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: NLTK Python TypeError: 'module' object is not callable<p>Trying to run the code below: </p> <pre><code>import os import nltk from nltk import word_tokenize ...
<p>If <code>'/usr/local/share/nltk_data'</code> is the path where your data exists, just do:</p> <pre><code>nltk.data.path = '/usr/local/share/nltk_data' </code></pre> <p>When you use <code>append()</code>, you are trying to use <code>os.path.append()</code> which is part of the <code>os</code> library.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JavaScript localStorage not working on first click<p>I have a page called category.html. I am trying to store value of category in JavaScript localStorage so...
<p>You are registering the click event only AFTER you call store. Store will be called, the event will be setup, then the click events will work, try this:</p> <p><a href="https://jsfiddle.net/ahp8tpzn/1" rel="nofollow noreferrer">https://jsfiddle.net/ahp8tpzn/1</a></p> <pre><code>$(document).ready(function() { v...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Open a png file to put as a comment background for a pop up image in Microsoft Excel<p>I am trying to put comment background based on a certain field in the ...
<p><strong>UPDATE:</strong> <br> <a href="https://i.stack.imgur.com/yt7gJ.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yt7gJ.gif" alt="Example"></a> You need to add the reference Microsoft Scripting Runtime in order to use the variable type "Scripting.FileSystemObject".</p> <p>This works for me</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mantis "Recently modified" changing after user monitors an issue<p>I'm administering a mantis site which has tens of thousands of users and thousands of issu...
<p>Unfortunately not without modifying the code.</p> <p>Try commenting out <a href="https://github.com/mantisbt/mantisbt/blob/release-1.3.0/core/bug_api.php#L1964" rel="nofollow">this line</a>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to implement React in a jQuery-based webapp?<p>I've been studying React and now I want to try implementing it on some pages only, as a proof-of-concept t...
<p>Why not?</p> <pre><code>&lt;script type="text/babel"&gt; // Define children components here class App extends React.Component { render() { return (&lt;div&gt;Hello world&lt;/div&gt;) } } ReactDOM.render( &lt;App /&gt;, document.getElementById("output") ); &lt;/script&gt; </code></p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why use setter when you can assign massively using a method?<p>I found out that I can assign data to a property using set or a method.</p> <pre class="lang-d...
<p>Typically, the targets of getters and setters are made private so they're not directly accessible from outside of the file or library.</p> <pre><code>class Business { String name, _address; double lat, long; bool coordsCalculated = false; Map propertyRecords = {}; get address { return _address; } ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I find out if this location is within the cropped area?<p>I have a 2D matrix. I created a cropped region from this matrix. I have a position knowledg...
<p>I assume your matrix entries are position entries? If not, create two matrices x and y with size of your 2D matrix and take them as reference.</p> <pre><code>% create matrix [x,y] = meshgrid(1:50); % cropped matrix x_crop = x(20:45,10:30); y_crop = y(20:45,10:30); % position in full-size matrix pos = [25, 23]; % ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to generate a dump sqlite3 with columns names on insert?<p>Regarding the dump generated by sqlite3:</p> <p><code>$ sqlite3 db.sqlite3 .dump &gt; db.dump...
<p>You could do some kind of search/replace operation after you get the dump. If "table" has the columns "id", "col_0" and "col_1", you would replace "insert into table values" with 'insert into table ("id", "col_0", "col_1") values'.</p> <p>You can do this in your favorite editor (vim, for example) or in the language...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PUT method for Symfony firewall form_login paths<p>I'm configuring the Symfony firewall to handle a login form. The trick is that the check route <strong>mus...
<p><em>We found the answer before I posted this question, here it is...</em></p> <p>For the firewall to accept login check on methods other than GET, you must this option: <code>post_only: false</code>. It's true by default.</p> <pre><code>firewalls: main: pattern: ^/ anonymous: true provi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: firebase_auth/unknown error after app release<p><a href="https://i.stack.imgur.com/yReFi.jpg" rel="nofollow noreferrer">enter image description here</a></p> ...
<p>solved : use special v.p..n.s firebase not works with android hardware if you are in iran or banned countries .</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django Ajax GET request<p>i'm very very new to jquery and ajax and right now i've already built a django forum-app whereby on the homescreen, the left side d...
<p>So, assuming you want to render this on the server (which is the simplest to explain), this is fairly simple.</p> <p>Give your right sidebar an <code>id</code> so you can reference it with jQuery like <code>$("#the-id-here");</code></p> <p>Using <code>$.get()</code>, you can do an ajax request to your server. You ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spring AOP around rest exucution<p>I have a small piece of code. Rest controller</p> <pre><code>@RestController public class GreetingController { @Requ...
<p>An around advice has to return (as Object) the result of the .proceed()-method or you are removing the return value.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to remove these swagger warnings, about HEAD and OPTIONS?<p>I used swagger on express js and when I do a query I am getting this warnings.</p> <p><code>...
<p>Finally got it working, I mean the warning is not showing anymore. The solution is just a one liner, sending HTTP status of <code>200</code> telling the browser that the request is supported.</p> <pre><code>export function optionCORS(req: Request, res: Response, next: NextFunction): void { // I am just setting t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Prevent Spring from meddling with CDI annotations even for factory created instances<p>I have a legacy product's JAR that contain Spring (4.3.8) managed clas...
<p>I finally was able to solve (work around) the problem. I had to remove all CDI-Annotations in the legacy JAR (by replacining them with their Spring counterparts), so spring would any longer work. </p> <p>Then I added the following XML block to the applicationContext.xml of my CDI WAR:</p> <pre><code>&lt;context:co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reproduce a colour effect<p>When an Excel cell referencing other cells is selected, the referenced cells are systematically highlighted with different colour...
<p>The only thing I can think of is by using svg and rectangles, dynamically generating them and assigning them colors based on numbers of cells selected (I suppose Excel assigns random colors?!). You can achieve the overlay effect by using <code>mix-blend-mode</code> (see snippet below, pay attention to the colors def...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I append an alement after another element?<pre><code>&lt;div&gt; &lt;label for="form_username" class="required"&gt;Username&lt;/label&gt; &lt;i...
<p>Since your input tag has an id <code>form_username</code>, you don't have to use <code>[name]</code> attribute as a selector anymore.</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-overri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Put entries of numpy matrix of differing column length into a 1D array<p>I'm working in Python. I have a numpy array of length L, called "arr", <code>arr = n...
<p>Sounds like you want to flatten a nested list. That is, your array of arrays is effectively a list of lists. There's a standard Python idiom for that, <code>itertools.chain</code>:</p> <p>Make a sample array of arrays:</p> <pre><code>In [828]: arr = np.array([np.arange(i) for i in range(1, 5)]) In [829]: arr Out...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: css changes not shown in browser<p>I don't think this is worthy question or not but still I am in trouble to find solution?</p> <p>I am working on my first p...
<p>If you made changes in the style section or main.css, those can be overwritten and not take effect if you also put styles within the html element. Put some code up and people can help you better.</p> <p>if you use the ``` code can go in your original post. Edit it.</p> <p>PHP</p> <pre><code>&lt;?php $t=time(); ech...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to fix jump when click on search bar?<p>There is a phenomenon that jumps when you click the search bar.</p> <p>The view is below.</p> <p><a href="https:/...
<p><a href="https://developer.apple.com/documentation/uikit/uiviewcontroller/1621515-edgesforextendedlayout" rel="nofollow noreferrer">https://developer.apple.com/documentation/uikit/uiviewcontroller/1621515-edgesforextendedlayout</a></p> <p>I have set &quot;under top bars&quot; of &quot;extend edge&quot; options in Vi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: XAML/MVVM help for implementing screen grid<p>As a complete beginner to XAML/MVVM I would like to request some help with implementing a 24x14 letter screen.<...
<p>The solution for me (minimal example) looks like this:</p> <p>In the XAML the grid gets defined like this</p> <pre><code>&lt;Grid x:Name=&quot;ScreenGrid&quot; RowDefinitions=&quot;*, *, *, *, *, *, *, *, *, *, *, *, *, *&quot; ColumnDefinitions=&quot;*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*,*...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pass data from one tableview to another using segue and didSelectRowAt<p>I have already shown a list of metro station on the screen, what I want to do is whe...
<p>In <code>didSelectRowAt</code> delegate method perform segue and as sender pass selected station</p> <pre><code>performSegue(withIdentifier: "identifier", sender: stations[indexPath.row]) </code></pre> <p>then you should have variable in destination ViewController and you can assign this variable in prepare for se...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pass a list of text in pandas str.replace function at once instead of iterating individual list elements<p>pandas function <code>str.replace</code> has 2 par...
<p>It seems you need <code>list comprehension</code> with <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.replace.html" rel="nofollow noreferrer"><code>Series.replace</code></a> (not <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.str.replace.html" rel="nofollow...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MFC: Emdedded child dialog is not showing up within parent dialog<p>I came across a <a href="https://www.codeproject.com/Articles/4087/How-to-implement-a-scr...
<p>It turns out (while composing this question) that the answer to my problem was two properties I need to set while in the resource view. When I have the child dialog open (<code>IDD_CHILD</code>), within the properties pane, I need to set the following properties:</p> <ul> <li><strong>Style</strong>: Child</li> <li>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What are ARG and LABEL in a Dockerfile<p>I have a Dockerfile that starts out...</p> <pre><code>FROM some.artifactory.example.com/openjdk:8-jre-alpine ARG ve...
<p>A <code>LABEL</code> is a piece of metadata on an image. You can add any <code>key=val</code> as a LABEL.</p> <p>An <code>ARG</code> is something you can pass at build time, to the builder. You can then use the value in your Dockerfile during the build (but it is no longer available at runtime; so unless you somehow...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to access BrowserRouter history outside of BrowserRouter?<p>Below is my code snippet simplified. (using react-router-v5) My question is how to get access...
<p>If you are trying to access parts of a routing context in the <code>App</code> component then the router providing the context needs to be higher in the ReactTree. The solution is simple. Move <code>BrowserRouter</code> higher than <code>App</code> in your apps code. Wrapping <code>App</code> in the <code>BrowserRou...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Interface hierarchy: general purpouse and how to use it<p>I have two interfaces and one class. This is what I have:</p> <pre><code>public interface Interfac...
<p><strong>1. Why InterfaceB cannot implements InterfaceB?</strong></p> <p>Because InterfaceB itself is an interface. Either you should extend InterfaceA or make InterfaceB concrete/abstract class.</p> <p><strong>2. Why MyClass can leave InterfaceA's methods unimplemented?</strong></p> <p>Really! If MyClass is not a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jQuery progress prevention code stop working<p>I have this snippet to prevent auto-progress in form on the step where user must select multiple questions. Th...
<pre><code>//Your code not clear. Just try this below code (function ($) { jQuery('#tab .question').on('click', function (e) { $target = jQuery(e.target); var isChecked = $target.prev().attr('checked'); if (isChecked) { $target.prev().prop('checked', false); } else { $target.prev().prop(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Lodash Js create a tree structure with arrays and objects<p>I'm trying to create a Lodash Tree like Arrays and Object. I have two arrays(like category and pr...
<p>You need to wrap the category object into a key <code>category</code></p> <p>This snippet should work for you</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>let categorie...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find an element in a dict inside tuple?<p>I have made a bit of a mess, so it is the first time I try to fetch data from a Microsoft AD. I have succeed...
<p>As far as I see, the result is a <em>tuple</em> and the <em>tuple</em>'s second element is a <em>dict</em>. So firstly you should get the second element of the <em>tuple</em> with <code>ldap_result[1]</code> and then you should access to the <code>givenName</code> field of <em>dict</em>.</p> <p>So if you combine all...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to optimise the grouping of values in lists by key in a dictionary list?<p>The script below works but I was wondering if there is a faster solution? With...
<p>It seems keys in the dictionaries are the same, so you could use a dict comprehension:</p> <pre class="lang-py prettyprint-override"><code>out = {k:[d[k] for d in input] for k in input[0]} </code></pre> <p>Another pretty fast alternative is to use the <code>cytoolz</code> module.</p> <pre class="lang-py prettyprint-...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get accesstoken via code using Azure Oauth 2.0<p>The situation: I have successfully get the code parameter from returning url via </p> <p><a href="ht...
<p>Thank you guys.</p> <p>I finally fellow <a href="https://blog.xamarin.com/authenticate-xamarin-mobile-apps-using-azure-active-directory/" rel="nofollow noreferrer">this article</a> and successfully got the access token, logged user info. The point to successfully get the access token is to give right parameters, th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: two way data binding in angular2 from parent component to child component<p>I am passing an object from parent to child. In child I am making changes to thi...
<p>If you are not reassigning <code>record</code> in the child &ndash; i.e., you are not doing something like <code>this.record = newRecord;</code> &ndash; then what you have should work fine. </p> <p>Since you are passing a JavaScript reference type (an object) to the child, any changes you make to the properties of...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to substitute different number of digits behind special character with regex<p>I have the following kind of string:<code>&quot;§ 9,12,14,15 und 16&quot;<...
<p>There is no single regex which can do that. What you can do is split your string into parts, and perform a substitution on each.</p> <pre><code>text = &quot;§§ 9,12,14,15 und 16&quot; parts = re.search(r'(§*)\s*((?:\d+,?\s*)+)\s*und\s+(\d+)', text) if parts: sections = parts.group(2) text = re.sub(r'(\d+)', ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: export functional component with injectIntl without using default export<p>Now I have two components, List and Item. Since Item is only used in List, I want ...
<p>This works fine:</p> <pre><code>export const Item = injectIntl( (props) =&gt; {...} ) </code></pre> <p>Just don't forget the the brackets, i.e. const Item = injectIntl(<strong>arrow function</strong>)</p> <p>Also use rest to get all existing parameters. And remove spaces from your id, otherwise querySelector will ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Determining 32-bit Mask in C<p>I'm not a C programmer, but found myself in a situation where I need to do some coding. I am using an ADC to determine voltage...
<p>channel 0, 1, 2, 3 ... correspond to the masks <code>1 &lt;&lt; channel</code> which are 1, 2, 4, 8 ... You can make a mask of multiple channels by combining bits with the <code>|</code> (bitwise OR) operator.</p> <p>The example mask 0x0103 corresponds to channels 0, 1 and 8. Since only 6 channels are enabled the ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Background size doesn't work on IE8<p>I use the following code to position icons in my login fields: </p> <pre class="lang-css prettyprint-override"><code>....
<p>Sadly, the only solution was to set a special rule for IE9 which removes this with white background:</p> <pre><code>background: #fff\9; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Compare values from multiple dictionaries<p>I have two lists of dictionaries and a tuple:</p> <pre class="lang-py prettyprint-override"><code>vrfs = [ {'def...
<p>Your question is not clear but I do what I understand.</p> <pre class="lang-py prettyprint-override"><code>for a in my_dict: if a['VLAN'] in vlans: for i in vrfs: if a['VLAN'] in i['interfaces']: print(i['name']) </code></pre> <p>OUTPUT:</p> <pre class="lang-none prettyprint-o...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Validate dataclass field with custom defined method?<p>While working with dataclasses, type hints are good but what I'm looking also for is a <strong>Validat...
<p>The ideal approach would be to use a modified version of the <a href="https://docs.python.org/3/howto/descriptor.html#validator-class" rel="nofollow noreferrer"><code>Validator</code></a> example from the Python how-to guide <a href="https://docs.python.org/3/howto/descriptor.html" rel="nofollow noreferrer">on <em>d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Giving an input a default value in redux-form<p>I would have thought this is stupidly easy... but I am struggling :D</p> <pre><code> &lt;Field type="text...
<p>define <code>initialValues</code> outSide of your class</p> <pre><code>const initialValues = { email: 'example@gmail.com' } </code></pre> <p>and put initialValues here </p> <pre><code>export default reduxForm({ form: 'venues', // a unique identifier for this form destroyOnUnmount: true, validate, init...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Average distance of each variable<p>The average distance of each variable may be calculated using the formula given below. Here d represents the average dist...
<p>Sorry at first I had a misunderstanding. Now this is what you really can do:</p> <pre><code>d &lt;- function(mat) { ind &lt;- as.numeric(combn(nrow(mat), 2)) n &lt;- length(ind) / 2 mean(apply(mat, 2, function(x) {y &lt;- x[ind]; sum((y[seq(from = 1, length = n, by = 2)] - y[seq(from = 2, length = n, by = 2)]...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CSS3 linear gradients<p>Here is a linear gradient that creates triangles in the top right of bottom left of the div, however, i can't work out how to make ...
<p>Remove the one from 0% to 5% and the one from 5% to 10%</p> <p>Basically here you have to imagine a page with a series of lines dividing it, rotated by 45 degrees.</p> <p>So from 0% of the page to 5% (bottom left), it's orange - <code>rgba(237,165,9,1) 0%, rgba(237,165,9,1) 5%</code></p> <p>From 5% to 10% - grey:...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firebase function - http get parameters with acentuation<p>I have a firebase function doing a http GET. There are 3 parameters and all works ok but if one of...
<p>Whenever you build a URL, you should properly escape all the query string components so that they contain <a href="https://stackoverflow.com/questions/2366260/whats-valid-and-whats-not-in-a-uri-query">only valid characters</a>. That's what <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/G...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to check if an existing specific user (say techxhelp) is logged in and then logout that specific user in django?<p>I want to do something like this in vi...
<p>Simply determine the <strong>Id</strong> of the <strong>specific user</strong> you are intending to logout, then you can implement something like:</p> <pre><code>from django.contrib.auth import logout BAD_USER = 1337 # assuming the user's Id is '1337' def home(request): user = request.user if user.id == BA...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why compiled APK does not respect minSdkVersion?<p>I have created a sample project from an Android Studio with <code>minSDKVersion=17</code>. I opened compil...
<p>All of those directories will be valid on API Level 17+ devices. 17 is higher than 13, 11, and 4. Android apps might pull resources from those directories, if there is not a resource that is a <a href="https://developer.android.com/guide/topics/resources/providing-resources.html#BestMatch" rel="nofollow">better matc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TypeError: 'type' object is not subscriptable during reading data<p>I'm pretty new importing data and I´m trying to make def that reads in the presented orde...
<p>Looks like the problem is right in the type hint of one of your function parameters: <code>dict[str, int]</code>. As far as Python is concerned, <code>[str, int]</code> is a <em>subscript</em> of the type <code>dict</code>, but <code>dict</code> can't accept that subscript, hence your error message.</p> <p>The fix i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create MS-Access VBA module from MS-Excel<p>I am using a large Excel *.xlsx table to create a MS Access *.accdb Database, including some queries. This provid...
<p>So I found the solution, sharing it here in case someone needs this aswell</p> <p>The following codes applies these steps</p> <ul> <li>Create a new default module</li> <li>rename the new module</li> <li>add code to the new module</li> </ul> <p>And the code, which has been used in MS Excel looks like:</p> <pre><c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: "onChange" event not firing in component, html Angular<p>I have this html template for a component that renders all the doctors in the database, and an array...
<p>Put your listener in the select element. Option elements don't have change listeners.</p> <pre><code>&lt;select (change)=&quot;changeColor($event)&quot;&gt; &lt;option *ngFor=&quot;let color of colors&quot; [ngStyle]=&quot;{ backgroundColor: color }&quot; &gt; {{ color }} ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to replace <span class="italic"> with <i> with BeautifulSoup?<p>I have some HTML like this:</p> <pre><code>&lt;p&gt;Lorem ipsum dolor sit amet, consectet...
<p>You could simply rename the tags <code>name</code> and delete its <code>class</code> attribute:</p> <pre><code>for e in soup.select('span.it'): e.name = 'i' del e['class'] </code></pre> <p>or in case that there are more attributes:</p> <pre><code>for e in soup.select('span.it'): e.name = 'i' for attr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel Nova HasOne Relationship view and edit 2 models in single panel<p>I have a HasOne relationship between 2 models.</p> <p>In Laravel Nova, is it possi...
<p>This feature is not officially supported in laravel nova. but there is a workaround to achieve it using model accessors and mutators. <a href="https://github.com/laravel/nova-issues/issues/799#issuecomment-439821920" rel="nofollow noreferrer">this answer can help you</a></p> <p>Example:</p> <pre><code>// in the mo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: exit on error + echo doesnt work together<p>I'm trying to add a meaningful error message to errors in my script, and exit at the 1st exit.</p> <p>I tried <c...
<p>You only exit the subshell <code>( )</code> but not the actual shell.</p> <p>You can use <code>{ }</code> instead of a subshell <code>( )</code> to group your commands. Example:</p> <pre><code>false || { err=$?; echo msg; exit $err; } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: why the COUNTS_BY_COLOUR.COUNTS is invalid identifier in oracle apex<p>The following code gives an error when I specify the name of the columns(<code>select ...
<p>You have used a quoted identifier <code>&quot;counts_by_colour&quot;</code> and quoted identifiers a case sensitive.</p> <p>In contrast, unquoted identifiers are implicitly converted to upper-case so <code>counts_by_colour</code> is converted to <code>COUNTS_BY_COLOUR</code>.</p> <p>When you compare the two, <code>&...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to mock an import with jest<p>I have a small <code>redux</code> middleware like so</p> <pre><code>import { hashHistory } from 'react-router' import { RE...
<p>You can mock the <code>react-router</code> module like this:</p> <pre><code>import { hashHistory } from 'react-router' import { REDIRECT_TO_LOGIN_REDIRECT_URL } from '../actions/login-redirect'; import redirectMiddleware from './redirect-after-login'; jest.mock('react-router', () =&gt; ({hashHistory: { push: jest....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Usage of NPoco in .net Core<p>I have recently started diving into the new .net core along with asp.net core mvc. There have been several issues that I have c...
<p>There are other people having the same issue. This has been reported as <a href="https://github.com/schotime/NPoco/issues/293" rel="nofollow">issue #293 on NPoco GitHub repository.</a></p> <p>The current workaround for this problem is to list the DbProviderFactory as shown below.</p> <pre><code>IDatabase _db = new...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: gdb <error reading variable> for any string object<p>Lets take this very simple program here for example:</p> <pre><code>// test.cpp #include &lt;string&gt; ...
<p>First run your program with gdb like so:</p> <pre><code>gdb test.exe </code></pre> <p>Now inside the command line interface run the command:</p> <pre><code>set charset UTF-8 </code></pre> <p>This should temporarily fix your problem. The only inconvenience might be that you need to run this line every time you debug ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CSS to make the container DIV to cover full page<p>I am trying to convert a <a href="https://codepen.io/drehimself/pen/KdXwxR" rel="nofollow noreferrer">chat...
<p>This will do:</p> <pre><code>.chat .chat-history { height: calc(100vh - 278px); overflow-y: auto; } .people-list { height: 100vh; overflow-y: auto; } </code></pre> <p>Updated codepen: <a href="https://codepen.io/anon/pen/BRxXmV" rel="nofollow noreferrer">https://codepen.io/anon/pen/BRxXmV</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sort List<Object> by current month to Last six months<p>I am having the following data in my list:</p> <pre><code> List&lt;FeatureAnalyzeDTOResult&gt; lis...
<p>Here's how I would do it:</p> <pre><code>enum Month { JANUARY, FEBRUARY, MARCH, APRIL, MAY, JUNE, JULY, AUGUST, SEPTEMBER, OCTOBER, NOVEMBER, DECEMBER } public static void main(String[] args) { List&lt;String&gt; data = Arrays.asList(&quot;october&quot;, &quot;apri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Object possibly null despite checking<p>Why is TS complaining</p> <blockquote> <p>Object possibly null</p> </blockquote> <p>despite my check?</p> <pre><code>...
<p>Since this is accessing a property of an object via key variable, TS does not recognize that both statements refer to the same value. You can store the value in a temporary constant to fix this:</p> <pre><code>const item = data[i]; if (item !== null) { result += item; } </code></pre> <p>But I would not recommend u...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: XML Schema validation error - missing declaration of element<p>Following is the xsd.</p> <pre><code>&lt;xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSche...
<p>You are very close. In addition to defining the <code>Message</code> <em>type</em>, you also have to declare the <code>Message</code> <em>element</em> itself. You can do so by adding,</p> <pre><code>&lt;xsd:element name="Message" type="dmb:Message"/&gt; </code></pre> <p>to your XSD. Then your XML will be valid ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Limit per some field<p>Suppose we have such an sql query, with joined data from another table.</p> <pre><code>SELECT pr.num, pr.resort_id, p.src_mask F...
<p>Use <code>ROW_NUMBER</code> to count the rows per <code>resort_id</code>.</p> <pre><code>SELECT resort_id, num, resort_id, src_mask FROM ( SELECT pr.resort_id, pr.num, pr.resort_id, p.src_mask, ROW_NUMBER() OVER (PARTITION BY pr.resort_id ORDER BY num) AS rn FROM rutraveler.rt_photo_resort AS pr ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: axios doesnt fetch on refresh, only on first render<p>So I've been struggling for a while with retrieving data from APIs and or retrieving local json files. ...
<p>As I mentioned in the comments, states are updated asynchronously. So, you should be careful when you use a state immediately after setting its value. In your case, you shouldn’t use the <code>data</code> state because you are not sure that it has a value. Try changing to this.</p> <pre><code> useEffect(() =&gt; { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mocking a connector throws error like Element not defined in Mule Registery<p>I am creating the Munit tests and mocking the salesforce connector for the quer...
<p>It looks like you missed the <code>#</code> before the brackets at the value to indicate it is an expression. I'm guessing that without considering an expression MUnit tries to use the value as a literal id to search in the Mule Registry, but that is not something you need to care about. Just add the missing <code>#...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I do Date calculation in React?<p>Say, I just retrieved an object called &quot;food&quot; from the database. &quot;food&quot; has an attribute called &qu...
<p>you can use the library <code>moment</code> <a href="https://momentjs.com/" rel="nofollow noreferrer">https://momentjs.com/</a></p> <p>and declare your two dates</p> <pre><code>let date1 = moment('2022-04-20T03:25:53.763+00:00'); let date2 = moment('2022-04-11T03:25:53.763+00:00'); </code></pre> <p>then get the diff...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to delete the second word using : as separator on java script<p>so i have string like this</p> <pre><code>accept : menerima accuse : menuduh achieve : ...
<p>A different approach to a regex would be to loop over the lines, and split the <code>:</code> using a map.</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>const string = `ac...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calculate the remaining days on view Laravel, negative days if date has passed<p>These are the values on my database, I just need to get the remaining days o...
<blockquote> <p>the problem solved but , im confused with the may 7 , which is the 3rd row should give me a negative value</p> </blockquote> <p>If you want to get the negative values, you would need to pass <code>false</code> as the second parameter of the <code>diffInDays</code> function.</p> <pre><code>Carbon\Carbon:...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a way to use Firebase Legacy console from new account<p>I have a project which uses instructions for the Firebase v2 but even trying to log in to <a...
<p>Projects created on (or migrated to) the new console on <a href="https://console.firebase.google.com" rel="nofollow">https://console.firebase.google.com</a>, will only be visible on that console. They will not (or no longer) show up on the <a href="https://www.firebase.com" rel="nofollow">legacy Firebase dashboard</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: VBA function causing runtime error 13 while returning array in excel 2016 but not in office 365?<p>I have a function that reads data in an tab and returns it...
<h2>One-Row Range to 1D Array</h2> <ul> <li><p>Why use one-liners with limited functionality? They are shorter but usually not faster.</p> </li> <li><p>In your sub, you could use:</p> <pre><code>actionDict(id).Add OneDaRow(rw.Cells(2).Resize(1, numArrCols)) </code></pre> </li> </ul> <p><strong>The Function</strong></p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change sprite's direction to diagonal if two movement keys are pressed simultaneously<p>I am trying to move a sprite using arrow keys. Below is the lo...
<p>You need to move the movement logic out of the event listener. Have the key event just log the current state of each key (up or down) then in the main loop check the state and move the play as needed.</p> <p>As I am unsure if you want the movement to be constant or only on the press I have included the option to c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Delete multiple xml nodes with same name (but not all)<p>How can I delete an xml node based on the data within.</p> <p>For example if in the below I wanted ...
<p>You can use <a href="http://docs.oracle.com/cd/E11882_01/appdev.112/e23094/xdb04cre.htm#ADXDB4305" rel="nofollow"><code>deleteXML()</code></a> with an XPath that specifies the node values you want:</p> <pre><code>deleteXml(&lt;your_xml&gt;, q'{//MMGroupID[text()='143' or text()='70']}') </code></pre> <p>Demo:</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is "getUserSelectedOutgoingPhoneAccount()" not callable from my telecom manager instance?<p>So I am trying to set up a system for multiple phones being c...
<p>Answer:</p> <p>After looking into it some more, it appears my application is running on a lower API Level than this method has been implemented in (Android 8.1.0, which is API Level 27). This method requires API Level 29 or higher in order to call it.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Select and extract contact details using Intent and ActivityResultContracts<p>I have a button to open and select a contact for some of it's specific data - n...
<p>It seems using <strong>ActivityResultContracts.PickContact()</strong> is the issue.</p> <p>I had to modify the code using <strong>Intent</strong> and <strong>ActivityResultContracts.StartActivityForResult()</strong> to get my desired result. Here is the new code</p> <pre><code>@Composable @Preview fun openAndSelect...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: move element to top when click each buttons<p>I have list and each list has "move top" button. when click "move top" button, div element shoul be move to top...
<p>You are prepending the wrong item. You need to prepend the parent <code>div</code> of the button, not the button itself. Also, you need to prepend to the <code>.wrap</code> div, which is the button's <code>parent parent</code> rather than to the button's parent which is just the <code>div</code> wrapping the button....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android "visibility" doesn't change if next instruction take long time<p>I have following situation in my fragment.</p> <pre><code> @SuppressLint(&quot;Click...
<p>All the code you have shown is running on the main (UI) thread. The documentation clearly states that <code>MediaPlayer.prepare()</code> can take a long time and <strong>should never be called on the main (UI) thread</strong>. The documentation even explains how to do this using <code>MediaPlayer.prepareAsync()</cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to activate a scrollTo before React renders its components?<p>In my React application, I have a <strong>TextHistory</strong> component which d...
<p>There is a react hooks api called <code>useLayoutEffect</code> which I believe can help you.</p> <p>The hook is similar to the <code>useEffect</code> hook but the difference is that updates scheduled inside <code>useLayoutEffect</code> will be flushed synchronously, before the browser has a chance to paint.</p> <p>U...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In pyspark how to check the format a pyspark was read in? Delta vs parquet<p>I have function that reads in file which could either be in delta or parquet for...
<p>You can't do that with Spark, but you can use <code>dbutils.fs</code> to check if delta metadata file exists</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why authorization token exists in axios interceptors even after deleting the token?<p>I am building a project where I store my auth token in the localstorage...
<p>The token persists in the interceptors because in the onClick event you are removing the token just from the storage, but not from the interceptors themselves.</p> <p>To remove it, you must change or delete the value of the header:</p> <pre><code> &lt;Button onClick={()=&gt;{ localStorage.removeItem('token') ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Feeding data from C to Python in Ubuntu<p>I'm trying to generate numbers in C, then pass them onto python, and print the data using sys.stdin. The code for g...
<p>You just need to flush the output. The reason is explained in <a href="https://stackoverflow.com/questions/13932932/why-does-stdout-need-explicit-flushing-when-redirected-to-file#13933741">Why does stdout need explicit flushing when redirected to file?</a>, i.e. the piping changes the buffering behavior.</p> <pre><c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: higher-order quantification that cannot be skolemized<p>I'm learning Alloy and experimenting with creating predicates for relations being <code>injective</co...
<p>Think of it like this: every Alloy analysis involves model finding, in which the solution is a model (called an instance in Alloy) that maps names to relations. To show that no model exists at all for a formula, you can run it and if Alloy finds no solution, then there is no model (in that scope). So if you run</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dropdownmenu-Limitation to 1<p>I just wanted to ask you if it is possible to limit the amount of Dropdownmenus opened at the same time. In the following you ...
<p>Your &quot;.dropdownbtn&quot; in place makes it more complicated. What do you think of customization?</p> <pre><code>&lt;nav&gt; &lt;ul class=&quot;my-nav&quot;&gt; &lt;li&gt; &lt;details class=&quot;dropdownbtn&quot;&gt; &lt;summary&gt;First&lt;/summary&gt; &lt;ul&gt; &lt;li&gt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: My wordpress blog is getting more views and visitors but my website does not while it has same data over it<p>I have created a wordpress blog previously and ...
<p>This may be because you are not continuously upgrading your website so that it can be easily searchable in google's or search engine's searching. Wordpress blogs are continuously getting upgraded using keywords to get the ranking in search engines. In simple words, you should focus on your website's SEO (Search engi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: what is an infostore in SAP Business Objects?<p>I am confused what InfoStore is and what it consists of:</p> <p>when i request <a href="http://localhost:640...
<p>The infostore consists of <em>infoobjects</em>. An <em>infoobject</em> represents a report, folder, universe, user, event, calendar, server, service, server group, user group, relationship, category, publication, object package, destination plugin, hyperlink, license key, security plugin, and many other things.</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Modifying pandas dataframe through function in python<p>I tried to modify the dataframe through function and return the modified dataframe. Somehow, it is n...
<p>ding.C doesn't exist and can't be accessed like an attribute. You need to change the line to</p> <pre><code>ding['C']=ding.A+ding.B </code></pre> <p>You can create an column like <code>ding['A'] = blah</code> which then turns into an attribute of the DataFrame. But you can't go the other way around.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular 2.0.0-rc.1: How to test elements on the view or content (e.g. @ViewChildren, @ContentChildren)<p>I have a component that gets data from a service whi...
<p>Injecting a component only creates an instance of the component class but no lifecycle callbacks will be called and no view created. </p> <p>You need to use the <code>TestComponentBuilder</code> instead:</p> <pre><code>describe('ComponentToTest', () =&gt; { let component: ComponentToTest; beforeEach(async(inje...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jquery noConflict Syntax advise<p>Please let me know how to write Jquery noConflict for the below javascript? Anyone kindly advise me the syntax for this one...
<p>Use unnamed function wrapper to pass jQuery as parameter.</p> <pre><code>jQuery.noConflict(); (function($){ $("#myOverlay").fadeIn(); // "500" is not required. "400" is the default $("#myOverlay").fadeOut(); // "500" is not required. ""400 is the default })(jQuery) </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 new buttons with buttons and plot them in QGraphicScene with an array in PyQt5<p>I have an application where I have several button widgets o...
<p>The <code>SeveralButtons</code> class should not be responsible of creating new buttons <em>outside</em> itself.</p> <p>You should emit that signal and connect it to the function of its parent, which will then create a <em>new</em> instance of the same class and also connect the signal.</p> <pre class="lang-py prett...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Resharper : subtituate macro with multi-line code<p>Is it possible to make Resharper <strong>Substituate macro call</strong> in separate-lines mode?</p> <h2...
<p>It's not possible at the moment, but you can always select the resulting code after a macro substitution and invoke "Reformat Code" (<code>Ctrl+Alt+Enter</code>) to make it readable.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to plot vectors orthogonal to quadmesh?<p>I am trying to use the <code>rgl</code> package in R to plot unit vectors orthogonal to each cell in a quadmesh...
<p>This is tricky. The fundamental insights are that:</p> <ol> <li>Each square in the mesh can be thought of as a plane</li> <li>Each plane can be defined by a formula z = <strong>a</strong>x + <strong>b</strong>y + <strong>c</strong></li> <li>The coefficients <strong>a</strong>, <strong>b</strong> and <strong>c</stron...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to save a plot created with forestplot package in R?<p>I have created a forest plot using the forestplot package in R as follows:</p> <pre><code>own &lt...
<p>To save the plot directly from your R notebook (I added the plot initialization thanks to user2554330's comment):</p> <pre><code># initialize plot png("forestplot.png", width=480, height=480) # make plot fplot # save plot dev.copy(png, "forestplot.png") dev.off() </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does LINQ's OrderBy jive with MoveNext?<p><a href="https://stackoverflow.com/questions/2792074/what-sorting-algorithm-is-used-by-linq-orderby">This threa...
<blockquote> <p>the way that LINQ works, unless you "cash out" of the query by use ToList() or similar, there are not supposed to be any intermediate lists created</p> </blockquote> <p>This statement is false. The flaw in your thinking is that you believe a false statement.</p> <p>The LINQ to Objects implementation...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Placing grid items without using template areas<p>I have a container with 4 elements which I would like to lay out like this:</p> <pre><code>┌───┬───┐ │ a │...
<p>Add <code>grid-auto-flow: column</code> to your grid container. No need for <code>grid-template-areas</code>.</p> <p>This property controls the directional flow of grid items. The default value is <code>row</code>.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Level of hierarchy on CSS in a legacy application in Ruby<p>One of my clients has one legacy system with a HUGE css (kind of emulating bootstrap). </p> <p>T...
<p>I don't think that "if it doesn't find anything on the legacy css" exists. You could add bootstrap before the legacy CSS so the legacy CSS overrides the styles set by bootstrap.</p> <p>You can also import bootstrap the "advanced" way to only import the components you want instead of the whole framework, if you impo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to select specific Variables retrieved using XMLHttpRequest<p>I am trying to to an integration on my website. I have successfully retrieved data using XM...
<p><code>xhr.responseText</code> is a JSON string. You need to prase it into a JS object and select only needed properties. Like</p> <pre><code>const jsonResponse = JSON.parse(xhr.responseText); const { metadata, amount, created_at } = jsonResponse.data; const { first_name, last_name } = metadata.customer; const result...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: validate inputs than close the div once filled out<p>I am really new to HTML,JavaScript and was just wondering how I would check to see if the input fields i...
<p>Try this:</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 validateForm() { debugger; var fields = ["surname", "name", "dob"] var i, l = fields.length; var ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Joining arrays on internal(nested ) row ids<p>how can I join/sum up array values row by row (i.e. rows representing offset in the array) when joining two tab...
<p>You were very close - see below correction</p> <pre><code>WITH table1 AS ( SELECT 1 AS row_id, STRUCT(&quot;A&quot; AS internal_id, ARRAY[1,2,3] as val1) AS col1 ), table2 AS ( SELECT 1 AS row_id, STRUCT(&quot;A&quot; AS internal_id, ARRAY[40,41,42] as val2) AS col2 ), table1_unnested as( select row_id...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: open children and close other children in multi-level navigation<p>I am working on a navigation and now managed to open up deeper levels of a certain parent ...
<p>You just need the additional rule to remove the active class using <code>closest</code> and <code>not(this)</code></p> <pre><code>$(this).closest('ul').children('li').not(this).children('.wrap').removeClass('active'); </code></pre> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-bab...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it too late to migrate Parse app to Parse server<p>I have the .json files from the Parse app in question. I never got to do the Migrate process as outline...
<p>As Julien stated, you won't be able to retrieve your files, nor any data that isn't in your exports. However, you most certainly can import data into mongoDB using .JSON files. </p> <p>What you'll want to do is follow the parse-server setup guide as if you're setting up a new parse-server instead of migrating. When...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to solve the problem of button flickering caused by css transition?<p>I have seen some solutions but they actually affect the design intended. Is there a...
<p>I would add an ::after pseudo element on your .button:hover, that will be slightly bigger than your actual button's area. As a result while you're hovering, the pseudo element will 'jump' under the cursor, that will prevent flickering - <code>.button</code> will not escape from your mouse :)</p> <p>The below additio...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Handling composer install command in Travis CI environment to speed up the build time<p>I successfully created an example .travis.yml file and the build pass...
<p>There's no one right answer for which section the <code>composer install</code> belongs to IMO. Use what makes sense for you. I would put it in <code>install</code>.</p> <p>Prefixing it with <code>travis_retry</code> is also a good idea if the command is prone to fail due to network issues. for example. It'll retry...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter-Firebase: Not able to create firebase project from terminal<pre><code>i Found 1 Firebase projects. ✔ Select a Firebase project to configure your Flu...
<p>Project names in Firebase and Google Cloud have to be globally unique amongst all users. The error message seems to indicate that a project named <code>first-trial-proj</code> already exists.</p> <p>You might want to try something a but more likely to be unique, like a combination of your name and the date.</p> <p>A...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add key-value to object in JS?<p>I found this expression, but I do not know where is it come from? Where is any documentation for it?</p> <pre class="...
<p>You can just put any key name here i chose eventValue</p> <pre><code>setFormData({..formData, eventValue: event.target.value}) </code></pre> <p>and then you should be able to access it like this</p> <pre><code>function setFormData(formDataObject){ // access it like this formDataObject.eventValue } </code></p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I get the first js object?<p>I have this</p> <pre><code> var markersList = document.getElementById('markersList'); L.MarkerCluster.include({ spi...
<p>If I understand your question correctly, then you can extract the lat and lng values from the resut of <code>getLatLng()</code> via the following regular expression:</p> <p><code>/(-?\d+.\d*)/gi</code> passed to <code>.match()</code> </p> <p>This regular expression will extract the two numbers from the result of <...