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: NullReferenceException was unhandled asp.net entity framework<p>I'm new to asp.net mvc and I'm doing this exercise for myself. I created an edmx from Northwi...
<p>You are declaring in your model that it will work with the <code>IndexViewModel</code> class as:</p> <pre><code>@model aspTest.Models.IndexViewModel </code></pre> <p>but you are sending nothing to the View from Controller as : </p> <pre><code>return View(); </code></pre> <p>Try using:</p> <pre><code>return View...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: "for" loop over objects - can't get it working<p>I'm currently storing two objects of the type Target in an <code>ArrayList&lt;Target&gt;</code>. I'm then lo...
<p>You are probably having trouble understanding how loops and function calls works.</p> <p>To make it work, please restructure your code like this:</p> <pre><code>public void loopButton() { for(int i = 0; i &lt; 1000; i++) { for(int i = 0; i &lt; targets.size(); i++) { Target t = targets.get(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL query to Laravel query builder<p>I have 2 tables</p> <pre><code>risks risk_id name area_id 1 a 1 2 b 1 risk_areas ...
<p>To translate <code>WHERE IN (SELECT ... )</code>, you need to use <code>whereIn</code>.</p> <p>Also, trying to use <code>DB::table()</code> inside a subquery won't yield the result you expect.</p> <p>This:</p> <blockquote> <pre class="lang-php prettyprint-override"><code>.., function ($query) use($q) { $quer...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sublinear algorithm to find the maximum contiguous range with elements >= k in an array<p>You are given an array <code>A</code> of length <code>N</code> cont...
<p>Yes, it is possible. You can use a special data structure that can be constructed in linear time and answers a range maximum query in <code>O(1)</code>. It is rather complex, you can read about it <a href="http://community.topcoder.com/tc?module=Static&amp;d1=tutorials&amp;d2=lowestCommonAncestor" rel="nofollow">her...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: call a function include pointer<p>suppose we got a void function include pointers: <code>void order(double *smp, double *lgp)</code></p> <p>when we call the...
<p>Pointers are often confusing because when you're defining it:</p> <blockquote> <p>double *smp</p> </blockquote> <p>It means "smp is a variable that'll contain an double's address"</p> <p>But later when you do</p> <blockquote> <p>*smp</p> </blockquote> <p>It means "I want the value of the double pointed by t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: msiOpenDataBaseModes != 0 causes exception<p>I don't understand this at all.</p> <p>When I try to open an MSI file in anything else than read only mode, I g...
<p>As well as Chris's advice, I'd stay away from the entire COM-type activation because it's completely unnecessary. There is a perfectly good Win32 API that can be used via p/invoke. Here's a minimal example I used once:</p> <pre><code> public class MsiInvoke { [DllImport("msi", CharSet = CharSet.Auto)] pub...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Git commit machine details<p>Is it possible to get the the below details of commits in Git.</p> <ol> <li>Machine/Computer name used to commit ?</li> <li>IP ...
<p>No, unless you set up something like a commit hook that puts that information as part of the commit message.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AngularJS 1.0.7 in html5Mode get 404 error when refresh page<p>I know there are some posts about this topic. I have read most of them, but I think I´m not sk...
<p>So the idea is to force Nginx to point all htpp requests to index.html and let the Angular do the routing in your application.</p> <p>You didn`t post any configuration so here is the most basic:</p> <pre><code>server { listen 80; server_name foobar.com www.foobar.com; index index.html; root /var/www/mysite; l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Nested ng-repeat is not working while parsing json data from a wordpress website<p>I am developing a news app using Ionic. News is coming from a wordpress si...
<p>I believe for better solution you need to create a custom filter. that will filter out if title is matching <code>{title: 'special'}</code></p> <pre><code>app.filter('filterForTitle',function($filter){ return function(news, prop1){ var returnValue = []; angular.forEach(news,function(values,index){ v...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: gridExtra::read.tiff and missing resolution info<p>To assemble multi-panel figures I'm writing a function that uses gtable to nicely and automatedly arrange ...
<p>After more googling it appears that the observed behavior is a bug in the <code>pixmap</code> package (see e.g. <a href="http://tinyurl.com/mnldnuz" rel="nofollow">here</a> for another instance). Switching to <code>tiff::readTIFF</code> fixes the issue - resolution is reported properly. <code>rtiff::readTiff</code> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Merging the values from three tables into one<p>I have three string values that I split on a pipe deliminator and I need to merge these values into one table...
<p>You can add an identity column to your temporary tables and then create a new table using a join on this column.</p> <p>Start by adding an identity column:</p> <pre><code>DECLARE @QuestionsPrimaryTable Table (Id INT IDENTITY(1,1), QuestionsId nvarchar(max)) INSERT INTO @QuestionsPrimaryTable SELECT Item FROM Split...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Oracle 11g DB-Link connection stays open even after re-creating database link<p>I have problem with Oracle DB-Link connection (Oracle 11g). Let us consider t...
<p>From the manual on the command <a href="http://docs.oracle.com/database/121/SQLRF/statements_2015.htm#SQLRF00901" rel="nofollow">alter session close database link</a>:</p> <blockquote> <p>When you issue a statement that uses a database link, Oracle Database creates a session for you on the remote database using...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular - Defining error type to HttpClient.post()<p>Is it possible to set the <strong>type</strong> of the return error to <code>HttpClient.post()</code>? I...
<p>You can use Rxjs operators <strong>catchError</strong> and <strong>throwError</strong> to catch the error, map it into a custom object and throw this object.</p> <pre><code>import { catchError, throwError } from 'rxjs/operators'; ... ... // user.service.ts sendData(data: User) { return this.http .post&lt;User...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Perl error related to Encode.pm<p>I have the following software:</p> <p>Ubuntu Linux 14.04 LTS</p> <pre><code>$ uname -a Linux XXX 3.13.0-45-generic #74-Ub...
<p>That error occurs when you try to decode something that's already decoded.</p> <p>To expand a little, in Perl you can have byte strings and character strings. On input your data can be converted from bytes to a character string (e.g. using decode, or an IO layer). On output the character string must be converted ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular filter catching values that contain the filter.. how to make it strict if strict doesn't work (as i expect)?<p>I'm pretty new to angular so please be...
<p>You should use the true filter : it will check if values are equals</p> <p>You can see it here : <a href="https://docs.angularjs.org/api/ng/filter/filter" rel="nofollow noreferrer">https://docs.angularjs.org/api/ng/filter/filter</a></p> <p>Here's an example:</p> <pre><code>&lt;tr ng-repeat="message in messages | ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the maximum number of elements one can store in a 2-d vector or array?<p>I tried storing 2000*2000 elements in a 2d vector declared as - <code>vector...
<p>According to the language specification, the only limitation on the amount of data you can put in a <code>vector</code> or a <code>vector&lt;vector&gt;</code> is the limit on how many unique memory addresses you can point to.</p> <p>But in a real-world application, the limitation is always going to be the limit of ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: c++ Do-While, Random Words From Array For String With No Repitition<p>What I want done is to have an array of words then a string is assigned a random word f...
<p>The first loop seems fine. Maybe you need to write <code>||</code> instead of <code>&amp;&amp;</code> in the second loop. </p> <p>PS : In the first loop, is it <code>while (string2 == string1);</code> instead of <code>while (string == string1);</code> ??</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regex Version of Strip() - Automate the Boring Stuff with Python<p>I've been trying to learn how to code with Al Sweigert's book. Right now I'm stuck in maki...
<p>If there is not <code>', '</code> in user input <code>.split</code> would produce list with 1 element, you might check it at act accordingly</p> <pre><code>userinput = input('Please type text and argument using the format text, argument: ').rsplit(', ', maxsplit=1) if len(userinput) == 1: texto, argumento = use...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why I can't get the user input when &0 stream is redirected<p>Examples:</p> <pre><code>set /p= 0&gt;nul runas /user:"" "" &gt;nul 2&gt;&amp;1 0&gt;con comp ...
<p>Let's follow the <a href="http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx" rel="nofollow">MS documentacion</a>.</p> <p>We have handle duplication </p> <pre><code>2&gt;&amp;1 : Take the handle in the stream 1, duplicate it and place the copy as t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I bind a value to a web component's attribute using Angular?<p>Let me preface this by saying that I've never really used Angular before. I'm trying to...
<p>To bind to attributes, you need to use the <code>[attr.*]</code> binding, otherwise you are binding to properties of the element, or <code>@Input()</code> of the custom element/component. In your example this would look like:</p> <pre><code>&lt;hello-world name="{{ name }}" [attr.enabled]="enabled"&gt;&lt;/hello-wo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ImportError No module named localflavor.us.forms in Django 1.7<p>I recently upgraded to Django 1.7.4 and had to change the deprecated localflavor import.</p>...
<p><code>localflavor</code> is now a third party app (as your import shows).</p> <p>You must install it: <a href="https://github.com/django/django-localflavor" rel="noreferrer">https://github.com/django/django-localflavor</a></p> <p><code>pip install django-localflavor</code></p> <p><a href="https://django-localflav...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MySql LEFT JOIN returns wrong first in PHP page, but correct results in MYSQL command line<p>We added two columns to our main MySQL table (named objects), a ...
<p>You have two columns called <code>name</code>. The second will overwrite the first.</p> <p>You should alias them to have distinct names. <code>select `o`.`name` as `o_name` ...</code></p> <p>In your case, the reason why only the first row is affected is because you use <code>fetch_assoc</code> to get that, but the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Command "doctrine:generate:entities" is not defined<p>I encounter a problem with Symfony and the Doctrine entities generator.</p> <p>When I call <code>php a...
<p>Ok I found the solution to my problem so I post the answer here hopping that it might help somebody one day :)</p> <p>The command <code>doctrine:generate:entities</code> is provided by the file <code>DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php</code> (<a href="https://github.com/doctrine/DoctrineBund...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Saving Relational Parse Object<p>Consider I have a parse object A and is related to object B. I want to save the object A.</p> <p>So I create an instance of...
<p>Lets take an example here. Suppose you have a <strong>Post</strong> object, and you have a <strong>Comment</strong> object. You can think of two types of relations here. You can put the comment object to the post object like the following.</p> <pre><code>postObject.add(commentObject); // See add() is used because t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Selecting multiple class names from 'this' object?<p>I'm trying to find a way to get all the class names from an object when I hover on it. Then, after getti...
<p>Here's one approach. You get the class name list, split them and take the last one. Then add/remove a class as you hover</p> <pre><code>var item; $('.cell').hover(function () { item = '.'+$(this).attr('class').split(' ').pop(); $(item).addClass("bordered"); }, function () { $(item).removeClass("bordered...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AngularJS select with ng-options not updating referenced object property in the parent scope<p>My select is populating with the contents of the model, but wh...
<p>Part of the issue is you are trying to set a click event on the tbody, you need to set the ng-click on the row (tr). </p> <p>Secondly, unless it is needed for another reason, I wouldn't duplicate the values from the "selectedTask" into a "newTaskStatus" when you are planning on changing the status and sending back...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JavaScript: how can I, on click, change the text of my item?<p>I'm learning the JavaScript language and I'd like to reproduce something. I have a text called...
<pre><code> $(document).on("click", "#slideshow-pause-icon, #slideshow-play-icon", function(){ $(this).html()=="Play"?$(this).html("Pause"):$(this).html("Play"); this.id= (this.id=="slideshow-pause-icon"?"slideshow-play-icon":"slideshow-pause-icon"); this.title = (this.title=="Click to pause"?"...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to implement upload component with one upload button in Vaadin?<p>I have the following class that implements the single Upload example</p> <pre><code>@O...
<p><code>Button.setImmediate(true)</code> is used to start upload after file selection (without button click). But you still need to hide the button with CSS.</p> <p>Quote from <a href="https://vaadin.com/book/-/page/components.upload.html" rel="nofollow">Book of Vaadin 5.25 Upload</a>:</p> <blockquote> <p>You can ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: QueryDSL difference between explicit join and where clause?<p>Say you have a QueryDSL query as follows:</p> <pre><code>JPQLQuery query = new JPAQuery(em); Q...
<p>For the record, the implicit joins in the where clauses perform inner join. <a href="https://groups.google.com/d/msg/querydsl/GwIspXSNHLw/U7RfY-daXjEJ" rel="nofollow">According to the QueryDSL forum</a>, you'd use the explicit joins when you want to reuse joins or use other join types beside inner join. Otherwise, y...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: iOS Loading view upon app launch<p>for my app i want the app to animate loading progress (loading local CoreData, and syncing with game center) before enteri...
<p>I would suggest you create an initial root view which is very simple with a background and present your progress using a HUD. I use this one:</p> <p><a href="https://github.com/jdg/MBProgressHUD" rel="nofollow">https://github.com/jdg/MBProgressHUD</a></p> <p>When you have initialised everything, drop the HUD and r...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to send mail with multiple attachments in java<p>I have here can send mail with multiple attachment:</p> <pre><code>Properties props = System.getPropert...
<p>Create a simple method called, something like, <code>attachFile</code>, which takes a <code>File</code>, <code>Multipart</code> and <code>MimeBodyPart</code> as parameters...</p> <pre><code>public void attachFile(File file, Multipart multipart, MimeBodyPart messageBodyPart) { DataSource source = new FileDataSou...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NullPointerException when object is initialized in another method<p>I was trying to learn about binary trees and <code>NullPointerException</code>were coming...
<p>The root cause is that in Java arguments are passed by value, which means, when you pass a (reference to) node <code>n</code> as an argument, you're actually passing a copy of the reference to that node, which is <code>null</code> at that time. Since you're changing the copy-reference, nothing is really assigned and...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Compiling my Java program to intall on Mac<p>I've written my program. It works as I want it to. I want to distribute it to Windows, Linux, and Mac users, not...
<p>Start with <a href="http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/packagingAppsForMac.html" rel="nofollow noreferrer">Packaging a Java App for Distribution on a Mac</a> and <a href="https://java.net/projects/appbundler" rel="nofollow noreferrer">Java Application Bundler</a>. This will allow you to pack...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kubernetes: PersistentVolumeClaim error, Forbidden: is immutable after creation except resources.requests for bound claims<p>I have created a StorageClass an...
<p>Solved in comments, deleting a namespaced object (which is most of them) requires specifying the namespace.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to override TouchUpInside event in CustomButton class?<p>I have a custom button:</p> <pre><code>public class CustomButton : UIButton { public void H...
<p>Will it work for you?</p> <pre><code>public class CustomButton : UIButton { public CustomButton() { TouchUpInside += HandleTouchUpInside; // or new EventHandler(HandleTouchUpInside) // if Xamarin compiler/runtime doesn't allow such shorter code } public void HandleTouchUpIn...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spark w/ Scala way of using multiple heterogeneous columns in a UDF<p>Say I have a dataframe with multiple columns of possibly various types. I need to write...
<p>here an example UDF: </p> <pre><code>val udf_doComputation = udf((c:Double, a1:Seq[Int],a2:Seq[Int],t1:Double) =&gt; { // your complex computation goes here (c*a1.sum+a2.sum).toString() + t1.toString() }) dataframe .withColumn("result",udf_doComputation($"c",$"a1",$"a2",$"t1")) .show() </cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I change the value of cells in a given column when selecting multiple rows?<p>I want to be able to select multiple rows in a datatable and then if th...
<p>What I get from your question is, you want to select multiple cells and then start typing and you expect all the selected cell values change:</p> <p><a href="https://i.stack.imgur.com/43RkU.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/43RkU.gif" alt="enter image description here"></a></p> <p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why the bootstrap styles are not applied even after the style css file is included?<p>I have linked the bootstrap css and js files in to my index.html. But t...
<p>It looks you link and format is kind of perfect with the exception of the button tag which should be "class btn btn-primary". Now I presume you are working on Ubuntu.I think you have forgotten to give permissions to the css files which are in that folder. Set the folder permissions like "chmod -R 777 foldername" ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to re-order polynomial term factors from sage output<p>I have </p> <pre><code> x,y, dx, dy= var("x, y, dx, dy"); def iD(f): return diff(f, x)*dx + diff...
<p>You might find <a href="http://www.sagemath.org/doc/reference/tensor/sage/tensor/differential_form_element.html" rel="nofollow">differential forms</a> more useful here. You'll note that you just have <code>dx</code> as a variable, which is ahead of both <code>x</code> and <code>y</code> in alphabetical order.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How Angular packages are build<p>What are the different files generated by the Angular build? I notice there are 6 of them:</p> <ul> <li><code>main.js</code>...
<p>You can read more about this on this <a href="https://upgradetoangular.com/angular-news/the-angular-cli-is-a-great-way-to-build-your-angular-app-but-what-it-does-can-be-a-mystery-what-are-those-files-it-generates/" rel="noreferrer">page</a></p> <p>In the last versions there is a <a href="https://blog.angular.io/ver...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Nintex .NET Framework RegEx Extract<p>I'm using Nintex Workflows and running into an issue trying to extract a alphanumeric value after the word <code>number...
<p>You could try the below regex,</p> <pre><code>(?s)^.*?number:\s([a-zA-Z0-9]+) </code></pre> <p>And get the string you want from group index 1. In <a href="http://www.regular-expressions.info/modifiers.html" rel="nofollow"> <code>(?s)</code> dotall mode</a>, <code>^</code> matches the start of first line only.</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Node.js subdomain not working?<p>I am not sure what I am doing wrong, I am trying to do requests from a virtual subdomain using <code>npm subdomain</code>. I...
<p>So I see they pass in the <em>require subdomain</em> into app.use, followed by the params. If I reformat their example to look more like your code:</p> <blockquote> <p>app.use(require('subdomain')({base: 'yourdomain.com'}));</p> </blockquote> <p>Note they don't pass in anything to the require subdomain. Instead ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Set margins with Apache poi<p>Using Apache poi to create a basic word document, I need to change the page margins. <a href="https://stackoverflow.com/questio...
<p>Thanks to Gagravarr for pointing me in the right direction. Seems I didn't have the full ooxml-schemas-1.1.jar. This code now sets the margins perfectly</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> CTSectPr ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Memory map shows space allocated to mystery variables _powers_ and _npowers_<p>I've been looking at the memory map for my code (written in c and compiled by ...
<p>You would have to look at the source for the version of libc to get a categorical answer. I did look at the source for one and found that, in that implementation, dpowers was a table of constants (powers of 10) used for output (doprnt). I suspect the others are similar.</p> <p>Note - while constants, these are no...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Accessing data from an API instead of a Json file<p>I'm trying to access data from an API endpoint instead of a Json file but I'm having issues accessing the...
<p>I would expect your service method that makes the api call to look something like this:</p> <pre><code>getData(): Observable&lt;Option[]&gt; { return this.http.get('some url').pipe(pluck('data')); } </code></pre> <p>Where Option looks like</p> <pre><code>export interface Option { id: number; name: string; }...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Connect to Cloudant via Excel Macro<p>I want to connect to a Cloudant database from an Excel Macro that I have written. The macro would essentially need to f...
<p>In case anyone else ever searches for this, I figured I would upload an actual response to this question (nearly a month later) rather than just a "yes, this is possible".</p> <p>Since Cloudant requires Basic Auth, the way that I have found to do this is below:</p> <pre><code>Set objHTTP = CreateObject("MSXML2.Ser...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JavaScript, variables scope, order of variable evaluation<p>I'm testing some angularjs app using protractor and have encountered such a problem:</p> <pre><c...
<p>Only one function can run at a time in JavaScript (that's simplifying a little, there are exceptions).</p> <p>The main function runs all the way through before anything else happens. Since that function includes <code>console.log(counter);</code>, it logs the value of <code>counter</code> <strong>at that time</stro...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What makes bare-metal tool chains special?<p>Why do I need a bare-metal toolchain when I want to compile a binary without the underlying OS? What restriction...
<p>Replace bare-metal with freestanding, no such thing as a bare-metal compiler.</p> <p>You don't need a freestanding compiler for bare-metal work. But then you need to use exactly the right combination of options to make a normal (cross-)compiler work as freestanding compiler. With gcc/clang that is certainly possibl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get the Biggest (int) Input From a Loop and Print it<p>I want to know how to get the biggest 'int(input) from the user in a loop. For example:</p> <pre><co...
<p>Keep track of the numbers the users enters, after the loop, pick the highest one using the <code>max</code> function.</p> <pre><code>def main(): numbers = [] times = int(input('How many times will you do this: ')) for i in range(times): num = int(input('Enter a number: ')) numbers.append...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to include service automatically using Node and Express.js<p>My ./controller/index.js look like below</p> <pre><code>module.exports = function(app) { ...
<p>You can create an index.js file in the controller folder that does the following:</p> <p><strong>./controllers/index.js</strong></p> <pre><code>'use strict'; var fs = require('fs'), path = require('path'); //load all routes in dir module.exports = function (server) { fs .readdirSync(__dirname) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React Hooks stale state inside function<p>I have something like this</p> <pre><code> const [state, setState] = useState({ num: 0 }); const validat...
<p>The solution to your problem is to not use <code>useState</code> for the function object.</p> <pre><code>const validation = { val: validateBiggerThan0 }; </code></pre> <p>Or to update the object on every change of your state:</p> <pre><code>useEffect(() =&gt; { setValidation({ val: validateBiggerThan0 }...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter initState() not retrieving data immediately, need to do hot reload to view it<pre><code>class _SelectMedChallengeState extends State&lt;SelectMedChal...
<p>If <code>DatabaseService().getCategoryList()</code> is a Future or Stream, then you're not waiting for a response, you're trying to get it immediately over your initState.</p> <p>Move your method inside a function using the <code>async</code> keyword or simply add:</p> <p><code>.then((result) =&gt; // your login)<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get JPanel to fill parent JFrame<p>I am trying to draw a circle in the center of a window, and I can't seem to get it right, should be really easy! My...
<p>The problem is that you're overriding <code>getX()</code> and <code>getY()</code>. Rename those to something else, and your code will work as expected. Also, it's a good idea to turn on compiler warnings for missing <code>@Override</code> annotations, and heed those warnings. (That would have notified the methods ov...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: write a shell script to search a complex string in a file as well as with the number of occurrences of it<p>i want to search<br> <code>at java.lang.Object.w...
<p>When you find an <code>at</code> at the start of the line add to your count and stop counting until you see a line that does not start with at.</p> <pre><code>awk 'BEGIN {count=0; boolCount=0}; /^at/ {if (boolCount==0) count++; boolCount=1}; !/^at/ {boolCount=0}; END {print "Found: " count} ' logfile </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jquery onclick method is not working properly<p>I'm trying to make a search form. I want it to be like when I click in the search form opener button, the sea...
<p>Simple way is to use <code>addClass()</code> and <code>removeClass()</code> functions instead of using <code>.css</code> Then for if statement you can use <code>if($(selector).hasClass())</code> </p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Display Kendo Tooltip only on F2 keypress event<p>I have a kendo grid with datas. I make the kendo grid selectable by row. Before I used kendo tooltip to dis...
<p>Change kendo <code>showOn</code> property on <code>'focus'</code> then use this code to show tootlip after F2 is pressed:</p> <pre><code>$("body").keydown(function (e) { if(e.key === "F2"){ var $grid = $("#grid"); $grid.data('kendoTooltip').show($grid.find('.k-state-selected')); } }); </code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Haskell strategies for speculative execution of conditionals / Alternative<p>I wonder which parallel strategy, spark, or whatever, can be used for speculativ...
<p>If we can countenance abandoning the world of pure parallel computations, we can turn to the <a href="http://hackage.haskell.org/package/async" rel="nofollow noreferrer">async</a> package, which allows cancellation of asynchronous tasks.</p> <p>For example, here's an speculative "if" that allows conditions that tak...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to post data to my API from a react form<p>I want to post data to my API from this form. But unfortunately, there is a Server error. Could anybody tel...
<p>A 500 error code is a server-side error. Thus you should be debugging your API code, not your react code to get to the bottom of the problem.</p> <p>With that said, the error message indicates a CORS error. If you are not familiar with <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS" rel="nofollow...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: VIM arrow keys with sudo<p>I have identical <code>.bashrc</code> and <code>.bash_profile</code> files. When I <code>sudo vim &lt;file&gt;</code> in insert mo...
<p>When you do <code>sudo vim &lt;file&gt;</code> you are running vim as the sudo user, so your users <code>.vimrc</code> is not being loaded, and the sudo user does not have a <code>.vimrc</code> of its own. You should see the same behavior with <code>vim -u NONE</code>. </p> <p>The solution is to do the following:</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to move between backlog items without going back to list in Azure devops?<p>If I'm going through a list of work items (backlog) in Azure DevOps (TFS) usi...
<p>According to your descriptions, what you are looking for seems to be buttons like "→" and "←" to quick move forward next or backward previous work item in the backlog list.</p> <p><strong>This is not available</strong> at the moment. However, as a workaround you could <strong>use query</strong> to list your backlo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert Java Date object to Matlab datetime array with time zone<p>I use a program that returns data whose timestamp is in <a href="https://docs.oracl...
<p>The <code>getTime</code> method of <code>java.util.Date</code> <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Date.html#getTime--" rel="nofollow noreferrer">returns the milliseconds in GMT</a>, but the <code>datenum</code> constructor takes milliseconds in local time. You need to convert to a GMT time ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how can i change the column order over the input or tkinter entry boxes?<p>I am searching for a way to change the columns of a dataframe via the input in the...
<p>Is the reason this example fails to work because it doesn't process multiple columns? If so, one way to do it is to force the end user to delimit their input with a character string. For example, if the user wanted columns a, b, and c, they might input</p> <pre><code>a, b, c </code></pre> <p>Where ', ' is the deli...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RGB values from getImageData are undefined<p>I want to click on an image and get the RGB values for that pixel.</p> <p>Here is my code:</p> <pre><code>&lt;...
<p><a href="https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D.getImageData" rel="nofollow"><code>getImageData</code></a> returns an <a href="https://developer.mozilla.org/en-US/docs/Web/API/ImageData" rel="nofollow"><code>ImageData</code></a> object, whose <code>data</code> property is the array...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Having <activity-alias> breaks a contract of singleTop mode<p>Here's the problem. I have an &lt;activity-alias> in my manifest defined as follows:</p> <pre>...
<p>Instead of referencing your <code>HomeActivity</code> in the classes that are launching it, you'll need to alter those intents to start "<code>MainActivity</code>" instead.</p> <p>EX:</p> <pre><code>Intent intent = new Intent(); intent.setClassName(mContext, "ru.treto.tile.MainActivity"); </code></pre> <p>Alterna...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Graph Anomalies Stacked Area Chart ggplot2<p>I'm trying to create a stacked area chart of negative and positive values showing the composition of the long an...
<p>I solved this by creating the long and short graphs separately and then setting all the negative values to 0 in the long data set and vice versa in the short data set. So, I just modified the code with this.</p> <pre><code>sectorMelt &lt;- melt(exampleData, id = 'date') longSector &lt;- sectorMelt shortSector &lt;-...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change twitter banner from url<p>How would I go by changing the twitter banner using an image from url using tweepy library: <a href="https://github.com/twee...
<p>Looking at library's code you can do what you want.</p> <pre><code>def update_profile_banner(self, filename, *args, **kargs): f = kargs.pop('file', None) </code></pre> <p>So what you need to do is supply the filename and the file kwarg:</p> <pre><code>filename = url.split('/')[-1] self.api.update_profile_bann...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to retrieve objectID from PFUser username query?<p>I ask the user to input their username. I then search the User class in Parse for their "account" and ...
<p><code>user</code>is an array here, try <code>println (user[0].objectId)</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SeekToCurrentBatchErrorHandler support for dead DLQ<p>Currently we use SeekToCurrentErrorHandler and publishing failed records to dead letter topic using Dea...
<p>There cannot be support for this because the framework doesn't know which record in the batch failed; all it could do is send the whole batch to the DLT which is not really what (most) people would want.</p> <p>Errors within a batch must be handled within the listener itself.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to outline the div tag?<p>I try to outline the div tag. I used <code>border:0.01em solid black</code> but it is not correctly fit. My script below</p> <...
<p>Under the standard box-model padding and borders are <strong>added</strong> to any defined width.</p> <p>If you set the box-sizing to <code>border-box</code> then the declared width will <strong>include</strong> any padding &amp; borders.</p> <p>It's often seen as part of a Universal Selector:</p> <p><div class="...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to extract specific substring from getline function in C++?<p>I'm fairly new to C++ so please forgive me if my terminology or methodology isn't correct. ...
<p>So, based on what we discussed in the comments, you just need to toss the stuff you don't want. So try this:</p> <pre><code>string namesel; string nameicd; string junk; while(!infileicd.eof()){ // Get the first section, which we'll ignore getline(infileicd, junk, ' '); getline(infilesel, junk, ' '); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Two onActivityResult conflict android<p>I have two activities, <code>TakePictureActivity</code> and <code>ChoosePicActivity</code>, and they both lead to <co...
<p>The problem was caused by <code>DecidePicActivity.choosepic</code> and <code>DecidePicActivity.takepic</code>.</p> <p>Previously, <code>DecidePicActivity</code> activity was like this:</p> <pre><code>public class DecidePicActivity extends Activity implements OnClickListener{ static boolean takepic = false; static ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fatal error (use theme.appcompat), even though I am using the AppCompat theme<p>I've recently upgraded my application to a material theme. However, I'm encou...
<p>From my experience, this could be 1 of 2 things (based on the samples you've provided):</p> <ol> <li>When I switched to appcompat, I had this issue a lot, until I found this line on the Android Developers Blog regarding the release of the appcompat support lib You can see the blog post <a href="http://android-devel...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I implement Azure Search Service in Sitefinity?<p>Does any know of any examples out there that show how to implement ISearchService using Azure search...
<p>Sitefinity supports Azure search out of the box. And you don't need to implement your own <code>ISearchService</code>.</p> <p>This is official documentation how to connect your Sitefintiy to Azure search service: <a href="https://www.progress.com/documentation/sitefinity-cms/generate-and-store-search-indexes-in-the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error 2002 Connection refused on phpmyadmin using Ubuntu and XAMPP<p>I just setup Ubuntu KDE on my chromebook and installed XAMPP, as I started the service u...
<p>Apparently what I did wrong was giving my user access to the /opt folder which contains mysql without knowing that I am preventing the access from the root, and mysql needs root access.</p> <p>If you're facing the same issue try this:</p> <pre><code>sudo chmod 755 /opt/lampp/etc/my.cnf sudo chmod -R 777 /opt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot read from TCP socket<p>I have a C++ client using QT and a JAVA server and I have successfully written from the client to the server but I cannot write...
<p>The <code>QTextStream::readAll</code> function attempts to read the <em>entire</em> contents of the stream. Either this message is or isn't the entire contents of the stream.</p> <p>If this message isn't the entire contents of the stream, then it should not return. It would be a serious error if <code>readAll</code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use Gradle Java Api 6.1.1<p>I am really confuse on how to use the gradle Java API. I am afraid that my confusion is at the fundamentals of what is thi...
<blockquote> <p>Basically what I thought I could do with this API was to create a Project object from a build.gradle file and then navigate it programatically through java code to inspect Tasks, Dependencies and so on.</p> </blockquote> <p>The <strong><em>public</em></strong> Gradle API is designed for interacting w...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Turn an ascii character code to a value between 0-26<p>Hello everyone today I have a question concerning the math involved in turning ascii code into a value...
<p>The following code should work in C and C++:</p> <pre><code>int codeFor(char ch) { if (ch &gt;= 'A' &amp;&amp; ch &lt;= 'Z') { return ch - 'A'; } else if (ch &gt;= 'a' &amp;&amp; ch &lt;= 'z') { return ch - 'a'; } else { /* do something to report an error. */ } } </code></pre> <p>Noti...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to prevent to close dialog when a user input error information and click "Save" button in Android<p>I have setup a custom Preference that must launch a d...
<p>Use this inside your <code>DialogPreference</code> : </p> <pre><code>@Override public void onClick(DialogInterface dialog, int which) { // If the user clicked "Ok" but the "savePassword" function returns false (mainly because the checks weren't good), we block the closing of the Dialog if (which == DialogIn...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Previous (business) dates pandas<p>I have a <code>pandas.core.series.Series</code> of specific dates (non-consecutive) which looks like the following: </p> ...
<h3><a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.tseries.offsets.BusinessDay.html" rel="nofollow noreferrer"><code>pd.offsets.BusinessDay</code></a></h3> <p>When you consider a Business Day to be Monday - Friday</p> <pre><code>df['prev_bd'] = df['Date'] - pd.offsets.BusinessDay(n=1) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to assign a numerical code to a string based on a set of keywords in R<p>For example, I have an array of data in which some text descriptions are given a...
<p>Data</p> <pre><code>data &lt;- c("Big Pool House", "1 Store Warehouse", "Multiple Storage Pool") </code></pre> <p>First define the keywords to search in the data and the corresponding codes</p> <pre><code>tags &lt;- c("Storage", "Pool", "Warehouse") ids &lt;- c(102, 101, 103) </code></pre> <p>Then use</p> <pre>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Running code and get segmentation fault error<pre><code>int main(){ int size; cout &lt;&lt; "How many vertices? \n"; cin &gt;&gt; size; whi...
<p>When you declare local (non-static) variables, they will not be initialized and their values will be<em>indeterminate</em> (in reality they will be seemingly random). Using such a variable except to initialize it will lead to <a href="http://en.wikipedia.org/wiki/Undefined_behavior" rel="nofollow"><em>undefined beha...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add Time from TimeSpan Object in Powershell<p>This has been driving me nuts, and it's got to be something simple I'm missing.</p> <p>I'm simply trying to get...
<p><code>TotalHours</code> includes fractional hours. The value of <code>$hours</code> will be something like <code>844.1311....</code>. The value of <code>TotalHours</code> is basically:</p> <pre><code>$ts = New-TimeSpan -Start $mytime $ts.Ticks / [TimeSpan]::TicksPerHour </code></pre> <p>If you want the integer val...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Request.UrlReferrer is easily bypassed and not reliable to use as guard?<p>I was trying to make a guard for some action so it is not accessible unless the re...
<p>UrlReferrer is not safe to use for authorization. Any browser or client can decide to set the referrer url to whatever they want. Additionally some browsers block refuse respecting this header (though that's mostly only true between different domains) for privacy reasons.</p> <p>There's the Authorize annotation spe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: "rel" attribute or "aria-attribute" to link a button to relative div?<p>I'm asking for a suggestion more than for a real problem. I would like to use the mor...
<p>The <code>button</code> element can’t have a <code>rel</code> attribute (as you can <a href="https://stackoverflow.com/a/14851121/1591669">easily check yourself</a>), and WAI-ARIA <a href="http://www.w3.org/TR/2014/REC-wai-aria-20140320/appendices#quickref" rel="nofollow noreferrer">does not</a> define an <code>aria...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to wrap @Html.DisplayFor() with @Html.ActionLink()<p>I just need to wrap column into hyperlink. So that a user can click on item of Number Column and can...
<p>You can't really, but you <em>can</em> just use <code>Url.Action</code> instead:</p> <pre><code>&lt;a href="@Url.Action("Read", new { id = item.id })"&gt; @Html.DisplayFor(modelItem =&gt; item.Number) &lt;/a&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I use set fragment inside my class which extends the Fragment class?<p>Null returned from <code>((MessageTextFragment)fragment).setActionButtonStateL...
<p>If <code>((MessageTextFragment)fragment).setActionButtonStateListener(bAction);</code> is line <strong>219</strong>, then you need to make sure that <code>MessageTextFragment</code> was added by the <code>FragmentManager</code> with the <code>id</code> of <code>sms_message</code> and was done before you called it.</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to format float in C without most significant digits?<p>I wanna output data look like this</p> <pre><code>input : 1999.99 output: 999.99 </code></pre> ...
<p>Truncating <em>extra</em> high order digits as requested can be obtained using the <code>fmod()</code> function:</p> <pre class="lang-c prettyprint-override"><code>#include &lt;math.h&gt; #include &lt;stdio.h&gt; void format_3_2(double input) { printf("%.2f", fmod(input, 1000.0)); } </code></pre> <p>input: <c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: WebGl adding multiple objects to one canvas<p>This is my first experiment in WebGL: I am trying to add a cube, octahedron and tetrahedron to a single canvas....
<p>You need to setup the program, then attributes and uniforms for each model before you draw it.</p> <pre><code>use program for cube set attributes for cube set uniforms for cube draw cube use program for tetrahedon set attributes for tetrahedon set uniforms for tetrahedon draw tetrahedon use program for sphere set...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AttributeError: 'MuParser' object has no attribute 'startRule'<p>So I copied this code from an <a href="https://stackoverflow.com/questions/15610183/if-else-...
<p>As already mentioned in the comments, <code>startRule</code> should be replaced with <code>parse</code> in your case. This method corresponds to the following parser rule in the grammar:</p> <pre><code>parse : block EOF ; </code></pre> <p>Every rule in the grammar translates to a method/function you can call. Yo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How should an ask timeout be handled by the askee? Is it even possible?<p>Suppose I have some client code that uses akka's <code>ask</code> pattern on an act...
<h2>The problem</h2> <p>So you need a mecanism to stop a long running computation taking place in the askee, whether or not the asker timed out.</p> <h2>A solution</h2> <p>First of all, only the askee knows how to deal with its own computation. Therefore, it is the only one who can gracefully stop it.</p> <p>A comm...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Win32 API SendMessage with HWND_BROADCAST<p>I am trying to send a message using myresult=SendMessage(hWnd,...). As I understand it, SendMessage sends a Windo...
<p>The return value will be that from whatever is the last of the receiving windows to process the message and return; which window this is is difficult (if not impossible) for the sending application to determine. </p> <p>Generally, when you want to use <code>HWND_BROADCAST</code> to notify multiple windows (or to co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Azure DevOps pipeline building Makefile<p>I'm trying to set up an Azure DevOps build pipeline for CI of a C project that is built using gnu make that eventua...
<p>Command Line Script task just runs the provided script as a shell script and checks its exit code (non-zero means error). The thing is that the exit code of a script is the exit code of last statement and by default (unless <code>-e</code> option is given) the shell will proceed regardless of errors, i.e.:</p> <h3>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to filter a certain object property value with angular select box<p>I would like to filter out a object that has a property value of <code>"None"</code>....
<p>You don't need to use angular-ui's <code>unique</code> filter here - its purpose is something else. </p> <p>If you just need to filter out based on a certain property, you could specify the filter expression like so (notice the <code>!</code>):</p> <pre><code>ng-options = '...in counterPsList | filter: { CounterPa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PowerBI: SAMEPERIODLASTYEAR function not working<p>I am getting the following error message when I write the below code: Value for 'Total Sales'cannot is det...
<p>Written in this way your formula is not referencing a measure, not a column, also you will need an expression inside calculate.</p> <pre><code>-- This reference a Measure, which in your case is not defined LYSales = CALCULATE([Total Sales],SAMEPERIODLASTYEAR('Date'[Date])) -- you can create it with this formula Tot...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check if in string are number after number?<p>I have string 123aSdfghjk. How can i check if in string number after number. I want to create function who ret...
<p>You can try with <em>RegEx</em> checking whether the string starts with number or not:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>function checkString(str){ return /...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Simple guessing game continuing with any other letter other than the declared variable Y/N<p>I am a aspiring developer and I am just learning my first langua...
<p>You have an accidental semicolon after that if statement and before your break.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I break out segments of a 'PHP' file into raw PHP, -and- possible raw HTML -in order-<p>So I've got a concept of how to do this - but actually implem...
<pre><code>&lt;?php $str = file_get_contents('filename.php'); // get values from starting characters $php_full = array_filter(explode('&lt;?php', $str)); $php = array_filter(explode('&lt;?', $str)); $html = array_filter(explode('?&gt;', $str)); // remove values after last expected characters ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Border-left in menu messing with layout<p>I'm having a hell of problem with a "simple thing". When i add a border-left to the menu, it pushes the same number...
<p>It would really help if you would post the actual code. The only thing I can think of without seeing is to try implementing border-box in your CSS.</p> <pre><code>html { box-sizing: border-box; } *, *:before, *:after { box-sizing: inherit; } </code></pre> <p>This helps to maintain a border inside a box without...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Merge list of dictionaries by certain key and append distinct values to list<p>Given a list of dictionaries:</p> <pre><code>list_of_dicts = [ {"docId": ...
<p>You can use <code>groupby</code> from the <code>itertools</code> module.</p> <pre><code>from itertools import groupby # Group by docId and attr1 def f(d): return d['docId'], d['attr1'] # x is a docId # y is an attr1 # z is an iterator of elements from list_of_dicts that have the same # docId and attr1 value....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to perform a random parameter MC scan in python?<p>I have to perform a Monte-Carlo scan over the parameters suppose x, y, z in the range x->(4, 8), y->(-...
<p>Since Monte Carlo is just throwing numbers at the function and seeing what sticks, this is just something like this in vanilla Python.</p> <pre class="lang-py prettyprint-override"><code>import random def fun(x, y, z): return (x * y) + z trials = [] for i in range(4000): x = random.uniform(4, 8) y = ...