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: Passing current input value to parent compnent<p>I'm struggling with the search filter. Im trying to lift up my input state to app component. Navbar compone...
<p>in searchHandler function, you call searchFilter before your state is set. you have two options:</p> <p>1)</p> <pre><code>const searchHandler = (e) =&gt; { searchFilter(e.target.value) } </code></pre> <ol start="2"> <li><p>use useEffect:</p> <pre><code> useEffect(() =&gt; { searchFilter(inputText) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: tkinter uses single function callback with arguments to chose what to do<p>I've written a code that execute a function in loop while a button is hold and sto...
<p>A solution I found has been</p> <pre><code> self.sch_plus_button = tk.Button(self, text=&quot;S+&quot;, command=lambda: self.sch_plus_callback('sch_plus')) self.sch_plus_button.pack() self.sch_plus_button.bind('&lt;Button-1&gt;', lambda event: self.sch_plus_callback('sch_plus', event)) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I create the pattern for the first four lags for the remaining groups?<p><a href="https://i.stack.imgur.com/am9u5.png" rel="nofollow noreferrer"><img...
<p>One option would be to use <code>shift</code> from <code>data.table</code></p> <pre><code>library(data.table) setDT(df1)[, paste0("Lag_Loyal", 1:4) := shift(Loyal, 1:4), by = grp] </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add more than one django-leaflet map in a view?<p>I was able to show a map on a single page using django-leaflet. In another page, I am trying to show...
<p>This is how I was able to display the two (or more) maps dynamically in a div.</p> <pre><code>&lt;script type="text/javascript"&gt; items_json.forEach(item =&gt; { let map = L.map(item.id + "-map").setView([item.fields.latitude, item.fields.longitude], 10); L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Lag and lead a variable in a dataframe by 1 month and 6 business days for panel data<p>I have a large panel data set and I would like to lag and lead a varia...
<p>Here's an approach that would work for &quot;x days later.&quot; In this case I use 2 days later to demonstrate on your data, but 35 days later might be good to get the 5 week later #, with same day of week and so should be another &quot;business day&quot; most of the time.</p> <pre><code># Convert dates to a date f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to know size of an embedded document in KB's in MongoDB<p>I have a collection with an embedded document,and the collection is my transactional collection...
<p>You can calculate the <a href="http://bsonspec.org/" rel="nofollow">BSON</a> size of a document using </p> <pre><code>var myDocument = db.collection.findOne({_id:&lt;some id&gt;}) Object.bsonsize(myDocument); </code></pre> <p>The result is in Bytes. See <a href="https://docs.mongodb.com/manual/reference/mongo-shel...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R does not recognize column names as predictors<p>I`m trying to build a random Forest model for predicting Arsenic concentration using sentinel 2 bands and v...
<p>Looks like <em>randomForest</em> doesn't like numeric column names, fix the column names. Try this example:</p> <pre><code># example data x &lt;- mtcars[1:10, 1:3] x[, &quot;400&quot;] &lt;- x$disp library(randomForest) colnames(x) # [1] &quot;mpg&quot; &quot;cyl&quot; &quot;disp&quot; &quot;400&quot; # as expe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Setting and retrieving values from an array with Checkboxes in PHP<p>I'm trying to place a value and retrieve it later on</p> <pre><code>$fruits = array("Wa...
<p>You can do this easily with <code>foreach()</code>(if you want to).</p> <pre><code>if(isset($_POST['fruit'])) { foreach($_POST['fruit'] as $fruit) { $fruits[] = $fruit; } if(!empty($fruits)) { echo 'It Works.!'; } else { echo "choose a box"; } } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to retrieve the value of switch and pass into Object?<p>I am trying to get the value of a switch and pass it to an object in a view controller.</p> <p>B...
<p>The error is pretty clear:</p> <p>In Interface Builder there is a dead connection to a selector <code>first_TimeConduct</code>. Most likely you renamed the action method.</p> <p>Search for <code>first_TimeConduct</code> with <kbd>⇧⌘F</kbd> and delete the connection.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: django rest framework - request context key error<p>I have two models (Like and News). I am using django-rest-framework to make a web api out of it.</p> <pr...
<p>You are getting this error because <strong>you are not passing <code>request</code> in the context when instantiating the <code>NewsSerializer</code> class or other similar serializers</strong> in the <code>to_representation()</code> method.</p> <p>You are manually instantiating the particular serializer class in <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Navigation - Fixed<p>I'm trying to create a site with a slightly complicated navigation. I've gotten the navigation to look like I want to on initial load, b...
<p>Declaring the following styles will fix the navigation in question to the top of the menu when the class <code>main-nav-scrolled</code> is added.</p> <p><strong>CSS</strong></p> <pre><code>.main-nav-scrolled .top-menu li { display: inline-block; float: none; } .main-nav-scrolled .top-menu { position: ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: position two span elements in opposite direction inside li<p>im listing 5 things using li in my html code. inside each li i have some data like <code>a:b</co...
<p>Flexbox can do that.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true"> <div class="snippet-code"> <pre class="snippet-code-css lang-css prettyprint-override"><code>ul { width: 80%; border:1px solid grey; margin: 1em auto; padding:0; } .subtitle { display: flex; justif...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: tortoisegit: Setting path to git.exe to an invariable destination<p>we are using tortoisegit 2.11.0 and the PATH variable at windows is pointing to the stand...
<p>As of TortoiseGit 2.13 there is no way to disable the Git.exe detection mechanism.</p> <p>It tries to find a git.exe on the path and looks for the installation path of the Git for Windows bundle if not Git.exe is configured yet.</p> <p>The path is stored in registry, maybe you can create a <code>.reg</code> file to ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: beautifulsoup find id given text<p>Here is my <code>html</code>:</p> <pre><code>&lt;div id="div:{c4b05d3c-dc70-409c-b28b-9cdb1157d346}{35}" style="position:...
<p>You can try something like this, use <code>re</code> module to match text with regex:</p> <pre><code>import re soup.find('p', text = re.compile('blah'))['id'] # u'p:{c9c23667-929c-4ee2-be44-edc002db83b8}{145}' </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Embedding Stackblitz Editor on Medium<p>I <a href="https://medium.com/@ole.ersoy/proxying-file-upload-buttons-with-angular-a5a3fc224c38" rel="noreferrer">wro...
<p>Just using this would work:</p> <pre><code>https://stackblitz.com/edit/html5-file-api2 </code></pre> <p>Get rid of the rest.</p> <p>Here's a <a href="https://medium.com/@siddajmera/-a4b5525355ce" rel="noreferrer"><strong>Draft Link</strong></a> to the preview.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: XSLT: Returning a value with a [not(object)] template match cuts template matches<p>I'm creating an XSLT where I want to get values from XML elements. If the...
<pre><code>&lt;xsl:template match=&quot;node()&quot;&gt; &lt;xsl:apply-templates select=&quot;node()&quot;/&gt; &lt;/xsl:template&gt; &lt;xsl:template match=&quot;items&quot;&gt; &lt;xsl:copy&gt; &lt;xsl:choose&gt; &lt;xsl:when test=&quot;itemA&quot;&gt; &lt;xsl:apply-templates select=&quot;itemA...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: redux: getting rid of boilerplate when updating reducers<p>Suppose you are creating a product and saving product's property in a reducer.</p> <p>When produc...
<p>In your action you can define as below:</p> <pre><code>const update_product_field = ({ prop, value, id }) =&gt; { return { type: ACTION_TYPE_UPDATE_PRODUCT, payload: { prop, value, id } }; }; </code></pre> <p>Then in your reducer you can define the case as below:</p> <pre><code>case ACTION_TYPE_UPDATE...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why isn't my Submit button with ng-disabled attribute is enabled when date input field is invalidated using AngularJS?<p>I'm using my client side form valida...
<p>You are not using the form tag, and the input type has to be <code>date</code> not dob</p> <pre><code>&lt;form name="myForm"&gt; &lt;input type="date" id="date" name="dob" ng-model="dob" placeholder="type your valid Date of Birth: YYYY-MM-DD" ng-pattern="^\d{4}-\d{2}-\d{2}$" class="form-control" required&g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Presence of xsd link overriding xslt<p>I am really new working with XML, XSD or XSLT.</p> <p>What I am trying to do is the following:</p> <ul> <li>Output d...
<p>Try (edited according to michael.hor257k's comment)</p> <pre><code>&lt;xsl:stylesheet version="2.0" xmlns:test="http://www.test.xsd" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="test"&gt; </code></pre> <p>And then add <code>test:</code> to all you accesssing your xml structure, e.g. <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I nest a Greensock timeline in multiple Greensock timelines?<p>I'm trying to have a timeline be part of multiple timelines in greensock. I guess the w...
<p>There are many ways to accomplish this, but let me first point out a few things:</p> <ol> <li>An animation (tween or timeline) can only have <strong>one</strong> parent. Think of it like a DOM node in that sense. So you cannot add() tl1 to both tl2 <em>and</em> tl3. When you add() it to one, it'll be removed from t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why i am getting error " 'str' object has no attribute 'str'"? I simply wanted to check "confirmeddtc" in my column which contain a text<p>Why i am getting e...
<p>You should use <a href="https://docs.python.org/3/reference/expressions.html#membership-test-details" rel="nofollow noreferrer">in</a> to check if a string contains something. This should work for you:</p> <pre><code>def Check(df_merge): if (&quot;confirmeddtc&quot; in df_merge[&quot;status&quot;].lower()): ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Set UL as dropdown on mobile and full width on desktop<p><strong>Background</strong></p> <p>We have the following code to have a horizontal <code>&lt;ul&gt;...
<p><code>ul</code> has default margin and padding values. i reset the values and delete the <code>max-width</code>.</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>var wind = ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: For loop running to specific column<p>I am trying to change this code to only go from column 3 to a certain column farther down the workbook. Instead of what...
<p>If you want to loop through the last column, use</p> <pre><code>Worksheets("Chart Data").Cells(1, Worksheets("Chart Data").Columns.Count).end(xlToLeft).Column </code></pre> <p>This assumes that row 1 has data in the last column you are interested in.</p> <p>So your loop would look like</p> <pre><code>For chartda...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jQuery count checkboxes and group count by data-attribute<p>I have a number of html checkboxes that I am trying to count like this...</p> <p><div class="snip...
<p><em>Don't need jquery (stay away from the bloatware).</em> Simply create an object and use section attribute value as it's keys:</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"><c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a good way to use Node and PHP in conjunction<p>Recently I have become quite attached to JavaScript. I have begun learning frameworks such as React ...
<p>It appears that you are conflating Node.JS, which is server-side JavaScript, with frontend development frameworks, such as Vue and React. While it is possible to use React to achieve server-side rendering, you can use React solely on the client-side. As a result, you are asking two questions:</p> <p><strong>Can you...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SaveAs .xlsx and then open the same saved file (Calling Macros from another saved workbook)<p>I have this code written to take save as file name from excel r...
<p>Should be close:</p> <pre class="lang-vb prettyprint-override"><code>Sub Data() Const SAVE_PATH As String = &quot;C:/VB Code/New folder/&quot; Dim WB1 As Workbook, WB2 As Workbook, WB3 As Workbook, WB4 As Workbook Dim Temp As Workbook, fName As String Application.DisplayAlerts = False ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CSS & JS Not Loading in Template in Laravel<p>I am new to Laravel and want to load a template. However, when I load it only HTML-based data shows and CSS/JS ...
<pre><code>&lt;link rel="stylesheet" href="{{ asset('css/backend_css/bootstrap.min') }}" /&gt; &lt;link rel="stylesheet" href="{{ asset('css/backend_css/bootstrap-responsive.min') }}" /&gt; &lt;link rel="stylesheet" href="{{ asset('css/backend_css/fullcalendar') }}" /&gt; &lt;link rel="stylesheet" href="{{ asset('css/b...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Which is efficient and better approach btw filter and for loop<p>I have a list of Class Object in NamAryVar<br> I need check if String is equals to any NamVa...
<p>Java 8 streams will almost always perform worst than regular iteration. The streams were added to Java to bring functional programming constructs into the language which would in-turn provide convenience to the programmers. Ease of use and maintainability are the primary motivators behind streams. </p> <p>Have a lo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bootstrap navbar not placing the items correctly<pre><code>&lt;nav class=&quot;navbar navbar-expand-lg navbar-light bg-light&quot;&gt; &lt;div class=&quo...
<p>To align navbar (place it on right), just add <strong>&quot;.justify-content-end&quot;</strong> to <strong>&quot;.collapse&quot;</strong> block, see Code snipper comment.</p> <p>To check it in Code Snippet example you might need to open it in full screen.</p> <p><div class="snippet" data-lang="js" data-hide="false" ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Understanding the Client's Responsibilities in OAuth 2.0<p>I've been trying to learn the inner workings of OAuth 2.0 in my own RESTful app, and I can't seem ...
<p>Yes, you need to store access tokens as user session data because they should be persistent. For example if user leaves your site and then reopens he expects to see himself logged in.</p> <p>It will be better if you make your sessions server-side: user-agent will store only session ID and all user data will be in yo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Haskell, trying to translate an input word from a given dictionary<p>Hey I'm just getting started with Haskell and I'm trying to write a programm that transl...
<blockquote> <p>I understand that elem is for Lists so I need an alternative</p> </blockquote> <p>You could use <a href="http://book.realworldhaskell.org/read/data-structures.html" rel="nofollow noreferrer"><code>Map.fromList</code></a> to create a balanced-tree dictionary - <a href="https://hackage.haskell.org/pack...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I format positive numbers with a + sign<p>I'm trying to make an interactive D&amp;D character sheet for my group to fit our homebrew ruleset but I've ...
<p>You can change the number format. The same way you can format a date as <code>dd/mm/yyyy</code> you can set formats for numbers. First, select the rows, columns or cells you wish to affect, then use the Format menu to apply a custom number format: <code>+#,##0;-#,##0</code>.</p> <p>The format before the semi colon ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: node js -how to delete particular _id data from array<p>this is my delete function route.js</p> <pre><code>router.delete("/qus/:id/answers/:answersId", func...
<p>You need to use <code>answers._id</code> directly when you are using <code>$pull</code> for the given data structure you have:</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"><co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: schema.xml doesn't update after post command<p>I'm new to Solr, I've been following their tutorial on the documentation and I added documents to be indexed f...
<p>If you are asking for updating the indexed documents with the new schema, then no SOLR doesn't support that. below are few points </p> <ol> <li>First once the schema.xml is changed solr service needs a restart else the new schema.xml won't be applied to new documents which are getting into SOLR. </li> <li>Already ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I use .babelrc to get babel-plugin-import working for antd?<p>I'm new to react, babel, and antd.</p> <p>I installed react and started a project using...
<p>[<strong>Update 2018-02-06</strong>: The answer is still correct, but there is a better alternative now, which is to use <code>react-app-rewired</code>. This is also documented in the link.]</p> <p>You need to follow the instructions in <a href="https://ant.design/docs/react/use-with-create-react-app#Import-on-deman...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: xarray open_mfdataset does not return arrays with Numpy data<p>I am currently trying to open multiple netCDF files. They all have same main dimension (which ...
<p>What you have is a <a href="https://docs.dask.org/en/stable/array.html" rel="nofollow noreferrer"><code>dask.array</code></a>, which is a chunked, scheduled (but not in-memory) set of multiple numpy arrays. In addition to providing a labeled indexing interface to arrays, xarray has the ability to work with multiple ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to do 1 URL re-write rule for multiple ids?<p>I have these URLs:</p> <p><a href="https://www.example.com/amp/articles/10/title" rel="nofollow noreferrer"...
<p><strong>My rule is correct. I figured out I had to place it before other article rules, for priority, for the rule to take effect.</strong></p> <p>From microsoft: The rules are evaluated in the same order in which they are specified.</p> <p>Reference: <a href="https://docs.microsoft.com/en-us/iis/extensions/url-rewr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Result number for Boolean queries with Apache Lucene<p>When benchmarking Apache Lucene v7.5 I noticed a strange behavior: I indexed the English Wikipedia dum...
<p>The explanation is that <a href="https://lucene.apache.org/core/7_2_0/queryparser/org/apache/lucene/queryparser/classic/QueryParserBase.html#setDefaultOperator-org.apache.lucene.queryparser.classic.QueryParser.Operator-" rel="nofollow noreferrer">the default operator is <code>OR</code></a> and not <code>AND</code> a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: wp_insert_post not displaying posts until hit update in the editor<p>I am creating a plugin for a theme am using the theme has multiple fields and i field th...
<p>After a Long Struggle i had to read the theme Structure and how it displays its posts and inserts them and found that they have been submitting the posts id's in a file.</p> <p>So how it works is</p> <p>when you load the post page the theme requests for posts from file it checks if file exists and time last updated ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Connect to mongodb URL fails after creating admin user<p>I have a web application that connects to MongoDB. Everything works fine before I create the admin u...
<p>What library or driver are you using? Regardless, you could try adding ?authenticationDatabase=admin to end of the url.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular2-Highcharts: Click event on custom legend title<p>Below is the highcharts that I have created. I added a custom legend title, which gives me the coun...
<p>You can attach onclick event on chart load event.</p> <pre><code> template: ` &lt;chart [options]="options" (load)="onChartLoad($event.context)"&gt; &lt;/chart&gt; </code></pre> <p>In the component</p> <pre><code>onChartLoad(chart) { this.chart = chart; var t = chart.legend.title.element.children[0]....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Auth0 API can't see URI parameter submitted with Python Requests<p>I'm trying to do an authentication against Auth0 from a Python script using the <a href="h...
<p>Ah, I found my own answer not long after.</p> <p>The key is the <code>%253A</code> in the URI encoding in the outgoing request body. (See <a href="https://stackoverflow.com/a/8348287/1751190">this answer</a>) Python's requests library is already URI-encoding the parameters, so my URI encoded <code>urllib.parse.quot...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Average a multiple number of rows for every column, multiple times<p><a href="https://i.stack.imgur.com/E3nIR.png" rel="nofollow noreferrer"><img src="https:...
<p>Try using <code>summarize(across())</code>, like this:</p> <pre><code>df %&gt;% group_by(Substation) %&gt;% summarize(across(everything(), ~mean(.x, na.rm=T))) </code></pre> <p>Output:</p> <pre><code> Substation `00:00` `00:10` `00:20` &lt;chr&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; 1 A ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Custom Saltstack Python module function accesible in pillar sls file<p>I am having some data loaded inside of my pillar file <code>configuration.sls</code> w...
<p>since pillar is rendered on the master you need to make sure the module is synced to the master.</p> <p>when you sync using <code>salt &lt;minion&gt; saltutil.sync_modules</code> you are syncing to the minion. to sync to the master use <code>salt-run saltutil.sync_modules</code></p> <p>see <a href="https://docs.salt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MYSQLi select how to<p>Im trying to select every lasted insert row with a match_id and show all match_id's on a php page, but not show multiple rows on same ...
<p>You can do a order by with time and group by your match id can achieve the desired output right??</p> <p>For example,</p> <pre><code>SELECT * FROM match_table GROUP BY match_id ORDER BY TIME(timenow) </code></pre> <p>Happy Coding, AK</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want to arrange my R code output(dataframe)containing multiple rows and columns in SQL table<p>I have my code written in R that gives me dataframe as an ou...
<p>There is the function <code>DBI::dbAppendTable</code> to append all rows and all columns of a data frame to a table of the data base. Keep in mind that there must be already a table in the data base having the same columns with the same types.</p> <pre><code>library(DBI) library(odbc) # create an example data frame...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Gemfile ROR version and local machine ROR version mismatch<p>I am a complete beginner to ROR and heroku. Currently I am trying to create an app with a git fr...
<p>Ruby 2.3 is kind of cool - stuff like the <a href="http://mitrev.net/ruby/2015/11/13/the-operator-in-ruby/" rel="nofollow">safe navigation operator</a>, so I recommend installing it, but if you don't want to - </p> <p>In either your Gemfile or <code>.ruby-version</code> file, you'll probably have a line which says ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Setting up Qt for CLion<p>i am struggling to set up Qt5 for CLion. Somehow, I did this for VS before but failed to do this in CLion. Building and Including Q...
<p>Try to add Qt library's installation directory (select specific Qt version and build system <code>\bin</code> sub-subdirectory) to <strong>PATH</strong> environment variable .</p> <p>I have been struggling with similar problem. I have had installed Qt library (version 5.6 and 5.7) in <code>C:\Qt\</code> directory. ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Transforming XML into HTML with couple representations<p>My XML contains description of some resource. I want to build HTML with JSON, XML, etc. representati...
<p>I'm sure we could discuss many alternative ways to rework your xsl but to be honest this is not the correct forum for such things -- You really ought to be using that code review forum on Stack Exchange. </p> <p>That said, I think your xsl structure is generally good - better than most we see on this site!</p> <p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why can't I get Bootstrap to float correctly?<p>I would like to have a password input and button be on the same line. Here's a link to my <a href="http://wri...
<p>Change the row that has your password field and button to:</p> <pre><code>&lt;div class="form-group row" style="width: 100%"&gt; &lt;div class="col-sm-8"&gt; &lt;input type="password" class="form-control pull-left" required id="pwd" name="pwd" placeholder="Password - 6 characters minimum (will be encryp...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: remove first 17 characters from multiple rows in a database<p>i have run this select query in my MySQL database</p> <pre><code>SELECT left(filename, 17) </c...
<p>I would suggest the MySQL function <code>SUBSTRING(str FROM x)</code> According to the reference it works like this:</p> <pre><code>SELECT SUBSTRING('foobarbar' FROM 4); </code></pre> <p>Will return 'barbar'</p> <p>More string functions of MySQL are found here: <a href="http://dev.mysql.com/doc/refman/5.7/en/stri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can't loop the distance between two locations. TypeError: 'numpy.float64' object is not iterable<p>I have a csv file with locations: <a href="https://i.stack...
<p>The full traceback shows us exactly what is causing that error.</p> <pre><code>Traceback (most recent call last): File "/home/rob/test/test.py", line 17, in &lt;module&gt; coords_1 = (all(lat[0][i]), all(lang[0][i])) TypeError: 'numpy.float64' object is not iterable </code></pre> <p>Lose those <code>all</cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Avoid printing of dots<p>I run pytest with option <code>-q</code>.</p> <p>Unfortunately this prints out a lot of dots. Example:</p> <pre><code>...............
<p>The verbosity options can't turn off the test outcome printing. However, <code>pytest</code> can be customized in many ways, including the outcome printing. To change this, you would override the <a href="https://docs.pytest.org/en/latest/reference.html#_pytest.hookspec.pytest_report_teststatus" rel="nofollow norefe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: print the distribution in python using dashes<p>Here's my code right now. So I would like to visualize a normal distribution graph in python only using these...
<p>Your print statement should be something like <code>print(&quot;%d: %s&quot; % (val, '-' * freq) )</code>.</p> <p>The magic is in the <code>'-' * freq</code> expression; what this does is print out <code>freq</code> dashes (e.g. if <code>freq == 3</code>, then you get <code>---</code>.</p> <p>Edit: See BeRT2me's com...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Website Shortcut Icon White Background<p>Hi ive setup a Favorite icon one my site and when I try to make a shortcut on the desktop for the website it creates...
<p>I love this site and use it for all of my websites <a href="https://realfavicongenerator.net/" rel="nofollow">https://realfavicongenerator.net/</a> It creates favicons for every device out there today and gives you the favicons and the code for the html pages</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: No visible @interface for RKDynamicMapping declares the selector setObjectMapping: whenValueOfKeyPath: isEqualTo - Restkit 0.2<p>Hi I'm trying to call setObj...
<p>Finally I found the solution . we can use <strong>addMatcher: matcherWithKeyPath: expectedValue: ObjectMapping</strong> property of the RKDynamicMapping object</p> <pre><code>[dynamicMapping addMatcher:[RKObjectMappingMatcher matcherWithKeyPath:@"type" expectedValue:@"Girl" objectMapping:girlMapping]]; </code></pre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C Multiple Input in One Line<p>I am solving Problem 'Red Light Green Light' with code 'DOLL' on Code chef.</p> <p><a href="https://www.codechef.com/problems/...
<p>You need to ask yourself a couple of questions:</p> <ul> <li>do you need to check for &quot;invalid&quot; input, and reject cases where the input is split over multiple lines.</li> <li>do you need to read all the numbers on a line of input WITHOUT knowing before hand how many there are supposed to be.</li> </ul> <p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: get a factor with levels to plot<p>I have the following <code>data.frame</code>:</p> <pre><code>structure(list(chr = c("1A", "1A", "1A", "1A", "1A", "1A"), ...
<p>I would use tidyverse to move from wide to long. I also included a possible histogram from lattice as an example</p> <pre><code>library(tidyverse) ##I name your original data frame df x &lt;- df %&gt;% gather(factors, value, -chr, -locus) %&gt;% mutate(factors = factor(factors)) ##Example plot ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can we indexing all the fields in document in Elastic Search<p>I am a newbie to elastic search. Now I am trying to create a mapping for an index. Dynamic map...
<p>Explicitly defining mappings for fields helps in the following ways:</p> <ul> <li>Mapping a field between, say, Text and String improves the search efficiency since the a field with "Text" is analyzed but with a String is not. </li> <li>Text fields are indexed whereas String fields are not. This impacts the size of...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In React, what is the best way to define action types?<p>In React, which one of the following ways is the best way to define action types?</p> <p>First way:...
<p>The way I use.</p> <p>Folder structure</p> <p>-- actions -- operations -- types -- reducers</p> <pre><code>// types const IS_MOBILE = 'root/IS_MOBILE'; const SCROLL_POS = 'root/SCROLL_POS'; const OPEN_MENU = 'root/OPEN_MENU'; export { IS_MOBILE, SCROLL_POS, OPEN_MENU, }; // actions export const getResolu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get generated ID after insert in UI5<p>My problem is, that I need to get the generated ID of a created entry. I want to create one entry in my <code>ODataMod...
<p>Meanwhile I solved the problem by myself. I moved the creation of the second entry into the success callback of the first entry. Thus I was able to get the ID out of the "response" parameter and added it as property to my second entry. That is probably not the best solution but it works for me. Maybe somebody el...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to account for two different types of strings when using preg_match?<p>I need help modifying the regex that is being used as the pattern in preg_match to...
<p>Use an optional non-capturing group around <code>\h+(?&lt;lname&gt;[\p{L}\h-]+?)</code> pattern:</p> <pre><code>^(?&lt;fname&gt;[\p{L}-]+)(?:\h+(?&lt;lname&gt;[\p{L}\h-]+?))?\h+\((?&lt;gender&gt;[MF])\)[-\h]+(?&lt;dob&gt;[\d/]+) ^^^ ^^ </code></pre> <p>See the <a href="h...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Typescript: add instance of external dependency to window object<p>I am integrating an external dependency into an Enterprise project. The integration goes ...
<p>The solution I went with in the end was</p> <pre><code>declare global { interface Window { foo: any Foo: any } } </code></pre> <p>And then for the integration</p> <pre><code>window.foo = new window.Foo({ container: `#${iframeContainerId}`, plugin: { id: pluginId }, }) </code></pre> <p>The...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extracting HTTP content in bash doesn't work with nc output<p>Let's say I have this HTTP response:</p> <pre><code>POST / HTTP/1.1 Content-Type: text/plain;c...
<p>output of nc goes to stderr just add <code>&amp;</code> after second <code>|</code> to make the pipe effective:</p> <p><code>echo -e "HTTP/1.1 200 OK\n\n" | ./busybox-armv7l nc -l -p 55764 |&amp; tr '\n' '#' | sed "s/.*##//" | tr '#' '\n</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ng-repeat on array based on length of second array<p>I am trying to iterate over an array using ng-repeat to display in a list. The number of records to disp...
<p>The simplest solution is to use limitTo</p> <pre><code>&lt;ul&gt; &lt;li ng-repeat="item in firstArray | limitTo:secondArray.length"&gt;{{item}}&lt;/li&gt; &lt;/ul&gt; </code></pre> <p><a href="http://plnkr.co/edit/LWh1uqNPxTy09u3MP677?p=preview" rel="noreferrer">http://plnkr.co/edit/LWh1uqNPxTy09u3MP677?p=previ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Thread's ThreadLocals cleaning<p><a href="https://stackoverflow.com/a/16644476/2934191">here</a> I have found the following code how to clean Thread's Thread...
<p>Both snippets clean ThreadLocals, but they have different approach. </p> <p>The longer snippet first get all thread ThreadLocals from ThreadLocalMap and call remove() method on them. You can use it only for the current thread, because remove() method just remove() value from current thread, there is no way how to s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Suit form include on list display in admin<p>Im trying to use Django Suit's form includes to add a button to the list display of all my subscribers in the ad...
<p>What's doing django-suit, here, is that it is including your HTML snippet in the change_form that is displayed for your model, the <strong>change_form</strong> being where you can modify your model and save the changes into the database.</p> <p>Where you want it to appear is the "<strong>change_list</strong>", aka ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get Array of Property, of Property (nested property) using stream Java 8<p>Based in this <a href="https://stackoverflow.com/q/30611870">Question</a>...</p> ...
<p>Your approach is rather inefficient, just chain the methods:</p> <pre><code>collectionEntityDTO.stream() .map(EntityDTO::getId) .map(IdDTO::getCode) .toArray(Long[]::new); </code></pre> <p>This approach is better because:</p> <ul> <li><p>It’s easier to read what’s going on</p></li> <li><p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: import libssh library in Visual Studio 2017<p>I'm currently trying to include the <em>libssh</em> library on Visual Studio 2017. I already downloaded <a href...
<p>What you downloaded is the source code of libssh. So before you can link it to any of your own projects, you need to build libssh first. This were <code>cmake</code> comes in. <code>CMake</code> is the build system used for libssh.</p> <p>In the source tree, which you have downloaded, you will find a file named <co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove firsts n documents in Elasticsearch<p>I want to periodicly remove firsts n stored document. How can I do it? I tried to get e.g. document no. 150000, ...
<p>You can actually achieve it using a single <code>_delete_by_query</code> request with corresponding <code>sort</code> and <code>size</code> parameters. Assuming that <code>timestamp</code> is the the name of your date field, <code>sample_index</code> is your index and <code>sample_type</code> - type name, the query ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Recursive JavaScript function for nested content prematurely generates closing tag<p>I'm trying to process a JavaScript array containing various levels of ob...
<p>Your function looks fine. The problem is that you are passing the array <code>newContent</code> to <code>html()</code> rather than a string of html. </p> <p>Try joining the array first with:</p> <pre><code> $('#output').html(newContent.join('\n')); </code></pre> <p>Here's a forked fiddle with the <code>div</code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot concatenate DB::table Laravel 5.7<p>I have an error in try concatenate in a query in my controller:</p> <pre><code> $asignaciones = DB::table('asi...
<p>Try using <code>DB::raw()</code> like this:</p> <pre><code>$asignaciones = DB::table('asignaciones') -&gt;join('dueños','asignaciones.dueno_id','=','dueños.id') -&gt;join('choferes','asignaciones.chofer_id','=','choferes.id') -&gt;select('asignaciones.*', 'dueños.nombre as dueño_nombre', 'dueños.ape...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Different Java Regex matching behavior when using UNICODE_CHARACTER_CLASS flag<p>I was testing the behavior of the <code>Pattern.UNICODE_CHARACTER_CLASS</cod...
<p>When you use <code>Pattern p = Pattern.compile(&quot;\\p{Punct}&quot;);</code>, then <code>\p{Punct}</code> refers to the following 32 characters:</p> <pre><code>!&quot;#$%&amp;'()*+,-./:;&lt;=&gt;?@[\]^_`{|}~ </code></pre> <p>Reference: <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a position property for a textbox header?<p>I'm using the following XAML to display a labelled textbox of a page...</p> <pre><code> &lt;Text...
<p>What about <code>DockPanel</code>? Wrap the <code>TextBox</code>es with <code>DockPanel</code>, then you can specify the location of the header to the left by setting the property <code>DockPanel.Dock="left"</code></p> <pre><code>&lt;DockPanel&gt; &lt;TextBox x:Name="header" Text="headershouldbeontheleft" DockP...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Implement Boudary Filling algorithm Using Matlab<p>OK, it's a Computer Graphics problem.I'm learning Computer Graphics and not good at Matlab either.When I'm...
<p>Be careful with the dimensions and orientations of matrices you are comparing.</p> <p>This should help:</p> <pre><code>function img = Boundaryfill(img, x, y, boundaryvalue, new) temp = squeeze(img(x,y,:))'; if temp ~= boundaryvalue &amp; (temp ~= new) img(x,y,:) = new; img=Boundaryfill(i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to annotate dependencies in an inline controller while configuring app routes?<p>I'm getting following error if I don't annotate the dependencies for an ...
<p>Try</p> <pre><code>app.config(['$stateProvider', '$urlRouterProvider', function($stateProvider, $urlRouterProvider) { $stateProvider.state('logout', { url: '/logout', controller: ['AuthService', '$state', function(AuthService, $state) { AuthService.logout(); $state.go('login'); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Paypal pay for invoice with REST API<p>Here is the situation. Someone has PayPal account and sends invoice to me. I have to PAY for the invoice. If I log int...
<p>Unfortunately, no, this is not something that is available right now.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The value could not be added to the collection, as the collection already contains an item of the same type ...<p>I need to customise each method in a WCF se...
<p>I found the root cause. In QA the service has two endpoints - http and https, but both are bound to the same Contract. </p> <p>Hence the code </p> <pre><code>host.Description.Endpoints .SelectMany(e =&gt; e.Contract.Operations) .ForEach(o =&gt; o.Behaviors.Add(operationBehavior)); </code></pre> <p>travers...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: when a ttcn function "runs on SomeComponent", how can it access the instance of this SomeCOmponent type?<p>I read that when ttcn function is annotated with "...
<p>Inside the function, you can use all variables defined in <em>SomeComponent</em> as if they are local variables defined in the function. </p> <p>The only difference between these variables and local variables is that their lifetime and scope is larger than local's. Their values are accessible in all functions that ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Device torch turns off when starting AVCaptureSession<p>I'm using AVCaptureSession to capture video.</p> <p>I want to light on the torch during the whole se...
<p>Ok, I figured out.</p> <p>The torch simply must be lighted on after the session start.</p> <p>So instead of:</p> <pre><code>try camera.setLight(on: true) self.captureSession.commitConfiguration() DispatchQueue(label: "capturesession").async { self.captureSession.startRunning() } </code></pre> <p>just do </p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: why onTap of inkwell is not working ? I tried at every place but its is not working<p>I am new to flutter. why onTap of inkwell is not working? I tried at ev...
<blockquote> <p>The InkWell widget must have a Material widget as an ancestor. The Material widget is where the ink reactions are actually painted</p> </blockquote> <p>So you Should wrap the inkwell in Material widget</p> <p>in your case try this</p> <pre><code> Padding( padding: const EdgeIns...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: iOS option is disabled in Version or platform (iTunes Connect)<p>I uploaded my app to the App Store using xcode. I can see my build in my existing app on iTu...
<p>I found the solution. In my case I wanted to update the app to a newer version which wasn't listed in the "+Version or Platform" menu. The possible reason is that a previous build failed, with the status of "Prepare for Submission". </p> <ol> <li>Select the build which is listed as "Prepare for submission" under "i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How link two chosen fields removing options from each other<p>I have two fields that have the same options. I want to make sure that when the user selects on...
<p>Try this example..</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>$select = $('.select'); $select.on('change', function() { var val = $(this).val(); $notThis = $select.not($(this)); $n...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: WordPress with local MySQL server: Cannot select created database as root<p>Even though I am root and I can log into my local mysql server as root, the WordP...
<p>I managed to figure out the solution. I follow these instructions (without sudo) in order to completely purge my mysql installation: <a href="https://gist.github.com/vitorbritto/0555879fe4414d18569d" rel="nofollow noreferrer">https://gist.github.com/vitorbritto/0555879fe4414d18569d</a>. By reinstalling my mysql, eve...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ssl file permission on postgresql 14 is not right<p>After enabling ssl on postgresql 14, there is error when starting the Postgres server:</p> <pre><code>202...
<p>First, change the ownership of all files to the PostgreSQL user:</p> <pre class="lang-sh prettyprint-override"><code>chown postgres server.crt server.key server.csr </code></pre> <p>Then remove the read permissions for the group from the private key file:</p> <pre class="lang-sh prettyprint-override"><code>chmod g-r...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python equivalent of "cd -"<p>I am writing a script that should change directory based on the input and then go back to the directory where the script was ex...
<p>What you're doing already <em>is</em> the equivalent of <code>cd -</code>.</p> <p>The <code>cd</code> shell builtin updates the <code>OLDPWD</code> shell variable (notably "shell variable", not "environment variable", so the value isn't inherited by subprocesses), and that value is used for <code>cd -</code>. Howev...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to recreate google keep note<p>I tried to create my own notes for the school project. And I ran into some problems, I am using contentEditable for the no...
<p>With a little research, I found out...</p> <p>Use of <code>contenteditable</code> across <strong>different browsers</strong> has been painful for a long time because of the differences in <strong>generated markup between browsers</strong>. For example, even something as simple as what happens when you press Enter/Re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Coordinates of dimension-wise maximum of Matlab array<p>I have 5-dimensional array of numbers. The goal is to find maximum values along 5-th dimension and th...
<p>Suppose your matrix <code>A</code> has dimension of <code>(m,n,o)</code>. Now you have the indices of maximum entries along the <code>3rd</code> dimension in <code>y</code> and the corresponding maximum values in <code>x</code>. You can access the maximum values by the following code-</p> <pre><code>z = (1:m*n)' + ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Scenebuilder/JavaFX polygons mouse event onClick<p>Link to scenebuilder and some Java code: <a href="https://imgur.com/a/FOr1Mag" rel="nofollow noreferrer">h...
<pre><code>import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.input.MouseEvent; import javafx.scene.layout.StackPane; import javafx.scene.shape.Polygon; import javafx.stage.Stage; public class ClickablePolygonApp extends Application { public static void main(String[] args) { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MongoDB Retrieve single value from array<p>Assuming that if i have such document</p> <p><strong>{ "id":"1", "references":["AD1","AD2","AD3"] }</strong></p> ...
<p>You can do this via <a href="http://docs.mongodb.com/manual/reference/operator/aggregation/project/#pipe._S_project" rel="nofollow noreferrer"><code>$project</code></a> and <a href="http://docs.mongodb.com/manual/reference/operator/aggregation/filter/#exp._S_filter" rel="nofollow noreferrer"><code>$filter</code></a>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Delete all numbers from Columns in Big Query<p>Fairly new to SQL and I'm trying to clean up a table I have. I have the following genres Column:</p> <p><a hre...
<p>What you are searching for is <a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#regexp_replace" rel="nofollow noreferrer">REGEXP_REPLACE</a></p> <p>This uses regular expalre4ssion to detect the nubers and remove them.</p> <pre><code>UPDATE `movies-dataset.movies_data.Movies_meta...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# Populated Array Property appearing as 'null' in Console app caller<p>I am not a C# developer and just trying to piggy-back off C#'s ADO SQL functionality ...
<p>You fill a <strong>local</strong> variable <code>TickerArray</code> in <code>RunReader.Read</code>. </p> <p>Change <code>string[] TickerArray = new string[Dataset.Rows.Count];</code><br> to just <code>TickerArray = new string[Dataset.Rows.Count];</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What should the "share" subdirectory contain?<p>When one has installed a library and look at what its repository contain, he may find something like that:</p...
<p>The "share" word is used because what is under /usr/share is platform independent, and can be shared among several machines across a network filesystem. Therefore this is the place for manuals, documentations, examples etc.</p> <p><a href="http://www.tldp.org/HOWTO/HighQuality-Apps-HOWTO/fhs.html" rel="nofollow">RT...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create an endless grid while panning<p>I'm writing an application that has a "Drawing area" where the user is to place components. The drawing area contains...
<p>The best way to pan is to use Graphics2D.scale that way you can (a) avoid complicated logic in your paintComponent and (b) make panning a reusable feature, as shown here </p> <p><a href="https://sourceforge.net/p/tus/code/HEAD/tree/tjacobs/ui/drag/Zoomable.java#l58" rel="nofollow noreferrer">https://sourceforge.net...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Access to polygon matrix from json files<p>I load polygons from json file using loadGeoJson. In json file I have properties name and id. All Polygons loads c...
<p>I use :</p> <pre><code>var woj =[]; map.data.addListener('addfeature', function(event) { var adm=event.feature.getProperty('id'); woj.push(adm); }); </code></pre> <p>That solves my problem.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change speed of a keyframe without it jumping<p>I am trying to change the speed of the keyframe by changing animationDuration. but everytime i change ...
<p>It is not possible to do that mid animation with pure css animations. In order to do that you would need to use a js animation library like GSAP. See <a href="https://stackoverflow.com/questions/20340112/how-can-i-change-the-speed-of-a-css-animation">this answer</a> for an example.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert Apache rewrite to Nginx<p>I have this htaccess code:</p> <pre><code>RewriteEngine On ​ RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FIL...
<p>The equivalent rewrite would be:</p> <pre><code>if (!-e $request_filename){ rewrite ^/?(.*)$ /index.php?url=$1 last; } </code></pre> <p>As <code>nginx</code> URIs include the leading <code>/</code> which your script probably does not want. Also, the <code>.php</code> file is likely processed in a different loc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fast way to set diagonals of an (M x N x N) matrix? Einsum / n-dimensional fill_diagonal?<p>I'm trying to write fast, optimized code based on matrices, and h...
<p>One approach would be to reshape to <code>2D</code>, set the columns at steps of <code>ncols+1</code> with the diagonal values. Reshaping creates a view and as such allows us to directly access those diagonal positions. Thus, the implementation would be -</p> <pre><code>s0,s1,s2 = M.shape M.reshape(s0,-1)[:,::s2+1]...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bash Scripts (even trivial ones) stuck when invoked on the terminal<p>I have a server on which we execute multiple bash scripts to automate tasks (like copyi...
<p>Issue solved, posting this as an answer so people can find it quicker.</p> <p>Turns out, as multiple users suggested in the comments (thanks to all!!) the problem was caused by a security monitor, which analyzed each of the scripts that were executed. The team changed some settings on that end to prevent it from hap...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Not able to click element via webdriver selenium<p>I tried to run the following, but I keep getting element not visible message</p> <pre><code>driver = webd...
<p>There are two <code>input</code> elements with the same <code>id</code> attribute <code>"user_password"</code> on page: the first one is hidden. You can use index to choose visible one:</p> <pre><code>driver.find_elements_by_id("user_password")[1].click() </code></pre> <p>or you can use more specific selector:</p>...