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,305,133 | Json View doesn't restrict the fields in the response<p>I need to send only 1 field annotated with @JsonView(in my case : eNumber) in my response. Also, this has to be only when the call is from Controller1 which also has a JsonView annotation.
But, eNumber field value is sent also when the call is from Controller2 whi... | <p>I believe you need to do the following:</p>
<ol>
<li>Define two views; one for internal one for public.</li>
<li>Annotate the fields not the getters (I believe, not 100% sure about this step).</li>
<li>Annotate the Controller2 method with "@JsonView(Views.Public.class)"</li>
</ol>
<p>Here is a <a href="htt... | Json View doesn't restrict the fields in the response | java|spring|jackson|json-view | 0 | 78 | 1 | 72,305,447 | 72,305,447 | 1 | true | 2022-05-19T13:06:47.657Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Json View doesn't restrict the fields in the response<p>I need to send only 1 field annotated with @JsonView(in my case : eNumber) in my response. Also, this... |
72,257,278 | How to load page until specific element found selenium python<p>Is there a way to set timeout when specific element in webpage loads</p>
<p><strong>Notice</strong>: I am talking about loading webpage using <code>driver.get()</code> method</p>
<p>I tried setting page loads timeout to 10s for example and check whether el... | <p>Edit:</p>
<pre><code>from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
op = Options()
op.page_load_strategy = 'none'... | How to load page until specific element found selenium python | python|selenium | 1 | 78 | 3 | 72,257,731 | 72,257,731 | 1 | true | 2022-05-16T09:51:14.580Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to load page until specific element found selenium python<p>Is there a way to set timeout when specific element in webpage loads</p>
<p><strong>Notice</s... |
72,288,392 | How to include related models using Django Rest Framework ListAPIView<p>Having 2 models and i need a list, a single queryset of lists that will combine all related fields from the 2 models.</p>
<pre><code>class Product(models.Model):
name = models.CharField(...)
price= models.Decimal(...)
image = models.... | <p>First, you need to define the serializer in serializers.py file.</p>
<pre><code>from rest_framework import serializers
from .models import Product, Order
class ProductSerializer(serializers.ModelSerializer):
class Meta:
fields = "__all__"
model = Product
class OrderSerializer(serializ... | How to include related models using Django Rest Framework ListAPIView | django-models|django-rest-framework|django-serializer | 1 | 78 | 1 | 72,288,901 | 72,288,901 | 1 | true | 2022-05-18T11:31:14.317Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to include related models using Django Rest Framework ListAPIView<p>Having 2 models and i need a list, a single queryset of lists that will combine all r... |
72,345,603 | React - Debounce + useEffect<p>I have created a debounced method <strong>inside</strong> my react component.</p>
<pre><code>const [count, setCount] = useState(0);
const lazyLog = useCallback(
_.debounce(() => { console.log(count) }, 5000),
[count]
);
</code></pre>
<p>and I am calling it inside a useEffect, ever... | <p>State is stale as it's not included in the dependency array of <code>useCallback</code>. Now if you add that the <code>deBounce</code> will not work.</p>
<p>Solution is to use a <code>ref</code> & hold a copy of the state in that. Then use that in the <code>debounce</code>. (<a href="https://codesandbox.io/s/kee... | React - Debounce + useEffect | javascript|reactjs|react-native|react-hooks | 1 | 78 | 2 | 72,345,884 | 72,345,884 | 1 | true | 2022-05-23T08:41:45.687Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React - Debounce + useEffect<p>I have created a debounced method <strong>inside</strong> my react component.</p>
<pre><code>const [count, setCount] = useStat... |
72,308,791 | How can I copy a JavaFX code that perfectly builds and runs to a remote ssh server in Visual Studio Code?<p>I tried to copy the java project folder in remote ssh server. Then I opened Visual Studio Code and used SSH FS extension by Kelvin Schoofs to open the remote folder. Then I opened the main .java App file, and the... | <p>Here are some of my suggestions:</p>
<p>First, please confirm whether the jdk you installed has JavaFX.
Then you can try to import all dependencies using <code>npm</code> and run the project.</p>
<p>Or You can simplify this whole process by switching to Maven based projects. A maven project has all build and depende... | How can I copy a JavaFX code that perfectly builds and runs to a remote ssh server in Visual Studio Code? | java|maven|visual-studio-code|vscode-extensions|maven-compiler-plugin | 0 | 78 | 1 | 72,315,029 | 72,315,029 | 1 | true | 2022-05-19T17:28:53.540Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I copy a JavaFX code that perfectly builds and runs to a remote ssh server in Visual Studio Code?<p>I tried to copy the java project folder in remote... |
72,261,028 | why is this for loop not returning the intended output?<p>This is just an exercise in a course, this app selects a random fruit from the fruits array and then the removeItem() function is supposed to remove that one from the array and returns the modified array, but I'm getting a weird output, and the function is not w... | <p>There were two major problems:</p>
<ul>
<li>Your <code>for</code> loop in <code>removeItem</code> was always returning on the first iteration</li>
<li>You were modifying the initial array as you removed items from it</li>
</ul>
<p>I've also removed all the unnecessary code used to reproduce your problem. Please read... | why is this for loop not returning the intended output? | javascript | 1 | 78 | 4 | 72,261,663 | 72,261,663 | 1 | true | 2022-05-16T14:41:45.993Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
why is this for loop not returning the intended output?<p>This is just an exercise in a course, this app selects a random fruit from the fruits array and the... |
72,264,302 | Updating a page every time I revisit the page in BottomNavigationbar<p>In my app the user is able to store favorite items on a different page in the bottom navigation bar. My problem is that the page does not refresh properly. If you add a favorite it gets displayed only when restarting the app.
If the favorites page i... | <p>Maybe not the most efficient method, but if you provide a passback to the Favourites class from the parent widget you can call a setState in the parent widget (assuming the parent widget reloads the database).</p>
<pre><code> class Favorites extends StatefulWidget {
const Favorites({Key? key, this.passback}) : ... | Updating a page every time I revisit the page in BottomNavigationbar | flutter|datastore|sqflite|flutter-bottomnavigation | 0 | 78 | 2 | 72,265,908 | 72,265,908 | 1 | true | 2022-05-16T18:58:35.673Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Updating a page every time I revisit the page in BottomNavigationbar<p>In my app the user is able to store favorite items on a different page in the bottom n... |
72,320,899 | See unmatched countries for joinCountryData2Map in rworldmap?<p>I'm using the <code>joinCountryData2Map</code> function in <code>rworldmap</code> to match my data to the countries in the world map.</p>
<p>I get this result:</p>
<pre><code>230 codes from your data successfully matched countries in the map
11 codes from ... | <p>Set <code>joinCountryData2Map(...,verbose=TRUE)</code> to print the names of the countries that failed to match in the console.</p>
<p><a href="https://cran.r-project.org/web/packages/rworldmap/vignettes/rworldmapFAQ.pdf" rel="nofollow noreferrer">From the FAQ</a>: "You can see that a summary of how many countr... | See unmatched countries for joinCountryData2Map in rworldmap? | r|rworldmap | 1 | 78 | 1 | 72,321,588 | 72,321,588 | 1 | true | 2022-05-20T14:48:31.750Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
See unmatched countries for joinCountryData2Map in rworldmap?<p>I'm using the <code>joinCountryData2Map</code> function in <code>rworldmap</code> to match my... |
72,394,167 | Create HTML elements from Array<p>How do I create HTML elements dynamically from an array?</p>
<p>For example, if I got an array <code>const data = ['123', '456', '789']</code> , and I wanna create a <code>p</code> tag of HTML for each value of the array. I've tried to use the <code>foreach</code> method but it's not w... | <h1>with just appendChild and createElement</h1>
<p>Using all what you used and just using <code>appendChild</code> this one is easiest solution.</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 prettyprin... | Create HTML elements from Array | javascript | 0 | 78 | 5 | 72,394,240 | 72,394,240 | 1 | true | 2022-05-26T15:19:55.820Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create HTML elements from Array<p>How do I create HTML elements dynamically from an array?</p>
<p>For example, if I got an array <code>const data = ['123', '... |
72,264,866 | Are FHIR-resource-Logical-Id's MANDATORY for "contained" fhir-resources?<p>I'm trying to get a clarification</p>
<p>Under the definition of what is a (fhir-resource-logical-id)</p>
<p><a href="https://www.hl7.org/fhir/resource-definitions.html#Resource.id" rel="nofollow noreferrer">https://www.hl7.org/fhir/resource-def... | <p>I wrote that, and I think I was just wrong when I did - just thinking that it wasn't needed functionally in that context, and didn't check whether it had to be present. This is a case where id is required</p> | Are FHIR-resource-Logical-Id's MANDATORY for "contained" fhir-resources? | hl7-fhir | 0 | 78 | 1 | 72,265,792 | 72,265,792 | 2 | true | 2022-05-16T19:53:44.910Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Are FHIR-resource-Logical-Id's MANDATORY for "contained" fhir-resources?<p>I'm trying to get a clarification</p>
<p>Under the definition of what is a (fhir-r... |
72,317,302 | Naming a subclass to store requirements of the parent class<p>I have the class Party and inside i have some restrictions to join that party.</p>
<p>Looking like this:</p>
<pre><code>class Party {
String id;
String name;
Instant date;
Requirement requirement;
}
class Requirement {
int age;
Strin... | <p>Perfectly acceptable to have plurals.</p>
<p>Requirements is not a subclass but here an embedded type. Requirements "is not" a party(inheritance). A party "has" requirements (composition).</p> | Naming a subclass to store requirements of the parent class | java|oop|design-patterns|naming-conventions | 3 | 78 | 3 | 72,317,544 | 72,317,544 | 2 | true | 2022-05-20T10:22:18.243Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Naming a subclass to store requirements of the parent class<p>I have the class Party and inside i have some restrictions to join that party.</p>
<p>Looking l... |
72,319,729 | How to chain doIfElse Scala Gatling<p>We're trying to migrate our Gatling tests from Scala to Java. We have a function that chains some execs and has a doIfElse between then. Attempting to add the same on Java affects the return type for the method and being not very familiar with Scala we're not sure how to migrate ou... | <p>It turns out that the else block is missing in the java code. Since Java does not support curried functions, gatling provides some methods in order to chain the actions together. so based on <a href="https://gatling.io/docs/gatling/reference/current/core/scenario/#doiforelse" rel="nofollow noreferrer">Gatling docs</... | How to chain doIfElse Scala Gatling | java|scala|gatling|scala-gatling | 0 | 78 | 1 | 72,320,234 | 72,320,234 | 2 | true | 2022-05-20T13:26:51.397Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to chain doIfElse Scala Gatling<p>We're trying to migrate our Gatling tests from Scala to Java. We have a function that chains some execs and has a doIfE... |
72,386,085 | UserMapper is null in Springboot project<p>I'm learning spring boot and am working on a toy project - a registration page.</p>
<p>I have a UserMapper interface that interacts with MySQL and it looks something like this:</p>
<pre class="lang-js prettyprint-override"><code>public interface UserMapper {
@Insert("... | <p>Autowire Usermapper into UserService class like this:</p>
<pre><code>@Autowired
private UserMapper userMapper;
</code></pre> | UserMapper is null in Springboot project | java|spring|spring-boot|mapper | 0 | 78 | 2 | 72,386,253 | 72,386,253 | 2 | true | 2022-05-26T02:34:37.223Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
UserMapper is null in Springboot project<p>I'm learning spring boot and am working on a toy project - a registration page.</p>
<p>I have a UserMapper interfa... |
72,396,860 | Determining the length of a comma separated string<p>Suppose I have a column that has a value of a comma separated string of various lengths:</p>
<pre><code> locations | city | county | state
---------------------+--------+---------+--------
A, B, C | | |
-------------... | <p>You can split the string into array:</p>
<pre class="lang-sql prettyprint-override"><code>select cardinality(string_to_array('a,b,c', ','));
cardinality
-------------
3
(1 row)
</code></pre> | Determining the length of a comma separated string | string|postgresql|delimiter|string-length | 1 | 78 | 1 | 72,396,992 | 72,396,992 | 2 | true | 2022-05-26T19:10:07.600Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Determining the length of a comma separated string<p>Suppose I have a column that has a value of a comma separated string of various lengths:</p>
<pre><code>... |
72,385,973 | Numeric Enum with is considered as a string in type comparison<p>While trying to do a comparison between a numeric enum, I noticed an error where the enum value is converted to a string type. Is that an expected behavior?</p>
<pre class="lang-js prettyprint-override"><code>enum Test {
a = 0,
b = 1
}
console.lo... | <p>This seems to be a confusion about what <code>Test[0]</code> is. Numeric <code>enum</code> members in TypeScript get a <a href="https://www.typescriptlang.org/docs/handbook/enums.html#reverse-mappings" rel="nofollow noreferrer">reverse mapping</a>, where indexing into the enum object with an enum <em>value</em> giv... | Numeric Enum with is considered as a string in type comparison | typescript|enums | 0 | 78 | 1 | 72,397,274 | 72,397,274 | 2 | true | 2022-05-26T02:14:54.373Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Numeric Enum with is considered as a string in type comparison<p>While trying to do a comparison between a numeric enum, I noticed an error where the enum va... |
72,382,596 | Best way to subtract Matrix from Vector of Matrix<p>I want to subtract a Matrix from a Vector of Matrix. For Example, In below defined variable i want to subtract y for each element of xl</p>
<pre><code>xl = [Matrix{Float64}(undef, 2, 3) for i in 1:1000]
y = Matrix{Float64}(undef, 2, 3)
</code></pre>
<p>I know this can... | <p>First of all, <code>map</code> is not the fastest thing, loops will almost always beat it. This array comprehension is 70% faster than <code>map</code>.</p>
<pre><code>@btime [[x[i]-$y[i] for i in eachindex($y)] for x in $xl];
33.300 μs (1001 allocations: 117.31 KiB)
</code></pre>
<p>Now, for why multithreading is... | Best way to subtract Matrix from Vector of Matrix | julia | 2 | 78 | 2 | 72,383,486 | 72,383,486 | 2 | true | 2022-05-25T18:29:12.083Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Best way to subtract Matrix from Vector of Matrix<p>I want to subtract a Matrix from a Vector of Matrix. For Example, In below defined variable i want to sub... |
72,247,284 | Cross-compiling [no_std] code - libcore and compiler_builtins not found<p>I'm trying to follow the steps explained in <a href="https://docs.rust-embedded.org/embedonomicon/smallest-no-std.html" rel="nofollow noreferrer">Embeddonomicon</a> to compile the smallest <code>#![no-std]</code> program, but for a new target on ... | <p>That's how I solved the issue:</p>
<ol>
<li><p>Use the right rustc source code. I started with a stable version whose libcore was not compatible with the latest <code>compiler_builtins</code>. See <a href="https://stackoverflow.com/questions/72273469/does-cargo-always-use-the-latest-compiler-builtins">here</a> for m... | Cross-compiling [no_std] code - libcore and compiler_builtins not found | rust|embedded|rust-cargo|bare-metal | 2 | 78 | 1 | 72,309,352 | 72,309,352 | 2 | true | 2022-05-15T10:06:36.643Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cross-compiling [no_std] code - libcore and compiler_builtins not found<p>I'm trying to follow the steps explained in <a href="https://docs.rust-embedded.org... |
72,390,780 | Reading three tables from same file in different Dataframes in pandas<p>I have a .xlsx file in which there are 3 different table available, seprated by three key words "Setteled", "Refund", "Charged" in want to read all the table in separate dataframes, sharing file data and desired output... | <p>Are your "tables" actual Excel tables? If so, you could use the approach explained <a href="https://samukweku.github.io/data-wrangling-blog/spreadsheet/python/pandas/openpyxl/2020/05/19/Access-Tables-In-Excel.html" rel="nofollow noreferrer">here</a>.</p>
<p>E.g.:</p>
<pre><code>import pandas as pd
from ope... | Reading three tables from same file in different Dataframes in pandas | python|python-3.x|pandas|dataframe|numpy | 0 | 78 | 3 | 72,391,177 | 72,391,177 | 2 | true | 2022-05-26T11:03:10.737Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reading three tables from same file in different Dataframes in pandas<p>I have a .xlsx file in which there are 3 different table available, seprated by three... |
72,246,317 | Can I choose the fill based on the color?<p>I have the following example data:</p>
<pre class="lang-r prettyprint-override"><code>d <- data.frame(x = 1:3, y = 1:3, category = letters[1:3], p = c(TRUE, TRUE, FALSE))
</code></pre>
<p>I'd like to plot this coloring by category.</p>
<pre class="lang-r prettyprint-overri... | <p>You can use <code>fill = after_scale(color)</code> to assign the fill to the same value as the color scale. Using <code>after_scale(ifelse(p, color, "white")</code> should give you the optional white fill value instead.</p>
<p>The only minor snag is that the usual NSE we get inside <code>aes</code> doesn't... | Can I choose the fill based on the color? | r|ggplot2 | 1 | 78 | 1 | 72,246,423 | 72,246,423 | 2 | true | 2022-05-15T07:27:37.130Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I choose the fill based on the color?<p>I have the following example data:</p>
<pre class="lang-r prettyprint-override"><code>d <- data.frame(x = 1:3,... |
72,361,663 | Do I need a solution to create xUnit tests?<p>I have a project in .NET 6 with a one-class simple console app, that I want to test. I wish to create a second class with xUnit test, but they do not run.</p>
<p><em>dotnet test</em> prints only</p>
<pre><code>Copyright (c) Microsoft Corporation. All rights reserved.
Star... | <p>There are compelling reasons why you would separate your test project from your production code.</p>
<ol>
<li>With all of your tests in the same project as your production code, you have to ship your tests with your finished product.</li>
<li>Since you have to ship your tests with the finished product, its dependenc... | Do I need a solution to create xUnit tests? | c#|.net|xunit | 3 | 78 | 2 | 72,362,704 | 72,362,704 | 2 | true | 2022-05-24T10:56:42.297Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Do I need a solution to create xUnit tests?<p>I have a project in .NET 6 with a one-class simple console app, that I want to test. I wish to create a second ... |
72,278,861 | Spirit.X3: passing local data to a parser<p>The examples in the Boost.Spirit documentation seem to fall in two cases:</p>
<p>1/ Define a parser in a function: semantic actions can access local variables and data as they are local lambdas. Like <code>push_back</code> here: <a href="https://www.boost.org/doc/libs/master/... | <p>About the approaches:</p>
<p>1/ Yes, this is viable for small, contained parsers. Typically only used in a single TU, and exposed via non-generic interface.</p>
<p>2/ This is the approach for (much) larger grammars, that you might wish to spread across TUs, and/or are instantiated across several TU's generically.</p... | Spirit.X3: passing local data to a parser | c++|boost|c++20|boost-spirit|boost-spirit-x3 | 1 | 78 | 1 | 72,280,079 | 72,280,079 | 2 | true | 2022-05-17T18:14:38.013Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spirit.X3: passing local data to a parser<p>The examples in the Boost.Spirit documentation seem to fall in two cases:</p>
<p>1/ Define a parser in a function... |
72,298,629 | Gatsby: getImage returns undefined<p>getImage is returning undefined so my GatsbyImage component is not rendered.</p>
<p>File structure:</p>
<ul>
<li>src/pages/gallery.js</li>
<li>src/images (has 12 photos named photo-01.jpg, photo-02.jpg, ...)</li>
</ul>
<p>I have the following code (gallery.js):</p>
<pre><code>import... | <p>The problem is that you are mixing <a href="https://www.gatsbyjs.com/plugins/gatsby-image/" rel="nofollow noreferrer"><code>gatsby-image</code></a> (from Gatsby 1 to Gatsby 2) and <a href="https://www.gatsbyjs.com/plugins/gatsby-plugin-image" rel="nofollow noreferrer"><code>gatsby-plugin-image</code></a> (from Gatsb... | Gatsby: getImage returns undefined | javascript|reactjs|gatsby|gatsby-image|gatsby-plugin | 3 | 78 | 1 | 72,298,846 | 72,298,846 | 2 | true | 2022-05-19T04:26:24.963Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Gatsby: getImage returns undefined<p>getImage is returning undefined so my GatsbyImage component is not rendered.</p>
<p>File structure:</p>
<ul>
<li>src/pag... |
72,322,442 | Setting USER in Dockerfile prevents saving file fields (eg. ImageField) in Django<p>I am trying to containerize Django with Dockerfile and docker-compose.yml as defined below. I built the Dockerfile as (fiifidev/postgres:test) for the compose file. Everything works fine. However anytime I try to save a model with a f... | <p>From Dockerfile:</p>
<pre><code>WORKDIR /home/appuser/src
USER appuser
# Install application into container
COPY --chown=appuser:appuser . .
</code></pre>
<p>Here you are creating a <code>src</code> directory and copying your code into it. This is baked into the resulting image.</p>
<p>From docker-compose.yml:</p>
... | Setting USER in Dockerfile prevents saving file fields (eg. ImageField) in Django | django|docker|docker-compose|dockerfile | 0 | 78 | 1 | 72,322,993 | 72,322,993 | 2 | true | 2022-05-20T17:01:07.843Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Setting USER in Dockerfile prevents saving file fields (eg. ImageField) in Django<p>I am trying to containerize Django with Dockerfile and docker-compose.ym... |
72,308,598 | How to empty a text box by using a button in react?<p>I have a text box to input numbers, and after pressing the button, I want to clear the text box value. I have no idea how to do it, and can anybody help me?</p>
<p><a href="https://i.stack.imgur.com/T978G.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgu... | <p>You should define a state for the <code>quantity</code> and then update that state whenever the user enters a new value to that new value. Or when the <code>Clear</code> button is pressed update it to <code>0</code>.</p>
<blockquote>
<p>You could of course also update to an empty string if you want. You would then j... | How to empty a text box by using a button in react? | javascript|reactjs | 0 | 78 | 1 | 72,308,718 | 72,308,718 | 2 | true | 2022-05-19T17:13:46.260Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to empty a text box by using a button in react?<p>I have a text box to input numbers, and after pressing the button, I want to clear the text box value. ... |
72,321,755 | Scala interprets _ param as Any => [Any]<p>I have an enum defined as follows</p>
<pre><code>enum Operator[T](val expr: String, val tag: T):
case Plus(override val tag: T) extends Operator("+", tag)
case Minus(override val tag: T) extends Operator("-", tag)
case Multiply(override val tag: T) e... | <p>This is actually a complement to @Luis Miguel Mejía Suárez's comment and @Gaël J's answer. As stated earlier in the comments and answers, you're actually passing a function, not an <code>Operator</code> instance to your extract function. I think what you intended to do, was to use a wildcard for the tag in <code>Plu... | Scala interprets _ param as Any => [Any] | scala | 1 | 78 | 2 | 72,323,570 | 72,323,570 | 2 | true | 2022-05-20T15:58:21.803Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Scala interprets _ param as Any => [Any]<p>I have an enum defined as follows</p>
<pre><code>enum Operator[T](val expr: String, val tag: T):
case Plus(over... |
72,246,249 | How to chain together a mix of data.table and base r functions?<p>I am using the data.table package to work with a very large data set, and value it's speed and clarity. But I am new to it and am having difficulties chaining functions together especially when working with a mixed set of data.table and base R functions.... | <p>If I understand correctly, the OP wants to</p>
<ul>
<li>rename column <code>Value_1</code> to <code>Value</code> (or in OP's words: <em>create new column "Values", which equals "Values_1"</em>)</li>
<li>drop column <code>Value_2</code></li>
<li>replace all occurrences of <code>XX</code> by <code>... | How to chain together a mix of data.table and base r functions? | r|data.table|operators|chaining | 1 | 78 | 3 | 72,252,934 | 72,252,934 | 3 | true | 2022-05-15T07:14:36.083Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to chain together a mix of data.table and base r functions?<p>I am using the data.table package to work with a very large data set, and value it's speed ... |
72,351,712 | Can app use a dependency lib which has been developed lower scala version?<p>I'm upgrading the application to scala version 2.12. The application is using a library which has been developed by another team in scala 2.11.</p>
<p>Here is my updated code of file build.sbt. It's using the library "sdp-commons-monitori... | <p>As mentionned in a comment: <strong>Scala 2 minor versions</strong> (where "minor" is used in the general semver meaning: <code>major.minor.patch</code>) <strong>are not binary compatible</strong>.</p>
<p>Thus, for instance, a library compiled with Scala 2.11 cannot be used in a Scala 2.12 project.</p>
<hr... | Can app use a dependency lib which has been developed lower scala version? | scala|sbt | 0 | 78 | 1 | 72,353,634 | 72,353,634 | 3 | true | 2022-05-23T16:12:55.940Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can app use a dependency lib which has been developed lower scala version?<p>I'm upgrading the application to scala version 2.12. The application is using a ... |
72,357,832 | Is the HAVING clause “useless” in a SELECT statement?<p>I’m reading a paper called <a href="https://www.ijstr.org/final-print/oct2015/Query-Optimization-Techniques-Tips-For-Writing-Efficient-And-Faster-Sql-Queries.pdf" rel="nofollow noreferrer">Query Optimization Techniques - Tips For Writing
Efficient And Faster SQL Q... | <p>If it were useless, it wouldn't exist.</p>
<blockquote>
<p>Use the HAVING clause to restrict the groups of returned rows to those groups for which the specified condition is TRUE</p>
</blockquote>
<p>Based on your example, you'd use it as e.g.</p>
<pre><code>SELECT s.cust_id,count(cust_id)
FROM SH.sales s
WHERE s.cu... | Is the HAVING clause “useless” in a SELECT statement? | sql|oracle|query-optimization|having | 0 | 78 | 1 | 72,357,868 | 72,357,868 | 3 | true | 2022-05-24T05:58:33.790Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is the HAVING clause “useless” in a SELECT statement?<p>I’m reading a paper called <a href="https://www.ijstr.org/final-print/oct2015/Query-Optimization-Tech... |
72,260,265 | How to show <p> tag in <ul> tag?<p>I have a <code><ul></code> tag that contain 2 <code><li></code> tag with a <code><p></code> tag that contain text:</p>
<pre><code><ul>
<li>List-item-1<p>para-1</p></li>
<li>List-item-2<p>para-2</p></li>
&l... | <p>You can use <code>find()</code> function here.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>$('ul li').html(function(){
return $(this).find('p');
});</code></pre>
<pre ... | How to show <p> tag in <ul> tag? | javascript|html|jquery|css | 1 | 78 | 3 | 72,260,311 | 72,260,311 | 4 | true | 2022-05-16T13:46:59.477Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to show <p> tag in <ul> tag?<p>I have a <code><ul></code> tag that contain 2 <code><li></code> tag with a <code><p></code> tag that con... |
72,336,579 | Good way of popping the least signifigant bit and returning the index?<p>I am new to C++ and I'm trying to write a function that will pop the least significant bit and then return the index of that bit. Is there a way to do this without creating a temporary variable?</p>
<p>Right now I have a function for finding the i... | <p>There's nothing wrong with using a temporary variable. However modern architectures are <a href="https://en.wikipedia.org/wiki/Superscalar_processor" rel="noreferrer">superscalar</a> and <a href="https://en.wikipedia.org/wiki/Out-of-order_execution" rel="noreferrer">out-of-order</a> so to better adapt for them you s... | Good way of popping the least signifigant bit and returning the index? | c++|bit-manipulation|bitwise-operators | 0 | 78 | 1 | 72,337,044 | 72,337,044 | 4 | true | 2022-05-22T10:09:42.090Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Good way of popping the least signifigant bit and returning the index?<p>I am new to C++ and I'm trying to write a function that will pop the least significa... |
72,268,050 | Wrong print values while iterating 2d char array<p>I am trying to run this code in Arduino IDE. It is printing wrong values.</p>
<pre><code>char daysOfTheWeek[7][4] = {"Sun", "Mon", "Tues", "Wed", "Thur", "Fri", "Sat"};
for(int i=0;i<7;i++) {
... | <p>All string literals have an implicit null-terminator at the end. So, the biggest ones of yours, the <code>"Tues"</code> and the <code>"Thur"</code>, are actually contain <strong>five</strong> characters, like so: <code>"Tues\0"</code> and <code>"Thur\0"</code>.</p>
<p>Thus, yo... | Wrong print values while iterating 2d char array | c++|multidimensional-array|char|arduino-ide | 1 | 78 | 2 | 72,268,172 | 72,268,172 | 4 | true | 2022-05-17T03:58:24.917Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Wrong print values while iterating 2d char array<p>I am trying to run this code in Arduino IDE. It is printing wrong values.</p>
<pre><code>char daysOfTheWee... |
72,257,354 | How to replace values between two curly brackets in python?<p>I want to replace values in strings between two curly brackets.</p>
<p>e.g:</p>
<pre><code>string = f"""
my name is {{name}} and I'm {{age}} years old
"""
</code></pre>
<p>Now I want to replace name, and age by some values.</p>... | <p>You can work with the template render engine with:</p>
<pre><code>from django.template import Template, Context
template = Template("my name is {{ name }} and I'm {{ age }} years old")
render_param = {
'name':'AHMED',
'age':20
}
result = template<strong>.render(</strong>Context(render_param)<stron... | How to replace values between two curly brackets in python? | python|django | 2 | 78 | 2 | 72,257,417 | 72,257,417 | 4 | true | 2022-05-16T09:56:48.787Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to replace values between two curly brackets in python?<p>I want to replace values in strings between two curly brackets.</p>
<p>e.g:</p>
<pre><code>stri... |
72,353,432 | Create a vector of year/quarters from a starting date<p>I have a string starting date, say, "2021 Q3" and I would like to create a vector of "Year Quarter"s following the start date. For example if the required length is 5 my output would be</p>
<p>"2021 Q3" "2021 Q4" "2022 ... | <p>Convert the input x to yearqtr class. It represents year and quarter internally as year + 0, 1/4, 1/2 and 3/4 so just add whatever number of quarters needed. It renders them as shown. See <code>?yearqtr</code> for more info.</p>
<pre><code>library(zoo)
x <- "2021 Q3"
as.yearqtr(x) + seq(0, length = 5)... | Create a vector of year/quarters from a starting date | r|date|tidyverse | 1 | 78 | 2 | 72,353,561 | 72,353,561 | 5 | true | 2022-05-23T18:42:22.387Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create a vector of year/quarters from a starting date<p>I have a string starting date, say, "2021 Q3" and I would like to create a vector of "... |
72,352,876 | Creating an array of things based on a type when you don't have an input parameter to tell you the type<p>I sometimes have a set of tests that I want to run on a bunch of different types. Here's a simple example of how I usually do that:</p>
<pre><code>import Test.Framework (Tes... | <p>You're quite close:</p>
<pre><code>{-# Language AllowAmbiguousTypes #-}
{-# Language ScopedTypeVariables #-}
{-# Language TypeApplications #-}
-- vvvvvvvvv
numberTests :: forall a. (Eq a, Ord a, Num a, Fractional a) => [Test]
numberTests = -- just like in the question
-- vvvvv... | Creating an array of things based on a type when you don't have an input parameter to tell you the type | haskell | 4 | 78 | 1 | 72,353,254 | 72,353,254 | 6 | true | 2022-05-23T17:51:49.773Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating an array of things based on a type when you don't have an input parameter to tell you the type<p>I sometimes have a set of tests that I want to run ... |
72,813,997 | get id by value in hierarcial data with js<p>I have hierarcial data as tree array:</p>
<pre><code>var myData = [
{
id: 0,
title:"Item 1"
}, {
id: 1,
title:"Item 2",
subs: [
{
id: 10,
title:"Item 2-1",
subs: [
... | <p>I made this simple <code>findId</code> method in order to find the title and returns the <code>id</code> or <code>undefined</code> as result made for your data array structure.</p>
<blockquote>
<p><code>findId(title, list)</code> function.
Its purpose is to iterate the list received in the second parameter, look for... | get id by value in hierarcial data with js | javascript|node.js|arrays|hierarchy|hierarchical-data | 0 | 78 | 1 | 72,814,172 | 72,814,172 | 1 | true | 2022-06-30T10:11:10.017Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
get id by value in hierarcial data with js<p>I have hierarcial data as tree array:</p>
<pre><code>var myData = [
{
id: 0,
title:"Item 1&... |
72,859,878 | Reversing a linked list - Error says found cycle<p>I wrote the following code to reverse a linked list, but not sure what I am doing incorrectly. This is from a sample <a href="https://leetcode.com/problems/reverse-linked-list/" rel="nofollow noreferrer">problem here</a> that asks to reverse a linked list.</p>
<pre><co... | <p>The problem here is that you're always returning last node of linked list in <code>traverse(node.next)</code> which then changes it's next causing a loop to get formed.<br />
Consider a linked list, 1 -> 2 -> 3 -> 4.<br />
Recursive calls are:<br />
<code>traverse(1) -> traverse(2) -> traverse(3) ->... | Reversing a linked list - Error says found cycle | javascript|algorithm|data-structures|linked-list|reverse | 1 | 78 | 3 | 72,861,014 | 72,861,014 | 1 | true | 2022-07-04T16:47:06.960Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reversing a linked list - Error says found cycle<p>I wrote the following code to reverse a linked list, but not sure what I am doing incorrectly. This is fro... |
72,822,328 | Same j as by in datatable leads to strange outcome<p>Let's keep this simple. I have the following DT:</p>
<pre><code>library(data.table)
test <- setDT(data.frame(a=c(1,2,2,1,3,3,3,4,4,4),b=c(1:9,9)))
test[a == 4,sum(b),b]
</code></pre>
<p>gives:</p>
<pre><code> b V1
1: 8 8
2: 9 9
</code></pre>
<p>but why? Shoul... | <p>You shouldn't <code>sum</code> and <code>group</code> with the same column <code>b</code>, otherwise you will always get a new column <code>V1</code>, whose value is same with the group column <code>b</code>, because each value in group column <code>b</code> is unique, which means you will get it self if you <code>s... | Same j as by in datatable leads to strange outcome | r|data.table | 4 | 78 | 1 | 72,824,614 | 72,824,614 | 1 | true | 2022-06-30T21:40:37.597Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Same j as by in datatable leads to strange outcome<p>Let's keep this simple. I have the following DT:</p>
<pre><code>library(data.table)
test <- setDT(dat... |
72,776,507 | How to prevent any scrolling outside the iFrame? (Svelte)<p>I have an iframe in a webpage:</p>
<pre><code><iframe id="wordBookiFrame" src="/wordBook" style="position:absolute; width:100%; height:100%;"></iframe>
</code></pre>
<p>When viewing the webpage on a small screen (ie a ... | <h3>To stop outside scrolling</h3>
<p>Add this css:</p>
<pre class="lang-css prettyprint-override"><code>
.stop-scrolling {
height: 100%;
overflow: hidden;
}
</code></pre>
<p>And then add and remove the <code>stop-scrolling</code> class with JavaScript.
<strong>Edit:</strong> add it to the body tag.</p>
<p>Even if... | How to prevent any scrolling outside the iFrame? (Svelte) | javascript|html|css|iframe|sveltekit | 1 | 78 | 1 | 72,776,920 | 72,776,920 | 1 | true | 2022-06-27T17:59:30.310Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to prevent any scrolling outside the iFrame? (Svelte)<p>I have an iframe in a webpage:</p>
<pre><code><iframe id="wordBookiFrame" src="... |
73,012,415 | Python: Dictionary where key is tuple of unknown order<p>I am trying to find a way to create a dictionary so that I can map a list of values to an appropriate function.</p>
<p>For example, I have something that looks like:</p>
<pre><code>function_map = {('Put','Put','Call','Call'): FunctionOne,
('Put',... | <p><a href="https://stackoverflow.com/users/18746959/the-thonnu">@The Thonnu</a>'s <a href="https://stackoverflow.com/a/73012555/10824407"><em>answer</em></a> is memory efficient but lookup complexity is fairly high. The simple alternative which I've mentioned in <a href="https://stackoverflow.com/q/73012415/10824407#c... | Python: Dictionary where key is tuple of unknown order | python | 0 | 78 | 5 | 73,012,655 | 73,012,655 | 1 | true | 2022-07-17T13:59:52.197Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python: Dictionary where key is tuple of unknown order<p>I am trying to find a way to create a dictionary so that I can map a list of values to an appropriat... |
72,919,526 | Text comparison between multiple files and remove the duplicate block<p>I have 3 notepad files in directory , i want to compare 1st file to other 2 and drop the duplicate blocks keep unique output , for Example :</p>
<p>File 1:</p>
<pre><code> User enter email id {
email id:(xyz@gamil.com)
action:enter
data:str... | <p>Open the first file and make a list of paragraphs</p>
<pre class="lang-py prettyprint-override"><code>with open('file1.txt', 'r') as f:
paragraphs = f.read().split('\n\n')
</code></pre>
<p>Now open the second file and make a list of paragraphs in the second file and remove the paragraphs that are in the first fi... | Text comparison between multiple files and remove the duplicate block | python|string-comparison|text-comparison | 0 | 78 | 1 | 72,919,589 | 72,919,589 | 1 | true | 2022-07-09T06:50:51.990Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Text comparison between multiple files and remove the duplicate block<p>I have 3 notepad files in directory , i want to compare 1st file to other 2 and drop... |
72,769,164 | CodeQL analysis for Windows is too slow if I need to compile the C++ project. How to solve this?<p>I am trying to setup a CodeQL analysis workflow for my project on Github. I would like to analyze the code for Windows, Ubuntu and MacOS all together and therefore I decided to split the compile-part into three parallel w... | <p>If downloading and building <code>boost</code> is the bottleneck, I think you could get a substantial speedup by caching that dependency, especially since its version or contents aren't changing frequently in your CI flow. I've split up your <code>boost</code> dependency and project build step into 2 different steps... | CodeQL analysis for Windows is too slow if I need to compile the C++ project. How to solve this? | c++|windows|github|c++17|github-actions | 1 | 78 | 1 | 72,773,762 | 72,773,762 | 1 | true | 2022-06-27T08:34:19.280Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CodeQL analysis for Windows is too slow if I need to compile the C++ project. How to solve this?<p>I am trying to setup a CodeQL analysis workflow for my pro... |
72,945,443 | Android - LiveData observe not getting update from AndroidViewModel in active Activity<p>I do see quite some questions about this issue but most of them are related to Fragment. I am calling it inside the activity but still not observing any changes.</p>
<p>MainActivity.kt:</p>
<pre><code>class MainActivity : AppCompat... | <p>In the examples you linked (<a href="https://developer.android.com/topic/libraries/architecture/viewmodel" rel="nofollow noreferrer">here</a>) the <code>loadUsers()</code> method does not <em>return</em> the data, it calls some method to get it asynchronously, then posts it to the LiveData (but they don't show that ... | Android - LiveData observe not getting update from AndroidViewModel in active Activity | android|kotlin | 0 | 78 | 2 | 72,945,947 | 72,945,947 | 1 | true | 2022-07-11T22:57:02.933Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Android - LiveData observe not getting update from AndroidViewModel in active Activity<p>I do see quite some questions about this issue but most of them are ... |
72,982,934 | Passing data between components with ngFor not working on Angular14<p>I am working on a personal project where I want to register every meal I eat along the day, and display them using charts.</p>
<p>I already know how to pass data between components using <code>Input()</code> between parent and child, but my problem h... | <p>You've to set <code>doughnutChartData</code> within <code>ngOnInit</code>.</p>
<p><a href="https://angular.io/guide/lifecycle-hooks#initializing-a-component-or-directive" rel="nofollow noreferrer">Keep in mind that a directive's data-bound input properties are not set until after construction.</a></p>
<pre class="la... | Passing data between components with ngFor not working on Angular14 | angular|typescript|ngfor | 0 | 78 | 1 | 72,983,331 | 72,983,331 | 1 | true | 2022-07-14T15:20:54.437Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing data between components with ngFor not working on Angular14<p>I am working on a personal project where I want to register every meal I eat along the ... |
72,821,523 | java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = java.util.ArrayList)<p>Reaching to ask for your help on this one.</p>
<p>I'm getting the error:</p>
<p><code>java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = java.util.Arr... | <p>For <code>ArrayList</code>, I recommend <a href="https://developer.android.com/reference/android/os/Parcel#writeParcelableList(java.util.List%3CT%3E,%20int)" rel="nofollow noreferrer"><code>writeParcelableList()</code></a> instead of <code>writeSerializable()</code>, and <a href="https://developer.android.com/refere... | java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = java.util.ArrayList) | android|android-intent|bundle|parcelable | 1 | 78 | 1 | 72,821,780 | 72,821,780 | 2 | true | 2022-06-30T20:14:01.947Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = java.util.ArrayList)<p>Reaching to ask for your help on th... |
72,775,283 | How to escape the name parameter in the content-disposition header?<p>When using HTTP/1.1 to submit a document using the <code>multipart/form-data</code> content type, each part must contain a <code>Content-Disposition</code> header with the form field name given as the <code>name</code> parameter.</p>
<pre><code>----... | <p><a href="https://datatracker.ietf.org/doc/html/rfc7230#section-3.2.6" rel="nofollow noreferrer">RFC7230</a> specifies how backslash escaping works for quoted strings in HTTP headers.</p>
<blockquote>
<p>A string of text is parsed as a single value if it is quoted using
double-quote marks.</p>
<pre><code> quoted-stri... | How to escape the name parameter in the content-disposition header? | http|escaping|multipart|content-disposition | 1 | 78 | 1 | 72,823,174 | 72,823,174 | 2 | true | 2022-06-27T16:16:31.920Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to escape the name parameter in the content-disposition header?<p>When using HTTP/1.1 to submit a document using the <code>multipart/form-data</code> con... |
72,846,005 | Return Base class shared pointer using derived class C++<p>I have a an interface:</p>
<pre><code>/*base.hpp */
class Base {
protected:
Base() = default;
public:
Base(Base const &) = delete;
Base &operator=(Base const &) = delete;
Base(Base &&) = delete;
Base &oper... | <p>This should do:</p>
<pre><code>std::shared_ptr<Derived> d = std::make_shared<Derived>();
std::shared_ptr<Base> getBase() { return d; }
</code></pre> | Return Base class shared pointer using derived class C++ | c++|pointers|inheritance|shared-ptr|abstract-base-class | 0 | 78 | 1 | 72,846,040 | 72,846,040 | 2 | true | 2022-07-03T11:12:24.567Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Return Base class shared pointer using derived class C++<p>I have a an interface:</p>
<pre><code>/*base.hpp */
class Base {
protected:
Base() = de... |
72,842,431 | Printing a triangle with incrementing digits instead of asterisks<p>I'm experimenting with my program by trying to build different kinds of pyramids and converting the values into different values. I managed to build one with asterisk sign and now I'm trying to find a way on how to change it into running numbers like &... | <blockquote>
<p>I'm trying to find a way on how to change it into running numbers like "0123456789" and the next line is "012345678" and so on. <strong>Is there a way to do that without fully/less changes of my code?</strong></p>
</blockquote>
<p>While the other answer provides an alternative soluti... | Printing a triangle with incrementing digits instead of asterisks | loops|assembly|x86-16|emu8086 | 1 | 78 | 2 | 72,847,182 | 72,847,182 | 2 | true | 2022-07-02T21:08:57.090Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Printing a triangle with incrementing digits instead of asterisks<p>I'm experimenting with my program by trying to build different kinds of pyramids and conv... |
72,855,957 | FHIR Issue trying to search by date range<p>I'm trying to do a /Observation search by value-quantity, I can do it without problems with the prefixes eq, ne, gt, lt, le etc but I can't do it for a range, I would like to be able to do it for a minimum and maximum value.</p>
<p>Is this possible? I have searched on composi... | <p>Range searches in FHIR are done using a lower bound combined with an upper bound since multiple conditions are ANDed together. If you wanted to search for Observations with a value between 1 and 10 you could do</p>
<pre><code>Observation?value-quantity=ge1&value-quantity=le10
</code></pre> | FHIR Issue trying to search by date range | hl7-fhir | 0 | 78 | 1 | 72,857,418 | 72,857,418 | 2 | true | 2022-07-04T11:27:18.653Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
FHIR Issue trying to search by date range<p>I'm trying to do a /Observation search by value-quantity, I can do it without problems with the prefixes eq, ne, ... |
72,858,723 | How to add HardConstraint for min and max count per group in OptaPlanner?<p>I'm new in OptaPlanner.</p>
<p>I need to divide the list of works between employees, but the number of work performed by one employee should not be less or more than the specified values.
For example, one employee cannot perform less than 10 an... | <p>In your domain, I do not see any fields to determine the Job's date, so I am assuming all jobs share the same date. Using <a href="https://www.optaplanner.org/docs/optaplanner/latest/constraint-streams/constraint-streams.html" rel="nofollow noreferrer">Constraint Streams</a>, you can model your minimum and maximum j... | How to add HardConstraint for min and max count per group in OptaPlanner? | java|optaplanner | 1 | 78 | 2 | 72,871,028 | 72,871,028 | 2 | true | 2022-07-04T15:02:32.687Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add HardConstraint for min and max count per group in OptaPlanner?<p>I'm new in OptaPlanner.</p>
<p>I need to divide the list of works between employe... |
72,892,121 | Select specific columns of a csv file contain specific letters in R<p>Using R to read a csv file.</p>
<p>Can anyone share with me how to select only columns end with _ct?</p>
<p><a href="https://i.stack.imgur.com/aYVR9.png" rel="nofollow noreferrer">enter image description here</a></p> | <p>Using <code>readr::read_csv()</code> you can specify which columns to select (using tidyselection as we use in <code>dplyr::select()</code>. For example if we want to select those column in <code>mtcars.csv</code> data starts with letter d, we can do the following</p>
<pre class="lang-r prettyprint-override"><code>l... | Select specific columns of a csv file contain specific letters in R | r | 2 | 78 | 4 | 72,892,311 | 72,892,311 | 2 | true | 2022-07-07T03:57:10.543Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Select specific columns of a csv file contain specific letters in R<p>Using R to read a csv file.</p>
<p>Can anyone share with me how to select only columns ... |
72,892,002 | How to overlap the menu with text when popping up without js?<p>I need a animated menu without js.
I create it using "transform" tag.</p>
<p>But Problem is : Footer menu not hidden by label after opened.
Searches not given any results.
Footer also has gradient color otherwise I'd hide it with a color block</p... | <p>This is very unclear but from what i've understand you should have a div wrapping mblock. This div would have the size of mblock and overflow hidden. This div would not move, but mblock would move inside it. So when mblock is outside of it, it would not appear.</p>
<p><div class="snippet" data-lang="js" data-hide="f... | How to overlap the menu with text when popping up without js? | html|css|overflow|z-index | 1 | 78 | 1 | 72,899,404 | 72,899,404 | 2 | true | 2022-07-07T03:31:02.723Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to overlap the menu with text when popping up without js?<p>I need a animated menu without js.
I create it using "transform" tag.</p>
<p>But Pr... |
72,910,631 | Why do I need to wrap navActions.navigateToPurchase() with LaunchedEffect in fun NavGraph when use Jetpack Compose?<p>In my plan, I hope to display Home UI when I run an app first, a user can open Purchase UI by clicking a button on Home UI. And more, Purchase UI will be displayed automatically if the app is expired wh... | <p>for my simple knowledge, the navigate function need to be called in the function or click event, navActions.navigateToPurchase() was not called in any of the above, because function marked Composable is not like normal function or click event, that is why LauchEffect is used as side effect for such scenarios as exp... | Why do I need to wrap navActions.navigateToPurchase() with LaunchedEffect in fun NavGraph when use Jetpack Compose? | android-studio|kotlin|android-jetpack-compose | 1 | 78 | 1 | 72,911,785 | 72,911,785 | 2 | true | 2022-07-08T11:19:35.733Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why do I need to wrap navActions.navigateToPurchase() with LaunchedEffect in fun NavGraph when use Jetpack Compose?<p>In my plan, I hope to display Home UI w... |
72,921,544 | This code should print i=1 but it is printing i=0 Why is it so?<pre><code>#include<studio.h>
int main()
{
int a=5,i;
i!=a>10;
printf("i=%d",i);
return 0;
}
</code></pre>
<p>This code should print i=1 but it is printing i=0 Why is it so?</p> | <p>That's because you don't do anything to i.
Your "i!=a>10" evaluates to false, but the result is not stored into a variable.
As it is mentioned in the comments, you need something like this:</p>
<pre><code>int a = 5;
int i = !(a > 10);
</code></pre>
<p>The != is mostly used in if-clauses, like</p>
<pr... | This code should print i=1 but it is printing i=0 Why is it so? | c | -4 | 78 | 2 | 72,921,672 | 72,921,672 | 2 | true | 2022-07-09T12:56:31.493Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
This code should print i=1 but it is printing i=0 Why is it so?<pre><code>#include<studio.h>
int main()
{
int a=5,i;
i!=a>10;
printf("... |
72,927,580 | C: what is a void* besides a pointer?<p>Reading <a href="https://www.cs.cmu.edu/%7E410/" rel="nofollow noreferrer">CMU's OS Course Home Page</a>, they say:<br />
"It is a good idea to be familiar with C conventions. For example, it is not generally the case that a void * is a pointer. If seeing a void * parameter,... | <p>One case where <code>void *</code> is not a pointer involves passing data to a callback function. Imagine some library gives you a function which does some useful work, and calls your function (callback) in the middle of that work.</p>
<pre><code>// useful_header.h
int do_useful_work(int data1, int data2, int (*call... | C: what is a void* besides a pointer? | c | 0 | 78 | 1 | 72,927,765 | 72,927,765 | 2 | true | 2022-07-10T09:50:33.737Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C: what is a void* besides a pointer?<p>Reading <a href="https://www.cs.cmu.edu/%7E410/" rel="nofollow noreferrer">CMU's OS Course Home Page</a>, they say:<b... |
72,943,841 | Create composite function from arbitrary number of functions<p>I am reading <a href="https://rads.stackoverflow.com/amzn/click/com/1782163921" rel="nofollow noreferrer" rel="nofollow noreferrer">Joseph Howse OpenCV book</a>. In the appendix, he's discussing creation of composite function from 2 other functions, as foll... | <p>You don't need recursion; this is a simple iterative problem:</p>
<pre><code>def createCompositeFunction(*funcs):
def apply(x):
for func in funcs:
x = func(x)
return x
return apply
def f1(x):
return x + 2
def f2(x):
return x * 3
def f3(x):
return x / 2
comp = ... | Create composite function from arbitrary number of functions | python|recursion | 1 | 78 | 6 | 72,943,981 | 72,943,981 | 2 | true | 2022-07-11T19:42:21.807Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create composite function from arbitrary number of functions<p>I am reading <a href="https://rads.stackoverflow.com/amzn/click/com/1782163921" rel="nofollow ... |
72,941,407 | It says to me: Type 'boolean' is not assignable to type 'false'.ts(2322), however, I return the correct type<pre><code>type Answer = { error: false; status: boolean } | { error: true; description: string };
async has_READ_EXTERNAL_STORAGEv1(): Promise<Answer> {
return await this.androidPermissions
... | <p><code>!answer.error</code> seems to be too vague for the compiler to infer the type.</p>
<p><code>answer.error === false</code> works as you expect.</p>
<pre class="lang-js prettyprint-override"><code>await this.has_READ_EXTERNAL_STORAGEv1().then(answer => {
if (answer.error === false) {
console.log(answer.... | It says to me: Type 'boolean' is not assignable to type 'false'.ts(2322), however, I return the correct type | angular|typescript|ionic-framework | 0 | 78 | 1 | 72,945,239 | 72,945,239 | 2 | true | 2022-07-11T16:00:01.780Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
It says to me: Type 'boolean' is not assignable to type 'false'.ts(2322), however, I return the correct type<pre><code>type Answer = { error: false; status: ... |
72,961,480 | How to make a proper Elapsed time? Python<p>So far I did something like this:</p>
<pre class="lang-py prettyprint-override"><code>import datetime as dt
import time, sys
start = time.time()
while True:
now = time.time()
delta = dt.timedelta(seconds=int(now - start))
sys.stdout.write('\r\033[2K' + str(delta... | <p>You can use <code>datetime.now</code> instead of <code>time.time</code> and then convert it to <code>timedelta </code>.</p>
<pre><code>start = dt.datetime.now()
now = dt.datetime.now()
print(frmtdelta(now - start))
</code></pre>
<p>You need to write a function to compute <code>hour</code>, <code>minute</code> and <c... | How to make a proper Elapsed time? Python | python|datetime|timedelta | 0 | 78 | 2 | 72,962,135 | 72,962,135 | 2 | true | 2022-07-13T05:48:40.720Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make a proper Elapsed time? Python<p>So far I did something like this:</p>
<pre class="lang-py prettyprint-override"><code>import datetime as dt
impor... |
72,975,334 | Simple implementation of sizeof in C<p>I came across one simple (maybe over simplified) implementation of the <code>sizeof</code> operator in C, which goes as follows:</p>
<pre class="lang-c prettyprint-override"><code>#include <stdio.h>
#define mySizeof(type) ((char*)(&type + 1) - (char*)(&type))
int ... | <p>What you have to remember here is that pointer arithmetic is performed in units of the size of the pointed-to type.</p>
<p>So, if <code>p</code> is a pointer to the first element of an <code>int</code> array, then <code>*p</code> refers to that first element and the result of the <code>p + 1</code> operation will be... | Simple implementation of sizeof in C | c|pointers|sizeof | 2 | 78 | 3 | 72,975,523 | 72,975,523 | 2 | true | 2022-07-14T04:49:52.133Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Simple implementation of sizeof in C<p>I came across one simple (maybe over simplified) implementation of the <code>sizeof</code> operator in C, which goes a... |
72,994,466 | Block Positon changes after changing innerHTML<p>I am trying to make a X-O game
so html is this:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code> const blocks = document.que... | <p>I have a slightly different solution using rows and column structure and flex.</p>
<p>Divide the structure into a tabular structure (ex: row, column). Try using <code>display:flex</code> to display the boxes in the same line.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel... | Block Positon changes after changing innerHTML | javascript|html|css | 2 | 78 | 2 | 72,994,672 | 72,994,672 | 2 | true | 2022-07-15T13:05:38.363Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Block Positon changes after changing innerHTML<p>I am trying to make a X-O game
so html is this:</p>
<p><div class="snippet" data-lang="js" data-hide="false"... |
73,003,509 | Reference inferred type in multi parameter type classes<p>I have a data type with 3 phantom types attached so i can define functions classes for each combination. This method removes much duplicate code:</p>
<pre><code>newtype Dd x y z = ToDd Cudd.DdNode deriving (Eq,Show)
--Class for all instances where the first sub... | <p>If you want the compiler to infer some types of a MPTC for you, you need to declare a suitable <em>functional dependency</em> in the class.</p>
<pre><code>{-# LANGUAGE FunctionalDependencies #-}
class DdT a b c | a->b, a->c where
</code></pre>
<p>But that doesn't really seem to be what you want. In parti... | Reference inferred type in multi parameter type classes | haskell|refactoring|type-inference|typeclass | 1 | 78 | 1 | 73,004,473 | 73,004,473 | 2 | true | 2022-07-16T10:41:58.817Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reference inferred type in multi parameter type classes<p>I have a data type with 3 phantom types attached so i can define functions classes for each combina... |
72,865,854 | Table with box inside<p>How to code this kind of table? The code for the table is easy for me but I don't know how to put a box in the upper right in every column. Thank you.</p>
<p><img src="https://i.stack.imgur.com/Xk9KO.png" alt="Table with box inside" /></p> | <p>I found a way to add a box in the upper right corner, by adding additional columns (one left and one right for symmetry reasons) and rows to the table.
This is my solution, though they are propably more elegant ways to achive this:</p>
<pre><code>\documentclass{article}
\usepackage{array}
\newcolumntype{P}[1]{>{\... | Table with box inside | latex | 1 | 78 | 1 | 73,077,812 | 73,077,812 | 2 | true | 2022-07-05T07:54:33.547Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Table with box inside<p>How to code this kind of table? The code for the table is easy for me but I don't know how to put a box in the upper right in every c... |
73,003,820 | Compare two vectors within a data frame with %in% with R<p><strong>Compare two vectors within a data frame with %in%</strong></p>
<p>I have the following data</p>
<p><code>T1 <- data.frame( "Col1" = c("a", "b", "aa", "d"), "Col2" = c("a,b,c", &quo... | <p>Another way you could achieve this (using your original approach with strsplit) is to do it <code>rowwise()</code> and 'sum' the logical test.</p>
<pre><code>T1 %>%
rowwise() %>%
filter(sum(unlist(strsplit(Col2,",")) %in% c("a","e","g")) >= 1)
</code></pre> | Compare two vectors within a data frame with %in% with R | r|vector | 1 | 78 | 2 | 73,004,668 | 73,004,668 | 2 | true | 2022-07-16T11:29:46.497Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Compare two vectors within a data frame with %in% with R<p><strong>Compare two vectors within a data frame with %in%</strong></p>
<p>I have the following dat... |
72,949,302 | How to solve "Time Limit Exceeded" error?<p><strong><strong>I am recently practicing on codeforces.com, I solved a problem there:</strong></strong></p>
<p>Kristina has two arrays a and b, each containing n non-negative integers. She can perform the following operation on array a any number of times:</p>
<p>apply a decr... | <blockquote>
<p>I am recently practicing on codeforces.com... It shows "Time limit Exceeded" when I went to submit this code.</p>
</blockquote>
<p>As <a href="https://stackoverflow.com/users/1553090/paddy">paddy</a> <a href="https://stackoverflow.com/questions/72949302/how-to-solve-time-limit-exceeded-error#c... | How to solve "Time Limit Exceeded" error? | c | -3 | 78 | 2 | 72,950,505 | 72,950,505 | 2 | true | 2022-07-12T08:34:02.017Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to solve "Time Limit Exceeded" error?<p><strong><strong>I am recently practicing on codeforces.com, I solved a problem there:</strong></strong></p>
<p>Kr... |
72,973,500 | R - Find x days from start date while keeping dates inbetween<p>I am trying to find the first date of each category then subtract 5 days <strong>AND I want to keep the days inbetween!</strong> this is where I am struggling. I tried <em>seq()</em> but it gave me an error, so I'm not sure if this is the right way to do i... | <p>This approach provides the row from each category with the minimum date, plus the five dates prior for each category (with value set to <code>NA</code> for these rows)</p>
<pre><code>library(data.table)
setDT(data)[data[, .(date=seq(min(date)-5,by="day", length.out=6)), category], on=.(category,date)]
</co... | R - Find x days from start date while keeping dates inbetween | r|date|sequence|lubridate | 1 | 78 | 3 | 72,973,885 | 72,973,885 | 2 | true | 2022-07-13T22:56:31.140Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R - Find x days from start date while keeping dates inbetween<p>I am trying to find the first date of each category then subtract 5 days <strong>AND I want t... |
72,919,450 | Subclasses of object class for Python in Linux command line<p>A Python install on Linux identifies 187 subclasses of the object class through this query:</p>
<pre><code>kali@kali:~$ python3 -c 'print(len("".__class__.__mro__[1].__subclasses__()))'
</code></pre>
<p>The same query in an IDLE shell identifies 34... | <p>When performing the check on various setups it seems your query is based on properties of the <code>object</code> class:</p>
<pre><code>"".__class__.__mro__
(<class 'str'>, <class 'object'>)
</code></pre>
<p>Thus your query can be translated as:</p>
<pre><code>len(object.__subclasses__())
</co... | Subclasses of object class for Python in Linux command line | python|linux|command-line | 3 | 78 | 1 | 72,919,678 | 72,919,678 | 2 | true | 2022-07-09T06:34:29.393Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Subclasses of object class for Python in Linux command line<p>A Python install on Linux identifies 187 subclasses of the object class through this query:</p>... |
72,942,311 | No MESSAGE-ID and get imap_tools work for imap.mail.yahoo.com<p>The question is twofold, about getting MESSAGE-ID, and using imap_tools. For an email client ("handmade") in Python I need to lessen the data amount read from the server (presently it takes 2 min to read the whole mbox folder of ~170 msg for yah... | <p>It looks simply like your email without a Message-ID legitimately does not have one; it appears the welcome email Yahoo sent you actually lacks it. Since it's a system generated email, that's not that unexpected. You'd just have to skip over it.</p>
<p>The second problem is that you need to use <code>imap_tools.Mail... | No MESSAGE-ID and get imap_tools work for imap.mail.yahoo.com | python-3.x|imaplib|yahoo-mail | 0 | 78 | 1 | 72,944,197 | 72,944,197 | 2 | true | 2022-07-11T17:16:03.770Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
No MESSAGE-ID and get imap_tools work for imap.mail.yahoo.com<p>The question is twofold, about getting MESSAGE-ID, and using imap_tools. For an email client... |
72,834,561 | Rx.NET Is there an elegant way to create observable from callback which is passed in ctor<p>I have this code</p>
<pre><code>using System.Reactive.Linq;
var wrapper = new Wrapper<int>();
var clicker = new Clicker(wrapper.Action);
Observable
.FromEvent
(
(Action<int> f) => wrapper.Regist... | <p>Your classes are trying to replicate basic functionality of delegates and observables... just use them as they are intended.</p>
<pre><code>public class Clicker : ISubject<int>
{
private readonly Subject<int> subject = new Subject<int>();
public void Click(int val)
{
subject.On... | Rx.NET Is there an elegant way to create observable from callback which is passed in ctor | c#|.net|reactive-programming|rx.net | 0 | 78 | 1 | 72,834,809 | 72,834,809 | 2 | true | 2022-07-01T20:57:34.873Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rx.NET Is there an elegant way to create observable from callback which is passed in ctor<p>I have this code</p>
<pre><code>using System.Reactive.Linq;
var ... |
72,962,404 | How to remove usage tip in Intellij<p>In Intellij,there is <code>usage</code> button.<br/>
How can I remove it? I try to google it but can't find any solution</p>
<p><a href="https://i.stack.imgur.com/aP8dt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/aP8dt.png" alt="enter image description here" ... | <p>You can hide <code>Usages</code> by disabling it in the IDE settings</p>
<p>⌘ + , (macOS), or Ctrl + Alt + S (Windows/Linux)</p>
<p>Then navigate to:</p>
<p><code>Editor > Inlay Hints > Code Vision > Usages</code>.</p>
<p>and untick the checkbox</p> | How to remove usage tip in Intellij | intellij-idea | 2 | 78 | 1 | 72,962,458 | 72,962,458 | 2 | true | 2022-07-13T07:25:12.900Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to remove usage tip in Intellij<p>In Intellij,there is <code>usage</code> button.<br/>
How can I remove it? I try to google it but can't find any solutio... |
72,931,543 | Sanitize email html body and increase zoom level HTML<p>I am making an email client for blind people (well, legally blind anyways), and I am trying to render the HTML body for the emails, in a safe way, but without losing the style of the original content. I also want all the content to have increased the size of every... | <p>I would recommend using an <code>iframe</code> which can prevent script execution via the <code>sandbox</code> attribute. You can add additional styling to set a specific root font size, though this may not work as expected depending on the mail's own styling.</p>
<pre class="lang-html prettyprint-override"><code>&l... | Sanitize email html body and increase zoom level HTML | html-email|svelte|email-client|sanitize | 1 | 78 | 1 | 72,931,653 | 72,931,653 | 2 | true | 2022-07-10T20:05:41.190Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sanitize email html body and increase zoom level HTML<p>I am making an email client for blind people (well, legally blind anyways), and I am trying to render... |
72,957,396 | Python re.sub with regex<p>Need help with regex within re.sub . In this case I am replacing with nothing ("")</p>
<p>My Current Code:</p>
<pre><code>file_list = ['F_5500_SF_PART7_[0-9][0-9][0-9][0-9]_all.zip',
'F_5500_SF_[0-9][0-9][0-9][0-9]_All.zip',
'F_5500_[0-9][0-9][0-9][0-9]_All.zip',
'F_SCH_A_PART1_[... | <p>You don't need a regular expression, you're removing fixed strings. So you can just use the <code>str.replace()</code> method.</p>
<pre><code>foldernames = [i.replace('_[0-9][0-9][0-9][0-9]_All.zip', '').replace('_[0-9][0-9][0-9][0-9]_all.zip', '') for i in file_list]
</code></pre>
<p>The two calls to <code>replace(... | Python re.sub with regex | python|regex|python-re | 1 | 78 | 2 | 72,957,443 | 72,957,443 | 2 | true | 2022-07-12T19:22:55.563Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python re.sub with regex<p>Need help with regex within re.sub . In this case I am replacing with nothing ("")</p>
<p>My Current Code:</p>
<pre><cod... |
72,994,491 | React, form input stops working after opening and closing custom drop down<p>I have created a form with a custom drop down component, and I've spent the day trying to find out what is causing this.</p>
<p>I've tried using <code>useRef</code> and use <code>defaultValue</code> SO answers.</p>
<p>The 'Menu Name' text inpu... | <p>In <code>DropDownList</code> you register some click outside listeners, but this happens in a <code>useMemo</code> when it should be a <code>useEffect</code>. Therefore the click handler is never removed when the popup closes which probably makes everything unelectable as <code>preventDefault</code> is called on eve... | React, form input stops working after opening and closing custom drop down | reactjs | 2 | 78 | 1 | 72,994,584 | 72,994,584 | 2 | true | 2022-07-15T13:07:29.090Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React, form input stops working after opening and closing custom drop down<p>I have created a form with a custom drop down component, and I've spent the day ... |
72,972,952 | Is there a way to open chrome devtools and ensure that console tab is selected<p>When you do command+option+i on this page, it will open the devtools. When it opens it will be focused on the last tab that was focused.</p>
<p>You can change the focused tab (from "Element" pane to "Console" or others)... | <p>Yes, you can use command + option + j to always open the Console!
<a href="https://developer.chrome.com/docs/devtools/open/#console" rel="nofollow noreferrer">https://developer.chrome.com/docs/devtools/open/#console</a></p>
<p><a href="https://i.stack.imgur.com/mwoIn.png" rel="nofollow noreferrer"><img src="https://... | Is there a way to open chrome devtools and ensure that console tab is selected | google-chrome|google-chrome-extension|selenium-chromedriver|google-chrome-devtools|chrome-devtools-protocol | 0 | 78 | 1 | 72,974,426 | 72,974,426 | 2 | true | 2022-07-13T21:43:36.347Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a way to open chrome devtools and ensure that console tab is selected<p>When you do command+option+i on this page, it will open the devtools. When i... |
72,897,007 | Convert string to 2 decimal Number in 1 line<p>I have a string 123.4567 that I want to convert to a Number with two decimals and I want to do this in 1 short line in Javascript.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="sn... | <p>you can do that :</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const
x = "123.4567"
, y = (0 | (parseFloat(x) *100)) /100 // or (0|parseFloat(x) *100) /100 - see JS Op... | Convert string to 2 decimal Number in 1 line | javascript|numbers|rounding | 1 | 78 | 1 | 72,902,140 | 72,902,140 | 2 | true | 2022-07-07T11:27:10.073Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert string to 2 decimal Number in 1 line<p>I have a string 123.4567 that I want to convert to a Number with two decimals and I want to do this in 1 short... |
72,824,944 | Perl: Go to further processing only if there are no elements to be processed by foreach loop of array (last iteration of foreach loop is on)<p>How can I check if no elements exist further in the array to be processed by the foreach loop?</p>
<p>Example:</p>
<pre><code>my @array = ("abc","def","... | <p>There are multiple ways to achieve desired result, some based on usage of <code>$index</code> of array, and other based on use <code>$#array-1</code> which can be utilized to obtain the array slice, the last element of an array accessible with <code>$array[-1]</code>.</p>
<pre class="lang-perl prettyprint-override">... | Perl: Go to further processing only if there are no elements to be processed by foreach loop of array (last iteration of foreach loop is on) | arrays|perl|foreach|iteration | 1 | 78 | 3 | 72,825,804 | 72,825,804 | 2 | true | 2022-07-01T05:55:42.890Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Perl: Go to further processing only if there are no elements to be processed by foreach loop of array (last iteration of foreach loop is on)<p>How can I chec... |
72,960,174 | How to convert Fancy text to normal text in javascript?<p>I'm creating a search function on javascript that has normal and fancy text.</p>
<p>The problem is when searching:
Fancy text value: </p>
<p>it does not work.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"... | <p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize" rel="nofollow noreferrer">Normalise</a> the string with <em>compatibility decomposition</em> before searching</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"... | How to convert Fancy text to normal text in javascript? | javascript|unicode-normalization | 2 | 78 | 1 | 72,960,306 | 72,960,306 | 2 | true | 2022-07-13T02:13:06.213Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert Fancy text to normal text in javascript?<p>I'm creating a search function on javascript that has normal and fancy text.</p>
<p>The problem is ... |
72,771,707 | What is the difference between softmax or sigmoid activation for binary classification?<p>In most of the articles I encountered that dealt with binary classification, I tended to see 2 main types of outputs:</p>
<pre class="lang-py prettyprint-override"><code>Dense(2, activation = "softmax")
</code></pre>
<p>... | <p>There is essentially no difference between the two as you describe in this question. However, <code>"softmax"</code> can also be applied to multi-class classification, whereas <code>"sigmoid"</code> is only for binary classification.</p>
<p><code>"sigmoid"</code> predicts a value betwee... | What is the difference between softmax or sigmoid activation for binary classification? | python|deep-learning|classification | -1 | 78 | 1 | 72,771,942 | 72,771,942 | 3 | true | 2022-06-27T11:57:57.300Z | 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 softmax or sigmoid activation for binary classification?<p>In most of the articles I encountered that dealt with binary classi... |
72,776,366 | SQL exclude rows containing nearly duplicate values filtered by grouped max values<p>I have a table like this...</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th style="text-align: center;">ID</th>
<th style="text-align: center;">User_ID</th>
<th style="text-align: left;">Skill</th>
<th styl... | <p>Using a <a href="https://app.rasgoml.com/sql?transformName=%22dedupe%22&tableState=%7B%22tables%22%3A%5B%7B%22name%22%3A%22My_First_Table%22%2C%22columns%22%3A%5B%7B%22name%22%3A%22ID%22%2C%22dataType%22%3A%22number%22%7D%2C%7B%22name%22%3A%22User_ID%22%2C%22dataType%22%3A%22number%22%7D%2C%7B%22name%22%3A%22Ski... | SQL exclude rows containing nearly duplicate values filtered by grouped max values | sql|sql-server|tsql|greatest-n-per-group | 2 | 78 | 2 | 72,776,550 | 72,776,550 | 3 | true | 2022-06-27T17:47:10.490Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL exclude rows containing nearly duplicate values filtered by grouped max values<p>I have a table like this...</p>
<div class="s-table-container">
<table c... |
72,802,995 | What does it means this error?" In template: call to deleted constructor of 'std::unique_ptr<InventoryElements>"<p>this is the class with all the methods.</p>
<pre><code>#include "InventoryElements.h"
class Inventory{
public:
explicit Inventory(int max) : MaxElements(max){
myInventory.resize(max);... | <p>Because a <code>std::unique_ptr</code> can not be <em>copied</em>, you will need to <strong>move</strong> your unique_ptr into your vector.</p>
<pre><code> myInventory.push_back( std::move(element) ); // no more error
</code></pre>
<p>After this line, <code>element</code> will no longer point to your element, as ... | What does it means this error?" In template: call to deleted constructor of 'std::unique_ptr<InventoryElements>" | c++ | 0 | 78 | 1 | 72,803,864 | 72,803,864 | 3 | true | 2022-06-29T14:19:22.007Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What does it means this error?" In template: call to deleted constructor of 'std::unique_ptr<InventoryElements>"<p>this is the class with all the methods.</p... |
72,858,915 | Getting the Address of a function that can only be called<p>I already asked a <a href="https://stackoverflow.com/questions/72856987/get-address-from-d3d12-interface-copytextureregion-method">Question</a> but I think thats very special and will not get a concrete answer.</p>
<p>Im trying to give a simpler Explanation of... | <p>Taking the address of the member function:</p>
<pre><code>auto RegionHookAddress = &d3d12::ID3D12GraphicsCommandList::CopyTextureRegion;
</code></pre>
<p>Calling the member function:</p>
<pre><code>(d3d12::pCommandList->*RegionHookAddress)(...);
</code></pre> | Getting the Address of a function that can only be called | c++|pointers|directx|direct3d12 | 1 | 78 | 1 | 72,859,347 | 72,859,347 | 3 | true | 2022-07-04T15:16:31.993Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting the Address of a function that can only be called<p>I already asked a <a href="https://stackoverflow.com/questions/72856987/get-address-from-d3d12-in... |
72,892,786 | Assign multiple values into variable oracle PLSQL<p>How to assign multiple values to variable using select query in PLSQL Oracle, example query is below</p>
<pre><code>Select * into v_name from tbl_name;
</code></pre> | <p>If you just declare the variable using <code>%rowtype</code>, it won't work if there's not exactly one row in the table (because, if it is empty, <code>select</code> will return <code>no_data_found</code>, and if there are two or more rows, you'll get <code>too_many_rows</code>), e.g.</p>
<pre><code>SQL> declare
... | Assign multiple values into variable oracle PLSQL | oracle|plsql | 0 | 78 | 2 | 72,892,939 | 72,892,939 | 3 | true | 2022-07-07T05:43:16.673Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Assign multiple values into variable oracle PLSQL<p>How to assign multiple values to variable using select query in PLSQL Oracle, example query is below</p>... |
72,905,663 | How to rename columns in R with dplyr using a character object?<p>My data frame is as such:</p>
<pre><code>#generic dataset
datatest <- data.frame(col1 = c(1,2,3,4), col2 = c('A', 'B', 'C', 'D'))
#character objects
name1 <- 'A'
name2 <- 'B'
</code></pre>
<p>I want to rename my columns using the name1 and name... | <p>Couple of options -</p>
<ol>
<li>Using <code>rename_with</code> -</li>
</ol>
<pre><code>library(dplyr)
name1 <- 'A'
name2 <- 'B'
datatest %>% rename_with(~c(name1, name2), c(col1, col2))
#If there are only two columns in datatest
datatest %>% rename_with(~c(name1, name2))
# A B
#1 1 A
#2 2 B
#3 3 C
... | How to rename columns in R with dplyr using a character object? | r|dplyr|rename | 3 | 78 | 3 | 72,905,752 | 72,905,752 | 3 | true | 2022-07-08T01:02:00.100Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to rename columns in R with dplyr using a character object?<p>My data frame is as such:</p>
<pre><code>#generic dataset
datatest <- data.frame(col1 = ... |
72,993,030 | How to verify table's column data is sorted by name or not<p>I have one project where I want to do some sorting. When the user click on the column name data should be show in sorted by name.</p>
<p>Is it possible to do in Cypress using POM?</p> | <p>You can extract the column data from the page, then sort it. Afterwards, click on app sort by name and match.</p>
<p>Here is a working simplified <a href="https://github.com/jjhelguero/cypress-examples/blob/main/cypress/integration/checkSortedColumn.md" rel="nofollow noreferrer">example</a>.</p>
<pre class="lang-js ... | How to verify table's column data is sorted by name or not | cypress|pageobjects | 0 | 78 | 2 | 72,995,066 | 72,995,066 | 3 | true | 2022-07-15T11:06:15.193Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to verify table's column data is sorted by name or not<p>I have one project where I want to do some sorting. When the user click on the column name data ... |
72,831,630 | Return a list where any string in one list starts with any string in another<p>In Python I'm attempting to use a list comprehension to create a list where any string in one list starts with any string in another.</p>
<p>For example, say I have a list of three names <code>Alan</code>, <code>Bob</code> and <code>Carl</co... | <p>Use <code>any()</code>, which is a builtin function that returns <code>True</code> if <code>any</code> element of an input iterable is true:</p>
<pre><code>>>> starts_with=('Bo', 'Da', 'Fr')
>>> names = ['Alan', 'Bob', 'Carl']
>>> [n for n in names if any(n.startswith(s) for s in starts_wi... | Return a list where any string in one list starts with any string in another | python|list-comprehension | -1 | 78 | 3 | 72,831,655 | 72,831,655 | 4 | true | 2022-07-01T15:38:48.927Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Return a list where any string in one list starts with any string in another<p>In Python I'm attempting to use a list comprehension to create a list where an... |
72,847,768 | Keep vector elements or matrix columns that only appear once<p>I have a matrix:</p>
<pre><code>A<-t(matrix(
c(0, 0, 1,
0, 0, 0,
0, 0, 1,
0, 0, 1,
0, 0, 0,
1, 1, 0), 3, 6))
</code></pre>
<p>and I need to keep columns that appear only once. So, the expected result is just the 3rd column: (1, 0, 1, 1, 0, 0).<... | <p>Looks like we need a double <code>duplicated</code>.</p>
<pre><code>A[, !(duplicated(t(A)) | duplicated(t(A), fromLast = TRUE)), drop = FALSE]
[,1]
[1,] 1
[2,] 0
[3,] 1
[4,] 1
[5,] 0
[6,] 0
</code></pre>
<p>The idea applies to a vector, too.</p>
<pre><code>x <- c(1, 1, 2, 3, 4, 3, 4, 5)
x[... | Keep vector elements or matrix columns that only appear once | r|matrix|vector|duplicates|unique | 5 | 78 | 3 | 72,847,882 | 72,847,882 | 4 | true | 2022-07-03T15:31:47.527Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Keep vector elements or matrix columns that only appear once<p>I have a matrix:</p>
<pre><code>A<-t(matrix(
c(0, 0, 1,
0, 0, 0,
0, 0, 1,
0, 0, 1,
... |
72,880,426 | How to get list of entities in python wikidata<p>I need to get all the info about some writers in wikidata</p>
<p>For example - <a href="https://www.wikidata.org/wiki/Q39829" rel="nofollow noreferrer">https://www.wikidata.org/wiki/Q39829</a></p>
<p><strong>My code</strong></p>
<pre><code>from wikidata.client import Cli... | <p>From <a href="https://wikidata.readthedocs.io/en/stable/wikidata/entity.html#:%7E:text=Although%20it%20implements%20Mapping%5BEntityId%2C%20object%5D%2C%20it%20actually%20is%20multidict.%20See%20also%20getlist()%20method." rel="nofollow noreferrer">the docs for Wikidata</a>:</p>
<blockquote>
<p>Although it implement... | How to get list of entities in python wikidata | python|wikidata | 3 | 78 | 1 | 72,880,557 | 72,880,557 | 4 | true | 2022-07-06T08:45:24.830Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get list of entities in python wikidata<p>I need to get all the info about some writers in wikidata</p>
<p>For example - <a href="https://www.wikidata... |
72,899,527 | Replacing a subset of table values with a list of vectors<p>I have a table as follows:</p>
<pre><code>tableA <- structure(c(1L, 0L, 0L, 0L, 0L, 6L, 0L, 6L, 0L, 3L, 0L, 0L, 0L, 0L, 1L), dim = c(3L,
5L), dimnames = structure(list(c("X", &quo... | <p>You <em>could</em> do the following</p>
<pre><code>cols2replace = match(c('B', 'C', 'D'), colnames(tableA))
cells2replace = tableA[, cols2replace] > 0
tableB = matrix(unlist(listB), nrow = 3, byrow = TRUE)
tableA[, cols2replace][cells2replace] = tableB[, cols2replace][cells2replace]
> tableA
A B... | Replacing a subset of table values with a list of vectors | r|list|vector | 1 | 78 | 2 | 72,899,779 | 72,899,779 | 4 | true | 2022-07-07T14:22:50.083Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Replacing a subset of table values with a list of vectors<p>I have a table as follows:</p>
<pre><code>tableA <- structure(c(1L, 0L, 0L, 0L, 0L, 6L, 0L, 6L... |
72,953,675 | Replace / mask alternative N chars in a string<p>I want to replace some characters in a string with a "*", in the following way:</p>
<p>Given N, leave the first N characters as-is, but mask the next N characters with "*", then leave the next N characters unchanged, ...etc, alternating every N charac... | <p>You could use <code>Array.from</code> to map each character to either "*" or the unchanged character, depending on the index. If the integer division of the index by <code>n</code> is odd, it should be "*". Finally turn that array back to string with <code>join</code>:</p>
<p><div class="snippet"... | Replace / mask alternative N chars in a string | javascript|string|replace|mask|masking | 2 | 78 | 3 | 72,953,956 | 72,953,956 | 4 | true | 2022-07-12T14:05:32.220Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Replace / mask alternative N chars in a string<p>I want to replace some characters in a string with a "*", in the following way:</p>
<p>Given N, le... |
72,961,638 | Python list of dict sorting move all zero at bottom<p>I have a list of dictionary which I am sorting using multiple keys.</p>
<p>Now I want to push all the elements that have zero rank (rank is a key)</p>
<p><strong>basically rank 0 must be at bottom</strong></p>
<pre><code>mylist = [
{
"score": 5.0,
... | <pre><code>mylist = [
{
"score": 5.0,
"rank": 2,
"duration": 123,
"amount": "18.000",
},
{
"score": -1.0,
"rank": 0,
"duration": 23,
"amount": "-8.000",
},
{
"score": -2.0,... | Python list of dict sorting move all zero at bottom | python|python-3.x | 0 | 78 | 2 | 72,961,966 | 72,961,966 | 4 | true | 2022-07-13T06:08:43.880Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python list of dict sorting move all zero at bottom<p>I have a list of dictionary which I am sorting using multiple keys.</p>
<p>Now I want to push all the e... |
72,874,635 | Bootstrap method for mixed glm zero-inflated model<p>I'd like to bootstrap a mixed glm zero-inflated model (<code>m_F</code>) using the <code>glmmTMB</code> package, but despite the use of <code>coef</code> or <code>fixef</code> for coefficients specification, I always have as output the error:</p>
<pre><code>Error in ... | <p>My answer is somewhat similar to @RuiBarradas's, but closer to your original code. The main point is that <code>coef()</code> doesn't do what you think; (1) the convention (set originally by the <code>nlme</code> package) is that for mixed models <code>coef()</code> returns a matrix (or list of matrices) of group-l... | Bootstrap method for mixed glm zero-inflated model | r|mixed-models|glmmtmb | 2 | 78 | 2 | 72,875,075 | 72,875,075 | 4 | true | 2022-07-05T19:32:27.940Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Bootstrap method for mixed glm zero-inflated model<p>I'd like to bootstrap a mixed glm zero-inflated model (<code>m_F</code>) using the <code>glmmTMB</code> ... |
73,000,247 | Is there a programmatic way to tell if a symlink points to a file or directory in C?<p>I am iterating directories recursively with <code>readdir</code>.</p>
<p><code>struct dirent</code> is documented <a href="https://www.gnu.org/software/libc/manual/html_node/Directory-Entries.html" rel="nofollow noreferrer">here</a>,... | <p>The <code>dirent</code> structure might tell you if the entry is a directory or a symbolic link, but some file systems do not provide this information in <code>d_type</code> and set it to <code>DT_UNKNOWN</code>.</p>
<p>In any case, the simplest way to tell if a symbolic link points to a directory or not, is via a <... | Is there a programmatic way to tell if a symlink points to a file or directory in C? | c|posix|symlink | 2 | 78 | 1 | 73,000,542 | 73,000,542 | 4 | true | 2022-07-15T22:45:50.530Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a programmatic way to tell if a symlink points to a file or directory in C?<p>I am iterating directories recursively with <code>readdir</code>.</p>
... |
72,908,081 | Create List<T> from IEnumerable<T> being returned from async function<p>How to create a <code>List<T> </code> from an <code>IEnumerable<T></code> after getting the <code>IEnumerable<T></code> from an async function?</p>
<p>My code:</p>
<pre class="lang-cs prettyprint-override"><code>var orders = await... | <p>Try</p>
<pre class="lang-cs prettyprint-override"><code>var orders = (await _DbManager.Orders.GetAllAsync()).ToList();
</code></pre> | Create List<T> from IEnumerable<T> being returned from async function | c#|list|async-await|ienumerable | 2 | 78 | 1 | 72,908,158 | 72,908,158 | 5 | true | 2022-07-08T07:27:41.213Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create List<T> from IEnumerable<T> being returned from async function<p>How to create a <code>List<T> </code> from an <code>IEnumerable<T></code>... |
72,935,245 | Format Specifiers in C and their Roles?<p>wrote this code to "find if the given character is a digit or not"</p>
<pre><code>#include<stdio.h>
int main()
{
char ch;
printf("enter a character");
scanf("%c", &ch);
printf("%c", ch>='0'&&ch<='9'... | <p>Characters in C are really just numbers in a token table. The <code>%c</code> is mainly there to do the translation between the alphanumeric token table that humans like to read/write and the raw binary that the C program uses internally.</p>
<p>The expression <code>ch>='0'&&ch<='9'</code> evaluates to... | Format Specifiers in C and their Roles? | c|format-specifiers | 2 | 78 | 2 | 72,935,443 | 72,935,443 | 5 | true | 2022-07-11T07:47:46.020Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Format Specifiers in C and their Roles?<p>wrote this code to "find if the given character is a digit or not"</p>
<pre><code>#include<stdio.h>... |
72,795,679 | How to insert newline in the argument text of "sed" utility under both single and double quotes?<p>I'd like to insert multiple lines above a target line in a file by using sed.</p>
<p>The <code>file.txt</code> below contains one line "<code>target line</code>". My initial version is using the single quote:</p... | <p><strong>With single-quotes</strong>:</p>
<p>The backslash followed by the newline are transmitted as-is to sed. Then sed actually uses the backslash to escape the raw newline character into the string rather than terminating the command. See:</p>
<pre class="lang-bash prettyprint-override"><code>$ printf %s 'hello\
... | How to insert newline in the argument text of "sed" utility under both single and double quotes? | bash|unix|sed|utility | -2 | 78 | 3 | 72,797,189 | 72,797,189 | 5 | true | 2022-06-29T04:04:48.530Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to insert newline in the argument text of "sed" utility under both single and double quotes?<p>I'd like to insert multiple lines above a target line in a... |
72,801,319 | warning like : Each child in a list should have a unique "key" prop<pre><code>import React, { useContext , useEffect } from 'react'
import noteContext from '../context/notes/noteContext';
import AddNote from './AddNote';
import NoteItem from './NoteItem';
const Notes = () => {
const context = useContext(noteCont... | <p>could you please use <code>index</code> instead of <code>note._id</code>, because <code>note._id</code> may be duplicates, you are receiving a warning, so you can use <code>index</code> instead of <code>note._id</code>.</p>
<pre><code>{notes.map((note, index) => {
return <NoteItem key={index} note={note} /&g... | warning like : Each child in a list should have a unique "key" prop | javascript|reactjs | -1 | 78 | 1 | 72,801,548 | 72,801,548 | -1 | true | 2022-06-29T12:18:48.453Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
warning like : Each child in a list should have a unique "key" prop<pre><code>import React, { useContext , useEffect } from 'react'
import noteContext from '... |
72,950,439 | How to find the most repeated line from a text and delete it from the whole text<p>I'm filtering tweets so I can do a sentiment analysis on them but there are repeating lines I want to avoid as they're just the name of the account, after the filtering the text is left like this:</p>
<p><a href="https://i.stack.imgur.co... | <p>Found a solution:</p>
<pre><code>def remove_duplicate_lines(name):
lines_seen = set() # holds lines already seen
outfile = open("NODUP_FILTERED_" + name, 'w', encoding='utf-8')
for line in open("FILTERED_" + name, 'r', encoding='utf-8'):
if line not in lines_seen: # not a du... | How to find the most repeated line from a text and delete it from the whole text | python | -1 | 78 | 5 | 72,967,343 | 72,967,343 | -1 | true | 2022-07-12T09:58:09.460Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to find the most repeated line from a text and delete it from the whole text<p>I'm filtering tweets so I can do a sentiment analysis on them but there ar... |
72,380,756 | keras sequential tensor as argument<p>I am trying to reproduce the image classification problem cat or dog using tensorflow and transfer learning (Xception model pretrained with imagenet). The code is:</p>
<pre><code>base_model = keras.applications.Xception(
weights='imagenet',
# image shape = 128x128x3
inp... | <p>You cannot use <code>tf.keras.applications.xception.preprocess_input()</code> inside the sequential model. You have to define it outside the model and can pass the output of it to the sequential model by assigning values to the tensor argument in the input layer.</p>
<pre><code>x=tf.random.uniform(shape=(1,128,128,3... | keras sequential tensor as argument | python|tensorflow|keras | 0 | 79 | 1 | 72,658,531 | 72,658,531 | 0 | true | 2022-05-25T15:51:42.110Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
keras sequential tensor as argument<p>I am trying to reproduce the image classification problem cat or dog using tensorflow and transfer learning (Xception m... |
72,782,588 | C++ reinitializing variables in a while loop<p>I have a settings menu that can make the window fullscreen. Most of the menu elements are dependent on the window size. By default, all the menu elements are in the same position they were in before the window was resized (meaning they are not in the position I intend). I ... | <p>In short: <code>std::make_unique</code> makes new objects, every time it's called. It <em>cannot</em> reuse the memory of the previous object. What would happen if the constructor of the new object throws an exception? It's only in the assignment to the existing <code>unique_ptr</code> that the old object is discard... | C++ reinitializing variables in a while loop | c++|unique-ptr | 0 | 79 | 1 | 72,783,673 | 72,783,673 | 0 | true | 2022-06-28T07:50:23.227Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C++ reinitializing variables in a while loop<p>I have a settings menu that can make the window fullscreen. Most of the menu elements are dependent on the win... |
72,789,053 | How to set NSSlider value in a NSToolbar - Swift Cocoa + Storyboard<p>I am quite new to Swift programming and I am trying to set a slider min, max and value in a NSToolbar. As an hypothetical exemple, I have a list of client and I want to use the slider in the toolbar to select a client data page. I will firt to loa... | <p>Thanks for the proposed solutions. It certainly put me in the wrigth direction.</p>
<p>Here is what I did. In the WindowController , I set a toolbar with 1) button «previous», 2) button «next» and 3) a slider «slider».</p>
<p>Those are linked to the proper IBOutler and IBaction in the WindowController.
The view... | How to set NSSlider value in a NSToolbar - Swift Cocoa + Storyboard | swift|cocoa|storyboard|nstoolbar|nsslider | 0 | 79 | 3 | 72,833,883 | 72,833,883 | 0 | true | 2022-06-28T15:13:42.173Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to set NSSlider value in a NSToolbar - Swift Cocoa + Storyboard<p>I am quite new to Swift programming and I am trying to set a slider min, max and value ... |
72,836,368 | Puppeteer not able to fetch data for some reason<p>I have created a react app that gives the following output as HTML:</p>
<pre class="lang-html prettyprint-override"><code>import './App.css';
import Home from './Home';
function App() {
return (
<div className="Apps">
<strong>"roo... | <p>The correct answer was given to me by @ggorlen, it should be like this:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const puppeteer = require("puppeteer")
const fs = req... | Puppeteer not able to fetch data for some reason | javascript|node.js|reactjs|puppeteer | 3 | 79 | 1 | 72,837,051 | 72,837,051 | 0 | true | 2022-07-02T04:06:22.797Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Puppeteer not able to fetch data for some reason<p>I have created a react app that gives the following output as HTML:</p>
<pre class="lang-html prettyprint-... |
72,843,578 | How to make sqflite database faster?<p>I am trying to developing an app. In this app I need a local database. I choose sqflite database but it is very slow. It is taking so much time to fetch and insert data. It is my database helper class. As you can see in code that I have lot of rows. I am new at asking question if ... | <p><a href="https://i.stack.imgur.com/Sb4CV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Sb4CV.png" alt="objectbox benchmarks" /></a></p>
<p>Here is the <strong>ObjectBox</strong> vs <strong>Hive</strong> vs<br />
<strong>Sqflite</strong> performance benchmarks.</p>
<p>You can decide which one you... | How to make sqflite database faster? | flutter|dart|sqflite | 0 | 79 | 2 | 72,843,987 | 72,843,987 | 0 | true | 2022-07-03T02:23:40.657Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make sqflite database faster?<p>I am trying to developing an app. In this app I need a local database. I choose sqflite database but it is very slow. ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.