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: Is it really necessary to stop the Maria DB Server when performing the restoration?<p>I was going through the official documentation for database backup and ...
<p>Yes, it's necessary for mysqld to be shut down to restore a physical backup.</p> <p>There's no way to copy back all the data files atomically, and also synchronize with in-memory buffers.</p> <p>Here's an analogy: have you ever been editing the same file with a colleague? (I don't mean Google Docs, I mean like a Wor...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to measure time spent in blocking code while using asyncio in Python?<p>I'm currently migrating some Python code that used to be blocking to use <code>as...
<h1>TLDR;</h1> <p>This decorator does the job:</p> <pre class="lang-py prettyprint-override"><code>def measure_blocking_code(f): async def wrapper(*args, **kwargs): t = 0 coro = f() try: while True: t0 = time.perf_counter() future = coro.send(None)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: No method named `match_command` found for struct `HashMap` in the current scope<p>I'm writing a command parser. Here is my code.</p> <pre class="lang-rust pr...
<p>The implementation isn't found because the types don't match. Compare:</p> <pre><code>impl CommandRegister for HashMap&lt;Command, fn(args: Vec&lt;String&gt;)&gt; { </code></pre> <pre><code>let mut map: HashMap&lt;&amp;Command, fn(args: Vec&lt;String&gt;)&gt; = HashMap::new(); </code></pre> <p>One uses <code>Comman...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to decrease space between ExpansionPanel elements in Flutter?<p>This is my code:</p> <pre><code>ExpansionPanel( headerBuilder: (BuildContext context, boo...
<p>You can modify the space/padding on <code>ExpansionPanelList</code> calling <code>expandedHeaderPadding</code>.</p> <pre class="lang-dart prettyprint-override"><code>ExpansionPanelList( expandedHeaderPadding: EdgeInsets.zero, children: [ ExpansionPanel( </code></pre> <p>listTile provide default height based ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: open Angular dialog in async methode<p>I want to open progress dialog by the onclick event. When I click on the button, the dialog is not opened until all as...
<p>For somone that has the same issue here How I fixed it. you can use afterOpened() from the dialog to let first the dialog open and run the async methodes.</p> <pre><code> this.dialog.open(ProgressComponent).afterOpened().subscribe(() =&gt; { await this.writePage1() await this.writePage2() await ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PyQt5 replace column order QTableView<p>is it possible to replace the order of columns in a QTableView? Like first it's &quot;name&quot;,&quot;age&quot;,&quo...
<p>You just have to change the indexes:</p> <pre class="lang-py prettyprint-override"><code>ORDER = [1, 0, 2] filename = f&quot;{self.sender().file}&quot; with open(filename, &quot;r&quot;) as f: for i, row in enumerate(csv.reader(f)): if i == 0: items = [str(field) for field in row] ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# RSACryptoServiceProvider export key as SPKI/DER<p>I want to have the equivalent to this javascript code</p> <pre><code>const rsaKeyPair = crypto.generateK...
<p>Thanks i managed to do it with <code>RSA.Create(2048)</code> and <code>ExportSubjectPublicKeyInfo()</code></p> <pre><code>RSA rsa = RSA.Create(2048); rsa.ExportSubjectPublicKeyInfo(); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reason of equals keyword in LINQ's join statement<p>Here is a LINQ query:</p> <pre><code>from a in db.Table1 join b in db.Table2 on a.Id1 equals b.Id2 </code...
<p>As per <a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/join-clause#the-equals-operator" rel="nofollow noreferrer">Microsoft's docs</a>:</p> <blockquote> <p>A <code>join</code> clause performs an equijoin. In other words, you can only base matches on the equality of two keys. Other...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find YouTrack issues with empty description<p>I have a bunch of issues on YouTrack with empty descriptions. I'd like to filter and find all issues wit...
<p>It's <code>has: -description</code> that you need.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to have multiple one to one relations to a specific model<p>I have a scientific info model that has a one-to-one relationship to my User model. this is m...
<p>You don't have to use <code>OneToOneField</code> because you're using two relations with the same table. You'd better use <code>ForeignKey</code>.</p> <pre><code>class ScientificInfo(models.Model): id = models.AutoField(primary_key=True) user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Count number of users that purchased in certain stores at certain dates<p>I have two tables:</p> <ul> <li><p>&quot;<code>purchases</code>&quot; table has 3 c...
<p>Use 2 levels of aggregation:</p> <pre><code>SELECT COUNT(*) count FROM ( SELECT p.user_id FROM purchases p INNER JOIN stores s ON s.store_id = p.store_id GROUP BY p.user_id HAVING SUM(s.latitude BETWEEN 23 AND 50 AND s.longitude BETWEEN -127 AND -66 AND p.purchase_date BETWEEN '2022-05-01' AND '2022-05-31'...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Connecting Dots for Every Person: Ggplot<p>I have this dataset:</p> <pre><code>my_data = data.frame(name = c(&quot;person1&quot;, &quot;person2&quot;, &quot;...
<p>It sounds like you want</p> <pre class="lang-r prettyprint-override"><code>ggplot(final, aes(x = variable, y = value, colour = name, group = name)) + geom_point() + geom_line() </code></pre> <p><a href="https://i.stack.imgur.com/KPOx6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KPOx6...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python read from csv with condition for TimeSeriesGenerator<p>I have a .csv file with many entries that looks like this:</p> <pre><code>observation1, observa...
<p>I've got a solution for this, I think, and this <a href="https://stackoverflow.com/questions/73006138">Reverse part of a .csv file using Python</a>, but it turned into a mini-project.</p> <p>Here's what my main looks like:</p> <pre class="lang-py prettyprint-override"><code>import csv from series import series_iter...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I insert a table name by using a query parameter?<p>I have an SQL Alchemy engine where I try to insert parameters via sqlalchemy.sql.text to protect agai...
<blockquote> <p>Any ideas why this does not work?</p> </blockquote> <p>Query parameters are used to supply the <em>values</em> of things (usually column values), not the <em>names</em> of things (tables, columns, etc.). Every database I've seen works that way.</p> <p>So, despite the ubiquitous advice that dynamic SQL i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why I can't get the new view added in the ASP.NET Core application?<p>I'm newer to ASP.NET Core applications and I'm trying to add a view, so I've added a fu...
<p>The header can be updated via the shared _Layout.cshtml file. Change this code to reflect:</p> <pre><code> &lt;ul class=&quot;navbar-nav flex-grow-1&quot;&gt; &lt;li class=&quot;nav-item&quot;&gt; &lt;a class=&quot;nav-link text-dark&quot; asp-area=&quot;&qu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Null check in foreach loop of JArray.Children()<p>I want to check if JArray.Children() is null in the foreach loop. I can do:</p> <pre><code> if (jArr...
<p>Apparently, <code>Children()</code> returns a custom <code>JEnumerable</code> type that is actually a struct, so cannot be null, which makes the null propagation awkward. So you could make this work using your first attempt, with a <code>JToken</code> in the type parameter (like Johnathan Barclay already suggested)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to export a plot in PDF with the text and the legend?<p>When I try to export a plot in PDF, all the text (titles, axis…) and the legend disappear. Export...
<p>Here is a simple way to export plots to PDF. You simply use the functions &quot;pdf()&quot; and &quot;dev.off()&quot;. It can handle multiple plots and can be used in loops to generate many pages of plots.</p> <pre><code>#set up the pdf as folder path / name.pdf pdf(&quot;C:/Users/xxx/Desktop/plot1.pdf&quot;) # Gen...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ggplot2, Ordering y axis descendent<p>I have a data frame called <code>tb</code> like this one</p> <pre><code> country station taxa scientific_name var...
<p>Use <code>scale_x_discrete(limits=rev) +</code></p> <pre><code>library(tidyverse) df %&gt;% group_by(country) %&gt;% arrange(country,taxa,scientific_name) %&gt;% ggplot(aes(fill = country, x = taxa)) + geom_point(aes(y=var1), size = 3, shape = 21)+ scale_x_discrete(l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: find index of certain array that is inside array<p>Is there a way to find an index of an array inside another array without converting them to list or using ...
<p>You can try this:</p> <pre><code>np.where((arr == find_this_array).all(axis=1))[0][0] </code></pre> <p>output:</p> <pre><code>1 </code></pre> <p>You can find more details about Numpy <code>where</code> from their documentation:</p> <p><a href="https://numpy.org/doc/stable/reference/generated/numpy.where.html" rel="n...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python Double Function recursion<p>I was working on a pygame project on VS code and accidentally written the following code:</p> <pre><code>def appear(): ...
<p>In Python, functions must be defined before they are called (executed, not just used in another definition). Therefore, there is no problem with your function definitions. Well, apart from creating an infinite recursion loop... The error the Python interpreter provided (&quot;RecursionError: maximum recursion depth ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Datastudio: Blended Data: Datetime can't be aggregated<p>I have two tables <code>case</code> and <code>party</code>. Both of them are from BigQuery. In the <...
<p>This is a bug, and it was already reported in <a href="https://issuetracker.google.com/issues?q=status:open%20componentid:196095" rel="nofollow noreferrer">Google's DataStudio IssueTracker</a>.</p> <ul> <li><a href="https://issuetracker.google.com/issues/179280180" rel="nofollow noreferrer">https://issuetracker.goog...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error in gsub("\n", br(), a, fixed = TRUE)<p>I'm trying to use ggplot to create a scatter plot of player data with a pop up that includes the players name. T...
<p>I'm not sure what caused your error, but I went to your data source link and selected the &quot;Get table as CSV (for Excel)&quot; option from &quot;Share &amp; Export&quot;. I highlighted all the resulting table text, and copied to excel. I then did &quot;Text to columns&quot; and split the data by the comma delimi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to conditionally (value in column) search for substrings in another column in python loop<p>I need to do a substring search in a string by condition in t...
<p>(<strong>UPDATED</strong>)</p> <p>Based on the updated question, my understanding of what's being asked is this:</p> <ul> <li>Create a new <code>Result</code> column</li> <li>If the <code>N_Product</code> columns in df1 and df2 for a given row match, then append to the value from the <code>N_Product</code> column in...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Saving frame to file without rendering in processing<p>In Processing, how can I modify an existing sketch which saves each frame to an image file so that it ...
<p>You can use a <code>PGraphics</code> object and draw on it just like you would with a canvas. Here's an example sketch with no draw loop which outputs an image file:</p> <pre><code>void setup() { PGraphics pg = createGraphics(150, 150); pg.beginDraw(); pg.background(255); pg.stroke(0); pg.fill(color(0, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to display array items with another items in one line in php?<p>I am getting two arrays as parameters but I want to have one item of array to be display ...
<p>The main issue is that the line</p> <pre><code>$items1 = array_map(function ($x) use ($optional) { return &quot;$x $optional&quot;; }, $items); </code></pre> <p>does not cope with anything but passing a single value in for the <code>$optional</code> parameter.</p> <p>If instead you add a condition which checks if it...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to decrypt a string with fernet as a flask service?<p>I am making a simple flask api which is encoding and decoding the coming string. I have no problem ...
<p>You're passing <code>fernet.decrypt</code> an <code>str</code> instead of a <code>bytes</code> object.</p> <p>How is your encrypted data encoded within the JSON? The usual is a base64:</p> <pre><code>import base64 decryptedbytes = fernet.decrypt(base64.b64decode(text)) </code></pre> <p>Keep in mind JSON does not sup...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ESB WSO2 How to send an email from esb<p>I want to make an api for sending some emails from a SMTP server but I don't a user and a password to put in axis2.x...
<p>@jakub.voves answer is correct. Let me add more details.</p> <p><code>Proxy</code>, <code>APIs</code>, <code>Inbound Endpoints</code> etc are a way to bring external messages into the system.(APIs help you to accept <code>Restful</code> invocation, Proxies allow you to consume SOAP messages, JMS Inbound Endpoints a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to print specific range of values in a 1 dimensional array in Python?<p>Given the array below:</p> <pre><code>array= [1,2,3,4,5,6,7,8] </code></pre> <p>U...
<p>You can use python list slices to get the desired set of numbers, so in your case, you can do the next:</p> <pre><code>a = array[2:6] </code></pre> <p>Now you have the items that you want in the array and print them as you like, printing the full array or printing them one by one iterating over the array. Even you c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Query with join from answer table and post and user 2 column with the same name<p>I retrieve from the query the username of the person who post and the perso...
<p>The problem is that you are using the * to specify the output columns -- you just need to use the AS keyword to specify the output column name so something like this:</p> <pre><code>SELECT post.*, answer.*, user.username as post_username, useranswer.username as answer_username FROM [Post] JOIN [User] ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Swift: Selectively prevent auto screen rotation with SpriteKit scenes<p>I have an iOS application that will have a number of SpriteKit scenes. These scenes s...
<p>here is a way to allow device rotation at top level, while simulating no rotation at SKScene level. you can receive device rotation events in SwiftUI and then pass that information down to your scene</p> <pre><code>struct GameSceneView: View { @State private var scene = TestScene() var body: some View { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Numpy Array replace booleans with string depending on position of "True"<p>To process to output of a multi-class classification I'd like to process a numpy a...
<p>You can use <a href="https://numpy.org/doc/stable/reference/generated/numpy.select.html" rel="nofollow noreferrer"><code>numpy.select</code></a>.</p> <pre><code>import numpy as np cls = np.array([[True, False],[False, False],[False, True],[True, False],[False, True]]) mask = cls.any(-1) condlist = [(mask &amp; cls[...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: My procedure from another module does not return correctly to main procedure from main module, after some extra pushes<p>I have 2 module files, one main file...
<p><code>READNR</code> is pushing twice and not ever popping. I don't see how it could possibly return to the caller.</p> <blockquote> <p>So if I push on the stack in some module and the stack remains non-empty, the program will not return properly to the main module?</p> </blockquote> <p>Yes: the call instruction push...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: For Loop while referring to an array with Length<p>I'm very new to javascript and have just recently learned about For loops. I have a variable that consists...
<p>For your first question:</p> <p>Inside the for loop, if you start from 0, and the condition is <code>i &lt; array.length</code> and the length of the array is 6, it will go from 0 to 5, and when it reaches 6 it will not respect the condition (6 &lt; 6 <code>false</code>) so it will exit the <code>for</code> loop bef...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the benefit of setting the capacity of an ArrayList explicitly<p>In java <code>ArrayList</code> we have a <em>constructor</em> -</p> <p><code>ArrayLi...
<p><code>ArrayList</code> as an implementation of a <a href="https://en.wikipedia.org/wiki/Dynamic_array" rel="nofollow noreferrer">Dynamic array</a> data structure.</p> <p>It resizes when its underlying array gets full (i.e. the current list index exceeds the last valid index of the underlying array).</p> <p>When it h...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to check that my data has been passed to the variable before it is rendered?(useRef)<p>I have this button that appears only when its text overflows its p...
<pre><code>const const [isOverflow, setIsOverflow] = useState(undefined) const inputRef = useRef&lt;HTMLDivElement&gt;() useEffect(() =&gt; { const el = inputRef.current const checkIfOverflow = () =&gt; { const isOverflowing = el.clientHeight &lt; el.scrollHeight setIsOverf...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Nginx, WordPress 6, Docker and friendly url<p>I need some help... If i set up frendly url in WP, like <strong>/%postname%</strong> or <strong>/%postname%.htm...
<p>Fix in above exsample (replace <strong>SUBFOLDER</strong> with your subpath):</p> <p>docker-compose.yml</p> <pre><code>wordpress: volumes: - wordpress_data:/var/www/html/SUBFOLDER </code></pre> <p>nginx.conf</p> <pre><code> location /SUBFOLDER { proxy_set_header Host $Host; proxy_set_header X-Re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to list GCP project labels in Cloud function?<p>Below documentation has details for accessing various GCP resources but not GCP project. I am interested ...
<p>Found the solution.</p> <pre><code> Google.Cloud.ResourceManager.V3.ProjectsClient projectsClient = await Google.Cloud.ResourceManager.V3.ProjectsClient.CreateAsync(); Google.Cloud.ResourceManager.V3.Project response = await projectsClient.GetProjectAsync(&quot;projects/83446985491&quot;); //r...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: API access works in curl but UrlFetchApp returns 400 Bad Request<p>I'm trying to access my Home Assistant API and it works fine using curl, but not in Google...
<p>It seems Google Apps Script may be blocking port 8123. The script functions by using by instead using your nabu casa url which operates out of port 80.</p> <p>Just change the <code>HOME_ASSISTANT_URL</code> value to <code>https://[yourspecialcode].ui.nabu.casa/api/</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make this code go back the start of the problemstate?<p>I am trying to create a program where you can choose 3 options. Review, cheat sheet and math e...
<p>You only have to add a infinite loop, there are many different ways of do that (in my example I use <code>while True</code>) an use <code>continue</code> to repeat the process.</p> <pre><code>def problemstate(): while True: # HERE: It is possible add a function to clean the console if you want print(&qu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error 500 while using bearer token with Spring boot + Keycloak<p>This is my first Keycloack integration with a SpringBoot + Spring Security app, and i found ...
<p>So apparently, the server url wasn't properly configured. Taking out the /auth in the path helped solving it. The localhost:8000/auth was deprecated since KC 17, and from now on, it's just the server url.</p> <p><a href="https://www.keycloak.org/migration/migrating-to-quarkus" rel="nofollow noreferrer">https://www.k...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Next.JS: How to use localized API routes when running on localhost, or alternatively how to have a single API route for all locales<p>I'm seeing an issue wit...
<p>I found out what the issue was. The API route path in the fetch did not have a forward slash at the start, which was resulting in them not being appended as absolute paths on my domain.</p> <p>So, the path in the fetch should be <code>/api/route/path</code>, and not <code>api/route/path</code>.</p> <p>Without the fo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: to_string(index = False) results in non empty string even when dataframe is empty<p>I am doing the following in my python script and I want to hide the index...
<p>That's the expected behaviour in Pandas DataFrame.</p> <p>In your case, <code>procinject1</code> stores the string representation of the dataframe, which is non-empty even if the corresponding dataframe is empty.</p> <p>For example, check the below code snippet, where I create an empty dataframe <code>df</code> and ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i read an array from firebase 9 using react<p>i want to read the array in the firebase firebase array format: <a href="https://i.stack.imgur.com/liAk...
<p>This code is how I usually do it from Firestore. I don't know what storage structure you're using in your database but I'll assume you've got a collection of users, then a collection of charts.</p> <p>If not, just adjust it accordingly.</p> <p>Imports:</p> <pre><code>import React, { useEffect, useState } from &quot;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TPL Dataflow block with an inner life<p>I've been doing a bit of TPL dataflow coding and am quite happy with the basics. The question I have is, how would I ...
<p>So, here's what I did in the end: My FSM class consisted of a broadcast block, working as input, a bufferblock working as output and an async method with an endless loop running in the threadpool. The async method gets the current input value from the broadcastblock whenever needed, does its thing and posts a result...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to load a bitmap, with background color, into a TImageList in Delphi 5?<h2>Short Version</h2> <p>Fill in the fuction:</p> <pre><code>procedure LoadImageL...
<p>Don't set the <code>TImageList.BkColor</code>, leave it at its default of <code>clNone</code>. You are telling the <code>TImageList</code> to draw its masked bitmaps onto the <code>TToolbar</code> over a fixed color. That is why your <code>TToolBar</code> is showing fuchsia. It is the <code>TImageList.BkColor</cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert utf-8 characters to "normal" characters in string in python3.10?<p>I have raw data that looks like this:</p> <blockquote> <p>25023,Zwerg+M%C3%...
<p>The %s are URL-encoding; use <code>urllib.parse.unquote</code> to decode the string.</p> <pre><code>&gt;&gt;&gt; raw = &quot;&quot;&quot;25023,Zwerg+M%C3%BCtze,0,1,986,3780 ... 25871,red+earth,0,1,38,8349 ... 25931,K4m%21k4z3,90,1,1539,2530&quot;&quot;&quot; &gt;&gt;&gt; import urllib.parse &gt;&gt;&gt; print(urllib...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: i am not able to filter records with rxjs filter?<p>In the <code>angular</code> project, i have <code>rxjs</code> <code>filter</code> through which i am not ...
<p>Well, there's a difference between <a href="https://rxjs.dev/api/operators/filter" rel="nofollow noreferrer">rxjs <code>filter</code></a> and the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter" rel="nofollow noreferrer">Array.filter</a>.</p> <p>The rxjs <code>f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change for loop increment/decrement value<p>Consider this code:</p> <pre><code># include &lt;iostream&gt; using namespace std; int main() { for(int i = ...
<p><code>d--</code> is shorthand for <code>d -= 1</code>, which is shorthand for <code>d = d - 1</code>. You should not read this as a mathematical equation, but as &quot;calculate <code>d - 1</code> and assign the result as the new value of <code>d</code>&quot;.</p> <pre><code>#include &lt;iostream&gt; int main() { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Assigining type to dynamically accessed object values<p>I have created a class which has 2 properties storing arrays of tuples with numbers. I also have crea...
<p>The immediate solution is pretty simple. All you need to do is change <code>pathArr: string</code> parameter to <code>pathArr: keyof PathfinderSecondStage</code> which will cause TypeScript to create a union type of all the public fields/methods within the class and then extract the <code>this[pathArr]</code> state...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get a row from a database (SQLite3) into a string from Julia?<p><strong>Julia, SQLite3</strong></p> <p>Hi! I have an SQLite3 database and want to get ...
<p>TLDR:</p> <pre><code>CSV.write(stdout, strq); </code></pre> <h3>Explanation</h3> <p>The API of SQLite.jl assumes using <code>DBInterface.execute</code> for querying the database. This method yields an object of type <code>SQLite.Query</code>.</p> <p>Let's have a look what can we do with it:</p> <pre><code>julia&gt; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: iOS runtime: when doing code module isolation, why protocol OK, method list not OK?<p>when doing code module isolation ( a little like subprojects ) ,</p> <p...
<ul> <li>Project has dependency B, and not import module B.</li> </ul> <p>Then the project want to use class defined B, it must be <strong>promise</strong></p> <ul> <li>The project has dependency A, and import models A.</li> </ul> <p>The project know the protocol defined in module A.</p> <ul> <li><p>The promise is that...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Writing asynchronous code for Azure's snapshots creation<p>I am new to Azure, Python and Asynchronous programming.</p> <p>I have a situation where I need to ...
<blockquote> <p>How do I write code for this situation, and which method should I choose? Threading, Asyncio etc. ?</p> </blockquote> <p>You can try the following code snippet, taken from the <a href="https://docs.microsoft.com/en-us/azure/developer/python/sdk/examples/azure-sdk-samples-managed-disks#create-a-snapshot-...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rubocop – how can I just display auto-correctable results<p>I would like to run Rubocop and just see auto-correctable results. The documentation (<a href="ht...
<p>@Andy Waite’s comment helped solve it. I was running rubocop version 1.25.1. The <code>--display-only-correctable</code> flag only arrived arrived in version 1.28.0. I changed my gemfile from:</p> <pre><code>gem 'rubocop', '~&gt; 1.25', require: false </code></pre> <p>to</p> <pre><code>gem 'rubocop', require: false...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Wide to Long preserving a group<p>How would I transform the following <code>data.frame</code> from wide to long while also generating a group column?</p> <p>...
<p>You could use <code>pivot_longer</code> to extract the group followed by <code>pivot_wider</code> to restore the <code>readout</code> columns:</p> <pre class="lang-r prettyprint-override"><code>library(dplyr) library(tidyr) dat %&gt;% pivot_longer(-ID, names_pattern = &quot;(.*)_(.*)&quot;, names_to = c(&quot;na...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to convert float to float64 inside a list - python<p>i have a X_train that has 16 lists and each list has a numpy array and several other float or float...
<p>@ DYZ's comment motivated me to solve this problem</p> <pre><code>x_train64=[] for (index, thing) in enumerate(X_train): if index &lt; len(X_train): current, next_ = thing, X_train[index] current_list64=[np.float64(current) for current in current] x_train64.append(current_list64) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Non-zero distinct elements and indices in an array in Python<p>I have an array <code>A</code> with <code>shape (3,3)</code>. I want to identify all non-zero ...
<p>Not the prettiest option perhaps, but this does the job.</p> <pre><code>import numpy as np A=np.array([[10,2,0],[2,20,1.3],[0,1.3,30]]) Distinct=sorted(set(list(np.reshape(A,A.shape[0]*A.shape[1])))) Distinct = [x for x in Distinct if x!=0] Indices = [[] for x in Distinct] for i,x in enumerate(Distinct): for j...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find factorial n modulo m faster than O(n)<p>How can I find <code>(n!) % m</code> <strong>faster</strong> than <code>O(n)</code>?</p> <blockquote> <p>1 &lt;=...
<p>You can easily have <code>O(m)</code> time complexity in the worst case (when <code>m</code> is a <em>prime</em>) and it seems to be good enough since you have <code>m &lt;= 1e6</code> (while <code>n</code> can be up to <code>1e18</code>). Note, that when <code>n &gt;= m</code></p> <pre><code> n! = 1 * 2 * ... * m *...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error on calling plugins/index.js to Cypress 10 version<p>I am trying to import plugins/index.js to the new structure of Cypress 10 but unfortunately it is n...
<p>Looks like the folder structure is a little bit different to the out-of-the-box setup.</p> <p>Based on the paths shown in the screenshot, I would guess you need to adjust the line with the error to</p> <pre class="lang-js prettyprint-override"><code>return require('../../../cypress/plugins/index.js`) </code></pre>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: width and height of an html table cells in php<p>//sorry for the bad code and the French I'm new, all I want is to make the user chose the width and height o...
<p>Update the input attributes correctly, 'name':</p> <pre><code>Largeur de Colonnes: &lt;input type=&quot;text&quot; name=&quot;widh&quot;&gt; Longueur de Colonnes: &lt;input type=&quot;text&quot; name=&quot;heig&quot;&gt; </code></pre> <p>PHP Codes should be like this:</p> <pre><code>if ($_SERVER[&quot;REQUEST_METHOD...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: renaming the column names in dataframe using some parts of original column name<p>I have this huge data frame with very long column names</p> <pre><code>impo...
<p>You can achieve this with a single regex:</p> <pre><code>df.columns = df.columns.str.replace(r'.*?([^_]+:).+?([^_]+_[^_]+)@.*', r'\1\2', regex=True) </code></pre> <p>output:</p> <pre><code> mynumber trial1:type_id trial1:king_que fer45:gul_har23 chb1:kaam_nix 0 11 ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ranges-v3 transform limitations<p>I am trying to use <strong>ranges-v3</strong> to split an SNMP OID into parts and return them as a <code>std::deque&lt;uint...
<p>The value type of the range returned by <code>ranges::views::split</code> isn't <code>std::string_view</code>, it is a implementation detail type.</p> <p>I'm not sure why you were able to <code>| to&lt;std::vector&lt;std::string&gt;&gt;</code> at all.</p> <p>Because it uses a sentinel, you will need to convert it to...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I use an arraylist created in another method<p>I right now made an arraylist and returned it just like in a void Right now I got something like this I...
<p>You can either define your list as static member or non-static member &amp; access it within different class methods something like:</p> <pre><code>public class Test { static List&lt;String&gt; list = new ArrayList&lt;String&gt;(); public static void main(String[] args) { list.add(&quot;aa&quot;); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to split a string by a splitter thats outside of the qoutes?<p>I have a string <code>'&quot;abc&quot;+ h abc &quot;abch&quot;'</code></p> <p>I want it to...
<p>It's not very pythonic, but it works:</p> <pre class="lang-py prettyprint-override"><code>def split_outside_quotes(string, sep): if sep == &quot;&quot;: raise ValueError(&quot;empty separator&quot;) substrings = [] in_quote = False split_from = 0 string_len = len(string) sep_len ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to point to an external javascript file with an array in vue?<p>I have this example below, where I'm using dropdowns to filter through data. As you can ...
<p>The question is a bit unclear around 'external' javascript file, I'm assuming you meant it will still live in the source code but in a different file.</p> <p>Use an import statement in your Vue file and an export statement in your js file</p> <p><strong>items.js</strong></p> <pre><code>const items = [ { name: ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Join two collection in mongodb<p>I'm new in mongodb. Could you please tell me how to perform join operation in this. I've two collection:</p> <p>Collection 1...
<p>Here's one way to do it.</p> <pre class="lang-js prettyprint-override"><code>db.square.aggregate([ { &quot;$lookup&quot;: { &quot;from&quot;: &quot;user&quot;, &quot;localField&quot;: &quot;userId&quot;, &quot;foreignField&quot;: &quot;_id&quot;, &quot;as&quot;: &quot;userDoc&quot; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Delete type “one of the list” using googlesheet api v4<p>I use POST, for added list in my sheets, but I can’t delete this rule from sheets. Tell me please, h...
<p>I believe your goal is as follows.</p> <ul> <li>You want to remove one of the items from the list of the data validation rule.</li> <li>You want to remove the data validation rule.</li> </ul> <h3>1. Create a data validation rule.</h3> <p>I think that your request body doesn't create the data validation. Because the ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Vue-cli 5 publish a single js and load from html page<p>I'm develop an app in Vue 2, using webpack. Currently only publish a '.js' file in remote directory, ...
<p>Finally I have found my error. The deployment create 2 files, because in my router I was using lazy load for a component. It was a stupid error from my part. Thanks to IVO GELOV for they comments</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to display 2 lines with ellipsis at the end with css in react js?<p>I want to display post description in 2 lines with ellipsis at the end . I actually c...
<p>Try the below solution, it works fine..</p> <p>on my component.js file</p> <pre><code>import React, { useEffect, useState } from &quot;react&quot;; import classes from &quot;./component.module.css&quot; export const Component = () =&gt; { return ( &lt;div className={classes.css}&gt; I want to display...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I use reverse relation items in templates django<pre><code> {% for order in orders %} &lt;li&gt;{{order.customer.last_name}} - {{ order.orderitem_s...
<p>As an order can consist of multiple items you would have to iterate over the set (the reverse relation):</p> <pre class="lang-html prettyprint-override"><code>{% for item in order.orderitem_set.all %} {{ item.product.title }} {% endfor %} </code></pre> <p>Habe a look at the documentation for <a href="https://doc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Column names changing when using as.data.frame on a list in R<p>I have a list that I'm trying to change to a data frame in R. When I do this with as.data.fr...
<p>any of the following will work:</p> <p>1.</p> <pre><code>as.data.frame(unname(total)) emp_id emp_name emp_id2 emp_name2 1 1 Rick 1 Rick 2 2 Dan 2 Dan 3 3 Michelle 3 Michelle 4 4 Ryan 4 Ryan 5 5 Gary 5 Gary </code></pre> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django view not rendering - sidebar & header loads fine but main content does not load<p>I've been through so many different things and I just can't work it ...
<p>My issue was in my base.html file - it appeared that my divider for layout-wrapper was not closed with <code>&lt;/div&gt;</code>.</p> <p>Anyone with similar issues, review your primary templates for your HTML and check to see if all dividers have been closed correctly.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Linear interpolation in R for columns<p>I have a table with column called 'rates'. This column include missing values. I need to calculate linear function wh...
<p>You could use <code>na.approx</code> from the <code>zoo</code> package. The function according to document:</p> <blockquote> <p>Generic functions for replacing each NA with interpolated values.</p> </blockquote> <p>Code:</p> <pre class="lang-r prettyprint-override"><code>df &lt;- data.frame(rates = c(0.66, NA, NA, N...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the support_ values from RFE pipeline?<p>I created a Pipeline with <code>RFE</code> and <code>RandomForestClassifer</code> in it and then applied ...
<p>You can access the retained features of the <em>best estimator</em> as follows:</p> <pre><code>rs.best_estimator_.named_steps['rfe'].support_ </code></pre> <p>Namely, you should access the <code>best_estimator_</code> attribute of the <code>RandomizedSearchCV</code> fitted instance (i.e. the pipeline re-fitted with ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Download files from last 3 days using WinSCP .NET assembly in PowerShell<p>I have this script and I want to collect all file with extension <code>*.did</code...
<p>You cannot use <code>Get-ChildItem</code> with remote files.</p> <p>You would need to use <a href="https://winscp.net/eng/docs/library_session_listdirectory" rel="nofollow noreferrer"><code>Session.ListDirectory</code></a>.<br /> Like here: <a href="https://stackoverflow.com/q/37007929/850848#37010471">Using WinSCP ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: rolling three day average in sql server<p>I want to find three day average of values. Expected output:</p> <div class="s-table-container"> <table class="s-ta...
<p>It seems you need a <code>ROWS/RANGE</code> argument in the windowed <code>AVG()</code>:</p> <p>Data:</p> <pre><code>SELECT * INTO trans FROM (VALUES (CONVERT(date, '20220501'), 100), (CONVERT(date, '20220502'), 150), (CONVERT(date, '20220503'), 50), (CONVERT(date, '20220514'), 250), (CONVERT(date, '2...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SELECT TOP 3 Max Score<p>I have a question on how to express the output of some results? The problem is: There were a number of contests where participants e...
<p>Use a pivot query to generate the 3 output columns you want:</p> <pre class="lang-sql prettyprint-override"><code>WITH cte AS ( SELECT *, DENSE_RANK() OVER (PARTITION BY event_id ORDER BY FinalRank) dr FROM Rank_table ) SELECT event_id, STRING_AGG(CASE WHEN dr = 1 THEN participant_name END, ',') ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filtering rows within a group<p>I have a dataframe like the following:</p> <pre><code>ID &lt;- c(1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5) Type &lt;- c('A','B','C','B...
<p>In <code>dplyr</code>, use <code>slice_min</code>, which by default filters the minimum value by group ordered by a variable (here <code>Type</code>, which is sorted by alphabetical order).</p> <pre class="lang-r prettyprint-override"><code>library(dplyr) df %&gt;% group_by(ID) %&gt;% slice_min(Type) # A tibb...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CSS Media Queries for specific iPads<p>I am trying to target specific iPads using CSS Media Queries The three that I want to target are:</p> <ul> <li>iPad 9....
<p>Get rid of the first media query then set the min-width just above the previous breakpoint -- see the code below</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>body { hei...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to collect data from multiple tables and create a typed object<p>I'm trying to retrieve data from multiple tables and create a typed objects (Class) for ...
<p>You shouldn't return a <code>Person</code> object because none of your queries return a <code>Person</code>. If you want to return a typed object you need to define a type; for example for your first query:</p> <pre><code>public class PersonCountryResponse { public string Person { get; init; } public string ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is splice deleting my entire array? I would only like to delete max if it is in position 0<p>I'm working on a leet code problem with the following instru...
<p><code>splice</code> does not return a modified copy of the array. The array is modified in-place, and what is returned is the deleted subarray, if any.</p> <p>In effect, your code is:</p> <pre><code>const deletedElements = prices.splice(0, 1); prices = deletedElements; </code></pre> <p>You deleted the first element ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cant run ECS external task<p>I have an EC2 ubuntu machine (g5.large). I registered the machine as an external instance on ECS. I created Task definition, clu...
<p>Solved!</p> <pre><code>echo &quot;GRUB_CMDLINE_LINUX=systemd.unified_cgroup_hierarchy=false&quot; | sudo tee /etc/default/grub.d/cgroup.cfg sudo update-grub </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django Error with Update view associted with model with foreign keys<p>I have a model, ProjectNoteComments, that is for adding comments on ProjectNotes. Comm...
<p>With some help I was able to solve this issue. First I changed the relevant URL to:</p> <pre><code>path('project/&lt;int:project_pk&gt;/note/&lt;int:projectnotes_pk&gt;/comment/&lt;int:pk&gt;/update', ProjectNoteCommentUpdateView.as_view(), name='project_note_comment_update'), </code></pre> <p>Then I changed the get...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter How to stack image and total member text<p>I was able to show the pictures as in the video by taking advantage of Johannes Milke's video that I left ...
<p>Add a label also to this class</p> <pre class="lang-dart prettyprint-override"><code> import 'package:flutter/material.dart'; class StackedWidgets extends StatelessWidget { final List&lt;Widget&gt; items; final TextDirection direction; final double size; final double xShift; final String lable; const...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why won't the pixels I try to draw into VGA memory show up?<p>I'm working on a little operating system, and I'm running into issues drawing pixels. It seems ...
<p>The assembly code sets mode 0x03 (80x25 Text), you have even commented it as such.</p> <p>Nowhere does it appear that you are setting mode 0x13 (320x200 256 colour).</p> <p>Your code is writing to both the text and graphics frame buffer. Only the text framebuffer will be rendered in text mode. You cannot render both...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Retrieving values from a DataFrame<p>My DataFrame (<code>df = df.sort_values('market_name').iloc[:1]</code>):</p> <pre><code> competition ...
<p>If you use <code>.iloc[0]</code> instead of <code>.iloc[:1]</code> then you get single row as <code>pandas.Series</code> and you can get value from <code>Series</code> using only header. And this doesn't need <code>.reset_index()</code></p> <pre><code>import pandas as pd data = { 'A': [1,2,3], 'B': [4,5,6]...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to increase the height of the bands?<p>I have created a funnel with the below script.</p> <pre class="lang-js prettyprint-override"><code>Highcharts.char...
<p>You need to increase height of the chart. For example:</p> <pre><code> chart: { type: 'funnel', height: 600 } </code></pre> <hr /> <p><strong>Live demo:</strong> <a href="https://jsfiddle.net/BlackLabel/a6sr93fo/" rel="nofollow noreferrer">https://jsfiddle.net/BlackLabel/a6sr93fo/</a></p> <p><strong>API R...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to combine date-containing columns into new column with unique dates?<p>I have a dataframe that has two date containing columns I'd like to perform the f...
<p>You can use <code>set()</code> to find the unique elements in each row, and a list comprehension to generate your desired result, joining each unique list together with a comma. Something like</p> <pre><code>df['date_range'] = [','.join(list(set(dates))) for dates in df[['date1', 'date2']].astype(str).values] </code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to put double quotes key as varaible in json query<p>I need to put double-quoted key as variable in JSON query. It works fine if I put key string directl...
<p>You never nest Jinja <code>{{...}}</code> template markers. When you write this:</p> <pre><code>msg: &quot;{{cert|from_json|json_query('data.`{{cert_type}}`')}}&quot; ## Does not work </code></pre> <p>You are looking for the literal string <code>{{cert_type}}</code>. You want to perform variable interpolation, whi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does `write` mode on a `RwLock` work if it isn't mutable?<p>So, I was writing some code and apparently R.A. didn't warn me about some erroneous stuff I h...
<blockquote> <p>From my prior knowledge, mutable in Rust cascades; in other words, if the &quot;master-containing&quot; object is immutable the rest will have to be too.</p> </blockquote> <p>This is almost always true... Until we consider <a href="https://doc.rust-lang.org/book/ch15-05-interior-mutability.html" rel="no...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Append SQL result to HTML table via Powershell<p>I have multiple databases from multiple SQL Servers.</p> <p>I am trying a output SQL data to an HTML table u...
<p>You need to create your base html (the one containing the head / body / table title / table headers) outside of the loop. In the loop, you create only the table cells.</p> <p>From there, you build your complete HTML.</p> <p><strong>Example</strong></p> <pre><code> # Just some data... I used calculated field to have ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I find an order that contains all the available products?<p>I have a <strong>products</strong> table that contains all the available products, as well...
<p>This is another way by using <code>GROUP_CONCAT</code>:</p> <pre><code>SELECT order_id FROM order_has_product GROUP BY order_id HAVING GROUP_CONCAT(DISTINCT product_id)=(SELECT GROUP_CONCAT(product_id) FROM products) ORDER BY product_id; </code></pre> <p>This query compares the concatenated product id's which will ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kafka How to not move offset until message processing is succeeded<p>We are reading messages from a Kafka-topic. I was under the <a href="https://github.com/...
<p>If you catch an exception in <code>process</code>, then the commit will never happen.</p> <p>You can store the partition+offset for the record that failed and <code>Seek</code> back to that offset.</p> <p>Alternatively, you can skip over the offset in your main processing loop and write that record to a dead-letter ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can a @IBDesignable UI component be implemented into a SwiftUI view?<p>I am trying to use <a href="https://github.com/PaoloCuscela/Cards" rel="nofollow n...
<p><a href="https://stackoverflow.com/users/12299030/asperi">@Asperi</a> commented:</p> <blockquote> <p>All Cards are UIView, so you need to use UIViewRepresentable wrapper to insert them into SwiftUI views.</p> </blockquote> <p>Indeed this worked, thank you Asperi.</p> <p>Here how I created the wrapper for anyone inte...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get latest Field from Firestore Collection using a Structured Query?<p>I am trying to use Zapier to add an email to a SendFox mailing list when a new user ge...
<p>The query you have right now returns all documents from the <code>customers</code> collection in descending order of their email address, so with the <code>z</code>s first. That seems to be unlikely what you want.</p> <p>Firestore has no built in concept of the most recent document, so what you'll want to do is:</p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Wrong data (junk or 0s) returned from pointer array member of struct<p>I'm trying to read some float values as an array to a struct member as shown below:</p...
<p>In this line:</p> <pre><code>inS.sptr = (float *) malloc(n * sizeof(float)); </code></pre> <p>you cause <code>sptr</code> to point to a malloc'ed region of just the right size for your inputs. That's good. But in the very next line:</p> <pre><code>inS.sptr = fvls; </code></pre> <p>you throw the malloc'ed pointer awa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i set Header map in case of custom HTTP Request in java?<p>I was using java.net.http package to create custom request. i could set additional headers...
<p>The <code>HttpRequestBuilder</code> doesn't allow a direct set of the <code>Map&lt;String, List&lt;String&gt;&gt;</code> into the headers nor exposes an equivalent of <code>putAll</code>.</p> <p>However, provided you have a <code>Map&lt;String, List&lt;String&gt;&gt;</code> called <code>yourHeaders</code>, then you ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find if the sentence has 3 consecutive words<p>You are given a string with words and numbers separated by whitespaces (one space). The words contains only le...
<p>If you'd rather continue with your code than use regex, here are your issues:</p> <ol> <li>You only loop over 3 of the elements in lst. Loop over the entire length of the list.</li> <li>You try to check if Number('somestring') === NaN. In JavaScript, NaN === NaN is False. Use <a href="https://developer.mozilla.org/e...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Time limit excedded for program - find Kth smallest element<p>I am looking at GeeksForGeeks problem <a href="https://practice.geeksforgeeks.org/problems/kth-...
<p>The problem is that your <code>heapify</code> function is not efficient. In the worst case it makes two recursive calls at the same recursion depth. This may even happen at several recursion depths, so that the number of times <code>heapify</code> is called recursively could become quite large. The goal is to have t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: python non-linear regression: choosing of function depended on param<p>I am currently using &quot;scipy.optimize.curve_fit&quot;</p> <p>In the equation (piec...
<p>This is the module that you want, you just need to adapt to it's API. The function <code>curve_fit</code> passes to your function arrays for <code>D</code> and <code>c</code> rather than single values, so you need to vectorize <code>MahonOldham</code> (and, please, rename to <code>mahon_oldham</code>, PEP8).</p> <p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Assign multiple values into variable oracle PLSQL<p>How to assign multiple values to variable using select query in PLSQL Oracle, example query is below</p>...
<p>If you just declare the variable using <code>%rowtype</code>, it won't work if there's not exactly one row in the table (because, if it is empty, <code>select</code> will return <code>no_data_found</code>, and if there are two or more rows, you'll get <code>too_many_rows</code>), e.g.</p> <pre><code>SQL&gt; declare ...