input_text_instruct
stringlengths
288
45.8k
output_text
stringlengths
37
33.2k
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to return a template list in C++?<p>I am learning C++ in school and in my homework, my task is to create the FooClass for these:</p> <pre><code>int main(...
<p>Your constructor is not copying the source elements into the array that it allocates. And, you need a destructor to free the allocated array when you are done using it.</p> <p>And, your <code>print()</code> method is not <code>static</code>, so it should act on <code>this</code> instead of taking a <code>FooClass</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In vue-imask how do I get the IMask class?<p>My question is very similar to this one for angular: <a href="https://stackoverflow.com/questions/71772195/in-an...
<p>The <code>IMask</code> instance is indeed <a href="https://github.com/uNmAnNeR/imaskjs/blob/d34f6f3/packages/vue-imask/src/composable.js#L48" rel="nofollow noreferrer">stored in <code>mask</code></a> returned from <code>useIMask()</code>. Since <code>mask</code> is a <a href="https://vuejs.org/api/reactivity-core.ht...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating new worksheet from array<p>I have got a worksheet with some data. I store that data in an array and then I want to create a new worksheet and save t...
<p>If you are looking to copy all the data in your source range, it isn't necessary to store that data in an array first. Just <code>Set</code> your range and make the value of the destination range equal the value of the source range. Try something like this:</p> <pre><code>Sub CopyRangeIntoNewWorkbook() 'disabling s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Edit the Font Color of a bs4Dash bs4ProgressBar<p>I have an R <code>Shiny</code> <code>bs4Dash</code> <code>bs4ProgressBar</code> running in an app. I...
<p>There is no argument in <code>bs4ProgressBar</code> to change the font color, but We can use CSS to do this:</p> <pre><code>library(shiny) library(bs4Dash) ui &lt;- fluidPage( tags$head( tags$style(HTML(&quot; .prgs_fnt &gt; .progress &gt; .progress-bar { color: #f00 } &quot;)) ), tags$style(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create an object that can build many other objects all of which have a mutable reference back to the builder object?<p>I have a bit of a difficulty fo...
<p>This can be achieved in two ways. Using smart-pointers or introducing internal mutability to the <code>ThingMaker</code>.</p> <h2>Smart-pointers</h2> <p>Using this approach we wrap our reference to <code>ThingMaker</code> in <code>Rc&lt;RefCell&gt;</code> so that we can have multiple mutable references to one object...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Angular Observable : cannot read properties of undefined (reading 'foo')<p>I'm having a service as follow:</p> <pre class="lang-js prettyprint-override...
<p>You could subscribe on your observable on html template then consume its data:</p> <pre><code>&lt;ng-container *ngIf=&quot;dataService | async as dataServiceDetails&quot;&gt; &lt;div fxLayout=&quot;row&quot; fxLayoutAlign=&quot;space-between center&quot; fxLayoutGap=&quot;20px&quot; class=&quot;stats-cards&quot; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter Dropdown Button Remove on press grey color<p>I want to remove this grey button when i'm selecting the value for dropdown button. How can i do it. I t...
<p>One possible way is to change default splashcolor in your ThemeData like this:</p> <pre><code>theme: ThemeData( splashColor: Colors.transparent, highlightColor: Colors.transparent, ), </code></pre> <p>A con with this is setting it in your themedata is if you would like to use different colors in othe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create array of arrays. The country name, the first three letters of the country name and the length of the country name<p>I want to create an array of array...
<p>You had 2 mistakes in your code</p> <ol> <li>You wanted to push an array into your array but you hadnt surrounded it in <code>[]</code> so you were actually pushing 3 new items into your output array</li> <li>You were <code>console.log</code> inside the loop so it was outputting every iteration - this should be outs...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Blazor Custom Control Validation<p>I have created some custom input controls that do not use a input tag to gather user input. For example, a directory locat...
<p>Here's a starting point. I've removed the Browser stuff and just toggle the string between empty and a value as a demo.</p> <p>This inherits from <code>InputBase&lt;T&gt;</code> which is a template that doesn't actually have an <code>input</code>.</p> <p>All you do is:</p> <ol> <li>Wire up setting <code>CurrentValu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Module not found: Error: Can't resolve 'react-export-table-to-excel'<p>I wanted to be exporting the table to excel in react so Installed <a href="https://www...
<p>I think there is some issue with the library. Even their GitHub page has an open issue on this here. In this issue people have also suggested one alternative with full tutorial <a href="https://github.com/EdisonJpp/react-export-table-to-excel/issues/3" rel="nofollow noreferrer">https://github.com/EdisonJpp/react-exp...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: script time out with executeAsyncScript() for fetch post call<p>I am trying to run a script using executeAsyncScript() method having a fetch call. since fetc...
<p>Note: I'm not in the habit of using java so I don't know how to escape strings properly.</p> <p>The general way to do this is:</p> <pre><code>js.executeAsyncScript(&quot;arguments[0]('foo')&quot;) </code></pre> <p>You can put that inside a promise's <code>then</code> and it will still work.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: label X axis on ggscatter<p>I have a dataframe with 2 columns to do a correlation. The data is of integer number from 1 to 10. However, when I use the ggscat...
<p>just by adding the labels and breaks to the scale using <code>scale_x_continuous</code> (or <code>scale_y_continuous</code>) as we do in ggplot. Also, note that, whatever change you make to the <code>label</code>, define those for <code>breaks</code> argument too.</p> <pre class="lang-r prettyprint-override"><code>l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter Tab bar can't take all space<p>I want to make a custom tab widget and set a list of this widgets to a tab bar. But tab bar can't take all space and s...
<p>To make the <a href="https://api.flutter.dev/flutter/material/TabBar-class.html" rel="nofollow noreferrer">TabBar</a> use the maximum width of the screen you should remove the <a href="https://api.flutter.dev/flutter/material/TabBar/isScrollable.html" rel="nofollow noreferrer">isScrollable</a> property or set it to ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Inject Instance of Service in WebMvcTest<p>I have a test for MyController.java</p> <pre><code>@WebMvcTest(controllers = MyController.class) class MyControlle...
<p>Based on your question description it looks like your coverage scan is ignoring <code>test/java/controller</code> package.</p> <p>If it is so, can you please check if that is the case.</p> <p>For calling <code>Service</code>, you can either use it with <code>@Autowired</code> or even create instance of your service ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is StandardOpenOption.CREATE_NEW not creating a file to be read from in Java?<p>Here is my code:</p> <pre><code>import java.io.IOException; import java.n...
<p>I have reproduced what you are seeing (on Linux with Java 17).</p> <p>As I noted in the comments, the behavior seems to contradict what the javadocs say what should happen, but what I discovered is this:</p> <ul> <li><p>With <code>READ</code> or neither <code>READ</code> or <code>WRITE</code>, a <code>NoSuchFileExce...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Postgraphil Graphql - how to filter query only if the input is not null and not empty<p>Im using postgraphile and i have this query:</p> <pre><code>query Pro...
<p>Without making the filter a generic argument on the client side, There are two server-side options for filter operator customization in the <code>postgraphile-plugin-connection-filter</code> (v2.3.0) plugin. Both require you to create an additional plugin that registers a build <a href="https://www.graphile.org/grap...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Toggle one list item at a time with React/TS functional components<p>I have a simple component with a few nested bits of mark-up:</p> <pre><code> import R...
<p>This is a perfect use case for React context. You essentially want a shared state among your menu. You can achieve this with prop drilling however contexts are a much cleaner solution.</p> <p><a href="https://codesandbox.io/s/vigorous-wozniak-5ls6qj?file=/src/App.tsx:731-1125" rel="nofollow noreferrer">Code sandbox<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using sympy cxxcode on Heaviside function fails<p>I am using sympy version 1.10.1 and numpy version 1.20.0. Can someone please explain why the following simp...
<p>If I were you I would open an issue on SymPy.</p> <p>To solve your problem you might want to modify the function in order to get <code>cxxcode</code> to work:</p> <pre><code>func = func.rewrite(Piecewise) # modify the last argument to insert the True condition args = list(func.args) args[-1] = [args[-1][0], True] # ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Heroku flask + socket.io 400 BAD REQUEST<p>Hello im trying to deploy my flask app on heroku. Im using flask_socketio module and socket.io in version 4.5(i di...
<p><code>eventlet==0.30.2</code> in requirements.txt and <code>python-3.8.13</code> in runtime.txt did the job! Procfile: <code>web: gunicorn --worker-class eventlet -w 1 main:app</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make detectron2 train on validation dataset in colab notebook?<p>There is no evaluation during training in the Google Colab Notebook for detectron2 as...
<p>Colab notebooks are usually slow and meant for showing the basic usage of a repo. The fact that it is not evaluating during training could be just as simple as they don't consider it necessary having that step in a simple notebook. The more complex examples with periodic evaluation during training are in their repo....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: scale_linetype_manual is not working or shown on legend in R, why?<p>I would like to have two linotypes (one solid and one dashed) and having it shown on the...
<p>A general advice that you will hear again and again when working with <code>gggplot2</code> is that get your data in long format. It makes it really easy to plot the data when it is in long format.</p> <p>We remove the <code>C</code> column which is not required here and use <code>pivot_longer</code> to get data in ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Logger becomes null in Azure Durable Function<p><a href="https://stackoverflow.com/questions/64530386/value-cannot-be-null-parameter-logger-durable-function-...
<p>This is expected. The activity function runs and populates the logger item for the bar class and it's then possible to use it. When the activity function returns however the Bar object is not passed directly to the orchestrator but instead put into an azure table (you should be able to view it). In order to store it...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I configure a NiFi schema to convert all properties to strings when converting from CSV to JSON?<p>I have flow files with CSV (pipe-delimited) content...
<p><strong>Summary:</strong> CSVReader with Schema Access Strategy &quot;Infer Schema&quot; may create a schema with numeric types. CSVReader with Schema Access Strategy &quot;Use String Fields From Header&quot; creates a schema where all fields are string fields. In either case, the field names come from the first r...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Vue trigger request to fetch data from API<p>I'm fresh in Vue so this question can be dumb. I want to display data in Vue from my backend Rails API. The data...
<p>You need to hook the fetchUnsyncedProductsRequest function to Vue's lifecycles, like created or mounted. See: <a href="https://vuejs.org/guide/essentials/lifecycle.html" rel="nofollow noreferrer">https://vuejs.org/guide/essentials/lifecycle.html</a></p> <p>I would also change the function to just return the data.</p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find the minimum number of steps to half the sum of elements in a list where each step halves an item in the list in O(N)<p>I came across an interview questi...
<p>Maybe you could utilize a <a href="https://docs.python.org/3/library/heapq.html" rel="nofollow noreferrer">max heap</a> to retrieve the worst factory more efficiently than you are right now, i.e., using a heap would allow for an <code>O(N log N)</code> solution:</p> <pre><code>import heapq def filters_required(fac...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: sed command does not execute properly on gitlab runner<p>I have a script which needs to run npm run test and capture test coverage coverage value <a href="ht...
<p>You could just pipe directly to <code>sed</code></p> <pre><code>total=$(npm test -- --coverage --watchAll=false | sed -En '/All files/s/^[^|]*\| +([[:digit:].]+).*$/\1/p') echo &quot;Current test coverage is : $total&quot; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set initialization order for a properties object?<p>Ex: suppose I have</p> <pre><code> private double foo; private double bar; public doub...
<p>I would argue that public setter are not appropriate in this particular case. I would suggest using a constructor instead:</p> <pre><code>public MyClass(double foo, double value) =&gt; (Foo, Bar) = (foo, value*foo); public double Foo {get; private set;} public double Bar {get; private set;} </code></pre> <p>Note tha...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Gradle - publishToMavenLocal - specify custom directory<p>When I do a <code>./gradlew publishToMavenLocal</code> it publishes to my default maven home direct...
<p>You can add a system property <code>maven.repo.local</code> with the path.</p> <p>Example:</p> <p><code>./gradlew -Dmaven.repo.local=/path/to/local/repo publishToMavenLocal</code></p> <p>Source: <a href="https://github.com/gradle/gradle/blob/0cb6116e150ec397f2e6c935ab4a851b48d2cf67/subprojects/dependency-management/...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Randomly select from vector and assign to other variables without replacement<p>I have an object with 37 elements.</p> <p>I want to randomly select from the ...
<p>You may try</p> <pre><code>split(vars, sample(rep(paste0(&quot;Group&quot;, 1:6), c(4, 5, 6, 9, 6, 7)))) $Group1 [1] &quot;f6&quot; &quot;i9&quot; &quot;b28&quot; &quot;d30&quot; $Group2 [1] &quot;c3&quot; &quot;d4&quot; &quot;j10&quot; &quot;p16&quot; &quot;r18&quot; $Group3 [1] &quot;h8&quot; &quot;k11&quo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Format String data - Asp core Razor page<p>I would just like to know if there is a way in ASP.NET Core to allow users to enter the user name in a specific fo...
<p>You can add custom validation rules.</p> <pre><code> [RegularExpression(@&quot;^[a-zA-Z]{2}[0-9]{4}$|^[a-zA-Z]{1}[0-9]{4}$&quot;] public string UserName { get; set; } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to access URL inside of a JSON API that leads to another JSON API, and display that information on a page in React?<p>I have a property of 'inspection-li...
<p>Then in the component mount using <code>useEffect</code> with empty array dependencies, and fetch the data from that URL, and set a state for it to update the UI, when data come.</p> <pre><code>const [data, setData] = useState() useEffect(() =&gt; { if (jsonDataProduct) { fetch(jsonDataProduct[&quot;inspectio...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find matching name in another table, return value associated w/ column in pandas<p>I have 2 tables. I want to take DF1 and adjust the values in the tables gi...
<p>Here is a solution! It involves stacking df1 and df2 so that they can be matched on index and column. As df1's &quot;comp&quot; has duplicate values, they needed to be merged and then unstacked one by one (as unstack doesn't work with duplicate values).</p> <p>Data:</p> <pre><code>import pandas as pd df1 = pd.Dat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make notifications dismiss after delay vs code<p>Notifications don't dismiss by themselves: <a href="https://i.stack.imgur.com/i03Qq.png" rel="nofollo...
<p>VSCode does not allow it.</p> <p>There was a <a href="https://github.com/microsoft/vscode/issues/23684" rel="nofollow noreferrer">feature request</a> for it, and <a href="https://github.com/microsoft/vscode/issues/1992" rel="nofollow noreferrer">the answer</a> was to show notifications as popups.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flatten a partially nested list in Ansible<p>having such a list:</p> <pre><code>[ [[[6781,&quot;1&quot;]], &quot;a&quot;], [[[6782,&quot;1&quot;]], &quot...
<p>You have a list composed of lists which you want to flatten. Applying the <code>flatten</code> filter to the entire list will not do what you want (as you found out) as it will flatten the entire list to a single level.</p> <p>What you want is to apply that same filter but individually to each element of your top li...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I pass my dictonary into class with function?<p>I want to declare a class using a dictionary and the ValueOrderedEnum library.</p> <p>I have a dictio...
<p>You can simply call <code>ValueOrderedEnum</code> with your <code>dict</code> as an argument to create the desired enumerated type.</p> <pre><code>&gt;&gt;&gt; from ordered_enum import ValueOrderedEnum &gt;&gt;&gt; my_dict = {'Blood':'4','Phlegm':'3','YellowBile':'2','BlackBile':'1'} &gt;&gt;&gt; Humor = ValueOrdere...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Uncaught TypeError: Cannot read properties of undefined (reading 'name') | Material UI<p>I'm trying to view the fetched data on MUI Autocomplete, but I get t...
<p>So I added this and it worked <code>getOptionLabel={option =&gt; (option ? option.name : &quot;&quot;)}</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ScrollView touch works despite all other touch is disabled<p>So my goal is to disable touch events for everything on screen and I don't want to use .disable ...
<p>Use instead (tested with Xcode 13.4 / iOS 15.5)</p> <pre><code>Color.clear // .ignoresSafeArea(.all) // &lt;&lt; if need all screen space .contentShape(Rectangle()) .highPriorityGesture(DragGesture(minimumDistance: 0)) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to optimize IP Address search query<p>I am trying to optimize ip address geolocation queries on the following raw schema (dataset is from an <a href="htt...
<p>Turns out the best approach was actually to create a BTREE index on just the <code>start_ip</code> field after converting ip columns to <code>INET</code>. Then the query was a simple check of <code>&lt;=</code> or <code>BETWEEN</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to define PyTorch3D plane geometry?<p>I'm new to <a href="https://pytorch3d.org/" rel="nofollow noreferrer">PyTorch3D</a> and I'm trying to define a (sub...
<p>The solution is to remove this line: <code>verts /= verts.norm(p=2, dim=1, keepdim=True)</code></p> <p>In more detail:</p> <pre class="lang-py prettyprint-override"><code>import torch from pytorch3d.ops.subdivide_meshes import SubdivideMeshes from pytorch3d.structures.meshes import Meshes # Vertex coordinates for ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: cx_Oracle executemany() in Python to load paginated API JSON data to Oracle Database<p>tbls = ['tbl1' , 'tbl2', 'tbl3']</p> <pre><code> for tbl in...
<p>Try binding with <code>executemany()</code> like this:</p> <pre><code>import cx_Oracle as oracledb import os import sys if sys.platform.startswith('darwin'): oracledb.init_oracle_client(lib_dir=os.environ.get('HOME')+'/Downloads/instantclient_19_8') un = os.environ.get('PYTHON_USERNAME') pw = os.environ.get('P...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to properly trim the edge of an input range track in CSS?<p>I am trying to build a slider component that looks similar to this: <a href="https://i.stack....
<p>I would probably just draw the groove separately instead of trying to make it work like this.</p> <p>Also:</p> <ul> <li>You can just <code>bind</code> the <code>value</code> of the input.</li> <li>It helps to have a container element which is used to dictate the overall size</li> <li>Flexbox in combination with <cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Akka cluster slave can't join seeds<p>I'm trying to build a small AKka.NET Cluster Application but I'm having problems since I keep getting the following err...
<p>Well, I just had to change the hocon configuration to the following:</p> <pre><code> &lt;![CDATA[ akka { actor { provider = cluster } remote { log-remote-lifecycle-events = DEBUG dot-netty.tcp { hostn...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Missing boxplot by category with plt.boxplot - (matplotlib)<p>I would like to do a boxplot with two categories, but for a reason it doesn't appear de second ...
<p>Yeah, as @BigBen said I had a <code>NaN</code>. So... here the solution:</p> <ol> <li>I decided to use Series instead of lists</li> </ol> <pre class="lang-py prettyprint-override"><code>bisonF = bison.loc[bison['animal_sex'] == &quot;F&quot;].animal_weight bisonM = bison.loc[bison['animal_sex'] == &quot;M&quot;].ani...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I show a star rating based on the average?<p>I am currently working with <strong>Django</strong> and <strong>Jquery</strong>, I need to show some hot...
<p>All your stars have the same set of IDs so it's only hitting the first it encounters. IDs should be unique. You can make them unique by including django's forloop.counter. IDs should not start with numbers so I'll change that too.</p> <pre><code>&lt;span class=&quot;fa fa-star&quot; id=&quot;star_{{forloop.counter...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: A form isn't working when showing mobile view<p>I'm trying to set a mobile view for my site. In this particular case i have to show two different forms accor...
<p>Your form is not working because you have a bug in the lines that start with <code>document.formregistrazione.</code> You are trying to read a <code>value</code> from <code>undefined</code>. Instead you can access your field value like this <code>document.formregistrazione[&quot;0&quot;][&quot;0&quot;].value</code>....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calculation of a ratio of columns to create a model<p>I have a set of data where i am trying to model the rate of TB cases per unit population. Am I correct ...
<p>Apparently yes! R is vectorized, which means you can easily do vector arithmetic.</p> <p>In many programming languages we need a <code>for</code> loop for this kind of calculation,</p> <pre><code>r &lt;- numeric(length(nrow(TBdata))) for (i in seq_len(nrow(TBdata))) { r[i] &lt;- TBdata[i, 'TB'] / TBdata[i, 'Popula...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is opposite to 'in' condition in Kotlin - '!` mark equivalent to Java<p>In Java we do use <code>!</code> in case we want to say NOT. But what should I u...
<p>You can use <code>!in</code> operator:</p> <pre class="lang-kotlin prettyprint-override"><code>if (item !in 5..10) </code></pre> <p>See documentation for a full list of operators:</p> <ul> <li><a href="https://kotlinlang.org/docs/operator-overloading.html#in-operator" rel="nofollow noreferrer">https://kotlinlang.org...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python Dictionary Tag Storing and Indexing<p>I'm fairly new to Python and I'm trying to write a boto3 script that would find certain tags with certain criter...
<p>The hard part is that the program is collecting information by looping through <code>instances</code>, but you then want to send emails based on <code>contact</code>.</p> <p>It will need to create a <strong>dictionary of contacts</strong>, which contains a <strong>dictionary of categories</strong> (missing tag key, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create a Customer User Defined function for replacing the missing rows using Mean Median Mode<p>I tried to create a custom user defined function in python fo...
<p>Hope this will help you,</p> <pre><code>import pandas as pd def conditional_impute(df,column_name,choice): try: if choice == 'mean': mean_value = df[column_name].mean() df[column_name].fillna(value=mean_value, inplace=True) elif choice == 'median': median_valu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Transforming pandas dataframe into different shape<p>I have below data frame using pandas library</p> <pre><code>import pandas as pd import numpy as np dat ...
<p>Use the <a href="https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.explode.html" rel="nofollow noreferrer"><code>.explode()</code></a> method:</p> <pre><code>res = dat.set_index('X').explode(['Y','Z']).reset_index() print(res) # X Y Z # 0 1 1 A # 1 1 2 B # 2 11 11 AA # 3 11 21 BB # 4 1...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find records based on enum value in postgresql<p>Let's say I have a BOOKS table with the records below below:</p> <p>The genres field is an array of e...
<p>The simple query is with <code>= ANY</code>:</p> <pre class="lang-sql prettyprint-override"><code>SELECT * FROM books WHERE 'Adventure'::book_genres_enum = ANY(genres) </code></pre> <p>This works with any type of array. Nothing special about an <code>enum</code> type in this regard.</p> <p>The explicit cast is opti...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mongodb query distinct sort by numerical order<p>I am trying to sort the mongodb collection distinct output in numerical order. but I am getting the error me...
<p>If you want to use mongoDB to sort, one option is:</p> <pre><code>db.collection.aggregate([ {$group: {_id: &quot;$carId&quot;}}, {$sort: {_id: 1}}, {$group: {_id: 0, res: {$push: &quot;$_id&quot;}}} ]) </code></pre> <p>See how it works on the <a href="https://mongoplayground.net/p/GDluoW-wRXe" rel="nofollow no...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sending GET Request with a JSON body<p>I am trying to consume an API that allows JSON bodies to be sent to a GET endpoint, however I cannot find a way to sen...
<p>You can call the <code>send</code> method, which is what <code>get</code> ends up calling to send the request:</p> <pre><code>Http::asJson()-&gt;send($method, $url, ['json' =&gt; $data]); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to disable file indexing in Ubuntu 22.04 (tracker3)<p>currently we have problems with our new Ubuntu 22.04 desktops and the <a href="https://wiki.gnome.o...
<p>I was with the same problem on Ubuntu 22.04.1 LTS and like you, none of the web stuff using 'systemctl' or 'tracker3 reset' was worked.</p> <p>I solved making some files non executables with:</p> <pre><code>sudo chmod -x /usr/libexec/tracker-miner-fs-3 sudo chmod -x /usr/libexec/tracker-extract-3 </code></pre> <p>Th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert .tsv file to .csv file with tab_delims using batch file<p>i have some trouble about convert file tsv to file csv with .bat. Problem is i can't conver...
<pre><code>@ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION rem The following settings for the source directory, destination directory, rem filename, output filename are names rem that I use for testing and deliberately include names which include spaces to make sure rem that the process works using such names. These will nee...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: .NET MAUI fails to run on Windows<p>The project builds successfully. When trying to start it says there are deployment errors</p> <p>Error DEP0600: Dep...
<p>On doc page <a href="https://docs.microsoft.com/en-us/dotnet/maui/supported-platforms" rel="nofollow noreferrer">Supported platforms for .NET MAUI apps</a>, we see requirements to run on Windows 10:</p> <blockquote> <p>Windows 10 <strong>version 1809 or higher</strong>, using <a href="https://docs.microsoft.com/en-u...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add column that is the sum of other columns<p>Input data:</p> <pre><code>Director= c(&quot;Director A&quot;, &quot;Director B&quot;, &quot;Director C&quot;) ...
<p>We could use <code>rowSums</code> with <code>select</code>:</p> <pre><code>library(dplyr) df_directors %&gt;% transmute(Director, Salary, Boards = rowSums(select(., contains(&quot;boards&quot;))),Number_of_qualifications) </code></pre> <p><strong>First solution:</strong></p> <pre><code>library(dplyr) df_directo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Retrieve data via link parameter in react<p>I have a list of user on a page , what i want to achieve is render user detail when i click on the link with his ...
<p>Since <code>getCoupeurInfoById</code> is an <code>async</code> function it implicitly returns a <code>Promise</code> object and subsequently (<em>quickly</em>) resolves and mutates the <code>coupeur</code> state variable. When you log it you see the resolved value.</p> <p>The <code>useState</code> hook expects a syn...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django views.py not rendering and giving error<p>i have an app called play, inside it i have made a templates folder and hello.html is saved there, in views....
<p><code>hello.html</code> should be a String. This is the path to yours Template.</p> <pre><code># the path should be relative to the 'templates/' directory return render(request, 'path/to/hello.html') </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove Word not in list Pandas Column<p>Below is the DF,</p> <pre class="lang-py prettyprint-override"><code>df = pd.DataFrame({'cd1' : ['PFE1', 'PFE25', np....
<p>Try this using <code>agg</code> with axis=1:</p> <pre><code>df['combined'] = df.agg(lambda x: list(x.dropna()), axis=1) spec_list = ['PFE15', 'PFE25'] df['new_col'] = df.agg(lambda x: list(x[x.isin(spec_list)]), axis=1) </code></pre> <p>Output:</p> <pre><code> cd1 cd2 cd3 cd4 cd5 ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why I'm not able to Inject this service?<p>Here's my websocket.service.ts on my Angular 13 application:</p> <pre><code>import { Injectable } from &quot;@angu...
<p>You probably need to use this form of Injectable decorator</p> <p><code>@Injectable({ providedIn: 'root', })</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make a simple Search Bar using html/css/js<p>this is another attempt to learn web development basics.</p> <p>I've created a simple search bar.</p> <p>...
<p>You don't need JavaScript to make it search on google. You can just add a form action that makes it go to google. Just change your HTML to:</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-html lang-html prettypri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MySQL vs. Oracle - @ http://sqlfiddle.com/<p>I'm running the below SQL code at <a href="http://sqlfiddle.com/" rel="nofollow noreferrer">http://sqlfiddle.com...
<p>Oracle does not support ENUM. Use according string-type column + CHECK constraint.</p> <pre class="lang-sql prettyprint-override"><code>Create Table Variables1 (name varchar(3), value1 int); Create Table Expressions (left_operand varchar(3), operator CHAR(1), CHEC...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Query - display zero where null in one column and select sum of two columns where not null in next column<p>I need to display a zero where &quot;Silo Wt&quot...
<p>You just need to wrap them in <code>ISNULL</code>.</p> <p>However, your query could do with some serious cleanup and simplification:</p> <ul> <li><code>DISTINCT</code> makes no sense as you are grouping by that column anyway.</li> <li>Two of the subqueries can be combined using <code>OUTER APPLY</code>, although thi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: radio input still true after unchecked<p>I have filter section with checkbox and radio when user unchecked for checkbox the content is hidding, but for radio...
<p>Separate into two types of handle: handle for <code>radio checked</code> and handle for <code>checkbox checked</code>. Have to put <code>onChange</code> into each radio input <code>&lt;input type=&quot;radio&quot; onChange={}... /&gt;</code>. Try this below code:</p> <p><div class="snippet" data-lang="js" data-hide=...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CORS issue: Response to preflight request doesn't pass access control check: It does not have HTTP ok status<p>I have visited other related posts but still I...
<p>The headers which you are setting for this request aren't required. In CORS these headers must be set on the server response for browser to allow the response if server has same-origin policy.</p> <p>I see <code>https://raw.githubusercontent.com</code> allows cross-origin requests, so try making this request without...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to fix error in sql "Execution finished with errors. Result: near "(": syntax error"?<p>How to remove all characters from / to &amp;.</p> <pre><code>UPDA...
<p>You can use this because I believe there is no LEFT function in SQLite:</p> <pre><code>UPDATE bal SET Perevod = substr(Perevod, 1, INSTR(Perevod, '/')-1) WHERE INSTR(Perevod, '/')&gt;0; </code></pre> <p><a href="https://dbfiddle.uk/?rdbms=sqlite_3.27&amp;fiddle=3ae4e7fcc759b067ea876ead5394f292" rel="nofollow norefer...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: nested forEach not working with append HTML<p>Nested forEach() not working with append HTML.</p> <p>Data is coming properly fine in <code>console</code> but ...
<p>You just need one <code>.forEach()</code> interpolate the following into the string in the <code>.service-wrapper-body</code>:</p> <pre><code>`${val.services[0].discounted_price}` </code></pre> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code">...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to navigate to another component and pass data<p>I am currently trying to accomplish routing from component to component and pass data so the newly opene...
<p>Tom, the passed route state will be accessible from the <code>location</code> object, i.e. <code>location.state.data</code>. You use the <code>useLocation</code> hook to access the <code>location</code> object in the receiving component.</p> <p>Sender:</p> <pre><code>&lt;Navigate to=&quot;/&quot; state={{ data: this...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Plotting ternary graph with imported excel sheet<p>I have a number of excel sheets (example attached) which plot simple ternary plots.[![basic excel sheet la...
<p>Using the data you posted in the table.</p> <pre class="lang-r prettyprint-override"><code># Read in the data Tdata &lt;- read.table(text = &quot;a-axis b-axis c-axis lithology roundness 11.11 10.98 5.92 a-ig sa 8.57 8.27 6.2 met sa 9.25 6.25 4.14 ss r 8.21 7.23 5.03 b-ig s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove unwanted permissions from Expo app<p>I developed an Expo app (managed) and generated the Android binary using EAS. After submitting the binary for int...
<h2>Short answer:</h2> <p>On SDK 45+, use <code>blockedPermissions</code> to remove unwanted permissions:</p> <pre class="lang-json prettyprint-override"><code>&quot;android&quot;: { // ... &quot;blockedPermissions&quot;: [ &quot;android.permission.RECORD_AUDIO&quot;, &quot;android.permission.CAMERA&quot; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I can't get the full body of the response in the postman<p>I can't get the full body of the response in the postman. A list comes with food for the restauran...
<p>The solution was add customization JSON. Add class and MappingJackson2HttpMessageConverter in spring-mvc.</p> <p>public class JacksonObjectMapper extends ObjectMapper {</p> <pre><code>private static final ObjectMapper MAPPER = new JacksonObjectMapper(); private JacksonObjectMapper() { registerModule(new Hiberna...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ffmpeg with python subprocess Popen<p>I'm trying to record webcam video from python using ffmpeg. The following ffmpeg works properly when run from the cmd</...
<p>We may add double quotes for letting Python <code>subprocess</code> know the string is one argument, and we have to close FFmpeg gracefully.</p> <p>Adding double quotes:<br /> Replace the following part <code>video=&quot;HP HD Camera&quot;:audio=&quot;Headset (realme Buds Wireless 2 Neo Hands-Free AG Audio)&quot;</c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting the current UIButton menu selected item<p>I have a uibutton with a menu and several actions.</p> <p>Whenever the user select a menu item I want to fe...
<p>You can fetch the selected item into the action block</p> <pre><code>let saveAction = { (action: UIAction) in //action print(action.title) } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Access to child of<p>am using API which allows me to collect data about countries. If i want get data about languages and currencies from different countries...
<p>You have to do pretty hacky things to achieve this. I've come with this way, if you want to extract it directly from the API response:</p> <pre><code>const currencyName = data[0].currencies[Object.keys(data[0].currencies)[0]].name; </code></pre> <p>A bit more readable:</p> <pre><code>const currencies = data[0].curr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: [Object][Object] angular<p>I'm trying to display the value in my form why i get [Object][Object] in my display i tried the ngModel but i have a validators</p...
<p>You're not meant to bind properties to the form. Just access the form directly:</p> <pre class="lang-js prettyprint-override"><code> ngOnInit(): void { this.Form = this.fb.group({ Code: ['', Validators.required], }); } getNextDRId() { this.micro.getNextId().subscribe((response: string) =&gt; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Default copy constructor and assignment operator<p>If among the elements of my class I have also a const data member, how do copy constructor and assignment ...
<pre><code>struct foo { int const x; }; foo f0{3}; // legal foo f1 = f0; // legal, copy-construction foo make_foo(int y) { return {y}; } // legal, direct-initialization foo f2 = make_foo(3); // legal, elision and/or move-construction f2 = f1; // illegal, copy-assignment f2 = make_foo(3); // illegal, move-assignme...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: webscraping an embedded table with rvest<p>I am learning how to webscrape with rvest and R and I want to extract the table embedded in the below website:</p>...
<p>It looks like the table is stored as JSON file. If you use the Network tab from the browser developers tool one can retrieve the link.</p> <p>url&lt;-&quot;https://perfectunion.us/wp-json/wpgmza/v1/datatables/base64eJy10zFrwzAQBeD-8mYV6rZJQFvo0CWBDIFC4lKu1sUWlRVzkkPA+L9HcVLo1qVa795907sBXdO9OgoBGu+bt-VuWZZrkm+WlQ3R+...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: combining consecutive matches and separating non-consecutive matches with from re findall<p>I have a string of the format:</p> <pre><code>my_string = 'hello|...
<p>You cannot &quot;exclude&quot; text in between other texts that are captured into the same group.</p> <p>You need to replace the lookahead with the consuming pattern, extract all consecutive matches, and then remove the <code>|foo</code> with a mere <code>str.replace</code> method as the post-processing step.</p> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How sum certain duplicated data?<p>I have a list of ids, some ids can be duplicated. How to sum values for the same id in one query?</p> <pre><code>SELECT SU...
<p>You need to join with table value data to get the desired number of rows e.g.:</p> <pre><code>select sum(stats.power) from ( select 489191 as template union all select 489191 union all select 489100 ) as vlist join stats on vlist.template = stats.template </code></pre> <p>If you're using MySQL 8 or later...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: java swing borderlayout adding panes difficulties<p>so basically, when I add two panes to container with BorderLayout I have a something like padding and I h...
<blockquote> <p>when I add two panes to container with BorderLayout I have a something like padding</p> </blockquote> <pre><code>mainContainer.setLayout(new BorderLayout(8, 6)); </code></pre> <p>What did you think the 8/6 values are used for?</p> <p>You are creating a gap between the components.</p> <p>It is best to re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hamburger Menu not working in Android WebView<p>I have a weird problem with Andriod WebView. My website's Humberger menu expands and closes fine in my mobile...
<p>your <code>WebView</code> should fit whole window, use <code>match_parent</code></p> <pre><code>&lt;WebView android:layout_width=&quot;match_parent&quot; android:layout_height=&quot;match_parent&quot; android:id=&quot;@+id/MyWebView&quot;/&gt; </code></pre> <p><code>wrap_content</code> set for height mak...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use numpy to find polygons in array of polygons which have at least one point in a bounding box<p>I have a numpy array of vertices for polygons. For example,...
<p>Defining the data:</p> <pre><code>import numpy as np upper_limit= (10, 10) lower_limit= (0, 0) polygons = np.array([ [(0, 0), (1, 3), (5, 7), (0, 9), (-1, 3)], [(200, 200), (200, 300), (300, 300), (300, 200)], [(-10, -10), (-20, 5), (3, 2), (60, 8)] ]) </cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript for deleting DIV that blurs website<p>There is a website with the following div:</p> <pre><code>&lt;div class=&quot;x&quot; style=&quot;user-selec...
<p><code>getElementsByClassName()</code> returns a collection. Only single objects have <code>remove()</code> method. You have to apply one of the following:</p> <ol> <li>Use brackets to specify an index of the object you want to get:</li> </ol> <p><code>div[0].remove()</code></p> <ol start="2"> <li>Use <code>item()</c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How To Replace Text Inside of a Timeout<p>I'm trying to replace text inside of a timeout while only manipulating the part of the below HTML inside of &quot;Y...
<p>By &quot;hacking&quot; the function that runs after the timeout, this can be achieved.</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-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt; &lt;html lan...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calculate sum of distances between nodes of a graph passed as an array in a DataFrame<p>Graph definition (The graph is fixed for the problem concerned):</p> ...
<p>One approach using <a href="https://networkx.org/documentation/stable/index.html" rel="nofollow noreferrer">networkx</a>:</p> <pre><code>import networkx as nx # init distances distances = {(&quot;N1&quot;, &quot;N2&quot;): 10, (&quot;N2&quot;, &quot;N1&quot;): 10, (&quot;N2&quot;, &quot;N3&quot;): 30, (&quot;N3&quo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MS SSAS - Calculated member to aggregate count of a dimension appearing for every row of underlying data<p>I usually work with a custom Java in-memory OLAP c...
<p>So I carried on trying stuff but also, at the same time I asked the question here, I posted on the Microsoft Tech Forums as after all it is one of their products! :)</p> <p>So I had correctly realised my above calc was merely counting the members of the dimension based on the filter.</p> <p>The answer was to add a c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to display url taxonomy in loop taxonomy wordpress?<p>i have a custom taxonomy genre, i want to show all taxonomy in genre.php page. when I try to use th...
<p>You can use this code it will give results as per your requirement.</p> <pre><code>&lt;?php /* Template Name: Genre */ get_header(); ?&gt; &lt;div class=&quot;content&quot;&gt; &lt;div class=&quot;main-content&quot;&gt; &lt;div class=&quot;main-container&quot;&gt; &lt;div id=&quot;list_categories_categor...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to call the JSON value using nodejs when the value is having hyphen<p>My JSON value has a value with hyphen like database-name.</p> <p>I wanted to replac...
<p>Try to do like this:</p> <p><code>result.databases[&quot;database-name&quot;]</code></p> <p>That's the way to access properties when you have a hyphen in their key names.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Azure Functions with Cosmos DB Binding - ORDER BY not working when passed as route parameter<p>I'm trying to fetch a list of items from a container ordered b...
<p>It doesn't looks like it is supported. If you look at the implementation <a href="https://github.com/Azure/azure-webjobs-sdk-extensions/blob/dev/src/WebJobs.Extensions.CosmosDB/Bindings/CosmosDBEnumerableBuilder.cs" rel="nofollow noreferrer">here</a>, it is converting the query parameters into SQL parameters:</p> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there any way to read .pth(dataset) and turn them into csv?<p>I have a repo that provided a model architecture, but not pretrained model. it actually prov...
<p><em>.pth</em> files saved with <code>toch.save()</code> are supposed to be binaries. using <code>torch.load()</code> you can get the dataset, and then save it again as a <em>.csv</em> with pandas for example</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make popup video responsive respective to mobile device<pre><code>&lt;button type=&quot;button&quot; class=&quot;action-oser&quot; id=&quot;click-vlin...
<p>add a <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/style" rel="nofollow noreferrer"><code>style=&quot;&quot;</code></a> attribute in the <code>&lt;iframe&gt;</code></p> <p>with this css code <code>max-width: 100%;</code></p> <p><a href="https://i.stack.imgur.com/e5UBp.gif" rel="nofoll...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Left join Without Subqueries<p>I am getting the below output, I want the same out but without subqueries<a href="https://i.stack.imgur.com/ZQbOS.png" rel="no...
<p>Thank you for the help friends. I figured out how to do it. Below is the solution for your refernce.</p> <pre><code>SELECT rec.requestno, COALESCE(totalsub, 0) AS totalsub, COALESCE(totalsel, 0) AS totalsel, COALESCE(totalrej, 0) AS totalrej FROM recruitersubmission rec LEFT JOIN ( SELECT request...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React - UI not aligning on mobile<p>I am having a layout which has text and a button on the left side and the image on the right side. The layout is working ...
<p>The Problem was it was using display flew as row for mobile as well. I used a media query to display flex as column for mobile and it worked. Thanks</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to select particular rows and columns without hardcoding in pandas python<p>I want to select name and score from index 1 to 3 and store it to a dataframe...
<p>You can use <code>iloc</code>:</p> <pre><code>&gt;&gt;&gt; df.iloc[1:4] Name Score 1 b 80 2 c 95 3 d 20 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to write multiple arrays of objects into json file using php?<p>I am having difficulty to write all of the array of objects into .json file. Here is my c...
<p>Because you're writing to the file inside the loop, you keep overwriting its contents every time.</p> <p>To write all the data to a file, and make it write a valid JSON entity which will be decodable again later, you need to construct a single array containing all your product data, and then encode and write that ar...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: modalDialog inside a loop in shinyapp<p>How can I use a <code>modalDialog</code> inside a loop? I've looked at some forums but none of them were satisfactory...
<p>Here is a way with <strong>shinyalert</strong>. That's strange, if you put a button in a Shiny alert, then clicking the button automatically closes the alert. That's why I use <code>actionLink</code> instead of <code>actionButton</code>. The app does not react as usual when clicking one button/link, so I use the <co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: control array, links by role in header, laravel-admin<p>I use <a href="https://laravel-admin.org/docs/en/README" rel="nofollow noreferrer">https://laravel-ad...
<p>You have multiple possible solution. One would be to make a helper <code>adminHasAccess($link['uri'])</code> and use it elegantly in your blade.</p> <pre><code>function adminHasAccess($uri) { switch($uri) { case 'users': return Admin::user()-&gt;isRole('administrator'); case 'posts': ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CASE WHEN function & date function to change now() > to an assumption date<pre><code>WITH latest AS ( SELECT DISTINCT customer_id, MAX(submitted_on) AS ...
<p>I would suggest avoiding the use of <code>now()</code> as this includes millisecond precision. Instead you probably only need date precision so you could use <code>current_date</code> instead. Plus you really don't need <code>select distinct</code> at all, nor do you need multiple joins etc.</p> <pre><code>WITH AA A...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to determine git remote name by giving the repo URL?<p>I'm trying to get the remote name of the giving URL:</p> <pre><code>$ git ls-remote --get-url git...
<p>I'm not aware of a way to do this directly with git, but you could pipe the result into a grep and format it:</p> <pre class="lang-bash prettyprint-override"><code>git remote -v | grep &quot;git@github.com:foo/bar.git&quot; | cut -f1 | head -1 </code></pre>