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: Appending filename at the end of certain lines in a text file<p>I am trying to append a file name at the end of certain lines in many files which I am concat...
<p>with bash and sed I'd propose:</p> <pre><code>for i in ./*/*contigs.fasta; do n=$(basename -s _contigs.fasta &quot;$i&quot;) sed &quot;s/^\(&gt;NODE.*\)/\1-$n/&quot; &quot;$i&quot; done </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Need help Configuring a test event for an aws Lambda function<p>I want to update this Lambda function to python3.9 from 3.6. I want to create a test event to...
<p>I would recommend that you look at recent CloudWatch Logs for this Lambda function. The code is logging the received event (which can be one of 2 types: Create and Update). Try to find a log for each event type. Then fabricate some test events from those logs.</p> <p>And don't rely on Lambda function test events bec...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Page Model Bool always returns false<p>I'm working on a razor pages project and I'm having an issue changing the value of my page model when clicking a butto...
<p>Try to use <code>@Model.IsCreatingCompany.ToString()</code> to replace <code>@Model.IsCreatingCompany</code>,so that the data passed to handler will be correct,here is a demo:</p> <p>cshtml:</p> <pre><code>&lt;div class=&quot;col-6 text-end&quot;&gt; &lt;form asp-page-handler=&quot;ToggleCreateCompan...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ExchangeImpersonation SOAP header must be present for this type of OAuth token in Python<p>Recently Microsoft has withdrawn the basic authentication service ...
<p>When your using the client_credentials flow you need to use impersonation in EWS eg change</p> <pre><code>access_type=DELEGATE </code></pre> <p>to</p> <pre><code>access_type=IMPERSONATION </code></pre> <p>You also need to make sure you Application registration has the full_access_as_app permission and its consented ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ReactJS - Uncaught TypeError: Cannot set property default of #<Object> which has only a getter<p><a href="https://i.stack.imgur.com/D6IA2.png" rel="nofollow ...
<p>Try to change the <code>className</code> of the <code>img</code> container to:</p> <pre><code>&lt;div className={classes['main-image']}&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make one button visible when another is clicked in Flutter/Dart?<p>I know how to make elements visible or invisible using the Visibility widget. Here ...
<p>Provide you the whole code, check this out::</p> <pre><code>import 'package:flutter/material.dart'; void main() { runApp(const MyApp()); } class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) {...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extract DB name and table name from snowflake query using snowsql<pre><code>Insert into D.d Select * from A.a join B.b on A.a.a1=B.b.b1 Join C.c on C.c.c1=B...
<p>You can use the SQLPARSE to parse the statement. I am providing a code below which is not optimally and efficiently written, but it has the logic to get the information</p> <pre><code>import sqlparse raw = 'Insert into D.d ' \ 'Select * from A.a join B.b on ' \ 'A.a.a1=B.b.b1 Join C.c on C.c.c1=B.b.b1;'...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how do I perform the following operation in python dataframe<p>below are my two dfs</p> <pre><code>df = pd.DataFrame(np.random.randint(1,10,(5,3)),columns=['...
<p>This is probably not the cleanest way, but it works.</p> <pre><code> df['a'] = dd['a'] df['a'] = df['a'].fillna(0) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: F#: Remove an event that was added in code I don't control<p>I'm working with F# and ScottPlot, and I need to replace ScottPlot's built-in right click event ...
<p>In the end, basically what <a href="https://stackoverflow.com/users/2088029/mrd-at-kookerellaltd">MrD at KookerellaLtd</a> suggested, I created the plot in a C# project, removed the event handler, and returned the modified plot to the F# code. Thanks for your suggestions, but this ended up being the cleanest, especi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R Shiny App Datetime Range Input rather than only Date<p>I'm working on building a Shiny App for work and currently have it up and running using a <code>date...
<p>I've just done a package for you :-)</p> <pre><code>remotes::install_github(&quot;stla/DateTimeRangePicker&quot;) </code></pre> <p>The following example is included in the doc.</p> <pre class="lang-r prettyprint-override"><code>library(DateTimeRangePicker) library(shiny) ui &lt;- fluidPage( br(), sidebarLayout(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the best way to check a url is valid every second (or less), with Task await or ContinueWith in a C# Window Forms Application (.NET)<p>I'm new to C# ...
<p>This answer will focus on the Task timer loop to answer the specific part of your question &quot;<strong>check a url is valid every second</strong>&quot;. There are lots of answers about how to perform the actual Ping (like <a href="https://stackoverflow.com/q/7523741/5438626">How do you check if a website is online...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Need help mapping values in a 9x9 array divided into 3x3 sections<p>I have a 9x9 main array filled with integer values and I want to divide this main array i...
<p>Solution by @MichaelButscher, section id:</p> <pre><code>section_id = (j // 3) * 3 + (i // 3) </code></pre> <p>And for the subarrays:</p> <pre><code>(i, j) in main array is (i % 3, j % 3) in subarray </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to hide tooltip for certain bars in chart.js<p>I am making a stacked bar that looks like the following:</p> <p><a href="https://i.stack.imgur.com/Vbwbl.p...
<p>I figured out how to get this to work. I hid the labels based on the background-color of a bar.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get a certain element from a body?<p>I use node-fetch , and I get the body of the site this way:</p> <pre class="lang-js prettyprint-override"><code>i...
<p>You can use <a href="https://cheerio.js.org/" rel="nofollow noreferrer">cheerio.js</a>. It is an implementation of jQuery for node.</p> <p>The below code selects an <code>h2</code> and changes its text to <code>Hello World</code>.</p> <pre><code>const cheerio = require('cheerio'); const $ = cheerio.load(body); $('h...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandoc Lua : how to add a markdown block around a header without losing the markdown syntax #<p>I am trying to add a div around a markdown header in a Lua fi...
<p>The <code>content</code> field contains the heading text, but the heading itself is the <code>el</code> element that's not returned. Returning it together with the raw blocks should work though:</p> <pre class="lang-lua prettyprint-override"><code>return { pre, el, post } </code></pre> <p>Or use a Div element:</p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: trigger to delete child if parent deleted MySQL<p>hello fellows im having isues with this code, im using mysql workbench</p> <p>I have this schema with 2 tab...
<p>I agree with the comment above about using a cascading foreign key. But if you don't use foreign keys (many people do not) or don't use a storage engine that supports foreign keys, this isn't an option.</p> <p>If you want to reference the <code>id</code> column of the row being deleted in a trigger, use <code>OLD.id...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In MySQL, when ordering by more than one conditions, how do I treat "false" the same way as "null"?<p>I have a <code>select</code> statement where I want to ...
<p>Just use an expression:</p> <pre><code>order by coalesce(some_table.boolean_column,0) desc, ... </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to upload HTML files to Apache Webserver running on Docker<p>I am starting out with Apache webservices. I am running it on Docker with the httpd image, a...
<p>Use <code>docker cp</code><br /> <code>docker cp ./index.html container:/var/www/html/index.html</code><br /> Adapt paths to your needs; to obtain container name, run <code>docker ps</code> . If your container is named apache2, then full command will be:<br /> <code>docker cp ./index.html apache2:/var/www/html/index...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Single quotes cause LiveView template processing error<p>I want to use the following Tainwind classes in my Phoenix LiveView template:</p> <pre><code>&lt;div...
<p>This problem can be worked around by using a sigil instead of the usual binary string:</p> <pre><code>&lt;div class={~s&quot;before:content-['Not_Hovering'] hover:before:content-['Hovering']&quot;}&gt; &lt;!-- ... --&gt; &lt;/div&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to execute "git reset --hard" in libgit2sharp<p>Libgit2sharp has a lot of potential, but some things that are very simple in regular git are an abolute m...
<p>The following code replicates the regular command-line <code>git reset --hard</code> as closely as possible. It dynamically looks up the tracked upstream branch for which we want to reset and then finds the &quot;base&quot; commit at which the two branches diverge and then resets to that.</p> <p>Took me a couple of ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ethers.js Contract call works from Brave browser but fails from Metamask Goerli Testnet<p>Contract - 0xaB9d2D124E70Be7039d7CCba9AFd06AdC1Bc60C0 All the faile...
<p>There is no contract on the <code>0xaB9d2D...</code> address on the Ethereum mainnet (<a href="https://etherscan.io/address/0xaB9d2D124E70Be7039d7CCba9AFd06AdC1Bc60C0" rel="nofollow noreferrer">Etherscan link</a>). So when you send it a transaction on the mainnet, it's a simple transfer between two end user addresse...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JavaScript reduce array of objects based on value<p>I am currently trying to use reduce to merge objects together when objects contain the a specific value a...
<p>you can do this</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>const groupByKey = (data, key) =&gt; Object.values( data.reduce((res, item) =&gt; { const value = item[k...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Linear layout split half to screen<p>I am using the adapter to show data to the screen and I am using a grid layout.</p> <blockquote> <p>The single grid cons...
<p>Try this</p> <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;LinearLayout xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot; xmlns:app=&quot;http://schemas.android.com/apk/res-auto&quot; xmlns:tools=&quot;http://schemas.android.com/tools&quot; android:lay...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Seperate multihead-columns dataframe in pandas<p>Please help divide this multi-frame pandas into separates, that's code</p> <pre><code>import datetime as dt ...
<h2><a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.xs.html" rel="nofollow noreferrer"><code>DataFrame.xs</code></a></h2> <pre><code>df1 = df.xs('1.HK', level=1, axis=1) df2 = df.xs('2.HK', level=1, axis=1) </code></pre> <p>Or if you have multiple stocks then you can use a dictionary to store the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use Firebase uid in firestore (Vue)<p>I'm using firestore, and I want to use a user's <code>uid</code> in the query, like this:</p> <pre class="lang-js prett...
<p>The issue is with the vuefire binding:</p> <p><a href="https://vuefire.vuejs.org/vuefire/binding-subscriptions.html#programmatic-binding" rel="nofollow noreferrer">https://vuefire.vuejs.org/vuefire/binding-subscriptions.html#programmatic-binding</a></p> <blockquote> <p>If you need to change the bound reference while...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pygame how to record keyboard movement while playing the game<p>So im trying to make tetris that also records players movement and then plays it back, think ...
<p>I've created an example that can record and then replay events with roughly the same time between events.</p> <p>When the left mouse button is pressed, recording is enabled and <code>KEYDOWN</code> events are appended to a list, along with the time they occurred. Left-clicking again disables recording. Right-clickin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Amazon Aurora PostgreSQL instance creation using CDK in python<p>I want to create Aurora PostgreSQL cluster and DB instance using CDK in python. I have gone...
<p>After spending some time I figured out the issue. Following are the details:</p> <p>Actually code was perfect if I execute DB cluster and DB instance separately but when I execute the whole code then system was trying to crate the DB instance before creating the DB cluster. And because of that system showing error.<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can i specify multiple intervals using BETWEEN and IN clause in the same query?<p>I am querying some time-series data and would like to apply a query to mult...
<p>The <code>t</code> CTE is a mimic of the list of intervals.</p> <pre class="lang-sql prettyprint-override"><code>with t (id, time_start, time_stop) as ( values ('interval-A', '2022-05-26T10:00'::timestamp, '2022-05-26T12:00'::timestamp), ('interval-B', '2022-05-26T13:00', '2022-05-26T17:00') ) select t.id, count(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to plot data over OpenStreetMap (Python)<p>Thank you in advance for all your answers.</p> <p>I am trying to plot a dataframe over an interactive map (Ope...
<p>The issue is likely the structure of your DataFrame. It appears that &quot;no data&quot; areas are getting mapped to zero or something similar, and the DF including a record for every point on the map - including the null / zero data bits you're not interested in plotting. Try filtering out the records with zero dat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to track BluetoothAdapter state changes dynamically in Jetpack Compose?<p>In my app, I would like to know if a user enables/disables Bluetooth using the ...
<p>I was able to solve this just by using <code>mutableStateOf</code>. It doesn't have to be initialized inside of a <code>@Composable</code> function to be reactive, which is what I misunderstood in the first place.</p> <ol> <li>Define a <code>mutableStateOf</code> value and a <code>BroadcastReceiver</code> that will ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using consistent RNG with OpenMP<p>So I have a function, let's call it <code>dostuff()</code> in which it's beneficial for my application to sometimes parall...
<ol> <li><p>First of all you have to make sure that both <code>function_that_accesses_rand</code> and <code>do_stuff</code> are threadsafe.</p> </li> <li><p>You do not have to duplicate your code if you use the <code>if</code> clause: <code>#pragma omp parallel for if(!parallelize_within)</code></p> </li> <li><p>To mak...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why are my list items not being displayed on listView (Android)<p>I have created one listview where I want to retrieve the items from sqlite database. So I h...
<blockquote> <p>But When I open that activity It doesn't displayed any records. I have debug the code but can't any exception. I have written wrong query?</p> </blockquote> <p><strong>probably</strong> as it appears that you are very likely comparing the anecdotal <em>oranges and apples</em> (see explanation/example) t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I tried to set enum field by reflection<pre><code>enum class Command(private vararg val commands: String) { @FieldEnrich(&quot;changeLanguages&quot;, &quo...
<p>It works for <code>CreatingCarStep</code> because its enum constants have a non-empty body. This forces the kotlin compiler to create subclasses of the enum class for each of the enum constants. Additionally, the annotations on the enum constant will be put on the generated subclass. Therefore, <code>enum::class.ja...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Microsoft Azure functions (nodejs), WEBSITE_MAX_DYNAMIC_APPLICATION_SCALE_OUT and maxConcurrentCalls not doing what they say<p>Using consumption plan. I crea...
<p>Yes @Teebu, &quot;<code>prefetchCount</code>&quot;:1 is the culprit.</p> <hr /> <p><strong>Example</strong>:</p> <p>If <code>prefetchCount</code> is set to 200, <code>maxConcurrentCalls</code> is set to 16 (assume), then 200 messages will be prefetched to a specific instance, but only 16 messages processed at a time...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: A comparison bar between two values - React<p>I have a UI component that I need to build but I have no idea how to go about it.</p> <p><a href="https://i.sta...
<p>maybe you will have API where you get these datas, in there must be percentage of how much it is so build like that what I build in HTML and in <code>first-progress</code>and <code>second-progress</code> tags style width as what you get in response</p> <pre class="lang-js prettyprint-override"><code>style={{width: `...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: VS16 doesn't expand CMake generator expressions<p>I'm using CMake for generating cross-platform build configuration. And for project to work I need to copy a...
<p>This ought to work:</p> <pre><code>cmake_minimum_required(VERSION 3.18) project(test) add_executable(bar foobar.cpp) list(APPEND DBG_LIBRARIES &quot;lib1&quot; &quot;lib2&quot;) list(APPEND REL_LIBRARIES &quot;lib1&quot; &quot;lib2&quot;) add_custom_command( TARGET bar POST_BUILD COMMAND &quot;${CMAKE_COMMAND...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: HTMX websockets extension doesn't connect to Django channels<p>I try to connect a Django channels Consumer to a HTMX <code>ext-ws</code> element, but I can't...
<p>As per docs you need to also include <code>hx-swap-oob=&quot;true&quot;</code> attribute into the html that you send back from websocket:</p> <p>See example from htmx GH: <a href="https://github.com/bigskysoftware/htmx/blob/master/test/servers/ws/server.go#L24" rel="nofollow noreferrer">https://github.com/bigskysoft...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can we Use Generic Variable to Make an import with TypeScript<p>I searched a lot,for a solution to create a basic generic component. For this i need to pass ...
<p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import" rel="nofollow noreferrer">Static import</a> statements cannot be used to resolve a dynamic specifier. From the linked documentation:</p> <blockquote> <p>Only single quoted and double quoted Strings are allowed.</p> </blockq...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Vite error during the deployment to heroku<p>My folder structure:</p> <p><a href="https://i.stack.imgur.com/GwiDK.png" rel="nofollow noreferrer"><img src="ht...
<p>This is likely caused by one of two issues:</p> <ul> <li>Heroku is pruning devDependencies from production app</li> <li>Heroku was caching the node_modules from previous build</li> </ul> <hr /> <p>In order create a smaller slug size for apps, the Heroku's buildpack will prune out the devDependencies from the package...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: .NET MailMessage DeliveryNotificationOptions stop working when adding a CC<p>I recently added a CC to a .NET MailMessage. As soon as I did that the read retu...
<p>Figured it out - added</p> <pre><code>Msg.Headers.Add(&quot;Return-Receipt-To&quot;, From) Msg.Headers.Add(&quot;Disposition-Notification-To&quot;, From) </code></pre> <p>Something must have changed recently with</p> <pre><code> Msg.DeliveryNotificationOptions = DeliveryNotificationOptions.OnSuccess </code></pre> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to generate an Excel with Slicers with Python? And with the XlsxWriter library?<p>I would like to be able to incorporate Slicers (access butto...
<p>No. That feature isn't supported by XlsxWriter and, due to the relative complexity, it probably won't be in the future.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Collections.sort() doesn't work. Problem with implementing the Comparable<> interface<p>Does someone have an idea why this code doesn't sort the employees pr...
<p>The problem is with your <code>compareTo</code> function. Both 4.2 and 4.0 are just 4s as integers, so your program doesn't swap them.</p> <p>You need to compare doubles. I think, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html#compare-double-double-" rel="nofollow noreferrer">this one</a> w...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter - Refresh widget with button press<p>I have an app that pulls quotes from an api and displays it.</p> <p>I am struggling to get my refresh button to ...
<p>Reset <code>future</code> using <code>setState</code>.</p> <pre><code>Future&lt;Quote&gt; quote; ... IconButton( ... onPressed: () { setState(() { quote = fetchQuote(); }); }, ) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to deadletter a message in AzureFunction ServiceBusTrigger<p>I'm trying to deadletter a message but can't seems to find the right library:</p> <pre><code...
<p>To perform message settlement tasks, you'll want to bind to <code>ServiceBusMessageActions</code>. This will give you access to operations such as dead lettering, completion, and abandonment.</p> <p>For example:</p> <pre class="lang-cs prettyprint-override"><code>[FunctionName(&quot;BindingToMessageActions&quot;)] ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unity 2D OnTriggerEnter2D() will not repeat in an entirely different script<p>I am creating a game where there are 9 chunks in 1 2D map and you must &quot;un...
<p>I don't have enough reputation yet to comment, so I'll propose a few possible problems/solutions. I assume your chunks are scenes, so you're loading in several scenes at once? Some things I can think of that might be causing the second chunk not to load in:</p> <ul> <li>Did you add the scene to the build? If not, yo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# process task manager kill running file<p>I try to open file using process in C#, but after that file end work.</p> <p>It is not end from task manager.</p>...
<p>When you done working with the Process class, you should dispose of it. To dispose of the type directly, call its Dispose method in a try/finally block. To dispose of it indirectly, use a language construct such as using</p> <p>Here is example with <strong>using</strong></p> <pre><code>using(Process cmd = new Proces...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: c++11 - zero-initi of members insted of default-init<p>In the below code, I expect members of <code>a</code> being inited with gargabe as they are not mentio...
<p>The <code>i</code> and <code>j</code> fields that you are accessing are, indeed, uninitialized. However, you are smearing the wrong part of the stack. It just so happens that on most OSes, the stack is initially all zeros. It even used to be common in C (long ago) to assume that automatic variables in <code>main<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: using a generic type to accept two different types of items as a parameter<p>this should be a simple use case, but I can't seem to fine an example that cover...
<p>The problem is that your function doesn't know anything about <code>MyGenericType</code>. To let it know that this type will always have certain properties, you will need to add a constraint. In this case, it looks like you need your generic type to be one of two specific types, so you could tell your generic functi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pivot wider with merging rows in R<p>I have the data like this:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>id</th> <th>grou...
<p>Two-step:</p> <pre class="lang-r prettyprint-override"><code>tidyr::pivot_longer(dat, -c(id, group)) %&gt;% tidyr::pivot_wider(id, names_from=c(&quot;group&quot;, &quot;name&quot;), names_glue=&quot;{name}_{group}&quot;, values_from=&quot;value&quot;) # # A tibble: 4 x 9 # id A_2 B_2 ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the use of “create essential data” in system update via hac in SAP HYBIRS?<p>While system update from hac, we have three options</p> <ol> <li>Update ...
<p>A couple of links related to what essential data is:</p> <ul> <li><a href="https://help.sap.com/docs/SAP_COMMERCE/4c33bf189ab9409e84e589295c36d96e/8ad2f0a7866910149c31803942c91149.html?locale=en-US" rel="nofollow noreferrer">https://help.sap.com/docs/SAP_COMMERCE/4c33bf189ab9409e84e589295c36d96e/8ad2f0a7866910149c31...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: HTML buttons are not aligned in center. either it moving to left side or right side<pre><code>&lt;div class=&quot;col-lg-3&quot;&gt; &lt;div class=&q...
<p>As suggested by <a href="https://stackoverflow.com/users/14335091/officer-erik-k">@Officer Erik K</a>, you can archive this using bootstrap 3 classes <code>text-center</code>, <code>pull-left</code> and <code>pull-right</code> :</p> <p><div class="snippet" data-lang="js" data-hide="true" data-console="true" data-bab...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Understanding model training and evaluation in Pytorch<p>I am following a Pytorch code on deep learning. Where I saw model evaluation taking place within the...
<ol> <li><p>For each epoch, you are doing train, followed by validation/test. For validation/test you are moving the model to evaluation model using <code>model.eval()</code> and then doing forward propagation with <code>torch.no_grad()</code> which is correct. Again, you are moving back the model back to train model u...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I need help trying to add color to div when there is no content yet in it. Javascript adds the content as much as the user needs<p>I am trying to make a flas...
<p>Thanks, Niall, you got me thinking, All I needed to use was min-hieight in #bottomOfPage. I set mine to 800px and it looks good. I have to transfer this idea to my full project.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I evaluate the Kaplan Meier estimator at specific time points?<p>I have a Kaplan Meier object from the R package <code>survival</code>. I can plot it...
<p>Use <code>summary()</code> with the <code>times</code> argument:</p> <pre class="lang-r prettyprint-override"><code>library(survival) KM &lt;- survfit(Surv(time, status) ~ 1,data = lung) summary(KM, times = seq(0, 5) * 90) #&gt; Call: survfit(formula = Surv(time, status) ~ 1, data = lung) #&gt; #&gt; time n.risk ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: icon gets cut off by border<p>So basically I am trying to fit my active icon(star) in a progress bar but it seems to get cut off by the border. I'm not exact...
<p>Background sizing seems to do the job. To maintain size, increase it on the active class. I've used some negative margin wizbang to shift position. You could also increase the size of <em>all</em> bullets and put some padding on the regular ones to shrink them.</p> <p><div class="snippet" data-lang="js" data-hide="f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Local NuGet source doesnt exist when building for Docker<p>I have 2 NuGet sources which are only simple local folders where im testing some Nuget Deployment....
<p>I ran into the same problems trying various methods to overcome to no vail.<br> There are two main issues :</p> <ol> <li><p>When you run a dockerfile, it runs in a context. <br>The context is the folder the command ran from, in VS case its one folder above the .csproj, <br>and (for security reasons apparently) you c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to access group keys during aggregation in pandas groupby?<p>Is there a way to access the group keys from inside the aggregation functions? For example w...
<p>Use:</p> <pre><code>df1 = df.groupby('score').agg(score_age = ('age', lambda x: x.name + x.sum())) print (df1) score_age score 2 42 3 48 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React-Bootstrap "Option was not found"<p>Trying to add a dropdown menu in a signup form.</p> <pre><code>import React from 'react'; import { Form, Option } fr...
<p>'Option' with a capital 'O' is used in React-Native but not in ReactJS. Need to use lowercase 'o' for 'option' to get dropdown to work.</p> <pre><code> &lt;Form.Select aria-label='TeamSelect'&gt; &lt;option&gt;Select your team&lt;/Option&gt; &lt;option value='1'&gt;Team One&lt;/Opt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Query Across Join Exclusively<p>I am trying to write a query to determine who, in my company, has roles that I specify, and no others.</p> <p>The tables are ...
<p>If I understood your requirements:</p> <pre><code>select U.Username from User U join UserRole UR on U.UserID = UR.UserID join Role R on UR.RoleID = R.RoleID where R.RoleName in ('Role1', 'Role2', 'Role3') GROUP BY U.Username HAVING COUNT(R.RoleName)=3 </code></pre> <p>The above is untested but should give you enou...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Are unit tests only manually executed or auto executed when building out a project?<p>I have a few questions when it comes to unit testing using Jest in Reac...
<ol> <li><p>Your tests are not executed when you build your project. If you are using a CICD platform, it may run <code>npm</code> commands to build your project and then run the tests after the build has successfully completed. However you may need to configure this yourself as building and testing are done exclusivel...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Azure - Run bicep from registry via ARM REST api<p>I'm looking into publishing bicep templates to a Bicep registry (ACR), and then deploying them via the ARM...
<p>Currently Content in the Bicep module registry can only be deployed from another Bicep file. Template specs can be deployed directly from the API, Azure PowerShell, Azure CLI, and the Azure portal. You can even use UiFormDefinition to customize the portal deployment experience.</p> <p>You can refer to this <a href="...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ModuleNotFoundError: No module named 'tensorflow.contrib' with jupyter notebook<p>So this is my error [ModuleNotFoundError: No module named 'tensorflow.contr...
<p>tensorflow.contrib is being removed in version 2.0, you therefore need version &lt;= 1.14 to operate tflearn.</p> <p>In the command line (not the notebook), <code>conda install tensorflow=1.14</code> (or tensorflow-gpu=1.14 if you want GPU support ; or pip install rather than conda install depending on what you are ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I teach Jackson to source the same field from two disjunctive JSON objects?<p>I have the case where I have some existing data which is present in mult...
<p>You can use <code>@JsonAlias</code> like this:</p> <pre class="lang-java prettyprint-override"><code>@Getter @NoArgsConstructor @AllArgsConstructor public class Item { @JsonAlias(&quot;someItemId&quot;) private UUID itemId; } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to resolve dead simple configuration dependency<p>I am trying to set up dependency injection in a small blazor-based web app.</p> <p>My current code i...
<p>By default, a call to <code>services.Configure</code> will only allow injecting an <code>IOption&lt;BigQuerySettings&gt;</code> into your consumers.</p> <p>If, however, you wish to inject <code>BigQuerySettings</code> directly into your consumer (which I would argue <a href="https://docs.simpleinjector.org/en/latest...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Instagram Multiprocessing with Selenium<p>Hey all trust that you're well, I'm trying to run multiple Instagram accounts parallel using <strong>Multiprocessin...
<p>This script uses <code>threading</code> (instead of <code>multiprocessing</code>) to open multiple independent windows (instances) of the browser. The code contained in the function <code>test_instance</code> is run simultaneously in each window.</p> <pre><code>import time from selenium import webdriver import threa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you call non-write functions from a module without needing to pay gas, using pact-lang-api?<p>I have a few simple functions that get data from the blo...
<p>You can just call the <code>local</code> API via HTTP request.</p> <p>I.e.</p> <pre><code>localRes = await fetch( `${networkUrl}/api/v1/local`, { headers: { &quot;Content-Type&quot;: &quot;application/json&quot;, }, method: &quot;POST&quot;, body: JSON.stringify(cmd), }; ); </code></pre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to print duplicate column one time while keeping other relevant information? MySQL<div class="s-table-container"> <table class="s-table"> <thead> <tr> <t...
<p>You can use aggregation over the &quot;<em>Books Written</em>&quot; field using MySQL <a href="https://dev.mysql.com/doc/refman/8.0/en/aggregate-functions.html#function_group-concat" rel="nofollow noreferrer"><code>GROUP_CONCAT</code></a> function as follows:</p> <pre><code>SELECT a.firstName ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dragging node makes a node selected/highlighted on vis.js<p>Dragging a network node in <code>vis.js</code> library highlights/selects that node, and when dra...
<p>This can be achieved with a combination of the <code>dragEnd</code> event and the <code>unselectAll</code> method, like:</p> <pre class="lang-js prettyprint-override"><code>network.on('dragEnd', function(){ network.unselectAll(); }); </code></pre> <p>A working snippet is below:</p> <p><div class="snippet" data-lan...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Split portion of string in bash<p>I have some very long text file ( &gt; 300-500 MB) and with thousands of lines, like:</p> <pre><code>blavbl [code] sdasdasd...
<p>Using sed:</p> <pre><code>sed '/^\[code\]$/,/^\[\/code\]$/!d;//d' </code></pre> <p>Using awk:</p> <pre><code>awk ' /^\[\/code\]$/ {--c} c /^\[code\]$/ {++c}' </code></pre> <p>Either of these methods require the tag patterns to alternate cleanly - no nested, repeated or unclosed tags.</p> <p>This prints all lines in...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: GCP HTTP Load Balancer open many ports<p>I found that many ports are opened in my HTTP Load Balancer IP address. But It should be only opened at 80, 443, and...
<p>There are two types of global Load balancers:</p> <ul> <li>Global HTTP(S) Load balancer - L7</li> <li>Global TCP/SSL proxy Load Balancer - L4</li> </ul> <p>Both load balancers use GFE Proxies to proxy client's traffic to the backend application. <a href="https://cloud.google.com/architecture/about-capacity-optimizat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: VSCode autocomplete/intellisense(?) in Jupyter Notebook when starting string literals keeps making me accidentally insert 'ArithmeticError' every time<p><a h...
<p>Figured it out.</p> <p>In VS Code settings, go to <strong>Extensions</strong> &gt; <strong>Jupyter</strong> &gt; <strong>Python Completion Trigger Characters</strong></p> <p>defaults were: <code>.%'&quot;</code></p> <p>So I deleted the single and double quotes, restarted, and voila, no more annoying popups.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AES CMAC generating wrong signature<p>I'm trying to generate AES-CMAC using cryptography library. And with message and key it is generating different output ...
<p>To derive the key <code>aeskey_for_CMAC</code>, <code>key</code> must not be hex <strong>en</strong>coded, but hex <strong>de</strong>coded and from the result the last 16 bytes are to be used as CMAC key:</p> <pre class="lang-py prettyprint-override"><code>aeskey_for_CMAC = binascii.unhexlify(key)[-16:] </code></pr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How we can link multiple authentication providers for phone and email in jetpack compose?<p>I have mail and mobile authentication in my register app, in fire...
<p>I solve the problem when I add <code>auth.currentUser?.linkWithCredential(credential)</code> line of the code in otpVerification function.</p> <pre><code>fun otpVerification(otp: String) { val credential = PhoneAuthProvider.getCredential(verificationOtp, otp) auth.currentUser?.linkWithCredential(c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Accessing button using ref<p>I'm not able to access the button using ref. Below is my code sample, In I keeping the undefined for completeSubmissionButton. I...
<p>You can't provide a ref to React component ,ref only work in a native html element so you need to pass your Button component into forwardRef fn</p> <pre><code> import {useRef , forwardRef} from 'react'; // your button component const Button = forwardRef((props,ref)=&gt;{ return ( &lt;button ref={ref}&gt;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replace comma to convert to numeric and introduce NA if there is character entry in r<p>I have a data frame DF in which few columns are having comma and char...
<p>You may try</p> <pre><code>library(dplyr) library(stringr) DF %&gt;% mutate(across(col1:col4, ~as.numeric(str_remove(.x, &quot;,&quot;)))) col1 col2 col3 col4 col5 1 1 33 67345 NA gb 2 45 33345 77 43 rt 3 30 87 90 23 dc 4 35 89 NA 55 ty </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot use @NotBlank<p>I just started working with spring and I'm trying to use @NotBlank. Problem is it is not working. In pom.xml I have this dependency:</...
<p>Add a dependency on <a href="https://search.maven.org/artifact/javax.validation/validation-api/2.0.1.Final/jar" rel="nofollow noreferrer">javax.validation:validation-api:2.0.1.Final</a>. That defines the validation API (i.e. the interface) but does not implement it. <a href="https://search.maven.org/artifact/org.sp...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Searching paths for ViewComponent in ASP.NET<p>In general if we use View(&quot;Index&quot;). It will search for views in Views/ControllerName or Views/Shared...
<p>Since it is a component, runtimes will search into components folder as stated below:</p> <ul> <li>/Views/{Controller Name}/Components/{View Component Name}/{View Name}</li> <li>/Views/Shared/Components/{View Component Name}/{View Name}</li> <li>/Pages/Shared/Components/{View Component Name}/{View Name}</li> </ul> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: WSL2 - Docker Compose volume mounting permission issue<p>I'm trying to build a local testing suite for a Python 3 application using Docker Compose. The appli...
<p>I found the issue in the end. Upon creation of the <code>application-default-credentials.json</code> file, the permission set was very limited, which did not allow read access by Docker.</p> <p>Once I edited the file's individual permissions (chmod 644), the application worked.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PHP mail successful with empty to parameter<p>I am learning PHP and from what I understand the <code>mail</code> function has a <code>to</code> parameter tha...
<p>The <code>mail()</code> function does not validate the input. It more or less just takes the data and hands it over to the system mailer daemon.</p> <p>If that handoff was successful, the method returns true.</p> <p>It it likely that your local mailer daemon will log an error that it couldn't process the email</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python - 10 evaluating lower than 2<p>I've added some troubleshooting code to try and figure out what's going on, but what keeps happening is when entering t...
<p><code>int(num)</code> converts <code>num</code> to an integer which is then discarded. You want <code>num = int(num)</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: light/dark mode in html, without CSS (only html)<p>it there a way to make the HTML elements be in dark mode</p> <p>if the user has activated in his system &q...
<p>add this CSS property <code>color-scheme: light dark;</code> to the <code>&lt;html&gt;</code> css selector <em>(is only one line of css)</em></p> <p>OR if you need <strong>only html</strong> you can use this <code>&lt;meta&gt;</code> tag</p> <pre class="lang-html prettyprint-override"><code>&lt;meta name = &qu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL server create how to create a new column based on previous row condition<p>I'm trying to create a new column, whose values are dependent to the previous ...
<p>Have you tried:</p> <pre class="lang-sql prettyprint-override"><code>select [Index], ID, AGE, SEX, HireMonth, CASE WHEN LAG(AGE, 1) OVER (ORDER BY [Index]) &gt; 25 AND LAG(HireMonth, 1) OVER (ORDER BY [Index]) &gt;= 9 THEN 1 ELSE ID END AS Tag FROM SOME_TABLE </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: If an app has multiple models with the same field, whats the best practice for keeping things DRY?<p>For example, if I have 3 models that look like this:</p>...
<p>Yes, you can define an <a href="https://docs.djangoproject.com/en/dev/topics/db/models/#abstract-base-classes" rel="nofollow noreferrer"><em>abstract base class</em> <sup>[Django-doc]</sup></a>:</p> <pre><code>class LeadId(models.Model): lead_id = models.BigIntegerField(&quot;Lead ID&quot;) class Meta: ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: making pvalue and fold change caculation more efficient<p>I have a dataframe that looks like this:</p> <pre><code> a a a b b b _____...
<p>If I understood correctly, you can vectorise it like this:</p> <pre><code>pvalues = pd.DataFrame() fcvalues = pd.DataFrame() qvalues = pd.DataFrame() a_data = data['a'].to_numpy() b_data = data['b'].to_numpy() # T test for each row pair. pvalue = stats.ttest_ind(a=a_data, b=b_data, axis=1)[1] pvalues['a vs b'] = ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to solve getit shared preferences error?<p>I'm trying bloctesting for my project and getting the following error:</p> <pre><code>'package:get_it/get_it_i...
<p>Okay so when you're doing blocTesting then you need to register your packages again in the setup function in it which is in the case you are using getit for dependency injection.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JSON_VALUE and path as variable in MySQL 8.x not working<p>I use Mysql 8.0 and trying to use JSON_VALUE to work with arrays in stored procedures</p> <pre><co...
<p><a href="https://dev.mysql.com/doc/refman/8.0/en/json-search-functions.html#function_json-value" rel="nofollow noreferrer">https://dev.mysql.com/doc/refman/8.0/en/json-search-functions.html#function_json-value</a> says:</p> <blockquote> <p><code>path</code> is a JSON path pointing to a location in the document. This...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I retrieve phone number of caller in Twilio Flex?<p>I am trying to retrieve caller phone number in the Flex plug-in. Using the caller phone number, I...
<p>Did you trying looking at the payload:</p> <p><code>payload.task.attributes</code> specifically:</p> <p><code>payload.task.attributes.from</code> ?</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error 'org.springframework.boot.autoconfigure.web.EmbeddedServletContainerAutoConfiguration$EmbeddedTomcat' in gRPC Spring Boot Client<p>I am getting below e...
<p>Need to have guava latest for resolving this. Working fine with the below.</p> <pre><code>&lt;dependency&gt; &lt;groupId&gt;com.google.guava&lt;/groupId&gt; &lt;artifactId&gt;guava&lt;/artifactId&gt; &lt;version&gt;23.6-jre&lt;/version&gt; &lt;/dependency&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to display a bar category on the axis when the value is 0<p>I have a dataframe column with the category of the corresponding row blood pressure systolic ...
<p>You can <a href="https://pandas.pydata.org/docs/reference/api/pandas.Series.reindex.html?highlight=reindex#pandas.Series.reindex" rel="nofollow noreferrer"><code>reindex</code></a> with a list of all possible categories:</p> <pre><code># your sample data s = pd.Series(index=['normal', 'stage1', 'elevated'], data=[37...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get github copilot suggestions only when requested<p>Is there any GH Copilot configuration setting for getting suggestions only when I request them? Like a s...
<p>You can disable inline suggestions with the <code>github.copilot.inlineSuggest.enable</code> setting, or with the <a href="https://docs.github.com/en/copilot/configuring-github-copilot/configuring-github-copilot-in-visual-studio-code" rel="nofollow noreferrer">Trigger Inline Suggesion</a> hotkey (<code>Alt</code> + ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RandomForestRegressor in Julia<p>I'm trying to train a <code>RandomForestRegressor</code> using <a href="https://github.com/JuliaAI/DecisionTree.jl" rel="nof...
<p>As stated <a href="https://github.com/JuliaAI/DecisionTree.jl/issues/190#issuecomment-1189600120" rel="nofollow noreferrer">here</a>, <a href="https://github.com/JuliaAI/DecisionTree.jl" rel="nofollow noreferrer"><code>DecisionTree.jl</code></a> doesn't support Multi-output RF yet. So I gave up on using <code>Decisi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Swapping elements in a list in Python<p>I am trying to swap the elements of list <code>A</code> i.e. <code>(i,j)</code> turns to <code>(j,-i)</code>. But the...
<p>What you have is a list of tuples, and tuples are immutable. What you're doing would not be described so much as &quot;swapping elements in a list&quot; as swapping the elements of a tuple (and negating the second one).</p> <p>If you have</p> <pre><code>a = (1, 1) </code></pre> <p>then you could perform this operat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I'm having a problem with the Tower of Hanoi using JavaScript<p>I'm trying to write a piece of code to create a method that prints a string with the correct ...
<p>Actually The problem has been resolved just by removing the console.log call at the last line (Thanks to the comments)</p> <pre><code> hanoi_steps = (numberOfDiscs) =&gt; { move(numberOfDiscs, 1, 2 , 3); } move = ( numberOfDiscs,start, intermediate, goal) =&gt; { if (numberOfDiscs &lt;= 0) { return; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set a multipartfile parameter as "not required" in java with spring boot?<p>my problem is that I have a controller developed in Java with Spring Boot ...
<p>Try <code>@RequestParam(required = false)</code> (no need for the name to be specified with the value param, because spring takes the variable name by default and in your case they're the same)</p> <p>You're method definition would look like this:</p> <pre class="lang-java prettyprint-override"><code>@PutMapping(&qu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pass ANY string as a in parameter to a stored procedure in mysql (dynamic)<p>I am experiencing some trouble when I pass date-like strings to a input paramete...
<p>OK, got it. Since I pass a string in TesterName I do need of course mark it between 'xxx' in this case. So it works by</p> <pre><code>set @t3=CONCAT(&quot;update localdevid.&quot;,TableName,&quot; set TesterID='&quot;,TesterName,&quot;' where SensorID=&quot;,DevID); </code></pre> <p>Same applies for the timestamp:</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does the variable array name at the end of the structure's definition means?<p>I've already read <a href="https://stackoverflow.com/questions/252780/why...
<p>It is a declaration of an array with 16 elements of the type <code>struct ppl_weight</code>. You could split this declaration</p> <pre><code>struct ppl_weight { uint16_t weight; uint8_t weightHour; } ppl_weightList[16]; </code></pre> <p>the following way</p> <pre><code>struct ppl_weight { uint16_t weigh...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The listener function is not registered in the functional components<p>Using <strong>Functional Component</strong>, I am trying to find the <strong>scroll po...
<p>If you want to listen on the current scroll position you would make use of the <code>onScroll</code> event attribute.</p> <p>I gave your scrolling <code>&lt;div&gt;</code> the <code>innerRef</code> and passed in <code>handleScroll</code> to your divs <code>onScroll</code>.</p> <pre><code> &lt;div className=&quot;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In multer file extension which shouldnt be saved getting saved<p>TASK OF CODE : The code telling multer to save file with pdf extension</p> <p>PROBLEM : I am...
<p>Looks like the problem is that the code execution continues after <code>cb(new Error(..)</code>, thus <code>cb(undefined,true)</code> gets called as well, telling multer that everything is ok. Change it to:</p> <pre><code>if (!file.originalname.toLowerCase().endsWith(&quot;pdf&quot;)) { return cb(new Error(&quot;p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Larvel 9 Edit/Update functionality returning Call to a member function store() on null<p>I have a blog where I am creating an update function and I removed t...
<p>You should call the <code>store</code> method only when you have new image file:</p> <pre><code>$image_path = $request-&gt;file('image')?-&gt;store('thumbnails', 'public'); </code></pre> <p>and then add <code>$image_path</code> to attributes only when you have new image:</p> <pre><code>$attributes = [ 'title...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to insert a tag in a Tkinter ScrolledText so that the user can type in their chosen style<p>I'm kinda new to Python and I'm running into a hitch that I j...
<p>Sure enough, changing this program to use Qt instead of Tkinter made all my text formatting dreams come true. The long and short of is is that for each of the Tkinter ScrolledText widgets, I used Qt's QTextEdit widgets instead. That enabled me to connect these functions to each of the bold, italic, and underline but...