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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
71,884,451 | How to implement the ability to hang out event handler when creating an item?<p>I have a <code>createEelement()</code> function.</p>
<p>With her, I will create HTML elements.</p>
<p>Function code:</p>
<pre><code>function createElement(tagName, options, ...children) {
const { classNames = [], attributes = {} } = optio... | <p>To resolve your problem, you could have an array of object, with the names of the events, the callbacks and the options of the event :</p>
<pre class="lang-js prettyprint-override"><code>const listeners = [{
name: "onclick",
callback: (e) => e.preventDefault(),
options: {},
}];
</code></pre>... | How to implement the ability to hang out event handler when creating an item? | javascript | 0 | 15 | 1 | 71,884,626 | 71,884,626 | 1 | true | 2022-04-15T13:09:07.870Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to implement the ability to hang out event handler when creating an item?<p>I have a <code>createEelement()</code> function.</p>
<p>With her, I will crea... |
71,884,584 | Can not realize thymleaf logic with image<p>I have following expression:</p>
<pre><code><img th:src="@{/api/file/{imageName}(imageName = ${account.profileImageLink})}" alt="profile picture">
</code></pre>
<p>and I want to realize next logic:
if imageName equals null so imageName = "profi... | <p>Lots of different ways to accomplish this.</p>
<ol>
<li><p>The <a href="https://www.thymeleaf.org/doc/tutorials/3.0/usingthymeleaf.html#default-expressions-elvis-operator" rel="nofollow noreferrer">elvis operator</a>:</p>
<pre><code><img th:src="@{/api/file/{imageName}(imageName=${account.profileImageLink} ?... | Can not realize thymleaf logic with image | spring|spring-mvc|thymeleaf | 0 | 25 | 1 | 71,885,788 | 71,885,788 | 1 | true | 2022-04-15T13:22:31.487Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can not realize thymleaf logic with image<p>I have following expression:</p>
<pre><code><img th:src="@{/api/file/{imageName}(imageName = ${account.pr... |
71,886,034 | How to properly use import in Python<p>In a python file I have 2 classes Node and LinkedList and after that some operations using those classes like below</p>
<pre><code>node1 = Node("a")
node2 = Node("b")
node3 = Node("c")
linkedList = LinkedList()
linkedList.insert(node1)
linkedList.ins... | <p>You should put the code you don't want to run in a <code>if __name__ == '__main__'</code> block :</p>
<pre class="lang-py prettyprint-override"><code>
<Your classes definition here>
if __name__ == '__main__'
node1 = Node("a")
node2 = Node("b")
node3 = Node("c")
l... | How to properly use import in Python | python | 0 | 30 | 1 | 71,886,087 | 71,886,087 | 1 | true | 2022-04-15T15:39:38.930Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to properly use import in Python<p>In a python file I have 2 classes Node and LinkedList and after that some operations using those classes like below</p... |
71,886,244 | Create and cleanup instance specific rabbitMQ instances<p>I have a set of microservices using springboot rest. These microservices will be deployed in a autoscaled and load balanced environment. One of these services is responsible for managing the system's configuration. When other microservices startup, they obtai... | <p>The idea and solution is correct. What you just miss that those queues, created by your consumer services could be declared as <code>auto-delete=true</code>: <a href="https://www.rabbitmq.com/queues.html" rel="nofollow noreferrer">https://www.rabbitmq.com/queues.html</a>. As long as your service is UP, the queue is ... | Create and cleanup instance specific rabbitMQ instances | spring-boot|spring-rabbit | 0 | 23 | 1 | 71,886,623 | 71,886,623 | 1 | true | 2022-04-15T16:00:28.787Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create and cleanup instance specific rabbitMQ instances<p>I have a set of microservices using springboot rest. These microservices will be deployed in a aut... |
71,886,682 | hiding a specific flex child when both children have a width of 100vw<p>If both my children have a <code>width: 100vw;</code> and my parent is set to flex which puts them side by side. I can control which child renders first with <code>flex-direction: row-reverse;</code> but how can I hide the child element that is not... | <p>If you want them to be full width, set the flex container to have a <code>flex-wrap: wrap;</code></p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>.parent{
display: flex... | hiding a specific flex child when both children have a width of 100vw | html|css | 0 | 31 | 1 | 71,886,796 | 71,886,796 | 1 | true | 2022-04-15T16:43:09.817Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
hiding a specific flex child when both children have a width of 100vw<p>If both my children have a <code>width: 100vw;</code> and my parent is set to flex wh... |
71,886,343 | only show the paragraph if the collector data matches like an if...else or switch case<p>I am wanting to have the paragraph show the collectors.XXXX only if it matches in an if...else or switch case but having troubles on placement in the file to make this work. This currently just shows all paragraphs with all headers... | <p>You can use inline rendering for that: <a href="https://reactjs.org/docs/conditional-rendering.html#inline-if-with-logical--operator" rel="nofollow noreferrer">https://reactjs.org/docs/conditional-rendering.html#inline-if-with-logical--operator</a>.</p>
<p>In your case it could be something like:</p>
<pre><code>{col... | only show the paragraph if the collector data matches like an if...else or switch case | sql|node.js|reactjs | 0 | 21 | 1 | 71,886,873 | 71,886,873 | 1 | true | 2022-04-15T16:09:11.050Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
only show the paragraph if the collector data matches like an if...else or switch case<p>I am wanting to have the paragraph show the collectors.XXXX only if ... |
71,887,359 | How do i select a whole row based on the highest value of a column<p>Im trying to print the whole row with the highest number of casualties in this data. Currently i can only print the highest number of casualties and not the whole row using the below code, does anyone know how to change it to what i need;</p>
<pre><co... | <pre><code>print(df.loc[df['Number_of_Casualties'] == df['Number_of_Casualties'].max()])
Accident_Index Number_of_Casualties LSOA_of_Accident_Location
1 1 52 E01003117
</code></pre> | How do i select a whole row based on the highest value of a column | python|pandas | 0 | 32 | 2 | 71,887,456 | 71,887,456 | 1 | true | 2022-04-15T17:58:15.033Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do i select a whole row based on the highest value of a column<p>Im trying to print the whole row with the highest number of casualties in this data. Cur... |
71,887,123 | How can disable first two column of header in vue<p>I am trying to disable draggable function for first 2 column i tried options in draggable</p>
<pre><code>:options="{disabled : 'Subject'}"
</code></pre>
<p>but it disable the all header draggable functionality</p>
<pre><code><thead class="not-as-sma... | <p>Add method in draggable :move that check the header title if it match with subject it will return false and it will not be able to drag</p>
<pre><code><draggable
v-model="headerColumn"
v-bind="dragOptions"
tag="tr"
:move="checkHeader"
>
checkHeader(value) {
... | How can disable first two column of header in vue | javascript|vue.js|vuejs2|draggable | 0 | 24 | 1 | 71,887,522 | 71,887,522 | 1 | true | 2022-04-15T17:31:42.920Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can disable first two column of header in vue<p>I am trying to disable draggable function for first 2 column i tried options in draggable</p>
<pre><code>... |
71,888,404 | changing variable value outside a function inside a class<p>how can i make it change the count value. the RollingCurlX thing is a multithreading class for php which only let you process response through a function and i dont know how you should handle it. please help me</p>
<pre><code>
class MyClass extends RollingCurl... | <p>Use the <code>use()</code> declaration to give the function access to an external variable. Make it a reference with <code>&</code> so assignments to the variable inside the function will affect the outer variable.</p>
<pre><code>function callback_functn($response, $url, $request_info, $user_data, $time) use (&a... | changing variable value outside a function inside a class | php | 0 | 31 | 2 | 71,888,431 | 71,888,431 | 1 | true | 2022-04-15T19:58:23.807Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
changing variable value outside a function inside a class<p>how can i make it change the count value. the RollingCurlX thing is a multithreading class for ph... |
71,877,109 | Is it possible to set a default path/ direction for a conda environment once activating it?<p>I am looking for a method to go to a directory (by default) after activating a conda environment. In other words, I am just lazy enough to use an addition command "cd".</p>
<p>I have tried to google for a while but s... | <p>You can do this via an <a href="https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#saving-environment-variables" rel="nofollow noreferrer">activation script</a>:</p>
<pre class="lang-bash prettyprint-override"><code>## activate 'foo' environment
conda activate foo
## ensure activati... | Is it possible to set a default path/ direction for a conda environment once activating it? | directory|path|conda|default | 0 | 30 | 1 | 71,888,778 | 71,888,778 | 1 | true | 2022-04-14T20:07:10.740Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to set a default path/ direction for a conda environment once activating it?<p>I am looking for a method to go to a directory (by default) aft... |
71,888,870 | How do i remove the space left by a float? (position: absolute won't align right to parent either?)<p>I'm trying to make this: <a href="https://i.stack.imgur.com/ULcrT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ULcrT.jpg" alt="example1" /></a></p>
<p>I want the purple div to align to the right o... | <p>Does <code>text-align: right;</code> instead of <code>float: right;</code> on <code>.subtitle</code> give you the result you're after?</p>
<pre><code>.titlebox {
display: flex;
justify-content: center;
text-align:center;
}
.title {
font-size: 55px;
background: green;
}
.subtitle {
text-alig... | How do i remove the space left by a float? (position: absolute won't align right to parent either?) | css | 0 | 24 | 1 | 71,888,995 | 71,888,995 | 1 | true | 2022-04-15T20:55:57.400Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do i remove the space left by a float? (position: absolute won't align right to parent either?)<p>I'm trying to make this: <a href="https://i.stack.imgur... |
71,888,963 | How to implement the display of icons with links to the social network?<p>I have a small project with user cards.</p>
<p>I have a JSON file with data on users whose cards are generated.</p>
<p>My task is in the card to show the icons of those social networks that the user has. If the user does not have any of the socia... | <p>This is actually quite straightforward, see the comments in the code</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>// Get the network hosts for of a user and optionally fi... | How to implement the display of icons with links to the social network? | javascript | 0 | 25 | 1 | 71,889,240 | 71,889,240 | 1 | true | 2022-04-15T21:07:25.097Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to implement the display of icons with links to the social network?<p>I have a small project with user cards.</p>
<p>I have a JSON file with data on user... |
71,890,416 | Pandas Dataframe display total<p>Here is an example dataset found from google search close to my datasets in my environment</p>
<p><a href="https://i.stack.imgur.com/HFU4R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HFU4R.png" alt="enter image description here" /></a></p>
<p>I'm trying to get out... | <p>I think this should work for 'Total':</p>
<pre><code>df1['Total']=df1.groupby('State')['Product'].transform(lambda x: x.count())
</code></pre> | Pandas Dataframe display total | python|pandas|dataframe | 0 | 32 | 2 | 71,890,454 | 71,890,454 | 1 | true | 2022-04-16T01:40:53.730Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas Dataframe display total<p>Here is an example dataset found from google search close to my datasets in my environment</p>
<p><a href="https://i.stack.i... |
71,891,796 | Overridng either both default function or no function from java interface<p>I am trying to build a encryption and decryption of string interface and there is class that is overriding that interface. Now, i want to do something that can make, if any class is implementing the interface, either that class override no defa... | <p>If you want to achieve that, your default implementations should not be inside the interface, but instead they should be in a separate class, e.g. <code>DefaultEncryptAlgorithm</code> that implements your interface.</p>
<p>Then, if you want to override none of the default implementations, you can use or derive from ... | Overridng either both default function or no function from java interface | java|oop | 0 | 32 | 1 | 71,891,854 | 71,891,854 | 1 | true | 2022-04-16T07:03:31.320Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Overridng either both default function or no function from java interface<p>I am trying to build a encryption and decryption of string interface and there is... |
71,891,915 | How to create a custom timerange and convert it to list<p>I want to make a list like this:</p>
<pre><code> list = ['200501','200502','200503'....'202012']
</code></pre>
<p>I want I could hard code the list from 200501(jan 2005) to 202012(dec 2020) but I would like to do it in a smarter way.</p>
<p>I tried:</p>
<pre><co... | <p>You could use <code>strftime</code>:</p>
<pre><code>out = pd.date_range(start='2005-01', end='2021-01', freq='m').strftime('%Y%m').tolist()
</code></pre>
<p>Output:</p>
<pre><code>['200501',
'200502',
'200503',
'200504',
...
'202010',
'202011',
'202012']
</code></pre> | How to create a custom timerange and convert it to list | python|python-3.x|pandas|list|datetime | 0 | 27 | 1 | 71,891,968 | 71,891,968 | 1 | true | 2022-04-16T07:24:53.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 custom timerange and convert it to list<p>I want to make a list like this:</p>
<pre><code> list = ['200501','200502','200503'....'202012']
</... |
71,886,119 | How to add a widget to systray in AwesomeWM?<p>I want to add a battery widget to the systray. How can I do that? How does systray recognize what programs to put in it?</p> | <p>It just occurred to me that this question has the <code>awesome-wm</code> tag, so ignore my X11-answer. Here is another attempt.</p>
<p>There is no way to add anything to a <code>wibox.widget.systray</code> from Lua code. However, you could just put a <code>awful.widget.imagebox</code> or <code>awful.widget.button</... | How to add a widget to systray in AwesomeWM? | awesome-wm | 0 | 542 | 2 | 71,892,206 | 71,892,206 | 1 | true | 2022-04-15T15:47:19.117Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add a widget to systray in AwesomeWM?<p>I want to add a battery widget to the systray. How can I do that? How does systray recognize what programs to ... |
71,890,547 | Sequelize One to Many Association Update won't work<p>This is how my two models are connected:</p>
<pre><code>DebitInvoice.hasMany(DebitInvoiceProduct, {
onDelete: 'CASCADE',
onUpdate: 'CASCADE',
foreignKey: 'invoice_serial'
});
DebitInvoiceProduct.belongsTo(DebitInvoice,{
foreignKey: 'serial'
});
</cod... | <p><code>update</code> does not have <code>include</code> option so you either need to call <code>setDebitInvoiceProducts</code> for each <code>DebitInvoice</code> model instance or call <code>destroy</code> and <code>create</code> on <code>DebitInvoiceProducts</code>:</p>
<pre class="lang-js prettyprint-override"><cod... | Sequelize One to Many Association Update won't work | node.js|express|model|sequelize.js | 0 | 28 | 1 | 71,894,241 | 71,894,241 | 1 | true | 2022-04-16T02:10:03.670Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sequelize One to Many Association Update won't work<p>This is how my two models are connected:</p>
<pre><code>DebitInvoice.hasMany(DebitInvoiceProduct, {
... |
71,894,805 | Firebase: Maintain a Username Directory<p>I am creating a Social app and want to track if a username already exists or not. The username list is supposed to grow in future and the way I was doing it now was a key value pair of <string,bolean> like this:</p>
<pre><code>name1: true,
name2: true
</code></pre>
<p>all... | <p>The Realtime Database doesn't have a 1MB limit (since it has no concept of a document, and everything is just a tree of JSON), so I'd typically use that for the index of user names.</p>
<p>Checking whether a name exists is pretty simple there too, and in JavaScript would look something like:</p>
<pre><code>const use... | Firebase: Maintain a Username Directory | firebase-realtime-database|google-cloud-firestore | 0 | 21 | 1 | 71,894,889 | 71,894,889 | 1 | true | 2022-04-16T14:40:08.673Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Firebase: Maintain a Username Directory<p>I am creating a Social app and want to track if a username already exists or not. The username list is supposed to ... |
71,877,591 | is it possible to configure Black to error or warn on non-literal dict instantiation or similar?<p>When enforcing code style, my team prefers using a dict literal instead of the dict() function call:</p>
<pre><code>c = { "a": 1 } // good
d = {} // good
e = dict() // bad
</code></pre>
<p>Can <a h... | <p>Maintainer of black here :wave:</p>
<p>Black cannot do this as this would be an AST unsafe transformation. It's not certain whether Black will gain AST unsafe features down the road, but it's unlikely IMO.</p>
<p>Instead you can use <a href="https://pylint.pycqa.org/en/latest/technical_reference/features.html#:%7E:t... | is it possible to configure Black to error or warn on non-literal dict instantiation or similar? | python|python-black | 0 | 26 | 1 | 71,895,203 | 71,895,203 | 1 | true | 2022-04-14T21:02:56.350Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
is it possible to configure Black to error or warn on non-literal dict instantiation or similar?<p>When enforcing code style, my team prefers using a dict li... |
71,895,457 | How Do I Do a Read-Only Area On A Textarea In HTML?<p>I am trying to create a textarea where it shows text but when you click on it and write something the text disappears. For example, on some websites is says "Search" on the textbar and when you click it and write something, the text disappears (like Google... | <p>You can use the <code>placeholder</code> attribute.</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><textarea style="resize:none;" cols="35" rows="1" wrap="virtual" p... | How Do I Do a Read-Only Area On A Textarea In HTML? | html|textarea | 0 | 34 | 2 | 71,895,524 | 71,895,524 | 1 | true | 2022-04-16T16:07:04.480Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How Do I Do a Read-Only Area On A Textarea In HTML?<p>I am trying to create a textarea where it shows text but when you click on it and write something the t... |
71,895,556 | model relationship and Queries in Django not a clear<p>what does these lines of code mean in Django View: i couldn't find a details explanation, I came to Django from a Laravel background, so I can understand the models and relationships... thanks</p>
<pre><code>customer = request.user.customer
product = Product.object... | <pre class="lang-py prettyprint-override"><code>customer = request.user.customer
</code></pre>
<p>The request object has a user, the user is the authenticated user (if no user is authenticated then the <code>AnonymousUser</code> object is returned instead). In this example the <code>User</code> model (i.e. the user tab... | model relationship and Queries in Django not a clear | django|model|relationship | 0 | 25 | 1 | 71,895,612 | 71,895,612 | 1 | true | 2022-04-16T16:17:57.950Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
model relationship and Queries in Django not a clear<p>what does these lines of code mean in Django View: i couldn't find a details explanation, I came to Dj... |
71,895,694 | Custom event fired but not triggered<p>I have two components and I am trying to save data from one component into another but somehow the event isn't triggered by the parent component. I see no errors in the code must be something else.</p>
<p>When I add newTask I emit "some" event but is not triggering on th... | <p>You have to add your EventListener to the component from where the event is firing. And in your code it's the <code>Task</code> Component. So instead of listening from the div you may code like this,</p>
<pre><code><Task :tasks="tasks" @some="some" />
</code></pre> | Custom event fired but not triggered | vue.js | 0 | 34 | 1 | 71,895,838 | 71,895,838 | 1 | true | 2022-04-16T16:38:47.553Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Custom event fired but not triggered<p>I have two components and I am trying to save data from one component into another but somehow the event isn't trigger... |
71,896,252 | Error Uncaught TypeError: Cannot read properties of null (reading 'addEventListener') in a separeted file<p>This error keep showing to me only if a put this JavaScript code in a separeted file, and link to my Html... If they are insede a tag they work just fine...</p>
<pre><code>script.js:4 Uncaught TypeError: Cannot ... | <p>Most likely you have issues with connecting script.js to your html file. You either need to connect js file after <code></body></code> tag or check if html content is ready/rendered with DOMContentLoaded event inside of your js file, and when DOM content is loaded you can execute your js code. Should be fine t... | Error Uncaught TypeError: Cannot read properties of null (reading 'addEventListener') in a separeted file | javascript|html|jquery|addeventlistener | 0 | 1,304 | 1 | 71,896,343 | 71,896,343 | 1 | true | 2022-04-16T17:59:20.983Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error Uncaught TypeError: Cannot read properties of null (reading 'addEventListener') in a separeted file<p>This error keep showing to me only if a put this ... |
71,896,466 | TypeScript is letting me declare prop data as whatever type I want without throwing an error?<p>I understand that the title might sound a little vague so I will do my best to explain my question here.</p>
<p>I'm making a simple quiz app, and on the backend I've created a query which returns data of this shape:</p>
<pre... | <p>You are declaring your <code>question</code> type as <code>any</code>, which disables TypeScript checking:</p>
<p>Change:
<code>currentQuestions.map((question: any, index: number) => (</code></p>
<p>To:<br />
<code>currentQuestions.map((question, index) => (</code></p>
<p>Which will allow TS to properly infer ... | TypeScript is letting me declare prop data as whatever type I want without throwing an error? | reactjs|typescript | 0 | 26 | 1 | 71,896,507 | 71,896,507 | 1 | true | 2022-04-16T18:29:16.617Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TypeScript is letting me declare prop data as whatever type I want without throwing an error?<p>I understand that the title might sound a little vague so I w... |
71,897,119 | How to load dynamic pages with data from a local JSON<p>I've just started learning Next.js, so thanks for your patience with my question. I'm trying to generate dynamic pages (and routes) from data loaded from a local JSON file (<code>data.json</code>). I will not be doing this in production - just trying to learn Next... | <p>To get the data you can use getServerSideProps() like this:</p>
<pre><code>export async function getServerSideProps() {
const data =
await require("/path/data.json");
return {
props: {
data,
},
};
}
</code></pre>
<p>And then get the role assigned with useRou... | How to load dynamic pages with data from a local JSON | reactjs|next.js | 0 | 23 | 1 | 71,897,419 | 71,897,419 | 1 | true | 2022-04-16T20:03:47.730Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to load dynamic pages with data from a local JSON<p>I've just started learning Next.js, so thanks for your patience with my question. I'm trying to gener... |
71,897,978 | I'm trying to write an asynchronous pathfinding function using async await in javascript<p>I'm testing if it works and a function that runs a while loop will block the code even if it is in an asynchronous function that I am awaiting. How do do something like pathfinding without freezing my webpage?</p> | <p>Doing <em>work</em> keeps the main JS event loop busy.</p>
<p>You can't get around that by using promises or the <code>async</code> and <code>await</code> tools. They are tools to <em>manage</em> asynchronous code, they don't make code asynchronous.</p>
<p>A couple of strategies you could employ are:</p>
<ul>
<li>Mo... | I'm trying to write an asynchronous pathfinding function using async await in javascript | javascript|async-await | 0 | 22 | 1 | 71,898,013 | 71,898,013 | 1 | true | 2022-04-16T22:39:22.480Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I'm trying to write an asynchronous pathfinding function using async await in javascript<p>I'm testing if it works and a function that runs a while loop will... |
71,898,342 | Concat varying ndim dataframes pandas<p>I have a list of dataframe, each with shape 1000x160.</p>
<pre><code>df_list = [df1,df2]
</code></pre>
<p>All the dataframe have same columns except last three i.e</p>
<pre><code>col1, col2, col3 ... col157, col158, col159, col160
</code></pre>
<p>columns from 1-157 are the same ... | <p>In the example where your list is two dfs, it sounds like you'd want the final df to have 163 cols: 157 + (2 * 3). It also sounds like a combination of reduce and merge could work -- previous answer <a href="https://stackoverflow.com/questions/38089010/merge-a-list-of-pandas-dataframes">here</a>. Would be useful to ... | Concat varying ndim dataframes pandas | python|pandas | 0 | 27 | 1 | 71,898,448 | 71,898,448 | 1 | true | 2022-04-17T00:00:46.567Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Concat varying ndim dataframes pandas<p>I have a list of dataframe, each with shape 1000x160.</p>
<pre><code>df_list = [df1,df2]
</code></pre>
<p>All the dat... |
71,897,532 | cutoff error using custom kernel in Smooth.ppp<p>I need to use a custom kernel with the Smooth function, but attempting this throws an error even though I specify cutoff:</p>
<p>Error: The argument ‘cutoff’ is required when a non-Gaussian kernel is specified and scalekernel=FALSE</p>
<pre><code>n=4; PPP=ppp(rep(1:n,n),... | <p>This is a bug. Thank you for bringing it to our attention.</p>
<p>It has been fixed in the development version of <code>spatstat.core</code> (<code>2.4-2.003</code>) which is available at the <a href="https://github.com/spatstat/spatstat.core" rel="nofollow noreferrer">GitHub repository</a></p>
<p>The bug only affec... | cutoff error using custom kernel in Smooth.ppp | spatstat | 0 | 29 | 1 | 71,898,575 | 71,898,575 | 1 | true | 2022-04-16T21:13:40.517Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
cutoff error using custom kernel in Smooth.ppp<p>I need to use a custom kernel with the Smooth function, but attempting this throws an error even though I sp... |
71,898,770 | How to make it so not every sound plays at once when hovering over a card<p>I tried making character cards, that when hovered over play the character his / her voiceline (only relevant parts shown), but when I hover over a character, they play every voiceline all at once, it's probably a mistake in the javascript, but ... | <p>It should only select the audio inside the <code>playHover</code> and not all the audio which is causing all the audio to play at once when hovering a card. You can try it like this (basing on how you written your code)</p>
<pre><code>window.onload=function(){
for (let i = 1; i <= 2; i++){
let playHo... | How to make it so not every sound plays at once when hovering over a card | javascript|html | 0 | 24 | 1 | 71,898,875 | 71,898,875 | 1 | true | 2022-04-17T02:05:50.533Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make it so not every sound plays at once when hovering over a card<p>I tried making character cards, that when hovered over play the character his / h... |
71,899,130 | Function return type based on the elements of array passed as an argument<p>I'm trying to find a way to create function which return type depends on the elements of array passed as an argument</p>
<pre class="lang-js prettyprint-override"><code>const arr1 = ['a', 'b'] as const
const arr2 = ['a', 'c'] as const
func(arr... | <p>So close!</p>
<pre><code>function func<A extends ReadonlyArray<string>>(array: A): { [K in A[number]]: any } { ... }
</code></pre>
<p><code>A[number]</code> will give us a union of all the strings inside it, and then we can map over that.</p>
<p>You can think of the generic here as a "retaining&quo... | Function return type based on the elements of array passed as an argument | arrays|typescript|typescript-generics|object-literal | 0 | 26 | 1 | 71,899,178 | 71,899,178 | 1 | true | 2022-04-17T03:45:59.627Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Function return type based on the elements of array passed as an argument<p>I'm trying to find a way to create function which return type depends on the elem... |
71,900,537 | can not resize non modal html dialog setting style='resize:both' but works with modal dialogs<p>Using style='resize:both' on non modal dialogs has no effect.
Below is the code to test. Is this the expected behaviour od a bug ?</p>
<pre><code><!DOCTYPE html>
<html>
<head>
<title>resiz... | <p>Try this :</p>
<pre><code> <dialog id='alertDialog' style='overflow:auto;resize:both;min-height:10px;'>
</code></pre> | can not resize non modal html dialog setting style='resize:both' but works with modal dialogs | html|css|dialog|resize|non-modal | 0 | 21 | 1 | 71,900,686 | 71,900,686 | 1 | true | 2022-04-17T08:51:01.417Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
can not resize non modal html dialog setting style='resize:both' but works with modal dialogs<p>Using style='resize:both' on non modal dialogs has no effect.... |
71,901,535 | Is there a way to use the CSVHelper CSVWriter with Dropbox?<p>I've used CSVHelper with Dropbox previously, but reading files. Now I want to write a file, and have discovered that this is not so simple. i.e. this code, with FolderPath as relative to the Dropbox root folder...</p>
<pre><code>using (StreamWriter writer=ne... | <p>Whilst typing my question, I thought "if only there was a way to get this as a string instead of writing to device", but the CSVHelper doco only showed writing to device, using StreamWriter. So I decided to just click around some of the other Write scenario's, and in the "writing to a Dynamic object&q... | Is there a way to use the CSVHelper CSVWriter with Dropbox? | c#|.net|dropbox-api|csvhelper | 0 | 22 | 1 | 71,901,536 | 71,901,536 | 1 | true | 2022-04-17T11:34:54.703Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a way to use the CSVHelper CSVWriter with Dropbox?<p>I've used CSVHelper with Dropbox previously, but reading files. Now I want to write a file, and... |
71,901,997 | GuideLine problem Android Studio - ClassNotFoundException<p>I have problem with GuideLine, does someone know the solution?</p>
<p>It look like the guideline is missing classes</p>
<p>The following classes could not be found:
- android.support.constraint.Guideline (Fix Build Path, Edit XML, Create Class)</p>
<p>Logcat a... | <p>Try to use <code>androidx.constraintlayout.widget.Guideline</code> instead of <code>android.support.constraint.Guideline</code></p>
<pre class="lang-xml prettyprint-override"><code> <androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline"
android... | GuideLine problem Android Studio - ClassNotFoundException | java|android|xml | 0 | 21 | 1 | 71,902,035 | 71,902,035 | 1 | true | 2022-04-17T12:47:06.230Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
GuideLine problem Android Studio - ClassNotFoundException<p>I have problem with GuideLine, does someone know the solution?</p>
<p>It look like the guideline ... |
71,902,210 | Confused about why this beginner's Dockerfile works on Windows<p>I am using Windows 10, and I have WSL2 installed</p>
<p>I have installed Docker Desktop, and successfully built and run the following <code>Dockerfile</code>:</p>
<pre><code>FROM php:7.2-apache
COPY src/ /var/www/html
EXPOSE 80
</code></pre>
<p>where /src... | <p>Yes, it's using WSL2 to run Linux containers</p> | Confused about why this beginner's Dockerfile works on Windows | docker|dockerfile | 0 | 21 | 1 | 71,902,366 | 71,902,366 | 1 | true | 2022-04-17T13:15:33.227Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Confused about why this beginner's Dockerfile works on Windows<p>I am using Windows 10, and I have WSL2 installed</p>
<p>I have installed Docker Desktop, and... |
71,902,742 | Flutter await for another method complete<p>I want to check if new update is available for my application or not. if update is available redirect user to <code>UpdateScreen</code> and if update is not available get the user info and redirect to <code>HomeScreen</code></p>
<pre><code>_check() async {
await _checkForU... | <p>return a bool whether there is an update available and use it to skip other methods:</p>
<pre><code>_check() async {
bool needsUpdate = await _checkForUpdate();
if (!needsUpdate)
await _getUserData(token);
}
Future<bool> _checkForUpdate() async {
print('check for update');
var url = Uri.... | Flutter await for another method complete | flutter|dart | 0 | 31 | 1 | 71,902,807 | 71,902,807 | 1 | true | 2022-04-17T14:31:42.847Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter await for another method complete<p>I want to check if new update is available for my application or not. if update is available redirect user to <co... |
71,902,670 | must i inform the user to give me permission to access the cashed application folder<p>i am making flutter application handle with videos , audios , images , all from server and there big part handling with cache application folder . save , cashed .. etc ..</p>
<p>i am wondering if i must inform the user to give me pe... | <p>No, you don't need to ask the user for permission. This directory can always be cleaned by the user or the system themselves if needed.</p> | must i inform the user to give me permission to access the cashed application folder | flutter | 0 | 31 | 1 | 71,902,975 | 71,902,975 | 1 | true | 2022-04-17T14:21:13.803Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
must i inform the user to give me permission to access the cashed application folder<p>i am making flutter application handle with videos , audios , images ,... |
71,902,821 | this table isnt working in oracle apex can someone help me figure out why<p>this table isnt working in oracle apex can someone help me figure out why</p>
<pre><code>CREATE TABLE booking (
Booking_ID int GENERATED BY DEFAULT AS IDENTITY NOT NULL,
Guest_ID int NOT NULL,
Room_ID int NOT NULL,
Employee_ID int NOT NULL,
b... | <p>It helps if you specify which error(s) you got when you ran this code.</p>
<p>As table references some other tables, I'll first create them (so that foreign key constraints wouldn't fail because of that); I'll create <em>dummy</em> tables with only primary key columns:</p>
<pre><code>SQL> create table guest (gues... | this table isnt working in oracle apex can someone help me figure out why | sql|oracle | 0 | 27 | 1 | 71,903,267 | 71,903,267 | 1 | true | 2022-04-17T14:43:12.893Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
this table isnt working in oracle apex can someone help me figure out why<p>this table isnt working in oracle apex can someone help me figure out why</p>
<pr... |
71,903,923 | Flutter : Range error on accessing JSON Response<p>I am accessing a JSON response with the following structure.</p>
<pre><code>{
"fullName": "FirstName LastName",
"listings": "5",
"items": [{
"type": "A",
"id": &... | <pre><code>Class GetCustomerData{
Future<List<CustomerDetails>> fetchData(queryStr) async {
try{
var response = await http.get(Uri,parse(apiurl+queryStr);
if(reponse.statusCode == 200){
return _parseResponse(response.body);
}else{
print('someError'}
}
on TimeoutException catch ... | Flutter : Range error on accessing JSON Response | flutter | 0 | 24 | 1 | 71,904,035 | 71,904,035 | 1 | true | 2022-04-17T17:20:10.327Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter : Range error on accessing JSON Response<p>I am accessing a JSON response with the following structure.</p>
<pre><code>{
"fullName": &q... |
71,904,196 | jQuery count checkboxes and group count by data-attribute<p>I have a number of html checkboxes that I am trying to count like this...</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override">... | <p><em>Don't need jquery (stay away from the bloatware).</em>
Simply create an object and use section attribute value as it's keys:</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"><c... | jQuery count checkboxes and group count by data-attribute | javascript|jquery | 0 | 18 | 3 | 71,904,299 | 71,904,299 | 1 | true | 2022-04-17T17:57:06.100Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
jQuery count checkboxes and group count by data-attribute<p>I have a number of html checkboxes that I am trying to count like this...</p>
<p><div class="snip... |
71,905,312 | 401 Bad credentials when try to hook code pipeline with GitHub<p>I got this error message when try to do <code>cdk deploy PipelineStack</code>:</p>
<pre><code>Webhook could not be registered with GitHub. Error cause: Invalid credentials [StatusCode: 401,
Body: {"message":"Bad credentials","doc... | <p>It's my fault.</p>
<p>I did not store the token properly:
<a href="https://i.stack.imgur.com/nhQMD.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nhQMD.png" alt="enter image description here" /></a></p>
<p>It should be stored like this:</p>
<p><a href="https://i.stack.imgur.com/IjVBk.png" rel="no... | 401 Bad credentials when try to hook code pipeline with GitHub | amazon-web-services|aws-codepipeline | 0 | 289 | 1 | 71,906,251 | 71,906,251 | 1 | true | 2022-04-17T20:42:31.573Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
401 Bad credentials when try to hook code pipeline with GitHub<p>I got this error message when try to do <code>cdk deploy PipelineStack</code>:</p>
<pre><cod... |
71,906,422 | Getting 'numPlay is not defined' error in React for button click method<p>I'm trying to call nextPage() in the getConfirm when somebody clicks the button "Confirm", but it says that numPlay is never defined in the getConfirm() method.</p>
<p>Please someone help me understand why/fix it! Thank you</p>
<pre><co... | <p>You need to declare <code>numPlay</code> outside of <code>getCOnfirm</code>:</p>
<pre><code>import React from 'react';
import ReactDOM from 'react-dom/client';
const root = ReactDOM.createRoot(document.getElementById('root'));
const title = <h1 style={{ fontSize: '40px' }}>Draft</h1>;
let numPlay;
cons... | Getting 'numPlay is not defined' error in React for button click method | javascript|reactjs | 0 | 23 | 1 | 71,906,557 | 71,906,557 | 1 | true | 2022-04-18T00:12:31.040Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting 'numPlay is not defined' error in React for button click method<p>I'm trying to call nextPage() in the getConfirm when somebody clicks the button &qu... |
71,906,570 | Python -> Pygame Window Close instatly<p>i'm follow Clear Code tutorial, and my pygame window closes instantly, i see some guys talking about identation, but i think that's ok.</p>
<pre><code>import pygame, sys
from settings import *
class Game:
def __init__(self):
# General Setup
pygame.init()
... | <p>you need to call the run function like <code>game.run()</code>, if you only say <code>game.run</code> is like just mentioning the function but not invoking it.</p> | Python -> Pygame Window Close instatly | python | 0 | 26 | 1 | 71,906,595 | 71,906,595 | 1 | true | 2022-04-18T00:44:40.627Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python -> Pygame Window Close instatly<p>i'm follow Clear Code tutorial, and my pygame window closes instantly, i see some guys talking about identation, but... |
71,906,678 | Triggering change event<p>I've got the following function:</p>
<pre><code>$('#id_service').on('change', function() {
afunction($(this));
});
</code></pre>
<p>I've then got another function that manually changes #id_service</p>
<pre><code>$(document).ready(function() {
$('#id_primary option:nth-ch... | <p>Maybe try using the jquery.trigger() function?</p>
<pre><code> $(document).ready(function() {
$('#id_primary option:nth-child(2)').attr('selected', 'selected');
$('#id_service').trigger('change');
});
</code></pre> | Triggering change event | jquery | 0 | 26 | 1 | 71,906,715 | 71,906,715 | 1 | true | 2022-04-18T01:11:35.393Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Triggering change event<p>I've got the following function:</p>
<pre><code>$('#id_service').on('change', function() {
afunction($(this));
}... |
71,901,973 | Append org-agenda-files with files of another directory<p>So i try to create a list of string in the form</p>
<pre><code>"a" "b" "c"
</code></pre>
<p>This is a list of files which i want to pass to <code>org-agenda-files</code>
As for now this looks like this</p>
<pre><code>(setq org-agend... | <p>If you want to include all org files from another directory, you can:</p>
<pre class="lang-lisp prettyprint-override"><code>(setq org-agenda-files '("~/.tasks.org"
"~/orgroam/daily/"))
</code></pre>
<p>If you still want to append files, you can:</p>
<pre class="lang-lisp ... | Append org-agenda-files with files of another directory | emacs|elisp|org-mode | 0 | 268 | 1 | 71,906,741 | 71,906,741 | 1 | true | 2022-04-17T12:43:48.670Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Append org-agenda-files with files of another directory<p>So i try to create a list of string in the form</p>
<pre><code>"a" "b" "c&... |
71,901,699 | Implemented function in provided context called instead of Jest mock<p>I need to test the click on a button in a React application which invokes a function provided by the context. When invoking the mocked function provided by the context in a Jest test the actual function is called. What to do to resolve this ?</p>
<p... | <p>The problem is you create a different React context in the test case rather than using the <code>ThemeContext</code> created in <code>./context/theme/ThemeProvider</code> module.</p>
<p>In other words, the context used by <code>useContext()</code> hook in the <code>App</code> component should be the <code>ThemeConte... | Implemented function in provided context called instead of Jest mock | reactjs|react-hooks|jestjs|react-testing-library|react-context | 0 | 538 | 1 | 71,908,021 | 71,908,021 | 1 | true | 2022-04-17T12:00:08.847Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Implemented function in provided context called instead of Jest mock<p>I need to test the click on a button in a React application which invokes a function p... |
71,908,858 | Kendo template auto increasement<p>Hello I would like to know how I can use a for loop in a template to add on a number 1 onward
as this is what I would get in the picture below</p>
<p>the rest are being call by the backend but however this S/N is just a number incensement from 1 onward</p>
<p><a href="https://i.stack.... | <p>There's a solution for this in the knowledge base <a href="https://docs.telerik.com/kendo-ui/knowledge-base/add-row-numbers" rel="nofollow noreferrer">here</a>, using the page() and pageSize() methods of the Data Source, as well as a counter variable.</p>
<p>See the code snippet for the proposed solution.</p>
<p><di... | Kendo template auto increasement | kendo-ui|kendo-grid | 0 | 27 | 1 | 71,908,982 | 71,908,982 | 1 | true | 2022-04-18T07:31:06.580Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Kendo template auto increasement<p>Hello I would like to know how I can use a for loop in a template to add on a number 1 onward
as this is what I would get ... |
71,909,240 | print customer number next to the own result in python<p>my code:</p>
<pre><code>import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from sklearn.model_selection import train_test_split
df = pd.read_csv('orderlist.csv', skiprows=1, delimiter=';', encoding="utf8")
df.columns = ["date"... | <p>the nth item of <code>pred_quantity</code> corresponds to the nth item in <code>df['customer_number']</code></p>
<p>so you can either add <code>pred_quantity</code> as a column to df</p>
<pre><code>df['pred_quantity'] = pred_quantity
print(df[['customer_number', 'pred_quantity']])
</code></pre>
<p>or use <code>zip<... | print customer number next to the own result in python | python|csv|machine-learning|scikit-learn | 0 | 32 | 1 | 71,909,415 | 71,909,415 | 1 | true | 2022-04-18T08:11:32.637Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
print customer number next to the own result in python<p>my code:</p>
<pre><code>import pandas as pd
from sklearn.tree import DecisionTreeClassifier
from skl... |
71,909,746 | How do I make the user input reflect in the new list created?<p>I have already created the function that allows the user to add a task, the problem I am having is how do I make the user input reflect on the newly created list, currently when I click to add the task, what the user typed, is not reflected in the new task... | <p>You forgot to add the text of task to the html string. I've added it to the readonly input.</p>
<pre class="lang-js prettyprint-override"><code> const createTask = () => {
const id = createId()
const task = elements.input.value;
const date = elements.cal.value;
if(!task && !date) return a... | How do I make the user input reflect in the new list created? | javascript | 0 | 33 | 1 | 71,909,833 | 71,909,833 | 1 | true | 2022-04-18T09:06:49Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I make the user input reflect in the new list created?<p>I have already created the function that allows the user to add a task, the problem I am havi... |
71,909,547 | How to batched download data from URL in R<p>I have many of urls. Each url points to a csv file and each csv file has its own name.</p>
<p>I want to download data from the urls and save it on my computer.</p>
<p>I have tried the code in <a href="https://stackoverflow.com/questions/25797242/batch-download-zipped-files-i... | <p>To download files in your working directory we can use <code>downloader</code> package. Extract <code>zip</code> file name using <code>gsub</code> from <code>urls</code>.</p>
<pre><code>library(downloader)
lapply(urls, function(x){
#create zip file name
nam = gsub(".*[/]([^.]+)[.].*", "\\1", x)... | How to batched download data from URL in R | r|url | 0 | 24 | 1 | 71,909,996 | 71,909,996 | 1 | true | 2022-04-18T08:45:24.973Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to batched download data from URL in R<p>I have many of urls. Each url points to a csv file and each csv file has its own name.</p>
<p>I want to download... |
71,909,933 | My if-else-then logic in onClick does not result in any DOM change<p>I just wanna create a function that returns <code>"login"</code> if I clicked on login <code>div</code> and the same with signup.</p>
<p>But my code always returns the <code>else</code> condition even when clicking on the <code>div</code> wh... | <p>It is not possible to catch the value returned by the onClick callback. You can use <code>useState</code> to declare an initial state and track changes to describe which section should be displayed. Then in the JSX part, you can use this state variable to check whether one form or the other needs to be displayed.</p... | My if-else-then logic in onClick does not result in any DOM change | reactjs|if-statement | 0 | 35 | 2 | 71,910,288 | 71,910,288 | 1 | true | 2022-04-18T09:23:46.430Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
My if-else-then logic in onClick does not result in any DOM change<p>I just wanna create a function that returns <code>"login"</code> if I clicked ... |
71,910,630 | Stop and resume loop not working - mouseover/mouseout<p>I wrote a script that changes the picture every 1 second.</p>
<p>But I have a problem, the loop does not stop when hovering and leaving the mouse on the child_block.</p>
<p>That is, when you hover the mouse over the picture, the pictures should stop changing. And ... | <p>The Following Behaviour Happens Because The event.target returns the innermost child element which is being hovered/clicked on. In your case since the parent div <code>child_block</code> has comparatively less space left out than <code>img_s</code> so even when you hover over most of the times the target will be <co... | Stop and resume loop not working - mouseover/mouseout | javascript | 0 | 29 | 1 | 71,910,809 | 71,910,809 | 1 | true | 2022-04-18T10:30:33.440Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Stop and resume loop not working - mouseover/mouseout<p>I wrote a script that changes the picture every 1 second.</p>
<p>But I have a problem, the loop does ... |
71,906,905 | Align type declarations vertically in WebStorm<p>How do you force WebStorm to align type declaration values vertically when running "Reformat Code"?</p>
<p>I have this:</p>
<p><a href="https://i.stack.imgur.com/83HWU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/83HWU.png" alt="enter imag... | <p>Not currently possible, please follow <a href="https://youtrack.jetbrains.com/issue/WEB-43078" rel="nofollow noreferrer">WEB-43078</a> and linked tickets for updates</p> | Align type declarations vertically in WebStorm | typescript|format|webstorm | 0 | 20 | 1 | 71,911,127 | 71,911,127 | 1 | true | 2022-04-18T01:57:02.883Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Align type declarations vertically in WebStorm<p>How do you force WebStorm to align type declaration values vertically when running "Reformat Code"... |
71,910,876 | Vuetify grid - reverse order of columns on screen-size break<p>I have a row of 2 columns that I want to display in their current order. However, when the screen sized is reduced I want to change the order of the columns so column two becomes the first column.</p>
<pre class="lang-html prettyprint-override"><code><v-... | <p>you can use <a href="https://vuetifyjs.com/en/styles/flex/#flex-order" rel="nofollow noreferrer">vuetify's responsive flex order classes</a> to achieve this effect.</p>
<p>for example you can put <code>class="order-last order-md-first"</code> on <code>Col1</code> in your example, this will cause the first ... | Vuetify grid - reverse order of columns on screen-size break | css|vuetify.js | 0 | 279 | 1 | 71,911,342 | 71,911,342 | 1 | true | 2022-04-18T10:55:16.880Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vuetify grid - reverse order of columns on screen-size break<p>I have a row of 2 columns that I want to display in their current order. However, when the scr... |
71,911,641 | cannot find module 'jspdf-autotable' and 'jspdf' or its corresponding type declarations<p>mycomponent.ts</p>
<pre><code>import jsPDF from 'jspdf';
import autoTable from 'jspdf-autotable';
export class Component implements OnInit {
.
.
.
exportPdf() {
const doc = new jsPDF('p', 'pt');
columns = [...]
auto... | <p>You have to install <code>@types/jspdf</code> and <code>@types/jspdf-autotable</code> as dev-dependencies.</p>
<p>If you use <code>yarn</code>:</p>
<pre><code>yarn add -D @types/jspdf @types/jspdf-autotable
</code></pre>
<p>For <code>npm</code> use:</p>
<pre><code>npm install @types/jspdf @types/jspdf-autotable --sa... | cannot find module 'jspdf-autotable' and 'jspdf' or its corresponding type declarations | javascript|node.js|json|typescript | 0 | 540 | 1 | 71,911,834 | 71,911,834 | 1 | true | 2022-04-18T12:10:14.350Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
cannot find module 'jspdf-autotable' and 'jspdf' or its corresponding type declarations<p>mycomponent.ts</p>
<pre><code>import jsPDF from 'jspdf';
import a... |
71,910,952 | Sum two financial fields in an SSRS report<p>My current forumla is:</p>
<pre><code>=Fields!ag_new_previousentryfeespaid.Value + Fields!ag_new_totalentryfeescollected.Value
</code></pre>
<p>Which results in the following:
$5$20</p>
<p>instead of $25.</p>
<p>I've tried:</p>
<pre><code>SUM(=Fields!ag_new_previousentryfees... | <p>Based on the result of your fir5st expression, it looks like the fields you are trying to sum are string with the <code>$</code> included</p>
<p>Your last option was the closest in in that case you have tried to sum the string and <strong>then</strong> convert it to an int, which will not work.</p>
<p>The easiest me... | Sum two financial fields in an SSRS report | reporting-services|formula | 0 | 25 | 1 | 71,912,910 | 71,912,910 | 1 | true | 2022-04-18T11:04:22.073Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sum two financial fields in an SSRS report<p>My current forumla is:</p>
<pre><code>=Fields!ag_new_previousentryfeespaid.Value + Fields!ag_new_totalentryfeesc... |
71,913,081 | pandas trim with NA value<p>I have some data frame with the following structure.</p>
<pre><code>timestamp Col_A Col_B
2021-04-19T16:12:00Z NA NA
2021-04-19T16:13:00Z NA NA
2021-04-19T16:14:00Z 1 NA
2021-04-19T16:15:00Z 2 NA
2021-04-19T16:16:00Z 3 1
2021-04... | <p>Check with <code>cumprod</code> after <code>all</code></p>
<pre><code>s = df.isna().all(1)
out = df[s.cumprod() + s.iloc[::-1].cumprod() == 0]
</code></pre> | pandas trim with NA value | pandas | 0 | 26 | 3 | 71,913,151 | 71,913,151 | 1 | true | 2022-04-18T14:25:03.527Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pandas trim with NA value<p>I have some data frame with the following structure.</p>
<pre><code>timestamp Col_A Col_B
2021-04-19T16:12:00Z ... |
71,908,677 | Failed returning data from array<p>i have a problem which that i cannot see the data inside array that i have pushed the data inside .then from axios</p>
<p>Here are the sample code
Axios from vue.js</p>
<pre><code>export default {
name: 'facts',
data(){
const test = [{id: 'test',name: 'test'}]
const respon... | <p>your code structure is not correct. use this code:</p>
<pre><code>export default {
name: 'ProfilePage',
data() {
return {
response: []
}
},
created () {
this.getData();
},
methods: {
getData() {
axios.get('http://localhost:3000').then(x => this.response = x.data);
}
... | Failed returning data from array | vue.js|asynchronous|async-await|promise|axios | 0 | 25 | 1 | 71,913,170 | 71,913,170 | 1 | true | 2022-04-18T07:11:41.803Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Failed returning data from array<p>i have a problem which that i cannot see the data inside array that i have pushed the data inside .then from axios</p>
<p>... |
71,913,974 | TypeORM createQueryBuilder where statement not respecting Enitity column name<p>I have a pre-existing database table that has a column with a name of <code>account_number</code>, however, I wanted to reference this column in my code as <code>accountNumber</code> instead.</p>
<p>I have the following entity where I set t... | <p>It looks like you're doing the same thing as in this question:</p>
<p><a href="https://stackoverflow.com/questions/67911693/typeorm-ignoring-column-name-of-columns">Typeorm ignoring @column name of columns</a></p>
<p>I'm not clear if this is documented, but I think something is wrong with explicitly named <code>Prim... | TypeORM createQueryBuilder where statement not respecting Enitity column name | typeorm | 0 | 525 | 1 | 71,914,058 | 71,914,058 | 1 | true | 2022-04-18T15:43:40.547Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TypeORM createQueryBuilder where statement not respecting Enitity column name<p>I have a pre-existing database table that has a column with a name of <code>a... |
71,914,392 | How to submit data without image using MultipartRequest?<p>I want to submit form data without taking image.</p>
<p>My user can select an image or without choosing any image they can submit data.
I have this for taking an image</p>
<pre><code>Future cameraImage() async {
var pickedImage = await _picker.pickImage(
... | <p>You can hAndle it by creating two separate
Uploadwithimage() and uploadwithoutimage()</p>
<pre><code>(_image== null) ?uploadwithoutimage ():uploadwithimage();
</code></pre> | How to submit data without image using MultipartRequest? | flutter|dart | 0 | 19 | 1 | 71,914,688 | 71,914,688 | 1 | true | 2022-04-18T16:23:46.513Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to submit data without image using MultipartRequest?<p>I want to submit form data without taking image.</p>
<p>My user can select an image or without cho... |
71,914,349 | Are total instance storage per region and Aurora Volume separate?<p>According to the AWS doc(<a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_Limits.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_Limits.html</a>) Aurora's total instance storag... | <p>100TB is the <strong>default</strong> limit for Aurora storage per region. That means you won't be able to scale up any single instance to the maximum 128TB, in a single region, because that would be more than the default limit.</p>
<blockquote>
<p>Or is it possible to scale up all 4 clusters to 128 TiB each?(Are to... | Are total instance storage per region and Aurora Volume separate? | postgresql|amazon-web-services|amazon-rds|amazon-aurora | 0 | 35 | 1 | 71,914,702 | 71,914,702 | 1 | true | 2022-04-18T16:20:06.830Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Are total instance storage per region and Aurora Volume separate?<p>According to the AWS doc(<a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUser... |
71,914,774 | Golang Gorm not creating table with constraints<p>I'm working on a Gin app with Gorm. Currently, I've got the following struct which represents a model:</p>
<pre><code>// Category represents a category object in the database
type Category struct {
Name string `json:"name" gorm:"size:60,unique,... | <p>Based on the <a href="https://gorm.io/docs/models.html" rel="nofollow noreferrer">doc</a>, I believe you should use semicolon (<code>;</code>) instead comma (<code>,</code>) between tag constraints declaration</p>
<pre class="lang-golang prettyprint-override"><code>type Category struct {
Name string `json... | Golang Gorm not creating table with constraints | mysql|go|go-gorm|go-gin | 0 | 281 | 1 | 71,915,078 | 71,915,078 | 1 | true | 2022-04-18T17:01:49.623Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Golang Gorm not creating table with constraints<p>I'm working on a Gin app with Gorm. Currently, I've got the following struct which represents a model:</p>
... |
71,915,296 | Attempting to read mongoDB document properties<p>I'm trying to read the property levelenabled from a document stored in my MongoDB database. When I log the returned data to console after finding the document with the GuildID(discord.js) it logs the correct document but when I try to check a value in that data the prope... | <p>Try <code>findOne</code></p>
<pre class="lang-js prettyprint-override"><code>await serverdata.findOne(...)
</code></pre>
<p>Using <code>find</code> or <code>findMany</code> will return a <code>cursor</code>.</p> | Attempting to read mongoDB document properties | javascript|node.js|mongodb|discord.js | 0 | 33 | 1 | 71,915,362 | 71,915,362 | 1 | true | 2022-04-18T17:54:48.693Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Attempting to read mongoDB document properties<p>I'm trying to read the property levelenabled from a document stored in my MongoDB database. When I log the r... |
71,914,979 | Is there a way to capture whether any radio button has been clicked and react from it<p>please refer to the reproducible code below. Everything works fine up to one point. If you select a team, and choose a weight through pushing the action buttons, and then click the populate button, a table appears with the weights... | <p>below is my interpretation of what you want. I put the info in the code too, but I'll give a brief idea here. Rather than use <code>eventReactive</code>, I used <code>reactiveValues</code>. This way I have a number that I can alter with different inputs. I then used observeEvent on each of the three inputs, <code>ra... | Is there a way to capture whether any radio button has been clicked and react from it | r|shiny|radio-button|reactive | 0 | 20 | 1 | 71,915,423 | 71,915,423 | 1 | true | 2022-04-18T17:22:03.347Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a way to capture whether any radio button has been clicked and react from it<p>please refer to the reproducible code below. Everything works fine u... |
71,915,492 | Plotting the summation over different values<p>I have the following summation function:</p>
<pre><code>import numpy as np
from sympy import var, Sum, pi, factorial, limit
import matplotlib.pyplot as plt
import math
import scipy.misc
def b_func(x, k):
n = np.arange(k)
X, N = np.meshgrid(x, n)
val =((X**(2... | <p>You are using sympy's <code>factorial</code> on numerical data types: if possible, avoind mixing symbolic functions with numerical data.</p>
<p>Replace sympy's <code>factorial</code> with the one from scipy:</p>
<pre><code>from scipy.special import factorial
</code></pre>
<p>After that you are going to get the plot:... | Plotting the summation over different values | python-3.x|matplotlib|math|plot|sympy | 0 | 17 | 1 | 71,915,577 | 71,915,577 | 1 | true | 2022-04-18T18:14:09.870Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Plotting the summation over different values<p>I have the following summation function:</p>
<pre><code>import numpy as np
from sympy import var, Sum, pi, fac... |
71,915,653 | Show BottomPlayerView above TabView in SwiftUI<p>I'm learning swiftUI and I want to make a music app.</p>
<p>I created a view which going to be above the tabView, but I want it to be shown only if user start playing a music.</p>
<p>My App, I use ZStack for bottomPlayer, and I share the bottomPlayer variable through .en... | <p>In your BottomPlayer add the @Published attribute before the show boolean.
This creates a publisher of this type.
<a href="https://developer.apple.com/documentation/combine/published" rel="nofollow noreferrer">apple documentation</a></p> | Show BottomPlayerView above TabView in SwiftUI | swiftui|tabbar | 0 | 28 | 1 | 71,916,013 | 71,916,013 | 1 | true | 2022-04-18T18:28:37.987Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Show BottomPlayerView above TabView in SwiftUI<p>I'm learning swiftUI and I want to make a music app.</p>
<p>I created a view which going to be above the tab... |
71,916,597 | Python: curl -d json will not work without apostrophe<p>I have to send the curl exact in that form to get a response in cli</p>
<pre><code>curl -d '{"id":0,"params":["aa:aa:00:00:00:00",["mixer","volume","80"]],"method":"slim.request"}' htt... | <p>If I understand your question correctly, you want the <code>curl -d ...</code> to be a string in Python. To do this, you will also have to wrap <code>curl</code> in quotes: <code>strVolume = "curl -d '{\"id\": 0, ...}' ..."</code>. Make sure you escape the quotes inside.</p> | Python: curl -d json will not work without apostrophe | python|python-3.x|curl | 0 | 32 | 1 | 71,916,624 | 71,916,624 | 1 | true | 2022-04-18T20:12:59.400Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python: curl -d json will not work without apostrophe<p>I have to send the curl exact in that form to get a response in cli</p>
<pre><code>curl -d '{"id... |
71,912,409 | adding a List to a View doesn't work as expected<p>I'm busy with a screen in my app that is driving me nuts. I could use a good advice and code guidance. Here two screen dumps of the screen in action. The photo is fixed and stays put. The text below the photo, the picker and the rows can scroll.</p>
<p><a href="https:/... | <p>You need to wrap everything in another VStack.
In this case the Navigation View does not add to the problem but it should be always your top layer.</p>
<pre><code>NavigationView{
VStack{
VStack{
// Your image and headline stuff
}
List{
// ForEach ...
}
... | adding a List to a View doesn't work as expected | swiftui | 0 | 30 | 1 | 71,916,708 | 71,916,708 | 1 | true | 2022-04-18T13:25:07.760Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
adding a List to a View doesn't work as expected<p>I'm busy with a screen in my app that is driving me nuts. I could use a good advice and code guidance. Her... |
71,917,794 | Locating involved functions in WordPress<p>I'm looking at a site someone else developed. We're using a child theme that is calling back to a lot of its parent's functions. There are about two dozen plugins. Somewhere in there is a bug that's preventing a theme setting from propagating to the rendered page. The problem ... | <p>This is probably not the best answer, but I've dealt with a lot of similar situations on some of my customers who own WordPress websites.</p>
<p>I usually download the database and website locally and setup a local website using <a href="https://localwp.com/" rel="nofollow noreferrer">LocalWP</a>, but you can use an... | Locating involved functions in WordPress | wordpress|debugging | 0 | 32 | 1 | 71,917,935 | 71,917,935 | 1 | true | 2022-04-18T22:44:19.460Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Locating involved functions in WordPress<p>I'm looking at a site someone else developed. We're using a child theme that is calling back to a lot of its paren... |
71,919,247 | how to create a wrapper that changes the props for the component in react<p>I m trying to do something with react components for the first time and need your help,
I want to wrap a component inside another one dynamically and changing its props.
for example, let's say I have this component:</p>
<p>let's suppose I want ... | <p>You can use <a href="https://www.delftstack.com/howto/react/react-pass-props-to-children/#passing-props-to-children-in-react-using-react-cloneelement" rel="nofollow noreferrer"><code>children</code></a> in <code>Props</code> to render your wrapped components with your <code>Wrapper</code> component</p>
<pre><code>ty... | how to create a wrapper that changes the props for the component in react | javascript|reactjs|typescript|react-native | 0 | 260 | 1 | 71,919,515 | 71,919,515 | 1 | true | 2022-04-19T03:09:31.267Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to create a wrapper that changes the props for the component in react<p>I m trying to do something with react components for the first time and need your... |
71,920,165 | populate all array of objects<p>I have a schema of <code>concerts</code> which I am populating with <code>reviews</code> using virtual populate which returns an array of reviews. Now on every review I again have to populate <code>customerId</code> to its <code>name</code> and <code>avatar</code>.</p>
<p>Here is my code... | <p>Populating across multiple levels would help you</p>
<pre><code>Concert
.findById(id)
.populate({
path: "reviews",
options: {
sort: { rating: -1, updatedAt: -1 },
},
populate : {
path : 'customerId',
options: {
select: { name: 1, avatar: 1 },
},
}
})
.... | populate all array of objects | node.js|mongodb|mongoose|mongoose-populate | 0 | 21 | 1 | 71,920,221 | 71,920,221 | 1 | true | 2022-04-19T05:42:28.993Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
populate all array of objects<p>I have a schema of <code>concerts</code> which I am populating with <code>reviews</code> using virtual populate which returns... |
71,920,355 | Get latest date after joining with another table and grouping by some other column mysql<p>I have 2 tables like this:</p>
<p>table_1 :</p>
<p><a href="https://i.stack.imgur.com/TLSAL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TLSAL.png" alt="enter image description here" /></a></p>
<p>table_2 :<... | <p>I suspect that you are using MySQL 5.7 or earlier, so we can use a join approach here:</p>
<pre class="lang-sql prettyprint-override"><code>SELECT a.Name, b1.Rank
FROM table_1 a
INNER JOIN table_2 b1 ON b1.id = a.id
INNER JOIN
(
SELECT id, MAX(Date) AS MaxDate
FROM table_2
GROUP BY id
) b2
ON b2.id =... | Get latest date after joining with another table and grouping by some other column mysql | mysql | 0 | 27 | 1 | 71,920,444 | 71,920,444 | 1 | true | 2022-04-19T06:07:40.903Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get latest date after joining with another table and grouping by some other column mysql<p>I have 2 tables like this:</p>
<p>table_1 :</p>
<p><a href="https:... |
71,830,745 | Setting the value of an Enum field in a temporary record<p>Total newbie in AL here; I'm experimenting with automated testing in Dynamics BC for a new deployment. As a very basic test, I'd like to simply create a new Item record in the Cronus test database and validate each field. I'm running into trouble when I try to ... | <p>The code in the <code>OnValidate</code> trigger still runs, even if you have marked the <code>Record</code> variable as <code>temporary</code>. In addition <code>temporary</code> is not inherited to the underlying variables meaning any <code>Record</code> variables used in the <code>OnValidate</code> trigger are not... | Setting the value of an Enum field in a temporary record | testing|dynamics-business-central|dynamics-al | 0 | 25 | 1 | 71,920,948 | 71,920,948 | 1 | true | 2022-04-11T15:49:46.603Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Setting the value of an Enum field in a temporary record<p>Total newbie in AL here; I'm experimenting with automated testing in Dynamics BC for a new deploym... |
71,908,560 | powershell on target machine causes "PSSession could not be created for Machine:'XXX:5986"<p>I try to use release pipeline and setup a task "run powershell on target machines"</p>
<p>And here are the error messages:</p>
<pre><code>##[error]Unable to create pssession. Error: 'Connecting to remote server XXX fa... | <p>The task "run powershell on target machines" will start a <code>Enter-PSSession</code> session from <code>your agent machine</code> to <code>target VM</code>.</p>
<p>As per the error message, on your target VM, please run <code>winrm quickconfig</code> to configure the service, run <code>winrm set winrm/co... | powershell on target machine causes "PSSession could not be created for Machine:'XXX:5986" | powershell|azure-pipelines|azure-pipelines-release-pipeline|powershell-remoting | 0 | 796 | 2 | 71,920,953 | 71,920,953 | 1 | true | 2022-04-18T06:57:51.013Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
powershell on target machine causes "PSSession could not be created for Machine:'XXX:5986"<p>I try to use release pipeline and setup a task "run powersh... |
71,920,380 | Set global description for Jenkins instance<p>Using Jenkins we would like to set this global description by default. We have used groovy scripts to set other global variables but I'm struggling to find what methods / classes I need to call in order to set this description for our Jenkins instance. I see many descriptio... | <p>The description that is shown in your image, is not a global Jenkins description but rather the description of the current view you are looking on - in this case the <code>All</code> view. If you switch to another view it will change.<br />
To modify this via groovy code you need to modify the description of the vie... | Set global description for Jenkins instance | jenkins|jenkins-groovy | 0 | 28 | 1 | 71,921,053 | 71,921,053 | 1 | true | 2022-04-19T06:10:55.380Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Set global description for Jenkins instance<p>Using Jenkins we would like to set this global description by default. We have used groovy scripts to set other... |
71,921,204 | How can I write axis ticks in small capital using ggtext?<p>I want to write axis ticks in small capital using <code>ggtext::element_markdown()</code>. However, an attempt like <code><span class='font-variant: small-caps'>small capital here!</span></code> is in vain. Then, how should I achieve that effect?</... | <p>Unfortunately the <code>font-variant</code> property is not supported by <code>ggtext</code>. According to the [docs] only (<a href="https://wilkelab.org/ggtext/articles/introduction.html" rel="nofollow noreferrer">https://wilkelab.org/ggtext/articles/introduction.html</a>):</p>
<blockquote>
<p>The CSS properties co... | How can I write axis ticks in small capital using ggtext? | ggplot2|fonts|axis-labels|ggtext | 0 | 35 | 1 | 71,921,356 | 71,921,356 | 1 | true | 2022-04-19T07:34:59.540Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I write axis ticks in small capital using ggtext?<p>I want to write axis ticks in small capital using <code>ggtext::element_markdown()</code>. Howeve... |
71,920,198 | Changing properties of source block for different states in a statechart<p>I have a model in Main that looks like this:</p>
<p><a href="https://i.stack.imgur.com/0JIQe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0JIQe.png" alt="enter image description here" /></a></p>
<p>The source block is set t... | <p>Set the source block to inject instead of interarrival time. Then add a transition of type <code>timeout</code> from <code>normalWeather</code> state to itself. Set the timeout as:</p>
<pre><code>uniform(4,8)
</code></pre>
<p>And set the action as:</p>
<pre><code>source.inject();
</code></pre>
<p><a href="https://i.... | Changing properties of source block for different states in a statechart | anylogic | 0 | 31 | 1 | 71,922,072 | 71,922,072 | 1 | true | 2022-04-19T05:46:52.403Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Changing properties of source block for different states in a statechart<p>I have a model in Main that looks like this:</p>
<p><a href="https://i.stack.imgur... |
71,921,959 | SQL Optimization, Nested Query on the same table<p>i have to create a query that return employees having mutliple territories parent for the same function code :</p>
<p>Table <code>employee_territory_function</code></p>
<pre><code>employee_id| employee_function_id | territory_id
+----------+-----------------------+---... | <pre><code>SELECT E.EMPLOYEE_ID,E.EMPLOYEE_FUNCTION_ID
FROM EMPLOYEE AS E
JOIN TERRITORY AS T ON E.TERRITORY_ID=T.TERRITORY_ID
GROUP BY E.EMPLOYEE_ID,E.EMPLOYEE_FUNCTION_ID
HAVING MIN(T.TERRITORY_PARENT_ID)<>MAX(T.TERRITORY_PARENT_ID)
</code></pre>
<p>Based on your sample data</p> | SQL Optimization, Nested Query on the same table | sql | 0 | 21 | 1 | 71,922,268 | 71,922,268 | 1 | true | 2022-04-19T08:36:14.477Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL Optimization, Nested Query on the same table<p>i have to create a query that return employees having mutliple territories parent for the same function co... |
71,923,824 | Rename dataframe columns prior to looping through URL's list<p>I set up a code to loop through a list of linked XML files (<code>urls_list</code>), flatten the files and append rows.
I would like to rename the columns, so I set a list of column names in <code>cols</code>.
It seems like the rows are correctly appended i... | <p>There is a method in pandas for this: <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.rename.html" rel="nofollow noreferrer">.rename</a></p>
<p>Code sample from the docu:</p>
<pre><code>df = pd.DataFrame({"A": [1, 2, 3], "B": [4, 5, 6]})
df.rename(columns={"A": &... | Rename dataframe columns prior to looping through URL's list | python|pandas|dataframe|for-loop|web-scraping | 0 | 32 | 2 | 71,923,871 | 71,923,871 | 1 | true | 2022-04-19T10:59:45.770Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rename dataframe columns prior to looping through URL's list<p>I set up a code to loop through a list of linked XML files (<code>urls_list</code>), flatten t... |
71,916,771 | Use two columns for FTS4 from sqlite3<p>I have a table with two columns (ldap, name). I want to be able to full text search any of those columns with the library FTS4. Here I have a couple of statements I'm using to create the virtual table but when I create a statement using Match the result is empty although it shoul... | <p>Inserting data in an external content FTS table requires to provide explicitly a value for the <code>docid</code>, which should be the <code>rowid</code> of the content table.</p>
<p>In your case you need to change the trigger :</p>
<pre><code>CREATE TRIGGER __sales_rep___after_insert
AFTER INSERT ON __sales_rep
BE... | Use two columns for FTS4 from sqlite3 | sqlite|full-text-search|fts4 | 0 | 34 | 1 | 71,924,005 | 71,924,005 | 1 | true | 2022-04-18T20:31:59.663Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Use two columns for FTS4 from sqlite3<p>I have a table with two columns (ldap, name). I want to be able to full text search any of those columns with the lib... |
71,923,677 | Makefile cannot find the last prerequisite object<p>I'm trying to compile a large C++ project with source files in several subdirectories of <code>src</code>.</p>
<p>My Makefile looks like this:</p>
<pre><code># ---------- Compiler and linker directives ----------
CXX = g++-11
CXXFLAGS = -std=c++17 -fopenmp -MD -g -Wa... | <p>Typo:</p>
<pre><code>RATE_OBJ = $(addprefix $(BUILD_PATH)/,$(RATE_SRC:.cpp=.o)))
</code></pre>
<p>There is an extra close paren here, which you can see in your error message:</p>
<pre><code>make: *** No rule to make target `../build/numerical/wignerSymbols.o)', ...
</code></pre> | Makefile cannot find the last prerequisite object | makefile | 0 | 16 | 1 | 71,925,523 | 71,925,523 | 1 | true | 2022-04-19T10:48:38.897Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Makefile cannot find the last prerequisite object<p>I'm trying to compile a large C++ project with source files in several subdirectories of <code>src</code>... |
71,925,869 | VueJS - Pull results from a separate component<p>I have found an excellent example for creating URL filters. I would like the results to be in a separate component though. In this example, all the code is in one file. Can someone help me to move the results to a separate component and also ensure the URL filters work w... | <p>You need to read about props in component (vuejs.org/v2/guide/components-props.html).</p>
<p>I wrote you an example but not tested, hope it will be helpful.</p>
<pre class="lang-js prettyprint-override"><code><template>
<div id="app">
<h2>Items</h2>
<p>
<in... | VueJS - Pull results from a separate component | vue.js | 0 | 23 | 1 | 71,926,386 | 71,926,386 | 1 | true | 2022-04-19T13:33:26.257Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
VueJS - Pull results from a separate component<p>I have found an excellent example for creating URL filters. I would like the results to be in a separate com... |
71,928,497 | Error with using basic spring boot authentication<p>I am going through a spring security tutorial where I am trying to configure a basic security using the spring-boot-starter-security using the class like below</p>
<pre><code>import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.con... | <p>Code allows access without authentication for / and /api/*</p>
<pre><code>http.authorizeRequests().antMatchers("/","/api/*").permitAll()
</code></pre>
<p>It restricts access without authentication to any requests which are not matched with above url</p>
<pre><code>.anyRequest().authenticated()
</... | Error with using basic spring boot authentication | java|spring|spring-boot | 0 | 27 | 1 | 71,928,594 | 71,928,594 | 1 | true | 2022-04-19T16:47:58.923Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error with using basic spring boot authentication<p>I am going through a spring security tutorial where I am trying to configure a basic security using the s... |
71,928,474 | How can I map an array of dicts inside a React return statement?<p>I'm trying to map an array inside a return statement. However, my approach returns</p>
<blockquote>
<p>Expression statement is not assignment or call</p>
</blockquote>
<p>I also tried by wrapping it in a React <code>Fragment</code> which doesn't return ... | <p>This code is wrong.</p>
<p>You should not wrap by <code>{}</code>. If you use <code>{}</code>, it means function body so you need to add <code>return</code>. Otherwise you should use <code>()</code>.</p>
<pre><code> // This doesnt work..
{Object.entries(props.paymentPlan).map(([key,value])=>... | How can I map an array of dicts inside a React return statement? | reactjs | 0 | 27 | 1 | 71,928,595 | 71,928,595 | 1 | true | 2022-04-19T16:46:08.340Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I map an array of dicts inside a React return statement?<p>I'm trying to map an array inside a return statement. However, my approach returns</p>
<bl... |
71,929,507 | Android Webview - Access html elements from Java<p>I want to know if there is any way to access HTML elements in webview in Android (from Java) without using JavaScript interface? I know JavaScript Interface can be used to pass data but is there any way to directly access HTML elements?</p> | <blockquote>
<p>there any way to directly access HTML elements?</p>
</blockquote>
<p>No, sorry.</p> | Android Webview - Access html elements from Java | java|android|webview|android-webview | 0 | 28 | 1 | 71,929,618 | 71,929,618 | 1 | true | 2022-04-19T18:15:59.187Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Android Webview - Access html elements from Java<p>I want to know if there is any way to access HTML elements in webview in Android (from Java) without using... |
71,929,724 | One project on Windows and Android - Python<p>Is there any application(s) or possibilities that could let me work on one Python file on my PC and phone? I mean situation when I'm doing something on PC, save it, close PC, but in a middle of night I have some thought, so I don't have to open PC, but just try it on phone ... | <p>Create a Git account (Github, Gitlab, Bitbucket, etc). Push your code there. Pull it to many devices where you can edit and re-push back.</p>
<p>This is not specific to Python.</p>
<p>If you want to <strong>deploy</strong> the Python code to always run the latest changes you've made, then you can setup CI/CD actions... | One project on Windows and Android - Python | python | 0 | 30 | 1 | 71,929,767 | 71,929,767 | 1 | true | 2022-04-19T18:35:01.240Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
One project on Windows and Android - Python<p>Is there any application(s) or possibilities that could let me work on one Python file on my PC and phone? I me... |
71,928,576 | Mongoose add condition in Select<p>I want to get specific fields in mongoose based on a condition. This is the case scenario I want
This is the data:</p>
<pre class="lang-json prettyprint-override"><code>{
...
businessInfo: {
isBusinessVerified: true
categories: [...]
}
...
}
</code></pr... | <p>You are actually on the right track to use <code>$cond</code> to wrangle your businessInfo object. Just put the simple case(i.e. only the flag is returned) in <code>else</code> should be fine.</p>
<pre class="lang-js prettyprint-override"><code>db.collection.aggregate([
{
"$addFields": {
"... | Mongoose add condition in Select | mongodb|mongoose|mongodb-query | 0 | 21 | 1 | 71,930,676 | 71,930,676 | 1 | true | 2022-04-19T16:55:21.927Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mongoose add condition in Select<p>I want to get specific fields in mongoose based on a condition. This is the case scenario I want
This is the data:</p>
<pr... |
71,930,136 | How to remove an NaN and Inf in a formula<p>I am writing a report with a column that calculates year over year comps in sales. The problem I am having is that we do not have any sales history that dates before the beginning of this year. I am using the formula below to calcute the percent change but am getting NaN and ... | <p>You could write a custom function to do this, that's probably the best way especially if you will need this often, but the expression only version below should work.</p>
<pre><code>=IIF(
SUM(Fields!PYMTDInvoiced.Value)=0,
0,
(SUM(Fields!MTDInvoiced.Value) - SUM(Fields!PYMTDInvoiced.Value))
/
II... | How to remove an NaN and Inf in a formula | reporting-services | 0 | 20 | 2 | 71,930,696 | 71,930,696 | 1 | true | 2022-04-19T19:11:04.900Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to remove an NaN and Inf in a formula<p>I am writing a report with a column that calculates year over year comps in sales. The problem I am having is tha... |
71,931,060 | Using Dice metric in pytorch "torchmetrics" : dice_score() missing 2 required positional arguments: 'preds' and 'target'<p>I'm trying to use Dice metric from pytorch "torchmetrics". I found an example for using accuracy metric. like below :</p>
<pre><code>from torchmetrics.classification import Accuracy
trai... | <p><a href="https://torchmetrics.readthedocs.io/en/stable/classification/dice_score.html" rel="nofollow noreferrer"><code>torchmetrics.classification.dice_score</code></a> is the functional interface to the Dice score. That means it is a stateless function that expects the ground truth and predictions. There doesn't se... | Using Dice metric in pytorch "torchmetrics" : dice_score() missing 2 required positional arguments: 'preds' and 'target' | python|deep-learning|pytorch | 0 | 276 | 1 | 71,931,134 | 71,931,134 | 1 | true | 2022-04-19T20:40:43.123Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using Dice metric in pytorch "torchmetrics" : dice_score() missing 2 required positional arguments: 'preds' and 'target'<p>I'm trying to use Dice metric from... |
71,931,064 | Need to add more 'ticks' to axes in subplots (greater than min and max of data)<p>I need to create four graphs that look like the image below using a function in python. <a href="https://i.stack.imgur.com/VTfvd.jpg" rel="nofollow noreferrer">picture of 4 3d graphs using MATPLOTLIB with data centered on the y axis and a... | <p>Arguably the easiest way is to manually set the ticks for each axis using the <code>set_xticks, set_yticks, set_zticks</code> methods:</p>
<pre class="lang-py prettyprint-override"><code>import numpy as np
import matplotlib.pyplot as plt
# generate random data
xdata = np.random.uniform(0, 13, 25)
ydata = np.random.... | Need to add more 'ticks' to axes in subplots (greater than min and max of data) | python|matplotlib | 0 | 35 | 1 | 71,931,436 | 71,931,436 | 1 | true | 2022-04-19T20:41:03.303Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Need to add more 'ticks' to axes in subplots (greater than min and max of data)<p>I need to create four graphs that look like the image below using a functio... |
71,927,223 | How do I access the date from an rShiny dateInput?<p>I am trying to write an input page that takes the date of a section's last training, then calculates the currency of that training (how many days since), but I seem to be having a problem accessing the date from the <code>dateInput</code> element. I'm currently just ... | <p>It is working, just make sure the last value in <code>reactive</code> is the value you want to assign to the <code>reactive</code>. You can do print, but do it before your gap calculation. Another thing is <code>reactive</code> is "lazily" evaluated. It means if there is no downstream reactivity requires i... | How do I access the date from an rShiny dateInput? | shiny | 0 | 30 | 1 | 71,931,981 | 71,931,981 | 1 | true | 2022-04-19T15:07:45.170Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I access the date from an rShiny dateInput?<p>I am trying to write an input page that takes the date of a section's last training, then calculates the... |
71,932,215 | Union type doesn't allow if statement with Typescript and React<p>I have code that is something like this</p>
<pre class="lang-js prettyprint-override"><code>// some package
export interface TCustomer {
name: string;
}
</code></pre>
<pre class="lang-js prettyprint-override"><code>import { TCustomer } from "some-... | <p>You can't directly access a property if TypeScript can't determine that the property <em>definitely</em> exists. Even if you're only accessing it to check for truthyness, it's not allowed, unfortunately. Here, you can use <code>in</code> instead. (Using <code>in</code> is not only permitted, it'll also let TS narrow... | Union type doesn't allow if statement with Typescript and React | reactjs|typescript | 0 | 25 | 1 | 71,932,259 | 71,932,259 | 1 | true | 2022-04-19T22:56:43.907Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Union type doesn't allow if statement with Typescript and React<p>I have code that is something like this</p>
<pre class="lang-js prettyprint-override"><code... |
71,931,994 | How to implement shouldRepaint when the object being compared is a List?<p>Lets say in Flutter we have a Custom Painter like this that takes a List as an argument:</p>
<pre><code>class StackPainter02 extends CustomPainter {
final List<double> brightnessValues;
late final int numberOfBulbs;
StackPainter02(
... | <p>That's exactly what <code>==</code> does. Take this example:</p>
<pre><code> final l1 = <int>[1, 2, 3];
final l2 = <int>[1, 2, 3];
final l3 = l1;
print(l1 == l2); // prints false
print(l1 == l3); // prints true
l1[2] = 4;
print(l3); // prints [1, 2, 4];
</code></pre>
<p>Two different list... | How to implement shouldRepaint when the object being compared is a List? | list|flutter|dart|comparison|flutter-custompainter | 0 | 33 | 1 | 71,932,314 | 71,932,314 | 1 | true | 2022-04-19T22:24:30.703Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to implement shouldRepaint when the object being compared is a List?<p>Lets say in Flutter we have a Custom Painter like this that takes a List as an arg... |
71,926,100 | Entity framework one-to-many relationship configuration<p>A client has many adresses and a warehouse has one address. My C# code looks like this:</p>
<pre class="lang-cs prettyprint-override"><code>public class Address
{
public int Id { get; set; }
public string Text { get; set; }
public Client Client { get... | <p>Your original schema was somewhat broken, your proposed change is worse. Each table should have a unique PK. If you start doubling up IDs in a table it means you are resorting to composite PK between client ID and address ID, except that won't work for Clients that don't have an address. (#null Address ID)</p>
<p>Wh... | Entity framework one-to-many relationship configuration | .net|entity-framework | 0 | 24 | 1 | 71,932,453 | 71,932,453 | 1 | true | 2022-04-19T13:49:36.263Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Entity framework one-to-many relationship configuration<p>A client has many adresses and a warehouse has one address. My C# code looks like this:</p>
<pre cl... |
71,932,250 | Predictions only returns value "1". shinyApp<p>I am trying to make predictions using a shinyApp but it seems something is wrong because the predict function allways returns value "1". I cant figure out.</p>
<p>I built a bagging model.</p>
<pre><code>library(ipred) #Bootstrapped Aggregation (Bagging)
df<-da... | <p>Instead of <code>renderText</code>, use <code>renderPrint</code>. Then your code works fine.</p>
<p>Try this</p>
<pre><code>ui <- fluidPage(
titlePanel("Predictions"),
fluidRow(
column(3,textInput("var1", h3("var1"))),
column(3,textInput("var2", h3("var... | Predictions only returns value "1". shinyApp | r|machine-learning|shiny|shinyapps | 0 | 30 | 1 | 71,932,780 | 71,932,780 | 1 | true | 2022-04-19T23:01:09.477Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Predictions only returns value "1". shinyApp<p>I am trying to make predictions using a shinyApp but it seems something is wrong because the predict function ... |
71,932,903 | How to make a mini fab in Jetpack Compose<p>In XML we can make the floating action button in 2 sizes (regular and <a href="https://material.io/components/buttons-floating-action-button/android#mini-fabs" rel="nofollow noreferrer">mini</a>) like the following</p>
<pre><code> <com.google.android.material.floatingacti... | <p>As you can see in the FAB implementation it sets a default size.
If you want to change the FAB size, I think the only way is using the <code>Modifier.size(40.dp)</code>.</p>
<pre><code>FloatingActionButton(
modifier = Modifier.size(40.dp), // 40 is a mini-fab
onClick = { }
) {
Icon(imageVector = Icons.F... | How to make a mini fab in Jetpack Compose | android|android-jetpack-compose|floating-action-button | 0 | 537 | 2 | 71,933,652 | 71,933,652 | 1 | true | 2022-04-20T00:48:29.940Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make a mini fab in Jetpack Compose<p>In XML we can make the floating action button in 2 sizes (regular and <a href="https://material.io/components/but... |
71,931,392 | updating multiple document at once<p>I have an array that contains objects of users, like below.</p>
<pre><code>[
{id: 122, name: 'Jone', addr: '11111aaaa'},
{id: 12, name: 'Jane', addr: 'spring field'},
{id: 14, name: 'Joe', addr: 'awesome street'},
]
</code></pre>
<p>When each user is saved to a separated docum... | <p>Use multi update ?</p>
<pre><code>db.collection.update({
name: {
$in: [
"Jone",
"Jane"
]
}
},
{
$set: {
addr: "somewhere"
}
},
{
multi: true
})
</code></pre>
<p><a href="https://mongoplayground.net/p/azsXUVFemgR" rel="nofollow noreferrer">mongoplaygroun... | updating multiple document at once | mongoose | 0 | 13 | 1 | 71,933,709 | 71,933,709 | 1 | true | 2022-04-19T21:08:39.460Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
updating multiple document at once<p>I have an array that contains objects of users, like below.</p>
<pre><code>[
{id: 122, name: 'Jone', addr: '11111aaaa'... |
71,925,794 | Pydantic Inherited Class validation<p>I have 2 Pydantic classes</p>
<pre><code>class AuthenticatedCreateBasketV2ApiModel(PublicCreateBasketV2ApiModel):
agency: str = Field()
owner: Optional[UserUuid] = Field()
effective_date: Date
class PublicCreateBasketV2ApiModel(BaseModel):
agency: str
changes... | <blockquote>
<p>The problem is that I can't seem to access effective_date in my validator</p>
</blockquote>
<p>Add the <code>values</code> argument and make sure that <code>effective_date</code> is before <code>changes</code>. From <a href="https://pydantic-docs.helpmanual.io/usage/validators/" rel="nofollow noreferrer... | Pydantic Inherited Class validation | python-3.x|pydantic | 0 | 539 | 1 | 71,933,792 | 71,933,792 | 1 | true | 2022-04-19T13:28:54.733Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pydantic Inherited Class validation<p>I have 2 Pydantic classes</p>
<pre><code>class AuthenticatedCreateBasketV2ApiModel(PublicCreateBasketV2ApiModel):
... |
71,933,399 | ktor plugins: require configuration values<p>I was wondering if there is a way to require configuration parameters when making custom plugins? My current hack around is to catch it at runtime</p>
<pre class="lang-kotlin prettyprint-override"><code>class PluginConfiguration {
var someConfig: String? = null
}
val My... | <p>I think it's not possible with <code>PluginConfiguration</code> API.</p>
<p>But there should be no problem in converting <code>MyPlugin</code> to a function, which will require a parameter to be specified:</p>
<pre><code>fun MyPlugin(someRequiredConfig: String) =
createApplicationPlugin(name = "MyPlugin&quo... | ktor plugins: require configuration values | kotlin|ktor | 0 | 27 | 1 | 71,933,954 | 71,933,954 | 1 | true | 2022-04-20T02:20:14.493Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ktor plugins: require configuration values<p>I was wondering if there is a way to require configuration parameters when making custom plugins? My current hac... |
71,935,802 | Map as a function parameter in Flutter<p>Error: <code>Non-nullable instance field id must be initialised.</code></p>
<p>Source: <code>Picture.fromMap</code></p>
<pre><code>import 'dart:typed_data'; // Uint8List
class Picture {
int id;
String title;
Uint8List? picture;
Picture({this.id = 0, this.title = "&quo... | <p>Use keyword <code>late</code> when you know that it will be initialized later. otherwise use <code>int id=0;</code> and similar for other non nullable fields as a default initialization</p>
<pre><code>class Picture {
late int id;
late String title;
Uint8List? picture;
Picture({this.id = 0, this.title = "&... | Map as a function parameter in Flutter | android|flutter|dart | 0 | 261 | 4 | 71,936,092 | 71,936,092 | 1 | true | 2022-04-20T07:35:00.927Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Map as a function parameter in Flutter<p>Error: <code>Non-nullable instance field id must be initialised.</code></p>
<p>Source: <code>Picture.fromMap</code><... |
71,936,127 | How to generate lookup table for counting leading zeroes (clzlut)?<p>I found <a href="https://stackoverflow.com/a/2355682/169992">this function</a>, but there is no explanation of where the <code>clzlut</code> lookup table came from (and I searched for many hours for it on the web, couldn't find anything):</p>
<pre><co... | <blockquote>
<p>How do you generate this lookup table?<br />
...to know how to generate a fallback, and for curiosity/learning's sake.</p>
</blockquote>
<pre><code>For each index 0 to 255:
Start at count = 8. (Bit width of uint8_t)
Copy index to i.
while i > 0:
Divide i by 2.
Decrement count.
clzlu... | How to generate lookup table for counting leading zeroes (clzlut)? | algorithm|bit-manipulation | 0 | 25 | 1 | 71,936,202 | 71,936,202 | 1 | true | 2022-04-20T08:03:34.447Z | Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to generate lookup table for counting leading zeroes (clzlut)?<p>I found <a href="https://stackoverflow.com/a/2355682/169992">this function</a>, but ther... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.