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,892,844 | how to set safari zoom level to 100% from the below shared image/steps with applescript or python script for macos desktop?<p>safari->preferences->websites->Page Zoom-> click on "when visiting other websites" and make this to 100% if option ranges in number from 50% to 200%</p>
<p>Need an applscri... | <h1>AppleScript 1: Set Safari default Page Zoom to 100%</h1>
<pre><code>tell application "System Events" to tell application process "Safari"
set frontmost to true
keystroke "," using command down -- Open Safari Preferences window
click button "Websites" of toolbar 1 of win... | how to set safari zoom level to 100% from the below shared image/steps with applescript or python script for macos desktop? | macos|safari|applescript | 0 | 48 | 1 | 73,631,282 | 73,631,282 | 0 | true | 2022-07-07T05:50:36.810Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to set safari zoom level to 100% from the below shared image/steps with applescript or python script for macos desktop?<p>safari->preferences->webs... |
72,994,803 | Shutdown / reboot linux machine from flutter app<p>Supposedly in C after importing <code><stdlibc.h></code> you can invoke method <code>system()</code> an pass a param to perform shutdown. But using this as C script passed to flutter button via ffi does not seem to work. There is a package <a href="https://pub.de... | <pre><code>import 'dart:io';
Future<void> shutdown({bool restart = false, int delay = 0}) {
final params = <String>[];
if (restart) {
params.add('-r');
}
params.addAll(<String>['-t', delay.toString(), 'now']);
return Process.run('shutdown', params);
}
</code></pre> | Shutdown / reboot linux machine from flutter app | linux|flutter|dart|std | 1 | 48 | 1 | 73,321,321 | 73,321,321 | 1 | true | 2022-07-15T13:30:26.123Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Shutdown / reboot linux machine from flutter app<p>Supposedly in C after importing <code><stdlibc.h></code> you can invoke method <code>system()</code>... |
72,250,399 | In ggplot and sportyR packages: how to fill white space outside the pitch with others colors?<p>Bellow is my code:</p>
<pre><code>library(sportyR)
library(ggplot2)
geom_basketball('nba', full_surf = FALSE, rotate = TRUE)
</code></pre>
<p>This is the github page: <a href="https://github.com/sportsdataverse/sportyR" rel=... | <p>I'm the author/maintainer of <code>sportyR</code>. Apologies for not seeing this when you originally posted your question!</p>
<p>Not sure if you ever resolved the issue, but what I think you're trying to do isn't entirely possible with <code>v1.0.1</code>, the version that was on CRAN at the time you posted the que... | In ggplot and sportyR packages: how to fill white space outside the pitch with others colors? | r|ggplot2 | 0 | 48 | 2 | 73,370,222 | 73,370,222 | 1 | true | 2022-05-15T17:00:04.910Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In ggplot and sportyR packages: how to fill white space outside the pitch with others colors?<p>Bellow is my code:</p>
<pre><code>library(sportyR)
library(gg... |
72,244,407 | There seems to be a problem with input of only 2 with a size of 6. Everything else seems to work exactly as expected. Why is this happening<p>I am starting to learn c++. So I want to try this using only recursion.Thank You for your help.</p>
<pre><code>#include <iostream>
using namespace std;
int lastIndex(int ... | <p>i think you mean</p>
<pre><code> return lastIndex(arr, size, num);
</code></pre>
<p>your code</p>
<pre><code> return(arr, size, num);
</code></pre>
<p>is equivalent to</p>
<pre><code> return num;
</code></pre> | There seems to be a problem with input of only 2 with a size of 6. Everything else seems to work exactly as expected. Why is this happening | c++|visual-studio|recursion | 0 | 48 | 2 | 72,244,420 | 72,244,420 | 0 | true | 2022-05-14T22:57:14.253Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
There seems to be a problem with input of only 2 with a size of 6. Everything else seems to work exactly as expected. Why is this happening<p>I am starting t... |
72,245,045 | How to concatenate multiple dataframes in sequential order?<p>I want to go through the whole month of april day by day. I want to print one dataframe that has every day combined up to the day I am at, and another df that has just the last 3 days. For example, lets say today was april 5th 2021. I want to print a datafra... | <pre><code>import pandas as pd
z = [pd.read_csv(f'21_apr{x}.csv') for x in range(1, 6)]
df1 = pd.concat([z[0:-1])
df2 = pd.concat([z[1:-1])
</code></pre> | How to concatenate multiple dataframes in sequential order? | python|pandas | 0 | 48 | 2 | 72,245,100 | 72,245,100 | 0 | true | 2022-05-15T01:52:45.480Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to concatenate multiple dataframes in sequential order?<p>I want to go through the whole month of april day by day. I want to print one dataframe that ha... |
72,245,632 | "model.fit()" sometimes takes Y_train (i.e, label/category) and sometimes not why?<p>in some cases we do not send any Y_train(Category/classes) and the code still works
For Example:-</p>
<p>history = model.fit(
train,
epochs=epochs,
batch_size=Batch,
verbose=1,
validation_data=validate
)
Here we have sent only the x_tr... | <p>If you have a dataset that contains both the features as well as labels, then you should not explicitly mention <code>y</code>. The fit method will try to extract the labels from the <code>x</code> itself.</p>
<p>For more information please refer: <a href="https://keras.io/api/models/model_training_apis/#fit-method"... | "model.fit()" sometimes takes Y_train (i.e, label/category) and sometimes not why? | machine-learning|deep-learning|computer-vision|conv-neural-network | 0 | 48 | 1 | 72,245,687 | 72,245,687 | 0 | true | 2022-05-15T05:06:25.573Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
"model.fit()" sometimes takes Y_train (i.e, label/category) and sometimes not why?<p>in some cases we do not send any Y_train(Category/classes) and the code ... |
72,246,352 | pandas - rename_axis doesn't work as expected afterwards - why?<p>i was reading through the pandas documentation (10 minutes to pandas) and came across this example:</p>
<pre><code>dates = pd.date_range('1/1/2000', periods=8)
df = pd.DataFrame(np.random.randn(8, 4),
index=dates, columns=['A', 'B', 'C', '... | <p>You are confusing the name of the index, and the index values.</p>
<p>In your example, the first code chunk runs because <code>dates</code> is a variable, so when you call <code>dates[5]</code> it actually returns the 5th value from the <code>dates</code> object, which is a valid index value in the dataframe.</p>
<p... | pandas - rename_axis doesn't work as expected afterwards - why? | python|pandas|indexing|rename | 0 | 48 | 2 | 72,246,489 | 72,246,489 | 0 | true | 2022-05-15T07:34:08.817Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pandas - rename_axis doesn't work as expected afterwards - why?<p>i was reading through the pandas documentation (10 minutes to pandas) and came across this ... |
72,247,116 | How can i do my url flexible in Django 1.11?<p>In my project with django I should do a site with flexible url. For instance:<br />
<code>mysite.com/register/kj-1k-32-mk</code></p>
<p>When someone write some other things after register/ I want to redirect them to my site. How can I redirect them. What should my urls.py ... | <p>That's because of the <code>\d+</code> pattern which only allows a sequence of digits. If you want a slug-like sequence, you can use:</p>
<pre><code>from django.conf.urls import url
from django.contrib import admin
from olvapp import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^register/(?... | How can i do my url flexible in Django 1.11? | python|django|url|django-urls | 1 | 48 | 1 | 72,247,126 | 72,247,126 | 0 | true | 2022-05-15T09:41:24.460Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can i do my url flexible in Django 1.11?<p>In my project with django I should do a site with flexible url. For instance:<br />
<code>mysite.com/register/... |
72,257,562 | Assign a value to a [(ngModel)] input<p>new to MEAN stack here,</p>
<p>I'm trying to insert datas into MongoDB, but with the _id of the connected user, so I have a function which display it :</p>
<pre><code> getSessionInfos(){
return sessionStorage.getItem('id');
}
</code></pre>
<pre><code>db.collection('transa... | <pre><code>data: any = {
date: "",
titre: "",
description: "",
montant: "",
id: sessionStorage.getItem('id'),
type: ""
}
</code></pre> | Assign a value to a [(ngModel)] input | node.js|angular | 1 | 48 | 3 | 72,257,827 | 72,257,827 | 0 | true | 2022-05-16T10:12:49.260Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Assign a value to a [(ngModel)] input<p>new to MEAN stack here,</p>
<p>I'm trying to insert datas into MongoDB, but with the _id of the connected user, so I ... |
72,253,288 | GLUT program crashes without any exception<p>I'm learning GLSL and trying write my own Ray Tracing shader. I'm using Python with PyOpenGL + GLUT. This is perfect works usually, but when I increase amount of rays to be trace program crashes on glutSwitchBuffers operation. No error messages, no exceptions in debugger, it... | <p>Okay, I find solution by myself using <a href="https://stackoverflow.com/users/2579738/bdl">BDL</a> comment.
When graphic card render frame more then 2 seconds Windows just kill that process. This is called TDL timeout.
There is two way to solve an issue when you need to do hard calculations:</p>
<ol>
<li>Increase T... | GLUT program crashes without any exception | python|opengl|glut | -1 | 48 | 1 | 72,258,412 | 72,258,412 | 0 | true | 2022-05-16T01:09:44.120Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
GLUT program crashes without any exception<p>I'm learning GLSL and trying write my own Ray Tracing shader. I'm using Python with PyOpenGL + GLUT. This is per... |
72,250,484 | COUNTIF in access Query<p>I have an Access Query that has computed columns as Rank1, Rank2, Rank3 which can be A, B or C as values.</p>
<pre><code>Rank1 Rank2 Rank3 Final_Rank
A B C
B A A
C B C
</code></pre>
<p>I want to add another column Final_Rank which use the COUNTIF... | <p>There is no function in MsAccess SQL that can count certain values across columns, like EXCEL's COUNTIF can. You can simulate it as:</p>
<pre><code>IIF(
IIF(Rank1='A',1,0)+IIF(Rank2='A',1,0)+IIF(Rank3='A',1,0) < 3 , 'B', ...
</code></pre> | COUNTIF in access Query | vba|ms-access | 0 | 48 | 1 | 72,259,249 | 72,259,249 | 0 | true | 2022-05-15T17:09:39.873Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
COUNTIF in access Query<p>I have an Access Query that has computed columns as Rank1, Rank2, Rank3 which can be A, B or C as values.</p>
<pre><code>Rank1 Ra... |
72,265,121 | Having A Problem With If Statements In Python<p>My goal is to have something like this:</p>
<pre><code>x = 201
if x >= 100 <= 200:
print(x)
else:
print('Less Than 100 Or More Than 200')
</code></pre>
<p>but it doesn't work:</p>
<p>output: <code>201</code></p>
<p>basically anything smaller than or equal 1... | <p>you wanna do this :</p>
<pre><code>x = 201
if 100<= x <= 200:
print(x)
else:
print('Less Than 100 Or More Than 200')
</code></pre> | Having A Problem With If Statements In Python | python|if-statement | -2 | 48 | 2 | 72,265,147 | 72,265,147 | 0 | true | 2022-05-16T20:17:22.677Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Having A Problem With If Statements In Python<p>My goal is to have something like this:</p>
<pre><code>x = 201
if x >= 100 <= 200:
print(x)
else:
... |
72,260,050 | Twilio phone call validation public numbers<p>I am using Twilio for the first time. It is implemented already, but I am trying to solidify the system.</p>
<p>My question is pretty simple. I would like to know if Twilio has integrated protections against trolls entering numbers such as 911-123-4567. I wouldn't want the ... | <p>Twilio doesn't have any automated blocks on dialling numbers. You might not want to call emergency numbers, for example, but some applications do.</p>
<p>You could certainly build your own blocklist for numbers you don't want your application to be able to call. Or for more security, your own allowlist.</p>
<p>One o... | Twilio phone call validation public numbers | twilio | 0 | 48 | 1 | 72,266,382 | 72,266,382 | 0 | true | 2022-05-16T13:31:05.400Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Twilio phone call validation public numbers<p>I am using Twilio for the first time. It is implemented already, but I am trying to solidify the system.</p>
<p... |
72,271,322 | How can I decode the http encrypted cookie in Jmeter<p>I am now using Jmeter to prepare a test plan for my web. The rough flow of the script is that I can check my profile after login. I tried to run my recorded script, and found that the cookie is encoded in http format which I don't want it to be.</p>
<p>Therefore, I... | <p><code>%22</code> means <code>"</code> which is <a href="https://en.wikipedia.org/wiki/Percent-encoding" rel="nofollow noreferrer">percent-encoded</a>, if you want to decode it back - take a look at <a href="https://jmeter.apache.org/usermanual/functions.html#__urldecode" rel="nofollow noreferrer">__urldecode()<... | How can I decode the http encrypted cookie in Jmeter | cookies|jmeter | 0 | 48 | 1 | 72,271,512 | 72,271,512 | 0 | true | 2022-05-17T09:15:35.410Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I decode the http encrypted cookie in Jmeter<p>I am now using Jmeter to prepare a test plan for my web. The rough flow of the script is that I can ch... |
72,273,445 | Finding Relationships between members with Pandas<p>I have a CSV file with more than 10,000,000 rows of data with below structures:</p>
<p>I have a TeamID as my unique code, in each TeamID 2 members(Kevin,Smith) or 3 members (Kevin,John,Smith) can exist.</p>
<pre><code>Data Format
TeamID Members MemberType
Tea... | <p>You can sort by MemberType, shift per group, and join:</p>
<pre><code>order = ['Gold', 'Silver', 'Bronze']
key = pd.Series({x: i for i,x in enumerate(order)})
df2 = df.sort_values(by='MemberType', key=key.get)
df.join(df2.groupby('TeamID')['Members'].shift().dropna().rename('Parent'),
how='right')
</code><... | Finding Relationships between members with Pandas | python|pandas | 1 | 48 | 1 | 72,273,564 | 72,273,564 | 0 | true | 2022-05-17T11:43:42.913Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Finding Relationships between members with Pandas<p>I have a CSV file with more than 10,000,000 rows of data with below structures:</p>
<p>I have a TeamID as... |
72,273,618 | The entity type required a primary key to be defined - but there is<p>I probably have a fairly trivial problem with EF configuring 1 table. This is how my class looks like:</p>
<pre><code>public class Task
{
[Key]
public int Id { get; set; }
[Required]
public string Description { get; set; }
[Disp... | <p>Ok, that was the dumbest mistake in a long time. It turned out the context was using the Task system class instead of my model class...</p> | The entity type required a primary key to be defined - but there is | entity-framework-core|entity-framework-6|.net-6.0 | 1 | 48 | 1 | 72,274,550 | 72,274,550 | 0 | true | 2022-05-17T11:55:12.490Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The entity type required a primary key to be defined - but there is<p>I probably have a fairly trivial problem with EF configuring 1 table. This is how my cl... |
72,274,622 | SQL Apply Distinct One Column<p>I have a SQL query as below. I want to apply <code>DISTINCT</code> to <code>Name</code> column in this query. Can you help me?</p>
<pre><code>SELECT Id,
ConflictCheckRequestIndividualId,
Name,
Surname,
it.IndividualType AS IndividualType,
JobTitle,
... | <p>Two ways with subtly different results. "GROUP BY X" is another way of saying "Give me one row per X". You will have to apply an aggregation function to each other row so it knows how to squash the rows into 1:</p>
<pre><code>SELECT MAX(Id),
MAX(ConflictCheckRequestIndividualId),
Na... | SQL Apply Distinct One Column | sql|sql-server|distinct | 0 | 48 | 2 | 72,275,004 | 72,275,004 | 0 | true | 2022-05-17T13:06:41.197Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL Apply Distinct One Column<p>I have a SQL query as below. I want to apply <code>DISTINCT</code> to <code>Name</code> column in this query. Can you help me... |
72,280,212 | gsub regex to work for both words boundaries and punctuation<p>I'm trying to search in sentences for both words (case insensitive) and punctuation symbols.
The below function works well for words, but requires <code>\\</code> to work for dots for example ; and thus it leads to unwanted behavior - see below:</p>
<pre><c... | <p>You need</p>
<ul>
<li><a href="https://stackoverflow.com/a/56683740/3832970">Escape special characters</a></li>
<li><a href="https://stackoverflow.com/a/45145800/3832970">Dynamic adaptive word boundaries</a></li>
<li>Since the dynamic adaptive word boundaries are lookarounds, you need to pass <code>perl=TRUE</code> ... | gsub regex to work for both words boundaries and punctuation | r|regex | 1 | 48 | 1 | 72,280,873 | 72,280,873 | 0 | true | 2022-05-17T20:21:08.620Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
gsub regex to work for both words boundaries and punctuation<p>I'm trying to search in sentences for both words (case insensitive) and punctuation symbols.
T... |
72,266,813 | FluentValidator and select element<p>I use Razor pages and want to specify a rule, when at least one selectItem should be selected for multiply select element.</p>
<p>I have the following rule:</p>
<pre><code>public class MailRangeValidator : AbstractValidator<MailsRangeModel>
{
public MailRangeValidator()
... | <p>from documentation <a href="https://docs.fluentvalidation.net/en/latest/aspnet.html" rel="nofollow noreferrer">https://docs.fluentvalidation.net/en/latest/aspnet.html</a>:</p>
<blockquote>
<p>Configuration for use with ASP.NET Razor Pages and PageModels is
exactly the same as with MVC above, but with the limitation ... | FluentValidator and select element | c#|.net|.net-6.0|fluentvalidation | 3 | 48 | 2 | 72,281,863 | 72,281,863 | 0 | true | 2022-05-16T23:59:37.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
FluentValidator and select element<p>I use Razor pages and want to specify a rule, when at least one selectItem should be selected for multiply select elemen... |
72,257,613 | BundleUrl return nil<p>I have an application which project hierarchy like this;</p>
<pre><code>ProjectApp
-AppNative
ProjectAppTest
ProjecUIAppTests
</code></pre>
<p>I have an public class swift and ı want to get bundleURL :</p>
<pre><code>public class AppBundle {
static var bundle : Bundle = AppBundle.initBund... | <p>I use .bundleURL to access bundleURL;</p>
<pre><code>public class AppBundle {
static var bundle : Bundle = AppBundle.initBundle()
class func initBundle() -> Bundle {
let podBundle = Bundle(for: AppBundle.self)
let bundleURL = podBundle.bundleURL
return Bundle(url: bundleURL!)!
... | BundleUrl return nil | swift|bundle | 0 | 48 | 2 | 72,283,712 | 72,283,712 | 0 | true | 2022-05-16T10:17:15.790Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
BundleUrl return nil<p>I have an application which project hierarchy like this;</p>
<pre><code>ProjectApp
-AppNative
ProjectAppTest
ProjecUIAppTests
</code><... |
72,275,781 | How to get list of ids into separate column<pre><code>CREATE TABLE master_tab (
e_id NUMBER(10),
owner_id NUMBER(10),
CONSTRAINT pk_master_tab PRIMARY KEY(e_id)
);
CREATE TABLE transaction_tab (
e_id NUMBER(10),
analysis_comp NUMBER(10),
CONSTRAINT fk_master_tab FOREIGN KEY(e_id) RE... | <p>@Vicky, this version is modified from you query and may be more comfortable for you.</p>
<pre><code>WITH a AS(
SELECT mt.e_id, rownum r FROM master_tab mt
JOIN transaction_tab tt ON(tt.e_id = mt.e_id AND tt.analysis_comp = 1)
WHERE mt.owner_id = 72
),
b AS(
SELECT mt.e_id, rownum r FROM master_tab mt
JOIN transactio... | How to get list of ids into separate column | sql|oracle | -1 | 48 | 1 | 72,284,626 | 72,284,626 | 0 | true | 2022-05-17T14:24:20.753Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get list of ids into separate column<pre><code>CREATE TABLE master_tab (
e_id NUMBER(10),
owner_id NUMBER(10),
CONSTRAINT pk_master_... |
72,285,294 | How to get commit on a particular date using gitlabapi query?<p>I have seen that there is query to fetch commits using since or until in gitlabapi query. I want to fetch the response for a particular date.</p>
<p>Example: I want to fetch the response for a repository's commit on 2022-04-18. I have tried with the follow... | <p>Try to specify the <strong>until</strong> and <strong>since</strong> in <strong>ISO 8601</strong> format.</p>
<p>To get a specific day you need to specify a day period e.g</p>
<pre><code>curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/5/repository/c... | How to get commit on a particular date using gitlabapi query? | gitlab|gitlab-api | 0 | 48 | 1 | 72,285,839 | 72,285,839 | 0 | true | 2022-05-18T08:00:17.270Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get commit on a particular date using gitlabapi query?<p>I have seen that there is query to fetch commits using since or until in gitlabapi query. I w... |
72,286,952 | Got stuck in 'grid-template-columns' in CSS<p>I am currently learning Django and got stuck. I have created 3 divs inside of an home container and written this CSS code for the home container -></p>
<pre><code><style type="text/css">
.home-container{
display: grid;
grid-template-co... | <p>The problem lies in your markup, you're forgetting to close a div before your third section resulting in only two children of <code>.home-container</code> with the second child holding sections 2 & 3:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class=... | Got stuck in 'grid-template-columns' in CSS | css|django | 2 | 48 | 2 | 72,287,072 | 72,287,072 | 0 | true | 2022-05-18T09:55:11.420Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Got stuck in 'grid-template-columns' in CSS<p>I am currently learning Django and got stuck. I have created 3 divs inside of an home container and written thi... |
72,285,893 | Swift: Saving file with special characters<p>I have written the following small function to load a file from a server and saved it to the app documents folder.
This func works fine. Until the filename on the server contains a German "Umlaut" like äöüß</p>
<p>The source file is like:
http:// scripts.myserver.o... | <p>My solution:
Changing the function from</p>
<pre><code>func downloadFile (fileOnServer: String, fileOnDevice: URL) async throws {
</code></pre>
<p>to</p>
<pre><code>func downloadFile (fileOnServer: URL, fileOnDevice: URL) async throws {
</code></pre>
<p>complete code:</p>
<pre><code>func downloadFile (fileOnServer: ... | Swift: Saving file with special characters | swift|character-encoding | 0 | 48 | 1 | 72,288,286 | 72,288,286 | 0 | true | 2022-05-18T08:42:45.833Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Swift: Saving file with special characters<p>I have written the following small function to load a file from a server and saved it to the app documents folde... |
72,274,071 | Pyinstaller drag-and-drop files to the --windowed app<p>How do I allow files to be dragged and dropped onto the --windowed app and allow for it to be seen as a text editor/code editor by the system (Be recommended when you click open with and can have files dragged onto it)? <a href="https://stackoverflow.com/questions... | <p>Add the desired filetypes to info_plist of the spec file</p> | Pyinstaller drag-and-drop files to the --windowed app | python|macos|pyinstaller | 0 | 48 | 1 | 72,291,354 | 72,291,354 | 0 | true | 2022-05-17T12:27:07.360Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pyinstaller drag-and-drop files to the --windowed app<p>How do I allow files to be dragged and dropped onto the --windowed app and allow for it to be seen as... |
72,293,684 | How to restore default resize property to draggable div?<p>After adding basic dragging functionality to a div, the default css resize property no longer responds. Moving the mouse over the resize corner results in the cursor changing to the resize cursor, but the resize behaviour is completely overridden by dragging be... | <p>I think it's impossible to have both working at the same time, if you keep the dragging possible on the whole card. In my opinion, the best way to achieve this, without being confusing, would be to enable dragging only on some part of the card. There is exemples on CodePen if you search for "drag resize".<... | How to restore default resize property to draggable div? | javascript|html|css|resize|draggable | 1 | 48 | 1 | 72,293,914 | 72,293,914 | 0 | true | 2022-05-18T17:38:03.703Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to restore default resize property to draggable div?<p>After adding basic dragging functionality to a div, the default css resize property no longer resp... |
72,298,350 | Simple movie database error, python type uniterable<p>I am trying to design some code that accepts entry of movie titles and durations, adds them to an object which then is sorted and prints the three longest movies, it runs until the last line and then fails, how should I be doing it differently?</p>
<pre><code>class ... | <p>Your <code>print_longest_movies</code> function is confusing the difference between a list of objects, and their type. <code>Movie</code> is not a list of things. It's just the name of the class. Plus, <code>sorted</code> RETURNS the sorted array. It doesn't CHANGE the array. You want:</p>
<pre><code> def pr... | Simple movie database error, python type uniterable | python | -2 | 48 | 1 | 72,298,377 | 72,298,377 | 0 | true | 2022-05-19T03:36:49.857Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Simple movie database error, python type uniterable<p>I am trying to design some code that accepts entry of movie titles and durations, adds them to an objec... |
72,298,170 | Use specific elements from JSON data and display it on a React page?<p>In react stock quote data is pulled from an api which returns JSON and I can get the JSON displayed in my react app.</p>
<p>How can I convert the JSON data to look like this on my React page:</p>
<p><strong>Market Summary > T $20.56</strong></p>
... | <p>I think this should work.</p>
<pre class="lang-js prettyprint-override"><code>state = {
value: [],
quotes: []
}
componentDidMount() {
// axios.get(`http://localhost/php-rest-api/api/getstockprice.php?stock_ticker=GME`)
// .then(res => {
// const quotes = res.data;
// t... | Use specific elements from JSON data and display it on a React page? | reactjs | 1 | 48 | 2 | 72,298,460 | 72,298,460 | 0 | true | 2022-05-19T03:07:07.573Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Use specific elements from JSON data and display it on a React page?<p>In react stock quote data is pulled from an api which returns JSON and I can get the J... |
72,302,853 | AttributeError: module 'scipy.misc' has no attribute 'imresize' please how can i solve this?<p>Please please here is the line of code that returns an error to me: AttributeError: module 'scipy.misc' has no attribute 'imresize'</p>
<pre><code>mask = np.reshape(binarized_predict_masks[j], newshape=(input_img_size, input_... | <p>you are trying to call a removed function.
The function <code>imresize</code> was removed in Scipy 1.3.0 as written in the documentation of the function: <a href="https://docs.scipy.org/doc/scipy-1.2.1/reference/generated/scipy.misc.imresize.html" rel="nofollow noreferrer">https://docs.scipy.org/doc/scipy-1.2.1/refe... | AttributeError: module 'scipy.misc' has no attribute 'imresize' please how can i solve this? | python | 0 | 48 | 1 | 72,303,000 | 72,303,000 | 0 | true | 2022-05-19T10:22:17.983Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AttributeError: module 'scipy.misc' has no attribute 'imresize' please how can i solve this?<p>Please please here is the line of code that returns an error t... |
72,302,371 | Why doesn't the code on Heroku get updated after updating the code on GitHub?<p>I'm making a simple TODO app and want to upload it to HEROKU.
But after I updated the code on Github, heroku code remained the same.
I've tried <a href="https://stackoverflow.com/questions/22600382/heroku-is-not-updating-my-code">this</a> a... | <p>Heroku's GitHub integration <a href="https://status.heroku.com/incidents/2413" rel="nofollow noreferrer">has been disabled for over a month</a> as part of a security response. It appears that it will remain disabled for another week or so:</p>
<blockquote>
<p>Based on current progress, we plan to complete our invest... | Why doesn't the code on Heroku get updated after updating the code on GitHub? | reactjs|django|heroku | 0 | 48 | 1 | 72,303,973 | 72,303,973 | 0 | true | 2022-05-19T09:51:12.090Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why doesn't the code on Heroku get updated after updating the code on GitHub?<p>I'm making a simple TODO app and want to upload it to HEROKU.
But after I upd... |
72,304,329 | How to use scrapy with html content<p>I have written a code using playwright that returns html content.
My question is if there is a method to call scrapy to read from this html content or scrapy reads only from urls ?</p>
<p>I will apreciate any answer from you.</p>
<p>Thanks !</p> | <p>I would suggest write that returned HTML content to a file and
use this to scrape local file using:</p>
<pre><code>import scrapy
import os
LOCAL_FILENAME = 'example.html'
LOCAL_FOLDER = 'html_files'
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
class ExampleSpider(scrapy.Spider):
name... | How to use scrapy with html content | python|scrapy|playwright | 0 | 48 | 1 | 72,305,743 | 72,305,743 | 0 | true | 2022-05-19T12:12:30.133Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use scrapy with html content<p>I have written a code using playwright that returns html content.
My question is if there is a method to call scrapy to... |
72,307,983 | Trim string before numbers (0-9) in SQL<p>I want to remove all the letters before numbers in the below strings:</p>
<pre>
BIO105L
BIO106
BIO106L
BIO201
</pre>
<p>I want the letters after the number to stay and not trimmed.</p>
<p>I tried to do this:</p>
<pre><code>select right(s.EVENT_ID, len(s.EVENTID) - charindex('%[... | <p>You are likely looking for <a href="https://docs.microsoft.com/de-de/sql/t-sql/functions/patindex-transact-sql" rel="nofollow noreferrer">PATINDEX</a> as you are searching for a pattern:</p>
<pre><code>SELECT RIGHT(s.EVENT_ID, LEN(s.EVENT_ID) - PATINDEX('%[0-9]%', s.EVENT_ID) + 1) FROM EVENTS s
</code></pre> | Trim string before numbers (0-9) in SQL | sql | 0 | 48 | 1 | 72,308,359 | 72,308,359 | 0 | true | 2022-05-19T16:23:27.220Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Trim string before numbers (0-9) in SQL<p>I want to remove all the letters before numbers in the below strings:</p>
<pre>
BIO105L
BIO106
BIO106L
BIO201
</pre... |
72,308,879 | How to Resize an Image in Swing?<p>I've learnt how to add an image in Javax swing a lot of times.
I've used containers and all imageicons, however the problem is that my photos are too large to fit in. They are above 1800*1700 pixels in size and the screen obviously can't accomodate them.
I would request you guys to su... | <p>I suppose it depends upon whether or not you want to maintain the <strong><a href="https://en.wikipedia.org/wiki/Aspect_ratio_(image)" rel="nofollow noreferrer">Aspect Ratio</a></strong> of the image you are loading into the JLabel.</p>
<p>In any case, below is a runnable which takes Aspect Ratio into account so tha... | How to Resize an Image in Swing? | java|image|swing | -3 | 48 | 2 | 72,310,504 | 72,310,504 | 0 | true | 2022-05-19T17:35:14.980Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to Resize an Image in Swing?<p>I've learnt how to add an image in Javax swing a lot of times.
I've used containers and all imageicons, however the proble... |
72,311,380 | How to remove multiple words, Not replace!, from a string Java<p>I'm new to java and currently I'm learning strings.</p>
<p>How to remove multiple words from a string? I would be glad for any hint.</p>
<p>The replacement doesn't work as it deletes a part of a word.</p>
<pre><code>class WordDeleterTest {
public stat... | <pre><code>class WordDeleter {
public String remove(String phrase, String[] words) {
String result = phrase;
for (String word : words) {
result = result.replaceAll("\\b" + word + "\\b", "");
}
return result.trim().replaceAll(" +", &... | How to remove multiple words, Not replace!, from a string Java | java|string|replaceall | 0 | 48 | 3 | 72,311,522 | 72,311,522 | 0 | true | 2022-05-19T21:43:29.377Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to remove multiple words, Not replace!, from a string Java<p>I'm new to java and currently I'm learning strings.</p>
<p>How to remove multiple words from... |
72,310,490 | Deblurring using inverse filtering doesn't work<p>I have a group project where we have to implement a Wiener Filter. But despite trying everything we can't find a way to make anything work...</p>
<p>For now we would just love to manage to use inverse filtering.
Even when we decide to take the source code from a site ex... | <p>Ok it was simply the n that was too big.
When I tried to put n = 0.00000001 it worked fine !</p> | Deblurring using inverse filtering doesn't work | python|matlab|math|image-processing|filter | 1 | 48 | 1 | 72,315,902 | 72,315,902 | 0 | true | 2022-05-19T20:04:26.887Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Deblurring using inverse filtering doesn't work<p>I have a group project where we have to implement a Wiener Filter. But despite trying everything we can't f... |
72,305,152 | Erro trying to build qml lib to Android<p>I'm using a qml lib with a qt c++ projetc, and work well in linux and windows, but when I try to build to Android I receive this error:</p>
<pre><code>make: *** No rule to make target 'install'. Stop.
09:40:07: The process "/home/ysaakue/Android/Sdk/ndk/21.3.6528147/prebu... | <p>Apparently the problem was because this project is a lib, and in the default build steps has some to copy the files to target device, and in my case it isn't required, so I disabled(using the QtCreator interface as bellow) the last two stets and the problem was solved. (for now at least).</p>
<p><a href="https://i.s... | Erro trying to build qml lib to Android | android|c++|qt|qml | 0 | 48 | 2 | 72,320,526 | 72,320,526 | 0 | true | 2022-05-19T13:08:02.753Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Erro trying to build qml lib to Android<p>I'm using a qml lib with a qt c++ projetc, and work well in linux and windows, but when I try to build to Android I... |
72,322,584 | Improve calculation time in parallel mode<p>I am new in the multithreading in Java, so I have a question about how to reduce calculation time in this example, without using Executors, Frameworks, etc, only plain threads?</p>
<pre><code>public static void main(String[] args) throws TestException {
Set<Double>... | <p>Try to create a class that extends <code>Thread</code> or implements <code>Runnable</code>, add the details on the <code>calculate()</code> method to the <code>run()</code> method of the new class.</p>
<p>Now in the for loop of main function create new threads of type of the new class and <code>start()</code> them.
... | Improve calculation time in parallel mode | java|multithreading|concurrency | 0 | 48 | 2 | 72,323,180 | 72,323,180 | 0 | true | 2022-05-20T17:15:12.960Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Improve calculation time in parallel mode<p>I am new in the multithreading in Java, so I have a question about how to reduce calculation time in this example... |
72,322,816 | List Indexing - Read File, Find Specific String, Replace String, Output New File<p>I have the following code, which i am attempting to read any file in, line by line searching for specific values from a list. If a value from within the old list is found, replace the found string with the same index position from old li... | <p>You could either use a dictionary as a look-up table or have another for-loop checking the list of values.</p>
<p>I also recommend you use the <code>with</code> syntax when opening a file, then you don't need to manually close it in the end.</p>
<pre class="lang-py prettyprint-override"><code>with open("foo&quo... | List Indexing - Read File, Find Specific String, Replace String, Output New File | python|list|indexing | 0 | 48 | 2 | 72,323,326 | 72,323,326 | 0 | true | 2022-05-20T17:37:26.463Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
List Indexing - Read File, Find Specific String, Replace String, Output New File<p>I have the following code, which i am attempting to read any file in, line... |
72,315,235 | Spring, catch exception<p>I have small problem. I can't catch exception in method. I need to catch <code>ConstraintViolationException</code> to process it. Somebody know why it happens?</p>
<pre><code>@Transactional(rollbackFor = Exception.class)
public void saveCustomer(Customer customer) {
Session session = sessi... | <p>I ran into similar problem some days ago.
I looked at the StackTrace and used <code>PersistenceException</code>.</p>
<p>Try it:</p>
<pre><code>@Transactional(rollbackFor = Exception.class)
public void saveCustomer(Customer customer) {
Session session = sessionFactory.getCurrentSession();
try {
sess... | Spring, catch exception | java|spring|hibernate|transactions | 0 | 48 | 2 | 72,329,982 | 72,329,982 | 0 | true | 2022-05-20T07:42:07.420Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spring, catch exception<p>I have small problem. I can't catch exception in method. I need to catch <code>ConstraintViolationException</code> to process it. S... |
72,335,776 | How do I pass type in c# methods?<p>I want to write a method which searches for an object in my list, which can contain multiple inherited types.</p>
<pre><code>public class MyClass
{
public readonly List<parentType> objects = new List<parentType>();
public parentType GetObject(Type type, string tag... | <p>You have several possibilities here:</p>
<ul>
<li><p>use <code>typeof</code> - <code>GetObject(typeof(childType), "tag")</code></p>
</li>
<li><p>rewrite your function in generic way and use type as generic parameter</p>
<pre><code>public parentType GetObject<T>(string tag) where T: parentType
{
//u... | How do I pass type in c# methods? | c#|methods|types|parameter-passing | 0 | 48 | 1 | 72,335,827 | 72,335,827 | 0 | true | 2022-05-22T07:58:14.407Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I pass type in c# methods?<p>I want to write a method which searches for an object in my list, which can contain multiple inherited types.</p>
<pre><c... |
72,336,671 | export place of styled component<p>Suddenly I was wondering about the location. Where do you place and use EXPORT?</p>
<pre><code>import React from 'react';
import styled from 'styled-components';
const App = () => {
return <Title>hello world</Title>;
};
export default App; // 1
const ... | <p>As @max-yankov noted, there are many different ways to do this similar to the folder structure of a React project. For your own projects, I would recommend that you always use the same methodology to implement a consistent app build. If you are working for a company or with a team on a project, there is usually alwa... | export place of styled component | reactjs|styled-components | 0 | 48 | 2 | 72,337,171 | 72,337,171 | 0 | true | 2022-05-22T10:23:00.213Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
export place of styled component<p>Suddenly I was wondering about the location. Where do you place and use EXPORT?</p>
<pre><code>import React from 'react';
... |
72,338,264 | time.strptime doesn't parse timezone<pre><code>time.strptime('Sun, 22 May 2022 10:50:14 +0000','%a, %d %b %Y %H:%M:%S %z')
</code></pre>
<p>and</p>
<pre><code>time.strptime('Sun, 22 May 2022 10:50:14 +0800','%a, %d %b %Y %H:%M:%S %z')
</code></pre>
<p>both give the same result</p>
<pre><code>time.struct_time(tm_year=20... | <p>Did you use the method <a href="https://docs.python.org/3/library/datetime.html#datetime.datetime.strptime" rel="nofollow noreferrer">datetime.strptime</a>? When I tested locally, it seems to be able to take timezone into account even when comparing two time parse from different timezone</p>
<pre><code>>>> ... | time.strptime doesn't parse timezone | python|strptime | 0 | 48 | 1 | 72,338,633 | 72,338,633 | 0 | true | 2022-05-22T13:59:13.630Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
time.strptime doesn't parse timezone<pre><code>time.strptime('Sun, 22 May 2022 10:50:14 +0000','%a, %d %b %Y %H:%M:%S %z')
</code></pre>
<p>and</p>
<pre><cod... |
72,335,039 | How to make discord wait for the script to finish running and how to not reply to discord before getting the data needed?<p>I'm new to node.js and async programming so I'm a bit confused on why this is happening. I am trying to run a discord bot which will give me data from a 3rd party website. I am able to query the d... | <p>this should work for ya!</p>
<pre><code>async execute(interaction) {
await runScript(scriptPath)
.then(output => interaction.reply(output))
}
</code></pre>
<p>it will <code>await</code> the script which literally means to wait for it to finish it's promises, then will grab the output from that and reply wit... | How to make discord wait for the script to finish running and how to not reply to discord before getting the data needed? | javascript|node.js|async-await|discord|discord.js | 0 | 48 | 1 | 72,339,883 | 72,339,883 | 0 | true | 2022-05-22T05:35:46.510Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make discord wait for the script to finish running and how to not reply to discord before getting the data needed?<p>I'm new to node.js and async prog... |
72,341,825 | Why is it that array outputs have a () with a number next to it in VS code?<p>Why is it that array outputs have a () with a number next to it in VS code?</p>
<p>Code:</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-... | <p>It is just the elements count. BTW, <code>console.log()</code> of any object (an array is also an object) is parsed in that way.</p>
<p><a href="https://i.stack.imgur.com/r3yU2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r3yU2.png" alt="enter image description here" /></a></p> | Why is it that array outputs have a () with a number next to it in VS code? | javascript|arrays|visual-studio | 0 | 48 | 1 | 72,341,914 | 72,341,914 | 0 | true | 2022-05-22T22:56:21.200Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is it that array outputs have a () with a number next to it in VS code?<p>Why is it that array outputs have a () with a number next to it in VS code?</p>... |
72,288,801 | Set Fabric runtime version<p>Have multiple versions of Fabric runtimes on local machine (8.1, 8.2, and 9.0 series) which can be listed with:</p>
<pre><code>Get-ServiceFabricRuntimeSupportedVersion
</code></pre>
<p>Have combed the Fabric documentation + web for anything about switching (changing) the SDK or Runtime vers... | <p>From the Control Panel choose Uninstall Programs and removed Fabric (6.0 SDK and Runtime). Restarted Windows (PC). Unclear if a restart is really necessary. Then opened the Web Platform Installer and through Spotlight searched for Fabric to click on Add. That put back 4.2.1235 of the SDK I needed. Done.</p> | Set Fabric runtime version | powershell|version|azure-service-fabric | 0 | 48 | 2 | 72,344,509 | 72,344,509 | 0 | true | 2022-05-18T11:59:07.523Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Set Fabric runtime version<p>Have multiple versions of Fabric runtimes on local machine (8.1, 8.2, and 9.0 series) which can be listed with:</p>
<pre><code>G... |
72,346,706 | Cors blocks my request even after enabling it in config<p>Hey I am building a web site in react and I tried fetching data from my backend server built in spring but It won't work. I added CorsConfigurationSource to my security config yet it still doesnt work.
My cors security config:</p>
<pre><code>@Bean
CorsConfigurat... | <p>CORS in Google Chrome is a bit special on <code>localhost</code>.
Read more about it <a href="https://stackoverflow.com/questions/10883211/why-does-my-http-localhost-cors-origin-not-work">here</a>.</p>
<p>On top of that, PORT does matter in CORS. Note that you enabled port 3000 in your Spring config, but are fetchin... | Cors blocks my request even after enabling it in config | javascript|spring-boot|http|spring-security|cors | -1 | 48 | 2 | 72,346,808 | 72,346,808 | 0 | true | 2022-05-23T10:05:06.300Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cors blocks my request even after enabling it in config<p>Hey I am building a web site in react and I tried fetching data from my backend server built in spr... |
72,347,632 | Select only unique ids row of table with different values in Descending order<p>I'm trying to get data that have the same medicine_id and unique insurance_id and last inserted row. Put Group by and Order by but in that got random data not last inserted.
I tried this code but got not last inserted data</p>
<pre><code>SE... | <p>MySQL 5.x: Use a sub-query to find the max created_at value per group, then join that on the source table to identify the row it was from.</p>
<pre><code>SELECT
p.`*`
FROM
`pricings` p
INNER JOIN
(
SELECT
`medicine_id`,
`insurance_id`,
MAX(created_at) AS `created_at`
FROM
`pricings`
GRO... | Select only unique ids row of table with different values in Descending order | mysql|sql|join|mysql-select-db | 0 | 48 | 2 | 72,348,379 | 72,348,379 | 0 | true | 2022-05-23T11:16:32.077Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Select only unique ids row of table with different values in Descending order<p>I'm trying to get data that have the same medicine_id and unique insurance_id... |
72,358,143 | How to fix Argument of type '() => AbstractControl[]' is not assignable to parameter of type 'array[]'?<p>I have chosen to use reactive forms for my form and I have a list of checkboxes to check, and I'm trying to use the <code>FormArray</code> to do this, however when I call my function in my Ng for , I got this error... | <p>try this</p>
<pre><code>getControls(): FormArray {
return this.form.get('engins') as FormArray;
}
</code></pre>
<p>Alternative, you can modify your code with some trick to be:</p>
<pre><code>get controls(): FormArray {
return this.form.get('engins') as FormArray;
}
</code></pre>
<p>and usage:</p>
<pre><code>*ngF... | How to fix Argument of type '() => AbstractControl[]' is not assignable to parameter of type 'array[]'? | angular|typescript | 0 | 48 | 1 | 72,358,508 | 72,358,508 | 0 | true | 2022-05-24T06:30:36.477Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to fix Argument of type '() => AbstractControl[]' is not assignable to parameter of type 'array[]'?<p>I have chosen to use reactive forms for my form and... |
72,360,664 | saxonc's transform_to_file() produces no output file when supplying xdm_node<p>This seems to be answered by @alinaOS in
<a href="https://stackoverflow.com/questions/71021778/saxonc-11-1-transform-to-file-produces-no-output-file">SaxonC 11.1 transform_to_file Produces No Output File</a> but doesn't answer their question... | <p>Apply_templates_returning_file works:</p>
<pre><code>import os
import xml.etree.ElementTree as ET
from saxonpy import PySaxonProcessor
def main():
print('starting code...')
source_XML = '''
<data>
<country name="Denmark" capital="Copenhagen"/>
... | saxonc's transform_to_file() produces no output file when supplying xdm_node | python|xml|xslt|saxon|saxon-c | 0 | 48 | 1 | 72,368,481 | 72,368,481 | 0 | true | 2022-05-24T09:42:54.603Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
saxonc's transform_to_file() produces no output file when supplying xdm_node<p>This seems to be answered by @alinaOS in
<a href="https://stackoverflow.com/qu... |
72,364,864 | Issues with writing compressed FlatBuffer to file and reading back from file<p>I have successfully able to write FlatBuffer data to file and can read back from the file. But now I am trying to compress the Flatbuffer data before writing to file. When I try to read the compressed data back from the file and decompress i... | <p>Looks like you are zipping the <code>ByteBuffer</code> which is the backing array to the flatbuffer, and doesn't start at 0. It would be better to serialize the raw <code>byte[]</code> you get from <code>builder.sizedByteArray()</code>.</p> | Issues with writing compressed FlatBuffer to file and reading back from file | gzip|flatbuffers | 0 | 48 | 1 | 72,369,553 | 72,369,553 | 0 | true | 2022-05-24T14:39:01.757Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Issues with writing compressed FlatBuffer to file and reading back from file<p>I have successfully able to write FlatBuffer data to file and can read back fr... |
72,371,604 | Optaplanner Penalty Not Working With a Nullable Variable<p>I am using OptaPlanner with two planning variables, one of them defined with nullable=true.
Following a Meeting example (for simplicity), say the Room could be null but the Time can't be null.</p>
<p>I defined a constraint on the non-null, <code>time</code> var... | <p><code>forEach()</code> will not work here, as that will only give you entities where none of the variables are null. <code>forEachIncludingNullVars()</code> is the way to go here. But you also need to understand that <code>join</code> has the same behavior as <code>forEach</code>- it does not include entities with n... | Optaplanner Penalty Not Working With a Nullable Variable | null|constraints|optaplanner | 0 | 48 | 1 | 72,373,440 | 72,373,440 | 0 | true | 2022-05-25T03:15:22.593Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Optaplanner Penalty Not Working With a Nullable Variable<p>I am using OptaPlanner with two planning variables, one of them defined with nullable=true.
Follow... |
72,375,342 | NullPointerException when invoking AppBarLayout - Android<p>I'm trying to make a youtube clone app.</p>
<p>My AppBarLayout from the .XML file is returning :</p>
<p><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.StreamingApplicationNactus/com.example.StreamingApplicationNactus.HomeA... | <p>When you are using Fragment, you need to inflate the view.</p>
<p>Remove these codes:</p>
<pre><code> appBarLayout = (AppBarLayout) findViewById(R.id.newappBar);
appBarLayout.setVisibility(View.VISIBLE);
</code></pre>
<p>And then at your <code>onCreateView</code>. Add these lines:</p>
<pre><code>@Override
public Vi... | NullPointerException when invoking AppBarLayout - Android | java|android|xml|android-layout|nullpointerexception | -2 | 48 | 1 | 72,375,449 | 72,375,449 | 0 | true | 2022-05-25T09:46:32.610Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
NullPointerException when invoking AppBarLayout - Android<p>I'm trying to make a youtube clone app.</p>
<p>My AppBarLayout from the .XML file is returning :<... |
72,376,669 | What is a best practice to initialize an object at runtime in a method in java?<p>I have a java method:</p>
<pre><code>public void method(JSONObject jsonRequest, String token, int size) {
DataRequest request = new DataRequest(size);
request.from(jsonRequest);
if (StringUtils.isNotEmpty(token)) {
re... | <p>You can create a functional <code>interface</code> creating the instance like (due to your parameter list you cannot use <code>Supplier</code> or <code>(Bi)Function</code>):</p>
<pre><code>@FunctionalInterface
interface DataRequestFactory {
DataRequest buildDataRequest(JSONObject jsonRequest, String token, int s... | What is a best practice to initialize an object at runtime in a method in java? | java|inheritance|constructor|polymorphism|overriding | 0 | 48 | 1 | 72,377,364 | 72,377,364 | 0 | true | 2022-05-25T11:19:59.113Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is a best practice to initialize an object at runtime in a method in java?<p>I have a java method:</p>
<pre><code>public void method(JSONObject jsonRequ... |
72,378,909 | Unable manage objects in array independently<p>I'm working on a text editor using React and I want to keep track of the changes in an array. Whenever I make changes an object is added to the array (as it should) but all the other objects change as well and become the same as the new one. I'm aware of how Javascript doe... | <p>The problem is in <code>updateTextbox</code>. With <code>{...this.state.document.content}</code> it only creates a shallow copy. In this copy the <code>textboxes</code> property will still reference the <em>same</em> object. And you <em>mutate</em> that object by the assignment to its <code>[key]</code> property. So... | Unable manage objects in array independently | javascript|reactjs | 0 | 48 | 1 | 72,380,028 | 72,380,028 | 0 | true | 2022-05-25T13:50:52.903Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable manage objects in array independently<p>I'm working on a text editor using React and I want to keep track of the changes in an array. Whenever I make ... |
72,381,858 | Moving variables in nested Loop JavaScript<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>function transformEmployeeData(employeeData) {
var arr = [];
var obj = {};
for (var ... | <p>If you don't put it in the loop, you are defining a single object and are just modifying its contents within the loop body and pushing that single object into the array.</p>
<p>But, if you include it inside the loop, you create a new object each time the loop body executes (and the existing variable stops pointing t... | Moving variables in nested Loop JavaScript | javascript|arrays|loops | 0 | 48 | 3 | 72,381,926 | 72,381,926 | 0 | true | 2022-05-25T17:19:46.757Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Moving variables in nested Loop JavaScript<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippe... |
72,385,879 | in a postgres container, where are the imported extensions located?<p>i would like to create a volume on that directory, and bring in plpython and postgis extensions.</p>
<p>for some reason i am unable to create extensions from within a container.</p>
<p>i have tried to run the postgres container by using the local ver... | <p>Postgres extensions are implemented as shared library modules (<code>.so</code>) files, generally located in <code>/usr/lib/postgresql/14/lib</code>. So for example, the control file for the <code>plpgsql</code> extension (<code>/usr/share/postgresql/14/extension/plpgsql.control</code>) looks like this:</p>
<pre><co... | in a postgres container, where are the imported extensions located? | python|postgresql|docker | -1 | 48 | 1 | 72,386,084 | 72,386,084 | 0 | true | 2022-05-26T01:57:38.710Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
in a postgres container, where are the imported extensions located?<p>i would like to create a volume on that directory, and bring in plpython and postgis ex... |
72,346,944 | Reading JSON file from azure Container to Data Bricks as Dictionary<p>I have a prefect JSON file in Azure container as the file is created using python dictionary, I can see the file with the help of dbutils and even read it by head but head can't read the whole file.</p>
<p>Using <code>spark.read.json(file_path)</code... | <p>Just simple open command works for this issue, just have to be careful with
json load and loads</p>
<pre><code>json_path = './config/jsonfile.json'
jsonData = open(json_path)
dictionaryObj = json.load(jsonData)
</code></pre> | Reading JSON file from azure Container to Data Bricks as Dictionary | python|json|dataframe|pyspark|databricks | 0 | 48 | 1 | 72,402,365 | 72,402,365 | 0 | true | 2022-05-23T10:23:05.997Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reading JSON file from azure Container to Data Bricks as Dictionary<p>I have a prefect JSON file in Azure container as the file is created using python dicti... |
72,398,720 | How to host a json file on the internet to consume with fetch?<p>I need to host a json file on the internet that allows GET and POST requests. I would consume data and send new data to this json, with javascript Fetch api would do the manipulations on the file.
For a college activity, for a website I'm creating.
would ... | <p>So, you can use this api <a href="https://myjson.dit.upm.es/" rel="nofollow noreferrer">https://myjson.dit.upm.es/</a> to store your data json and request it with FETCH API. I hope I have solved your problem</p> | How to host a json file on the internet to consume with fetch? | javascript|json | -2 | 48 | 1 | 72,409,057 | 72,409,057 | 0 | true | 2022-05-26T22:40:49.390Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to host a json file on the internet to consume with fetch?<p>I need to host a json file on the internet that allows GET and POST requests. I would consum... |
72,362,952 | Is there a method to find a file by hash in JGit<p>I am coding a Java program with JGit to handle the local Git repository. I am wondering if there is a way to find a committed file via hash in JGit like what the command git file-cat -p does in the terminal? To be specific, given the hash of a file, the program should... | <p>I found a tutorial that solves my question: <a href="https://www.codeaffine.com/2014/10/20/git-internals/" rel="nofollow noreferrer">https://www.codeaffine.com/2014/10/20/git-internals/</a></p>
<p>Here is the core code in this tutorial that corresponds to the command git file-cat:</p>
<pre><code>ObjectReader objectR... | Is there a method to find a file by hash in JGit | java|jgit | 0 | 48 | 1 | 72,439,464 | 72,439,464 | 0 | true | 2022-05-24T12:32:57.793Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a method to find a file by hash in JGit<p>I am coding a Java program with JGit to handle the local Git repository. I am wondering if there is a way ... |
72,396,772 | Flutter Future returning instance of future<p>I am making an api call to receive data. When I make the call, I get back an instance of future. Why does this still return an instance of future instead of waiting for the data?</p>
<p>Here is my networking file</p>
<pre><code>class NetworkHelper {
NetworkHelper(this.url... | <p>Your <code>getSecureData</code> method is returning a Future with no type associated, so try including a type to the the Future such as</p>
<pre><code>Future<SomeType> getSecureData() async {
//..
}
</code></pre> | Flutter Future returning instance of future | flutter | 0 | 48 | 1 | 72,397,337 | 72,397,337 | 0 | true | 2022-05-26T19:01:42.267Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter Future returning instance of future<p>I am making an api call to receive data. When I make the call, I get back an instance of future. Why does this ... |
72,284,031 | Need to separate particular String from array in javascript<p>I have a output like this</p>
<p>Output :</p>
<pre><code>[{service: 'xdc'},{service: 'cddc'}, {service:
'cdcd'},{service: 'cddc'}]
</code></pre>
<p>I need to convert like this</p>
<p>output : <code>[xdc,cddc,cdcd,cddc]</code></p> | <p>You can use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map" rel="nofollow noreferrer">Array.prototype.map()</a> combined with <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment" rel="nofollow noreferrer">D... | Need to separate particular String from array in javascript | javascript|arrays|for-loop | 0 | 48 | 3 | 72,284,072 | 72,284,072 | 0 | true | 2022-05-18T06:16:42.080Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Need to separate particular String from array in javascript<p>I have a output like this</p>
<p>Output :</p>
<pre><code>[{service: 'xdc'},{service: 'cddc'}, {... |
72,334,777 | Why my arrow shortcuts don't work after I apply a custom ButtonStyle in SwiftUI?<p>Built for macOS 12. After I use my custom <code>ButtonStyle</code> like below. The arrow <code>KeyboardShortcut</code> won't work, but other shortcuts like <code>space</code> or <code>return</code> or directly click work fine.</p>
<pre><... | <p>Looks like a SwiftUI bug. Here is possible safe workaround (tested with Xcode 13.3 / macOS 12.3.1)</p>
<p>Here is main part:</p>
<pre><code> ZStack {
Button("", action: button3action)
.opacity(0)
.keyboardShortcut(.downArrow, modifiers: [])
But... | Why my arrow shortcuts don't work after I apply a custom ButtonStyle in SwiftUI? | swift|swiftui | 1 | 48 | 1 | 72,335,375 | 72,335,375 | 0 | true | 2022-05-22T04:20:09.940Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why my arrow shortcuts don't work after I apply a custom ButtonStyle in SwiftUI?<p>Built for macOS 12. After I use my custom <code>ButtonStyle</code> like be... |
72,381,549 | Flutter - SetState not working on extracted widgets<p>Hello so basically I want to know why setState() works on widgets extracted as methods but does not work on widgets extracted as widgets....</p>
<p>and also when to use extracted widgets/ extracted widgets as methods or are they both the same? but I guess they cant ... | <p><code>setState()</code> actually doesn't care if it is extracted widget och method. It has no "check" for that.</p>
<p>It tells the UI that the state of the widget has changed, and that it might be needed to redraw. It schedules a new build. But it does not necessarily redraw everything if it doesn't <stro... | Flutter - SetState not working on extracted widgets | flutter | 1 | 48 | 2 | 72,381,722 | 72,381,722 | 0 | true | 2022-05-25T16:50:13.527Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter - SetState not working on extracted widgets<p>Hello so basically I want to know why setState() works on widgets extracted as methods but does not wor... |
72,341,265 | Python - if inside of an if<p>My script looks for certain bluetooth state criterias (if it's turned On and if there's no device connected) through the first loop and then sleeps 10 seconds to allow the user to change the bluetooth state and then checks again the same criterias before executing a prompt.</p>
<p>What I d... | <p>You run the <code>subprocess</code> to get the <code>BT_state</code> before the sleep but you don't run it again after the sleep so the variable <code>BT_state</code> is not updated. Effectively you are checking the same thing twice.</p>
<p>I have refactored your code below to separate out the different pieces in th... | Python - if inside of an if | python-3.x|if-statement|terminal|bluetooth|notifications | 0 | 48 | 2 | 72,344,474 | 72,344,474 | 0 | true | 2022-05-22T20:59:01.247Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python - if inside of an if<p>My script looks for certain bluetooth state criterias (if it's turned On and if there's no device connected) through the first ... |
72,314,805 | Missing type definition information in VS Code when own Node.js package is published on NPM<p>I cannot figure out why, once my own <a href="https://www.npmjs.com/package/efficy-enterprise-api" rel="nofollow noreferrer"><code>efficy-enterprise-api</code></a> NPM package is published, the type definitions (used by VS Cod... | <p>I deduced the issue to the usage of the separated <code>./@typings</code> folder for the generate <code>.mts</code> and <code>.mts.map</code> files. I was unable to find a functional configuration of package.json to point to these multiple generated files (not only <code>index.mjs</code>)</p>
<p>By running typescrip... | Missing type definition information in VS Code when own Node.js package is published on NPM | node.js|npm|jsdoc | 0 | 48 | 1 | 72,466,595 | 72,466,595 | 0 | true | 2022-05-20T07:00:10.827Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Missing type definition information in VS Code when own Node.js package is published on NPM<p>I cannot figure out why, once my own <a href="https://www.npmjs... |
72,370,405 | Finding difference between dates in two rows where one can be null in Python<p>I have a dataset with two datetime columns (let's say Call_Date & Transaction_Date). Call_Date is always populated, as we are only looking for instances where we were able to reach a consumer. Then, if the consumer makes a transaction, w... | <p><a href="https://i.stack.imgur.com/IIkBx.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/IIkBx.jpg" alt="https://i.stack.imgur.com/IIkBx.jpg" /></a></p>
<p>following working for me. please check the attached image to see output</p>
<pre><code>from dateutil.parser import *
import pandas as pd
impor... | Finding difference between dates in two rows where one can be null in Python | python|pandas|numpy|datetime|null | 1 | 48 | 1 | 72,370,761 | 72,370,761 | 0 | true | 2022-05-24T23:15:23.360Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Finding difference between dates in two rows where one can be null in Python<p>I have a dataset with two datetime columns (let's say Call_Date & Transact... |
72,262,796 | drop rows if before match code within an order<p>I have a series of individuals represented by ID's that are associated with addresses in an order. Some, but not all, of those individuals have an address with a positive match code (matchcode = 1). I want to drop all the addresses before that match code, keeping the one... | <p>After grouping by 'ID', <code>match</code> the position of 1 in the 'matchcode', get the <code>seq</code>uence and use <code>slice</code> to subset the rows. If there are not cases, <code>nomatch</code> will return the number of rows (<code>n()</code>), thus we get all the observations</p>
<pre><code>library(dplyr)
... | drop rows if before match code within an order | r | 3 | 48 | 1 | 72,262,855 | 72,262,855 | 0 | true | 2022-05-16T16:48:41.213Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
drop rows if before match code within an order<p>I have a series of individuals represented by ID's that are associated with addresses in an order. Some, but... |
72,254,262 | How to find a value that doesn't exist in one table through another table in SQL<p><strong>Publisher Table</strong>
<a href="https://i.stack.imgur.com/npA5s.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/npA5s.png" alt="Publisher Table" /></a></p>
<p><strong>Book Table</strong>
<a href="https://i.st... | <p>You have to use condition <code>PublisherID IS NOT NULL</code> inside sub query. Your <code>NULL</code> record was returning <code>false</code> for all rows.</p>
<pre><code>SELECT PublisherID
FROM Publisher
WHERE PublisherID NOT IN (SELECT PublisherID FROM Book WHERE PublisherID IS NOT NULL);
</code></pre>
<hr />... | How to find a value that doesn't exist in one table through another table in SQL | sql-server | 1 | 48 | 2 | 72,254,338 | 72,254,338 | 0 | true | 2022-05-16T04:50:08.727Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to find a value that doesn't exist in one table through another table in SQL<p><strong>Publisher Table</strong>
<a href="https://i.stack.imgur.com/npA5s.... |
72,250,696 | These values aren't comparing in this function (vanilla javascript)<p>I know the answer to this is probably really simple, as it's only a simple number guessing game. For whatever reason the comparison between "num1" and "num2" in the function and the code that follows doesn't execute.</p>
<p>Notabl... | <p>The problem is that you are comparing a string with a number.</p>
<p>With <code>value</code> you query a string:</p>
<pre><code>document.getElementById("number").value
</code></pre>
<p>Therefore, you must first convert the string into a number:</p>
<pre><code>parseInt(document.getElementById("number&q... | These values aren't comparing in this function (vanilla javascript) | javascript | 0 | 48 | 3 | 72,250,864 | 72,250,864 | 0 | true | 2022-05-15T17:37:35.243Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
These values aren't comparing in this function (vanilla javascript)<p>I know the answer to this is probably really simple, as it's only a simple number guess... |
72,337,483 | How to join two objects in array<p>I want to filter two objects in datasets array by label with date . I use in react-chartjs-2. I don't know how do i filter.</p>
<p>Example :</p>
<pre><code>First Object : {
"id": 2,
"customer_id": 4,
"date": "2019-05-15T21:00:00.000Z&quo... | <p>I would do something like this:</p>
<ol>
<li>Place the items in an array so they are more easily managed;</li>
<li>Create an array with the keys you need in your datasets: (<em>wbc</em>,<em>vitamin</em>,etc...) and custom settings for each key ( <em>bg-color</em>, etc... );</li>
<li>Reduce the keys array to a datase... | How to join two objects in array | javascript|reactjs|chart.js|react-chartjs | 0 | 48 | 1 | 72,337,705 | 72,337,705 | 0 | true | 2022-05-22T12:15:32.883Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to join two objects in array<p>I want to filter two objects in datasets array by label with date . I use in react-chartjs-2. I don't know how do i filte... |
72,329,380 | Does GC.SupressFinalizer() prevent GC from collecting the managed resources?<p>If Finalizer (destructor) is implemented in a class and GC.SupressFinalizer() is called from the overriden Dispose() method will the Garbage Collector still take care of any managed resources the instances of that class might have?
What conf... | <p>There are many Q+A about this already on SO so I'll give you a very practical answer: You <a href="https://blog.benoitblanchon.fr/safehandle/" rel="nofollow noreferrer">won't ever need to write a finalizer</a>.</p>
<p>Summary: In the rare case that you have an unmanaged resource, use the SafeHandle class to make it ... | Does GC.SupressFinalizer() prevent GC from collecting the managed resources? | c#|garbage-collection|idisposable|finalizer|unmanagedresources | 0 | 48 | 1 | 72,329,679 | 72,329,679 | 0 | true | 2022-05-21T12:05:25.410Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Does GC.SupressFinalizer() prevent GC from collecting the managed resources?<p>If Finalizer (destructor) is implemented in a class and GC.SupressFinalizer() ... |
72,259,577 | How change List<Unit> type to proper one in kotlin<p>I have an issue with getting only information with passed coinList values. To begin with, I want to make coinList to <code>List<Coin></code> instead of <code>List<Unit></code> and I am out of ideas on how to change it. I want to compare <code>it.id</code>... | <p>maybe something like this would work, first doing a filter to only retrieve relevant items, then mapping</p>
<pre><code> val coinsList = arrayListOf<String>("foo", "bar")
val coins = repository.getCoins().filter { it.id in coinsList }.map {
it.toCoin()
}
</code></pre> | How change List<Unit> type to proper one in kotlin | android|kotlin | 0 | 48 | 1 | 72,259,838 | 72,259,838 | 0 | true | 2022-05-16T12:55:05.713Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How change List<Unit> type to proper one in kotlin<p>I have an issue with getting only information with passed coinList values. To begin with, I want to make... |
72,334,098 | conversion pine script v2 to v3<p>This is my code.</p>
<pre><code>isBuyPlotted=isBuyPlotted[1]==true?true:nz(buySetup[MAXSIGNALDELAY+1])==9?true:false or nz(buySetup)==9?false:buySignal[1]==true // init
buySignal=nz(buySetup[MAXSIGNALDELAY])>9-MAXSIGNALDELAY and close>nz(high[1]) and nz(close[1])>nz(open[1])... | <p>Both those variables are of type <code>bool</code> in the original code but you have declared them as <code>float</code>. That's what the error message tells you.</p>
<p>Change it to:</p>
<pre><code>isBuyPlotted=false
buySignal=false
isBuyPlotted:=isBuyPlotted[1]==true?true:nz(buySetup[MAXSIGNALDELAY+1])==9?true:fal... | conversion pine script v2 to v3 | pine-script|indicator | 0 | 48 | 1 | 72,340,435 | 72,340,435 | 0 | true | 2022-05-22T00:47:07.053Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
conversion pine script v2 to v3<p>This is my code.</p>
<pre><code>isBuyPlotted=isBuyPlotted[1]==true?true:nz(buySetup[MAXSIGNALDELAY+1])==9?true:false or nz(... |
72,252,662 | Filter required partition field n unnest array of date<p>I need to interrogate my table partitioned by a required <strong>transactionDate</strong> field.</p>
<p>I want to filter my data only on multiple dates to avoid recovering a lot of data but I have this error : <code>Query error: Cannot query over table t without ... | <p>When <code>dates</code> is empty, <code>transactionDate IN UNNEST(dates)</code> condition will be <code>false</code> and your query will return an error:</p>
<blockquote>
<p>Cannot query over table 'testset.t' without a filter over column(s) 'transactionDate' that can be used for partition elimination</p>
</blockquo... | Filter required partition field n unnest array of date | sql|google-cloud-platform|google-bigquery | 0 | 48 | 1 | 72,252,935 | 72,252,935 | 0 | true | 2022-05-15T22:36:04.860Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Filter required partition field n unnest array of date<p>I need to interrogate my table partitioned by a required <strong>transactionDate</strong> field.</p>... |
72,397,262 | kivy.uix.screenmanager.ScreenManagerException: ScreenManager accepts only Screen widget. Error<p>I'm trying to add these two screens to the screenmanager but i'm getting this error. What am i doing wrong? I know there are other ways to use the screen manager but i want to know how i could use it with the builder method... | <p><em>Need to import custom <code>Screen</code> classes just like other scripts:</em></p>
<p><strong>main.py:</strong></p>
<pre><code>from kivy.core.window import Window
from kivy.lang.builder import Builder
from kivymd.app import MDApp
from kivy.uix.screenmanager import ScreenManager,Screen
from sc1 import Screen1
fr... | kivy.uix.screenmanager.ScreenManagerException: ScreenManager accepts only Screen widget. Error | python|kivy|kivymd | 0 | 48 | 1 | 72,398,541 | 72,398,541 | 0 | true | 2022-05-26T19:46:03.270Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
kivy.uix.screenmanager.ScreenManagerException: ScreenManager accepts only Screen widget. Error<p>I'm trying to add these two screens to the screenmanager but... |
72,251,518 | Why doesn't my custom component update when I change properties with setAttribute?<p>I think I don't quite understand how components and entities work.
I'm using the box component that appears in the a-frame help (<a href="https://aframe.io/docs/1.3.0/introduction/writing-a-component.html#example-box-component" rel="no... | <p>You need to update the <code>box</code> attribute - <code>setAttribute("height", XXX)</code> will trigger an update in the <code>height</code> component.</p>
<p>If <code>color</code> is in the <code>box</code> schema, then:</p>
<pre><code> // this updates the color property of the box attribute,
// trigge... | Why doesn't my custom component update when I change properties with setAttribute? | aframe | 0 | 48 | 1 | 72,251,796 | 72,251,796 | 0 | true | 2022-05-15T19:22:44.130Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why doesn't my custom component update when I change properties with setAttribute?<p>I think I don't quite understand how components and entities work.
I'm u... |
72,316,713 | No output while scraping Google search page<p>I am trying to scrape from Google search results the blue highlighted portion as shown below:</p>
<p><a href="https://i.stack.imgur.com/xKPO0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xKPO0.png" alt="enter image description here" /></a></p>
<p>When ... | <p>Google uses javascript to display most of its web elements, so using something like <code>requests</code> and <code>BeautifulSoup</code> is unfortunately not enough.</p>
<p>Instead, use <a href="https://selenium-python.readthedocs.io/" rel="nofollow noreferrer">selenium</a>! It essentially allows you to control a br... | No output while scraping Google search page | python|beautifulsoup | -1 | 48 | 1 | 72,316,832 | 72,316,832 | 0 | true | 2022-05-20T09:36:37.353Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
No output while scraping Google search page<p>I am trying to scrape from Google search results the blue highlighted portion as shown below:</p>
<p><a href="h... |
72,278,761 | How can I get the duplicate objects from this JSON array with JS?<p>From the below JSON I wanted to get the players and list them by how many times they are referenced. So for example Player 3, Chelsea being referenced once, is the top player at #1, then Jim being referenced twice would be #2, then then Player one, ... | <p>One way of doing it is with a combination of <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce" rel="nofollow noreferrer"><code>.reduce(..)</code></a> and <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort" rel="no... | How can I get the duplicate objects from this JSON array with JS? | javascript|json | 0 | 48 | 2 | 72,278,941 | 72,278,941 | 0 | true | 2022-05-17T18:06:38.663Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I get the duplicate objects from this JSON array with JS?<p>From the below JSON I wanted to get the players and list them by how many times they are ... |
72,246,072 | Why this custom implementation slower than the built-in?<p>May i ask, why this user-made implementations slower than built-in ones:</p>
<p>Sample:</p>
<pre><code>English (Compulsory) -A
BSc 16 101
English
1
-3
Fundamentals of Mathematical Statistics
BSc 16 102
Maths
1
-3
Computer Fundamentals and Computing Software
BSc... | <p>The same question was asked at the OFFICIAL git repository of dart, the primary focus of which is given below:</p>
<blockquote>
<p>Different code behave differently.</p>
<p>The built-in functionality is written to be efficient at their job.
The code here is not particularly efficient because it:</p>
<ul>
<li>Copies ... | Why this custom implementation slower than the built-in? | dart|uint8array|uint8list | 0 | 48 | 1 | 72,259,352 | 72,259,352 | 0 | true | 2022-05-15T06:41:21.483Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why this custom implementation slower than the built-in?<p>May i ask, why this user-made implementations slower than built-in ones:</p>
<p>Sample:</p>
<pre><... |
72,253,941 | How do I convert strings in a 2-D RDD to int using PySpark<p>I'm new to pyspark, and have been trying to figure this out for hours.</p>
<p>Currently, my RDD looks like this:</p>
<pre><code>[['74', '85', '123'], ['73', '84', '122'], ['72', '83', '121'], ['70', '81', '119'], ['70', '81', '119'], ['69', '80', '118'], ['70... | <h2>Update</h2>
<p>Before performing the below operations, you can use <code>map</code> and <code>collect</code> to convert your RDD into list.</p>
<pre><code>rdd = spark.sparkContext.parallelize(data)
list_string = rdd.map(list).collect()
</code></pre>
<hr />
<p>Using list comprehension is actually quick and efficient... | How do I convert strings in a 2-D RDD to int using PySpark | python|apache-spark|pyspark | 1 | 48 | 1 | 72,254,086 | 72,254,086 | 0 | true | 2022-05-16T03:36:52.097Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I convert strings in a 2-D RDD to int using PySpark<p>I'm new to pyspark, and have been trying to figure this out for hours.</p>
<p>Currently, my RDD ... |
72,370,140 | Get data response from fetch when is created as javascript module in my code<p>I have been trying for a days that a function created as a module can return the data.</p>
<p>I use flask and in a page I am loading the module in the header.</p>
<pre><code><script src="{{url_for('static', filename = 'js/modules.js'... | <p>Functions like <code>fetch(...)</code> and <code>.json()</code> are asynchronous functions. These return an object of type Promise. This means that the result of the function is not returned immediately.<br />
With <code>await</code> the final result can be awaited and can then be used. Functions that use the await ... | Get data response from fetch when is created as javascript module in my code | javascript|flask|fetch | 0 | 48 | 1 | 72,370,863 | 72,370,863 | 0 | true | 2022-05-24T22:33:10.443Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get data response from fetch when is created as javascript module in my code<p>I have been trying for a days that a function created as a module can return t... |
72,297,311 | Regex to split file paths into groups?<p>This is the structure of the files:</p>
<pre><code>(number)/firstdirectory/unimportant/unimportant/lastdirectory.DAT
</code></pre>
<p>I need to write a regex that will place the number, the first directory, and the last directory in groups 1, 2, and 3 respectively.</p>
<p>exampl... | <p>First of all regex is not the way to go. Pathlib should be used instead.</p>
<p>Here is the regex solution if you do wish to use it anyway:</p>
<pre><code>import re
regex = re.compile(r"\((\d+)\)(?:/([^/]+))?.*/([^\.]+)\..*$")
paths = ["(1)/Downloads/Maps/Map of Places.pdf","(25)/Publication... | Regex to split file paths into groups? | python|regex|data-analysis | 0 | 48 | 2 | 72,297,377 | 72,297,377 | 0 | true | 2022-05-19T00:19:12.873Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Regex to split file paths into groups?<p>This is the structure of the files:</p>
<pre><code>(number)/firstdirectory/unimportant/unimportant/lastdirectory.DAT... |
72,296,378 | Algorithm to get maximum affordable amount of items with individual costs and limits<p>i got a small headache over a problem regarding an efficient way to distribute a fixed amount of points evenly between n items that got different costs and limits. Costs <em>don't</em> increase with each item.</p>
<p>Lets say i got 3... | <p>Your approach isn't bad. The algorithm can be sped up a bit by</p>
<ul>
<li>keeping the elements in a list, and not just visiting each during each iteration of your outer loop, but by kicking it out of the list once it hit its limit</li>
<li>not just buying one of each item per round, but as many as feasible if you'... | Algorithm to get maximum affordable amount of items with individual costs and limits | javascript|algorithm|math | 0 | 48 | 1 | 72,296,785 | 72,296,785 | 0 | true | 2022-05-18T21:47:31.780Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Algorithm to get maximum affordable amount of items with individual costs and limits<p>i got a small headache over a problem regarding an efficient way to di... |
72,239,270 | EF Core/C#: Set many-to-many relationship with a variable field?<p>If you have an EF/asp.net Core app that has ads with services with a price. Where each ad can have many services (out of a predefined set of choices, like haircut, nail polish, etc. ) and a price that is variable for each ad. How do you form the many t... | <p>This is no longer a many to many relationship between two entities that EF can implicitly handle for you, but rather two one to many relationships between three entities.</p>
<p>Create an intermediary <code>AdServiceType</code> (or any other appropriate name) which has two FKs (<code>Ad</code>, <code>ServiceType</co... | EF Core/C#: Set many-to-many relationship with a variable field? | c#|asp.net-core|entity-framework-core | 0 | 48 | 2 | 72,239,357 | 72,239,357 | 1 | true | 2022-05-14T10:18:52.563Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
EF Core/C#: Set many-to-many relationship with a variable field?<p>If you have an EF/asp.net Core app that has ads with services with a price. Where each ad ... |
72,246,905 | Golang Print structure always report undefined<p>Here is the structure I defined - generated from a json to Go struct tool:</p>
<pre><code>type NYTimesNews struct {
Data struct {
LegacyCollection struct {
CollectionsPage struct {
Stream struct {
Edges []struct... | <p>You named loop variable <code>Node</code> but what it really contains is a struct of type <code>Edge</code>. <code>.Node</code> is property of each <code>Edge</code> in the collection you iterate over. You need to access it through edge's <code>.Node</code> field like this instead:</p>
<pre class="lang-golang pretty... | Golang Print structure always report undefined | go|struct | 0 | 48 | 1 | 72,246,992 | 72,246,992 | 1 | true | 2022-05-15T09:02:39.770Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Golang Print structure always report undefined<p>Here is the structure I defined - generated from a json to Go struct tool:</p>
<pre><code>type NYTimesNews s... |
72,249,167 | Opening A New Page After Form Successfully Submitted Using Php<p><a href="https://i.stack.imgur.com/ZEHSL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZEHSL.png" alt="hosting-file-format" /></a></p>
<p>I control form elements using php.If they are not valid i print an error message below them.My p... | <p>I believe you cannot set the header location once its already been set
see accepted answer here : <a href="https://stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php">How to fix "Headers already sent" error in PHP</a></p>
<p>I am not sure how much hate I will get for offering ... | Opening A New Page After Form Successfully Submitted Using Php | php|html|css|forms|web-hosting | 1 | 48 | 1 | 72,250,745 | 72,250,745 | 1 | true | 2022-05-15T14:27:22.930Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Opening A New Page After Form Successfully Submitted Using Php<p><a href="https://i.stack.imgur.com/ZEHSL.png" rel="nofollow noreferrer"><img src="https://i.... |
72,252,250 | Not able to compile MLY file using Dune<p>I am writing my first Ocamllex and Ocamlyacc program by following <a href="https://youtu.be/yySh6WLCn7A" rel="nofollow noreferrer">this</a> tutorial</p>
<p>My dune file looks like</p>
<pre><code>(executable
(public_name Calculator)
(name main))
(ocamllex lexer)
(ocamlyacc par... | <p>I think ocamlyacc doesn’t have that <code>%start <type> symbol</code> syntax. You should separately specify the type using <code>%type</code>:</p>
<pre><code>%type <unit> prog
%start prog
</code></pre> | Not able to compile MLY file using Dune | ocaml|ocamllex|ocamlyacc | 0 | 48 | 1 | 72,253,355 | 72,253,355 | 1 | true | 2022-05-15T21:17:21.003Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Not able to compile MLY file using Dune<p>I am writing my first Ocamllex and Ocamlyacc program by following <a href="https://youtu.be/yySh6WLCn7A" rel="nofol... |
72,260,288 | Storing data in different variable during a FOR loop<p>I have this code:</p>
<pre><code>import math
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
sens_fac = [0.8, 1, 1.2]
A = 13;
B = 5;
C = 7/2;
D = 3*1.2;
par = [A,B,C,D]
data = pd.DataFrame(index=range(len(sens_fac)),columns=range(len(par)))
... | <p>You can drop the columns with only one unique element (keep columns with more than one unique element):</p>
<pre><code>term1.loc[:, term1.nunique().gt(1)].squeeze()
</code></pre>
<p>output:</p>
<pre><code>0 2.195296
1 2.995886
2 3.216978
Name: 0, dtype: float64
</code></pre>
<p><em>NB. you can use <code>squ... | Storing data in different variable during a FOR loop | python|pandas|dataframe|for-loop | 0 | 48 | 1 | 72,260,343 | 72,260,343 | 1 | true | 2022-05-16T13:48:37.710Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Storing data in different variable during a FOR loop<p>I have this code:</p>
<pre><code>import math
import matplotlib.pyplot as plt
import numpy as np
import... |
72,262,573 | how do I perform the following operation in python dataframe<p>below are my two dfs</p>
<pre><code>df = pd.DataFrame(np.random.randint(1,10,(5,3)),columns=['a','b','c'])
dd = pd.DataFrame(np.repeat(3,2),columns=['a'])
</code></pre>
<p>I want to replace the column 'a' of df with values in column 'a' of dd. Any empty row... | <p>This is probably not the cleanest way, but it works.</p>
<pre><code> df['a'] = dd['a']
df['a'] = df['a'].fillna(0)
</code></pre> | how do I perform the following operation in python dataframe | python|pandas|dataframe | -1 | 48 | 1 | 72,262,911 | 72,262,911 | 1 | true | 2022-05-16T16:31:23.583Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how do I perform the following operation in python dataframe<p>below are my two dfs</p>
<pre><code>df = pd.DataFrame(np.random.randint(1,10,(5,3)),columns=['... |
72,264,122 | Binding rvalue ref to string literal in constructor vs construct in-place<p>I'm a bit confused about C++ temporaries in regards to string literals and move semantics.</p>
<p>Which one of the following is better, in terms of performance and readability.</p>
<p>Usage: <code>Constructor("string_literal")</code><... | <p>Option 1 will copy when you have a movable string and construct and move from a literal.</p>
<p>Option 2 will move when you have a movable string and construct and move when you have a literal.</p>
<p>Option 3 is the worst as it will always copy.</p>
<p>As you can see Option 2 <= 1 <= 3.</p>
<p>Also consider</... | Binding rvalue ref to string literal in constructor vs construct in-place | c++ | 0 | 48 | 1 | 72,265,312 | 72,265,312 | 1 | true | 2022-05-16T18:43:17.550Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Binding rvalue ref to string literal in constructor vs construct in-place<p>I'm a bit confused about C++ temporaries in regards to string literals and move s... |
72,265,336 | delimit text file in python<p>I'm trying to import a text file and have it delimited in the rows which it can be without losing the lines which can't be.
Here's an example:</p>
<pre><code>Some text for the title
some more text for a description
some more descriptions.
City,State,Capital
Philadelphia,Pennsylvania,No
Sa... | <p>You could split the text file and read each part seperately, then you could use <code>pd.read_csv</code> for it, but as one file, as far as I know, you should just read the file with <code>readlines()</code> and some conditions.</p>
<p>Try it with this:</p>
<pre><code>with open('your_textfile.txt', 'r') as f:
so... | delimit text file in python | python|pandas | 0 | 48 | 2 | 72,265,717 | 72,265,717 | 1 | true | 2022-05-16T20:36:21.107Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
delimit text file in python<p>I'm trying to import a text file and have it delimited in the rows which it can be without losing the lines which can't be.
Her... |
72,265,399 | XSLT to parse XML and write out a flat file with a line feed after each parent segment<p>I’m new to xslt and want to use it to just write out a flat file from the xml input below.</p>
<p>I also need a line feed after each parent segment</p>
<p>So this:</p>
<pre><code><?xml version="1.0" encoding="UTF-... | <p>AFAICT, you want to do:</p>
<p><strong>XSLT 2.0</strong></p>
<pre><code><xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="UTF-8"/>
<xsl:strip-space elements="*"/>
<xsl:template m... | XSLT to parse XML and write out a flat file with a line feed after each parent segment | xml|xslt | 1 | 48 | 1 | 72,267,765 | 72,267,765 | 1 | true | 2022-05-16T20:43:07.207Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
XSLT to parse XML and write out a flat file with a line feed after each parent segment<p>I’m new to xslt and want to use it to just write out a flat file fro... |
72,268,148 | how to get parent object property in foreach function<p>for example
I can't reach 'this.ret' so use 'obj.ret' in loop.</p>
<p>is this right way?</p>
<pre><code>const obj = {
ret : 0,
sum : function(arr){
$.each(arr, function(i, v){
obj.ret += v //Can't reach this.ret
})
this.print();
},
... | <p>You can use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions" rel="nofollow noreferrer">Arrow Function</a></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 la... | how to get parent object property in foreach function | javascript|object|this | 0 | 48 | 2 | 72,268,333 | 72,268,333 | 1 | true | 2022-05-17T04:16:52.623Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to get parent object property in foreach function<p>for example
I can't reach 'this.ret' so use 'obj.ret' in loop.</p>
<p>is this right way?</p>
<pre><co... |
72,272,125 | How can I upload multiple images in firebase at react in different method?<p>I want to <code>console.log()</code> in the <code>console.log(list)</code> the <code>uploadBytes</code> of my image, so that I could implement it and pass it at my backend without separating it.</p>
<p>The code is something like this</p>
<pre>... | <p>If I understand your question correctly you want to log the list of download URLs after all the images have been uploaded.</p>
<p>This requires that you handle two asynchronous operations for each upload:</p>
<ul>
<li>the upload of the data itself,</li>
<li>the call to get the download URL.</li>
</ul>
<p>Since you n... | How can I upload multiple images in firebase at react in different method? | javascript|firebase|firebase-storage | 0 | 48 | 1 | 72,275,519 | 72,275,519 | 1 | true | 2022-05-17T10:12:34.440Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I upload multiple images in firebase at react in different method?<p>I want to <code>console.log()</code> in the <code>console.log(list)</code> the <... |
72,282,715 | How to load a CSV into a dictionary (hash)?<p>I'm dealing with (unsorted) CSV-files, where certain columns comprise a <em>key</em>, whereas another column is the <em>value</em>. Let's say, columns (1, 2, 3, 7) of each row comprise the key, and the 11th column is the row's value.</p>
<p>I'd like to load these into hashe... | <p>You can try:</p>
<pre><code>d = pd.read_csv('data.txt', header=None, usecols=[1, 2, 3, 7, 11],
index_col=[0, 1, 2, 3], sep=' ')[11].to_dict()
</code></pre>
<p>Some information:</p>
<ul>
<li><code>header=None</code>: consider first line as data and not column names</li>
<li><code>usecols=[1, 2, 3, 7, ... | How to load a CSV into a dictionary (hash)? | python|pandas|numpy|csv|dictionary | -1 | 48 | 2 | 72,283,305 | 72,283,305 | 1 | true | 2022-05-18T02:53:51.153Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to load a CSV into a dictionary (hash)?<p>I'm dealing with (unsorted) CSV-files, where certain columns comprise a <em>key</em>, whereas another column is... |
72,286,632 | Why is datetime64 converted to timedelta64 when converting into a YYYY-MM string<p>I want to convert time columns (<code>dtype: datetime64[ns]</code>) in a <code>panda.DataFrame</code> into strings representing the year and month only.</p>
<p>It works as expected if all values in the column are valid.</p>
<pre><code>0 ... | <p>Don't use a custom function, use <a href="https://pandas.pydata.org/docs/reference/api/pandas.Series.dt.strftime.html" rel="nofollow noreferrer"><code>strftime</code></a> with <code>%-m</code> (the minus strips the leading zeros):</p>
<pre><code>series_nat.dt.strftime('%Y-%-m')
</code></pre>
<p>output:</p>
<pre><cod... | Why is datetime64 converted to timedelta64 when converting into a YYYY-MM string | pandas|numpy | 1 | 48 | 1 | 72,286,679 | 72,286,679 | 1 | true | 2022-05-18T09:34:19.383Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is datetime64 converted to timedelta64 when converting into a YYYY-MM string<p>I want to convert time columns (<code>dtype: datetime64[ns]</code>) in a <... |
72,281,557 | How to validate XML with multiple XSD stored in Odoo modules<p>I need to validate an xml that I generate with two XSD files provided. I am struggling because one of the XSD files references the other one and it looks that I am getting errors because of that.</p>
<p>The following is the "Invoice schema":</p>
<... | <p>As Michael Kay commented, I needed to get the absolute path to the XSD file. In odoo I have managed to do it by using the following code:</p>
<pre class="lang-py prettyprint-override"><code>import os
# This gets the location of the absolute location of the python file running
current_location = os.path.dirname(os.p... | How to validate XML with multiple XSD stored in Odoo modules | python|xml|xsd|odoo|lxml | 0 | 48 | 1 | 72,292,142 | 72,292,142 | 1 | true | 2022-05-17T22:59:40.793Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to validate XML with multiple XSD stored in Odoo modules<p>I need to validate an xml that I generate with two XSD files provided. I am struggling because... |
72,289,938 | SSAS tabular DISTINCTCOUNTNOBLANK equivalent<p>I have the data below in SSAS tabular import from sql server</p>
<pre><code>create table #Data (ID int,Names varchar(50))
insert into #Data values
(1,'one'),(2,NULL),(3,'two'),(4,'one'),
(5,NULL),(6,NULL),(7,'two'),(8,'three'),
(9,'one'),(10,NULL),(11,'two'),(12,'one'),
(1... | <p>Try this measure. The NOT(ISBLANK()) part is the is the <a href="https://dax.guide/distinctcountnoblank/" rel="nofollow noreferrer">equivalent of DISTINCTCOUNTNOBLANK</a>.</p>
<pre><code>Total := CALCULATE(
DISTINCTCOUNT(Data[Names]),
Data[ID]>10,
NOT(ISBLANK(Data[Names]))
)
</code></pre> | SSAS tabular DISTINCTCOUNTNOBLANK equivalent | visual-studio|dax|ssas|ssas-tabular | 1 | 48 | 1 | 72,292,618 | 72,292,618 | 1 | true | 2022-05-18T13:16:10.670Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SSAS tabular DISTINCTCOUNTNOBLANK equivalent<p>I have the data below in SSAS tabular import from sql server</p>
<pre><code>create table #Data (ID int,Names v... |
72,294,805 | How to sort an array of objects based on scores - Javascript<p>I have an array of objects that contain the data I want to sort (it has more properties), like so:</p>
<pre><code>[
{
"data": {
"id": "green"
}
},
{
"data": {
... | <p>You can sort them like this:
<a href="https://jsfiddle.net/Ldvja31t/1/" rel="nofollow noreferrer">https://jsfiddle.net/Ldvja31t/1/</a></p>
<pre><code>const scores = {
"green": 5,
"red": 3,
"blue": 8
};
const myData = [
{
"data": {
"id&... | How to sort an array of objects based on scores - Javascript | javascript|arrays|sorting | 1 | 48 | 3 | 72,294,927 | 72,294,927 | 1 | true | 2022-05-18T19:15:16.380Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to sort an array of objects based on scores - Javascript<p>I have an array of objects that contain the data I want to sort (it has more properties), like... |
72,299,998 | BigQuery: Rolling daily count visitor's summary of payment<p>I have this data:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>date</th>
<th>visitor_id</th>
<th>total_payment</th>
</tr>
</thead>
<tbody>
<tr>
<td>2022-01-01</td>
<td>A</td>
<td>20</td>
</tr>
<tr>
<td>2022-01-01</td>
<td>B</td... | <p>You can use this query as solution.
First, I calculate cumulative payments of each user.
Then, I find the minimum date for each user that exceeds 20$ cumulative payment.
At the last step, I count number of users for each minimum date, and also accumulate that number.
In the output you don't have to have first_day_us... | BigQuery: Rolling daily count visitor's summary of payment | sql|google-bigquery | -1 | 48 | 2 | 72,301,603 | 72,301,603 | 1 | true | 2022-05-19T07:02:27.750Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
BigQuery: Rolling daily count visitor's summary of payment<p>I have this data:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>d... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.