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: Traditional sql equivalent for Linq functions<p>I wrote this query, but I want to use it with functions.</p> <pre><code>var hede = (from customer in _custom...
<p>You can achieve it in this way</p> <pre><code>var result2Tables = _customerRepository.Table.Join(_sourcedefinitionepository.Table, c =&gt; c.SouceCode , s =&gt; s.SourceCode, (c, s) =&gt; new { Customer = c, SourceName = s }))....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Migrating PHP 7 to 8 - Object's constructor is not called<p>We need to migrate our live online store from PHP 7.x to PHP 8.x</p> <p>My main XAMPP folder is r...
<p>Propably incompatible changes. From docs:</p> <blockquote> <p>Methods with the same name as the class are no longer interpreted as constructors. The __construct() method should be used instead.</p> </blockquote> <p>Source: <a href="https://www.php.net/manual/en/migration80.incompatible.php" rel="nofollow noreferrer"...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Plot a fieldline onto 2D magnetic field components in IDL<p>I would like to overplot a single fieldline at some radius or starting point, onto a contour of a...
<p>You can compute streamlines with <code>PARTICLE_TRACE</code> and do your own graphics however you want.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Timertask Run() method is not working for longer period like 2 hours<p>created an own application which gets started automatically although it gets removed o...
<p>Fixed this issue using Alarm Manager.</p> <pre><code> public void startAlert() { var alarmIntent = new Intent(this, typeof(AlarmReceiver)); var pending = PendingIntent.GetBroadcast(this, 0, alarmIntent, PendingIntentFlags.UpdateCurrent); var alarmManager = GetSystemServic...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to build a for loop that prints the sentiment score of each string and does not produce a key error?<p>I have a dataset of tweets that I put into a panda...
<p>At your sentiment functions you can use <code>try/except</code> concept so you can define what to do if an exception raises. It's not going to be perfect example because dont know what your functions do actually but your can try;</p> <pre><code> def text_sentiment(text): try: tokens = [token.casefold()...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Update Records with Flow Identifier Key<p>I'm trying to get a script together to update the ActionTypeID column based off the particular Area flow for each V...
<p>You want something with <code>lag()</code> and other window functions. It is a little tricky, but something like this:</p> <pre><code>with toupdate as ( select sd.*, row_number() over (partition by visitid, area order by startdate) as seqnum from #sampledata sd ) update toupdate s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: mongodb query filter documents by array value or size<p>I have a document that's look like this if it hasn't got any items in the <code>itemList</code> field...
<p>You can do an <code>$or</code> in <code>$expr</code> to cater to the 2 criteria.</p> <pre class="lang-js prettyprint-override"><code>db.collection.aggregate([ { $match: { &quot;alloweUidList.uid&quot;: &quot;prQUKkIxljVqbHlCKah7T1Rh7l22&quot;, &quot;alloweUidList.boolId&quot;: 1, &quot;boolId...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cant connect to on premise SQL Server from ASP.NET Core 3.1 in Docker<p>I have created <code>ASP.NET MVC Core web app</code> in <code>VS 2019 with Docker sup...
<p>It seems the problem is with SSL and Docker image. Changing to a bionic image solves the problem. More about this <a href="https://github.com/dotnet/SqlClient/issues/222" rel="nofollow noreferrer">https://github.com/dotnet/SqlClient/issues/222</a></p> <pre><code>FROM mcr.microsoft.com/dotnet/core/aspnet:3.0-bionic ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is my django web-app login form not working?<p>I've tried to add login form to my tasks web-app, but something goes wrong and I can't login to my created...
<p>Could it possibly be a spelling error? <code>metrhod=&quot;POST&quot;</code></p> <p>Try this:</p> <pre class="lang-py prettyprint-override"><code> &lt;h1&gt;Login&lt;/h1&gt; &lt;form method=&quot;POST&quot; action=&quot;&quot;&gt; {% csrf_token %} {{ form.as_p }} &lt;input type=&quot;submit&quot; value=&...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use !ImportValue on a resource's Arn string in Cloudformation<p>I try to import a resource's arn string from another cloudformation stack's output. Bu...
<p>Instead of</p> <pre><code> Role: !ImportValue: LocalLambdaExecRole.Arn </code></pre> <p>it should be:</p> <pre><code> Role: !ImportValue LocalLambdaExecRole </code></pre> <p>and your output should be:</p> <pre><code>Outputs: LocalLambdaExecRole: Description: Lambda Execution Role Value: !GetAtt LocalLamb...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Constexpr function evaluation on a template parameter object (MSVC vs clang/gcc)<p>As I understand it, the following should be valid C++20:</p> <pre class="l...
<p>Yes, seems like a bug to me as well.</p> <p>The parser seems to have a problem specifically with the member function call via <code>.</code> in the template argument. It works when using <code>-&gt;</code>:</p> <pre><code>template&lt;B b&gt; A&lt;(&amp;b)-&gt;one()&gt; f() { return {}; } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Having trouble with Javascript ordering form not calculating<p>So I'm getting a null error with my order form when I'm trying to calculate the total using ja...
<p>the problem is the array contains many Divs than not in HTML, </p> <p>the first item <strong>'guptakush_'</strong> only exist in html</p> <p>so if you check if div exists before settings value it will resolve the problem + the finaltotal is input not html so put new value with <strong>.value</strong> not <strong>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Auto populate the data in Sub form to a text-box in Main form?<p>I have a Sub form (in Data sheet view) in my Main form. This datasheet form has 3 fie...
<p>Place 3 textboxes in subform footer section with expressions like: <code>=Last([Process])</code>. These textboxes will not display in datasheet view, however, main form can reference them, like:</p> <p><code>=[subform container name].Form.tbxLastProc</code></p> <p>Be aware any changes in subform record order or fi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to not color nan values when making a contour plot with matplotlib.collections.PolyCollection<p>I am trying to plot a tri/quad mesh along with results on...
<p>Matplotlib's colormapping mechanics come from a time when <code>numpy.nan</code> wasn't around. Instead it works with masked arrays.</p> <pre><code>facecolors = np.ma.array(facecolors, mask=np.isnan(facecolors)) </code></pre> <hr> <p>Concerning the other error you get, note that <code>.set_clim</code> is an attri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rails RSpec net-ssh mock return of second ssh request<p>I'm working on a web application that frequently access simulation data on a remote server. I want to...
<p>With this mock</p> <pre><code>allow(Net::SSH).to receive(:start).and_return("[' ', 'Error with connection']") </code></pre> <p>the <code>ssh_with_stderr</code> looks like</p> <pre><code>def ssh_with_stderr(command) @output = "" @errors = "" begin [' ', 'Error with connection'] rescue Net::SSH::Excepti...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# create object dynamically and set each parameter with loop<p>Is there any way to fill up the variables of a dynamically created instance?</p> <p>Something...
<p>you can use the prop variable to set the value of the object that you created using the Activator.</p> <pre><code> public class Car { public string Name {get;set;} public string Color {get;set;} } var carType = typeof(Car); var carInstance = Activator.CreateInstance(carType); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Attaching another table after a hasManyThrough relationship<p>i am trying to connect 4 tables together:</p> <pre><code>StepAnimation Model: public funct...
<p>Then you can continue selecting the category relationship in your workSequence as long as it is available on your model. Like this.</p> <pre><code>$this-&gt;stepAnimation = New StepAnimation(); $workSequence = $this-&gt;stepAnimation::with('step.workSequence.categoryWorkSequence')-&gt;get(); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: nested if/else/elsif not looping<p>I'm really new to coding and Python and have beent trying the &quot;rock, paper, scissor&quot; game. Everything seems to w...
<p>In Python, strings (text) are True as long as they are not empty. Similarly, lists, sets and other collections are True unless empty. It has a great advantage once you are aware of it. Also, your indentation was wrong. You need to move the <em>computer=t[randint(0,2)]</em> into the loop to pick a new choice each tim...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Converting to int<p>I encounter a error when I try to convert a string variable which is read from a text file to int. How can I convert the number that is r...
<p>You can use the <code>Int32.TryParse</code> as mention in below code.</p> <pre><code> int no = 0; string number = "6"; Int32.TryParse(number, out no); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TypeORM not getting data saved by Prisma<p>I started migration TypeORM (using Nest.js) to Prisma queries.</p> <p>At some point I noticed that data saved with...
<p>As @Samathingamajig pointed out, it was indeed a different database!</p> <p>Wow. Just wow!</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mat-form-field not a known element<p><em>Hi, I went thru similar questions here but did not found solution for me so I am triing to ask with my code. I am tr...
<p>Simply add your <code>DialogComponent</code> in your declarations array in the app.module.ts after importing it correctly.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Button changing newest div item instead of the correct<p>I created a div table of sorts, where there is a button, and that button creates a box, and what is ...
<p>I think the problem is in the <code>test</code> function.</p> <pre class="lang-js prettyprint-override"><code>function test() { document.querySelector('#content').insertAdjacentHTML( 'afterbegin', `&lt;div class=&quot;grid-item-white&quot; id=&quot;combined&quot; onclick=changeColor('combined')&gt; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Turn a json list to a data frame<p>I have a json list that its saved as text, and i'm trying to convert it into a data frame.List looks like that:</p> <pre>...
<p>The issue you seemed to be having was with the quotation marks. If you have your JSON object saved as a text file, <code>{jsonlite}</code> will automatically escape those characters when reading the file. The defaults for <code>fromJSON</code> flatten lists into dataframes when possible, which is what you wanted.</p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you push a string into all users documents in a mongodb collection?<p>This is my subcommand code:</p> <pre class="lang-js prettyprint-override"><code>...
<p>You can use the <code>find</code> function from mongoose, then loop through all the found results.</p> <pre><code>const foundSchemas = await notificationSchema.find({}); foundSchemas.forEach(result =&gt; { result.Notifs.push('Your Notification'); result.save(); }) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to include python pex package in yocto image<p>I need to include python pex package into my yocto image. </p> <p>I tried to use setupautotools and pypi ...
<p>I think everything you need to write as the other python package are already there.</p> <p><a href="https://github.com/pantsbuild/pex" rel="nofollow noreferrer">https://github.com/pantsbuild/pex</a> is the github repo </p> <p><a href="https://pypi.python.org/pypi/pex" rel="nofollow noreferrer">https://pypi.python....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Configure Nexus 2 for https<p>We have installed and successfully working instance of Nexus Manager 2 with configured proxy to <a href="http://repo1.maven.org...
<p>While not always needed <a href="https://issues.sonatype.org/browse/NEXUS-5524" rel="nofollow noreferrer">https://issues.sonatype.org/browse/NEXUS-5524</a> leads me to believe you may need to trust the certificate in the https version of repo1.maven.org. See <a href="https://help.sonatype.com/display/NXRM2/Managing...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SqlAlchemy + psycopg2 using ssl certificate<p>So far I was using just psycopg2 to create my postgresql connection like</p> <pre><code>connection = psy.connec...
<p>I had</p> <pre><code>'sslcert' : os.environ.get('CA_FILE_PATH') </code></pre> <p>which was supposed to be</p> <pre><code>'sslrootcert' : os.environ.get('CA_FILE_PATH') </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Running a Laravel app in Fargate: which folders do I need to persist?<p>I am going to run a containerized Laravel app on AWS Fargate.</p> <p>Since the contai...
<p>yes, keep the session data. You can use the database driver for that. There's no need to save the cache. You may or may not want to save the logs (storage/logs/laravel.log) depending on your use case.</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 property only readable in a swift package while can be accessed outer of it?<p>I'm making a swift package using existing code to separate a cla...
<p>Every property has a combination of accessibilities for <code>get</code> and <code>set</code>.</p> <p>The default is</p> <pre class="lang-swift prettyprint-override"><code>internal internal(set) </code></pre> <p>You seem to want</p> <pre class="lang-swift prettyprint-override"><code>public private(set) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TypeOrm/PostgreSQL createQueryBuilder: select column from joined table<p>I want to select only a column from a table that I'm joining into. A <code>separator...
<p>I suppose your joined tables are not selected from because you use <code>innerJoin</code> method instead of <code>innerJoinAndSelect</code>. Additionally, since <code>getOne</code> returns objects with your entity type (<code>Separator</code> in your case), you need to make sure the relations between <code>Separator...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get SAML Signing Certificate data using Microsoft graph api<p>I'm using Http requests to retrieve data from Azure active directory, my goal is to retr...
<p>The SAML certificate info is available from the <code>servicePrincipals</code> endpoint, but not the <code>applications</code> endpoint.</p> <p>You'll find relevant info in the <code>KeyCredentials</code> and the <code>preferredTokenSigningKeyThumbprint</code> properties.</p> <p><strong>Portal view</strong></p> <p><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unhandled Exception: Unable to getUserMedia: getUserMedia(): DOMException, NotAllowedError<p>We're trying to make a video conferencing app. When running the ...
<p>Don't forget to add device permissions in the Android Manifest file.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I minimize somehow the 7-zip output/log in C#?<p>I am using this code to compress folders:</p> <pre><code>ProcessStartInfo p = new ProcessStartInfo(); ...
<p>If you set your process’s standard output to redirect, like so:</p> <p><code>p.RedirectStandardOutput = true;</code></p> <p>(<a href="https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.standardoutput?view=netframework-4.8" rel="nofollow noreferrer">read more about this here</a>)</p> <p>You can...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why can my comment consist of so much forward slash (/)?<p>I know that there are many types of comment, I will list out a few of them (those related):</p> <u...
<p>As per the C++ standard: <a href="http://eel.is/c++draft/lex.comment" rel="nofollow noreferrer">lex.comment</a></p> <blockquote> <p>The characters <code>//</code> start a comment, which terminates immediately before the next new-line character.</p> </blockquote> <p>From the above, you can infer that every character ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Meaning of the perl syntax construction involving a comma<p>I've encountered a piece of code in a book that looks like this:</p> <pre><code>#for (some_condi...
<p>Consider the following code:</p> <pre><code>$x=1; $y=1; $x++ , $y++ if 0; # note the comma! both x and y are one statement print "With comma: $x $y\n"; $x=1; $y=1; $x++ ; $y++ if 0; # note the semicolon! so two separate statements print "With semicolon: $x $y\n"; </code></pre> <p>The output is as follows:</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular 8, multiple different animations on multiple different elements at the same time<p>I have a div with some contents of which I need to animate its pos...
<p>solution: use one trigger with a group() inside of it:</p> <pre><code>trigger('moveAvatar', [ transition('* =&gt; maximum', [ group([ animate('800ms ease-in-out', style({ top: '15%', left: '90%', }) ), query('.text', [ ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Querying Child-Parent Table in Laravel<p>I am building a search box/calendar. However, I am getting <code>Unknown column 'product_name' in 'where clause'</co...
<p>You are not correctly using Laravel, you are not following naming conventions and your query is not right.</p> <p>This code:</p> <pre class="lang-php prettyprint-override"><code>public function search() { $other = $_GET['other']; $fromDate = $_GET['fromDate']; $toDate = $_GET['toDate']; $inventory =...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to read "std::greater<>{}" in "std::make_heap"<pre><code>// min heap solution // extract k smallest data from a min-heap of all n data points class K_Sma...
<p>According to the <a href="https://en.cppreference.com/w/cpp/algorithm/make_heap" rel="nofollow noreferrer">cppreference</a>:</p> <pre class="lang-cpp prettyprint-override"><code>template&lt; class RandomIt &gt; void make_heap( RandomIt first, RandomIt last ); template&lt; class RandomIt &gt; constexpr void make_hea...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change the color of the div depending on which button i click ? ( javascript/css/html ONLY no library)<p>i am trying to create a toast notification. I...
<p>You can pass in a 'status' parameter to your function and determine the color to be used based on the status, like this:</p> <pre class="lang-js prettyprint-override"><code>function toast(status){ const inputVal = document.getElementById("myInput").value; const container = document.getElementById("toastcon...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: symfony form login and api login in one project<p>I have a Symfony project. I used Easyadmin bundle and I used form login for security and authentication. I ...
<p>In recent versions of Symfony, at least, you can add your <em>list</em> of <code>custom_authenticator</code>s at the same level as the form_login.</p> <p>Two very useful commands to show the configuration - and all available options are:</p> <ul> <li><code>bin/console debug:config security</code> # what is currently...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Confusion about docker ENTRYPOINT<p>I am new to Docker, so bear with me. I have written a Dockerfile that creates an image with a Java language Spring Boot s...
<p>If you want to run a container with some default parameters you need to define these parameters in <code>CMD</code>:</p> <pre><code>ENTRYPOINT [ "./run-route-assessor.sh" ] CMD ["-cmd1 value1 -cmd2 value2"] </code></pre> <p>So you can run the container with just:</p> <blockquote> <p>docker run image-name</p> </...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Merging two data frames without duplicating metric values<p>I have two data frames and I want to merge them by leader values, so that I can see the total run...
<p>We can do a <code>replace</code> on those 'total' columns after a left_join</p> <pre><code>library(dplyr) left_join(df2, df1 ) %&gt;% group_by(leadername) %&gt;% mutate_at(vars(starts_with('total')), ~ replace(., row_number() &gt; 1, NA)) # A tibble: 4 x 6 # Groups: leadername [2] # leadername leader...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Alter text() while preserving children of element using XSLT<p>Considering the following example:</p> <pre><code>&lt;root&gt; &lt;a&gt;foo &lt;b&gt;bar&lt...
<p>You can define templates which match text nodes, not just elements. You could make a template which matches text nodes which are children of <code>a</code> elements, e.g.</p> <pre class="lang-xml prettyprint-override"><code>&lt;xsl:stylesheet xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot; version=&quot;3...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is my JetPack compose text so big (material design)<p>I am practicing Jetpack compose, by making a simple Application with multiple destinations (screen)...
<p>Are you using same implementation of MaterialTheme as they are and are you wrapping your screen in it? Their implementation is <a href="https://github.com/googlecodelabs/android-compose-codelabs/blob/main/BasicLayoutsCodelab/app/src/main/java/com/codelab/basiclayouts/ui/theme/Theme.kt" rel="nofollow noreferrer">here...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Customer cus_* already has the maximum number of payment methods attached<p>Almost never worked with a stripe. Once I solved the problem with payment and tha...
<p>You are seeing this error message, <code>maximum number of payment methods attached</code> as there is a limit on how many payment methods can be attached to a specific customer. The limit is 400 for cards and 200 for sources.</p> <p>To correct this, you can <a href="https://stripe.com/docs/api/payment_methods/detac...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is this component being rendered after throwing an error?<p>I’m currently following along with the React JS documentation and I’ve encountered an issue w...
<h1>Edit 2:</h1> <p>Well, the problem is in react version <code>16.12.0</code>, if you change it to <code>16.0.0</code>, it won't rerender twice. You can test this in <a href="https://codesandbox.io/s/blissful-bartik-f9gtj" rel="nofollow noreferrer">this codesandbox</a> by changing the react version.</p> <p>This is a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does invoke() do in Ursina module<p>I imported <a href="https://www.ursinaengine.org" rel="nofollow noreferrer"><code>Ursina</code> module</a>. It is a ...
<p>It's used for calling a function with a delay, similar to Invoke() in Unity. So in this case it will decrease player.y by 1 after 0.25 seconds.</p> <p>invoke(function, *args, **kwargs)</p> <p>Edit: Example from documentation:</p> <pre><code>def test_func(item, x=None, y=None): print(item, x, y) test_func('te...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot create or delete db on Plesk server<p>Today I came to the realization that I cannot add or delete any of the databases that belong to any of my client...
<p>Seems root@lo...got removed when you upgraded MariaDB few days ago.</p> <p><strong>Choice 1:</strong> It would have removed root@127... also and you would have used both root user references to your databases, connected dbs, <strong>views</strong>, etc. <strong>Views</strong> mainly as the error points to that also...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to create custom auto increment for string field in laravel<p>i need to save a custom auto increment string when a new product is created. What is the be...
<p>You could also use model event's. Below you have the boot function in which you would put into your model. After that you would have access to various of event's like creating, created, updating, updated .. so on and so for. We are interested in created, as it is triggered after your model is saved. </p> <p>The sta...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Permission error when configuring credential rotation in AWS Secret Manager<p>I'm following this <a href="https://aws.amazon.com/blogs/security/rotate-amazon...
<p>You need to grant Secrets Manager permission to invoke the policy - See <a href="https://aws.amazon.com/premiumsupport/knowledge-center/lambda-function-secrets-manager/" rel="nofollow noreferrer">https://aws.amazon.com/premiumsupport/knowledge-center/lambda-function-secrets-manager/</a></p> <p>'Grant Secrets Manage...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fill Remaining Column Space With Image<p>Hello I am working on a mockup with Bootstrap 4. I am wondering how I can fill in the remaining space of this red bo...
<p>After lots of looking around and trial and error, it was solved with a simple</p> <pre><code>img { height:100% } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there any way of doing unwrap_or_return an Error (any error)<p>Is there any way to simplify the returns in the following example (originally copied from <...
<p>You're looking for the <a href="https://doc.rust-lang.org/rust-by-example/error/result/enter_question_mark.html" rel="noreferrer">question mark operator</a>, possibly combined with <a href="https://doc.rust-lang.org/stable/std/result/enum.Result.html#method.or" rel="noreferrer"><code>Result::or</code></a> or <a href...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R categorize messy data through string matching<p>I am trying to categorize messy data with a dataframe with four columns:</p> <p>&quot;company_name&quot;, w...
<p>This answer is likely going to be incomplete because it's not clear exactly how your <code>company_type</code> is decided. My best guess right now is that it's based on the <code>company_name</code>, if it has related terms or not. This will definitely have to change based on the data you are putting in, and I imagi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Arduino function can't edit array<p><strong>Background</strong></p> <p>I've written an Arduino function which receives strings in the format <code>"a,b,c,d,...
<p>Your <code>readings</code> is an array of integers. And <code>split</code> is a pointer-to-char.</p> <p>The statement</p> <pre><code>readings[x] = split </code></pre> <p>stores split, which is the address of a character, as an integer value.</p> <p>If I write</p> <pre><code>const char *pointer = "42"; int addre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Converting Double type column to date format type pyspark retuning<p>I have a dataframe with double column ( 20180310), i want to convert it to Date format (...
<p>Because when you cast from double to string, the column will have this form: <code>2.018031E7</code></p> <p>cast to integer before casting to string:</p> <pre><code>df.withColumn( &quot;new_col&quot;, F.to_date(F.col(&quot;old_col&quot;).cast(&quot;integer&quot;).cast(&quot;string&quot;), &quot;yyyyMMdd&quot;)) </co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Property 'add' does not exist on type 'CollectionReference<DocumentData>'<p>I'm trying to do twitter-clone, but when i try to create function that will send ...
<p>The SDK v9 is modular. You need to import the methods you want to use.</p> <p>Importing the <code>add()</code> method as follows should do the trick:</p> <pre><code>import {collection, getDocs, add} from &quot;firebase/firestore&quot;; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I calculate distance between multiple latitude and longitude data?<p>I have 1100 station location (latitude and longitude) data and 10000 house locat...
<p>Here's a toy example for finding mass distances between <code>m</code> points and <code>n</code> cities. It should translate directly to your station/house problem.</p> <p>I brought up worldcities, spun the globe (so to speak), and stopped on four cities. I then spun again and stopped at two points. The two counts ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R Shiny Background color changes with each tab<p>I have a few tabs in the navbar (Home, Tab1, Tab2, etc). I want the Home page background color to be white, ...
<p>You need to pass the color from R to JS like this:</p> <pre><code>library(shiny) ui &lt;- tagList(tags$head( tags$script(" Shiny.addCustomMessageHandler('background-color', function(color) { document.body.style.backgroundColor = color; }); ") ), navbarPage(title = "App Title", id = "navba...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a formatted array from the timestamp column in a pandas dataframe<p>I have the following pandas dataframe called <code>df_time_series</code></p...
<p>IIUC get hours from DatetimeIndex by <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DatetimeIndex.hour.html" rel="nofollow noreferrer"><code>DatetimeIndex.hour</code></a>:</p> <pre><code>timeDataArray = pd.to_datetime(df_time_series.index).hour.to_numpy() </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: image viewer for windows that doesn't play slideshows in full screen<p>on linux I had a good image viewer that could run a slide show in multiple instances s...
<p><a href="https://www.irfanview.com/" rel="nofollow noreferrer">Irfanview</a> is a great photo viewer. It will show individual photos, it has a full-screen display or part screen with menus and toolbars. It has 'next' and 'previous' photo commands in both modes. It can do slide shows.</p> <p>It works fine on Windows...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to test a transformation in Palantir Foundry?<p>We try to create a test function for the whole transformation.</p> <pre class="lang-py prettyprint-overri...
<p>After trying out several approaches with different conditions, the following approach seems cleanest to me.</p> <ul> <li>no hard-coding paths to datasets</li> <li>it is very explicit about adding/removing transformation inputs</li> <li>in-memory dataframes are used as test inputs</li> </ul> <p><code>test_my_transfor...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Caused by: io.cucumber.datatable.UndefinedDataTableTypeException: Can't convert DataTable to int<p>I have am keep getting this error when i use integer, stri...
<p>You should change the order how you define your method parameters. So the below would work:</p> <pre class="lang-java prettyprint-override"><code>@Given(&quot;{string} post request sent with following data and count is {int}&quot;) public void myTestStep(String URL, int countValue, DataTable dataTable) { for(int ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change the view of the array<p>How can i change the view of the array for this query<code>select ['apple', 'orange', 'cucumber'] as name, 'Alice' student </c...
<p>Consider below:</p> <pre class="lang-sql prettyprint-override"><code>SELECT FORMAT('%T', ['apple', 'orange', 'cucumber']) AS name; -- or SELECT TO_JSON_STRING(['apple', 'orange', 'cucumber']) AS name; </code></pre> <p><a href="https://i.stack.imgur.com/OYQwSm.png" rel="nofollow noreferrer"><img src="https://i.stack....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: My very basic python program will not work and I don't know why maybe I am blind and tired but I can't tell<p>why do i get this error for this:</p> <pre><cod...
<p>You need to change the second line</p> <pre><code>prisoners = input('How many player(s): ') print('Welcome to Prison break!') if int(prisoners) == 1: print('Welcome solo player, bravest of the brave') elif 2 &lt;= int(prisoners) &lt;5 : print('Welcome prisoners, hold on to each other tight') elif 1 &gt; int(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CLion doesn't sort include statements on commit<p>I'm using clang-format to define rules for sorting my include statements. This works perfectly when using t...
<p>JetBrains Support confirmed to be that this is a bug within CLion that they managed to reproduce on their system.</p> <p>Hoping for it to be fixed in a future version :)</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Selecting number from string based on criteria<p>I have the following data set:</p> <pre><code>PATH = c(&quot;5-8-10-8-17-20&quot;, &quot;56-85-89-8...
<p>The below should be reasonably efficient, there is nothing wrong with your approach.</p> <pre><code>numpath &lt;- sapply(strsplit(PATH, &quot;-&quot;), as.numeric) maxindexes &lt;- lapply(1:length(numpath), function(x) which(numpath[[x]] &lt;= INDX[x])) result &lt;- sapply(1:length(numpath), function(x) max(numpath[...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I select an element basing on its dataset and using template strings?<p>I'm trying to select a paragraph element with the data-id equal to the variab...
<p>You should use <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors" rel="nofollow noreferrer">Attribute selector</a> (Equals):</p> <pre><code>p[data-id=${item.name}] </code></pre> <p><strong>Demo:</strong></p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mock private wrapper/primitive/String field<p>My question is not <a href="https://stackoverflow.com/questions/36173947/mockito-mock-private-field-initializat...
<p>You can simply inject the values yourself and then remove the <code>@InjectMocks</code> annotation. This can best be done in a setup method annotated with <code>@Before</code> so it gets executed for every test.</p> <pre><code>@Before public void setup() { MockitoAnnotations.initMocks(this); sample = new Sa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can't assign character while iterating through char pointer<p>I need to convert a <code>char*</code> into <code>char* []</code> in order to pass it as a func...
<p>The line</p> <pre><code>char *str = &quot;my_program -f 1 -o out.txt&quot;; </code></pre> <p>will create a <a href="https://en.cppreference.com/w/c/language/string_literal" rel="nofollow noreferrer">string literal</a> and make <code>str</code> point to that string literal.</p> <p>Your program is not allowed to modif...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Retrieve the value of the checkbox in Kivy<p>I am trying to retrieve the value of the checkbox on kivy to write some logic. Could someone please help me and ...
<p>First you have to give an <code>id</code> to the <code>Checkbox</code>:</p> <pre><code> Checkbox: id: check_box </code></pre> <p>... and then you have its state like this: <code>print(self.ids.check_box.state)</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NBuilder and DbContext invalid cast issue<p>I am really new to <strong>NBuilder</strong>, but it looks awesome so I thought I would have a go. I have a <code...
<p>The second solution was soooo close, it was simply this:</p> <pre><code>private static DatabaseContext CreateDatabaseContext() { var dbContext = Substitute.For&lt;DatabaseContext&gt;(); var items = Builder&lt;Hall&gt;.CreateListOfSize(10).Build().AsQueryable(); var dbSet = Substitute.For&lt;DbSet&lt;Ha...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Where is a "global bootstrap place" in Laravel<p>I am trying to install <a href="https://github.com/kylekatarnls/business-day" rel="nofollow noreferrer">kyle...
<p>One option is to place this in the <code>boot</code> method of your <code>AppServiceProvider</code>.</p> <pre><code>&lt;?php namespace App\Providers; use Cmixin\BusinessDay; use Illuminate\Support\ServiceProvider; class AppServiceProvider extends ServiceProvider { /** * Register any application services...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get column value of a row if it matches other column value from other row<p>Same as <a href="https://stackoverflow.com/questions/60019276/get-column-value-if...
<p>IIUC, you want to map the values in commentID_parentID with the values of usernameChannelId associated to the same Id. You can try:</p> <pre><code>#create the mapper s_map = df.loc[df.Id.ne('NULL'), :].set_index(['Id'])['usernameChannelId'] # create the column by mapping the values where comment_parentID is not NU...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add text to folium choropleth maps<p>I am using sample data from geopandas for this example. But basically what I want to do is have a choropleth map ...
<p>I don't have enough experience with geopandas, but in this case, <code>gdf.explore()</code> doesn't seem to have the ability to add annotations, so you can add a marker with html format text set with an icon on the folium side. If the map coordinate system in geopandas is The map coordinate system of geopandas is no...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: php How could I get keynames of an associative array<p>I have this array:</p> <pre><code>$rooms[&quot;100&quot;]['guestcount'] = 2; $rooms[&quot;200&quot;]['...
<p>How do you initialize the array $room? This code should work.</p> <pre><code>$rooms = []; $rooms[&quot;100&quot;]['guestcount'] = 2; $rooms[&quot;200&quot;]['guestcount'] = 2; $rooms[&quot;300&quot;]['guestcount'] = 1; $roomnumbers = array_unique(array_keys($rooms)); var_dump($roomnumbers); </code></pre> <pre><code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Issue when serializing JSON response into Java Object<p>Im a newbie in Java. I am trying to serialize a JSON response into a Java Object (UserData) but i am ...
<p>The exception speaks for itself, you're having a null pointer exception in the toString method. There is no need to use a .toString() on an Integer when contcatenating strings, you can change your toString() method like so:</p> <pre><code>@Override public String toString() { return &quot;{&quot; + &quot;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: iOS Deep Linking with Auto Login Token in the URL<p>I am new to deep linking in iOS and I am trying to make sign-in work with a magic link.</p> <p>The links...
<p>In your URL, <code>?autoLogin=</code> is a query item and not part of the path.</p> <p>In your <code>apple-app-site-association</code> you should just need to set the path to <code>/</code>. The <code>?</code> is messing it up since it's used to match any single character in the string.</p> <p>If you want to have ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Identifying the Pixel format(Like RGB, CMYK, LAB..etc ) of image in python<p>I have a set of images, I need to identify the image format. </p> <p>When I try...
<p>To determine the color scheme of image, use the following:</p> <pre><code>from PIL import Image img = Image.open(PATH_TO_IMAGE) img.mode </code></pre> <p>the field "mode" contains the data you need</p> <p>It is written in more detail here: <a href="https://pillow.readthedocs.io/en/5.1.x/handbook/concepts.html" re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How load() is supposed to be used<p>I'm trying to understand how SvelteKit renders my web app in different scenarios, and I'm a bit puzzled by <code>load()</...
<blockquote> <p>But why would I want to do both?</p> </blockquote> <p>Because server-side rendering tends to be faster on first load.</p> <p>When the user directly visits the site, the server-side rendered version displays content more quickly under certain conditions, e.g. on a slow network or underpowered hardware if...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mysql multiple order, one order by date with condition<p>I have a simple SQL request which orders the result by the number of sales and then by the number of...
<p>You can use the boolean expression <code>sales = 0 AND date &gt;= '2022-05-01'</code> in the <code>ORDER BY</code> clause, between the 2 columns:</p> <pre><code>SELECT * FROM io__image ORDER BY sales DESC, sales = 0 AND date &gt;= '2022-05-01' DESC, viewcount DESC; </code></pre> <p>See the <a href...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to implement JSON Response in Flutter carousel_slider 4.1.1<p>I have this API <a href="https://questinternational.ph/api/get_hotelphotos" rel="nofollow n...
<p>You can create a model and map the retrieved data with the API to facilitate further manipulation of the information in the code</p> <pre><code>class Hotel { final int id; final String photo; final double price; Hotel({ required this.id, required this.photo, required this.price, }); factory...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dto from multiple string in Entity mapstruct<p>I´ve being looking in SO for this question but can´t find an answer.</p> <p>I would like to know if there is ...
<p>From what I understood you would like to use the <code>IdentificationMapper</code> to map the <code>Identification</code> into <code>IdentificationEntity</code>.</p> <p>You almost got it. </p> <p>You need to tell MapStruct to map <code>identification</code> into the <code>identificationEntity</code> from the <code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I visualize the content of a datasets.Dataset?<p>I am using the Huggingface <code>datasets</code> library to load a dataset from a pandas dataframe. The ...
<p>The answer is simpler than you think. Just do</p> <pre><code>print(dataset[i]) </code></pre> <p>where <code>i</code> is the number of the row (first is 0).</p> <p>The output will be a dictionary with the features as keys and the content of the row as values.</p> <pre><code>print(dataset[0]) &lt;&lt;&lt; { &quot;a&q...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Global Constants in Python3<p>I have some code which was written in Python2.7 and I need to convert it to Python3. My problem is that I used this <a href="h...
<p>I quickly ported the old <code>const.py</code>. Be aware that it won't work if it's not in a file named <code>const.py</code>!</p> <pre class="lang-py prettyprint-override"><code>class _const: class ConstError(TypeError): pass def __setattr__(self,name,value): if name in self.__dict__: ra...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replace str values in series into np.nan<p>I have the following series</p> <pre><code>s = pd.Series({'A':['hey','hey',2,2.14},index=1,2,3,4) </code></pre> <p...
<p>You can use</p> <pre class="lang-py prettyprint-override"><code>out = s.mask(s.apply(type).eq(str)) </code></pre> <pre><code>print(out) 1 NaN 2 NaN 3 2 4 2.14 dtype: object </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get auto fill values(default values) on serializer create method in django?<p>I have a model like this:</p> <pre><code>class Post(BaseModel): ...
<p>Default values gets assigned when the instance is created. You are trying to print before that. If you want to get the id in craete function ,you can print after calling the super.create() . Do not forget to return the object later.</p> <pre><code>def create(self, validated_data): obj= super().create(validated...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: VBA for text to date<p>How to apply for all items below E4 and F4,G4,H4 and I4:<br /> The format as seen was has a mixture of &quot;21-07-21&quot; and &quot;...
<p>Please, use the next function:</p> <pre><code>Function convStrToDate(strD As String) As Date If InStr(strD, &quot;-&quot;) &gt; 0 Then strD = Replace(strD, &quot;-&quot;, &quot;/&quot;) Dim arrD: arrD = Split(strD, &quot;/&quot;) If UBound(arrD) = 2 Then convStrToDate = DateSerial(CLng(arrD(2)), ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Read configuration values in robot framework<p>I have a robot framework test automation product that runs in a docker container. All the configurations for t...
<p>I found the soultion.</p> <p>1.You create <code>.env</code> file as below and put all of your environment variables as below. This is the environment file that you are going to push in to the docker container.</p> <pre><code>HOST_ADDRESS=&quot;https://192.168.0.15&quot; DEFAULT_PORT=&quot;8056&quot; </code></pre> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why react-router-dom send the following message: No routes matched location "/shopping-cart"?<p>I am new to <code>react-router-dom</code> v6 and trying to ro...
<p>The code <em><strong>is</strong></em> missing a route matching <code>&quot;/shopping-cart&quot;</code>. <code>react-router-dom@6</code> <code>Route</code> components don't take paths with optional parameters. If you need to render a component on <code>&quot;/shopping-cart&quot;</code> <em><strong>and</strong></em> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CSS attribute selector does not work in Chrome<p>Since last week we have had issues with CSS on our website on the current version of Google Chrome. The page...
<p>Our customers had similar (intermittent) issues after upgrading to Chrome 103.</p> <p>After a lot of debugging and hair pulling I've discovered that Chrome simply discards <code>[data-attribute]</code> styles if there are 50 (or more) rules with <code>[data-attribute]</code> without any values ( as opposed to <code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Not able to integrate DialogFlow with Firestore<p>I want to use Firestore in my DialogFlow bot but it shows certain errors. This is my index.js code:</p> <p...
<p>Neither of these are errors, and shouldn't be preventing your webhook fulfillment from working.</p> <p>The "estimating Firebase Config" error just says that you haven't explicitly set a Firebase configuration, so it is making some assumptions based on the environment - most notably, that you're working in a Cloud F...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How friend function works<p>I wanted to learn how to use <strong>friend</strong> functions. When attempting it for the first time, I have little problem and ...
<p>These error messages</p> <blockquote> <p>|17|error: 'minutes' was not declared in this scope| </p> <p>|18|error: 'hours' was not declared in this scope|</p> </blockquote> <p>means that within this function definition</p> <pre><code>Time operator+(const Time &amp; t) { Time sum; sum.minutes = minute...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Clarify how docker command COPY behaves relative to docker build context<p>I want to copy the contents of a parent directory (relative to the position of the...
<p>You mention in a comment that your top-level <code>app-root</code> directory has a <code>.dockerignore</code> file that excludes the entire <code>docker</code> directory. While the Dockerfile will still be available, nothing else in that tree can be <code>COPY</code>ed into the image, and if you <code>COPY ./ ./</c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Gulp I need /dist to have node_modules and .git<p>I have folder structure like this</p> <ul> <li>dist</li> <li>src <ul> <li>public <ul> <li>index.html</li...
<p>Hoping this explanation will help you:</p> <p>The /dist folder would be self-sufficient if you have a npm script to build your project to the dist folder and then the npm script <strong>start</strong> to run your application from this folder.</p> <p>Another thing, the node_modules and the dist folder <strong><a hr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How Do I Get Django Poll Votes In Percentage Format?<p>I used the tutorial to create a polling app...and I've been expanding on it...I've got it working...bu...
<p>I was able to answer my question leveraging the solution documented here....</p> <p><a href="https://stackoverflow.com/questions/18933943/how-do-i-call-a-custom-method-on-a-model-with-a-template-in-django/18934029#18934029">How do I call a custom method on a model with a template in Django?</a></p> <p>My final answe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: i18n Translate.instant with parameters<p>I need to use TranslateService.instant from ngx-core and pass parameters to do string interpolation.<br> So far I've...
<p>For using the <code>instant</code> method, you have to be sure that your translations have been loaded and it is safe to use it, if not it will fail. That may be the point. </p> <p>The explanation is simple, you have three ways of loading the translation:</p> <ul> <li><p>You are sure that your translation files ar...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Boostrap-5 carousel is not working as it should be<p>I'm learning to build websites, and I'm been doing it by myself with tutorials and stuff. I'm in the par...
<p>You should add <a href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css" rel="nofollow noreferrer">bootstrap.min.css</a> and <a href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.bundle.min.js" rel="nofollow noreferrer">bootstrap.bundle.min.js</a> CDN references to the proje...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using R to produce Excel style combo graphs - for categorical data on x axis<p>I need to use R to create graphs with a primary and a secondary axis. I've som...
<p>It is a little tricky. You could try something like this. </p> <pre><code>library(tidyverse) lvls = c("Aries", "Taurus", "Gemini", "Cancer", "Leo", "Virgo", "Libra", "Scorpio", "Sagittarius", "Capricorn", "Aquarius", "Pisces") df %&gt;% mutate( star_sign =as.numeric(factor(star_sign, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pdf from web api service not opening<p>Below is my code, actually it downloads pdf file but it might be corrupt or something wrong with it. Can you please he...
<p>Thanks All, I have used &quot;SelectPDF&quot; library and it is working fine now!</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Different header template for cms pages<p>I would like to use two different header templates for a website. One for the home page and in other cms pages the ...
<pre><code>There are two ways: 1- &lt;?php if (is_front_page()): ?&gt; home header codes &lt;?php endif; ?&gt; other pages header codes 2- You should have two header files like: header.php &amp; header-home.php : &lt;?php if (is_front_page()){ get_header('home'); } el...