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: Why is my D code to sum a vector up x4 slower than C?<p>I was wondering why D code is so slow? I originally used std.algorithm.sum but the performance was ev...
<p>You can improve speed with <code>uninitializedArray</code> from <code>std.array</code> and use foreach over array directly:</p> <pre><code>import std.algorithm; import std.stdio; import std.array; void main() { immutable int n = 10000000; auto v = uninitializedArray!(int[])(n); fill(v, 1); int tota...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find the file name in python<p>I have a Question. I'm a little bit confuse in it. I have URL from which images and videos are coming.I want to get the...
<pre><code>from urlparse import urlparse from os.path import splitext url = "sample/test/image.png" image_formats = [".png", ".jpeg"] video_formats = [".mp4", ".mp3", ".avi"] def get_ext(url): """Return the filename extension from url, or ''.""" parsed = urlparse(url) root, ext = splitext(parsed.path) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: 301 redirect dynamic part of an URL<p>I was wondering if it is possible to redirect an URL like this: www.domain.com/index.php?itemid=2&amp;search=<strong>ab...
<p>You can use this code in your <code>DOCUMENT_ROOT/.htaccess</code> file:</p> <pre><code>RewriteEngine On RewriteCond %{QUERY_STRING} ^itemid=2&amp;search=[^&amp;]+ [NC] RewriteRule ^(index\.php)?$ http://www.newdomain.com/new? [L,NC,R=302] </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kendo Grid: how to update data source from code when the row changes<p>this follows on from a few of my previous posts, regarding updating the kendo grid dat...
<p>This is a known problem with Kendo's grid, it can't do a partial refresh, it always rebuilds the full table. See my answer <a href="https://stackoverflow.com/a/22969403/2001735">here</a> on how you might deal with that.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to delete this 2d dynamic array in c++<pre><code>bool **arr=new bool* [row]; for(int i=0; i&lt;9; i++) { arr[i]= new bool[column]; } </code></pre> <...
<p>You just delete in the reverse order it was allocated:</p> <pre><code>for(int i=0; i&lt;9; i++) { delete [] arr[i]; } delete[] arr; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Selecting rows with maximum value, combining WHERE. MAX, and CAST, in spark.sql<p>I have a table in Spark with a <code>date_string</code> column of type stri...
<p>You seem to be pretty close already. However, you cannot use a column computed in the <code>FROM</code> clause within the <code>WHERE</code> clause (it is evaluated before the <code>SELECT</code> clause).</p> <p>This should work:</p> <pre><code>SELECT *, CAST(date_string AS INT) AS date FROM data.so...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: replacing key object for the array values<p>Im having a problem with replacing keys in object</p> <pre><code>let headers = ['title1', 'title2', 'title3'] l...
<p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_objects/Object/values" rel="nofollow noreferrer">Object.values</a> returns only values from specified <code>obj</code> and <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/fromEntries" re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Twilio: Start/Stop Recording Mid-Call<p>Two related questions on this topic:</p> <ol> <li><p>Can a moderator of a conference call start or stop recording af...
<p>Twilio evangelist here.</p> <p>There is no way to start/stop a recording of a <a href="https://www.twilio.com/docs/api/twiml/conference" rel="nofollow"><code>&lt;Conference&gt;</code></a> call through the Record attribute. You might be able to do this by dialing in Twilio as a participant.</p> <p>There is also no...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mergesort on a linked-list using only one function, segmentation fault<p>I need to implement the function: <code>struct listnode * mergesort(struct listnode ...
<pre><code>if ( data == NULL ) return; </code></pre> <p>You should return NULL.</p> <hr> <pre><code>btail = head-&gt;next; // second item while(btail-&gt;next != NULL) // anything left { </code></pre> <p>If btail is set to head->next. If head->next is NULL, you're trying to check in the loop NULL->next...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why do I get errors with my App/Validators?<p>I have been trying to validate that the first name does not include anything but letters, numbers, hyphens, or ...
<p><code>app/validators</code> is a good place to store validators, all you need to do, is to tell Rails about this folder existence. Add this line to your autoload paths in <code>config/application.rb</code> (<code>YourAppName::Application</code> section):</p> <pre><code>config.autoload_paths &lt;&lt; Rails.root.join...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why can't I use an enum as key in a interface with other keys<p>I found out via other issues <em>how</em> to make it work, but I couldn't find out WHY.</p> ...
<p>Basically:</p> <ul> <li><code>{ reads: storeName[], writes: storeName[] }</code> is a normal <a href="https://www.typescriptlang.org/docs/handbook/interfaces.html" rel="nofollow noreferrer">interface type</a>,</li> <li><code>{ [action in actions]?: storeName[] }</code> is a <a href="https://www.typescriptlang.org/d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add multiple QFrames into a single QFrame at runtime while using MSVC<p>I am creating a main window having a number of frames as child frames on it. I want t...
<p>I have found my mistake in the above code. I was trying to initialize a QList with a new Instance of of <strong>QFrame</strong>. As structure of <strong>QList</strong> is very much similar to an array so In the QList we can add items either by<strong>insert()</strong> method or by <strong>append()</strong>. The fol...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java: Owasp AntiSamy vs Owasp-java-html-sanitize<p>I am looking for html purifier library now. And I've found that there are two "owasp" library. First is <a...
<p>OWASP java html sanitizer is newer project than antisamy. Goals of these projects are the same - sanitizing HTML to prevent XSS and filter out other unwanted content. However their approach is different. Every approach has its tradeoffs so you should choose the solution depending on your requirements. In a nutshell ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I bootstrap a Laravel application from within a Laravel application?<p>I am trying to build a proof of concept to solve the following problem: I need...
<p>The problem was caused by de namespacing. </p> <pre><code>$kernel = $app-&gt;make(Illuminate\Contracts\Http\Kernel::class); </code></pre> <p>Should be</p> <pre><code>$kernel = $app-&gt;make(\Illuminate\Contracts\Http\Kernel::class); </code></pre> <p>This is also the case for</p> <pre><code> $request = Illuminat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pass to a case class constructor the instance being constructed<p>I have a complex set of traits and case classes, but for the sake of the discussion let me ...
<p>If you need to have a case class, I don't think it can be done. Case classes cannot have lazy parameters, and if they could point to themselves most of their methods would probably blow the stack. With a regular class you can do this:</p> <pre><code>scala&gt; class X(x0: =&gt;X) { | lazy val x = x0 | }...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Seperate Pact Interactions in Provider Verification Tests by Endpoint<p>I just started to adopt Pact test for my system that consists of one provider service...
<p>The JUnit4 Readme has a section about this topic. I think it also applies to Junit5 <a href="https://github.com/DiUS/pact-jvm/tree/master/provider/pact-jvm-provider-junit#using-multiple-classes-for-the-state-change-methods" rel="nofollow noreferrer">https://github.com/DiUS/pact-jvm/tree/master/provider/pact-jvm-prov...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use GIT as document versioning system - muitiple concurrent users<p>I would like to manage versioning of some plain JSON text and GIT seems like a nic...
<p>Using Git is definitely a possible solution to your problem. My recommendation is that you pretty-print your document such that each entry is one line, like so:</p> <pre><code>{ "a": 1, "b": [ "x", "y", "z" ] } </code></pre> <p>This will help reduce any conflicts in cas...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Call dictionary element from a tuple<p>This is the tuple I have:</p> <pre><code>a = (-2.1900105430326064, 0.20989101040060731, 0, 2106, {'1%': -3.433458873...
<p>it is <code>a[4]["1%"]</code>, the dict it the fifth element with indexes starting at <code>0</code>, so <code>a[4]</code> gets the fifth element i.e the dict, you then access the key with <code>["1%"]</code>:</p> <pre><code>a = (-2.1900105430326064, 0.20989101040060731, 0, 2106, {'1%': -3.4334588739173006, '10%...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Selenium tests - Everything is printed all the time no matter what<p>This might sound like a very silly question but here it is:</p> <p>I'm writing selenium...
<p>I almost never use <code>unittest</code> all by itself but, as far as I can tell, that <code>print</code> results in output to the console is the default behavior with <code>unittest</code>. Here's an example file:</p> <pre><code>import unittest class Test(unittest.TestCase): def test_one(self): print...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: include everything (including "ca.") up to next period or comma<p>I'll use the syntax used on regex101.com, but my code is in R.</p> <p>take the following s...
<p>If a positive lookbehind <code>(?&lt;=</code> is supported, you could add an optional part to match a dot if what precedes is <code>ca</code></p> <pre><code>\bLVEF\b[^.]*(?:(?&lt;=ca)\.)? </code></pre> <p><strong>Explanation</strong></p> <ul> <li><code>\bLVEF\b</code> Match LVEF between word boundaries</li> <li><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: increment,decrement on label when click the + or - button in ios<p>I want to make a type of view where I have a custom cell to show the item list and a butto...
<pre><code>-(IBAction)addButton:(id)sender{ TableViewCell *cell; // check device version if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")){ cell = (TableViewCell*)((UIButton*)sender).superview.superview.superview; } else{ cell = (TableViewCell*)((UIButton*)sender).superview.superview.superview.superview; } ce...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to catch and redirect rails routes that are valid, but invalid resource id?<p><code>match '*path' =&gt; redirect('/'), via: :all if Rails.env.production?...
<p>Check out <a href="http://guides.rubyonrails.org/action_controller_overview.html#rescue-from" rel="noreferrer"><code>rescue_from</code></a>. It's quite handy when you want to deviate from Rails' default behavior of displaying a 404 page.</p> <pre><code>class ApplicationController &lt; ActionController::Base rescu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the accepted convention for when to use an object containing objects vs an array of objects in JSON?<p>I am currently in the process of writing a GUI...
<p>If all you're going to do is iterate over your objects, then an array of objects makes more sense. If these are settings and people are going to need to look up a specific one then the original object notation is better. the original allows people write code like</p> <pre><code>var foo = settings['2013'][someEventN...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to attach a word before each request in spring mvc?<p>I have got a spring mvc controller which has many methods. In all the methods I start the path by <...
<p>You can add <code>@RequestMapping("/api")</code> on class level and omit it on method level then.</p> <p>So something like this should do the trick:</p> <pre><code>@RestController @RequestMapping("/api") public class Test { @GetMapping(value="/host") public String returnText() { return "hello"; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regex in python: combining 2 regex expressions into one<p>Suppose I have the following list:</p> <pre><code>a = ['35','years','opened','7,000','churches','r...
<p>This should work:</p> <p><code>reg = re.compile('[a-zA-Z]+\.|[0-9,]+')</code></p> <p>Note that your first regex is wrong because it deletes any string within a dot inside it. To avoid this, I included <code>[a-zA-Z]+\.</code> in the combined regex. Your second regex is also wrong as it misses a "+" and a ",", whic...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: p:selectOneMenu not refreshing properly when pressing F5<p>So before anything <strong>just to make it clear this is an issue that happens with firefox even i...
<p>You can use <code>dynamic="true"</code> attribute. I got the same problem solved using this attribute. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ngOptions - Value Is Undefined<p>I'm working with AngularJS and I've generated an object with a <code>size</code> property that holds an array of objects.</p...
<p>this is a classic problem in angular. Its because you are using ng-if which is creating a child scope. you need to set your model to someObject.size and change all references to that. And then in the controller put $scope.someObject = {};</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to check whether a field has been set without triggering a race condition?<p>I have a struct that is shared across many goroutines, and I woul...
<p>In your approach you would have to lock first before you can check if <code>Items</code> has been set. E.g.:</p> <pre><code>func (container *Container) loadContainer() { container.mu.Lock() defer container.mu.Unlock() if container.Items != nil { return } container.Items = loadItems() }...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java JSON object insertion order maintenance<p>I am using a Java JSON object to store some data. But when I printed it, I found that it stores the data rando...
<p>Arrays are ordered so use an array of key-value objects <code>[ {key1: val1}, {key2: val2} ]</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parameters URL request, undefined<p>I want to have a button that redirect me to an url like this: <strong>task-details/1</strong></p> <p>For this, in HTML I...
<p>Try this:</p> <pre><code> &lt;ul *ngFor="let task of tasks" class="list-group list-group-flush"&gt; &lt;li class="list-group-item"&gt; {{task.description}} &lt;button class="btn-success" routerLink="/task-details/"+task.taskId&gt;&lt;/button&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Force a class implementing the interface to define a constant<p>I am willing to force my classes to define a constant named COMMAND. If php would allow overr...
<p>Personally, my choice would be:</p> <pre><code>interface RequestInterface { /** * @returns string */ public function getCommand(); } class LoginRequest implements RequestInterface { public function getCommand() { return "loginuser"; } ... } </code></pre> <p>You can always chec...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Explanation for brew install vs. bundle install needed for PGSQL error. (How to make my PGSQL work)<p>I have a rails app that I am trying to run tests on. Th...
<p>You have a lot of questions here and I'll try my best to give an overview of all the moving pieces here as well as some solutions to solve your psql problem.</p> <p>First, some background:</p> <p><strong>Ruby gems</strong></p> <p>These are packages that contain ruby code that you want to be used by your applicati...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change SVG path color using data in JavaScript function<p>I have a question that builds on similar ones like <a href="https://stackoverflow.com/questions/358...
<p>Using an array of objects is not a very efficient way to do this, but if that's the data structure you have, you can extract the information you need with <code>Object.keys()</code> and <code>Object.values()</code>.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Problems comparing two array lists objects<p>This may seem like a dumb question but I have been stuck on this for awhile. The code I have is supposed to chec...
<p>It's more a guess than an answer, but..</p> <p>In your first piece of code you check if <code>other</code> is of type <code>LineSegmentDb</code>, if it's true you cast <code>other</code> to type <code>ArrayList</code>. You get a <code>java.lang.ClassCastException</code> because other is of type <code>LineSegmentDb<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Listview onClickListener is not working in Drawer Layout<p>I am making a drawer having <code>ListView</code> in it. But surprisingly its not getting any <cod...
<p>Thanks everyone for giving suggestion for this issue. But I have found the cause for this abnormal behaviour. It is because of <code>RelativeLayout</code> (Outside Drawer Layout) defined in Activity's XML file (not item list XML). On removing that code, the click works as charm. :) Sorry for not including that code ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: To find same row in tic tac toe using a formula<p>I have numbered my tic-tac-toe game cells as:<br></p> <pre><code>0 1 2 3 4 5 6 7 8 </code></pre> <p>Now, ...
<p>You can use a similar expression to create a row list. The code below creates both row and column lists using a pair of similar functions that both use the built-in <code>divmod()</code> function to convert the grid index into (X, Y) coordinates and a helper function <code>xy_to_i()</code> to convert such coordinate...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Postgres: Grant access to future tables to various users<p>There are several threads already on this topic. Yet I'm unable to get it done and keep getting "p...
<p>If you <code>ALTER DEFAULT PRIVILEGES <strong>FOR ROLE group_x</strong></code>, that means that the privileges are only granted on future objects <strong>created by user <code>group_x</code></strong>.</p> <p>So you need to specify the user that creates tables in the <code>FOR ROLE</code> clause.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Blocking behaviour with Entity Framework Async methods and SQL Server Compact<p>I have an MVVM app that calls a data service to get some data to bind. The da...
<p>The SQL Server Compact ADO.NET provider does not provide any Async APIs. But loading data should never take a fewcseconds, unless you are fetching 1000s of rows. Initialize a dbContext.connection object when you start your app, and leave empty and unused for the lifetime of your app. There is also a cost of init of ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: getMethod with an array<p>I can not seem to figure out why this is not working. plow is a constructor I made in another class file but I want to be able to a...
<p>With this:</p> <pre><code> Plow[] plows = new Plow[PLOWS]; </code></pre> <p>you are instancing a new array of <code>Plow</code> objects. But at this point, the array will be initialized to <code>PLOWS</code> items, but all the items inside will be <code>null</code>. Each item will need to be initialized by itself....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: javascript <script async attribute><p>I am developing a widget. the code for it is :</p> <pre><code>&lt;script type="text/javascript"&gt; var hashgurus_...
<p><code>document.write</code> cannot be called from an asynchronous script. Use a regular script and an asynchronous injection of the HTML instead, e.g.</p> <pre><code>var div = document.createElement('div'); div.id = "FJ_TF_Cont"; div.style.position = 'relative'; div.style.padding = '20px'; div.style.margin = '20px'...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Force HTST cache reset from webserver<p>I'm using <code>nginx</code> as reverse proxy and <code>nodejs</code> for the application. I want to know is there an...
<p>You can use <code>max-age = 0</code> to reset cache and force HTST cache reset. </p> <p>In nginx:</p> <pre><code>server { ... add_header Strict-Transport-Security "max-age=0;"; ... } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Toolbar Item Click<p>I am using toolbar in my app. Toolbar layout looks like this. I add <code>imageButton</code> inside toolbar as menu item. (Is that is a ...
<p>I ended up by using the following code</p> <pre><code> ImageButton imageButton = (ImageButton) toolbar.findViewById(R.id.shareButton); imageButton.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { } }); </code></pre> <p>I ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add flash message to form without losing page<p>I am using node.js and express to make a CRUD web app, and I am trying to work out how to get a flash message...
<p>You can declare your post route as:</p> <pre><code>router.post('/edit/:id', function(req, res) { // logic to check for errors // if errors, set flash message and // redirect to /edit/:id }); </code></pre> <p>Then on, you can use the ID in the post route to redirect to the edit page of the same resourc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parameters for sklearn average precision score when using Random Forest<p>I have been trying to fiddle with sklearn metrics, particularly average_precision_s...
<p>With predict - you predict labels (assume it's 0 and 1) With predict_proba - you have probabilities of both labels for certain sample (result [0.1, 0.9] =&gt; this sample most likely 1 not 0).</p> <p>The metric AP - is the order metric so the only order of prediction is important. So if ground truth vector [1, 0, 1...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Present Scene from a helper class<p>I am developing a game for iOS that has in game currency. I have an SKSceneStore that has an SKLabelNode that displays th...
<p>I managed to find a more elegant solution and used the following code:</p> <p>in "provideContentForProductIdentifier:(NSString *)productIdentifier"</p> <pre><code>[[NSNotificationCenter defaultCenter] postNotificationName:@"reinitializeStore" object:self]; </code></pre> <p>and then in my SKSceneStore I used</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Throw an exception if an Optional<> is present<p>Let's say I want to see if an object exists in a stream and if it is not present, throw an Exception. One wa...
<p>Since you only care <strong>if</strong> a match was found, not what was actually found, you can use <code>anyMatch</code> for this, and you don't need to use <code>Optional</code> at all:</p> <pre><code>if (values.stream().anyMatch(s -&gt; s.equals("two"))) { throw new RuntimeException("two was found"); } </cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I create a WKWebView App for MacOS<p>I have an HTML5 App developed in XCode in the IOS App Store and I wish to create a copy of that app for the Mac A...
<p>Step 1 - Install XCode 11 and open it.</p> <p>Step 2 - Select "File" and "New" and "Project" from the main menu.</p> <p>Step 3 - Select "App" (top left) and Select "Next" (bottom right).</p> <p>Step 4 - Give your app a name, for User Interface select "Storyboard" and then select "Next".</p> <p>Step 5 - Select a ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: gdb shows wrong addresses while zeroing a buffer<p>My objective is to initialize a buffer in assembly. I use NASM on a 64bit-linux and gdb for debugging. The...
<p>As the comments indicated, there is another variable called <code>buffer</code> in another source file of glibc. Changing the variable name to <code>puffer</code> gives the expected results. Furthermore, the following line should have made me skeptical:</p> <pre><code>$1 = (char **) 0x7ffff7fa0250 &lt;buffer&gt; </...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel get model from ID with belongtoMany<p>I'm building an application using Laravel 4 but have some problems with the pivot tables.</p> <p>there are 3 t...
<p>The immediate issue is that you're trying to reuse your iterator variable from the foreach loop. This is leading to your unexpected results.</p> <pre><code>foreach($category-&gt;product as $product) { ^^^^^^^^ $product = Product::where('id' , '=' , $product-&gt;id )-&gt;get(); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot read property 'roles' of null<p>I want my bot to send a private message to the user that joins my server. </p> <p>To do this I used:</p> <pre><code>...
<p>I don't think you can find roles on members like this. You use the <code>.find()</code> on guilds (<code>member.guild.roles.find(r =&gt; r.name == "Admin")</code>)</p> <p>If you want to check if they got the corect role something like this should work:</p> <pre><code>let adminRole = message.guild.roles.get("ADMIN_...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use the bash script for directory structure?<p><strong>The Brief:</strong> I'm trying to make a directory structure using Automator on mac <a href="ht...
<p>So this solved my problem:</p> <pre><code>DIR="$1" CLIENT="$2" TMONTH="$(date -j +%d_%B_%Y)" mkdir -p ${DIR}/${CLIENT}/${CLIENT}_Social_Media/${CLIENT}_${TMONTH}/${CLIENT}_Calendars mkdir -p ${DIR}/${CLIENT}/${CLIENT}_Social_Media/${CLIENT}_${TMONTH}/${CLIENT}_Design/${CLIENT}_OpenFiles mkdir -p ${DIR}/${CLIENT}/$...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: FAILED: SemanticException Column line_id Found in more than One Tables/Subqueries<p>I got the following error while the running this hive script.</p> <pre><...
<p>Your WHERE clause references <code>line_id</code>, which is ambiguous because it could either be from <code>dt1</code> or <code>dt2</code>. You will need to change it to either <code>dt1.line_id</code> or <code>dt2.line_id</code>, depending on which you intended to refer to.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PyQt4 Press a Button to Launch a Batch file and Collect its Output<p>I have a problem and I would really appreciate any kind of help!I am using PyQt4 and Pyt...
<p>Use subprocess module to load and execute the batch</p> <p>This <a href="https://stackoverflow.com/questions/1818774/executing-a-subprocess-fails">thread</a> might help you</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: resample dataframe by months from current's date<p>I am trying to modify my dataset to be organized by monthly dates in order to make predictions later. The ...
<p>You can use <code>pd.cut</code> to group periods of 30 days in the past from today. </p> <pre><code>import pandas as pd today = pd.to_datetime('today').normalize() freq = '30D' # Size of the bins Nbin = (today - data1['Date'].min())//pd.Timedelta(freq) + 1 # Number of bins bins = [today - n*pd.Timedelta(freq) f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use CDN hosted highlight.js using Rails?<p>Where do I place the following links to get highlight.js to work on my Rails application (<a href="https://...
<p>on <code>app/views/layouts/application.html</code></p> <p>In the middle of head tags.</p> <p>Sometimes is hard to identify something in the many things you need to learn about Rails.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to parse a XLS file in python which contains HTML code?<p>I have downloaded a dataset which gives you .XLS files but when I open it using the notepad I s...
<p>One option would be to open the file in Excel and save it in .xlsx format. You could read it directly into a dataframe like this:</p> <pre><code>import pandas as pd df = pd.read_excel('2rpyAZhE.xlsx') </code></pre> <p>Another option would be to use BeautifulSoup. Something like this:</p> <pre><code>from bs4 impor...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why do Windows and Linux have different strdup implementations: strdup() and _strdup()?<p>When working with <code>strdup</code> on Windows I found out that <...
<p>There are several functions that are part of the POSIX specification, i.e. Linux and most other UNIX variants, that are not part of standard C. These include <code>strdup</code>, <code>write</code>, <code>read</code>, and others.</p> <p>The reasoning for the leading underscore is as follows, taken from the <a href...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I take advantage of parallel processing in gcloud?<p>Google Cloud offers a virtual machine instance with 96 cores. </p> <p>I thought that having thos...
<p>In your specific use case I think one of the solutions is to use <a href="https://cloud.google.com/solutions/using-clusters-for-large-scale-technical-computing" rel="nofollow noreferrer">Clusters</a>.</p> <p>There are two main types of cluster computing workloads, in your case since you need to index 14 billion wor...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python: isinstance() undefined global name<p>I'm new with Python and I'm trying to use classes to program using objects as I do with C++.</p> <p>I wrote 3 ....
<p>As pointed in some comment, circular dependencies are not well handled if imported in the form <code>from a import A</code>.</p> <p>In short, the problem with <code>... import *</code> is that is causes the local scope to have all its declarations overridden, in effect making the identification of from which module...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why default java max heap is 1/4th of Physical memory?<p>I have read couples of articles on java heap space and found out that the default max heap for JVM i...
<p>This dates back to JDK 5, which introduced JVM ergonomics. Prior to this, the JVM would set very small defaults for the heap space. JDK 1.1 had a default of 16Mb for both Xms and Xmx, JDK 1.2 changed this to Xms of 1Mb and Xmx of 64Mb by default. In JDK 1.3, Xms default increased to 2Mb.</p> <p>Since Java was pro...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Return deleted records from function<p>I'm trying to return the Id of a deleted record from within a function.</p> <pre><code>CREATE OR REPLACE FUNCTION del...
<p>Since there was a cascade delete placed on users there was actually never a person record deleted. However, if knowing if that delete on users was successful, the following return query solution gives exactly back what was needed. </p> <pre><code>CREATE OR REPLACE FUNCTION delete_person(_person_id UUID) RETURNS...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to insert a name with apstrophe in SQLite<p>I am trying to insert <code>Gandhi's Salt March</code> as the Name in the Name column of my database. I have ...
<p>Wrong: <code>givenString = givenString.replace("'", "\\'");</code><br> Right: <code>givenString = givenString.replace("'", "''");</code></p> <p>Note: If you use bound parameters (<strong>?</strong>) in your query, this <strong>MUST NOT</strong> be done (binding will automatically manage all the apostrophes in strin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i get text value from TextField while using a ViewModelProvider?<p>I have a form (a bunch of TextField widgets), i get the data from a REST API and l...
<p>Thanks to Thiago Dong Chen i managed to find the solution to my problem.</p> <p>Thiago suggested that i create a <code>TextEditingController</code> variable and set its text value in <code>onModelReady</code> as follows</p> <pre><code>onModelReady: (model) { myController.text = model.settings == null ? '' : mode...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular.js filter by exact values (strict equality)<p>I have following html code</p> <pre><code> &lt;ul ng-repeat="friend in friends | filter: { age: '2' }...
<p>As of Angular 1.2, you just need to add the strict parameter (true) to the filter so that it looks for an exact match, and pass <code>2</code> as a number instead of a string: <code>filter:{age:2}:true</code></p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: associating a topic attribute to a bookmark<p>I'm trying to create a new Bookmark so its associated with a Topic. Everytime I try and do so, my <code>topic_i...
<p>@BartDangus,</p> <p>You need to pass the Topic ID in the params. Otherwise, there is no way to know which topic the Bookmark is to be associated. It makes the most sense to nest Bookmark under Topic so that the Topic ID is always sent. I read in the comments that you unnested Bookmark from Topic; can you elaborate ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how can I validate a single form field in flutter<p>I have a form with multiple controls but spreaded over mulitple tabs. If the user clicks a button I like ...
<p>To validate individual form field create key with <code>FormFieldState</code> type, assign that key to form field and call <code>validate</code> method on key's current state:</p> <pre class="lang-dart prettyprint-override"><code>class MyCustomForm extends StatefulWidget { @override MyCustomFormState createStat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get params from PUT or DELETE request from ZEND_HTTP_CLIENT request<p>I want to get params from my PUT or DELETE request sent with Zend_Http_client like this...
<p>Finally I found this solution : in Zend/Controller/Plugin/ you can find PutHandler.php . It can be used to get PUT params using $this->getRequest()->param_name. Include it in your boostrap.php file with this : </p> <pre><code>protected function _initRestRoute() { $this-&gt;bootstrap('frontController'); $fr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: fgets clears the contents of my C file and doesn't allow me to print to a file<p>I'm making a simple c program to add, display and modify records for a stude...
<p>you are writing the file named on the command line <code>argv[1]</code>, but do you mean to be reading stdin? That won't read what you just wrote.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error passing a value between 2 subroutine<p>I'm trying to pass a <strong>String</strong> between 2 sub in VBA, but everytime I got a compilation Error</p> ...
<blockquote> <p>The routine declaration does not match the description of the event or routine of the same name</p> </blockquote> <p>You are getting the error because <code>ComboBox1_Change</code> doesn't support passing of arguments. <code>ComboBox1_Change(ByVal value As String)</code> should be <code>ComboBox1_Cha...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to apply partition by and row_number() on inner join and case statement in sql query<p>I have a sql query </p> <p><div class="snippet" data-lang="js" da...
<p>Made few changes </p> <p>Removed unwanted brackets in <code>Join</code> condition. Also there was a mistake in <code>Join</code> without <code>ON</code> condition, corrected it </p> <p>Then kept only the <code>join</code> conditions in <code>On</code> clause moved the filters to <code>where</code> clause.</p> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Intellij thinks TypeScript function names are properties<p>After wrestling with a part of my angular app that just wouldn't work I finally found the culprit ...
<p>There is nothing technically wrong in calling getters/setters properties, they are 'accessor properties' - essentially functions that work on getting and setting a value, but look like regular properties to an external code. And marking them unused is expected if they are not used anywhere in your code - this is a w...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Querying and linking to from join tables<p>Two Questions:</p> <p>1) I have a retreats/:id view where I can display the team names that are affixed to a spec...
<p>First part can be done this way</p> <pre><code>&lt;% retreat.teams.each do |team| %&gt; &lt;%= link_to(team.name, team_path(team.id)) %&gt; # or whatever the path helper is &lt;% end %&gt; </code></pre> <p>Second part, you can run this query instead</p> <pre><code>@teams = Team.where(retreat_id: @retreat.id).i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: the numbers appearing closest to integer x in the vector<int> v1 must be printed first<p>Below there is a tabular view of a sorted vector.</p> <p><strong><c...
<p>Elaborating on what <a href="https://stackoverflow.com/a/60155329/8735401">Aconcagua</a> suggested:</p> <pre><code>#include &lt;algorithm&gt; #include &lt;iostream&gt; #include &lt;iterator&gt; #include &lt;vector&gt; struct sortClosestToFunctor { explicit sortClosestToFunctor(int x) : m_x{x} {} bool operato...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sorting timestamp in descending order in mongodb<pre><code>Product.find({ userId: data.id },null,{ $sort :{ createdOn : -1}},function(err...
<pre><code>Product.find({ userId: data.id },null,{ sort :{ createdOn : -1}},function(err, products) {...}); </code></pre> <p>I only have to remove $ from $sort it works fine for me now :) </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: dotnet is not recognized as the name of a cmdlet (MacOS)<p>This is a really weird thing that happens to me now and then. When using visual studio on mac and ...
<p>I had the same issue. It happens randomly. Lost a couple of hours from my life until I found a workaround that solves the issue.</p> <p>I am using: </p> <ul> <li>NuGet Package Manager Console (NuGet 5.6.0.5)</li> <li>in Visual Studio for Mac COMMUNITY Version 8.6.1</li> <li>and use it for Entity Framework commands...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Js check if the location is in my site with cross domain<p>I have an iframe that linked to other site and when the user press a button there is redirect to m...
<p>Probably simplest to catch the error and retry again after a <code>setTimeout(..., 10)</code>, until it stops happening (perhaps with an upper limit; e.g., if you keep trying for more than 30 seconds, give up).</p> <p>E.g.:</p> <pre><code>function checkForFrame(callback) { var timeout = Date.now() + 30000; // ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Modelica comments<p>Does the Modelica specification forbid the type of comments as given in the following example code? The tool I am using moves the commen...
<p>If you're using OpenModelica then the comments will be moved around unfortunately. We are planning to fix that but it will take some time.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Schedule design - Wordpress<p>I'm working on a schedule for a gym and i m not sure how to structure it. A week looks something like this:</p> <pre><code> ...
<p>Well i also have a similar idea, why dont you instead use this plugin and make changes to it. <a href="http://codecanyon.net/item/timetable-responsive-schedule-for-wordpress/7010836" rel="nofollow">http://codecanyon.net/item/timetable-responsive-schedule-for-wordpress/7010836</a></p> <p>Or you can even take ideas ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Function With/Without Passing an argument - PHP<p>Below is a function I created for inserting break lines.</p> <p>It works fine like this; br(2); //any numb...
<p>You want to use a default value:</p> <pre><code>function br($i = 1) { $j = 0; while ($j &lt;= $i) { echo '&lt;br /&gt;'; $j++; } } </code></pre> <p>Reference: <a href="http://php.net/manual/en/functions.arguments.php" rel="nofollow">PHP Manual - Function arguments</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Have multiple ranges with different attributes on NSAttributedString<p>I have a multiline UILabel of which I would like to increase the line height, but I al...
<p>in your viewdidLoad Method assign string to self.content :</p> <pre><code>self.content = @"pass your text "; </code></pre> <p>// Remove the First line of your method it is not needed</p> <pre><code>- (void)setContent:(NSString *)content { NSAttributedString *attributedString = [[NSAttributedString alloc] ini...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to debug Spring Security authorization annotations?<p>I have spring security application in which want to enable annotations security (pre and post autho...
<p>Set the log level of org.springframework.security to debug. On invoking the method with annotations, you can find log messages that indicate interceptor being applied, especially look for: DEBUG MethodSecurityInterceptor</p> <p>Updated: That means there is some config difference between your sample app and main app...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Wrong format of Double type with exponential in JSP<p>in my page jsp I have a double property ${ bean.property } but it display like this :</p> <pre><code>1...
<p>use <a href="http://docs.oracle.com/javaee/5/jstl/1.1/docs/tlddocs/fmt/formatNumber.html" rel="nofollow"><code>formatNumber</code></a></p> <pre><code>&lt;%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %&gt; &lt;fmt:formatNumber type="number" maxFractionDigits="5" value="${bean.property}" /&gt; </cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to handle exception in Java without having to go back to the beginning of the try block?<p>I've implemented exception handling in my program, but now the...
<p>If your application is going to have have multiple User inputs then you should have multiple loops to handle each of those inputs since each input has the potential to possibly be wrong and generate an exception. </p> <p>In most cases, if an exception occurs because of User input then the value within the variable ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: $q resolve function not triggering then<p>I thought I was using the <a href="https://docs.angularjs.org/api/ng/service/$q" rel="nofollow">AngularJS $q</a> in...
<p>You need to call <code>$rootScope.$apply()</code>.</p> <pre><code>$q(function(resolve, reject) { resolve(); console.log("This happens"); //This shows that resolve() is being called }).then(function() { console.log("This too!"); }); $rootScope.$apply(); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Save Web page directly to PDF using JS<p>I want to save web page directly to PDF.</p> <p>What I have done is-</p> <p><div class="snippet" data-lang="js" da...
<p>The short answer is no, you cannot prevent users from seeing the option in their browser using just javascript.</p> <p>The slightly-longer answer, is that you <em>can</em> do this with a bit more than javascript.</p> <p>Using a service such as <a href="http://html2canvas.hertzen.com/" rel="noreferrer">html2canvas<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What are the actual runtime performance costs of dynamic dispatch?<p>There's some background on this topic in the Rust book section on <a href="https://doc.r...
<p><em>Disclaimer: the question is fairly open-ended, therefore this answer might be incomplete. Treat it with an even bigger grain of salt than you would normally.</em></p> <p>Rust uses a simple &quot;virtual table&quot; to implement dynamic dispatch. This strategy is also used in C++ for which <a href="https://www.cs...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Making tableView Cells Fall into place one after the other (tableViewCellAnimation)<p>I'm new to obj-C and I have this code which makes the cells slide in fr...
<p>I think you just don't understand how delay and blocks works. Let me try to clear this code:</p> <ol> <li>You go throw all <code>[self.tableView visibleCells]</code> array</li> <li>You call <code>[UIView animateWithDuration:...]</code> method number of times, how much elements in <code>visibleCells</code> array (de...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: An attempt to communicate with Azure DevOps failed because a token could not be retrieved<p>I have projects that I have controlled be Azure DevOps. Every tim...
<p>You may try the following items:</p> <ol> <li>Go to Control Panel &gt; Credential Manager, and remove all Windows Credentials related to TFS.</li> <li>Close all Visual Studio instances, and delete the <code>%LOCALAPPDATA%\.IdentityService</code> folder if it exists.</li> <li>Clear TFS caches <code>%LOCALAPPDATA%\Mic...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JS detects wrong width and height for one particular .mp4 file<p>My issue is that JavaScript is reporting wrong width and height for one particular <code>mp4...
<blockquote> <p>UNIX systems recognize width and height CORRECTLY (607x1080)</p> <p>Windows recognizes width and height INCORRECTLY (1080x1080)</p> </blockquote> <p>Are you ready for this? Both are correct and one is wrong, depending on your definition of rite and wrong.</p> <p>Run this command: <code>MP4Box -diso -st...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Couchbase Lite pull replication fails with error in a sample Couchbase Mobile End to End testing project<p>I am getting started with Couchbase Mobile. The fe...
<p>After a painful journey going through this whole process and getting no clue from the debug logs of emulator, I tried to run the app on a real device and it logged a error log statement which said something to the effect of <strong>not allowed to communicate with the network</strong> (I lost the exact log statement)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extract directory from a file path (Android Java)<p>I want to extract the directory part of a file path in Android. I know I can use </p> <pre><code>File fi...
<p>Ok, after your comment I get what you mean. Just look at the <a href="http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8-b132/java/io/File.java#File.getParent%28%29" rel="nofollow">source</a> (this is from OpenJDK, but I doubt Android will be too different). So, no overhead because of seeking o...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does Acrobat Acroform support internal small database and export to text features?<p>I want to create a editable pdf, using Acroform Technology, with the fol...
<p>Feature 1 is no problem; you may work with arrays, and then convert them to strings you can put in (hidden) fields for saving and reopening the document. </p> <p>Feature 2 will most likely require Acrobat (Pro), as there are still some limitations in Reader.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I change the rate or period of a repeating task using ScheduledExecutorService?<p>I have a modified version of the bluetooth chat sample app. I have ...
<p>I improved the answer a bit (mainly because I too had to use <code>ScheduledExecutorService</code>). Please use this code instead of the previous one I posted, because the previous one was really on performance, for no good reason. </p> <pre><code>private ScheduledExecutorService scheduledExecutorService; private S...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Obtain all possible sums and output list based on values<p>I have a data frame with two columns: <code>LOOKUP</code> which contains an index number, and the ...
<p>One solution involving <code>purrr</code>, <code>tibble</code>, <code>dplyr</code> and <code>tidyr</code> could be:</p> <pre><code>map(.x = 1:nrow(dat), ~ combn(dat$VALUE, .x, paste, collapse = ",") %&gt;% enframe()) %&gt;% bind_rows() %&gt;% rowid_to_column() %&gt;% separate_rows(value) %&gt;% left_join(d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you push updates to a deployed meteor app that has a filesystem?<p>I have an app running on my own digitalocean VM that I'm trying to play around with...
<p>You can use <code>dokku</code> (<a href="https://github.com/progrium/dokku" rel="nofollow">https://github.com/progrium/dokku</a>). DigitalOcean allows you to create an instance <a href="https://www.digitalocean.com/community/tutorials/how-to-use-the-digitalocean-dokku-application" rel="nofollow">pre-installed with d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: structure vector push_back C++<p>I'm having a problem figuring out how to use push_back function to push array elements of a structure into the TeamV vector....
<ul> <li><p>First, you need to change <code>TeamS</code> to have a list of <code>string</code>s for team members, not just one <code>string</code>.</p> <pre><code>struct TeamS { int ID_NUM; std::vector&lt;string&gt; team_members; }; </code></pre></li> <li><p>In the function to initialize <code>teamV</code>:</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ZF2, I18n and dynamic locale not working anymore after update<p>After finally updating Apache 2.2 -> 2.4 and php 5.4 -> 5.5 translation in view is not dynami...
<p>Found the problem. You have to set translator with locale to the view helper:</p> <pre><code>public function onBootstrap($events) { .... $viewRenderer = $events-&gt;getApplication()-&gt;getServiceManager()-&gt;get('ViewRenderer'); $plugIn = $viewRenderer-&gt;plugin('translate'); $plugIn-&gt;setTra...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set child div to parent's height (100%)?<p>This is they layout of the page <img src="https://i.stack.imgur.com/Ew0GP.png" alt="enter image description...
<p>You could wrap news description and image into a single <code>&lt;article&gt;</code> element</p> <p>Then you may assign a <code>border-left</code> to the new inserted element. Doing so you avoid to use empty markup for styling purpose only and you also improve the semantic of the page. </p> <pre><code>&lt;article&...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to create a generic impl for a trait that works with all but one subset of types?<p>I am trying to write a generic method that accepts a funct...
<p>Your attempt does not work because it is not possible to have overlapping implementations of a trait.</p> <p>Below an attempt to write a generic method that accept a <code>Serialize</code> value or an <code>Arc</code> of a <code>Serialize</code> value.</p> <p>It leverages the <code>Borrow</code> trait and its bla...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do i copy and paste data to worksheets that i created in VBA using for loop?<p>Im trying to copy and paste my data and assign them into different workshe...
<p><strong>If your raw data does not have a header row then I would use a loop to gather up your target cells and copy them accordingly.</strong></p> <p>You will need to update your 3 target values inside <code>Arr</code> to <code>Charlie1</code>, <code>Martin1</code>, etc.</p> <p>Macro Steps</p> <ol> <li>Loop throu...