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: NSURLConnection consuming huge memory<p>I'm using <code>NSURLConnection</code> to interact with the server side and I have observed that when the server take...
<p>Yes this is possible in case if your data for response is large in size. Generally what we do, we create instance of <code>NSData</code> and append all downloaded data to this variable.This works perfect when your data is comparatively small. If you have large data in response, the better way is to create file in Do...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to hide column from user in MySQL table<p>I figured that this would be easy, but apparently (and to my frustration) it is not.</p> <p>I have a user. We ...
<p>We can grant/revoke privileges at the column level as MySQL stores column privileges in the mysql.columns_priv table, and should be applied for single column in a table.</p> <pre><code>GRANT SELECT (col1), INSERT (col1,col2) ON dbname.tblname TO 'user'@'hostname'; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Risk of code injection with explode() and count()?<p>I'm working with a website which currently stores product ID lists in a <strong>string</strong> within t...
<p>Well, it really depends upon how they are being used inside your code. For example, if you are querying these IDs in your database. It should be fine if you are using parameterized queries to achieve this. However, in order to make sure that weird inputs don't roam around in your code, you could validate using a sim...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to assign a value to a textbox at program start<p>i am creating a project for my class (C# in visual studio) that works as a token dispensing machine. ...
<p>There are two simple ways to accomplish this for a Win Forms application:</p> <ol> <li>When the designer is open, select the given textbox and look at the Properties window. You'll see a property called Text, set it to your desired value.</li> <li>In the code-behind for your form, in the constructor or <code>Form_L...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a way to change the configuration of the Typerocket editor?<p>I'm trying to add options in the Typerocket editor.</p> <p>Like after the Header 1/2/...
<p>You just need to echo some javascript in the wp-admin page to change Typerocket.</p> <pre><code>echo "&lt;script&gt; TypeRocket.redactorSettings = { buttons: ['html','formatting','bold','italic','deleted', 'unorderedlist','orderedlist','outdent','indent', 'image','file','link','alignment','horizontalrul...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to trigger submit on form the right way?<p>I need to trigger a submit on a form but then handle it with javascript. This is how the component looks like<...
<p>Use keyboard events from React - <a href="http://facebook.github.io/react/docs/events.html" rel="nofollow">http://facebook.github.io/react/docs/events.html</a> For example:</p> <pre><code>var CommentForm = React.createClass({ handleSubmit: function(e) { alert("YES again"); return; }, handleKeyPress: f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot cabal install hs3 (for haskell-supercollider)<p>(Ubuntu 12.04)</p> <p>Hello! I'm trying to get hs3 installed to my haskell platform so that I can use...
<p>You appear to have reached "Cabal Hell".</p> <p>It looks to me like <code>hsc3</code> for versions later than 0.13 depends on GHC being at least version 7.6 (the version which added the <code>lookupEnv</code> function), while Ubuntu 12.0.4 provides 7.4. This shows up as a compilation error because <code>hsc3</code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Best way to create a fake smart pointer when you need one but only have a reference?<p>What's the best way to fake a shared pointer for situations like below...
<p>After punching the person who put a <code>shared_ptr</code> there<sup>*</sup>, use the crazy (ok, <em>aliasing</em>) constructor of <code>shared_ptr</code>:</p> <pre><code>template&lt; class Y &gt; shared_ptr( const shared_ptr&lt;Y&gt;&amp; r, T *ptr ); </code></pre> <p>This constructs a <code>shared_ptr</code> s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mapstruct, mapping to nested objects from sevral input parameters<p>Given a set of five objects:</p> <pre><code>KeyDto{String id} ValueDto{String name, Str...
<p>The error you are seeing is because by default MapStruct will try to map <code>valueDto.value</code> into <code>Target.value</code> which is <code>String</code> to <code>Value</code>.</p> <p>However, you can configure this like this:</p> <pre><code>@Mapper public MyMapper { @Mapping( target = "key.id", source...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to show a popup(see image) in iOS<p>Just starting out with iOS developing in Swift so I'm not certain how to call this thing.</p> <p>What I'm trying to ...
<p><a href="https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIActionSheet_Class/" rel="nofollow">UIActionSheet</a> is what you are searching for.</p> <p>Be careful because it's deprecated since iOS 8 but the reference links to the replacement as well.</p> <blockquote> <p>in iOS 8 and later, in...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ZF2 - Get Data From Doctrine Orm In Dao Layer<p>My Controller :</p> <pre><code>&lt;?php namespace Admin\Controller; use Zend\Mvc\Controller\AbstractActionC...
<p>You have to inject all dependencies and use the service manager to get the classes.</p> <p>In you Module.php you have to register and inject the dependencies:</p> <pre><code>class Module { // ... public function getServiceConfig() { $factories = [ 'Admin\Dao\CrudDao' = function (Se...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a best practice for parsing all information contained within one parent XML node?<p>I'm writing a VB.NET application to parse a large XML file which...
<p>You can use these classes to deserialize your xml quickly</p> <pre class="lang-vb prettyprint-override"><code>Imports System.IO Imports System.Xml.Serialization </code></pre> <pre class="lang-vb prettyprint-override"><code>&lt;XmlRoot&gt; Public Class jmdict &lt;XmlElement("entry")&gt; Public Property entr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I have 3 variables set to the same name and I think it only see's the last one<pre><code>for /f "skip=2 tokens=1" %%i in (my.txt) do set row=%%i </code></pre...
<pre class="lang-dos prettyprint-override"><code>@ECHO OFF SETLOCAL ENABLEDELAYEDEXPANSION SET "data=" FOR /f %%a IN (q28666033.txt) DO SET "data=!data! %%a SET "data=%data:~1%" ECHO(%data% GOTO :EOF </code></pre> <p>I used a file named <code>q28666033.txt</code> containing your data for my testing.</p> <p>I believe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to read a json file with more than one records<p>I am trying to save high scores for a game and also load it in high score section, but the way I am savi...
<p>In order to store more than one JSON record, use an array, as when loading you can just load JSON types (an an array is the ideal JSON type you're looking for for that use case).</p> <p>In that case, to read all scores:</p> <pre class="lang-py prettyprint-override"><code>scores = [] with open ("score.json") as jso...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Behaviour of #define macro expansion in C++<p>I knew that if we don't put space after closing angle brackets in a variable declaration, C++ throws the follow...
<p>Macro expansion happens after tokenisation; it doesn't replace text, but sequences of tokens.</p> <p>This means that, with the macro, the expansion of <code>vi</code> gives a <code>&gt;</code> token, separate from the one following the macro invocation. In each case, tokenisation only finds a single <code>&gt;</cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: printing 1 instead of filenames<p>I have some image collection in my specied directory.And i want to get their name using readdir() function.But instead of s...
<p>Operator precedence. This line:</p> <pre><code> while($data=readdir($file)!==false){ </code></pre> <p>is being parsed/executed as</p> <pre><code> while ($data = (readdir($file) !== false)) ^------------------------^ </code></pre> <p>Note the extra brackets. <code>$data</code> is getting the boole...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SignalR refusing connections<p>I'm trying to configure my signalR demo to my project </p> <p><strong>framework : 4.0</strong> , <strong>SignalR version : 1....
<p>A lots of credit goes to <a href="https://stackoverflow.com/users/4519336/frebin-francis">this</a> man. he made my problem easy to solve.</p> <p>See, first of all my all the references were to <strong>4.0</strong> then So I used Signalr Older version 1.1.4</p> <p>Here's is my errors scenario:</p> <ol> <li><p><str...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating new array from a core data array object?<p>i am currently working on Core Data and i have following code</p> <pre><code>NSManagedObjectContext *man...
<p>To get an array with 'Exit' code , add a predicate to your fetch request like this.</p> <pre><code> NSManagedObjectContext *managedObjContxt = [self managedObjectContext]; NSFetchRequest *fetchReq = [[NSFetchRequest alloc] initWithEntityName:@"BDEvent"]; //add this line fetchReq.predicate = [NSPredicate...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: replacing words not letters with javascript<p>I'm trying to replace some words in a string with <code>.replace(desiredWord,"")</code>, to remove those words ...
<p>The following should work:</p> <p>If you pad your <code>desiredWord</code> with the word boundary <code>\b</code> operator it will work without false positives.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-j...
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 IHostedService and Task for scheduled task in asp.net core?<p>I wanna update data from an in-memory database to a relational da...
<p>Generally is because of how the process works. I will assume that you don't place the <code>Task.Run()</code> on the controller but on the startup. If you use it on the controller it will simply start a new thread in each and every request.</p> <p>The way ASP.NET Core works is that it starts a process that listens ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to localize Woocommerce weight<p>So, in settings of Woocommerce weight and other metric system in Russian language. But in product page for example it st...
<p>Done, just posted this code in theme's functions.php</p> <pre><code>function localize_weight_units($weight) { return str_replace('g', 'г', $weight); } add_filter('woocommerce_format_weight', 'localize_weight_units'); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hibernate JPA no exception when removing detached object<h2>Question</h2> <p>I am writing a unittest for a JPA service, and was expecting to see an <code>Il...
<p>Your only mistake is that a brand-new entity object is not <em>detached</em>, it is <em>transient</em>, or <em>new</em>. Take a look at <a href="http://onjavadev.com/?p=1096" rel="nofollow">this flow-chart lifecycle diagram</a> for more information.</p> <p>The takeaway here is that there are four phases of the Hibe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jdbc slow insertion into tables (Prepared Statements)<p>this is my first question here, so please don't freak out when I am asking something wrong ;)</p> <p...
<p>Using a PreparedStatement only improves performance if you using bind variables for the dynamic portion of the content. </p> <p>For example:</p> <pre><code>PreparedStatement x = con.prepareStatement("SELECT * FROM FFA WHERE Spielername = '"+ Spielername + "';"); </code></pre> <p>Should be changed to:</p> <pre><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: 'Provided Authorization Grant is invalid' error while trying to login a dockerized application using wso2<p>I have dockerized our Angular application which h...
<p>Thanks for everyone who commented and tried to figure out the solution for the issue i mentioned. I got the resolution for the issue . As i tried multiple times to login by doing permutations and combinations in configurations, authentication was blocked for me. As a reason, i couldn't login and generate access tok...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change Toolbar home icon color<p>I am using a android.support.v7.widget.Toolbar and learned from <a href="https://stackoverflow.com/a/27152138/335640"...
<p>I solved it by editing styles.xml:</p> <pre><code>&lt;style name="ToolbarColoredBackArrow" parent="AppTheme"&gt; &lt;item name="android:textColorSecondary"&gt;INSERT_COLOR_HERE&lt;/item&gt; &lt;/style&gt; </code></pre> <p>...then referencing the style in the Toolbar definition in the activity:</p> <pre><code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Float values to String in Postgresql<p>I'm using PgSQL 9.1. </p> <pre><code>SELECT 5.1::text </code></pre> <p>is working fine with output <code>'5.1'</cod...
<p>I think I found a solution. Try to cast into numeric type first...</p> <pre><code>SELECT (5.1::numeric)::text </code></pre> <p>Please add your answer if you have a better solution. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Date in VBA form<p>On my excel form I would like for my date to auto populate with today's date, I tried using the <code>=Today()</code> function but when I ...
<p>Once again, I would recommend using a UserForm! Then in the code for that form, you can simply insert:</p> <pre><code>Private Sub UserForm_Initialize() Project.MyTxtBox = Date End Sub </code></pre> <p>I would recommend <a href="http://www.excel-easy.com/vba/userform.html" rel="nofollow"> this </a> resource for lea...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Remove Rs. from float column of cost in C#<p>I am uploading bulk data using excel which has cost column (cost) having values like Rs. 1260. The data t...
<p>Your <code>item.cost</code> contains value like <code>Rs. 1234</code>, then you can split your <code>item.cost</code> using <code>.</code>, then convert last element of array and convert it into float.</p> <pre><code>var cost = float.Parse(item.cost.split('.').Last()); //cost = 1234 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Uploading image with Ionic/angular to php script does not work<p>I am trying to make my Ionic app upload an image that was selected by the user. I read sever...
<p>I found the solution....</p> <p><code>if(move_uploaded_file($_FILES['file']['tmp_name'], $target_path))</code></p> <p>and</p> <pre><code>uploadData.append('image', this.selectedFile, this.selectedFile.name); </code></pre> <p>do not work together because the name I used in the formdata is 'image' and the PHP scri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Request to determine the quantity of a specific members in several classes linked together with a multiplier<p>I've made a simplified example of my ontology ...
<p>Thank you for so much cleaning and reworking of your ontology. However, I still don't think it's a good way to capture what you're trying to express. For instance your ontology includes, in N3 notation):</p> <pre><code>untitled-ontology-14:input_2_of_process_1 a owl:NamedIndiv...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Skip first x rows when setting a column value in a DataFrame with a non-integer index?<p>Lets say I want to set a columns value in a <code>DataFrame</code>. ...
<p>Use <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.iloc.html" rel="nofollow noreferrer"><code>DataFrame.iloc</code></a> which is position based indexing. <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.loc.html#pandas.DataFrame.loc" rel="nofo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Efficiently send a stream of UDP packets<p>I know how to open an UDP socket in C++, and I also know how to send packets through that. When I send a packet I ...
<p>As mentioned in some other comments, what you're describing is a flow control system. The wikipedia article has a good overview of various ways of doing this: </p> <p><a href="http://en.wikipedia.org/wiki/Flow_control_%28data%29" rel="nofollow">http://en.wikipedia.org/wiki/Flow_control_%28data%29</a></p> <p>The so...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL substring non greedy regex<p>I have data like</p> <pre><code>http://www.linz.at/politik_verwaltung/32386.asp </code></pre> <p>stored in a text column. ...
<p><code>\.[^.]*$</code> matches <code>.</code> followed by any number of non-dot characters followed by end-of-string:</p> <pre><code># select substring('http://www.linz.at/politik_verwaltung/32386.asp' from '\.[^.]*$'); substring ----------- .asp (1 row) </code></pre> <p>As for why the non-greedy quantifiers ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Deleting the topmost element in the binary heap<p>I'm trying to implement the binary heap. I've successfully implemented <code>display()</code> and <code>ins...
<p>Your <code>fixheap2</code> fails to consider the case where both children are valid but have keys smaller than the parent's. In that situation, the heap property has been restored, and you should stop swapping with children (or you'll re-invalidate it).</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CKEDITOR 5 - Remove "Insert Media" option from ClassicEditor<p>I'm using <code>CKEditor 5</code> in my <code>angular 7</code> application. <code>ClassicEdito...
<p>Instead of removing specific buttons it is possible to set the default configuration of the CKEditor to show only the options which are required to us.</p> <p>Adding below code to the constructor in your angular component.ts file will create a simple CKEditor with only those options mentioned in the <code>items</co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to create a userspace networking stack with python?<p>Looking to create a project which implements a <em>user-space networking stack</em>, so ...
<p>It's almost certainly possible to do, but depending on how far down you want to go, you will need to write some parts in another language. The authors of <a href="https://arxiv.org/pdf/1901.10664.pdf" rel="nofollow noreferrer">this paper</a> [1] wrote a version of their user-space network driver <a href="https://git...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to call a variable from a function<pre><code>function test{ for($a=0;$a -le 2;$a++){ if($a -eq 1){break} } } #----outside---- write-output $a </...
<p>Aside from using <a href="https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_scopes" rel="nofollow noreferrer">scopes</a> as described in <a href="https://stackoverflow.com/a/60090371/9898643">Rob's answer</a>, there is also the possibility to send a parameter by <a href="https:...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: lower_case_table_names set to 2, Workbench still does not allow lowercase database name<p>I have installed <code>MySql Workbench 6.2</code> with <code>MySql ...
<p>In Windows, table naming is case-insensitive. That is, your <code>Customer</code> table and your <code>customer</code> table will always be the same on Windows. That's a limitation of the NT File System. This applies when your MySQL <em>server</em> is running on a Windows platform. It doesn't matter where your work...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sum on a Recursive Self-Join<p>I found an extremely helpful article located at: <a href="https://stackoverflow.com/questions/1757260/simplest-way-to-do-a-rec...
<p>You can add a new field to your recursive cte and multiply as you iterate through:</p> <pre><code>WITH q AS ( SELECT *,Quantity AS Tot_Qty FROM mytable WHERE PersonID = 1 UNION ALL SELECT m.*,m.Quantity * q.Tot_Qty AS Tot_Qty FROM mytable m ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to write Unit Test for this class using Jersey 2 test framework<p>I am trying to write unit test for a Rest api call which is having a POST method for ad...
<p>You can use the <a href="https://hk2.java.net/2.3.0/index.html" rel="noreferrer">HK2</a> capabilities of Jersey 2, that helps with <a href="https://jersey.java.net/documentation/latest/ioc.html" rel="noreferrer">Dependency Injection</a>. Doing it this way, you can create a <a href="https://hk2.java.net/apidocs/org/g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: @Put Mapping For An Image<p>I'm creating an image uploader with springboot, my entity has the employeeName, employeeDiscpretion and his photo, When you uploa...
<p>Instead of saving the whole contents of the form-upload, you could just take the file-contents (image bytes in this case) encode them as base64 and save that base64 encoded string in your database. Whenever you want to update the image of the employee, just replace the old base64-encoded image with the new one. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: %2F not accepted in URL by apache<p>I have got this problem where I cannot enter %2F and %5C in the search box of my site because apache actively refuses to ...
<blockquote> <p>I just noticed that this directive has caused internal server error on all of my pages and I cannot figure out why</p> </blockquote> <p>As the <a href="http://httpd.apache.org/docs/2.2/en/mod/core.html#allowencodedslashes" rel="nofollow">http://httpd.apache.org/docs/2.2/en/mod/core.html#allowencodeds...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I bind directly to SQLite table?<p>I have a Xamarin app on Android. There is SQLite database using sqlite-net-pcl nuget. It has table <code>Items</code>....
<p>the consensus here is that it is not possible. I asked on the GitHub to implement it though there was no response for a week. </p> <p>I would probably write a wrapper myself and post it here later. </p> <p>But as it stands at the moment the answer is - <strong>no</strong></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trying to do addition of 3 objects of class but i get error in that : TypeError: unsupported operand type(s) for +: 'int' and 'Demo'<h1>python version 3.0 an...
<p>You <em>want</em> your <code>__add__</code> implementation to result in a new <code>Demo</code> object with the <code>data</code> values added together. You should <em>not modify</em> <code>self</code> inside <code>__add__</code>, that's the wrong semantic. You don't expect <code>Demo(1) + Demo(2)</code> to modify <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get users from azure active directory to azure function<p>I am developing a server less application using azure functions using Node js. Function app ...
<p>You can get the access token using <a href="https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-client-creds-grant-flow" rel="nofollow noreferrer">client credential flow</a>(not related to specific user) in your function. </p> <pre><code>const APP_ID = '[COPIED_APP_ID]'; const APP_SECERET = '[...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: django save imagefile in static dir<p>I have some images i retrieve from <a href="http://image.eveonline.com/" rel="nofollow">http://image.eveonline.com/</a>...
<p>you need to set your <code>MEDIA_URL</code> and <code>MEDIA_ROOT</code> in your settings.py and then define your image field like this:</p> <pre><code>image = models.ImageField(upload_to="items") </code></pre> <p>Note that you dont need to add the whole path to <code>upload_to</code> attribute, Django will append ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ASP.Net MVC Model binding a [Serializable] class<p>I have this class</p> <pre><code>[Serializable] public class MyObject { // properties omitted } </cod...
<p>The answer is in the setting <code>IgnoreSerializableAttribute</code> on the <em>Resolver</em></p> <pre><code>((DefaultContractResolver)config.Formatters.JsonFormatter .SerializerSettings.ContractResolver) .IgnoreSerializableAttribute = true; </code></pre> <p>Check the:</p> <p><a href="https://stackoverflow...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Iterating over doctrine collections takes too much memory<p>I've a symfony2 command that skims over my big database and exports the data into an XML file.</p...
<p>I would suggest to use the doctrine "batch processing" (<a href="http://doctrine-orm.readthedocs.org/en/latest/reference/batch-processing.html">http://doctrine-orm.readthedocs.org/en/latest/reference/batch-processing.html</a>).</p> <p>It allows you to handle a lot of data and to limit the php memory used. So in you...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error: type SugarRecord does not take parameters<p>I'm getting this error in compile time after I cloned the repo and imported the library folder as a module...
<p>It turns out the Generic parameter in SugarRecord is not needed anymore.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Guessing Game Help on JavaScript<p>Basically, I created a number guessing game. I have got it to work but I need help on calculating the number of guesses th...
<p>You can accomplish this with a variable in <code>checkValue</code>'s outer scope:</p> <ol> <li>Define a variable (<code>guesses</code>) outside of <code>checkValue</code>.</li> <li>Increment it each time the user makes a guess.</li> <li>Change your success message to show the value.</li> <li>Reset it to 0 after suc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Codeigniter pagination not worrking returns 404<p>Hi I'd like some help please. I 'm having two controllers: movies.php and actors.php where I list all actor...
<p>Change <code>$config['base_url'] = site_url($this-&gt;uri-&gt;segment(1) . '/');</code> to,</p> <pre><code>$config['base_url'] = base_url().'movies/index'; </code></pre> <p>and </p> <pre><code>$config['base_url'] = base_url().'actors/index'; </code></pre> <p>And <code>$config['uri_segment'] = 3;</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Problem with Android Studio on Mac System<p>At work, we are currently trying to program a google flutter app. It works just fine on my Windows PC and now I t...
<p>I don't think this error is related to gradle caching. The actual error is <code>Unsupported class file major version 57</code>. The version of gradle you use is <a href="https://github.com/gradle/gradle/issues/8681" rel="nofollow noreferrer">not compatible with java 13</a>.</p> <p>Compare the version of the Java J...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: django templates upload file - how to handle a non-existant physical file<p>I am using django to upload an image file to the server.</p> <p>When the user at...
<p>Use the <a href="https://docs.djangoproject.com/en/1.7/ref/files/storage/#django.core.files.storage.Storage.exists" rel="nofollow"><code>exists()</code></a> method of the file storage. For example if the name of the image field is <code>image</code> the code will look like:</p> <pre><code>if obj.image.storage.exist...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to ensure that parent is passing populated props to a child component in VueJS<p>Good day all. Imagine we have a parent and a child component i.e <code>P...
<p>this is not true. parent <code>created</code> called before child rendered. the problem in you code is </p> <pre><code>eventsLeftAction: { show: true, type: 'options', options: this.eventsFilters, model: this.compEventsLeftActionModel, placeholder: 'Select Event' } </code></pre> <p>you cannot set <code>o...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Switch a disk containing cloudera hadoop / hdfs / hbase data<p>we have a Cloudera 5 installation based on one single node on a single server. Before adding 2...
<p>i've resolved in this way:</p> <ol> <li><p>stop all services but hdfs</p></li> <li><p>export data out of the hdfs. In my case the interesting part was in hbase:</p> <pre><code>su - hdfs hdfs dfs -ls / </code></pre> <p>command show me the following data:<br> drwxr-xr-x - hbase hbase 0 2015-02-26...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I turn an array into an array of Promises?<p>I am using <code>bluebird</code>, if that matters. I have an array of objects:</p> <pre><code>a = [obj1, ob...
<pre><code>Promise.map a, (obj) -&gt; doStuff obj .then (objArray) -&gt; moreStuff() </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does (311&255) mean in C++?<p>What does the statement "(311&amp;255)" mean in C++ and how does it relate to speeding up memory access when the second n...
<p>The '&amp;' operator is a binary, <em>bitwise</em> operator, and can be used to accomplish "bit masking" when used in an expression like <code>(311 &amp; 255)</code>. </p> <p>311 in binary is 100110111. When you perform an AND operation with 255 (which is 11111111 in binary), the result is to set any bits to the ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: addMarker and moveCamera invalid declarations<p>I am implementing a map that needs to show your current location when ran. So far I have had no issues but to...
<p>Not sure if this is a posting error or your actually code but it is not correct.</p> <p>You have placed code where normally there are memberVariableDeclarations. This would be what the compiler is complaining about.</p> <p>If this is just an error in the post - then correct the post and I'll remove this...</p> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mocha conditional testing - If else always passes<p>I'm trying to do a conditional test on one of my elements, but mocha just skips the "if else" statements ...
<p>Tried doing it without the chai.js expect, and it works.</p> <p>Here's how I did it, if anyone has the same question:</p> <pre><code>it('if test case', async function () { var cardProcZeroVerify = await driver.hasElementByAccessibilityId("card_proc_0"); if (cardProcZeroVerify === false || undefined || nu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Return the Row Number in an Index that meets a Specified Value (Excel)<p>I have a question regarding indexing in excel. Is there a way if I define an range (...
<p>Like Doug mentioned in the comments, the easiest way to do this is with the match function. <a href="https://support.office.com/en-us/article/MATCH-function-0600e189-9f3c-4e4f-98c1-943a0eb427ca?CorrelationId=6f57fcb5-f423-4ff0-913c-527174d9bcd4&amp;ui=en-US&amp;rs=en-US&amp;ad=US" rel="nofollow">More info</a></p> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: LLVM inconsistent numbering scheme<p>I've been playing around with compilers and have been working on my own toy C compiler. Currently I'm attempting to targ...
<p>Your code is invalid because there is actually another basic block you did not labeled:</p> <pre><code>true0: ; preds %0 %5 = add i32 0, 1 ret i32 %5 hidden_bb: ; this will named as %6 by default br label %end0 else0: ; preds %0 </code></pre> <p>If it has a label than the error will gone. Note that all...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make erlang see that an atom is a PID<p>I have the following code:</p> <pre><code>-module(circle). -export([proc/1,mother/0,chain/1]). -spec mother...
<p>Registered process name doesn't turn into pid. Here is type specification of destination in <a href="http://www.erlang.org/doc/man/erlang.html#send-2" rel="nofollow">erlang:send/2</a> which is the same as <code>!</code> operator:</p> <pre><code>dst() = pid() | port() | (RegName :: atom()) | {RegN...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using C# Dataset to read xml file<p>I have an xml file with the below data:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt; &lt...
<p>Just get rid of the <code>&lt;countries /&gt;</code> element. E.g.,</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8" standalone="yes"?&gt; &lt;Tables xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt; &lt;country country_id = "1" name = "Afghanistan"/&gt; &lt;country country_id = "2" name = "Alba...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mailjet Non-Nested Loop Failing<p>My test email for a Mailjet Template keeps failing in a for loop I am using. Unlike other Mailjet Loop questions on stack o...
<p>After so many frustrating hours, I figured out what was wrong as I was about to post this question. Hope it helps someone save some time.</p> <p>In a for loop, you cannot give a value a default value. For instance {{var:FirstName:""}} is ok outside of the for loop, but {{month.Name:""}} is NOT okay inside the for l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I execute HTML code with a Javascript for loop?<p>I am trying to create a page, where each film (from a database) is displayed in an image slider, I ...
<p>Assuming your data is stored in a variable called <strong>films</strong> like the following:</p> <pre><code>var films = [["1917", "1.png"], ["The Lion King", "2.png"], ["Parasite", "3.png"]]; </code></pre> <p>you can loop through them like this:</p> <pre><code>var i, len, films, list; for (i = 0, len = films.leng...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Making a template that requires a template<p>I am trying to make a templated class that only works on other templated classes.</p> <p>My attempt looks like:...
<p>What you need is </p> <pre><code> template &lt;template&lt;typename, typename&gt; class T, size_t count&gt; class DoubleTemplate { ... }; </code></pre> <p>Example:</p> <pre><code>#include &lt;iostream&gt; #include &lt;cstddef&gt; template &lt;typename K, typename V&gt; class Foo {}; class Bar {}; template &l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Python dict values from external file in WRDS CRSP query<p>I would like to read dictionary values (CRSP PERMNOS) from an external file (a Python dict) ...
<p>First, write each of your permnos to a file called permnos.txt in the following format:</p> <pre><code>22074 20482 ... 18980 </code></pre> <p>Then you can do the following:</p> <pre><code>def main(): parm = {'permnos': tuple([line for line in open('permnos.txt', 'r')])} data = db.raw_sql('SELECT date,perm...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Simulated Metrics size for "iPhone 5.5-inch" doesn't show the interface correctly in iPhone 6 plus device<p>I'm using xcode 6.1.1 version and iPhone 6 plus a...
<p>Select the button/ view you want. Then simply use the shortcut <code>⌥⇧⌘=</code>. This will <code>Reset to Suggested Constraints</code>.</p> <p>For this to work successfully, try moving your button to the suggested areas, i.e. move the button/ view to the top right corner like you have till the dotted blue lines ap...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android Studio Change Project Name / Root Directory Name<p>How to change the name of a <strong>project's root directory</strong> in Android Studio 0.9.9. I r...
<p>Basically you can by changing the project's folder name and reopening it.</p> <p>It is also recommended to change the name of the project in the Android Studio project structure by editing these files:</p> <ul> <li>Change the project name in <code>.idea/.name</code></li> <li>Rename the <code>[Name].iml</code> file...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the corret use of use case diagram<p>What is corret use of this model .. the 1. or 2. ? ... or should have 1. extends instead of include ? <img src="...
<p>I guess the UC in #1 should read "item selection" and not section.</p> <p>Both of your designs are wrong in the one or other way. "item selection" is not a use case. It does not deliver any value to Actor (at least none I could imagine). So you are trying to put a CRUD into a use case. Re-think on what the actual v...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Factory still not registered after trying solutions provided<p>I am trying to write an Rspec test for the first time, my model test worked out fine, but I ha...
<p>On this line</p> <pre><code> post :create, product: attributes_for(valid_product) </code></pre> <p>You are calling <code>attributes_for</code> passing <code>valid_product</code> which is an actual instance of <code>Product</code>, hence the error message.</p> <p>I suspect you intended to write</p> <pre><code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to see whether a symbol has been matched or not?<p>I am making a code puzzle where the user will be provided with a list of ten words encrypted with symb...
<p>I think something like this, unless I misunderstood your question:</p> <pre><code>textfile = open('a.txt') replace_dict_list = [] replace_symbol = raw_input(" Which symbol would you like to replace ") replace_letter = raw_input(" Which letter would you like to replace it with ") dict = {replace_symbol:replace_le...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Resolve javascript promise on DOM event<p>I've been looking for an answer but couldn't find none for my issue (or at least I didn't understand how to make it...
<p>Something like this?</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>function Test() {} Test.prototype.testing = function(){ return new Promise(function (resolve, reject...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I optimize This Code Into Lesser Line of Code<p>How can I optimize this code.</p> <p>I want to reduce lines of code.</p> <pre><code>public class Co...
<p>While <a href="https://stackoverflow.com/a/60210879/180719">Stephen M Irving's answer</a> is pretty spot on and corrects all the beliefs found in your question, this still answers your question, trying to minimize the number of statements.</p> <pre><code>public class CoolDude { public static void main(String[] ar...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to reduce this below java code?<p>Here I've written some code to navigate to different links using different buttons in android. Is there anyway to reduc...
<p>Create one method for click listener and use if condition.</p> <p>Here is sample code.</p> <p><strong>Your OnCreate Code:</strong></p> <pre><code>Button tv = (Button) findViewById(R.id.my1); onClick(tv); tv1 = (Button) findViewById(R.id.my2); onClick(tv1); Button tv2 = (Button) findViewById(R.id.my3); onClick(t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jQuery Hide Show when multiple selectors<p>I am trying to toggle hide/show on multiple elements, and it works on mobile, however on desktop, my code seems to...
<p>did you try this?</p> <p>Edit to your comment: </p> <pre><code>$('div.pop-up').click(function(){ $('.text').removeClass('show'); $(this).find('.text').toggleClass('show'); }); </code></pre> <p>You have to say which div to click by class, otherwise, partent div's are clicked as will...</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android SQLite: order by many columns<p>TABLE_NAME (COL1, COL2, COL3, COL4);</p> <pre><code> Cursor cur = db.query(TABLE_NAME, null, null, null, null, n...
<p>With String orderBy you could specify multiple columns as this:</p> <pre><code>String order = COL1 + ", " +COL2 + ", " + COL3; Cursor cur = db.query(TABLE_NAME, null, null, null, null, null, order); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add geom_point to stat_density_ridges<p>I am able to draw density_ridge using this code. I want to add geom_point at percentile 0.50 without changing ...
<p>Try </p> <pre><code>p + geom_point(data = aggregate(Sepal.Length ~ Species, iris, median), aes(x = Sepal.Length, y = Species), color = "red", size = 5, inherit.aes = FALSE) </code></pre> <p>(along the way you must have called <a href="https://cran.r-proje...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JavaFX MediaPlayer just stops after 1 minute+<p>I'm using the MediaPlayer class in JavaFX to run the media the whole time untill you close the application bu...
<p><strong>Hotfix</strong>, try adding the following code inside <code>start()</code></p> <pre><code>primaryStage.setOnCloseRequest(windowEvent -&gt; { mediaPlayer.stop(); }); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it thread-safe to have multiple channels for communicating with a single shared struct?<p>Consider the following code:</p> <pre><code>type Cache struct{ ...
<p>In principle the usage of channels is a valid way to ensure synchronous access to the struct data. The problem I see with your approach is that your <code>Run</code> function does only a single read and then returns. As long as you call <code>Run</code> from the same goroutine every time, it might work but there's a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to compare arrays in my case?<p>I am trying to do a mapping in my app.</p> <p>I have something like</p> <pre><code>$scope.newProducts = ['123','456','7...
<p>You could set a <code>isNew</code> flag on the new products.</p> <pre><code>$scope.products.forEach(function (product) { if ($scope.newProducts.indexOf(product.id) &gt; -1) { product.isNew = true; } }); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Saving picture croped from div-tag<p>I have found a way to move a picture round in a box made of a tag. It works perfectly as i want it. The code is as fl...
<p>You have two ways that you can handle this. In <code>PHP</code> you can do server side editing (You would pass the coordinates to the server and then use something similar to <a href="http://php.net/manual/en/book.image.php" rel="nofollow">GD</a> in order to crop the image to the set width/height you want), or use t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Symfony entity field type with custom unselectable separators<p>Lets say I have an entity City which has cityName also has priority 1, 2 or 3. I need to crea...
<p>You could use optgroup tag <a href="http://symfony.com/doc/current/reference/forms/types/entity.html#group-by" rel="nofollow">to group</a> cities by specified field. Just add <code>'group_by' =&gt; 'field_name'</code> option to the city field.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: xcode autolayout hidden view takes up space<p>I have been struggling all day to make this work but<br> but without success. I tried to set the Button Top Con...
<p>Visibility of views has no effect on constraints. Hidden views still participate in the constraint system just like visible ones.</p> <p>If you want the layout to change when a view's visibility changes, you have to modify the constraints manually when your view's visibility changes. You can either disable/uninstal...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can resume Thread But unable to stop completly<p>I have finally been able to get my thread to resume after some excellent advice from you guys, but am unable...
<p>Unless you're actually checking the <code>intrrupted</code> state of the current thread, then interrupting it will have no effect...</p> <p>Instead, you could use another <code>AtomicBoolean</code> value which indicates if the thread should continue performing it's work, for example</p> <pre><code>public class Wor...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: bootrsp function unknown to Matlab<p>I try to execute a simple matlab bootstrapt example from taken <a href="https://www.google.com.tr/url?sa=t&amp;rct=j&amp...
<p>Abdelhak M. Zoubir and D. Robert Iskander created once a "BOOTSTRAP MATLAB TOOLBOX", that is a private library for computing bootstraping statistics. This library required Matlab 5.0 and the Statistical Matlab Toolbox of this time. It contained a file called bootrsp.m.</p> <p>You can read about it and download the ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Annotation in pydev not showing correctly<p>On two installations of pydev on Windows (different computers) with Eclipse 4.4 the annotations of errors and war...
<p>I can reproduce the problem starting form a fresh installation of Eclipse (Luna, Eclipse IDE for C/C++ Developers, Windows 64bit) and adding first PyDev and then other plugins until the problem reappears:</p> <p>PyDev seems to be incompatible with "PTP Fortran Support" (installed from <a href="http://download.eclip...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I'm confused on why this Linked List implementation works<p>I've just recently gotten into linked lists and I'm adding my own "add to end" function. </p> <p...
<blockquote> <p>Wouldn't <code>temp-&gt;pNext != NULL</code> stop at the 2nd to last node?</p> </blockquote> <p>No. Here is the pictorial representation for ease of understanding.</p> <p>With <code>temp != NULL</code>, <code>temp</code> will be pointing to <code>NULL</code>:</p> <pre><code> +---+ +---+ +---+...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RecyclerView keeps repeating cached (?) subview and not looking to onBindViewHolder<p>I have RecyclerView where every list item has an ImageButton, thee imag...
<p>Try to change your code to:</p> <pre><code>if (myVote != 0) { Log.d("dbg", myVote + ""); holder.ratingButton.setImageResource(R.drawable.ic_star_grey600_36dp); } else { holder.ratingButton.setImageResource(int another resource); } } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas - change cell values so that they equal the deviation from the average across the row?<p>Say that I have a df that looks like the following: </p> <p>...
<p>Sure, you calculate the <code>mean</code> computed row-wise and then calculate the difference:</p> <pre><code>df = pd.DataFrame({'x':[1,2,3],'y':[2,3,4]}) mean = df.mean(axis=1) df = df.sub(mean,axis=0) print(df) </code></pre> <p>Output:</p> <pre><code> x y 0 -0.5 0.5 1 -0.5 0.5 2 -0.5 0.5 </code></pre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: tidying time series data by country<p>I have time-series data organized by country and then my variable of interest. When I occasionally have two rows that a...
<p>I think I understand what you're asking, but it's tough to tell from the way you've presented your data and phrased the question. Some helpful resources on how to ask questions are <a href="https://stackoverflow.com/help/how-to-ask">How do I ask a good question?</a> and <a href="https://stackoverflow.com/help/minima...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: FPGA reached the limit of USB WireIns<p>I'm programming a Xilinx Spartan-6 on an OpalKelly implementation for my master thesis at university. To by precise, ...
<p>If you have lots of data that you can stream, use a Pipe.</p> <p>If you want to access the data randomly, you'll have to use a multiplexer, controlled by a WireIn.</p> <p>Regarding efficiency, you'll have to specify what dimension of efficiency you are interested in, and what value is acceptable. For example, ban...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SwiftUI - usage of toggles - console logs: “invalid mode 'kCFRunLoopCommonModes'” - didSet does not work<p>I have a general problem using toggles with Swift...
<ol> <li><p>Ignore that warning, it's SwiftUI internals and does not affect anything. If you'd like submit feedback to Apple.</p> </li> <li><p><code>didSet</code> does not work, because <code>self</code> here (as <code>View</code> struct) is immutable, and <code>@State</code> is just property wrapper which via non-muta...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ajax request giving duplicate data<p>actually I am inventing a newsfeed script for my own purposes and I am getting some duplicate error anyone any help woul...
<p>This is it I got the answer thanks to all I myself learned it Here is the code in case you all need it:</p> <pre><code> $current_time = $_POST['last_time']; $item = mysqli_fetch_assoc($posts_data); $last_news_time = $item['date']; while ($last_news_time &lt; $current_time) { usleep(1000); //g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Relative Postion in a vector of n-minimum values in Matlab<p>I would like to know how to compute a vector in Matlab that contains the relative position of th...
<p>Use the second output of <a href="http://www.mathworks.com/help/matlab/ref/sort.html" rel="nofollow"><code>sort</code></a>. The second output of <code>sort</code> tells you the position of where each number in the original unsorted array appears in its sorted result:</p> <pre><code>&gt;&gt; Q=[10,15,11,18,90,21]; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is that a bad design for access control database?<p>I'm a simple system in PHP and codeigniter and need a simple but better way to manage users and their acc...
<p>you forgot a table for relationship between the role- id to multiple users - id.... so each user would have a role and on basis of the role he would get permissions.. or else u can add a field role_id to users table..</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Centering Objects From Storyboard<p>Im starting to experiment with storyboard. As you can see I have chosen the storyboard size to be height=regular and widt...
<p>The problem is that (as described in the comments) you are positioning the views without AutoLayout. When you just drag and drop the views, it's actually setting the frame's positions and sizes. The main problem with this approach is that it doesn't set the position and size in a proportional and related manner, tak...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dealing with import of foreignKeys in django-import-export<p>I don't understand how django-import-export module deals with ForeignKeys. Here is a simple exem...
<p>I figured out that you have to find yourself the match ! It's impossible to alterate values in a tablib dataset so you have to take entries make changes and put them back in a new line then erase the old one. </p> <p>My excel template contains columns <code>id_genus</code> (empty), <code>name_genus</code> and <code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: php Object of class DateInterval could not be converted to string<p>i've tried using date_diff and date_create to get a difference from two date that's alrea...
<p>You need to call <a href="http://php.net/manual/en/dateinterval.format.php"><code>DateInterval::format()</code></a> to display that difference as a string.</p> <pre><code>echo $diff-&gt;format('%d days'); </code></pre> <p>See the manual for all of the available formatting options.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Issue with line Target.row<p>I have a macro which works well. This macro changes the size of the character and the color of the selected cell and when unsele...
<p>The <code>Row</code>-property of a <code>Range</code> returns the row number.<br> What you need is a Range that contains all cells of a row. You can use <code>Range.EntireRow</code> for that:</p> <pre><code> With Target.EntireRow .Font.Size = LargeSize .Interior.Color = 49407 End With </code></pre>