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,364,590 | How to Plot a plot with multiple values?<p>Could anyone help me?</p>
<p>I need to draw a plot from the dataframe but I have no idea how to draw it. So my ideal plot look like this, which means each x-axis provides multiple values(and they absolutely can't be covered by each other).
<a href="https://i.stack.imgur.com/Tl... | <p>With the toy dataframe you provided, here is one way to do it:</p>
<pre class="lang-py prettyprint-override"><code># Prepare data for plotting
new_df = pd.concat(
[
pd.DataFrame(
{
"x": [i + j * 10 - 1 for i in range(1, len(df[col]) + 1)],
"value... | How to Plot a plot with multiple values? | python|pandas | 1 | 73 | 1 | 72,417,194 | 72,417,194 | 1 | true | 2022-05-24T14:20:09.487Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to Plot a plot with multiple values?<p>Could anyone help me?</p>
<p>I need to draw a plot from the dataframe but I have no idea how to draw it. So my ide... |
72,363,687 | how to bind policy to node in Chef?<p>I'm new to chef. Recently I'm studying policyfile in chef. But I can only find how to use testkitchen to run the policy, I'm doubting -- if the policy file can only be used in testing?
Is there any method to bind it to node like "knife node edit" binding roles to node?
Or... | <p>You can only have one policy assigned to a node at a given time in Chef, if you assign the node a policy.</p>
<p>Otherwise, you can set it like a node attribute on the node. The JSON below represents the policy name and policy group you would provide:</p>
<pre class="lang-json prettyprint-override"><code>{
"p... | how to bind policy to node in Chef? | chef-infra|chef-policyfile | 0 | 73 | 1 | 72,427,211 | 72,427,211 | 1 | true | 2022-05-24T13:22:50.817Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to bind policy to node in Chef?<p>I'm new to chef. Recently I'm studying policyfile in chef. But I can only find how to use testkitchen to run the policy... |
72,373,169 | Xcode's iPhone device simulator always prints letter A using AnyDesk<p>As the title says, I am currently using AnyDesk to remotely access a Mac computer, when typing in the simulator of an iphone xcode device, the keyboard prints all letters A, no matter what letter of the alphabet I type, it converts them all to lette... | <p>I had the same problem.
Click the keyboard icon on the top status bar of Anydesk\s window and then select "Auto".</p> | Xcode's iPhone device simulator always prints letter A using AnyDesk | ios|iphone|keyboard | 0 | 73 | 1 | 72,436,457 | 72,436,457 | 1 | true | 2022-05-25T07:00:45.023Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Xcode's iPhone device simulator always prints letter A using AnyDesk<p>As the title says, I am currently using AnyDesk to remotely access a Mac computer, whe... |
72,384,161 | WebFlux call with WebClient returning IllegalStateException Only one connection receive subscriber allowed<p>I'm using Webflux and WebClient to talk to another API</p>
<pre><code>suspend fun doSomething() : myResponse {
return webClient
.get()
.uri {
it.path("/some/path")
.qu... | <p>The <em>Only one connection receive subscriber allowed</em> is the key here.<br />
In my code, if I had:</p>
<pre><code>.onStatus
.bodyToMono
.onErrorResume
</code></pre>
<p>I found that meant that more subscribers were trying to receive the response, thus causing the problem.<br />
Try to simplify everything by s... | WebFlux call with WebClient returning IllegalStateException Only one connection receive subscriber allowed | rest|kotlin|spring-webflux|reactive | 0 | 73 | 1 | 72,633,631 | 72,633,631 | 1 | true | 2022-05-25T21:04:39.103Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
WebFlux call with WebClient returning IllegalStateException Only one connection receive subscriber allowed<p>I'm using Webflux and WebClient to talk to anoth... |
72,282,146 | How to separate the date, hour and timezone info using pandas?<p>I'm curious about how to use pandas to deal with this sort of info in a .csv file:</p>
<p>2022-08-11 11:50:01 America/Los_Angeles</p>
<p>My goal is to extract the date, hour and minute, and the timezone info for further analysis.</p>
<p>I have tried to li... | <p>pandas cannot handle a datetime column with different timezones. You can start by splitting the <code>datetime</code> and <code>timezone</code> in separate columns:</p>
<pre><code>df[['datetime', 'timezone']] = df['datetime'].str.rsplit(' ', n=1, expand=True)
df['datetime'] = pd.to_datetime(df['datetime']) # this co... | How to separate the date, hour and timezone info using pandas? | pandas|datetime|timestamp | 0 | 73 | 1 | 72,285,389 | 72,285,389 | 1 | true | 2022-05-18T00:54:46.017Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to separate the date, hour and timezone info using pandas?<p>I'm curious about how to use pandas to deal with this sort of info in a .csv file:</p>
<p>20... |
72,362,319 | How to fix cardinality error in my CNN model<p>I am currently working on a CNN model where my inputs are CSV's with 1080 rows and 4 attributes (columns). I have all the CSVs under their own categories directory, for example <code>/Category A/...</code>, <code>/Category B/...</code> etc.</p>
<p>At start I have created t... | <p>I used the following code to generate random data and was able to replicate the issue with it.</p>
<pre><code># Generating random X and y values
x=tf.random.uniform((1080,4,1))
X=[]
for i in range(510):
X.append(x)
y=tf.random.uniform((510,))
</code></pre>
<p>Reshape X to overcome the error as follows:</... | How to fix cardinality error in my CNN model | python|tensorflow|machine-learning|keras|conv-neural-network | 0 | 73 | 1 | 72,558,312 | 72,558,312 | 1 | true | 2022-05-24T11:45:37.993Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to fix cardinality error in my CNN model<p>I am currently working on a CNN model where my inputs are CSV's with 1080 rows and 4 attributes (columns). I h... |
72,392,195 | Does this manipulation in python save more time for my highly inefficient program?<p>I am using the following code unchanged in form but changed in content:</p>
<pre><code>import numpy as np
import matplotlib.pyplot as plt
import random
from random import seed
from random import randint
import math
from math import *
f... | <p>There are several issues in your code:</p>
<ul>
<li><strong>the mean is recomputed from scratch</strong> based on the growing array. Thus, the complexity of <code>mean(Black)-mean(White)</code> is <strong>quadratic</strong> to the number of elements.</li>
<li><strong>The <code>mean</code> function is not efficient</... | Does this manipulation in python save more time for my highly inefficient program? | python|performance|optimization|timing | 0 | 73 | 2 | 72,396,240 | 72,396,240 | 1 | true | 2022-05-26T12:57:25.250Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Does this manipulation in python save more time for my highly inefficient program?<p>I am using the following code unchanged in form but changed in content:<... |
72,370,870 | How to close a multiprocessing queue from a parent (consumer) process<p>Where using a multiprocessing queue to communicate between processes, many articles recommend sending a terminate message to the queue.
However, if a child process is the producer, if may fail expectedly, leaving the consumer without and notificati... | <p>If you are concerned about the <code>producer</code> process not completing normally, then I am not sure what your question is because your code as is should work except for a few corrections: (1) it is missing an <code>import</code> statement, (2) there is no call to <code>runProcess</code> and (3) your worker thre... | How to close a multiprocessing queue from a parent (consumer) process | python|multiprocessing|python-multiprocessing | 0 | 73 | 1 | 72,382,969 | 72,382,969 | 1 | true | 2022-05-25T00:41:47.770Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to close a multiprocessing queue from a parent (consumer) process<p>Where using a multiprocessing queue to communicate between processes, many articles r... |
72,293,115 | Searching and editing values in the heap of the current process in C<p>So in our university assignment we were asked to change the output of two sequential <code>printf("%s", s1); printf("%s", s2);</code> functions without touching the variables. The intent was for us to use the theoretical knowledg... | <p>Assuming that you are working on GNU/Linux using glibc, which is the most common setup, then you can make some assumptions that will help you solve the problem.</p>
<ol>
<li>As you say, both allocated chunks will reside into the same newly initialized (linear) heap, which usually spans multiple pages (several KBs). ... | Searching and editing values in the heap of the current process in C | c|malloc|heap-memory | 0 | 73 | 2 | 72,293,449 | 72,293,449 | 1 | true | 2022-05-18T16:50:21.110Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Searching and editing values in the heap of the current process in C<p>So in our university assignment we were asked to change the output of two sequential <... |
72,331,130 | Sorting a VARCHAR column with numbers and letters<p>I have a column that has numbers from 1 to 12, and also can include letters W, E, S. I want the column to sort numerically (1,2,3,4...) then list all records with a letter.</p>
<p>So, before I did anything the column was ordering like:</p>
<p>1, 10, 11, 12, 2, 3, 4, ... | <p>You can use a <em>case expression</em> to first split the results into 2 groups and order by that, then your existing condition:</p>
<pre><code>order by case when Total + 0 > 0 then 0 else 1 end, Total + 0;
</code></pre> | Sorting a VARCHAR column with numbers and letters | mysql | 3 | 73 | 1 | 72,331,213 | 72,331,213 | 1 | true | 2022-05-21T15:53:27.690Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sorting a VARCHAR column with numbers and letters<p>I have a column that has numbers from 1 to 12, and also can include letters W, E, S. I want the column t... |
72,323,449 | To retrieve data from list where it contains dictionary as its values (python)<p>I am newbie to python, trying to understand the concepts. I am trying to traverse a list, where inside list, I have kept dictionary data set which are initialized. I have defined function to traverse and the retrieve data.</p>
<p>Initially... | <p>It would be simple to do the following:</p>
<p>Create one dictionary from the list of dictionaries:</p>
<pre><code>dict1 = {k: v.split(", ") for x in vertebrateAnimalsDict for k, v in x.items()}
</code></pre>
<hr />
<h3>EDIT:</h3>
<p>Convert this to a series and explode (so each item in the list of values ... | To retrieve data from list where it contains dictionary as its values (python) | python-3.x|list|dictionary|traversal | 0 | 73 | 2 | 72,323,687 | 72,323,687 | 1 | true | 2022-05-20T18:34:03.807Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
To retrieve data from list where it contains dictionary as its values (python)<p>I am newbie to python, trying to understand the concepts. I am trying to tra... |
72,393,702 | spring boot - use https only if ssl.key-store file exists<p>I added these lines to application.properties:</p>
<pre><code>server.ssl.key-store: keystore.p12
server.ssl.key-store-password: 111111
server.ssl.keyStoreType: PKCS12
server.ssl.keyAlias: tomcat
</code></pre>
<p>How do I use HTTPS only if the server.ssl.key-st... | <p>I solved a compareable problem by setting those properties programatically. This mean, you could check if the key-store file exists before you start your application with
<code>SpringApplication.run(MyApplication.class, args);</code></p>
<p>Depending on whether the key-store exists or not you could build a new args-... | spring boot - use https only if ssl.key-store file exists | java|spring|spring-boot|https|keystore | 0 | 73 | 1 | 72,394,294 | 72,394,294 | 1 | true | 2022-05-26T14:46:15.703Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
spring boot - use https only if ssl.key-store file exists<p>I added these lines to application.properties:</p>
<pre><code>server.ssl.key-store: keystore.p12
... |
72,307,829 | Trying to supply PGPASS to Docker Image<p>New to Docker here. I'm trying to create a basic Dockerfile where I run a python script that runs some queries in postgres through psycopg2. I currently have a pgpass file setup in my environment variables so that I can run these tools without supplying a password in the code. ... | <p>It's better to pass your secrets into the container at runtime than it is to include the secret in the image at build-time. This means that the <code>Dockerfile</code> doesn't need to know anything about this value.</p>
<p>For example</p>
<pre class="lang-sh prettyprint-override"><code>$ export PGPASSWORD=<postgr... | Trying to supply PGPASS to Docker Image | python|postgresql|docker | 1 | 73 | 1 | 72,308,099 | 72,308,099 | 1 | true | 2022-05-19T16:10:43.723Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Trying to supply PGPASS to Docker Image<p>New to Docker here. I'm trying to create a basic Dockerfile where I run a python script that runs some queries in p... |
72,241,684 | How to compute the remaining free space or width of div?<p>I am looking for a way to compute the remaining width of a div after adding inner spans dynamically</p>
<p><a href="https://i.stack.imgur.com/5la5E.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5la5E.png" alt="enter image description here" ... | <p>This should do the trick:</p>
<p>It gets the rectangular coordinates of the last <code><span></code> using <code>yourSpan.getBoundingClientRect()</code>.. so the <code>right</code> property of the object returned describes the distance from the left side of the div... So if you know the parent <code>div</code>... | How to compute the remaining free space or width of div? | angular | 1 | 73 | 2 | 72,241,959 | 72,241,959 | 1 | true | 2022-05-14T15:33:28.597Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to compute the remaining free space or width of div?<p>I am looking for a way to compute the remaining width of a div after adding inner spans dynamicall... |
72,396,094 | Print custom error message using manually created exception class<p>I have a custom exception class as:</p>
<pre class="lang-py prettyprint-override"><code>class MyException(Exception):
pass
</code></pre>
<p>And I am invoking it as follows:</p>
<pre class="lang-py prettyprint-override"><code>class over():
def ... | <p>try this code:</p>
<p>class MyException(Exception):
"""
Catches the exception raised by MyClass
"""</p>
<pre><code>def __init__(self, message):
self.message = message
def __str__(self):
return self.message
</code></pre>
<p>class over():</p>
<pre><code>def check(self):
col1 ... | Print custom error message using manually created exception class | python|exception|custom-error-handling | 0 | 73 | 3 | 72,396,182 | 72,396,182 | 1 | true | 2022-05-26T17:55:44.703Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Print custom error message using manually created exception class<p>I have a custom exception class as:</p>
<pre class="lang-py prettyprint-override"><code>c... |
72,245,560 | mongodb.service dies after running some hours in Ubuntu<p>I have used mongodb(v3.6.8) for my server(Ubuntu 20.04), it works well for years. Recently,it be killed and failed to restart by systemd after running some days. I restart sysemd, it works for a few hours and dies again.
Refer to systemd status:</p>
<pre><code>... | <p>using dmesg -T show the reason why system kill mongodb(updated in question section), it's because "ot ouf memory".
Mongodb consumes 2486640kB while my server is 16 GB, so mongodb does not consume too high memory.</p>
<p>The failure is because other programs take too much memory, it's not mongodb problem</p... | mongodb.service dies after running some hours in Ubuntu | mongodb|ubuntu|systemd|linode | -1 | 73 | 2 | 72,246,735 | 72,246,735 | 1 | true | 2022-05-15T04:42:14.080Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
mongodb.service dies after running some hours in Ubuntu<p>I have used mongodb(v3.6.8) for my server(Ubuntu 20.04), it works well for years. Recently,it be ki... |
72,242,820 | Google Sheets Query using dependent dropdown<p>Initially I set up a query based on a search by month and year in a single dropdown using this formula</p>
<p><code>=QUERY(Haulage!A2:R, "SELECT * WHERE 1=1 "&IF(A2="All Months",""," AND LOWER(M) = LOWER('"&A2&"')&qu... | <p>Try</p>
<pre><code>=QUERY(Haulage!A2:R, "SELECT * WHERE " & if(A2="All","A is not null",if(left(A2,3)="All","(M) LIKE ('%"&SUBSTITUTE(A2,"All","")&"')","LOWER(M) = LOWER('"&A2&"') ")) , 1)
</code><... | Google Sheets Query using dependent dropdown | google-sheets-formula | 0 | 73 | 1 | 72,253,454 | 72,253,454 | 1 | true | 2022-05-14T18:12:40.857Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google Sheets Query using dependent dropdown<p>Initially I set up a query based on a search by month and year in a single dropdown using this formula</p>
<p>... |
72,369,469 | Sort axis aligned bounding boxes of meshes along a ray where each AABB is guaranteed to intersect the ray<p>How do I sort axis aligned bounding boxes along a ray where each AABB is guaranteed to intersect the ray?</p>
<p>I have tried to sort the centroid's be that doesn't work well. So is there another alternative?</p> | <p>You should sort by perpendicular distance from <code>ray_start</code> in <code>ray_direction</code> direction. That can be computed using simple <code>dot</code> product.</p>
<ol>
<li><p><strong>If the AABB do not intersect you can sort by</strong></p>
<pre><code>dot(BBOX_center-ray_start,ray_direction)
</code></pre... | Sort axis aligned bounding boxes of meshes along a ray where each AABB is guaranteed to intersect the ray | algorithm|sorting|bounding-box | 1 | 73 | 1 | 72,373,326 | 72,373,326 | 1 | true | 2022-05-24T21:06:16.533Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sort axis aligned bounding boxes of meshes along a ray where each AABB is guaranteed to intersect the ray<p>How do I sort axis aligned bounding boxes along a... |
72,296,311 | Concurrent Array Functions<p>I have a function that takes an array of sub-arrays containing number strings and returns an array with the highest number from each sub-array:</p>
<pre><code>const largestOfFour = arr => {
arr.map(e => {
e.sort((a,b) => b - a).splice(1);
});... | <p>There is no concurrency in JavaScript. But your <code>map</code> callback does not return anything (there is no <code>return</code> in the statement block) so <code>.map()</code> returns an array of undefined values.</p>
<p>To avoid that the original data gets mutated, I would also avoid the use of <code>sort</code>... | Concurrent Array Functions | javascript|arrays|algorithm|array.prototype.map|sub-array | 0 | 73 | 2 | 72,296,404 | 72,296,404 | 1 | true | 2022-05-18T21:39:55.220Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Concurrent Array Functions<p>I have a function that takes an array of sub-arrays containing number strings and returns an array with the highest number from ... |
72,259,675 | How to edit QML PathPolyLine path property?<p>I have an issue with QML PathPolyLine "path" property.
In documentation it said that:</p>
<blockquote>
<p>It can be a JS array of points constructed with Qt.point()</p>
</blockquote>
<p>Does it mean I can work with it like with JS array?</p>
<p>Here is an example ... | <p>There isn't any secrets, really, just initialize a new JS array and <code>push()</code> items based on <code>Qt.point()</code>.</p>
<p>It's easier to test if it's working or not using a valid data range and displaying it for visualization purposes:</p>
<pre><code>import QtQuick 2.15
import QtQuick.Window 2.15
import... | How to edit QML PathPolyLine path property? | arrays|qt|qml|alias | 1 | 73 | 1 | 72,265,942 | 72,265,942 | 1 | true | 2022-05-16T13:02:06.910Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to edit QML PathPolyLine path property?<p>I have an issue with QML PathPolyLine "path" property.
In documentation it said that:</p>
<blockquote... |
72,373,910 | Map through array of arrays, to find id and change object<p>I have an array of ids <code>['id1', 'id3']</code>.</p>
<p>I also have an array of <code>items</code>:</p>
<pre><code>[
{
children: [{
children: [{
id: "id1", //This is value I need to find
... | <p>I think you can use recursive function something like below :</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>let ids = ["id1", "id2"];
let arrayOfItems = [
{
children... | Map through array of arrays, to find id and change object | javascript|arrays|reactjs | 1 | 73 | 1 | 72,374,121 | 72,374,121 | 1 | true | 2022-05-25T07:58:09.013Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Map through array of arrays, to find id and change object<p>I have an array of ids <code>['id1', 'id3']</code>.</p>
<p>I also have an array of <code>items</c... |
72,326,131 | Is there any other way of code for the methods? It asks for user input n times based on a certain number<p>I'm making this Study Schedule program and a part of it is where I ask how many Subjects does the user have, and then they say (for example) 5. Based on that number of subjects it will ask "What is the name o... | <pre><code>public String SubjectName1;
public String SubjectName2;
public String SubjectName3;
public String SubjectName4;
public String SubjectName5;
public String SubjectName6;
</code></pre>
<p>Could be an array of Strings:</p>
<pre><code>String[] SubjectName = new String[6];
</code></pre>
<p>Also:</p>
<pre><code> pu... | Is there any other way of code for the methods? It asks for user input n times based on a certain number | java|input|simplify | -1 | 73 | 2 | 72,326,158 | 72,326,158 | 1 | true | 2022-05-21T01:58:20.707Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there any other way of code for the methods? It asks for user input n times based on a certain number<p>I'm making this Study Schedule program and a part ... |
72,397,001 | Make columns within a list in HTML/CSS<p>I have an unordered list in which I am displaying some objects. These objects have multiple attributes which I want to display. I made this in Python Flask and jinja.</p>
<pre><code><li class="list-group-item">
<a href="link">{{candida... | <p>To get things started, replace all of your CSS with this:</p>
<pre><code>.list-group-item {
display: grid;
grid-template-columns: repeat(5, auto);
align-items: center;
}
</code></pre>
<p><code>grid-template-columns</code> defines the width of the 5 columns, so to start with you'll find your columns don't line ... | Make columns within a list in HTML/CSS | html|css|flask | 0 | 73 | 1 | 72,397,092 | 72,397,092 | 1 | true | 2022-05-26T19:23:16.287Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Make columns within a list in HTML/CSS<p>I have an unordered list in which I am displaying some objects. These objects have multiple attributes which I want ... |
72,258,291 | how to fix hamming weight invariants<p>I am learning Dafny, attempting to write a specification for the hamming weight problem, aka the number of 1 bits in a number. I believe I have gotten the specification correct, but it still doesn't verify. For speed of verification I limited it to 8 bit numbers;
problem definitio... | <p>After playing around, I did find a version which passes though it required reworking <code>countOneBits()</code> so that its recursion followed the order of iteration:</p>
<pre class="lang-dafny prettyprint-override"><code>function countOneBits(n:bv8, i: int, j:int): bv8
requires i ≥ 0 ∧ i ≤ j ∧ j ≤ 8
decreases ... | how to fix hamming weight invariants | bit-manipulation|dafny|loop-invariant | 1 | 73 | 1 | 72,537,583 | 72,537,583 | 1 | true | 2022-05-16T11:12:42.570Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to fix hamming weight invariants<p>I am learning Dafny, attempting to write a specification for the hamming weight problem, aka the number of 1 bits in a... |
72,401,162 | how to make the radio button list text is NOT below the radio button?<p>I am using visual studio 2013 and use the radio button list in ASP.Net. Im having problem with the text which it's not in line with the button. <a href="https://i.stack.imgur.com/DtGoY.png" rel="nofollow noreferrer">This is what I got</a> and <a hr... | <p>So,I try to use this in asp.net</p>
<pre><code> <div class="col-sm-8">
<asp:RadioButtonList ID="rblHalfday" runat="server" Visible="false" RepeatDirection="Horizontal" RepeatLayout="Table" RepeatColumns="2" CssClass="mylist"... | how to make the radio button list text is NOT below the radio button? | asp.net|visual-studio|radiobuttonlist | 0 | 73 | 1 | 72,401,817 | 72,401,817 | 1 | true | 2022-05-27T06:11:47.493Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to make the radio button list text is NOT below the radio button?<p>I am using visual studio 2013 and use the radio button list in ASP.Net. Im having pro... |
72,371,452 | Can't deploy firestore cloud functions<p>I am trying to integrate Elastic Search in my Flutter app. I am trying to deploy a few functions but nothing seems to work.</p>
<p>here is my index.js code:</p>
<pre><code>const functions = require('firebase-functions');
const admin = require('firebase-admin');
const { Client } ... | <p>Your elastic search package is not installed successfully.
Make sure you are in the '<em><strong>functions</strong></em>' directory when you run <strong>npm i @elastic/elasticsearch</strong> command.
Also you can grab the latest version of your package from npm and add it to your package.json manually if the issue p... | Can't deploy firestore cloud functions | javascript|elasticsearch|google-cloud-functions | 0 | 73 | 1 | 72,371,498 | 72,371,498 | 1 | true | 2022-05-25T02:45:14.363Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can't deploy firestore cloud functions<p>I am trying to integrate Elastic Search in my Flutter app. I am trying to deploy a few functions but nothing seems t... |
72,389,994 | pandas multiIndex pair only for top and bottom n rows<p>I have a pandas dataframe like as shown below</p>
<pre><code>Company,year
T123 Inc Ltd,1990
T124 PVT ltd,1991
T345 Ltd,1990
T789 Pvt.LTd,2001
ABC Limited,1992
ABCDE Ltd,1994
ABC Ltd,1997
ABFE,1987
Tesla ltd,1995
AMAZON Inc,2001
A... | <p>A possible solution using <code>Series.rolling</code> with <code>center=True</code> and window size <code>11</code> (<code>=5+1+5</code>) on <code>Company</code> and then exclude the tuples with the middle row:</p>
<pre><code>from itertools import chain, product
idx = pd.MultiIndex.from_tuples(chain(*(product([row]... | pandas multiIndex pair only for top and bottom n rows | python|pandas|dataframe|numpy|multi-index | 1 | 73 | 2 | 72,391,140 | 72,391,140 | 1 | true | 2022-05-26T09:57:21.760Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pandas multiIndex pair only for top and bottom n rows<p>I have a pandas dataframe like as shown below</p>
<pre><code>Company,year ... |
72,246,416 | How to output a Multiline Character Image in the console<p>I am developing a text-based game and I want to make the title something catchy. I tried to use a text to ASCII converter to make a nice-looking title and then copy and paste it in my code to output it, but it didn't work.</p>
<p>Here is what I tried to do:</p>... | <h3>String literals</h3>
<p><a href="https://docs.oracle.com/javase/specs/jls/se15/html/jls-3.html#jls-3.10.5" rel="nofollow noreferrer">String literal</a> - is a string consists of zero or more characters enclosed in double quotes <code>"myText"</code>.</p>
<p>It is not possible to create a multiline string ... | How to output a Multiline Character Image in the console | java|string|ascii|java-text-blocks | 3 | 73 | 1 | 72,247,090 | 72,247,090 | 1 | true | 2022-05-15T07:46:17.143Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to output a Multiline Character Image in the console<p>I am developing a text-based game and I want to make the title something catchy. I tried to use a ... |
72,288,793 | How to return a value from try, catch, and finally by using condition?<p>My <code>get()</code> method is being marked with a red line, it tells me</p>
<blockquote>
<p>this method must return a result of type char</p>
</blockquote>
<pre><code>public char get() {
mutex.lock();
char c = buffer[out];
try {
... | <p>Your code should cover all the possible scenario. Now it doesn't because you're not returning from the method if exception occur.</p>
<p>The <code>return</code> statement placed inside the <code>try</code> will be unreachable in case of exception.</p>
<p><em>For more information on Exception-handling, I suggest to h... | How to return a value from try, catch, and finally by using condition? | java|exception|conditional-statements|try-catch|return-value | 0 | 73 | 2 | 72,289,162 | 72,289,162 | 1 | true | 2022-05-18T11:58:28.320Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to return a value from try, catch, and finally by using condition?<p>My <code>get()</code> method is being marked with a red line, it tells me</p>
<block... |
72,251,321 | Sequelize: Optional limit parameter<p>I've seen a few questions on optional where clauses and order params, both of which I can implement, but I was wondering how to have an optional <code>limit</code> parameter? Maybe I'm missing something easy, but I can't see anything obvious in the docs</p>
<p>If I specify it like ... | <p>You can simply define <code>findAll</code> options outside <code>findAll</code> call and add <code>limit</code> prop optionally only if you have a value in <code>req.query.limit</code>:</p>
<pre class="lang-js prettyprint-override"><code>const options = {
}
if (req.query.limit) {
options.limit = req.query.limit
}
... | Sequelize: Optional limit parameter | javascript|sequelize.js | 0 | 73 | 1 | 72,251,367 | 72,251,367 | 2 | true | 2022-05-15T18:54:35.930Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sequelize: Optional limit parameter<p>I've seen a few questions on optional where clauses and order params, both of which I can implement, but I was wonderin... |
72,274,380 | How to cast an Object to Map (without using 'as')?<p>Variable 'valor' is of type 'Object'.</p>
<p>'valor' stores a 'Map<String, String>'.</p>
<p>I can 'convert' valor to a Map using:</p>
<pre><code>var json = valor as Map<String, String>;
</code></pre>
<p>The question is: Can I do the same thing without usi... | <p>You can cast without an <em>explicit</em> <code>as</code>, by going through dynamic.</p>
<pre class="lang-dart prettyprint-override"><code>dynamic dynamicValue = valor; // Valid up-cast.
Map<String, String> map = dynamicValue; // Implicit down-cast.
</code></pre>
<p>The implicit downcast is effectively an <cod... | How to cast an Object to Map (without using 'as')? | dart | 1 | 73 | 3 | 72,280,596 | 72,280,596 | 2 | true | 2022-05-17T12:49:59.157Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to cast an Object to Map (without using 'as')?<p>Variable 'valor' is of type 'Object'.</p>
<p>'valor' stores a 'Map<String, String>'.</p>
<p>I can ... |
72,329,245 | Absolute of number in brainfuck<p>How would you go about getting the absolute of a number in brainfuck?
I originally thought squaring the number (<code>[->+>+<<]>>[-<<+>>]<<[>[->+>+<<]>>[-<<+>>]<<<-]</code>) and square rooting it would work, ... | <p>One way to compute the absolute of a number is to identify its sign. If you know how your program represents negative numbers, there is a <a href="https://www.reddit.com/r/brainfuck/comments/kaf2eo/how_do_i_check_if_a_number_is_positive/gf9yf0n/" rel="nofollow noreferrer">reddit answer</a> by <a href="https://www.re... | Absolute of number in brainfuck | brainfuck | 2 | 73 | 2 | 72,329,498 | 72,329,498 | 2 | true | 2022-05-21T11:46:04.603Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Absolute of number in brainfuck<p>How would you go about getting the absolute of a number in brainfuck?
I originally thought squaring the number (<code>[->... |
72,341,861 | How to split and move the column?<p>I rotate the table with transpose(). Then I check and change every element with transform() and transformer(). The problem is with transformer():
I divided the first row. The second part (phone numbers) stays in the first row. The first (names) part is moved to the third row. The pro... | <p>Maybe I'm missing something but this feels a bit too complicated?</p>
<p>Couldn't you do just something like this:</p>
<pre><code>from tabulate import tabulate
table = [["Smith, О.А.|00-07-16", "cazirko51@yandex.ru", "cazirko51@yandex.ru"],
["Brian, С.Е.|12-07-15", &... | How to split and move the column? | python | 1 | 73 | 1 | 72,348,567 | 72,348,567 | 2 | true | 2022-05-22T23:06:25.627Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to split and move the column?<p>I rotate the table with transpose(). Then I check and change every element with transform() and transformer(). The proble... |
72,340,253 | How to execute bash variable with double quotes and get the output in realtime<p>I have a variable that has a command that I want to run.
It has a bunch of double-quotes. when I echo it, it looks beautiful.</p>
<p>I can copy-paste it and run it just fine.</p>
<p>I tried simply <code>$cmd</code>, but it doesn't work. I... | <p>In your array version, double quotes escaped by a backslash become part of the arguments, which is not intended.</p>
<p>So removing backslashes should fix the issue.</p> | How to execute bash variable with double quotes and get the output in realtime | bash | 0 | 73 | 1 | 72,355,066 | 72,355,066 | 2 | true | 2022-05-22T18:24:27.383Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to execute bash variable with double quotes and get the output in realtime<p>I have a variable that has a command that I want to run.
It has a bunch of d... |
72,355,143 | How to count duplicates in Pandas?<p>I use this pattern to find duplicates in column A from set <code>duplicates</code>:</p>
<pre><code>duplicates = {1, 2, 3}
df[~df['A'].isin(duplicates)]
</code></pre>
<p>It works and returns me rows witout duplicates. But how to get count of duplicates?</p>
<p>I have tried these:</p>... | <pre><code>new_df = df[~df['A'].isin(duplicates)]
new_df['duplicate_values'] = new_df.duplicated('A')
new_df['duplicate_values'].sum()
</code></pre> | How to count duplicates in Pandas? | python|pandas | 0 | 73 | 1 | 72,355,173 | 72,355,173 | 2 | true | 2022-05-23T21:49:08.820Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to count duplicates in Pandas?<p>I use this pattern to find duplicates in column A from set <code>duplicates</code>:</p>
<pre><code>duplicates = {1, 2, 3... |
72,384,023 | Terraform data block only if it is dev env<p>I am trying to get the list of users in an IAM group. The group only exists in dev account and not prod</p>
<pre><code># lookup for user accounts in Developers group only if its dev env
data "aws_iam_group" "developers" {
count = var.profile == "d... | <p>Since you are using <code>count</code> for <code>aws_iam_group</code>, this will transform this resource into an array of resources. If you want to iterate over it and access certain item, you would want to use the <a href="https://www.terraform.io/language/expressions/splat" rel="nofollow noreferrer"><code>splat</c... | Terraform data block only if it is dev env | terraform|terraform-provider-aws | 0 | 73 | 2 | 72,384,179 | 72,384,179 | 2 | true | 2022-05-25T20:50:47.627Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Terraform data block only if it is dev env<p>I am trying to get the list of users in an IAM group. The group only exists in dev account and not prod</p>
<pre... |
72,392,368 | The operand can't be null, so the condition is always true. Remove the condition<p>I keep getting this warning and I am unsure how to resolve it. Help if u can please
Below is the excerpt of the code</p>
<pre><code>String imageUrl = '';
CircleAvatar(
backgroundColor: Colors.white70,
backgroundImage: imageUrl... | <p>You are getting this warning because you are declaring your variable <strong>"imageUrl"</strong> with and empty String.</p>
<p><strong>Note: Empty string and null both are not same they are different. So, to get rid of this warning you have to make your variable nullable like this</strong></p>
<pre><code>S... | The operand can't be null, so the condition is always true. Remove the condition | flutter|dart|dart-null-safety | 0 | 73 | 1 | 72,392,422 | 72,392,422 | 2 | true | 2022-05-26T13:10:02.980Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The operand can't be null, so the condition is always true. Remove the condition<p>I keep getting this warning and I am unsure how to resolve it. Help if u c... |
72,387,958 | Update progress bar from thread monitoring CPU activity<p>I am getting this error from my code:</p>
<pre class="lang-none prettyprint-override"><code>RuntimeWarning: MetaObjectBuilder::addMethod: Invalid method signature provided for "CPU_VALUE"
self.threadclass.CPU_VALUE.connect(SIGNAL('CPU_VALUE'), self.U... | <p>Your example has several problems. Firstly, you are mixing old-style and new-style signals, which is confusing and unnecessary. Old-style signals should never be used in new applications. Secondly, you are using a signal object (<code>CpuSignal</code>), which is unnecessary since signals can be directly defined on t... | Update progress bar from thread monitoring CPU activity | python|multithreading|cpu-usage|pyside2|qprogressbar | 1 | 73 | 1 | 72,396,642 | 72,396,642 | 2 | true | 2022-05-26T07:00:22.783Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Update progress bar from thread monitoring CPU activity<p>I am getting this error from my code:</p>
<pre class="lang-none prettyprint-override"><code>Runtime... |
72,398,983 | Python - using metaclass & class attributes in object instances<p>I have a number of classes that inherit a common one. I need the parent class to keep track of a bunch of dependencies/relationships that are defined at the class level. Something like:</p>
<pre><code>class Meta(type):
ALLDEPENDENCIES = {}
def __... | <p>Meta describes <code>how</code> to create class but not <code>what</code> class that will be.</p>
<p><code>Meta</code> != <code>Parent</code> with inherited attributes</p>
<p>So you have to pass proper attributes into new class:</p>
<pre class="lang-py prettyprint-override"><code>class Meta(type):
_a = {}
de... | Python - using metaclass & class attributes in object instances | python|metaclass|class-attributes | 1 | 73 | 2 | 72,399,497 | 72,399,497 | 2 | true | 2022-05-26T23:22:31.823Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python - using metaclass & class attributes in object instances<p>I have a number of classes that inherit a common one. I need the parent class to keep track... |
72,394,937 | RSI in spyder using data in excel<p>So I have an excel file containing data on a specific stock.</p>
<p>My excel file contains about 2 months of data, it monitors the Open price, Close price, High Price, Low Price and Volume of trades in 5 minute intervals, so there are about 3000 rows in my file.</p>
<p>I want to calc... | <p>I have two solutions to this. One is to loop through each group, then add the relevant data to the <code>summary_table</code>, the other is to calculate the whole series and set the <code>RSI</code> column as this.</p>
<p>I first recreated the data:</p>
<pre><code>import yfinance
import pandas as pd
# initially cr... | RSI in spyder using data in excel | python|excel|spyder|finance|trading | 1 | 73 | 1 | 72,405,176 | 72,405,176 | 2 | true | 2022-05-26T16:17:13.183Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
RSI in spyder using data in excel<p>So I have an excel file containing data on a specific stock.</p>
<p>My excel file contains about 2 months of data, it mon... |
72,399,044 | SQL Union horizontally without common key<p>I have two tables in BigQuery.</p>
<p><strong>TABLE1:</strong></p>
<pre><code>| timestamp | FIELD1 | FIELD2 | ...
| 12345678 | 000000 | 000000 | ...
| 00154789 | 000000 | 000000 | ...
</code></pre>
<p><strong>TABLE2:</strong></p>
<pre><code>| temperature |
| 1000000000 |
|... | <p>Referred to this <a href="https://learnsql.com/blog/join-tables-without-common-column/" rel="nofollow noreferrer">site</a>, posting this as wikianswer.</p>
<p>You may want to try these queries with desired result.</p>
<p>Cross-join approach:</p>
<pre><code>with table1 as (
select 12345678 as timestmp, 000000 as fi... | SQL Union horizontally without common key | sql|google-bigquery | 0 | 73 | 1 | 72,400,755 | 72,400,755 | 2 | true | 2022-05-26T23:32:44.977Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL Union horizontally without common key<p>I have two tables in BigQuery.</p>
<p><strong>TABLE1:</strong></p>
<pre><code>| timestamp | FIELD1 | FIELD2 | ...... |
72,326,433 | Replace With Next Largest Number<p>I need to write a function that replaces each number with the next highest number in the list.
<br>Say we have the list<code>[5, 7, 3, 2, 8]</code>.
The <code>5</code> gets replaced by the <code>7</code> and the list becomes <code>[7, 5, 3, 2, 8]</code>.<br>
After that, we switch the ... | <p>Based on your desired result, you can sort the list, then do a lookup that finds pairs the numbers with the next largest. With that you can just replace the items in the list. By zipping the values as pairs, the greatest value will not have an entry. You can use this to replace it with <code>-1</code> when you try t... | Replace With Next Largest Number | python|arrays|algorithm|loops|sorting | 0 | 73 | 1 | 72,326,534 | 72,326,534 | 2 | true | 2022-05-21T03:25:41.683Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Replace With Next Largest Number<p>I need to write a function that replaces each number with the next highest number in the list.
<br>Say we have the list<co... |
72,340,099 | SQL: Give up/return different result if too many rows<p>Short version, I have a SQL statement where I only want the results <em>if</em> the number of rows returned is less than some value (say 1000) and otherwise I want a different result set. What's the best way to do this without incurring the overhead of returning t... | <pre class="lang-sql prettyprint-override"><code>WITH max1000 AS (
SELECT the_row, count(*) OVER () AS total
FROM (
SELECT the_row -- named row type
FROM T AS the_row
WHERE updated_at > timestamp
AND name <= 'Michael'
ORDER BY name
LIMIT 1001
) sub
)
SE... | SQL: Give up/return different result if too many rows | sql|postgresql|count|limit | 0 | 73 | 1 | 72,341,883 | 72,341,883 | 2 | true | 2022-05-22T18:02:16.283Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL: Give up/return different result if too many rows<p>Short version, I have a SQL statement where I only want the results <em>if</em> the number of rows re... |
72,313,189 | Data Annotation model validation for Required attribute<p>In my web api project, I have this code which uses Data Annotation Required attribute to validate. But when I test it using Postman, it can still go through.</p>
<pre><code> public async Task<ActionResult> IsAccountClosed([Required] string nric)
{
... | <blockquote>
<p>In my web api project, I have this code which uses Data Annotation Required attribute to validate. But when I test it using Postman, it can still go through?</p>
</blockquote>
<p>The <code>[Required]</code> attribute allows you to use <code>ModelState.IsValid</code> construct. As model binding and model... | Data Annotation model validation for Required attribute | c#|asp.net-core | 0 | 73 | 1 | 72,313,368 | 72,313,368 | 2 | true | 2022-05-20T03:13:35.890Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Data Annotation model validation for Required attribute<p>In my web api project, I have this code which uses Data Annotation Required attribute to validate. ... |
72,267,828 | pglm doesn't use any variables from local environment<p>I am writing some re-usable (hopefully) R code, and part of it is a pglm helper function:</p>
<pre><code>pglm_helper <- function(family, fmla, fixed_effect, tbl) {
pglm::pglm(
fmla,
family=family,
data=tbl,
effect="individual",
m... | <p>Using the debugger helps to understand the cause of the error.<br />
<code>pglm()</code> calls an internal function <code>starting.values()</code> which calls :</p>
<pre><code>eval(startcl, parent.frame())
</code></pre>
<p>where <code>startcl</code> is the original expression:</p>
<pre><code>pglm::pglm(
cites ~
... | pglm doesn't use any variables from local environment | r|environment|lm | 3 | 73 | 1 | 72,327,094 | 72,327,094 | 2 | true | 2022-05-17T03:19:48.840Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pglm doesn't use any variables from local environment<p>I am writing some re-usable (hopefully) R code, and part of it is a pglm helper function:</p>
<pre><c... |
72,313,352 | Timing a class function in C++<p>A previous post, <a href="https://stackoverflow.com/questions/31391914/timing-in-an-elegant-way-in-c">Timing in an elegant way in C</a>, showed a neat method for profiling using a wrapper function. I am trying to use one of the profiler to profile my class functions.</p>
<pre><code>#inc... | <p>You can use <a href="https://en.cppreference.com/w/cpp/utility/functional/bind" rel="nofollow noreferrer"><strong><code>std::bind</code></strong></a> to create a callable object for invoking a class method on a class object.</p>
<p>Then you can pass this callable to your <code>profile</code> function as you would pa... | Timing a class function in C++ | c++|templates|profiling|rvalue-reference | 1 | 73 | 1 | 72,313,480 | 72,313,480 | 2 | true | 2022-05-20T03:44:21.640Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Timing a class function in C++<p>A previous post, <a href="https://stackoverflow.com/questions/31391914/timing-in-an-elegant-way-in-c">Timing in an elegant w... |
72,381,138 | Random ABCD char generator<p>I am making a quiz game and want when the player calls his friend(which is a simple cout), the program prints a random char of an answe(A, B, C or D) and a random number to present how sure he is(from 1 to 100). Whetever I try the char in console is always D, and the number is always 87. I ... | <p>Random numbers generation is not as simple as you might think.<br />
See here some general info: <a href="https://en.wikipedia.org/wiki/Random_number_generation" rel="nofollow noreferrer">Random number generation - Wikipedia</a>.</p>
<p>In order to use <a href="https://en.cppreference.com/w/c/numeric/random/rand" re... | Random ABCD char generator | c++|random|char|numbers | 0 | 73 | 1 | 72,381,399 | 72,381,399 | 2 | true | 2022-05-25T16:16:23.430Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Random ABCD char generator<p>I am making a quiz game and want when the player calls his friend(which is a simple cout), the program prints a random char of a... |
72,259,405 | pandas evaluating strings as numeric<p>assume df as;</p>
<pre><code>data = {'duration':['1week 3day 2hour 4min 23', '2hour 4min 23sec', '2hour 4min', np.nan, '', '23sec']}
df = pd.DataFrame(data)
</code></pre>
<p>I'm trying to calculate the duration as sum of seconds. Replaced the values as:</p>
<pre><code>df['duration... | <p>You can use a regex combined to a custom function to replace weeks by 7 days and add seconds on lonely numbers (you can add other units). Then convert <a href="https://pandas.pydata.org/docs/reference/api/pandas.to_timedelta.html" rel="nofollow noreferrer"><code>to_timedelta</code></a>:</p>
<pre><code>def change_uni... | pandas evaluating strings as numeric | python|pandas|eval | 1 | 73 | 2 | 72,259,546 | 72,259,546 | 2 | true | 2022-05-16T12:43:55.490Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pandas evaluating strings as numeric<p>assume df as;</p>
<pre><code>data = {'duration':['1week 3day 2hour 4min 23', '2hour 4min 23sec', '2hour 4min', np.nan,... |
72,328,526 | JS Date doesn't react to DST change<p>I have tested <code>new Date()</code> in the console and the return value doesn't depend on <a href="https://en.wikipedia.org/wiki/Daylight_saving_time" rel="nofollow noreferrer">DST</a>.
But my PC's clock does.
<a href="https://i.stack.imgur.com/h6UIp.png" rel="nofollow noreferrer... | <p>JavaScript is doing the right thing. However, most browsers (Chrome, etc.) will only detect a change to Window's "Adjust for daylight saving time automatically" setting when all browser windows are closed and the browser is restarted.</p>
<p>That said, my best advice is that you should never turn the &quo... | JS Date doesn't react to DST change | javascript|datetime|timezone|dst|timezone-offset | 0 | 73 | 1 | 72,342,700 | 72,342,700 | 2 | true | 2022-05-21T10:01:54.420Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JS Date doesn't react to DST change<p>I have tested <code>new Date()</code> in the console and the return value doesn't depend on <a href="https://en.wikiped... |
72,385,918 | How to calculate Big O time complexity for while loops<p>I am having trouble understanding how while loops affect the Big O time complexity.</p>
<p>For example, how would I calculate the time complexity for the code below?
Since it has a for loop that traverses through each element in the array and two nested while loo... | <p>There is best case, average case, and worst case.</p>
<p>I'm going to have to assume there is something that constrains the two <code>while</code> loops so that neither iterates more than <code>n</code> times, where <code>n</code> is the number of elements in the array.</p>
<p>In the best case, you have O(n). That ... | How to calculate Big O time complexity for while loops | java|for-loop|while-loop|big-o | 0 | 73 | 3 | 72,386,244 | 72,386,244 | 2 | true | 2022-05-26T02:04:37.837Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to calculate Big O time complexity for while loops<p>I am having trouble understanding how while loops affect the Big O time complexity.</p>
<p>For examp... |
72,301,617 | Map duplicate rows in Pandas dataframe by vlalue of a column?<p>In a dataframe with 2 columns <code>[id][string]</code>, I need to know which lines are duplicates of which lines based on the value of the column <code>[string]</code>.
My dataframe has thousands of rows but only 2 columns.</p>
<p><strong>Sample of the in... | <p>I'd use groupby and a listcomp.</p>
<pre><code>>>> df
id string
0 0 A B C D
1 1 D B C D E Z
2 2 A B C D
3 3 Z Z Z Z Z Z Z Z Z Z Z Z
4 4 D B C D E Z
5 5 A B C D
>>>
>>> [l for l in... | Map duplicate rows in Pandas dataframe by vlalue of a column? | python|python-3.x|pandas|dataframe | 1 | 73 | 3 | 72,301,810 | 72,301,810 | 3 | true | 2022-05-19T09:03:03.363Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Map duplicate rows in Pandas dataframe by vlalue of a column?<p>In a dataframe with 2 columns <code>[id][string]</code>, I need to know which lines are dupli... |
72,348,433 | Assembly 64 bits function a*b+c/d-(e-f)%(g+h)<p>I need to solve this function in assembly but I have a problem with modulo. I have no idea why but it gives very strange results.</p>
<p>C++ code</p>
<pre class="lang-cpp prettyprint-override"><code>#include <iostream>
extern "C" __int64 suma(int a, int b,... | <p>Not sure if this is what you want, but when you have to write something in assembly, it is often a good idea to first have a look at what the compiler produces.</p>
<p>I'm not sure why you have an <code>__int64</code> return type when you assign it anyway to an <code>int</code>, but I'll respect your given function ... | Assembly 64 bits function a*b+c/d-(e-f)%(g+h) | assembly|x86-64 | 0 | 73 | 1 | 72,366,223 | 72,366,223 | 3 | true | 2022-05-23T12:21:24.247Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Assembly 64 bits function a*b+c/d-(e-f)%(g+h)<p>I need to solve this function in assembly but I have a problem with modulo. I have no idea why but it gives v... |
72,373,266 | JSON_EXTRACT_PATH_TEXT equivalent in python?<p>SQL has a very useful function called JSON_EXTRACT_PATH_TEXT, which allows to extract data from a json file just by providing the full json path.</p>
<p>What is the easiest way to achieve the same result in python?</p>
<p>I am particularly interested in pandas solutions: <... | <p>I'm not familiar with anything that does this out of the box, but it is fairly simple to do. try something like this:</p>
<pre><code>from functools import reduce
class JsonPath:
@classmethod
def get(cls, data, path):
return reduce(cls._get_item, path, data)
@classmethod
def _get_item(cls, ... | JSON_EXTRACT_PATH_TEXT equivalent in python? | python|sql|json|pandas | 0 | 73 | 1 | 72,373,742 | 72,373,742 | 3 | true | 2022-05-25T07:08:22.693Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JSON_EXTRACT_PATH_TEXT equivalent in python?<p>SQL has a very useful function called JSON_EXTRACT_PATH_TEXT, which allows to extract data from a json file ju... |
72,253,869 | Shouldn't there be a copy ctor invocation here? Elision disabled (no named return value optimization)<pre><code>struct Test {
int field = 30;
Test() { cout << "In ctor" << endl; }
Test(const Test &other) { field = other.field; cout << "In copy ctor" << endl; }... | <H4>C++17</H4>
<p>Starting from C++17, there is <a href="https://en.cppreference.com/w/cpp/language/copy_elision#Mandatory_elision_of_copy/move_operations" rel="nofollow noreferrer">mandatory copy elison</a> which says:</p>
<blockquote>
<p>Under the following circumstances, the compilers are required to omit the copy a... | Shouldn't there be a copy ctor invocation here? Elision disabled (no named return value optimization) | c++|move|copy-constructor|copy-elision|nrvo | 2 | 73 | 1 | 72,254,000 | 72,254,000 | 3 | true | 2022-05-16T03:20:23.367Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Shouldn't there be a copy ctor invocation here? Elision disabled (no named return value optimization)<pre><code>struct Test {
int field = 30;
Test() ... |
72,353,935 | Find array element that is true for ALL elements in the second array<p>I'm trying to find the smallest common multiple from one array by comparing it to the values in the other by using <code>% num === 0</code>. The answer should be 6, but because each number in the first array is true at least once, they all get retu... | <p>You need loop over the <code>x</code> array and return the first element that gets divided by <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every" rel="nofollow noreferrer"><code>every</code></a> value in <code>arr</code>.</p>
<p><div class="snippet" data-lang="js" d... | Find array element that is true for ALL elements in the second array | javascript|arrays | 1 | 73 | 4 | 72,354,002 | 72,354,002 | 3 | true | 2022-05-23T19:34:05.257Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find array element that is true for ALL elements in the second array<p>I'm trying to find the smallest common multiple from one array by comparing it to the ... |
72,325,697 | Create an awk script to generate a new column in a dataset?<p>I am working on the following dataset and I would like to create an awk script to make an arithmetic operation between with other columns and add the result of each record in a new column that could be called "Survival Percentage" with only 2 decim... | <p>Considering your samples and shown attempts here is the <code>awk</code> code which you can try. Which removes Control M characters(which we found out in comments) and this also checks that your 6th, 7th and 4th columns should be integers/floats etc and nothing else, try it out once.</p>
<pre><code>awk '
BEGIN { FS... | Create an awk script to generate a new column in a dataset? | ubuntu|awk | 1 | 73 | 1 | 72,325,961 | 72,325,961 | 3 | true | 2022-05-20T23:51:38.953Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create an awk script to generate a new column in a dataset?<p>I am working on the following dataset and I would like to create an awk script to make an arith... |
72,360,539 | How to filter rows by custom function Pandas?<p>I have a custom regex Python function that checks is it email or not:</p>
<pre><code>def isEmail(str):
return True;
</code></pre>
<p>I want to iterate all rows in Pandas dataframe and validate the column <code>email</code>. and return count ofvalid rows (true/false).</p... | <p>you can find the answer here George</p>
<p><a href="https://stackoverflow.com/questions/55463399/is-it-possible-to-use-a-custom-filter-function-in-pandas">Is it possible to use a custom filter function in pandas?</a></p>
<p>you can try adding a global counter inside the <code>is_email()</code> function to count how ... | How to filter rows by custom function Pandas? | python|pandas | 1 | 73 | 1 | 72,360,594 | 72,360,594 | 3 | true | 2022-05-24T09:34:28.920Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to filter rows by custom function Pandas?<p>I have a custom regex Python function that checks is it email or not:</p>
<pre><code>def isEmail(str):
retu... |
72,325,611 | Adding image to Inno Setup uninstaller background<p>This is the code to fill the background of the Inno Setup with an image, and hide the inner and outer panels, taken from <a href="https://stackoverflow.com/q/41049054/850848">Inno Setup - Image as installer background</a>:</p>
<pre class="lang-pascal prettyprint-overr... | <p>Well, actually as the uninstall form is structured the same way as the install wizard, the code for uninstall will be pretty much the same. You just need to move the code to <a href="https://jrsoftware.org/ishelp/index.php?topic=scriptevents&anchor=InitializeUninstallProgressForm" rel="nofollow noreferrer"><code... | Adding image to Inno Setup uninstaller background | image|controls|inno-setup|pascalscript | 3 | 73 | 1 | 72,326,792 | 72,326,792 | 3 | true | 2022-05-20T23:31:05.163Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding image to Inno Setup uninstaller background<p>This is the code to fill the background of the Inno Setup with an image, and hide the inner and outer pan... |
72,307,377 | Ways to access class variable in method - python<p>Can you please tell me what is a difference between calling Class_name.class_variable and self.class_variable inside method. Here is the example:</p>
<pre><code>class Employee:
raise_amount = 1.04
def __init__(self, first, last, pay):
self.first = first
... | <p>Python attribute reading, with <code>self.attribute</code> works like this:</p>
<ol>
<li>Python checks if the attribute is a data descriptor in the class or ancestor class, if so, its <code>__get__</code> method is called (not the case, I will get back here later)</li>
<li>Then checks the instance (self) <code>__dic... | Ways to access class variable in method - python | python|oop|class-variables | 0 | 73 | 2 | 72,307,506 | 72,307,506 | 3 | true | 2022-05-19T15:36:53.597Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Ways to access class variable in method - python<p>Can you please tell me what is a difference between calling Class_name.class_variable and self.class_varia... |
72,333,969 | How to limit number of rows in a database for each owner id<p>I need to create a complex SQL statement for Postgres that I can't seem to figure out, would anyone be able to help me out here? Here's what I need:</p>
<p>I have a table called <code>tags</code>, which is a table that stores a name and value, along with inf... | <p>If I understand your question correctly, you could use a <a href="https://www.sqltutorial.org/sql-window-functions/sql-rank/" rel="nofollow noreferrer">rank()</a> function and group them by the owner_id, and order by the partition date. then delete all the records that have a rank higher than 3.</p>
<pre><code>DELET... | How to limit number of rows in a database for each owner id | sql|database|postgresql|where-clause|sql-delete | 1 | 73 | 1 | 72,334,173 | 72,334,173 | 4 | true | 2022-05-22T00:01:49.980Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to limit number of rows in a database for each owner id<p>I need to create a complex SQL statement for Postgres that I can't seem to figure out, would an... |
72,347,517 | How to remove the last character from integer value in vb6<p>Hello i am trying to make a code that removes the last digit from an integer example</p>
<pre><code>int num = 1234
</code></pre>
<p>to be</p>
<pre><code>int num 123
</code></pre>
<p>I did the same code in C# but i am failing to do it on vb6 this is the c# cod... | <p>You are on the right path. The key missing step is to convert the number to a string before manipulating it.</p>
<pre><code>Option Explicit
Private Sub Command1_Click()
Dim num As Integer
Dim s As String
num = 1234
s = CStr(num) 'convert number to a string
s = Left(s, Len(s) - 1) ... | How to remove the last character from integer value in vb6 | vb6 | 2 | 73 | 2 | 72,347,887 | 72,347,887 | 4 | true | 2022-05-23T11:06:29.550Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to remove the last character from integer value in vb6<p>Hello i am trying to make a code that removes the last digit from an integer example</p>
<pre><c... |
72,379,794 | iterator operator++ overload compiling error<p>I have a linked list that contains a pointer to the first and last node and size which indicates how many nodes are there in the list.
I've implemented iterator for Queue that points to the address of the node, I've already succeeded implementing begin(),end() and ==,!=, a... | <blockquote>
<p>How do I make it work without <code>typename</code> at the start of the definition?</p>
</blockquote>
<p>If you meant about the function <code>Queue<T>::Iterator::operator++()</code> definition, you can do it via <a href="https://en.cppreference.com/w/cpp/language/function" rel="noreferrer">traili... | iterator operator++ overload compiling error | c++|class|c++11|templates|class-template | 1 | 73 | 1 | 72,381,181 | 72,381,181 | 5 | true | 2022-05-25T14:46:37.510Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
iterator operator++ overload compiling error<p>I have a linked list that contains a pointer to the first and last node and size which indicates how many node... |
72,248,443 | Problem with a junk value in a member when using an empty default constructor<p>I am trying to create a very basic class with a default constructor:</p>
<pre><code> class Point {
public:
Point() = default;//con 1
explicit Point(double x): x_axis(x), y_axis(0){}//con 2
Point(const Po... | <p>It's because the second constructor initializes the member variables with values while the first constructor leaves the member variables with indeterminate values.</p>
<p>Either do:</p>
<pre><code>class Point {
public:
Point() : x_axis{}, y_axis{} {} // instead of = default
...
</code></pre>
<p>or</p>
<pre><cod... | Problem with a junk value in a member when using an empty default constructor | c++|oop|c++11 | 2 | 73 | 2 | 72,248,487 | 72,248,487 | 6 | true | 2022-05-15T12:53:17.313Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Problem with a junk value in a member when using an empty default constructor<p>I am trying to create a very basic class with a default constructor:</p>
<pre... |
72,371,541 | Is *&var redundant?<p>New to C++ and trying to understand use of <code>*</code> and <code>&</code>.</p>
<p>I think I understand that <code>&*var</code> is useful if I want to have a reference variable to a pointer as a function argument, or just as a reference variable to a pointer in general. What about if the... | <p>In <em>most</em> cases, <code>*&var</code> (take the address of <code>var</code>, then dereference that address to access <code>var</code>) and <code>&*var</code> (dereference <code>var</code> to access the thing it points at, then take the address of that thing) are the same as just using <code>var</code> b... | Is *&var redundant? | c++|pointers|reference | 2 | 73 | 1 | 72,371,569 | 72,371,569 | 6 | true | 2022-05-25T03:05:00.193Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is *&var redundant?<p>New to C++ and trying to understand use of <code>*</code> and <code>&</code>.</p>
<p>I think I understand that <code>&*var</cod... |
72,325,515 | Why is the std::vector not giving any outputs in c++<p>I don't understand why but the std::vector is not giving anything after i put a class pointer in the array.</p>
<pre><code>// runs at start
void States::AssignState(GameState* state) {
_nextVacentState++;
_states.push_back(state);
}
// executes in a loop
v... | <p>This is one of the reasons I'd suggest getting in the habit of using curly braces for all <code>if</code> statements, even ones that live on a single line.</p>
<p>A problem line:</p>
<pre class="lang-cpp prettyprint-override"><code>if (_nextVacentState == 0) std::cout << "Error: There is no states, setup ... | Why is the std::vector not giving any outputs in c++ | c++|class|pointers|stdvector | 0 | 73 | 1 | 72,325,533 | 72,325,533 | 7 | true | 2022-05-20T23:11:59.003Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is the std::vector not giving any outputs in c++<p>I don't understand why but the std::vector is not giving anything after i put a class pointer in the a... |
72,881,056 | Why does my dbt container hang in Vertex AI?<p>I am trying to follow <a href="https://datatonic.com/insights/dbt-vertex-ai-pipelines-google-cloud/" rel="nofollow noreferrer">this</a> tutorial to run a dbt docker image as a Vertex AI component. When the pipeline runs the component just seems to sit there for ever. Is th... | <p>You see the pipeline logs to get an idea regarding what is going on in the pipeline.
From the <a href="https://cloud.google.com/vertex-ai/docs/pipelines/logging" rel="nofollow noreferrer">doc</a></p>
<blockquote>
<p>After you define and build a pipeline, you can use Cloud Logging to create log entries to help you mo... | Why does my dbt container hang in Vertex AI? | docker|dbt|google-cloud-vertex-ai|kfp | 0 | 73 | 1 | 72,893,151 | 72,893,151 | 1 | true | 2022-07-06T09:30:39.053Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does my dbt container hang in Vertex AI?<p>I am trying to follow <a href="https://datatonic.com/insights/dbt-vertex-ai-pipelines-google-cloud/" rel="nofo... |
72,963,977 | C# Web Forms : Update Set doesn't update Row<p>I am using ASP .NET Web Forms . I have 8 Textboxes in which the user can input data for a specific row on the SQL and make changes on the database accordingly for a car, with make, model, year, engine, the rate, availability and location.</p>
<p>I am using the Update Set S... | <p>Your code is missing a few aspects. You are defining the query, which is correct, and you set the parameters and values correctly. You never execute the query, however, and after setting the variables, you close the connection.</p>
<p>I copied your code, made these changes, and it worked for me. Give it a try.</p>
<... | C# Web Forms : Update Set doesn't update Row | c#|asp.net|webforms | 1 | 73 | 2 | 72,964,354 | 72,964,354 | 1 | true | 2022-07-13T09:31:47.760Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# Web Forms : Update Set doesn't update Row<p>I am using ASP .NET Web Forms . I have 8 Textboxes in which the user can input data for a specific row on the ... |
72,870,849 | Can I Include my backend API, sensitive data, and CPU intensive code in SvelteKit project?<p>I'm new to SvelteKit. I have some familiarity having built an app that serves as a pure front end, but want to know if I can use SvelteKit for backend code, e.g. CPU intensive work or API development. I'm aware the convention i... | <p><strong>Updating and expanding this answer based on clarification in <a href="https://stackoverflow.com/questions/72870849/can-i-include-my-backend-api-sensitive-data-and-cpu-intensive-code-in-svelteki#comment128725640_72876917">this comment</a>:</strong></p>
<blockquote>
<p>What if I don't want to use Supabase thou... | Can I Include my backend API, sensitive data, and CPU intensive code in SvelteKit project? | sveltekit | 1 | 73 | 1 | 72,876,917 | 72,876,917 | 1 | true | 2022-07-05T14:08:09.760Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I Include my backend API, sensitive data, and CPU intensive code in SvelteKit project?<p>I'm new to SvelteKit. I have some familiarity having built an ap... |
72,980,353 | How to disable particular mat-checkbox in angular14<p>I have used angular material in my application.Trying to disable the particular mat checkbox.I have tried but not working properly. It is disbaling all the checkbox.But i want to disable only Car and Motor checkboxes. How to do it? If anyone konws please help to fin... | <p>You are so close. Why don't you just use the <code>obj</code> that you are passing to your <code>isDisable()</code> function.</p>
<pre><code>isDisable(obj: any){
console.log(obj)
if (obj.item === 'Car' || obj.item === 'Motor') {
return true;
}
else {
return false;
}
}
</code></pre>
<... | How to disable particular mat-checkbox in angular14 | angular|typescript|angular-material|angular14 | 1 | 73 | 1 | 72,980,788 | 72,980,788 | 1 | true | 2022-07-14T12:16:26.653Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to disable particular mat-checkbox in angular14<p>I have used angular material in my application.Trying to disable the particular mat checkbox.I have tri... |
72,845,312 | With multiple remotes, I checked out a commit, did some changes and created a new branch and when I check out to any branch I get detached head error<p><strong>My Goal</strong> : Make a successful checkout without detached HEAD error.</p>
<p><strong>What I have done so far</strong> : Currently I have two remotes setup ... | <p>Nearly all the details in your question (multiple remotes, what you did previously) are irrelevant. The facts are simple: Checking out a <em>remote tracking branch</em> like</p>
<pre><code>git checkout remotes/fsprojects/events-projects-finsih
</code></pre>
<p>(?) is indeed a detached head. The only checkout that i... | With multiple remotes, I checked out a commit, did some changes and created a new branch and when I check out to any branch I get detached head error | git|github|git-checkout | -2 | 73 | 2 | 72,847,289 | 72,847,289 | 1 | true | 2022-07-03T09:18:33.703Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
With multiple remotes, I checked out a commit, did some changes and created a new branch and when I check out to any branch I get detached head error<p><stro... |
72,769,527 | Def and Return Function in python<p>I'm having some problems with the def and return function in Python.
On the top of my program I've defined:</p>
<pre><code>from subprogram import subprogram
</code></pre>
<p>then I've defined the def in which I've included the values I wanted to be returned:</p>
<pre><code>def subpro... | <p>The function doesn't return the variable, only the value on it.</p>
<p>If you want to get the returned value on var_colonna_1, you should asign it, as Sayse said, you should do:</p>
<pre><code>var_colonna_1 = subprogram(ssh, x_off, y_off, data_array, i, j)
</code></pre> | Def and Return Function in python | python | -1 | 73 | 1 | 72,769,639 | 72,769,639 | 1 | true | 2022-06-27T09:04:59.213Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Def and Return Function in python<p>I'm having some problems with the def and return function in Python.
On the top of my program I've defined:</p>
<pre><cod... |
72,913,094 | Rails 'includes' and 'where' with belongs_to and has_many association<p>I have models:</p>
<pre class="lang-rb prettyprint-override"><code>class Order < ApplicationRecord
acts_as_paranoid
has_paper_trail
enum status: %i[created in_process]
has_many :order_containers
has_many :line_items
end
class LineIt... | <p>This will return all products in Order#1 from Isle#1. If order has multiple variants from the same product it will return duplicate products, if this is not what you need add <code>.distinct</code> to these queries.</p>
<pre class="lang-rb prettyprint-override"><code>>> order = Order.first
>> isle = Isl... | Rails 'includes' and 'where' with belongs_to and has_many association | ruby-on-rails|ruby|database|postgresql|rails-activerecord | 2 | 73 | 2 | 72,917,580 | 72,917,580 | 1 | true | 2022-07-08T14:41:05.010Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rails 'includes' and 'where' with belongs_to and has_many association<p>I have models:</p>
<pre class="lang-rb prettyprint-override"><code>class Order < A... |
72,981,648 | Loop through each subdirectory in a main directory and run code against each file using OS<p>Essentially what I'm trying to do is loop through a directory that contains multiple sub-directories and within those run code against each file in a for loop.</p>
<p>The only start I managed to make was listing the directories... | <p>I like using pure <code>os</code>:</p>
<pre class="lang-py prettyprint-override"><code>import os
for fname in os.listdir(src):
# build the path to the folder
folder_path = os.path.join(src, fname)
if os.path.isdir(folder_path):
# we are sure this is a folder; now lets iterate it
fo... | Loop through each subdirectory in a main directory and run code against each file using OS | python|python-3.x|python-os | 0 | 73 | 2 | 72,982,364 | 72,982,364 | 1 | true | 2022-07-14T13:51:22.577Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Loop through each subdirectory in a main directory and run code against each file using OS<p>Essentially what I'm trying to do is loop through a directory th... |
72,875,207 | Wait(NULL) catch a PID of a child not finished?<p>i want that my loop intercept the child process finished or a message sent in the queue by a child. It work if a child sent a message and terminate immediatly...but if i wanna send a message and do other things? I put here my code that work and the variant where i'm wor... | <p>You <em>can</em> do both <code>wait</code> and <code>msgrcv</code> in the same loop, but you'll have to keep a count of the number of children terminated. And, you'll have to make the calls non-blocking:</p>
<pre><code>int pid_done = 0;
while (pid_done < SO_USERS_NUM) {
num_bytes = sizeof(mt_msg) - sizeof(mt_... | Wait(NULL) catch a PID of a child not finished? | c|parent-child|waitpid | 0 | 73 | 1 | 72,875,449 | 72,875,449 | 1 | true | 2022-07-05T20:30:17.740Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Wait(NULL) catch a PID of a child not finished?<p>i want that my loop intercept the child process finished or a message sent in the queue by a child. It work... |
72,844,949 | Scalability Qt 5.15 Android<p>Since it is incredibly difficult to find a developer of android applications for qt, I will ask a question here, suddenly someone was doing this.</p>
<p>How to solve the scalability problem on different devices? Ideally, the application should look the same on all screens, from m/hdmi to x... | <p>In our case, we did not want to fill entire Pad and/or TV screen, and our appraoch for handling responsive-size was to:</p>
<ul>
<li>Make size-preset: find our prefered screen-size-preset, on which we base all view constants (sizes).
<blockquote>
<p>We did pick 320x548, which is smallest iPhone safe-area.</p>
</bloc... | Scalability Qt 5.15 Android | android|c++|qt|qml | 2 | 73 | 1 | 72,847,501 | 72,847,501 | 1 | true | 2022-07-03T08:22:56.113Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Scalability Qt 5.15 Android<p>Since it is incredibly difficult to find a developer of android applications for qt, I will ask a question here, suddenly someo... |
72,782,178 | How to pass BGR NumPy arrays directly to FFMPEG with CUDA support<p>I am using <code>cv2</code> to edit images and create a video from the frames with FFMPEG. See this post for more details.</p>
<p>The images are 3D RGB NumPy <code>array</code>s (shape is like [h, w, 3]), they are stored in a Python <code>list</code>.<... | <p>In case you already know the syntax of FFmpeg CLI, you may use subprocess module as in my <a href="https://stackoverflow.com/questions/61260182/how-to-output-x265-compressed-video-with-cv2-videowriter">following answer</a> (the syntax applies FFmpeg CLI).</p>
<p>When using <code>ffmpeg-python</code> package:</p>
<ul... | How to pass BGR NumPy arrays directly to FFMPEG with CUDA support | python|video|ffmpeg | 2 | 73 | 1 | 72,793,386 | 72,793,386 | 2 | true | 2022-06-28T07:17:05.557Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to pass BGR NumPy arrays directly to FFMPEG with CUDA support<p>I am using <code>cv2</code> to edit images and create a video from the frames with FFMPEG... |
72,794,815 | How can I materialize a string to the actual type?<p>I am creating a projection variable like this:</p>
<pre class="lang-cs prettyprint-override"><code>var projection = Builders<Items>.Projection
.Include(x => x.Name);
</code></pre>
<p>The <code>Include</code> method takes an expres... | <p>As written this answer from the comment as the future reference, you can apply</p>
<pre class="lang-cs prettyprint-override"><code>.Include(key)
</code></pre>
<p>Provide a <code>string</code> value which is the field name.</p>
<hr />
<p>As from <a href="https://github.com/mongodb/mongo-csharp-driver/blob/93614cccfa5... | How can I materialize a string to the actual type? | c#|expression|mongodb-.net-driver | 0 | 73 | 1 | 72,795,479 | 72,795,479 | 2 | true | 2022-06-29T01:30:22.257Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I materialize a string to the actual type?<p>I am creating a projection variable like this:</p>
<pre class="lang-cs prettyprint-override"><code>var p... |
72,786,793 | Why doesn't minimax pick the best position in Tic Tac Toe?<p>I've made a Minimax algorithm to determine the best position in Tic Tac Toe. I want it to play for both 'x' and 'o'. For the most part, it works great; it's unbeatable. But as we all know, when starting the game, the strongest position to hold is the middle o... | <p>Minimax assumes best play from both players, that is the core of the algorithm. Tic Tac Toe will always be a draw no matter starting position, if both players play the best moves. Therefore the algorithm will think each move from the starting position is equally good (a score of 0, a draw).</p>
<p>So when you do thi... | Why doesn't minimax pick the best position in Tic Tac Toe? | c|algorithm|tic-tac-toe|minimax | 1 | 73 | 1 | 72,795,582 | 72,795,582 | 2 | true | 2022-06-28T12:53:15.430Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why doesn't minimax pick the best position in Tic Tac Toe?<p>I've made a Minimax algorithm to determine the best position in Tic Tac Toe. I want it to play f... |
72,795,180 | How To Use Pymunk Categories and Masks<p>I am making a python project with the 2D physics engine <a href="https://pypi.org/project/pymunk/" rel="nofollow noreferrer">pymunk</a>, but I am not familiar with pymunk or the base C library that it interatcs with, <a href="https://chipmunk-physics.net/" rel="nofollow noreferr... | <p>It can look a bit tricky at first, but is actually quite straight forward, at least as long as you dont have too complicated needs.</p>
<p>With ShapeFilter you set the category that the shape belongs to, and what categories it can collide with (the mask property).</p>
<p>Both categories and the mask are stored as 32... | How To Use Pymunk Categories and Masks | python|filter|collision-detection|bitwise-operators|pymunk | 2 | 73 | 1 | 72,807,516 | 72,807,516 | 2 | true | 2022-06-29T02:35:51.123Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How To Use Pymunk Categories and Masks<p>I am making a python project with the 2D physics engine <a href="https://pypi.org/project/pymunk/" rel="nofollow nor... |
72,808,368 | How to archive documents stored in SQL Server<p>I have a client for which I did a portal which manages documents used by their company. The documents are stored in SQL Server. This all works great.</p>
<p>Now, a few years later, there are 130,000 documents, most of which are no longer needed. The database is up to 20... | <p>Export the backup file in Azure Blob storage in archive mode which will cost less and easy to import back to database when required. <strong>Delete the records from database afterwards</strong>.</p>
<ol>
<li>Click on the Export option for your SQL database in Azure SQL Server.</li>
</ol>
<p><a href="https://i.stack.... | How to archive documents stored in SQL Server | sql-server|azure|azure-storage | 0 | 73 | 1 | 72,809,669 | 72,809,669 | 2 | true | 2022-06-29T22:07:41.257Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to archive documents stored in SQL Server<p>I have a client for which I did a portal which manages documents used by their company. The documents are st... |
72,819,892 | Snowflake sql is updating all rows instead of selective rows from WHERE clause<p>I want to update only certain rows of table1 where source='abc'. However, it ends up updating all the rows of table1 as if WHERE clause doesn't exist. I want to update a column from another table's column value where the IDs are same betwe... | <p>The correct UPDATE syntax is:</p>
<pre><code>UPDATE table1
SET col1 = table2.col2
FROM table2
WHERE table1.ID = table2.ID
AND table1.source = 'abc';
</code></pre> | Snowflake sql is updating all rows instead of selective rows from WHERE clause | sql|sql-update|snowflake-cloud-data-platform | 0 | 73 | 1 | 72,820,073 | 72,820,073 | 2 | true | 2022-06-30T17:36:13.903Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Snowflake sql is updating all rows instead of selective rows from WHERE clause<p>I want to update only certain rows of table1 where source='abc'. However, it... |
72,823,939 | Updating property wrapper like @StateObject, affects other view rendering that does not use that property<p>When using different property wrappers associated with view updates, changes in one place affect rendering of views that do not use that property.</p>
<p><a href="https://i.stack.imgur.com/LpKau.gif" rel="nofollo... | <p>To render SwiftUI calls <code>body</code> property of a view (it is computable, i.e. executes completely on call). This call is performed whenever any view dependency, i.e. dynamic property, is changed.</p>
<p>So, <code>viewModel.chageFirstTitle()</code> changes dependency for <code>ContentView</code> and <code>Cont... | Updating property wrapper like @StateObject, affects other view rendering that does not use that property | swift|swiftui|view|dependencies|rendering | 1 | 73 | 2 | 72,824,345 | 72,824,345 | 2 | true | 2022-07-01T02:57:03.427Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Updating property wrapper like @StateObject, affects other view rendering that does not use that property<p>When using different property wrappers associated... |
72,837,221 | How to send session in Laravel API Controllers<p>I'm working with Laravel 5.8 and I'm trying to build my API for mobile app developer.</p>
<p>Basically I have made an API <code>RegisterController</code> that has a method like this:</p>
<pre><code>public function register(Request $request)
{
// Validation Da... | <p>To answer specific question, you could use <a href="https://laravel.com/docs/5.8/session" rel="nofollow noreferrer">session helper</a> and write phone number in session in register function:</p>
<pre><code>public function register(Request $request)
{
// Validation Data
$validData = $this->vali... | How to send session in Laravel API Controllers | php|laravel|api|rest|laravel-5.8 | 0 | 73 | 2 | 72,837,451 | 72,837,451 | 2 | true | 2022-07-02T07:18:38.860Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to send session in Laravel API Controllers<p>I'm working with Laravel 5.8 and I'm trying to build my API for mobile app developer.</p>
<p>Basically I hav... |
72,835,368 | What is the type of an async function?<pre><code>pub trait GenericAsyncRunner{
fn return_run_function(&self) -> ?;
}
pub enum AsyncRunError{}
pub struct SpecificAsyncRunner{}
impl SpecificAsyncRunner{
async fn run(&self) -> Result<u32, AsyncRunError> {
todo!()
}
}
impl Generi... | <p><code>async</code> functions can't be specified in traits yet, and your example is one of the big reasons why. Your best bet is to return <code>Box<dyn Future<Output=T>></code>, or use the <a href="https://lib.rs/crates/async-trait" rel="nofollow noreferrer"><code>async-trait</code></a> crate that does t... | What is the type of an async function? | rust | 2 | 73 | 1 | 72,841,032 | 72,841,032 | 2 | true | 2022-07-01T23:17:26.357Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the type of an async function?<pre><code>pub trait GenericAsyncRunner{
fn return_run_function(&self) -> ?;
}
pub enum AsyncRunError{}
pu... |
72,842,122 | Inserting into data structure in O(1) time while maintaining index order<p>Is there a data structure with elements that can be indexed whose insertion runtime is O(1)? So for example, I could index the data structure like so: <code>a[4]</code>, and yet when inserting an element at an arbitrary place in the data structu... | <p>The problem that you are looking to solve is called the <a href="https://en.wikipedia.org/wiki/List-labeling_problem" rel="nofollow noreferrer">list labeling problem</a>.</p>
<p>There are lower bounds on the cost that depend on the relationship between the the maximum number of labels you need (n), and the number of... | Inserting into data structure in O(1) time while maintaining index order | data-structures|time-complexity | 0 | 73 | 2 | 72,843,528 | 72,843,528 | 2 | true | 2022-07-02T20:07:15.763Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Inserting into data structure in O(1) time while maintaining index order<p>Is there a data structure with elements that can be indexed whose insertion runtim... |
72,848,680 | Solving longest path in matrix<p>So this is the question to find longest path of 1s in a matrix of 0s and 1s from starting coordinates to the ending coordinates.</p>
<p>Here is the solution I figured out somehow and which I understand as well (almost). Though I am having trouble understanding one line of this:</p>
<pre... | <p>If I understand the code correctly, the highlighted line is backtracking.</p>
<p>Consider this line: <code>visited[`${i},${j}`] = true;</code>. The purpose of this line is to stop the recursive DFS from visiting a point you've just visited (otherwise you'll simply get a recursive loop).</p>
<p>But once that path is ... | Solving longest path in matrix | javascript|algorithm|matrix|data-structures | 0 | 73 | 1 | 72,848,742 | 72,848,742 | 2 | true | 2022-07-03T17:44:14.420Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Solving longest path in matrix<p>So this is the question to find longest path of 1s in a matrix of 0s and 1s from starting coordinates to the ending coordina... |
72,867,371 | How to get the package.log version with angular, ionic & capacitor<p>I used the following pugin: <a href="https://github.com/sampart/cordova-plugin-app-version" rel="nofollow noreferrer">cordova-plugin-app-version</a>, to get the version of my app and displayed it into my html file.</p>
<p>But I did the migration to Ca... | <p>You can easily import it in your .ts file.</p>
<pre><code>import p from '[path to your file]/package.json';
</code></pre>
<p>Then you have access to all the properties in your package.json:</p>
<pre><code>version = p.version;
</code></pre>
<p>Then you can display it in your HTML:</p>
<pre><code><div>{{version}... | How to get the package.log version with angular, ionic & capacitor | angular|ionic-framework|package.json|capacitor | 0 | 73 | 1 | 72,869,459 | 72,869,459 | 2 | true | 2022-07-05T09:52:08.510Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get the package.log version with angular, ionic & capacitor<p>I used the following pugin: <a href="https://github.com/sampart/cordova-plugin-app-versi... |
72,873,810 | How to Window Tensorflow Dataset derived from a dictionary<p>I would like to window a dataset as seen in the post <a href="https://stackoverflow.com/questions/55429307/how-to-use-windows-created-by-the-dataset-window-method-in-tensorflow-2-0">How to use windows created by the Dataset.window() method in TensorFlow 2.0?<... | <p>You can achieve this within <code>tf.data</code> API as follows,</p>
<pre><code>import tensorflow as tf
data = {'col_a': [0,1,2,3,4], 'col_b': [0,1,2,3,4]}
ds = tf.data.Dataset.from_tensor_slices(data)
# Seems like you don't need windows with < 3, then set drop_remainder to True
windowed_ds = ds.window(size=3,sh... | How to Window Tensorflow Dataset derived from a dictionary | python|tensorflow|tensorflow2.0 | 0 | 73 | 1 | 72,875,971 | 72,875,971 | 2 | true | 2022-07-05T18:11:07.117Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to Window Tensorflow Dataset derived from a dictionary<p>I would like to window a dataset as seen in the post <a href="https://stackoverflow.com/question... |
72,877,295 | Find locations within distance of multiple locations<p>I'm trying to run a query that will find locations with a given distance of any of the given locations. This is for a search result where users can select multiple locations to look around.</p>
<p>My current approach is to use <code>ST_ClosestPoint</code> and pass ... | <p>To make things simpler put the <code>ST_Collect</code> in a subquery or CTE, and in the outer query use <code>ST_DWithin</code> with the newly created MultiPoint, the column <code>coordinate</code> and a given distance, e.g.</p>
<pre class="lang-sql prettyprint-override"><code>WITH j (points) AS (
SELECT
ST_Co... | Find locations within distance of multiple locations | sql|postgresql|postgis | 2 | 73 | 1 | 72,886,228 | 72,886,228 | 2 | true | 2022-07-06T02:21:28.117Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find locations within distance of multiple locations<p>I'm trying to run a query that will find locations with a given distance of any of the given locations... |
72,887,296 | How to rewrite uses of given/when so to eliminate "experimental" warnings for their use<p>ALL,</p>
<p>I have following:</p>
<pre><code>This is perl 5, version 26, subversion 3 (v5.26.3) built for x86_64-linux-thread-multi
(with 57 registered patches, see perl -V for more detail)
Copyright 1987-2018, Larry Wall
Perl m... | <p>I like to use dispatch tables for things like this. Essentially it's a hash where the keys are the valid options, and the value of the key is a subroutine that does what you want to do when a valid option is supplied. Doing it this way eliminates a long chain of if/else statements.</p>
<p>You can put the subroutines... | How to rewrite uses of given/when so to eliminate "experimental" warnings for their use | perl|warnings | 4 | 73 | 2 | 72,888,126 | 72,888,126 | 2 | true | 2022-07-06T16:54:40.763Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to rewrite uses of given/when so to eliminate "experimental" warnings for their use<p>ALL,</p>
<p>I have following:</p>
<pre><code>This is perl 5, versio... |
72,932,218 | How to create DataFrame with 100 values consisting of 10 elementary numbers in Python Pandas?<p>I need to create Data Frame in Python Pandas with 100 rows with random values consisting of 10 elementary numbers.
So as a result I need something like below "col1" has to be as date type string:</p>
<pre><code>col... | <p>To ensure that values beginning with one or more zeros are properly formatted, we can create values of data type string with zero padding to 10 places:</p>
<pre class="lang-py prettyprint-override"><code>rng = np.random.default_rng()
df = pd.DataFrame(pd.Series(rng.integers(0, 10**10, size=100)).apply(lambda n: f'{n... | How to create DataFrame with 100 values consisting of 10 elementary numbers in Python Pandas? | python|pandas|random | 1 | 73 | 2 | 72,932,345 | 72,932,345 | 2 | true | 2022-07-10T22:12:41.110Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create DataFrame with 100 values consisting of 10 elementary numbers in Python Pandas?<p>I need to create Data Frame in Python Pandas with 100 rows wi... |
72,945,293 | Generating a random string with matched brackets<p>I need to generate a random string of a certain length – say ten characters, for the sake of argument – composed of the characters <code>a</code>, <code>b</code>, <code>c</code>, <code>(</code>, <code>)</code>, with the rule that parentheses must be matched.</p>
<p>So ... | <p>Use dynamic programming to generate a data structure that knows how many there are for each choice, recursively. Then use that data structure to find a random choice.</p>
<p>I seem to be the only person who uses the technique. And I always write it from scratch. But here is working code that hopefully explains it... | Generating a random string with matched brackets | string|algorithm|random|language-agnostic | 1 | 73 | 2 | 72,945,609 | 72,945,609 | 2 | true | 2022-07-11T22:30:54.143Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Generating a random string with matched brackets<p>I need to generate a random string of a certain length – say ten characters, for the sake of argument – co... |
72,951,451 | How do you set the size of FontAwesome icon using CSS in Angular?<p>Per FontAwesome Usage Guide, you set the size of icons like so:</p>
<pre><code>1. <fa-icon [icon]="['far', 'coffee']" [classes]="['toolbar-icon']" size="2x"></fa-icon>
2. <fa-icon [icon]="['far', 'coffe... | <p><em>Creating an answer just in case other people find this question and doesn't look in the comments.</em></p>
<p>Since you style markup, you can use <code>font-size</code> to set the size of FontAwesome icons.</p>
<pre><code>fa-icon {
font-size: 20px;
}
</code></pre> | How do you set the size of FontAwesome icon using CSS in Angular? | css|angular|angular-fontawesome | 2 | 73 | 1 | 72,952,655 | 72,952,655 | 2 | true | 2022-07-12T11:18:03.343Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do you set the size of FontAwesome icon using CSS in Angular?<p>Per FontAwesome Usage Guide, you set the size of icons like so:</p>
<pre><code>1. <fa-... |
72,949,606 | Nested arrays $unwind and $group back together in mongoDB<p>We have three nested arrays:</p>
<ol>
<li><code>principalCredits</code> with 2 objects</li>
<li><code>credits</code> with 2 objects each</li>
<li><code>awardNominations.edges</code> with variable totals from 0 to 3</li>
</ol>
<p>The task is to add a field to t... | <p>So the "rule" in restoring to original structure is that for each <code>$unwind</code> you did to "deconstruct" the document you now have to do a <code>$group</code> to restore it.</p>
<p>As you can imagine in such a pipeline this could be VERY cumbersome. but definitely doable.
However let me pr... | Nested arrays $unwind and $group back together in mongoDB | mongodb|aggregate | 2 | 73 | 2 | 72,954,819 | 72,954,819 | 2 | true | 2022-07-12T08:59:13.527Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Nested arrays $unwind and $group back together in mongoDB<p>We have three nested arrays:</p>
<ol>
<li><code>principalCredits</code> with 2 objects</li>
<li><... |
72,988,487 | Is it safe to access stack variable after `this` has been deleted<p>Found similar questions: <a href="https://stackoverflow.com/questions/550189/is-it-safe-to-delete-this">Is it safe to `delete this`?</a>
I know that it's unsafe to access member variable. Because <code>this</code> becomes a dangling pointer after <code... | <p>The problem is having <code>counter_</code> equal to <code>task_num_ - 1</code> does not mean all threads are finished. It just mean that the <code>fetch_add</code> call has been executed by all threads here. The thing is the <code>==</code> in the expression <code>counter_.fetch_add(1, std::memory_order_acq_rel) ==... | Is it safe to access stack variable after `this` has been deleted | c++|multithreading | 0 | 73 | 1 | 72,992,193 | 72,992,193 | 2 | true | 2022-07-15T02:31:30.580Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it safe to access stack variable after `this` has been deleted<p>Found similar questions: <a href="https://stackoverflow.com/questions/550189/is-it-safe-t... |
73,014,813 | HTTP GET with VBA and special characters in URL<p>I'm trying to communicate with Google Distance API via <code>VBA</code> in 64bit Excel 365, but having trouble with special character input in street address data. Other threads having similar issues with other HTTP requests, though with output and I struggle to relate.... | <p>I suggest you change these two lines in your code:</p>
<pre><code>myOrigin = WorksheetFunction.EncodeURL("Tähetorni 1 Tallinn")
myDest = WorksheetFunction.EncodeURL("Sääse 2 Tallinn")
</code></pre>
<p>Your code returns a valid string with those changes (also note I replaced the <code>+</code> wit... | HTTP GET with VBA and special characters in URL | excel|vba|xmlhttprequest|special-characters | 0 | 73 | 1 | 73,016,041 | 73,016,041 | 2 | true | 2022-07-17T19:36:46.260Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
HTTP GET with VBA and special characters in URL<p>I'm trying to communicate with Google Distance API via <code>VBA</code> in 64bit Excel 365, but having trou... |
73,016,615 | function cusparseScsr2csc in cuSPARSE library return strange result<p>I want to test the <code>cusparseScsr2csc</code> which is a function used to convert a <strong>csr</strong> format matrix to a <strong>csc</strong> format matrix (or just say <strong>transpose a csr format matrix</strong>), so I write the code below ... | <p>The main problem is here:</p>
<pre><code>cudaMemcpy(csr_values, col_inds, sizeof(int) * nnz, cudaMemcpyHostToDevice);
</code></pre>
<p>That should be:</p>
<pre><code>cudaMemcpy(csr_col_inds, col_inds, sizeof(int) * nnz, cudaMemcpyHostToDevice);
</code></pre>
<p>A few other notes:</p>
<ul>
<li><p>The function <code>c... | function cusparseScsr2csc in cuSPARSE library return strange result | c++|cuda|sparse-matrix|cusparse | 0 | 73 | 1 | 73,024,381 | 73,024,381 | 2 | true | 2022-07-18T01:57:19.420Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
function cusparseScsr2csc in cuSPARSE library return strange result<p>I want to test the <code>cusparseScsr2csc</code> which is a function used to convert a ... |
72,798,210 | How to remove CRLF character (Carriage Return Line Feed) in Linux terminal?<p>I am receiving a simple output from an Oracle Database, for some reason the output goes down to a new line and I cannot remove that return character.</p>
<p>This is what I've already tried:</p>
<pre><code>sed 's/^M//g'
sed 's/\r//g'
sed 's/\n... | <p>To remove the CRLF bytes, it's much easier in Perl:</p>
<pre><code>perl -pe 's/\x0d\x0a//g'
</code></pre>
<p>Or you can run <code>sed</code> and <code>tr</code>:</p>
<pre><code>sed 's/\r$//' file | tr -d '\n'
</code></pre>
<p><code>C2 A7</code> in UTF-8 corresponds to <code>U+00A7</code> or <code>SECTION SIGN</code>... | How to remove CRLF character (Carriage Return Line Feed) in Linux terminal? | linux|shell|sed|terminal|newline | 1 | 73 | 2 | 72,798,393 | 72,798,393 | 2 | true | 2022-06-29T08:31:14.707Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to remove CRLF character (Carriage Return Line Feed) in Linux terminal?<p>I am receiving a simple output from an Oracle Database, for some reason the out... |
72,905,044 | How to get the maximum count of data in string format<p><strong>This is my code:</strong></p>
<pre><code> table(Car_DataSet_no_na$Dealer)
</code></pre>
<p><strong>Output:</strong></p>
<pre><code>> table(Car_DataSet_no_na$Dealer)
Anny David Henry
870 263 128
</code></pre>
<p><strong>I assigned it as (... | <p>I will explain the answer of Adam Quek in a reproducible example:</p>
<pre><code>exampleVector <- sample(x = rep(x = c("Pikachu", "Charmander", "Balbasaur"),
times = c(30, 15, 45)))
x <- table(exampleVector)
# The number
max(x)
# The name
names(... | How to get the maximum count of data in string format | r|database|dataframe|max | 2 | 73 | 2 | 72,909,533 | 72,909,533 | 2 | true | 2022-07-07T22:58:38.610Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get the maximum count of data in string format<p><strong>This is my code:</strong></p>
<pre><code> table(Car_DataSet_no_na$Dealer)
</code></pre>
<p... |
72,838,130 | Can I add functionality to this number incrementor?<p>I am still learning JavaScript so I wanted to use this as an added opportunity to learn more.
Currently, the code is written in only HTML & CSS. Where I need help is in making this work with JavaScript.</p>
<p>I saw a number incrementor/decrementor (like the one... | <p>First, you need a script to listen to click Events and then execute the script. For that, you can use <code>addEventListener</code>.</p>
<p>Then you need a variable like <code>index</code> to act as a counter. If you click on <code>minus</code> the counter needs to be lowered by 1 with <code>variable--</code> or in ... | Can I add functionality to this number incrementor? | javascript|html|css | 0 | 73 | 2 | 72,838,254 | 72,838,254 | 2 | true | 2022-07-02T09:55:10.340Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I add functionality to this number incrementor?<p>I am still learning JavaScript so I wanted to use this as an added opportunity to learn more.
Currently... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.