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: Best way to aggregate total size of objects in nested GCS bucket?<p>I have several PiB of data nested under a bucket and they’re categorized as:</p> <p>Bucke...
<p>You could retrieve the bucket size programatically like:</p> <pre class="lang-python prettyprint-override"><code>import sys from google.cloud import storage bucket_name = 'qpalzm-bucket' client = storage.Client() bytes_used = sum( [blob.size for blob in client.list_blobs(bucket_name, delimiter='/')] ) print( ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Copy content from cell in a row to adjacent right-hand cell in R<p>I have a data frame that looks like this:</p> <pre><code> df &lt;- data.frame(col1=c(NA, N...
<p>You can <code>apply</code> the <code>na.locf0</code> on all rows using the following code:</p> <pre><code>library(zoo) setNames(data.frame(t(apply(df, 1, na.locf0))), colnames(df)) </code></pre> <p>Output:</p> <pre><code> col1 col2 col3 col4 col5 col6 col7 1 &lt;NA&gt; arroz arroz arveja arveja frejol fre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL table definition best practice for column<p>I have these prices depending on monthly purchase Source A:</p> <pre><code>| Purchase | Price ...
<p>prefect use case for range data type.</p> <pre><code>CREATE TABLE txn_range_price_ref ( source text, txn_qty_range int8range, fee numeric ); INSERT INTO txn_range_price_ref VALUES ('Source A', '[1, 5000]'::int8range, 2.50), ('Source A', '[5001,7500]'::int8range, 2.40), ('Source A', '[7501,10...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: export default was not found; module export not working<p>with encore webpack, I do add a js file:</p> <pre class="lang-js prettyprint-override"><code>Encore...
<p>Oh man, I've put a <code>request.js</code> and a <code>request/index.js</code> into the same folder. So when I <code>import ./request</code> inside <code>request.js</code>, its gonna import itself due to the hierarchy of the import file detection.</p> <p>Now I will just put all the files into a separate folder <code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How are the hash values in git not exhausted?<p>The total possible no of unique git commit hash values are - <strong>16^40</strong>, 16 possible hexadecimal ...
<p>Pay attention to what that &quot;48&quot; is counting. That's how many zeroes after the leading &quot;1&quot;.</p> <p>Say there's ten billion people on earth. That's 1e10. Say all ten billion people on earth are using Git and generating ten billion hash codes each, every second, non stop. That's 1e20 hash codes use...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I extract data from "List <Contact>" of object and paste it into file.txt in C#?<pre><code>static List&lt;Contact&gt; ListOfContact = new List&lt;Con...
<p>There's so much missing in your code. Firstly <code>ListOfContact</code> is a list but you're trying to access <code>verbList</code> from it, which doesn't make sense.</p> <p>Here's an example you can use...</p> <pre><code>using System; using System.Collections.Generic; using System.IO; using System.Linq; using Syst...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kotlin. Mockk: Missing mocked calls inside every<p>I'm using mockk library fo testing my business logic. I have interactor which I want to test. My interacto...
<p>You're mocking it twice and you don't need that. Remove the first mock and you will have something like that:</p> <pre><code> private lateinit var test: Test @Test fun `test`() { test = mockk(relaxed = true) { every { data1 } returns mockk { every { nestedData } return...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Failing to parse email from Gmail correcty because of `\r\n`<p>I have a simple email in Gmail that looks like this:</p> <pre><code>Hi all @alice - please pr...
<p>As was suggested in the comment by Daniel, I used the HTML data in order to extract the message correctly:</p> <p>I defined the <code>HTML</code> parser:</p> <pre><code>from html.parser import HTMLParser from io import StringIO def extract_text(html_text: str) -&gt; str: class MLStripper(HTMLParser): de...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python - Get the source code of the line that called me<p>Using the python inspect module, in a function, I would like to get the source code of the line tha...
<p>A really dumb solution would be to capture a stack trace and take the 2nd line:</p> <pre><code>import traceback def fct1(): stack = traceback.extract_stack(limit=2) print(traceback.format_list(stack)[0].split('\n')[1].strip()) # prints &quot;a = fct1()&quot; return None a = fct1() </code></pre> <p>@jt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: tailwind not working after trying every solution online<p>I have done absolutely everything from the documation, and I have searched and tried everything thr...
<p>The stylesheet is not in the right folder:</p> <pre class="lang-js prettyprint-override"><code>npx tailwindcss -i styles.css -o ./dist/output.css --watch </code></pre> <pre class="lang-html prettyprint-override"><code> &lt;link rel=&quot;st...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I add attributes to all heading elements with jQuery?<p><strong>How to change the heading tags <code>&lt;h1&gt;</code> to <code>&lt;h1 data-splitting...
<p>You can easily do that with JavaScript, specifically jQuery, since WordPress includes it. In this case, <code>data-splitting</code> is not a tag, it is an attribute, a custom one. Custom attributes are mainly used to access elements or place useful information in tags to make something happen on the website. It won'...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how does IServiceScopeFactory get registered internally?<p>below is some code example using DI:</p> <pre><code>public class Program { public static void M...
<blockquote> <p>how does <code>IServiceScopeFactory</code> get registered?</p> </blockquote> <p>It is registered internally within the <code>ServiceProvider</code> when it is initialised.</p> <pre><code>//... CallSiteFactory.Add(typeof(IServiceScopeFactory), new ConstantCallSite(typeof(IServiceScopeFactory), Root)); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to count how many times something occures in a loop, java<p>I am trying to find out how many times the 6 occurs in this loop. I tried array, <code>ArrayL...
<p>Try this method</p> <pre><code>public static void main (String[] args) throws java.lang.Exception { // your code goes here int min = 1; int max = 6; int reps = 10, x, count = 0; for (int y = 0; y &lt; reps; y++) { x = min + (int) (Math.ra...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to return object of first and last names<p>The result is returning {firstname: 'Mike,Henry,Pete', lastname: 'Port,Split,Micky'} I want result to return {...
<p>split data with <code>&quot;, &quot;</code> then split with <code>&quot; &quot;</code></p> <pre class="lang-js prettyprint-override"><code>var data = &quot;Mike Port, Henry Split, Pete Micky&quot;; var result = []; var newNames = data.split(&quot;, &quot;); newNames.forEach(name =&gt; { let splitted = name.split(&...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sum of column values ​inside Json array with group by<p>I have next Django model.</p> <pre><code>class StocksHistory(models.Model): wh_data = models.Json...
<p><a href="https://dbfiddle.uk/?rdbms=postgres_14&amp;fiddle=7c90e210c53bf14eb2f59bcf4b637dda" rel="nofollow noreferrer"><strong>demo</strong></a></p> <pre><code>WITH cte AS ( SELECT jsonb_path_query(js, '$[*].stocks.wh')::numeric AS wh, jsonb_path_query(js, '$[*].stocks.qty')::numeric AS b, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does the C++ standard guarantee that when the return value of 'rdbuf' passed to the stream output operator, he conent of the buffer gets printed out<p>Consid...
<p>A <code>std::basic_stringbuf</code> is derived from a <a href="https://en.cppreference.com/w/cpp/io/basic_streambuf" rel="nofollow noreferrer">std::basic_streambuf</a>. Cppreference describes its use:</p> <blockquote> <p>The I/O stream objects <code>std::basic_istream</code> and <code>std::basic_ostream</code>, as w...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Re-assign an element in a nested list KDB+/Q<p>I have a nested list like the following:</p> <pre><code>L:((2020.07.01 2020.09.30); (2020.10.01 2020.12.31); (...
<p>Index at depth <a href="https://code.kx.com/q4m3/3_Lists/#382-indexing-at-depth" rel="nofollow noreferrer">https://code.kx.com/q4m3/3_Lists/#382-indexing-at-depth</a></p> <pre><code>q)L[7;1]:2022.05.31 q)L 2020.07.01 2020.09.30 2020.10.01 2020.12.31 2021.01.01 2021.03.31 2021.04.01 2021.06.30 2021.07.01 2021.09.30 2...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unordered Map Performing Much Slower than Map<p>Say I am attempting to solve the <a href="https://leetcode.com/problems/two-sum/" rel="nofollow noreferrer">t...
<p>The unordered_map has to allocate and copy to grow over and over while the map just allocates nodes.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Back4app giving parseerror 200 on chrome<p>I made a database for accounts login for a web app with back4app, it works on Firefox-ish but doesn't work on Chro...
<p>It looks like you're using the Parse JavaScript SDK to log in users. Based on the code you've shared, it looks like you're not passing the correct parameters to the Parse.User.logIn() method.</p> <p>The logIn() method takes two parameters - the first is the username, and the second is the password. Based on your cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error: Command "start" is not available outside of a Sanity project context<p>Run the command again within a Sanity project directory, where &quot;@sanity/co...
<p>The <code>sanity start</code> command needs to be run inside the folder with Sanity installed so it knows what Sanity instance to start up.</p> <p>You need to navigate into that folder (should be the one with <code>sanity.json</code> in it) and then run <code>sanity start</code> again.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hibernate fails to validate in-memory h2 database after flyway migration using Spring-Boot<p>Hibernate fails to validate database schema, which is created by...
<p>As noted in the comments below the question, the problem can be solved by removing the property <code>spring.flyway.url</code> from the properties file.</p> <p>If the property is not set, then Spring Boot will configure Flyway with either the primary <code>DataSource</code> or, if it exists, the <code>DataSource</co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kotlin - categorized subenums<p>I am trying to implement a Role class/interface/enum that I can use throughout my program. I want the roles to be somewhat ca...
<p>You <em>could</em> reflect your roles in the type system by defining a sealed interface for each role type like this:</p> <pre><code>sealed interface Type1 { val t: Int fun test() } sealed interface Type2 { val s: String } </code></pre> <p>Then your <code>Role</code> class could be defined as a <code>se...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pycharm on Mac: why Python SDK cache get corrupted regularly?<p>This is the massage that Pycharm gives me almost once a day, and I have to restart it. As I h...
<p>It turns out the issue was the number of git repositories each with a separate project SDK (i.e. venv interpreter) that I had simultaneously opened in my PyCharm instance (over 10).</p> <p>The re-indexing of git caches and Python libraries created memory issues and eventually resulted in corruption of index files; t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: "static const" function and variable<p>I read so many answers saying static const functions can't exist. Eg. <a href="https://stackoverflow.com/questions/703...
<p>This code is illegal, it's const qualified static method</p> <pre><code>class Sample{ public: static int fun() const { return 0; } }; </code></pre> <p>This code is OK, it's a const qualified non-static method</p> <pre><code>class Sample{ public: int fun() const { return 0; } }; </code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spacy - adding multiple patterns to a single NER using entity ruler<p>so this is my problem in Spacy Rule based matching.</p> <p>I have a txt group say</p> <...
<p>Each pattern you add to the Ruler is one sequence of tokens. So you aren't matching each of those terms individually, you're matching all of them in a row, without punctuation. You should add them as separate patterns, something like this:</p> <pre><code>words = (&quot;wan&quot;, &quot;fibre&quot;, ...) patterns = [...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Customize alpha values based on conditions for multiple facets time series plots in R<p>For the time series plot which is composed by two subplots:</p> <pre>...
<p>You could achieve this by creating a boolean variable that detects the year you would like to highlight and then passing that as the alpha aesthetic inside your plot:</p> <pre><code>df %&gt;% mutate(date = as.Date(date, origin = &quot;1899-12-30&quot;)) %&gt;% mutate(year=as.numeric(year(date))) %&gt;% pivot_...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Deciles in Python<p>I want to group a column into deciles and assign points out of 50.</p> <p>The lowest decile receives 5 points and points are increased in...
<p>Try this:</p> <pre><code>df['points'] = df['decile'].add(1).mul(5) </code></pre> <p>Output:</p> <pre><code> column decile points 0 1 0 5 1 2 0 5 2 2 0 5 3 3 1 10 4 4 1 10 5 4 1 10 6 5 2 ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: error C2679: binary '>>' : no operator found<p>The full error message reads:</p> <p>Error C2679: binary '&lt;&lt;' : no operator found which takes a right-ha...
<p>You don't need pointers here</p> <pre><code>int main() { int a[4] = { 1, 2, 3, 4 }; Dun&lt;int&gt; ar{a}; Ar&lt;int&gt; ur{&amp;ar}; cout &lt;&lt; ur[1]; return 0; } </code></pre> <p>otherwise you'd have to dereference your pointer before your <code>operator[]</code> can be used</p> <pre><code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to search json for a string and output a parent value using jq?<p>Trying to pull a value out with jq, but didn't seem as easy as i originally thought.</p...
<p>Depending on what level you can expect your search value, here's a quite narrow solution using all keys from the example: First, iterate over the <code>.response</code> array, then keep only those items for which <code>any</code> of the values in <code>.sources[].sample_retrieve_cmd</code> <code>contains</code> the ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to bypass debounceTime in angular<p>I have this text input with a <code>debounceTime</code> pipe, so that we don't hit the server too often while the use...
<p>You can merge your streams after <code>debounceTime</code></p> <pre><code>this.keyUp$.pipe( debounceTime(500), mergeWith(this.keyEnter$)) .subscribe(data =&gt; this.onInputChanged.emit(data)); </code></pre> <p>just keep in mind that after debounce time it will still emmit, so you have to add a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change text in widget on button click in Dart/Flutter?<p>I need to change the text in this widget when the button is clicked.</p> <p>That is, every ti...
<p>You are accessing List of List in the wrong way. The correct way would be something like this: <code>_data[0][_listCount];</code></p> <p>A better approach would be: (EDIT: I have put all the code now) EDIT2: I am putting all code to use with CSV load file.</p> <pre><code>class CSVExperimentRoute extends StatelessWi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Resizing makes the window's content become thinner on each loop<p>I was trying to fix an issue where the window stretched out the content, and I finished fix...
<p><a href="https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/gluOrtho2D.xml" rel="nofollow noreferrer"><code>gluOrtho2D</code></a> not only sets the projection matrix, but defines an orthographic projection matrix and multiplies the current matrix by the new matrix. You need to load the <a href="https://en....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Trigger Github Action only on specific push option?<p>For example, If I define an action in <code>.github/workflows</code> like this:</p> <pre><code>n...
<p>This is not possible.</p> <p>What you showed in your YAML is not valid. The <a href="https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#push" rel="nofollow noreferrer"><code>on: push</code> trigger doesn't support <code>option</code></a>.</p> <p>This was <a href="https://github.communit...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to group by user id to a specific row?<p>I am trying to select the unique user id that is going to a specific user.</p> <p>let's say I want it to be 200,...
<p>I didn't test the real dataset, but the logic should be something like:</p> <pre><code># select 1500 unique users import numpy as np users = np.random.choice(df['user_id'].unique(), size=1500, replace=False) # filter the users and get (up to) 200k random rows df_sample = df[df['user_id'].isin(users)].sample(n=20000...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the correct way to use computed properties with Dynamic LINQ?<p>I have these models.</p> <pre><code>public class Ticket { public int Id {get;set;...
<p>I've found it best to make my actual Entity models reflect the database structure as closely as possible, and largely use them for CRUD operations. You can create a separate class to represent other queryable facets of your entity, but instead of using computed properties, use mapping logic to create a projection fo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adding separations and bottom annotation in geom_tile ggplot<p>So I created a heatmap using geom_tile() as follows:</p> <pre><code>df_temp &lt;- df_master df...
<p>This can be done with themed facets using the <code>ggh4x</code> package.</p> <p>The sample data provided doesn't really reproduce your plot, so I have created my own with the same structure for illustration purposes.</p> <pre class="lang-r prettyprint-override"><code>library(ggh4x) ggplot(df_temp, aes(x = X, y = v...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: If previous element is x, then return it<p>I need to build a web-scraping tool for this page: <a href="https://www.valchov.cz/sluzby/specialni-sluzby-/" rel=...
<p>Question and expected output is not that clear but assuming, that your goal is to get all the links and apply corresponding dates I would reccomend to adjust your script that way:</p> <ol> <li><p>You do not need extra <code>re</code> modul instead use <code>css selectors</code>:</p> <pre><code>soup.select('p:-soup-c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to sort array with some "between" numbers?<p>Is it possible, somehow, to sort array with some &quot;between&quot; numbers?</p> <pre><code>[31,...
<p>As mentioned in the comments, the only way this will work is if you use string to capture the numbers. The engine is going to store your <code>33/34</code> as the decimal. There is no way to get the original value back.</p> <p>Doing it is just a simple parse and sort.</p> <p><div class="snippet" data-lang="js" data-...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cisco config replace strings with Powershell<p>For security reasons, how can I replace the values after the word &quot;secret&quot;? Cisco config file extrac...
<p>Assuming your config is in a file called cisco.cfg:</p> <pre><code>Get-Content ./cisco.cfg | %{$_ -replace '(secret 5) .*','$1 &lt;&lt;ENCRYPTED PASSWORD REMOVED&gt;&gt;'} </code></pre> <p>Here is that idea applied to the script that you've put in the comments:</p> <pre><code>$ParentPath = &quot;C:\cygwin64\home\&qu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Xpath give nothing<p>I am getting trying to getting <code>phone number</code> but give nothing from the xpath how to solve these problem these is page link ...
<p>Assuming you get the concret <code>HTML</code> you could adjust your <code>xpath</code> - Select the <code>&lt;ul&gt;</code> by its <code>class</code> and the last <code>&lt;li&gt;</code>. Cause the number is not included in the <code>&lt;span&gt;</code>, you have to call its <code>sibling</code>:</p> <pre><code>//u...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get Common elements and Difference between two Lists by a particular property using Streams<p>I have two lists of objects <code>dbAssets</code> and <code>ass...
<p>Since you are mapping your <code>SomeClass</code> instances into <code>String</code>s, your stream pipeline produces a <code>List&lt;String&gt;</code>, not a <code>List&lt;SomeClass&gt;</code>.</p> <p>To get a <code>List&lt;SomeClass&gt;</code>, try something like this:</p> <pre><code>List&lt;SomeClass&gt; output = ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to search data in a mongodb database using laravel<p>I am trying to write a query to search the mongodb database for a specific query and return the a...
<p>The $searchs variable is missing, when you call the page with no query. You either have to return the search-view in the else branch with the $searchs variable set:</p> <pre><code>// ... else { return view('search',['searchs' =&gt; []); } </code></pre> <p>or put a condition in your blade file:</p> <pre><co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why win32com doesnt show me all emails<p>I want to parse emails in python through the Outlook application. Running this code I get only a few of my emails.</...
<p>Emails were not visible beacuse they were on the server!</p> <p>File-&gt; Account Settings-&gt; Account Settings...-&gt; double click on your Exchange account-&gt; set the Mail to keep offline slider to: All.</p> <p>Found it <a href="https://answers.microsoft.com/en-us/outlook_com/forum/all/how-to-access-old-emails-...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Match folder in URL path but exclude parameters<p>I'm trying to match URLs using the folder path /c/ but exclude and URL with the same folder path containing...
<p>I'm not sure the particulars of re2, but here you go:</p> <pre><code>^https://www.example.com/c/[^?]*$ </code></pre> <p>Translation:</p> <ul> <li><code>^</code> starting at the start of the string</li> <li><code>https://www.example.com/c/</code> Match this exact string</li> <li><code>[^?]*</code> match any number of...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use LearningTransport with nservicebus azure trigger functions (NServiceBusTriggerFunction)<p>Trying to use the example code snippet:</p> <pre><code>builder....
<p>NServiceBus support for functions only works with <a href="https://docs.particular.net/nservicebus/hosting/azure-functions-service-bus/" rel="nofollow noreferrer">Service Bus</a> and <a href="https://docs.particular.net/previews/azure-functions-storage-queues" rel="nofollow noreferrer">Storage Queues</a>. If you wan...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: replace substrings of elements within list and keep original elements<p>I have a <em>list</em> <code>names</code>.</p> <p><code>names = ['Dr. Augsten, BÜNDNI...
<p>Is regex in this case necessary? You can use <code>str.split</code> with <code>maxsplit=1</code> parameter:</p> <pre class="lang-py prettyprint-override"><code>names = [ &quot;Dr. Augsten, BÜNDNIS 90/DIE GRÜNEN&quot;, &quot;Dirk Adams, GRÜNE&quot;, &quot;Blechschmidt, DIE LINKE&quot;, &quot;Steffen H...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to adjust node as per pivot<p>In Scenekit</p> <p>let's say I have 2 BOX , box1 with PIVOT , box2 without PIVOT</p> <p>My Goal is to match both of boxes ...
<p>Both of your boxes have pivots. By default, for SCNBox, it's in the objects center (the center of the Bounding Box). What you do is shifting the Pivot of your first Box. The Scene Object will always be placed relative to its current pivot position. So when you move up the pivot of the Y axis, the object will be in a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: WPF Styles won't apply in designer but works in runtime<p>I'm having an issue where the styles don't seem to apply in the WPF designer, so it only shows the ...
<p>Downgrading Rider to <a href="https://www.jetbrains.com/rider/download/other.html" rel="nofollow noreferrer">2021.3.4</a> fixed this.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reformatting loop to save every iteration of data<p>Sorry for asking such a basic question, but I am new to coding and still have a difficult time manipulati...
<p>Not the most efficient solution, but you could check whether the file exists, and if so read it, and append the new lines afterwards.</p> <p>Additionally, your <code>df2 = pd.DataFrame(items)</code> call should have one less indentation. Otherwise, you'll be creating a new dataframe and saving it for every iteration...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert enum to List<String><p>I have enum class and I want to show the enum data to ListView. Can anyone tell how to do that?</p> <pre class="lang-dart pret...
<p>Possible duplicate <a href="https://stackoverflow.com/q/29567236/10157127">of this</a></p> <p>You can do</p> <pre class="lang-dart prettyprint-override"><code>List&lt;String&gt; values = TableType.values.map((e) =&gt; e.name).toList(); </code></pre> <p>More about <a href="https://api.flutter.dev/flutter/dart-core/En...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how do i include get_absolute_url in my success_url of a class view<p>How do i include the get_absolute_url defined in the model in the class based view?</p>...
<p>You can override the <a href="https://docs.djangoproject.com/en/dev/ref/class-based-views/mixins-editing/#django.views.generic.edit.DeletionMixin" rel="nofollow noreferrer"><strong><code>.get_success_url()</code></strong> method <sup>[Django-doc]</sup></a>:</p> <pre><code>class DeleteCommentView(DeleteView): mod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: red line after BufferedImage rotate<p>Why after orientation i have red line on image?</p> <pre><code>public class TestOrienationImg { public static void ...
<p>The call <code>g2d.drawRect(0, 0, newWidth - 1, newHeight - 1);</code> uses the new image dimensions with the affine transform (orig-&gt;new) so you are not drawing a red box around the new image shape. One way to fix is to pass in the original dimensions:</p> <pre><code>g2d.drawRect(0, 0, w - 1, h - 1); </code></pr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rendering Problem in BOTH Chrome & Firefox with CSS Transform<p>Although sometimes a pixel here or there must be forgiven and forgotten.<br /> But in this ex...
<p>Borders can be fiddly when you start applying transforms to the element they are applied to, so remove the <code>transform:scale(-1)</code> from the containing <code>&lt;li&gt;</code> elements and transform the <code>&lt;a&gt;</code> instead:</p> <pre class="lang-css prettyprint-override"><code>nav li { backgrou...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does useNavigate replace option do?<p>The <a href="https://reactrouterdotcom.fly.dev/docs/en/v6/hooks/use-navigate#usenavigate" rel="nofollow noreferrer...
<p>The <code>replace</code> options property is a REPLACE navigation action. It's a redirect, replacing the current entry in the history stack versus PUSHing a new entry onto the top like a regular navigation.</p> <pre><code>navigate(path); // PUSH, navigate navigate(path, { replace: true }); // REPLACE, redirect </cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extract words within curly quotes but keep it when used as apostrophe<p>I have a <strong>UTF-8 file</strong> which has curly quotes <code>‘Awaara’</code> lik...
<p>You can use</p> <pre class="lang-sh prettyprint-override"><code>sed -E -e &quot;s/([[:alpha:]]['’][[:alpha:]])|['‘’]/\\1/g&quot; \ -e 's/[][()&gt;?,;.!:]|′|…/ /g' &quot;$1&quot; | tr ' ' '\n' | sort -u | \ tr 'a-z' 'A-Z' &gt; our_vocab.txt </code></pre> <p>See the <a href="https://ideone.com/EGHb89" rel="nofollo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use Ajax & jQuery to change data order retrieved at table in Blade<p>I'm working with Laravel 8 and I have retrieved the list of <code>users</code> at...
<p><strong>View:</strong></p> <pre><code>&lt;table class=&quot;table table-hover&quot; id=&quot;contentDiv&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;th&gt;&lt;/th&gt; &lt;th&gt;Username&lt;/th&gt; &lt;th&gt;Email&lt;/th&gt; &lt;th&gt;User Status&lt;/th&gt; &lt;/tr&gt;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NavigationLink issue linking to a website<p>Using <code>NavigationLink</code> i'm attempting to make a button that forwards you to a website on safari, but c...
<p>Use <code>Link</code> instead of <code>NavigationLink</code></p> <p><code>Link</code> is for websites, <code>NavigationLink</code> is for SwiftUI Views.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to fix selenium unable to find element when run on Heroku but is able to find the same element when run locally?<p>I am running a <strong>simple python s...
<p>Google gives you page depending on your location. For example here is my local browser (on my computer):</p> <p><a href="https://i.stack.imgur.com/v8mZl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v8mZl.png" alt="enter image description here" /></a></p> <p>And here is how it looks like on my p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Stop Button From Pushes Text to the Left on Hover<p>Have this button that's great, but when I hover over it, it pushes the text to the left.</p> <p>Trying to...
<h2>Update</h2> <p>For multiple buttons that are identical, collect all <code>.btn</code> in a NodeList and iterate through it with <code>.forEach()</code> and then bind events to each <code>.btn</code></p> <pre><code>document.querySelectorAll('.btn') .forEach(b =&gt; b.onevent = e =&gt; { e.target.classList.toggle('...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to download automated word doc to client machine<p>I have created a word document based on an aspx form, the document is created in a different vb.class ...
<p>Is this a asp.net web site? If yes, then the file system you have for use on the web side of things of course is only folders in the web site. You can certainly save a file into that web site and say one of its folders.</p> <p>However, when you provide a button for a download link? Well, you can provide a path name ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: bitcode bundle could not be generated because Flipper-DoubleConversion was built without full bitcode<p>I wanted to build IOS after environmental separation....
<p>I changed Filpper version</p> <ul> <li>package.json</li> </ul> <pre class="lang-json prettyprint-override"><code>{ &quot;react-native-flipper&quot;: &quot;^0.135.0&quot;, } </code></pre> <ul> <li>podFile</li> </ul> <pre><code>use_flipper!({ 'Flipper' =&gt; '0.135.0' }, configurations: ['DevDebug','ProdDebug','DevRel...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extract specific data from an output of shell command in Ansible<p>I would like to create a playbook that extract the <code>used</code> space for <code>/boot...
<p>This is a typical <a href="https://xyproblem.info" rel="nofollow noreferrer">x/y problem</a> (although it is easy to answer since you have given your root requirement i.e. get used size on a mount point).</p> <p>You don't have to use <code>shell</code> to get that information. It's all available in the target machin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Winbond W25Q and STM32F411 Blackpill - SPI not respond<p>I'm writing SPI driver on top of CMSIS for W25Q (25Q64FVSIG) populated on STM32F411 Blackpill board....
<p>I found the problem. It was that the MISO for flash on my board is connected to pin PA7, not as in the documentation to PB4. I probably have a different version of this board.</p> <p>Never trust schematics! Check for yourself on a real board!</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is my rotation matrix not working properly?<p>I've been working a bit on this simple rasterizer, but the cube I imported is not rotating properly. Here's...
<p>As I stated in the comments the issue is not with the rotation as the math checks out.</p> <p>The issue should be with the projection.</p> <p>Here is the geometry for the perspective projections. Below is a sketch from the side showing how <em>y</em> and <em>z</em> coordinates interact. Something similar happens bet...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want to get a list of files using FirebaseStorage in Flutter, but I can't<p>I am Japanese. I am using automatic translation, so please forgive me if my Eng...
<p>Please make sure you're able to read and write from Firestorage. If your code does not allow you to read those data, you could get some related information from the console(&quot;RUN Page under bottom&quot;) in Android studio. Therefore, we need to change the rules for Firebase Storage to be public, like this:</p> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: query with both MATCH and CREATE<p>I have 3 Nodes:</p> <ul> <li><code>:User</code> which has a unique <code>id</code> property</li> <li><code>:Palette</code>...
<p>MERGE and MATCH stages (or MATCH and MATCH) require a WITH between them in order to use the result of the former in the latter.</p> <p>In your case you can use the <code>p</code> that you already have like this:</p> <pre><code>... WITH p MATCH (p)-[in:INCLUDES]-&gt;() DELETE in </code></pre> <p>So you won't need t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Researchpy : Warning in the example of summary_cont() page<p>The researchpy's <a href="https://researchpy.readthedocs.io/en/latest/summary_cont_documentation...
<p>Values are assigned as shown below. Row indexes on the left, column names on the right. Explicit 'loc' indexing is used. You can see the difference between explicit and implicit 'iloc' indexing <a href="https://stackoverflow.com/questions/72235641/selecting-data-from-a-pandas-dataframe/72240640#72240640">here</a></p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to parse yaml file with string values<p>For the below example, I am trying to read this yaml file, parse it and write the contains under the <code>data</...
<p>Is the quote part of the data, or just its representation? If it's part of the data, you'll have to indicate that in the yaml.</p> <pre class="lang-yaml prettyprint-override"><code>data: key1: | &quot;Value1&quot; key2: Value2 </code></pre> <p>Note that enclosing quotes is optional on yaml string val...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to Get last Transaction For Ticket based on time stamp in Bigquery<p><a href="https://i.stack.imgur.com/r7iQh.png" rel="nofollow noreferrer"><img src="ht...
<p>Try query below:</p> <pre class="lang-sql prettyprint-override"><code>with sample_data as ( select struct(111 as ticket_id, ['Open','ReOpen','Modified','Cancelled'] as type, [timestamp('2022-7-14 03:39:00'),timestamp('2022-7-14 03:40:00'),timestamp('2022-7-14 03:50:00'),timestamp('2022-7-14 04:39:00')] as time_stamp...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does VSCode snippet syntax allow optional parameters to a command<p>I recently started using a 3rd party extension for language supporting robot programming ...
<blockquote> <p>Is there a way to edit the snippets json to not enter the optional part unless I start typing a backslash followed by text?</p> </blockquote> <p>No, I don't think there is any way to do that within the same snippet. You could make another snippet with the backslash prefix but that is cumbersome.</p> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React Native, not able to store and fetch data correctly with async-storage<p>I am using the below code to create a simple to-do list. Everything works fine...
<h1>Problem</h1> <p>The problem is caused by the below <code>useEffect</code>. It saves <code>tasks</code> in storage every time <code>tasks</code> changes, but also on first render where <code>tasks</code> is equal to <code>[]</code>, the value given to <code>useState</code>.</p> <pre><code>useEffect(() =&gt; { const...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add spinner while loading data in react.js?<p>I want to add spinner while loading data from database. For fetching data I am using react-hook. Here is...
<p>You can do solution with useEffect. Basically initial loading is true and it becomes false when you have inventories data. I also see that you are using tailwind so you can set spinner icon animation directly with <code>animate-spin</code></p> <pre><code>import React from &quot;react&quot;; import { useNavigate } fr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does it say "double free or corruption (out) Aborted"<p>I wrote this code and it says that there is error <code>double free or corruption(out)</code> I d...
<p>You allocate the nodes as a single block of 4 nodes, you cannot free them one at a time as you do in the final loop. You should either:</p> <ul> <li>allocate each node separately</li> <li>or only free the node array pointed to by <code>n</code>.</li> </ul> <p>Here is a modified version using the first approach:</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fontawesome Icons take different widths<p>I'm using Tailwind CSS along with Font Awesome Icons. Here the icons show like this,</p> <p><a href="https://i.stac...
<pre><code>&lt;script src=&quot;https://cdn.tailwindcss.com&quot;&gt;&lt;/script&gt; &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/js/all.min.js&quot; integrity=&quot;sha512-6PM0qYu5KExuNcKt5bURAoT6KCThUmHRewN3zUFNaoI6Di7XJPTMoT6K0nsagZKk2OB4L7E3q1uQKHNHd4stIQ==&quot; crossorigin=&quot...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: an issue of installing ngx-bootstrap with Angular 14 (Package "ngx-bootstrap" was found but does not support schematics)<p>I'm having a problem install ngx-b...
<p>Currently ngx-bootstrap is not compatible with angular 14. But you can force the installation by ignoring all peerDependencies when installing</p> <pre><code>npm install ngx-bootstrap@latest --legacy-peer-deps </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there any way to increase the performance of my python code without using threads/processes?<p>I am trying to do the Euler Problems, and I am stuck on the...
<p>Also, for starters, you dont need to check all numbers up to &quot;number+1&quot;. It is sufficient to test all numbers up to int(sqrt(number))+1. If you find a prime number, you divide your original number by that and repeat (recursively). At the end of this recursion, you will be left with some number which is it...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dependency injection using go interface<p>Im trying to use some dependency injection via go interface after reading some docs about it.</p> <p>I’ve two metho...
<blockquote> <p>But it doesn’t works</p> </blockquote> <p>It is not specified, but I assume that Dependency Injection does not work.</p> <p>Injection requires at least two different entity types. One is injected and the second on is a target receiving that injection.</p> <p>In your case, you have only one - Injection i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does my BlockOperation continue after I add it to an OperationQueue?<p>Apple documentation says that Operations run synchronously. Why then does the code...
<p>You said:</p> <blockquote> <p>Apple documentation says that Operations run synchronously. Why then does the code continue to run after an operation is added to a queue?</p> </blockquote> <p>Your debug output is correct. The <code>BlockOperation</code> will run asynchronously with respect to the thread which added it...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL display low med high as 1 2 3<p>I'm very new to this so sorry if I struggle with clarity.</p> <p>The database I am working from has a column of values st...
<p>I think that you could use the CASE command, for example:</p> <pre><code>SELECT id , disease , CASE WHEN rating = 'low' THEN 0 WHEN rating = 'mid' THEN 1 ELSE 'etc' END AS rating FROM mytable; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular Material Tooltip - is it possible to embed an image in a mat-tooltip?<p>I'm currently trying to find the best way to display an corresponding image w...
<p>You would need to implement custom template, which material tooltip doesn't support out of the box. There are workarounds if you look around though.</p> <p>A simpler way would be to use package, that supports templates however.</p> <p><a href="https://ng-matero.github.io/extensions/components/tooltip/overview" rel="...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot install private dependency from artifact registry inside docker build<p>I am trying to install a private python package that was uploaded to an artifa...
<p>From your traceback log, we can see that Cloud Build doesn't have the credentials to authenticate to the private repo:</p> <pre><code>Step 10/12 : RUN pip install --extra-index-url https://us-west1-python.pkg.dev/my-project/my-package/simple/ my-package==0.2.3 ---&gt; Running in b2ead00ccdf4 Looking in indexes: http...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The remote system does not have CMake 3.8 or greater<ol> <li><strong>Introduction to the problem</strong></li> </ol> <p>I'm trying to create a MacOS app that...
<p>This seems to be a Visual Studio bug. You can keep track of it <a href="https://developercommunity.visualstudio.com/t/Remote-MacOS-build-doesnt-work-with-Win/10046572" rel="nofollow noreferrer">here</a>.</p> <h3>Workaround</h3> <p>It looks like Visual Studio always looks for CMake under local folder of currently con...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: If String(s) in List, output the index of List and which String(s) was found<pre><code>py_list = ['Big apple pie','Small blueberry Pie','Cold Cherry Pie','Ho...
<p>The accepted answer can be improved by eliminating the need for a belated look-up of the index as follows:</p> <pre><code>py_list = ['Big apple pie','Small blueberry Pie','Cold Cherry Pie','Hot keylime pie'] keywords = ['blueberry','keylime'] for i, s in enumerate(py_list): for k in keywords: if k in s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ActiveMQ Artemis Shared Storage slave fail to start if master is not started<p>We have a master/slave setup with the shared storage strategy. We observed tha...
<p>Generally speaking what you're seeing is <em>not</em> the expected behavior for master/slave using shared storage. If the master is not started and the slave is started then the slave should acquire the lock on the shared storage and start. I just tested this out using the <code>transaction-failover</code> example w...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Custom boxshadow not showing<p>I'm trying to add a custom shadow to my theme but it's not working, am I missing something? I'm on Svelte. I also added color...
<p>Everything is looking fine in <code>config file</code>.</p> <p>You have to use the custom shadow like with this class <code>shadow-neumorphic</code>. Please verify this.</p> <p>You can see the working code <a href="https://play.tailwindcss.com/PBhZTRj9gY" 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: I need some input regarding the Texteditingcontroller and overflowing pixels<p>I have a few questions regarding the Texteditingcontroller. I finally managed ...
<p>For question no.1 aren't you using different text style <code>descriptionTextStyle &amp; titleTextStyle</code></p> <p>For question no.2 if you want to make the editable text only availble person just add bool and if else condition</p> <p>For question no.3 Text have params called overflow</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to perform search query with mongo and mongoose with react.js?<p>I've been having trouble with creating a search component in this project. Basically, th...
<p>You are sending request body for <code>GET</code> request, try sending query params, like this:</p> <pre><code>const handleSearch = async (e) =&gt; { const product = {search}; const response = await fetch(`/api/products/search?${new URLSearchParams(product).toString()}`) } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: GroupBy transform median with date filter pandas<p>I have 2 dataframes:</p> <p>df1:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> ...
<p>Here's a way to do this without a python loop:</p> <pre class="lang-py prettyprint-override"><code>df3 = df1.merge(df2, on=['artist_id', 'region_id']) df3 = df3[df3.date &gt;= df3.concert_date - pd.DateOffset(months=3)] df3 = df3.groupby(['artist_id', 'region_id', 'concert_date']).median().rename( columns={'popu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parsing Python hex string in half<p>I'm having troubles wrapping my head around splitting this hex string by the following request.</p> <pre><code>#hex strin...
<blockquote> <p>When I split the string on &quot;middle_of_string&quot; i get equal numbers on both sides. Does this mean that I am duplicating the last value of the first half and the first value of the second half?</p> </blockquote> <p>No! You're dividing the string exactly in half correctly. Assuming <code>s</code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Set custom route using OData 8<p>Recently I updated to OData 8.0.10. I added this in my <code>Startup.cs</code> file:</p> <pre><code>services.AddRouting(); s...
<p>@anthino</p> <ol> <li>Is there a way to reroute odata to api, make /odata prefix as /api and make it work?</li> </ol> <p>if you add 'opt.AddRouteComponents(&quot;api&quot;, GetEdmModel())', remember to remove [Route(&quot;api/[controller]&quot;)] and other attribute routings</p> <ol start="2"> <li>Should I make anot...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React: Passing Props not working. Am I missing something?<p>as you may get from the title, passing props in react is not working. And i don´t get why.</p> <p...
<p>You should pass <code>&lt;Login /&gt;</code> as the element. Try this code:<br> App.js:</p> <pre><code>import './App.css'; import { BrowserRouter as Router, Routes, Route } from &quot;react-router-dom&quot;; import Login from './components/Login.js'; function App() { return ( &lt;div className=&quot;App&quot;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python findall() not working like I think it should<p>In python, I'm attempting to collect the nodes of my xml file with the tag 'offer' whose direct parent ...
<p>You have to deal with <a href="https://docs.python.org/3/library/xml.etree.elementtree.html#parsing-xml-with-namespaces" rel="nofollow noreferrer">the namespaces in your xml</a> (which, at least in your question, is not well-formed). Assuming your xml is fixed, you can select, for example, the seller ID in each offe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create an async generator "from scratch"<p>Most of the time I am using asyncio API. But how would I create an async generator &quot;from scratch&quot;?</p> <...
<p>I'm glad the fixing the call to <code>asyncio.sleep()</code> got things running.</p> <p>I'm concerned partly about your <code>run()</code> function, because you're only <code>await</code>-ing on the first task, which means your code could exit before the other tasks are complete. I would suggest this:</p> <pre><code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Update Authority of Candy Machine Project<p>My question is regarding taking over a partially minted CM project. I'm not too familiar with Solana development....
<p>An already partical mint has a few things that need to be updated to fully take over a project.</p> <p>You'll need to have on hand the update auth keypair for the Candymachinne given to you by the old owner or have them perform some of the actions here if they do not hand it over as some actions need to be performan...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Argument data type varchar is invalid for argument 2 of substring function<p>I'm trying to put 2x'-' in phone number and I'm getting the following error</p> ...
<p>Your Query modified as below</p> <pre><code>declare @tel nvarchar(20) = '123456789' set @tel = (select left (@tel, 3))+'-'+(select substring (@tel, 4,3))+'-'+(select right (@tel, 3)) select @tel </code></pre> <p>can Re write as below</p> <pre><code>declare @tel nvarchar(20) = '123456789' set @tel = left (@tel, 3)+'-...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R adding 10 to a specific element of a list in a dataframe<p>I have this dataframe df:</p> <pre><code>df&lt;-structure(list(tile_type_index = c(9, 15, 20, 5,...
<p>Trivial with a loop:</p> <pre><code>library(magrittr) for (i in seq_len(nrow(df))) { if (df$tile_type[i] == 'Outpost') next tidx = df$tile_type_index[i] df$material_on_hex[[i]][tidx] %&lt;&gt;% add(10) } # tile_type_index tile_type material_on_hex # 1 ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas merge_asof Question: one-to-multiple merge<p>I am trying to merge two dataframes by nearest time point. I tried <code>merge_asof</code>. However, the ...
<p>You need to perform a double <code>merge</code>, first with the <code>merge_asof</code>, then a classical <code>merge</code>. The trick is to identify the duplicates in the asof merged right DataFrame:</p> <pre><code>df_B2 = df_B.assign(idx=df_B.groupby('time').ngroup()) out = (pd .merge_asof(df_A, df_B2, on='time...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert factor to datetime in R<p>I have a colum that is of factor datatype, however the timestamp is in this format:</p> <blockquote> <p>%Y-%m-%dT%H:%M:%S</...
<p>How about this with <code>lubridate</code> ?</p> <pre><code>x &lt;- as.factor(&quot;2022-05-16T20:38:19&quot;) library(lubridate) y &lt;- ymd_hms(x) str(y) </code></pre> <p><code> POSIXct[1:1], format: &quot;2022-05-16 20:38:19&quot;</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: search for a name inside array that it's inside array<p>I want to find a specific name given by user in this array if it's not found show a message. I tried ...
<p>this is the answer thank you all for help.</p> <p>$nameInput = $_POST['name']; $passInput = $_POST['password'];</p> <pre><code> $nameInput = strtoupper($nameInput); $c=0; foreach($persons as $key) { if($key['name'] == trim($nameInput) &amp;&amp; $key['password'] == $passInput){ ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Two geom_ribbon<p>I want some figure like this <a href="https://i.stack.imgur.com/TfIuP.jpg" rel="nofollow noreferrer">two geom_riboon from: https://doi.org/...
<p>Your problem is that <code>geom_line</code> and <code>geom_ribbon</code> require different aesthetics: for <code>geom_line</code> you need to set <code>color</code>, for <code>geom_ribbon</code> one uses <code>fill</code>:</p> <pre class="lang-r prettyprint-override"><code>library(tidyverse) df &lt;- expand.grid(ti...