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: Get the type of an item in "keyof" using a property and generic types<p>I want to define an interface with generic type that have to accept an object having ...
<p>I'm going to simplify your example to show where the problem is and how to fix it. First, you have a generic <code>KeyValFunc&lt;T, K&gt;</code> type that takes an object type <code>T</code> and one if its key types <code>K</code>, and hold both that key and a function that accepts a value whose type matches the ob...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Plot a histogram for a frequency table in R- ggplot2<p>I have a frequency table of number of occurrences of a variable per each value of reference (essential...
<p>First make your data from wide to longer using <code>pivot_longer</code>. After that you can create a stacked barplot like this:</p> <pre><code>library(ggplot2) library(dplyr) library(tidyr) df_1 %&gt;% pivot_longer(-ref) %&gt;% ggplot(aes(x = ref, y =value, fill = name)) + geom_bar(stat = &quot;identity&quot;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas: Search and replace a string across all columns in a dataframe<p>I'm trying to search for a string 'NONE' that is in uppercase across all columns in a...
<p>Try this</p> <pre class="lang-py prettyprint-override"><code>df = pd.DataFrame({'A': ['None', 'NONE', '565'], 'B': ['234', 'NONE', '347']}) # replace NONE by None df = df.replace('NONE', 'None') print(df) </code></pre> <pre><code> A B 0 None 234 1 None None 2 565 347 </code></pr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parse XML body from HTTP Push request with Express & Node.js, using body-parser-xml<p>I need to process a HTTP push request using Node.js express.</p> <p>The...
<p>The request has apparently been parsed by the</p> <pre class="lang-js prettyprint-override"><code>app.use(express.urlencoded({ extended: true })); </code></pre> <p>middleware, which means that it must have had <code>Content-Type: application/x-www-form-urlencoded</code>. Remove the two <code>app.use</code> lines, be...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Aggregate copublications associated with a primary publication<p>Each primary_citation may have multiple copublications. I would like to aggregate citation_...
<p>Lmk if is that what you needs:</p> <pre><code>dat %&gt;% group_by(primary_citation) %&gt;% mutate(N = paste0(&quot;copublication_&quot;,row_number())) %&gt;% ungroup() %&gt;% pivot_wider( id_cols = primary_citation, names_from = N, value...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to convert in python negative value objects in dataframe to float<p>I'd like to create function a which converts objects to float. Tried to find some sol...
<p>You can extract the numbers on one side, and identify whether there is a minus in the other side, then combine:</p> <pre><code>factor = np.where(df['price'].str.match(r'[−-]'), -1, 1)/100 out = (pd.to_numeric(df['price'].str.replace(r'\D', '', regex=True), errors='coerce') .mul(factor) ) </code></pre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does isolated V3 App service Environment have 2 outbound IP?<p>Version 2 App service environment gives 1 outbound IP</p> <p>But with ver,3 isolated App s...
<blockquote> <p>Can i delete one of the outbound IP?</p> </blockquote> <p>There are 2 outbound IPs because there are 2 load balancers in the infra vnet for ASEv3. One IP is for the infra roles (Multi,FE, etc) and the other is for the workers outbound connection. We provide both as outbound ips because outbound traffic ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Typescript types that can be overwritten based on type arguments<p>I'm trying to figure out the best way to tell the typescript compiler that a function that...
<p>You can do that fairly easily with function overloads and a second parameter; that also lets you build in a useful explanatory error when (inevitably) the programmer &quot;knows&quot; the cookie exists but it dooesn't:</p> <pre class="lang-typescript prettyprint-override"><code>export function getCookie&lt;T&gt;(nam...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: data from ObservableObject class do not pass to .alert()<p>Sorry for simple question, try to learn SwiftUI</p> <p>My goal is to show alert then i can not loa...
<p>Probably when doing this check, the data fetch process is not finished yet.</p> <pre><code>if networkManager.appError != nil { showAlert = true } </code></pre> <p>So you should wait the network request finish to check if there is error or not.</p> <p>If you sure there is error and just test this try this to see ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I count dictionary items with specific values inside list in Python?<p>I want to print and count the users who are 'male' and are born on 1973, 1980....
<p>You can extract the year as a substring of the birthday and then compare:</p> <pre class="lang-py prettyprint-override"><code> for user in users: if user['gender']=='male' and user['birthday'][0:4] in ['1973', '1980']: count +=1 print(user) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Where does 'Microsoft Accessibility Insights' extension (web) store data?<p>Wondering if the community can help me understand if (scanned) data is only store...
<p>In general, Accessibility Insights for Web only stores complete scan data locally in the browser and does not upload results to any sort of external host.</p> <p>If you chose to allow usage telemetry when you started the extension for the first time, it will upload some anonymous usage data. This includes informatio...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can't login to Office 365. Getting a blank password screen<p>I am unable to login to office.com. When I go to login I am getting the following image: <a hre...
<p>I tried opening your link and it's working fine.</p> <p>You can try the following things:</p> <p>1 - Try logging in incognito and check if you get the same result</p> <p>2 - Update the browser to the latest version</p> <p>3 - Try using a different browser</p> <p>4 - Try using a different device</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Displaying modified PDF page in PDF View without saving locally<p>I am using the following code to write a text on a PDF. I need to display the modified PDF ...
<p>You can create a <code>PDFDocument</code> from <code>Data</code>. Use <code>.dataRepresentation()</code> on your PDFDocument to get the data, and <code>PDFDocument(data: )</code> to create the PDFDocument from the data.</p> <pre><code>let data = myPDFDocument.dataRepresentation() let anotherDocument = PDFDocument(da...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to fix maker at center with dragable map and pick the new location on drag end?<p><strong>I am working on google maps and I am trying to drag my map(came...
<p>Steps</p> <ol> <li>create a stack</li> <li>In children of stack place your google maps</li> <li>Second children of the stack should be your marker/icon, positioned at the center, you can use Positioned or Align widget.</li> <li>Use the predefined method of GoogleMaps widget {void Function(CameraPosition) onCameraMov...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Requirements.txt not installed in Docker container<p>I have got the following Dockerfile</p> <pre><code>FROM jupyter/scipy-notebook COPY . ./work COPY setu...
<p>Solved by typing <code>docker-compose up -d --build</code> with the second <code>docker-compose.yml</code> file and all other files as shown in the question (as suggested by @dallyger).</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I find and edit the html code for Moodle without using the additional HTML box?<p>I've been hunting for days now and for whatever reason the code see...
<p>In moodle, you can use the theme plugin renderers to render the core outputs. Please refer to the theme renderer method.<br /> <a href="https://docs.moodle.org/dev/Overriding_a_renderer" rel="nofollow noreferrer">https://docs.moodle.org/dev/Overriding_a_renderer</a></p> <p>you can find the full_header function in <s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AWS Lambda doesn't have DynamoDB permissions when invoked by URL/API Gateway<p>We have a pair of existing AWS Lambda functions that read/write from a DynamoD...
<p>When you invoke the lambda function in the lambda console, lambda is using an <em>Execution role</em>.</p> <p>When you invoke the lambda function via API gateway or via the function URL, it is likely that you are using <code>IAM</code> authorization. As a result, lambda is using <em>the role of the principal</em> wh...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What's the good write to display this json form in angular 13<p>So to be simple i've got in json this:<a href="https://i.stack.imgur.com/4vKNW.png" rel="nofo...
<p>Try with an array :</p> <pre><code>operations?: OperationsDetails[]; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Best way to refactor methods that have the same code but different return values<p>I have this piece of code:</p> <pre><code>public A methodA(X answer) { ....
<p>I'd extract the unique part of the code to a <a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/Supplier.html" rel="nofollow noreferrer"><code>Supplier</code></a>, move the common code to one method, and have the original methods call that underlying method with a supplier:</p> <pre class="lang-ja...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Constraint a path to be within a folder<p>Say you want to store a file within a folder <code>C:\A\B\C</code> and let the user supply the file name.</p> <p>Ju...
<p>I've used one of my test projects, it really doesn't matter:</p> <p>Using c#10</p> <pre class="lang-cs prettyprint-override"><code>internal class Program { static void Main(string[] args) { string template = @&quot;F:\Projectes\Test\SourceGenerators&quot;; string folder = @&quot;..\..\..\..\T...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to not allow conversion from temporary shared_ptr to weak_ptr for derived types<p>I have asked this question for <a href="https://stackoverflow.com/quest...
<p>One of the possible solutions - overload <code>use_weak_ptr</code> for all <code>std::shared_ptr</code>.</p> <pre><code>template &lt;typename T&gt; void use_weak_ptr(std::shared_ptr&lt;T&gt;&amp;&amp;) = delete; </code></pre> <p><a href="https://godbolt.org/z/Tj1a134bd" rel="nofollow noreferrer">https://godbolt.org/...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calling PS1 script from other PS1 script failing after invoked for the 1st time in same Terminal instance, Why?<p>As per the image showing below, I have two ...
<p>Someone might write this better then me.</p> <p>You need to rename <code>call.ps1</code> to <code>call.psm1</code></p> <p>Then change the code in <code>main.ps1</code> to the following</p> <pre><code>Import-Module '.\call.psm1' callingthefunction </code></pre> <p>Also in your <code>main.ps1</code> you used <code>'....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NOT_FOUND when adding tasks to Google Cloud Tasks<p>I'm getting an error called NOT_FOUND while adding tasks to Google Cloud Tasks from the Firebase Function...
<p>check the service account email you are using, suppose you have the task object like this:</p> <pre><code> const task = { httpRequest: { httpMethod: 'POST', url, body: Buffer.from(JSON.stringify((payload))).toString('base64'), // required by cloud tasks api headers: { 'Content-Ty...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to check more than one value from dictionary in an if statement?<p>Im just starting to learn unity and saw this task in one of my c# studying books. I ha...
<p>I am not sure if I understood the question but I will try to give you a basic overview of what is happening in the code you posted. Let's start with the if, how an if block works is simple you put a boolean bool for short in C# that can have two different values true and a false, inside the if(BOOL VALUE) and if the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to load complex data using Pyspark<p>I have a <code>CSV dataset</code> that looks like the below:</p> <p><a href="https://i.stack.imgur.com/7cLFq.png" re...
<p>Main issue is consecutive double quotes in your csv file. you have to escape extra double quotes in your csv file Like this :</p> <pre><code>4/24/2019 11:43:30,25-34,Higher Education,Student Records Coordinator,&quot;54,371&quot;,USD,Philadelphia,8 - 10 years,equivalent to Assistant Registrar, 4/25/2019 8:35:51,25...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want close electron app from another html page with button<p>We are currently improve a project with electronjs: We have main.js for electron as you know ...
<p>You must use <code>ipcMain</code> and <code>ipcRenderer</code>. Main for reading message and Renderer for sending message.</p> <blockquote> <p>.html page</p> </blockquote> <pre><code>&lt;script&gt; function kapat() { const { ipcRenderer } = require('electron') const ipc = ipcRenderer; ipc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dividing two SQL queries<p>I am not super familiar with SQL queries, but I am trying to divide the results of two queries, ex. # of users with at least $x / ...
<p>you use aliases that where not defined</p> <pre><code>SELECT x._number / y._number FROM ( SELECT COUNT(address) _number FROM transferAmounts WHERE poolholdings &gt; 0 ) x join ( SELECT COUNT(address) _number FROM transferAmounts ) y on 1=1 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Send email to the new google form submission only<p>I'm new to the Google apps script. I wrote a script to send emails when there is a new submission from go...
<p>Instead of reading the values from the spreadsheet take advantage of the form submit event object. This event object has two properties including the form submission values, one is an Array of form submission values in the same order than the sheet columns, the other is an object having a property for each question ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I draw blocks with dygraphs<p>Instead of a typical time series line graph, I need to draw blocks as illustrated in the transition from diagram 1 to di...
<p>You might be better served by defining a custom <a href="https://dygraphs.com/tests/plotters.html" rel="nofollow noreferrer"><code>plotter</code></a> rather than using <code>underlayCallback</code>. The docs are a bit sparse, but it gives you the reference to the drawing context that you need:</p> <pre class="lang-j...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is the ManuallyDrop ABI guaranteed to be repr(transparent)?<p>The <a href="https://doc.rust-lang.org/nomicon/other-reprs.html" rel="nofollow noreferrer">nomi...
<p>This was actually <a href="https://github.com/rust-lang/rust/pull/88375/files" rel="noreferrer">just clarified</a> with today's release of <a href="https://github.com/rust-lang/rust/blob/stable/RELEASES.md#version-1610-2022-05-19" rel="noreferrer">Rust 1.61.0</a>. The documentation of <code>ManuallyDrop</code> now s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does AdaBoost or GradientBoosting ensemble with a single estimator give different values than the single estimator?<p>I'm curious why a single-estimator ...
<p><code>AdaBoostRegressor</code> performs weighted bootstrap sampling for each of its trees (unlike <code>AdaBoostClassifier</code> which IIRC just fits the base classifier using sample weights): <a href="https://github.com/scikit-learn/scikit-learn/blob/32f9deaaf27c7ae56898222be9d820ba0fd1054f/sklearn/ensemble/_weig...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Numpy Delete not deleting rows<p>I've been trying to write some code to delete rows from my 2d array according to the following criteria:</p> <ol> <li>every ...
<p>Have a look at your code and check what is happening to <code>new_arr</code> when the next loop itteration starts.</p> <p>The approach you chose however is not very efficient, because you will copy the array every time you call delete. It is better do do it in one shot, something like this:</p> <pre><code># creating...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want to sort my words from arr by 2nd letter of each word according to my given pattern<p>/* pattern: e,b,c,d,i,f,g,h,o,j,k,l,m,n,u,p,q,r,s,t,a,v,w,x,y,z</...
<p>You can use the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort" rel="nofollow noreferrer">sort method</a> and the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf" rel="nofollow noreferrer">indexOf function</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PanGestureHandler Expected `onGestureHandlerEvent` listener to be a function<p>Using <code>PanGestureHandler</code> from <code>react-native-gesture-handler</...
<p><a href="https://github.com/software-mansion/react-native-reanimated/issues/1506#issuecomment-860684310" rel="nofollow noreferrer">This comment</a> on GitHub points in the correct direction.</p> <p>Though not specified in the docs, but can be inferred from the examples... <code>PanGestureHandler</code> requires an a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to process a dataframe column based on another dataframe column in PySpark?<p>Let's say that I have these two dataframes</p> <pre class="lang-none pretty...
<p>Join the dataframes, but use <code>alias</code> on them. Then you will be able to choose between columns of the same name.</p> <pre class="lang-py prettyprint-override"><code>df3 = (df1.alias('a') .join(df2.alias('b'),['Name', 'Surname'], 'left') .select( 'Name', 'Surname', F.coalesce...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Having an issue with relative paths in .runsettings for output folders using NUnit 3.13.3 in Visual Studio 2017<p>I am using NUnit 3 with Visual Studio 2017....
<p>Issue reported on GitHub. See the following link for response. <a href="https://github.com/nunit/nunit3-vs-adapter/issues/997#issuecomment-1186165040" rel="nofollow noreferrer">https://github.com/nunit/nunit3-vs-adapter/issues/997#issuecomment-1186165040</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: parse No Key json list with moshi in Android<p>What I am trying to do is to get Json response from GitHub API call of user's repository list.</p> <p>response...
<p>Because the JSON you are getting is an array, you need to return an array (List) type instead of an object type. The error came from Moshi trying to parse an array (outer tokens <code>[]</code>) as an object (outer tokens <code>{}</code>).</p> <p>Change this:</p> <pre><code>@GET(&quot;/users/{username}/repos&quot;) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: python error when compiling app that uses ahk<p>I use AHK in my app, and when I compile the app with pyinstaller and click on the resulting .exe file: this e...
<p>I was having the same problem and probably everyone who converts to exe will face the same problem --add-data you need to specify, actually that's the reason for the error, here's the code I used for myself, you can edit it</p> <pre><code>pyinstaller --onefile --noconsole --add-data &quot;C:\Users\fatih\AppData\Loca...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Server 2012 Email alert if there is a power outage<p>I have a old Windows 2012 Server, and we have AD installed in it... my question is how will i configure ...
<p>On the server create a scheduled task that executes on boot. This task can send an email after every server restart.</p> <p>The Windows Event log will contain events with ID 6008 (which means &quot;The previous system shutdown at time on date was unexpected&quot;) - ie power-cut or other unplanned shutdown. You migh...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: why does conditional list.insert() in python add additional items to list<pre><code>h = list('camelCase') for i in range(len(h)): if h[i].isupper(): ...
<p>Your issue is that you are iterating over the range of the list, and when you find a capital letter, you insert the space in that position, which means that the capital letter will be move to the next position, therefore once you find a capital letter it will simply add a space and check that letter again.</p> <p>Yo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: EF core query loop asynchronous<p>In the previous day I am looking for a way to make my code fully asynchronous. So that when called by a rest API, I' ll get...
<blockquote> <p>In the previous day I am looking for a way to make my code fully asynchronous. So that when called by a rest api, I' ll get an immediate response meanwhile the process is running in the background.</p> </blockquote> <p>Well, that's <em>one</em> meaning of the word &quot;asynchronous&quot;. Unfortunately...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to call function in django template using conditionals<p>I have a model for Group:</p> <pre><code>class Group(models.Model): leader = models.ForeignKe...
<p>For this, you might want to perform ac check in your join function prior to adding the user and after adding the user. This way, if the group is full, you can return that to the view, or if the user is the last to join the group, you can then close it. something like this may work:</p> <pre><code>def check_group(gro...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Undefined reference using GLFW static in a shared library<p>I'm building a project with two major components: Game and Engine. Engine is a shared library cal...
<p>I find thanks to kiner_shah hint that the problem come from the library. In fact, i'm using GLFW as a static library, so all the dependent library doesn't come with it. I needed to add these libraries for linux:</p> <blockquote> <p>links { &quot;glfw&quot;, &quot;Xrandr&quot;, &quot;Xi&quot;, &quot;GLU&...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can the result of JsonSerializer.Deserialize ever be null?<p>The return type shown in <a href="https://docs.microsoft.com/en-us/dotnet/api/system.text.json.j...
<p>Yes, parsing <em>valid JSON</em> <code>&quot;null&quot;</code> with a JSON serializer have to return <code>null</code>.</p> <pre><code>WeatherForecast? weatherForecast = JsonSerializer.Deserialize&lt;WeatherForecast&gt;(&quot;null&quot;); </code></pre> <p>Note that other <em>valid JSON</em> strings like <code>&qu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Best way to handle Svelte component props<p>I'm building an app using SvelteKit and Tailwind. I know that when using Tailwind to style it is recommended to l...
<p>Alternatively to using the <code>$$restProps</code> (and based on @pilchard's comment above, thanks for that) an options object could be exported, which is holding all the modified attributes values and is spread after the default attributes defined on the input element inside the component<br /> Like this all possi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to read Excel file in Spreadsheet::ParseXLSX<p>I'm trying to read <code>.xlsx</code> file in <code>Spreadsheet::ParseXLSX</code></p> <pre><code>#!/home/b...
<p>Where did you read that was the correct way to use SpreadSheet::ParseXLSX?</p> <p>I don't know the module at all well but, reading <a href="https://metacpan.org/pod/Spreadsheet::ParseXLSX" rel="nofollow noreferrer">the documentation</a>, it says:</p> <blockquote> <p>This module returns data using classes from <a hre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java string to query a varbinary(64) column<p>For a unit test, I need to query a MySQL table for a specific value in a varbinary(64) column. The data is load...
<p>I think what's happening here is: If your column is of some <code>byte[]</code> type (e.g. <code>VARBINARY</code>), then the <code>Loader</code> API will attempt to decode base64 encoded binary data, see <a href="https://github.com/jOOQ/jOOQ/issues/5858" rel="nofollow noreferrer">https://github.com/jOOQ/jOOQ/issues/...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I change the shortcut CTRL + ALT + D (Duplicate Line) from Cnpack plugin?<p>It there a way to change the &quot;Duplicate line&quot; shortcut from the...
<p>To edit this option you just need to do a right click somewhere in the <code>IDE editor</code> to show up the editor context menu. There navigate to the entry <code>CnPack Editor Menu</code> to open its sub menu. There navigate to <code>Others</code> to open the submenu, too, and finally click on <code>Options...</c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to wait for suspend function to be completed before executing other code in kotlin<p>I'm wondering if I can wait until a suspend function has completed b...
<p>Mark both functions suspending functions by adding the <code>suspend</code> modifier before <code>fun</code>. Then move the <code>AppScope.launch {}</code> call to wrap the call to <code>setParticlePicking</code>, wherever it is (you did not include in the sample).</p> <p>It should look something like this:</p> <pre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to loop through multiple elements based on class in Playwright JS test?<p>I am trying to write a Playwright JS test to scrape some values from a website....
<p>The dom is a little complicated and had to use nested loops to get the format you are looking for.</p> <pre class="lang-js prettyprint-override"><code>test.describe('Scrap', async () =&gt; { test('Stamps', async ({ page }) =&gt; { await page.goto('https://colnect.com/en/stamps/list/country/38-Canada'); awa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Number of 30 min intervals between two timestamps<p>Each row of data has a start and end timestamp. I've round them to the nearest 30 min interval using the ...
<pre><code>select '01:30'::time as a, '13:30'::time as b, timediff('min',a,b) as c, floor(c/30) as d; </code></pre> <p>gives:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>A</th> <th>B</th> <th>C</th> <th>D</th> </tr> </thead> <tbody> <tr> <td>01:30:00</td> <td>13:30:00</td> <t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to git ignore subfolders but not the files in first level<p>I have this folder structure and I need to ignore everything except the files (.R) in the sce...
<p>Assuming the scenario folders are in the root of your project, <code>scenario1/*/</code> isn't what you're after. That will ignore everything inside scenario1. It sounds to me that you want to ignore the <code>data</code> and <code>outputs</code> folders, but include the <code>.R</code> files. There are two solution...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: displaying live result from edit text to text view<p>I am creating a small golf app that includes a score card. I am facing an issue displaying the user's li...
<p>This is a partial answer intended to give you some ideas to finalize your approach.</p> <p>This line in the <code>onEditorAction</code> callback:</p> <pre><code>userSumOfHoles += Integer.parseInt(userScores.get(j).getText().toString()) - coursePars.get(j); </code></pre> <p>can be replaced with:</p> <pre><code>userSu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL - How do I use Case When to pivot data and have no duplicate keys in the rows?<p>I need to transpose the In_Type and Out_Type attributes to columns with ...
<p>You are almost done. You just need to add an outter query to aggregate the values of your query using conditions, like this:</p> <pre><code>SELECT pt_id, arrival_date, ft, pd1, pd2, admit, CASE WHEN admit IS NULL THEN trans_in1 END AS trans_in1, trans_out1, trans_in2, CASE WHE...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there any benefit in using Map (Object) over objects in React functional components?<p>I couldn't find anything about this online but I recently saw some ...
<p>One potential advantage of a Map is that its keys can be of any type - unlike plain objects, in which a key may only be a string or a symbol. Something else to consider is that plain objects with dynamic keys can rarely be problematic due to property name collisions (<code>__proto__</code>, <code>valueOf</code>, etc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Allocating memory to a passed-in pointer argument<p>What is the solution to the following problem:</p> <p>I have a null pointer which I pass to another funct...
<p>you are changing the pointer so do this</p> <pre><code>void xf(int **p) { *p = malloc(sizeof (int)); printf(&quot;xf: %p\n&quot;, *p); **p = 123; } </code></pre> <p>and</p> <pre><code>int *p = NULL; xf(&amp;p); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to highlight differences between rows per key, per column in SQL?<p>Say I have a dataset that I know has a number of rows where the unique keys are the s...
<p>Since you'll be using this with an arbitrary number of columns, I'd lean toward dynamic construction in a Snowflake query. There's only one function that does that and preserves the column names, and that's <code>object_construct</code>. You can use object_construct to create objects from the rows (as long as the ov...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JSON.stringfy(ArrayData) change is not being subscribed in UseEffect in Nextjs<pre><code>import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; im...
<p>Try to change your <code>inclusionHandleChange</code> function like this:</p> <pre><code>const inclusionHandleChange = (e) =&gt; { const { name, value } = e.target; const newValue = value === '' ? 0 : value; var inclusionItem = inclustionValue.find((va) =&gt; va.itemID === name); if (inclusionItem) { //...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trigger pipeline from another pipeline in Tekton<p>I have 2 Tekton <code>Pipeline</code>s <code>A</code> and <code>B</code>. I want to trigger execution of p...
<p>Your current solution is correct, as Tekton indeed doesn't really offers any easy way to trigger one pipeline from another.</p> <p>EventListeners are a nice way to get it working, without requiring you to authenticate against Kubernetes itself. Could be triggered with some curl/wget/any scripting language offering w...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to implement or after group in regex pattern<p>I want to get the thread-id from my urls in one pattern. The pattern should hat just one group (on level 1...
<p>Not knowing if this fits for all situations, but I would try this:</p> <pre><code>^.*?thread-((?:(?!-page|\.html).)*) </code></pre> <p>In Java, that could look something like</p> <pre><code>List&lt;String&gt; matchList = new ArrayList&lt;String&gt;(); Pattern regex = Pattern.compile(&quot;^.*?thread-((?:(?!-page|\\....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I subtract two integers datewise in SQL Server?<p>I have a table which has years as int, say 202101. I want to get the difference in months with 2022...
<p>Just to expand on Larnu's comment.</p> <pre><code>select datediff(month ,try_convert(date,concat(202101,'01')) ,try_convert(date,concat(202205,'01')) ) </code></pre> <p><strong>Results</strong></p> <pre><code>16 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel Excel: How to set the headers from database fields<p>There are tutorials about customizing headers. But now I want to use the header from database ta...
<p>If I want to export Users.</p> <p>This command is provided by laravel-excel:</p> <pre><code>php artisan make:export UserExport --model=User </code></pre> <p>UserExport.php</p> <pre><code>&lt;?php namespace App\Exports; use App\Models\User; use Maatwebsite\Excel\Concerns\FromCollection; use Maatwebsite\Excel\Concer...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Search for keys of a document in MongoDB and Golang<p>I'm using golang and its official mongo db driver, and I want to save documents is in the following str...
<p>I'm not sure if it directly works with <code>find</code> and <code>$regex</code>. It's better to try it in mongo first. Then implement in Go. Sample data:</p> <pre class="lang-js prettyprint-override"><code>/* 1 */ { &quot;_id&quot; : &quot;1b836f704c884d28&quot;, &quot;type&quot; : &quot;url&quot;, &quo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Where can I find the list of acceptable file type with FilePond?<p>I have a project with <a href="https://pqina.nl/filepond/docs/" rel="nofollow noreferrer">...
<p>you can check <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types" rel="nofollow noreferrer">MIME Common types</a></p> <p><code>.tiff</code> =&gt; <code>image/tiff</code></p> <p><code>.docx</code> =&gt; <code>application/vnd.openxmlformats-officedocument.wordprocessingml...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting IndexOutOfBoundsException in ArrayList while using .add(index, element)<p>I am using the <code>list.add(index, element)</code> function to insert ele...
<p>You can only use indexes that are existing or one larger than the last existing. Otherwise you would have some spots with no element in it. If you need a ficxed length to store elements on a specified position, try to fill the List before with empty entries or use an array:</p> <pre><code>MyElement[] myArray = new M...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: No inboud audio from WebRTC SFU connection<p>I started developing a (group) video chat application with WebRTC in a SFU configuration and Socket.io as signal...
<p>The problem was storing the received media stream.</p> <pre><code>let trackCount = 1; pc.ontrack = (event) =&gt; { const tracks = event.streams[0].getTracks(); if (!producer.stream) producer.stream = event.streams[0]; else tracks.forEach((track) =&gt; { producer.stream?.addTra...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Definition of spearmanr<p>To test my understanding on spearmanr and pearsonr, I compared two ways to compute spearmanr, which should give the same result. Su...
<p><em>Firstly,</em> just for clarification, <a href="https://en.wikipedia.org/wiki/Pearson_correlation_coefficient" rel="nofollow noreferrer">Pearson</a> and <a href="https://en.wikipedia.org/wiki/Spearman%27s_rank_correlation_coefficient" rel="nofollow noreferrer">Spearman</a> correlations are not the same, however t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: HTML Select Input Tag bringing error with "selected" attribute in React JS<p>Seeing this warning in React Warning: Use the <code>defaultValue</code> or <code...
<p>It's basically a warning that encourages you to change your code from doing <code>&lt;option selected&gt;</code> to doing <code>&lt;select defaultValue=&quot;theValue&quot;&gt;</code> or using a controlled select.</p> <p>It's probably because React wants to keep consistency between the Form components.</p> <p>Edit: ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to show Tags inside Shortcode<p>I know how to display Wordpress Current Post Title. It's like this:</p> <pre><code>&lt;?php echo do_shortcode('[auto_gall...
<p>You can use this way to display tags inside a Shortcode:</p> <pre><code>&lt;?php $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { echo do_shortcode('[auto_gallery search=&quot;' . $tag-&gt;name . '&quot;]'); } } ?&gt; </code></pre> <p>I hope this helps.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Write registry using nsis<p>I want to run a <code>.reg</code> file inside an NSIS installer. My registry file is:</p> <pre><code>Windows Registry Editor Vers...
<p>I've solved the problem using <a href="https://nsis.sourceforge.io/Reference/SetRegView" rel="nofollow noreferrer">SetRegView</a>. As I was working on a 64-bit operating system, it was trying to look to the registries as a 32bit register by default. Because of that, nothing was happening to my registry file. Setting...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to animate the cursor to the next new line and generate another new lines of characters in js / css?<p>I'd like to ask this question again, after all the...
<p>The animation is executed once for an element with <code>id=&quot;text&quot;</code>. What you can do is create a new element with <code>id=&quot;text&quot;</code> on every function call, which will execute the animation for that element:</p> <pre><code>let divElem = document.getElementById('container'); function New...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Nested dictionary to multiindex dataframe<p>I'm trying to convert a nested dictionary to multiindex dataframe where dictionary keys are columns labels.</p> <...
<p>IIUC, try:</p> <pre><code>my_dict = {&quot;season&quot;:&quot;summer&quot;, &quot;threshold&quot;:70, &quot;analysis&quot; : {&quot;max_temp&quot;:50, &quot;min_temp&quot;:20}} df_in = pd.json_normalize(my_dict) df_in.columns = df_in.columns.str.split('.', expand=True) df_in </code></pre> <p>Output:</p> <pre><cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make git always warn to stash or commit changes before checking out a different branch?<p>When I have modified my current branch and check out to a di...
<p>As <a href="https://stackoverflow.com/questions/72346246/how-to-make-git-always-warn-to-stash-or-commit-changes-before-checking-out-a-dif#comment127809311_72346246">Useless says in a comment</a>, you will need to write your own little mini-program (e.g., a few lines of shell script or alias) that does this. Git's &...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Applying direct modification from GeometryEffect without using modifier function in SwiftUI<p>I am looking to apply direct effect of modification of Geometry...
<p>Well, implementation of <code>GeometryEffect</code> is private (thus comparison in question is not accurate), so exactly we rather cannot replicate its behavior.</p> <p>However for same specific cases something like the following can be used</p> <pre><code>struct MyCustomGeometryEffect&lt;MyContent: View&gt;: View {...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Select data between a given interval of time from two columns MySQL<p>I need to retrieve data from a table from a given interval of time. My table is like th...
<p>To get all the values between the given interval of time - (05:00:00 - 10:00:00) use:</p> <pre><code>select * from tbl where Start_Time between '05:00:00' and '10:00:00' or End_Time between '05:00:00' and '10:00:00'; </code></pre> <p><a href="https://dbfiddle.uk/?rdbms=mysql_8.0&amp;fiddle=ba828afe1a3ca9f21d6c104e...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to generate arbitrary subqueries/joins in a Jooq query<p><strong>Situation</strong>: I am porting our application to Jooq to eliminate several n+1 proble...
<p>After reading another question <a href="https://stackoverflow.com/questions/55238643/jooq-join-with-nested-subquery">jOOQ - join with nested subquery</a> (and not realizing the solution) and playing around with generating Java code via <a href="https://www.jooq.org/translate/" rel="nofollow noreferrer">https://www.j...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python extract text between regex matches<p>I have a text file that I want to extract data from using Python. An example of the file is as follows:</p> <pre>...
<p>If you want the line after the 3 digits, and that line should not start with a digit you can use a capture group:</p> <pre><code>^\d{3}((?:\n(?!\d{3}$).*)*) </code></pre> <p><a href="https://regex101.com/r/ItXeRN/1" rel="nofollow noreferrer">Regex demo</a></p> <p><strong>Example</strong></p> <pre><code>import re pa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make a function executes after x seconds of its call using python<p><strong>I don't want function to be called every x secs</strong> <em>I want a func...
<p>You don't need to write any code at all. That's exactly what the standard Python library's threading.Timer does. All you have to do is call it.</p> <pre><code>import threading def fun_1(): # this will be executed in a separate thread print(&quot;Be kind : ) &quot;) def fun_2(): threading.Timer(2.0, fun_1).s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React fetch stops working after page refresh<p>I am fetching a single object. When the page loads for the first time the fetched elements does render to the ...
<p>Thats because for first time render there is no product yet , and after fetching and rerender component it is available , so in first render you have no access to object and it throw error</p> <p>you can do <code>{products?.product?.name}</code></p> <p>Or You can also write your code like</p> <pre><code>import { use...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Keycloak error: client_not_found reason: cannot_match_source_hash<p>Trying to configure AWS OpenSearch with Keycloak with SAML2. I got XML SAML metadata fro...
<p>Change entityID (clientId) in keycloak same as &quot;Service provider entity ID&quot; of AWS.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Altair: How to make scatter plot aligned with image background created by mark_image?<p>I'm looking for a working example to have a .png picture as the backg...
<p>Yes, if you change the values of x and y in your image plot to something like y=-200 and x=200, the image should be more centered in the scatter plot.</p> <p>You can also change the anchor point of the image using <code>align</code> and <code>baseline</code>:</p> <pre class="lang-py prettyprint-override"><code>impor...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: install4j "Request privileges" not working as expected on macOS<p>We ran into a problem when trying to install Homebrew on macOS using a Custom Action in our...
<p>The elevated helper process in install4j runs as root. It looks like Homebrew does not want to run as root. You would have to wrap the sudo calls in the installer into a graphical sudo like described here:</p> <p><a href="https://stackoverflow.com/a/3034671/936832">https://stackoverflow.com/a/3034671/936832</a></p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error creating bean with name 'cvpSpringBootApplication': Bean instantiation via constructor failed by Maven install<p>I want to run a Maven install, but I g...
<p>I solved the problem by adding the following plugin including configuration to the pom.xml.</p> <pre><code> &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt; &lt;version&gt;2.19.1&lt;/version&gt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How could I create a two color background for my app, I'm not trying to make a gradient, so far that's all the solutions I've been seeing<p>Screenshot of a m...
<p>Play with this widget and follow <a href="https://docs.flutter.dev/development/ui/layout" rel="nofollow noreferrer">flutter.dev/development/ui/layout</a></p> <pre class="lang-dart prettyprint-override"><code>void main() =&gt; runApp(const MyApp()); class MyApp extends StatelessWidget { const MyApp({Key? key}) : s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: 'Specified repository is not supported for current operating system' error<p>I am trying to install a Percona cluster on a VM following <a href="https://www....
<p>There is not yet a PXC for Ubuntu 22.04. PXC is based on Percona Server, Percona Server is based on Oracle MySQL Community. MySQL Community is not yet available from Oracle for Ubuntu 22.04. PXC will not likely be available for Ubuntu 22.04 until 8.0.30 at the earliest.</p> <p>-- George O. Lorch III Director of S...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Finding Min-Max<p><strong>Issue</strong> Not able to get Min-Max of parts using formulas, shows wrong value</p> <p><strong>What I did</strong></p> <p>Here is...
<p>In Office 365:</p> <pre><code>=MAXIFS(TAT!C:C,TAT!A:A,A2)&amp; &quot;/&quot; &amp;MINIFS(TAT!C:C,TAT!A:A,A2) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JOIN performance: affected by primary key choice or column order?<p>I have a table <code>labor</code> with 20 columns and 30 millions rows. One column <code>...
<p>The order of columns in the table makes no measurable difference.</p> <p>The choice of primary key <em>does</em> make a difference in InnoDB. That storage engine uses a table's primary key as a so-called <em><a href="https://dev.mysql.com/doc/refman/8.0/en/innodb-index-types.html" rel="nofollow noreferrer">clustered...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PHP - Resort Array with a Key array<p>Good day,</p> <p>So I have the following array to start with that has items added to it. The order the items are added ...
<p>If I understood correctly your problem, here's a possible solution:</p> <pre class="lang-php prettyprint-override"><code>$firstArray = [ [ 'tid' =&gt; 'value_5' ], [ 'tid' =&gt; 'value_4' ], [ 'tid' =&gt; 'value_3' ], [ 'tid' =&gt; 'value_2' ], [ 'tid' =&gt; 'value_1' ], ]; $tidToAdd = [ 'value_...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to reduce plot (image) size for `exams2pdf` output?<p>When I reduce the size of the image in the <a href="http://www.r-exams.org/assets/posts/2017-08-14-...
<p><strong>TL;DR</strong></p> <p>With your settings you control the size of the graphics file that is created. But the default LaTeX template includes all graphics with 80% of the text width. Thus, no matter how large the actual graphics file is (.pdf, .png, ...) it is always embedded in LaTeX/PDF with 80% width.</p> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating multiple QThreads and perform action AFTER all QThreads are closed<p>here I have a simple GUI. With the creation of this GUI I am starting a thread ...
<p>As @musicamante suggested I got the desired result using the isFinished() method.</p> <p>Here is how I made it:</p> <pre><code># Waits for all threads to finnish. Breaks out of the loop afterwards while True: for thread in self.thread.values(): if not thread.isFinished(): brea...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Difference(s) between getStaticPaths + getStaticProps and useRouter in NextJS?<p>I'm learning NextJS and currently <strong>I don't understand the differences...
<p>The difference is when your code runs. The functions <code>getStaticPaths</code> and <code>getStaticProps</code> runs on <em>compile time</em>, i.e. when you run the command <code>next build</code>. This generates the HTML once, and no JS runs when someone visits your site to look at a book. The page will look the s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to disable reference highlighting in Visual Studio 2022<p>The problem is displayed in this image.</p> <p><a href="https://i.stack.imgur.com/sy1xB.png" re...
<p>There doesn't seem to be a setting that turns it off for all languages, however if you change the RBG values to 30 for all three (if you are using the default dark theme in Visual Studio), you can essentially achieve this, since the highlighting will be the same exact color as the background, thus hiding it. To cha...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ChocoSolver - Find the minimal number of path to visit all cities<p>I am using Choco Solver 4.10.8 in Java for a constraint programming problem. The goal is ...
<p>Actually, you don't need to declare the city_by_path variables as new ones. Indeed, either the path is used and its cities are visited, either the path is not used and all cities will be valued to zero in the matrix (which is always true for cities not in the path).</p> <p>To make it work, you can declare your matri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Manipulate CSV file using groovy and java<p>Newbie here with a question. I have the following .csv file as an example:</p> <pre><code>10;06.07.2022;This is t...
<p>Given the input file <code>projects/test.csv</code> containing these lines:</p> <pre><code>10;06.07.2022;This is test; 08;01.07.2020;This is test; 15;06.07.2021;This is test; 09;06.07.2021;This is test; </code></pre> <p>The following Groovy script:</p> <pre><code>import java.time.format.DateTimeFormatter import java...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Time Complexity of Subsets problem solution<p>I would like to verify the space and time complexity of my solution to <a href="https://leetcode.com/problems/s...
<p>I figured out why it's 2^N times N.</p> <p>For <code>subsetsHelper()</code>, at <code>i</code>th level, the number of subsets is <code>2^(i-1)</code>. And the size of each subsetList in it is <code>O(N)</code>. As I double the size of each sub subsetList (from <code>list</code> to <code>listCopy</code> in code) in ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to return a NamedFile in a HttpResponse using Actix-web<p>I try to return a NamedFile in a HttpRespose with this function</p> <pre><code>fn response(x: N...
<p>i solved it by introducing a new function that converts the content of the file into a single string</p> <pre><code>fn open(x: PathBuf) -&gt; String{ return fs::read_to_string(x) .expect(&quot;Something went wrong&quot;); } </code></pre> <p>and used instead of NamedFile a String the function looks like t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Strange behaviour on text color in jetpack compose<p>Hey I am new in jetpack compose. I tried to set window background color black and white according to the...
<p>When you use <code>MaterialTheme.colorScheme.background</code> it works correctly because in that case the <code>Surface</code> composable is able to determine the correct content color (that would be the <code>contentColor</code> parameter) based on the background color which you set (which is the <code>color</code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MongoDB adding ObjectId to array of IDs<p><a href="https://i.stack.imgur.com/9nFsO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9nFsO.p...
<p>You are pushing key-value pair into the array.</p> <pre><code>ObjectId: ('61f942b737bdc10018722539') </code></pre> <p>Instead, it should be:</p> <pre><code>ObjectId('61f942b737bdc10018722539') </code></pre> <pre><code>db.poems.updateOne( { title: &quot;My stillness&quot; }, { $push: { communities: ObjectId('61f9...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Passing Context information to task in DataBricks Workflows<p>I need in my task the scheduling date of the job run to run queries based on a timestamp. Is th...
<p>I guess that you are asking this because your job has several tasks. If that's the case, you can use <a href="https://docs.databricks.com/dev-tools/databricks-utils.html#taskvalues-subutility-dbutilsjobstaskvalues" rel="nofollow noreferrer">Dbutils.jobs.taskvalues</a> for doing so, in the first task of your job, you...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Azure - Update service principal scope<p>I've created a App and added a resource group. How can I update service principal and add a second resource group? ...
<p>To add an additional resource group you can do this:</p> <pre><code>az ad sp create-for-rbac -n &quot;MyApp&quot; --role Contributor --scopes /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup1} /subscriptions/{subscriptionId}/resourceGroups/{resourceGroup2} </code></pre> <p><strong>Scope</strong> is the ...