input_text_instruct
stringlengths
288
45.8k
output_text
stringlengths
37
33.2k
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to redirect to another component's tab in angular 12?<p>I am trying to redirect to another component's tab using the <code>routerLink</code>.</p> <p>for ...
<p>You are going in the right direction. Just add <code>history-tab</code> as query params:</p> <pre><code>&lt;a class=&quot;hvr-icon-forward&quot; [routerLink]=&quot;['/app/Snow']&quot; [queryParams=&quot;show:history-tab&quot;]&lt;/a&gt; </code></pre> <p>In your component read like this:</p> <pre><code>import {Route...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: query to get statistic data from SQL server<p>I have a table named total sales. In this table there are sales data like invoice date and branch name that sel...
<p>Based on your description, what you wanted should be</p> <pre><code>SELECT invoice_date, SUM(case when branche_name = 'branch1' then quantity end) AS malqaStore, SUM(case when branche_name = 'branch2' then quantity end) AS tahliaStore FROM total_sales WHERE branche_name in ( 'branch1' , 'branch2' ) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Repeated data on inserted rows<pre><code>--demo setup drop table if exists dbo.product go create table dbo.Product ( ProductId int, ProductTitle va...
<p>Well, first of all, you need to find a sequence number over all your records. If you already have a primary key, that's good. In example you gave us, there's no such column, so let's generate it. Then, we make pairs with start and end dates for each product's category change. Another thing is to group all these prod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why Net::DNS::Resolver does not return IP for localhost?<p>I am inside docker container. When I run: <code>perl -Ilocal/lib/perl5 -MNet::DNS::Resolver -e 'pr...
<p>Judging from the docs and your debug output, you want <code>Net::DNS::Resolver-&gt;new(defnames =&gt; 0)</code> to pass unqualified names (with no dots) directly to the server, instead of always appending the default domain.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rearrange columns as per column headers - Run-time error 9: Subscript out of range<p>I want to rearrange columns as per column headers. I found the below mac...
<p>The issue is when your <strong>Base</strong> worksheet has more than <strong>12</strong> columns.</p> <p>For example if the worksheet has 13 columns.<br /> The <strong>lastCol</strong> variable is set to 13.<br /> It is passed into the <strong>col</strong> variable and when it reaches 13 and is used in <code>correct...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Download web page and remove content except for one html table<p>I am given a large html report from another department quite regularly that requires a fair ...
<p>Suggesting <code>gawk</code> cutting on first multi-line record. Followed by <code>sed</code>, head trimming till <code>&lt;!-- ...</code>.</p> <pre><code>gawk 'NR==1{print}' RS=&quot;&lt;/table&gt;\n&lt;/div&gt;\n&lt;/div&gt;&quot; input.html |sed '0,/&lt;!-- START Daily Keystroke/d' </code></pre> <p>Or without int...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: scipy has no attribute signal<p>I have a file which imports a function from another file, like shown below.</p> <p><strong>file1.py:</strong></p> <pre><code>...
<p>With scipy, you need to import the submodule directly with either <code>import scipy.signal</code> or <code>from scipy import signal</code>. Many submodule won't work if you just import scipy. You can read about the scipy api <a href="https://docs.scipy.org/doc/scipy/reference/" rel="nofollow noreferrer">here</a></p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check if native element exist or not in Angular<p>I have this checkbox</p> <pre><code> &lt;input #optionA class=&quot;form-check-input&quot; type=&quot;chec...
<p><code>optionA</code> / <code>optionB</code> are probably undefined. Check for them.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to read a File character-by-character in reverse without running out-of-memory?<hr /> <h2>The Story</h2> <hr /> <p>I've been having a problem lately...</...
<p>This will do it (but as written it is not very efficient).</p> <ul> <li>just skip to the last location read less one and read and print the character.</li> <li>then reset the location to the mark, adjust size and continue.</li> </ul> <pre><code>File f = new File(&quot;Some File name&quot;); int size = (int) f.length...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Looping Over And Array of Objects and Updating Each One<p>I'm trying to update objects inside an array based on specific conditions that I check using two fu...
<p>Try this:</p> <pre class="lang-js prettyprint-override"><code>(async () =&gt; { let posts = await Post.find() posts.map(async (post) =&gt; { if (isLessThanOneDay(post.deadline)) { console.log(post.id, post._id) await Post.findOneAndUpdate({ _id: post.id }, { $set: { category: 'deadline' }}) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: gcov is invoking gtest sources and unit-tests. how can I avoid this?<p>I am working on creating a Jenkins pipeline for unit-testing maybe with GTest. My plan...
<p>You can filter out unwanted coverage data, but you can't create data that doesn't exist.</p> <blockquote> <p>1. gcov is creating gcda and gcno files for gtest sources and my unit-tests. Because gcovr is invoking them and I see them in the HTML files. how can I avoid this? I only want my production code in the HTML f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I get the value of an Array without knowing the name of the Array<p>im currently working on a user authentication system using expressJS. Therefore to...
<p>I suspect your library's <code>query()</code> might be returning a <code>[rows, fields]</code> array.<br/> <a href="https://www.npmjs.com/package/mysql2" rel="nofollow noreferrer"><code>mysql2</code></a>'s <code>query()</code> does, at least.</p> <p>Maybe the below?:</p> <pre class="lang-js prettyprint-override"><co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android Studio 3.1.3 . Build Error while Executing app on build apk or emulator<p>I have upgraded my windows 7 Ultimate to windows 8.1 and after opening my p...
<p>I have very similar problem the solution is add these line in gradle.properties:</p> <pre><code>android.useAndroidX=true android.enableJetifier=true </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to write "twice" so it can accept "swap" without restricting their type<p>If I have these definitions</p> <pre><code>twice f = f . f swap (x,y) = (y,x) ...
<p>This is tricky to do, because you need to express that the result- and argument types are polymorphic, yet in a particular functional relationship. You need to provide this relationship in an explicit way. The most common way of expressing a type-level function is with a type family, but such functions can not be na...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: adjust values which are associated with a string from a different column<p>I have a dataframe which I'd like to adjust the values which are associated with a...
<pre><code>df['wgt'] = np.where(df.name == &quot;joe&quot;, df.wgt * 1.1, df.wgt) </code></pre> <p>or</p> <pre><code>df.loc[df.name == &quot;joe&quot;, &quot;wgt&quot;] *= 1.1 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: change bar chart column color in odoo<p>I have the task of changing colors in graph -&gt; bar chart columns. By default they are blue. But I want to change ...
<p>The graph colors are set in the <a href="https://github.com/odoo/odoo/blob/15.0/addons/web/static/src/views/graph/graph_renderer.js#L42" rel="nofollow noreferrer">graph renderer</a>. For example for the bar chart, odoo get the color from <a href="https://github.com/odoo/odoo/blob/15.0/addons/web/static/src/views/gra...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: node cross-env can't set the class variables<p>i am using <code>node v12.22.9</code>, <code>npm 8.5.1</code> and installed <code>cross-env: &quot;^7.0&quot;<...
<p>When you're using classes you can use the constructor to set class variables using <code>this</code></p> <pre class="lang-js prettyprint-override"><code>class eyesonMeeting { constructor() { this.audio = true; } // example using audio in a different function someFunctionSettingAudioFalse() { this.au...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to read preference with glance Widget Jetpack compose?<p>I'm trying to do a weather app with a widget. I call open weather map api and I can see the weth...
<p>I found a very good exemple If it can help someone : <a href="https://itnext.io/schedule-image-displaying-in-glance-widget-with-work-manager-api-cc474ed8571c" rel="nofollow noreferrer">https://itnext.io/schedule-image-displaying-in-glance-widget-with-work-manager-api-cc474ed8571c</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change broadcast_address of existing YugabyteDB installation<p>[Question posted by a user on <a href="https://www.yugabyte.com/slack" rel="nofollow noreferre...
<p>I don’t think we support changing the bind/broadcast address, after the fact. We persist address information, in various structures, across servers, eg: for each tablet, we store the IP in each raft group.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Upgrade Typeorm version 0.2.28 to 0.2.45<p>I want to upgrade my typeorm version from 0.2.28 to 0.2.45 but when I tried to start the server I had an error tha...
<p>I found that the problem was in createConnection, it was like that:</p> <pre><code>createConnection().then(async () =&gt; { console.log(`Server is running at http://localhost:${PORT} `); }); </code></pre> <p>and i just added the ormconfig as argument in createConnection:</p> <pre><code>createConnection({ &quot...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: joinedload and load_only but with filtering<p>I have two models with a simple FK relationship, Stock and Restriction (Restriction.stock_id FK to Stock).</p> ...
<p><code>joinedload</code> basically should not be used with <code>filter</code>. You probably need to take <code>contains_eager</code> option.</p> <pre class="lang-py prettyprint-override"><code>from sqlalchemy.orm import * my_query = Restriction.query.join(Restriction.stock).options( contains_eager(Restriction.s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Typescript type of variable string yet still says it can be a string or null<p>I have a state that is expecting a string variable. It's a search term. I'm ge...
<p>My guess is that typescript is preventing this, since it does not know if the function will return a <code>string</code> type again if it has done that in the first go.</p> <p>Look at this example:</p> <pre><code>const random = () =&gt; { let x = 3; let arr = [2,'str']; return arr[x%2]; }; const letX :string = typeo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Linux:Splitting a string into an array with shell<p>I have a way to siplt the string into a array with shell ,but the array seems no value</p> <pre><code>&gt...
<p>If the values are &quot;nice&quot; - no filename expansion trigger characters and elements are nicely separated by spaces - just read the array.</p> <pre><code>arr=($a) </code></pre> <p>A way better and safer version, is to use readarray or mapfile.</p> <pre><code>readarray -d ' ' -t arr &lt; &lt;(printf &quot;%s&qu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Svelte's reactivity not working on class variables<p>So for form actions, I made a class to make things cleaner, but there's a problem. Whenever any errors/s...
<p>Reactivity only works for code within components, outside you need to use stores or events to signal changes.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: blazor - EditorRequired attribute<pre><code> @code { [Parameter, EditorRequired] public Trail Trail { get; set; } = default!; } </code></pre> <p>...
<blockquote> <p>What does this mean</p> <ol> <li>EditorRequired</li> </ol> </blockquote> <p>It is a hint to the user of your component that <code>Trail</code> is a required parameter. When you 'forget' Trail, as in <code>&lt;MyComponent /&gt;</code> you will get a warning, and some squiggly lines under that usage.<br ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: create a pdf file with Jinja without creating the html file<p>I'm creating a pdf file using an html template and weasyprint to convert the html file to a pdf...
<p>Thanks to a @K J idea I just add a delete functionality at the end of the function</p> <p>And the code will be like this</p> <pre><code>def save_the_last_bill_to_html_pdf(self): env = Environment(loader=FileSystemLoader('templates')) # 3. Load the template from the Environment template = env....
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 make 'xsl:for-each' create one output file for every found instance?<p>I have three files: '1b.xml', '2b.xml' and 'try.xcl'.</p> <p>What I ...
<p><em><strong>--- edited in response to clariifcation ---</strong></em></p> <p>In <strong>XSLT 2.0</strong> or higher, you can do:</p> <pre><code>&lt;xsl:stylesheet version=&quot;2.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;&gt; &lt;xsl:output method=&quot;xml&quot; version=&quot;1.0&quot; enco...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get the number before a certain value in each row<p>I haven't be able to find this anywhere. I want to be able to create a column that uses the data from the...
<p>A possible solution in <code>base R</code>:</p> <pre class="lang-r prettyprint-override"><code>df$end_num &lt;- apply(df, 1, \(x) x[which(x == &quot;end&quot;) - 1]) df #&gt; V1 V2 V3 V4 V5 V6 end_num #&gt; 1 0 start 1 end ended 0 1 #&gt; 2 3 end 0 start 5 0 3 #&gt; 3 2 star...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spaces between editor line numbers intellij<p>As you can see there is a lot of &quot;Spaces&quot; between editor line numbers and i dont know how to disable ...
<p>thanks to @user11350388 I finally found the problem and basically it was cause of a property in Editor|Inlay Hints. Specifically in Code vision -&gt; Code author where if I deactivate it the problem is solved by magic.</p> <p><a href="https://i.stack.imgur.com/7N4e8.png" rel="nofollow noreferrer"><img src="https://i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove URLs from image alt text in Wordpress<p>i have a WP installation that lots of image alt text contain the URL of the image. Like:</p> <pre><code>&lt;im...
<p>Wordpress saves alt text inside the wp_postmeta table, just search for one of your media post ID and look for the _wp_attachment_image_alt post meta key.</p> <p>You will find your alt text there. If you want to simply remove ALL of them you may try with a simple REPLACE made in mysql, watch out with the conditions, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript) I would like to compare two two-dimensional arrays to delete the duplicate elements<p>As I have already asked, I would like to ask again because ...
<p>So one issue is that when you splice the ground array you are removing the element and then the .forEach method jumps FORWARD to the next element and now you've skipped over an element. If you use a traditional for loop you can shift the for loop back one every time you remove an element so you do not skip any.</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why I am not able to extract the object using the masked image?<p>Here are two images in the drive, one is masked and another one is real image:</p> <p><a hr...
<p>your code just needs an additional <code>/255</code>.</p> <pre class="lang-py prettyprint-override"><code>import cv2 import numpy as np img = cv2.imread('im010.jpg') mask = cv2.imread('im010.png') img_foreground = np.array((mask/255)*(img/255)) cv2.imshow('', img_foreground) cv2.waitKey() </code></pre> <p>that's ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQLiteDialect_pysqlite cannot be used as a data source for security reasons<p>I've a error in the middle of using superset database. I've gotten add new data...
<p>Support for SQLite database connections was retired via configuration some versions ago due to security reasons (basically, it's not a proper DB to support multi-web servers).</p> <p>That said, if your superset set up is simple and the SQLite DB isn't going to support heavy workload, you can turn support on by chang...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get 1,2,3,4,5 star average individually (1star% +2star% +3star% +4star% +5star%=100%)<p>Suppose i have rated a user with 1 star 3 times, 2star 1times, 4star ...
<p>Create in your <code>User</code> model methods, that count the precentage and then simply use it as needed:</p> <pre><code>class User(...): ... def count_star_precentage(self, star): return (Rating.objects.filter(activity__creator=self, star=star).count() / self.all_ratings().count()) * 100 def ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Problem with showing/outputting Nat type in a function that converts integers to Nats<p>I am currently learning about types in Haskell, and a given example i...
<blockquote> <p>“No instance for <code>(Show T)</code>” means “I don't know how values of type <code>T</code> should be converted to string so I can print them”. Often, declaring the type <code>T</code> with <code>... deriving (Show)</code> is enough to provide a basic conversion. – <a href="https://stackoverflow.com/u...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert a data frame to into row vector or long vector<p>I'm not sure what is the exact data type that is but when I see class It shows character and numeric...
<p>Your expected outcome is not clear to me (i.e. using your sample data, what should the final outcome be?), but perhaps you're looking for <code>table()</code> (my guess for &quot;a&quot;) or <a href="https://tibble.tidyverse.org/reference/enframe.html" rel="nofollow noreferrer"><code>deframe()</code> from the tibble...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: the trait bound `actix_identity::Identity: FromRequest` is not satisfied<p>I am following <a href="https://dev.to/krowemoh/a-web-app-in-rust-07-logging-a-use...
<p>The error message is unhelpful (there is an <a href="https://github.com/rust-lang/rust/issues/22750" rel="nofollow noreferrer">open issue for this</a>).</p> <p>You're using actix-identity 0.3 which depends on actix-web 3 while your main app function is using actix-web 4 which causes Rust to include <em>both</em> act...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make React Leaflet Marker popup in right side always?<p>I want to show a React Leaflet Marker popup on the right side of the map screen, but it always...
<p>On top that that marker I have added a model to show data.</p> <p>and the model goes top of the map like this so you can write your own popup.</p> <pre><code>const [open, setOpen] = React.useState(false); const [data, setData] = React.useState(); const handleClose = () =&gt; { setOpen(false); }; const han...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to call a method on a dependency with SpEL<p>I want to call a method on a dependency in my controller in <code>@PreAuthorize</code> annotation using SpEL...
<p>Problem was I wanted to reference a <strong>MapStruct</strong> mapper, which was registered as a bean, with the name of the interface instead of the actual bean name which is the implementation.</p> <p>I had a mapper interface called <strong>PuppetMapper</strong>, registered as a Spring bean, but looking at the actu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get a Rquared and F-ratio for a mixed effects model in R?<p>Data fits a mixed effects model with nested random effects. How do I get the r-square and ...
<p>For the R-squared you can use the <code>r.squaredLR</code> function from the <code>MuMIn</code> package:</p> <pre><code>library(MuMIn) r.squaredLR(mod) </code></pre> <p>Output:</p> <pre><code>[1] 0.1017782 attr(,&quot;adj.r.squared&quot;) [1] 0.1086741 </code></pre> <p>For the F-ratio, maybe you want this:</p> <pre>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: image resize in bootstrap<p>I am new to html, css, &amp; bootstrap. I am having a problem with an image with a class of card-img-top. I can t figure out why ...
<pre><code>.card-img-top { height: 250px; } </code></pre> <p>You can set the height of your image like this.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Vaadin 23: file upload from clipboard / Ctrl+V<p><strong>My need</strong>: I'd like to add an &quot;upload from clipboard&quot; functionality into a Vaadin 2...
<p><strong>Why initially intended solution does not work</strong>: It seems that uploading a screenshot via an <code>Upload</code> field is not feasible because the <a href="https://developer.mozilla.org/en-US/docs/Web/API/FileList" rel="nofollow noreferrer">FileList</a> (= model of a file input field) does not allow t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Octave: create a class variable then access it within class (in constructor)<p>Maybe it's a trivial question but I would like to know how to access a constan...
<p>The question is a bit confusing, as different attempts seem to be using different parts, but in general I think your problem is that you are not passing the object as a formal parameter in the method.</p> <p>It is also not clear if you are trying to modify the object &quot;in-place&quot;, or trying to generate a new...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python GEKKO: how to insert a function into the solver?<p>I have quite a big project I want to solve with GEKKO. It consists of quite a large number of parti...
<p>There is no current method to call external &quot;black-box&quot; functions with Gekko. One of the reasons that Gekko performs well is that it compiles the functions to byte-code as if they were written in FORTRAN or C++ and it uses automatic differentiation to provide sparse 1st and 2nd derivatives to the solvers. ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to calculate df.cummin() piecewise<p>I want to start <code>df.cummin()</code> when <code>cond</code> column is true until recompute <code>df.cummin()</co...
<p>You're looking to groupby the cumsum of the cond column. Since you don't want any values up until the first True, you need to essentially delete values for group zero.</p> <pre><code>import pandas as pd import numpy as np A=[17,18,21,15,18,19,22,16,30,50,] cond=[False,True,False,False,False,True,False,False,True,Fal...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why I got unable to get local issuer certificate for https://registry.yarnpkg.com<p>I just happen to get error <code>unable to get local issuer certificate</...
<ol> <li>Check if your .npmrc does not specify manual CAs.</li> <li>Check if you are behind a corporate proxy.</li> <li>Check if your local certificates are corrupted.</li> </ol>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create registry entry but not delete it<p>Working on something for Server2012 (Win8) and it's communicating with a website that uses TLS 1.2. So, for those O...
<p>Sure. Make the <code>&lt;Component Permanent=&quot;yes&quot;</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What's the difference between the print inside and outside<p>I am learning the tensorflow which version is 2.8.0 on my MacBook M1. For debugging the code in ...
<p>I believe it is because tensorflow datasets have <em>lazy loading</em>, which means they aren't evaluated until you actually try to iterate over the result.</p> <p>When you removed the for loop, you were no longer iterating over the result, so it was never evaluated.</p> <p>See <a href="https://stackoverflow.com/a/5...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: save by group predicted values from linear regression to a dataframe<p>I want to apply linear regression and predict values to subsets of my original data by...
<p>The output must be a Series of numpy arrays, so <code>explode()</code> should do the trick.</p> <p>However, <code>time</code> cannot be a column in the output because the dimensions won't match. Function <code>model()</code> returns the predicted values, so unless the length of each sub-df is 59, <code>time</code> c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas: get first occurrence and ignore if in any other column on same day<p>Newbee here.</p> <p>Given the below files, I am trying to count how many times a...
<p><strong>UPDATED ANSWER:</strong></p> <p>Based on clarifications by OP in comments, here is a new strategy to get what is required:</p> <pre class="lang-py prettyprint-override"><code>df = df.set_index(['Date', 'Facility', 'Begin Time']).stack() df.index=df.index.droplevel(3) df = df.to_frame().rename(columns={0:'Nam...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python3.9 cryptography.fernet error on import<p>My code:</p> <pre><code>from cryptography.fernet import Fernet </code></pre> <p>Error:</p> <pre><code>Traceba...
<p>The file encoding was incorrect, I had to change it to utf-8</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to check for undefined before assigning to variable<p>Im using a find method to extract an ID (string) but this is returning an undefined as it doesnt ex...
<p>You can use <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining" rel="nofollow noreferrer">optional chaining</a> like this:</p> <pre><code>const additionalLinePhoneNumber = products.find(product =&gt; product.name === 'segundaLinea')?.id; </code></pre> <h3>Edit:</h3...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Executable.hasRealParameterData() and Parameter.isNamePresent() don't work as expected<p>This question is kind of continuation of one previously asked in <a ...
<p>As it was pointed out by <a href="https://mail.openjdk.org/pipermail/core-libs-dev/2022-June/092008.html" rel="nofollow noreferrer">Daniel Fuchs</a> we need to compile the code with <code>-parameters</code> flag.</p> <p><a href="https://docs.oracle.com/en/java/javase/18/docs/specs/man/javac.html" rel="nofollow noref...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get all tables owned by one user but not by others, one by one<p>It's being assumed that two users own the same table when both of them own a table wi...
<p>I would do it like this:</p> <pre><code>SELECT m.TABLE_NAME, usr_count, owner_list FROM DBA_TABLES m LEFT JOIN (SELECT TABLE_NAME, count(*) as usr_count, listagg(OWNER, ',') within group (order by OWNER) as owner_list FROM DBA_TABLES WHERE OWNER LIKE 'USR_%' GROUP BY TABLE_NAME...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flink Oracle JDBC sink connector not loading the driver<p>I am trying to create Flink JBDC sink to an oracle database. When run locally (from a junit test an...
<p>There is no support in Flink 1.13 for Oracle via JDBC, that was only added in Flink 1.15</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How I can use emojis with React?<p>I need to know if is there an emoji library that allows using of emojis and also gets an HTML emoji decimal or hexadecimal...
<p>If I get you correctly, you want to find <strong>full emoji references list.</strong></p> <p>You can <strong>check out</strong> this emoji <strong>unicode reference</strong> from W3Schools: <a href="https://www.w3schools.com/charsets/ref_emoji.asp" rel="nofollow noreferrer">https://www.w3schools.com/charsets/ref_emo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parse duration format from PT0S or PT1H57M4S to 01:57:04 in Google Sheets/DataStudio<p>I'm exporting duration from clockify to google sheets, but keep gettin...
<p>Use <code>regexextract()</code>, like this:</p> <pre><code>=arrayformula( iferror( 1 / ( iferror( regexextract(C1:C; &quot;(\d+)H&quot;) / 24 ) + iferror( regexextract(C1:C; &quot;(\d+)M&quot;) / 24 / 60 ) + iferror( regexextract(C1:C; &quot;(\d+)S&quot;) / 24 / 60 / 60 ) ) ^ -1 ) ) </code></pr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find occurrences of a pair in a multimap<p>I have been trying to write a program that finds the occurrences of a pair in a multimap. So far I am think...
<p>I suggest using a <code>std::unordered_map&lt;std::string, std::unordered_map&lt;std::string, unsigned&gt;&gt;</code> instead. You then get 2 fast lookups and the count without iterating.</p> <p>Example:</p> <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt; #include &lt;iterator&gt; #include...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Coalesce in duplicated values<p>I have a table like this:</p> <p><a href="https://i.stack.imgur.com/str4f.png" rel="nofollow noreferrer"><img src="https://i....
<p>You can <code>GROUP By &quot;_sdc_source_key_id&quot;</code> and use <code>MAX</code> of your values</p> <pre><code>Select &quot;_sdc_source_key_id&quot;, MAX(COALESCE(value='Integrity',null)) as cia_security ,MAX(COALESCE (value='Confidentiality',null)) as cia_conf ,MSX(COALESC...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it bad practice to have parameters the same name as a variable in the outer scope?<p>I've run into this enough that I thought I'd ask: is it bad to have p...
<p>It can potentially cause unnecessary confusion and errors, but tooling can help prevent this from happening at all or differentiate state from arguments. ESLint was already mentioned in that regard.</p> <p>If a function does not rely on state reactivity, you can consider to extract it to a separate file where the sh...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you position a set of buttons that don't move when text size changes?<p>I'm stuck on trying to make these buttons positions absolute so that when the ...
<p>you have to give a specific width to the span element</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Combine ranges in one function<p>I got a function to shuffle multiple columns with different amount of values. For every column I have a function that shuffl...
<p>Probably it can be done with a loop this way:</p> <pre><code>var ss = SpreadsheetApp.getActiveSpreadsheet(); var sheet = ss.getSheetByName('level_345'); var ranges = ['A1:A101','B1:B99','C1:C89','D1:D124','E1:E75']; ranges.forEach(r =&gt; shuffleRange(r, sheet)); function shuffleRange(r, sheet) { var range = she...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# How to Iterate in an IEnumerable<object><p>I have a table where I want to display the data that I get from the database but can't find a way to iterate wi...
<p>Maybe you can try to set <code>List&lt;Paciente&gt;</code> as the model of the view.Here is a simple demo:</p> <p>action:</p> <pre><code>public IActionResult ObtenerTodos() { var pacientes = from p in _context.Pacientes from p1 in _context.Personas where p....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pg_dump toc.dat missing public schema line<p>I'm trying to parse the toc.dat file and I see different result when dumping same database from different pg_dum...
<p>See this commit <a href="https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=5955d934194c3888f30318209ade71b53d29777f" rel="nofollow noreferrer">pg_dump</a> the relevant part being:</p> <blockquote> <p>This has the visible effect that the public schema won't be mentioned in the output at all, except for u...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter aligning GridView widget<p>so i want to put my <strong><code>Gridview.count</code></strong> widget in bottomCenter of my app. As you can see, my <str...
<p>add <code>shrinkWrap: true</code> to GridView</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: UTF-8 Arabic in JavaScript<p>I read <a href="https://stackoverflow.com/questions/38831465/arabic-characters-doesnt-show-properly-in-javascript">this</a>, but...
<p>As mentioned by @slebetman in his comments, the correct answer is to send the data from the server as <code>utf-8</code> which is done in my case as I'm sending data as streaming, by sending the <code>Content-Type</code> as <code>text/event-stream; charset=utf-8</code></p> <p>My code in the GoLang server became:</p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can we able to take a backup of the file using wildcard<p>we have some files like dev_app_s01.properties dev2_app2_s01.properties qa_app_s02.properties</p> <...
<p>One method could be sticking a for loop around one of these many solutions:</p> <p><a href="https://unix.stackexchange.com/questions/96380/how-to-append-date-to-backup-file">https://unix.stackexchange.com/questions/96380/how-to-append-date-to-backup-file</a></p> <p>The gist would be:</p> <pre><code>for i in dev*_app...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can you apply a custom function to a column in pandas dataframe and store the output in a column of another dataframe?<p>I am trying to call a specific f...
<p>I don't really understood what this function should do, but I think <code>pandas.apply</code> might be relevant... <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.apply.html" rel="nofollow noreferrer">https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.apply.html</a></p> <p>if you co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to sum elements of N lists in python?<p>I have a list of tuples of lists... :</p> <pre><code>lst = [(['a', 1], ['b', 2]), (['c', 3], ['d', 4], ['e', 5])]...
<p>Simply this:</p> <pre><code>L = [(['a', 1], ['b', 2]), (['c', 3], ['d', 4], ['e', 5])] for t in L: s = ''.join(x[0] for x in t) S = sum(x[1] for x in t) print([s, S]) </code></pre> <p>and refrain to define variable names using python keywords...</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Way to revoke the signed URL created in GCP<p>I have a signed URL <code>$gsutil signurl -d 7m &lt;private-key&gt; gs: //&lt;bucket&gt;\&lt;obj&gt;</code> is ...
<p>A signed URL can only be revoked by invalidating the service account public key.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does MongoDB throw error "ns does not exist"?<p>I don't understand why MongoDB triggers an error with the following NodeJS code:</p> <pre><code>import { ...
<p>I would vote that <code>await users.countDocuments()</code> returns 0 as workaround, effectively what happens here is:</p> <ol> <li><code>ns not found exception</code> is thrown.</li> <li>This exception is handled by returning 0 without actual exception.</li> </ol> <p>You can see it in the shell as well:</p> <pre><c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do i this Verification widget?<p>I have this DESIGN <a href="https://i.stack.imgur.com/yD6MC.jpg" rel="nofollow noreferrer"><img src="https://i.stack.img...
<p>I did it without package. Result in image below.</p> <p><a href="https://i.stack.imgur.com/N1m4T.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/N1m4T.jpg" alt="" /></a></p> <pre><code>class OTPScreen extends StatefulWidget {   final String email;   final String type;   const OTPScreen( ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert a column of char datatype into time format in R?<p>I have a dataset which contains some columns in hh:mm:ss format in excel. When I imported t...
<pre class="lang-r prettyprint-override"><code>library(tidyverse) library(lubridateExtras) # Sample data df &lt;- tribble( ~totalHandling, &quot;00:09:24&quot;, &quot;00:17:28&quot;, &quot;01:40:20&quot; ) # Code df2 &lt;- df |&gt; mutate(totalHandling = hms(totalHandling)) df2 #&gt; # A tibble: 3 × 1 #&gt; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to push a repository on github<p>I try to push my local git repository to github with no success.</p> <p>The steps I followed so far are:</p> <ul> <li...
<p>You need to run <code>git push origin master</code> to push the changes in your github remote repo Cause You're on <code>master</code> branch in your local</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter Userinput will only get displayed after a hotreload, but not in the application itself<p>Hi im new to Flutter and coding and tried do build my first ...
<p>The following code should do the trick. The problem was not using <a href="https://api.flutter.dev/flutter/widgets/State/setState.html" rel="nofollow noreferrer"><code>setState</code></a> to refresh the screen with the new data and not iterating over all values to display them (Also, moved global variables to local)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Test multiple parsing outputs instead of hardcoding each of them into a constant Node js<p>So in my application I am cron parsing multiple database data and ...
<p>You could create an array with the references of the constants, but it's tricky after that, because if you use any built-in array method like map, forEach, reduce... to execute the function it will not await the previous finish to execute the next call. Therefore, what you should do is to use <a href="https://develo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to search a row for cell value(s) then output the header?<p>I'm new here and trying to automate. I have a work roster and would like for it to output who...
<p>try:</p> <pre><code>=INDEX(TEXT(TODAY(), &quot;On dd mmmm yy: A\M \s\hift\s ar\e &quot;)&amp; TEXTJOIN(&quot;, &quot;, 1, IF(REGEXMATCH(VLOOKUP(TODAY(), A2:E5, {2,3,4,5}, ), &quot;AM Duty&quot;), B1:E1&amp;&quot; (duty), &quot;, ))&amp; TEXTJOIN(&quot;, &quot;, 1, IF(REGEXMATCH(VLOOKUP(TODAY(), A2:E5, {2,3,4,5}, )...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: BigQuery ML.DETECT_ANOMALIES with model 'arima_plus' returns only nulls<p>I build a VERY simple model with only a time series and a data field of always 1 to...
<p>After a closer look into the <a href="https://cloud.google.com/bigquery-ml/docs/reference/standard-sql/bigqueryml-syntax-detect-anomalies" rel="nofollow noreferrer">documentation</a> I found out that anomaly detection works only outside of the training range - at least for new queries and only as far as as the <code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: co_await is not supported in coroutines of type std::experimental::generator<p>What magic generator should I define to make the code below work?</p> <pre><co...
<p>My understanding is probably that <code>generator_iterator</code> can't handle <code>co_await</code> because it requires the task to be suspended with <code>co_yeld</code>, see the iterator source code:</p> <pre><code> generator_iterator&amp; operator++() { m_coroutine.resume(); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is s-maxage supported by browsers?<p>I have a hard time finding out if <code>s-maxage</code> is supported by browsers, or by which versions of them.</p> <p><...
<p>You should not expect browsers to respect <code>s-maxage</code>.</p> <p>As defined in the <a href="https://datatracker.ietf.org/doc/html/rfc7234#section-5.2.2.9" rel="nofollow noreferrer">specification</a>, <code>s-maxage</code> only applies to shared caches. A browser cache is generally considered to be a private c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use secrets when building docker compose locally<p>I recently started using Buildkit to hide some env vars, and it worked great in prod by gha!</p> <p...
<p>Support for this was recently implemented in v2. See the below pull requests.</p> <ul> <li><a href="https://github.com/docker/compose/pull/9386" rel="noreferrer">https://github.com/docker/compose/pull/9386</a></li> <li><a href="https://github.com/compose-spec/compose-spec/pull/238" rel="noreferrer">https://github.co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Are PyTorch activation functions best stored as fields?<p>An example of a simple neural network in PyTorch can be found at <a href="https://visualstudiomagaz...
<h2>On &quot;storing&quot; functors</h2> <p>The snippet is not &quot;re-creating&quot; anything -- calling <code>torch.tanh(x)</code> is literally just calling the function <code>tanh</code> exported by the <code>torch</code> package with arguments <code>x</code>.</p> <hr /> <h2>Other ways of doing it</h2> <p>I think t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Order by ID and Price woocommerce products<p>I’m using a custom loop to display woocommerce products on a page, I need order it by range price and products i...
<p>You can check this snippet.</p> <pre><code>$args = array( 'post_status' =&gt; 'publish', 'post_type' =&gt; 'product', 'orderby' =&gt; 'ID', 'order' =&gt; 'asc', 'meta_query' =&gt; array( array( 'key' =&gt; '_price', ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to resolve 'libRblas.so: No such file or directory' during package installation?<p>When I try to install certain packages (<code>imputeTS</code>) that ne...
<p>Some comments have put me on the right track and helped me to solve the problem—I will briefly summarize.</p> <p>Since a dependencies issue was suspected, I installed the package from which the error message originated (<code>fracdiff</code> in this case) and tried again to install the target package. The error reoc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# executing if statement every 10 seconds<p>I want my code (messagebox) to run no sooner than 10 seconds in this loop timer which is 2000 milliseconds. Is t...
<p>As mentioned in comments, the cleanest way to do this would be to use a timer that ticks every 10 seconds, even if that means having to create a separate one from the timer used by other code.</p> <p>If you absolutely <em>must</em> do it this way, however, you need to keep state (i.e. an instance field) which either...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to sort immutable slice in Rust?<p>Suppose that I have the following code snippet:</p> <pre class="lang-rust prettyprint-override"><code>fn foo(xs: &amp;...
<p>Since the data is immutable, you have to make a mutable copy of it first. You do not statically know the size of the slice parameter, so you need to use a <code>Vec</code> (instead of an array) to copy into. Then you can sort that <code>Vec</code> and use it normally in the rest of your function:</p> <pre class="lan...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to turn a handleSubmit form function into a reusable one<p>I'm using the React-Bootstrap <code>handleSubmit</code> function to validate a form , submit i...
<p>You can achieve this using a custom hook:</p> <p><em><strong>useHandleSubmit.js</strong></em></p> <pre><code>const useHandleSubmit() { const [validated, setValidated] = useState(false); const handleSubmit = (event, func) =&gt; { const form = event.currentTarget; console.log(&quot;form&quot;, fo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fail building shopify theme app extension<p>I'm trying to build a theme app extension using CLI 3.0, I managed to create the extension on my app but I have 2...
<p>I was running into similar issues.</p> <p>My solution:</p> <ol> <li>Install rbenv <a href="https://github.com/rbenv/rbenv" rel="nofollow noreferrer">https://github.com/rbenv/rbenv</a>, set required <code>~/.zshrc</code> file using <code>nano ~/.zshrc</code></li> <li>Use rbenv to install latest Ruby version (3.1.2)</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I draw a horizontal reference line in chart.js?<p>I want to draw a horizontal reference line at a particular value.</p> <p><a href="https://i.stack.i...
<p>You can use the <a href="https://www.chartjs.org/chartjs-plugin-annotation/latest/" rel="nofollow noreferrer">annotation plugin</a> for 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...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python Unknown Error : Attribute Error with MongoDB database<p>I have written a programme and I have tried to spilt my programme into multiple python files. ...
<p>It is good practice to set any class attributes in the <code>__init__</code> method of your class.</p> <p>If you don't do this, and reference the attribute before it is set, you will get an <code>AttributeError</code>.</p> <p>This code is a bit safer; if you try and get the username before it it set, it will return ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Need to loop in VBA choosing different sets of data until I add to the sum of X<p>thanks for reading and helping out.</p> <p>I have a series of data in Excel...
<p>Create a <a href="https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/collection-object" rel="nofollow noreferrer">Collection</a> called <code>Tickets</code>. Create a variable to hold the sum, called <code>Total</code>. Then you can loop down the sheet, adding tickets to the total and...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is there less need to normalize state with RTK Query?<p>According to the <a href="https://redux-toolkit.js.org/rtk-query/usage/customizing-queries#custom...
<p>We cover the answers to both those questions in more detail in both the RTK Query docs, and the &quot;Redux Essentials&quot; tutorial:</p> <ul> <li><a href="https://redux-toolkit.js.org/rtk-query/usage/cache-behavior#no-normalized-or-de-duplicated-cache" rel="nofollow noreferrer">https://redux-toolkit.js.org/rtk-que...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is the first return in my javascript while loop undefined?<p>why is my while loop returning 'undefined' in the first loop instead of 'time'?</p> <p><div ...
<p>Because when you declare quantity, you are not assigning any value to it, thus it is <code>undefined</code>.</p> <p>During the first loop, your are logging quantity before you assign it <code>'time'</code> or <code>'times'</code>. So quantity is still undefined. If you want it to log something else than undefined, j...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: clap capture all remaining arguments in one field in Derive API?<p>I am using clap v3.1.18 with following code.</p> <pre><code>#[derive(Parser, Debug)] #[cla...
<p>The <a href="https://github.com/clap-rs/clap/blob/v3.1.18/examples/derive_ref/README.md" rel="nofollow noreferrer">derive reference</a> states:</p> <blockquote> <p>Any <a href="https://docs.rs/clap/3.1.18/clap/type.Command.html" rel="nofollow noreferrer"><code>Command</code> method</a> can also be used as an attribu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What's the best way to get all messages for all users?<p>After doing some reading through the docs it seems like if you wanted to read all messages for all u...
<p>You can omit the second point and get all the messages in a user's mailbox by calling the endpoint:</p> <pre><code>GET /users/{id|userPrincipalName}/messages </code></pre> <p>Resource:</p> <p><a href="https://docs.microsoft.com/en-us/graph/api/user-list-messages?view=graph-rest-1.0&amp;tabs=http#http-request" rel="n...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: typecasting with if let 'someClass' as? SomeClass and binding to 'someClass.'someProp' does not work<p>I have the following construct</p> <pre><code>import S...
<p>If you are really hell-bent on using this approach, then try this example code:</p> <pre><code>struct ContentView: View { @ObservedObject var topClass = TopClass() var body: some View { ForEach($topClass.someArr) { $value in if let someSubclass = $value.wrappedValue as? SomeSubclass ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C++ Impossible nullptr call mystery<p>So I decided to get rid of singletons in my project and introduce dependency injection. I did all the necessary changes...
<blockquote> <p>Even If I try to dereference it on purpose, it DOES succeed.</p> </blockquote> <p>No, the program has <strong>undefined behavior</strong> meaning it is <strong>still in error</strong> even if it doesn't say so explicitly and &quot;seems to be working&quot;. This is due to the use of <code>-&gt;</code> f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to export python variable as javascript file<p>I have a python variable in jupyter notebook</p> <pre><code>allFolders = {'1': { '2': {'3': { 'A' : {}, 'B...
<p>You can't write a <code>dict</code> object to the file. Try this</p> <pre><code>import json file = open('allFolders.js', 'w') file.write(json.dumps([allFolders])) file.close </code></pre> <p>Passing <strong>allFolders</strong> <code>dict</code> as a <code>list</code> encloses it in square brackets essentially makin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Styled-components suggestion props name with type script<p>I need styled-components show suggestion props name I create styled components CardHeader and add ...
<p>You can try this little lifehack</p> <pre><code>import { FC } from 'react'; const CardHeader = styled&lt;FC&gt;(Card.Header)&lt;ICardHeader&gt;`` </code></pre> <p>but for good, you just need to type the component (seemd it's just any and that's why types don't work correctly) from this library and everything will w...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Draw text with background color<p>I want to know how can I draw text like this check image <a href="https://i.stack.imgur.com/nSDuk.jpg" rel="nofollow norefe...
<p>You can use the <a href="https://pillow.readthedocs.io/en/stable/reference/ImageDraw.html#PIL.ImageDraw.ImageDraw.textbbox" rel="nofollow noreferrer"><code>draw.textbbox</code></a> method to get a bounding box for your text string and fill it using the <a href="https://pillow.readthedocs.io/en/stable/reference/Image...