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: Match Excel Date Range with Day of Week<p>I have a expense form with a departure and return date. I would like to match all dates between the departure date ...
<p>There's plenty of ways to do this. Along similar lines to what you have tried, I got this. It works as per your screenshot and also tested with different dates below:</p> <p><a href="https://i.stack.imgur.com/ktmnp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ktmnp.png" alt="enter image descri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Oracle SQL - Keep rows within group where there are larger number of values for column, in a specific column category<p>I need to figure out how to take the ...
<p>By using a combination of window functions, you can count the number of Y flags for each group/account/site/brand, then find the maximum number of Y flags of those partitioned with another analytic function, then only return the rows where those two values match.</p> <h2>Query</h2> <pre class="lang-sql prettyprint-o...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Make a FOR LOOP with numpy arrays multiplication and "appending" faster<p>This is my current code.</p> <p>It works fine when the number of elements in the se...
<p>Your code as is killed my session, presumably because the array dimension(s) was too big for memory. Trying again with smaller numbers:</p> <pre><code> In [1]: from collections import deque ...: import random ...: ...: center_freq = 20000000 ...: smpl_time = 0.03749995312*pow(10,-6) ...: ...: ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How one video overlay with 2 different videos with ffmpeg?<p>How one video overlay with 2 different videos with ffmpeg?</p> <p>I have code like this:</p> <...
<p>Use</p> <pre><code> ffmpeg -i video.mov -i ov1.mp4 -i ov2.mp4 \ -filter_complex "[0:v]setpts=PTS-STARTPTS[v0];[1:v]setpts=PTS-STARTPTS+1/TB[v1];[2:v]setpts=PTS-STARTPTS+10/TB[v2];[v0][v1]overlay=enable='between(t,1,10)'[v01];[v01][v2]overlay=enable='between(t,10,15)'" \ -t 30 \ -pix_fmt yuv420p -c:a cop...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Header size of array in C++ for WDK<p>Not sure if "header" is the correct term, so please correct me if it isn't.</p> <p>I'm trying to first allocate a memo...
<p>That amount of that extra space, if any, is compiler dependent. For the languange definition [expr.new, paragraph 15]:</p> <blockquote> <p>[It] is a non-negative unspecified value representing array allocation overhead; the result of the new-expression will be offset by this amount from the value returned by ope...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: issues with injected content sizing<p>I am creating a "live search" feature, this works fine functionally, however, on responsive testing, it breaks almost a...
<p>You need to fix the <em>flip effect css</em>. Nothing to do with twitter bootstrap. Your <code>.flip-container</code> is not getting height, so in xs when many containers stack you see the probleme.</p> <p>You could set a fixed height for your <code>.flip-container</code> but since you want dynamic height here is a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to localize a newly created storyboard?<p>I have simply created a new Single App project in Xcode 10.1. Then I have created a new storyboard named "Login...
<p>Follow these steps.</p> <ul> <li>Select <em>Login.storyboard</em> in <em>Project Navigator</em>.</li> <li>Go to the <em>File Inspector</em>.</li> <li>At the bottom you should see a <em>Localization Section</em>, with a big <em>Localize...</em> button.</li> <li>Click on the button, and Xcode will ask you for which l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Awk to (random) sample a file by id-uniques criteria<p>I'm learning AWK to read a big file which format is similar to this MasterFile:</p> <pre> Beth|4.00|0...
<p>this is the one of the right ways to do this</p> <pre><code>$ sort -t'|' -u -k1,1 file | shuf -n3 Mark|5.00|20| Kathy|4.00|10| Jise|5.62|0| </code></pre> <p>change <code>-n3</code> to whatever number of unique entries you need. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: .NET CustomValidator: Prevent Submit Button<p>I'm trying to add a custom field validator to some legacy code. If the email does not belong to a certain domai...
<p>You need to create client side validation also. You do that with <code>ClientValidationFunction</code> of the Validator.</p> <pre><code>&lt;asp:CustomValidator ID="CustomValidator1" runat="server" ControlToValidate="tbEmail" ClientValidationFunction="allowedDomains" ErrorMessage="Not Valid"&gt;&lt;/asp:CustomVal...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Properties, Arrays and ArrayLists using vb.net<p>In my code behind in my Web project I have a Property<br/></p> <pre><code>Public Shared UserAttributes(2) A...
<p>Finally I've made it to solve this puzzle as follows <br> One Property as <code>ArrayList</code> <br></p> <pre><code>Public Property _UserParameters As ArrayList Get Return UserParameters End Get Set(value As ArrayList) UserParameters = value End Set End P...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PGSQL: How to find Bank ending balace by recent statement date according each customer<p>I have a table called "bankStatement" where we have <code>bankaccoun...
<p>You can use a Postgres' <strong>distinct on</strong> extension:</p> <pre><code>select distinct on (bankaccount_id) bankaccount_id, statement_date, ending_balance from bankstatement order by bankaccount_id, statement_date desc </code></pre> <p>In my opinion this approach is more elegant and safer than...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Keras 1D CNN: How to specify dimension correctly?<p>So, what I'm trying to do is to classify between exoplanets and non exoplanets using the kepler data obta...
<ol> <li><p>Yes, your dataset should be a 3d tensor.</p></li> <li><p>The correct input shape (for tensorflow backend) is <strong>(sample_number,sample_size,channel_number)</strong>. You can check that from your error message, "the expected dimension was (None, 3197, 1)". </p></li> </ol> <p>'None' refers to an arbitrar...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SMTP response code 530 returned by Amazon SES<p>I was trying to send an email through the Amazon SES SMTP interface <strong>with php</strong> referring this ...
<p>This worked for me. Try adding the following to your enviornment variables:</p> <p><code>aws_access_key_id</code> as Variable Name and <strong>your access id</strong> as Variable Value</p> <p>and, <code>aws_secret_access_key</code> as Variable Name and <strong>your access key</strong> as Variable Value</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replacing links in the content with processed links in rails using nokogiri<p>The feature I am currently working on is to replace all the links in the conten...
<p>You want to use an HTML fragment.</p> <p>Try this</p> <pre><code>def replace_links(content) fragment = Nokogiri::HTML.fragment(content) doc.css("a[href]").each do |link| link['href'] = ... end return fragment.to_html end </code></pre> <p>And no need for that <code>sub!</code> hack, just return <cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unexpected unknown at-rule "@tailwind" scss/at-rule-no-unknown<p>This is my <code>stylelint.config.js</code>,</p> <pre><code>module.exports = { extends: ['...
<p>Does this help?</p> <pre><code>rules: { 'at-rule-no-unknown': null, 'scss/at-rule-no-unknown': [ true, { ignoreAtRules: ['tailwind'] } ], } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sort indices of slice<p>I want to sort the index of elements rather than sorting the slice. For <code>[]string{&quot;dog&quot;,&quot;cat&quot;,&quot;apple&qu...
<p>The indices your <code>less()</code> function gets are indices of the sortable slice (<code>indices</code>), not another (<code>arr</code>) slice.</p> <p>So use <code>i</code> and <code>j</code> to index <code>indices</code>. The result of course is an index to be used for the <code>arr</code> slice (that's your def...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unexpected POSIXct behavior for minutes<p>I do not understand why POSIXct returns NA for certain times? It does not make sense that for exactly that day, the...
<p>I turns out that it is the day where you jump from winter time to summer time, thus the hour does not exist. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Julia: Generate normally distributed random number with restricted range<blockquote> <p><strong>Question:</strong> How can I generate a random number in th...
<p>Use the <a href="https://juliastats.github.io/Distributions.jl/stable/starting.html" rel="nofollow noreferrer">Distributions</a> package. If you don't already have it:</p> <pre><code>using Pkg ; Pkg.add(&quot;Distributions&quot;) </code></pre> <p>then:</p> <pre><code>using Distributions mu = 0 #The mean of the tr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want to multiply between two arrays values in flutter<p>I have 2 Array called A and B, and I want to multiply 2 array values and create a new result array<...
<p>Try this</p> <pre><code>void main() { final a = &lt;int&gt;[2, 3, 4]; final b = &lt;int&gt;[1, 2, 3]; final result = &lt;int&gt;[]; for (int i = 0; i &lt; a.length; i++) { result.add(a[i] * b[i]); } print(result); } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to apply a sequence of custom operations on a group by<p>I have a dataframe of the form:</p> <div class="s-table-container"> <table class="s-table"> <the...
<p>Select the first non-NA value across the selected variables after grouping:</p> <pre class="lang-r prettyprint-override"><code>library(dplyr) df %&gt;% na_if(&quot;na&quot;) %&gt;% group_by(ID) %&gt;% arrange(desc(Rank), .by_group = T) %&gt;% summarise(across(Var1:Var2, ~ head(.x[!is.na(.x)], 1))) # A ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Grails resources not working with cache-busting CKEditor release (4.5.5+)<p>I am unable to get a Grails 2.5.2 application using the resources plugin to handl...
<p>The eventual solution (recommended by a colleague) is to exclude the specific CSS file(s) from being processed by <code>grails resources</code>:</p> <pre><code>resource url:"thirdparty/ckeditor/skins/moono/editor.css", exclude: "*" </code></pre> <p>This avoids affecting other files that were either unaffected by t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RocksDB: support of out-of-core ? related performance?<p>I'm starting a new software that should be able to handle large dataset, ie, some terabytes of data....
<p>RocksDB has no difficulty with datasets that exceed RAM size. However, you pretty much have to use Bloom filters to preserve performance, and they take up RAM. So you will see some linear memory growth as your database grows. But it's nowhere near 1-to-1, more like 1/50th or so.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add variying markers to a map when accessing external JSON data asynchronously<p>I have the following markercollection.json file with several geograph...
<p>By looping through <code>data.features</code> with <code>forEach(fn)</code> instead of a <code>for(...)</code> loop, you will benefit from the local scope afforded by <code>fn</code>. </p> <p>Therefore :</p> <pre><code>data.features.forEach(function(feature) { var sAddress = feature.address.street + ', ' + fea...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to split sentence in button<p>so i want to make big button with name &quot;insert file audio (mp3)&quot; in 1 line or 2 line but what i can made it's bec...
<p>Your code is correct, it is showing the whole name in 1 line. I am copy pasting your code, it is running as you wanted it to.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: create a data frame based on input values<p>I am new to R. Your help here will be appreciated.</p> <p>I have inputs such as.</p> <pre><code> columnA &lt;-...
<p>First you can compute the lenght of the <code>data.frame</code>:</p> <pre><code>userinput &lt;- 14 N &lt;- (600 - 8) * 25 / userinput </code></pre> <p>Then, using <code>dplyr</code> you create the <code>data.frame</code>:</p> <pre><code>mydf &lt;- data_frame(ColA = 14, ColB = 1:floor(N), ColD = 25, ColF = 8) %&gt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rotate element on mousemove that's larger than viewport<p>I'm having an issue trying to rotate an element on mousemove. I believe the issue is related to the...
<p>When using css <code>transform</code> functions, the functions are processed in order from left to right.</p> <p>In your case, what you want is to first <code>translate</code> the element and THEN <code>rotate</code> it. For example this <a href="https://stackoverflow.com/a/25305203/2661226">answer on SO</a> explai...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to track Firestore data completely fetched or not?<pre><code>mColRef.document(mUid).get().addOnSuccessListener(new OnSuccessListener&lt;DocumentSnapshot&...
<p>Any time you perform a Firestor query, <em>all</em> of the results of that query are available when the onSuccess callback is is invoked. The snapshot argument to the callback contains all of the document data, so when you call <code>documentSnapshot.get()</code>, the entire results are available. There is no such ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AutoIncrement Realm failed<p>I create an activity and want to insert a new realm object it always keep on error http null if i put getNextKey();</p> <p>here...
<p><code>max</code> returns a Number or <code>null</code> if no objects exists. So most likely no DetailMenu objects exist and you get a NullPointerException.</p> <p>Use this instead:</p> <pre><code>Number max = realm.where(DetailMenu.class).max("MenuID"); return (max != null) ? max.intValue() + 1 : 0; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: log-in after checking the specific response from the API-POST request<p>I am having problems with POST request function I made, The problem is that I don't k...
<p>Create a decodable struct which holds your server's response</p> <pre><code>struct SignInResponse: Decodable { struct SignInResult: Decodable { let First: String let Last: String let CompleteName: String let PhoneNumber: String let Email: String let IsConnectedToCu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React + Material UI - Best way to prevent child tree from remount when toggling parent theme<p><strong>Background</strong></p> <p>I wanted to follow Material...
<p>The <code>useTheme</code> hook should return the provided context value, not the context itself. This is recreating a context provider and remounting children.</p> <p>Example:</p> <p>useTheme</p> <pre><code>import { createContext, useState, useMemo, useContext } from &quot;react&quot;; import { ThemeProvider, create...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Square APIs for Canada and USA<p>I have my application registered with square. I am using register APIs, square oauth and square connect APIs. My app will la...
<p>No. Your app will work fine for canadian merchants. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Assign 1 and 0 values to numpy array depending on whether values are in list<p>I am looking for a way to filter numpy arrays based on a list</p> <pre><code>...
<p>We could use <a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.in1d.html" rel="nofollow noreferrer"><code>np.in1d</code></a> to get the mask of matches. Now, <code>np.in1d</code> flattens the input to <code>1D</code> before processing. So, the output from it is to be reshaped back to <code>2D</code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: insert text into multiple fields such as excel cells<p>I'm configuring autohotkey for the first time and am having trouble with a script to insert text into ...
<p><code>for</code> returns both the key and value for each element:</p> <pre><code>f4:: for key,value in array_ccs { send Value: %value%{ERROR} } return </code></pre> <p>Output when pressing F4 in notepad:</p> <pre><code>Value: 1100580 Value: 1098954 Value: 1032801 Value: 1100579 </code></pre> <p>ref: <a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adding column name to user function<p>I am using a 'user function' to generate the frequencies for each type of 'apply-all' type question.</p> <p><strong>Thi...
<p>In your function you could add another column containing the variable names:</p> <pre class="lang-r prettyprint-override"><code>multfreqtable = function(data, question.prefix) { z = length(question.prefix) temp = vector(&quot;list&quot;, z) for (i in 1:z) { a = grep(question.prefix[i], names(data)) # ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python: Create a new column based on different conditions<p>I have a dataset with different columns. It looks like that:</p> <pre><code>ID = [97,97,97,19,19,...
<p>You can try <code>groupby</code> and use <code>isin</code> to check value existence then <code>assign</code></p> <pre class="lang-py prettyprint-override"><code>out = (df.groupby(['ID', 'DATE']) .apply(lambda g: g.assign(OUTPUT=[g['Destination_1'].isin(g['Destination_2']).any()]*len(g)))) </code></pre> <pre><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i extract the order id from below stringy json in jmeter?<p>How to extract the order id from below code</p> <pre><code>{&quot;status&quot;: &quot;OK&...
<p>Go for 2 <a href="https://jmeter.apache.org/usermanual/component_reference.html#JSON_JMESPath_Extractor" rel="nofollow noreferrer">JSON JMESPath Extractors</a>:</p> <ol> <li><p>First to get <code>Result</code> attribute value from the response</p> <p><a href="https://i.stack.imgur.com/EcAxs.png" rel="nofollow norefe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript print SQL first item in ResultSet without comma, then all others with comma<pre><code> create procedure my_stored_procedure(TABLE VARCHAR) retur...
<p>you can add boolean check if this first or not:</p> <pre><code>var sql_col_list = `select distinct key_name from TABLE;` results = snowflake.execute({sqlText: sql_col_list}); var isFirst = true; while (results.next()) { if(isFirst) { script += results.getColumnValue(1) + '\n'; isFirst =...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Rust with C API and mut/pointer problems with types<p>I'm trying to interact with a low-level C API using Rust. It requires calling to get the size of ...
<p>You probably want to do something like this.</p> <pre class="lang-rust prettyprint-override"><code>#[repr(C)] struct MyInfo { a: i32, b: f32, } extern &quot;C&quot; { fn getVals( pNumItems: *mut usize, pItems: *mut MyInfo, ); } fn main() { // first detect required size let m...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Validation message not showing .Net MVC<p>I am new to .net MVC. I am trying to validate a field from the model, but <strong>error</strong> message is not sho...
<p>Make sure you have added following scripts in the view</p> <pre><code>&lt;script src='@Url.Content("~/Scripts/jquery-1.8.2.js")' type='text/javascript'&gt;&lt;/script&gt; &lt;script src='@Url.Content("~/Scripts/jquery.validate.js")' type='text/javascript'&gt; &lt;/script&gt; &lt;script src='@Url.Content...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Power Bi calender<p>please I need to make a calendar table to enjoy the privileges of some functions but my date field is formatted with hour minute and seco...
<p>You can add a calculated column to extract just the date part of your DATETIME field. Something like:</p> <pre><code>DateOnly = DATE ( YEAR ( TableName[DateTimeField] ), MONTH ( TableName[DateTimeField] ), DAY ( TableName[DateTimeField] ) ) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I create a commit that rolls back another one?<p>For simplicity, let's create a repository with two commits only:</p> <pre class="lang-sh prettyprint...
<blockquote> <p>commit that rolls back another one?</p> </blockquote> <p>That seems a good fit for <a href="https://git-scm.com/docs/git-revert" rel="nofollow noreferrer">git revert</a></p> <pre><code>git revert &lt;second commit&gt; </code></pre> <p>But that apply to all files from second commit (being reverted)</p> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CreateSlice Error Uncaught ReferenceError: returnfalse is not defined<p>I have used Redux Toolkit several times before and have never been this error when cr...
<p>The problem is caused by the webpack version. I used webpack v.4.22, but it was solved once I downgraded to v.4.21. (Upgrade is better)</p> <p>I found this when I'm trying to use styled component and there was same error. I found solution at <a href="https://github.com/styleguidist/react-styleguidist/issues/1181" re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to pass a data between different classes defined for tabs in my tkinter GUI?<p>I have this code below, and I want to pass variable <code>n</code> in clas...
<p>You never create an instance of <code>Data</code>. Instead, you're initializing <code>self.data</code> to an empty dictionary. You need to create an instance of <code>Data</code> and pass that to the tabs.</p> <pre><code>class SampleApp(tk.Tk): def __init__(self, *args, **kwargs): ... self.app_da...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there any React plugin similar to jquery's infinitysliderv2 plugin?<p>I am looking for a react plugin to perform the same function as jquery's infinitysli...
<p>Were you able to come across Swiper.js? They have a lot to offer when it comes to carousels and it also has a lot of properties too which you can add to your carousel for it to be fully-customizable. Here is the docs for reference. <a href="https://swiperjs.com/demos" rel="nofollow noreferrer">https://swiperjs.com/d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Conditional rewrite in .htaccess based on domain<p>I have tried to use previous advice relating to similar questions, but without success. It may be that th...
<p>To rewrite to <strong>/domain1</strong> folder when <strong>domain1.me.uk</strong> is in the url,you can use :</p> <pre><code>RewriteEngine on RewriteCond %{HTTP_HOST} ^(www\.)?domain1.me.uk$ RewriteCond %{REQUEST_URI} !^/domain1/ RewriteRule ^(.*)$ /domain1/$1 [NC,L] </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 convert status(string) from http request to status_id(number) before applying business logic<p>This code is written in nestjs with typeorm I m using...
<p>If you're just looking to dynamically get the value of an enum through the enum key, you can use:</p> <pre><code>EnquiryStatusEnum[status as keyof typeof EnquiryStatusEnum] </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PhoneGap Build App Expiring Provisioning Profile<p>I have an "in house" hybrid app built with PhoneGap that is distributed via direct link so it does not use...
<p>Running an app on an iOS device simply requires that there is a valid provisioning profile on the device when you launch the app. If your app is the only one ever installed on the device (meaning the old provisioning profile is the only one that's been installed on the device), when you hit the expiration date, the ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Allow chinese Characters in a valid email address.<p>i am looking to find a way to allow Chinese characters in an valid email. </p> <p>The current code i ha...
<p>As described in <a href="https://developer.apple.com/reference/foundation/nsregularexpression" rel="nofollow noreferrer">the API Reference for <code>NSRegularExpression</code></a>, you can use the syntax <code>\p{UNICODE PROPERTY NAME}</code> to match any character with a specified <a href="https://en.wikipedia.org/...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Backbone set without merge<p>It seems that backbone merges fields when they are added to model using <code>set</code> method. Is there any way to add new fie...
<p><a href="http://backbonejs.org/#Model-set" rel="nofollow"><code>Model.set</code></a> doesn't support a direct replacement of the properties, but you can use <a href="http://backbonejs.org/#Model-clear" rel="nofollow"><code>Model.clear</code></a> to achieve what you want, something like:</p> <pre><code>var m = new B...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable autofilling id field when add form is called<p>Well, I'm unable to autofill the id field when I click the add button. The id field is a dropdown field...
<p>Solved, when set_relation two tables the id can't be set so, we must do this with normal field and it works with hidden field:</p> <p>I hope this will help more people with same problem.</p> <pre><code>if ($crud-&gt;getState() == "add") { $crud-&gt;change_field_type('idCitas', 'hidden', $idCarga); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sending JSON data stored in a struct through a segue<p>I'm wanting to store &quot;idMeal&quot; on the cell I click to send it through a segue to my DetailVie...
<p>I have to define the index the user tapped. E.g., just save the row and use it.</p> <pre><code> class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { var mealList = [Desserts]() var indexTapped: Int? func tableView(_ tableView: UITableView, didSelectRowAt ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Restore git history from split repositories<p>When our project started we where not to familiar with git, and at some point decided to re-start the repositor...
<p>You can do this pretty easily by fetching the commits from the old repository then using <code>git rebase</code> to replay the history of the new repository on top of the old one.</p> <p>First, fetch the commits from the old repository.</p> <pre><code>git remote add old_repo &lt;url-for-old-repo&gt; # Add old repo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using ES Module packages in Azure Typescript Function<p>I am unable to use the package <a href="https://www.npmjs.com/package/p-map" rel="nofollow noreferrer...
<p>I resolved my issue by renaming my index.ts file to index.mts. This built a index.mjs file (after running <code>npm run build</code>) in my dist folder which fixed the issue.</p> <p>One thing to note is that you also have to edit your function.json's scriptFile key so it uses your .mjs file instead of non-existing ....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to filter users that have multiple rows where row1="value1" and row2="condition2", ... in SQL?<p>A have the following data</p> <pre><code>id user_id visi...
<p>One aggregation approach might be:</p> <pre class="lang-sql prettyprint-override"><code>SELECT user_id FROM yourTable GROUP BY user_id HAVING SUM(visited_country = 'Spain') &gt; 0 AND SUM(visited_country = 'France') &gt; 0 AND SUM(visited_country = 'England') = 0; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Automating new cell entries based on condition<p>First-time caller, long-time listener. I'm sorry if the title is a bit off, not really sure how to vocalize ...
<p>It sounds like a cool project! Here are some thoughts:</p> <p>Using the Script Editor at Tools > Script Editor in Google Sheets:</p> <ol> <li>You can collect the clock in and clock out timestamps.</li> <li>You go through those cells in the code and <a href="https://stackoverflow.com/a/17171685/7053599">if the day ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: validate textbox without postback<p>Good morning/afternoon/evening to all of you, Sir/Ma'am, I have a question regarding my code below. What my code does is ...
<p>You either do the validation on form submit, onblur of the field or on keyup on the field. There other places that I'm not thinking of that you could do the client side as well.</p> <p>Here's a version of on key up:</p> <pre><code>$(document).ready(function() { $("#&lt;%=fname.ClientID%&gt;").on("keyup", fun...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cheerio not selecting certain elements that ARE present in HTML string<p>I'm trying to scrape a website, and I'm running into the problem where, using Reques...
<p>It turns out the code was written with an error, perhaps in efforts to deter scraping. There was a tag <code>&lt;font&gt;</code> that was closed with a <code>&lt;/div&gt;</code>, and this somehow broke cheerio's parsing ability.</p> <p><code>html = html.replace(/[&lt;]font size[=]["]1["][&gt;]\d[&lt;]\/div[&gt;]/g,...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I track the progress/status of an asynchronous AWS Lambda invocation?<p>I have an API which I use to trigger AWS Lambda jobs. Upon request, the API i...
<p><strong>There's no built-in way to check for the status of an asynchronous Lambda invocation.</strong></p> <p>Asynchronous Lambda invocation, using the event invocation type, is meant to be a <em>fire and forget</em> job. As such, there's no 'progress' or 'status' to get or poll for.</p> <p>As you don't want to wait...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Converted a code from javascript to python, tryin to use Python Turtle<p>The code under does not draw any image: &quot;&quot;&quot;</p> <pre><code>import tur...
<p>To my eye, it seems like you used an <code>if</code> when you meant a <code>while</code>. Making that substitution, and tidying up the code, it does draw something:</p> <pre><code>from turtle import Screen, Turtle from math import sin, cos, pi STEPS = 24000 SIZE = 61 def walk(i): turtle.penup() term = 1.0...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Tweepy streaming behind proxy not working<p>I can't seem to get tweepy stream working behind a proxy. By this I mean I've tried doing this:</p> <pre><code>t...
<p>Solved it. </p> <p>Couldn't be fucked to look through the whole of tweepy, but for some reason, the proxy setting wasn't being passed to the streaming function/wasn't working correctly.</p> <p>I fixed this by adding a manual proxy configuration in line 225 of streaming.py in the tweepy lib, such as:</p> <pre><cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Do I have to set up 2 EC2 instances in order to use AWS ACM?<p>I have one EC2 instance and I would like to set up HTTPS based on ACM. </p> <p>So it seems I ...
<p>You have more options to place the ACM other than on the ELB: <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-services.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/acm/latest/userguide/acm-services.html</a></p> <p>But if you are still wanting to use the ELB, you can just pick one subnet...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Want to build multiple Dockerfile via Ansible<p>I am trying to make Ansible-Playbook that builds multiple Dockerfile</p> <pre><code> │   ├── aa │   │   ├── 1...
<sup> <p>Given the tree</p> <pre class="lang-sh prettyprint-override"><code>shell&gt; tree conf/ conf/ └── aa ├── 11 │   └── ubuntu.18.04 │   └── Dockerfile ├── 22 │   ├── ubuntu.16.04 │   │   └── Dockerfile │   └── ubuntu.20.04 │   └── Dockerfile ├── 33 │   └── ubuntu.20...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I generate a table of IDs which have only one attribute each?<p>I have a table that looks like this</p> <pre><code>id attribute 1 a 1 a 2 ...
<p>ohh I just saw hive but this is pretty standard sql give it a try.</p> <pre><code>SELECT ID FROM TABLENAME GROUP BY ID HAVING COUNT(DISTINCT attribute) = 1 </code></pre> <p>Having is like a where statement after the <code>GROUP BY</code> aggregation has occurred.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Iterate the input step over different number of files in Pentaho<p>I have a <code>get file names</code> step with a Regular expression that gets 4 csv files....
<p>Change your current job to a subjob that executes once for each incoming record.</p> <p>In the new main job you need:</p> <ul> <li>a transformation that runs Get Filenames linking to Copy Rows to Result</li> <li>a Job entry with your current job. Configure it to execute for each row.</li> </ul> <p>In the subjob y...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Formula for generating delimited list of incremented numbers<p>Looking for a formula that takes a min and max value, then generates a delimited list of numbe...
<p>You may try</p> <pre><code>=TEXTJOIN(&quot;,&quot;,,SEQUENCE(1,3,2015,1)) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: An error occurred (ValidationException) when calling the PutItem operation: One or more parameter values were invalid: Missing the key CreatedAt<p>Help, I am...
<blockquote> <p>Wow what an oversight!! I finally came back to this project and discovered that within the Overview tab (on the AWS DynamoDB Service page), the Table definition's Sort Key attribute (that's underneath General Information section in The Dynamo &gt; Tables breadcrumb) had an extra space accidentally appen...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Groupby df column using pandas<p>I have data</p> <pre><code>1 member_id application_name active_seconds 2 192180 Opera 6 3...
<p>I think you need <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.core.groupby.GroupBy.aggregate.html" rel="nofollow"><code>aggregate</code></a>:</p> <pre><code>df1 = df.groupby(['member_id', 'application_name']) .agg({'application_name':len, 'active_seconds':sum}) print (df1) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does Plotly similar function like matplotlib fill_between<p>I am converting some matplotlib code to Plotly.</p> <p>Does Plotly have something similar to matp...
<p><code>go.Scatter</code> has a <code>fill</code> keyword that can be used to control the fill behavior. You can read more at this <a href="https://plotly.com/python/filled-area-plots/" rel="nofollow noreferrer">documentation page</a> or by typing <code>help(go.Scatter)</code>.</p> <pre><code>import plotly.graph_objec...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does new Map() works in javascript when the json has keys with same name<p>I have a JSON structure and code like below :</p> <pre><code>const villages =...
<p>A Map has key-value pairs, similar to an object, and will have a value for every <em>distinct</em> key. (If you want to use keys <code>k1</code> and <code>k2</code>, and <code>k1 === k2</code>, and you call <code>myMap.set(k1</code> and then later <code>myMap.set(k2</code>, then the initial value assigned by <code>k...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Postman returns status 200 OK, but JMeter gives 'Connection timed out'<p>I will try to provide as much as information as I can remember and can share due to ...
<ol> <li><p>If JMeter cannot connect to the server and Postman can most probably it means that networking configuration is not correct.</p> <p>So check your <a href="https://learning.postman.com/docs/getting-started/proxy/" rel="nofollow noreferrer">Postman proxy settings</a> and make sure that JMeter is <a href="https...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Localizing claims in custom policy<p>I have custom claims in my sign-up page <code>register_header</code> and <code>password_header</code> and I want to loca...
<p>• I would suggest you to please try configuring the localization string ids in the custom policy regarding the two custom claims that you want to be translated in Japanese. Since you have already done the same as posted in your localization strings claims, I would suggest you to please modify your custom policy to...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to determine the relationship represented by navigation 'Customer.BoughtProducts' of type 'ICollection<Product>'<p>I have 3 models and a User class wh...
<p>I don't know your Customer's code. But I guess you maybe use <code>ICollection&lt;Product&gt; </code> for more than one. Take seller as an example.</p> <p>According to your Seller.cs, I add below code in Product,</p> <pre><code> public Guid SellerId { get; set; } public Seller ProductSeller { get; se...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CloudBerry PowerShell Multipart<p>I've written a powershell script to upload from a windows system to an Amazon S3 Bucket. The script successfully uploads ...
<p>Set-CloudOption UseChunks=true</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: return in if statement throws conversion error<p>I will apologize in advance for the long post. Just trying to give you all the information I have.</p> <p>I ...
<p><code>records</code> is of type <code>List&lt;SearchRow&gt;</code>, which is not compatible with the type <code>List&lt;SearchResult&gt;</code>, you either have to convert the <code>SearchRows</code> to <code>SearchResults</code> (e.g. via a <code>Select</code>) or alter the type accepted by <code>ToCSV</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: marge widget in PyQt4 Python<p>how can i marge <strong>IP Address list</strong> and the <strong>combo box</strong> to the top?i already try using <strong>set...
<p>Use <code>QVBoxLayout.addStretch</code> method:</p> <pre><code>sublayout2 = QVBoxLayout() sublayout2.addWidget(lb3) sublayout2.addWidget(combobox_ip_list) sublayout2.addStretch(1) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Execution of script.sed gives error in ubuntu?<p>I have a .sed script in which I have a code to make changes in a dataset. The code is as follows:</p> <pre><...
<p>Replace</p> <pre><code>&quot;s/,BEL,/,Belgium,/g&quot; -e &quot;s/,IT,/,Italy,/g&quot; </code></pre> <p>with</p> <pre><code>s/,BEL,/,Belgium,/g s/,IT,/,Italy,/g </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to uninstall Visual Studio 2015<p>Some time ago i've installed Visual Studio 2015, then I continue to install 2017. How can I remove Visual Studio 2015 w...
<p>I haven't used Vs from a long time but as far as i remember, each version of VS has is own installer, so you can go to the control panel -> Application and look for the uninstaller of Visual Studio 2015, that should not affect VS2017</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Union Different Field type as String<p>I have <code>2 tables</code> in <code>GCP BigQuery Table</code>.</p> <pre><code>Table 1 has 4 Attributes Name (STRING...
<pre><code>SELECT name, CAST(id AS STRING) AS id, [Org Num], CAST([Country Code] AS STRING) AS [Country Code] FROM 'project1.Dataset1.Table1' UNION ALL SELECT name, id, CAST([Org Num] AS STRING) AS [Org Num], [Country Code] FROM 'project1.Dataset1.Table2' </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find out which condition breaks a logical and expression<p>I want to find an elegant way to get the component of the logical <code>and</code> expression belo...
<p>You can use <code>next</code> and a generator expression:</p> <pre><code>breaker = next((test.__name__ for test in (test1, test2, test3) if not test(value)), None) </code></pre> <p>Demo:</p> <pre><code>&gt;&gt;&gt; def test1(value): return True &gt;&gt;&gt; def test2(value): return False &gt;&gt;&gt; def test3(va...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting a Client Key in Microsoft Azure speech services<p>I am working in R (RStudio) and need to translate a lot of text automatically. I have identified th...
<p>Login to your Azure Portal and create an app. This will provide the components you need.</p> <p><a href="https://www.netiq.com/communities/cool-solutions/creating-application-client-id-client-secret-microsoft-azure-new-portal/" rel="nofollow noreferrer">This tutorial</a> gives a step by step guide</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Update Values of Multiple Array in Redux<p>I'm updating an array and I wanted to update the <code>productCode</code> based on the given <code>newCode</code> ...
<p>The issue is with the reducer</p> <pre><code>case appConstants.CREATE_ALL_PRODUCTS_SUCCESS: return { ...state, products: state.products.map((product, index) =&gt; { const found = action.payload.find((el) =&gt; el.productIndex === index); console.log(found); return found ? { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Translating an object not working as intended<p>When I try to create a cube that can be moved around using the z-axis using a translation matrix, half of the...
<p>I had found the error. It was with this line:</p> <pre><code>z_trans = numpy.array([0, 0, z, 0]) </code></pre> <p>I had to convert it to a matrix instead of an array.</p> <pre><code>z_trans = pyrr.Matrix44([1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, z, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting sql data based on row value<p>I have a table like so:</p> <pre><code>date | id ------------------------ 2022-04-01 | 1 2022-04-02 | 1 ...
<p>you can work with the window function <code>ROW_NUMBER</code> to get the date you want</p> <pre><code>WITH CTE AS (select id,date, ROW_NUMBER() OVER(PARTITION BY id ORDER BY Date DESC) rn from table) SELECT id,date FROM CTE where rn = 2 </code></pre> <p>Torpas is right, to exclude todays logins you and add another c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: OPENROWSET not able to convert datetime from text file<p>I have a flat file which is generated using SSIS. the flat file stores all the values for datetime d...
<p>Just truncate the trailing zeroes:</p> <pre><code>select cast( '2001-02-14 09:46:48.123000000' as datetime)-- error select cast( '2001-02-14 09:46:48.123' as datetime)-- ok select cast( '2001-02-14 09:46:48' as datetime) -- ok select cast( left('2001-02-14 09:46:48.123000000', 23) as datetime) -- ok </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Detect when curl file download is completed<p>I am downloading a file using curl on shell script:</p> <p><code>do shell script "curl -f http://example.com/f...
<p><code>do shell script</code> works synchronously. </p> <p>The next code line is executed when the download is completed.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: code designed to remove NaN from array, still returns NaN JS<p>I need to remove all empty values (null, undefined, '', NaN, false) EXCEPT 0 from an array. e...
<p><code>isNaN()!= NaN</code> has no meaning, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN" rel="nofollow noreferrer"><strong><code>isNaN</code></strong></a> is a function that takes a parameter and check (return <code>true</code> or <code>false</code>) if it's a valid...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to run other projects from a wrapper project in a solution<p>I have an asp.net core project(WebAPI) - "Project 1".</p> <p>I have a console applicatio...
<p>Solved the problem by following these 2 steps,</p> <ol> <li><p>compiling Project 1 and Project 2 as a class library rather than console application.</p></li> <li><p>copying configuration settings of Project 1 and Project 2 to Project 3.</p></li> </ol> <p>CODE: //called startup method of project 2 and 1 from main o...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reformating a large dataset in python<p>I have a large df from the WRDS CRSP database on monthly basis, which I need to reshape/reformat to be able to work w...
<p>You need pandas <code>pivot</code></p> <pre><code>df.pivot(index='Date',columns='Ticker',values='Prc') </code></pre> <p>Using sample data created as below</p> <pre><code>df = pd.DataFrame([ [19850101,'abc',1.0],[19850102,'abc',1.1],[19850101,'xyz',2.0],[19850102,'xyz',1.9] ],columns=['Date','Ticker','Prc']) </code><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use placeholder in CachedNetworkImage?<p>I want to add a placeholder of a progress bar while image is loading but for some reason it does not work.</p...
<p>You can use progressIndicatorBuilder when image is loading like this</p> <pre><code>progressIndicatorBuilder: (context, url, downloadProgress) =&gt; Container( decoration: const BoxDecoration( shape: BoxShape.circle, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Message size limit for Facebook messenger bot<p>I am trying to implement a Facebook messenger bot. I have trouble with the bot replying with a response that ...
<p>As <a href="https://developers.facebook.com/docs/messenger-platform/reference/send-api#message" rel="nofollow noreferrer">described in the doc</a>, text message <em>must be UTF-8 and has a 2000 character limit</em>.</p> <p>There are other restrictions <a href="https://developers.facebook.com/docs/messenger-platform...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Numpy comparing vectors of length m and n resulting in boolean matrix of size m,n<p>I am wondering if there is a more efficient way to run the comparison (or...
<p>You can use <strong>broadcasting</strong> to make this operation more efficient. Indeed, <code>repeat</code> creates a new temporary array. Here is the resulting code:</p> <pre class="lang-py prettyprint-override"><code>a.reshape(-1, 1) &gt; b </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Problems with fgets function<p>Here I use fgets() to get user input with several strings, it never appeared in the output:</p> <pre><code>#include &lt;stdio....
<p>Don't mix <code>scanf()</code> and <code>fgets()</code> or as man page says:</p> <blockquote> <p>It is not advisable to mix calls to input functions from the stdio library with low-level calls to read(2) for the file descriptor associated with the input stream; the results will be undefined and very probably not ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Domain changes when copying<p>I have set up a webserver and connected a dns with the domain shown bellow to it. The Problem is that when I copy and paste the...
<p>What you see is ok and works as designed. What you see is not a &quot;weird&quot; string, it is the ASCII representation of Internationalized Domain Names aka IDNs which are domain names using characters outside of the ASCII range.</p> <p>You can search for IDNA specification to understand more about that.</p> <p>Br...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ServerHttpSecurity authorizeExchange PermitAll Not Working<p>I've configured auth0 authentication with spring cloud API gateway, My basic setup is as follows...
<p>The problem is in the filter</p> <pre><code> @Bean public GlobalFilter customGlobalFilter() { return ((exchange, chain) -&gt; exchange.getPrincipal().map(principal -&gt; { String userName = &quot;&quot;; if (principal instanceof JwtAuthenticationToken) { //Get username from Principa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Implications of not assigning the return value of a function to a variable<p>I'm going through some introductory C++ exercises, one of which is: What's going...
<p>How automatic allocation is implemented on your particular platform is irrelevant. Your codes <em>does</em> trigger UB, not because you ignore the return value of <code>testMethod</code> (which, by the way, is <em>not</em> a method) but on the contrary because the following line uses it:</p> <pre><code>int* y = new...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Table not displaying as expected<p>Why am I getting this kind of display when trying on add line to my table ? <a href="https://i.stack.imgur.com/Zqa0X.png" ...
<p>Since you are using table tag the display already set to table but then in your CSS you are overriding the display property to BLOCK, So the solution is simple please see the CSS below and also please add more data as number of headings.</p> <pre><code>table { overflow: scroll; width: 100%; border-collapse: co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Make stream combination exhaust once one of its underlying streams are exhausted<p>If I want to combine multiple same-typed streams into one, I would use <a ...
<p>Write your own stream combinator:</p> <pre><code>use futures::{Async, Poll, Stream}; // 0.1.25 struct WhileBoth&lt;S1, S2&gt;(S1, S2) where S1: Stream, S2: Stream&lt;Item = S1::Item, Error = S1::Error&gt;; impl&lt;S1, S2&gt; Stream for WhileBoth&lt;S1, S2&gt; where S1: Stream, S2: Stream&lt;Item =...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How clear duplicate consecutive non-alphabetic characters in a string?<p>Matching the string only for: <code>,.:-</code> how I can remove duplicate values f...
<p>Here we are using <code>preg_replace</code> to achieve desired output.</p> <p><strong>Regex:</strong> <code>([,.:-])\1+</code> <a href="https://regex101.com/r/9qCH8J/2" rel="nofollow noreferrer"><strong>Regex demo</strong></a></p> <p>Or </p> <p><strong>Regex:</strong> <code>(,|\.|:|-)\1+</code><a href="https://re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Form contents are printed outside of the form while using PHP tag<p>I have created a table for category which fetches category data from database. The table ...
<p>This has nothing to do with PHP.</p> <p>You are trying to make <code>input</code> and <code>div</code> elements children of a <code>table</code> element, which is not allowed.</p> <p>Using <a href="https://validator.nu/" rel="nofollow noreferrer">a markup validator</a> would have highlighted this error.</p> <p>If yo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rename a row with X unknown characters<p>If I have the following dataframe:</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th>ID</...
<p>For an efficient solution, use vectorial methods and assign with <code>loc</code>:</p> <pre><code>df.loc[df['ID'].str.count('#').gt(2), 'ID'] = 'unknown' </code></pre> <p>output:</p> <pre><code> ID other 0 219218 34 1 823#32 47 2 unknown 42 3 8#3#32 32 4 unknown 97 5 unknown ...