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,221,376 | Mongodb Distinct Query with Count<p>I have a schema like below in mongodb</p>
<pre><code>let reactions = [
{
messageId: 1,
reactions: [
{
"userid": "7212898122",
"reactionId": 2,
"date": "2022-05-12T18:55:49.... | <p>You can do something like:</p>
<ol>
<li><code>$unwind</code> to separate reactions</li>
<li><code>$group</code> both by messageId and reactionId, to get the count you want</li>
<li><code>$group</code> by messageId to 'revert' the <code>$unwind</code> and use <code>k</code> and <code>v</code> in the array to enable t... | Mongodb Distinct Query with Count | node.js|mongodb|mongodb-nodejs-driver | 0 | 55 | 1 | 72,221,621 | 72,221,621 | 1 | true | 2022-05-12T19:49:31.907Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mongodb Distinct Query with Count<p>I have a schema like below in mongodb</p>
<pre><code>let reactions = [
{
messageId: 1,
reactions: [
... |
72,221,657 | mismatched input error when trying to use Spark subquery<p>New at PySpark, trying to get a query to run and it seems like it SHOULD run but I get an EOF issue and I'm not sure how to resolve it..</p>
<p>What I'm trying to do is find all rows in blah.table where the value in col "domainname" matches a value fr... | <pre><code>select * from blah.table
where (id1, id2) in (select id1,id2 from blah.table
where domainname in ('list.com','of.com','domains.com'))
</code></pre>
<p>Or, use <code>EXISTS</code>:</p>
<pre><code>select * from blah.table t1
where EXISTS (select * from blah.table t2
where t1.... | mismatched input error when trying to use Spark subquery | sql|pyspark|apache-spark-sql | 0 | 73 | 1 | 72,221,719 | 72,221,719 | 1 | true | 2022-05-12T20:19:03.287Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
mismatched input error when trying to use Spark subquery<p>New at PySpark, trying to get a query to run and it seems like it SHOULD run but I get an EOF issu... |
72,219,020 | Use clone helper only when button pressed<p>I am trying to make it so that my draggable element is only cloned when I press the Control button and drag it. My options for the <code>draggable()</code> function are:</p>
<pre><code>var pressedKeys = {};
window.onkeyup = function(e) { pressedKeys[e.keyCode] = false; }
wind... | <p>Consider the following.</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() {
var pressedKeys = {
17: false
};
$(window).on({
keyup: function(e) {
... | Use clone helper only when button pressed | jquery-ui|jquery-ui-draggable | 0 | 19 | 1 | 72,221,735 | 72,221,735 | 1 | true | 2022-05-12T16:18:04.743Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Use clone helper only when button pressed<p>I am trying to make it so that my draggable element is only cloned when I press the Control button and drag it. M... |
72,221,857 | Find all unique values in array and than split it and return something else<p>My goal is to find all the unique years in this array and than return it as a array. I have almost done it but cant figure out how I will return the split value.</p>
<pre><code>function findUniqueYears() {
const arr = ['1973-11-01', '2001-0... | <p>This should do</p>
<pre><code>const findUniqueYears = (arr) => Array.from(new Set(arr.map(item => item.split('-')[0])))
</code></pre> | Find all unique values in array and than split it and return something else | javascript|arrays | 0 | 39 | 2 | 72,221,931 | 72,221,931 | 1 | true | 2022-05-12T20:42:14.853Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find all unique values in array and than split it and return something else<p>My goal is to find all the unique years in this array and than return it as a a... |
72,216,588 | Cannot Link to part of page with MUI 5 Drawer<p>I'm simply trying to link to a specific part of my first page when the user clicks on the <em>Shop</em> button in the navigation Drawer but it doesn't do anything at all:</p>
<p><a href="https://i.stack.imgur.com/FUQCp.png" rel="nofollow noreferrer"><img src="https://i.st... | <p>You can use <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView" rel="nofollow noreferrer">scrollIntoView</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/API/History/pushState" rel="nofollow noreferrer">History.pushState()</a> to handle this. Remove the <code>href</code> fr... | Cannot Link to part of page with MUI 5 Drawer | javascript|html|css|reactjs|material-ui | 0 | 61 | 1 | 72,221,989 | 72,221,989 | 1 | true | 2022-05-12T13:33:55.797Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cannot Link to part of page with MUI 5 Drawer<p>I'm simply trying to link to a specific part of my first page when the user clicks on the <em>Shop</em> butto... |
72,222,014 | ForEach - print both an item and numerical value<p>How can I achieve a ForEach result that displays each array member, along with numerical values depending on the list count, that increment up for each item</p>
<p>Example would be
1 "Turkey"
2 "Ham"
3 "Mayo"</p>
<pre><code>struct EditorDi... | <p>Try using enumerated</p>
<pre><code>ForEach(Array(recipeDirections.enumerated()), id: \.offset){ (index,recipe) in
</code></pre>
<p>The index will be 0,1,2, according to array numbers.</p> | ForEach - print both an item and numerical value | swift|swiftui | 0 | 123 | 1 | 72,222,051 | 72,222,051 | 1 | true | 2022-05-12T21:01:06.993Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ForEach - print both an item and numerical value<p>How can I achieve a ForEach result that displays each array member, along with numerical values depending ... |
72,222,054 | Overload == operator for a boost::variant<p>I have a boost::variant of a bunch of types (int, double, custom class etc) and need to implement an overload for the == operator. How do I go about this?</p>
<p>My error is wrt the == operator, complaining that "too few operators for this operation". What am I miss... | <p>Your <code><<</code> operator takes two arguments, the stream and the variant.</p>
<p>Your <code>operator==</code> takes one argument. If you're defining a free function <code>operator==</code>, the signature should be <code>bool operator==(const someVariant& lhs, const someVariant& rhs)</code>.</p> | Overload == operator for a boost::variant | c++|boost|operator-overloading | 0 | 50 | 1 | 72,222,088 | 72,222,088 | 1 | true | 2022-05-12T21:05:45.713Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Overload == operator for a boost::variant<p>I have a boost::variant of a bunch of types (int, double, custom class etc) and need to implement an overload for... |
72,221,820 | ssis dtsconfig file, is there encryption<p>I remember a while ago there was some microsoft utility where you could encrypt sensitive values in an app.config file for a c# Console application. Does anyone know if there is a way to encrypt sensitive values in a dtsconfig file? Obviously the default dtexec.exe would hav... | <p>Nope, not an option.</p>
<p>That is one of the reasons the Project Deployment Model and the SSISDB was introduced. With that, you can natively encrypt and more importantly, decrypt those values to provide credentials at run-time.</p> | ssis dtsconfig file, is there encryption | encryption|ssis|password-encryption | 0 | 25 | 1 | 72,222,107 | 72,222,107 | 1 | true | 2022-05-12T20:38:06.963Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ssis dtsconfig file, is there encryption<p>I remember a while ago there was some microsoft utility where you could encrypt sensitive values in an app.config ... |
72,215,689 | How to append np.arrays() in a for-loop?<p>This application is in analysis of astrophysical data, but the problem is purely a question of programming/syntax. I want to go through my 53 bins of data (each one 1D galaxy spectrum at different radii of the galaxy) and perform some algorithm to determine kinematical paramet... | <p><code>for bin in (1,53):</code> is going to treat <code>(1,53)</code> as a tuple of elements containing only 1 and 53, to actually go through the range you need <code>for bin in range(1,54)</code> (54 instead of 53 because it is non-inclusive of the last element).</p>
<pre class="lang-py prettyprint-override"><code>... | How to append np.arrays() in a for-loop? | python|numpy | 0 | 93 | 1 | 72,222,160 | 72,222,160 | 1 | true | 2022-05-12T12:33:35.497Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to append np.arrays() in a for-loop?<p>This application is in analysis of astrophysical data, but the problem is purely a question of programming/syntax.... |
72,222,035 | Initializing a class with numpy array question<p>So I have defined the following function to be entered into a class:</p>
<pre><code>MatrixConverter(arr)
</code></pre>
<p>Which works exactly how I want it to, taking in a numpy array as argument, and produces a simpler matrix as a numpy array.</p>
<p>Now, I would like t... | <p>No need to do anything too fancy, we can bind the (unit tested) function to a class method, then invoke that in the <code>__init__</code> function.</p>
<pre><code>
def matrixConverter(arr):
# Some complicated function you already wrote
raise NotImplementedError
class SeveralConverter:
def __init__(self,... | Initializing a class with numpy array question | python|arrays|numpy | 0 | 36 | 1 | 72,222,181 | 72,222,181 | 1 | true | 2022-05-12T21:03:38.237Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Initializing a class with numpy array question<p>So I have defined the following function to be entered into a class:</p>
<pre><code>MatrixConverter(arr)
</c... |
72,221,977 | Jolt transform specification input<p>i have the following input json:</p>
<pre class="lang-json prettyprint-override"><code>{
"tags": {
"event": "observation",
"source": "hunter"
}
}
</code></pre>
<p>The output JSON should look like below:</p>
<pre class="la... | <p>You can use this specification</p>
<pre class="lang-json prettyprint-override"><code>[
{ // combine each key-value pair under within common arrays
"operation": "shift",
"spec": {
"tags": {
"*": {
"$": "&2_&1&qu... | Jolt transform specification input | json|apache-nifi|jolt | 0 | 26 | 1 | 72,222,204 | 72,222,204 | 1 | true | 2022-05-12T20:56:59.307Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Jolt transform specification input<p>i have the following input json:</p>
<pre class="lang-json prettyprint-override"><code>{
"tags": {
"... |
72,220,758 | Using Altair's interval selection as a filter in a multi-view chart<p>In my concatenated chart, I’m using an interval selection as a filter (see the GIF, Python code, and VL spec below).</p>
<p>Even though my selection appears to be empty, my filtered chart still shows some data. What I'd like to achieve is to show the... | <p>Your chart seems to be working fine to me. The only thing I noticed is that some circles are not showing up which can make it look like there is no data there when you brush. If you set your domain to start at zero, these then appear fine and everything works as expected.</p>
<p><a href="https://vega.github.io/edito... | Using Altair's interval selection as a filter in a multi-view chart | python|altair|vega-lite|vega | 0 | 71 | 1 | 72,222,212 | 72,222,212 | 1 | true | 2022-05-12T18:53:16.820Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using Altair's interval selection as a filter in a multi-view chart<p>In my concatenated chart, I’m using an interval selection as a filter (see the GIF, Pyt... |
72,222,258 | In Pandas sum columns and change values to proportion of sum<p>If I have the following DataFrame, how can I convert the value in each row to the proportion of the total of the columns?</p>
<p>Input:</p>
<pre><code>pd.DataFrame(
{'A': {0: 1, 1: 1},
'B': {0: 1, 1: 2},
'C': {0: 1, 1: 9},})
</code></pre>
<p>Output:</p>
<... | <p>How about <code>apply</code>?</p>
<pre class="lang-py prettyprint-override"><code>import pandas as pd
df = pd.DataFrame(
{'A': {0: 1, 1: 1},
'B': {0: 1, 1: 2},
'C': {0: 1, 1: 9},})
df = df.apply(lambda col: col / sum(col))
print(df)
# A B C
# 0 0.5 0.333333 0.1
# 1 0.5 0.666667 0.9
</code><... | In Pandas sum columns and change values to proportion of sum | python|pandas | 0 | 48 | 2 | 72,222,282 | 72,222,282 | 1 | true | 2022-05-12T21:30:11.773Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In Pandas sum columns and change values to proportion of sum<p>If I have the following DataFrame, how can I convert the value in each row to the proportion o... |
72,214,623 | is there any way to integrate Alert rules with Azuredevops WorkItems-bugs<p>Looking for some way to create the ADO workitem type-bugs, whenever any created Azure alert rules trigger alerts.</p>
<p>Is there any inbuilt mechanisam available either in ADO or Azure loganalytic workspaces, where we created the alert rules.<... | <p>I don't think there's any built-in way to do it.</p>
<p>You could create an <a href="https://stefanstranger.github.io/2020/06/05/UsingAzureLogicAppToCreateBugWorkItem/" rel="nofollow noreferrer">Azure Logic App that creates a task in DevOps</a> and then make it an Action for your Alert.</p>
<p>Connecting the ticket ... | is there any way to integrate Alert rules with Azuredevops WorkItems-bugs | azure-devops|azure-log-analytics|azure-devops-extensions|azure-devops-server-2019|azure-monitor | 0 | 60 | 1 | 72,222,360 | 72,222,360 | 1 | true | 2022-05-12T11:21:27.500Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
is there any way to integrate Alert rules with Azuredevops WorkItems-bugs<p>Looking for some way to create the ADO workitem type-bugs, whenever any created A... |
72,222,096 | How to add specified alignment to an image?<p>So, I would like to have the image in the footer of this template be aligned more with the text above it that reads, TRACKING # EP. How do I set the margins for this?</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div ... | <p>Try this:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code><table class="label">
<tr>
<td class="sign">F</td>
<td class="holder">
... | How to add specified alignment to an image? | html | 0 | 31 | 2 | 72,222,380 | 72,222,380 | 1 | true | 2022-05-12T21:11:20.067Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add specified alignment to an image?<p>So, I would like to have the image in the footer of this template be aligned more with the text above it that ... |
72,222,422 | Dynamically define argument type<p>I'm writing a library with TypeScript. It's meant to be a super-set of a configuration language, and itself configurable.</p>
<p>In a particular context, I want to declare a class with an object of essentially any shape, which will be converted to the expected shape by a function whic... | <pre class="lang-js prettyprint-override"><code>// Defined by my library
const makeClass = <T extends unknown>(mappingFunc: (T) => Output) =>
class SpecifiedMyClass(input: T) {
// Uses mappingFunc internally
}
return SpecifiedMyClass
}
</code></pre>
<p>Maybe I didn't understand the problem correc... | Dynamically define argument type | typescript | 0 | 34 | 1 | 72,222,471 | 72,222,471 | 1 | true | 2022-05-12T21:49:23.760Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Dynamically define argument type<p>I'm writing a library with TypeScript. It's meant to be a super-set of a configuration language, and itself configurable.<... |
72,218,706 | How do I create a button in kotlin without xml?<p>How do I make a button without any XML? I tried XML but it did not work and it is "Old" I heard.</p> | <p>Yeah, using XML is old but it's the standard way of defining views in Android. Nowadays exist alternatives to that such as Jetpack Compose which takes a more <code>React</code> style when declaring the GUI where you write <code>@Composable</code> functions that produce a UI. Quite nice.</p>
<p>In any case you can cr... | How do I create a button in kotlin without xml? | android|kotlin | 0 | 76 | 1 | 72,222,519 | 72,222,519 | 1 | true | 2022-05-12T15:55:05.770Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I create a button in kotlin without xml?<p>How do I make a button without any XML? I tried XML but it did not work and it is "Old" I heard.<... |
72,221,777 | How to find and replace the first occurrence of any single text character (Excel)<p>I need to replace or substitute the first instance of a single text character in an excel row.</p>
<pre><code>current: B01 TEST TEST TEST A W B 0 A
expected result where first "A" that is on its own is replaced with "|&qu... | <p>This uses Office 365 LET and SEQUENCE and is not dependent on it being a capital character. It will replace the first character whether alpha, numeric or special that has a space on either side of it with the <code>|</code>:</p>
<pre><code>=LET(rng,A1,
sq,SEQUENCE(LEN(rng)-3),
md,MID(rng,sq,3),
lft,LEFT... | How to find and replace the first occurrence of any single text character (Excel) | excel|excel-formula | 0 | 75 | 2 | 72,222,549 | 72,222,549 | 1 | true | 2022-05-12T20:33:25.140Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to find and replace the first occurrence of any single text character (Excel)<p>I need to replace or substitute the first instance of a single text chara... |
72,222,417 | Vue.js computed boolean incorrect<p>I need a computed property for whether startDate is less than endDate. For some reason when I code it as below, the computed property always computes as false even though the expression is correct. See <a href="https://codepen.io/iiydejib/pen/WNMGKzG" rel="nofollow noreferrer">Pen</a... | <p>Arrow function wouldn't bind this for Computed</p>
<p>Try:
<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>startLTEndDate() {
return(Date.parse(this.dateStart) < Date.pars... | Vue.js computed boolean incorrect | javascript|vuejs2 | 0 | 33 | 1 | 72,222,553 | 72,222,553 | 1 | true | 2022-05-12T21:48:57.883Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vue.js computed boolean incorrect<p>I need a computed property for whether startDate is less than endDate. For some reason when I code it as below, the compu... |
72,218,287 | How do I construct a dictionary of dictionary of dictionaries?<p>I was going through some basic gene encoding techniques and came across a problem:</p>
<p>My dictionary should look something like :</p>
<pre><code>codon_dict= {
"A": {
"A": {
"A": 0.0,
&qu... | <p>Try <a href="https://docs.python.org/3/library/itertools.html#itertools.product" rel="nofollow noreferrer"><code>itertools.product</code></a>:</p>
<pre class="lang-py prettyprint-override"><code>from itertools import product
s = "ATGC"
out = {}
for x, y, z in product(s, repeat=3):
out.setdefault(x, {... | How do I construct a dictionary of dictionary of dictionaries? | python-3.x|dictionary|nested | 0 | 27 | 1 | 72,222,563 | 72,222,563 | 1 | true | 2022-05-12T15:24:20.897Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I construct a dictionary of dictionary of dictionaries?<p>I was going through some basic gene encoding techniques and came across a problem:</p>
<p>My... |
72,222,225 | Text alignment doesnt work on mobile [CSS]<p>I have a weird problem with text alignment which I never had before.</p>
<p>On this app: <a href="https://damdafayton-countries.herokuapp.com/" rel="nofollow noreferrer">https://damdafayton-countries.herokuapp.com/</a>
two sections of text doesn't get aligned to middle in th... | <p>not sure I understood your problem but if your are talking about the titles that are not vertical align it's because of your font "Gill,sans-serif"
Sometimes some fonts change the vertical orgin point</p> | Text alignment doesnt work on mobile [CSS] | html|css|bootstrap-4 | 0 | 34 | 1 | 72,222,701 | 72,222,701 | 1 | true | 2022-05-12T21:26:51.253Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Text alignment doesnt work on mobile [CSS]<p>I have a weird problem with text alignment which I never had before.</p>
<p>On this app: <a href="https://damdaf... |
72,204,393 | Making a while loop more efficient for use on a large data.table to delete rows based on certain conditions<p>I have a pretty big amount of data in a data table. I would like to delete a number of rows if there is a certain value in a cell.</p>
<p>Below is an excerpt from my data table:</p>
<pre><code> V1 ... | <p>Wonderful example of the challenges a nicely formatted Excel spreadsheet offers to data analysis.</p>
<p>If I understand correctly, the OP wants to remove <em>all</em> rows of a section if <em>any</em> of the values in column <code>V3</code> equals <code>#NV</code>. A new section starts with a non empty entry in col... | Making a while loop more efficient for use on a large data.table to delete rows based on certain conditions | r|data.table | 0 | 73 | 3 | 72,222,744 | 72,222,744 | 1 | true | 2022-05-11T16:17:26.937Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Making a while loop more efficient for use on a large data.table to delete rows based on certain conditions<p>I have a pretty big amount of data in a data ta... |
72,222,688 | Restricting object key type with const<p>I am able to define an object key type from a union like:</p>
<pre><code>type Action = 'foo' | 'bar' | 'baz';
type UserStates = 'active' | 'deleted' | 'dishonoured';
type Permission = {
[key in UserStates]: Action[];
};
</code></pre>
<p>However, I have a scenario where the o... | <p>You almost had it:</p>
<pre><code>type Permission = {
[key in typeof UserStates[number]]: typeof Action[number][];
};
</code></pre> | Restricting object key type with const | typescript | 0 | 68 | 2 | 72,222,764 | 72,222,764 | 1 | true | 2022-05-12T22:27:52.017Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Restricting object key type with const<p>I am able to define an object key type from a union like:</p>
<pre><code>type Action = 'foo' | 'bar' | 'baz';
type ... |
72,222,400 | How to eliminate passing View Model to this Jetpack Compose Kotlin Home Screen?<p>I'm trying to clean-up my code and eliminate View Models where not necessary.</p>
<p><strong>I'd like to be able to access <code>itemList</code>, <code>filtering</code>, and <code>itemListFiltered</code> in my <code>HomeScreen</code> func... | <p>Pass it just like that...</p>
<pre><code>model.itemsList
</code></pre>
<p>The <code>::</code> symbol doesn't work how you seem to think it does. Consider it to be used for static non-changing variables/methods. Like you could use <code>model::addItem</code> or <code>model::clearItemList</code> since they are just pu... | How to eliminate passing View Model to this Jetpack Compose Kotlin Home Screen? | kotlin|android-jetpack-compose | 0 | 77 | 1 | 72,222,771 | 72,222,771 | 1 | true | 2022-05-12T21:46:33.923Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to eliminate passing View Model to this Jetpack Compose Kotlin Home Screen?<p>I'm trying to clean-up my code and eliminate View Models where not necessar... |
72,210,838 | HTML can't properly read unicode in image tag src<p>I am using electron with html, css and js. For my desktop app, I want to import an image from my local storage using an img tag. However, my file name contains an unicode (e.g. #). When, HTML try to fetch the image it gets rid of the second half part of the file name ... | <p><code>#</code> is not a "unicode" as you call it. It is just a plain ASCII character. But, within a url, it just happens to be a <em>reserved</em> character, used to denote an anchor within a resource, and so is not part of the resource's path, which is why you see it getting stripped off.</p>
<p>So, you... | HTML can't properly read unicode in image tag src | javascript|html|unicode|filenames | 0 | 92 | 2 | 72,222,837 | 72,222,837 | 1 | true | 2022-05-12T06:12:56.377Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
HTML can't properly read unicode in image tag src<p>I am using electron with html, css and js. For my desktop app, I want to import an image from my local st... |
72,219,995 | Vue v-model.lazy modifier does not work. Why?<p>Here is my code:</p>
<pre><code><!DOCTYPE html>
<html>
<head>
<title>My first Vue app</title>
<script src="https://unpkg.com/vue@2"></script>
</head>
<body>
<div id="app">
... | <p>Change v-model.laze To v-model.lazy</p>
<p>Try:
<div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code><!DOCTYPE html>
<html>
<head>
<title>My first Vue ... | Vue v-model.lazy modifier does not work. Why? | html|input|vuejs2|onchange|lazy-evaluation | 0 | 32 | 1 | 72,222,914 | 72,222,914 | 1 | true | 2022-05-12T17:37:57.487Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vue v-model.lazy modifier does not work. Why?<p>Here is my code:</p>
<pre><code><!DOCTYPE html>
<html>
<head>
<title>My first V... |
72,222,788 | How to reset jquery/javascript filter<p>I have a list of div items which I am filtering/sorting via JS.
Each item animates in to place - in this case, scales up to its final size.</p>
<p>When I filter the items via buttons, anything already on screen DOES NOT play this animation again.</p>
<p>How can I RESET the filter... | <p>To reset the elements you have to get them back to the 0% on the animation. The easiest way to do that is to hide them all first. So instead of hiding all the ones that are not currently selected, hide everything first, then show what you want to show after that. Now immediately hiding and showing does not give t... | How to reset jquery/javascript filter | javascript|jquery|css | 0 | 49 | 2 | 72,222,934 | 72,222,934 | 1 | true | 2022-05-12T22:43:57.443Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to reset jquery/javascript filter<p>I have a list of div items which I am filtering/sorting via JS.
Each item animates in to place - in this case, scales... |
72,221,851 | ListView and Expanded not work in flutter<p>I need help to solve this problem. The expanded renders the child but does not expand.</p>
<pre><code>return Scaffold(
body: ListView(
children: [
_HomeBody(child: child,)
],
)
);
</code></pre>
<p>_HomeBody</p>
<pre><code>return Container(
width: MediaQ... | <p>You can't have <code>Expanded</code> inside of a scrolling view (<code>SignleChildScrollView</code>, <code>ListView</code>, etc..)</p>
<p>cause like this you are telling the child of the expanded to take of the whole vertical space allowed to you, and the scroll view can allow infinite vertical space, so in a nutshe... | ListView and Expanded not work in flutter | flutter|listview|flutter-renderflex-error | 0 | 278 | 1 | 72,222,955 | 72,222,955 | 1 | true | 2022-05-12T20:40:53.837Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ListView and Expanded not work in flutter<p>I need help to solve this problem. The expanded renders the child but does not expand.</p>
<pre><code>return Scaf... |
72,222,878 | get count of partitions in a kafka topic with scala 2.12<p>With scala 2.11 and spark-streaming-kafka-0-8_2.11 I could do</p>
<pre><code>import org.apache.spark.streaming.kafka.KafkaCluster
val params = Map[String, Object](
"bootstrap.servers" -> "localhost:9092",
"key.deserializer"... | <p>You don't need Spark for this. You can use <a href="https://kafka.apache.org/24/javadoc/org/apache/kafka/clients/consumer/KafkaConsumer.html#listTopics--" rel="nofollow noreferrer"><code>KafkaConsumer.listTopics()</code></a> to get a Map of topic names to a list of partitions.</p> | get count of partitions in a kafka topic with scala 2.12 | scala|apache-spark|apache-kafka|spark-streaming | 0 | 60 | 1 | 72,223,150 | 72,223,150 | 1 | true | 2022-05-12T22:58:39.167Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
get count of partitions in a kafka topic with scala 2.12<p>With scala 2.11 and spark-streaming-kafka-0-8_2.11 I could do</p>
<pre><code>import org.apache.spa... |
72,223,079 | How to keep top 500 rows a csv loop (python) and overwrite each file<p>I am trying to read more than 100 csv files in python to keep the TOP 500 rows (they each have more than 55,0000 rows). So far I know how to do that, but I need save each modified file in the loop with its own filename in csv format. because normall... | <p>Dataframes can write as well as read CSVs. So, just create and call <code>to_csv</code> with the same filename.</p>
<pre><code>import pandas as pd
import glob
FolderName = str(input("What's the name of the folder are you comparing? "))
path = input('Enter full path of the folder: ')
all_files = glob.glob(... | How to keep top 500 rows a csv loop (python) and overwrite each file | python|pandas|dataframe | 0 | 44 | 1 | 72,223,170 | 72,223,170 | 1 | true | 2022-05-12T23:36:29.873Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to keep top 500 rows a csv loop (python) and overwrite each file<p>I am trying to read more than 100 csv files in python to keep the TOP 500 rows (they e... |
72,223,200 | PayPal create_order_error cannot read properties of null<p>I've integrated PayPal into my .NET 6 (Blazor) application. I followed the <a href="https://developer.paypal.com/docs/checkout/standard/integrate/#link-addpaymentbuttons" rel="nofollow noreferrer">PayPal docs here</a> to add the button. In test mode all worked ... | <blockquote>
<p>document.getElementById('p-amount')</p>
</blockquote>
<p>Is null. Make it be something that's not null.</p> | PayPal create_order_error cannot read properties of null | paypal|.net-6.0 | 0 | 128 | 1 | 72,223,233 | 72,223,233 | 1 | true | 2022-05-13T00:00:32.963Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PayPal create_order_error cannot read properties of null<p>I've integrated PayPal into my .NET 6 (Blazor) application. I followed the <a href="https://develo... |
72,223,191 | Send and load an ML model over Apache Kafka<p>I've been looking around here and on the Internet, but it seems that I'm the first one having this question.</p>
<p>I'd like to train an ML model (let's say something with PyTorch) and write it to an Apache Kafka cluster. On the other side, there should be the possibility o... | <p>One reason to avoid this is that Kafka messages have a default of 1MB max. Therefore sending models around in topics wouldn't be the best idea, and therefore why you could instead use model files, stored in a shared filesystem, and send <strong>URIs to the files</strong> (strings) to download in the consumer clients... | Send and load an ML model over Apache Kafka | python|apache-kafka|scikit-learn|pytorch | 0 | 43 | 1 | 72,223,262 | 72,223,262 | 1 | true | 2022-05-12T23:58:06.257Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Send and load an ML model over Apache Kafka<p>I've been looking around here and on the Internet, but it seems that I'm the first one having this question.</p... |
72,222,517 | How to test form controls avoiding bracket notation to preserve type checking and maintainability<h3>The Problem</h3>
<p>My unit tests on a form break when I refactor an object's member because I can only access the formcontrols on a fromgroup by using bracket notation. This string based selection of the member under t... | <p>The proper way of getting a form control from a FormGroup is to use its <code>get</code> function:</p>
<pre><code>const descControl = comp.form.get('description')
descControl.setValue(null)
</code></pre>
<p>this way if the form control is missing, at least your tests will raise an error about it.</p>
<p>The angular ... | How to test form controls avoiding bracket notation to preserve type checking and maintainability | angular|typescript|unit-testing|angular-forms|form-control | 0 | 60 | 1 | 72,223,415 | 72,223,415 | 1 | true | 2022-05-12T22:04:02.477Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to test form controls avoiding bracket notation to preserve type checking and maintainability<h3>The Problem</h3>
<p>My unit tests on a form break when I... |
72,222,866 | Learning flutter from c# models and http call using http.dart for first time<p>I am learning dart coming from a c# back ground and flutter. I am following this tutorial <a href="https://www.djamware.com/post/5f308ef7185c336b811b362a/flutter-tutorial-consume-crud-rest-api-android-and-ios-apps" rel="nofollow noreferrer">... | <p>Your factory constructor is trying to call the main constructor using named parameters, but it uses positional parameters. Updated class below (with Dart style tweaks).</p>
<pre><code>class Player {
final int id;
final int type;
final String playerLevel;
final String firstName;
final String surname;
Pla... | Learning flutter from c# models and http call using http.dart for first time | flutter|dart | 0 | 44 | 1 | 72,223,485 | 72,223,485 | 1 | true | 2022-05-12T22:57:36.577Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Learning flutter from c# models and http call using http.dart for first time<p>I am learning dart coming from a c# back ground and flutter. I am following th... |
72,223,460 | How to create a cookie to store the timestamp of when a page is first loaded with php<p>I would really appreciate any help if possible!</p>
<p>This is the question:
Use a cookie (NOT PHP SESSION) that expires a year from now to do the following:
Record the timestamp of the FIRST load of this page (but NOT any subsequen... | <p>Check if the cookie is already set. If not, set the cookie to the current timestamp.</p>
<pre><code>if (!isset($_COOKIE['load_date'])) {
setcookie('load_date', time(), time() + 86400*365);
}
</code></pre> | How to create a cookie to store the timestamp of when a page is first loaded with php | php|cookies|timestamp | 0 | 148 | 1 | 72,223,531 | 72,223,531 | 1 | true | 2022-05-13T01:00:07.173Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create a cookie to store the timestamp of when a page is first loaded with php<p>I would really appreciate any help if possible!</p>
<p>This is the qu... |
72,223,011 | Pandas: return rows that have two matching columns commonality<p>I am trying to write a commonality script which will return rows in a pandas dataframe that have two matching columns, and also will sum up the number of rows with matches into a new column</p>
<p>OPERATION and MACHINE are the columns to match</p>
<p>Inpu... | <pre><code>df[df.groupby(['OPERATION', 'MACHINE'])['BATCH'].transform('count') > 1].assign(MATCHES = df.groupby(['OPERATION', 'MACHINE'])['BATCH'].transform('count'))
BATCH OPERATION MACHINE DATE MATCHES
4 1C 2000 Phone2 05-Jan-22 2
5 1A 2000 Phone2 06-Jan-22 2
</code><... | Pandas: return rows that have two matching columns commonality | python|pandas|dataframe|filter|match | 0 | 22 | 1 | 72,223,570 | 72,223,570 | 1 | true | 2022-05-12T23:24:41.767Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas: return rows that have two matching columns commonality<p>I am trying to write a commonality script which will return rows in a pandas dataframe that ... |
72,223,232 | Number Matcher Error even though values are of type Number<p>I am having trouble with the third test case in my describe case. More specifically, I get the error with the line <code>expect(secondResult._body.length).toHaveLength(initalBlogs.length + 1)</code>. Here I keep getting a "Matcher error: received value m... | <p>In this line</p>
<pre class="lang-js prettyprint-override"><code>expect(secondResult._body.length).toHaveLength(initalBlogs.length + 1)
</code></pre>
<p>you are computing the length twice: once with <code>.length</code> and once with <code>.toHaveLength()</code>.<br />
In other words, you are testing the value of <c... | Number Matcher Error even though values are of type Number | jestjs | 0 | 25 | 1 | 72,223,579 | 72,223,579 | 1 | true | 2022-05-13T00:05:40.800Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Number Matcher Error even though values are of type Number<p>I am having trouble with the third test case in my describe case. More specifically, I get the e... |
72,223,560 | Failed to capture the error message in linux<p>Failed to capture the response for the below command;</p>
<pre><code>URL="https://gsdfdsfithub.com/gitexpert/testGithub.git" > /dev/null
git ls-remote $URL -q
if [ $? -nq 0 ]; then
echo "Failed, please provide valid url"
fi
</code></pre>
<p><s... | <p>Print stdout and stderr to <code>/dev/null</code>.</p>
<pre><code>URL="https://gsdfdsfithub.com/gitexpert/testGithub.git" > /dev/null
git ls-remote $URL -q >> /dev/null 2>&1
if [ $? != 0 ]; then
echo "Failed, please provide valid url"
fi
</code></pre> | Failed to capture the error message in linux | bash|shell | 0 | 29 | 1 | 72,223,601 | 72,223,601 | 1 | true | 2022-05-13T01:24:42.473Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Failed to capture the error message in linux<p>Failed to capture the response for the below command;</p>
<pre><code>URL="https://gsdfdsfithub.com/gitexp... |
72,223,453 | pandas, access a series of lists as a set and take the set difference of 2 set series<p>Given 2 pandas series, both consisting of lists (i.e. each row in the series is a list), I want to take the set difference of 2 columns</p>
<p>For example, in the dataframe...</p>
<pre><code>pd.DataFrame({
'A': [[1, 2, 3], [4, 5... | <p>Thanks to: <a href="https://www.geeksforgeeks.org/python-difference-two-lists/" rel="nofollow noreferrer">https://www.geeksforgeeks.org/python-difference-two-lists/</a></p>
<pre><code>def Diff(li1, li2):
return list(set(li1) - set(li2)) + list(set(li2) - set(li1))
df['C'] = df.apply(lambda x: Diff(x['A'], x['B'... | pandas, access a series of lists as a set and take the set difference of 2 set series | python|pandas|set | 0 | 27 | 1 | 72,223,642 | 72,223,642 | 1 | true | 2022-05-13T00:57:56.520Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pandas, access a series of lists as a set and take the set difference of 2 set series<p>Given 2 pandas series, both consisting of lists (i.e. each row in the... |
72,223,511 | Do you have to use multipe try excepts for various KeyErrors closely coupled? Can they be combined without losing functionality in Try clause<p>Let's imagine I'm trying to print results from a request response. If I have multiple parameters I want to check, but may not necessarily be in every response I can contain the... | <p>There is a few way to do this:</p>
<p>Separate try - expect</p>
<pre><code>def print_response(response):
print(response)
results = response.json()['results']
try:
print(response.elapsed.total_seconds())
KeyError as e:
print("There is no key:", e)
try:
print(... | Do you have to use multipe try excepts for various KeyErrors closely coupled? Can they be combined without losing functionality in Try clause | python|keyerror|try-except | 0 | 23 | 1 | 72,223,662 | 72,223,662 | 1 | true | 2022-05-13T01:13:07.520Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Do you have to use multipe try excepts for various KeyErrors closely coupled? Can they be combined without losing functionality in Try clause<p>Let's imagine... |
72,209,542 | How to find a value of a key in a nested dictionary with lists?<p>There's some very strange json payloads that I need to parse and I'm complete stuck..</p>
<p>Say I have a nested dictionary with lists that looks like this:</p>
<pre><code>test_dict1 = {
"blah":"blah",
"alerts": [{&... | <p>Since you do not know how deep inside the value is, it is prob advisable to use a recursive function to iterate through all the layers till it's found. I used DFS below.</p>
<pre><code>def search(ld, find):
if(type(ld)==list):
for i in ld:
if(type(i)==list or type(i)==dict):
r... | How to find a value of a key in a nested dictionary with lists? | python|loops|dictionary | 0 | 46 | 3 | 72,223,674 | 72,223,674 | 1 | true | 2022-05-12T02:38:32.080Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to find a value of a key in a nested dictionary with lists?<p>There's some very strange json payloads that I need to parse and I'm complete stuck..</p>
<... |
72,215,153 | Contrast emmeans: post-hoc t-test as the average differences of the differences between baseline and treatment periods<p>I am using the lme4 package in R to undertake linear mixed effect models (LMM). Essentially all participants received two interventions (an intervention treatment and a placebo (control)) and were se... | <p>A two-period crossover is the same as a repeated 2x2 Latin square. My suggestion for future such experiments is to structure the data accordingly, using variables for sequence (rows), period (columns), and treatment (assigned in the pattern (A,B) first sequence and (B,A) second sequence. The subjects are randomized ... | Contrast emmeans: post-hoc t-test as the average differences of the differences between baseline and treatment periods | lme4|emmeans|lsmeans | 0 | 91 | 1 | 72,223,933 | 72,223,933 | 1 | true | 2022-05-12T11:58:04.367Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Contrast emmeans: post-hoc t-test as the average differences of the differences between baseline and treatment periods<p>I am using the lme4 package in R to ... |
72,223,946 | Convert nested dictionary to flat pandas dataframe<p>How can I convert a nested dictionary into a flat pandas df? Something such as this:</p>
<pre><code>my_dict = {'Level1': {'Level21': {'Level31': 'some_value_31'},
'Level22': {'Level31': 'some_value_32'},
'Level23': {'Level31: 'some_value_31', 'Level32': 'some_val... | <p>Try this,</p>
<pre><code>df = pd.DataFrame(my_dict["Level1"]).T.reset_index().rename(columns = {"index":"Level1"})
</code></pre>
<p>Output -</p>
<div class="s-table-container">
<table class="s-table">
<thead>
<tr>
<th style="text-align: center;"></th>
<th style="text-align: center;">Lev... | Convert nested dictionary to flat pandas dataframe | python|pandas | 0 | 33 | 1 | 72,224,042 | 72,224,042 | 1 | true | 2022-05-13T02:48:38.327Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert nested dictionary to flat pandas dataframe<p>How can I convert a nested dictionary into a flat pandas df? Something such as this:</p>
<pre><code>my_d... |
72,216,141 | Accessing application property in Spring boot application from MapStruct mapper<p>I want to access <code>basic-info.expiration</code> from <code>application.yml</code> a Spring boot application.</p>
<h4>application.yml</h4>
<pre class="lang-yaml prettyprint-override"><code>basic-info:
expiration: 6
</code></pre>
<h4>... | <p>As @M. Deinum suggested, interface was changed to an abstract class. This is the most preferred method since application need no refactoring.</p>
<pre><code>@Mapper(componentModel = "spring")
public abstract class UserMapper {
@Value("${basic-info.expiration}")
long expireInMonths = 0;
@Ma... | Accessing application property in Spring boot application from MapStruct mapper | java|spring|spring-boot|mapstruct | 0 | 167 | 1 | 72,224,107 | 72,224,107 | 1 | true | 2022-05-12T13:06:41.583Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Accessing application property in Spring boot application from MapStruct mapper<p>I want to access <code>basic-info.expiration</code> from <code>application.... |
72,211,014 | Keywords extraction in Python - How to handle hyphenated compound words<p>I'm trying to perform keyphrase extraction with Python, using KeyBert and pke PositionRank. You can see an extract of my code below.</p>
<pre><code>from keybert import KeyBERT
from keyphrase_vectorizers import KeyphraseCountVectorizer
import pke
... | <p>this could be a silly workaround but it may help :</p>
<pre><code>from keybert import KeyBERT
from keyphrase_vectorizers import KeyphraseCountVectorizer
import pke
text = "The life-cycle Global Warming Potential of the building
resulting from the construction has been calculated for each stage in
the life-cyc... | Keywords extraction in Python - How to handle hyphenated compound words | python|nlp | 0 | 106 | 2 | 72,224,302 | 72,224,302 | 1 | true | 2022-05-12T06:32:39.867Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Keywords extraction in Python - How to handle hyphenated compound words<p>I'm trying to perform keyphrase extraction with Python, using KeyBert and pke Posit... |
72,224,335 | Is the parent object reference changed if a child object is changed?<p>Suppose I have this</p>
<pre><code>let a = { data: 'old' }
</code></pre>
<p>Lets say hypothetically that a has a reference to '123'</p>
<p>If I do</p>
<pre><code>a.data = 'new'
</code></pre>
<p>Is the reference of a still pointing to '123' or has it... | <p>You can make a very simple test for this:</p>
<pre><code>let a = { data: "something" };
let b = a;
</code></pre>
<p>Now <code>a</code> and <code>b</code> are references to the exact same object.</p>
<pre><code>a.data = "something else";
console.log(a === b); // true
</code></pre>
<p>Assigning to ... | Is the parent object reference changed if a child object is changed? | javascript|reactjs | 0 | 42 | 2 | 72,224,361 | 72,224,361 | 1 | true | 2022-05-13T04:08:51.587Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is the parent object reference changed if a child object is changed?<p>Suppose I have this</p>
<pre><code>let a = { data: 'old' }
</code></pre>
<p>Lets say h... |
72,224,208 | A difference between Mono.mapNotNull(....) and Mono.flatMap(Mono.justOrEmpty(....))<p>Being a novice to Project Reactor I'm trying to wrap my head around the documentation. However I still can't figure out if there any practical difference between the following (pseudo-)code:</p>
<pre><code>aMonoObject
.flatMap(val... | <p>The result will be the same but there is a semantic difference between the two. In your case, the <code>mapNotNull</code> is a better choice because it does exactly what you need: transforms the emitted value within the existing stream. You could use <code>Mono.justOrEmpty</code> if you wanted to start a new stream.... | A difference between Mono.mapNotNull(....) and Mono.flatMap(Mono.justOrEmpty(....)) | java|project-reactor | 0 | 112 | 1 | 72,224,377 | 72,224,377 | 1 | true | 2022-05-13T03:42:58.400Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
A difference between Mono.mapNotNull(....) and Mono.flatMap(Mono.justOrEmpty(....))<p>Being a novice to Project Reactor I'm trying to wrap my head around the... |
72,224,194 | array_key_exists(): The first argument should be either a string or an integer<p>Im trying to upload an image in my Laravel app. but have an error:</p>
<p>array_key_exists(): The first argument should be either a string or an integer</p>
<p>Im using the enctype: <code><form method="POST" action="/prod... | <p>Validation rules cannot have spaces. Try to simplify the method and use everything that the Laravel framework offers you.</p>
<p>Example:</p>
<pre><code>
public function crearProducto(Request $request)
{
// Validation rules cannot have spaces.
$request->validate([
'nombre_p... | array_key_exists(): The first argument should be either a string or an integer | php|laravel | 0 | 649 | 1 | 72,224,431 | 72,224,431 | 1 | true | 2022-05-13T03:39:44.493Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
array_key_exists(): The first argument should be either a string or an integer<p>Im trying to upload an image in my Laravel app. but have an error:</p>
<p>ar... |
72,224,462 | how to make a curved design in constraintLayout as given below<p><a href="https://i.stack.imgur.com/RylG5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RylG5.png" alt="enter image description here" /></a></p>
<p>How to make this curved view having text inside, in constraint Layout</p> | <p>Add a background to your parent layout of the textview like this</p>
<pre><code>android:background="@drawable/my_bg"
</code></pre>
<p>and create <code>my_bg.xml</code> like this</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<shape
android:shape="rectangle"... | how to make a curved design in constraintLayout as given below | android|responsive-design|android-constraintlayout|android-drawable|curve | 0 | 54 | 1 | 72,224,484 | 72,224,484 | 1 | true | 2022-05-13T04:29:45.377Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to make a curved design in constraintLayout as given below<p><a href="https://i.stack.imgur.com/RylG5.png" rel="nofollow noreferrer"><img src="https://i.... |
72,224,049 | Arrays, SUM + INDEX/MATCH<p><a href="https://i.stack.imgur.com/rsyOk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rsyOk.png" alt="enter image description here" /></a></p>
<p>Note: tried in Excel and Google Sheets, but I have a preference for Sheets.</p>
<p>Basically I want to get the sum of a grou... | <p>If you are not strict to use INDEX and MATCH, you may use the following solution:</p>
<p>Add extra column name it "Month", this column will extract the month name from the date column using TEXT function as the following:</p>
<pre><code>=IF(C3<>"",TEXT(C3,"mmmm"),"")
</c... | Arrays, SUM + INDEX/MATCH | arrays|excel|google-sheets | 0 | 125 | 3 | 72,224,543 | 72,224,543 | 1 | true | 2022-05-13T03:10:31.773Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Arrays, SUM + INDEX/MATCH<p><a href="https://i.stack.imgur.com/rsyOk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rsyOk.png" alt="enter... |
72,224,486 | Angular double curly braces expressions being executed multiple times on mouse down and up<p>In our Angular app, given code like the following:</p>
<pre><code><div>{{ aGetProperty }}</div>
<div>{{ aMethod() }}</div>
</code></pre>
<p>Whenever I click anywhere on the page, these expressions are e... | <p>Angular actually patches the browsers's low-level API: for example the addEventListener is patched to check for changes in DOM and rerender the view. Thus, when you click on the DOM elements Angular will run change detection and your method calls in DOM will get executed. In other words: it's a bad practice to bind ... | Angular double curly braces expressions being executed multiple times on mouse down and up | javascript|angular|ionic-framework | 0 | 33 | 1 | 72,224,651 | 72,224,651 | 1 | true | 2022-05-13T04:33:55.853Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular double curly braces expressions being executed multiple times on mouse down and up<p>In our Angular app, given code like the following:</p>
<pre><cod... |
72,223,928 | How to use MatchIT R package to use caliper width on logit of the propensity score instead of the propensity score?<p>The R package MatchIT uses a caliper width on the standard deviation of the propensity score. Is there a way to use logit of the propensity score?</p> | <p>Yes. In the <code>link</code> argument, specifiy <code>link = "linear.logit"</code>. Below is an example:</p>
<pre class="lang-r prettyprint-override"><code>m <- matchit(A ~ X1 + X2, data = data, method = "nearest",
distance = "glm", link = "linear.logit",
... | How to use MatchIT R package to use caliper width on logit of the propensity score instead of the propensity score? | r|propensity-score-matching | 0 | 106 | 1 | 72,224,737 | 72,224,737 | 1 | true | 2022-05-13T02:45:14.417Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use MatchIT R package to use caliper width on logit of the propensity score instead of the propensity score?<p>The R package MatchIT uses a caliper wi... |
72,222,129 | Channels django nginx 502<p>I ran into a problem once I install and add "channels" to the settings and after that to the asgi file. Server crashes, I get 502 and nginx won't start. How can I add these channels and start working already</p>
<pre><code>ASGI_APPLICATION = "mysite.asgi.application"
app... | <p>Did you configure Nginx properly? Below is a sample Nginx config.</p>
<pre><code>upstream channels-backend {
server localhost:8000;
}
...
server {
...
location / {
try_files $uri @proxy_to_app;
}
...
location @proxy_to_app {
proxy_pass http://channels-backend;
proxy_h... | Channels django nginx 502 | django|nginx|django-channels|http-status-code-502 | 0 | 47 | 1 | 72,224,773 | 72,224,773 | 1 | true | 2022-05-12T21:14:55.020Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Channels django nginx 502<p>I ran into a problem once I install and add "channels" to the settings and after that to the asgi file. Server crashes,... |
72,221,986 | how to merge multiple datasets with differences in merge-index strings?<p>Hello I am struggling to find a solution to probably a very common problem.</p>
<p>I want to merge two csv-files with soccer data. They basically store different data of the same games. Normally I would do a merge with <code>.merge</code>, but th... | <p>As commenters and existing answer have suggested, if the number of unique names is not too large, then you can manually extract the mismatches and correct them. That is probably the best solution unless the number of mismatches is very large.</p>
<p>Another case which can occur, is when you have a ground truth list ... | how to merge multiple datasets with differences in merge-index strings? | python|pandas|dataframe|merge|data-science | 0 | 53 | 2 | 72,224,805 | 72,224,805 | 1 | true | 2022-05-12T20:57:50.503Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to merge multiple datasets with differences in merge-index strings?<p>Hello I am struggling to find a solution to probably a very common problem.</p>
<p>... |
72,224,682 | Why use AddScoped() instead of AddSingleton()?<p>Why I should use <code>AddScoped()</code> for my repositories or services? Why not <code>AddSingleton()</code>?
I know about differences between them, but dont understand why I shouldn't use singleton instances to avoid creating new objects for each requests.
Can you exp... | <p>As you said, you know the difference so I won't get into that.</p>
<p>The reason you don't want addSingleton for your repositories or services is because typically your repositories and services are considered "business logic" and "persistence logic". And in your business logic you might have som... | Why use AddScoped() instead of AddSingleton()? | c#|asp.net-core|dependency-injection | 0 | 504 | 2 | 72,224,965 | 72,224,965 | 1 | true | 2022-05-13T05:05:36.473Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why use AddScoped() instead of AddSingleton()?<p>Why I should use <code>AddScoped()</code> for my repositories or services? Why not <code>AddSingleton()</cod... |
72,218,875 | What is needed to be able to make a backup of mongo database<p>I am trying to make a backup of mongo database, but I keep getting authentication errors.
I gave my user all the privileges I could and I still cannot do a backup:</p>
<pre><code># mongosh --host 10.1.10.1 --port 27017 -u administrator admin --quiet --eval ... | <p>You need to specify the authentication database, for example</p>
<pre><code>mongodump --host 10.1.10.1 --port 27017 -u administrator --authenticationDatabase=admin ...
</code></pre>
<p>On <code>mongosh</code> the authentication database defaults to the database you connect. See <a href="https://stackoverflow.com/que... | What is needed to be able to make a backup of mongo database | mongodb | 0 | 56 | 1 | 72,224,973 | 72,224,973 | 1 | true | 2022-05-12T16:07:21.167Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is needed to be able to make a backup of mongo database<p>I am trying to make a backup of mongo database, but I keep getting authentication errors.
I ga... |
72,222,999 | Implementing js script for scrolling to a target in Clojurescrip - Re-frame<p>I'm working on a Clojure project, using clojure, clojurescript, re-frame and reagent.
There is a button that I want when it is clicked, the user jumps to the related image tag by scrolling.
There are lots of buttons that each button should sc... | <p>You're probably looking for <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView" rel="nofollow noreferrer"><code>Element.scrollIntoView()</code></a>. I also don't think you have to modify <code>events.cljs</code>, just add this code into <code>views.cljs</code> (I also added some images ... | Implementing js script for scrolling to a target in Clojurescrip - Re-frame | javascript|clojurescript|re-frame | 0 | 77 | 1 | 72,225,037 | 72,225,037 | 1 | true | 2022-05-12T23:21:22.250Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Implementing js script for scrolling to a target in Clojurescrip - Re-frame<p>I'm working on a Clojure project, using clojure, clojurescript, re-frame and re... |
72,218,994 | Why does Xamarin.FFImageLoading SVG is not working on Android 11 & 12?<p>Xamarin.FFImageLoading SVG seems to not be working on Android 11 & 12.</p>
<p>For example, when I do Android Target to 11 Version, setting the SVG on Embedded Resource, with this code:</p>
<pre class="lang-xml prettyprint-override"><code><f... | <p>It seems that it's a special issue on the Android 11, and the solution is add the reference of the skiasharp or update the nuget package skiasharp both in the android part and the forms part.</p>
<p>You can check the following link:<a href="https://github.com/luberda-molinet/FFImageLoading/issues/1526" rel="nofollow... | Why does Xamarin.FFImageLoading SVG is not working on Android 11 & 12? | android|xamarin|svg|ffimageloading | 0 | 269 | 1 | 72,225,046 | 72,225,046 | 1 | true | 2022-05-12T16:16:21.007Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does Xamarin.FFImageLoading SVG is not working on Android 11 & 12?<p>Xamarin.FFImageLoading SVG seems to not be working on Android 11 & 12.</p>
<p>Fo... |
72,224,610 | cornerRadius on message SwiftUI<p>I'm having this problem that my messages don't have corner radius on the other side. This is how it looks:</p>
<p><img src="https://i.stack.imgur.com/aH8dm.png" width="300"></p>
<p>And there is the code for it:</p>
<pre><code>HStack {
HStack {
Text(text)
.fixedS... | <p>Actually what you're doing is applying padding after the background, in this way your padding will apply to your background view and now your background view is no more on the corner that's why no round corner on specific side, you can place padding before the background to achieve what you're looking for:</p>
<pre>... | cornerRadius on message SwiftUI | ios|swift|swiftui | 0 | 104 | 2 | 72,225,098 | 72,225,098 | 1 | true | 2022-05-13T04:52:27.730Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
cornerRadius on message SwiftUI<p>I'm having this problem that my messages don't have corner radius on the other side. This is how it looks:</p>
<p><img src=... |
72,224,529 | How to set a new audio data source for Android MediaPlayer in Kotlin<p>New to Android and Kotlin...</p>
<p>I am trying to set a new audio data source for the Android MediaPlayer. The below code compiles and runs, but the sound isn't played. No crash, no errors. The toast "Media Player prepared!" never shows u... | <p><code>MediaPlayer.create(...)</code> return new instance of <code>MediaPlayer</code> after call <code>prepare()</code>. Is useless to call <code>stop()</code> and <code>reset()</code> after <code>create(...)</code>. Using raw resource you have to setDataSource with <code>AssetFileDescriptor</code> like <code>setData... | How to set a new audio data source for Android MediaPlayer in Kotlin | android|kotlin|android-mediaplayer | 0 | 151 | 1 | 72,225,182 | 72,225,182 | 1 | true | 2022-05-13T04:40:21.227Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to set a new audio data source for Android MediaPlayer in Kotlin<p>New to Android and Kotlin...</p>
<p>I am trying to set a new audio data source for the... |
72,222,239 | docker-compose create volume of my app folder and run node command in it<p>Docker beginner here.</p>
<p>I am trying to set up docker for local development. My ultimate goal is to be able to use "vite" to do hot module reloading development server.</p>
<p>Here's what I am trying:</p>
<pre><code>#docker-compose... | <p>I think your issue is that you're using a docker volume. A docker volume is a piece of storage managed by docker. What you usually want when you're doing development with hot reload is a <em>bind mount</em> which lets the container access a part of the host's file system. With hot reload, you make a bind mount to th... | docker-compose create volume of my app folder and run node command in it | node.js|docker|docker-compose|dockerfile|docker-command | 0 | 278 | 1 | 72,225,265 | 72,225,265 | 1 | true | 2022-05-12T21:28:21.453Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
docker-compose create volume of my app folder and run node command in it<p>Docker beginner here.</p>
<p>I am trying to set up docker for local development. M... |
72,224,663 | Excel problem: Exported from OBIEE to Excel analysis adding time part to a date column<p>There is a date column used in OBIEE analysis. That column is declared as 'date' datatype in Oracle table, type in rpd is also 'DATE'. However, when exported to Excel, Excel is adding time values to the end of date part of this col... | <p>UseFormattedValue is the way to go because your problem isn't the Oracle side, but rather Microsoft trying to be "smart" in their interpretation in Excel.
<a href="https://docs.oracle.com/middleware/bi12214/biee/BIESG/GUID-FF6954BA-2DE0-4422-BA58-05F32936F4FF.htm#BIESG9196" rel="nofollow noreferrer">https:... | Excel problem: Exported from OBIEE to Excel analysis adding time part to a date column | excel|oracle|date|time|obiee | 0 | 39 | 1 | 72,225,357 | 72,225,357 | 1 | true | 2022-05-13T05:02:20.630Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Excel problem: Exported from OBIEE to Excel analysis adding time part to a date column<p>There is a date column used in OBIEE analysis. That column is declar... |
72,225,445 | Calling a REST API with Api Id and key using Python<p>I am trying to send a request to get a token to an API.</p>
<pre><code>curl -X POST "https://base_url/token"
-H "accept: application/json"
-H "Content-Type: application/json" -d "{ "appId": some_id, "appKey&q... | <p>You have to use <a href="https://docs.python-requests.org/en/latest/api/#requests.request" rel="nofollow noreferrer"><code>json</code> parameter instead of data</a>. It should contain <em>A JSON serializable Python object to send in the body of the Request.</em></p>
<pre>
rsp = requests.request("POST", url, headers=... | Calling a REST API with Api Id and key using Python | python|python-3.x|python-requests|api-key | 0 | 363 | 2 | 72,225,504 | 72,225,504 | 1 | true | 2022-05-13T06:46:43.507Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Calling a REST API with Api Id and key using Python<p>I am trying to send a request to get a token to an API.</p>
<pre><code>curl -X POST "https://base_... |
72,225,507 | Delete a word from a string which contains hashtags<p>I have already done a lot of "filtering" with regexp to remove unwanted characters from a string, this is what i am using:</p>
<pre><code>var regexpHashtag = new RegExp(/(?:^|\s)(?:#)([a-zA-Z\d]+)/g)
var regexpUrl = new RegExp(/(?:https?|ftp):\/\/[\n\S]+/g... | <p>Your logic admits that a hashtag may be preceded by some character, so remove the whitespace boundary check on the LHS:</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>var r... | Delete a word from a string which contains hashtags | javascript|node.js|regex|vue.js | 0 | 132 | 1 | 72,225,547 | 72,225,547 | 1 | true | 2022-05-13T06:53:52.817Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Delete a word from a string which contains hashtags<p>I have already done a lot of "filtering" with regexp to remove unwanted characters from a str... |
72,225,585 | CountDownLatch: object not locked by thread before wait()<p>I want to pause the main thread until the other thread finishes.
I tried <code>CountDownLatch</code> and semaphore. but none of them worked. I got the same error for both.</p>
<blockquote>
<p>Caused by: java.lang.IllegalMonitorStateException: object not locked... | <p>You are using the wrong method. You should call <code>await</code>, not <code>wait</code>. See <a href="https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/CountDownLatch.html" rel="nofollow noreferrer">CountDownLatch</a> for example code.</p> | CountDownLatch: object not locked by thread before wait() | java|android|multithreading | 0 | 60 | 3 | 72,225,698 | 72,225,698 | 1 | true | 2022-05-13T07:00:44.563Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CountDownLatch: object not locked by thread before wait()<p>I want to pause the main thread until the other thread finishes.
I tried <code>CountDownLatch</co... |
72,225,121 | Should you use required named parameters when making a data model in flutter?<p>Is it good practice to require named parameters for data models in flutter when you know that the data should always have a specific field like an id or username? I think this would remove unnecessary null checking, but I've always seen mod... | <p>Below is my opinion, i'm not sure it's true for all but it works for me</p>
<p><strong>Reason 1</strong>: it's too long and unnecessary to write the whole thing out, some Jsons can be very complicated to do this, moreover when you get the data in JSON you'll want to simply initialize <code>var A = A.fromJson(jsonDat... | Should you use required named parameters when making a data model in flutter? | firebase|flutter|dart|google-cloud-firestore | 0 | 73 | 1 | 72,225,702 | 72,225,702 | 1 | true | 2022-05-13T06:09:39.153Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Should you use required named parameters when making a data model in flutter?<p>Is it good practice to require named parameters for data models in flutter wh... |
72,191,366 | Azure Functions deployment fails because pip install cannot find environment variable / app setting<p><strong>EDIT:</strong> My flaw when deploying to Azure was that I was not saving the new Application settings I was introducing <em>facepalm</em>. Saving <code>PIP_EXTRA_INDEX_URL=https://<token>@raw.githubuserco... | <p>In this <a href="https://github.com/Azure/azure-functions-core-tools/issues/3054" rel="nofollow noreferrer">issue</a> it has been confirmed that this is expected behavior and that my workaround is valid:</p>
<blockquote>
<p>"local.settings.json" is unique to core tools and thus only applies
during the func... | Azure Functions deployment fails because pip install cannot find environment variable / app setting | python|azure|azure-functions | 0 | 362 | 1 | 72,225,720 | 72,225,720 | 1 | true | 2022-05-10T18:27:20.887Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Azure Functions deployment fails because pip install cannot find environment variable / app setting<p><strong>EDIT:</strong> My flaw when deploying to Azure ... |
72,209,326 | Is it possible to customize the contents of the Clear button in react-bootstrap-typeahead?<p>Using <a href="https://github.com/ericgio/react-bootstrap-typeahead" rel="nofollow noreferrer">react-bootstrap-typeahead</a> is it possible to change the contents of the Clear button?</p>
<p>I need to include a FontAwesome icon... | <p>You can't customize <code>ClearButton</code> itself, but you can follow the example you linked to and use your own clear/close button component:</p>
<pre><code><Typeahead ... >
{({ onClear, selected }) => (
<div className="rbt-aux">
{!!selected.length && <MyCloseButton... | Is it possible to customize the contents of the Clear button in react-bootstrap-typeahead? | font-awesome|react-bootstrap-typeahead | 0 | 64 | 1 | 72,225,769 | 72,225,769 | 1 | true | 2022-05-12T01:59:58.050Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to customize the contents of the Clear button in react-bootstrap-typeahead?<p>Using <a href="https://github.com/ericgio/react-bootstrap-typeah... |
72,225,540 | How to get .vbs output in the same window of a .bat file<p>I have a batch file that does a lot of different things and within that batch file, at some step, I'm running a VBS script. The problem is, the execution/output of this script will always open a new window, runs the script there and then it closes leaving me wi... | <p>Don't use the <code>start</code> command. Type <code>start /?</code>.</p>
<pre><code>C:\WINDOWS\system32>start /?
Starts a separate window to run a specified program or command.
</code></pre>
<p><code>Start</code> is used to start programs in unusual ways. Normal ways you just type the inbuilt command or full pa... | How to get .vbs output in the same window of a .bat file | windows|batch-file|vbscript|script | 0 | 62 | 1 | 72,225,808 | 72,225,808 | 1 | true | 2022-05-13T06:56:46.283Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get .vbs output in the same window of a .bat file<p>I have a batch file that does a lot of different things and within that batch file, at some step, ... |
72,177,883 | A problem in modeling the emissions in SUMO<p>Trying to model vehicles' emissions, I used the HBEFA model. There is an issue when the vehicles stop( the first two seconds in my scenario) or decelerate so that no emissions data are recorded during these situations. While I replaced my emission models with PHEMlight, I n... | <p>Essentially this is an open bug in SUMO see <a href="https://github.com/eclipse/sumo/issues/2110" rel="nofollow noreferrer">https://github.com/eclipse/sumo/issues/2110</a> and the references therein. There is currently no good workaround except for manually adapting the emission values after the run for those vehicl... | A problem in modeling the emissions in SUMO | sumo | 0 | 21 | 1 | 72,225,876 | 72,225,876 | 1 | true | 2022-05-09T20:28:39.223Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
A problem in modeling the emissions in SUMO<p>Trying to model vehicles' emissions, I used the HBEFA model. There is an issue when the vehicles stop( the firs... |
72,221,742 | Bokeh HoverTool datetime formatter not working<p>My code for the bokeh HoverTool is the following:</p>
<pre><code>p = figure(
plot_height=250,
x_axis_type='datetime',
)
p.vbar(x=data_df['date'].dt.to_pydatetime(), top=data_df['data'].values, width=datetime.timedelta(1))
hover_tool = HoverTool(
... | <p>Your solution works, if you use <code>$x</code> instead of <code>@x</code> and add one of the listed formats supported by the <a href="https://docs.bokeh.org/en/latest/docs/reference/models/formatters.html#datetimetickformatter" rel="nofollow noreferrer"><code>DatetimeTickFormatter</code></a> to <code>('Date', '$x')... | Bokeh HoverTool datetime formatter not working | python|charts|hover|bokeh | 0 | 97 | 1 | 72,225,922 | 72,225,922 | 1 | true | 2022-05-12T20:29:51.237Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Bokeh HoverTool datetime formatter not working<p>My code for the bokeh HoverTool is the following:</p>
<pre><code>p = figure(
plot_height=250,
... |
72,225,872 | How to check 2 conditions in angular ngif<p>I am little stuck trying to get this *ngIf to work correctly. What I am trying to do is show the div if it is empty only if the user viewing is owner. If the user is a guest, and the div is empty, it should not be shown. here is what I have:</p>
<pre><code><div *ngIf="... | <p>It's logic: Show the div if its NOT empty OR the user is the owner:</p>
<pre><code><div *ngIf="(tray.flyers.length > 0) || (isOwner === true)"></div>
</code></pre> | How to check 2 conditions in angular ngif | angular|typescript | 0 | 228 | 1 | 72,225,941 | 72,225,941 | 1 | true | 2022-05-13T07:28:41.323Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to check 2 conditions in angular ngif<p>I am little stuck trying to get this *ngIf to work correctly. What I am trying to do is show the div if it is emp... |
72,225,840 | Order By Date desc evaluates 01-01-1970 higher then everything else<p>I have the following simplified query</p>
<pre><code>SELECT
id
to_char(execution_date, 'YYYY-MM-DD') as execution_date
FROM schema.values
ORDER BY execution_date DESC, id DESC
</code></pre>
<p>execution_date can be null.</p>
<p>If no value is ... | <p><a href="https://dbfiddle.uk/?rdbms=postgres_14&fiddle=5d1fc31a3cf2d3121092f2446cce87e5" rel="nofollow noreferrer">https://dbfiddle.uk/?rdbms=postgres_14&fiddle=5d1fc31a3cf2d3121092f2446cce87e5</a></p>
<pre><code>SELECT
id,
to_char(coalesce( execution_date, '1970-01-01'::date), 'YYYY-MM-DD') as execut... | Order By Date desc evaluates 01-01-1970 higher then everything else | postgresql|date|sql-order-by | 0 | 99 | 3 | 72,226,082 | 72,226,082 | 1 | true | 2022-05-13T07:26:34.987Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Order By Date desc evaluates 01-01-1970 higher then everything else<p>I have the following simplified query</p>
<pre><code>SELECT
id
to_char(execution... |
72,225,302 | Parametrizing with class method, then calling that method with object<p>(pseudo-code)
I have class Node with properties:</p>
<pre><code>class Node(WebElement):
def __init__(self, element):
super().__init__(element)
...
@property
def name(self):
<returns name>
@property
... | <p>You can do:</p>
<pre class="lang-py prettyprint-override"><code>for node in nodes:
assert property.fget(node) is not None
</code></pre> | Parametrizing with class method, then calling that method with object | python|pytest|parametrized-testing | 0 | 36 | 1 | 72,226,113 | 72,226,113 | 1 | true | 2022-05-13T06:30:04.197Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Parametrizing with class method, then calling that method with object<p>(pseudo-code)
I have class Node with properties:</p>
<pre><code>class Node(WebElement... |
72,218,230 | Bash - check if repository exists<p>I am trying to create if statement which will check if repository with name X exists, if it doesn't => create it.</p>
<p>Made following code. It works, but when repository doesn't exists, then it shows error. I couldn't find any ways of removing that error in console. Make I was u... | <p>As soon as you <a href="https://askubuntu.com/questions/1010213/how-to-completely-silence-git-ls-remote">completely silence git ls-remote</a> I will suggest to check the exit code of the command (<code>$?</code>) rather than its output.</p>
<p>Based on your code you could consider a function in this way:</p>
<pre cl... | Bash - check if repository exists | bash|if-statement|github|terminal | 0 | 112 | 1 | 72,226,160 | 72,226,160 | 1 | true | 2022-05-12T15:20:12.127Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Bash - check if repository exists<p>I am trying to create if statement which will check if repository with name X exists, if it doesn't => create it.</p>
... |
72,211,417 | Flink checkpoint not replaying the kafka events which were in process during the savepoint/checkpoint<p>I want to test end-to-end exactly once processing in flink. My job is:</p>
<blockquote>
<p>Kafka-source -> mapper1 -> mapper-2 -> kafka-sink</p>
</blockquote>
<p>I had put a <code>Thread.sleep(100000)</code>... | <p>For exactly-once, you must provide a <code>TransactionalIdPrefix</code> unique across all applications running against the same Kafka cluster (this is a change compared to the legacy <code>FlinkKafkaConsumer</code>):</p>
<pre class="lang-java prettyprint-override"><code>KafkaSink<T> sink =
KafkaSink.&l... | Flink checkpoint not replaying the kafka events which were in process during the savepoint/checkpoint | apache-flink|kafka-consumer-api|flink-streaming | 0 | 138 | 1 | 72,226,308 | 72,226,308 | 1 | true | 2022-05-12T07:11:30.273Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flink checkpoint not replaying the kafka events which were in process during the savepoint/checkpoint<p>I want to test end-to-end exactly once processing in ... |
72,101,677 | Need help by populating a PrimeReact Tree<p>I'm trying to populate a PrimeReact Tree with data from sqlite3 database, but it doesnt work.</p>
<p>Here is my SQL-Query:</p>
<pre><code>select 'prj:'||p.id as key,p.name as label,(
select json_group_array(json_object('key',key,'label',label))
from(
select 'tpr:'||tpr.id... | <p>If <code>initial</code> is your json to be mapped to <code>Tree</code>, then you need to make a slight modification to convert string to array</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprin... | Need help by populating a PrimeReact Tree | javascript|sql|sqlite|primereact | 0 | 32 | 1 | 72,226,313 | 72,226,313 | 1 | true | 2022-05-03T15:19:52.680Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Need help by populating a PrimeReact Tree<p>I'm trying to populate a PrimeReact Tree with data from sqlite3 database, but it doesnt work.</p>
<p>Here is my S... |
72,224,616 | validating multiple input query params in Mule 4<p>I am using Mule 4.4 community edition
I have a GET endpoint with 4 query params:</p>
<blockquote>
<p>empId ( mandatory )</p>
</blockquote>
<blockquote>
<p>collegeId ( mandatory )</p>
</blockquote>
<blockquote>
<p>subject ( either subject or score is required )</p>
</... | <p>I do not think you can customize the error message solely via Open API Specs, However when you generate the flows in your application, it will create error handlers too for APIKIT validations. You can write a transform message within the <strong>bad request</strong> error handler to modify the response by checking t... | validating multiple input query params in Mule 4 | mule|openapi|mule4 | 0 | 124 | 1 | 72,226,448 | 72,226,448 | 1 | true | 2022-05-13T04:53:17.567Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
validating multiple input query params in Mule 4<p>I am using Mule 4.4 community edition
I have a GET endpoint with 4 query params:</p>
<blockquote>
<p>empId... |
72,225,510 | How can I strech an axis of a plotly plot?<p>See the image in the link for reference: <a href="https://i.stack.imgur.com/nlxV5.png" rel="nofollow noreferrer">1</a></p>
<p>Even though the figure is pretty wide, the plot itself is way to small. Adjusting the figure size however doesn't improve the size of the plot.</p>
<... | <p>You have to play with the aspect ratio:</p>
<pre><code>fig.update_layout({"scene": {"aspectratio": {"x": 2, "y": 2, "z": 0.75}}})
</code></pre>
<p>Here are a couple of pictures. The first without setting aspect ratio, the second with the code above:</p>
<p><a href="h... | How can I strech an axis of a plotly plot? | python|plotly|plotly-python | 0 | 57 | 1 | 72,226,507 | 72,226,507 | 1 | true | 2022-05-13T06:54:08.953Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I strech an axis of a plotly plot?<p>See the image in the link for reference: <a href="https://i.stack.imgur.com/nlxV5.png" rel="nofollow noreferrer"... |
72,220,283 | Data warehouse design for parking lot - date and time dimensions<p>I came across a data warehousing practice question. I tried to think of various ways to design this but I'm not sure what the best practices are. The question deals with designing a data warehouse for a parking lot and writing a SQL query for getting th... | <p>Your model is a clear cut example of an accumulating snapshot table: foreign keys to dimensions would be vehicle_id, date_in_id, date_out_id, time_in_id and time_out_id. And as a measure the duration of parking.</p>
<p>When a car comes in date_in_id and time_in_id are populated, but not date_out_id, time_out_id nor ... | Data warehouse design for parking lot - date and time dimensions | data-modeling|data-warehouse|sql-data-warehouse | 0 | 35 | 1 | 72,226,644 | 72,226,644 | 1 | true | 2022-05-12T18:06:32.117Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Data warehouse design for parking lot - date and time dimensions<p>I came across a data warehousing practice question. I tried to think of various ways to de... |
72,225,731 | How to test Stripe Connect connected account creations<p>I want to use <code>Stripe Connect</code> to provide multiparty payments, in my website.</p>
<p>I have a platform. User A (customer) will pay User B (which is the service provider) on the platform and as a platform, I want to get some amount percentage in the mid... | <p>There are multiple points to clear:</p>
<ol>
<li>There are Standard, Express and Custom account types. There are also
3 fund flows of Direct Charge, Destination Charge, or Separate
Charges and Transfers. See <a href="https://stripe.com/docs/connect/charges#types" rel="nofollow noreferrer">comparison from Stripe Doc<... | How to test Stripe Connect connected account creations | stripe-payments | 0 | 104 | 1 | 72,226,684 | 72,226,684 | 1 | true | 2022-05-13T07:16:31.117Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to test Stripe Connect connected account creations<p>I want to use <code>Stripe Connect</code> to provide multiparty payments, in my website.</p>
<p>I ha... |
72,216,234 | How to create a .bat file which execute python file<p>I'm new to bat file and started to implementing it. I have a list of linux application commands which starts my application. I have a windows system to deploy, used to git bash to execute those commands, but in every system restart have to start the application manu... | <p>You will need to make 2 files, one for the windows command line (<code>.bat</code>) another for the <code>bash</code> script (<code>.sh</code>). The reason being, after you <code>start</code> the <code>bash</code> console, it will work on different window and it has no idea what your <code>.bat</code> contains. We s... | How to create a .bat file which execute python file | windows|batch-file|git-bash | 0 | 198 | 1 | 72,226,785 | 72,226,785 | 1 | true | 2022-05-12T13:12:18.683Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create a .bat file which execute python file<p>I'm new to bat file and started to implementing it. I have a list of linux application commands which s... |
72,226,467 | R: Building phylogenetic tree from arbitrary features?<p>StackExchange.</p>
<p>I'm trying to build a phylogenetic tree for >100 individuals, using R.</p>
<p>However, while tutorials for packages like APE and ggtree readily show how to do this using raw DNA or pre-sorted groupings (e.g. <em>(((A,B),(C,D)),E)</em>), m... | <p>A (phylogenetic) tree is just a hierarchical clustering of samples. The only thing needed is to define a dissimilarity measure between all sample pairs.
In your case, you have sets of numbers for each row, and thus we can use Jaccard for this. For example, all elements of sample B are also found in sample A, so they... | R: Building phylogenetic tree from arbitrary features? | r|phylogeny | 0 | 22 | 1 | 72,226,805 | 72,226,805 | 1 | true | 2022-05-13T08:20:30.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R: Building phylogenetic tree from arbitrary features?<p>StackExchange.</p>
<p>I'm trying to build a phylogenetic tree for >100 individuals, using R.</p>
... |
72,226,543 | Javascript classList.add to element with 0px height<p>Not sure if I'm missing something obvious here, but I'm trying to add a class to an element that has <code>0px</code> height to begin with.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code"... | <p>The problem is that if you put height 0 but do not set the <code>overflow: hidden</code> the text content of that div will overflow and cover the clickable text, so the click event won't be dispatched:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="sn... | Javascript classList.add to element with 0px height | javascript | 0 | 63 | 2 | 72,226,821 | 72,226,821 | 1 | true | 2022-05-13T08:26:33.103Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Javascript classList.add to element with 0px height<p>Not sure if I'm missing something obvious here, but I'm trying to add a class to an element that has <c... |
72,213,787 | How to change results as far as I move map in react-instantsearch-dom-maps<p>I am currently working with algolia and I have some strange issue with the map. I have this interface (left column is results, right column is map) like on this picture:</p>
<p><a href="https://i.stack.imgur.com/jfcKA.png" rel="nofollow norefe... | <p>The issue was caused by filters. I filtered results by location, so thats why I was returned to previous location.</p> | How to change results as far as I move map in react-instantsearch-dom-maps | reactjs|typescript|google-maps|algolia|react-instantsearch | 0 | 51 | 1 | 72,226,835 | 72,226,835 | 1 | true | 2022-05-12T10:15:54.940Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to change results as far as I move map in react-instantsearch-dom-maps<p>I am currently working with algolia and I have some strange issue with the map. ... |
72,226,667 | Split list by sum of sublist items<p>I have a list of sublists with file names and sizes. I need to split that list into sublists based on the criteria that each splitted sublist must have a total file size less than 500 000 000 bytes. I have tried multiple solutions but I could not find a way to make it work.
My last ... | <p>Is this what you want to get?</p>
<pre><code>import functools
import operator
data = [[r"c:\example_path", 480000], [r"c:\example_path2", 500000]] * 10000
list_final = []
total_size = 0
list_items_subset = []
for name, size in data:
total_size += size
if total_size < 500000000:
... | Split list by sum of sublist items | python|list | 0 | 45 | 1 | 72,226,866 | 72,226,866 | 1 | true | 2022-05-13T08:35:47.287Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Split list by sum of sublist items<p>I have a list of sublists with file names and sizes. I need to split that list into sublists based on the criteria that ... |
72,209,869 | How to get the groupby keys with a loop?<p>I need to do some somewhat complicated processing for each group after grouping.
in <code>pandas</code>, it can be writed as follows:</p>
<pre class="lang-py prettyprint-override"><code>for i,g in df.groupby(['id','sid']):
pass
</code></pre>
<p>While in polars, the <code>g... | <p>You could use partition by. This would yield a <code>dictionary</code> where the <code>groupby</code> keys map to the partitioned <code>DataFrames</code>.</p>
<pre class="lang-py prettyprint-override"><code>df = pl.DataFrame({
"groups": [1, 1, 2, 2, 2],
"values": pl.arange(0, 5, eager=Tru... | How to get the groupby keys with a loop? | python|python-polars | 0 | 91 | 1 | 72,226,898 | 72,226,898 | 1 | true | 2022-05-12T03:36:15.333Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get the groupby keys with a loop?<p>I need to do some somewhat complicated processing for each group after grouping.
in <code>pandas</code>, it can be... |
72,196,428 | Polars: Setting categorical column to a specific value while keeping categorical type<p>Can somebody help me with the preferred way to set a categorical value for some rows of a polars data frame (based on a condition)?</p>
<p>Right now I came up with a solution that works by splitting the original data frame in two pa... | <p>As of <code>polars>=0.13.33</code> you can simply set a categorical value with a <code>string</code> and the <code>Categorical</code> dtype will be maintained.</p>
<p>So in this case:</p>
<pre class="lang-py prettyprint-override"><code>df.with_column(
pl.when(pl.col("column") == "e").then(... | Polars: Setting categorical column to a specific value while keeping categorical type | python-polars | 0 | 207 | 1 | 72,226,927 | 72,226,927 | 1 | true | 2022-05-11T06:36:48.910Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Polars: Setting categorical column to a specific value while keeping categorical type<p>Can somebody help me with the preferred way to set a categorical valu... |
72,226,897 | Is it safe to use uid to store data in firebase database?<p>I plan on creating an application on flutter that uses firebase auth and cloud firestore. My plan is to create a user and the use the user's uid(iser id) to store and modify data in the database. So a specific id refers to a specific user.
I wanted to know if ... | <p>Would advise to use your custom ID along side with UID. When your app grows, you don't want to be sharing the UID or passing it around. Also while setting firebase rules, you'll be referring to UIDs, which should be kept private.</p>
<p>generate a random string for the ID.</p>
<p>And for sensitive user data, set a r... | Is it safe to use uid to store data in firebase database? | database|firebase|flutter|security|google-cloud-firestore | 0 | 177 | 1 | 72,226,978 | 72,226,978 | 1 | true | 2022-05-13T08:54:58.260Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it safe to use uid to store data in firebase database?<p>I plan on creating an application on flutter that uses firebase auth and cloud firestore. My plan... |
72,227,036 | How to keep dollar sign within sed in the bash script?<p>I am trying to find a way to escape the dollar sign within the <code>sed</code> command in a bash script. I have found here tons of answers that say that you need to put four backslashes in a row in order to escape the sign. I have also tried the version with two... | <p>You can escape the dollar sign with a backslash:</p>
<pre><code>sed -i "1ccd /home/userr/\$PARAMETER/\$METHOD" "/home/userr/Documents/aaa.txt"
</code></pre>
<p>Documentation here: <a href="https://www.gnu.org/software/bash/manual/html_node/Escape-Character.html" rel="nofollow noreferrer">https://... | How to keep dollar sign within sed in the bash script? | string|bash | 0 | 124 | 2 | 72,227,121 | 72,227,121 | 1 | true | 2022-05-13T09:04:39.947Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to keep dollar sign within sed in the bash script?<p>I am trying to find a way to escape the dollar sign within the <code>sed</code> command in a bash sc... |
72,226,450 | Is it possible to update a line of already printed text in python?<p>I am working on a text based operating system in Python and I am wondering if it would be possible to update an already printed string on the same line. There doesn't seem to be anything on this other than <a href="https://stackoverflow.com/questions/... | <p>You might be able to do this in a limited way by writing out <code>'\b'</code> to erase and rewrite.</p>
<pre><code>import sys
def foo()
sys.stdout.write('foo')
sys.stdout.flush()
sys.stdout.write('\b\b\b')
sys.stdout.write('bar')
sys.stdout.flush()
</code></pre>
<p>I'm doing a similar thing on ... | Is it possible to update a line of already printed text in python? | python|python-datetime | 0 | 93 | 3 | 72,227,136 | 72,227,136 | 1 | true | 2022-05-13T08:19:04.640Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to update a line of already printed text in python?<p>I am working on a text based operating system in Python and I am wondering if it would b... |
72,226,920 | pandas: declare a pandas dataframe as a constant<p>I would like to declare my dataframe as constant, so no matter what operations are happening in a modeule it's values or column names do not change. I know that it is possible to define constant variables using <strong>slot</strong> =() like so,</p>
<pre><code>class CO... | <p>Your first solution is applicable only for <em>immutable</em> data, consider following example</p>
<pre><code>class CONST(object):
__slots__ = ()
my_constant = {"x":1,"y":2,"z":3}
CONST = CONST()
CONST.my_constant.clear()
print(CONST.my_constant)
</code></pre>
<p>output</p>
<pr... | pandas: declare a pandas dataframe as a constant | python|pandas|constants|readonly-attribute | 0 | 86 | 1 | 72,227,211 | 72,227,211 | 1 | true | 2022-05-13T08:56:45.057Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pandas: declare a pandas dataframe as a constant<p>I would like to declare my dataframe as constant, so no matter what operations are happening in a modeule ... |
72,227,059 | How to hide the default android webview progress bar?<p>i work on an app that displays a page through a webview. I have implemented my own progress bar and it works fine. However i cannot get rid of the default android progress bar that keeps showing up (the three gray dots). The round progress indicator is mine the do... | <p>In WebView there is no progress by default while loading the web page, the three-dot progress that you are viewing must be from the website which you are loading</p> | How to hide the default android webview progress bar? | java|android|android-studio|webview|android-progressbar | 0 | 51 | 1 | 72,227,292 | 72,227,292 | 1 | true | 2022-05-13T09:06:15.653Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to hide the default android webview progress bar?<p>i work on an app that displays a page through a webview. I have implemented my own progress bar and i... |
72,227,242 | Changing transporterfleet based on programmaticaly created schedule<p>In following up related to my previous question <a href="https://stackoverflow.com/questions/72217914/add-variable-as-value-in-schedule-anylogic/72218970?noredirect=1#comment127608155_72218970">previous question</a>, when a schedule programmatically ... | <p>In the Capacity field, write <code>schedule == null ? 0. : schedule.getValue()</code></p>
<p>This will link it to your programmatic schedule, but only after it has been created (which is not done right at the start of the model but an instance later).</p> | Changing transporterfleet based on programmaticaly created schedule | anylogic | 0 | 44 | 1 | 72,227,299 | 72,227,299 | 1 | true | 2022-05-13T09:21:18.333Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Changing transporterfleet based on programmaticaly created schedule<p>In following up related to my previous question <a href="https://stackoverflow.com/ques... |
72,225,590 | What should the response status code be in a REST API when the given ID is a valid ID but there's no matching document?<p>I'm using MongoDB for my Express app and I know that when an ID is an invalid ID for the corresponding database, the response status code is 400 (Bad Request). But what if the ID is a valid ID but t... | <blockquote>
<p>What should the response status code be in a REST API when the given ID is a valid ID but there's no matching document?</p>
</blockquote>
<p><a href="https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-semantics#section-15.5.5" rel="nofollow noreferrer">404</a></p>
<blockquote>
<p>The <em>404 (Not ... | What should the response status code be in a REST API when the given ID is a valid ID but there's no matching document? | node.js|mongodb|rest|express|api-design | 0 | 31 | 1 | 72,227,368 | 72,227,368 | 1 | true | 2022-05-13T07:01:01.697Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What should the response status code be in a REST API when the given ID is a valid ID but there's no matching document?<p>I'm using MongoDB for my Express ap... |
72,227,309 | Question about Variables in powershell script<p>I'm writing a script and I was wondering if there is a way to give a variable for example $a from a script firstscript.ps1 to an other script secondscript.ps1 executed by firstscript.ps1</p>
<p>To clarify what I'm saying :</p>
<p>I exec firstscript.ps1 it does different t... | <blockquote>
<p>then it launch secondscript.ps1 on a remote computer and i would like the $a from to transfert firstscript.ps1 to secondscript.ps1</p>
</blockquote>
<p>Assuming you invoke the script remotely using <code>Invoke-Command</code>, pass arguments to the script via the <code>-ArgumentList</code> parameter:</p... | Question about Variables in powershell script | powershell | 0 | 40 | 1 | 72,227,407 | 72,227,407 | 1 | true | 2022-05-13T09:27:17.347Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Question about Variables in powershell script<p>I'm writing a script and I was wondering if there is a way to give a variable for example $a from a script fi... |
72,227,254 | Conways game of Life with 1D array<p>Right now I'm doing this <a href="https://rustwasm.github.io/book/game-of-life/implementing.html" rel="nofollow noreferrer">tutorial</a> for WebAssembly with Rust. The task is to implement <a href="https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life" rel="nofollow noreferrer">Conw... | <p>It ends up looking a bit odd because of the constraint of unsigned integers (<code>u32</code>). What we want to write is</p>
<pre class="lang-rust prettyprint-override"><code>for delta_row in [-1, 0, 1]
</code></pre>
<p>which gives every row within 1 of our original, but we can't use <code>-1</code> because it has a... | Conways game of Life with 1D array | arrays|rust|conways-game-of-life|rust-wasm | 0 | 96 | 1 | 72,227,424 | 72,227,424 | 1 | true | 2022-05-13T09:22:10.133Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Conways game of Life with 1D array<p>Right now I'm doing this <a href="https://rustwasm.github.io/book/game-of-life/implementing.html" rel="nofollow noreferr... |
72,217,651 | quarto rmarkdown code block to only display certain lines<p>I have a .qmd / .rmd file that wants to show the output of block of code. The code block has a lot of lines at the beginning that I'd like to hide, in the example below I'd like the output to be the third line of code <code>str(month)</code> and output the re... | <p>This does not work because you are using YAML syntax for chunk options as recommended with Quarto but <code>#| echo: c(3)</code> is not valid YAML. <code>#| echo: 3</code> is.</p>
<p>You can use <code>!expr</code> within YAML field to parse R code if necessary. <code>#| echo: !expr c(3)</code> would work. It is expl... | quarto rmarkdown code block to only display certain lines | r|r-markdown|quarto | 0 | 856 | 2 | 72,227,465 | 72,227,465 | 1 | true | 2022-05-12T14:40:58.943Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
quarto rmarkdown code block to only display certain lines<p>I have a .qmd / .rmd file that wants to show the output of block of code. The code block has a lo... |
72,227,384 | Git alias for checkout branch, pull and checkout back<p>We are using the Feature-Branch-Workflow, which means others merge theire changes to the <code>dev</code>-branch that I want to merge into my feature branch. As it happens a lot I would like to have a simple git alias which does:</p>
<ol>
<li>Checkout the <code>de... | <p>You'd have to use an ad hoc bash function to pass your parameter :</p>
<pre><code>git config alias.pab '!f() { git checkout $1 && git pull && git checkout -; }; f'
</code></pre>
<p>As a note, <code>git checkout -</code> is a handy shortcut for <code>git checkout @{-1}</code>, but both work.</p> | Git alias for checkout branch, pull and checkout back | bash|git|alias | 0 | 98 | 1 | 72,227,521 | 72,227,521 | 1 | true | 2022-05-13T09:32:48.380Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Git alias for checkout branch, pull and checkout back<p>We are using the Feature-Branch-Workflow, which means others merge theire changes to the <code>dev</c... |
72,225,745 | How to traverse an inner array in motoko?<p>I am new to motoko and internet computer, when i am working i am having too much difficulties that look simple, I am having difficulties doing this, posting the link to forum question here</p>
<p><a href="https://forum.dfinity.org/t/how-to-traverse-inner-array-of-a-trie/12941... | <p>I prepared a small code in motoko playground for you in order to see how you can traverse inner array and achieve your goal of filtering Trie. Here is as well saved project in motoko playground: <a href="https://m7sm4-2iaaa-aaaab-qabra-cai.raw.ic0.app/?tag=1150943578" rel="nofollow noreferrer">https://m7sm4-2iaaa-aa... | How to traverse an inner array in motoko? | motoko|internet-computer|dfinity | 0 | 46 | 1 | 72,227,534 | 72,227,534 | 1 | true | 2022-05-13T07:18:16.590Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to traverse an inner array in motoko?<p>I am new to motoko and internet computer, when i am working i am having too much difficulties that look simple, I... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.