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,890,776 | Sort() Method For Similar Values<p>I am sorting an array using the <code>sort()</code> method. When there is a duplicate value I'd like to run secondary logic to decide the sort order.</p>
<p>For example, in the below array, I'd like to choose how <code>red</code> and <code>orange</code> get sorted.</p>
<p>This is my s... | <p>If the <code>inventoryTotal</code> values are equal, then you should return a sort result based on doing a string comparison (using <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare" rel="nofollow noreferrer"><code>localeCompare</code></a>) of the two <cod... | Sort() Method For Similar Values | javascript|sorting | 1 | 54 | 4 | 72,890,936 | 72,890,936 | 1 | true | 2022-07-06T23:17:24.233Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sort() Method For Similar Values<p>I am sorting an array using the <code>sort()</code> method. When there is a duplicate value I'd like to run secondary logi... |
72,893,847 | How to declare ngif value by concatenate in angular<p>Trying to hide bullet point by ngIf but not working. How to declare an ngif value by concatenating If anyone knows, please help to find the solution.</p>
<p>app.component.html:</p>
<pre><code><mat-list>
<mat-list-item *ngFor="let season of seasons;... | <p>OK, your solution is overcomplicated. Just store the index of clicked position</p>
<pre><code><p matLine (click)="hides(i)">{{ season }}</p>
</code></pre>
<pre><code> hiddenIndex = -1;
hides(val: number) {
this.hiddenIndex = val;
}
</code></pre>
<p>and hide the element:</p>
<pre><code... | How to declare ngif value by concatenate in angular | angular|typescript|angular-material | 2 | 54 | 3 | 72,894,013 | 72,894,013 | 1 | true | 2022-07-07T07:28:22.173Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to declare ngif value by concatenate in angular<p>Trying to hide bullet point by ngIf but not working. How to declare an ngif value by concatenating If a... |
72,893,168 | Ruby Shopping cart cant save user<p>I am working on creating shop cart / order. I created shop cart with association by this <a href="https://youtu.be/rPmlA_T_J84" rel="nofollow noreferrer">guide</a> so I have some problem. After a new sign in session My app can't find my previous cart and create one new</p>
<pre><cod... | <p>Your <code>current_cart</code> helper is creating a new cart any time there isn't one in the session. In a new session, there of course won't be a cart, even if the user has had one previously, so if you want to use their latest cart instead of always creating a new one, you could do something like this:</p>
<pre cl... | Ruby Shopping cart cant save user | ruby-on-rails|ruby|devise | 0 | 54 | 1 | 72,894,404 | 72,894,404 | 1 | true | 2022-07-07T06:28:19.933Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Ruby Shopping cart cant save user<p>I am working on creating shop cart / order. I created shop cart with association by this <a href="https://youtu.be/rPmlA_... |
72,890,747 | linear mixed model with log-transformation in R: Compute standard deviation or 95%CI for specific estimates and their contrasts<p>I use a mixed model to compute velocity estimates for specific locations (4 categories) at a chosen frequency (continuous) in R.</p>
<p>This is what I have so far:</p>
<pre><code>lmer.df = l... | <blockquote>
<p>How can I compute the standard deviation (or confidence intervals) for estimated values at specific frequencies? Using <code>emmeans()</code> I get the SE and 95%CI for the estimated velocities at mean frequency. I would need a similar table for i.e. frequency = 90.</p>
</blockquote>
<p>You can control ... | linear mixed model with log-transformation in R: Compute standard deviation or 95%CI for specific estimates and their contrasts | r|mixed-models|emmeans | 0 | 54 | 1 | 72,898,230 | 72,898,230 | 1 | true | 2022-07-06T23:11:17.740Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
linear mixed model with log-transformation in R: Compute standard deviation or 95%CI for specific estimates and their contrasts<p>I use a mixed model to comp... |
72,900,042 | Translate javascript makeTree in Laravel<p>I'm using Laravel 8. Currently I have this function in my projet to build a json tree but it's client side and I'd like to make this tree on the json response laravel endpoint.</p>
<pre><code> makeTree = (nodes, parentId) => {
return nodes
.filter((node) => nod... | <p>Honestly i didn't dope dive into the javascript snippet, but i can share here some code stuff which i've used in the past and it worked so well. Actually i've found some snippet before and improved that for my own. Don't have that exact link currenty (will update in case of having that), but this is what i've got:</... | Translate javascript makeTree in Laravel | php|laravel | 1 | 54 | 2 | 72,900,576 | 72,900,576 | 1 | true | 2022-07-07T14:56:01.890Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Translate javascript makeTree in Laravel<p>I'm using Laravel 8. Currently I have this function in my projet to build a json tree but it's client side and I'd... |
72,900,036 | If/Filter clause to query formula (with arrayformula embeded)<p>I have a response sheet on GSheets with over 100 columns/questions that can either be responded by Yes or No. If the candidate answers no they will have to fill in a freetext question.</p>
<p>The following formula - allows me to export the questions that w... | <p>try:</p>
<pre><code>=ARRAYFORMULA(SUBSTITUTE({'Module 1 Responses'!A:C, FILTER('Module 1 Responses'!D:Z,
MOD(COLUMN('Module 1 Responses'!D:Z), 2)=0)}, "Yes", ))
</code></pre>
<p><a href="https://i.stack.imgur.com/1XCO3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1XCO3.png" alt="ent... | If/Filter clause to query formula (with arrayformula embeded) | sql|if-statement|google-sheets|array-formulas|google-query-language | 0 | 54 | 1 | 72,904,860 | 72,904,860 | 1 | true | 2022-07-07T14:55:50.840Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
If/Filter clause to query formula (with arrayformula embeded)<p>I have a response sheet on GSheets with over 100 columns/questions that can either be respond... |
72,905,533 | How to get the value of another condition before the previous condition<p>input</p>
<pre><code>import numpy as np
import pandas as pd
df = pd.DataFrame(np.random.random((10,1)).round(2), columns = ['A'])
df['cond1'] =[True,False,False,False,True,False,False,True,False,True]
df['cond2'] =[False,False,True,False,False,Tr... | <p>Follow the same logic with <code>shift</code> and <code>ffill</code></p>
<pre><code>df.loc[(~df['cond2']) & (df['cond2'].cummax()),'expect'] = df['A'].where(df['cond1']).ffill().shift().mask(df.cond2)
df
Out[249]:
A cond1 cond2 expect
0 0.42 True False NaN
1 0.07 False False NaN
2 0.99 ... | How to get the value of another condition before the previous condition | python|pandas|dataframe | -3 | 54 | 2 | 72,905,769 | 72,905,769 | 1 | true | 2022-07-08T00:33:04.800Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get the value of another condition before the previous condition<p>input</p>
<pre><code>import numpy as np
import pandas as pd
df = pd.DataFrame(np.ra... |
72,906,008 | React project displaying blank page on GitHub Pages<p>I have a project that is displaying a blank page on GitHub Pages. I have added</p>
<pre><code>"homepage": "https://jusmccar.github.io/ContactManager",
</code></pre>
<pre><code>"predeploy": "npm run build",
"deploy": ... | <p>Your problem is here in <code>App.js</code></p>
<blockquote>
<pre class="lang-js prettyprint-override"><code>const [contacts, setContacts] = useState(
JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY))
);
</code></pre>
</blockquote>
<p>You're not doing anything to handle the initial case where there is nothing in... | React project displaying blank page on GitHub Pages | javascript|reactjs|github-pages | -1 | 54 | 2 | 72,906,040 | 72,906,040 | 1 | true | 2022-07-08T02:14:17.630Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React project displaying blank page on GitHub Pages<p>I have a project that is displaying a blank page on GitHub Pages. I have added</p>
<pre><code>"hom... |
72,898,080 | Problem with accessing XML-attributes via xpath<p>I have some <code>XML</code> that consists of a lot of repitions of the following xml-structure:</p>
<pre><code><record>
<header>
<identifier>oai:dnb.de/dnb:reiheO/1254645608</identifier><datestamp>2022-04-01T23:49:32Z</datestamp>
<... | <p>First, your xml is still not well formed since the <code>xsi</code> prefix hasn't been declared. I made up a declaration below just to make the answer work.</p>
<p>Second, you need to use an xml parser like lxml to use xpath.</p>
<p>So all together:</p>
<pre><code>rec = """[your xml above, but with th... | Problem with accessing XML-attributes via xpath | python|xml|xpath|beautifulsoup|elementtree | 2 | 54 | 3 | 72,911,098 | 72,911,098 | 1 | true | 2022-07-07T12:48:05.730Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Problem with accessing XML-attributes via xpath<p>I have some <code>XML</code> that consists of a lot of repitions of the following xml-structure:</p>
<pre><... |
72,910,268 | Capture the painted area on the canvas<p>hi i want build a drawing app that capture the painted area on the canvas like <a href="https://www.autodraw.com/" rel="nofollow noreferrer">auto Draw </a>.
For this, I considered to take the position of the start and end of the line from the canvas.
the startingdrawing function... | <p>you should edit your function like this :</p>
<pre><code>const startDrawing = ({ nativeEvent }) => {
const { offsetX, offsetY } = nativeEvent;
const element = createElement(offsetX, offsetY);
// console.log(element);
ctxRef.current.beginPath();
ctxRef.current.moveTo(offsetX, offsetY);
ctx... | Capture the painted area on the canvas | javascript|reactjs|canvas | 2 | 54 | 1 | 72,912,607 | 72,912,607 | 1 | true | 2022-07-08T10:44:41.787Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Capture the painted area on the canvas<p>hi i want build a drawing app that capture the painted area on the canvas like <a href="https://www.autodraw.com/" r... |
72,899,646 | Are gitignore’d `.env` files in GitHub Codespaces visible to anyone but me?<h2>Background</h2>
<p>GitHub allows you to store <a href="https://docs.github.com/en/actions/security-guides/encrypted-secrets" rel="nofollow noreferrer">Encrypted Secrets</a> (<em>Settings > Codespaces > Codespaces secrets</em>), which i... | <p>I received <a href="https://twitter.com/lostintangent/status/1545058063207395328?s=21&t=42Cp8WsQwe4fR-I4cLZ6Ow" rel="nofollow noreferrer">this answer on Twitter</a> from GitHub employee Jonathan Carter (<a href="https://twitter.com/lostintangent?s=21&t=42Cp8WsQwe4fR-I4cLZ6Ow" rel="nofollow noreferrer">@LostI... | Are gitignore’d `.env` files in GitHub Codespaces visible to anyone but me? | github|environment-variables|codespaces|github-codespaces | 2 | 54 | 1 | 72,913,173 | 72,913,173 | 1 | true | 2022-07-07T14:31:07.073Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Are gitignore’d `.env` files in GitHub Codespaces visible to anyone but me?<h2>Background</h2>
<p>GitHub allows you to store <a href="https://docs.github.com... |
72,918,555 | Js function that shows a div as a result of a search but the disappear when something else is searched<p>Baby developer here. So, I’m creating a weather app using Axios and open weather API to grab live forecast info. I created an empty div in my HTML and then created a function that would show an alert at the bottom o... | <p>Thank you all for your answers they really helped!</p>
<p>I have also tried something that also worked</p>
<p>I updated the function to >></p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettypr... | Js function that shows a div as a result of a search but the disappear when something else is searched | javascript|api|axios|openweathermap|weather-api | 0 | 54 | 2 | 72,921,515 | 72,921,515 | 1 | true | 2022-07-09T02:41:16.053Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Js function that shows a div as a result of a search but the disappear when something else is searched<p>Baby developer here. So, I’m creating a weather app ... |
72,921,408 | How can you get overlapping matches in regex?<p>Say I have a regex <code>r"(([a-zA-Z]+)(&|\|)([a-zA-Z]+))"</code>, and a string <code>"groupone|grouptwo|groupthree|groupfour"</code>.</p>
<p>If I run</p>
<p><code>re.findall(r"(([a-zA-Z]+)(&|\|)([a-zA-Z]+))", "groupone|grouptwo|... | <p>You could use the third-party <a href="https://pypi.org/project/regex/" rel="nofollow noreferrer"><code>regex</code></a> module for this. Unlike the standard library <a href="https://docs.python.org/3/library/re.html" rel="nofollow noreferrer"><code>re</code></a>, it supports overlapping matches.</p>
<pre><code>impo... | How can you get overlapping matches in regex? | python|regex|python-re | 0 | 54 | 1 | 72,921,529 | 72,921,529 | 1 | true | 2022-07-09T12:36:30.560Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can you get overlapping matches in regex?<p>Say I have a regex <code>r"(([a-zA-Z]+)(&|\|)([a-zA-Z]+))"</code>, and a string <code>"gro... |
72,921,653 | How to get newly inserted Ids from identity primary key column when using SqlBulkCopy<p>I'm using C# and .NET Core 6. I want to bulk insert about 100 rows at once into database and get back their Ids from <code>BigInt</code> identity column.</p>
<p>I have tried lot of different variants, but still do not have the worki... | <p>You need an <code>OUTPUT</code> clause on your insert, but Bulk Copy does not allow this kind of customization.</p>
<p>While nowhere near as neat, you could do this by using a Table Valued Parameter and a custom <code>INSERT</code> statement. TVPs use the bulk copy mechanism, so this should still be pretty fast, alt... | How to get newly inserted Ids from identity primary key column when using SqlBulkCopy | c#|sql-server|.net-6.0|sqlbulkcopy | 2 | 54 | 1 | 72,925,996 | 72,925,996 | 1 | true | 2022-07-09T13:13:37.880Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get newly inserted Ids from identity primary key column when using SqlBulkCopy<p>I'm using C# and .NET Core 6. I want to bulk insert about 100 rows at... |
72,927,782 | Running multiply Anova and/or T-Test on variables in one dataframe in R<p>I've the a data frame containing different items (and it's cost) and also it's subsequent groupings. I would like to run an Anova and/or T-Test for each item based on their groupings to see if their mean differs. Anybody knows how to do this in R... | <p>You could use <code>anova_test</code> from the <code>rstatix</code> package like this:</p>
<pre class="lang-r prettyprint-override"><code>df <- data.frame(Item = c("Book A", "Book A", "Book A", "Book A", "Book B", "Book B", "Book B", "Book... | Running multiply Anova and/or T-Test on variables in one dataframe in R | r|dplyr|statistics|anova|t-test | 1 | 54 | 2 | 72,927,844 | 72,927,844 | 1 | true | 2022-07-10T10:30:13.187Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Running multiply Anova and/or T-Test on variables in one dataframe in R<p>I've the a data frame containing different items (and it's cost) and also it's subs... |
72,932,926 | How do you build your own filter() that is similar to the native built in filter() with all of its parameters?<p>I am learning about filter() and what this method does. So far I understood what it does and how to use it. The part I am struggling with is trying to understand all of its optional parameters and what they ... | <p>You are already passing the <code>currentValue</code> to the callback, but it seems you are missing the <code>index</code> and <code>arr</code> parameters.</p>
<pre class="lang-js prettyprint-override"><code>let check = callback(currentElement, i, this);
</code></pre>
<p>The second parameter for <code>filter</code> ... | How do you build your own filter() that is similar to the native built in filter() with all of its parameters? | javascript|arrays|filter | 0 | 54 | 2 | 72,932,988 | 72,932,988 | 1 | true | 2022-07-11T01:25:34.770Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do you build your own filter() that is similar to the native built in filter() with all of its parameters?<p>I am learning about filter() and what this m... |
72,922,505 | an unknown error while using FirebaseAuth.instance.signInWithCredential<p>Getting a weird error while using signInWithCredential(), but I am able to sign in by signInAnonymously()</p>
<p>Have tried searching and remaking app in facebookDeveloper account.</p>
<p>My Function:</p>
<pre><code>Future<UserCredential> _... | <p>The following steps can be helpful if you haven't tried it yet -</p>
<ol>
<li>Check if the firebase app is instantiated at the beginning -> .initializeApp()</li>
<li>Firebase Auth doesn't work without initialization</li>
<li>If the above two doesn't work, replace google-services.json with a new one. Do a clean bu... | an unknown error while using FirebaseAuth.instance.signInWithCredential | flutter|firebase|dart | 0 | 54 | 1 | 72,934,298 | 72,934,298 | 1 | true | 2022-07-09T15:10:31.377Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
an unknown error while using FirebaseAuth.instance.signInWithCredential<p>Getting a weird error while using signInWithCredential(), but I am able to sign in ... |
72,935,355 | PyTorch learning scheduler order changes loss in a drastic way<p>I'm a beginner to PyTorch and am trying to train a MNIST model based on a custom neural network class. My learning rate scheduler, loss function and optimizer are:</p>
<pre><code>optimizer = optim.Adam(model.parameters(), lr=0.003)
loss_fn = nn.CrossEntro... | <p><strong>StepLR</strong> updates the learning rate after every <em>step_size</em> by <em>gamma</em>, that means if step_size is 7 then learning rate will be updated after every 7 epoch by multiplying the current learning rate to gamma. That means that in your snippet, the learning rate is getting 10 times smaller eve... | PyTorch learning scheduler order changes loss in a drastic way | python|machine-learning|deep-learning|pytorch | 1 | 54 | 1 | 72,937,373 | 72,937,373 | 1 | true | 2022-07-11T07:57:37.257Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PyTorch learning scheduler order changes loss in a drastic way<p>I'm a beginner to PyTorch and am trying to train a MNIST model based on a custom neural netw... |
72,935,947 | CMake imported targets in add_subdirectory not available in main CMakeLists.txt<p>I want to build an application that depends on the OpenCV (version 3.4.6) viz module. This module has the VTK library (version 7.1.1) as dependency. I want to use ExternalProject to build both, the vtk library and the opencv viz module an... | <p>Unlike to normal targets, which are global, an IMPORTED target by default is <strong>local</strong> to the directory where it is created.</p>
<p>For extend visibility of the IMPORTED target, use GLOBAL keyword:</p>
<pre><code>add_library(opencv_core SHARED IMPORTED GLOBAL)
</code></pre>
<p>This is written in the <a ... | CMake imported targets in add_subdirectory not available in main CMakeLists.txt | c++|opencv|cmake | 1 | 54 | 2 | 72,937,802 | 72,937,802 | 1 | true | 2022-07-11T08:55:30.030Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CMake imported targets in add_subdirectory not available in main CMakeLists.txt<p>I want to build an application that depends on the OpenCV (version 3.4.6) v... |
72,946,462 | python according to the same value combining dictionary<p>i have a list of dict like this</p>
<pre><code>[
{'id': 'A123',
'feature': {'name': 'jack', 'age' : '18' },
'create_time': '2022-5-17 10:29:47',
'is_fast': False},
{'id': 'A123',
'feature': {'gender': 'male'},
'create_time': '2022-5-17 10:29:47',
... | <p>This should get you started... I put some inline notes to explain what the code is doing. You still need to implement a date time comparison.</p>
<pre><code>def merge_dicts(lst):
final = {} # results
for row in lst: # iterate through list
if row['id'] not in final: # if current item id hasn... | python according to the same value combining dictionary | python|list|dictionary | 0 | 54 | 2 | 72,946,612 | 72,946,612 | 1 | true | 2022-07-12T02:33:55.233Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
python according to the same value combining dictionary<p>i have a list of dict like this</p>
<pre><code>[
{'id': 'A123',
'feature': {'name': 'jack', 'age'... |
72,946,482 | How to make code dynamic removing hard coded values?<p>In a React project, I have an array of data which has corporation names based in their respective countries. I have also filtered out based on the country name, but, hard coded values aren't required. So, what could be the best optimal solution, to make code dynami... | <p>You can group data by country and then use that grouped data to display</p>
<pre><code>import { useEffect, useState } from "react";
import DetailComp from "./DetailComp";
//group countries by short name
const groupCountries = (data) => {
return data.reduce((result, item) => {
const {... | How to make code dynamic removing hard coded values? | javascript|reactjs | 0 | 54 | 1 | 72,946,621 | 72,946,621 | 1 | true | 2022-07-12T02:38:52.920Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make code dynamic removing hard coded values?<p>In a React project, I have an array of data which has corporation names based in their respective coun... |
72,948,277 | Set webcam grabbing resolution with ImageIO in Python<p>Using simple Windows/Python to read from Webcam:</p>
<pre><code>camera = iio.get_reader("<video0>")
screenshot = camera.get_data(0)
camera.close()
</code></pre>
<p>I'm getting a default resolution of 1980x1920. The webcam had different, larger reso... | <p>You can set the resolution via the <a href="https://imageio.readthedocs.io/en/stable/_autosummary/imageio.plugins.ffmpeg.html#parameters-for-reading" rel="nofollow noreferrer"><code>size</code> kwarg</a>, e.g. <code>size=(1280, 720)</code></p>
<p>My webcam is my third device and the resolution defaults to <code>640x... | Set webcam grabbing resolution with ImageIO in Python | python-imageio | 1 | 54 | 1 | 72,949,164 | 72,949,164 | 1 | true | 2022-07-12T07:04:54.400Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Set webcam grabbing resolution with ImageIO in Python<p>Using simple Windows/Python to read from Webcam:</p>
<pre><code>camera = iio.get_reader("<vid... |
72,953,300 | How can I read just one field in MongoDB C#?<p>Im trying to read just one field from the MongoDB with a given ID, but its giving me all the object... How can I do it ? What should I do? I tried with this repository but its returning me all the object</p>
<p>Here is my class:</p>
<pre><code>public class Hall
{
[BsonId... | <p>In order to return only the list of surveys, you can change your method like this:</p>
<pre><code>public async Task<List<string>> ReadSurveysHall(string hallId)
{
var filter = Builders<Hall>.Filter.(x => x.Id, hallId);
var halls = await _mongoManager.Find(filter, MongoConstants.HallCollectio... | How can I read just one field in MongoDB C#? | c#|mongodb | 1 | 54 | 1 | 72,954,139 | 72,954,139 | 1 | true | 2022-07-12T13:41:21.400Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I read just one field in MongoDB C#?<p>Im trying to read just one field from the MongoDB with a given ID, but its giving me all the object... How can... |
72,953,672 | Why does my redirect fail to load the expected component?<p>I have an Angular application with a redirect in place within the routing module to handle old urls, however the redirect is not hitting the expected routes, and instead falls through to the wildcard route. Below is a simplified example of the issue:</p>
<pre>... | <p>Use parameters: instead of</p>
<pre><code> {
path: 'old',
redirectTo: '..',
},
</code></pre>
<p>go</p>
<pre><code> {
path: 'old/:child',
redirectTo: ':child',
},
</code></pre>
<p><a href="https://stackblitz.com/edit/angular-e1gt7c-twawde?file=src%2Fapp%2Fapp-routing.modu... | Why does my redirect fail to load the expected component? | angular|angular-router | 0 | 54 | 1 | 72,954,379 | 72,954,379 | 1 | true | 2022-07-12T14:05:27.043Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does my redirect fail to load the expected component?<p>I have an Angular application with a redirect in place within the routing module to handle old ur... |
72,942,061 | python Path from pathlib module doesn't add path separator<p>I have the following issue using Path from the pathlib library:</p>
<pre><code>from pathlib import Path
import os
path_list = ["path","to","directory1","directory2"]
join_str = os.path.sep
my_path = join_str.join(path_... | <p><code>Path</code> cannot assume how the result will be used further, so it constructs the path object from the input data as is.</p>
<p>I will demonstrate with examples.</p>
<p>To begin with, prepare the directories in <code>/tmp</code>:</p>
<pre class="lang-bash prettyprint-override"><code>zyzop@localhost:~$ cd /tm... | python Path from pathlib module doesn't add path separator | python|pathlib | 0 | 54 | 3 | 72,955,518 | 72,955,518 | 1 | true | 2022-07-11T16:56:00.047Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
python Path from pathlib module doesn't add path separator<p>I have the following issue using Path from the pathlib library:</p>
<pre><code>from pathlib impo... |
72,960,357 | Kubernetes YAM file error validating data<p>Hi there I am trying to do a lab of kubernetes but I am stuck in a step where I need to deploy a yaml file.</p>
<p>"5. Create a job that creates a pod, and issues the etcdctl snapshot save command
to back up the cluster:"</p>
<p>I think my yaml file has some errors ... | <p>The <code>hostPath</code> indent is incorrect at volumes section:</p>
<pre><code>...
volumes:
# Volume storing the etcd PKI keys and certificates
- name: etcd-certs
hostPath:
path: /etc/kubernetes/pki/etcd
type: DirectoryOrCreate
# A volume to store the backup snapshot
- name: snapshots
hostPath:
... | Kubernetes YAM file error validating data | kubernetes|ubuntu-16.04 | 0 | 54 | 2 | 72,960,420 | 72,960,420 | 1 | true | 2022-07-13T02:45:01.783Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Kubernetes YAM file error validating data<p>Hi there I am trying to do a lab of kubernetes but I am stuck in a step where I need to deploy a yaml file.</p>
<... |
72,909,541 | Microsoft Graph Authentication reprocess additional claims<p>I'm building a simple demo application <code>netcoreapp6.0</code> where I offer a sign-in button to log in users against Azure AD.
For the initial login we request basic claims like 'user.read'.
Now we need to acquire additional claims from our users as soon ... | <p>Thanks for the help so far!</p>
<p>We've managed to succeed:</p>
<p>What we've done:
In <code>startup.cs</code></p>
<pre><code>services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
.AddMicrosoftIdentityWebApp(Configuration.GetSection("Authentication")) // Fetch Auth Data from appse... | Microsoft Graph Authentication reprocess additional claims | .net|azure|authentication|microsoft-graph-api | 1 | 54 | 2 | 72,962,271 | 72,962,271 | 1 | true | 2022-07-08T09:44:22.287Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Microsoft Graph Authentication reprocess additional claims<p>I'm building a simple demo application <code>netcoreapp6.0</code> where I offer a sign-in button... |
72,968,057 | Adding multiple rectangle patches using Matplotlib<p>I want to add multiple rectangle patches (<code>rect1, rect2, rect3</code>)using <code>ax.add_patch</code> but it takes 2 positional arguments only. How can I implement this? The current and the expected outputs are presented.</p>
<pre><code>import matplotlib as mpl
... | <p>You need to also add <code>rect2</code> and <code>rect3</code> to your figure: <code>ax.add_patch(rect2)</code> and <code>ax.add_patch(rect3)</code>. For now you only add <code>rect1</code>, hence the result.</p> | Adding multiple rectangle patches using Matplotlib | python|matplotlib | 0 | 54 | 2 | 72,968,153 | 72,968,153 | 1 | true | 2022-07-13T14:32:48.857Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding multiple rectangle patches using Matplotlib<p>I want to add multiple rectangle patches (<code>rect1, rect2, rect3</code>)using <code>ax.add_patch</cod... |
72,957,937 | google protobuf - how to access size of buffer as specified in .proto file?<p>My protobuf file is</p>
<pre><code>message Msg{
// User Authentication data as bytes.
bytes MsgData = 1 [(nanopb).max_size = 2048];
}
</code></pre>
<p>When I generate the <strong>C</strong> API, the relevant parts are:</p>
<pre><code... | <p><code>sizeof(Msg_AuthenticationData_t.bytes)</code> is the API to get the size of the array. That's the way it works for any C type.</p>
<p>The encoded message size is the maximum size of the output of <code>pb_encode()</code>. Because of the field type and length headers in <a href="https://developers.google.com/pr... | google protobuf - how to access size of buffer as specified in .proto file? | c|protobuf-c|nanopb | 1 | 54 | 1 | 72,969,899 | 72,969,899 | 1 | true | 2022-07-12T20:17:41.070Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
google protobuf - how to access size of buffer as specified in .proto file?<p>My protobuf file is</p>
<pre><code>message Msg{
// User Authentication data... |
72,969,204 | how to use database data to determine what action to take<p>I am looking to have a page with a redirect based on what is in the database.
I have a table called "nametable" and 2 columns "id" and "switch"
The id never changes, only the switch entry does. Sometimes it will have "on"... | <p>I got it. Thanks to the help in the comments, and the answer by @Edgaras except I made a tiny switch to have the == off, and that made it work. thank you all so much. Here is the solution.</p>
<pre><code><?php
$servername = " ";
$username = " ";
$password = " ";
$dbna... | how to use database data to determine what action to take | php|mysql | -1 | 54 | 2 | 72,970,588 | 72,970,588 | 1 | true | 2022-07-13T15:53:33.300Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to use database data to determine what action to take<p>I am looking to have a page with a redirect based on what is in the database.
I have a table call... |
72,970,450 | How to make "int" based on number from database? - Java<p>I'm making a game, so far I've made two buttons for the test. The first button makes a win, and the second one loses, all this is added to the database.</p>
<p><a href="https://i.stack.imgur.com/HehHv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgu... | <p>If you want to increment a value in the database, you can use the <a href="https://firebase.google.com/docs/database/android/read-and-write#atomic_server-side_increments" rel="nofollow noreferrer">atomic increment operation</a>:</p>
<pre><code>Map updates = new HashMap();
updates.put("wins", ServerValue.in... | How to make "int" based on number from database? - Java | java|android|firebase|firebase-realtime-database|integer | 0 | 54 | 1 | 72,971,298 | 72,971,298 | 1 | true | 2022-07-13T17:38:11.763Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make "int" based on number from database? - Java<p>I'm making a game, so far I've made two buttons for the test. The first button makes a win, and the... |
72,968,944 | Marking zero values with a red line in gnuplot<p>I have a .csv datafile that outputs values from 0 to 500 i.e</p>
<pre><code>25.2
2.82
2.05
2.13
2.42
2.17
2.00
0
0
0
0
3.33
3.41
3.26
3.30
0
27.8
</code></pre>
<p>and plot it using</p>
<pre><code>plot 'out.csv' using 1 with lines
</code></pre>
<p>From that file I would l... | <p>Depending on what exactly you are looking for, the following would be my suggestion from what I understood from your question.
Plot the data again <code>with impulses</code> and filtered with the ternary operator (check <code>help ternary</code>).</p>
<p><strong>Script:</strong></p>
<pre><code>### plot with ternary ... | Marking zero values with a red line in gnuplot | gnuplot | 0 | 54 | 1 | 72,972,377 | 72,972,377 | 1 | true | 2022-07-13T15:35:03.060Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Marking zero values with a red line in gnuplot<p>I have a .csv datafile that outputs values from 0 to 500 i.e</p>
<pre><code>25.2
2.82
2.05
2.13
2.42
2.17
2.... |
72,974,160 | What can I do to replace a button in place of another in vuetify?<p>I need replace a button when it's clicked because I need that button to have 3 states (entrada, salida and registrado),I already have those buttons but they only work when reloading the page, I just want it to render without reload, I add my code for a... | <p>You can play out with the buttons with in the <code><v-data-table></code> without any page refresh.</p>
<p>Live Demo <strong>:</strong></p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint... | What can I do to replace a button in place of another in vuetify? | vue.js|vuejs2|vuetify.js|v-data-table|v-btn | 0 | 54 | 1 | 72,976,746 | 72,976,746 | 1 | true | 2022-07-14T01:05:11.870Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What can I do to replace a button in place of another in vuetify?<p>I need replace a button when it's clicked because I need that button to have 3 states (en... |
72,975,927 | How to get current command register value/name in Vim?<p>Currently I have this mapping:</p>
<pre><code> nmap <silent> x :set opfunc=SpecialChange<CR>g@
function! SpecialChange(type)
silent exec 'normal! `[v`]"_dP'
endfunction
</code></pre>
<p>it helps me to substitute some value with the defau... | <p>Taking inspiration from the example provided under <code>:help :map-operator</code>, this is how your function should look:</p>
<pre><code>nnoremap <expr> <key> SpecialChange()
function! SpecialChange(type = '')
if a:type == ''
set opfunc=SpecialChange
return 'g@'
endif
execut... | How to get current command register value/name in Vim? | vim|neovim | 0 | 54 | 2 | 72,977,555 | 72,977,555 | 1 | true | 2022-07-14T06:07:27.817Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get current command register value/name in Vim?<p>Currently I have this mapping:</p>
<pre><code> nmap <silent> x :set opfunc=SpecialChange<C... |
72,974,729 | What is the meaning of the prefix 'Speculative' and 'Checked' of Turbofan operators?<p>In the Turbofan IR, there are several operators whose name begins with 'Speculative' or 'Checked' (e.g. SpeculativeSafeIntegerAdd, CheckedInt32Add, CheckedFloat64ToInt32, ...).</p>
<p>What is the meaning of those prefix?</p> | <p>"SpeculativeSafeIntegerAdd" means "type feedback suggests that this <code>+</code> adds small integers, but that assumption must be guarded with a type check". It's an intermediate-level node that will be lowered further eventually.</p>
<p>"CheckedInt32Add" performs an int32 addition, c... | What is the meaning of the prefix 'Speculative' and 'Checked' of Turbofan operators? | javascript|v8|jit | 1 | 54 | 1 | 72,981,111 | 72,981,111 | 1 | true | 2022-07-14T03:01:55.430Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the meaning of the prefix 'Speculative' and 'Checked' of Turbofan operators?<p>In the Turbofan IR, there are several operators whose name begins with... |
72,984,553 | When I create an object in Django admin, `form_valid()` method is not called<p>When a new <code>Listing</code> is created the <code>form_valid()</code> method creates a <code>Bid</code> object. However, when I use Django Admin to create new a <code>Listing</code> then, the <code>Bid</code> object is not created becaus... | <p>A <code>ModelAdmin</code> has no <a href="https://docs.djangoproject.com/en/dev/ref/class-based-views/mixins-editing/#django.views.generic.edit.FormMixin.form_valid" rel="nofollow noreferrer"><strong><code>.form_valid(…)</code></strong> method <sup>[Django-doc]</sup></a>, this is for class-based views (CBVs) that in... | When I create an object in Django admin, `form_valid()` method is not called | python|django|django-admin | 1 | 54 | 1 | 72,984,859 | 72,984,859 | 1 | true | 2022-07-14T17:34:57.277Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
When I create an object in Django admin, `form_valid()` method is not called<p>When a new <code>Listing</code> is created the <code>form_valid()</code> metho... |
72,984,339 | Conditional replacement of values in JOLT<p>I try to replace a value conditionally in JOLT. The first step is to check whether the key "links" exists. If this key exists, it should also be checked whether the key "type" has the value "null". If both conditions are true, the value of the ke... | <p>You're on the right track. Just apply some little tweaks within the current <strong>shift</strong> transformation, and then apply <strong>cardinality</strong> transformation in order to pick the first components of the generated arrays for the <strong>type</strong> attribute such as</p>
<pre class="lang-json prettyp... | Conditional replacement of values in JOLT | json|transformation|jolt | 1 | 54 | 1 | 72,985,193 | 72,985,193 | 1 | true | 2022-07-14T17:15:45.073Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Conditional replacement of values in JOLT<p>I try to replace a value conditionally in JOLT. The first step is to check whether the key "links" exis... |
72,989,685 | C++ Memory Layout: Questions about multiple inheritance, virtual destructors, and virtual function tables<p>I have a <code>main.cpp</code> file as follows.</p>
<pre class="lang-cpp prettyprint-override"><code>#include <stdio.h>
class Base1
{
public:
int ibase1;
Base1() : ibase1(10) {}
virtual void f_... | <blockquote>
<ol>
<li>What is the meaning of the content in the red box?</li>
<li>Does the above relate to "C++ trunk"?</li>
</ol>
</blockquote>
<p>The symbols you highlighed are <a href="https://en.wikipedia.org/wiki/Name_mangling" rel="nofollow noreferrer"><em>mangled</em></a>, you can use some demangle too... | C++ Memory Layout: Questions about multiple inheritance, virtual destructors, and virtual function tables | c++|multiple-inheritance|memory-layout|virtual-destructor|virtual-table | 0 | 54 | 1 | 72,989,867 | 72,989,867 | 1 | true | 2022-07-15T06:07:44.253Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C++ Memory Layout: Questions about multiple inheritance, virtual destructors, and virtual function tables<p>I have a <code>main.cpp</code> file as follows.</... |
72,990,809 | How to add conditional props to style object in @emotion/react/Typescript?<p><a href="https://i.stack.imgur.com/KWrCP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KWrCP.png" alt="enter image description here" /></a></p>
<p>I want to add props to control my css in emotion,but I don't know how to do... | <p>You can <strong>wrap</strong> it inside a <code>function</code> and handle your function param as <code>prop</code>.</p>
<pre><code>const getMessageWrapperStyle = (props) => {
css({
display: "flex",
alignItems: "center",
marginBottom: "20px",
alignSelf: props.from_u... | How to add conditional props to style object in @emotion/react/Typescript? | reactjs|typescript|emotion|css-in-js | 0 | 54 | 1 | 72,990,887 | 72,990,887 | 1 | true | 2022-07-15T07:58:37.573Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add conditional props to style object in @emotion/react/Typescript?<p><a href="https://i.stack.imgur.com/KWrCP.png" rel="nofollow noreferrer"><img src... |
72,992,919 | Open Layers GeoTIFF<p>Hi can somebody explain how to work with ol.GeoTIFF layer? I tried this tutorial <a href="https://openlayers.org/workshop/en/cog/true-color.html" rel="nofollow noreferrer">https://openlayers.org/workshop/en/cog/true-color.html</a></p>
<p>OL version : 6.14.1
I tried to load the layer like this:</p>... | <p>It should work if you are using the latest <code>ol.js</code> and your <code>olMap</code> is set up correctly:</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-html lang-html prettyprint-override"><code><!docty... | Open Layers GeoTIFF | openlayers | -1 | 54 | 1 | 72,994,434 | 72,994,434 | 1 | true | 2022-07-15T10:55:51.963Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Open Layers GeoTIFF<p>Hi can somebody explain how to work with ol.GeoTIFF layer? I tried this tutorial <a href="https://openlayers.org/workshop/en/cog/true-c... |
72,998,356 | I can't print a specific set in a list in python<pre><code>coordinates=[(4,5),(5,6,(6,6))]
print(coordinates[3])
result:Traceback (most recent call last):
File "C:\Users\PycharmProjects\pythonProject1\App.py", line 2, in <module>
print(coordinates[3])
IndexError: list index out of range
</code></... | <p>You want to double check the way you formatted your list.
From the looks of it, your list has index 0 (4,5) and index 1 (5,6,(6,6)). Your list simply has nothing at index 3 because there are only 2 entries. That's what the error message means.</p>
<p>You might want to change your list into <code>coordinates=[(4,5),5... | I can't print a specific set in a list in python | python | -2 | 54 | 3 | 72,998,404 | 72,998,404 | 1 | true | 2022-07-15T18:35:36.887Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I can't print a specific set in a list in python<pre><code>coordinates=[(4,5),(5,6,(6,6))]
print(coordinates[3])
result:Traceback (most recent call last):
... |
72,999,836 | MicroPython application throws AttributeError for very basic use of re.split without a duplicate "re.py" file present<p>I don't seem to understand why my rather generic use of the <code>split</code> function from the <code>re</code> library is failing:</p>
<pre><code>from machine import Pin, SPI, UART
from array import... | <p>In Micropython, you need to <a href="http://docs.micropython.org/en/latest/library/re.html#re.compile" rel="nofollow noreferrer">compile</a> the matching pattern and then call the split method on the returned regex object.</p>
<pre class="lang-py prettyprint-override"><code>import re
s1="123\t123\t123"
p... | MicroPython application throws AttributeError for very basic use of re.split without a duplicate "re.py" file present | python|python-3.x|python-re|raspberry-pi-pico|thonny | 0 | 54 | 1 | 72,999,958 | 72,999,958 | 1 | true | 2022-07-15T21:40:21.210Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MicroPython application throws AttributeError for very basic use of re.split without a duplicate "re.py" file present<p>I don't seem to understand why my rat... |
73,004,019 | gcovr with Cobertura XML output gives absolute path of production files<p>I have managed to show code coverage data with Cobertura XML in Jenkins.
Its works well, but I wants to see the source code in Jenkins, too.
I accidentally saw, that Jenkins is referring for the source files at my windows harddrive, but the files... | <p>In this instance, you can fix things by changing <code>--filter</code> to <code>--root</code>.</p>
<p>Gcovr has a concept of a “root” directory which defaults to the current working directory. The root is used for various purposes like serving as a default filter, but also for deciding how file names are presented i... | gcovr with Cobertura XML output gives absolute path of production files | jenkins|code-coverage|cobertura|gcovr | 0 | 54 | 1 | 73,006,209 | 73,006,209 | 1 | true | 2022-07-16T12:01:40.960Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
gcovr with Cobertura XML output gives absolute path of production files<p>I have managed to show code coverage data with Cobertura XML in Jenkins.
Its works ... |
73,007,565 | numpy dot product with floating point<p>I was trying to do a dot product using numpy.dot() function. A MWE is given below.</p>
<pre><code>import numpy as np
a = np.array([1.24912871, 2.45123219, 6.87478761, 8.24982742, 3.31231561, 9.42387436])
b = np.array([2.24912871, 5.45123451, 9.87487986, 7.24982743, 1.31231215, 8.... | <p>You are running into the non-associativity of floating point arithmetic. So, ordinarily, no, you can not get two computations with the same result in exact arithmetic to get the same result in floating point arithmetic.</p>
<p>If your inner product calculation is a minor part of the work, you could contemplate doing... | numpy dot product with floating point | numpy|mpi|floating|dot-product | -1 | 54 | 1 | 73,008,612 | 73,008,612 | 1 | true | 2022-07-16T20:46:51.523Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
numpy dot product with floating point<p>I was trying to do a dot product using numpy.dot() function. A MWE is given below.</p>
<pre><code>import numpy as np
... |
73,014,398 | How to simplify object<p>I have an issue here where the code is quite heavy and quite hard to read imo.</p>
<p>I've simplified the code as much as I can but I was wandering if there's a way to simplify this code even further? Or maybe if there is any better terminology i could use for the comments? Any help is much app... | <p>You can use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals" rel="nofollow noreferrer">Template Strings</a> to simplify <code>booking_name</code></p>
<pre class="lang-js prettyprint-override"><code>booking_name: `${username.first_name} ${username.last_name}`,
</code></pre... | How to simplify object | javascript|react-native|simplify|code-cleanup|ecmascript-2016 | -2 | 54 | 2 | 73,014,489 | 73,014,489 | 1 | true | 2022-07-17T18:36:44.257Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to simplify object<p>I have an issue here where the code is quite heavy and quite hard to read imo.</p>
<p>I've simplified the code as much as I can but ... |
73,005,917 | How to set up a Monte Carlo simulation in an ODE to estimate uncertainty?<p>I am aiming to do a Monte Carlo simulation of my ODE to see the variance of possible outcomes and graph the solutions to visualize the results for the entire time-sequence. However, I am struggling to set up the simulation and can't seem to fin... | <p>Following the approach from <a href="https://stackoverflow.com/q/72914861/3677576">an answer given a few days ago</a>, we may write a function that encapsulates random number generation and model simulation. Then we can call this in a loop or with <code>replicate</code> or <code>lapply</code>. The result is then a l... | How to set up a Monte Carlo simulation in an ODE to estimate uncertainty? | r|ode|montecarlo|desolve | 1 | 54 | 2 | 73,014,960 | 73,014,960 | 1 | true | 2022-07-16T16:30:02.363Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to set up a Monte Carlo simulation in an ODE to estimate uncertainty?<p>I am aiming to do a Monte Carlo simulation of my ODE to see the variance of possi... |
73,019,176 | What's the ultimate and definitive way to clear the browser cache?<p>I'm using Liferay CMS as part of my Uni course in full stack development and, as a final project, I have to use the d3.js library to display some graphs. I'm struggling to clear the browser cache though, and that makes the developing process very tedi... | <p>This doesn't clear caches but will solve your updating problem.</p>
<p>In the HTML, add an (unused) query string to the html link to linked files and alter it each time you make an update to the file. e.g. for css:</p>
<pre><code><link rel="stylesheet" href="styles.css?a">
</code></pre>
<p>... | What's the ultimate and definitive way to clear the browser cache? | javascript|web|d3.js|caching|liferay | 0 | 54 | 2 | 73,019,948 | 73,019,948 | 1 | true | 2022-07-18T08:11:57.463Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What's the ultimate and definitive way to clear the browser cache?<p>I'm using Liferay CMS as part of my Uni course in full stack development and, as a final... |
73,026,542 | "NameError: name 'table' is not defined", trying to add numbers over a loop to a string<p>I am trying to loop through a range of values and have it be attached to the name before the equal sign.</p>
<pre><code>for i in range(0, 5):
table[i] = "hello"
print(table[i])
</code></pre>
<p>I want the result ... | <p>First of all, the code you provided is a syntax of Python 3. The error happens while you try to access the variable <code>table</code> which is not defined (in your snippet). What you need is string formatting to display your expected result. In addition, if you need <code>i</code> to start with 1 to 5, you have to ... | "NameError: name 'table' is not defined", trying to add numbers over a loop to a string | python | -2 | 54 | 1 | 73,026,648 | 73,026,648 | 1 | true | 2022-07-18T17:49:26.017Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
"NameError: name 'table' is not defined", trying to add numbers over a loop to a string<p>I am trying to loop through a range of values and have it be attach... |
73,029,280 | How do I set the style for an item in a c# content page?<p>I added the following style in Styles.xaml.</p>
<pre><code><Style x:Key="ButtonOutline" TargetType="Button">
<Setter Property="BackgroundColor" Value="{AppThemeBinding Dark={StaticResource ButtonColorDark}, Li... | <p>Loadfromxaml was not working, not sure why. I'm able to get the style using this:</p>
<pre><code>Application.Current.Resources.TryGetValue("ButtonOutline", out object buttonStyle);
grid.Add(new Button
{
Text = "Clear",
Command = vm.ClearCommand,
Style = (Style)buttonStyle
}, 1, 1)... | How do I set the style for an item in a c# content page? | c#|xaml|maui|.net-maui | 0 | 54 | 1 | 73,029,808 | 73,029,808 | 1 | true | 2022-07-18T22:33:04.917Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I set the style for an item in a c# content page?<p>I added the following style in Styles.xaml.</p>
<pre><code><Style x:Key="ButtonOutline&quo... |
73,024,283 | Map with bubbles with radius on basis of counting<p>I have this easy script for creating bubbles on map, but I would like bubbles with radius on basis of intensity.
I put an image with lat, lon and count. In finaly I put the map result, but there aren't bubbles. Where I am wrong?</p>
<pre><code>import pandas as pd
# Lo... | <p>The reason for the display seems to be that the default value for the bubble radius is 10, so the size of the bubble is indistinguishable because it is specified below that value. So, change the return value to determine the radius from a certain value. And to give markers at individual positions, we need to get the... | Map with bubbles with radius on basis of counting | python|scatter-plot|folium | 0 | 54 | 1 | 73,031,303 | 73,031,303 | 1 | true | 2022-07-18T14:49:12.533Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Map with bubbles with radius on basis of counting<p>I have this easy script for creating bubbles on map, but I would like bubbles with radius on basis of int... |
72,891,147 | Add longitude and latitude as features in tensorflow-recommender model<p>I am making a recommender system. For similar queries I want to give similar recommendations.</p>
<p>I was following the example from here: <a href="https://www.tensorflow.org/recommenders/examples/featurization?hl=en" rel="nofollow noreferrer">ht... | <p>In this Google <a href="https://developers.googleblog.com/2017/11/introducing-tensorflow-feature-columns.html" rel="nofollow noreferrer">blog</a> an explaination is given on how to model geographic coordinates. You can make use of feature crosses to combine the longitude and latitude features.</p> | Add longitude and latitude as features in tensorflow-recommender model | python|tensorflow|keras|tf.keras|recommendation-engine | 0 | 54 | 1 | 73,047,589 | 73,047,589 | 1 | true | 2022-07-07T00:36:43.967Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add longitude and latitude as features in tensorflow-recommender model<p>I am making a recommender system. For similar queries I want to give similar recomme... |
72,996,569 | Circular design pattern?<p>I have a class <code>A</code> and class <code>B</code>. Class <code>A</code> has a parameter which is a list of objects of class <code>B</code>. Class <code>B</code> has a parameter which is an object of instance <code>A</code>.</p>
<p>Would inheritance help me somehow here?</p>
<p>What would... | <p>Well, since no one replied so far, here's what I think.</p>
<ul>
<li>Circular reference is almost always the outcome of a bad design, so you should probably rethink the way your classes are defined. However, Python will happily accept it - your issue is probably with a type checker, or your IDE, not with Python</li>... | Circular design pattern? | python|design-patterns | 0 | 54 | 1 | 73,053,465 | 73,053,465 | 1 | true | 2022-07-15T15:45:52.617Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Circular design pattern?<p>I have a class <code>A</code> and class <code>B</code>. Class <code>A</code> has a parameter which is a list of objects of class <... |
73,002,691 | Applying css styling for native material select<p>I have two dropdown below:</p>
<ol>
<li>Basic Mat select</li>
<li>Basic native select</li>
</ol>
<blockquote>
<pre><code><h4>Basic mat-select</h4>
<mat-form-field appearance="fill">
<mat-label>Favorite food</mat-label>
<mat... | <p>From what I know and have experienced there's no simple way to do it using just CSS. You will also need JS.</p>
<p>These two links should help:</p>
<ol>
<li>[https://moderncss.dev/custom-select-styles-with-pure-css/][2]</li>
<li>[https://www.w3docs.com/snippets/css/how-to-style-a-select-box-drop-down-with-only-css.h... | Applying css styling for native material select | javascript|html|jquery|css|angular-material | 0 | 54 | 1 | 73,083,055 | 73,083,055 | 1 | true | 2022-07-16T08:24:51.810Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Applying css styling for native material select<p>I have two dropdown below:</p>
<ol>
<li>Basic Mat select</li>
<li>Basic native select</li>
</ol>
<blockquot... |
72,935,493 | Android emulator not showing the running app<p>I am building and android application using Nativescript. After about a month of not touching the project i am trying now to run it again but facing a big problem - although from the visual code everything seems fine (i run command "tns run android" and everythin... | <p>Check please
Maybe it help you!</p>
<pre><code>https://github.com/NativeScript/nativescript-cli/issues/5069
</code></pre> | Android emulator not showing the running app | android|angular|android-studio|visual-studio-code|nativescript | -1 | 54 | 1 | 73,213,034 | 73,213,034 | 1 | true | 2022-07-11T08:09:32.707Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Android emulator not showing the running app<p>I am building and android application using Nativescript. After about a month of not touching the project i am... |
72,797,525 | Git format-patch and branch conflicts<p>I need to create patches from one repo (<code>repo-a</code>) and merge them into another (<code>repo-b</code>). These patches needs to contain the commits themself, so I found that <code>git format-patch</code> and <code>git am</code> is a perfect fit.</p>
<p>We are using multipl... | <p>I found a way to do this in the way I wanted.</p>
<pre class="lang-bash prettyprint-override"><code>git remote add otherrepo ../otherrepo
git fetch otherrepo
# If you want to fetch lfs objects as well
git lfs fetch --all otherrepo
# -X subtree: Or you will get a lot of merge-conflicts, some of them with empty line... | Git format-patch and branch conflicts | git|version-control | 1 | 54 | 3 | 73,222,498 | 73,222,498 | 1 | true | 2022-06-29T07:38:53.030Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Git format-patch and branch conflicts<p>I need to create patches from one repo (<code>repo-a</code>) and merge them into another (<code>repo-b</code>). These... |
72,780,955 | Why aren't these two strings equivalent? C<p>I'm currently working my way through CS50x and just tinkering around with some of the practice problems from Week 1 and testing the limits of my knowledge. Could someone help me understand why the two strings "my_month" and "your_month" aren't equal?</p>
... | <p>The reason is because technically they aren't equal. When you use '==' on strings, what you are comparing is their addresses.</p>
<p>To compare the contents of 2 string you have you have to use strcmp().</p>
<p><strong>So your code should look like this:</strong></p>
<pre><code>if (strcmp(your_month, my_month) == 0)... | Why aren't these two strings equivalent? C | arrays|c|string|cs50 | 0 | 54 | 2 | 72,781,056 | 72,781,056 | 1 | true | 2022-06-28T05:03:19.597Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why aren't these two strings equivalent? C<p>I'm currently working my way through CS50x and just tinkering around with some of the practice problems from Wee... |
72,898,384 | How to keep workspace:* version specifications when running 'lerna version'<p>In a given JS monorepo, sub-packages that depend on each other declare this dependency in their <code>package.json</code> files as</p>
<pre class="lang-json prettyprint-override"><code> "@foo/bar": "workspace:*",
"... | <p>The original <a href="https://github.com/lerna/lerna" rel="nofollow noreferrer">Lerna</a> does not currently work properly with <code>workspace:</code> protocol (it will throw some errors and overwrite any <code>workspace:</code>), there was this <a href="https://github.com/lerna/lerna/pull/2450" rel="nofollow noref... | How to keep workspace:* version specifications when running 'lerna version' | monorepo|lerna|yarn-workspaces|yarnpkg-v2 | 0 | 54 | 1 | 72,954,992 | 72,954,992 | 1 | true | 2022-07-07T13:07:49.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to keep workspace:* version specifications when running 'lerna version'<p>In a given JS monorepo, sub-packages that depend on each other declare this dep... |
73,023,075 | Data manipulation to nested dictionaries?<p>I have some data that looks like this:</p>
<pre><code>this_data = [{
"Name": "Bluefox",
"Sub Name": "Moonglow",
"Time Series": "{'2022-07-06': 9.5, '2022-07-07': 7.2, '2022-07-08': 10.3}",
"Proba... | <p>I don't think there is a direct way to export "Name" and "Sub Name" on different levels but you can do it by looping over your dataframes grouped by "Name" (using pandas). There are additional difficulties like converting your strings to dictionaries and switching the levels of the date... | Data manipulation to nested dictionaries? | python|json|python-3.x|dictionary|data-science | 0 | 54 | 1 | 73,023,602 | 73,023,602 | 1 | true | 2022-07-18T13:26:22.883Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Data manipulation to nested dictionaries?<p>I have some data that looks like this:</p>
<pre><code>this_data = [{
"Name": "Bluefox",
... |
72,892,486 | Merge/Join pandas dataframe with condition<p>I have a two pandas DataFrame <code>df1</code> and <code>df2</code>. The relationship between them is one-to-many, and in some instances it can be one-to-one. When the relationship is one-to-many, I'd like to join columns with certain conditions. I'll illustrate with some da... | <p>For match by max or by min by both columns create helper column <code>tmp</code> and join new DataFrame created by sorting per columns <code>lid</code> and <code>tmp</code> with remove duplicates per <code>lid</code>:</p>
<pre><code>df2['tmp'] = list(zip(df2['av'].str.strip('$').astype(int), df2['cr']))
#sorting by... | Merge/Join pandas dataframe with condition | python|pandas | 1 | 54 | 1 | 72,892,523 | 72,892,523 | 1 | true | 2022-07-07T05:00:17.647Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Merge/Join pandas dataframe with condition<p>I have a two pandas DataFrame <code>df1</code> and <code>df2</code>. The relationship between them is one-to-man... |
72,894,354 | Calculations with datetime index of Pandas dataframe<p>I have a Pandas dataframe. The index of the dataframe is a datetime column namely "time".
How is it possible to call certain information like min() or max values of this index datetime column?
or how do I do a timedelta calculation?</p>
<p>The dataframe e... | <p>Use:</p>
<pre><code>duration = (pd.Timedelta(str(df_1hz.index.time.max()))-
pd.Timedelta(str(df_1hz.index.time.min())))
print (duration)
0 days 01:35:44
</code></pre>
<p>If there is same datetimes:</p>
<pre><code>def f(x):
ts = x.total_seconds()
hours, remainder = divmod(ts, 3600)
minutes, se... | Calculations with datetime index of Pandas dataframe | python-3.x|pandas|dataframe|datetime | 1 | 54 | 1 | 72,894,367 | 72,894,367 | 1 | true | 2022-07-07T08:09:23.773Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Calculations with datetime index of Pandas dataframe<p>I have a Pandas dataframe. The index of the dataframe is a datetime column namely "time".
Ho... |
72,839,751 | ES6 Module's importmap to Pug<p>I am new in Pug. I try to translate this code to Pug v3.0.2:</p>
<pre class="lang-html prettyprint-override"><code><body>
<script async src="https://unpkg.com/es-module-shims@1.3.6/dist/es-module-shims.js"></script>
<script type="importmap&quo... | <p>Correct usage of JS on client side is:</p>
<pre><code>script.
console.log("hello world")
</code></pre>
<p>The script in Pug:</p>
<pre><code>script(type="importmap").
{
"imports": {
"gl-matrix": "https://cdn.skypack.dev/gl-matrix@3.4.3"
}
}
</code>... | ES6 Module's importmap to Pug | pug | 0 | 54 | 1 | 72,847,983 | 72,847,983 | 1 | true | 2022-07-02T14:18:01.133Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ES6 Module's importmap to Pug<p>I am new in Pug. I try to translate this code to Pug v3.0.2:</p>
<pre class="lang-html prettyprint-override"><code><body&g... |
72,882,604 | Update Field in MongoDB but need to consider old value<p>How to Update a field by reading the old value from the document then update a new value to that field in MongoDB.</p>
<hr />
<p>suppose in a document i have a field named Qty and it already has a value like Qty = 2;
now i need to update the Qty = 5;
So after upd... | <p>Suppose you have a model like below.</p>
<pre><code> db.products.insertOne(
{
_id: 1,
sku: "foo",
quantity: 2,
}
)
</code></pre>
<p>The following updateOne() operation uses the $inc operator to:</p>
<ul>
<li>increase the quantity field by 2</li>
</u... | Update Field in MongoDB but need to consider old value | mongodb|mongodb-query | -3 | 54 | 1 | 72,882,915 | 72,882,915 | 1 | true | 2022-07-06T11:13:21.627Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Update Field in MongoDB but need to consider old value<p>How to Update a field by reading the old value from the document then update a new value to that fie... |
72,820,742 | Why is the outcome of problem 23 of project Euler wrong?<p>I am trying to solve problem 23 of project Euler (a website with math puzzles). Problem 23 is this:</p>
<p><a href="https://i.stack.imgur.com/nkI9B.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nkI9B.png" alt="enter image description here" ... | <p>If you just check the output of:</p>
<pre class="lang-py prettyprint-override"><code>print(sum(range(12, 28123 + 1)))
</code></pre>
<p>you will get <code>395465560</code>. So you are summing up all numbers in this range. And why? Because of this mistake in the last lines of code:</p>
<pre class="lang-py prettyprint-... | Why is the outcome of problem 23 of project Euler wrong? | python | -1 | 54 | 1 | 72,821,051 | 72,821,051 | 1 | true | 2022-06-30T18:52:59.717Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is the outcome of problem 23 of project Euler wrong?<p>I am trying to solve problem 23 of project Euler (a website with math puzzles). Problem 23 is this... |
72,887,367 | Reading Large Text Content Into Dictionary<p>I have a large text file with daily entries:</p>
<pre><code>Date - 01031991
Location- Worcester, MA
Status - very long sentence that
continues over the next few
lines like so.
Author- Security 87
Date- 01071991
Location - Fort-Devens, MA
Status: another long... | <p>A non-regex approach:</p>
<pre><code># read text from file
path = # file name
with open(path, 'r') as fd:
text = fd.read()
# process text line by line
data = {}
last_key = ''
for line in text.split('\n'):
if line.startswith(' '):
data[last_key] += ' ' + line.strip(' -:\n\t')
else:
key, _,... | Reading Large Text Content Into Dictionary | python|string|text | 0 | 54 | 1 | 72,887,733 | 72,887,733 | 1 | true | 2022-07-06T17:00:14.350Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reading Large Text Content Into Dictionary<p>I have a large text file with daily entries:</p>
<pre><code>Date - 01031991
Location- Worcester, MA
Status - ver... |
72,900,344 | Why is my sum() summing to zero, having no NAs and only numerical data?<p>Once again with a very simple question.</p>
<p>I am trying to add all emissions together, basically summing 5 variables per row.</p>
<p>However, it keeps summing to zero, even when I have no NAs and only numeric values.</p>
<p>This is the data I ... | <p>You need to specify that it is a vector of variables using <code>c()</code> and ``'s. As you output is already numeric, you won't need to specify that.</p>
<pre class="lang-r prettyprint-override"><code>df_structure %>%
rowwise() %>%
mutate(sum_emissions = sum(c(`Particeles_PM10_[kg]_WTW_whole transport c... | Why is my sum() summing to zero, having no NAs and only numerical data? | r|dataframe|dplyr|sum | 0 | 54 | 2 | 72,900,460 | 72,900,460 | 1 | true | 2022-07-07T15:15:17.883Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is my sum() summing to zero, having no NAs and only numerical data?<p>Once again with a very simple question.</p>
<p>I am trying to add all emissions tog... |
72,942,365 | Subsetting and Summing within categories in R<p>I am trying to subset and compute sums from within groups, based on certain conditions. All of this should be possible with base R, but I am unsure how to make it work properly.</p>
<p>I have a basic dataframe with many variables.</p>
<p>I am interested in variables A (ca... | <p>If you want to do it with <code>base</code> as asked (*), you could use <code>aggregate</code> (or <code>tapply</code>):</p>
<pre class="lang-r prettyprint-override"><code>data <- data.frame(A = c(rep("Category1", 1200),
rep("Category2", 850)),
B = c... | Subsetting and Summing within categories in R | r|dataframe|sum|subset | 0 | 54 | 1 | 72,942,520 | 72,942,520 | 1 | true | 2022-07-11T17:20:52.097Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Subsetting and Summing within categories in R<p>I am trying to subset and compute sums from within groups, based on certain conditions. All of this should be... |
72,829,391 | How to create a selector for a Button programmatically<p>How to create a selector programmatically (Kotlin) for an ImageButton with the following requirements.</p>
<ul>
<li>Only the background scales by 25% while the image remains the same size while the button is at the <code>Pressed</code> state.</li>
<li>The backgro... | <p>You will need to recreate the following drawable programmatically:</p>
<pre><code><selector>
<item android:drawable="@android:color/holo_blue_light" android:state_pressed="true" />
<item>
<inset android:drawable="@android:color/holo_red_light" androi... | How to create a selector for a Button programmatically | android|button|selector|android-button|programmatically | 1 | 54 | 2 | 72,903,765 | 72,903,765 | 1 | true | 2022-07-01T12:38:37.770Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create a selector for a Button programmatically<p>How to create a selector programmatically (Kotlin) for an ImageButton with the following requirement... |
73,006,084 | Create a data frame with values column names matching another data frame's name<p>I have some data frames, as follows</p>
<pre><code>jack<-data.frame(c("M","F"),c(12,22))
colnames(jack)[1]<-"sex"
colnames(jack)[2]<-"age"
ethan<-data.frame(c("M","F"... | <p>We can use <code>mget</code> on the <code>intersect</code>ing objects created in the global environment with the <code>names</code> from 'mydf' to return a <code>list</code> of key/values, then bind the list elements with <code>bind_rows</code>, reshape to 'wide' format with <code>pivot_wider</code> and later join w... | Create a data frame with values column names matching another data frame's name | r|dataframe | 2 | 54 | 2 | 73,006,125 | 73,006,125 | 1 | true | 2022-07-16T16:52:40.627Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create a data frame with values column names matching another data frame's name<p>I have some data frames, as follows</p>
<pre><code>jack<-data.frame(c(&q... |
72,899,720 | Selecting specific columns from a Data Frame<p>everybody!!
I have a question.
Imagine a Data Frame with columns [a, b, c, e, f, g, h, i, j]. I want to create a 2nd DF having only columns a, c-g. How can I do this in a single coman without creating a list putting ao the columns? For example, I'm writing in that way:</p>... | <p>The easiest way will be to use slice notation <code>.loc</code> as you demonstrated along with a call to <code>.drop</code> to remove any specific unwanted columns:</p>
<h2>Create data</h2>
<pre class="lang-py prettyprint-override"><code>>>> df = pd.DataFrame([[*range(10)]]*5, columns=[*'abcdefghij'])
>&... | Selecting specific columns from a Data Frame | python|pandas | 2 | 54 | 4 | 72,900,295 | 72,900,295 | 1 | true | 2022-07-07T14:35:59.513Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Selecting specific columns from a Data Frame<p>everybody!!
I have a question.
Imagine a Data Frame with columns [a, b, c, e, f, g, h, i, j]. I want to create... |
72,871,918 | Execute some code after a successful SQL Unit Test<p>We have an application that has many SPROCs being developed and maintained by multiple developers, and we are trying to automate the process to keep track of modifying and testing the SPROCs. We currently have a table in our database that is populated and modified ba... | <p>We found the results using a couple of slightly adjacent posts.</p>
<p>It comes down to creating a base test class that only has the <code>TestCleanup()</code> method and referencing the <code>TestContext.CurrentTestOutcome</code>.</p>
<p>You will then have the other test classes reference this as a base class and r... | Execute some code after a successful SQL Unit Test | c#|sql|visual-studio|unit-testing|stored-procedures | 2 | 54 | 2 | 72,884,266 | 72,884,266 | 1 | true | 2022-07-05T15:24:37.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Execute some code after a successful SQL Unit Test<p>We have an application that has many SPROCs being developed and maintained by multiple developers, and w... |
72,988,495 | How to directly label regression lines within plot frame (without a legend)?<h2>Data and Previous Content</h2>
<p>This question is a continuation of a <a href="https://stackoverflow.com/questions/72947930/how-can-i-color-one-specific-regression-line-among-many-in-ggplot-to-match-annot">previous question</a> with the sa... | <p>Adapting <a href="https://stackoverflow.com/a/69742445/12993861">this answer</a> to your case you could achieve your desired result by using <code>stat="smooth"</code> via <code>geom_text</code> or <code>ggrepel::geom_text_repel</code>. The tricky part is to get only one label for which I use an <code>ifel... | How to directly label regression lines within plot frame (without a legend)? | r|ggplot2|regression|legend | 0 | 54 | 1 | 72,990,051 | 72,990,051 | 1 | true | 2022-07-15T02:34:15.947Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to directly label regression lines within plot frame (without a legend)?<h2>Data and Previous Content</h2>
<p>This question is a continuation of a <a hre... |
72,944,612 | 'NumberOfCharsWritten' could be '0': this does not adhere to the specification for the function 'WriteConsoleOutputCharacterW' 22<p>Im trying to write a console screen buffer, but i keep getting different errors pointing at the LPDWORD variable no matter what values i assign to it</p>
<pre><code>#include<iostream>... | <p>You are passing a NULL pointer to <code>WriteConsoleOutputCharacter()</code>, but the pointer needs to point to an actual <code>DWORD</code> instead.</p>
<p>Declare a <code>DWORD</code> variable and use the <code>&</code> operator to get a pointer to that <code>DWORD</code>:</p>
<pre><code>DWORD NumberOfCharsWri... | 'NumberOfCharsWritten' could be '0': this does not adhere to the specification for the function 'WriteConsoleOutputCharacterW' 22 | c++ | -2 | 54 | 1 | 72,944,677 | 72,944,677 | 1 | true | 2022-07-11T20:58:42.873Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
'NumberOfCharsWritten' could be '0': this does not adhere to the specification for the function 'WriteConsoleOutputCharacterW' 22<p>Im trying to write a cons... |
73,020,825 | How to convert each row in Pandas DF to 2D numpy array?<p>I have a Pandas dataframe with <code>785</code> columns (<code>784</code> columns and <code>1</code> column as a label).</p>
<p>I wanna use CNN to train a model on it, therfore I should convert each row if the dataframe to "image": <code>(28x28x1)</cod... | <p>Following code is an example of 4 columns and a label.</p>
<pre><code>import numpy as np
import pandas as pd
csv_path = './example.xlsx'
df = pd.read_excel(csv_path)
df_new = pd.DataFrame(columns=['Column', 'label'])
for i, row in df.iterrows():
a = []
for j, column in row.iteritems():
if j == 'la... | How to convert each row in Pandas DF to 2D numpy array? | python|pandas|numpy | 0 | 54 | 3 | 73,021,661 | 73,021,661 | 1 | true | 2022-07-18T10:27:04.510Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert each row in Pandas DF to 2D numpy array?<p>I have a Pandas dataframe with <code>785</code> columns (<code>784</code> columns and <code>1</code... |
72,893,226 | Checking if date is matching date format<p>So it is pretty straight forward code. I have an input date that I want to validate against a specific format (the input date should perfectly match the date format specified), so I used the following code, input an invalid date (that should failed matching) but to my surprise... | <p>According to <a href="https://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_Patterns" rel="nofollow noreferrer">Unicode Date Format Patterns</a> only the two digit year format <code>yy</code> checks also for the length, 3 <code>y</code> and more add leading zeros up to the number of <code>y</code>... | Checking if date is matching date format | swift|datetime | 0 | 54 | 2 | 73,022,607 | 73,022,607 | 1 | true | 2022-07-07T06:33:32.173Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Checking if date is matching date format<p>So it is pretty straight forward code. I have an input date that I want to validate against a specific format (the... |
72,947,484 | Skip a spec file on fail and still report it as failed on result<p>I am aiming to skip a spec files once an <code>it()</code> inside it <strong>fails</strong>. And I would still like to see the error reported so I know where to focus on.</p>
<p>I have two test scripts that is inside the same folder <strong>first.cy.js<... | <p>The <code>afterEach()</code> is too early to call <code>Cypress.runner.stop()</code>, but it seems to work with <code>test:after:run</code>.</p>
<pre class="lang-js prettyprint-override"><code>describe('test body', () => {
Cypress.on('test:after:run', (result) => {
if (result.currentRetry === result.ret... | Skip a spec file on fail and still report it as failed on result | cypress | 1 | 54 | 2 | 72,948,343 | 72,948,343 | 1 | true | 2022-07-12T05:38:31.790Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Skip a spec file on fail and still report it as failed on result<p>I am aiming to skip a spec files once an <code>it()</code> inside it <strong>fails</strong... |
72,891,446 | Could Java Future call its own get() function in its other members?<p>I wish to do this:</p>
<pre><code> CompletableFuture<Integer> f1 = CompletableFuture.supplyAsync(()->{
try {
Thread.sleep(3000);
} catch (InterruptedException e) {}
return 1;
... | <p><code>this</code> refer to the caller instance(object) who call the instance method, you cannot use this inside a class and refer to the declared variable <code>f1</code>.</p>
<p>You can test if the task is done then print the result else print another message, giving it 3 seconds to be sure that it will be done for... | Could Java Future call its own get() function in its other members? | java|function|compilation|get|future | 0 | 54 | 2 | 72,891,529 | 72,891,529 | 1 | true | 2022-07-07T01:43:44.697Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Could Java Future call its own get() function in its other members?<p>I wish to do this:</p>
<pre><code> CompletableFuture<Integer> f1 = Complet... |
72,849,265 | What is the difference between areas and "boxes" of a box in the box model<p>Regarding the margin, border, padding and contents of a box, what is the difference between <em>area</em> (margin, border, padding and content areas) and a <em>box</em> (margin box, border box, padding box and content box)?</p>
<p>For example,... | <p>From the <a href="https://www.w3.org/TR/css-box-3/#box-model" rel="nofollow noreferrer">specification</a></p>
<blockquote>
<p>Each box has a content area (which contains its content—text, descendant boxes, an image or other replaced element content, etc.) and optional <strong>surrounding</strong> padding, border, an... | What is the difference between areas and "boxes" of a box in the box model | css | 1 | 54 | 2 | 72,850,297 | 72,850,297 | 1 | true | 2022-07-03T19:16:21.623Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the difference between areas and "boxes" of a box in the box model<p>Regarding the margin, border, padding and contents of a box, what is the differe... |
72,769,444 | How can I pass variable of "phoneNumberState.value" from ScreenA to ScreenB in jetpack compose?<p>I have one variable in screen A as val <code>phoneNumberState = remember { mutableStateOf("") }</code> and I want to pass this argument to screen B, so I try to do it on internet, there is some example, I confus... | <p>According to <a href="https://developer.android.com/jetpack/compose/navigation" rel="nofollow noreferrer">Navigation compose document</a>:</p>
<p>first change your ScreenB's constructor to this:</p>
<pre><code>@Composable
fun ScreenB(
navController: NavController,
number: String
) {...}
</code></pre>
<p>then... | How can I pass variable of "phoneNumberState.value" from ScreenA to ScreenB in jetpack compose? | android|kotlin|android-jetpack-compose | 0 | 54 | 2 | 72,770,851 | 72,770,851 | 1 | true | 2022-06-27T08:58:15.327Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I pass variable of "phoneNumberState.value" from ScreenA to ScreenB in jetpack compose?<p>I have one variable in screen A as val <code>phoneNumberSt... |
72,775,824 | Waiting until eventListener is called to return a promise<p>I'm trying to return the result of a fetch call but I want to wait until my eventListener detects a change within a dynamically rendered selector list.</p>
<p>You'll see the fetch call written below grabbing the values from an API and rendering the list of val... | <p>Break this into three steps.</p>
<ol>
<li>Prepare: Fetch data + cache data</li>
</ol>
<pre><code>const fetchResult = fetch(...).then(response => response.json());
</code></pre>
<ol start="2">
<li>Build list (use id to identify records!)</li>
</ol>
<pre><code>
fetchResult.then(data => {
// Create select list
... | Waiting until eventListener is called to return a promise | javascript|es6-promise|fetch-api | 0 | 54 | 1 | 72,776,224 | 72,776,224 | 1 | true | 2022-06-27T17:01:12.457Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Waiting until eventListener is called to return a promise<p>I'm trying to return the result of a fetch call but I want to wait until my eventListener detects... |
72,774,762 | WLP and OpenLiberty prevent me to use LtpaToken2 cookie name<p>I am planning to implement SSO w/OIDC between several identical Websphere Liberty profile (wlp) instances with the standard <code>LtpaToken2</code> cookie, but I don't see it being generated under that name. Instead, I see a random <code>WAS_*</code> cookie... | <p>Enabling either the openidConnectClient-1.0 or openidConnectServer-1.0 will cause the cookie name to be automatically generated with a server specific identifier for either one of those features. In some situations, this allows configuring multiple Relying Parties and Providers in the same host without collisions wh... | WLP and OpenLiberty prevent me to use LtpaToken2 cookie name | open-liberty | 0 | 54 | 1 | 72,776,223 | 72,776,223 | 1 | true | 2022-06-27T15:36:50.553Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
WLP and OpenLiberty prevent me to use LtpaToken2 cookie name<p>I am planning to implement SSO w/OIDC between several identical Websphere Liberty profile (wlp... |
72,985,448 | pyparsing variables that refer to each other<p>I am using <code>pyparsing</code> to write a small grammar, but I'm running into an issue where the definition of one variable requires me to use another variable that itself requires the first one, etc. <a href="https://stackoverflow.com/questions/24488959/prolog-fact-lex... | <p>This is a common issue with grammars, where there is some recursion in the definition of things.</p>
<p>I often encourage parser developers to take a moment and write up a BNF before diving into writing code. This is good practice whether you are using pyparsing or any other parsing library. Here is one that I came ... | pyparsing variables that refer to each other | python|context-free-grammar|pyparsing | 1 | 54 | 1 | 72,987,633 | 72,987,633 | 1 | true | 2022-07-14T18:58:34.433Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pyparsing variables that refer to each other<p>I am using <code>pyparsing</code> to write a small grammar, but I'm running into an issue where the definition... |
72,925,369 | Find each table whose first cell has one of two words followed by three digits<p>I would like to fix the following code to make it find each table in the document where it has the pattern <code>ARC</code> or <code>MEC</code> words followed by the wildcard digits <code>[1-4][1-9]{2}</code> without any leading/trailing c... | <p>For example:</p>
<pre><code>Sub Demo()
Application.ScreenUpdating = False
With ActiveDocument.Range
With .Find
.ClearFormatting
.Replacement.ClearFormatting
.Format = False
.Forward = True
.Wrap = wdFindStop
.MatchWildcards = True
.Text = "<[ACEMR]{3}[1-4][1-9]{2}>"
... | Find each table whose first cell has one of two words followed by three digits | vba|ms-word|wildcard | 0 | 54 | 2 | 72,925,520 | 72,925,520 | 1 | true | 2022-07-10T00:00:34.040Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find each table whose first cell has one of two words followed by three digits<p>I would like to fix the following code to make it find each table in the doc... |
72,901,409 | Concat columns of a groupby object Pandas<p>I have a dataset as shown below</p>
<pre><code> No Manufacturer Description Capacity Bezeichung2 Name Year
0 735.00.26 Yamaha IT 125 H NaN 1981
1 735.00.26 Yamaha RT 180 NaN NaN 1990
2 735.00... | <p>Fixing up the groupby by filling <code>nan</code> values:</p>
<pre><code>out = (df.fillna('')
.groupby(['No', 'Manufacturer', 'Description', 'Capacity', 'Bezeichung2', 'Name'])['Year']
.agg(['min', 'max'])
.reset_index())
print(out)
</code></pre>
<p>Output:</p>
<pre><code> No Manu... | Concat columns of a groupby object Pandas | python|pandas | 1 | 54 | 1 | 72,902,187 | 72,902,187 | 1 | true | 2022-07-07T16:34:40.357Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Concat columns of a groupby object Pandas<p>I have a dataset as shown below</p>
<pre><code> No Manufacturer Description Capacity Bezeichung2 Name... |
72,838,106 | How to handle alpha layer of images in css?<p>I was trying to make a image button.The images have alpha layer in them. The alpha layer is not blending properly and instead of transparency, I am getting a white background.</p>
<p>I don't know how to fix this. Please help. I want the image buttons to show the color of la... | <p>you put the image inside a <code><button></code>! <em><<this is the problem</em></p>
<p>the default behavior of a <code><button></code> is to be grey.</p>
<p>just add a <code>inherit</code> value to <code>background-color</code> css property</p>
<p><a href="https://developer.mozilla.org/en-US/docs/... | How to handle alpha layer of images in css? | html|css|image|button|alpha | 1 | 54 | 1 | 72,838,364 | 72,838,364 | 1 | true | 2022-07-02T09:50:45.840Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to handle alpha layer of images in css?<p>I was trying to make a image button.The images have alpha layer in them. The alpha layer is not blending proper... |
72,801,722 | Proper way to use Angular EventEmitter<p>In my simplified scenario there is a <code>parent</code> component, which contains all the business logic.</p>
<p>The <code>parent</code> creates a <code>child</code> component which is only responsible to display a list of buttons.</p>
<p>I want to handle the click events for s... | <p>You can emit what-ever</p>
<p>//parent</p>
<pre><code>@Component({
selector: "parent",
template: ` <child
[buttons]="buttons" (click)="$event()"
></child>
<span>{{ description }}</span>`
})
export class ParentComponent {
description = "&q... | Proper way to use Angular EventEmitter | javascript|angular|typescript|events | 2 | 54 | 2 | 72,803,916 | 72,803,916 | 1 | true | 2022-06-29T12:49:17.903Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Proper way to use Angular EventEmitter<p>In my simplified scenario there is a <code>parent</code> component, which contains all the business logic.</p>
<p>Th... |
72,891,378 | How to create a FactoryBot factory that is an amalgamation of two other records?<p>I have an object, let's call it a TransitProvider.</p>
<p>It isn't an ActiveRecord object. It uses ActiveModel but it's designed to pull (or persist) it's data from two separate tables, a Provider table and a TransitService table. (reaso... | <p>Thoughtbot recently wrote a <a href="https://thoughtbot.com/blog/tips-for-using-factory-bot-without-an-orm" rel="nofollow noreferrer">blog post</a> on this subject, and FactoryBot's README has a section on <a href="https://github.com/thoughtbot/factory_bot/blob/main/GETTING_STARTED.md#custom-construction" rel="nofo... | How to create a FactoryBot factory that is an amalgamation of two other records? | ruby-on-rails|ruby|rspec|factory-bot|factories | 2 | 54 | 1 | 72,891,722 | 72,891,722 | 1 | true | 2022-07-07T01:29:19.500Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create a FactoryBot factory that is an amalgamation of two other records?<p>I have an object, let's call it a TransitProvider.</p>
<p>It isn't an Acti... |
72,363,886 | How can I run xctest for return ViewController func<p>How to write XCTestCase for below code</p>
<pre><code>class HelpViewUseCase: HelpUseCaseProtocol, SubscriptionsHelpProtocol, ProfileHelpProtocol {
func getHelpViewController() -> UIViewController {
HelpViewController()
}
}
</code></pre>
<p... | <p>A unit test (or "<a href="https://www.industriallogic.com/blog/history-microtests/" rel="nofollow noreferrer">microtest</a>") should:</p>
<ul>
<li>Set up something to call (Arrange)</li>
<li>Call the behavior we want to exercise (Act)</li>
<li>Confirm the expected result (Assert)</li>
</ul>
<p>This is a se... | How can I run xctest for return ViewController func | swift|unit-testing|xctest|xctestcase | -3 | 54 | 1 | 72,724,144 | 72,724,144 | 1 | true | 2022-05-24T13:34:51.223Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I run xctest for return ViewController func<p>How to write XCTestCase for below code</p>
<pre><code>class HelpViewUseCase: HelpUseCaseProtocol, Subsc... |
72,894,352 | REST API with methods using different programming languages<ul>
<li>I assume that an App Service as part of an App Service Plan
<ul>
<li>could have methods not all in the same language.</li>
</ul>
</li>
</ul>
<p>Someone I work with stated you should have 2 App Services, e.g. one for python and one for Scala.
Is this so... | <blockquote>
<p>Someone I work with stated you should have 2 App Services, e.g. one for python and one for Scala. Is this so?</p>
</blockquote>
<p>Correct, you will need different App Services per runtime/language. They can share the same App Service Plan, if the runtime is supported by the Operating System of the App ... | REST API with methods using different programming languages | azure|rest|azure-web-app-service | 0 | 54 | 2 | 72,894,835 | 72,894,835 | 1 | true | 2022-07-07T08:09:18.733Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
REST API with methods using different programming languages<ul>
<li>I assume that an App Service as part of an App Service Plan
<ul>
<li>could have methods n... |
72,971,459 | How to count the numer of rows containing a string in a multiline list?<p>I'm a newbie of python...</p>
<p>I have created a list like a table with rows and 4 columns</p>
<pre><code>70782763 Pilot 17,54 4,9
74006423 Pilot 19,95 4,9
74924394 Pilot 16,06 4,9
70782763 Auto 20,9 6,5
70706423 Track 19,1 5,9
74924394 Tra... | <p>if I understood correctly:</p>
<pre><code>table = [[70782763, 'Pilot', 54, 9],
[74006423, 'Pilot', 14, 9],
[74924394, 'Pilot', 4, 9],
[70782763, 'Auto', 9, 5],
[70706423, 'Track', 15, 9],
[74924394, 'Track', 45, 9]]
print(sum([x[1] == 'Pilot' for x in table]))
</code></p... | How to count the numer of rows containing a string in a multiline list? | python|list | 0 | 54 | 2 | 72,971,596 | 72,971,596 | 1 | true | 2022-07-13T19:10:25.243Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to count the numer of rows containing a string in a multiline list?<p>I'm a newbie of python...</p>
<p>I have created a list like a table with rows and 4... |
72,978,701 | Merging two dictionaries as rows into one pandas dataframe<p>My question is similar to</p>
<p><a href="https://stackoverflow.com/questions/47561337/merging-two-dictionaries-into-one-dataframe">Merging two dictionaries into one dataframe</a></p>
<p>but that question asked how to merge two dictionaries in one dataframe, ... | <p>Let us do</p>
<pre><code>d = {'foo': foo, 'bar': bar}
pd.DataFrame(d).T.rename_axis('set').reset_index()
</code></pre>
<p>Alternative approach with comprehension</p>
<pre><code>d = {'foo': foo, 'bar': bar}
pd.DataFrame({'set': k, **v} for k, v in d.items())
</code></pre>
<hr />
<pre><code> set mean median p90
... | Merging two dictionaries as rows into one pandas dataframe | python|pandas|dictionary | 1 | 54 | 1 | 72,978,786 | 72,978,786 | 1 | true | 2022-07-14T10:01:32.607Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Merging two dictionaries as rows into one pandas dataframe<p>My question is similar to</p>
<p><a href="https://stackoverflow.com/questions/47561337/merging-t... |
72,897,833 | Avoiding collisions when processing a list in parallel<p>I'm not sure the title is the best, but I think the code below will help. For simplicity sake, let's say I have a list of a class with two values, category and itemid. I need to process each item in the list, but I can't process two records with the same category... | <p>You should think about this by category individually instead of trying to assemble processing units yourself (your "rows"). Basically, process each category in parallel, but each item at a time for each category ordered by item id.<br><br>
Something like this (the <code>Sleep</code> is to illustrate the lo... | Avoiding collisions when processing a list in parallel | c# | 0 | 54 | 1 | 72,898,145 | 72,898,145 | 1 | true | 2022-07-07T12:28:23.647Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Avoiding collisions when processing a list in parallel<p>I'm not sure the title is the best, but I think the code below will help. For simplicity sake, let's... |
72,990,092 | How to set the Thread priority on parallel iteration with standard Java API?<p>I found in <a href="https://github.com/burningwave/core/wiki/Iterating-collections-and-arrays-in-parallel-by-setting-thread-priority" rel="nofollow noreferrer">this tutorial</a> a way to iterate in parallel a collection of objects by settin... | <p>Referring to the answer from <a href="https://stackoverflow.com/a/22269778/10946202">Custom thread pool in Java 8 parallel stream</a> You can use <code>List.parallelStream</code> with a Custom <code>ForkJoinPool</code>. The trick is fill up the pool with a custom <code>ForkJoinWorkerThreadFactory</code> that sets re... | How to set the Thread priority on parallel iteration with standard Java API? | java|multithreading|loops|parallel-processing | 1 | 54 | 1 | 72,990,804 | 72,990,804 | 1 | true | 2022-07-15T06:55:15.913Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to set the Thread priority on parallel iteration with standard Java API?<p>I found in <a href="https://github.com/burningwave/core/wiki/Iterating-collect... |
72,892,291 | Why does my method that scans a file and prints out the result print 1 space further than the last time?<p>I'm currently writing a quite lengthy piece of code to recreate Conway's Game of Life and have just realized that when I run my code, the method that I made to scan through a file and print itself out as matrix do... | <p>I believe the problem is being caused by the fact that your reading a line of text from a file in and expecting it to be <em>magically</em> split for you into a string array.</p>
<pre class="lang-java prettyprint-override"><code>public static String[][] originalBoardCreation()
{
Scanner sc= MyUtils.readFile(inpFil... | Why does my method that scans a file and prints out the result print 1 space further than the last time? | java|arrays|loops|java.util.scanner | 0 | 54 | 1 | 72,892,624 | 72,892,624 | 1 | true | 2022-07-07T04:28:11.583Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does my method that scans a file and prints out the result print 1 space further than the last time?<p>I'm currently writing a quite lengthy piece of cod... |
72,784,306 | Python loops with break/continue<p>Given a set of integers numbers = [10, 0, 11, 5, 3, 0, 6, 0, 2, 0, 6, 9] containing at least two zeros. Print the sum of numbers from the given set located between the last two zeros (if the last zeros are in a row, then print 0).
My attempt:</p>
<pre><code>numbers = [10, 0, 11, 5, 3,... | <p>It's much easier to reverse the list and look for the first two zeros.</p>
<pre><code>>>> numbers = [10, 0, 11, 5, 3, 0, 6, 0, 2, 0, 6, 9]
>>> numbers_rev = reversed(numbers)
>>> sum_ = 0
>>>
>>> for x in numbers_rev:
... if x == 0:
... break
>>> ... | Python loops with break/continue | python|loops | 0 | 54 | 4 | 72,784,401 | 72,784,401 | 1 | true | 2022-06-28T09:52:55.363Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python loops with break/continue<p>Given a set of integers numbers = [10, 0, 11, 5, 3, 0, 6, 0, 2, 0, 6, 9] containing at least two zeros. Print the sum of n... |
72,797,562 | Git clone return master as default branch<p>When cloning a repository from a git server I'm getting master as the default branch, when the content of the <code>HEAD</code> file is <code>ref: refs/heads/main</code>.
If I clone the repo from the bare repository stored in my local machine, everything works fine.</p> | <p>After discussion, the <a href="https://stackoverflow.com/users/14196101/martin-daniel">OP Martin Daniel</a> finds out in <a href="https://stackoverflow.com/questions/72797562/git-clone-return-master-as-default-branch/72797703#comment128585645_72797703">the comments</a> the repository needs to be cloned with the <str... | Git clone return master as default branch | git | 2 | 54 | 1 | 72,797,703 | 72,797,703 | 1 | true | 2022-06-29T07:41:25.633Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Git clone return master as default branch<p>When cloning a repository from a git server I'm getting master as the default branch, when the content of the <co... |
72,976,411 | Flutter - How to change TextFormField fillColor according Validation result<p>I want to change <code>TextFormField</code> <code>fillColor</code> according to result of validation. Same as below:</p>
<p><img src="https://i.stack.imgur.com/UNOzA.png" alt="image1" /></p>
<p><img src="https://i.stack.imgur.com/oBGum.png" a... | <p>you can use this code directly</p>
<pre><code>import 'package:flutter/material.dart';
class TestPage extends StatefulWidget {
const TestPage({Key? key}) : super(key: key);
@override
State<TestPage> createState() => _TestPageState();
}
class _TestPageState extends State<TestPage> {
final for... | Flutter - How to change TextFormField fillColor according Validation result | flutter|dart|validation|input|textformfield | 0 | 54 | 2 | 72,978,699 | 72,978,699 | 1 | true | 2022-07-14T06:55:50.553Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter - How to change TextFormField fillColor according Validation result<p>I want to change <code>TextFormField</code> <code>fillColor</code> according to... |
72,838,986 | Swift SceneKit Diffuse color doesn't change anything<p>I have a 3D model in .obj form and a corresponding .mtl file.</p>
<p>I dragged them both into xcode and converted the .obj model to a .scn file.</p>
<p>Xcode loads the file correctly and also applies the material. So in diffuse there is a color. (See image below) T... | <p>Assuming the first image shows the result you don't want and the second image is a result more or less good, I can tell you this: The emission color of the first image is set to a pure white, which means, the emission is set to its maximum, what makes it almost invisible on white backgrounds. the second image just h... | Swift SceneKit Diffuse color doesn't change anything | swift|3d|scenekit | 0 | 54 | 1 | 72,845,201 | 72,845,201 | 1 | true | 2022-07-02T12:17:42.723Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Swift SceneKit Diffuse color doesn't change anything<p>I have a 3D model in .obj form and a corresponding .mtl file.</p>
<p>I dragged them both into xcode an... |
72,831,367 | Pictures loading very slowly on webpage<p>I'm wondering what the best practice is for loading high-resolution images on a webpage. Currently I'm loading a bunch of images locally and the website is running super slowly. Here's an example:</p>
<p><a href="https://shmoss.github.io/Gibbs-Lab/research.html" rel="nofollow... | <p>This is a bit of a "highly opinionated question", since many people will have different answers based on when they last looked at "standards", but here's some fairly recent guidance to work from. It's guidance, not rules, so feel free to make some judgement calls with it.</p>
<blockquote>
<p><str... | Pictures loading very slowly on webpage | html|css|image | 0 | 54 | 1 | 72,831,661 | 72,831,661 | 1 | true | 2022-07-01T15:17:17.790Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pictures loading very slowly on webpage<p>I'm wondering what the best practice is for loading high-resolution images on a webpage. Currently I'm loading a b... |
72,808,636 | How to test function defined on window object in Jest and typescript<p>I'm trying to test a call to a function defined on the global window object. I have looked at multiple examples but am still not able to run a simple test case.</p>
<p>Api.ts</p>
<pre><code>import "./global.d";
const verifier = window.Veri... | <p>The problem here is your import order.</p>
<p>When you <code>import { Api } from "./api";</code>, you run <code>const verifier = window.Verifier;</code>, which, at the time, is <code>undefined</code>.</p>
<p>If you change the order of the imports and spies it should work as expected:</p>
<pre class="lang-j... | How to test function defined on window object in Jest and typescript | javascript|typescript|jestjs | 0 | 54 | 1 | 72,811,375 | 72,811,375 | 1 | true | 2022-06-29T22:50:00.600Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to test function defined on window object in Jest and typescript<p>I'm trying to test a call to a function defined on the global window object. I have lo... |
72,834,246 | what is full form of gRPC ? is it "general" Remote procedure call OR "Google" Remote procedure call<p>is it "<strong>general</strong>" Remote procedure call OR "<strong>Google</strong>" Remote procedure call</p> | <p>Neither. According to the <a href="https://grpc.io/docs/what-is-grpc/faq/" rel="nofollow noreferrer">grpc.io FAQ</a>.</p>
<blockquote>
<p>What does gRPC stand for?</p>
<p>gRPC Remote Procedure Calls, of course!</p>
</blockquote>
<hr />
<p><strong>Speculation time</strong></p>
<p>This is probably similar to what happ... | what is full form of gRPC ? is it "general" Remote procedure call OR "Google" Remote procedure call | grpc | -1 | 54 | 1 | 72,834,322 | 72,834,322 | 1 | true | 2022-07-01T20:15:04.113Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
what is full form of gRPC ? is it "general" Remote procedure call OR "Google" Remote procedure call<p>is it "<strong>general</strong>" Remote proce... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.