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: JavaMail: MimeMessage sent as plain text when HTML is expected?<p>I have the following <code>Java</code> code in my <code>Spring</code> REST Web App:</p> <p...
<p>Try setting the MimeMessage content directly like this.</p> <pre><code>mimeMessage.setContent(email.content(), "text/html"); mimeMessage.saveChanges(); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Join without creating duplicate records<p>I have 2 tables product table and category table. Below is how the category table looks-</p> <pre><code>Product_ID...
<p>Below is for BigQuery Standard SQL </p> <pre><code>#standardSQL SELECT Product_ID, Category, SubCategories, Quantities_sold FROM `project.dataset.product` p LEFT JOIN ( SELECT Product_ID, Category, STRING_AGG(DISTINCT SubCategory ) SubCategories FROM `project.dataset.category` GROUP BY Product_ID, Category...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Where do i connect the shield of coaxial cable on a 433MHz receiver PCB?<p>I am trying to extend the reception on my weather sensor by connecting an antenna ...
<p>No you must connect it to RF ground right beside where the center conductor meets the board. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CSS file being read as HTML file<p>I'm trying to link a css stylesheet to my django html template but it keeps being read as an html file with the error:</p>...
<p>Have you pointed your "Static_URL" to static_cdn folder? </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Numpy Vectorization: add row above to current row on ndarray<p>I would like to add the values in the above row to the row below using vectorization. For exam...
<p>You can use indexing directly:</p> <pre><code>b = np.zeros_like(a) b[0] = a[0] b[1:] = a[1:] + a[:-1] &gt;&gt;&gt; b array([[0, 0, 0, 0], [1, 1, 1, 1], [3, 3, 3, 3], [5, 5, 5, 5]]) </code></pre> <p>An alternative:</p> <pre><code>b = a.copy() b[1:] += a[:-1] </code></pre> <p>Or:</p> <pre><co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Combination one to one between array elements without repetition<pre><code>$example1 = array(3, 9, 5, 12); $example2 = array(5, 4); $example3 = array(8, 2, 4...
<p>Almost. But in the second loop you need to pick just part of the original array.</p> <p><a href="http://php.net/manual/en/function.array-slice.php" rel="nofollow">array_slice</a> function might be helpful here.</p> <pre class="lang-php prettyprint-override"><code>$example1 = array(3, 9, 5, 12); for ($i = 0, $n = ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C: Using select() to write to new client<p>I'm creating a chat server/client using C and I'm using <code>select()</code> to monitor my sockets.</p> <p>The p...
<p>Seconds after posting this I found the solution. The listening sockets both need to be read from when there is a new client. Only after accepting the connection does the new socket get watched for writing. The socket listening for new connections obviously needs to be read from not written to. Will keep this up for ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does the new object keep the properties of the old one?<p>I create a method that casts an aging spell upon people and decreses their age by two: </p> <p...
<p>You reassign <code>x</code> in the spell method, so it points to the <em>new</em> person, then you change that new person's age, and then you throw that person away. So the net result is nothing changed. It's the same as doing this:</p> <pre><code>void agingSpell(Person p) { Person throwaway = new Person(p.age); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python : Convert list of strings to floats with empty/none<p>I have <code>a = ['1','2','','17']</code></p> <p>I would like to apply a min / max operation on...
<p>You could define a function that tries to convert values to floats and returns <code>None</code> if it can't, then use list comprehensions to create converted and filtered versions of the list you can use <code>min</code>/<code>max</code>/... whatever on while keeping the original intact.</p> <pre><code>def try_flo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: onClick loading new page before running my function<p>When a user clicks my link, I want a Javascript function to run which hides all the content on my page,...
<p>Try this:</p> <pre><code>&lt;a href="add.htm" onclick="clearScreen(this,event);"&gt;&lt;span class="clickableDiv"&gt;&lt;/span&gt;ADD DEVICE&lt;/a&gt; function clearScreen(link, event){ event.preventDefault(); document.getElementById("container").style.display = 'none'; setTimeout(function(){ w...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Integrity constraint exception handling with user friendly message Yii2<p>I have a table with a triple key, now I want to show a "friendly" warning if I repe...
<p>Stop inserting same <code>planificacion_fk</code> for new entries. The error says, you are inserting a same primary key value which must be unique for all entries.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MongoDB: Filtering out elements from nested arrays<p>I have a data collection similar to:</p> <pre><code>{ "_id" : 1, "name" : "Class 1", "stude...
<p>I think this is what you need: </p> <pre><code>db.school.aggregate([ { $project: { students: { $filter: { input: "$students", as: "student", cond: { $gte: ["$$student.score", 90] } } }, name: 1, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django choices tutorial<p>Can someone explain me what the function at the end of the coices example in the Django tutorial is for?</p> <p>Thanks!</p> <pre>...
<p>Upper class is a term used mostly in U.S based colleges to collectively denote Juniors and Seniors ( i.e the 3rd and 4th year students in a college with usually 4 year degrees, <a href="https://en.wikipedia.org/wiki/Student#:%7E:text=Upperclassman%20to%20refer%20collectively%20to%20Juniors%20and%20Seniors" rel="nofo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Which CSS selector can be used to select a flex box item in wrapped state?<p>I have a <code>display:flex</code> row with 3 columns and <code>flex-wrap</code>...
<p>There is no CSS selector to select specifically wrapped flex items, unfortunately.</p> <p>(It's unlikely that any such selector will be added, because it'd create weird circular dependencies. e.g. suppose a flex item wraps because it's too wide for the first line -- and then you select it &amp; restyle it to be sk...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to extract digit from an integer that fits a range of numbers?<p>For example, a user might input an ID number and creating a function that goes through t...
<p>Expanding on a comment, an integer is not necessarily an <code>int</code>. For example</p> <pre><code>char five = '5'; </code></pre> <p>is an integer stored in a <code>char</code>. Also</p> <pre><code>std::string x = "157567658"; </code></pre> <p>are several single digit integers represented as a <code>std::stri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python multiprocessing Queue put() behavior<p>I'm doing something very simple using multiprocessing:</p> <pre><code>data = {'a': 1} queue.put(data, True) da...
<p>Actually, this is thought to be a feature, not a problem. The queue immediately returns so your process continues while serialization happens and to avoid what is known as "<a href="http://bugs.python.org/issue17025" rel="noreferrer">queue contention</a>".</p> <p>The two options I suggest you have:</p> <ol> <li><p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel - Different path when run function from Chrome and as a scheduled call<p>Sorry, if it's an amateur question, but I couldn't find the answer. I have a...
<p>If you intend to run this code from both the browser and as a scheduled task, you need to add some logic to detect if the code is running in console first. For example:</p> <pre><code>// is this running as a scheduled task? if (app()-&gt;runningInConsole()) { $filePathGz = public_path('uploads/admanagerriport/'...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Redirect http to https and also no-www to www<p>I want to redirect the following:</p> <p><code>http://example.com</code> to <code>https://www.example.com</c...
<p>You can add these <code>mod_rewrite</code> rules into an <code>.htaccess</code> file at the root of your site:</p> <pre><code>RewriteEngine On RewriteBase / # www RewriteCond %{HTTP_HOST} !^www\. RewriteRule ^(.*)$ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # https RewriteCond %{HTTPS} off RewriteRule ^(.*)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the value using another column and get difference between each row in MySQL or SQL?<pre><code>finish_position official_rating date ...
<p>I have imagined to do it like this and I will try to explain.</p> <blockquote> <p>Please note that my date column is named datec and table is called test</p> </blockquote> <ul> <li><p>First I have selected selected first part of the result where I will not calculate any difference (until first number 1 appeare...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: File contents not as long as expected<pre><code>with open(sourceFileName, 'rt') as sourceFile: sourceFileConents = sourceFile.read() sourceFileConent...
<p>If your file is encoded in something like <code>UTF-8</code>, you should decode it before counting the characters:</p> <pre><code>sourceFileContents_utf8 = open(sourceFileName, 'r+').read() sourceFileContents_unicode = sourceFileContents_utf8.decode('utf8') print(len(sourceFileContents_unicode)) i = 0 source_file_...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can SELECT from table but not UPDATE it (get "relation [table name] does not exist" when attempting to UPDATE<p>When I tried to update several columns in a t...
<p>After changing nothing these queries work now. Who knows...</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NodeJS foreach loop with setInterval<p>I'm trying to fetch data from array every two seconds and then send the request to the twitter API to follow the user....
<p>If you want to avoid using any libraries:</p> <p>setInterval will wait 2 seconds to handle the script it contains but the rest of the code will keep going. This means the forEach loop will execute 400 times and set 400 different intervals of 2 seconds, which will end around the same time.</p> <p>What you could use...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unit Testing Views in WPF<p>I have used Mock to unit test ViewModels. My problem is with the views. I have to test the KeyUp event of a textbox. </p> <p>In ...
<p>Views should not have any business logic in them... that's the whole point of MVVM. Therefore, there should be no reason to test your views. </p> <p>However, if you really want to test some logic in an event handler, just put it into another method and call that from your event handler. You will then be able to tes...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use both default and material theme for different ng-select in Angular 6<p>I need to use <code>ng-select</code> with a material theme on my page, and ...
<p>If your <code>style.scss</code> has the following code, your <code>~@ng-select/ng-select/themes/default.theme</code> will load inside <code>.default</code> and <code>~@ng-select/ng-select/themes/material.theme</code> will load inside <code>.material</code></p> <pre><code>.material { @import "~@ng-select/ng-selec...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to show data table in report viewer in visual studio 2013<p>I have a report viewer with the name reportviewer1.A report named as report.rldc. I have used...
<pre><code>var ConnString = System.ConfigurationManager.ConnectionStrings["dbconn"].ConnectionString; SqlDataAdapter dataadapter; DataTable someDataTable = new DataTable("ReportViewResults); using (SqlConnection connStr = new SqlConnection(ConnString)) { using (SqlCommand cmd = new SqlCommand("yourStoredProc or Sql...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Excel: Extract all partial matches from a two dimensional array and create a list with results<p>I have a sheet with several cells containing text that inclu...
<p>If one has the Dynamic Array formulas then put this in the first cell:</p> <pre><code>=FILTERXML("&lt;a&gt;&lt;b&gt;"&amp;TEXTJOIN("&lt;/b&gt;&lt;b&gt;",TRUE,B3:E12)&amp;"&lt;/b&gt;&lt;/a&gt;","//b[contains(.,'"&amp;H1&amp;"')]") </code></pre> <p><a href="https://i.stack.imgur.com/uTcDh.png" rel="nofollow noreferr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Output string as html in freemarker<p>So we are storing html in out data model. I need to output this into a freemarker template:</p> <p>example:</p> <pre>...
<p><code>[#noescape]</code> or <code>&lt;#noescape&gt;</code> is only valid when used inside an <code>[#escape]</code> tag. Your data is probably stored with the HTML encoded. You need to get the backend to un-encode the html.</p> <p>Otherwise you'll need to do something like...</p> <pre><code>${value?replace("&amp;g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error found "This release is not compliant with the Google Play 64-bit requirement(Opencv lib)"<p><a href="https://i.stack.imgur.com/GPH3n.png" rel="nofollow...
<p>Error came because <strong>Opencv</strong> Lib have only 32bit and possible to not have 64bit lib of <strong>Opencv</strong> in your project. So, please check your project<code>(app/src/main/jniLibs)</code> check this below folder </p> <blockquote> <p>armeabi-v7a(32bit)</p> </blockquote> <p>and </p> <blockquote...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python CSV library returning 1 item instead of a list of items<p>Im trying to use the CSV library to do some excel processing, but when I use the code posted...
<p>Assuming you are giving examples of your data above the line <code>import csv</code>, it looks like your data is comma delimited but you are setting up your CSV reader to expect tab delimited data (<code>dialect=csv.excel_tab</code>).</p> <p>What happens if you change that line to:</p> <pre><code>data = csv.reader...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: indexing wikipedia articles in SOLR around a location with given distance<p>What is the best way to index Wikipedia Articles (which contain Geo locations lon...
<p><a href="https://en.wikipedia.org/wiki/Special:Nearby" rel="nofollow">Special:Nearby</a> you mentioned in comments used to be powered by Solr, but it now uses Elasticsearch. The extension that provides geospatial search - <a href="https://www.mediawiki.org/wiki/Extension:GeoData" rel="nofollow">GeoData</a> - also su...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In opencv-python cap.read() returns false after 1 second<p>I'm trying to label a video with opencv version 4.2.0.32, python 3.7.4 and win10. I installed open...
<p>I actually solve the problem. It was code independent. It looks like opencv dlls were missing from the python path. I pasted the dlls and problem solved. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: get all facebook likes without pagination in android<p>I am using this code which returns only 25 pges I like .How can I get more ?</p> <pre><code>new Reque...
<p>You can´t just get all entries, the default limit is 25 per API call and you need to implement paging to get more results: <a href="https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#paging" rel="nofollow">https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#paging</a></p> <p>That me...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Interface with keys declared by string array<p>I have an interface.</p> <pre><code>interface ICalculateFieldProps { fields: string[] set: string updat...
<blockquote> <p>...if pass <code>['width', 'height']</code> to <code>fields</code>...</p> </blockquote> <p>If you mean <strong>at runtime</strong>, you can't do this using TypeScript's type system. TypeScript does its work at compile time.</p> <p>You can, of course, do it at runtime with runtime checks in the imple...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: warning in importing a CSV to R; "-" not meaningful for factors<p>I'm trying to import a set of dates from CSV to R.</p> <p>Code:</p> <pre><code>dates &lt;...
<p>You can do this by using the <code>&lt;-</code> operator, which is the standard <code>assignment operator</code> in R. </p> <pre><code>dates &lt;- read.csv(file = "dates.csv", header = FALSE) </code></pre> <p>instead of the one you are typing above.</p> <p>You could also read <a href="https://stat.ethz.ch/R-manua...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: When to use GLSL shaders in OpenGL in a game?<p>I am learning GLSL and how to do transformations and lighting etc however I just have 1 shader program that i...
<p>Shaders are a bit like functions that run on the GPU instead of the CPU. Having one shader that does everything is like having one function that does everything; i.e. usually a huge, unmaintainable mess with branches everywhere. That said, having one shader for each object is usually overkill, as many objects can be...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript array to boolean type coercion not making sense<p>When I run the following line of code:</p> <pre><code>var x = []; console.log(!x); console.log(...
<p><strong>tl;dr:</strong> <em>Converting</em> a value to Boolean is very different from <em>comparing</em> a value to Boolean because JavaScript has implicit type conversion.</p> <blockquote> <p>Can someone explain to me what is going on here?</p> </blockquote> <p><code>!x</code> is the same as doing <code>!Boolea...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to transpose the first rows into new columns in R?<p>I want to transpose the first two rows into two new columns, and remain the rest of data frame. How ...
<p>Here is an option with <code>slice</code></p> <pre><code>library(dplyr) DF %&gt;% select(A) %&gt;% slice(1:2) %&gt;% t %&gt;% as.data.frame %&gt;% bind_cols(DF %&gt;% slice(-(1:2))) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: winform and session timeout<p>I have a vb.net winform and I want to know how to add sort of like a session time out to it. For example, I have a varialbe set...
<p>First question, why do you want to do in a winform. Such things we generally use in web forms. But even you want to use such things in WinForms you need to use <code>Timer Class</code>. Whenever you encounter activity, you can just reset the timer by calling <code>Stop</code> then immediately calling <code>Start</c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is converting Python unicode by casting to str reversible?<p>The proper way to convert a unicode string <code>u</code> to a (byte)string in Python is by call...
<p>In Python 2, if the conversion with <code>str()</code> was successful, then you can reverse the result. Using <code>str()</code> on a <code>unicode</code> value is the equivalent of using <code>unicode_value.encode('ascii')</code> and the reverse is to simply use <code>str_value.decode('ascii')</code>. Using <code>u...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does php have a way to stop the call chain if a null value is encoutered?<p>I would like to do <code>self::container()-&gt;get($path);</code> but <code>self:...
<blockquote> <p>This answer applies for PHP versions olders than 8.0.0. For PHP 8.0.0 and later see Maks3w answer</p> </blockquote> <p>Short answer: no, there is no such thing in PHP.</p> <p>I would avoid, at all price, doing magic like the one you suggested.</p> <p>Doing:</p> <pre><code>&lt;?php public static function...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is `[](std::list<int>& list){return std::move(list)}(list)` guaranteed to leave `list` empty?<p>More particularly:</p> <pre><code>struct A{ std::list&lt...
<p>No. Moving from most standard library classes leaves them in a "valid but unspecified state" [1]. That means you have to explicitly clear <code>a.list</code> in order to ensure that it's empty after the move.</p> <p>[1] There are exceptions to this rule: most notably, <code>std::unique_ptr</code> is required to be ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I add users to a Gitlab private group with a Webhook?<p>Are account/organization level webhooks a thing in Gitlab? I'm creating a membership site, and wh...
<p>You can use the <a href="https://docs.gitlab.com/ee/api/members.html#add-a-member-to-a-group-or-project" rel="nofollow noreferrer">Gitlab API</a> to add members to projects/groups.</p> <p>The webhooks you mentioned (changes pushed, merge requests started, etc.) are all events that are triggered within Gitlab and ca...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Handle multiple objects for SQLite Database<p>I am trying to update a single SQLite row item multiple times in a thread.But it throwing <strong>close() was n...
<p>Simple solution:</p> <p>No need to open/close the db each time from thread. You should have to open the db in <code>onResume()</code> and close it in <code>onPause()</code> to handle multiple db instances. </p> <p>Simple change your code From :</p> <pre><code>@Override public void run() { mValues.open(); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do i add tab space to php function<p>I am trying to add tab space to php function. i have try using multiple white spaces, '\t' but both are not working<...
<p>Use <code>html_entity_decode()</code></p> <pre class="lang-php prettyprint-override"><code>public function getProductDescription() { return html_entity_decode($this-&gt;name."&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;". $this-&gt;carton_quantity .' * '. $this-&gt;weight.' g'); } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to remove white borders on bar charts in highcharts?<p><a href="https://i.stack.imgur.com/b4NWY.png" rel="nofollow noreferrer"><img src="https://i.stack....
<p>Setting the plotOptions.bar.borderWidth to 0 is a solution which you are looking for. </p> <p>Demo: <a href="https://jsfiddle.net/BlackLabel/foapqu40/" rel="nofollow noreferrer">https://jsfiddle.net/BlackLabel/foapqu40/</a></p> <pre><code> plotOptions: { bar: { borderWidth: 0 } }, </code></pre> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular performance: ng-show vs. dynamically recompile directive<p>Let's say I have a boolean <code>format</code> that controls how a collection of items sho...
<p>$compile is expensive (relatively). Your use case sounds like a candidate for ng-switch, so don't reinvent the wheel if ng-switch works for you.</p> <p>However, inside your directive, you can cache the compilation of each template and then re-link them by calling the link function returned by $compile. This would...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RxSwift asDriver map and strong self<p>I'm trying to figure out if I'm creating a retain cycle here. I want to bind the current offset of the collection view...
<p>Yes, your code creates a retain cycle because your chain keeps a strong reference to self and self keeps a strong reference to the chain (through the disposeBag.)</p> <p>Also, such code is a code smell because you are depending on side effects in a <code>map</code> (the value of <code>self.collectionView.frame.widt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Defining classes using Unsafe.defineClass without resolving dependencies<p>Due to a requirement of my program, I am in the situation where I need to define m...
<p><code>Unsafe.defineClass</code> <em>does not resolve</em> classes, as specified in <a href="https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-5.html#jvms-5.4.3" rel="nofollow noreferrer">JVMS §5.4.3</a>. The most of symbolic references in the constant pool remain unresolved.</p> <p>The only dependencies that...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I create an alert Dialog window with a seek bar?<p>I have the following layout :</p> <pre><code>&lt;SeekBar android:layout_width="match_parent" ...
<p>First inflate the view you want to set to dialog with <code>LayoutInflater</code>:</p> <pre><code>LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); View mView = inflater.inflate(R.layout.dialog_view, null); </code></pre> <p>Than initialize your seekbar:</p> <pre><code>S...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: H2 Database created with spring-boot-starter-data-jpa but not with spring-boot-starter-data-jdbc<p>I am new in Spring. I am trying to work with H2 Database a...
<p>I found the solution :</p> <p>As I said, I am using Spring Initializr to bootstrap the project. In the job pc, I was not able to use the last version of Spring boot (2.2.4), so i choosed 2.1.12</p> <p>Version Spring Boot</p> <p>With this version, it works with JPA but not with JDBC...</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ignore spelling error in DocX file<p>Using OpenXML, I'm inserting some text into a document that I know will be marked as incorrectly spelled (because it's a...
<p><code>ProofError</code> is to actually mark the text run with the <em>angry red line</em>. To exclude the text in a run for spell/ grammar checks use <code>noProof</code>. </p> <p>Lets say you got a word in a run as:</p> <pre><code>&lt;w:p&gt; &lt;w:r&gt; &lt;w:t&gt;Cfgcfgcyhgjguih&lt;/w:t&gt; &lt;/w:r&gt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Websocker-Rails message from outside<p>recently i'n trying to use websocket-rails gem. And i wonder is there any idea to send notifications from server to us...
<p>You can do that using the following code.</p> <pre><code>WebsocketRails[:channel_name].trigger :event_name, data_object </code></pre> <p>But to send from the background (model, jobs, rake task) the websocket-rails gem requires you to install redis. You can find the instruction for that in the link below.</p> <p><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Do I need separate domain for MVC Web API?<p>I am facing one problem.</p> <p>I have 1 Presentation Layer Project using <em>ASP.NET MVC</em>. There is anothe...
<p>Two domains? No. However, given that you have two projects you will need two separate deployment locations. That means they'll either need to live at different <em>subdomains</em> (i.e. <code>www.domain.com</code> and <code>api.domain.com</code>) or under different virtual directories of the same domain/subdomain (i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Auto and copy elision<p>What exactly are the rules for copy elision when one is using auto and commits to a specific type ? (see: <a href="http://herbsutter....
<p>I guess you use <code>libstdc++</code>. It is currently not standard conformant in this regard, i.e. the <code>iostream</code>s do not have move constructors yet although they should have. It will be fixed in version 5: </p> <blockquote> <p><strong>Runtime Library (libstdc++)</strong></p> <blockquote> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to enter a new line in react-bootstrap?<p>I am using reactbootstrap and I want to enter a new line. <br/> doesn't seem to work. </p> <pre><code>{revisio...
<p>You can use a <code>p</code> tag</p> <p>The following should work.</p> <pre><code>{revision.notes.map(note =&gt; ( &lt;div key={note.id}&gt; &lt;p&gt;{note.content}&lt;/p&gt; &lt;span className="pull-right"&gt; &lt;a href={`/editor/${note.author.id}`}&gt; &lt;i&gt; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android Studio error 13=permission denied in linux<p>i am using android studio latest version in linux(elementary luna to be specific). I installed jdk, andr...
<p>I'm running android studio 1.0.2 on ubuntu 14.04 (LTS) 32 bit and i had the same problem. just go to "<strong>/home/suUs12/Android/Sdk/build-tools/21.1.2/</strong>" and then right click on '<strong>aapt</strong>' file , <strong>properties -> permissions</strong> and check '<strong>Allow executing file as program<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Merging JSON while keeping key layout<p>I'm trying to merge multiple JSON results that I get from an API into a single one. </p> <p>The JSON data I'm receiv...
<p>As it's difficult to test properly, this code is as close as I can guess at.</p> <p>The problem is that when you add the data in with <code>$jsonCombined[]</code>, this will just add the data to the end of the array in a numerical sequence. This code instead gets the key along with the content in lines like...</p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to have a properly Dark and Light Theme with Splash Screen<p>I have read that there is a way to have a values-night and a values folder. But how to chang...
<p>Try below dark mode code which I am use.</p> <p><strong>Step - 1</strong></p> <p>First of create <strong>night</strong> folder into your resource file like below image(i.e. values-night)</p> <p><a href="https://i.stack.imgur.com/0WfcS.png" rel="noreferrer"><img src="https://i.stack.imgur.com/0WfcS.png" alt="Creat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regular Expression for REGEXP_SUBSTR in Oracle<p>I have the following text to search:</p> <pre><code>#S7Z OK #Wed Feb 18 07:16:26 GMT 2015 expiration=10.0 l...
<pre><code>SELECT REGEXP_SUBSTR( '#S7Z OK #Wed Feb 18 07:16:26 GMT 2015 expiration=10.0 lastModified=1424192425832 length=466472 path=/name/_master_/563/5638ad54-8079-4399-ba2b-3257b6e6c7fd.pdf userType=', 'path=(.+)', 1, 1, null, 1) FROM dual; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: child class method pointer to method parent argument c++<p>it might be strange what i'm trying to see and i will try to clarify as much as possible. I'm usin...
<p>You cannot directly call child method from a base class, but you can use template:</p> <pre><code>class A { public: template&lt;class T&gt; void executeMethod( void (T::*method)() ) { (static_cast&lt;T *&gt;( this )-&gt;*method)(); } }; class B : public A { public: void sampleMethod() {...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: replace the string having dynamic character inside square bracket<p>I've a string format:</p> <pre><code>new.ControlField[0] = ""; new.ControlField[1...
<p>I don't have Notepad++ on my machine, but try searching for</p> <pre><code>new\.ControlField\[\d+\] = </code></pre> <p>and replacing with nothing. Make sure you have the "grep" or "regex" option selected in your find and replace.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C: Issue with setting soft limit using RLIMIT_FSIZE<p>I was reading the Manual Pages about getrlimt/setrlimit and I was following the examples accordingly.</...
<p><code>setrlimit</code> does not return the current value. You need to call <code>getrlimit</code> after setting the value to retrieve the current value.</p> <pre><code> struct rlimit rl; getrlimit (RLIMIT_CPU, &amp;rl); rl.rlim_cur = 1; setrlimit (RLIMIT_CPU, &amp;rl); getrlimit (RLIMIT_CPU, &amp;rl); pr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Scala promise does not work if I encapsulate it in a commodity function<p>I have this code that I use in a spray handler</p> <pre><code> get { def ...
<p>I believe that your problem is due to the infamous auto-Unit <em>feature</em> of Scala. Your function:</p> <pre><code>def callbacklistener(arg: T): Unit = { arg: T =&gt; p success arg } </code></pre> <p>will probably be interpreted as:</p> <pre><code>def callbacklistener(arg: T): Unit = { { arg: T =&gt; p suc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Write SQL query that finds the most common first name(S), errors<p>I need to write a query that finds the most common first names, given a table called USERS...
<p>Aggregation isn't allowed in the <code>WHERE</code> clause. You wanted the query to return the name associated to the count of occurrences of the most frequent names. Instead a <code>HAVING</code> clause should be used because the <code>HAVING</code> clause is used to filter groups after the aggregation in SQL.</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Matplotlib Scatter plot filter color (Colorbar)<p>I have some data let say <code>x</code>, <code>y</code>, and <code>z</code>. All are <code>1D</code> arrays...
<pre><code>import matplotlib.pyplot as plt import numpy as np np.random.seed(42) # prepare random data stats = -1, 1, 200 x = np.random.uniform(*stats) y = np.random.uniform(*stats) z = np.random.uniform(*stats) # mask unwanted data thresh = 0.4 mask = np.abs(z) &lt;= thresh x_ma = np.ma.masked_where(mask, x) y_ma = ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Windows Phone 8.1 Silverlight Unique device Id<p>I would like to know if there is a way to find unique device ID for Windows phone 8.1 Silverlight applicatio...
<p>I have found an answer to the question. It turns out that I can use the Windows.Phone.System.Analytics.HostInformation.PublisherHostId method, but I have to check the ID_CAP_IDENTITY_DEVICE capabillity in WMAppManifest.xml file. That file can be found under Properties of Windows phone 8.1 Silverlight application.</p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Chrome extension which toggles On and Off<p>I'm trying to make an extension which would toggle another specific extension on and off. However, I tried over a...
<p>Let's see how your extension currently works.</p> <p>There's your popup page, that loads, with the checkbox unchecked by default.</p> <p>Then, your code runs, checks if the checkbox is checked (it isn't) and disables the extension you specify.</p> <p>And then.. <em>nothing</em>. You never told Chrome to do anythi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use properly glVertexAttribPointer()'s offset parameter<p>I am having issues with OpenGL's <strong>glVertexAttribPointer()</strong>.</p> <p>If you ha...
<p>No, if you store the vertices for the two triangles in two different VBOs, as you specified here:</p> <blockquote> <p>you want to read half of it and put it in a VBO1 and VAO1 and then read the other half and put it into another VBO2 and VAO2</p> </blockquote> <p>you don't need an offset. The offset passed to <c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Byte conversion back to Image<p>I'm trying to convert the bytes in plr.PlayerImage back into an image for the picturebox. </p> <p>However, Method 1 returns ...
<p>As said in my comment from above, your not casting your property in the memory stream you have created. Also if <code>plr.PlayerImage</code> is not defined as <code>Byte()</code> you will get an exception.</p> <p>Here's what it may look like...</p> <pre><code> Public Property PlayerImage As Byte() </code></pre> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to center align/center parallax scrolling content?<p>I am using a simple parallax scrolling effect however I am running into two problems. </p> <ol> <li...
<p><strong>Option #1</strong> (related to your code):</p> <p>There are some basics missing. For example closing div of page-wrap.</p> <ol> <li>Basically you can set a background for your header and play with it. </li> <li><p>With little conditions you can do the same trick with the nav</p> <pre><code>if ($(this).scr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: XML Schema Definition (XSD) for XML files<p>How can I check whether a XML file uses a XML Schema Definition (XSD)? For example, if you decompress a signed od...
<p><em>"...How can I check whether a XML file uses a XML Schema Definition (XSD)?..."</em></p> <p>(1) You cannot, if there is no embedded reference in an XML file by the attribute <code>xsi:schemaLocation</code> to the XML schema. </p> <p>(2) Though, whatever API is in use, it can still validate against some XSD sche...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Draw on Zoomable Image in C# windows Forms<p>so am implementing a project that can read image pan it, zoom it and do other stuff.. everything was goin...
<p>Here is a <code>PictureBox</code> subclass that supports the ability to apply zooming not only to the <code>Image</code> but also to graphics you draw onto its surface.</p> <p>It includes a <code>SetZoom</code> function to zoom in by scaling both itself and a Matrix.</p> <p>It also has a <code>ScalePoint</code> fu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does window.innerWidth go past my viewport size?<p>I'm trying to .appendChild() an element into my viewport without introducing vertical/sideways scrolli...
<p>The <code>x</code> and <code>y</code> in your example will be the first pixel <strong>outside</strong> the viewport, to the bottom right of it. Remember that these values are 0-based.</p> <p>For instance, suppose <code>innerWidth</code> is 5 and <code>innerHeight</code> is 3. You'd have:</p> <pre> [0, 0] [1, 0] ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does html5 canvas support hex colors with alpha?<p>I was wondering If a square could be drawn in color <code>#FF000000</code> then a circle inside of <code>#...
<p><strong>Update:</strong> Modern browsers now support 8 character hex colors, for CSS and canvas.</p> <hr /> <p>Canvas, like CSS, does not support 8 character hex colors. You can however use the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#rgba%28%29" rel="noreferrer"><code>rgba</code> color ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Swift tuples comparison<p>Can someone tell, why in similar cases Xcode returns: in 1st case - true, in 2nd case - false? It's a tuples comparison. First it c...
<p>In both cases the numeric value is equal.<br> The difference is the string comparison:</p> <ul> <li>"life" is &lt; "lifiee", because "e" is &lt; "i"</li> <li>"life" is > "death", because "l" is > "d"</li> </ul> <p>String comparison works letter by letter, until letters aren't equal or one string is and end. For ex...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CSS - Fade div into background image<p>Is there a way to achieve the following design with CSS?</p> <p><a href="https://i.stack.imgur.com/IUmNo.png" rel="no...
<p>Alright, I found the solution: <code>mask-image: -webkit-gradient(...)</code></p> <p>Browser support is <a href="https://caniuse.com/#feat=css-masks" rel="nofollow noreferrer">not optimal</a> though...</p> <p>Example:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="fa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PHP & HTML Alternate syntax for foreach: Undefined variable<p><strong>EDIT:</strong> I am using wamp in these examples.</p> <p>There must be something I have...
<p>You are getting only one warning each, right?</p> <p>That’s because your loops did not actually execute – since you used <code>&lt;?</code> only on your foreach statements, and if <code>short_open_tags</code> is off, that means your loop statements don’t execute at all – and so the variables are not set in the firs...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating a self incrementing function<p>Say I have two dictionary objects like:</p> <pre><code>members = {"member1" : ["PCP1", "PCP2", "PCP3"], "m...
<p>It could help a lot if you post your function, but with the infos you give I think a solution could be:</p> <p>Let's say you use the function: <code>difference_function</code> And the two dictionnaries you detailed are parameters for this function.</p> <p>Then you could just iterae over the dictionnary : <code>mem...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add a Claim to a SystemUser as a flag(bool) in C#<p>I need to add a <code>Claim</code> to be passed to the <code>front-end</code>. I want to check <co...
<p>Claims always have a string value (<a href="https://stackoverflow.com/questions/44677784/custom-claim-with-boolean-type/44677996#44677996">you can read more here</a>). There is a possibility to specify <code>valueType</code> as Boolean:</p> <pre class="lang-cs prettyprint-override"><code> context.IssuedClaims.Add(n...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: accessing other socket inside the socket.on('connection') in socket.io<p>I'm new with node.js and socket.io.</p> <p>How to access other socket inside socket...
<p>If you want some data (such as the avatar) to be available for future events after it is received, then you have to save that data somewhere in your server and save it in a way that you know which piece of data goes with which connection.</p> <p>There are a zillion ways to structure that from saving it to a propert...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i merge two arrays in one array of arrays in Javascript?<p>I have the following two arrays:</p> <pre><code>const firstArr = [1, 2, 3, 4] const secon...
<p>You could <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce" rel="nofollow noreferrer">reduce</a> to a single array</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rails: Enum query with multiple values<p>In edge API(<a href="http://edgeapi.rubyonrails.org/classes/ActiveRecord/Enum.html" rel="nofollow">http://edgeapi.ru...
<p>Here is what you want :</p> <pre><code>Conversation.where(status: Conversation.statues.values_at(:active, :archived)) </code></pre> <p>..<a href="http://edgeapi.rubyonrails.org/classes/ActiveRecord/Enum.html" rel="nofollow">The mappings</a> are exposed through a class method with the <strong>pluralized attribute n...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to input content to a cell without create a new excel document?<p>now I am working on a project using c# to built a console application, which is to add ...
<p>I get it! it is really easy.</p> <pre><code>Excel.Application xlapp = (Excel.Application)ExcelDnaUtil.Application; Excel.Workbook wbook = xlapp.ActiveWorkbook; Excel.Worksheet wsheet = wbook.ActiveSheet; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Implementing Nokia Here SDK in Android<p>I want to develop an app in android using 'here sdk' but i'm unable to find any libraries or files to include in my ...
<p>The only place I've found is here: <a href="https://github.com/haroldcalayan/SmartPlaces/find/master" rel="nofollow">https://github.com/haroldcalayan/SmartPlaces/find/master</a>. You can download the sdk files individually (here-sdk.jar and here-sdk.jar.proprties).</p> <p>However I have no idea what version of the ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to end a session in Selenium and start a new one?<p>I'm trying to quit the browser session and start a new one when I hit an exception. Normally I wouldn...
<p>You need to create the driver object again once you quite that. Initiate the driver in the <code>get_info</code> method again.</p> <p>You can replace <code>webdriver.Firefox()</code> with whatever driver you are using.</p> <pre><code>def get_info(url): browser = webdriver.Firefox() browser.get(url) try...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Tibco - Max flow limit property<p>I have a process with max flow limit enabled. The value being set at 10. Its a Asyn process and used to get thousands of me...
<p>The <code>FlowLimit</code> configuration setting is a BusinessWorks setting, so I am assuming that you have BusinessWorks engines that are consuming messages from an EMS queue.</p> <p>The concept of flow control exists in order to ensure that the number of incoming evens to a BusinessWorks engine does not cause the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Matplotlib annotation arrow with TikZ style path decoration<p>I have recently switched from making illutrations with TeX (PGF/TikZ) to using Matplotlib for t...
<p>I created this in matplotlib with the help of the <a href="https://github.com/GkAntonius/feynman" rel="nofollow noreferrer">feynman package</a> by GkAntonius (<a href="http://gkantonius.github.io/feynman/" rel="nofollow noreferrer">docs</a>). This has capabilities for neat plotting of various arrow types using verti...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add data in query which isn't in type<p>I'm working on a little personal project which export data from Rest API and expose them via Graphql.</p> <p>I got m...
<p>The parameters you are defining for your teams query do not have to be the same as your Team type attributes. This is possible: </p> <pre><code>type Team { id: ID, name: String, code: String } type Query { teams(id: ID, name: String, code: Int, competitionId: Int): [Team] } Query: { teams: (_, fil...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Improve the resolution of png generated with R<p>I created some networks through <code>R</code> and the <code>IGRAPH package</code> in <code>.png</code> file...
<p>Use <code>png</code>'s <code>res</code> parameter to adjust nominal resolution. Note that is a good idea to adjust values vor height and width accordingly in order to preserve text size etc.:</p> <pre><code>resfactor = 3 png(filename=plotname, res = 72*resfactor, height=640*resfactor, width=640*resfactor) </code></...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SSRS Subscription error "An error occurred during rendering of the report"<p>When i subscribe report with xls format it complete successfully but when i subs...
<p>This looks like a Microsoft bug, see here <a href="https://connect.microsoft.com/SQLServer/feedback/details/764556/rrrendering-error-when-rendering-larger-reports-to-xlsx-via-subscription-sql-2012" rel="nofollow noreferrer">https://connect.microsoft.com/SQLServer/feedback/details/764556/rrrendering-error-when-render...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Intermittent redirection loops during ADFS authentication<p>I am using Owin to configure my ASP.NET MVC 5 (.NET 4.5, IIS 7/8) application to authenticate aga...
<p>Do you use session data, and or TempData? I understand is it related to cookies. I too have the same issue. </p> <p>Here is some <a href="https://katanaproject.codeplex.com/workitem/197" rel="noreferrer">more information</a> and a <a href="https://stackoverflow.com/a/21234614/1043198">thorough explanation of the ca...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript - Numbers showing as NaN and object undefined<p>I am trying to make a comment generator for a program we use, and I am having an issue with number...
<p><code>totalPages</code>, <code>startPage</code> and <code>endPage</code> are the elements themselves, you have to take the <code>value</code> (if element is input) or <code>textContent</code> (if element is other than input) from them:</p> <pre><code>var totalPages = document.getElementById("totalPages").value; var...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Arduino MKRGSM 1400 crashes when connecting to MQTT<p>I have a question concerning the Arduino MKRGSM 1400 and MQTT. </p> <p>I use the code below to connect...
<p>As hashed out in the comments</p> <p>You never called the <code>connect()</code> function so the GSM network was never setup. </p> <p>You then probably need to use the GSMClient to initialise the PubSubClient so it knows how to access the network.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python Slicing NumPy Array according to feature_importances_<p>I have a set of features as a <code>NumPy</code> array. </p> <p><code>RandomForestRegressor</...
<p>If I understand correctly, what you are looking for is <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.argsort.html" rel="nofollow">argsort</a>. It will return the indices into a sorted array in increasing order. As an example:</p> <pre><code>import numpy as np from sklearn.ensemble import Random...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firebase messaging problems under iOS<p><strong>Please see new findings below</strong> </p> <p>Despite following the configuration steps in the <a href="htt...
<p>I've finally solved this issue.</p> <p>I'm running firebase_messaging 6.0.9 and Flutter 1.12.13+8, MacOS Catalina with iOS 13 on iPhone SE.</p> <p>Let's get one thing out of the way: The behavior of firebase_messaging on iOS is buggy.</p> <p>What I essentially did was:</p> <p>1) Clean the code and ensure the FCM...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to simulate bouncing ball? odeint not applicable?<p>Here is a code simulating the simplest falling ball:</p> <pre><code>%pylab from scipy.integrate impo...
<p>The simplest way is just to add a big force that kicks the particle out from the forbidden region. This requires an ODE solver that is able to handle "stiff" problems, but luckily <code>odeint</code> uses <code>lsoda</code> which automatically switches to a mode suitable for such problems.</p> <p>For example,</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: intersection of arrays in javascript<p>I have array something like this:</p> <pre><code>var array1 = [ {"name":"a","groups":["xxx","yyy"]}, ...
<p>Modern JS would be:</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>function filter(array1, array2) { // to filter array1 based on array2 return array1.filter(function(elt) { // retain an ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Delete line from 2D array in Python<p>I'm have a 585L, 2L numpy array in Python. The data is organized like in this example.</p> <pre><code>0,0 1,0 2,1 3,0 ...
<p>Since you mention your structure being a numpy array, rather than a list, I would use numpy logical indexing to select only the values you care for.</p> <pre class="lang-python prettyprint-override"><code>&gt;&gt;&gt; import numpy as np &gt;&gt;&gt; x = [[0,0], [1,0], [2,1], [3,0], [4,0], [5,1]] # Create dummy list...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to transform column values of a dataframe to another dataframe with different indexes?<p>I have two dataframes with equal number of rows.</p> <pre><code...
<p>Because of the same number of rows, you can assign numpy array:</p> <pre><code>df_a['Y'] = df_b['Text'].to_numpy() </code></pre> <p>Older pandas versions:</p> <pre><code>df_a['Y'] = df_b['Text'].values </code></pre> <hr> <p>If want to map or merge be free to use some of solution from <a href="https://stackoverf...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: error: incompatible types: <anonymous OnSuccessListener<AuthResult>> cannot be converted to OnCompleteListener<AuthResult>erro<p>Below are the code. I don't ...
<p>As Stack Trace suggested use <code>addOnSuccessListener</code> instead of <code>addOnCompleteListener</code> like below:</p> <pre><code>auth.createUserWithEmailAndPassword(edtEmail.getText().toString(),edtPassword.getText().toString()) .addOnSuccessListener(new OnSuccessListener&lt;AuthResult&gt;() { ...