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: step function to N times for a task<p>I am finding a way to do this in , My scenario is I want to repeat a step until I am not finished my dynamic number of ...
<p>I wrote here an example of implementing a map in the step functions. I hope it will be helpful.</p> <pre><code>from aws_cdk import aws_stepfunctions import aws_cdk.aws_stepfunctions_tasks as tasks from aws_cdk import aws_lambda ... ... ... self.get_files = aws_lambda.Function( self, ....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: "TypeError: hashConstructor is not a constructor", error when using "@aws-sdk/signature-v4" on AWS-Lambda<p>I am developing a lambda in TypeScript that uses ...
<p>Import the packages like this</p> <pre><code>import crypto from &quot;@aws-crypto/sha256-js&quot;; const { Sha256 } = crypto; </code></pre> <p>And not like this</p> <pre><code>import * as crypto from &quot;@aws-crypto/sha256-js&quot;; const { Sha256 } = crypto; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Converting packed 64-bit integers to packed 8-bit integers with signed saturation using AVX512<p>I am looking for a solution for saturating packed 64-bit int...
<p><code>_mm256_cvtepi64_epi8</code> is AVX512. (Specifically AVX512VL; the 512-bit version is AVX512F). You tagged that but your (original) title only said AVX.</p> <p>Anyway, your options include doing saturated addition in the first place with <code>_mm256_adds_epi8</code> so you can have 8x as many elements per ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I add data to a column only if a certain value exists in previous column using Python and Faker?<p>I'm pretty new to Python and not sure what to even ...
<p>I'd slightly change the approach and generate a column <code>OS</code>. This column you can then transform into <code>With MacOS</code> etc. if needed.</p> <p>With this approach its easier to get the 0.5 / 0.5 split within Windows right:</p> <pre class="lang-py prettyprint-override"><code>from faker import Faker fro...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Break the character values into multiple names in SAS<p>Suppose I have a data set as follows</p> <pre><code>data mydat; input samplename$ value; datalin...
<p>For your particular task you can use the folowing code:</p> <pre><code>data mydat; length v1 v2 v3 $200; input v1 v2 v3 value; infile cards dlm=&quot;: &quot;; datalines; AA:77:D1 45 BB:08:D3 50 ; run; </code></pre> <p>Tom has absolutely correctly suggested more traditional and might be flexible for t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Even-Odd Train-Test Split with 2D array input and return two tuples of the form (X_train, y_train), (X_test, y_test)<p>trying to complete this function. Any ...
<p>Given your example data</p> <pre><code>data = np.array([[ 1.961e+03, 2.263e-02], [ 1.962e+03, 1.420e-02], [ 1.963e+03, 8.360e-03], [ 1.964e+03, 5.940e-03], [ 1.965e+03, 5.750e-03], [ 1.966e+03, 6.190e-03], [ 1...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error importing animated file from Blender to Unity<p>I'm having issues importing this files in Unity <a href="https://drive.google.com/drive/folders/1bspUVI...
<p>The problem is that it's a procedural model and not a &quot;normal&quot; Mesh. If I export as .fbx from blender and then import again, there's also just a cube. You'll have to somehow convert the procedural mesh into a static one.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to loop through and edit records from database entity table that has a checkbox checked in ASP.NET MVC C#<p>I'm having a hard time getting this to work. ...
<p>Are you certain your controller is passing records to your view? Try placing a break point at both returns from your controller and inspect your prod object.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TypeScript "Cannot find module" when using WebPack inline loader syntax, solve without using @ts-ignore?<p>I perfectly know why the error is raised but I can...
<p>Typescript allows you to declare a custom module import on your own, specifically you might use a <a href="https://www.typescriptlang.org/docs/handbook/modules.html#wildcard-module-declarations" rel="nofollow noreferrer">wildcard module declarations</a> so following things:</p> <ul> <li>Declare your custom typings f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to prevent duplication of values in local storage?<p>I'm coding a shopping cart with local storage support but it's not working properly. When i incremen...
<h1>Short version</h1> <p>You should compare using a method like <a href="https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Array/some" rel="nofollow noreferrer"><code>.some()</code></a> or <a href="https://developer.mozilla.org/fr/docs/Web/JavaScript/Reference/Global_Objects/Array/find" rel...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Removing duplicates and selecting distinct values with struct array in Bigquery<p>I'm getting started with BigQuery. I have a database that looks like <a hre...
<pre><code>with T AS (), unnested_and_unique as ( select distinct id, colour, count, shape, date from T left join unnest(arr) x ) select date,array_agg(struct(count,shape,id,colour)) as res from unnested_and_unique group by 1 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ERROR: syntax error at or near "." - JPA Pageable<p><code>repository</code>:</p> <pre><code>@Repository public interface PostRepository extends PagingAndSort...
<p>Basically you are not able to fetch the part of the inner collection. But you could reach it from the another side of the bi-directional relationship</p> <pre><code>@Repository public interface PostCommentRepository extends PagingAndSortingRepository&lt;PostComment, Long&gt; { @Query(value = &quot;SELECT pc FR...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Need help deserializing JSON data from an external Web API and storing the data in a SQL database<p>So, I'm working with JSON for the first time within ASP.n...
<p>Ok, so you could do this one of two ways:</p> <p>use netonsoft - parse the jason. (just like we do with xml - really a VERY simular approach).</p> <p>Or, build a class that represents the XML, or json data.</p> <p>So, in some cases, its easier to pluck out the values of the json string (using parsers and attribute s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I access only specific input fields using foreach loop in Laravel livewire?<p>I am a newbie here and using livewire, I'm doing multiple submissions s...
<p>You could convert your <code>array</code> to a <a href="https://laravel.com/docs/9.x/collections" rel="nofollow noreferrer"><code>collection</code></a> and then use the <a href="https://laravel.com/docs/9.x/collections#method-pluck" rel="nofollow noreferrer"><code>pluck</code></a> method to get the single field you ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to restrict the user from creating more than one doc in firestore database?<p>I have a form on my flutter app where the userr can submit his personal inf...
<p>Use setData</p> <pre><code>Firestore.instance. collection('users'). document('userID').collection('collection name').document('docId') set(data, merge: true) </code></pre> <p>Now this will create a new entry if it doesnt exist and update it if its existing</p> <p>From the docs</p> <blockquote> <p>setData(Map&l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Quasar2 Vue3 QSelect end of the multiple selection trigger when it loses focus<p>I have the following template:</p> <pre><code>&lt;template&gt; &lt;q-item ...
<p>Use slot:</p> <pre><code>&lt;template&gt; &lt;q-item tag=&quot;label&quot; v-ripple&gt; &lt;q-select borderless stack-label emit-value map-options multiple class=&quot;full-width&quot; v-model=&quot;model&quot; :options=&quot;options&quot; :label=&quot;name...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Character countdown isn't working when value is present<p>I have an input field and I added a character countdown to it via vanilla Javascript. The user can ...
<p>As mentioned in the comment section, simply calling the <code>countCharacters();</code> function under it's scope, will trigger the event that you seek for.</p> <p>Note that the white spaces here do count as the characters.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cartesian Product of Lists Using Ada<p>I am currently working on programming this (<a href="https://rosettacode.org/wiki/Cartesian_product_of_two_or_more_lis...
<p>Since each set of integers can be any length, including empty, I would start with a type that can handle all those situations:</p> <pre class="lang-ada prettyprint-override"><code>type Integer_Set is array(Positive range &lt;&gt;) of Integer; -- Input type type Integer_Tuple is array(Positive range &lt;&gt;_ of Int...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Most efficient way to compare two panda data frame and update one dataframe based on condition<p>I have two dataframe df1 and df2. df2 consist of "tagname" a...
<p>You can do this by calling an apply on your <code>comments</code> column along with a <code>loc</code> on your <code>bucketing_df</code> in this manner -</p> <pre><code>def find_type(a): try: return (bucketing_df.loc[[x in a for x in bucketing_df['tagname']]])['value'].values[0] except: retu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get department and manager's email through google admin sdk?<p>I am calling google admin directory api to get user through email and then storing the ...
<p>You already have the <code>User</code> object, so if you want to read the <code>department</code> property you only have to navigate its tree. See the example below:</p> <pre class="lang-js prettyprint-override"><code>function myFunction() { var user = AdminDirectory.Users.get(bmail); org = user['organizations']...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I move the Shop Page Title to the left? (Woocommerce+Custom theme{minimog theme})<p>I’ve tried everything and it just won’t work.</p> <p>This was my ...
<p>You could use flex.</p> <pre><code>.heading { display: flex; } </code></pre> <p>This is how it looks on my side.</p> <p><a href="https://i.stack.imgur.com/vf0oW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vf0oW.jpg" alt="enter image description here" /></a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R - split legend in two columns<p>I have the following R plot.</p> <pre><code>library(tidyverse) dat &lt;- data.frame( FunctionClass = factor(c("A", "B",...
<p>From <a href="https://stackoverflow.com/questions/18400432/creating-multi-column-legend-in-ggplot">this</a> post here is a solution to get a multi-colum legend:</p> <pre><code>p &lt;- dat %&gt;% gather("variable", "value", -FunctionClass, -legend) %&gt;% ggplot(aes(FunctionClass, value, fill = legend, group = v...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Increment the ifelse True count and write to a column<p>I have a tibble where I want to increment the count every time the if condition is met and write to a...
<p>We can use <code>replace</code></p> <pre><code>library(dplyr) library(stringr) treeTable_w_bucket &lt;- treeTable_w_bucket %&gt;% mutate(bucket = replace(Bucket, Feature == 'g201a', str_c('bucket_', seq_len(sum(Feature == 'g201a'))))) </code></pre> <hr> <p>Or using <code>base R</code></p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I can't run the executable of a game made with Bevy<p>I was following a bevy tutorial and I thought:</p> <blockquote> <p><em>What if I run the executable? Af...
<p>First, there is a big difference between <em>development</em> and <em>release</em>. Your <em>development</em> configuration should be focused on low build times, and your <em>release</em> configuration should be focused on portability.</p> <p><code>Bevy</code> recommends using the <code>&quot;dynamic&quot;</code> fe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: why does my std::transform retuns nothing/empty string?<p>can you help explain me how to use <code>std::transform</code> ? I need to create a function that r...
<p>You haven't allocated any space in <code>result</code>, so you are observing a pretty &quot;gentle&quot; case of undefined behavior (&quot;gentle&quot; because the program is observably not working, rather than happening to work by pure luck).</p> <p>To solve the problem, you can either allocate such memory before c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set the fixed height of the container inside the GridView.builder? should not depending on childAspectRatio<p><a href="https://i.stack.imgur.com/Tc3yl...
<p>I had the same issue and ended up calculating the <code>childAspectRatio</code> so that each cell ends up having the height that I want.</p> <pre><code>double cellWidth = ((MediaQuery.of(context).size.width - allHorizontalPadding) / columnCount); double desiredCellHeight = 200; double childAspectRatio = cellWidth /...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does a frame buffer attached to a texture have to be bound to a texture unit?<p>I'm trying to render to a frame buffer. I did this:</p> <pre><code> render...
<p>You don't have to bind the framebuffer texture to a texture unit while render to the FBO. The texture is associate with the framebuffer object, and when you bind the FBO before rendering, everything will be setup correctly.</p> <p>In your code, you only need the binding for <code>TexParameteri</code> and <code>TexIm...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reusing a UI of an existing document as part of another process/view<p>I have a use case where users can register themselves. Once registered, the users beco...
<p>You can use a bound view component to achieve this.</p> <p>See <a href="https://skyvers.github.io/skyve-dev-guide/views/#view-components" rel="nofollow noreferrer">https://skyvers.github.io/skyve-dev-guide/views/#view-components</a></p> <pre><code>&lt;component binding=&quot;member&quot; /&gt; </code></pre> <p>will ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to generate powersets with a maximum size in C#?<p>I am trying to generate all powersets from a given list within a limit of given maximum size. I've fou...
<p>It's easy with recursion:</p> <pre><code>static public IEnumerable&lt;List&lt;int&gt;&gt; FindAllCombos(List&lt;int&gt; list, int maxSize, int minIndex = 0) { yield return new List&lt;int&gt;(); if (maxSize &gt; 0) for (int i = minIndex; i &lt; list.Count; i++) foreach (var set in FindAll...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Regex in Python to find words with certain characters and without other characters<p>First off, I am new to regex and am using <a href="https://regex10...
<p>I guess you could iterate through your list of words and filter out which word you want or don't want, for example</p> <pre><code>words = ['about', 'alout', 'aotus', 'apout', 'artou', 'atour', 'blout', 'bottu', 'bouet', 'boult', 'bouto', 'bouts', 'chout', 'clout', 'count', 'court', 'couth', 'crout', 'donut', 'doubt'...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: response is empty when trying send a request GET with vanilla JS to express<p>I want to create a request GET that returns a <code>json</code> data type with ...
<p>I don't see any issue with the code It must be a cross domain issue. The reason it works from postman is it handle the preflight automatically. You need to enable cors in your express server like this.</p> <pre><code>const express = require('express') const app = express(); var cors = require('cors') app.use(cors(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to click on one of the items in a drop down list using selenium (python)<p>I am unable to click on the 'Search photos' button on flickr (image below i...
<p><em>Solved it</em> Just had to hit ENTER for the photos results page to show. Here is the single line of code I changed:</p> <pre><code> searchBar.send_keys(searchTerm, Keys.ENTER) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java - Thread using executor service<p>I'm learning executor service in java. Requirement is using executor service create 4 threads - </p> <p>Thread 1 - g...
<p>You could do this using multiple ways.</p> <p>For exanple, <strong>joining</strong>:</p> <p>A Thread can join another Thread, which means that it waits until the other Thread finishes. Thread 2 and 3 could join Thread 1 and Thread 4 could join Thread 2 and 3.</p> <p>Another possibility is <strong>await and signa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Groupby behavior on set_index<p>I have the following dataframe:</p> <pre><code> year state 0 0 2010 AK 24.524096 1 2010 AL 186.981422...
<p>Doing <code>ratio.set_index(['state', 'year']).sort_index()</code> gives the correct output. Thanks to @ALollz.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Button that sets imageView from the gallery, within fragment<p>I have tried many different solutions that I have found, this seems to be the closest i've bee...
<p>The <a href="https://developer.android.com/training/basics/intents/result" rel="nofollow noreferrer">Activity Result guide</a> uses selecting an image as its example, which uses the <a href="https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContracts.GetContent" rel="nofollow no...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firestore getting the value from different documents<pre><code>sportsRef.collection("sports").documents [ ["bowling" : [ "equipment": "bowling ball, bowling ...
<p>A query in Firestore limits what documents are retrieved from a collection. Since you want to retrieve all documents, you shouldn't be using a query.</p> <pre><code>db.collectionGroup("sports").get().addOnSuccessListener(new OnSuccessListener&lt;QuerySnapshot&gt;(){ @Override public void onSuccess(QuerySnapshot ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to stop MPSolver of Google OR-Tools at the first feasible solution found?<p>I have a MIP (BP, maximization) that takes too long to compute and I'd like t...
<p>can you try CP-SAT ? Does it fit there ? meaning no continuous variables.</p> <p>Can you remove the objective function ?</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to validate form on submit click with custom reusable hook?<p>I'm trying to make a custom reusable useForm hook with inputs validation. I want form to be...
<p>The reason the <code>console.log</code> is empty is because react state setting is asynchronous. It's probably setting it fine, it just happens shortly <em>after</em> the <code>console.log</code> because of how React batches state updates and runs them later seamlessly.</p> <p>I would suggest logging it in the rend...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google Cloud Run only has access to subset of metadata on http://metadata.google.internal<h2>Problem: Google Cloud Run only provides a subset of documented m...
<p><a href="https://cloud.google.com/compute/docs/storing-retrieving-metadata#default" rel="nofollow noreferrer">Compute Metadata service</a> you linked is only available to Compute Engine products (such as GCE, GKE). Many of the endpoints in there are about VM details, VM metadata/tags, VM startup scripts etc. </p> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does V8 give this confusing error message?<p>On chrome/node (v8 in general i suppose), the following gives an error message:</p> <blockquote> <p>Uncau...
<p>V8 developer here. This looks like a bug. Please file a bug at <a href="https://crbug.com/v8/new" rel="nofollow noreferrer">crbug.com/v8/new</a>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PHP Create temporary link to page/file<p>I am working on a website project, where you can login.</p> <p>I want to make a system where you can request a file,...
<p>Start with these 2 tables. Whenever you upload file or manually add it, add an entry in the <strong>files</strong> table. Whenever someone request a file, generate a link for it in <strong>links</strong> table like <code>https://host/download.php?id=the_random_string</code> which will point to the real file_id, with...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Chart.js Tooltip not showing all values of x-axis datasets in a specific point in line chart, issue with mode: 'index'<p>I used to use below configuration in...
<p>This is because you are updating to a new major version which has multiple major breaking changes, so is the tooltip config moved from the <code>options.tooltips</code> namespace to the <code>options.plugins.tooltip</code> namespace, if you change this it works as expected. I suggest you read the <a href="https://ww...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cassandra Python driver doesn't page large queries<p>It is said in the <a href="https://docs.datastax.com/en/developer/python-driver/3.25/query_paging/" rel=...
<p>Your test is invalid because your code is faulty.</p> <p>When you <code>list()</code>, you are in fact &quot;materialising&quot; all the result pages. Your code is not iterating over the rows but retrieving all of the rows.</p> <p>The driver automatically fetches the next page in the background until there are no mo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to be sure whether std::strtof succeeded or failed?<p>If <code>strtof</code> can't convert the string, it returns 0.0. <a href="http://www.cplusplus.com/...
<p>From <a href="https://en.cppreference.com/w/cpp/string/byte/strtof" rel="nofollow noreferrer">cppreference</a> for <code>float strtof(const char* str, char** str_end)</code>:</p> <blockquote> <p>If no conversion can be performed, ​0​ is returned and <code>*str_end</code> is set to <code>str</code>.</p> </blockquo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get the current directory of my exe, even when it is launched from another app or shortcut<p><strong>Solved.</strong></p> <p>I found out that the &quot;Start...
<p>As I already said in the comments <code>AppContext.BaseDirectory</code> has to return the correct path, you are doing something that is unknown to us.</p> <p>Here a proof that it is working as expected</p> <p>My WinForms application consists of this:</p> <pre><code>public partial class Form1 : Form { public Form...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make Sub Menu Always visible<p>I have menu navigation how to make sub menu always visible on the homepage only? <br />Thank You</p> <p><a href="https:...
<p>I could see you have a homepage parent class (.home) with body tag, so its easy,</p> <p>Try this,</p> <pre><code>.home .vertical-navigation .vertical-menu{ opacity:1; visibility: visible; } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to calculate PCKE's code_verifier?<p>I'm going through <a href="https://www.oauth.com/playground/authorization-code-with-pkce.html" rel="noreferrer">Okta...
<p>The PKCE code challenge is the Base64-URL-encoded SHA256 hash of the verifier. This means you need to take the original string, calculate the SHA256 hash of it, then Base64-URL-encode the hash. That's a lot of words, so let's walk through it.</p> <p>There are two problems with what you've tried to do above:</p> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Overlaying an image on another<p>I am using this code to show image</p> <pre><code>&lt;img class=&quot;imgpath&quot; /&gt; &lt;style&gt; .imgpath{ ...
<p>When using the <code>img</code> html tag, you are supposed to specify the <code>src</code>. Since you didn't, it displays a default small image showing that the browser couldn't get an image from <code>src</code>.</p> <p>You have at least two possibilities depending on what you intend to do:</p> <p>Use <code>src</co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: You can't submit updates as some information about your app is incomplete (Google Play)<p>Cannot update my app in Google Play since it says:</p> <blockquote>...
<p>After contacting Google Play support they replied and said that if you use analytics we need to choose <strong>YES</strong> on The AD_ID permission for an analytics use case on the Advertising ID section.</p> <p>You should not remove permission manually or remove analytics sub-modules that contain AD_ID permission s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Print indices of columns that are selected on click using the DT package in Shiny app<p>I have a selectable DT and a radio button that changes the orientatio...
<p>After more Googling, I found the answer.</p> <p>The answer is given here:</p> <p><a href="https://rstudio.github.io/DT/shiny.html" rel="nofollow noreferrer">https://rstudio.github.io/DT/shiny.html</a></p> <p>2.1.2 Column Selection Row selection is the default mode in DT. You can turn on column selection using <code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL Query Execution Plan Analyzer Tool<p>I am using RDS Aurora PostgreSQL and I am new in PostgreSQL. I have been trying to analyze Execution Plans for queri...
<p><a href="https://explain.depesz.com/" rel="nofollow noreferrer">https://explain.depesz.com/</a> is the one I always use. It has suggestions, and things like <code>SeqScan</code> are clickable and lead you to the related article.</p> <p>Also, consider running <code>explain (verbose, analyze, buffers)</code> for bette...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas DataFrame: replace column values in one df with column values from another df in case of only certain string characters should be replaced<p>I'm tryin...
<p>It looks like there are two components to your problem:</p> <ol> <li><p>you have integer keys in <code>df1</code> that map to specific animal strings in <code>df2</code> (e.g. <code>0 = 'cat', 1 = 'cat', 2 = 'dog'</code>, etc)</p> </li> <li><p>those integer keys are embedded in a string and need to be extracted some...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AWS Lambda - promise.all not working for s3.send DeleteObjectCommand<p>I have a strange issue of Promise.all not working for s3.send for DeleteObjectCommand....
<p>You're passing an array that contains a single nested array to <code>Promise.all</code>. You'll want to omit those <code>[…]</code> brackets when already using <code>.map()</code>:</p> <pre><code>await Promise.all(thumbSizes.map(size =&gt; removeObject( destnBucketName, `resized-${size.width}X${size.height...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Distribute divs over one line based on their given share in percents<p>I want to make a one-line graph of items that describes their distribution over time. ...
<p>As others have stated, the reason your widths are failing is because the <code>width</code> <em>attribute</em> is not valid on <code>&lt;div&gt;</code>s. You need to move it into the <code>style</code> attribute.</p> <p>However I'm chiming in to show how, with a simple adjustment, we can include the black seperator...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change HTML attributes using Flask and Jinja2 templates?<p>I am using Flask with Jinja2 templates. I have a Jinja2 loop populating a table. I have but...
<p>This kind of toggling is better handled in the front-end via JavaScript.</p> <p>Using Jinja2 template means handling it in the back-end, since the Jinja2 template is only re-rendered when the there is a new request and the view updates. You don't really want to hit the server just to toggle something on the webpage....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spread custom tick labels evenly over colorbar<p>I'm trying to add a custom colorbar to my heatmap using pyplot. My code looks something like this:</p> <pre...
<p>The axes for the ticks are in a range from 0 (bottom) to 1 (top). Dividing the space evenly into 6 parts will mark the bottom of each color region. Adding half of it will be nicely in the center. Therefore, <code>ticks=np.linspace(0,1,6,endpoint=False) + 1/12</code>. Or, equivalently, <code>ticks=(np.arange(6)+1/2)/...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I access strings in `strings.xml` from a Recycler Adapter class using `getString()` in Kotlin<p>I need to access strings in <code>strings.xml</code> ...
<p>I assume that the problem is cause because of the access of </p> <pre><code>Resources.getSystem() </code></pre> <p>I would strongly suggest to not do that.</p> <p>Suggestion from my side: Make the view in ListItemHolder as accessible field like this</p> <pre><code>inner class ListItemHolder(val view: View) </cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google Visualization stacked BarChart with interval, why is it stacking the interval?<p>Please see the below snippet for a stacked BarChart that has a min/ma...
<p>I have figured out that the two intervals must be just after the first data point in the array. Then it draws properly. I have posted the answer below.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Divide a value in JSON using postgreSQL<p>Im relatively new and would like to redenominate some values in my current database. This means going into my jason...
<p>Move the <code>jsonb_typeof()</code> check into the where clause:</p> <pre><code>update property_calculation set dynamic_fields = jsonb_set( dynamic_fields, '{totalBaseValue}', to_jsonb((dynamic_fields-&gt;&gt;'totalBaseValue')::numeric / 1000) ) where jsonb_...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does the error appear when I use the useUserData hook?<p>When I'm trying to use hook <code>useUserData</code> to save and display user data in the projec...
<p>Well, you are expecting that <code>onSnapshot</code> will magically be called right after you app loads - it needs some time to fetch document from your collection. I would add additional flag which indicate if data is still loading or not:</p> <pre class="lang-js prettyprint-override"><code>function useUserData(use...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add new column with min and max function in Pyspark and group by the data?<p>PySpark Dataframe: adobeDF</p> <p><a href="https://i.stack.imgur.com/OYq...
<p>How about the following?</p> <pre><code>adobeDF.groupBy("post_evar10").agg( f.min("start_date").alias("min_start"), f.max("end_date").alias("max_end") ) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert Python2 iterkeys() to python3<p>I have this line from python2 code:</p> <pre><code>m = w.iterkeys().next(); </code></pre> <p>When trying to run this,...
<p>There exist tool for such conversion called <a href="https://docs.python.org/3/library/2to3.html" rel="nofollow noreferrer"><code>2to3</code></a> let say you have <code>code.py</code> file with content as follows</p> <pre><code>import collections w = collections.OrderedDict(a=1,b=2,c=3) m = w.iterkeys().next(); prin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adjust variable if I have a empty table<p>I have a filtered dataframe:</p> <pre><code>börse2 = bör[(bör['Ausprägung'] == bor)].iloc[0:1, : ] </code></pre> ...
<p>So if use <a href="http://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#boolean-indexing" rel="nofollow noreferrer"><code>boolean indexing</code></a>:</p> <pre><code>börse2 = bör[(bör['Ausprägung'] == bor)] </code></pre> <p>And is necessary test empty dataframe use <a href="http://pandas.pydata.org...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# compare lists in a resource efficient way<p>this code works if string in list2 matches string in list1 and it is time efficient when it comes to larger li...
<p>Here's a two liner, along the lines of what Optional Option was thinking:</p> <pre><code>var hash = new HashSet&lt;string&gt;(list1); var reducedList2 = list2.Where(s =&gt; s.Split(',').All(e =&gt; !hash.Contains(e))).ToList(); </code></pre> <ul> <li><p>Put sally and joe in the lookup</p></li> <li><p>Enumerate the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NodeJS: Server.on-listenerfunction doesn't exist when exporting?<p>I am using server.js to start the server and router.js to listen to the requests. When I t...
<p>If you are looking to import the <code>router.js</code> and have the <code>server</code> object accessible in that file and execute the <code>on</code> method on it, one way to do it is by passing the <code>server</code> while requiring the <code>router.js</code> file as follows:</p> <p>server.js:</p> <pre class="la...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find and serve JavaScript files with Rails<p>I'm trying to install "<a href="https://rubygems.org/gems/wysiwyg-rails" rel="nofollow noreferrer">wysiwy...
<p>Usually, gems are meant to be used with Sprockets (the assets pipeline). Gems that support Webpacker integration usually have a matching <a href="https://yarnpkg.com/package/@rails/ujs" rel="nofollow noreferrer">yarn</a>/<a href="https://yarnpkg.com/package/turbolinks" rel="nofollow noreferrer">npm</a> package.</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use a .h file without header guards multiple times<p>Currently I have a .h file provided by a professor that I'm not allowed to modify. I have to use...
<p>You can either wrap it with a second header <code>guarded_header.h</code> that has the guards:</p> <pre><code>#ifndef GUARDED_HEADER_H #define GUARDED_HEADER_H #include "unguarded_header.h" #endif </code></pre> <p>Then in your source:</p> <pre><code>#include "guarded_header.h" </code></pre> <p>or you could just ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python Ctypes - String to c_char_p to c_void_p and back<p>I'm being unable to create certain C data structures in Python using Ctypes and then read them back...
<p>The 2nd instance that fails is due to <code>c_char_p(bytes('hi', 'ascii')</code> being the only reference to the object. Python doesn't know that C saved that pointer, so after that line executes the object is destroyed and the pointer that C saved is now invalid. Referencing it is undefined behavior.</p> <p>In th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does Yarn 2 support --offline mode like v1.x?<p>I am using <strong>Yarn 1.21</strong>, and with a couple of manual steps I am able to make the offline mode w...
<p>I found out that <strong>Yarn 2</strong> <em>will</em> support an offline mode, which is referred to as the <em>Yarn cache</em>, from this answer below thanks to arcanis:</p> <pre><code>the offline mirror has been merged with the Yarn cache, so any time you see the word "cache" you can think of it as what was previ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a difference between PDO::exec and PDO::query when using PDO::ATTR_PERSISTENT = true?<p>There seems to be a difference between <code>PDO::exec</code...
<p>If you are using <code>exec()</code> for <code>SELECT</code> then you are already doing something wrong. This function (<a href="https://www.php.net/manual/en/pdo.exec.php" rel="noreferrer">as is mentioned in the manual</a>) does not fetch results from the database. It can only be used for queries, which produce no ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Items in grid don't resize in response to animation<p>I have a grid of four squares and I want the other squares to shrink responsively when one expands on h...
<p>I just <a href="https://twitter.com/ChallengesCss/status/1545367863250264075" rel="nofollow noreferrer">did something similar</a> (related article for full detail: <a href="https://css-tricks.com/zooming-images-in-a-grid-layout/" rel="nofollow noreferrer">https://css-tricks.com/zooming-images-in-a-grid-layout/</a>)<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Finding target coordinates from given coordinates<p>Hi their I have an excercise and below is my solution to it. Is their a better solution?</p> <blockquote>...
<p>If the number of lines is what concerns you, you can replace:</p> <pre><code>int fx; int fy; int zx; int zy; int xgleich = 0; int ygleich = 0; int cnt = 1; </code></pre> <p>with</p> <pre><code>int fx, fy, zx, zy, xgleich = 0, ygleich = 0, cnt = 1; </code></pre> <p>and</p> <pre><code>if (fx &lt; zx) { fx++; } els...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Select elements from json array based on 2 criteria<p>I am fetching the list of issue comments on a specific PR with the following <code>curl</code> command<...
<p><code>select</code> is the function that filters by criteria.</p> <p>Use with <code>map</code> to retain the array structure</p> <pre class="lang-bash prettyprint-override"><code>jq 'map(select(.user.login == &quot;foobar&quot;))' </code></pre> <p>Or iterate and get just the matching items</p> <pre class="lang-bash ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ASP.NET Core 6 How to redirect from one view to other<p>tl:dr: I would love to redirect from my Layout view into an index view of a certain class. I do not w...
<p>According to your description, if you want to redirect the view from layout to another view, I suggest you could consider using the <code>Context.Response.Redirect(&quot;~/Account/LogIn&quot;);</code></p> <p>More details ,you could refer to below example:</p> <pre><code>@if (Context.User.Identity.IsAuthenticated)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Years of Service Anniversary formula - Cognos Analytics - Costpoint 8.0.0<p>this one has been bugging me for a few weeks... I'm trying to write a formula in ...
<p>In the absence of start dates, which would be easier, and handling the more general case (What if they are approaching 45 years of service?):</p> <pre><code>case when MOD(MOD([Years Of Service], 5) + 1, 5) &gt; 0.91 and MOD(MOD([Years Of Service], 5) + 1, 5) &lt;= 1 then 'yes' else 'no' end </code></pre> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android: Always receiving null object in extras passed in the intent<p>I am creating a recycler view in my app and fetching data from firestore for the same....
<p>You are calling <code>startActivity</code> twice that cause the problem. </p> <p><strong>Option - 1:</strong> Try removing inside <code>itemView.setOnClickListener</code> like below :</p> <pre><code>itemView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Sys...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to play video from tests saved in cypress container?<p>How do I play video from tests saved within cypress container ? One of my tests is failing when ru...
<p>After a test run just copy over the saved video from the container to your host machine:</p> <pre><code>docker cp container_name:/e2e/cypress/path/to/video/file /path/to/your/local/folder </code></pre> <p>Replace container_name and update the path to video file (will be the same as running through terminal) and save...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does my elementary cellular automata not display the right image given a certain rule-set?<p>I have recently made a simple elementary cellular automata v...
<p>I've introduced a function that avoids out of range subscripts called <code>get_gen()</code>.</p> <p>This one assumes everything beyond your array is barren 0.</p> <p>For your rule the live cell 'moves' left and then falls out of the <code>world</code> at that barren edge.</p> <p>As others point out you could execut...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add custom close button for antd modal?<p>I want to add custom close button for antd modal. How can I do so?</p> <p>This is my current close button</p...
<p>You can use API property called closeIcons on Model div like this:</p> <pre><code>&lt;Modal title=&quot;Modal 1000px width&quot; centered visible={visible} closeIcon={&lt;LogoutOutlined /&gt;} // Choose any icon you need. &gt; &lt;p&gt;some contents...&lt;/p&gt; &lt;p&gt;some contents...&lt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change font style to "Arial" for tab_model() output<p>I am trying to change the font style of my tab_model() table to Arial but am still failing after...
<p>You can use the <code>CSS</code> argument inside <code>sjPlot::tab_model</code>.</p> <pre class="lang-r prettyprint-override"><code>library(sjPlot) # Sample fit fit &lt;- lm(mpg ~ wt, data = mtcars) # Table tab_model(fit, CSS = list(css.table = '+font-family: Arial;')) </code></pre> <p><a href="https://i.stack.img...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a way to add translate-z-[ ] utility class<p>I would like to add translate-z-[] utility class to my tailwindcss classes so I could use parallax scro...
<p>Yes, you can create <a href="https://tailwindcss.com/docs/plugins#dynamic-utilities" rel="nofollow noreferrer">plugins</a> for custom utilities</p> <p>You config should have something like this</p> <pre class="lang-js prettyprint-override"><code>const plugin = require('tailwindcss/plugin'); module.exports = { the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to keep only 'stable' values in a list in F#<p>I have the following data:</p> <blockquote> <p>[ 0, +1, +1, +1, 0, +1, -1, -1, 0, -1, -1, -1, -1, +1, +...
<p>I don't think there is any easy way to do this using built-in F# functions. However, if you define one helper operation, then you can solve this nicely.</p> <p>The helper is a function that I'll call <code>groupAdjacentBy</code> which groups together adjacent elements in the list based on some function that compute...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Waiting for a Task conditionally<p>For an <code>async</code> method that returns a <code>Task&lt;bool&gt;</code>, I need to take some actions when the method...
<p><a href="https://blog.stephencleary.com/2012/07/dont-block-on-async-code.html" rel="nofollow noreferrer">You shouldn't block on async code</a>. In short, you're very likely to be blocking the thread that the async method needs to return to (in this case you are, as it's the UI thread). The solution is to use async-a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: BizTalk send port throws error System.Net.WebException: The HTTP request was forbidden with client authentication scheme 'Anonymous'<p>I am getting the error...
<p>That error occurs if the web service is expecting some authentication and BizTalk is not sending any credentials or other authentication. So you need to go into the Security tab, set the <code>Security mode</code> to either <code>Transport</code> or <code>TransportCredentialOnly</code> and select a <code>Transport ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mean of dictionary's values, where values are in the form of a list/array. (one liner)<p><strong>Background:</strong></p> <p>Not sure if I have all my termi...
<p>This is possible to write in one line, but I wouldn't recommend it:</p> <pre><code>&gt;&gt;&gt; plt.plot(*zip(*{k: np.mean(v) for k, v in k_to_accuracies.items()}.items()), '.') </code></pre> <p>As you can see, this is rather opaque, and, while it produces the correct input, the versions in your question are far e...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Visual Studio/Chrome not updating HTML/Typescript<p>I am running my company's application locally and making some HTML/TS changes. However, whenever I save/h...
<p>It turns out the problem was with Chrome. Inside Dev Tools -&gt; Settings -&gt; Network -&gt; Disable cache (while DevTools is open).</p> <p>When I clicked this option, it stopped caching old changes, and I was able to see my updates again with each hot reload.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: writing more than one parameter to a firestore database with dialogflow<p>I have created a dialogflow agent to register some informations from the users, ain...
<p>Change your function to this</p> <pre><code>function cadastroHandler(agent) { let { nome, estado, cidade, coord, wppcoord, emailcoord, area } = agent.parameters; db.collection("cadastros").add({ nome: nome, estado: estado, cidade: cidade, coord : coord , wppcoord : wppco...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cookie not stored on response/redirect<p>I simply cannot make a 302 redirect send a cookie.</p> <p>I have a 302 request at <code>https://mysite-api.azurewebs...
<p>It seems that when doing a redirect you simply <strong>must</strong> have the UI and API on the same domain.</p> <p>Since this was the case in production, I had to ensure my development environment is also hosted on the same domain, and then the cookie:</p> <pre><code>Token=ABCDE; Max-Age=2592000; Path=/; Domain=sub...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JQ replacing values in one array based on values from different array<p>I would like in JQ to substitute the values in the first array with the names in the ...
<p>With <strong>json</strong> input file:</p> <pre><code>[ [ {&quot;size&quot;:0},{&quot;size&quot;:1},{&quot;size&quot;:2},{&quot;size&quot;:3},{&quot;size&quot;:4}, {&quot;size&quot;:5},{&quot;size&quot;:6},{&quot;size&quot;:7},{&quot;size&quot;:8},{&quot;size&quot;:9}, {&quot;size&quot;:0...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: string placeholder replacement program in javascript<pre><code>function format(template, ...values) { return template.replace(/{(\d+)}/g, (_,i) =&gt; val...
<p>_ in fat arrow function is called as <strong>throwaway variable</strong>.</p> <p>The underscore symbol <code>_</code> is a valid identifier in JavaScript, and in your example, it is being used as a function parameter.</p> <p>A single underscore is a convention used by some javascript programmers to indicate to oth...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get random time within next hour from given time?<p>I have a object which returns DateTime. I need to generate a random time within next hour.</p> <p...
<p>You can generate random minutes between <code>0-60</code> using <a href="https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ThreadLocalRandom.html#nextInt-int-" rel="noreferrer">ThreadLocalRandom</a> and add them to <code>ZonedDateTime</code></p> <pre><code>ZonedDateTime result = date.plusMinutes(Thread...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: User paths in R<p>The following is a sample of the dataset I am working on. I am trying to assess which users create a request on the contact form and are su...
<p>You can use <code>cumsum()</code> to create identifiers for all created requests. Then check if the send button was clicked in each request with <code>any()</code>.</p> <pre class="lang-r prettyprint-override"><code>library(tidyverse) paths %&gt;% group_by(session_id) %&gt;% mutate(request_id = cumsum(Page == ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: wordpress php shortcode output<p>I am trying to connect a filepath to my wordpress page. The filepath I am trying to connect to should be:</p> <pre><code>'/w...
<p>The <code>add_shortcode</code> function requires all the output to be returned not echoed</p> <p>From the docs: <a href="https://developer.wordpress.org/reference/functions/add_shortcode/" rel="nofollow noreferrer">https://developer.wordpress.org/reference/functions/add_shortcode/</a></p> <blockquote> <p>Note that t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Shell script to backup filtered directories<p>I have several directories that I want to backup to a zip file with a shell script. Directory tree looks like t...
<p>The pathnames returned by <code>find</code> already begin with <code>$SRCDIR</code>, you don't need to concatenate it when you run <code>zip</code>. You're trying to add <code>/testing/source/testing/source/fiction_01</code> to the zip file.</p> <pre><code>zip -r $DESTDIR$BKPNAME $CHLDIR </code></pre> <p>When you'...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get content from local server when accessing a custom local url (http://localost:8080 from http://localhost/testing)<p>I apologize if i'm being vague, but i ...
<p>The question would be much clearer if you used complete URLs. I'm guessing what you're asking for is a redirect or a proxy:</p> <p>From http://localhost/testing To: http://localhost:8080</p> <p>The solution would be to install a web server (separate from the python SimpleHTTPServer) that is configured to listen on p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create ToDo-Tasks for other users<p>Is it possible to create a ToDo-Task for other users using a single Admin login?</p> <p>I have registered an app, and set...
<p>What you need is application permission, however, Graph ToDo tasks API is not yet supported. <a href="https://i.stack.imgur.com/T1vwH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/T1vwH.png" alt="enter image description here" /></a></p> <p>For more information, check document:<a href="https://do...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: wx.listctrl focus imprcise<p>dear all:</p> <p>I am using list ctrl in a wxPython Frame.</p> <pre><code>self.listCtrl = wx.ListCtrl(self.framePanel, size=wx.D...
<p>I am not convinced that <code>SetFocus</code> is fundamentally different from <code>EnsureVisible</code>, which simply ensures that the list has been scrolled sufficiently, to ensure that item is visible.<br /> Try <code>self.listCtrl.Select(60)</code> in tandem with <code>self.listCtrl.Focus(60)</code> so that the ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Event Data is undefined after confirmation modal has been clicked<p>I have a dropdown from the semantic-ui package, which works fine when I don't include the...
<p>You cannot get configId(data.value) from handleConfirm because, handleConfirm is a callback function which is fired when you click the "yes" button on <code>&lt;Confirm/&gt;</code>, it has no idea of which option you just selected. The only place you can get that information is the onChange callback on that <code>&l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replicate column based on colnames in R<p>I have a data frame in <em>R</em>, namely <code>data</code> as follows:</p> <pre><code>set.seed(123) data &lt;-...
<p>This is against naming conventions!!!</p> <pre><code>library(dplyr) data %&gt;% mutate(` `= rep_len(colnames(data), length.out=nrow(data)), .before=1) </code></pre> <pre><code> A B C D 1 A -0.56047565 0.4007715 -0.6250393 0.55391765 2 B -0.23017749 0.1106827 -1.6866...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting value from datepicker and assign to php<p>I have a form for booking an appointment with 1 inputs and 2 selects: <strong>First</strong>: input with jQ...
<p>You need to make an <a href="https://api.jquery.com/jquery.ajax/" rel="nofollow noreferrer">AJAX request</a> each time the user selects a date. For this to work you can use the datepicker library's <a href="https://api.jqueryui.com/datepicker/#option-onSelect" rel="nofollow noreferrer">onSelect` event</a>.</p> <ol>...