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: Row-wise sum of paired values in 2 identically labelled lists<p>I have two lists Sis1 and Sis2 with identical column names and identical first column values ...
<ol> <li><p>Since you say that they should be added <em>&quot;by the shared Time value&quot;</em>, we cannot use <code>bind_cols</code>, which would require perfect alignment and shared-existence of all <code>Time</code> values. (If this is always the case, then just ignore it ... and pray that your assumption is alway...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to move an image in Flutter/Dart using a draggable<p>I am trying to create a simple children's game that allows the user to click on an image and drag it...
<p>I am not sure if this is the most efficient or best way of doing it but I got the following solution to work. Please let me know if you have a better way!</p> <pre><code>class _DragBoxState extends State&lt;DragBox&gt; { Offset position = Offset(0.0, 0.0); AssetImage apple; AssetImage _imageToShow = new Asset...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: .dialog using buttons values<p>My aim is for the user to press a button, that will then open up a pop-up, where they can select one of two options, the code ...
<p>You should update this:</p> <pre><code>var $self = .showOptions.val(); </code></pre> <p>as</p> <pre><code>var $self = this.value; </code></pre> <p>and i think this is not needed: <code>is 'basicModal'</code> so you can remove it from there. Now the code would be like this:</p> <pre><code>$(".showOptions").click...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Smooth horizontal and vertical scrolling<p>I have started a website in which I need smooth horizontal and vertical scrolling. A menu on the right, so I can c...
<p>Here is an example of how you can do horizontal smooth scrolling to the right when you click a button by using animate() method. Hope this can be useful.</p> <pre><code> $(".downArrow").click(function () { var topPos = $('body').scrollTop(); $("body").animate({ scrollTop: topPos + 800...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting Date only instead of date and time<p>Ok so i have sorted the difference of Dates, it's working great. The problem i am facing now is that when i clic...
<p>From what I understand you want to save up the only date part of the <code>datetime</code> you can do that as below:</p> <pre><code> DateTime AdmitDate = DateTime.Parse(TextBox1.Text); cmd.Parameters.AddWithValue("@AdmitDate", AdmitDate.ToShortDateString()); DateTime DischargeDate = DateTime.Parse(TextBo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kubernetes- Tolerations : node.kubernetes.io/unreachable:NoExecute for 300s<p>I'm new to Kubernetes and I'm struggling with few error. I want to create Kuber...
<blockquote> <p><strong>Note</strong> Kubernetes automatically adds a toleration for <code>node.kubernetes.io/not-ready</code> and <code>node.kubernetes.io/unreachable</code>. </p> <p>Kubernetes automatically adds a toleration for node.kubernetes.io/not-ready with tolerationSeconds=300 unless the pod configu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find string in another string<p>So I have a .txt file with the following format:</p> <pre><code>abc@example.com:number cde@example.com:number efg@example.ru...
<h3>Broken code from question instrumented</h3> <p>With a bare minimum of fixes (so I can get it to compile as C code under my stringent compiler flags), and with diagnostic printing added, this variant of your code:</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;string.h&gt; int main...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Invoke local python script from web browser instance<p>Am working on a python script (env: custom Linux Mint 17.1) that uses a webbrowser class to instantiat...
<p>Since you're using PyQt4 and the QtWebKit module, it's very easy to do so.</p> <p>You create a function that grabs the url and acts accordingly. Here's some sample code to get you started:</p> <pre><code>from PyQt4.QtCore import QUrl from PyQt4.QtGui import QApplication from PyQt4.QtWebKit import QWebView, QWebPag...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to filter ng-options<p>A customer sees all of there documents on a table. Documents has its own service call, I have select boxes that they can use to fi...
<p>Here is a working <a href="http://plnkr.co/edit/UQgd5TTzGft50EnMGhMN?p=preview" rel="nofollow">Plunker</a> demonstrating the below technique.</p> <p><strong>First:</strong> You need to filter your locations in your controller and <code>push</code> to a new array that populates your <code>&lt;select&gt;</code> field...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make send message to particular URI after successfull webscoket connection?<p>I have a secure websocket server running on localhost:443/server-demo ( ...
<p>The code in a question does not establish a WebSocket connection to the server.</p> <p>To establish the WebSocket connection, the application must write a WebSocket handshake to <code>conn</code> and receive the handshake response. See the <a href="https://www.rfc-editor.org/rfc/rfc6455" rel="nofollow noreferrer">R...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to calculate the top offset of hidden elements?<p>I have elements hidden and i want calculate the top offset it how this is done? i try this code but giv...
<p>From jQuery API: <a href="https://api.jquery.com/offset/" rel="nofollow noreferrer">https://api.jquery.com/offset/</a></p> <blockquote> <p><strong>Note:</strong> jQuery does not support getting the offset coordinates of hidden elements or accounting for margins set on the <code>&lt;html&gt;</code> document elem...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: iOS know when touchesEnded if touches on top of certain view<p>I have to do some "snap to grid" behaviour,</p> <p>I have a dragging image "sprite", but I ne...
<p>touched.view is the view on which the touch started. You want to find out if the location where the touch ended is on top of a specific button. You can do this by checking if the location of the touch relative to the button is within the button's bounds.</p> <pre><code>- (void)touchesEnded:(NSSet *)touches withEven...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I show only the column name of the SQL table<p>Currently my code consists of</p> <pre><code>$sql = "SHOW columns FROM tblexercise"; $result = mysqli_...
<p>You don't need a loop inside a loop. You only need one <code>foreach</code> loop and then you can access the key <code>Field</code> which holds the name of the column. The query <code>SHOW COLUMNS</code> is explained in the <a href="https://dev.mysql.com/doc/refman/8.0/en/show-columns.html" rel="nofollow noreferrer"...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React Native - Get file name from android content uri<p><Br> I need to get file name from android content uri, for example: <Br> content://com.android.provid...
<p>I not found pure solution in react native, so I created native package in android and created module in react native from so I can use it. <Br> This the the android code:</p> <pre><code>@ReactMethod public void getFileNameFromUri(String filepath, Promise promise) { Uri uri = Uri.parse(filepath); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to determine in PgAdmnin if a database is completely restored?<p>When PgAdmin III displays a list of databases, a database in the middle of restoring loo...
<p>If by restore you mean pg_restore command in progress you cannot see that directly from pgAdmin. What pg_restore does in fact is execute simple CREATE TABLE, INSERT or COPY commands that differ in no way from normal commands. What you can do is you can open the <a href="http://www.pgadmin.org/docs/1.8/status.html" r...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: API threads and static methods<p>I have an APIController handling post requests that is calling a static method in a static class that I want to return the n...
<p>You can use a lock</p> <pre><code>static object SpinLock = new object(); lock(SpinLock) { //Statements } </code></pre> <p>In your case</p> <pre><code>hat I am trying to do is find a way to lock the static method so it can process 1 thread at a time so no matter how many simultaneous calls come in the static m...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In this AWS CLI command, why copying files with --exclude & --include wildcards not working?<p>In the following directory, I want to upload only the <code>.h...
<p><a href="https://stackoverflow.com/users/264812/josedasilva">josedasilva</a> is right, you need to use the <code>--recursive</code> flag. Now, to only include only the current directory files, you need to mix some include and exclude flags. </p> <p>This should do the job:</p> <pre><code>aws s3 cp --recursive ./ s3...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get elements in list and get next item using LINQ in C#?<p>In my application I have <strong>version</strong> list which is string. Json result looks l...
<p>When working with versions, why not use <code>Version</code> class?</p> <pre><code> string[] data = new string[] { "v2.9.0", "v2.10.0", "v2.11.0", "v2.12.0", "v2.13.0", "v2.14.0", "v2.15.0", "v2.16.0", "v2.1.0", "v2.2.0" }; string[] sorted = data .OrderBy(item =&gt; Version.Parse(Regex.Match...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TaskCanceledException encountered<p>I was trying to Update my Local Repository using Git Bash but I'm not able to do the. Even though I made a sync few hours...
<p>Check first if you have <a href="https://help.github.com/en/github/authenticating-to-github/securing-your-account-with-two-factor-authentication-2fa" rel="nofollow noreferrer">2FA (2 factor authentication)</a> activated.</p> <p>If you do, then you would need to enter a <a href="https://help.github.com/en/github/aut...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does MotionLayout support Shared Element Transitions between fragments?<p>I'm considering refactoring my code to use MotionLayout for animations, but at the ...
<p>To answer your question as concisely as possible, yes MotionLayout does support shared elements. However, your current code will likely need some reworking to get it to happen. MotionLayout does shared element transitions by interpolating between two defined constraints for any given view. So you can definitely have...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to generate Swagger 1.2 JSON with .NET Web API<p>We're trying to generate Swagger 1.2 spec JSON for our .NET Web API. I've tried using Swashbuckle, but i...
<p>Not really sure why you want to use Swagger 1.2 over Swagger 2.0, but you can still use Swashbuckle, only an older version of it such as <a href="https://github.com/domaindrivendev/Swashbuckle/tree/v4.2.0" rel="nofollow">https://github.com/domaindrivendev/Swashbuckle/tree/v4.2.0</a>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Print array of chars by F() makro<p>To reduce the usage of SRAM on my Arduino I'd like to print some text via the F() makro:</p> <pre><code>void setup() { ...
<p>In your example, <code>text</code> is a mutable <code>char[]</code>. Moving that to flash would be problematic. Changing the mutable in runtime, <code>text[0] = 'I';</code>, would not work as promised. Use the macro with a <code>const char*</code> instead - and do it around the string literal you want flashed.</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error: Call to a member function viewVars() on array on CakePHP<p>I am trying to send an email with cakephp. My setup code is below. It doesn't matter if I s...
<p><code>Application.from_email</code> does not exist or is <code>null</code>, causing <code>CakeEmail::from()</code> to receive <code>null</code> as an argument, resulting in it acting as a getter, ie it will return the current <code>from</code> value, which is an array, hence the error.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript output used for a rails condition<p>The following javascript returns the viewport of a browser:</p> <pre><code>&lt;script&gt; $(document).read...
<p>You would need a time travel device for this to even be remotely possible. The view is rendered on your server long before the page is even sent to the client. The only way the server would know the viewport size is if you sent it in the request. And thats not exactly ideal as the viewport size may change after the ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ng-touched not working - AngularJS<p>Form fields not being added <code>ng-touched</code> class, instead remains <code>ng-pristine</code></p> <p>This is my f...
<p>The term <code>pristine</code> and <code>touched</code> are not similar. An input will remain <code>pristine</code> as long as it has not been modified. It is <code>untouched</code>, as long as it didn't loose focus - <a href="https://docs.angularjs.org/api/ng/directive/ngModel">Angular doc states</a> that <code>ng-...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python: IndexError: index (7) out of range (0<=index<7) in dimension 0<p>this problem probably has a simple cause, but I don't see it now, and maybe someone ...
<p>If the index range is 0&lt;=index&lt;7, that means that the dimension for that range is 7, not 8. Check what the shape of your matrix actually is at that time, and make sure it wasn't mistakenly created too small.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: LPCXpresso error CreateProcess: No such file or directory<p>I know there are multiple questions regarding this subject, but they did not help. When trying to...
<p>It seems your problem is a happy mess with Vista and GCC. Long story short, a CRT function, <code>access</code>, has a different behavior on Windows and Linux. This difference is actually mentioned on Microsoft documentation, but the GCC folks didn't notice. This leads to a bug on Vista because this version of Windo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What process reads blocks to the buffer cache?<p><strong>DBWR</strong> processes write dirty blocks from the buffer cache to the data files. <br> Documentati...
<p>From the <a href="https://docs.oracle.com/cd/E11882_01/server.112/e40540/process.htm#CNCPT1248" rel="nofollow">overview of server processes</a>:</p> <blockquote> <p>Oracle Database creates server processes to handle the requests of client processes connected to the instance. A client process always communicates w...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get value from select Angular 8.2. ( FormBuilder )<p>I want to take the "id" of a select I have with Angular 8.2</p> <pre><code> &lt;select (change)='chang...
<p>I think you should use value: </p> <pre><code>&lt;select (change)='changeProvider($event)' class="form-control" id="field_provider" name="provider" formControlName="providerId"&gt; &lt;option *ngFor="let providerOption of providers; [value]="providerOption.id" trackBy: trackById"&gt; {{ provide...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PostgreSQL result of first query used in second query<p>Sample Data:</p> <pre><code>|lastmodified|Number1|Number2|password_mod| |2020-01-25 |250000 |100000...
<p>One intuitive/user-readable way to write the query would be with a CTE:</p> <pre><code>WITH userlist AS ( SELECT a.lastmodifiedat AS Aenderungs_Datum, a.lastmodifiedby AS Aenderungs_User, a.ntusername AS Betroffener_User, a.anweisungshoehekv AS AnweisungshoeheKV, a.anweisungshoehepflege AS Anw...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Query for selecting all customers with the total number of orders in a specific range<p>As the title says, I want to select all customers with the total numb...
<p>Try this, you can get rid of the <code>where</code> clause:</p> <pre><code>select c.id, c.first_name, c.last_name from customers c inner join orders o on o.customer_id = c.id group by c.id, c.first_name, c.last_name having count(*) between 3 and 6; </code></pre> <p>or another version, depending on your preference:...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to fix " 'float' object is not subscriptable"<p>Hello I have an issue with my code :</p> <pre><code>xor_inputs = [(0.0, 0.0), (0.0, 1.0), (1.0, 0.0), (1....
<pre><code>xor_outputs = [(0.0,), (1.0), (1.0), (0.0)] </code></pre> <p>The first element in this list is a tuple with a single float because of the trailing comma. However, the rest of them are floats.</p> <p>You don't really need tuples here, though. You can just do</p> <pre><code>xor_outputs = [0.0, 1.0, 1.0, 0.0...
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 Factory pattern to refactor my Java code?<p>I would like to use the Factory pattern to make a new method addShip this determines in running...
<p>If you want to use Factory pattern in your code, you should do the following:</p> <ol> <li>Extend all your <code>Ship</code> classes from abstract class <code>Ship</code>.</li> <li>Create an abstract class <code>AbstractShipFactory</code> which has a method <code>Ship createShip(int, int, int)</code>.</li> <li>Crea...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to wrap a function which contains hooks with HoC<p>As the title suggest I want to be able to wrap a function (which contains) hooks in a HoC.</p> <p>In ...
<blockquote> <p>Concretely, a higher-order component is a function that takes a component and returns a new component. <a href="https://reactjs.org/docs/higher-order-components.html" rel="nofollow noreferrer">react docs</a></p> </blockquote> <p>so, you have to have a function that returns a component, maybe like...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: GHC TypeLits without values<p>Trying to design a type-driven API, I've been trying to get something like the following working (using much more complicated c...
<p>Type synonyms (defined with <code>type</code>) are replaced with their definition during typechecking. The problem is that <code>Printer</code> has no reference to <code>s</code> in its definition, which leads to the following constraint:</p> <pre><code>generic :: KnonwSymbol s =&gt; IO () </code></pre> <p>This ty...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Rselenium with firefox and socks5h<p>I'm using the RSelenium package to connect to firefox, but I wish to do it via a socks proxy.</p> <p>In Python, t...
<p>Not tested but something like the following should work:</p> <pre><code>fprof &lt;- makeFirefoxProfile(list( "network.proxy.socks" = "squid.home-server" , "network.proxy.socks_port" = 3128L , "network.proxy.type" = 1L ) ) remDr &lt;- remoteDriver(extraCapabilities = fprof) remDr$open() </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ListView: Populate listview with images from JSON<p>I have a listview which works perfectly when it comes to displaying all the text from a database through ...
<p>Its good practice to work with objects in Java thus first create a new class named UserBook with the following code :</p> <pre><code>public class UserBook { private String name; private String BName; private String imageUrl; public UserBook() { } public String getName() { return name; } public void setName(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular isState - how to make comparision inside ng-if?<p>THE SITUATION:</p> <p>Hello guys. I am using isState for my angular app.</p> <p>This is the docum...
<p>Just put the filter expressions into parenthesis and OR them:</p> <pre><code>ng-if="('is_A' | isState) || ('is_B' | isState)" </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CORS Origin Request not allowed React Express<p>I am using react &amp; express for a simple form and i get this when i post my react form to express server<...
<p>CORS requests that has <code>credentials: true</code> will not work with <code>origin: "*"</code>. If you wish to include credentials, then you need to specify your origin, which also do not work with localhost. Therefore I would recommend not including credentials unless your application is hosted online.</p> <p>S...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: add new header to iframe<p>how do i add a new header for every outgoing request only for trusted request</p> <pre><code> chrome.webRequest.onBeforeSendHe...
<p>Read <a href="https://developer.chrome.com/extensions/webRequest" rel="nofollow">the documentation</a>. Emphasis mine:</p> <blockquote> <p>If the optional <code>opt_extraInfoSpec</code> array contains the string <code>'blocking'</code> (only allowed for specific events), the callback function is handled synchrono...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Tiled Map Editor: Make isometric tiles connect seamlessly/remove staircase effect<p>I am using the TiledMap editor, with a set of Tiles I got from opengamear...
<p>The editor "blindly" renders rows of tile-images, These rows are too far apart, leading to this staircase effect. Reduce the map tile height (65 in your screenshot) so that it fits.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: getSheetValues not returning data Google Script<p>The log for my script returns no information. I've copy-pasted this script with minimal changes from this <...
<p>The functions <code>stripArray(values)</code> and <code>testSheet()</code> should be seperate functions. Try This code below:</p> <pre><code>function stripArray(values) { return values.filter(function(d) { return d.length &amp;&amp; d[0] !== ''; }); } function testSheet() { var ssId="1kR...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to disable MATLAB GUI elements DURING (not AFTER) processing a function<p>It's my first post here, so hello everyone! </p> <p>My question is about MATLA...
<p>Try using the <a href="http://www.mathworks.com/help/matlab/ref/drawnow.html" rel="nofollow">drawnow</a> command after your initial enabling/disabling of GUI controls and before the line:</p> <p>%%%%%%%%%%%%%%%%%%%% HERE FUNCTION DOES SOME STUFF %%%%%%%%%%%%%%%%</p> <p>This should cause MATLAB to flush the queued ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL: How to get array of IDs from most common values in a table?<p>I have the most counts of each value in a column like so:</p> <pre><code>SELECT col, COUN...
<p>You can get an array for each <em>col</em>:</p> <pre><code>SELECT col, COUNT(*), ARRAY_AGG(id) as ids FROM table GROUP BY col ORDER BY COUNT(*) DESC; </code></pre> <p>You can fetch the first row of the above query:</p> <pre><code>SELECT col, COUNT(*), ARRAY_AGG(id) as ids FROM table GROUP BY col ORDER BY COUNT(*)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Objective-C && doesn't short circuit for !var<p>Try running this:</p> <pre><code>UIView *testView = nil; NSLog(@"Take 1"); NSString *message = @"view doesn...
<p>The output you see is correct and the short-circuit behavior is working correctly too.</p> <p>When boolean expressions are evaluated the result is considered to be true if the expression is not 0 or false if it is 0. So everywhere where you have <code>if (something)</code> you can read this as <code>if (something !...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to use refresh html header through php through shell<p>I wrote a php script that refresh automatically to do a long process. To do that, I use:</p> <pre...
<p>I answer my question but I would like to thanks you all for the helpfull tips.</p> <p>As HTML headers can't be used by calling php though shell, I wrote a script that get the refresh header sent and sleep the time needed before calling again the php script.</p> <pre><code>#!/bin/bash my_bash_function() { respon...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why do we do toString('hex') after crypto?<p>Why do we convert to string after hashing the password?</p> <p><code>u.password = crypto.pbkdf2Sync(password, s...
<p>The result of <code>crypto.pbkdf2Sync</code> is a binary value: harder to store, represent, pass over. Thus you can safely turn it to a hex representation, which is much more user friendly.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Apache NiFi - Process content of a CSV S3Object<p>I am trying to process a CSV stored in a S3 Bucket with Apache NiFi. </p> <p>For this aim I am using the f...
<p>Finally I found the way to fix the problem.</p> <p>Using SplitText processor after FetchS3Object is possible to split line by line (count = 1) and process each line after that processor.</p> <p><a href="https://i.stack.imgur.com/x68Ql.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/x68Ql.png" al...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: for information retrieval course using python, accessing given tf-idf weight<p>I am doing this python program where i have to access : This is what i am tryi...
<p>So, if I'm understanding you correctly, we have to transform the input dictionary:</p> <pre><code>ind = {'a':[ [1,3] ], 'b': [ [1,4 ] ] } </code></pre> <p>To the output dictionary:</p> <pre><code>{1:5} </code></pre> <p>Where the <code>5</code> is calculated as the euclidian distance for the value portion of the inpu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set up my Kafka Connect in distributed mode for better perofmance<p>I am running my Kafka connect for Elastic search in distributed mode . Currently i...
<blockquote> <p>i have 2 EC2 instance </p> </blockquote> <p>So you can only run 2 workers. Add more (in different AZs) for better fault tolerance. You need to add CPU and memory monitoring to know if you should add more instances. </p> <blockquote> <p>running kafka connect on above instance type with max task as...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Scroll to added content<p>I have a problem with automatic scrolling down to recently added content. For example, this code doesn't scroll to just added ListT...
<p>try this</p> <pre><code>class _HomePageState extends State&lt;HomePage&gt; { ScrollController _controller = ScrollController(); List&lt;Widget&gt; tiles = []; int n = 0; @override Widget build(BuildContext context) { return Scaffold( body: GestureDetector( onTap: () { setState...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Read csv with timestamp to R. Define colClass in table.read<p>I'm trying to read a table (.CSV 120K x 21 wide) assigning object classes to columns with:</p> ...
<p>For an unconventional date-time format, one can import as character (step 1) and then coerce the column via strp (step 2)</p> <p>step 1</p> <pre><code>df &lt;- read.table(file = "data.csv", header = TRUE, sep = "," , dec = "." , ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: django-rest-framework-simplejwt disable refresh<p>Is there a way to disable refresh token?</p> <p>Take away refresh field from the response.</p> <p><a href...
<p>Thank you @alamshafi2263. I think you give the perfect direction. </p> <p>Don't know why, I still git the <code>refresh</code> item from server response, not Django Shell. (also see the debug variables in photo). So I just simply <code>data.pop('refresh', None)</code> it out, then problem solved.</p> <p>Thank you ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Where did ConcurrentDictionary.ForEach go?<p>Context: C#, VS, Unity</p> <p>We updated Unity from 4.0.1 to 5.11.3. Now the ForEach-method on a ConcurrentDict...
<p>I ended up writing an extension.</p> <pre><code>public static void ForEach&lt;T&gt;(this IEnumerable&lt;T&gt; list, Action&lt;T&gt; action) { foreach (var item in list) { action(item); } } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: GridView Page Index Change Event causes JavaScript runtime error<p>On Page Index Change Event of GridView, the following error is caused.</p> <pre><code>Jav...
<p>From your ScriptManager control, add the following attribute and it's value:</p> <pre><code>&lt;asp:ScriptManager runat="server" EnablePartialRendering="false" /&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: browserify with noparse=true - how it works<p>I would like to ask what is the purpose of using browserify with <strong>noparse</strong> option set to <strong...
<p>Normally when you bundle a file with browserify, it parses the file for <code>require()</code> calls so it can build a dependency graph and bundle the required files. The purpose of the <code>noParse</code> option is to skip that parsing when you don't need or want it. For example, if you're bundling a large library...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Event is not triggered after adding new elements<p>I have HTML list:</p> <pre><code>&lt;ul&gt; </code></pre> <p>contains initial items of:</p> <pre><code>...
<p>You need to use event delegation for dynamically added DOM elements as shown below :-</p> <pre><code>$(document.body).on("click",".favorite-btn",function(){ alert("Yes!"); }); </code></pre> <p>OR</p> <pre><code>$("ul#id").on("click",".favorite-btn",function(){ alert("Yes!"); })...
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 the output of previous step in the same script<p>The script runs two scripts depending on the output of the first script, i want to c...
<p>A common arrangement is to write your scripts so that programmatic operation is convenient. In concrete terms, that means that your script should return a zero exit code on success, nonzero otherwise. Then what you ask for is a simple matter of</p> <pre><code> script1 &amp;&amp; script2 </code></pre> <p>or in more...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a way I could reduce the code required to start / stop a stopwatch and measure milliseconds?<p>Currently my code is decorated with a lot of code lik...
<p>You could have a method declared in a static class which accepts your action, and times it.</p> <pre><code>using System; using System.Diagnostics; public static class MethodTimer { public static double CalcTime(Action action) { var stopWatch = new Stopwatch(); stopWatch.Start(); act...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: webgl drawArray intermediate results<pre><code> setMatrixUniforms(); gl.drawArrays(gl.TRIANGLES, 0, triangleVertexPositionBuffer.numItems); </code></p...
<p>A simple solution is to recalculate the positions outside of WebGL with plain javascript and your matrix library.</p> <p>For instance if you want to know what the point (0, 0, 0) becomes after you apply the model view matrix you would just multiply it with that matrix.</p> <pre><code>var point = [0, 0, 0]; var res...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the equivalent of Android TextView in iOS?<p>When I searched for "Android TextView equivalent in iOS" in Google and StackOverflow I expected to find ...
<p>The equivalent of an Android <code>TextView</code> in iOS is <code>UILabel</code> and <code>UITextView</code>. The one you want for large amounts of text is <code>UITextView</code>. Below are descriptions taken from the documentation:</p> <p><a href="https://developer.apple.com/library/ios/documentation/UIKit/Refer...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Search index of one Dimensional array in two dimensional array and return row by row java<p>I've got a problem is that I have an array one dimensional </p> ...
<p>I hope I understood the issue correctly. </p> <pre><code> String[] purposeAll= {"P1","P2"}; //String[] purposeAll= {"P3","P1"}; Testing Stuff. String[][] purpose = { { "P1", "a", "b", "c", "d", "e", "f", "h" }, { "P2", "a", "b", "c", "d", "e", "g", "i" }, { "P3", "l", "m", "n", "o", ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error starting Spring boot application with ElasticSearch<p>I want to use ElasticSearch with Spring Data. I am using Spring 5, Spring Boot 2 and ElasticSearc...
<p>My solution: config:</p> <pre><code>@Configuration @EnableElasticsearchRepositories(queryLookupStrategy = QueryLookupStrategy.Key.CREATE_IF_NOT_FOUND) public class ElasticSearchConfig { @Bean RestHighLevelClient elasticsearchClient() { RestHighLevelClient client = new RestHighLevelClient(RestClient....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python C API Boolean Objects<p>I am using Python C API 2.7.2 with my C++ console application. There is one doubt regarding Python C API Boolean Objects</p> ...
<blockquote> <p>It needs to be treated just like any other object with respect to reference counts.</p> </blockquote> <p>This means that you <strong>must</strong> incref it when you take its reference</p> <pre><code>{ Py_INCREF(Py_True); PyObject* myVariable = Py_True; </code></pre> <p>and you <strong>must</st...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Plotly: How to add elements to hover_data using plotly.express piechart?<p>I am playing with examples from plotly.express <a href="https://plot.ly/python/pie...
<p>This seems to be a <a href="https://community.plot.ly/t/customdata-for-pie-chart-is-undefined/6021" rel="nofollow noreferrer">relic</a> from back when it was stated <a href="https://github.com/plotly/plotly.js/issues/2048" rel="nofollow noreferrer">that</a></p> <blockquote> <p>Oh pie hover is a big mess</p> </blo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sort array with special character javaScript<p>I have the following array. How can I sort it properly? I tried the following:</p> <pre><code>var array = ["1...
<p>You can call <code>parseInt</code> on the arguments, which will take only the initial numeric part of the argument (dropping the <code>:</code> and anything past it, if it exists):</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre cl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why JSON data from decoder to become UITableView datasource does not assigns?<p>Recently got stuck on a problem of assigning freshly downloaded JSON data to ...
<p>First of all delete</p> <p><strike></p> <pre><code>print(self.tableData?.list.count) // returns nil self.tableData = weatherGetter.getMowForecast(completion: ((tableData, true))) // error - Cannot convert value of type '(WeatherForecast?, Bool)' to expected argument type '((WeatherForecast?, Bool)) -&gt; Void' </...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: installing an archived package<p>The package is available on this website. <a href="http://cran.r-project.org/src/contrib/Archive/rlandscape/" rel="nofollow"...
<p>This is an old (archived) package that is no longer supported. If you really need it, you can install it using <code>R CMD INSTALL</code> but you need also to install all its dependencies manually.</p> <p>Installing your desired package gave me the following:</p> <pre><code>&gt;R CMD INSTALL ~/Downloads/rlandscape...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Visual Studio c# open console from windows form<p>I have a visual studio project in c#, And i'd like to be able to launch console applications from my window...
<p>The first part is easy. To run a program, <em>any</em> program, from C#, just use <a href="https://msdn.microsoft.com/en-us/library/system.diagnostics.process.start%28v=vs.110%29.aspx" rel="nofollow"><code>Process.Start</code></a>:</p> <pre><code>Process.Start("myApp.exe"); </code></pre> <p>The second is <em>much<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pass params to js function in polymer view<p>i have a polymer paper-checkbox, which triggers js function with on-change attribute.</p> <p>my-component.html:...
<p>Sadly, no. One way of getting around this is to add data-... attributes to your element and get them from the sender in your function.</p> <pre><code>&lt;paper-checkbox on-change="{{ boxChange }}" data-arg1="test"&gt;&lt;/paper-checkbox&gt; Polymer('my-component', { boxChange: function(event, detail, sender) {...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Synchronous loop with async calls<p>This is what I need to accomplish:</p> <p>I have a function (we will call it <code>thePromise</code>) that returns a pro...
<p>You need to use <a href="https://github.com/caolan/async#eachSeries" rel="nofollow">async.eachSeries</a>, from the docs:</p> <blockquote> <p>The same as <a href="https://github.com/caolan/async#each" rel="nofollow">each</a>, only iterator is applied to each item in arr in series. The next iterator is only called ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bug in pandas query() method?<p>I was experimenting several use cases for the pandas query() method, and tried one argument that threw an exception, but yet ...
<p>It looks like you had a typo, you probably wanted to use <code>==</code> rather than <code>=</code>, a simple example shows the same problem:</p> <pre><code>In [286]: df = pd.DataFrame({'a':np.arange(5)}) df Out[286]: a 0 0 1 1 2 2 3 3 4 4 In [287]: df.query('a = 3') --------------------------------------...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Storing images into an array<p>I am trying to create a searchable array in JS. I want the arrays to work as only the images show, then using 'tags' to filter...
<p>No need to create a new image. This has more to do with html and displaying of the image than anything else:</p> <pre><code>function NotebookListCtrl($scope) { $scope.notebooks = [ {"name": "Lenovo", "processor": "Intel i5", "age": 2011, "src": 'images/img/image1.jpg' }, //more notebooks.....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Back Button to tableView<p>I have a karaoke app . On the first screen are all the songs. There are menu button for categories. If "Classic Music" button is s...
<p>Yo are making a new view controller every time you press back, you should embed your mainViewController in a navigation controller. This way you can go forward pushing view controllers and backward popping them.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add quotation marks to URL when redirecting with GET method<p>I have a search form looking like this:</p> <pre><code>&lt;form action='http://localhost:1000/...
<p>Solved it by using a JS function. Code looks as follows:</p> <p><strong>Form</strong></p> <pre><code>&lt;form onsubmit="return redirect(this)"&gt; &lt;input id="searchvalue"&gt; &lt;button type="submit"&gt;Search&lt;/button&gt; &lt;/form&gt; </code></pre> <p><strong>JS function</strong></p> <pre><code> &lt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Editing RPGLE-Code directly from the ifs?<p>does anyone know how to edit rpg code stored in the ifs with the rational developer?</p> <p>I only get the follo...
<p>If you are missing views in a perspective you want to use, just add them from the menu <code>Window -&gt; Show View -&gt; Other...</code> (choose the view you want)</p> <p>If you are not getting the editor you want Right click on the file and choose the editor you want by selecting <code>Open With</code>, then sele...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to version packages in golang?<p>I've read a whole bunch of articles and SO questions on importing 3rd party go packages which all seems straight forward...
<p>The official version, from the <a href="http://golang.org/doc/faq#get_version" rel="noreferrer">GO FAQ</a>:</p> <blockquote> <p>If you're using an externally supplied package and worry that it might change in unexpected ways, the simplest solution is to copy it to your local repository. (This is the approach Goog...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot load XML documents on web page with JavaScript<p>I am trying to load my parse my XML document but the HTML page remains null, is there something that ...
<p>I've just tested your example and it's working with the adjustment to add an element with the <code>id="content"</code> to the HTML:</p> <pre><code>&lt;body onLoad="outputXML('content', 'assets/xml/sample.xml', 'assets/xml/sample.xsl');"&gt; &lt;div id="content"&gt;&lt;/div&gt; &lt;/body&gt; </code></pre> <p>The...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Facebook header navigation bar uses an image instead of simple color<p>I was going through the page source of Facebook and found out that Facebook uses a sim...
<p>They are using a 1px wide image, then set the background of the respective div to <code>repeat-x</code>. This fills the entire screen and makes the gradient the same across all browsers, given the fact certain versions of IE and so on don't support CSS gradients.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to extract rows where a string matches?<p>my data is as below and want to extract only those rows where data column has string like "7_" and its position...
<p>Try this</p> <pre><code>within(df[grep("7_", df$data, fixed = TRUE), ], data &lt;- sub(".*?(7_[^;]*).*", "\\1", data)) # RowNo Name data # 1 1 ABC 7_113838 # 2 2 xyz 7_145 # 3 3 MNO 7_14 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Html/Javascript: Input Text To Item<p>Okay, I'm trying to search google and I can't find anything out on this. Probably because I don't know what the techni...
<p>I'm not sure if that's what you're looking for, but just as a quick example without having looked at the actual code but using the CSS from the Stackoverflow tag elements - you can just retrieve the value of the input on <code>change()</code>, create an element, append the value of input and an additional element to...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unit test in ios, Tab bars<p>So i just started to learning unit testing in IOS and i have few simple tasks to complete.</p> <p>So basically i have created a...
<p>A tab bar controller in iOS has a <code>tabbar</code> property. This tab bar, has an <code>items</code> property. You can use these to make sure it has the correct number and in the correct order. <em>However</em> this seems like a bad test to me. Don't waste time testing things which are trivial, or components whic...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AngularJs - Dynamic template<p>I am trying to implement directive for dynamic template. Depending on what is selected in drop-down list, template should chan...
<p>in html: attribute name must be "template-id" because you access it like $attrs.templateId</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i turn on MobileNetwork?<p>I tried to turn on MobileNetwork by using code below,but it does not work and it throws **NoSuchMethodexception **. How ca...
<p>For accessing the WIFI state :</p> <pre><code>WifiManager wifiManager ; wifiManager = (WifiManager)this.getSystemService(this.WIFI_SERVICE); wifiManager.setWifiEnabled(true); //True - to enable WIFI connectivity . </code></pre> <p>For accessing the DATA/3G state :</p> <pre><code>ConnectivityManager dataMa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: dyld: Library not loaded: @rpath/GoogleUtilities.framework/GoogleUtilities<p>I really need some help in a problem which is turning me crazy...</p> <p>It's a...
<p>I had this problem when running on the <em>simulator</em>, but not on my device. The problem is that CylanceProtect antivirus software on my MacBook was blocking the GoogleUtilities file:</p> <p><a href="https://i.stack.imgur.com/szRii.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/szRii.png" al...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Lombok @Sl4j annoation with log4j implementation<p>I'd like to use the <code>Lombok</code> annotation <code>@Sl4j</code> in my project, but the default...
<p>Lombok and Slf4j are separated apis. Your code should use @Slf4j annotation to do logging.</p> <p>Where it will log is not concern of Lombok but Slf4j configuration. Slf4j manual describes your <a href="http://www.slf4j.org/manual.html" rel="nofollow noreferrer">desired case</a>. Essentialy your app should use slf4...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Writing a simple batch file that checks if a program is running<p>Me and couple of my friends are using a shared folder on Dropbox, where've uploaded our min...
<p>This is not exactly what you are looking for in the topic of the question, but if I get it right you would like to avoid that a server is started twice. So I would do the following:</p> <p>Create a batch-file that:</p> <p>First checks if a file named *_MinecraftServer.txt exists. If yes, it assumes that the server...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Vectorizing for loops to speed up a program in R<p>I'm looking for some simple vectorized approach for my <strong>for loop</strong> in R. I have the followin...
<p>In the spirit of "Teach somebody to fish is better than to give a fish", I'll walk you through that: </p> <ol> <li><p>Make a copy of your code: you are going to mess it up!</p></li> <li><p>Find the bottleneck: </p> <p>1a: make the problem smaller: </p> <pre><code>Rep &lt;- 100 df.expanded &lt;- as.data.frame(rep...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JPA: Using composite primary keys for map relations<p>Following an <a href="https://wiki.eclipse.org/EclipseLink/Examples/JPA/2.0/MapKeyColumns#Example_of_a_...
<p>There is no way to signal a composite primary key, because the PHONE_TYPE is part of the Map in the <code>Employee</code> class and OWNER_id is part of the <code>Phone</code> class. Beside that, that is also not your primary key: the primary key is the id property (as you have it). What you actually need is to speci...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Defining a ComboBoxTableCell and ComboBox nodes FXML<pre><code>import javafx.scene.control.TableCell; import javafx.scene.control.TableColumn; import javafx....
<p>If you are creating <code>String</code>s, you can do</p> <pre><code>&lt;TableColumn prefWidth="50" text="Grade"&gt; &lt;cellFactory&gt; &lt;ui.view.ComboBoxTableCellFactory /&gt; &lt;nodes&gt; &lt;FXCollections fx:factory="observableArrayList"&gt; &lt;String fx:value=...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find distances from an array<p>I have an array of dates (1000 columns,2 arrows).</p> <p>Link of the data: <a href="https://mega.nz/#!MMlhWbbT!bwsu4_t...
<p>This will calculate the distance between two consecutive points over the whole array:</p> <pre><code>for x in range(0,len(dt1)): print(D(dt1[x][0],dt1[x+1][0],dt1[x][1],dt1[x+1][1])) </code></pre> <p>If you want to calculate the distance between any two points in the array without repetitions, this should do i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using for loop to find specific characters in string<p>I am attempting the <a href="http://eloquentjavascript.net/03_functions.html#p_8y74cOkS91" rel="nofoll...
<p>There is something wrong about how you're trying to implement this feature. First of all I think it's better if you have a function that accepts the <code>string</code> and the <code>char</code> as parameters in order to call it whenever you want.</p> <p>Example of calling :</p> <pre><code>getChar('this is my cust...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: type error passing struct to macro in common lisp<p>I have this struct:</p> <pre><code>(defstruct (endpoint (:constructor create-endpoint (name tags values)...
<p>See: <code>,(endpoint-name endpoint)</code></p> <p>This looks like it is evaluating the expression at macroexpansion time. <code>endpoint</code> is code, not yet evaluated.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python ValueError: I/O operation on closed file. sample tutorial not working<p>I am following a tutorial to learn to read and write to a file. I am getting t...
<p>The line after <code>f.close()</code> that is <code>f.read('newfile.txt', 'r')</code> should be <code>f = open('newfile.txt', 'r')</code>.</p> <p>That is </p> <pre><code>f = open('newfile.txt', 'r') print f.read() f.close() </code></pre> <p>After which you need to add <code>f.close()</code> again.</p> <p><strong...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot declare a variable in a variadic template using metaprogramming<p>I am using a variadic template function to perform a function for each argument. The...
<p>You created a variable and did not use it.</p> <p>You have all warnings enabled (<code>-Wall</code>) and warnings-as-errors enabled. As creating a pointless variable is usually a sign you made a mistake, the compiler has a warning for it.</p> <p>So a warning (you created a variable and did not use it) generated a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How best to architect django models to fit a scenario?<p>I'm modeling a system involving a process using a small number of inputs in a recipe to create outpu...
<p>Assuming, per the comments that Inputs and Outputs can't go in the same table, then a Generic Foreign Key is probably your best option to have a relationship that binds to either model. To start with your Recipe code:</p> <pre><code>from django.contrib.contenttypes.fields import GenericForeignKey from django.contri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Node js - ejs: How to run password check on login/register form<p>I created a login page as a small example. The form is asking the usual things such as user...
<p>I've been try your code and it's working fine, the only one line not working is:</p> <pre class="lang-html prettyprint-override"><code>&lt;% include ./partials/messages %&gt; </code></pre> <p>You have to change this line with this code below:</p> <pre class="lang-html prettyprint-override"><code>&lt;%- include('p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trying to access a custom prop in styled components<p>Hi I'm trying to access a custom prop in a styled-component.I know that this is a very basic thing but ...
<p>I assume you are using ThemeProvider in the higher order component. You can access theme by just using props.theme...</p> <p>Update your productCardStyles.js</p> <pre><code>import styled from 'styled-components' const wrapper = styled.div` background: red; margin-bottom: ${props =&gt; (props.spaceBelow ? '25p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Write a Macro to Edit an Individual Comment in Word<p>So far I have a custom context menu that appears when I right click a comment allowing me to run a Macr...
<p>Okay I've found the solution so I'm posting in case anyone else has the same problem.</p> <p>First you'll need a custom shortcut menu for your right click, you can find out how to build this here: <a href="https://gregmaxey.com/word_tip_pages/customize_shortcut_menu.html" rel="nofollow noreferrer">https://gregmaxey...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: "flutter run" gets stuck at "Running Gradle task 'assembleDebug"<p>I updated Flutter to the latest stable version today - <code>1.12.13+hotfix.7</code> (I wa...
<p>The issue has been resolved upstream. If you want to consume it you will have to switch to the <code>master</code> channel (for now. It will arrive in the <code>stable</code> channel at some point) by running </p> <pre><code>flutter channel master </code></pre> <p>After running that, I was able to build my apk ju...