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,846,231 | Aggregation between two derived classes<p>Can there be an aggregation relationship type between two derived classes of one base class (for example, one class contains vector of another)?</p>
<p>Can it be implemented in C++ and if so, is it considered a good practice and does not violate logic or not?</p>
<p>Example in ... | <p>Short answer is yes, and your class diagram shows an example of when you'd do this. Except buttons are actual, "physical" items on screen, and have unique identity, you can't just copy them in a data structure, you would <em>probably</em> use pointers to these buttons, in C++ like this using smart pointer:... | Aggregation between two derived classes | c++|aggregation | 0 | 43 | 1 | 72,848,984 | 72,848,984 | 1 | true | 2022-07-03T11:46:57.303Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Aggregation between two derived classes<p>Can there be an aggregation relationship type between two derived classes of one base class (for example, one class... |
72,990,033 | Type 'JsObject' can't be assigned to type 'BuildContext'<pre><code>onTap: () => Navigator.push(
context,
MaterialPageRoute(
builder: (_) => RestaurantScreen(restaurant: restaurant),
),
),
</code></pre>
<p>Above on the OnTap, when I say context it says the error below. Is there a workaround for this?</p>... | <p>It's highly possible that you've imported by mistake the <code>dart:js</code> module. If so, just remove it:</p>
<pre class="lang-dart prettyprint-override"><code>import 'dart:js'; // <- Remove this import
</code></pre>
<p><a href="https://api.dart.dev/stable/2.17.6/dart-js/context.html" rel="nofollow noreferrer"... | Type 'JsObject' can't be assigned to type 'BuildContext' | flutter|dart | 0 | 43 | 1 | 72,990,216 | 72,990,216 | 1 | true | 2022-07-15T06:49:58.720Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Type 'JsObject' can't be assigned to type 'BuildContext'<pre><code>onTap: () => Navigator.push(
context,
MaterialPageRoute(
builder: (_) => Res... |
72,970,927 | How to change one dataframe column values based on a sibling column values?<p>Let's say I have a dataframe with columns: "Date, Price".</p>
<p>I wish to achieve this:<br />
If the value of the date in the "Date" column of the dataframe falls between April and October, I want to create a new column:<... | <p>First, you need to have your dates in <code>datetime</code> format. If they're not already datetimes, you can convert them with <code>pd.to_datetime</code>.</p>
<pre><code>df = pd.DataFrame({'Date':['17-2-21', '1-4-21', '21-6-21', '15-9-21', '17-2-22'], 'Price': [10.2, 12.5, 7.0, 3.8, 8.8]})
df.Date = pd.to_datetime... | How to change one dataframe column values based on a sibling column values? | python|pandas|datetime | 0 | 43 | 1 | 72,971,347 | 72,971,347 | 1 | true | 2022-07-13T18:21:09.943Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to change one dataframe column values based on a sibling column values?<p>Let's say I have a dataframe with columns: "Date, Price".</p>
<p>I wi... |
72,967,477 | Getting unexpected output while handling double values in mariadb<p>I have to perform certain calculation on a value which is stored as a varchar,First I am converting the value into a double and then trying to multiply the double value with 0</p>
<p>Eg
Query: Select cast('-12345.67' as Double)*0;</p>
<p>Output: -0 (Ne... | <p><a href="https://en.wikipedia.org/wiki/IEEE_754" rel="nofollow noreferrer">IEE754 standard for floating point arithmetic</a> as used by most computers defines signed zero format: +0 and -0.
The notation "−0" may be used informally to denote a negative number that has been rounded to zero.</p>
<p><strong>Ex... | Getting unexpected output while handling double values in mariadb | mariadb | -1 | 43 | 1 | 72,968,978 | 72,968,978 | 1 | true | 2022-07-13T13:50:35.653Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting unexpected output while handling double values in mariadb<p>I have to perform certain calculation on a value which is stored as a varchar,First I am ... |
72,932,109 | How to to write cypress locator for dynamic input field<p><a href="https://i.stack.imgur.com/nZ7H8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nZ7H8.png" alt="enter image description here" /></a></p>
<p>How to write locator for this highlighted input field element when ID and Class attribute are ... | <p>The "Course name" text is a notable feature of that block of HTML. Select it and use traversal commands to get to the <code><input></code></p>
<pre class="lang-js prettyprint-override"><code>cy.contains('span', 'Course name')
.next()
.find('input')
</code></pre>
<p>Alternatively, the placeholder ... | How to to write cypress locator for dynamic input field | cypress|relative-locators | 1 | 43 | 1 | 72,932,141 | 72,932,141 | 1 | true | 2022-07-10T21:46:55.173Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to to write cypress locator for dynamic input field<p><a href="https://i.stack.imgur.com/nZ7H8.png" rel="nofollow noreferrer"><img src="https://i.stack.i... |
72,955,585 | Python Test Case Failed<p>I was trying to solve a simple python code it run successfully but it fails all the test cases. Can anyone help what mistake I'm doing.</p>
<pre><code>def print_full_name(first_name, last_name):
first_name = 'Ross'
last_name = 'Taylor'
print(f'Hello {first_name} {last_name} ! ... | <p>The code you supplied does not contain a test so the question is a little confusing.</p>
<p>If you are asking why your inputs do not end up in the print statement.</p>
<p>The following is the answer:</p>
<p>Your method parameters are overridden inside the method by the following lines, this is referred to as hard co... | Python Test Case Failed | python|python-3.x | -1 | 43 | 1 | 72,962,995 | 72,962,995 | 1 | true | 2022-07-12T16:32:17.900Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python Test Case Failed<p>I was trying to solve a simple python code it run successfully but it fails all the test cases. Can anyone help what mistake I'm do... |
72,783,185 | Entropy calculation gives NaN - is applying na.omit a valid tweak?<p>By definition, the entropy is defined as:</p>
<pre><code>entropy <- function (p) sum(-p * log(p))
</code></pre>
<p>I'm performing LCA using the <strong>poLCA</strong> package and trying to calculate entropy, which for some of my models are outputti... | <p>It is valid, but not transparent at first glance. The reason is that the mathematical limit of <em>xlog(x)</em> as <em>x -> 0</em> is 0 (we can prove this using L'Hospital Rule). In this regard, the most robust definition of the function should be</p>
<pre><code>entropy.safe <- function (p) {
if (any(p > ... | Entropy calculation gives NaN - is applying na.omit a valid tweak? | r|statistics|entropy | 1 | 43 | 1 | 72,783,349 | 72,783,349 | 1 | true | 2022-06-28T08:32:21.013Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Entropy calculation gives NaN - is applying na.omit a valid tweak?<p>By definition, the entropy is defined as:</p>
<pre><code>entropy <- function (p) sum(... |
72,916,503 | How to merge 3 columns into 1 whilst keeping values column separate<p>I have the following Pivot table:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>Subclass</th>
<th>Subclass2</th>
<th>Layer</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<tr>
<td>A</td>
<td>B</td>
<td>C</td>
<td>5</td>
</t... | <p>here is one way to do it</p>
<pre><code>pd.concat([df,
df[['Subclass','Subclass2']].stack().reset_index()[0].to_frame().rename(columns={0:'Layer'})
]
)[['Layer','Amount']].sort_values('Layer')
</code></pre>
<pre><code> Layer Amount
0 A NaN
1 B NaN
0 C 5.0
2 ... | How to merge 3 columns into 1 whilst keeping values column separate | python|pandas|dataframe|melt | -1 | 43 | 2 | 72,916,586 | 72,916,586 | 1 | true | 2022-07-08T20:07:15.060Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to merge 3 columns into 1 whilst keeping values column separate<p>I have the following Pivot table:</p>
<div class="s-table-container">
<table class="s-t... |
72,955,159 | Code to recognize a dynamic string within a string?<p>In my table I have a text column, and I need to check if the 5 characters of the string is specifically an exclamation point followed by 4 (dynamic) numbers - '!XXXX' - example !0422, the 4 numbers are not known, just need to know it there's a ! followed by 4 number... | <p>add column, custom column, with formula as below, replacing [Column1] with the name of your text column</p>
<pre><code>= try if Text.Start([Column1],1)="!" and Number.From(Text.End([Column1],4))>=0 then "YES" else "NO" otherwise "NO"
</code></pre>
<p>if you are not sure it ... | Code to recognize a dynamic string within a string? | powerbi|powerquery|m | 0 | 43 | 1 | 72,955,308 | 72,955,308 | 1 | true | 2022-07-12T15:56:18.837Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Code to recognize a dynamic string within a string?<p>In my table I have a text column, and I need to check if the 5 characters of the string is specifically... |
73,012,467 | Delete Extra Item Decoration within last row empty columns In a Recycler View<p>Im trying to delete the empty column Item decoration as per the below Image. I Initially thought to restrict the spancount for the last row as per the content using below code in comments but however Im not successful.</p>
<p>below is the c... | <p>Within Custom Divider, modifying the bottom padding based on the lastRowCount it is working as expected.</p>
<p>Below is the working code and result also added comments within code for better understanding</p>
<pre><code>fun drawHorizontal(c: Canvas?, parent: RecyclerView) {
val noOfColumns = 10
val top = pa... | Delete Extra Item Decoration within last row empty columns In a Recycler View | android|android-recyclerview|gridlayoutmanager|item-decoration | 0 | 43 | 1 | 73,020,766 | 73,020,766 | 1 | true | 2022-07-17T14:06:40Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Delete Extra Item Decoration within last row empty columns In a Recycler View<p>Im trying to delete the empty column Item decoration as per the below Image. ... |
72,995,330 | How to replace slow 'apply' method in pandas DataFrame<p>I have a DataFrame with currencies transactions:</p>
<pre><code>import pandas as pd
data = [[1653663281618, -583.8686, 'USD'],
[1653741652125, -84.0381, 'USD'],
[1653776860252, -33.8723, 'CHF'],
[1653845294504, -465.4614, 'CHF'],
[165... | <p>You could just use pandas <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.cumsum.html" rel="nofollow noreferrer"><code>cumsum</code></a> here:</p>
<p><strong>EDIT</strong>
After adding a condition:
I don't know how <code>transform</code> performs compared to <code>apply</code>, I'd say just tr... | How to replace slow 'apply' method in pandas DataFrame | python|pandas|apply | 0 | 43 | 1 | 72,995,422 | 72,995,422 | 1 | true | 2022-07-15T14:11:23.280Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to replace slow 'apply' method in pandas DataFrame<p>I have a DataFrame with currencies transactions:</p>
<pre><code>import pandas as pd
data = [[165366... |
72,833,022 | get true file url after user uploads in django<p>here is the problem. in my project user is going to upload an excel file and right after that the app must take it and read it using <code>pandas</code>. file is uploaded in <code>media/projects/%Y/%m/%d/</code>:
<br></p>
<p><code>views.py</code>:<br></p>
<pre><code>if r... | <p>Try this one.
<a href="https://docs.djangoproject.com/en/4.0/ref/models/fields/#django.db.models.FileField.upload_to" rel="nofollow noreferrer">https://docs.djangoproject.com/en/4.0/ref/models/fields/#django.db.models.FileField.upload_to</a></p>
<pre class="lang-py prettyprint-override"><code>from datetime import da... | get true file url after user uploads in django | python|django | 0 | 43 | 1 | 72,833,443 | 72,833,443 | 1 | true | 2022-07-01T17:54:18.217Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
get true file url after user uploads in django<p>here is the problem. in my project user is going to upload an excel file and right after that the app must t... |
72,918,635 | Merging changes to my local repo without overwriting my changes<p>I would just like to seek some help. I've been browsing over stackoverflow and google but somehow cannot find an answer for this. I am collaborating with someone and he is the owner of the remote repo in Github. I forked his repo and then cloned it to my... | <blockquote>
<p>I started doing my own changes on my local repo, but my question is, if he updates a his side of the repo, how do I update my side without my changes being overwritten?</p>
</blockquote>
<p>The sequence of commands would be:</p>
<pre><code>git remote add upstream https://github.com/original/repository
... | Merging changes to my local repo without overwriting my changes | git|github|github-actions|git-pull | 1 | 43 | 2 | 72,918,953 | 72,918,953 | 1 | true | 2022-07-09T03:02:08.020Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Merging changes to my local repo without overwriting my changes<p>I would just like to seek some help. I've been browsing over stackoverflow and google but s... |
73,003,789 | How to automatically assign USER ROLES in Oracle Apex<p>I'm trying to create an authorization scheme that creates users based on a table in my database named <code>DJELATNIK</code> that has attributes <code>name, surename, korisnicko_ime, lozinka</code>. <code>korisnicko_ime</code> is the username for the employee and... | <p>It is not clear from your question if you are using your own roles or the native "Application Access Control".</p>
<p>If you're using "Application Access Control" then there is an <a href="https://docs.oracle.com/en/database/oracle/apex/22.1/aeapi/ADD_USER_ROLE-Procedure-Signature1.html#GUID-9371... | How to automatically assign USER ROLES in Oracle Apex | oracle|oracle-apex | 0 | 43 | 1 | 73,005,300 | 73,005,300 | 1 | true | 2022-07-16T11:25:37.873Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to automatically assign USER ROLES in Oracle Apex<p>I'm trying to create an authorization scheme that creates users based on a table in my database named... |
72,837,948 | Same class within the same element<p>So I'm making a tool to help students learn foreign language. It's basically two columns of text, first in the targeted language, and the other in English. The one I'm currently making is for Greek.</p>
<p>What my goal is that when a word in the first is hovered over it's highlighte... | <p>If you want to highlight exact same classes from one column and in the second then you can use this code:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>function clear() {
... | Same class within the same element | html|jquery|css | 3 | 43 | 1 | 72,838,248 | 72,838,248 | 1 | true | 2022-07-02T09:26:05.803Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Same class within the same element<p>So I'm making a tool to help students learn foreign language. It's basically two columns of text, first in the targeted ... |
72,804,521 | Removing a custom stop words list from a column in a pandas data frame<p>I'm working on analyzing a long list of survey responses. I can remove the stopwords in the standard nltk list perfectly fine. However, I've created a modified list and can't seem to noodle how to incorporate it into the code. The original code I ... | <p>I am not sure if I understand completely, but why can't you use the same line of code but then check for membership in the new set? So:</p>
<pre><code>df['stopwords_removed'] = df['no_punc'].apply(lambda x: [word for word in x if word not in new_stopwords])
</code></pre> | Removing a custom stop words list from a column in a pandas data frame | python|pandas | -1 | 43 | 1 | 72,804,938 | 72,804,938 | 1 | true | 2022-06-29T16:01:38.890Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Removing a custom stop words list from a column in a pandas data frame<p>I'm working on analyzing a long list of survey responses. I can remove the stopwords... |
72,814,104 | I would like to exclude some rows by Eloquent<p>I have a user table that contains a colum "role"
i would like to exclude the ones that contains a certain role by Eloquent
Does any one knows a solution for this ?</p> | <p>To answer your original comment</p>
<pre><code>User::query()->whereNotIn('role', 'blabla')->get();
</code></pre>
<p>To answer the second edit of the comment:</p>
<pre><code>User::query()->whereNotIn('role', [
'Admin', 'responsable', 'magasinier', 'demandeur'
])->get();
</code></pre>
<p>To answer the... | I would like to exclude some rows by Eloquent | php|sql|laravel|eloquent | 0 | 43 | 1 | 72,814,162 | 72,814,162 | 1 | true | 2022-06-30T10:18:49.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I would like to exclude some rows by Eloquent<p>I have a user table that contains a colum "role"
i would like to exclude the ones that contains a c... |
72,832,067 | What is this syntax? myVariable!=null?myVariable:5<p>Hello guys very simple question for you.
I just dont know how to google this, we use this in our framework and i want learn more about it but i dont know what is it. can you please help?This is simplest example.Any lead how can i google it will be good answer for me... | <p>Ternary operator. If <code>myVariable</code> does not equal <code>null</code>, the expression evaluates to <code>myVariable</code>. Otherwise, <code>5</code>*.</p>
<p>Equivalent to:</p>
<pre><code>myVariable == null ? 5 : myVariable
</code></pre>
<p>*Since <code>myVariable</code> is compared to <code>null</code>, th... | What is this syntax? myVariable!=null?myVariable:5 | java | -1 | 43 | 1 | 72,832,090 | 72,832,090 | 1 | true | 2022-07-01T16:15:08.720Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is this syntax? myVariable!=null?myVariable:5<p>Hello guys very simple question for you.
I just dont know how to google this, we use this in our framewo... |
72,901,863 | SQL count replies<p>I feel stupid for asking, but I have a small problem with my SQL.</p>
<p>Lets say, you have a Table with the following columns:</p>
<pre><code>id (= The id of the post)
replyto (= The id of the post this post replies to)
replies (= The count of replies)
</code></pre>
<p>What I want to do, make a SQL... | <p>Table alias (the <code>AS</code> statement) allows you to refer to a table by an alias you give it, thus enabling you to compare values between same table.</p>
<p><strong>Wrong answer:</strong></p>
<pre><code>UPDATE posts AS table1
SET replies = (SELECT COUNT(1) FROM posts AS table2 WHERE table2.replyto = able1.id)
... | SQL count replies | mysql|sql | -1 | 43 | 2 | 72,901,983 | 72,901,983 | 1 | true | 2022-07-07T17:12:24.493Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL count replies<p>I feel stupid for asking, but I have a small problem with my SQL.</p>
<p>Lets say, you have a Table with the following columns:</p>
<pre>... |
72,894,550 | How to catch an out of bounds exception in Java and continue?<p>I am writing a program that converts a prefix expression to a postfix expression. For an expression like " x-x-ABC+BA " the program should throw an out of bounds exception, and the program should continue onto the next line (from the input docume... | <p>You catch the exception outside of your <code>while</code> loop - thus, the loop is long over and doesn't continue when the exception is caught.</p>
<p>Within the catch block, you're repeating the code reading your input, just now there's no more catch and retry, so the second occurrence of an exception will end you... | How to catch an out of bounds exception in Java and continue? | java|arrays|exception | -1 | 43 | 1 | 72,894,732 | 72,894,732 | 1 | true | 2022-07-07T08:25:25.973Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to catch an out of bounds exception in Java and continue?<p>I am writing a program that converts a prefix expression to a postfix expression. For an expr... |
72,843,266 | Radio buttons not reacting to press<p>I feel as if this is something to do with the fact that I have them inside a modal, regardless, I cant seem to figure this out. Both the Radio buttons and the list tiles are visible in the modal but they have no reaction when pressed. I have tried placing the difficulty variable un... | <p>The problem was bottom sheet state was not being update</p>
<pre><code>class Home extends StatelessWidget {
Home({Key? key}) : super(key: key);
String? difficulty;
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
//on press of this button have modal come from bottom with create scr... | Radio buttons not reacting to press | flutter | 1 | 43 | 1 | 72,843,540 | 72,843,540 | 1 | true | 2022-07-03T00:32:29.907Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Radio buttons not reacting to press<p>I feel as if this is something to do with the fact that I have them inside a modal, regardless, I cant seem to figure t... |
72,840,446 | Laravel - Insert Selected Row<p>I have a table :</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>header 1</th>
<th>header 2</th>
<th>button</th>
</tr>
</thead>
<tbody>
<tr>
<td>First</td>
<td>row</td>
<td>insert </td>
</tr>
<tr>
<td>Second</td>
<td>row</td>
<td>insert</td>
</tr>
<tr>
<td>Th... | <p>You are not using an array so all your previous inputs will be replaced by the last one. If you don't have any more fields to send with your request you can solve this by putting your form inside your loop. <code>button</code> tag also accepts a value so you can skip the hidden input field to use less code.</p>
<pre... | Laravel - Insert Selected Row | php|laravel-8 | 1 | 43 | 1 | 72,845,695 | 72,845,695 | 1 | true | 2022-07-02T15:52:59.663Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laravel - Insert Selected Row<p>I have a table :</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>header 1</th>
<th>header 2</th>... |
72,835,114 | In Oracle PLSQL, how to declare IN parameter as NUMBER(9,2)?<p>I want to declare amount parameter as type NUMBER(9,2); How come this Oracle PL/SQL procedure doesn't work?</p>
<pre><code>CREATE OR REPLACE PROCEDURE spupdate_price_by_cat(amount IN NUMBER(9, 2))AS
BEGIN
END;
/
</code></pre>
<p>When I run it, i get error:... | <p>You cannot declare a <code>NUMBER</code> data type with scale and precision in the signature of a PL/SQL function or procedure.</p>
<p>Either use <code>NUMBER</code>:</p>
<pre class="lang-sql prettyprint-override"><code>CREATE OR REPLACE PROCEDURE spupdate_price_by_cat(
amount IN NUMBER
)
AS
BEGIN
NULL;
END;
/
<... | In Oracle PLSQL, how to declare IN parameter as NUMBER(9,2)? | sql|oracle|plsql | 0 | 43 | 1 | 72,835,164 | 72,835,164 | 1 | true | 2022-07-01T22:24:52.990Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In Oracle PLSQL, how to declare IN parameter as NUMBER(9,2)?<p>I want to declare amount parameter as type NUMBER(9,2); How come this Oracle PL/SQL procedure ... |
72,972,959 | How to match `.[domain]` for this regex that i have, rather than the first `.`<p>Given this URL regex</p>
<pre><code>((https?:\/\/?(www\.))?|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)
</code></pre>
<p>How can I properly make it trigger for the following</p>
<pre><code>w... | <p>You just need to remove <code>\b</code> and replace <code>*</code> with <code>+</code>. Also, if you don't want to match <code>www.google</code>, this is what needs to be done:</p>
<ol>
<li><code>^</code> - Matches the beginning of the string.</li>
<li><code>$</code> - Matches the end of the string.</li>
<li><code>(... | How to match `.[domain]` for this regex that i have, rather than the first `.` | regex | 0 | 43 | 2 | 72,973,706 | 72,973,706 | 1 | true | 2022-07-13T21:45:06.153Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to match `.[domain]` for this regex that i have, rather than the first `.`<p>Given this URL regex</p>
<pre><code>((https?:\/\/?(www\.))?|(www\.))[-a-zA-Z... |
73,001,197 | jQuery Circle Progress prevent the animation start from 0 if data updated<p>I'm using jquery-circle-progress plugin.</p>
<p>The code is working perfectly. But now I put 1 button there to update the value of percentage.</p>
<pre><code><button id="add">Add</button>
</code></pre>
<p>As you can see be... | <p>Yes, it is possible. Just change the <code>circleProgress</code> function signature to receive a string and a number.</p>
<pre class="lang-js prettyprint-override"><code>$(".react .bar").circleProgress('value', 0.60);
...
$(".react .bar").circleProgress('value', 0.80);
</code></pre>
<p>Following... | jQuery Circle Progress prevent the animation start from 0 if data updated | javascript|html|jquery|css | 1 | 43 | 1 | 73,001,271 | 73,001,271 | 1 | true | 2022-07-16T02:51:44.550Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
jQuery Circle Progress prevent the animation start from 0 if data updated<p>I'm using jquery-circle-progress plugin.</p>
<p>The code is working perfectly. Bu... |
72,944,261 | How to fire a function on every request in .net core minimal API<p>Just starting out with .net core minimal API and trying to solve all the little issues that will have to work before it's usable in my situation.</p>
<p>This API will be accessible from multiple tenants so I need to check the calling domain on every req... | <p>You can add a piece of middleware in the request pipeline to fetch any details needed for mapped APIs. For example...</p>
<pre><code>var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.Use((context, next) =>
{
// Lets assume the domain info is in the query string
context.Ite... | How to fire a function on every request in .net core minimal API | .net-core|minimal-apis | 1 | 43 | 1 | 72,945,084 | 72,945,084 | 1 | true | 2022-07-11T20:23:38.463Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to fire a function on every request in .net core minimal API<p>Just starting out with .net core minimal API and trying to solve all the little issues tha... |
72,931,465 | calculate average of a column in accordance to another column<p>Say I have this dummy panda's df:</p>
<pre><code> Feature1 Featrue2
0 X 0
1 X 0
2 Y 0
3 Y 1
4 Y 1
5 X 1
6 Y 0
7 X 1
8 ... | <p>You can indeed use <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.groupby.html" rel="nofollow noreferrer"><code>groupby()</code></a>:</p>
<pre class="lang-py prettyprint-override"><code>df2 = df.groupby('Feature1').mean()
</code></pre>
<p>Ouput:</p>
<pre><code> Featrue2... | calculate average of a column in accordance to another column | python|pandas | 2 | 43 | 1 | 72,931,495 | 72,931,495 | 1 | true | 2022-07-10T19:53:25.687Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
calculate average of a column in accordance to another column<p>Say I have this dummy panda's df:</p>
<pre><code> Feature1 Featrue2
0 X ... |
72,996,988 | Typescript: Discriminated union based on type<p>Why is the following not possible for TS ? Why cant I use a type as discriminant ?</p>
<pre><code>export interface A1 {
plop: number;
}
export interface B1 {
hop: number;
}
export interface A {
foo: number;
bar: string;
inner: A1;
}
export interface B {
foo:... | <p>Consider for a moment the expansion of your types. The type <code>AorB</code> represents the union:</p>
<pre><code>{
foo: number;
bar: string;
inner: A1;
} | {
foo: number;
bar: string;
inner: B1;
}
</code></pre>
<p>Noting that nowhere in this does the type <code>A1 | B1</code> appear. This is to say tha... | Typescript: Discriminated union based on type | typescript|types|discriminated-union|union-types | 2 | 43 | 1 | 72,998,076 | 72,998,076 | 1 | true | 2022-07-15T16:22:32.113Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Typescript: Discriminated union based on type<p>Why is the following not possible for TS ? Why cant I use a type as discriminant ?</p>
<pre><code>export inte... |
72,780,177 | Select last values based on rows below in another column in R<p>I've been working on a dataset with rolling subs for a netball game. I'm trying to find the last 5 players to be left on the bench, but there is another column where players swap on. This causes issues as a player could sub off in the last 5 rows then sub ... | <p>A <em>data.table</em> option using an anti-join between <code>sub_off</code> and <code>sub_on</code> where the <code>time</code> is later:</p>
<pre><code>library(data.table)
setDT(df)
df[!df, on=c("sub_off"="sub_on","time<time"), .(bench=sub_off)]
# bench
#1: Amy
#2: Jorja
... | Select last values based on rows below in another column in R | r|dplyr | 2 | 43 | 1 | 72,780,384 | 72,780,384 | 1 | true | 2022-06-28T02:38:55.730Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Select last values based on rows below in another column in R<p>I've been working on a dataset with rolling subs for a netball game. I'm trying to find the l... |
72,916,718 | How to read matrix from an ascii file<p>I am trying to read ascii text file as a matrix. The ascii file has 512 entries which are treated as rows and after each breakline character, a new row starts.
It looks something like <a href="https://i.stack.imgur.com/FtBs0.png" rel="nofollow noreferrer"><img src="https://i.stac... | <p>Your problem here is that when you split a line the last element of the list returned will be a string <code>"\n"</code>, which cannot be converted to int. So Removing it with <code>[:-1]</code> should work:</p>
<pre class="lang-py prettyprint-override"><code>with open('24_5.asc', 'r') as f:
l = [[int(... | How to read matrix from an ascii file | python|arrays|matrix|data-conversion | -1 | 43 | 1 | 72,916,838 | 72,916,838 | 1 | true | 2022-07-08T20:33:28.683Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to read matrix from an ascii file<p>I am trying to read ascii text file as a matrix. The ascii file has 512 entries which are treated as rows and after e... |
72,841,951 | function with array.join -help in javascript<p>so before anything my experience with JavaScript is not that much, I'm trying to make a function called hashtag_it with an array and i want to add # before every index in this array so when I call the function the output is going to be #programming,#code , i tried to use a... | <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 my_array = ['programming','code'];
function hashtag_it() {
return my_array.map(item => `#${item}`).join(',');
}
conso... | function with array.join -help in javascript | javascript|arrays | -1 | 43 | 3 | 72,841,968 | 72,841,968 | 1 | true | 2022-07-02T19:37:03.907Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
function with array.join -help in javascript<p>so before anything my experience with JavaScript is not that much, I'm trying to make a function called hashta... |
72,948,022 | Powershell output information by heading variable from CSV<p>I'm trying to take a csv file with a couple of headings and format it into a nice word document while sorting alphabetically by heading1.</p>
<p>The csv looks like:</p>
<pre><code>heading1,heading2,heading3, - up to heading5
info1,info2....info5
info1,info2..... | <p>Your first attempt was pretty close - I've made a few changes as follows:</p>
<pre><code>$csv = @"
heading1,heading2,heading3,heading4,heading5
info11,info12,info13,info14,info15
info21,info22,info23,info24,info25
info21,info32,info33,info34,info35
info41,info42,info43,info44,info45
"@
$data = $csv | Conv... | Powershell output information by heading variable from CSV | arrays|powershell|csv|foreach | 0 | 43 | 1 | 72,951,969 | 72,951,969 | 1 | true | 2022-07-12T06:41:31.513Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Powershell output information by heading variable from CSV<p>I'm trying to take a csv file with a couple of headings and format it into a nice word document ... |
72,798,254 | Making the keyboard momentarily unresponsive in order to clean an M1 MacBook<p>I have been trying to find a way to clean the keyboard and body of my M1 MacBook Air. I used to just turn off my laptop, use a clean cloth to remove dust and fingerprints, and then turn it on. But this laptop cannot be disturbed at all witho... | <p>You need to setup an event tap for the keyboard. You can tap into a variety of events, for example the key down event. Whenever that event is triggered a callback function is executed which is passed the event data (<code>e</code>). Just return <code>true</code> if you want to block the event. That should disable yo... | Making the keyboard momentarily unresponsive in order to clean an M1 MacBook | apple-m1|hammerspoon | 0 | 43 | 1 | 72,848,542 | 72,848,542 | 1 | true | 2022-06-29T08:34:19.560Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Making the keyboard momentarily unresponsive in order to clean an M1 MacBook<p>I have been trying to find a way to clean the keyboard and body of my M1 MacBo... |
72,781,522 | What is causing the new line character to not work in my program?<p>I am not sure why my new line is not working for <code>printf(operand1, "%s\n");</code> I print test afterwards and its not on a new line.</p>
<pre class="lang-c prettyprint-override"><code>#include <stdio.h>
int main(){
printf("... | <p>First, it should be <code>printf("%s\n",operand1)</code>. What happens in your code is that <code>operand1</code> is treated as format string and since it doesn't have <code>%</code> in it, it is printed as is.</p>
<p>Second, your <code>operand1</code> doesn't have zero byte after the copied chars, so it's... | What is causing the new line character to not work in my program? | arrays|c|string | 0 | 43 | 1 | 72,781,672 | 72,781,672 | 1 | true | 2022-06-28T06:15:07.230Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is causing the new line character to not work in my program?<p>I am not sure why my new line is not working for <code>printf(operand1, "%s\n")... |
72,824,003 | Overload pattern as a storage<p>I am trying to use overload pattern as a storage, but I am having trouble appending a new element.</p>
<p>Is it actually possible?</p>
<p>There is an example - <a href="https://godbolt.org/z/ohvY4sx9q" rel="nofollow noreferrer">https://godbolt.org/z/ohvY4sx9q</a></p>
<p>PS stackoverflow ... | <p><a href="https://godbolt.org/z/bjqnaxMhK" rel="nofollow noreferrer">godbolt</a>
Is this what you want?</p>
<pre><code>#include <iostream>
#include <typeinfo>
template<typename... Ts>
struct Container : Ts...
{
void operator()(auto&&... args)
{
( [&]() {
std::c... | Overload pattern as a storage | c++ | 0 | 43 | 1 | 72,824,136 | 72,824,136 | 1 | true | 2022-07-01T03:08:54.597Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Overload pattern as a storage<p>I am trying to use overload pattern as a storage, but I am having trouble appending a new element.</p>
<p>Is it actually poss... |
72,945,578 | How to limit list printing while taking string input in Python?<p>I have below <code>python</code> code as you can see I am taking names as an input from user and if it matches with the name that is present in names list then code breaks. My current requirement is if user types numbers (ex: 1,2 ) or names (Left,right) ... | <p>The <code>for x in string_text:</code> loops over each name, so multiple names/multiple loops doing testing. What you want is to test that all the names are in <code>names</code> in one test. Here's a way using <code>all</code> and a generator expression:</p>
<pre class="lang-py prettyprint-override"><code>names=[... | How to limit list printing while taking string input in Python? | python|python-3.x|list|validation|user-input | 0 | 43 | 1 | 72,945,628 | 72,945,628 | 1 | true | 2022-07-11T23:25:01.587Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to limit list printing while taking string input in Python?<p>I have below <code>python</code> code as you can see I am taking names as an input from use... |
72,842,544 | ON UPDATE CASCADE does not work in Oracle<p>I am building a database using Oracle SQL Developer. I want to add a foreign key integrity constraint that cascades on update. However, when I run the following query I get an error. There is also a red line below the word UPDATE and when I hover over it, it says "Syntax... | <p>Oracle supports only <code>ON DELETE CASCADE</code>.</p>
<p>As simple as that.</p>
<hr />
<p>If you want to implement it, use a database trigger. Here's an example.</p>
<p>Sample tables first (in master-detail relationship; source are Scott's EMP and DEPT tables):</p>
<pre><code>SQL> create table t_dept as select... | ON UPDATE CASCADE does not work in Oracle | sql|oracle | 0 | 43 | 1 | 72,842,555 | 72,842,555 | 1 | true | 2022-07-02T21:31:05.330Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ON UPDATE CASCADE does not work in Oracle<p>I am building a database using Oracle SQL Developer. I want to add a foreign key integrity constraint that cascad... |
72,851,034 | Map function with array based on integers on 2D numpy array<pre class="lang-py prettyprint-override"><code>>>> a = 0.001 * np.random.randint(0, 1000, size=(5))
>>> a
array([0.524, 0.311, 0.603, 0.957, 0.923])
>>> b = np.random.randint(0, 2, size=(3, 5))
>>> b
array([[1, 1, 1, 0, 1],... | <p>There are a couple of ways of doing this. I would probably use the <code>where</code> and <code>out</code> arguments to <code>np.subtract</code>:</p>
<pre><code>np.subtract(np.ones(len(b)), a, out=np.broadcast_to(a, b.shape).copy(), where=b.astype(bool))
</code></pre>
<p>Going with @hpaulj's solution to use the 3-ar... | Map function with array based on integers on 2D numpy array | python|numpy | 1 | 43 | 1 | 72,851,069 | 72,851,069 | 1 | true | 2022-07-04T01:46:08.160Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Map function with array based on integers on 2D numpy array<pre class="lang-py prettyprint-override"><code>>>> a = 0.001 * np.random.randint(0, 1000... |
72,395,046 | Replacing certain parts of a list in Python<p>I have a list of columns that represents months for different metrics. It was imported from a CSV. There are two issues: (1) The months start with '22-' and (2) some months end with .1 , .2 etc.</p>
<p>Here is the list:</p>
<pre><code>months = ['22-Apr', '22-May', '22-Apr.1... | <p>Among others, you could <code>split</code> by <code>'-'</code> and get the second part, then by <code>'.'</code> and get the first part. The latter will work even if there is no <code>'.'</code> in the string.</p>
<pre><code>>>> months = ['22-Apr', '22-May', '22-Apr.1', '22-Apr.2']
>>> [s.split(&qu... | Replacing certain parts of a list in Python | python | 0 | 43 | 1 | 72,395,078 | 72,395,078 | 1 | true | 2022-05-26T16:26:53.180Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Replacing certain parts of a list in Python<p>I have a list of columns that represents months for different metrics. It was imported from a CSV. There are tw... |
72,395,467 | Jest testing a loop with Booleans<p>I have the following function in Jest. I have a method called isAquatic that returns a bool depending on the animal.</p>
<pre><code> const nonAquaticAnimal = ["tiger", "cat", "lion"]
test.each(nonAquaticAnimal)(
'.isAquatic',
... | <p>The array argument passed to <a href="https://jestjs.io/docs/api#testeachtablename-fn-timeout" rel="nofollow noreferrer">test.each</a> is usually a 2D array, so you can have the animal and the expected result for that animal in the <code>nonAquaticAnimals</code> array. And the test function would both the items in a... | Jest testing a loop with Booleans | javascript|arrays|reactjs|jestjs | -1 | 43 | 1 | 72,395,854 | 72,395,854 | 1 | true | 2022-05-26T17:00:36.963Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Jest testing a loop with Booleans<p>I have the following function in Jest. I have a method called isAquatic that returns a bool depending on the animal.</p>
... |
72,396,480 | How to mock parameter provided as input to anonymous Func delegate via lambda expression?<p>I have this code for which I'm trying to write a unit test:</p>
<pre><code>public static void AddRuntimeServices(this IServiceCollection services)
{
services.AddScoped<IAppClient>((serviceProvider) =>
{
... | <p>Use an actual service collection. and add the mocked services so that when it resolves them you have control of the desired behavior</p>
<pre><code>//...
//Arrange
IServiceCollection services = new ServiceCollection();
ISnapshotService snapshotService = Mock.Of<ISnapshotService>();
IUrlContext urlContext = ... | How to mock parameter provided as input to anonymous Func delegate via lambda expression? | c#|unit-testing|mocking|mstest | 1 | 43 | 1 | 72,396,877 | 72,396,877 | 1 | true | 2022-05-26T18:32:02.923Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to mock parameter provided as input to anonymous Func delegate via lambda expression?<p>I have this code for which I'm trying to write a unit test:</p>
<... |
72,396,970 | Filling NAs to string 0 and then to int reverts to float<p>What I want here is for the Nans to ultimately be integer values. Since my dataset is 1000s of columns, I can't just change a couple of columns to make them integer and when I tried <code>df = df.astype('int')</code> in Dask, after changing the values to 0 floa... | <p>IIUC:</p>
<pre><code>from dask.dataframe import from_pandas
ddf = from_pandas(df, npartitions=2)
out = ddf.select_dtypes('number').fillna(0).astype('int64')
</code></pre>
<p>Output:</p>
<pre><code>>>> out.compute()
Age salary
0 10 15000
1 15 0
2 0 20000
</code></pre> | Filling NAs to string 0 and then to int reverts to float | python|pandas|dask|nan | 1 | 43 | 1 | 72,397,107 | 72,397,107 | 1 | true | 2022-05-26T19:20:57.780Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Filling NAs to string 0 and then to int reverts to float<p>What I want here is for the Nans to ultimately be integer values. Since my dataset is 1000s of col... |
72,382,520 | We modified SSIS package directly in MSDB.dbo.sysssisPackages but old version still runs<p>We modified an SSIS package's script directly via the following:</p>
<blockquote>
<p>UPDATETEXT MSDB.dbo.sysssisPackages.Packagedata @ptrval @SearchTextOffset @SearchTextLen @NewText;</p>
</blockquote>
<p>The modification was to ... | <p>My recollection is that it SSIS stored the .NET script itself <em>and</em> the compiled binary. You might try opening the package you exported in Visual Studio, editing the Script Task and hitting the recompile button, save, save and deploy to the MSDB (via dtutil.exe)</p>
<p>The next challenge encountered was</p>
<... | We modified SSIS package directly in MSDB.dbo.sysssisPackages but old version still runs | sql-server|ssis | 2 | 43 | 1 | 72,397,544 | 72,397,544 | 1 | true | 2022-05-25T18:21:49.900Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
We modified SSIS package directly in MSDB.dbo.sysssisPackages but old version still runs<p>We modified an SSIS package's script directly via the following:</... |
72,398,549 | glob: Match files with multi-dotted extension but exclude some depending on sub part in extension<p>I have a folder with tsx files and test tsx files structured as shown</p>
<pre><code>packages
packageName
src
index.tsx
sample.tsx
sample.test.tsx
tests
index.test.tsx
</code></pre>
... | <p>Try</p>
<pre><code>shopt -s globstar extglob
printf '%s\n' packages/**/!(*.test).@(tsx|ts)
</code></pre>
<p>See the <a href="https://mywiki.wooledge.org/glob#extglob" rel="nofollow noreferrer">extglob</a> section in <a href="https://mywiki.wooledge.org/glob" rel="nofollow noreferrer">glob - Greg's Wiki</a>.</p> | glob: Match files with multi-dotted extension but exclude some depending on sub part in extension | bash|grep|glob | 0 | 43 | 1 | 72,399,137 | 72,399,137 | 1 | true | 2022-05-26T22:16:21.147Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
glob: Match files with multi-dotted extension but exclude some depending on sub part in extension<p>I have a folder with tsx files and test tsx files structu... |
72,400,959 | WebSockets streaming third party API to multiple subclients<p>We have a data-driven application where our backend continuously fetches data from a third party server and then feeds it over websocket to our clients frontend. Now the issue is that whenever each client will come the same data has to be fetched twice for b... | <p>If you want to send the data from the API it to two clients who are not both connected at the time the data is fetched then you'll need to cache the data somewhere</p>
<p>For example a Redis cache (or similar technology) is one option if you don't want to use a database or other persistent storage.</p> | WebSockets streaming third party API to multiple subclients | javascript|php|api|websocket|data-driven | 0 | 43 | 1 | 72,402,325 | 72,402,325 | 1 | true | 2022-05-27T05:46:00.297Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
WebSockets streaming third party API to multiple subclients<p>We have a data-driven application where our backend continuously fetches data from a third part... |
72,392,744 | can I block mappings changes via API in WireMock standalone?<p>TLDR: Is there a way to disable whole or part of the Stub Mappings API (i.e. disable POST/PUT/DELETE to '/__admin/mappings')? Let's assume I want to do it on Wiremock instance level, not a proxy server level.</p>
<p>In my company we use the WireMock server ... | <p>You could achieve this by implementing a filter extension. Specifically you'd probably want to extend <code>AdminRequestFilter</code> and use it to apply rules about which methods/URLs you want to allow.</p>
<p>Here's an example implementation of a filter of this kind:
<a href="https://github.com/wiremock/wiremock/b... | can I block mappings changes via API in WireMock standalone? | testing|mocking|integration-testing|wiremock|wiremock-standalone | 1 | 43 | 1 | 72,403,427 | 72,403,427 | 1 | true | 2022-05-26T13:37:49.330Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
can I block mappings changes via API in WireMock standalone?<p>TLDR: Is there a way to disable whole or part of the Stub Mappings API (i.e. disable POST/PUT/... |
72,343,775 | Using join to find similarities between two datasets containing strings in PySpark<p>I'm trying to match text records in two datasets, mostly via using PySpark (not using libraries such as BM25 or NLP techniques as much as I can for now -using Spark ML and SparkNLP libraries are fine).</p>
<p>I'm towards finishing the ... | <p>The reason is when you display full_similarity_df you will see 2 fullText and biGrams columns like below</p>
<pre><code>+------+-----------+-------+------+--------+-------+
|int_id| fulltext|bigrams|ext_id|fulltext|bigrams|
+------+-----------+-------+------+--------+-------+
| 1|abc def fhg|abc def| 1| ab... | Using join to find similarities between two datasets containing strings in PySpark | python|apache-spark|join|pyspark | 0 | 43 | 1 | 72,444,477 | 72,444,477 | 1 | true | 2022-05-23T05:51:25.927Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using join to find similarities between two datasets containing strings in PySpark<p>I'm trying to match text records in two datasets, mostly via using PySpa... |
72,305,478 | Django test unit logged in user<p>I need some unit tests to check if a user after successful login can open profile editing page, how am I supposed to do this?</p>
<p>I tried this code, but it shows an error. Do I have to use my own view to register a user then to log in or there are some unit test modules for that?</p... | <p>The client API allows you to login a user like so:</p>
<pre class="lang-py prettyprint-override"><code>self.client.force_login(user)
</code></pre>
<p>Just run that before accessing the profile page in your test.</p>
<p>There also is an error in your code.</p>
<pre class="lang-py prettyprint-override"><code>...
self.... | Django test unit logged in user | django|authentication|testing | 1 | 43 | 1 | 72,305,541 | 72,305,541 | 1 | true | 2022-05-19T13:31:02.677Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Django test unit logged in user<p>I need some unit tests to check if a user after successful login can open profile editing page, how am I supposed to do thi... |
72,280,378 | Selectfield not showing options<p>I have a field in my modelform where the user can choose the mealtype. But the form input does not work, when I click it, nothing happens. What I want to happen is to display a dropdown with the different meal types.</p>
<p>The model looks like this</p>
<pre><code>class Recipe(models.M... | <p>Try using square brackets [for, a, list] rather than curly braces {"which":denotes, "a": dictionary), eg,</p>
<pre><code>meal_type = [
('Breakfast', 'Breakfast'),
('Lunch', 'Lunch'),
('Dinner', 'Dinner')
]
</code></pre>
<p>You also have widget defined as you would for a forms.form, no... | Selectfield not showing options | django|django-models|django-forms | 0 | 43 | 1 | 72,281,944 | 72,281,944 | 1 | true | 2022-05-17T20:34:24.603Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Selectfield not showing options<p>I have a field in my modelform where the user can choose the mealtype. But the form input does not work, when I click it, n... |
72,258,717 | input type="radio" - only choose second option?<p>I have an issue with my radio input.
It lets me change to the second option if im clicking on the label but it doesnt work for the first option. I can only choose the first option if im clicking on the selection-circle but i dont want to display it. It should work with ... | <p>Your first label's for (strang1u2) and input's id (strang1u3) don't match. This may be causing this as the label isn't associated with the input.</p> | input type="radio" - only choose second option? | html|css|forms|radio-button | 0 | 43 | 1 | 72,258,757 | 72,258,757 | 1 | true | 2022-05-16T11:47:27.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
input type="radio" - only choose second option?<p>I have an issue with my radio input.
It lets me change to the second option if im clicking on the label but... |
72,293,915 | How to push new column into array using setState<p>I am using an external library to build a Taskboard and what I want to achieve is to add a new column when clicking and add column button. I am struggling with adding the column, I have the newly created column but it doesn't get added to the array. What am I doing wro... | <p>Your main issue is the way you update your state. This is what you have:</p>
<pre class="lang-js prettyprint-override"><code>this.setState({
columsData: newColumn,
});
</code></pre>
<p>This piece of code will set the state to <code>columsData: newColumn</code>, which is wrong for a few reasons:</p>
<ul>
<l... | How to push new column into array using setState | javascript|reactjs | 1 | 43 | 3 | 72,294,105 | 72,294,105 | 1 | true | 2022-05-18T17:58:24.157Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to push new column into array using setState<p>I am using an external library to build a Taskboard and what I want to achieve is to add a new column when... |
72,373,281 | Javascript: Get all dates between from and to dates<p>I am using the following in a ReactJS app:</p>
<pre><code>var getDaysArray = function(s, e) {
for (var a = [], d = new Date(s); d <= e; d.setDate(d.getDate() + 1)) {
a.push(new Date(d));
}
return a;
};
const abc = new Date(item.DateTo.toDate()).toISOSt... | <p>The problem here came from the fact you were transforming your dates into
<code>String</code> using the following command : <code>new Date(item.DateTo.toDate()).toISOString().substring(0, 10);</code></p>
<p>Then you were comparing a string and a date object in your for loop with <code>d <= e</code></p>
<p>To work... | Javascript: Get all dates between from and to dates | javascript | -1 | 43 | 1 | 72,373,424 | 72,373,424 | 1 | true | 2022-05-25T07:09:40.683Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Javascript: Get all dates between from and to dates<p>I am using the following in a ReactJS app:</p>
<pre><code>var getDaysArray = function(s, e) {
for (va... |
72,304,568 | how to convert json response to excel using python<p>this reponse I am getting:</p>
<pre><code> {
"value": [
{
"id": "/providers/Microsoft.Billing/Departments/1234/providers/Microsoft.Billing/billingPeriods/201903/providers/Microsoft.Consumption/usageDetails/usageDeta... | <p>I tried your code and stored json file into an output first:</p>
<p><a href="https://i.stack.imgur.com/SYvMr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/SYvMr.png" alt="output" /></a></p>
<p>-TAGS is a dictionary you access it without any keys so it will be <code>NONE</code></p>
<p>If not com... | how to convert json response to excel using python | python | 0 | 43 | 1 | 72,306,153 | 72,306,153 | 1 | true | 2022-05-19T12:29:37.663Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to convert json response to excel using python<p>this reponse I am getting:</p>
<pre><code> {
"value": [
{
"id&... |
72,310,807 | converting XMLHTTPRequest To jquery ajax<p>I try lots of ways to convert my XMLHTTPRequest into jQuery ajax but I couldn't be successful.</p>
<p>I would be really appreciate if anyone could help me solve this issue.</p>
<p>here is my XMLHttpRequest Code:</p>
<pre><code> var url = url;
var xhr = new XMLHttpReques... | <p>Try this</p>
<pre><code>$.ajax({
url: "<?php echo $this->ui_url('onlineexamcats', 'all'); ?>",
data: "ajax=1",
type: "POST",
processData: false,
success: function(res) { console.log(res); }
});
</code></pre> | converting XMLHTTPRequest To jquery ajax | javascript|jquery|ajax|xmlhttprequest | 0 | 43 | 1 | 72,310,901 | 72,310,901 | 1 | true | 2022-05-19T20:37:17.917Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
converting XMLHTTPRequest To jquery ajax<p>I try lots of ways to convert my XMLHTTPRequest into jQuery ajax but I couldn't be successful.</p>
<p>I would be r... |
72,340,127 | How to append to the value of a given key in a json column?<p>I have <code>user_product_mapping</code> storing product per user:</p>
<pre><code>DROP TABLE IF EXISTS user_product_mapping;
CREATE TABLE user_product_mapping
(
id SERIAL NOT NULL PRIMARY KEY,
user_id INT,
product_info json NOT NULL,
CONSTRA... | <pre class="lang-sql prettyprint-override"><code>UPDATE user_product_mapping
SET product_info = json_build_object('product', concat_ws(',', NULLIF(product_info->>'product', ''), 'laptop'))
WHERE user_id = 2;
</code></pre>
<p>Even works properly with a missing 'product' key, one with a null value, or an empty ... | How to append to the value of a given key in a json column? | sql|json|postgresql | 0 | 43 | 1 | 72,343,144 | 72,343,144 | 1 | true | 2022-05-22T18:05:49.523Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to append to the value of a given key in a json column?<p>I have <code>user_product_mapping</code> storing product per user:</p>
<pre><code>DROP TABLE IF... |
72,333,034 | How to apply filters together?<p>I have markers on a Google Map with dropdown filters, and these filters work perfectly well individually. However, I want the filter to consider all three drop-down lists at once.</p>
<p>Here is my code: <a href="https://jsfiddle.net/h4cv57tb/" rel="nofollow noreferrer">https://jsfiddle... | <p>Make sure you look at where there is duplicate code and simply combine areas that are different, if feasible. To combine these functions into a single one just combine the if conditions together.</p>
<pre><code>filterMarkers = function(category = null, eres = null, hely_tipus = null) {
for (i = 0; i < gmarker... | How to apply filters together? | javascript|drop-down-menu|google-maps-markers | 0 | 43 | 1 | 72,333,296 | 72,333,296 | 1 | true | 2022-05-21T20:32:34.677Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to apply filters together?<p>I have markers on a Google Map with dropdown filters, and these filters work perfectly well individually. However, I want th... |
72,389,637 | Google Sheet: Fetch earliest date and average of value of month from the list<p>Below is the data:</p>
<pre><code>02/06/2000 15:30:00 5.12
05/06/2000 15:30:00 5.2
06/06/2000 15:30:00 5.28
07/06/2000 15:30:00 5.26
08/06/2000 15:30:00 5.33
09/06/2000 15:30:00 5.36
12/06/2000 15:30:00 5.24
13/06/2000 15:30:00 5.33
14/06/2... | <p>try:</p>
<pre><code>=ARRAYFORMULA(QUERY(QUERY(
{TEXT(GOOGLEFINANCE("NASDAQ:GOOG", "price", DATE(2020,1,1), TODAY(), "DAILY"), "mm/e"),
TEXT(GOOGLEFINANCE("NASDAQ:GOOG", "price", DATE(2020,1,1), TODAY(), "DAILY"), {"e-m-1", "#.#0&... | Google Sheet: Fetch earliest date and average of value of month from the list | google-sheets|google-sheets-formula|average|number-formatting|google-query-language | 1 | 43 | 2 | 72,391,192 | 72,391,192 | 1 | true | 2022-05-26T09:28:30.180Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google Sheet: Fetch earliest date and average of value of month from the list<p>Below is the data:</p>
<pre><code>02/06/2000 15:30:00 5.12
05/06/2000 15:30:0... |
72,291,519 | How to keep the values with most frequent prefix in a groupby pandas dataframe?<p>Let's say I have this dataframe :</p>
<pre><code> Country Market
0 Spain m1_name
1 Spain m1_location
2 Spain m1_size
3 Spain m2_location
4 USA m1_name
5 USA m2_name
6 USA m3_size
7 USA m3_locatio... | <p>You can try groupby and apply to filter group rows</p>
<pre class="lang-py prettyprint-override"><code>out = (df.assign(prefix=df['City'].str.split('_').str[0])
.groupby('Country')
.apply(lambda g: g[g['prefix'].isin(g['prefix'].mode())])
.reset_index(drop=True)
.drop('prefix',axis=1))
</... | How to keep the values with most frequent prefix in a groupby pandas dataframe? | python|pandas|dataframe | 0 | 43 | 3 | 72,291,721 | 72,291,721 | 1 | true | 2022-05-18T14:57:10.370Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to keep the values with most frequent prefix in a groupby pandas dataframe?<p>Let's say I have this dataframe :</p>
<pre><code> Country Market
0 Spa... |
72,339,480 | Trying to update code to return HTML value in Selenium (Python)<p>I am using Selenium to crawl some Facebook group information:</p>
<pre><code> with open("groups.txt") as file:
lines = file.readlines()
total = len(lines)
count = 1
for line in lines:
group_id = line.strip().spli... | <p>NEW</p>
<p>This code extract the exact number of members and convert it from string to integer</p>
<pre><code>driver.get('https://www.facebook.com/groups/410943193806268/about')
members = driver.find_element(By.XPATH, "//span[contains(text(), 'total members')]").text
members = int(''.join(i for i in member... | Trying to update code to return HTML value in Selenium (Python) | python|html|selenium | 2 | 43 | 1 | 72,341,876 | 72,341,876 | 1 | true | 2022-05-22T16:40:36.280Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Trying to update code to return HTML value in Selenium (Python)<p>I am using Selenium to crawl some Facebook group information:</p>
<pre><code> with open(... |
72,315,680 | Want another way shortcode about sqlcode<p>please, i want find another way</p>
<p><strong>example data</strong></p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th style="text-align: center;">date</th>
<th style="text-align: center;">tomato</th>
<th style="text-align: center;">phone</th>
<th st... | <p>So just group the result</p>
<pre><code>select date,
sum(tomato),
sum(phone),
sum(book),
sum(pen)
from copy
where date = '2022-05-15'
GROUP BY date
</code></pre> | Want another way shortcode about sqlcode | mysql|sql|shortcode|short | 1 | 43 | 1 | 72,315,861 | 72,315,861 | 1 | true | 2022-05-20T08:18:48.810Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Want another way shortcode about sqlcode<p>please, i want find another way</p>
<p><strong>example data</strong></p>
<div class="s-table-container">
<table cl... |
72,399,996 | Get the value of specific fields in an array based on a condition<p>I have an array below.
For each <code>"_id"</code> in each object element in this array, there is an array called <code>"form"</code>.</p>
<p>What I would like to get is the <code>answerValue</code> for each <code>_id</code>, where ... | <p>This one I like because you filter before you map. If you had a large array this might give you better performance:</p>
<pre><code>let arr = array.filter(x => x.form.every(y => y.field === "cState"));
const data = arr.map((x) => ({ user: x.user, id: x._id,
answer:x.form[0].answerValue }... | Get the value of specific fields in an array based on a condition | javascript|arrays | 1 | 43 | 2 | 72,400,430 | 72,400,430 | 1 | true | 2022-05-27T03:00:23.760Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get the value of specific fields in an array based on a condition<p>I have an array below.
For each <code>"_id"</code> in each object element in th... |
72,323,913 | I have a JSON table, how can I create a sql table with this information in PLSQL?<p>I'm working with PLSQL and I have this JSON table (first variable),
How can I insert this data into a sql table, i have already try this, but i have SQL statement ignored error:</p>
<pre><code>CREATE TABLE Prueba_ins_json (
user... | <p>Just need to provide <code>PATH</code>(<em>preferably along with data types</em>) clause such as</p>
<pre><code>INSERT INTO Prueba_ins_json
SELECT *
FROM JSON_TABLE(json_prueba,
'$[*]' COLUMNS(
userId INT PATH '$.userId',
... | I have a JSON table, how can I create a sql table with this information in PLSQL? | json|oracle|plsql|oracle11g | 1 | 43 | 1 | 72,324,094 | 72,324,094 | 1 | true | 2022-05-20T19:23:00.877Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I have a JSON table, how can I create a sql table with this information in PLSQL?<p>I'm working with PLSQL and I have this JSON table (first variable),
How c... |
72,275,439 | When Current column and Previous column > 0, then do this<pre><code>mysql> select * from table;
+------+------+------+-------+
| id | cnta | cntb | cntc |
+------+-------------+-------+
4 0 1 2
3 2 3 0
2 1 0 1
1 3 2 2
</code></pre>
<p>... | <p>If your last row of the result is not to be empty, try this:</p>
<pre><code>SELECT
t1.id,
(
CASE WHEN t1.cnta>0 AND t2.cnta>0 THEN t1.cnta ELSE 0 END
+
CASE WHEN t1.cntb>0 AND t2.cntb>0 THEN t1.cntb ELSE 0 END
+
CASE WHEN t1.cntc>0 AND t2.cntc>0 THEN t1.cntc ELSE 0 END
) AS cValue
FROM
... | When Current column and Previous column > 0, then do this | mysql | 0 | 43 | 2 | 72,277,539 | 72,277,539 | 1 | true | 2022-05-17T14:02:21.323Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
When Current column and Previous column > 0, then do this<pre><code>mysql> select * from table;
+------+------+------+-------+
| id | cnta | cntb | cnt... |
72,390,484 | Get array size for GROUP_CONCAT() - MySQL<p>I am running a query where I used <code>GROUP_CONCAT()</code> and now I want to know the length of this array. I used <code>LENGTH()</code>, however, this shows the number of characters in the row. Should I even use <code>GROUP_CONCAT()</code> in the first place?</p>
<p>The r... | <p>I think what you are trying to achieve is counting the number of occurrence of ','+1:
Use</p>
<pre><code>ROUND (
(
LENGTH(concated)-LENGTH(REPLACE(concated, ",", "")))/LENGTH(",")+1
) AS COUNT
</code></pre>
<p>Replace concated to your GROUP_CONCAT</p> | Get array size for GROUP_CONCAT() - MySQL | mysql|sql|arrays | 0 | 43 | 2 | 72,390,762 | 72,390,762 | 1 | true | 2022-05-26T10:39:22.670Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get array size for GROUP_CONCAT() - MySQL<p>I am running a query where I used <code>GROUP_CONCAT()</code> and now I want to know the length of this array. I ... |
72,271,307 | Is there a way to iterate over values of a column then check if it's present elsewhere?<p>I have generated 2 .csv files, one containing the original md5sums of some files in a directory and one containing the md5sums calculated at a specific moment.</p>
<pre><code>md5_original.csv
----------
$1 ... | <p>I would use GNU <code>AWK</code> for this task following way, let <code>md5_original.csv</code> content be</p>
<pre><code>7815696ecbf1c96e6894b779456d330e {BLANK_COLUMN} s1.txt
912ec803b2ce49e4a541068d495ab570 {BLANK_COLUMN} s2.txt
040b7cf4a55014e185813e0644502ea9 {BLANK_COLUMN} s64.txt
8a0b67188083b924d48ea72cb187b... | Is there a way to iterate over values of a column then check if it's present elsewhere? | shell|csv|awk|sed|sh | -2 | 43 | 1 | 72,272,146 | 72,272,146 | 1 | true | 2022-05-17T09:14:33.887Z | 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 iterate over values of a column then check if it's present elsewhere?<p>I have generated 2 .csv files, one containing the original md5sums ... |
72,309,642 | Redirect based on the ?id= parameter in the url<p>I have a login system that I build in PHP and MySQL.
if any of my users log in they get directed to the user.php page</p>
<p>I have an authenticate.php page that redirects the user based on their ID to a page. This is the code that adds the id to the URL: <strong>header... | <p>Hi you can do the following:</p>
<pre><code>//function redirect to page
function redirect(){
var id= <?php echo $_GET['id'];?>;
if(id==1){
window.location.href = "url1";
}
if(id==2){
window.location.href = "url2";
}
}
redirect();
</code></pre> | Redirect based on the ?id= parameter in the url | javascript|php|mysql|parameters | 1 | 43 | 1 | 72,310,100 | 72,310,100 | 1 | true | 2022-05-19T18:44:18.053Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Redirect based on the ?id= parameter in the url<p>I have a login system that I build in PHP and MySQL.
if any of my users log in they get directed to the use... |
72,319,446 | Java Home not set<p>I downloaded gradle and in the instruction it told me to add it to system variables so i did but i accidentally removed one of the paths. So when i tried to see what version of gradle i use it was saying error java home is not set(you can see in the image in the mingv terminal). My question is how c... | <p>Your screenshot presents list of <code>PATH</code> variable values. Close this dialog.</p>
<p>On the parent dialog window, add new variable, name it <code>JAVA_HOME</code>.</p>
<p>Put the following value to it: <code>C:\Program Files\jdk-18.0.1</code></p>
<p>Click OK to accept your changes</p>
<p><a href="https://i.... | Java Home not set | java|gradle|system-properties | 1 | 43 | 2 | 72,319,481 | 72,319,481 | 1 | true | 2022-05-20T13:07:42.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java Home not set<p>I downloaded gradle and in the instruction it told me to add it to system variables so i did but i accidentally removed one of the paths.... |
72,265,233 | How to find a DataTemplate control from inside the Click event<p>I have a <code>GridView</code> with a <code>ColumnHeaderTemplate</code></p>
<p>The template contains a path with the name <code>arrow</code>:</p>
<pre><code><DataTemplate x:Key="HeaderTemplate">
<DockPanel>
<Path DockPanel.D... | <p>No, the <a href="https://docs.microsoft.com/en-us/dotnet/api/system.windows.frameworktemplate.findname?view=windowsdesktop-6.0" rel="nofollow noreferrer"><code>FindName</code></a> method you mean would apply to <code>ControlTemplate</code>, not <code>DataTemplate</code>.</p>
<ul>
<li><a href="https://docs.microsoft.... | How to find a DataTemplate control from inside the Click event | c#|wpf|xaml|gridview|datatemplate | 0 | 43 | 1 | 72,270,716 | 72,270,716 | 1 | true | 2022-05-16T20:26:49.127Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to find a DataTemplate control from inside the Click event<p>I have a <code>GridView</code> with a <code>ColumnHeaderTemplate</code></p>
<p>The template ... |
72,302,806 | How to find the amount of objects that user have in particular date?<p>I am learning mongo and I am trying to provide two metrics for given user in given time range. Precisely I need to calculate this kind of array of objects that represents state of the backpack for the particular day:</p>
<pre><code>{
data: [
... | <p>I do not believe what you wish to do, which is create a cross-backpack position by day, is <em>fully</em> served by a mongodb pipeline. The reason is that you need to track state day over day so that when, say, 3 days from now a <code>backpack.deleted</code> event occurs, you know how much to delete from the runnin... | How to find the amount of objects that user have in particular date? | mongodb | 0 | 43 | 1 | 72,310,065 | 72,310,065 | 1 | true | 2022-05-19T10:18:34.247Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to find the amount of objects that user have in particular date?<p>I am learning mongo and I am trying to provide two metrics for given user in given tim... |
72,267,914 | How to setText of 2d array of JTextFIelds using actionlistener?<p>My assignment is to create 2 JPanels, one for a 2d array, 6 rows of 5 empty JTextFields and another for JButtons that should somewhat resemble an on-screen keyboard. I created the JPanels with the empty JTextFields and JButtons, now I need a way so that ... | <p>This line <code>if(e.getSource().equals("A"))</code> is your first issue. It simply will not work because <code>e.getSource()</code> returns an object that will never equal <code>"A"</code>.</p>
<p>Instead, you need to first cast the source to the correct object type like so:</p>
<pre><code>publi... | How to setText of 2d array of JTextFIelds using actionlistener? | java|swing | 1 | 43 | 1 | 72,268,112 | 72,268,112 | 1 | true | 2022-05-17T03:35:17.233Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to setText of 2d array of JTextFIelds using actionlistener?<p>My assignment is to create 2 JPanels, one for a 2d array, 6 rows of 5 empty JTextFields and... |
72,239,997 | How can I create a two dimensional array with each element being a list in Java?<p>I want to create a two-dimensional array, each element of which is a list, as in the image.
I tried <code>ArrayList<List<User>>[][] arrayList = new ArrayList[3][3];</code></p>
<p>Is this a correct solution? Because when I try... | <p>This compiles and runs for me. Note I changed your definition of "arrayList" to match your diagram better. I think this is what you want. However it's simple to extend if you need something different.</p>
<pre><code>public class ArrayOfList {
public static void main( String[] args ) {
ArrayLis... | How can I create a two dimensional array with each element being a list in Java? | java|arrays|list|multidimensional-array|arraylist | 0 | 43 | 1 | 72,240,124 | 72,240,124 | 1 | true | 2022-05-14T12:01:25.677Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I create a two dimensional array with each element being a list in Java?<p>I want to create a two-dimensional array, each element of which is a list,... |
72,326,073 | Python program runs but finishes with exit code 0<p>I'm trying to learn Python by following <a href="https://www.youtube.com/watch?v=8ext9G7xspg" rel="nofollow noreferrer">this tutorial</a> on YouTube.</p>
<p>I've followed along and written the code, yet when I run it, the program finishes instantly without inputting i... | <p>You don't seem to be running the main <code>play()</code> function. Do note it says "exit code 0" meaning program finished, not "line 0".</p>
<p>Try adding this at the bottom of the file:</p>
<pre><code>if __name__ == "__main__":
play()
</code></pre>
<p>It will run the <code>play()<... | Python program runs but finishes with exit code 0 | python | -1 | 43 | 1 | 72,326,086 | 72,326,086 | 1 | true | 2022-05-21T01:42:43.730Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python program runs but finishes with exit code 0<p>I'm trying to learn Python by following <a href="https://www.youtube.com/watch?v=8ext9G7xspg" rel="nofoll... |
72,265,606 | splitting a flatfile using timestamp as new line instead of \n<p>I have a flatfile and am trying to create a dataframe using read_csv and I'd like to use a timestamp as the spot where a new row starts instead of a new line. I don't want to use \n because when there's an error in the flatfile, the errors take up multipl... | <p>One way would be to read in the file and then fix it. This approach finds all the lines that start with timestamps, groups by them and then concatenates all the strings in that group.</p>
<p>The data:</p>
<pre><code>str_io = io.StringIO(
'''2022-05-16 01:mm:ss here's a normal line in the file
2022-05-16 02:mm:ss he... | splitting a flatfile using timestamp as new line instead of \n | python|regex|pandas | 0 | 43 | 1 | 72,266,775 | 72,266,775 | 1 | true | 2022-05-16T21:03:20.243Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
splitting a flatfile using timestamp as new line instead of \n<p>I have a flatfile and am trying to create a dataframe using read_csv and I'd like to use a t... |
72,353,310 | C program hanging when executing thread in producer-consumer problem<p>I'm reproducing the producer-consumer in C using semaphores from <code>semaphore.h</code> and threads and mutexes from <code>pthread.h</code> with a very simple implementation. However, when I compile and run my program I won't see any output and th... | <p>You <em>do</em> have a deadlock [eventually].</p>
<p>To fix, <em>reverse</em> the order of the <code>sem*</code> and mutex calls.</p>
<p>Here is the refactored code with debug:</p>
<pre><code>#include <stdio.h>
#include <pthread.h>
#include <semaphore.h>
#include <time.h>
#include <stdarg.... | C program hanging when executing thread in producer-consumer problem | c|pthreads|mutex|semaphore|thread-synchronization | 0 | 43 | 1 | 72,353,838 | 72,353,838 | 1 | true | 2022-05-23T18:32:38.023Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C program hanging when executing thread in producer-consumer problem<p>I'm reproducing the producer-consumer in C using semaphores from <code>semaphore.h</co... |
72,333,321 | Parsing out text without a tag<p>I have been trying to parse out text without any tags. Wanted to build a little scraping tool for myself to help find good DND games to play on Roll20 (I was going to take this data and attach it to a table within each link for the final goal).</p>
<p>The URL I am parsing out info is he... | <p>I started off by looking at the source code of the page, and searching for a know string. (like part of a game description).
it seems every description is inside a <code><td class='gminfo'></code>
but, its parent element, the <code><tr></code>, is more intresting as it contains all the desired data.
Noti... | Parsing out text without a tag | python|html | 0 | 43 | 1 | 72,333,597 | 72,333,597 | 1 | true | 2022-05-21T21:27:19.633Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Parsing out text without a tag<p>I have been trying to parse out text without any tags. Wanted to build a little scraping tool for myself to help find good D... |
72,283,019 | Query and exclude empty cells<p>I'm trying to query data, format it, and exclude empty cells.</p>
<p><a href="https://i.stack.imgur.com/Vip0z.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Vip0z.jpg" alt="enter image description here" /></a></p>
<pre><code>=ARRAYFORMULA({"Date";IFERROR(QUE... | <p>If you data in <code>J Column</code> are true date then you can use below <code>QUERY()</code> formula.</p>
<pre><code>=QUERY(J2:J,"select J where J is not null label J 'Date' format J 'm/d/yyyy'")
</code></pre>
<blockquote>
<p>Edit: If data is string formatted then could try-</p>
</blockquote>
<pre><code>... | Query and exclude empty cells | google-sheets | 2 | 43 | 1 | 72,283,177 | 72,283,177 | 1 | true | 2022-05-18T03:56:07.493Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Query and exclude empty cells<p>I'm trying to query data, format it, and exclude empty cells.</p>
<p><a href="https://i.stack.imgur.com/Vip0z.jpg" rel="nofol... |
72,244,590 | How to display a list of search results in Django 4<p>I'm writing a Django app to manage sales leads. From the template that lists a page of leads, I want to give the user the ability to search all leads using first name and last name as the search criteria. When I type in a last name and press enter, the page flickers... | <p>Below is your url.py file</p>
<pre><code>urlpatterns = [
path('', LeadsListView.as_view(), name='list'),
path('<int:pk>/', LeadsDetailView.as_view(), name='detail'),
path('', LeadsCreateView.as_view(), name='create'),
path('', LeadsSearchResultsView.as_view(), name='search_results'),
]
</code><... | How to display a list of search results in Django 4 | django | 0 | 43 | 1 | 72,245,251 | 72,245,251 | 2 | true | 2022-05-14T23:47:40.843Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to display a list of search results in Django 4<p>I'm writing a Django app to manage sales leads. From the template that lists a page of leads, I want to... |
72,249,918 | How do I run a function every four minutes since a specific epoch?<p>My main function calls a number of subroutines in a <code>while True:</code> loop.</p>
<p>I want to add another function <code>g()</code> that only runs once every four minutes. Function <code>g()</code> should only run at 4 minutes, 8 minutes, 12 min... | <p>Create a new variable to store the next time the function should run:</p>
<pre><code>import time
def main():
epoch = time.time()
count = 0
next_g = 0
while True:
count = count + 1
if a() == 1:
b()
c()
d()
if count % 20:
... | How do I run a function every four minutes since a specific epoch? | python | 0 | 43 | 1 | 72,249,961 | 72,249,961 | 2 | true | 2022-05-15T15:58:10.703Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I run a function every four minutes since a specific epoch?<p>My main function calls a number of subroutines in a <code>while True:</code> loop.</p>
<... |
72,251,599 | How to make game wait before strats?<p>I am trying to do when i run the game it wait 3s before it starts in Unity.
I put all gameobjetc in a empty object with code:</p>
<pre><code>[SerializeField]
private float seconds = 3f;
private void Start()
{
StartCoroutine(Wait());
}
private IEnumerator Wait()
{
Time.time... | <p>Because <code>WaitForSeconds</code> corresponds to the time in the game and follows <code>Time.scale</code>, So when you set <code>Time.Scale</code> to <code>0</code>, no time passes. Use <strong><code>WaitForSecondsRealtime</code></strong> to resolve this issue, This method works independently of <code>Time.Scale</... | How to make game wait before strats? | c#|unity3d | 1 | 43 | 2 | 72,253,690 | 72,253,690 | 2 | true | 2022-05-15T19:33:46.143Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make game wait before strats?<p>I am trying to do when i run the game it wait 3s before it starts in Unity.
I put all gameobjetc in a empty object wit... |
72,244,397 | Ask the user before submitting the form<p>I have a cshtml page with this code:</p>
<pre><code><form action='@Url.Action("ExportExcel", "Records")' method="post" target="_blank" onsubmit="return exportExcel(), true">
<input type="hidden" na... | <p>You can try to remove onsubmit,and use a button to open modal,then calling exportExcel when clicking Yes button:</p>
<pre><code><form action='@Url.Action("ExportExcel", "Records")' method="post" target="_blank" id="myForm">
<input type="hidden"... | Ask the user before submitting the form | javascript|asp.net-core|razor|controller|onsubmit | 3 | 43 | 1 | 72,253,725 | 72,253,725 | 2 | true | 2022-05-14T22:54:51.910Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Ask the user before submitting the form<p>I have a cshtml page with this code:</p>
<pre><code><form action='@Url.Action("ExportExcel", "Rec... |
72,268,001 | Why is my component in React being called multiple times?<p>I am having an issue where my Listings component is running twice and I only want it to run once. I tried adding a counter below that would only run the code that grabs the data from the backend once but that did not work as you can see below it is still loopi... | <p>Because React will re-render when state change, if you want stop re-render, put your <code>grabListings()</code> inside <code>useEffect()</code> like this:</p>
<pre><code>useEffect(() => {
grabListings();
},[])
</code></pre> | Why is my component in React being called multiple times? | javascript|reactjs | 0 | 43 | 1 | 72,268,037 | 72,268,037 | 2 | true | 2022-05-17T03:49:46.147Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is my component in React being called multiple times?<p>I am having an issue where my Listings component is running twice and I only want it to run once.... |
72,279,487 | Numba-Cuda and data types<p>A while ago, I asked the following question:</p>
<p><a href="https://stackoverflow.com/questions/69509859/numba-cuda-computation-seems-to-be-slower-than-sequential-run-did-i-do-obvious">Numba Cuda computation seems to be slower than sequential run. Did I do obvious mistakes?</a></p>
<p>It wa... | <p><a href="https://numba.readthedocs.io/en/stable/user/jit.html" rel="nofollow noreferrer">Eager compilation</a> should not be confused with <a href="https://numba.readthedocs.io/en/stable/user/pycc.html" rel="nofollow noreferrer">ahead of time compilation</a>. The former compile the function dynamically using the JIT... | Numba-Cuda and data types | cuda|numba | 0 | 43 | 1 | 72,280,582 | 72,280,582 | 2 | true | 2022-05-17T19:10:08.650Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Numba-Cuda and data types<p>A while ago, I asked the following question:</p>
<p><a href="https://stackoverflow.com/questions/69509859/numba-cuda-computation-... |
72,279,126 | Getting specific cell value from NetCDF file slow on first execution<p>I am accessing a netcdf file using the xarray python library. The specific file that I am using is publicly <a href="https://zenodo.org/record/4943354" rel="nofollow noreferrer">available</a>.</p>
<p>So, the file has several variables, and for most ... | <p>Rather than selecting from the <code>.values</code> property, subset the array first:</p>
<pre class="lang-py prettyprint-override"><code>print(ds.ET_500m[0, 0, 0].values)
</code></pre>
<p>The problem is that <a href="https://docs.xarray.dev/en/latest/generated/xarray.DataArray.values.html" rel="nofollow noreferrer"... | Getting specific cell value from NetCDF file slow on first execution | raster|netcdf|python-xarray|data-cube | 1 | 43 | 1 | 72,281,327 | 72,281,327 | 2 | true | 2022-05-17T18:38:34.153Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting specific cell value from NetCDF file slow on first execution<p>I am accessing a netcdf file using the xarray python library. The specific file that I... |
72,286,322 | How to perform multiple AND statement after THEN Statement<pre><code>Sub Crons()
Dim s1 As Worksheet, s2 As Worksheet
Dim check1 As Boolean, check5 As Boolean, check10 As Boolean, flow As Boolean, speed As Boolean, motor_power As Boolean
Set s1 = ThisWorkbook.Worksheets(1)
Set s2 = ThisWorkbook.Wor... | <p>Just don't use <code>AND</code>!</p>
<pre><code>If check1 Or _
((check10 Or check5) Or _
(flow Or speed) Or _
(motor_power)) Then
s1.Range("B30").Value = "Activate anomaly detection"
s1.Range("B31").Value = "Activate Operating hour"
s1.Rang... | How to perform multiple AND statement after THEN Statement | excel|vba | 0 | 43 | 2 | 72,286,427 | 72,286,427 | 2 | true | 2022-05-18T09:13:03.457Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to perform multiple AND statement after THEN Statement<pre><code>Sub Crons()
Dim s1 As Worksheet, s2 As Worksheet
Dim check1 As Boolean, check5 A... |
72,286,554 | margin-top applies to sibling element also<p>I am creating an <strong>About</strong> page for my website. I have one parent element called <code>maindiv</code>, a flexbox with two children, one is <code>leftcont</code> and another is <code>rightcont</code>. I want to create an animation using margin-top to <code>leftco... | <p><code>margin-top</code> also changes the size of the parent, and this also affects the <code>rightcont</code>. If you use <code>transform: translateY</code> property the parent does not notice the movement and you get the effect you are looking for.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-c... | margin-top applies to sibling element also | html|css|animation|css-animations|margin | 0 | 43 | 1 | 72,286,673 | 72,286,673 | 2 | true | 2022-05-18T09:28:24.617Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
margin-top applies to sibling element also<p>I am creating an <strong>About</strong> page for my website. I have one parent element called <code>maindiv</cod... |
72,307,904 | How to ensure that at least 3 pods are always running even if there are any rolling updates in Kubernetes<p>I have deployed an application in k8s cluster with 8 replicas. but how to ensure that there will be at least 3 pods always running during rolling update, can anyone please suggest a solution ?</p>
<p>Thanks in ad... | <p>you can set the required values on <code>maxSurge</code> and <code>maxUnavailable</code></p>
<pre><code> strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 50%
type: RollingUpdate
</code></pre>
<p>setting <code>maxUnavailable</code> to 50% will make sure that you always have 4 pods running... | How to ensure that at least 3 pods are always running even if there are any rolling updates in Kubernetes | kubernetes | 1 | 43 | 2 | 72,308,269 | 72,308,269 | 2 | true | 2022-05-19T16:16:37.923Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to ensure that at least 3 pods are always running even if there are any rolling updates in Kubernetes<p>I have deployed an application in k8s cluster wit... |
72,309,503 | search for repeating characters and remove them from array js<p>I have multiple random arrays in which i put into arrays from scraping a website.</p>
<p>I was wondering if I could search an array and remove the repeating html that is in the array</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console... | <p>Have a go with fragments and remove</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>arr.forEach(({post_content},i)=>{
const fragment = document.createElement("div");
... | search for repeating characters and remove them from array js | javascript|html|arrays|web-scraping | 0 | 43 | 2 | 72,309,723 | 72,309,723 | 2 | true | 2022-05-19T18:31:07.070Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
search for repeating characters and remove them from array js<p>I have multiple random arrays in which i put into arrays from scraping a website.</p>
<p>I wa... |
72,309,854 | Pytest AssertionError even if status code is correct<p>Why do I keep getting <code>AssertionError</code> when actually 400 is returned as in line 14 is set?</p>
<pre><code>14 assert status_code == 400
15 AssertionError: assert (400, 'Please fulfill all parts!') == 400
</code></pre>
<p>Thanks!</p> | <p>you're trying to assert that an <code>int</code> is equal to a <code>tuple</code>.</p>
<p>specifying the index of <code>status_code</code> will solve it.</p>
<p>ie: <code>assert status_code[0] == 400</code></p> | Pytest AssertionError even if status code is correct | python-3.x|pytest|assert | 1 | 43 | 1 | 72,311,251 | 72,311,251 | 2 | true | 2022-05-19T19:02:31.017Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pytest AssertionError even if status code is correct<p>Why do I keep getting <code>AssertionError</code> when actually 400 is returned as in line 14 is set?<... |
72,311,426 | How to figure out the maximum number of framebuffers in WebGL<p>How do I get the maximum number of possibly allocated framebuffers in WebGL? I assume you use <code>getParameter</code> but I don't know what to pass in it. For the maximum amount of color attchements I know I can pass <code>MAX_DRAW_BUFFERS_WEBGL</code>, ... | <p>There is no hard limit on framebuffers, after all they're not resource intensive, their attachments are.</p>
<p>As to the number of supported color attachments, according to <a href="https://www.khronos.org/registry/webgl/specs/latest/1.0/#6.8" rel="nofollow noreferrer">section 6.8</a> in the <a href="https://www.kh... | How to figure out the maximum number of framebuffers in WebGL | webgl|framebuffer|webgl2 | 1 | 43 | 1 | 72,312,014 | 72,312,014 | 2 | true | 2022-05-19T21:49:25.217Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to figure out the maximum number of framebuffers in WebGL<p>How do I get the maximum number of possibly allocated framebuffers in WebGL? I assume you use... |
72,330,295 | How to change a value in local storage<p>I am saving on the local storage this item on the key <code>perfil</code>.</p>
<pre><code>[{"inscricao":{"nome":"Duarte","passe":"1234","email":"abcd@abcd.com"},"estatisticas":{"totalJogos"... | <p>You need to set it again after changing it:</p>
<pre><code>function get_localstorage(){
let x = localStorage.getItem("perfil")
return JSON.parse(x)
}
const newValue = get_localstorage();
newValue[0]["estatisticas"]["totalJogos"] = 1;
localStorage.setItem("perfil", JSON.s... | How to change a value in local storage | javascript | 0 | 43 | 1 | 72,330,334 | 72,330,334 | 2 | true | 2022-05-21T14:06:13.710Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to change a value in local storage<p>I am saving on the local storage this item on the key <code>perfil</code>.</p>
<pre><code>[{"inscricao":{&... |
72,332,758 | (javascript) If you had a string that was a word with a number at the end. How would you add a space between the word and the number?<p>For example:</p>
<pre><code>let word = 'Winter4000'
const seperate = (word) => {
...
}
seperate(word) // output: Winter 4000
</code></pre>
<p>The word can be random and the numb... | <p>Ian's answer works for most integers, but for decimals or numbers with commas (like 1,000,000), you'll want an expression like</p>
<pre><code>word.split(/([0-9.,]+)/).join(" ");
</code></pre>
<p>so it doesn't put an extra space when it runs into a decimal point or comma.</p>
<p>Writing this as a function,<... | (javascript) If you had a string that was a word with a number at the end. How would you add a space between the word and the number? | javascript|string | 1 | 43 | 3 | 72,333,042 | 72,333,042 | 2 | true | 2022-05-21T19:47:13.803Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
(javascript) If you had a string that was a word with a number at the end. How would you add a space between the word and the number?<p>For example:</p>
<pre... |
72,335,584 | Catch exceptions in multi threads and processes program<p>I'm trying to catch some specific exception. The problem is that my program is complex and can hide this exception as a 'primary' exception or as an inner exception inside an aggregated exception. (it could also be an inner of an inner exception and so on)
How d... | <p>That's the more concise syntax I can think of, featuring the <a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/is" rel="nofollow noreferrer"><code>is</code></a> operator:</p>
<pre><code>bool success;
MyOwnSpecialErrorException exception;
try
{
//...
}
catch (AggregateException ... | Catch exceptions in multi threads and processes program | c#|multithreading|exception|try-catch|inner-exception | 2 | 43 | 1 | 72,335,855 | 72,335,855 | 2 | true | 2022-05-22T07:24:57.163Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Catch exceptions in multi threads and processes program<p>I'm trying to catch some specific exception. The problem is that my program is complex and can hide... |
72,360,173 | Types predicate: can 'is' be seen as a subtype of boolean?<p>I was studying better <a href="https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates" rel="nofollow noreferrer">type predicates</a> and how they actually narrow the type through <code>pet is Fish</code>, for example.</p>
<p>I've ... | <p>No this is not really equivalent to const strings. Booleans have only two possible values, i.e. <code>boolean</code> is the same as <code>true | false</code>, you cannot narrow that type other than having just <code>true</code> or <code>false</code>.</p>
<p>I would think of type guard as being a special syntax, a fu... | Types predicate: can 'is' be seen as a subtype of boolean? | typescript | 1 | 43 | 1 | 72,360,322 | 72,360,322 | 2 | true | 2022-05-24T09:10:09.110Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Types predicate: can 'is' be seen as a subtype of boolean?<p>I was studying better <a href="https://www.typescriptlang.org/docs/handbook/2/narrowing.html#usi... |
72,364,059 | Create a defaultdict who's key refers to the same numerical value as the key<p>I'm looking to create a <code>defaultdict</code> who's key automatically refers to an integer or float of equal value</p>
<p>ie behavior would be:</p>
<pre><code>In [1]: selfkey = defaultdict(something)
In [2]: selfkey[4]
Out[2]: 4
In [3]:... | <p>Using the solution proposed in <a href="https://stackoverflow.com/questions/2912231/is-there-a-clever-way-to-pass-the-key-to-defaultdicts-default-factory">Is there a clever way to pass the key to defaultdict's default_factory?</a>.</p>
<pre><code>from collections import defaultdict
class keydefaultdict(defaultd... | Create a defaultdict who's key refers to the same numerical value as the key | python|collections|defaultdict | 1 | 43 | 2 | 72,364,607 | 72,364,607 | 2 | true | 2022-05-24T13:45:49.290Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create a defaultdict who's key refers to the same numerical value as the key<p>I'm looking to create a <code>defaultdict</code> who's key automatically refer... |
72,374,397 | Can selected columns change the number of rows in MySQL?<p>I have a simple query with a couple of joins but when I add columns in to my selection from the same set of joins, number of rows change by just adding or removing columns in selection without changing any joins.</p> | <p>Yes they can. Your query or as you call it "simple query" can have, for example, keyword distinct and adding a column to a select like that will change the number of total rows in your result.</p>
<pre><code>select distinct t1.id, t2.id
from t1
left join t2 on t1.id = t2.id
</code></pre>
<p>VS</p>
<pre><co... | Can selected columns change the number of rows in MySQL? | mysql|sql|sqlyog | 0 | 43 | 1 | 72,374,511 | 72,374,511 | 2 | true | 2022-05-25T08:36:37.177Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can selected columns change the number of rows in MySQL?<p>I have a simple query with a couple of joins but when I add columns in to my selection from the sa... |
72,377,421 | Does ProcessBuilder() take some time to complete?<p>Does ProcessBuilder() take some time to complete?
For example, some <code>key</code> is already defined for the OS you are using.
Is it possible that when the second line executes the previous step isn't yet completed? (the second line will be using <code>old key</cod... | <p>It definitely takes some time (whatever time your command takes). The start method returns a Process, which you can wait for:</p>
<pre><code>var process = ProcessBuilder().command("cmd.exe", "/c", "setx key abcd").start();
try {
process.waitFor();
} catch(InterruptedException e) {
... | Does ProcessBuilder() take some time to complete? | java|processbuilder | 0 | 43 | 1 | 72,377,717 | 72,377,717 | 2 | true | 2022-05-25T12:12:01.563Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Does ProcessBuilder() take some time to complete?<p>Does ProcessBuilder() take some time to complete?
For example, some <code>key</code> is already defined f... |
72,383,390 | Is there a way to know if the message succeeded in the response?<p>We just started using Twilio and are running into an issue of people attempting to use landlines to send messages. We are thinking of using Twilio's lookup functionality, but wanted to see if there was a way to get a better response after sending the me... | <p>To send a message via Twilio, you're creating a <a href="https://www.twilio.com/docs/sms/api/message-resource" rel="nofollow noreferrer">Message Resource</a> via the Twilio API.
Message Resources have a status property that indicates whether the message has been sent, delivered, undelivered, failed, etc. You can fin... | Is there a way to know if the message succeeded in the response? | .net-core|twilio-api | 0 | 43 | 1 | 72,383,977 | 72,383,977 | 2 | true | 2022-05-25T19:47:36.257Z | 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 know if the message succeeded in the response?<p>We just started using Twilio and are running into an issue of people attempting to use lan... |
72,386,386 | Is there a way to declare Status and Level in Oracle?<p>I usually use SQL Server so declare variables in Oracle seem different a little.</p>
<p>Here is the table Im trying to create:</p>
<pre><code> CREATE TABLE EMPLOYEE(
EmpNo char(10) CONSTRAINT PK_EmpNo PRIMARY KEY,
EmpName varchar2(30),
Birthday DATE not null,
Dep... | <p><code>LEVEL</code> is a reserved word that cannot be used as an identifier. Every database has them; the complete list of reserved words for Oracle is here: <a href="https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/Oracle-SQL-Reserved-Words.html#GUID-55C49D1E-BE08-4C50-A9DD-8593EB925612" rel="nofo... | Is there a way to declare Status and Level in Oracle? | sql|oracle | 0 | 43 | 1 | 72,386,504 | 72,386,504 | 2 | true | 2022-05-26T03:31:53.800Z | 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 declare Status and Level in Oracle?<p>I usually use SQL Server so declare variables in Oracle seem different a little.</p>
<p>Here is the t... |
72,392,851 | How to update only one of duplicated rows in SQL without primary keys?<p>I have a table that have the following columns:</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th>st_id</th>
<th>sbj_id</th>
<th>desc</th>
<th>scr</th>
<th>sbm_dt</th>
</tr>
</thead>
<tbody>
<tr>
<td>2001</td>
<td>10</td... | <p>Schema and insert statement:</p>
<pre><code> create table testTable(st_id int, sbj_id int, description varchar(50), scr float, sbm_dt datetime);
insert into testTable values(2001, 10, 'Q2', 7.4, '2021-05-03 17:03:32');
insert into testTable values(2001, 10, 'Q1', 8.0, '2021-04-03 18:07:35');
insert into... | How to update only one of duplicated rows in SQL without primary keys? | sql|mariadb|greatest-n-per-group | 0 | 43 | 1 | 72,393,290 | 72,393,290 | 2 | true | 2022-05-26T13:44:23.947Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to update only one of duplicated rows in SQL without primary keys?<p>I have a table that have the following columns:</p>
<div class="s-table-container">
... |
72,398,909 | How to get value of a child based on the text of another child within the same JavaScript parent<p>so I want to be able to get "Text B" from the table below using Cypress but have tried many things and I can only get "Party B".</p>
<pre><code><div class="table">
<div class="... | <p>To get the table containing "Party B", specify the selector inside <code>.contains()</code></p>
<pre class="lang-js prettyprint-override"><code>cy.contains('div.table', 'Party B') // returns the table with "Party B" inside somewhere
.find('div.text') // find the 2nd child whi... | How to get value of a child based on the text of another child within the same JavaScript parent | javascript|html|css|cypress | 1 | 43 | 1 | 72,399,082 | 72,399,082 | 2 | true | 2022-05-26T23:09:50.820Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get value of a child based on the text of another child within the same JavaScript parent<p>so I want to be able to get "Text B" from the ta... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.