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: python variable lambda expression shortcut method for sorted expression<p>The following code works but it's very ungainly:</p> <pre class="lang-py prettyprin...
<p>This can be implemented with closures:</p> <pre><code>def nested_itemgetter(keys): def getter(val): for key in keys: val = val[key] return val return getter </code></pre> <p>Or class:</p> <pre><code>class NestedItemGetter: def __init__(self, keys): self.keys = keys ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to run android project. Gradle sync failing becuase of GradleConnectionException<p>Android studio showing error when try to build project.</p> <pre><c...
<p>Change <code>distributionUrl</code> in <code>gradle-wrapper.properties</code> from</p> <pre><code>distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip </code></pre> <p>to</p> <pre><code>distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip </code></pre> <p>and syn...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SingleChildScrollView not working for password textfield in Flutter<p>I am currently creating my first flutter application. So, when I was testing the login ...
<p>I was able to solve the problem by removing the &quot;Center&quot; widget.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there any way to extract value list from map in presto query?<p>i have table with a column that has two columns: ID (bigint), Vals (map&lt;bigint, float&g...
<p>You may use <a href="https://prestodb.io/docs/current/sql/select.html?highlight=unnest" rel="nofollow noreferrer"><code>unnest</code></a> to turn map into rows and <a href="https://prestodb.io/docs/current/functions/map.html" rel="nofollow noreferrer"><code>map_values</code></a> to get values as an array:</p> <pre><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Look for a string in a data frame and select the rows with R<p>I have a table like this</p> <div class="s-table-container"> <table class="s-table"> <thead> <...
<p>We could use <code>if_any</code> with <code>str_detect</code></p> <pre><code>library(dplyr) library(stringr) df1 %&gt;% filter(if_any(everything(), ~ str_detect(.x, 'A|3|y'))) </code></pre> <p>-output</p> <pre><code> ColumnA ColumnB ColumnC ColumnD 1 A x 1 k1 2 C z 3 ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to apply a vega theme when using vl2png<p>I have a <a href="https://github.com/vega/vega-lite" rel="nofollow noreferrer">vega-lite</a> chart specificatio...
<p><code>vega-themes</code> aren't available from the <code>vega-cli</code> utilities – they are instead embedded in <code>vega-embed</code>. The good news is that since themes are merely <a href="https://vega.github.io/vega/docs/config/" rel="nofollow noreferrer">vega config</a> objects, you can just manually include ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to get ip address as a string<p>I'm developing a network sniffer based on <code>libpcap</code> in C programming language.</p> <p>Already I have one funct...
<p><code>ip</code> is not initialized.</p> <pre><code>char *ip = malloc(20); ip[0] = 0; </code></pre> <p>You should check the result of <code>malloc</code> to avoid dereferencing the NULL pointer</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can youtube uploader block video from being played in IOS app<p>I would like to play youtube videos in an IOS app using youtube API. Can a video's uploader ...
<p>Yes, youtube video can be blocked from being played in IOS apps at the discretion of the content uploader.</p> <p><a href="https://youtube-eng.googleblog.com/2011/12/understanding-playback-restrictions_28.html" rel="nofollow noreferrer">https://youtube-eng.googleblog.com/2011/12/understanding-playback-restrictions_...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add transition to sections on my website<p>I am making a custom-coded site. I want to add a transition to sections when they come into the viewport. I...
<p>This could very easily be solved using a <code>scroll</code> event listener on <code>window</code>, tracking exactly when a given HTML section comes into view and then add a class on it that fades it in.</p> <p>Or as a much more simpler method, which I'll prefer, you could use the <code>IntersectionObserver</code> A...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I limit the expanding of my input?<p>I have a label and an input in a div. this div is a grid. the width of my input is set to 100%.</p> <p>Currently...
<p>Here you go bro, a simple solution of <code>margin: 0 auto;</code> this will center it and you can change your desired width.</p> <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt; &lt;html lang=&quot;en&quot;&gt; &lt;head&gt; &lt;meta charset=&quot;UTF-8&quot;&gt; &lt;meta http-equiv=&quot...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Explain what for (char c : str) does?<p>I am asking since I couldnt immediately find an answer on google, I know the answer is simple.</p> <p>what does for ...
<p>It iterates the individual characters of <code>str</code>, copying each one to the (local) variable <code>c</code> for use in each iteration of the loop.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to remove extra occurrences of a letter in a string?<p>Using Javascript is there a way to remove extra occurrences of a specific letter in a string?</p> ...
<p>Sorry, I misunderstood your question.</p> <p>To only keep one instance of specified char:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>function onlyOneCharOf(string, pa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Axios requests using authentication token sometimes fail in Safari<p>I'm developing a react (16.9.0) single page app that uses axios (0.19.0). The axios requ...
<p>The solution was to add a trailing slash to urls referencing a single object. The <a href="https://www.django-rest-framework.org/api-guide/routers/" rel="noreferrer">DRF Router docs</a> indicate the correct pattern is:</p> <pre><code>URL pattern: ^users/{pk}/$ Name: 'user-detail' </code></pre> <p>Whether it's a bu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ADF - Data flow limiting number of rows on group by<p>I have a dataflow that reads data from an excel that has &gt;100,000 rows.</p> <p>I've added a <strong>...
<p>I don't know what the limit is or where it is documented, but it appears the issue was when using the sink type <strong>Cache</strong>. I changed it to a dataset and output the data to files and it exported everything I was expecting.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to reproduce ASP.NET Core 6 conventions (post configure route)<p>Documentation contains something unclear and unbind to finally result description about ...
<p>I found PostConfigure convention in MS source code.</p> <p><a href="https://i.stack.imgur.com/Wcuio.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Wcuio.png" alt="IdentityDefaultUIConfigureOptions" /></a></p> <p>So, if you want to add 13 attributes and PostConfigure convention you need to somethi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Formula to get crossed values<p>I am trying to get values from other column, based on some logic, crossed logic, but I didn't get any result with the only th...
<p>I'd say the fastest way with formula takes two columns. The first one (let's say column C) will use this formula to define the blocks:</p> <pre><code>=IF(A5=&quot;&quot;,C4+1,IFERROR(C4+0,0)) </code></pre> <p>It's meant for cell C5.</p> <p>The second column will give back the actual result:</p> <pre><code>=SUMIFS(B:...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: passing all init variables to self<p>Is there a standard way to pass all arguments defined in <code>__init__()</code> to the whole class (as self arguments)?...
<p>As per <a href="https://stackoverflow.com/a/1389304/14720380">this</a> answer you can do this:</p> <pre><code>class X(object): def __init__(self, x, y, z): vars = locals() # dict of local names self.__dict__.update(vars) # __dict__ holds and object's attributes del self.__dict__[&quot;sel...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does [{:keys [var1 var2] :as something-else] mean in Clojure argument list?<p>I am reading an open source project and trying to understand this function...
<p>It's called <a href="https://clojure.org/guides/destructuring" rel="nofollow noreferrer">destructuring</a>.</p> <p>This particular case is analogous to</p> <pre><code>(fn [msg] (let [type (get msg :type) request-id (get msg :request-id)] ...)) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Turning sets of adjacent cells in the same row into a new row in Pandas<p>After scraping data from an unordered list on a web page, I ended up with rows like...
<p>You could try as follows:</p> <pre><code>import pandas as pd import numpy as np data = [['cateogory1', &quot;cat1_item1&quot;, &quot;foo&quot;, &quot;http://example.com&quot;, &quot;cat1_item2&quot;, &quot;foo&quot;, &quot;http//def.com&quot;], ['cateogory2', &quot;cat2_item1&quot;, &quot;foo&quot;, &quot;http://uv...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: host.docker.internal didn’t send any data for WebStatus endpoint<p>I am trying to run <a href="https://github.com/dotnet-architecture/eShopOnContainers" rel=...
<p><em>host.docker.internal</em> is for docker internal communication mainly - not external connection to container (for example from localhost). You can open any container in docker desktop and try clicking browse web (if applicable) or as suggested above in comments use localhost:5107</p> <p>A little background from ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to fill carriage return printed string with whitespaces until end of line?<p>I'm trying to do something that should (and perhaps is) quite simple, but I ...
<p>You can print clean line consisting of spaces and then print your new line, for example:</p> <pre class="lang-py prettyprint-override"><code>import random from time import sleep countries = [&quot;Argentina&quot;, &quot;USA&quot;, &quot;Canada&quot;] for _ in range(10): # clear the line print(&quot; &quot;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: running regression with clusters from k means<p>I did k means clustering by running below code</p> <pre><code>X_std = StandardScaler().fit_transform(df_logre...
<p>You've just applied Kmeans clustering on <code>X_std</code>. With the Sklearn package, you can extract the labels and fill them into the appropriate clusters.</p> <p>Assuming your X_std is a 2x1 np array (i.e. <code>np.array([[1,2],[3,4],[4,5]]...</code>))</p> <pre><code>cluster_1 = [] cluster_2 = [] for i in range...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What file is facebook looking for<p>I'm getting this error when trying to build in Unity or Android Studio</p> <pre><code> * What went wrong: Could n...
<p>Turns out facebook updated their dependencies file.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to save multiple records in Laravel<p>To save 1 data is like this. Should I loop the <code>-&gt;save();</code> part so I can make 2 or more different col...
<pre><code>public function store(Request $request) { $data = $request-&gt;all(); $mark = new Record(); $mark-&gt;out_of = $data['out_of']; if ($data['student_id']) { foreach ($data['student_id'] as $row =&gt; $value) { $data1 = array( 'out_of' =&gt; $mark-&gt;out_of, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to apply multiple colors to multiple columns in gt R Package<p>I use the {gt} package a lot at work; however, I have to apply multiple colors to multiple...
<p>Here is one way using a for loop:</p> <pre><code>library(dplyr) library(gt) tbl1 &lt;- data_tbl %&gt;% # Initialize a gt table gt() nm1 &lt;- names(data_tbl[,2:4]) for(i in seq_along(nm1)) { tbl1 &lt;- tbl1 %&gt;% tab_style( style = list( cell_fill(color = &quot;#1dab48&quot;) ), ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Compare 2 lists in java and return the difference<p>Hello I am using selenium with java. I have to compare lists and return the difference.These values i am ...
<pre><code>public static void main(String[] args) { List&lt;Integer&gt; ids = List.of(1, 2, 3); List&lt;Double&gt; taxes = List.of(10.25, 1.58, 30.28); List&lt;Double&gt; taxes2 = List.of(10.25, 1.57, 28.28); for (int i = 0; i &lt; ids.size(); i++) { int id = i + 1; int result = taxes....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add function data to my model - Node/Express<p>I have a form with the input fields "firstName", "lastName" and "assetTag". I want to submit that form and pos...
<p>if you are talking about getting that value out of the promise you need to look into <a href="https://javascript.info/async-await" rel="nofollow noreferrer">async / await</a>.</p> <p>here's the code</p> <pre class="lang-js prettyprint-override"><code>app.post('/', async (req, res) =&gt; { let data = await si.sy...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i extract mean bioclimatic variables from unprojected grid cells?<p>I have a shpfile from the <a href="https://gadm.org/download_world.html" rel="nof...
<p>Excuse me if I'll only use similar datasets to demonstrate the workflow (gadm_410 is ~1.4 GB, wc2.1_30s_bio is ~ 9.7 GB). I'll also try to stick to <code>sf</code> and <code>terra</code> as much as possible:</p> <pre class="lang-r prettyprint-override"><code>library(sf) #&gt; Linking to GEOS 3.9.1, GDAL 3.3.2, PROJ ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What drives the fields available for Azure DevOps custom rule actions?<p>I'm trying to add a custom rule in azure devops to set the &quot;Resolved Date&quot;...
<p>The &quot;Resolved Date&quot; field has the <code>IsComputed</code> attributes to <code>true</code>, which means that <strong>its value is computed by the system and cannot be changed</strong>. This is documented <a href="https://docs.microsoft.com/en-us/azure/devops/boards/queries/query-by-workflow-changes?view=azu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Finding a numbers knowing some some of their divisors<p>I'm in the process of solving this kata at cw <a href="https://www.codewars.com/kata/566afbfc8595f2e7...
<p>you ca try to implement <a href="https://en.wikipedia.org/wiki/Least_common_multiple#Using_a_simple_algorithm" rel="nofollow noreferrer">this</a> algorithm.</p> <p>another optimization you can do is to run this algorithm for the numbers from 2 to n+1 and divide the result by two. It will give you the same result tha...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: transform dataframe to json structure<p>Need help with converting this df to exact JSON as an example using R. Already tried a lot of approaches but cant suc...
<p>You could use <code>tidyr::nest</code> and <code>jsonlite::toJson</code> like so:</p> <pre class="lang-r prettyprint-override"><code>library(tidyr) library(dplyr) library(jsonslite) df |&gt; select(-station) |&gt; group_by(month) |&gt; nest() |&gt; rename(summary = data) |&gt; jsonlite::toJSON() #&gt; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How query to array of categories to get posts in Laravel?<p>Hi in my site I want to show posts that result of selected-multi category by checkboxes input. I ...
<p>Since you have <a href="https://laravel.com/docs/6.x/eloquent-relationships#many-to-many" rel="nofollow noreferrer">many-to-many</a> relationship between <code>Post</code> and <code>Category</code>,</p> <p>you can just use <a href="https://laravel.com/docs/6.x/eloquent-relationships#querying-relationship-existence"...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mysql LIKE 2nd character and 2nd last character both are 'm'<p>I try to find query to find a string that 2nd character and 2nd last character both are letter...
<p>Why not just <code>OR</code> instead of <code>AND</code>? I don't see the point of <code>AND</code> when your <code>LIKE</code> operator allready rules out names below three characters. You don't need to use regex nor a check for length:</p> <pre><code>SELECT last_name FROM employees WHERE last_name LIKE '_m_' ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Export ssrs report to excel in 1 sheet<p>I have two tablix in ssrs. I want all the data in the first Tablix in sheet 1, but when I export my ssrs report to e...
<p>There must be a Page Break on a Row or Column Group in the first table that is causing it to create pages for each Group.</p> <p>Click on the table and click on the drop down by the Grouping for each Group at the bottom and go to the Group Properties.</p> <p><a href="https://i.stack.imgur.com/Ef1s8.png" rel="nofollo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to modify default WordPress registration form?<p>I am creating one feature for adding user roles in WordPress default registration, it's working but I wa...
<p>Code is correct, change these lines from</p> <pre><code>echo '&lt;select name=&quot;role&quot; class=&quot;input&quot;&gt;'; </code></pre> <p>to</p> <pre><code>echo '&lt;select name=&quot;role&quot;&gt;'; </code></pre> <p>this will give you a dropdown, without any conflict.</p> <p>Now, these lines will give you a la...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jQuery remove script effect came from ajax<p>I have customised nested modal script (<a href="https://jquerymodal.com/" rel="nofollow noreferrer">jQueryModal<...
<p>Thanks to @Taplar for help, I got the problem and could able to solve it by little googleing and solution was to use jQuery's <a href="https://api.jquery.com/off/" rel="nofollow noreferrer">off</a> </p> <p>example:</p> <p><code>$('.button').off('click').on('click', function(){ ... });</code></p> <p>same way for s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reduce iterations in a sorting algorithm<p>Let's say I have a list that I want to sort based on subjective criteria, such as the user's personal preferences....
<p>I'd suggest just doing a regular <code>sort</code> by turning your <code>AskUser</code> into a comparator function and using <code>functools.cmp_to_key()</code> to turn it into a sorting key function. That way you can take advantage of <code>sort</code>'s built-in efficiency to minimize the number of comparisons, w...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: trying to saving my stream in my viewmodel<p>I'm having trouble saving the stream of my selected picture from my galary. this is what i'm trying.</p> <pre><...
<p>I assume you are trying to cache the stream using the _stream field for some future use. Since the .net <strong>Stream</strong> class implements the <strong>IDisposable</strong> interface it relies on you to release this unmanaged resource manually (in contrast to the garbage collector doing it for you).</p> <p>I w...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Auto increment multiple column values from parent id<p>I have 2 Parent tables like <code>DEPARTMENT</code> and <code>COUNTRY</code>. In both of these tables,...
<p>That doesn't make much sense to me because</p> <ul> <li>what you really need is master-detail relationship (<code>department</code> and <code>country</code> masters, <code>employee</code> detail with foreign keys establishing referential integrity constraint towards master tables)</li> <li>why do you care about orde...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create CommandQueue and Command Allocator using IID_PPV_ARGS<p>I am learning how to create CommandQueue, Command Allocator, and CommandList in DirectX 12.</p...
<p><code>IID_PPV_ARGS()</code> expects the address of an interface pointer variable. Both <code>ComPtr::operator&amp;</code> and <code>ComPtr::GetAddressOf()</code> return such an address - the address of the internal <code>ComPtr::ptr_</code> data member. The only difference between them is that <code>ComPtr::operat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Full dataset columns value_counts().to_frame() using for to append to a file in excel<p>I'm struggling with pandas using Google Colab. Let me explain my situ...
<p>Use a <code>for</code> loop to iterate through every column (series) in your Dataframe, calculate value_counts, reindex to move the column's original values from the index to a column (creating a Dataframe) and then store each dataframe in a list. Then import <code>functools import reduce</code> and use the <code>re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ifcManager.getAllItemsOfType() ran into error<p>I am using the <code>ifcLoader.ifcManager.getAllItemsOfType()</code> function from <code>ifc.js</code> I put ...
<p>At a very quick glance, it looks like you're processing one too many items in your for statement:</p> <p>You have:<br /> for(let i = 0; i &lt;= slabsID.length; i++) {</p> <p>Since you're starting at zero, you should stop at length-1:<br /> for(let i = 0; i &lt; slabsID.length; i++) {</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL join 2 tables where IDs match and each table's ID column is not unique<p>Let's say.. I have 2 tables like this</p> <p><strong>Table 1</strong> <a href="h...
<p>One option might be to use <code>row_number</code> analytic function (to get values you'll later join tables on) and then use full outer join. Something like this:</p> <p>Sample data:</p> <pre><code>SQL&gt; with 2 t1 (order_id, t1_col1, t1_col2) as 3 (select 1, 15000, 'sub fee' from dual union all 4 se...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Print HTML table with data from 3d associative array where amount ranges consider current value and next iteration's value<p>I've just begun learning php and...
<p>I recommend breaking up your table generating into its repeatable parts. Separating your business logic from your presentation is a great way to improve readability and maintainability.</p> <p>Create template strings and fill them with data as you iterate.</p> <p>I'd probably pretty up the array declaration for eas...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does TypeScript allow this?<p>In TypeScript I'm making a GET request that results in a JS object like this:</p> <pre class="lang-js prettyprint-override...
<p>The thing is, Typescript typing is applying at compile time. </p> <p>The data you retrieve from your <code>GET</code> request will always be treated as <code>any</code> unless you do something about it. Because Typescript have no way to determine what type the data is <em>(could be anything)</em>.</p> <p>What you ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# Load different assemblies depending on bitness in runtime<p>So my problem is that my company wants to switch from x86 to x64 though some of our customers ...
<p>We have a situation where we are using a 3rd-party DLL which is available in 32-bit and 64-bit versions. Our application could run as either 32-bit or 64-bit, so we had to make it load the correct version of the DLL.</p> <p>The problem we had was that the 3rd-party DLL is a UI control, so you have to access it using...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to display DIV after 30 seconds on copy text content on web page?<p>I have a <code>div</code> tag that I want to display 30 seconds after copying content...
<p>You could use the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/copy_event" rel="nofollow noreferrer">copy</a> event and setTimeout:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can you use Microsoft Power Automate to develop a company wide workflow solution?<p>I am currently investigating possible tools with which to develop a workf...
<p>Look at Business Process Flows (BPFs).</p> <p><a href="https://docs.microsoft.com/en-us/power-automate/business-process-flows-overview" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/power-automate/business-process-flows-overview</a></p> <p>The following text is from &quot;<a href="https://docs.microsoft...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Passing multiple arguments in return 'Response' (python)<p>I am working in Angular and I am using Http Request and Response. Is it possible to send multiple ...
<p>You can return a <code>dictionary</code></p> <pre><code>return Response({'serializer_data': serializer.data, 'some_other_value': obj.someothervalue}) </code></pre> <p>Or you can append <code>someothervalue</code> to <code>serializer.data</code></p> <pre><code>data = serializer.data data['someothervalue'] = obj.so...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel paginate resources won't add meta<p>I have resources data returning in JSON. When I try to get my data with paginate it is not included meta data.</p...
<p>You don't need to use <code>response()</code>. Laravel's resource classes allow you to expressively and easily transform your models and model collections into JSON.</p> <p>Every resource class defines a <code>toArray</code> method which returns the array of attributes that should be converted to JSON when sending ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Removing last Sepcial Character in String using jQuery<p>I have a string it contains project name and project ID.</p> <p><code>var projectName= &quot;BMW-ASS...
<p>use</p> <pre><code>x.split(/-\s/) </code></pre> <p>It will split into two parts as you expected</p> <pre><code>x = &quot;BMW-ASSET-Management- 1133978889&quot; let [projectName, projectId] = x.split(/-\s/) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: error while copying mapping and setting of elasticsearch index of version 5.1 to 7.0<p>I am trying to copy the whole index data from a remote server to my lo...
<p>hi i think its because in elastic 7 remove type feature and for re indexing you need to have same version and bigger cluster to work i think you need logstash or some script to copy your data</p> <blockquote> <p>You must use the same size or larger cluster, and the same Elasticsearch version. Depending on your ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: "ValueError: dictionary" error on setting node attributes from dictionary on NX<p>I'm trying to add attributes to my nodes from dictionary. My nodes represen...
<p>Documentation mentions <strong>If values is a dict or a dict of dict</strong>, but I tried dict of list so It did not worked.</p> <p>So instead of this:</p> <blockquote> <p>{'Leslie Howard': ['Comedy', 'Drama'...</p> </blockquote> <p>I changed it to:</p> <blockquote> <p>{'Leslie Howard': {'Movie types': ['Comedy', ....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use a variable instead of a constant in the following statement in python with PyPDF2<p>object = PyPDF2.PdfFileReader(r&quot;C:\PROYECTOS\PruebasPDF\A...
<p>you should be able to use</p> <pre class="lang-py prettyprint-override"><code>path = r&quot;C:\PROYECTOS\PruebasPDF\ArchivosPDF\326581098.pdf&quot; object = PyPDF2.PdfFileReader(path) </code></pre> <p>The reason why the leading <code>r</code> is necessary are the <code>\</code> symbols: In a normal string (without l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does Gitlab register a runner on a Docker container?<p>I'm attempting to register a Gitlab runner using Docker (running on Centos 7.6) using the followin...
<p>Both containers (the temporary one and the actual gitlab-runner instance) share a volume together <code>-v /srv/gitlab-runner/config:/etc/gitlab-runner</code> in which the registration token is stored. The actual instance of the runner can then use that token from the generated config to authenticate with the gitlab...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use if else loop in Dialogflow for showing results<p>I have Javascript code for Dialogflow doing project on Google Actions. For this code if answer is...
<p>While you <em>can</em> use a loop to show results, there are a few problems with how you've done to, and possibly even with what you're trying to return.</p> <p>First - Dialogflow requires you to return a Promise from any function that makes an asynchronous call, such as a call to the Firebase database. You're curr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Powershell: Extract Exchange property and Display in array<p>I need to get all Exchange users into an Array, with a column for their SIP address and another ...
<p>You are on the right track, however you are trying to join the objects without referencing the sub-properties you are actually interested in. Try something like:</p> <pre><code>$list_UsersExtCloud = Get-Recipient e12367 | Select-Object Alias, EmailAddresses, @{ Name = 'SIP'; Expression = { ($_.EmailAddresses | Wher...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I sort this list by frequency, this is what I've tried and its not what I expected<pre><code>items = [4, 6, 2, 2, 6, 4, 4, 4] result = sorted(items, k...
<p>You actually have succeeded in sorting the list by frequency. The problem is that both 2 and 6 have the same frequency, so their sort order is left unchanged. If you'd like to sort first by frequency, then by value, you can do that easily by exploiting the fact that a tuple is sorted first by the value in index 0, t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Search By Regex Pattern ActiveRecord<p>Is there a way to search via Regex pattern in ActiveRecord? I have a collection of products. I'll like to search these...
<p>If you using a database that supports regex matching, this is possible. E.g: Postgres. I have done some regex search on ActiveRecord using Postgres as DB. You can read up this <a href="https://www.postgresql.org/docs/9.3/functions-matching.html" rel="nofollow noreferrer">article</a></p> <p>So in your case, you can ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python: How to convert a list of integers into nested lists of integers where max-min for each nested list never exceeds X?<p>I'm actually having a hard time...
<p>Loop through the sorted list. Each time you start a group, save the first value of the range in one variable. Then as you step through the list, update the last value of the range to the current element. Whenever the element exceeds <code>first+limit</code>, you start a new range.</p> <pre><code>def do_something(l, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: nav element example, from WHATWG spec<p>According to <a href="https://html.spec.whatwg.org/multipage/sections.html#the-nav-element" rel="nofollow noreferrer"...
<p>From my personal reading, what the specs say here when they say</p> <blockquote> <p>In the following example, the page has several places where links are present, but only one of those places is considered a navigation section.</p> </blockquote> <p>refers to the note above, which states</p> <blockquote> <p>User agen...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: saving database on phpMyAdmin - mySQL<p>I have created a database with two tables on my phpMyAdmin account, and I'm using 000webhost for a web hosting. Once ...
<p>Normally a database would persist across login sessions. The only possible exception would be if you log in as different users (which could be different usernames or if you use fine-grained IP-based access controls, for instance, two different users both with username <code>natasha</code>, one host <code>192.0.2.1</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to keep structure of text after feeding it to a pipeline for NER<p>I've build an NER (named entity recognition) model, based on a HuggingFace existing mo...
<p>The <code>group</code>s have a <code>start</code> and <code>end</code> index that tell you which part of the input string each label corresponds to. I.e., you can pass the text <em>as a whole</em>, with the newlines intact (<code>ner_pipeline(f.read(), ...)</code>) and subsequently replace substrings.</p> <p>Here's ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does a nested if statement affect actual runtime before f(n) simplifies to O(g(n))?<p>I am aware that constant coefficients and constants are simply igno...
<p>Knowing the actual runtime, as you say, before calculating the time complexity in big-O is not important. In fact, as you continue studying, you will find that in many cases it is ambiguous, annoying or very, very difficult to find an exact number of steps that an algorithm will execute. It often comes down to defin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular Reactive form : Not able to bind action in table<p>I am unable to add radio button in Table using Angular 2+. If there is no radio button(action), i...
<p>You forgot to use FormArray in HTML to indicate that this is array <strong>formArrayName="address"</strong> <a href="https://stackblitz.com/edit/angular-6-reactive-form-validation-5mxbb8" rel="nofollow noreferrer">stackblitz</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NPM Error : Error: EROFS: read-only file system, mkdir '/npm'<p>I created an index.js, index.html and package.json file and I wanted to add express. When I w...
<p>The error means that you have no permission to install anything with npm at the path <code>/npm</code>.<br> To verify this run <code>npm root -g</code>. This should return <code>/npm</code>.</p> <p>Note that <code>/npm</code> ist not the default installation path on MacOS (see <a href="https://stackoverflow.com/a/3...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jquery search filter and limit records by object key<p>Am trying to make a search in jquery, to filter object by keyword. The problem am having now is when s...
<p>You could try something like this, to make the counting, and the adding happens only once for each store. You simply use a variable as a stopper for repeated stores.</p> <pre><code>var storeOnce = ''; if (sort === "store" &amp;&amp; row.store_name.toLowerCase().search(regex) != -1) { if (row.store_na...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In my constructor, is it bad practice to set class variables by calling getters on an object I pass into a constructor?<p>So imagine I have a simple class wi...
<p>So I resolved this by creating a static mapper like this;</p> <pre><code>public class Mapper { public static A mapToA(B b) { return A.builder() .x(b.getX()) .y(b.getY()) .list(b.getList()) .build(); } } </code></pre> <p>Obviously the mapper holds the ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: custom paths added to tsConfig file aren't recognized in Angular8<p>I added a custom path to my tsConfig file and figure out why Angular won't recognize it. ...
<p>I just launched VSCode and all of a sudden the error was gone. I have the node terminal open running my <code>ng serve</code> and using the terminal inside VSCode to generate components. Maybe something in there somehow updated itself. Before I had closed and re-served my project so it could re-compile with the u...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas df to json - request using<p>:)</p> <p>I need to use request package to use API. Api from IT needs json which look exactly like this:</p> <p>{ &quot;S...
<p>First convert the types to match the request.</p> <pre><code>df[&quot;StoreCode&quot;]=df[&quot;StoreCode&quot;].astype(str) df[&quot;GlovoStoreCode&quot;]=df[&quot;GlovoStoreCode&quot;].astype(str) </code></pre> <p>Only performing the transformation for 1st item. Setup a loop if you want to do it for multiple rows....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Referencing a loop object<p>i am currently checking out tanka + jsonnet. But evertime i think i understand it... sth. new irritates me. Can somebody help me ...
<p>Great to read that you're making progress with <code>tanka</code>, it's an awesome tool (once you learned how to <em>ride</em> it heh).</p> <p>Find below a possible answer, see inline comments in the code, in particular how we ab-use <code>tanka</code> layout flexibility, to &quot;populate&quot; <code>deploys: [...]...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Show selection box over multiple rows in Altair<p>I want to create a plot using <code>altair</code> that spans multiple rows and is interactive. Highlighting...
<p>It is not possible to show a selection on multiple charts <a href="https://github.com/vega/vega-lite/issues/3686" rel="nofollow noreferrer">https://github.com/vega/vega-lite/issues/3686</a>, <a href="https://github.com/vega/vega-lite/issues/7030" rel="nofollow noreferrer">https://github.com/vega/vega-lite/issues/703...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Highlight duplicate rows in a multiindex dataframe and export to excel<p>I have a Python code that uses a multiidex dataframe, which is exported to Excel. Wh...
<p>Changing the second-to-last line, the function works successfully and automatically saves the format to excel</p> <pre><code>df2['Duplicate'] = df2.duplicated() df2.style.apply(lambda x: ['background-color: yellow' if (x.Duplicate == True) else ('background-color: white' if (x.Duplicate =...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Applying a subscripting function within a data frame<p>I have a a column with lists of numbers and have written a function to take the even numbers of the li...
<p>You are not using <code>.apply()</code> correctly. try:</p> <pre><code>X = pd.DataFrame({ 'A':[[1,2,3,4,5,6],[2,3,4,5,6,7]]}) X['B'] = X.apply(lambda x: remove(x[0]),axis=1) </code></pre> <p>Also, if you'd like a solution which doesn't use an extrernal function:</p> <pre><code>X = pd.DataFrame({ 'A':...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: arduino parameter pack working without tuple<p>I'm trying to do a sketch that can return a parameter pack. I found a reference here: <a href="https://stacko...
<p>The type of <code>params</code> is dependent on the template parameters, so the compiler has no way of knowing whether <code>.get</code> is a template or not when parsing it. You need to tell the compiler explicitly that it is a template:</p> <pre><code>auto callFunc(seq&lt;S...&gt;) -&gt; decltype(this-&gt;func(th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error - com.google.firebase.database.DatabaseException: Can't convert object of type java.lang.String to type com.example.project_sewing.Event1<p>I get this ...
<p>According your <strong>database</strong> structure, You are getting multiple <code>children</code> from your <code>query</code> to <strong>firebase</strong>. You have to handle this like below:</p> <pre><code>@Override public void onDataChange(@NonNull DataSnapshot dataSnapshot) { for (DataSnapshot childSnapsh...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Catching anchor element using SHDocVw.InternetExplorer<p>I want to catch the anchor element in website via vba.</p> <p>I tried both as an MSHTML.IHTMLAnchorE...
<p>You want a page load wait after each <code>.navigate</code>. In this case you only need the one <code>.navigate</code> and wait.</p> <p><code>getElementsByClassName()</code> returns a collection not a single node. So both your type declaration, subsequent <code>SET</code> attempt to this type, and later attempt to v...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Move span in new line if text is longer then block<p>I have block Component: </p> <pre class="lang-html prettyprint-override"><code>&lt;div class="block"&gt...
<p>Try adding the following to your css: <code>.text{ display: inline-block; }</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google Sheet Query: Why "!= ' '" doesn't work?<p>To select cells that are not empty, we have to use something like</p> <pre><code>SELECT * WHERE A IS NOT NUL...
<p>when referring to a null cell try:</p> <pre><code>&quot;where A &lt;&gt; ''&quot; </code></pre> <p><a href="https://i.stack.imgur.com/uH1M5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uH1M5.png" alt="enter image description here" /></a></p> <p>or:</p> <pre><code>&quot;where not A = ''&quot; </...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you get the GPS shared location of whatsapp using the Twilio API?<p>I am using Node JS + twilio API to get whatsapp messages from a bot. Right now I a...
<p>If a <em>"Location"</em> is attached to a Whatsapp message, it will be present in the POST request parameters and you can get its properties similarly with how you get the body of the message.</p> <pre><code>if (req.body.Latitude &amp;&amp; req.body.Longitude) { console.log('Whatsapp location received...'); con...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find and check obects with all properties being empty in Matlab?<p>For example, I create a <code>student</code> with all properties being empty</p> <p...
<p>Not many more choices than to loop through the properties of your object to check if they are all empty or not:</p> <pre><code>function isE = check_emptyness(A) props = properties(A); isE = true; for iprop = 1:length(props) if ~isempty(A.(props{iprop})) isE = false; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Making a txt file using excel sheet data<p><a href="https://i.stack.imgur.com/iuVet.png" rel="nofollow noreferrer">excel image file</a></p> <p><a href="https...
<p>First do it for single file and put code in function which get filename as argumetn - ie. <code>function(filename)</code> - and later use <code>for</code>-loop to execute it for many filenames on list.</p> <pre><code>import pandas as pd def function(filename): df = pd.read_csv(filename, sep='\s*,\s*', engine='p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Need Node app to watch external website instead of localhost<p>I'm still new to Node, so what I'm asking may not work the way I'm wanting to, but, here is my...
<p>You can't take any site name by just "listening" to it with node app. When user in the Internet goes to www.myexample.com/id, the url is resolved into ip address and user's browser connects to a server (physical machine) that is running on that ip address. This server then accepts the connection and serves the websi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Improve the performance of if-else loop to update missing value<p>I have a massive dataset with millions of lines that I want to fill in the missing values w...
<p>As @zephryl suggested, I wrote a function using Rcpp and it was way faster than R function. Below is working Rcpp function for the R loop mentioned in question.</p> <pre><code>library(Rcpp) cppFunction('DataFrame mean_function(DataFrame input_df, DataFrame row_number){ #include &lt;vector&gt; NumericVector p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cross side scripting vulnerability detected in javascript code<p>Please check the vulnerability on cross side scripting - &quot;The untrusted data reaches a ...
<h2>Understanding the finding</h2> <p>The finding line:</p> <pre><code>The property &quot;req.body&quot; is a source of untrusted data. </code></pre> <p>is saying that <code>req.body</code> is untrusted data.</p> <p>I don't know if this is a direct quote from the tool or your summary, but let's take it at face value: t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Borders and Formatting as Table<p>I developed the following code which should do two things, but I am have problems on it:</p> <pre><code>`' ************* Pl...
<p>Being more assertive you can do like this (relative to the first code posted):</p> <pre><code>myrange = Cells(Rows.Count, 6).End(xlUp).Address With Sheets(&quot;LTXN Report&quot;) .Select ' or .Activate .Range(&quot;A1:&quot; &amp; myrange).BorderAround ColorIndex:=1, Weight:=xlThick End With </code></pre> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I replicate this R vector function with Rep in Python<p>Here is my code:</p> <pre><code> df$two &lt;- c(0, rep(1:(nrow(df)-1)%/%120)) </code></pre> <...
<p>This should be similar to what you've provided in R:</p> <pre class="lang-py prettyprint-override"><code>df[&quot;two&quot;] = pd.Series([0] * ((len(df.index) - 1) // 120)) </code></pre> <p>WHERE:</p> <ul> <li>df is a Pandas dataframe with a column named &quot;two&quot;</li> <li>An equivalent structure to <code>c()<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MySQL how to delete first 3 letters for all records found?<p>I have column named Column1 looks like this:</p> <pre><code>ABCABC321 ABCABC213 ABC478 ABC474 <...
<pre><code>UPDATE your_table SET your_column = RIGHT(your_column, CHAR_LENGTH(your_column) - 3) WHERE your_column LIKE 'ABCABC%'; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Tests - .net core 3<p>I'm creating a Rest API in .net core 3 (my first one). In that API I did a dll that I call from some API methods. I want to write some ...
<p>As the Comment states. You haven't mocked the CreateClient method. It should look something like the following:</p> <pre><code>public void GetCredentials() { var httpClientFactoryMock = Substitute.For&lt;IHttpClientFactory&gt;(); var csmsTestClient = new HttpClient(); httpClientFactoryMock.CreateClient(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to execute commands in FarManager running in Windows console<p>I have a client server application. Using the <code>CreateProcess()</code> function, a new...
<p>I am attaching my solution based on the advice of @YurkoFlisk. Maybe it can be useful for someone</p> <pre><code>//Execute command in FarManager //nVirtKey - code of virtual key to run in far void RunFar(int nVirtKey){ std::cout &lt;&lt; &quot;Key code &quot;&lt;&lt; nVirtKey &lt;&lt; std::endl; //Create st...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android Firebase notification have no sound<p>I'm getting Firebase notification sound while app runs and not getting notification sound while app is in backg...
<p>Just do one thing say your backend developer to just send <strong>data</strong> payload in the notification, ask him to restrict and remove <strong>notification</strong> payload,</p> <p>Because when you are getting a notification at that time if your app in the background and you are getting notification payload at...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Inconsistency in GHCi between representations of values of type String and [Char]<p>Take the following definitions:</p> <pre class="lang-hs prettyprint-overr...
<p><code>String</code> and <code>[Char]</code> are exactly the same type. The <code>Show</code> typeclass contains a &quot;trick&quot; to print that type using a different syntax than other lists.</p> <p>If you need the regular list-like output, you could use a custom <code>Char</code>-like type to bypass that exceptio...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PYQT5 - Slot function does not take default argument<p>I am working on an PYQT5 interface, with a QPushButton supposed to call a slot function, which has def...
<p>The <a href="https://doc.qt.io/qt-5/qabstractbutton.html#clicked" rel="nofollow noreferrer"><code>clicked</code></a> signal of QPushButton, like any class that inherits from QAbstractButton, has a <code>checked</code> argument which represents the current checked ("pressed") state of the button.</p> <blockquote> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: When logging in in login and register modes, leaving the edittexts blank, it kicks them out of the application<p>I'm new to Android, there are 2 modes in the...
<p>Modify button click like this</p> <p>You've to validate before submitting firebase edit text values. User name optional but when you read it's possible to throw null pointer exception</p> <pre><code>button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: L1 regularization neural network in Pytorch does not yield sparse solution<p>I'm implementing a neural network with l1 regularization in pytorch. I directly ...
<p>The l1 regularization in pytorch does not handle the cases when the parameter will be shrunk to zero. You have to manually apply some soft-thresholding function like</p> <pre><code>$$s_{\lambda}(z)=sign(z)*(|z|-\lambda)_+$$ </code></pre> <p>after each iteration to filter those parameters which are zero until conve...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to invert the case of characters of the whole sentence?<p>I can not explain how to invert the case of characters with the help of a regular. At this stag...
<p>You are close as your regex is fine and you need to loop though chars of found match though few issues as follows:</p> <p>• You need to loop though the found match instead of char array <code>input.toCharArray()</code></p> <p>• Get the match group using <code>matcher.group(1)</code></p> <p>so follow the steps to ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting Could not compile inline filter : <Jsonpath with Query><p>I was trying to get json array using query with json path I used following maven repo</p> ...
<p>Correct Json Path is</p> <p><code>$.verdict[?(@.reputationStatus=="KNOWN")].sha256</code></p> <p>which returns</p> <pre><code>[ "b80ff3bb189960738bc94973c7bc25e541c1bdff5b9c1c69973a13345ffbc3c3" ] </code></pre> <p><strong>EDIT:</strong> I tried using jsonpath library and both the json path expressions give cor...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use Error() without throwing exception in Jest<p>I have a React component called <code>&lt;Error /&gt;</code> which can accept a string or an actual <code>Er...
<p>Try this in your test file:</p> <pre><code>import Error as ErrorComponent from './error/component.jsx'; //Or wherever this is </code></pre> <p>You could also try to name your Error component differently.</p> <p>Hope this helps.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does the parameters saved in the checkpoint are different from the ones in the fused model?<p>I trained a <code>QAT</code> (Quantization Aware Training) ...
<p>I finally found out the cause. The error messages with the form of : </p> <blockquote> <p>While copying the parameter named "xxx.weight", whose dimensions in the model are torch.Size([yyy]) and whose dimensions in the checkpoint are torch.Size([yyy]).</p> </blockquote> <p>are actually generic messages, only ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error in calculating standard error: (list) object cannot be coerced to type 'double'<p>I have calculated the mean of the observations for each treatment usi...
<p><code>summarise_each</code> is getting deprecated and <code>funs</code> is replaced by <code>list</code></p> <pre><code>library(dplyr) Data %&gt;% group_by(Treatment) %&gt;% summarise_at(vars(-group_cols()), list(mean = ~mean(., na.rm = TRUE), sd = ~sd(., na.rm = TRUE), ...