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: How to Tokenize String with Commas and Line Delimiter<p>I'm making a simple String Tokenizer in Swift like I would in Java...but it's really not working out ...
<p>This extends Syed's componentsSeperatedByString answer but with Swift's map to create the requested Nx2 matrix.</p> <pre><code>let tokenizedString = "string 1, string 2, string 3, ^, string a, string b, string c, ^" let lines = tokenizedString.componentsSeparatedByString("^, ") let tokens = lines.map { (var lin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cancelling a DisplaySettingsChanged Event<p>I have some trouble with the DisplaySettingsChanged event. I want to cancel it when it tries to rotate the screen...
<p>Without knowing which platform you are targetting it is difficult to help, but have you had a look at this if you're developing for Windows 8\ Windows Phone 8.</p> <p><a href="https://msdn.microsoft.com/en-us/library/windows/apps/windows.graphics.display.displayproperties.autorotationpreferences" rel="nofollow">htt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bottom Navigation View Is Shown Incorrectly<p>I have some full-screen activities in my app which have bottom navigation view at the bottom. When the app has ...
<p>I ran and checked your code. Just remove the "View.SYSTEM_UI_FLAG_LAYOUT_STABLE" flag while hiding the navigation bar. It will solve your problem! And I hope you would understand why removing this specific flag solves your problem :)</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dataloader caches across context creations (graphQl ApolloServer)<p>I have integrated DataLoaders into my graphQL requests, but for some reason the cache is ...
<p>You only call the <code>DataLoader</code> constructor once and then export the resulting DataLoader instance as a constant. Even though your context function is called on each request, it uses the imported value, which is always the same DataLoader instance. Change your export so that it is a function:</p> <pre><co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Open activity after click in notification in alarmmanager and broadcast Kotlin<p>I set on my application the notification every 7 hours in this way: </p> <p...
<p>All you need is to add <code>.setContentIntent</code> in your notification builder.</p> <pre><code>// Create the notification to be shown val mBuilder = NotificationCompat.Builder(context!!, "AlarmId") .setSmallIcon(R.mipmap.ic_food) .setContentTitle("Synchronize Fitbit") ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to calculate top 3 results<p>I have a table with multiple columns such as</p> <pre><code>RacerID | Round1 | Round2 | Round3 | Round4 | Total 2 ...
<p>may be this:</p> <pre><code>SELECT RacerID , round1 + round2 + round3 + round4 - LEAST(round1, round2, round3, round4) AS Top3Rounds FROM tablename </code></pre> <p>Fiddle example <a href="http://www.sqlfiddle.com/#!2/546f5/7" rel="noreferrer"><strong>here</strong></a>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I rotate an image from a file with Xamarin on iOS<p>I have been trying to rotate an image for a couple days now, but the best I get is still a black i...
<p>It looks like you want to take a <code>UIImage</code>, and then rotate it either 90 clockwise or 90 degrees counter clockwise. You can actually do this with just a few lines of code:</p> <pre><code>public void RotateImage(ref UIImage imageToRotate, bool isCCW) { var imageRotation = isCCW ? UIImageOrientation.Ri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to extract base64 src from a video using just Javascript?<p>With we have a mp4 file how can we create a base64 src from it using just javascript?</p> <p...
<p>This is probably an answer, but I didn't tested yet: (MooTools)</p> <p><a href="http://jsfiddle.net/eliseosoto/JHQnk/" rel="nofollow">http://jsfiddle.net/eliseosoto/JHQnk/</a></p> <pre><code>&lt;div&gt; &lt;div&gt; &lt;label for="filePicker"&gt;Choose or drag a file:&lt;/label&gt;&lt;br&gt; &lt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Standard deviation of a discrete Gaussian filter<p>I created a Gaussian filter in MATLAB as shown below:</p> <pre><code> f = fspecial('gaussian', [1, 3], 2)...
<p>Your <code>f</code> is a sampling of the normal distribution. Its values are not normally distributed. Its 2nd order spatial central moment should be 4 (square of sigma value), but the standard deviation of the samples will not. (Contrast sampling the distribution itself to sampling random values with a given distri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to have a branch of code conditionally be compiled in C++?<p>Title says it all really. Sample code which illustrates the spirit of the affaire...
<p>Tag dispatch.</p> <pre><code>template&lt;class T&gt; bool foo_impl(std::true_type){ unsigned long identity = collection.rbegin()-&gt;first + 1; std::shared_ptr&lt;T&gt; newObject(new T(identity)); collection.insert( identity , newObject ); return true; } template&lt;class T&gt; bool foo_impl(std::f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Deleting messages from SQS queue after processing<p>My application sends messages to a AWS SQS queue for jobs that need some sort of background processing. M...
<p>When you receive a message from an SQS queue, the message will (by default) return to the queue 30 seconds later. This is to handle cases where processing of the message crashes and the message needs to be processed again.</p> <p>Once your message is successfully processed, use <code>deleteMessage</code> to delete ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add new array at the beginning of multidimensional array<p>I have a multidimensional array like this:</p> <pre><code> // Create an empty array $noti_...
<p>Use <a href="http://php.net/manual/en/function.array-unshift.php" rel="noreferrer"><code>array_unshift()</code></a>:</p> <blockquote> <p>array_unshift() prepends passed elements to the front of the array. Note that the list of elements is prepended as a whole, so that the prepended elements stay in the same order...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to access the logged-in Principal from a session scoped spring bean<p>I want to access the logged-in user from a session-scoped spring bean, is that poss...
<p>You can try creating an Interceptor and setting the logged in user to a property of your session bean, which can be injected into your interceptor.</p> <p>Like this:</p> <pre><code>public class SessionDataInitializerInterceptor extends HandlerInterceptorAdapter { private static final Logger LOG = Logger.getLo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JMH gives hectic throughput values<p>I'm running <a href="https://github.com/ReactiveX/RxJava/blob/1.x/src/perf/java/rx/schedulers/ComputationSchedulerPerf.j...
<p>If you can use a 0.9.1+ version, you should have a look at the <code>perfasm</code> profiler that was added to JMH. It allows you to map the assembly of your code to the time spent at each instruction. It will however require you to use a Linux box as it makes use of the <code>perf</code> command.</p> <p>Other than...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to pause the service when the home button is pressed and resume the service when the program is resume?<pre><code>public class BackgroundMusicService ext...
<p>You have your onPause and onResume methods. You generally don't need to extend the Application class but instead use it in your Activity (esp if your app only has one Activity). </p> <p>However, why start and stop the service? Why not just pause/unpause the music? You can send an intent to pause/unpause (or even to...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Excel to to remove duplicate based on average<p>I have an excel table with only duplicated IDs (in first column) and corresponding <strong>values</strong> in...
<p>If you want to retain the duplicates with the highest value in the AVG column, sort the data by ID, then by AVG.</p> <p>Then use the "Remove Duplicates" command on the Data ribbon and select the ID column only.</p> <p>Data sorted by ID and AVG:</p> <p><img src="https://i.stack.imgur.com/rMO6S.png" alt="enter imag...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add data to localStorage and retrieve it<p>I have the following:</p> <pre><code> &lt;form onsubmit={ addToLocalStorage }&gt; &lt;/form&gt; this.items ...
<p><code>.push()</code> returns the new array length.</p> <pre><code>var a = [].push("a"); a = a.push("b"); </code></pre> <p>a is now equal to 2 and that array is gone.</p> <p>Here's what you want:</p> <pre><code>this.items.push(value); localStorage["someKey"] = JSON.stringify(this.items); ... var loadedArray = J...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Php count duplicate elements in an array and concat of ids<p>How can we find the count of duplicate elements in a multidimensional array and concat of ids ?<...
<pre><code>//Assumption: Input is in $in //Step 1: Cumulate $tmp=array(); foreach ($in as $skill) { if (isset($tmp[$skill['skill_name']])) $tmp[$skill['skill_name']][]=$skill['feed_id']; else $tmp[$skill['skill_name']]=array($skill['feed_id']); } //Step 2: Fix up desired output format $out=array(); foreac...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Installing node.js for angular - connect.static and karma<p>I'm trying to install a simple node webserver following the example in Pro AngularJS from apress....
<p>Apparently in the latest build of connect the static middleware has been moved to it's own package.</p> <p><a href="https://stackoverflow.com/questions/24346161/nodejs-connect-cannot-find-static">nodejs connect cannot find static</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Its a Simple Java HashMap, How elements added in respective buckets<p>Its a Simple Java HashMap, How elements added in respective buckets. I'm aware of the f...
<p>You have a <code>HashMap</code> with 16 buckets. Since it's a <strong>Hash</strong>Map, you start by getting the <code>hashCode()</code> of the key, which returns an <code>int</code> value.</p> <p>How do you assign a full range of <code>int</code> values to 16 buckets? One way is to use the <code>%</code> remainder...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Read cell and use text as input for VBA formula<p>I've been searching for a long time now to find a simple solution for my problem but I just can't find it. ...
<p>You have multiple workbooks and multiple worksheets available that could potentially be the parent of <em>cell</em>. You need to reference the cell definitively and take its <code>.Value</code> or <code>.Text</code> to be used as a worksheet name without relying on <em>Activesheet</em> for a default parent.</p> <pr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Duplicate Character Counter for an Alphanumeric<p>I am writing a short piece of code to practice learning python. Note I am not worried about error handling ...
<p>You should be iterating over the user input, not your dictionary</p> <pre><code>for char in s: letter_histogram[char] += 1 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make 2 spring projects share the same code base<p>I have 2 web projects in Spring MVC that are similar and have the same services and models. I want t...
<p>Something like the below. See <a href="http://books.sonatype.com/mvnex-book/reference/multimodule.html" rel="nofollow">http://books.sonatype.com/mvnex-book/reference/multimodule.html</a> for more info. </p> <p>Maven parent module <code>/pom.xml</code>:</p> <pre><code>... &lt;groupId&gt;com.example&lt;/groupId&gt; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Excel DataValidation dropdown value coming back null<p>I am trying to retrieve a Cell value from an file File.xlsm using Apache POI 4.0.1.</p> <p>The cell h...
<p>Your problem is not reproducible for me. This question shows why we always need a <a href="https://stackoverflow.com/help/minimal-reproducible-example">Minimal, Reproducible Example</a>.</p> <p>So let's have a such:</p> <p><code>ExcelDataValidation.xlsx</code> looks like:</p> <p><a href="https://i.stack.imgur.com...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extracting an element called time in SimpleXML<p>I have fetched an XML document from an external site using <code>file_get_contents()</code>. In the XML, the...
<p>First, you need to use <code>$day1</code> - not <code>day1</code>. You missed the <code>$</code>.</p> <p>Having this you can use xpath to find the relevant entry:</p> <pre><code>$xml-&gt;forecast-&gt;xpath("//time[@day='$day1']")[0]-&gt;symbol['name']; </code></pre> <p>Check the manual page about the <code>xpath(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you install PyLucene on OpenSuSE or another rpm based distro?<p>I'm trying to install pylucene on opensuse; is there an rpm package in the repositorie...
<p>It looks like there few rpm packages, but they are very old, so I will recommend you to install it manually with help of official guides:</p> <p><a href="http://lucene.apache.org/pylucene/install.html" rel="nofollow">http://lucene.apache.org/pylucene/install.html</a> (mind Download button near the top left corner)<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: two for loops in list comprehension python<p>I have a list:</p> <pre><code>f_array=['1000,1','100,10','100,-10'] </code></pre> <p>I am trying to sum up all...
<p>If you want to use nested loops then need to swap the order of the <code>for</code> loops:</p> <pre><code>number = sum([num for item in f_array for num in item.split(",")[1]]) </code></pre> <p>List comprehension loops are listed in <em>nesting order</em>, left to right is the same as nesting in regular Python loop...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to remove a tester's account from Google Play Console?<p>In the <a href="https://play.google.com/apps/publish" rel="nofollow noreferrer">Google Play Cons...
<p>This is the correct way.</p> <p>Note that this will not remove the version currently installed on their device nor downgrade to the production version. However they won't be eligible for future versions in those testing tracks and will receive the production version as soon as it has a higher versionCode as what th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Negation of null for Nullable<bool><p>I am confused with c# compiler in case of negating the <code>null</code> value of <code>bool?</code>. Compiler does int...
<p>See Section 7.3.7 of <a href="https://www.microsoft.com/en-us/download/details.aspx?id=7029" rel="nofollow noreferrer">the spec</a>:</p> <blockquote> <p><strong><em>Lifted operators</em></strong> permit predefined and user-defined operators that operate on non-nullable value types to also be used with nullable fo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check for existing conda environment in Makefile<p>I am creating a conda environment inside a Makefile. However, if this environment was created already, I'd...
<p>I solved the problem with the following:</p> <pre><code>ifeq (,$(shell which conda)) HAS_CONDA=False else HAS_CONDA=True ENV_DIR=$(shell conda info --base) MY_ENV_DIR=$(ENV_DIR)/envs/$(CONDA_ENV_NAME) CONDA_ACTIVATE=source $$(conda info --base)/etc/profile.d/conda.sh ; conda activate ; conda act...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Wrap div using 2 wrapper inside array loop<p>I am having difficulty while having the dual container div inside my for each array loop. Getting "two-half" div...
<p>Use <a href="https://www.php.net/manual/en/function.array-chunk.php" rel="nofollow noreferrer"><code>array_chunk</code></a> to split an array into chunks.</p> <pre class="lang-php prettyprint-override"><code>&lt;?php $array = range(1, 8); $half = array_chunk($array, 2); // chunk for halfs $item = array_chunk($hal...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Safe to Git commit passwords to a branch that never gets pushed?<p>If I have two branches, <code>master</code> &amp; <code>secret</code>. And I commit sensit...
<p>You have to be exceedingly careful to make sure your secret bits are not pushed to the remote repository. For example, if you merge from <code>secret</code> to <code>master</code> or accidentally push <code>secret</code>, they get out. See <a href="https://stackoverflow.com/q/13877469/123109">How to disable git pus...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SSRS - How to feed a report parameter "under the rug"?<p>I have a parameter in my report that my user cannot know about for security reasons. But this report...
<p>In SSRS you can set a parameter to be hidden in the general tab of Report Parameter Properties.</p> <p>You can then set the parameter using a default value.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: dynamic styleUrls in angular 7<p>After trying the other answers in SO, and none of them working, i'm thinking it a problem in the latest version of Angular.....
<p>I'll leave this here for others:</p> <pre><code>@Component({ selector: 'app-some-thing', templateUrl: './some-thing.component.html', styleUrls: [ require('./some-thing.component.scss').default, require(`./some-thing.component.${dynamic}.scss).default` ] </code></pre> <p>Notice, the ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Do BroadcastReceiver, Service, and Activity share Application object?<p>I have among others the following components:</p> <ul> <li>a <code>BroadcastReceiver...
<p>The short answer to your question is <strong>YES</strong>, <code>Activity</code>, <code>Service</code> and <code>BroadcastReceiver</code> objects do indeed share the same <code>Application</code> object </p> <ul> <li><em>as long as the process in which they are run remains alive</em>.</li> <li><em>and if these comp...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it ok accessing [UIApplication sharedApplication] from background thread?<p>While working on <code>Objective-C</code>, I need to get the <code>protectedDa...
<blockquote> <p>Question 1: Should the code be run inside main queue/ UI Thread?</p> </blockquote> <p>Definitely yes because if you run your app with the main thread checker on Xcode will highlight calls <code>UIApplication sharedApplication</code> as issues when accessed from a background thread</p> <blockquote> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Xamarin forms: Gif image is not working with FFimageloading in UWP<p>I am using <code>FFImageLoading</code> for playing a gif file in my project. It is worki...
<p>This is not available for UWP in my knowledge, Last time I checked it was an enhancement that was not added.</p> <p><strong>UPDATE</strong></p> <p>When you check FFImageLoading's Github issues there is an <a href="https://github.com/luberda-molinet/FFImageLoading/issues/1061" rel="nofollow noreferrer">open issue</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Expand Contained Mongo Document<p>This is for MongoDB</p> <p>I have a Document say <code>Employee</code> as below:</p> <pre><code>{ "_id":"e01", "name"...
<p><a href="https://docs.mongodb.com/manual/reference/operator/aggregation/lookup/" rel="nofollow noreferrer">$lookup</a> is needed to "join" the data from both collections and <a href="https://docs.mongodb.com/manual/reference/operator/aggregation/unwind/index.html" rel="nofollow noreferrer">$unwind</a> or <a href="ht...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MySQL before insert trigger filling omitted column<p>I am trying to make make a trigger, that will fill column B with value from column A if column B was not...
<p>You need to close the <code>IF</code> with <code>END IF</code></p> <pre><code>DELIMITER $$ CREATE TRIGGER trigger_name BEFORE INSERT ON my_table FOR EACH ROW BEGIN IF NEW.valueB IS NULL THEN SET NEW.valueB = NEW.valueA ; END IF ; END;$$ delimiter ; </code></pre> <p>Check the example here <a href="ht...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Order angular datatables without showing user interaction triangles<p>I would like to have the data sorted in a fixed way, without the user interacting with ...
<p>I used the answer by igg and sorted the data in the code before rendering datatables and then set ordering to false.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Counting inputs with lists<p>Ultimately, I want to build a script that takes a user's input and not only counts how many inputs they have, but repeats them i...
<pre><code>print('Add as many items to the basket as you want. When you are done, enter "nothing".') print('What do you want to put into the basket now?') #create basket list basket = [] while True: myInput = input() if myInput == "nothing": #print length of basket to count elements, and use basket to s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I use the value of UIStepper as the value for videoMaximumDuration?<p>I am currently working on an a video app in which I'd like to give the user the...
<p>You can see this <a href="http://goo.gl/uXw9CC" rel="nofollow">example</a>, You'll know how to use UIStepper.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to insert a variable string into a JSON query?<p>I have a query that runs just fine like this. It returns the right object and everything. </p> <pre><co...
<p>Have a try like this: </p> <pre><code>var time; if (this.value == "1"){ time = 'previous_300_minutes' } else { time = 'previous_30_minutes' } var all = new Keen.Query("extraction", { eventCollection: "android-sample-button-clicks", timeframe: time }); </code></pre> <p>Or like this:</p> <pre><code>var time...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Failed to construct 'Blob': The 1st argument provided is either null, or an invalid Array object.<p>I started using filesaver.js today.I have created the fol...
<p>Since you won't tell us what <code>final_transformation</code> is, we have to guess with no context. Try this : </p> <pre><code>function saving(){ var blob = new Blob([final_transformation], {type: "text/plain;charset=utf-8"}); saveAs(blob, "hello world.txt"); } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kohana 3.2, calling ORM table models(with has_many relationship) that are put inside a subfolder<p>I was trying to organize my codes, in <strong>application/...
<p>As you are working with <code>ORM</code> it would make sense to write your own class that holds the important methods - mainly removing the <em>table_</em> prefix from values.</p> <p>To do so, just create a file APPPATH/classes/ORM.php. The important method here is <a href="http://kohanaframework.org/3.3/guide-api/...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there any method to integrate velocity template with backbone.js?<p>I have a website which was wrote by java. The template is velocity,rendering by javaco...
<p>if it is an issue with the current interpolaters (not sure if that is a word but I mean the <code>&lt;%</code> and <code>%&gt;</code>) in underscore you can change these as per the docs say (<a href="http://underscorejs.org/#template" rel="nofollow">http://underscorejs.org/#template</a>)</p> <blockquote> <p>If E...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reload d3.js graph on node click<p>I've had a d3 graph with a bunch of nodes based off items. When I click on one of those nodes, the graph is reloaded with ...
<p>Handle the 3 states enter, exit and update, separate from each other:</p> <pre><code>node = svg.selectAll(".node") .data(nodes); // base data selection, this is the update var nodeE = node .enter(); // handle the enter case var nodeG = nodeE.append("g") .attr("class", "node") .call(force.drag); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Importing Three.js Module in a Node express server<p>I am trying to import threeJs module inside my html script to test out, I have it working when I downloa...
<p>You have to move the <code>three.module.js</code> file to a location that Express will serve. For example, if you have a public folder where you have other static files that are being served by Express, put the <code>three.module.js</code> file there and then put the correct URL to that resource in the import statem...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: iOS Safari Mobile doesn't trigger pageshow firing only once<p>The iOS Safari doesnt't seem to trigger pageshow event in the following situation.</p> <p>Lets...
<p><strong>Hack : This is what worked for me</strong></p> <pre><code>var myCustomEvent = (navigator.userAgent.match('iPhone') != null) ? 'popstate' : 'pageshow'; $(window).on(myCustomEvent, function(e) { ... } </code></pre> <p>For some reason <code>popstate</code> triggers everytime when page state changes in iOS b...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Need help for a getInput function<p>I've been having trouble with my javascript code.</p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; ...
<p>Try doing it like so:</p> <pre><code>document.getElementById("enterInput").addEventListener("click", getInput ); function getInput() { var val = document.getElementById("inputLine").value; //do something with val document.getElementById("inputLine").value=""; return val; } </code></pre> <p>See <a ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: submit function inside click function<p>I'm using click function to get the current ID of the clicked form, then running submit form function to apply my cod...
<p>If you look closely on <a href="https://api.jquery.com/submit/" rel="nofollow noreferrer">.submit() docs</a> you can see that the way you used it is for <strong>handling an event</strong>. But no event is being triggered. To send the actual event you have to either put <code>data</code> as a first argument and then ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Negative integer to signed 32-bit binary<pre><code>&gt;&gt;&gt; a = -2147458560 &gt;&gt;&gt; bin(a) '-0b1111111111111111001111000000000' </code></pre> <p>My...
<p><em>Bitwise AND</em> (<code>&amp;</code>) with <code>0xffffffff</code> (2<sup>32</sup> - 1) first:</p> <pre><code>&gt;&gt;&gt; a = -2147458560 &gt;&gt;&gt; bin(a &amp; 0xffffffff) '0b10000000000000000110001000000000' &gt;&gt;&gt; format(a &amp; 0xffffffff, '32b') '10000000000000000110001000000000' &gt;&gt;&gt; '{:...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: GCP Bulk Decompress maintaining file structure<p>We have a large number of compressed files stored in a GCS bucket. I am attempting to bulk decompress them u...
<p>I have looked for Java code of <a href="https://github.com/GoogleCloudPlatform/DataflowTemplates/blob/master/src/main/java/com/google/cloud/teleport/templates/BulkDecompressor.java" rel="nofollow noreferrer">bulk decompressor</a> and the PipelineResult method does following steps:</p> <ol> <li>Find all files matchi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is (1/90) = 0?<p>I am working in Unity3D with <code>C#</code> and I get a weird result. Can anyone tell me why my code equals 0?</p> <pre><code>float A ...
<p>The literals <code>1</code> and <code>90</code> are interpreted as an <code>int</code>. So <a href="https://msdn.microsoft.com/en-us/library/3b1ff23f.aspx" rel="nofollow">integer division</a> is used. After that the result is converted to a <code>float</code>.</p> <p>In general C# will read all sequences (without d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TypeError: object is not a function - jquery<p>I'm working on a 'Quote of the day' feature for a website. It works fine but I get a javascript error 'TypeErr...
<p>Why do you need <code>refresh</code>? Simply remove it:</p> <pre><code>$('#qotd').html(output); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Handling multiple exception using JUNIT5 test cases<p>I have created a JUNIT test case for my DynamoDB CRUD operation. I have used assertions to handle the u...
<p>I'd separate the three different scenarios into test cases of their own. Similar to that:</p> <pre class="lang-java prettyprint-override"><code>@Test void updateItem() throws Exception { CatalogItems cat = new CatalogItems(1, "xxxx", "f"); ResponseEntity Res = Eservice.updateItemInDynamoDbTable(cat); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to retain the previous version of app on user cancel - Wix Installer Upgrade<p>eI have an APP Installer using Wix. Now I need to Upgrade the APP without ...
<p>Assuming there's no other problem, the RemoveExistingProducts action must be between InstallInitialize and InstallFinalize for the transaction to roll back and reinstall the old product. You didn't say where your REP is sequenced. </p> <p>If it IS between those two actions then the issue may be that the reinstall o...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to properly connect a React js application to MongoDB database<p>I am having some problems connecting to <code>MongoDB</code> database. After I launch my...
<p>Looks like you are trying to execute a node application into a React application, this is not possible</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jquery blur method is not performing any action with form data of the django<p>I'm developing Checklist app with Django in which I'm trying to create a templ...
<p>Got it.. !!</p> <p>The main issue was with the script src </p> <p>The one which I was using, </p> <pre><code>&lt;script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"&gt;&lt;/script&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 we send notifcation to authenticate user on Signalr which uses BackPlane?<p>We are using Azure Service Bus Topics as a backplane for signalR and we h...
<p>It's related with topic configuration on azure. We crated a topics with "enable partitioning". We were missing many messages.Now, Topics are created by IOC. It's work fine. I have tested on both instances. context.Clients.User works fine.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Linked list pointer issue<p>There are 2 createList functions, one prints out all the elements of the linked list whereas other doesnt why so?</p> <pre class...
<p>In this function</p> <pre><code>/*following createList prints out only 1st element, why?*/ node* createList(node* root , int a){ if(root == NULL) root = new node(a); else createList(root-&gt;next , a); return root; } </code></pre> <p>its parameter root is a local variable of the function that holds a ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TextBox not stretching horizontally<p><strong>I am unable to stretch the textbox horizontally fit its container.</strong></p> <p>NOTE:</p> <ul> <li><p>I do...
<p>Try setting the <a href="https://msdn.microsoft.com/en-us/library/system.windows.controls.control.horizontalcontentalignment(v=vs.110).aspx" rel="nofollow"><code>ListView.HorizontalContentAlignment</code> Property</a> to <code>Stretch</code> instead. From the linked page:</p> <blockquote> <p>... you can set the H...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RESTful API Client<p>I am new to RESTful API client development. I have a got the sample client code to integrate to REST Server. Below is the the snap shoot...
<p>I'm a bit surprised that you want to use JAX-WS to access a RESTful API. In this technology, a web service operation invocation is represented by an XML-based protocol such as SOAP.</p> <p>There are several technologies to do a call to a RESTful applications. Here are two of them:</p> <ul> <li><strong><a href="htt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Universal search Acumatica does not work with dot symbol on the Windows server<p>I added an alternative id to the universal search, and now I can search for ...
<p>I asked the support case to Acumatica and got that message. The dash character is used as a separator in standard fulltext search on SQL server. So you receive the result that has some of parts of the item specified. Nothing we can do about.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to do dynamic elements in a v-if statement correctly?<p>I'm super new, and stumbling through learning vue. and hoping someone can help with a statement i...
<p>I'm still not exactly sure what you're trying to achieve but based on your comment I think this is somewhere close:</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>new Vue(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reset TextView position in row of Listview for Android Application<p>I am using ListView to display some data. The data is shown in TextView. String length w...
<p>As you mentioned, your <code>TextView</code>s are sizing vertically due to the <code>wrap_content</code> values for their <code>layout_height</code>s. It seems that when <code>View</code>s are recycled in <code>ListView</code>s (and, most likely, all <code>AdapterView</code>s), no layout is automatically triggered, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get selected rows in vb6 TDBgrid<p>I'm a beginner in VB6. I am creating an application that contains a TDBGrid. My problem is how can i get the row se...
<p>As you said you have changed to dbgrid then you can do below</p> <pre><code>Dim row As GridViewRow = GridView1.SelectedRow Dim CellValue = row.Cells(1).Text </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Image link urls are showing two copies of every image using slack rtm API<p>Here's the code we're using, which worked totally fine until about a week ago:</p...
<h1>The Issue:</h1> <p>Two major things:</p> <ol> <li>You should use <code>chat.postMessage()</code> instead of <code>rtm.sendMessage()</code>. You were right to try that, but you need to stick with it if you want to fix this - from the docs: <ul> <li><blockquote> <p><a href="https://api.slack.com/rtm#formatting_m...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: display karma tests on browser<p>I'm new to karma unit-testing angular. I tested angular-socket-io application. This is what I saw when I ran karma start on ...
<p>If you would be happy with opening an HTML report that Karma generated for you, then take a look at <a href="https://github.com/dtabuenc/karma-html-reporter" rel="nofollow">karma-html-reporter</a>. Just add it to the reporters list in your Karma configuration:</p> <pre><code>{ // much more before this reporter...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Recursion not fully traversing object with nested objects<p>I'm intending to write a module that can be instantiated with default configuration and then over...
<p>This line:</p> <pre><code>return customize.call(this[prop], conf[prop]); </code></pre> <p>occurs inside a for loop, so you are returning before each item has been iterated over. Your return statement should be outside the loop.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: when image download then get error "... is not a valid virtual path"<hr> <p>In below code image search from Google and display it. i add one link-button in ...
<p>As far as I know there is know way to get file name for online resource like image (if the image hosting provider provides API then that will give you the name other wise not possible). So what you can do is you can generate the name from the <code>url</code> randomly.</p> <p>So in general all the <code>URL</code> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extending a script to loop over multiple files and generate output names<p>I have following script (named vid2gif.sh) to convert a video file to gif: </p> <...
<pre><code>#!/bin/sh for f; do tempdir=$(mktemp -t -d gifdir.XXXXXX) ffmpeg -i "$f" "$tempdir/out%04d.gif" gifsicle --delay=10 --loop "$tempdir"/*.gif &gt;"${f%.*}.gif" rm -rf "$tempdir" done </code></pre> <p>Let's go over how this works:</p> <ol> <li><p>Iteration</p> <pre><code>for f; do </code></pre> <p>i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Making form's onsubmit to work only for particular submits<p>In PHP program, I have JS function which validates submit <code>&lt;form ...onsubmit='return isO...
<pre><code>instead of onsubmit u can use onClick. &lt;input type="submit" onclick="return pressSubmit1()" value="submit1" /&gt; &lt;input type="submit" onclick="return pressSubmit2()" value="submit2" /&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why usort reverts an array when values are equals on PHP prior to 7.0<p>I'm trying to use usort on an array, and get a different behavior regarding the versi...
<p>If you want to have the same results in both versions, you will need to ensure that you specify how equal items will deal with other fields.</p> <p>So you could solve this with...</p> <pre><code>usort($arr1, function ($a, $b) { if($a['points'] == $b['points']){ return $a['date'] - $b['date']; } r...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to C# Reading xml file<p>I have an XML file. I want C # with the desktop application. There are similar solutions on the site. But I can't read with the ...
<p>I used simple solution to read and edit XML file:</p> <pre><code> XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load("path\to\file.xml"); XmlNode node = xmlDoc.SelectSingleNode("//nodeName"); node.InnerText = value; xmlDoc.Save("path\to\file.xml"); </code></pre> <p>You can load this file, read single node or ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Attempt to index field (nil value)<p>Whenever I try to use Body.pos, it always says that it is a nil value. But it is assigned a value in the new function, s...
<p>The issue is your OOP implementation. The metatable <code>o</code> needs to be set as a local variable.</p> <p>In your code <code>o</code> is a global variable hence why you always reset it when you create a new object.</p> <pre class="lang-lua prettyprint-override"><code>Vector={ -- ... ,new=function (se...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Azure pipeline run build on Pull Request branch<p>Is there any way to run a pipeline with changes from the Feature branch with the stable branch?</p> <p>1) ...
<p>The PR will run on its own branch <code>refs/pull/{pullId}/merge</code>.</p> <p>A simple place this can be seen is looking at the checkout task of the build you've setup for your policy.</p> <p><a href="https://i.stack.imgur.com/yNs7H.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yNs7H.png" al...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: operator new() behaves differently when operator delete() is deleted depending on the existence of the default constructor<p>Creating a new object of class C...
<blockquote> <p>What are the differences between compiler-generated default constructor and user-defined default constructor that make this happen?</p> </blockquote> <p><code>new</code> expression invokes the corresponding <code>operator new</code> and then calls the constructor. If the constructor throws an excepti...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find the most profitable path in a board<p>assume that we have a board like this :</p> <p><img src="https://i.stack.imgur.com/O1CQr.png" alt="enter i...
<p>You are solving the <a href="http://en.wikipedia.org/wiki/Longest_path_problem" rel="nofollow">Longest Path Problem</a>, which is usually NP-Complete. However, in your case, you actually have a <a href="http://en.wikipedia.org/wiki/Directed_acyclic_graph" rel="nofollow">Directed Acyclic Graph</a>, and thus an effici...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Stop javascript increment at a certain value<p>I have coded this small script which increments a given value, in this case 200, by 1 every 3.2 seconds. </p> ...
<pre><code>var i = 200; function increment() { if (i == 300) { // stop when it hits 300 window.clearInterval(id); return; } i++; document.getElementById('generated').innerHTML = Number(i).toLocaleString('en'); } var id = window.setInterval('increment()', 3200); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Irregular DIV shape, cross browser platform support<p>I'm trying to make a irregular shaped DIV, but the only method that I found out to accomplish this is b...
<p>Let's make the sloped sidebar with a <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/transform" rel="nofollow"><code>transform</code></a>:</p> <ul> <li><p>The sidebar is given <code>position: fixed</code> and will stay in one place relative to the viewport</p></li> <li><p>The sidebar is given <code>transf...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: a simple way to break a String into a list of Strings<p>so i am still learning java and recently i needed a method that does this :</p> <p>it breaks the str...
<pre class="lang-java prettyprint-override"><code>String s= "aaa bbb eejj ,hhre"; String[] list = s.split(" "); for(String g : list){ System.out.println(g); } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Powershell - query servers with roles installed<p>I have a txt file with all the server names.</p> <p>I want to query each server in the txt to see if RDS i...
<p>Try something like this:</p> <pre><code>Get-Content W:\AllWindows.txt | ForEach-Object { @(($_), (Get-WindowsFeature -Name Remote-Desktop-Services)) } | Format-Table -Auto -wrap | Out-File -FilePath $csvfile </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: a == b returns true, a.attribute == b.attribute returns false; ruby<p>I'm testing this line of a controller:</p> <pre><code>@channel.update_attribute(:activ...
<p>I suppose a channel is an ActiveRecord object and it's the same as doing:</p> <pre><code>channel1 = Channel.find(1) channel2 = Channel.find(1) </code></pre> <p>So <code>channel1 == channel2</code> because their identity is the same. (they are both channels and have the same id)</p> <p>But if you update one of the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: List only folders which matches the wildcard expression<p>Is there a command which lists all folders that matches a wildcard expression? Example, if there a...
<p>Use <code>find</code> command, for example:</p> <pre><code># find anything that start with 'jo' end with 'm' (case insensitive) find . -iname 'jo*m' </code></pre> <p>You can execute any command after that, for example:</p> <pre><code># find just like above but case sensitive, and move them to `/tmp` find . -name ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Vuex mapstate undefinded<p>I'm having trouble using the Vuex mapstate. While testing writing this.$store.state.count but I'm trying to shorten the name down ...
<p>You can use a <a href="https://v2.vuejs.org/v2/guide/mixins.html#Global-Mixin" rel="nofollow noreferrer">global mixin</a> like this:</p> <pre><code>Vue.mixin({ computed: mapState([ 'count' ]), }) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: std::move_if_noexcept calls copy-assignment even though move-assignment is noexcept; why?<p>I'm trying to get as close to the <em>Strong Exception Guarantee<...
<h3>The Introduction</h3> <p>The name of <code>move_if_noexcept</code> certainly implies that the function will yield an <em>rvalue-reference</em> as long as this operation is <code>noexcept</code>, and with this in mind we soon realize two things:</p> <ol> <li>A simple cast from <code>T&amp;</code> to <code>T&amp;&amp...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: VS .Net Core Razor pages do not update unless project is re-started<p>I have a simple .Net Core 3.1 project in VS 2019. I edit a cshtml file in VS while the ...
<p>Microsoft mentioned in the documentation to add runtime compilation.</p> <blockquote> <p>Runtime compilation may be optionally enabled by configuring your application.</p> </blockquote> <p><a href="https://docs.microsoft.com/en-us/aspnet/core/mvc/views/view-compilation?view=aspnetcore-3.0#runtime-compilation" re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rotate QPixmap on a QGraphicsScene around a point<p>My problem is the following: I have a QGraphicsScene, there is a QPixmap on it. I would like to rotate th...
<p>You should rotate the <code>QGraphicsPixmapItem</code>, not the pixmap itself. Use <a href="http://qt-project.org/doc/qt-4.8/qgraphicsitem.html#setTransformOriginPoint" rel="noreferrer"><code>QGraphicsItem::setTransformOriginPoint</code></a> to define the transform origin point and <a href="http://qt-project.org/doc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is this the correct implementation of a dynamically allocated 2d array<p>So i am tasked with the following question. I'm not sure if this is the appropriate ...
<pre><code>m_TwoDArray[numRows][numCols] = value; </code></pre> <p>is not right. You end up accessing the array out of bounds, which will result in undefined behavior. That needs to be changed to:</p> <pre><code>m_TwoDArray[i][j] = value; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Paste Special error 1004 PasteSpecial method of Range class failed because Paste:=xlPasteValues<p>Hi I have looked thoroughly those similar questions and ans...
<p>If you just extract the values, it's easy to use arrays.</p> <pre><code>Sub upload_file() Dim WB As Workbook Dim source As Workbook Dim vDB As Variant 'create variant variable Dim Ws As Worksheet With Application .DisplayAlerts = False .ScreenUpdating = False End With Set WB = ThisWorkb...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I fix compiler warnings C6386 and C6385?<p>For the program I am writing I need to create an array with a user-defined size, as well as random values b...
<p>In this loop the index variable x not i.</p> <p>So change the loop like</p> <pre><code>int i = size; for (int x = 0; x &lt; i; x++) //generate random numbers { dataSet[x] = (rand() % 31) - 15; cout &lt;&lt; dataSet[x] &lt;&lt; " "; } </code></pre> <p>In fact the var...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Multimarkdown to custom HTML Template<p>How do I use <a href="https://github.com/fletcher/MultiMarkdown-4" rel="nofollow noreferrer">MultiMarkdown 4</a> to t...
<p>A very simple, somewhat hackish way would be to prepare a <code>header.html</code> file containing e.g</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;title&gt;my page&lt;/title&gt; &lt;/head&gt; &lt;body&gt; </code></pre> <p>and a <code>footer.html</code> containing e.g.</p> <pre><code> &lt;/body&gt; &lt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Memory sanitizer reports use-of-uninitialized-value in global object construction<p>I get <code>use-of-uninitialized-value</code> warning while executing the...
<p>This is probably already reported MemorySanitizer bug <a href="https://github.com/google/sanitizers/issues/542" rel="nofollow noreferrer">https://github.com/google/sanitizers/issues/542</a>.</p> <p>However it was closed with Status WontFix without much explanation.</p> <p>It seems that you need to build instrument...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to programmatically *remove* a Google Sheets menu item in Apps Script<p>Apps Script folks, how do I programmatically <em>remove</em> a custom menu item i...
<p>There are no methods for removing menu items.</p> <p>An alternative approach is building a new menu and using it to replace the existing menu. Note, <em>the replacement menu must have the same name as the existing menu</em>, otherwise an additional menu will be added.</p> <p>The following example will initially cr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I have multiple iterators to the same data pertaining to a file?<p>I have a file that I wish to read and filter the data into two different sets and ...
<p>You cannot. Instead, you will need to clone the iterator, or some building block of it. In this case, the highest thing you can clone is the <code>Cursor</code>:</p> <pre><code>use std::io::{self, BufRead}; fn main() { let cursor = io::Cursor::new(b"pillow\nbrick\r\nphone"); let lines = cursor.clone().lin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Set UIImage height based on a ratio of the width using Autolayout<p>I am trying to figure out how to set the height of a UIimage on the storyboard based on t...
<p>If you add a<code>UIImageView</code> to the Storyboard and manually set it to the ratio you want, e.g. 300x400px, you can then click the pin button on the bottom right (shown below) and check the box that says "aspect ratio". That will add a constraint to always keep your view the same aspect ratio, even as you chan...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to register an open generic decorator for an open generic registration in Autofac?<p>I have an open generic registration for handlers in autofac that loo...
<p>As per the <code>autofac</code> documentation <a href="http://docs.autofac.org/en/latest/advanced/adapters-decorators.html" rel="nofollow">here</a>, please try following solution:</p> <pre><code>// Register the open generic with a name so the // decorator can use it. builder.RegisterGeneric(typeof(CommandHandler&lt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What are microservices and how do they differ from an API-driven architecture?<p>I want to be able to answer the question, "Do you use microservices?" I have...
<p>I agree with you that there seems to be no well-established method to actually measure objectives such as "small", "loosely coupled" etc. It is probably hard to give an exact definition, because it depends on the context and on the way an application works. </p> <p>However, there are some criteria regarding the dev...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Linux on Virtual Box as primary workspace?<p>I will be getting a new Windows computer for work but am interested in doing as much of my actual work as ...
<p>You can allocate disk space dynamically, so that it won't take more than is needed. Memory can be adjusted easily, so start with the recommended value and adjust as required. Start with a minimal Linux install and add what you need for your work. This arrangement works well, and you can used the shared drive feature...