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: Can`t Pass a Model Class to my BaseAdapter<p><strong>Error Shown:</strong> </p> <blockquote> <p>Attempt to invoke virtual method 'void android.widget.Gr...
<p>Error message clearly says that GridView is null. There is no <code>GridView</code> in your layout, there is only <code>Grid</code>. Change <code>Grid</code> to <code>GridView</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: getContentView() from android BottomSheetDialog<p>Is there any way to get <code>ContentView</code> from android <code>BottomSheetDialog</code> ? In <code>Pop...
<p>Please try this: </p> <pre><code>View contentView = bottomSheetDialog.findViewById(android.R.id.content); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python Poetry's default test not working for me<p>I want to try out poetry, but the initial setup/test isn't working for me, so I'm a little confused. I beli...
<p>The <code>pytest</code> version that <code>poetry</code> includes at the moment when using <code>poetry new</code> is outdated and doesn't work with python3.10. You have to update <code>pytest</code> with <code>poetry add --dev pytest@latest</code>.</p> <p>From poetry 1.2 on, poetry will no longer define any default...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Google Map APIs<p>I am currently working on a personal project to develop a REST API which would perform tasks similar to what UBER, OLA like taxi aggr...
<p>You may use the following references:</p> <ul> <li>Choose from the <a href="https://developers.google.com/maps/documentation/" rel="nofollow">Google Maps APIs</a> documentations depending on your needs. There are actually tutorials given within the documentations.</li> <li>Answers to <a href="https://developers.goo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to sort array of objects by date but with most current date first?<p>I've got the array of objects:</p> <pre><code>const data = [{ &quot;id&quot;: &quo...
<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 getItemsInAscendingDateOrderAndClosestToNowFirst(arr) { const time = Date.now(); const [closest, ...rest] = Array ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: sed delete code block from file<p>I want to remove the <code>server {...}</code> code block from the default nginx configuration server configuration file.</...
<p><code>sed</code> doesn't allow regex to span multiple lines, so you would need to use multiple commands to achieve what you want, e.g. something like:</p> <pre><code>'/(\s*#?)server\s*\{/,/\1\}/d' </code></pre> <p>But unfortunately sed doesn't allow back references from previous regexes, so the above doesn't work....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How map a collection and single value to function<p>I have a function invoke_query that takes two arguments (connection (object) and sql_query (string)). I ...
<p>As noted in the comments, the simple way is best:</p> <pre><code>for sql in queries: invoke_query(connection, sql) </code></pre> <p>If you want to work the result, the built-in 'map' does kind of what you want, but first you'll need to make the function take only one argument.</p> <pre><code>from functools im...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to access the member variables and methods in VideoJs function in angular 2?<p>I am using videojs plugin in my angular project. I am trying to access the...
<p>You have to use ES6 <a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/Arrow_functions" rel="nofollow noreferrer">arrow functions</a> for callbacks to get the correct <code>this</code> context inside your callback. When you use the <code>function() {}</code> syntax the <code>this</code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Query or formula that takes data from different ranges<p>I am looking for a single query (or formula) that can take data from different ranges and pull it to...
<p>use:</p> <pre><code>=INDEX({QUERY(A3:C,&quot;select B,A where C is null&quot;), IFNA( VLOOKUP(QUERY(A3:C,&quot;select A where C is null&quot;), E3:G23, {2, 3}, ))}) </code></pre> <p><a href="https://i.stack.imgur.com/W1vwR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W1vwR.png" alt="enter ima...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is Apache Storm still relevant now that Apache Kafka has processing capabilities?<p>I'm very naive about data engineering but it seems to me that a popular p...
<p>You still need to <em>deploy</em> the Kafka code somewhere, e.g. YARN.<br> Plus, Kafka Streams can only process between the same Kafka cluster; Storm has other spouts and bolts. </p> <p>Kafka has no external dependency of a cluster scheduler, and while you may deploy Kafka clients in almost any popular programming ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: vba: delete filtered rows but not first one (or store it and paste after deletion)<p>Working on Microsoft Visual Basic Application Edition 7.1 in Excel 2013 ...
<p>Define your range for deleting as <code>Range(Cells(2,2),Cells(ActiveSheet.UsedRange.Rows.Count,2))</code> (To replace the <code>Selection</code> call). This will delete everything except for the first cell in the column</p> <p>Edit to avoid excel prompt: <code>Range(Cells(2,2),Cells(ActiveSheet.UsedRange.Rows.Co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript in large code base, set color to immutable?<p>I am working in a large java script code base affected by multiple different companies. Within the t...
<p>As always you can use <strong>"!important"</strong> on all your property values.</p> <p>If you're unfamiliar "!important" will prevent the typical cascade effect from occurring and preserve the important value: </p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do i make the vue model reflect a change<p>I have a very simple task i am trying to solve. I want to make the vue model update or display in a new proper...
<p><strong>Observations :</strong></p> <ul> <li>Strings are immutable. Hence, The string manipulation methods such as split returns a new array and will not update the original string. Ex <strong>:</strong></li> </ul> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it okay to have pointers to old state objects in React Redux?<p>I have a react app using redux with a state object that looks like this:</p> <pre><code>{...
<p>You can update only what changed, and it's containing structures.</p> <p>Since state already includes <code>phones</code>, and it haven't, you only need to merge in the changed personal:</p> <pre><code>return Object.assign({}, state, { personal: { firstName: 'Rock', lastName: 'Strongo' } }); </code></pre> <p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ManyToManyField relationship retrieving no data<p>I've one structure like this: 1. Author 2. Book 3. AuthorType 4. AuthorBookType</p> <p>A book can hav...
<p>There is no difference in the syntax between Django versions here; any of the docs you found would still work.</p> <p>You need to iterate through the many-to-many relationship:</p> <pre><code>{% for author in authors %} {{ author.name }}&lt;br&gt; {% for book in author.books.all %}{{ book.title }}{% endfor...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: gulp quitting after dependent task<p>What am I missing? Gulp is quitting <strong>without error</strong> after my dependent task. <code>styles</code> does n...
<p>Think about what you said. If <code>clean()</code> is stopping the process then that is [most likely] where your problem is.</p> <p>In this case, your problem is because of the <code>done</code> callback. As of v2.0, the <code>del</code> package no longer accepts a callback... so it's never being called. Instead...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: xPath is working for the last page but not the first - Selenium Java<p>I want to extract some data from <a href="https://www.ncbi.nlm.nih.gov/pubmed/?term=(%...
<p>I suspect this is an <em>off-by-one error</em> as XPath's indexing starts with 1 and having <code>div[0]</code> there would not match anything.</p> <p>In general, though, <em>your expression is very fragile</em> as it is an absolute expression with the path starting with the very root of the HTML tree down to the d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to store multiple value in one available value in SSRS reporting<p>Currently i wanted to search multiple value in one available value which configured in...
<p>The easiest way would be to add a table to your database containing the relationship between the parameter value and the values you actually want to search for.</p> <p>For example you could create a dataset with the following in your dataset query.</p> <pre><code>CREATE TABLE myLookupTable(AreaName varchar(50), Loca...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add plot when croos<p>I want to add a circles when 2 lines cross.</p> <pre><code>study(title=&quot;Williams %R&quot;, shorttitle=&quot;The Willy&quot;) // W...
<p>Your code is a mixture of <code>v3</code>, <code>v4</code> and <code>v5</code>. You should fix that first.</p> <p>After that, you are looking for <code>ta.cross()</code> to see if there is a cross and <code>plotshape()</code> function to display the circles.</p> <pre><code>// This source code is subject to the terms...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Simple site search django<p>I'm trying to create a simple search for products in the online store. I watched tutorials and read questions here. I tried to d...
<pre><code>def ProductList(request, category_slug=None): category = None categories = Category.objects.all() products = Product.objects.filter(available=True) query = request.GET.get('query') //as your input field name is query and not q if query: products = Product.objects.filter(title__ico...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hibernate Optional Inheritance<p>I have a question regarding Hibernate annotated and inheritance. </p> <p>In the database, I have a <code>parent</code> tabl...
<p>When you directly lookup the parent entity from a JPA inheritance structure then the "most bottom" sub-entities are determined by the JPA implementation because those ones need to be persisted in the persistent area. Therefore the "optional inheritance" you mention is not possible in JPA. Please see the answer of <a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get PowerPoint current slide index in Office Add-In API?<p>I'm developing an <a href="https://github.com/OfficeDev/office-js-docs" rel="nofollow">Offi...
<p>We can get the current index of active slide via using the <strong>document.getSelectedDataAsync</strong> method. Here is an example for your reference:</p> <pre><code>Office.context.document.getSelectedDataAsync(Office.CoercionType.SlideRange, function (asyncResult) { if (asyncResult.status == "failed"...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Failed to load the TensorFlow runtime; `Library not loaded: @rpath/libcudnn.5.dylib`<p>I've installed Tensorflow into a fresh virtual environment on OSX 10.1...
<p>Symbolic links from <code>libcudnn.5.dylib</code> to the available <code>libcudnn.6.dylib</code> solved it. I put links in both <code>/Developer/NVIDIA/CUDA-8.0/lib</code> and <code>/usr/local/cuda/lib</code>:</p> <pre><code> 16 May 24 14:12 libcudnn.5.dylib -&gt; libcudnn.6.dylib </code></pre> <p>Successful impo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Script will not write the headers to a csv<p>I am trying to write some simple crawlers to get some data for me from various online stores. Now, I have writte...
<p>You need to close the file to flush the write buffer to disk. Add</p> <pre><code>f.close() </code></pre> <p>To the end of the script.</p> <p>Or better still, use a context to open the file so it closes automatically.</p> <pre><code>with open(filename, 'w') as f: f.write(headers) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: .htaccess redirect based on query string, preserve string<p>I'm trying to redirect one URL to another if a specific value (do=login) only if a value in the q...
<p>This is not working because your current <code>RewriteRule</code> only matches root page <code>/</code>. You need to match <code>myscript/script1.php</code></p> <pre><code>RewriteEngine On RewriteCond %{HTTP_HOST} domain1\.com$ [NC] RewriteCond %{QUERY_STRING} do=login [NC] RewriteRule ^myscript/script1\.php$ https...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: enable to use reactstrap library in client side spfx<p>I am creating a client-side web part in SharePoint using react and I am getting an error for using rea...
<p>add "externals": { "reactstrap": "<a href="https://cdnjs.cloudflare.com/ajax/libs/reactstrap/6.0.1/reactstrap.full.min.js" rel="nofollow noreferrer">https://cdnjs.cloudflare.com/ajax/libs/reactstrap/6.0.1/reactstrap.full.min.js</a>" },</p> <p>to config.json it will resolve reactstrap dependancy in spfx</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The custom view added in the WKWebview is not listed during UITesting<p>I have a UITableview with the below view hierarchy.</p> <pre><code>UIViewController ...
<p>The issue is fixed by adding the custom view to the accessibility elements list.</p> <pre><code>[self.view setAccessibilityElements:@[customView]]; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Changing Button Label and Title dynamically for Buttons created from Array (in swift)<p><strong>My environment:</strong> The code below is written in swift P...
<p>There are a couple of issues going on here. The first is that in SwiftUI, generally you want your model to be a <code>struct</code>, since SwiftUI Views respond well to changes in value types (like a <code>struct</code>) out-of-the-box.</p> <pre><code>public struct Student { public var first: String public v...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change wordpress search results from post to product<p>I'm building a custom search page for my new site to include custom sections for both blog posts and p...
<p>You have to follow below process to search by <code>products</code></p> <p><strong>Step - 1</strong></p> <p>Search form for Custom Post Type: <code>Products</code></p> <p>---> Add Below code where you are representing your search form</p> <pre><code> &lt;div&gt; &lt;h3&gt;Search Products&lt;/h3&gt; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can't take value from series in python<p>I'm trying to get value from the pandas series. Like in the arrays I'm trying to get 3. value with tempArray[3] but ...
<p>It seems you're looking for:</p> <pre><code>testY.iloc[18] </code></pre> <p>This retrieves the 19th entry in the series <code>testY</code>, as opposed to the value where the index is <code>18</code>.</p> <p>Documentation on <code>iloc</code>: <a href="https://pandas.pydata.org/docs/reference/api/pandas.Series.iloc.h...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SOAP message can not parse to java object<p>I have following SOAP message and generated jaxb class.</p> <p>SOAP Message:</p> <pre><code>&lt;soapenv:Envelop...
<p>The error message tells you that it encountered a result element with a namespace while it expected a result element without a namespace ( the "{}" in &lt;{}result> means no namespace).</p> <p>You have to specify the namespace to JAXB via the namespace attribute :</p> <pre><code>@XmlAccessorType(XmlAccessType.FIEL...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the right way to do such import<p>So this is my current folder structure</p> <pre><code>└── Main folder/ ├── subfolder/ │ ├── subfolder_fun...
<p>You need to use a relative import in <code>subfolder_function.py</code> to specify you want the import to be from the same directory. See the <a href="https://docs.python.org/3/reference/import.html" rel="nofollow noreferrer">docs</a> for more information on relative imports</p> <h3>subfolder_function.py</h3> <pre><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Easy way to get a readable date from a long (timestamp) in scala<p>My question is simple</p> <p>If I do:</p> <pre><code>var start = System.currentTimeMilli...
<p>You can use the <code>java.time</code> library like:</p> <pre><code> val formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm:ss") formatter.format(LocalDateTime.now) </code></pre> <p>If you only have the timestamp, this solution gets a bit more complex:</p> <pre><code>formatter.format(LocalDateTime.ofIns...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to trigger an URL to invoke a proxy services in wso2esb<p>I want to invoke the proxy services using an url. That is If I gave the url a user can use that...
<p>Not sure if I got it right. But if you created a http proxy like this, you can go to the management console, click on the proxy name and there you'll see the URL of the proxy.</p> <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;proxy xmlns="http://ws.apache.org/ns/synapse" name="HTTPProxy" ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NoMeasureSelected CampaignPerformanceReportRequest Microsoft Ads<p>I'm trying to setup Microsoft ads to a project and get <strong>CampaignPerformanceReportRe...
<p>Looks like your structure around <code>Columns</code> isn't quite right.</p> <p>I think what the error <code>The specified report request does not specify measurement columns (at least one is required). Please submit a report request with the required columns for this report type, and optionally additional columns t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get return value for multi-processing functions in python<p>I have two functions to run in parallel and each of them returns a value. I need to wait for both...
<p>Using <code>concurrent.futures</code>:</p> <pre><code>from concurrent.futures import ProcessPoolExecutor as Executor #from concurrent.futures import ThreadPoolExecutor as Executor # to use threads with Executor() as executor: future1 = executor.submit(fun1, arg1, arg2, ...) future2 = executor.submit(fun2, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Issue centering a QR square<p>I am writing an Android test app to see how to handle QR codes. This is the code for the main activity (MainActivity.kt) and a ...
<p>The <em>ConstraintSet</em> doesn't know about the QR code view, so any attempts to constrain it will fail since it is unknown to the <em>ConstraintSet</em>. The <em>ConstraintSet</em> is populated with a call to <em>ConstraintSet#clone(ConstraintLayout)</em></p> <p>Change the code to the following:</p> <pre><code>co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Environment variable in jenkins not printing<p>I am creating an environment variable in my freestyle Jenkins project like this</p> <pre><code>$files1 =Get-Ch...
<p>Do it like this. Add a <code>&lt;br&gt;</code> tag instead of a new line like you are doing.</p> <pre><code>$files1 =Get-ChildItem $ENV:WORKSPACE/altab write-output $ENV:WORKSPACE $linklist = [System.Collections.ArrayList]@() $prefix=&quot;http://x.x.x.x:8080/job/ws/altab/&quot; foreach ($file in $files1) { $url1 ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to get a section to flex in a column<p>I'm working on media queries, I'm trying to go from a tablet view to a desktop view. I can only get one or the oth...
<p>I think the media queries are overlapping, to prevent them from overlapping try this way</p> <pre><code>@media (min-width: 768px) and (max-width: 987px) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Div height issues , Div height does not cover whole body<p>I have slider panel ,what i am doing , when my slider open then it's cover all height, but not abl...
<p>Instead of <code>overflow:hidden;</code> use <code>overflow-x:hidden;</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: file in python formatting<p>So here is a file</p> <pre><code>APPLE: toronto, 2018, garden, tasty, 5 apple is a tasty fruit &gt;&gt;&gt;end Orange: japan, 3...
<p>For this simple example, the following gives the results you want. (Although you probably misspelled grapes).</p> <pre><code>from pprint import pprint import re def main(): fin = open('f1.txt', 'r') data = {} key = '' parsed = [] for line in fin: line = line.rstrip() if line.st...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change value based on Closure Counter in JavaScript<p><a href="https://i.stack.imgur.com/maPSq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur...
<pre><code> function NegboxENtryValue() { let inputval = document.getElementsByClassName(&quot;boxENtryValue&quot;)[0].value let prodPrice = document.getElementById(&quot;productPrice&quot;).innerHTML.split(/[\s&amp;]+/) // here use product price not product total price prodPrice[1] = prodPr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PM2 doesn't watch file change at Vagrant machine<p>I set up a server with the following directory structure:</p> <pre><code>project |-- bootstrap | `-- pr...
<p>It needs to set the <code>watch_options</code> as</p> <pre><code>"watch_options": { "usePolling": true } </code></pre> <p>source: <a href="https://github.com/Unitech/pm2/issues/931" rel="nofollow">https://github.com/Unitech/pm2/issues/931</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Outputting user defined structure with boost::log<p>I'm trying to output content of <em>boost::asio::streambuf</em> object with <em>boost::log</em> library. ...
<p>Your <code>operator&lt;&lt;</code> is not found by ADL. See the first part of <a href="https://stackoverflow.com/questions/32524347/boost-log-stdexception-formatter-unable-to-find-operator-overload-in-own-nam/32538936#32538936">this</a> answer.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calculate percentage Pandas groupby<p>I have a Dataframe with 4 columns: 'ID' (clients), 'item', 'tier' (high/low), 'units' (number). Now for each item and e...
<p>I think you want this:</p> <pre><code>dfs = df.groupby(['item','tier']).agg( ID_amount=('ID', 'size'), total_units=('units', 'sum')) dfs['percent_units'] = dfs.groupby('item')['total_units']\ .transform(lambda x: x/x.sum()*100) dfs </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AWS: Boto3: AssumeRole example which includes role usage<p>I'm trying to use the AssumeRole in such a way that i'm traversing multiple accounts and retrievin...
<p>To get a session with an assumed role: </p> <pre class="lang-py3 prettyprint-override"><code>import botocore import boto3 import datetime from dateutil.tz import tzlocal assume_role_cache: dict = {} def assumed_role_session(role_arn: str, base_session: botocore.session.Session = None): base_session = base_sess...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# Editing a single value in DataRow succeeds but runs infinitely<p><strong>Scenario</strong>: This is in a WinForm project to view images with some extra re...
<p>You can try something like the following:</p> <pre><code>private bool BusySelectedIndexChanged; // used later to avoid re-entrancy private void listBox_SelectedIndexChanged(object sender, EventArgs e) { // REENTRANCY if (BusySelectedIndexChanged) // already running return; BusySelectedIndexChange...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: App crash if use NSMutableArray instead of NSArray<pre><code>plot2.graphPoints = graphPointsMutableArray; // plot2.graphPoints = @[LMGraphPointMake(CGPoin...
<p>Your two lines are not equivalent.</p> <p>This:</p> <pre><code> plot2.graphPoints = @[LMGraphPointMake(CGPointMake(1, 25), @"1", @"34.5")]; </code></pre> <p>Assigns an <code>NSArray</code> containing a single <code>LMGraphPoint</code> to <code>plot2.graphPoints</code></p> <p>while this:</p> <pre><code>[graphPoi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Entity Framework code-first generating tables/keys in an unexpected manner<p>I have many classes representing tables, but three are giving me headaches: Pers...
<p>Sometime default mapping is not what we want, so we have to explicitly say to EF what we need. Just add this method to your DbContext and it works as required:</p> <pre><code>protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Entity&lt;Person&gt;().HasMany(p =&gt; p.TasksAssigne...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to interpret this wierd if(dwRet &lt; bufsize) statement?<p>I'm trying to compile <a href="https://docs.microsoft.com/ru-ru/windows/desktop/api/fileapi/n...
<p>Interpret it as someone not knowing how to escape or unescape HTML properly. <code>&amp;lt;</code> is HTMLese for the character <code>&lt;</code>, and would not be valid C++ otherwise.</p> <p>So the snippet should say <code>if (dwRet &lt; BUFSIZE)</code>. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Vue prop is sent from a component is undefined<p>I have a Kanban board inside my dashboard which displays issues of a project. I added a menu to allow the us...
<p>Probably it's because in KanBanBoard.vue you defined your prop as project_id and in Dashboard.vue you're passing it like this:</p> <pre><code>&lt;KanBanBoard :projectid=&quot;project_id&quot;&gt;&lt;/KanBanBoard&gt; </code></pre> <p>instead do:</p> <pre><code>&lt;KanBanBoard :project_id=&quot;project_id&quot;&gt;&lt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PHP Mongo Find in array<p>Good morning! I have mongodb base:</p> <pre><code>{ &quot;_id&quot; : ObjectId(&quot;.........&quot;), &quot;0&quot; : { ...
<ol> <li>change object to key-value aray</li> <li>filter the array with regex</li> <li>if array is not empty then the doc is what you need</li> </ol> <p>you can check the result in the mongoplayground link below</p> <pre><code>db.collection.aggregate([ { $match: { $expr: { $ne: [ { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Differences on someArray.[] and someArray.@each<p>So I understand that Ember can compute on an array and elements within it. There are two options here. </p>...
<p>someArray.[] will only be used when the array items are added/removed.</p> <p>When the particular property in the array object is changed then someArray.@each will be called. </p> <pre><code> isNameChanged: function() { console.log('is Name Changed') }.property('someArray.@each.name') </code></pre> <p>Can ch...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Stack toast notification from bottom up - css / reactjs<p>I'm making a toast notification and trying to implement position options.</p> <p>My problem is that...
<p>Here is a simplified solution.</p> <pre><code>import { useState } from &quot;react&quot;; import &quot;./styles.css&quot;; export default function App() { const [toasts, setToasts] = useState([]); const btnClicked = () =&gt; { console.log(&quot;btnClicked&quot;); setToasts([...toasts, { id: toasts.leng...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: UWP Update UI From Async Worker<p>I am trying to implement a long-running background process, that periodically reports on its progress, to update the UI in ...
<p>It is key to understand that <code>async/await</code> does not directly say the awaited code will run on a different thread. When you do <code>await GetDataAsync(pickedFile);</code> the execution enters the <code>GetDataAsync</code> method still on the UI thread and continues there until <code>await file.OpenStreamF...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to write this not Exists sql<p>features is a primary table feature_groups is a join table joining features and groups group_orgs another join table joini...
<p>If it gives you the right results and isn't <em>too</em> slow then it's probably good enough, however I would note that your <code>LEFT JOIN WHERE x IS NOT NULL</code> is effectively an <code>INNER JOIN</code>:</p> <pre><code>select f.feature_id from features f inner join feature_groups fg on f.fea...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create regex with multiple conditions<p>I need to scan log file to find some substrings.</p> <p>How to combine conditions below in single regex expre...
<p>I came up with this one:</p> <pre><code>(?!.*?(DDD|EEE|FFF).*?)(?&lt;!(DDD|EEE|FFF))(AAA|BBB|CCC) </code></pre> <p>It seems to work, using these test cases:</p> <pre><code>123AAA //matches 123BBB //matches 123CCC //matches 123DDD //no match 123EEE //no match 123FFF //no match AAADDD //no match EEEBBB //no match <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The body might complete normally, causing 'null' to be returned, but the return type, 'Future<bool>', is a potentially non-nullable type<p>I upgraded my proj...
<p>Your <code>systemBackButtonPressed()</code> doesn't return anything, and it should return a Future of a bool. You can achieve returning the future if you mark it as <code>async</code>, and to return a bool just add the return in the end:</p> <pre><code> Future&lt;bool&gt; systemBackButtonPressed() async { if (n...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Excel - highlight differences in column<p>I have 2 columns that are unordered. One contains 4800 results and one contains 4700. In theory they should have th...
<p>You can add a formatting rule which applies formatting based on a formula. If you apply such a rule for column A, you can use the following formula to determine whether or not a specific value is in column B:</p> <pre><code>=VLOOKUP($A1,$B:$B,1,FALSE) </code></pre> <p>Hope this helps you out.</p> <p>P.S. Please p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NLTK Making Bigrams and Trigrams sequentially error doing both at same time<p>I am trying to pass text into the script below and have it output both bigrams ...
<p><code>filter</code> returns an iterator. Once you iterate through it, it becomes empty. You must convert the iterator into a list if you want to use it more than once:</p> <pre><code>important_words = list(filter(lambda x: x not in stopwords, words_lowercase)) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Docker - Dont see mongoDB image after docker-compose build<p>I am doing my first steps with docker compose and made a docker-compose.yml file which contains:...
<p><code>docker-compose build</code> does literally that: it builds images. In order for an image to be built, the base image needs to present. That is the reason, why you are seeing the <code>node</code> image present.</p> <p>You do not see the mongoDB image, because it is not built. Once you attempt to <code>docker-c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Appsettings and middleware Core 2.1<p>I have made a custom middleware and now I want to access the appsettings that are in another project in my solution. Sh...
<p>If you don't need all your configuration passed to your middleware but just a section you can use </p> <pre><code>IOptions&lt;T&gt; </code></pre> <p>Create MyConfig.cs Class file:</p> <pre><code>public class MyConfig { public string MyConfig1 {get; set;} public string MyConfig2 {get; set;} } </code></pre> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Do I have to install Node for using npm for react?<p>I had uninstalled Node js recently since I didn't have enough space in my drive and I was not doing any ...
<p>Yes, since NPM stands for NODE Package Manager, it does use Node runtime.</p> <p>To install node again you can run on your mac <code>brew install node</code> if you use windows, I suggest you just enter in node website, download it and install.</p> <p>If your disk is full, you can delete other things, but node is fu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does the typeof return undefined not string<p>Why does the typeof return undefined not string</p> <pre><code>myFunction(); function myFunction(){ var add...
<p>The variable address is not defined within the scope of where you are trying to use it. The variable only exists inside the &quot;myFunction&quot; function. If you move the console.log into the function block it should work as you expect.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Play 2.5 and Fluentlenium: how to turn HtmlUnit warnings off<p>I am trying to write Selenium Tests using <code>WithBrowser</code> class of the PlayFramework ...
<p>When using <code>WithBrowser</code> helper class, you can override <code>provideBrowser</code> to customize how the <code>TestBrowser</code> is configured. There are some other details, but the code below pretty much shows how to do it:</p> <pre><code>import static org.junit.Assert.*; import com.gargoylesoftware....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to get table rows which is nested in other tables using xpath in scrapy spiders<p>How to get the table rows which is nested in other tables and form tag....
<p>You can choose which tags to follow in xpath by specifying the tag in brackets. </p> <p>For your example it would be: </p> <pre><code> //table[@class="gridTable"]/... </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to disable moment.js daylight timezone conversion<p>It is possible to disable the daylight timezone conversion in moment.js?</p> <p><a href="http://plnk...
<p>If you are saying that you want moment to display your date and time (which is UTC, as indicated by the 'Z'), exactly as is, you should use moment.utc:</p> <pre><code>moment.utc('2016-06-03T04:00:00.000Z').format() "2016-06-03T04:00:00Z" </code></pre> <p>When you use the default moment constructor, as you are now,...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change CSS value of other elements if one element is being hovered<p>I have a few social-media links displayed by <code>.card</code> box-elements. Now I want...
<p>You're almost there:</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-css lang-css prettyprint-override"><code>div { display: inline-block; width: 100px; height: 100px; margin 1em; background: navy; } s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SSRS 2012: Display Parameter Label in Caps<p>The parameter has many values but the labels can either be all caps or all lowercase. How can I make the report ...
<p>There is the function <code>UCase</code>. It returns a string or characters containing the specified string converted to uppercase.</p> <p>To set your parameter to all capitals, try:</p> <pre><code>=UCASE(Parameters!ReportParameter1.Label) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Are pointers to non-static member function "formally" not considered pointers<p>I came across <a href="https://stackoverflow.com/a/71870413/12002570">this</a...
<p>The quoted statements in question seems to be validated by the following statements from the standard.</p> <p>From <a href="https://timsong-cpp.github.io/cppwp/n4659/dcl.mptr#3" rel="nofollow noreferrer">dcl.mptr#3's note</a>:</p> <blockquote> <p>[ Note: See also [expr.unary] and [expr.mptr.oper]. <strong>The type “...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Append "_id" to foreign key fields in Django Rest Framework<p>I have a model like so:</p> <pre><code>class MyModel(models.Model): thing = models.Foreign...
<p>Found same request and solution here:</p> <p><a href="https://github.com/tomchristie/django-rest-framework/issues/3121" rel="noreferrer">https://github.com/tomchristie/django-rest-framework/issues/3121</a></p> <p><a href="https://gist.github.com/ostcar/eb78515a41ab41d1755b" rel="noreferrer">https://gist.github.com...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: 'Post' object is not iterable even though i'm using filter<p>I'm trying to get all posts for a certain Vehicle and this is the code that i have:</p> <pre><co...
<p>Found out the problem, i was passing as DetailView instead of ListView</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: HTML & Javascript text changing<p>i was wondering how i could do the following:</p> <ol> <li>I get the input from the user using form(okay fine)</li> <li>i t...
<p>In my experience, the best way to store information from page-to-page is through local storage.</p> <p>Local storage persists from page to page, while JavaScript variables are cleared out, and cookies can be un-reliable based on the response from the server they are sent too.</p> <p>In your function that takes the u...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use snake case for file names and camel case for file names in CLion?<p>When I create new class <code>MyClass</code>, CLion creates <code>MyClass.h</c...
<p>You have to write some Apache Velocity engine code to do that. Inside the CLion preferences you can adjust the file creation template settings (something like that, I don't have CLion open here to look it up) and write something like:</p> <pre><code>#set( $CamelCaseName = "" ) #set( $part = "" ) #foreach($part in $...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django: Set initial value for ForiegnKey in a CreateView<p>I'm trying to create a view of type <code>CreateView</code>. This view will take the <code>form_cl...
<p>If you want to set the initial value of <code>instructor</code> field, you shouldn't exclude it from the form. You could instead make the field hidden.</p> <p>Or you could include that in the <code>exclude</code> list, but then you shouldn't override <code>get_initial</code> method, but do the assignment manually:<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find json data?<p>chitown88 help me to find the json on this website : <a href="https://www.iwc.com/fr/fr/watch-collections/pilot-watches/iw329303-big...
<p>There isn't anything special about this page. Just grab the right information with <code>beautifulsoup</code>:</p> <pre class="lang-py prettyprint-override"><code>import requests from bs4 import BeautifulSoup url = &quot;https://www.omegawatches.com/fr-fr/watch-omega-constellation-quartz-27-mm-12315276005001&quot;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fisher score error - Length of value does not match length of index?<p>I am working on ML problem, trying to compute the fisher score for feature selection p...
<p>The inputs to the fisher_score method is expected a numpy array not a pandas dataframe/series.</p> <p>Try this:</p> <pre><code>score = fisher_score.fisher_score(t[['A','B']].to_numpy(), t['Y'].to_numpy()) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to avoid duplicate JS code that each uses its own this?<p>I have several different classes with the same duplicate code. Aside from the different identit...
<p>Assuming you want a non-inheritance solution, my suggestion would be to pass &quot;this&quot; as an argument, as prototypes can be manipulated as parameters. That would allow you to keep the parameters at a minimum while not losing data.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Propagate rejected promise via a .catch()<p>I have some code which essentially looks like this:</p> <pre><code>export function firstFunction(req: express.Re...
<blockquote> <p>the secondFunction should ideally catch this error and propagate it up</p> </blockquote> <p>No, propagation is the default. Ideally you should not need to catch it at all, and it will propagate up automatically.</p> <blockquote> <p>I have tried things that all lead to an unhandled promise rejectio...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to combine two dataframe based on column route?<p>Column route represents the point for each location</p> <p>So I have two tables like this, my question ...
<h2>Answer</h2> <pre class="lang-py prettyprint-override"><code>import numpy as np prime_map = {k:v for k,v in zip(&quot;12345&quot;, [2,3,5,7,11])} def road_key_to_number(x): return np.prod(list(prime_map[k] for k in x.split(&quot;,&quot;))) df1[&quot;key&quot;] = df1[&quot;Route&quot;].apply(road_key_to_numbe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Should I create wrapper for java.nio.Files for Unit test purpose?<p>I am trying to write unit test for below class without creating real file</p> <pre><code...
<p>Use <a href="https://github.com/google/jimfs" rel="nofollow">JimFs</a> an in-memory implementation of the Java 7 filesystem API. You will need to make sure that your code allows for alternative filesystem implementations, but it should result in more extendable code and its much more preferable to mocking.</p> <p>L...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MTAudioProcessingTap EXC_BAD_ACCESS , doesnt always fire the finalize callback. how to Release it?<p>Im trying to implement <strong>MTAudioProcessingTap</str...
<p>If <code>VideoMediaInput</code> is deallocated <em>before</em> the tap is deallocated (which can happen as there seems to be no way to synchronously stop a tap), then the tap callback can choke on a reference to your deallocated class.</p> <p>You can fix this by passing (a wrapped, I guess) weak reference to your c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get validate Cognito Access Token in AWS Lambda to allow Gateway API call?<p>What I am trying to do is to set up API Gateway to my Lambda function tha...
<p>Please take a look at the sample code on this blog post: <a href="https://mobile.awsblog.com/post/Tx3JK25U7Z9EUIU/Integrating-Amazon-Cognito-User-Pools-with-API-Gateway" rel="noreferrer">https://mobile.awsblog.com/post/Tx3JK25U7Z9EUIU/Integrating-Amazon-Cognito-User-Pools-with-API-Gateway</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Draw a circle with a circle void inside with paperjs<p>Draw a steel pipe section in <code>paperjs</code>. It's only a circle with a void circle inside. Just ...
<p><code>.subtract()</code> is the correct method. Found it in <a href="http://paperjs.org/examples/boolean-operations/" rel="nofollow noreferrer">paperjs.org examples</a></p> <pre><code>const outer = new paper.Path.Circle(position, diameter/2) const inner = new paper.Path.Circle(position, diameter/2-thickness) pipe_s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sort multi-line cells containing dates in descending order in Google Sheets<p>In <a href="https://docs.google.com/spreadsheets/d/1pDqt-jfwmvo7bYuenjcWhrKJh6i...
<p>try:</p> <pre><code>=ARRAYFORMULA(IF(A2:A7=&quot;&quot;,,SUBSTITUTE(REGEXREPLACE(TRIM(FLATTEN( QUERY(QUERY(QUERY(SPLIT(FLATTEN(&quot;♥&quot;&amp;SUBSTITUTE(TRIM(SPLIT( REGEXREPLACE(REGEXREPLACE(A2:A7, &quot;, four: &quot;, &quot; on &quot;), &quot;(?:)(?i)(one|, two|, three|, four):&quot;, ), CHAR(10))), &quot; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SAS replicates values<p>I have a table with some millions records. There, I have a column looking like that (goes from 1 to 7 for hundreds of times)</p> <p>...
<p>Without seeing more of the data table and it's potential natural ordering columns you could create a DATA step view</p> <pre><code>data work.big_with_week / view=work.big_with_week; set big; if list = 1 then nweek + 1; run; </code></pre> <p>The syntax <em>variable</em><code>+</code><em>expression</em> is known...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I connect to SFTP service based on Azure Storage Account Solution with BizTalk 2013<p>I have a requirement to connect to an SFTP service based on Azu...
<p>With earlier version of BizTalk it doesn't use WinSCP and there is a limited set of SSH Cyphers that it supports.</p> <p>When it tries to connect to an SFTP server that has a set of cypher that doesn't have a match for the one that the BizTalk SFTP adapter supports, then it will throw a very unhelpful error in the W...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Blank screen on internet explorer 11 due to script error<p>I have an error which stops my entire site from showing. Everything is loaded, I can even hover an...
<p>typeSpeed appears twice.</p> <pre><code>try { var firstSentence = $("#typed").attr('data-typed-first'); var secondSentence = $("#typed").attr('data-typed-second'); var thirdSentence = $("#typed").attr('data-typed-third'); var fourthSentence = $("#typed").attr('data-typed-fourth'); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Observerable appending data over and over again on populate action<p>I have a Mat-Table that is duplicating the data when the user clicks the button to popul...
<p>If you want for every 5 records to return array of 10 records (and not the cumulative result) you should not always push in <code>this.rows</code>, or you can reset <code>this.rows</code> before populating it. Try something like this:</p> <pre><code>connect(collectionViewer: CollectionViewer): Observable&lt;Gizmos[...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Tried all the selenium click option but click is not working on an element<pre><code>WebElement n=driver.findElement(By.cssSelector(&quot;tr:nth-of-type(1) &...
<p>I think you are trying to click on an SVG image, which are handled differently from the conventional elements.</p> <pre><code>driver.find_element(By.XPATH, &quot;//*[name()='svg' and @class='MuiSvgIcon-root')]&quot;) </code></pre> <p>This should work, if the svg is what you are trying to click. If you have only one ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert dictionary to dictionary of lists by using strings<p>I have data in the following form:</p> <pre><code>{None: {'VPP_users': {None: [1, 2, 3, 4]}, 'ti...
<p>You can achieve this with dictionary comprehension, considering the exact format of this input dictionary :</p> <pre><code>d = {None: {'VPP_users': {None: [1, 2, 3, 4]}, 'timesteps': {None: [1, 2]}, 'DR_signal': {None: 180.0}, 'power_contract': {(1, 1): 25, (2, 1): 78, (3, 1): 95, (4, 1): 9, (1, 2): 91, (2, 2): 62, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Saving Edits on a WFS using OpenLayers<p>So with an app that I've produced by taking <a href="http://wordpress-dbauszus.rhcloud.com/wfs-t-with-openlayers-3-5...
<p>Turns out that the problem lied in the fact that my geometry column needed to be called geometry and OpenLayers only works with with EPSG:3857.</p> <p>The code is correct</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use window functions to get the cumulative count of two columns based on the value from one column?<p>I'm trying to get the cumulative count of previo...
<p>I present to you 2 options, one I don't think will work because mysql doesn't always support <code>PIVOT</code> but I wrote the 2nd option using something more generic.</p> <p>They use CTE's which are technically subqueries, but maybe you will like them better because they're easier to decipher.</p> <p><strong>Optio...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Multiple inserts to the same instance of an immutable data structure in Scala<p>I have a data type called <code>Fork</code> which is immutable. A <code>Fork<...
<p>You could use <a href="https://www.scala-lang.org/api/current/scala/collection/GenTraversableOnce.html#foldLeft[B](z:B)(op:(B,A)=%3EB):B" rel="nofollow noreferrer"><code>foldLeft</code></a></p> <pre><code>val fkl = bodies.foldLeft(fk)((f,b) =&gt; f.insert(b)) </code></pre> <p>it will start with original <code>fk</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Permission in android<p>I need to run my app and ask about read external storage permission, I'm using <code>RecyclerView</code> and when I accept perrmissio...
<p>you have to call below methods again if user grants permission</p> <pre><code>loadAudio(); initRW(); </code></pre> <p>Also in onCreate() call above two methods only if permissions are granted</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AWS SNS : Case of multiple subscribers<p>I am a beginner in using AWS services. I have a requirement recently in which I wanted to send some data from servic...
<p>Messages sent to SNS topics go to all subscribers.</p> <blockquote> <p>Publishers send messages to topics. Once a new message is published, Amazon SNS attempts to deliver that message to <strong>every endpoint</strong> that is subscribed to the topic. <em>(emphasis added)</em></p> <p><a href="http://docs.aws...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kotlin #toCharArray giving wrong characters<p>I'm trying to loop through characters of a string. While doing so I found out that the <code>#toCharArray</code...
<p>Unfortunately, a Kotlin <code>Char</code> is 16-bit, and so characters outside of the basic multilingual plane needs to be represented with 2 <code>Char</code>s (surrogate pairs). One <code>Char</code> is not enough.</p> <p>If you want to loop through all the Unicode <em>codepoints</em> in the string, use <code>code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Minor Syntax issue regarding Swift 3.0 and a for loop<p>I recently just converted my code to the Swift 3.0 syntax that came with the Xcode 8 beta. I ran into...
<p>Don't use a floating point type as loop index</p> <pre><code>for i in 0 ..&lt; 3 { let background = SKSpriteNode(texture: backgroundTexture) background.position = CGPoint(x: backgroundTexture.size().width/2 + (backgroundTexture.size().width * CGFloat(i)), y: self.frame.midY) background.size.height = sel...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rotation of a point around origin in 2D converge to 0<p>Following code is written to rotate a point around the origin in 2D. However, instead of going on a c...
<p>At first, you apply <strong>changed</strong> x value to get y. It is just wrong. Instead remember old value and use it.</p> <pre><code> var tempx = x; x = (x * Math.cos(theta)) - (y * Math.sin(theta)); y = (y * Math.cos(theta)) + (tempx * Math.sin(theta)); </code></pre> <p>Second: reusing the same va...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reactive Angular Material Data Table<p>I've created an Angular Material Data Table with this <code>ng generate @angular/material:material-table</code> comman...
<p>I figured out how to setup a table for my requirements. The main change is that I removed the Observable which fetches the data from the <strong>TableDataSource</strong> and introduced a <strong>DataService</strong>:</p> <pre><code>export class DataService { //the @Select is from ngxs but can be anything returnin...