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: Page not found error on /album route<p>I'm new at Zend Framework 2, i tried to develop a simple web page following the official guide here: <a href="http://f...
<p>Problem solved, The problem it's the Virtual Host. I created the zf2-tutorial.conf file in /etc/apache2/sites-enabled Now it works</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mechanical Turk - Fetch all information of batches in one go.<p>Is there any way to fetch all the information from different batches in one go. Say for examp...
<p>No. You can only download them batch-by-batch. You could access all the HITs individually via the API, which would probably be easier in this case than manually downloading 50 CSVs.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: execCommand() doesn't "unbold" text<p>I made my own WYSIWYG text-editor.</p> <p>The contenteditable-field is a div, see code below:</p> <pre><code>&lt;div ...
<p>The <code>execCommand('bold'...</code> works as expected, i.e. toggles the surrounding of the text in tag. The problem is that you set <code>'font-weight: normal'</code> style for the b tag in the following CSS classes. It means that you explicitly want the text in the <code>&lt;b&gt;</code> tag to be normal and it...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why can't I call a Polymer function on an element?<p>This is really bugging me, can't seem to get this to work and I figure it's got to be some small little ...
<p>You need to wait for the <a href="https://www.polymer-project.org/docs/polymer/polymer.html#polymer-ready" rel="nofollow"><em>polymer-ready</em> event</a>, because the Polymer element upgrade is performed asynchronously:</p> <pre><code>&lt;script&gt; window.addEventListener('polymer-ready', function() { var x...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Windows Runtime equivalent to WriteableBitmap's AddDirtyRect<p>I'm building an app where I would like to redraw the image on screen around a user's finger to...
<p>No, this API isn't there. You could use a secondary patch bitmap to update only a portion of the rendered output. If you need more control over what gets pushed out to the buffers you'd need to use a <code>SwapChainPanel</code> and DirectX.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adding PHP Variable to the end of link -Laravel 4.2<p>I am trying to add a variable to the end of an link <code>&lt;a href="foo.com/$ID"&gt;LINK&lt;/a&gt;</c...
<p>Replace this:</p> <pre><code>&lt;td&gt;&lt;?php echo implode('&lt;/td&gt;&lt;td&gt;', $row); ?&gt;&lt;/td&gt; </code></pre> <p>With something like this:</p> <pre><code>&lt;td&gt;&lt;?= $row['title'] ?&gt;&lt;/td&gt; &lt;td&gt;&lt;?= $row['place_film_country'] ?&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="http://foo.com/...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ActionBar icon not showing<p>i have added the menu file:</p> <pre><code>&lt;item android:id="@+id/action_refresh" android:orderInCategory="1...
<p>Try this in your onCreate method</p> <pre><code>getSupportActionBar().setDisplayShowHomeEnabled(true); getSupportActionBar().setIcon(R.drawable.ic_launcher); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Datatable won't update my DB<pre><code>usersTableAdapter usersTA = new usersTableAdapter(); var usersTable = new users.usersDataTable(); usersTA.Fill(usersTa...
<p>This is a common misunderstanding on what the <a href="https://msdn.microsoft.com/en-us/library/system.data.datatable.acceptchanges(v=vs.110).aspx" rel="nofollow">AcceptChanges</a> method does.<br> I think the problem arises from the initial comment in the documentation of the <code>AcceptChanges</code> method .</p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What's the difference between LazyList and Stream in Scala?<p>I noticed that <code>Stream</code> is deprecated in <code>Scala 2.13</code> and they suggest us...
<p>NthPortal, a contributor to <code>LazyList</code>, states in <a href="https://github.com/scala/scala/pull/7842/files#r264513994" rel="noreferrer">Update and improve LazyList docs #7842</a> </p> <blockquote> <p>The key difference between <code>LazyList</code> and <code>Stream</code> - and its key feature - is th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python get index of columns with matching values<p>I have a dataFrame in which I do not have headers or column names. I want to return the list of indexes in...
<p>This may not be exactly what you are looking for but I would not use a filter query. I would do this since you already know the index position of the row of interest is 2.</p> <pre><code>import pandas as pd import numpy as np df = pd.DataFrame({0: {0: 'March', 1: 2019, 2: 'A'}, 1: {0: 'April', 1: 2019, 2: 'E'}, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Show percentage in WPF datagridProgressbarcolumn along with progress?<p>I am used the below codes in datagridtemplateprogressbarcolumn and its working...
<p>This should do it (not tested, but you should get the idea):</p> <pre><code>&lt;DataGridTemplateColumn Header="Progress" Width="*" Visibility="Visible"&gt; &lt;DataGridTemplateColumn.CellTemplate&gt; &lt;DataTemplate&gt; &lt;StackPanel&gt; &lt;TextBlock Text="{Binding Progres...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Make fluid-sized block stick to top corner and allow content flow around it, but remain below content at certain breakpoints.<p>I've created a codepen to dem...
<p>You can use a combination of <code>float</code>, <code>flex</code> and media queries as below:</p> <pre><code>.floater{ float: right; } @media (max-width: 500px) { .wrapper{ display: flex; flex-direction: column; } .main{ order: 0; } .floater{ order: 1; }...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: execute system command (bash) using assembly?<p>Basically I am trying to execute the command <code>/bin/ls</code> using assembly, but unfortunately I am fail...
<p>Found the problem, as pointed by @Jestor (thank you), I needed to store the executing file at <code>ebx</code> and all the arguments including the filename in <code>ecx</code> and set <code>edx</code> to null as below:</p> <pre><code>SECTION .data buf: db "./", 0 SECTION .text global _start _start: xor eax, eax xo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to prevent WSASend() from blocking my UI thread?<p>I want to use Overlapped I/O with Completion Routine to handle client connections.</p> <p>In my UI th...
<p>I agree with @DavidHeffernan - the UI thread should be doing UI things. The IO thread surely needs a binding and port, (server), or peer address and port(client). The socket from ConnectEx or AcceptEx is surely better loaded in the IO thread, but a Socket class with, (at this time, undefined), socket member could su...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Suggestion required - Python code performance improvement<p>Need some advice in improving the performance of my code. </p> <p>I have two files ( Keyword.txt...
<p>If all your search-word phrases consist of whole words (begin/end on a word boundary) then parallel indexing into a word tree would about as efficient as it gets.</p> <p>Something like</p> <pre><code># keep lowercase characters and digits # keep apostrophes for contractions (isn't, couldn't, etc) # convert upperca...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does programmatically setting layout sizes actually save on performance?<p>So whenever I try to use layout_weights within each other to achieve the layouts I...
<p>"Nested Layouts" implies that Android does not know how big each layout should be without iterating over each layout setting to determine if the size should be changed based on other layouts.</p> <p>This means that "nesting" could result in many iterations of trying to size each layout, then trying to figure out if...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ng-class Conditional Syntax<p>I am trying to conditionally apply a class to an element but I can't get the syntax correct</p> <p>I have tried the following ...
<p>You shouldn't use the double quote on your evaluation, because it's closing your ng-class attribute. You can use the single quote if you want to check a string. In you're case, if bar is a boolean value, you don't have to use quotes at all :</p> <pre><code>ng-class="{foo: bar === true}" </code></pre> <p>which is e...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Uncaught TypeError: Cannot read property 'company_id' of undefined<p>I'm getting this error from my script, weird thing is, it still works. It still runs and...
<p>Your loop is iterating <code>getUsersCount + 1</code> times so <code>getUsers.data[getUsersCount + 1]</code> is undefined. Try the following fix:</p> <pre><code>for(i=0; i&lt;getUsersCount; i++) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check if method "return null" and is @Nullable<p>Can I make Findbugs, or any other code analyser, check if a method that can return <code>null</code> is anno...
<p>I believe the current tooling cannot do that out of the box, including IntelliJ. You will have to write a custom FindBugs check. FindBugs has some logic to support nullness analysis.</p> <p>The reason for that is that you are trying to reverse-engineer the contract of the method. Nullness annotations are part of th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django Inconsistent Test after Patch<p>I get inconsistencies when getting results after <code>patch</code>. I am trying to compare the results after I patch....
<p>The reason is that querysets in Django are <a href="https://docs.djangoproject.com/en/3.0/topics/db/queries/#querysets-are-lazy" rel="nofollow noreferrer">lazy</a>. When you store the old result in variable it doesn't mean that any DB activity was actually performed. You may just store attribute value and make check...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: If we have multiple macros in single jinja template. How to render a particular macro in it in python<p>Ex: name = aa.py.jinja2</p> <pre><code>{% macro Macr...
<p>Macros are comparable with functions and are meant to be called. You can import <code>aa.jinja2</code> first and then call its <code>Macro1</code> function:</p> <pre><code>aa = env.from_string('{% import 'aa.jinja2' as aa %}{{ aa.Macro1() }}').render() </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel eloquent case insensitive data<p>I have a table in migrations named <code>currency_codes</code> with fields <code>(id, source, code)</code>.</p> <p>...
<p>Your search queries and validation rules are case insensitive when you are using mysql.</p> <p>e.g.:</p> <pre><code>$query-&gt;where('code', $code) </code></pre> <p></p> <pre><code>'code' =&gt; 'unique:currency_codes,code' </code></pre> <p>If you want your codes to always be stored in uppercase you can use a <a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to merge a dynamically named record with a static one in Dhall?<p>I'm creating an AWS Step Function definition in Dhall. However, I don't know how to cre...
<p>First, I'll include an approach that does not type-check as a starting point to motivate the solution:</p> <pre><code>let rando = ComparisonOperator::{ Variable = "$.name", StringEquals = Some "Cow" } let comparisons = renderRuleComparisons ComparisonType.Not [ rando ] in comparisons # toMap { Next = "Public" } ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Storing words into an array in Mars MIPS<p>I'm trying to teach myself Assembly using Mars for the MIPS architecture and am wondering how to store a series of...
<p>If you don't need to do it at runtime, you can of course just initialize your array with the pointers directly:</p> <pre><code>.data X: .word Ryan, Tammi, Mike, Jessica Ryan: .asciiz "Ryan" Tammi: .asciiz "Tammi" Mike: .asciiz "Mike" Jessica: .asciiz "Jessica" </code></pre> <p>Otherwise you'd have to...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does this generator return a function instead of a value<p>Essentially I'm trying to make an http request with my koa application and was wondering what ...
<p><code>koa-request</code> or any other library that returns thunks or promises/thenables for asynchronous calls is meant to be used with a co-routine library like <code>co</code> or the <code>koa</code> web application framework, which uses <code>co</code> to handle generator-based control flow.</p> <p>ECMAScript 6 ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fetch all rows based on the query into an array and return single value<p>Fetch all rows based on the query into an array and return single value</p> <p>Que...
<p>Replace the <code>$arr[] = $arr2;</code> with <code>$arr[$arr2[0]] = $arr2[1];</code>. That might solve your problem.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Should I initialize DOMdocument in the model or controller<p>I have recently built a script that uses DOMdocument to generate an XML feed of posts from a CMS...
<p>Just use the documentation, that's what I did, and I never used this framework before:</p> <blockquote> <p>The View is the information that is being presented to a user. A View will normally be a web page, but can be any type of "page".</p> </blockquote> <p>See <a href="http://gilbitron.github.io/PIP/#views" r...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Heroku: ActionController::RoutingError (No route matches [GET] "/fonts/glyphicons-halflings-regular.ttf)<p>I’m getting the following error at Heroku:</p> <p...
<p>You have a couple of issues here.</p> <ul> <li>The font assets aren't in a path known to the sprockets so they won't be served when asset compilation is on (i.e., production).</li> <li>Even if you fixed asset compilation, you are using a static version of bootstrap.css so the path to the font assets can't be set to...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Maven include zip dependency<p>We have an zip artifact hosted on our local repository. Within my Maven project I would like to retrieve this zip dependency. ...
<p>You can use <a href="http://maven.apache.org/plugins/maven-dependency-plugin/unpack-mojo.html" rel="nofollow noreferrer">unpack</a> goal of Maven Dependency Plugin.</p> <p>Find below an example snippet:</p> <pre><code>&lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-dependency-plugin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Making multi callback synchronized with jQuery $.when<p>This is my sample code:</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="sn...
<p>The problem is that each callback timeout is activated almost at the same time. You can do the following though:</p> <pre><code>function out(msg) { $('#output').append(msg + '&lt;br&gt;'); } function foo(index, callback) { var time = array[index]; out(time); if (index == array.length - 1) callback(); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Apply colored circle on top of the clicked image<p>I have a page that when loaded displays this: </p> <p><img src="https://i.stack.imgur.com/99Bp9.png" alt=...
<ol> <li>This <code>#panel1 row img</code> is a wrong selector, change it to <code>#panel1 .row img</code> - note class name selector <code>.row</code></li> <li>Change your click handler to do this <code>$(this).toggleClass("circle");</code></li> <li><p>.circle class shall look like:</p> <p><code>.circle { borde...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reading raw json data of a table into df table?<p>I am trying to download the json data into a df table from: "<a href="http://emweb.securities.eastmoney.com...
<p>Using the given URL.</p> <pre><code>import pandas as pd import requests url=&quot;http://emweb.securities.eastmoney.com/NewFinanceAnalysis/lrbAjax?companyType=4&amp;reportDateType=0&amp;reportType=1&amp;endDate=&amp;code=SZ002475&quot; json_data = requests.get(url).json() out_df = pd.DataFrame(eval(json_data)) prin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: c# datetimepicker set time<p>On my WinForm, I want a user to be able to 'reset' or 'clear' the datetimepicker on a buttonclick. My goal is to set it to 00:00...
<p>Try changing your custom format from <code>hh:mm tt</code> to <code>HH:mm tt</code>. </p> <pre><code>dateTimePicker1.Format = DateTimePickerFormat.Custom; dateTimePicker1.CustomFormat = "HH:mm tt"; dateTimePicker1.Value = DateTime.Now.Date; </code></pre> <p>As we can see at MSDN<br> <a href="https://msdn.microsof...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i parse a user object to return a screen name and move on to my next step?<p>I'm on code-cademy and i'm in Step 2 of learning twittr api in rubygem (...
<p>You need to [ require 'json' ] at the beginning of your code.</p> <p>Your username will be encoded in response.body, but you need to call JSON.parse on it to decode it properly.</p> <p>So you have to answer after # ADD CODE TO PARSE THE RESPONSE BODY HERE : user = JSON.parse(response.body)</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can a foreign key also be used as primary key?<p>For a university course, I have to set up an SQL database. </p> <p>We are supposed to set up a database con...
<p>Because the closed sales table is really an extension of the offer table it makes sense. The offer becomes closed and the closed sales table contains addition data not needed in other offers. This seems an elegant solution.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a better way to implement the fibonacci formula using rational numbers?<p>I'm reading the <a href="http://learnyouahaskell.com/" rel="nofollow noref...
<p>(You can't use your <code>sqrt</code> version, use <code>Data.Real.Constructible</code> instead)</p> <pre><code>import Data.Real.Constructible fib :: Int -&gt; Construct fib n = (((1+sqrt(5))/2)^n - ((1-sqrt(5))/2)^n)/sqrt(5) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python Django Count Dictionary using For Loop Per Key<p>Hi I'm new to python programming. I need to create a dictionary using for loop and count the status p...
<p>Using a simple iteration. </p> <p><strong>Ex:</strong></p> <pre><code>device_info = {} for device in data['sensors']: if device['device'] not in device_info: device_info[device['device']] = {'up_sensors':0, 'down_sensors': 0} #Create default dict if device['status']== 'Up': ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create own TextBox class with specific properties in c#<p>I am quite new in C# programming. I would need your help in a question about creating own TextBox c...
<pre><code>public class MyTextBox : TextBox { public MyTextBox() { // Change the background color this.BackColor = Color.BurlyWood; this.Font = new Font("Verdana", 16); } } </code></pre> <p>Build your project.</p> <p>After that, look in your toolbox:</p> <p><a href="https://i.sta...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: My TaskCompletetion code for performance<p>I have been developing an ios app with Xamarin.iOS. We have a WCF service, and i use dynamic proxy which credated ...
<p>The implementation of the method looks good to me, although I would set the exception of the task completion source in the <code>catch</code> block, but if you prefer to ignore it that is up to you.</p> <p>If you are using .NET 4.5 Your code for calling the function can be simplified to</p> <pre><code>var folderIt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Function/Operator in Dart to obtain size of a data type<p>I wish to know the amount of memory allocated to different data types in Dart. But I cannot find a ...
<p>It does not really make much sense to have such an operator in a high-level programming language like Dart where the size of types can change by optimization on runtime and based on if fields in classes are used or not. If you need the size of a given type for debug purposely, I guess you can find some information b...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: UIwebview picture to new view controller<p>I have a UIWebview displaying my html page with picture links. How can I make it so when the user clicks the link,...
<p>If you are sure your web view only contains images links then you can make your current view controller implements the UIWebViewDelegate especially:</p> <pre><code>- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType { /...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I isolate a space using RegExp in VBA (\s vs. \p{Zs})?<p><strong>Introduction/Question:</strong></p> <p>I have been studying the use of Regular Expre...
<p>Since you are trying to find a correspondence with the <code>\p{Zs}</code> Unicode category class, you might want to also handle all hard spaces. This code will be helpful:</p> <pre><code>strPattern = "^[0-9](\S)+[ " &amp; ChrW(160) &amp; "]" </code></pre> <p>Or, </p> <pre><code>strPattern = "^[0-9](\S+)[ \x0A]" ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to find weekdays from specific week in Flutter?<p>For example 20.week contain May 11, 2020 - May 17, 2020</p> <p>The code have to show these date range....
<p><a href="https://en.wikipedia.org/wiki/ISO_week_date" rel="nofollow noreferrer">The ISO 8601 definition for week 01 is the week with the Gregorian year's first Thursday in it.</a> </p> <p>We need found out if <code>first day of a year</code> is before <code>Thursday</code></p> <pre><code>DateTime getDateByWeekNumb...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to enhance the performance of a Java application that makes many calls to the database?<p>As per my understanding the execution of java programs is prett...
<p>Some suggestions :</p> <ul> <li>Scale your database. Perhaps the database itself is just slow.</li> <li>Use 'second level caching' or application session caching to<br> potentially speed things up and reduce the need to query the<br> database.</li> <li>Change your queries, application or schemas to reduce the numbe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to run Spring Boot app after upgrading to 2.2.4: method does not exist<p>I got an error after upgrading Spring Boot version from 2.1.11 to 2.2.4. Then...
<p>Have a look at the Javadoc for versions <a href="https://docs.spring.io/spring-boot/docs/2.1.11.RELEASE/api/org/springframework/boot/web/client/RestTemplateBuilder.html#setConnectTimeout-int-" rel="nofollow noreferrer">2.1.11</a> and <a href="https://docs.spring.io/spring-boot/docs/current/api/org/springframework/bo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Eclipse, project unable to launch<p>i am using Eclipse Luna. My work space was C:\Users\user\workspace, that is my windows drive and it was not my default wo...
<p>Change the method main method name to <code>public static void main(String args[])</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it guaranteed for two (or more) versions of the .NET Framework to be installed side by side?<p>Based on many articles I have read, I came to the conclusio...
<p>There's a difference between the Framework version and the runtime version. You can have different runtimes operate side-by-side without interfering if your application is properly marked with the expected runtime in its configuration file.</p> <p>Programs written for a particular runtime (e.g. 1.1, 2.0, 4.0) can ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: python best practice, combining core application with rest service calls<p>I have a question about coding best practice. I am developing an application with ...
<p>It is not possible to give a general answer for this question. In term of robustness and code cleanness it is important to observe the principle of separation of concerns.</p> <p>That means that the part that produces the object must be independant of the part that posts it: they should be separately tested, and on...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can default constructor that does nothing affect performance?<p>I was going through <a href="https://code.google.com/p/box2d/source/browse/" rel="nofollow"><...
<p>If it didn't exist, then you could only create an object using the other constructor. That constructor initialises the data members, which is slower than not initialising them. So you can use this constructor for performance reasons if you don't need to give them values yet.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firebird SQL command for reindexing a column<p>Wondering what the SQL command is to re-number a column in firebird, so each row for that column reads:</p> <...
<p>I have created a simple example to demonstrate this:</p> <pre class="lang-sql prettyprint-override"><code>CREATE TABLE renumber_example ( id INTEGER NOT NULL ); </code></pre> <p>I populated this table with some discontinuous numbers:</p> <pre><code>INSERT INTO renumber_example (id) VALUES (1); INSERT INTO renumb...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Card dealing, playing<p><strong>Problem</strong></p> <p>I've never made a card game before, and I'm having quite some difficulty at the moment.</p> <p>Howe...
<p>I would say the fact that you have them rendering and moving up you are off to a great start. </p> <p>My recommendation though would be to look at a MVC (Model View Controller) approach to the problem. Keep the info for cards played and what the player has for cards in a separate object from your view. That way whe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: update sql using ajax<p>I've been trying this code but i don't know what's wrong with it, i want my database to be update once a link is click before it goes...
<p>Your PHP script is expecting a parameter called getNotifId and you're sending 'field'. Change the name being sent via ajax like this:</p> <pre><code>... data: { action: 'save', getNotifId: $("#getNotifId").val() }, ... </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using list.reverse() on a copy changes the original<p>Hi I am trying to make a function that checks for Palindromes and I thought I could easily use the <cod...
<p><code>x</code> and <code>y</code> are refer to same memory location. </p> <pre><code>&gt;&gt;&gt; x = [1,2,3] &gt;&gt;&gt; id(x) 141910924 &gt;&gt;&gt; y = x &gt;&gt;&gt; id(y) 141910924 &gt;&gt;&gt; z = list(x) &gt;&gt;&gt; id(z) 141676844 &gt;&gt;&gt; x.append(10) &gt;&gt;&gt; x [1, 2, 3, 10] &gt;&gt;&gt; y [1, 2...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: INSERT into Access DB using Windows Forms not working but not throwing an error<p>I'm trying to insert user entered data into a Windows Form into an Access D...
<p>You are mixing 2 different ways of doing database access. One one hand you are working with an adapter which is intended with working with a dataset. You would do the changes on a table in a dataset and then call update on the adapter. But you are taking control of the commmand objects inside the adapter passing par...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: call ffmepg from apache php without full path<p>I need a apache /php to recognize ffmpeg command without specifing the full bath of /usr/local/bin/ffmpeg <...
<p>PHP uses default <code>profile</code> to execute commands with <a href="http://php.net/manual/en/language.operators.execution.php" rel="nofollow"><code>backticks</code></a>/<code>shell_exec</code>. It apparently does not include <code>/usr/local/bin</code> in the <code>$PATH</code>. To fix the problem you might expl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Explicit implementation of properties<p>What i want to achieve is simple, i have an Interface <code>IDatasource</code>, which has a property called <code>Dat...
<p>Remove the <code>public</code> from </p> <pre><code>public DatasourceSettings IDatasource.DatasourceSettings </code></pre> <p>Because it is explicitly implementing an interface method it is a-priori public</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Webrtc Android to Android?<p>Im a bit confused, Ive only seen examples from android to pc or vice versa. I need to make an android app that connects from two...
<p>Yes is it possible to do that, but also need a server, to exchange ICE or STUN candidates, only WebRTC can't do that. I developed such a program, only resource that I had, it was source codes and official link <a href="http://www.webrtc.org/native-code/android" rel="nofollow noreferrer">WebRTC</a>. It's API change v...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Disable all checkboxes when one active<p>My problem is that i dont know which element i should target to check if the checkbox is checked and then to disable...
<p>Try using radio buttons instead, they will only let the user select one answer per question at the time.</p> <p>Example:</p> <pre><code>(Question 1) &lt;input type="radio" name="question1" value="yes" /&gt; &lt;input type="radio" name="question1" value="no" /&gt; (Question 2) &lt;input type="radio" name="question...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to compute loss for every data point in Keras?<p>I use Tensorflow 2.0 and Keras to train a model. I do the following to load a pre-trained model which I ...
<p>Just take a loss function from the backend and use it. </p> <p>Example - if eager mode is on:</p> <pre><code>losses = tf.keras.backend.categorical_crossentropy(true_data, pred_data) </code></pre> <p>Example - if eager mode is off:</p> <pre><code>def loss_calc(x): return backend.categorical_crossentropy(x[0],...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ajax.BeginForm is always excecuting a 'POST'<p>I have two ajax forms:</p> <pre><code>@using (Ajax.BeginForm("Index2","Home", new AjaxOptions { ...
<p>It appears from the <a href="https://msdn.microsoft.com/en-us/library/system.web.mvc.ajax.ajaxoptions.httpmethod%28v=vs.118%29.aspx" rel="nofollow">docs</a> that GET and POST are only two verbs supported by <code>HttpMethod</code> property:</p> <blockquote> <p>Gets or sets the HTTP request method ("Get" or "Post"...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to fix a error “invalid operands to binary expression”<p>When i used this code to find the volume of cylinder i got the error</p> <p>'invalid operands t...
<p>You cant use <code>^</code> for power in <code>C</code> .This is not the power it is <code>bitwise xor</code>.USe this instead-</p> <pre><code>#include &lt;math.h&gt; #include&lt;stdio.h&gt; int main() { float r,vol; printf("Enter the parameters to be calculated:\n"); scanf("%f",&amp;r); vol = (4*3.14*(po...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Protecting jsTree Styles from Other jsTree Instances<p>Is it possible to prefix the class names generated by the <a href="https://www.jstree.com/" rel="nofol...
<p>jsTree has support for using themes with its setup configuration.</p> <pre><code>$('#jstree').jstree({ "core" : { "themes": { "name": "mycustomtheme", "dots": true, "icons": true } } }); </code></pre> <p>You can use the default CSS <a href="https://github.com/vakata/jstree/blob/master/dist/themes/default/s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: angularjs transclude and ng-repeat: doing it right<p>I have the following code that produces not the expected result:</p> <pre><code>&lt;div class="outer"&g...
<p>transclude() by itself just links the content of the directive to the proper scope and returns it. What you want to do is actually clone the content (make copy of it), before transclude links it. As you code stands right now, your transcluded content is just getting moved from one instance to another - ending up o...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I retrive the value of a constraint?<p>I have a <code>NSLayoutConstraint</code> constraint:</p> <pre><code>var myConstantLeading: CGFloat = 10 var my...
<p>The constraints you've set both use "Equal" relationships with a constant of 10pt from either side. If you change the image size without adjusting the constraints you've violated the constraint requirements &amp; have an ambiguous layout. </p> <p>If you want to observe the change in constant values they need to be ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Expectation of a product in python sympy<p>In python sympy I have the following code</p> <pre><code>from sympy.stats import P, E, variance, covariance, Norm...
<p>If you look at <code>help(arg)</code> you will get a hint that is helpful: the <code>arg(x)</code> is 0 if its <code>x</code> is positive. So if you define your parameters as positive instead of real, <code>arg</code> will be able to evaluate:</p> <pre><code>&gt;&gt;&gt; mu, sigma = symbols('mu sigma',positive=True...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Return the last six months of a current date (ORACLE)<p>Good afternoon.</p> <p>I would like to get a list of the last six months before the current date.</p...
<p>One way is to use <code>connect by</code>:</p> <pre><code>select to_char(add_months(sysdate, -level + 1), 'mm-yyyy') mth from dual connect by level &lt;= 6 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C++ Struct Default Call Value<p>New to C++ here. Lets say I have a struct defined as:</p> <pre><code>struct Item { string name; } </code></pre> <p>In C++...
<p>You need to overload the stream insertion operator <code>operator&lt;&lt;</code> for <code>Item</code> type.</p> <pre><code>#include &lt;iostream&gt; #include &lt;string&gt; struct Item { std::string name; friend std::ostream&amp; operator&lt;&lt;(std::ostream&amp; stream, const Item&amp; obj); }; std::ostre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I get this to run without freezing the GUI<p>This is a very simplified version of my code to get a better understanding of what I'm doing wrong here....
<p>Don't call <code>run()</code> directly on your <code>Thread</code> object. This immediately executes the <code>run()</code> method and doesn't spawn a new thread. Instead, just call <code>start()</code> as you have and let the system create the thread and call <code>run()</code> when it decides to.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to read from channel while go routines are running<p>I am looking to fire off an unknown number of goroutines. In this example adding to the <code>number...
<p>Because <code>Run</code> reads one message from <code>numbers</code>, writes one message to <code>messages</code>, and terminates. Try this instead:</p> <pre><code> func Run(numbers chan int, messages chan string) { for stuff := range numbers { messages &lt;- fmt.Sprintf("Ran %d", stuff) } } </code><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TrafficStats reporting -1 for all applications except my own?<p>I run the following code on my device:</p> <pre><code>PackageManager packageManager = contex...
<p>I just found this in the android documentation for <a href="https://developer.android.com/reference/android/net/TrafficStats.html#getUidRxBytes(int)" rel="nofollow noreferrer"><code>TrafficStats#getUidRxBytes(int)</code></a>.</p> <blockquote> <p>Starting in <code>Build.VERSION_CODES.N</code> this will only report...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Removing object properties with empty values from JS object<p>Is there a way to loop over an object and remove properties where the value matches a certain c...
<p>You were almost there, try like so: <div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>var user = { first : 'John', last : 'Doe', city : 'Boston', state : 'MA', zip : '', birthdate :...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: View requires multiple API endpoints -- how can I speed up requests in non-blocking fashion?<p>I need to render a view that depends on multiple API endpoints...
<p>As long as the calls don't depend on each other, you can run them all in parallel using the async library, <a href="https://github.com/caolan/async" rel="nofollow">https://github.com/caolan/async</a> . </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to only get inner text of a tag in BeautifulSoup, excluding the embedded one?<p>For example,</p> <pre><code>&lt;ul&gt; &lt;li&gt; &lt;b&gt;H...
<p>You could use the <a href="http://www.crummy.com/software/BeautifulSoup/bs4/doc/#find" rel="noreferrer"><code>find</code></a> function like so</p> <pre><code>from bs4 import BeautifulSoup html = '''&lt;ul&gt;&lt;li&gt;&lt;b&gt;Hey, sexy!&lt;/b&gt;Hello&lt;/li&gt;&lt;/ul&gt;''' soup = BeautifulSoup(html) print soup...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mongoose schema reference and undefined type 'ObjectID'<p>I'm trying to do some relations between my schemas and I have some problems with my solution. Here ...
<p><code>mongoose.Types.ObjectId</code> is the <code>ObjectId</code> constructor function, what you want to use in schema definitions is <code>mongoose.Schema.Types.ObjectId</code> (or <code>mongoose.Schema.ObjectId</code>).</p> <p>So <code>deviceSchema</code> should look like this instead:</p> <pre><code>var deviceS...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Golang - Discard as WriteCloser<p>I needed to create an equivalent of <a href="https://golang.org/pkg/io/ioutil/#pkg-variables" rel="nofollow noreferrer">iou...
<p>I took <a href="https://stackoverflow.com/users/770830/bereal">bereal</a>'s tip and looked at <code>NopCloser</code>. The approach works nicely, and is useful in test functions built around the libraries that require a <code>WriteCloser</code>.</p> <p>I renamed the type <code>myWriteCloser</code> as it can be used ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get currentViewController of View Controller in UITabBarController in UINavigation Controller<p>I would like to know how I can find the current view controll...
<p>Try doing this:</p> <pre><code> UITabBarController *tabBarControler = (UITabBarController*)self.window.rootViewController; UINavigationController *navController = [[tabBarControler viewControllers] objectAtIndex:&lt;selected_index&gt;]; NSArray *navViewControllers = [navController viewControllers]; </cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use filter in dynamically in scala?<p>I have the raw of line of logs file about 1TB. As below.</p> <pre><code>Test X1 SET WARN CATALOG MAP1,MAP2 INFO...
<p>Something like this could work when you require all words to appear in a line:</p> <pre><code>val words = Seq("SET", "INFO", "CATALOG") val filterRdd = rdd.filter(f =&gt; words.forall(w =&gt; f.contains(w))) </code></pre> <p>and if you want any:</p> <pre><code>val filterRdd = rdd.filter(f =&gt; words.exists(w =&g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android toolbar filling entire screen<p>So I am attempting to implement a navigation drawer using the appcompat library. I am using a toolbar as my action ba...
<p>For the first problem:</p> <p>You are using a LinearLayout.The default orientation is horizontal.</p> <p>You should add <code>android:orientation="vertical"</code> to your root element.</p> <p>For the second problem:</p> <p>Remove <code>android:fitsSystemWindows="true"</code> or move the Toolbar inside the first...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Shift value to some point in binary number<p>I wonder if it is possible to do the following.<br> For instance, I have a number 00001110. I am shifting it lef...
<pre><code>Instruction Carry Reg value ----------- ----- --------- PUSH x 01110000 ROL 0 1110000x ROL 1 110000x0 b6 now in carry POP 1 01110000 ROL 0 11100001 b6 now to b0 AND $7Fh x 01100001 </code></pre> <p>The answer above does ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Enter various data types in a text box and input them into an Object array<p>Enter various data types in a text box and input them into an Object array</p> ...
<p>This is a two step process. Step 1 is to parse a CSV line from the user and step 2 is to identify a number (I choose double) verses straight text. I prefer Regular Expressions due to their flexibility (once learned) and believe both steps can be solved using regex.</p> <p>If you do a search, there are whole StackOv...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PyQt: 'ConverterDialog' object has no attribute 'comboBoxIndexChanged'<p>I'm trying to connect comboBox to a slot in class ConverterDialog. I don't know why ...
<p>There are at least three things wrong with the example code you posted:</p> <ol> <li><p>You are attempting to pass the <em>return value</em> of a callable, rather than the callable object itself. So remove the parentheses from the last argument:</p> <pre><code>QtCore.QObject.connect(self.ui.comboBox, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cypress sharing variables/alias between Hooks?<pre><code>So I have a pretty `before` and `beforeEach` function that runs before all tests. It looks something...
<p>I ran a few tests, all the bits seem to work!</p> <p>The following does not give you an answer, but may help you debug.</p> <p><strong>Passing token between before() and beforeEach()</strong></p> <p>Assume we have a user in <code>before()</code>, does it get to the <code>onBeforeLoad()</code> callback?</p> <pre ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TinyMCE 4 advanced table editor plugin<p>Does anyone know of a plugin for TinyMCE that improves the features of the table editor? The thing that is most both...
<p>Add the "colorpicker" plugin to your TinyMCE initial configuration and the text fields will have a color picker that the user can use to choose the color.</p> <pre><code>tinymce.init({ selector: "textarea", plugins: "table colorpicker", }); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: directive needs to modify table after ng-repeat renders rows<p>I have an table directive, fixed-first-column, with a link function that modifies table row co...
<p>Alright, so you have a directive that is wrapping (2) two or more <code>ngRepeat</code> items.</p> <p>Communicating up the chain can be difficult, since each <code>ngRepeat</code> has it's own scope, and their parent is the controller scope. Your <code>fixed-first-column</code> directive could have it's own scope, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to take a multi-indexed DataFrame to a nested dictionary structure?<p>How can you make a dataframe that has a multi-index and make it into a nice nested ...
<p>It grew too complex, too fast:</p> <pre><code>from pprint import pprint import pandas as pd that = {'Food':['Apple','Apple','Apple','Apple','Banana','Banana','Orange','Orange'], 'Color':['Red','Green','Yellow','Red','Red','Green','Green','Yellow'], 'Type':['100','4','7','101','100','100','4','7'], 'tim...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to parse JSON if an element is coming as jsonobject sometime and jsonarray sometime<p>I have json response comming from service. For one element some tim...
<p>Found the solution here <a href="https://stackoverflow.com/questions/7668507/gson-handle-object-or-array">Gson handle object or array</a></p> <p>@Pasupathi your solution is also correct but I want a way using Gson as my service response is too large and complex.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL - Delimiting to a Specific Range<pre><code>SELECT * FROM `cpus_z-series` WHERE `Model_ID` LIKE '%Z5%'; </code></pre> <p>The above SQL query would target ...
<p>First, why do you have the wildcard at the front? Wouldn't this do the same thing?</p> <pre><code>WHERE `Model_ID` LIKE 'Z5%'; </code></pre> <p>If so, you can just use the length of the string:</p> <pre><code>WHERE `Model_ID` LIKE 'Z5%' AND LENGTH(Model_ID) = 4 </code></pre> <p>Of course, you can also use regul...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: DNSJava in Kubernetes<p>Dnsjava is an implementation of DNS in Java. We have built some of our application logic around it.. Just wanted to check if Kubernet...
<p>Not entirely sure what you mean, but Kubernetes doesn't care what you run on it. Your workloads are your problem :)</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reflection - Collect WinForm Controls<p><strong>DESCRIPTION</strong>: I want to take all available controls from over 1000 Winforms from many assemblies. I d...
<p>When you drop a control in the form, the designer creates a member field for the control. If you haven't changed the <code>GenerateMember</code> property to change this behavior, or haven't used data form wizards which create labels without member variables, then you can get all controls using those member fields wi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Connect Quickbooks Online to SugarCRM using Talend<p>I would like to migrate accounts and other transactions from SugarCRM to Quickbooks Online.</p> <p>But ...
<p>I could find some components from <a href="http://www.cloudb.com" rel="nofollow">cloudb</a> and <a href="http://www.qbo-connect.com" rel="nofollow">qbo-connect.com</a>. I will have to choose cause they are paid plugins.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the rationale for the difference in destruction behavior between std::unique_ptr and std::shared_ptr?<p>From <a href="http://en.cppreference.com/w/cp...
<p><code>std::shared_ptr&lt;X&gt;</code> already has a bunch of overhead over a raw <code>B*</code>.</p> <p>A <code>shared_ptr&lt;X&gt;</code> basically maintains 4 things. It maintains a pointer-to-<code>B</code>, it maintains two reference counts (a "hard" reference count, and a "soft" one for <code>weak_ptr</code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parsing data from googleapi<p>I'm trying to build an app that uses data from this url: <a href="http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&amp;...
<p>Your top level object for json is not array so NSDictionary *thread = [self.issueData objectAtIndex:indexPath.row]; this will not work. You top level object is dictionary so parsing will be as</p> <pre><code>(CustomTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: executing a node js child process after click html button<p>i have to design a simple webpage. that was click the Button then the command prompt will be open...
<p>You have to pass a string to render.<br> Maybe you have to reverse the callback order to:</p> <pre><code>app.post('/',function(req,res){ child_process.exec("cmd.exe" ,(err,stdout,stderr)=&gt; { res.render(stdout) }) }); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Maximum integer index in PHP array<p>The following PHP code</p> <pre><code>&lt;?php $x[5076021987]=1234; var_dump($x); ?&gt; </code></pre> <p>produces ...
<p>After checking through everything, <a href="http://php.net/manual/en/language.types.array.php" rel="nofollow">php documentation</a> says</p> <blockquote> <p>The key can either be an integer or a string.</p> </blockquote> <p>Check the <code>Syntax section</code>.</p> <p>So it turns out that you <strong>have to</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to: android app that uploads/downloads to hosting?<p>I am playing with the idea of making an app that allows you to upload text and images/videos to a se...
<p>Went to <a href="https://security.stackexchange.com/questions/82353/android-app-using-ftp">security exchange</a> and found out that FTP isn't that safe. Someone suggested HTTP upload instead.</p> <p>I found a couple of tutorials (haven't tested them yet) that seem to do what I want:</p> <p><a href="http://androide...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Instagram login with swift 5, getting ["error_type": OAuthException, "error_message": Invalid platform app, "code": 400]<p>I'm trying to login with instagram...
<p>Use Instagram App ID, Instagram App Secret and remove #_ from received code. Then Make your post request below format.</p> <pre><code>let urlString = "https://api.instagram.com/oauth/access_token" let appendedURI = "client_id=\(API.INSTAGRAM_CLIENT_ID)&amp;client_secret=\(API.INSTAGRAM_CLIENTSERCRET)&amp;grant_typ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Impossible to import koalas in scala notebook<p>It seems basic but from what I see on databricks website, nothing works on my side</p> <p>I have installed k...
<p>Koalas is a Python package, which mimics the Pandas (another Python package) interfaces. Currently no Scala version is published, even though the project may contain some Scala code. The goal of Koalas is to provide a drop-in replacement for Pandas, to make use of the distributed nature of Apache Spark. Since Pandas...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why postgres SQL DB is different from other db<p>I am new to postgres I want to know why it is used I know that it is object oriented rdbms but what is the e...
<p>Postgres is relational database like any other relational databases (MySQL, MSSQL, Oracle). From their begins it has only one ORDBMS feature - <a href="https://www.postgresql.org/docs/current/tutorial-inheritance.html" rel="nofollow noreferrer">table inheritance</a>. In academic era, the Postgres was experimental da...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Aggregate Data based on Two Different Assessment Methods in R<p>I'm looking to aggregate some pedometer data, gathered in steps per minute, so I get a summed...
<p>Here's a solution using rolling joins from <code>data.table</code>. The basic idea here is to roll each time from the <code>pedometer</code> data <em>up</em> to the next time in the <code>EMA</code> data (while matching on ID still). Once it's the next EMA time is found, all that's left is to isolate the <code>X</co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pugpig framework<p>I have an app with Pugpig framework and this error:</p> <pre><code>Undefined symbols for architecture x86_64: "_OBJC_CLASS_$_KGLocalFil...
<p>Sounds like you need a more recent version of the <code>Pugpig.framework</code>. Version 2.4 and up supports 64-bit, <a href="https://pugpig.zendesk.com/hc/en-us/articles/202429446-Release-Notes#2.4.0" rel="nofollow noreferrer">https://pugpig.zendesk.com/hc/en-us/articles/202429446-Release-Notes#2.4.0</a></p> <hr> ...