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: Catch on-click event on checkboxes<p>I try to get the click on a checkbox using RactiveJS, as follows:</p> <p>HTML:</p> <pre><code>&lt;input type='checkbox...
<p>Your fiddle is using version <code>0.3.7</code>, in that version only proxy events are supported and there was no init event in which to subscribe, and there were no array methods on ractive itself. So you'd need to do something like:</p> <pre><code>ractive.on('toggle', function(){ this.get("clicked").push("cli...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to test select box without any option selected with codeception?<p>So the value of the field should be the first option selected.</p> <p>As i see the pr...
<p>This situation can be tested with the following:</p> <pre><code>$I-&gt;seeElement("#id_of_the_select_box"); $I-&gt;dontSeeElement("#id_of_the_select_box option[selected='selected']"); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to hide an element when display: none doesn't work<p>Here's the deal. I have troubles while trying to hide a paragraph element with a class"text".<a href...
<p>Use <code>visibility:hidden</code></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-css lang-css prettyprint-override"><code>.img { position: absolute; left: 40%; transform: translateX(-50%); } .p-wrap { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Perform script execution, only if condition fullfiled<p>I have next script </p> <pre><code>./students.sh |awk '{print $1,$4}' CLARA MARC [Found] STEVE [Foun...
<p>One way to do this type of generic task is to use the exit code of a previous program to determine whether or not to execute the next program.</p> <p>Generically:</p> <pre><code>if anycommand; then anothercommand fi </code></pre> <p><code>anothercommand</code> will only execute if <code>anycommand</code> was...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: When you install TFS on the application tier, does that affect the databases on the data tier?<p>I only installed TFS 2013 on the application tier and didn't...
<p>No installing the bits does not affect the data tier. You need to configure the application tier to point at the data tier before it will have any effect.</p> <p>If you already have databases and you are upgrading in place then you can just "configure app tier only".</p> <p>If you are on new hardware then you need...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Assistance with Nested Dictionary<p>So what my code is supposed to do is get the student id's and put them into a dictionary and then get their homework, exa...
<p>Your question is not clear, as the form of your input data is unknown. But in general terms you could do as follows:</p> <pre><code>out_dict = {'123456':{'exam':[97, 98, 45], 'homework': [44,45]}} # example of a list with grades. maybe read from a file? homework_grades = [1,2,3,4] # appends grades one at a time f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: subtracting Dates and saving value in different column of database<p>Ok, so What i want to do is take Two dates, subtract them and insert their answer (in in...
<p>After all the researching and help from the people above, this is what worked for me:</p> <pre><code>DateTime AdmitDate = DateTime.Parse(TextBox1.Text); cmd.Parameters.AddWithValue("@AdmitDate", AdmitDate.ToShortDateString()); DateTime DischargeDate = DateTime.Parse(TextBox2.Text); cmd.Param...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can AngularJS trigger $watch on one URL when data is updated on another URL<p>I'm wondering if I can trigger <code>$watch</code> for changes in the database ...
<p>If you need two ways communication, like updates on a client when someone else visits a page, you could use a librairie like socket.io <a href="http://socket.io/" rel="nofollow">http://socket.io/</a> which visit to every connected socket).</p> <p>You could also add a timer to request like every 30sec the server and...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Undefined method for class / calling methods outside of a class<pre><code>class Computer_create public def initialize(filename) @@files = [] @fi...
<p>The error message is exactly right; the class doesn't have a <code>list</code> method.</p> <p>Call <code>list</code> on the <em>instance</em> of <code>Computer_create</code> you already created, e.g.,</p> <pre><code>file_1.list </code></pre> <p>In other words, exactly how you called the <em>other</em> instance me...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to store different outputs inside a funcion?<hr> <p>I want to store different output variables that are calculated inside a function. I coded a toy exam...
<p>It is impossible without a <code>list</code>. <code>List</code> would be better than a <code>data.frame</code> because it can store different types of variables (<code>vector</code>, <code>table</code>, <code>plot</code> ect.) Try to do it like here:</p> <pre><code>f = function(number) { xx = NULL savexx = NULL s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: javascript, saving reference to nested object literal<p>Lets say I have the following object:</p> <pre><code>name = { name_one : { name_one_A : ...
<p>It's a bit hard to tell exactly what you're asking which has caused some confusion among the answers.</p> <p>If you're referencing <code>name.name_one.name_one_A</code> multiple times, you can save that once and then use it:</p> <pre><code>var x = name.name_one.name_one_A; x.name_one_A_a = 'Bill'; x.name_one_A_b =...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a Yii2 model without a database<p>I would like to create a yii2 model without a database. Instead, the data is generated dynamically and not st...
<p>This is a <code>Model</code> from one of my projects. This <code>Model</code> is not connected with any database. </p> <pre><code>&lt;?php /** * Created by PhpStorm. * User: Abhimanyu * Date: 18-02-2015 * Time: 22:07 */ namespace backend\models; use yii\base\Model; class BasicSettingForm extends Model { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Labelling and Grouping Postcodes using Python<p>I'm fairly new to Python and I am attempting to group various postcodes together under predefined labels. For...
<p>The reason why your comparison block isn't working is that when you use csv reader to read your file, each line is being added to <code>your_list</code> as a <code>list</code>. So you are making a list of lists and when you compare those things it doesn't match.</p> <pre><code>['LL58'] == 'LL58' # fails </code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Retrieve JSON POST data in CodeIgniter<p>I have been trying to retrieve JSON data from my php file.Its giving me a hard time.This is my code</p> <p>Code in ...
<p>General method I use for my Ajax Calls in CI :</p> <p><strong>JS :</strong></p> <pre><code>post_array = { "myvar" : "value1", "myvar2": "value2" } $.post(baseUrl + "/AjaxController/my_function", post_array, function(data) { var res = jQuery.parseJSON(data); alert(res.property); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to filter by a column generated in the same query?<p>The below is a very simple query where <code>my_data</code> consists only of 1 row, and it's there o...
<p>I want to start answering your question as you presented them.</p> <ol> <li><p>No, you cannot filter by a new generated column alias you just create in the select statement and I will explain why, later.</p></li> <li><p>On the other hand, you are right on using a CLE (the part that start with WITH) in order to filt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Display SwiftUI modal from UIKit view<p>I have got a modal sheet built with <code>SwiftUI</code> but the rest of my app is <code>UIKit</code>. I want to disp...
<p>You do it like this</p> <pre><code> let hostingController = UIHostingController(rootView: MyModalView() self.present(hostingController, animated: true, completion: nil) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Force localeResolutionCallback upon language change<p>I'm confronted with an interesting problem. I am using "localeResolutionCallback" to set the locale on ...
<p>You should use "locale" as you mentionned and then just return null if it's during a device language change. Do the opposite if it's a manual language set.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Show Two table columns in a aspxgridview?<p>I have tow tables in mssql server, Car &amp; Weight.</p> <p>Car has IDCar, Name, Username, Description co...
<p>Write a query with the <code>join</code> with both tables and get the desired result and then bind that result to the <code>gridview</code>. Your query can be like,</p> <pre><code> Select c.Name,w.Weight,w.Date FROM Car c LEFT Join Weight w ON c.CarID = w.CarID </code></pre> <hr> <p><stro...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I change the properties of all the buttons in my Swift app?<p>I have a Swift app that navigates through many view controllers, all with similar appearanc...
<p>Here are the basic steps which will simplify things, in your case this would have to be repeated for each viewController. </p> <ol> <li><p>Create one outlet for all your buttons:</p> <pre><code>@IBOutlet var myButtons: [UIButton]! </code></pre></li> <li><p>Connect (drag) this outlet with each of the buttons on the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Testing Stripe works with js: true, but it makes other components work incorrectly<p>Testing the stripe framework requires Javascript to be turned on, but wh...
<p>As per your comment, you're getting an error from stripe's API: <code>Stripe::InvalidRequestError</code>.</p> <p>According to their API (<a href="https://stripe.com/docs/api#errors" rel="nofollow">https://stripe.com/docs/api#errors</a>):</p> <blockquote> <p>Invalid request errors arise when your request has inva...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JavaFX freeze window<p>I encountered a problem when I filter a treeView (long process) my application freezes. I tried to do this in a separate thread (Threa...
<p>I <strong>fixed</strong> it this way, I don’t know how correct it is. But it worked for me. I hope it will be useful.</p> <pre><code> //Event Button Search btnFind.setOnAction(event -&gt; { newFind(); if (Config.isRoot()) { String finalSFilterExt = filterExt.getText()...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to use Filtering while using google Places API (Android)<p>I'm trying to use Google Places API on my Android and fail in the filtering process. I've ...
<p>Please post LogCat, also check and verify that your Manifest file contains all the required permissions and google play services version defined.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Neo4j lucene query on relationships and nodes property<p>I have created a fulltext index "peopleSearch" on 'description' property of node "User" and 'skillna...
<p>Manual indexes in Neo4j (and your fulltext indexes are of that kind) are either for nodes or for relationships. You cannot have a combined index for both. </p> <p>If if that would be possible it wouldn't make any sense since you use the indexes in Neo4j to find start points for traversals. If the index query result...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google using HTTP/2.0?<p>Why is Google already using HTTP/2.0 as at this time there isn't any RFC for that (it was approved by the IETF on 17th February 2015...
<p>Both servers and many UAs implement the HTTP/2 variant that was specified in an Internet Draft months ago. It's not materially different from the final HTTP/2 protocol, apart from the ALPN identifier naming the protocol.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas: concatenate multilevel index such that the other Dataframe has different sorting<p>Consider you have the following two dataframes <code>dfs</code> an...
<p>You can repeat rows by unique values of <code>Gender</code> by <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.concat.html" rel="nofollow noreferrer"><code>concat</code></a>, use <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.reset_index.html" rel="nofol...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Typescript/Javascript custom hooks<p>i am beginner and trying to refactor Javascript hooks into Typescript but i cannot get button onClick event to change st...
<p>You're getting a type error because you're returning an array in your <code>useToggler</code> function.</p> <pre><code>function useToggler (defaultOnValue=false){ const[istoggledOn, setIsToggledOn] = useState(defaultOnValue); function clickHandler(){ setIsToggledOn(prevState =&gt; !prevState) }...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In Storyboards, can I put custom text under the "featured" tab bar icon?<p>I can set the "System Item" to "Featured", and it will show a star icon with the "...
<p>If you change your viewcontroller's title, it should update it's associated tabBarItem's title, but you're still going to have a problem when your tabBarController gets initialized outside of that view controller.</p> <p>The safest route it still going to be getting a star.png and using that instead.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to call method from fragment only if host activity was destroyed?<p>I got a <code>method()</code> in the fragment. Fragment in host activity. So I need t...
<p>You can, by SupportFragmentManager, get a Fragment by layout id, tag or name. But the most important thing here is in some situations Activity.onDestroy() method could never be called. So be careful if you implement code that needs to be executed, like an unsubscribe logic or removing callbacks.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I get only one checkbox check action to trigger<p>I have a group of checkboxes and a function to add an input when checked. The problem I'm getting is...
<p>Well. For every change, you run a function for each checkbox. If i had previously checked a checkbox, then, it's checked and your function related to ALL the checked checkboxes.</p> <p>I would advise to run the function only once and not use the <code>.each</code> function. So, for every change in the checkboxes, i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Displaying element's layer style in javascript<p>I am trying to display a div's layer style using javascript. My js code is as follows:</p> <pre><code>&lt;b...
<p>You should use the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Member_Operators#Bracket_notation" rel="nofollow">bracket notation</a></p> <pre><code>function displayStyle(objectId, styleName) { var objRef = document.getElementById(objectId); var styleValue = objRef.s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Streaming data from Mongoose - "Can't set headers after they are sent"<p>I have an app that's using Node, Express, Angular, and Mongoose. I'm trying to get ...
<p>With the streaming interface, the <code>data</code> event is emitted for every document in the query result. This is resulting in <code>res.json(data)</code> being called multiple times, which is an error since <code>res.json</code> internally invokes <code>res.send</code> which tries to set the charset on the <code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find the Second value from a table.?<p>I have One table with StatusID in StatusHistory Table. One customer could be multiple statusID. I need to find ...
<p>There's nothing like second value of table. It depends on many factors, like indexes, etc.</p> <p>To be able to get 1., 2. or n-th record depending on sort order, use <a href="https://msdn.microsoft.com/en-us/library/ms186734.aspx" rel="nofollow">ROW_NUMBER()</a> function.</p> <pre><code>SELECT StatusIDHeld FROM ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Odd white space on smaller screens (non-responsive site)<p>If you take my current site below 1224px resolution and scroll to the right, there is just white s...
<p>Your .container class has a fixed width of 1224px and (according to the comments) you don't need your site to be responsive below 1224px width, so the easiest solution is to set min-width: 1224px to the body element of your document.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regular Expression for SOAP Response in Groovy<p>Did I do something wrong here on matching/extracting the value of UserToken (ie. "bb14MY") using Regular Exp...
<pre><code>def soapResponse = connection.content.text; Pattern pattern = Pattern.compile(/(?s)UserToken=&amp;quot;(.*?)&amp;quot;/, Pattern.DOTALL); Matcher matcher = pattern.matcher(soapResponse); if (matcher.find()) { println(matcher.group(1)); } </code></pre> <p>This is what I did to solve my question.</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set a radiobutton as checked by updating its FormControl<p>In my app I have a Component which acts as a radio-button-group and in it I have my own rad...
<p>You have to pass formGroup to the child and there get the value of control you want, or simply pass selectedValue. Then you use [checked] attribute and compare value and selectedValue, then it will work.</p> <p>Here is working demo on <a href="https://stackblitz.com/edit/angular-xnxusf" rel="nofollow noreferrer">st...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Neo4j insert nodes with various relationships<p>I tried to create "recipe", "ingredients" and "user" nodes (author).</p> <p>Basically, an author can have ma...
<p>I believe the issue is with the WITH clause referencing the next node to be created, rather than referencing the previous node to be created. Additionally, the code is trying to create undirected relationships.</p> <p>Try this:</p> <pre> MATCH (user:User) WHERE ID(user) = {uid} CREATE (recipe:Recipe {name:"receta ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: double-type Assignment Error, C++<p>I preempt my question with the fact that I started using C++ two days ago.</p> <p>I get this error: "a value of type "d...
<p><code>getInput</code> is the name of a function. That name by itself <em>refers</em> to the function, but it doesn't <em>call</em> the function. And since a function name is, in most contexts, implicitly converted to a pointer to the function, it becomes an expression of type <code>double (*)()</code>, or "pointer t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to check whether a file is present in external storage?<p>How to check whether a file is present in external storage? </p> <p>I want to play a video fro...
<p>You Can check whether the file is exist or not by the following code.. </p> <pre><code>File extStore = Environment.getExternalStorageDirectory(); File myFile = new File(extStore.getAbsolutePath() + "/book1/page2.html"); if(myFile.exists()){ ... } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android take picture with low RAM device - Can setPictureSize() lower the memory usage?<p>Following the documentation from developper.android.com </p> <p>I ...
<p>I found a solution :</p> <p>We stop using Camera camera.takePicture() and only use the preview object. Idea based on @CommonsWare code for the photo display and base on zebra crossing astute solution. </p> <p>idea : </p> <pre><code>btTake.setOnClickListener(new View.OnClickListener() { @Override ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Active Directory search filter example<p>I can't find the meaning, the difference between these two examples for search filter </p> <pre><code>(&amp;(object...
<p>If you reorder them a bit, I guess you'll see the difference:</p> <pre><code>(&amp;(objectClass=user)(sn=*)(bysUserName=*)(|(bysUserName={0})(cn={0}))) (&amp;(objectClass=User) (|(bysUserName={0})(cn={0}))) </code></pre> <p>The first one has <strong>additional</strong> restrictions on <code>sn...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I render multiple draw modes?<p>I've created a program that switches draw modes (GL_TRIANGLES, GL_POINTS, GL_LINE_LOOP, etc). I render these draw mod...
<p>You need to draw twice. The first one with a <code>GL_TRIANGLES</code> primitive and the second one with <code>GL_TRIANGLE_STRIP</code> primitive. Something like this:</p> <pre><code>glDrawArrays(GL_TRIANGLES, first, count); // do any atualization in Uniforms, if necessary to update transformations // and do it ag...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: rails server command doesn't run<p>I am trying to run the rails server on windows instance (I am using gitbash). I already install ruby (1.9.3), rails(4.2.0)...
<p>To solve this for the time being comment out the web-console gem as this has reference to the pty gem but please take note of my comment on your question</p> <pre><code># gem 'web-console' </code></pre> <p>You might then want to run bundle install again</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spree get all taxons from underlying taxonomy<p>How to get all taxons that are children of a certain taxonomy.</p> <p>I retrieve the taxonomy like this:</p>...
<p>A Spree::Taxonomy <a href="https://github.com/spree/spree/blob/v2.4.3/core/app/models/spree/taxonomy.rb#L5" rel="nofollow">has_many :taxons</a> so you should be able to do:</p> <pre><code>Spree::Taxonomy.find_by_machine_name('product_categories').taxons </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Excluding properies for JIRA JQL search using REST API<p>I am using JIRA rest api for <a href="https://docs.atlassian.com/jira/REST/latest/#d2e2450" rel="nof...
<blockquote> <p>Is there a way we can filter out all other properties?</p> </blockquote> <p>There is no way to hide other properties of assignee.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Matching a char in a matrix on Ocaml<p>I am making a game solver and while using a matrix in OCaml, I need to check whenever it's complete, with A's or V's, ...
<p>First, note that the value of any OCaml construct of the form <code>for ... done</code> is <code>()</code>, the single value of type <code>unit</code>. You can't give a value to the loop as you seem to be trying to do.</p> <p>Your immediate problem is that when you use <code>if</code> without <code>else</code> in O...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: xCode publish App Icon Error<p>When I try to publish my app to the app store, it shows me two errors:</p> <p>First: Missing required icon, the bundle does n...
<p>Yes, you need a 57x57 png in your build. I would recommend reading the <a href="https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/AppIcons.html#//apple_ref/doc/uid/TP40006556-CH19-SW1" rel="nofollow">iOS Human Interface Guidelines: App Icons</a> material.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JavaScript files not working on content page asp.net<p>I have a content page where I want to add 2 external JavaScript files for ckeditor. Everything is work...
<p>Based on the comment by the OP...</p> <blockquote> <p>In developer tools i'm getting this error: "Error code: editor-incorrect-element.". But in other page where its working fine I don't get this error</p> </blockquote> <p>In which case this is not a problem with the location of your JS files.</p> <p>It is beca...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why can't I see an image in Swift?<p>I am going to make an image slide. So I used CollectionView.</p> <p>But I can't see the image. What's the problem?</p> ...
<p>You need to specify the <strong>vertical spacing constraint</strong> between the <code>imageView</code> and <code>button</code>, i.e.</p> <pre><code>button.top = imageView.bottom </code></pre> <p><a href="https://i.stack.imgur.com/EOMDG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EOMDG.png" ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rails acts_as_tenant seed data<p>I'm using the <code>gem 'acts_as_tenant'</code> in a Rails 3 project.</p> <p>I would like to seed new data every time a new...
<p>This worked:</p> <pre><code>$ TENANT=5 rake db:seed </code></pre> <p>In seed.rb:</p> <pre><code>statuscode = Statuscode.first_or_create( :tenant_id =&gt; ENV['TENANT'], :statuscode =&gt; 'Completed', :closed =&gt; true ) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CSS and JS files don't update in Phalcon app<p>I have a Phalcon app where I added some HTML (in volt), JS and SCSS. I compiled my CSS into the <code>public</...
<p>We just solved this issue in vagrant by disabling send file support with <strong>sendfile off;</strong> parameter to nginx site.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to check if instance exists if variable not existing?<p>I have a button which imports a module with a class. The class (varClass) creates a window.</p> ...
<p>You could catch the <code>NameError</code> exception:</p> <pre><code>try: var.toggleUI() except NameError: var = varClass() </code></pre> <p>If you needed call <code>toggleUI</code> the first time too, just try the name itself:</p> <pre><code>try: var except NameError: var = varClass() var.toggle...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google AdMob 7 integration with cocoapods<p>I have spent hours on this and still no luck.</p> <p>I have a library (which is a pod) and it's using Google AdM...
<p>If anyone is interested or faced this problem, I know now why my end-point application couldn't notice the existence of Google Ad Mob pod inside my own pod.</p> <p>I should have used spec.ios.vendored_frameworks in my pod spec cause now Google AdMob SDK and Maps SDK for iOS are provided as Frameworks in cocoapods s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: 'WSGIRequest' object has no attribute 'get'<p>I'm trying to create a login form with Django. I'm creating a view witch will handle both get and post requests...
<p>You should use the <code>request.POST</code> dict-like object:</p> <pre><code>username = request.POST.get('username','') password = request.POST.get('password','') </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Effective non-blocking execution<p>I implement a service which runs on cloud. I have a method <code>fastExcute()</code> which makes some calculation very fas...
<p>if you want to execute your <code>IndependentBackgroundMethodAsync</code>asynchronously and you care about the result I would use <code>ContinueWith</code> (see <a href="https://msdn.microsoft.com/en-us/library/system.threading.tasks.task.continuewith%28v=vs.110%29.aspx/%22ContinueWith%20MSDN%22" rel="nofollow">MSDN...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why can't I compile OpenSSL with multiple threads? (make -j3)<p>I'm trying to build OpenSSL. If I build it with <code>make</code> (1 thread), it compiles oka...
<p>As MadScientist's comment indicates a makefile has to be designed to support parallel builds. Apparently OpenSSL is supposed to support parallel make but one of their <a href="http://rt.openssl.org/Ticket/Display.html?id=2364&amp;user=guest&amp;pass=guest" rel="nofollow">bug reports</a> shows that this support has o...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: write query using Doctrine Query Builder<p>i have three table Patient,Symptoms, PatientSymptoms </p> <pre><code>patient Symptoms PatientSymptoms id n...
<p>Try following code:</p> <pre><code>$result = $em-&gt;getRepository('EntityBundle:Patient') -&gt;createQueryBuilder('p') -&gt;select('DISTINCT(p.id)') -&gt;innerJoin('p.PatientSymptoms','ps') -&gt;innerJoin('ps.Symptoms', 's') -&gt;andWhere('s.symptoms = :name') -&gt;setParameter('name', $nam...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does Mercurial treat equivalent changesets?<p>My setup is as follows: I've a repository R with default branch and another named branch "a". On both branc...
<p>The following is a part of <code>hg help log</code>:</p> <pre><code> Note: for performance reasons, log FILE may omit duplicate changes made on branches and will not show removals or mode changes. To see all such changes, use the --removed switch. </code></pre> <p>So you should be able to see both change...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get a name from the user and display it in a Toast using Kotlin?<p>I made a custom dialog that contains an <code>EditText</code> to make the user ente...
<p>Omar welcome to the <strong>SO</strong> community.</p> <p>In your code what you're doing is making a custom dialog and calling the dialog provided positive buttons <code>onClick</code> I'm sure your code crashes at this line of code</p> <pre><code>val name = entered_name.text.toString() </code></pre> <p>Because i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Accessing Leaflet.js GeoJson features from outside<p>I want to interact with a leaflet powered map's GeoJson overlay (polygons) from outside of <code>L.</cod...
<p>You may use getLayer to get the feature by its id.<br> <a href="http://leafletjs.com/reference.html#layergroup-getlayer" rel="noreferrer">http://leafletjs.com/reference.html#layergroup-getlayer</a></p> <pre><code>var geojsonLayer = L.geoJson(data,{ onEachFeature: function(feature, layer) { layer._leafle...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Take only digit as input by scanf() and avoid other characters<p>I want to take the following format of input using <code>scanf()</code> until EOF that will ...
<h1><code>std::cin</code> solution</h1> <p>Since you are already using <code>std::cout</code><sup>1</sup>, you can use <code>std::cin</code> instead of <code>scanf</code>. Now, read the number first, and handle the sign after:</p> <pre><code>std::vector&lt;int&gt; numbers; for (int n; std::cin &gt;&gt; n;) { num...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: variable declared inside method satisfy encapsulation or not<p>encapsulation is properties or method hiding using access modifier i want to know is a variabl...
<p>These two variables are method specific and would be on Stack rather than on the Heap. So encapsulation doesn't apply to method specific variables.</p> <p>You should encapsulate fields specific to class (which constitutes to State of an object)</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Php mail not working with more than one recipient<p>How come <a href="http://www.emanueleferonato.com/2008/07/22/sending-email-with-multiple-attachments-with...
<p>although this is not a direct response to your issue, you could potentially save yourself trouble by using a pre-existing email sending library like either:</p> <p>phpmailer <a href="https://github.com/PHPMailer/PHPMailer" rel="nofollow">https://github.com/PHPMailer/PHPMailer</a></p> <p>or simplesmtp <a href="http...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Building GCC: Is there a way to only build cpp?<p>I am attempting to build GCC however what I really want is only c pre-processor.</p> <p>Is there a way to ...
<p>It seems that CPP is not a separate program all it does is execv cc1 as captured with the following strace command</p> <pre><code>execve("/usr/lib/gcc/x86_64-linux-gnu/9/cc1", ["/usr/lib/gcc/x86_64-linux-gnu/9/"..., "-E", "-quiet", "-imultiarch", "x86_64-linux-gnu", "-", "-mtune=generic", "-march=x86-64", "-fasynch...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parse a xml file in Visual basic<p>which is the best way to parse this xml ???</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;DOCWARE Versi...
<p>To read a tag with a changed name you can to do using xmlReader and find if you document.Name contains this prefix "Pos", try to use this code:</p> <pre><code>Dim document As XmlReader = New XmlTextReader(fileName) While (document.Read()) Dim type = document.NodeType If (type = XmlNodeType.Element) Then ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Setting the 'pointed finger' cursor for individual rows in an asp.net gridview<p>I'm using an asp.net checkbox in a template field in an asp.net gridview. I'...
<p>what about:</p> <pre><code>input[type="checkbox"] { cursor: pointer; } input[type="checkbox"]:disabled { cursor: default; } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: History API/Angular: how to go back to predetermined URL<p>I have a requirement within my Angular app which uses the Angular UI Router, to go back from one s...
<p>I've found a more palatable solution to using cookies or local storage - session storage!</p> <p>My locn service now looks like this.</p> <pre><code>(function () { 'use strict'; angular .module('csApp') .factory('locn', ['$location', '$state', '$window', function ($location, $st...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does defining this size variable as const result in memory being zeroed out? (godbolt example included)<p>Compiler Explorer Example: <a href="https://god...
<blockquote> <pre><code>int Size = 16; // &lt;-- not const int arr1[Size]; </code></pre> </blockquote> <p>This program is ill-formed in C++, because non-compile-time-constant values may not be used as the size of an array.</p> <blockquote> <pre><code>arr3[I] = arr1[I] + arr2[I]; </code></pre> </blockquote> <p>The va...
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 add an attachment to a payment for an invoice on xero?<p>On the Xero UI, there is a way to go to the Payments made for an invoice, and add ...
<p>You can use Xero's Files API to upload a file and create an association to a payment.</p> <p>You'll need to upload the file first to <code>https://api.xero.com/files.xro/1.0/Files</code> - <a href="https://developer.xero.com/documentation/files-api/files#POST" rel="nofollow noreferrer">File Upload</a> </p> <p>...a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Golang brackets syntax explanation<p>I can't figure out what does these brackets do in this code:</p> <pre class="lang-golang prettyprint-override"><code>fu...
<p>Since the lexical scope (as commented) does not scope anything, it is more a "coding style" here, as expressed in <a href="https://github.com/gin-gonic/gin/issues/108#issuecomment-53999693" rel="noreferrer"><code>gin-gonic/gin</code> issue 108</a></p> <blockquote> <p>I, personally, like to use the brackets becaus...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# static winform controls not appearing<p>Initially I was rather confused. I am starting to understand my code is skipping the second for because my NUD arr...
<p>With such a vague, not-very-useful code example, it's impossible to say for sure what is wrong.</p> <p>That said, <code>IndexOutOfRangeException</code>, along with that apparently you are initializing the <code>equipCore</code> array once, using a field initializer, suggests that at the time it's initialized, the <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how can I get a staff member's supervisor using mysql<p>hello I need to get an employee's supervisor name so </p> <pre><code>desc staff; +--------------+--...
<p>Basically, you can self-join the table:</p> <pre><code>select t1.Lastname from mytable t inner join mytable t1 on t1.staffNo = t.SupervisorNo where t.Lastname = 'McLester' </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Avoid a SQL subquery double join on the right element in PostgreSQL?<p>I am trying to optimize a sql query and want to see how i can avoid subqueries when do...
<p>I don't see why you have any subqueries at all:</p> <pre><code>SELECT f.title, f.film_id, fc.category_id, c.name FROM film f LEFT JOIN film_category fc ON f.film_id = fc.film_id LEFT JOIN category c ON fc.category_id = c.category_id ORDER by f.title </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django save methode collide with signal on model change<p>I want to save a postcover and a correspondending postcover thumbnail in a smaller resolution. In t...
<p>You should use <a href="https://docs.djangoproject.com/en/3.0/ref/signals/#post-save" rel="nofollow noreferrer"><code>post_save</code></a> signal. Since you are using <a href="https://docs.djangoproject.com/en/3.0/ref/signals/#pre-save" rel="nofollow noreferrer"><code>pre_save</code></a> now, your signal handler cal...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PDO insert not adding records to database table<p>For some reason, the first SQL works (the UPDATE) but the second INSERT part does nothing and puts nothing ...
<p>In the first statement there is an error in <code>$e = Y,</code>. <code>Y</code> must be defined as a constant or you have to put it in quotes. Also <code>'Y'</code> would be sufficient. </p> <p>For the second insert statement we can only guess, because it is not possible to know what's in <code>$row</code> and <co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NetSuite Client Script for Suitelet<p>I have a suitelet similar to: </p> <p><a href="https://stackoverflow.com/questions/55148957/how-to-add-checkbox-in-a-l...
<p>I solved the issue by removing the client script altogether and adding a POST (else) element to the suitelet to handle the submit element of the suitelet. If anyone wants to see let me know and I can post up.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fullcalendar showing 1 hour events as 2 hours<p>I have the following JSON data:</p> <p>2015-02-22T04:00:00-05:00 which clearly shows 4am to 5am which is a o...
<p>Mikesmithdev answered this one for me, I didn't have an end specified, I thought you could do it with just one string of data.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: IllegalStateException when using JavaFX Alert in init() because not on FX application thread<p>Using <a href="https://blog.codecentric.de/en/2015/09/javafx-h...
<p>In the past I've been able to solve this kind of issues with wrapping the logic in a Platform.runLater() call. ie:</p> <pre><code>try { [...] } catch (Exception e) { Platform.runLater(new Runnable() { @Override public void run() { new Alert(AlertType.ERROR).showAndWait(); Platform.exit(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Synchronous Dispatch Doesn't Work?<p>Maybe I'm not understanding the concept but shouldn't this second piece of code wait before the first one is done?</p> ...
<p>It does wait until the first finishes execution. Where the system is confusing you is with your usage of <code>myRef.observeSingleEventOfType(, withBlock:</code></p> <p>99% of APIs that request an execution block will push their operations onto a separate thread and then execute the block upon completion. The <code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: DDD (Domain Driven Design) Can I use inheritance ?<p>Consider the following example:</p> <ul> <li>We have Order, and any order can be of diffrent types.</l...
<p>Inheritance in DDD Aggragate Roots is a tricky topic. I think most people (and I think I also read this in Implementing Domain-Driven Design) would opt for not having inheritance in AR. </p> <p>The main point to think about is behaviour. Will the different Order types have different public interface at any time in ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TableViewController presented modally resists scrolling and is difficult to dismiss<p>I have a TableViewController with dynamic cells which is presented moda...
<p>The culprit was found to be this line when I set up my <code>TableViewController</code>:</p> <pre><code>self.tableView.alwaysBounceVertical = false </code></pre> <p>Apparently, disabling bouncing for the tableview kind of deactivates the drag gesture for the modal view.</p> <p>I set it to true and everything was wor...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change a method that uses System.out.print() to work with System.out.println()<p>I have the following code which works perfectly fine:</p> <pre><code>public...
<p>Currently you're creating <em>one</em> <code>StringBuilder</code> for the whole method - but never actually printing the result of it. Instead, create one <code>StringBuilder</code> per line of output. It's not a big change from your original code:</p> <pre class="lang-java prettyprint-override"><code>public static...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ruby on Rails - Admin User View<p>I am working on a Ruby on Rails application in which a user has many posts and each post has many comments. </p> <p>In the...
<p>In users table add boolean column admin and set 1 if you want that user to be admin</p> <p>In user model define </p> <pre><code>def is_admin? admin == true end </code></pre> <p>In contoroller user action</p> <pre><code>@users = User.all </code></pre> <p>In user.erb file, You can list out all users</p> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: VBScript FolderExists on Network Path returns False<p>I have a folder that <strong>does</strong> exist on the network. When I run the following code before ...
<p>Since I needed to know if the share truly exists (not just ignore the fact that my script was not being truthful), I decided to map a drive letter to the SharePoint directory first - and if that fails, I know that the folder does not really exist. Doing that, I can automate the check, and it doesn't take much extra...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I can't access the redux store properly in react components<p>I am just started using redux in my react app and I have successfully added some values on my r...
<p>I have found out that the reason for the initial values of state as output on other components was due to the fact that I was refreshing the page each time a new component was loaded.Since redux states have a special behaviour of wiping the state on refresh <a href="https://stackoverflow.com/questions/49104247/in-re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ANT task - multiple files - loop through<p>I have quite complicated ant task to write. I had to make separate builds files and 1 left. There are 4 files: </...
<p>For any xmldriven build i recommend using the ant addon <a href="http://www.oopsconsultancy.com/software/xmltask/" rel="nofollow">xmltask</a>, so something like :<br>(assuming that clientnames are similar in buildpackage.txt and structure.xml - your snippet has several names Client_01, client1 .. !?)</p> <pre><code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Profiling Django: very slow performance<p>I developed a Django application and adding some data through the admin interface. The performance is totally abysm...
<p>Answering here to avoid further discussion.</p> <p>The culprit has been the same in multiple places. I have followed this pattern (Python 3):</p> <pre><code>class RootFoo(models.Model): name = models.CharField(max_length=50) def __str__(self): return self.name class Foo(models.Model): rootfo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why C allows uninitialized local variables?<p>Looking into languages such as Java &amp; C# use of uninitialized local variable is compile time error. Then wh...
<p>The C language is well known for producing very fast and efficient code.</p> <p>With that in mind, it makes sense for the language not to automatically initialize all variables. With languages that automatically initialize variables, if you later initialize them in code, they actually get initialized twice, which i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Combine range and match in Elasticsearch<p>I have documents in an Elasticsearch index with the following structure:</p> <pre><code>{ "title": 'Nutrtional ...
<p>There are some small typos in your code snippets and you need to wrap your <code>should</code>-clause into another <code>bool</code>-query which you add/move to into your must clause.</p> <p><strong>Solution</strong> (verified with ES 7.5.x)</p> <pre><code>POST my_index/_bulk {"index": {}} {"title": "Nutrtional fa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you call postMessage() from a vue service worker<p>We have a vue firebase service worker that needs to call back to the main vue app. According to my ...
<p>The client does not need to make a fetch request in order to allow the Service Worker to communicate with it. You can use the Clients API inside the Service Worker. You can also initiate a completely separate postMessage message from the client in the beginning after the app has started.</p> <p>Clients API: <a href...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firebase Cloud Firestore: Query isn't updating ArrayList in Android<p>I am using the following query:</p> <pre><code>db.collection("Example") ...
<p>You need to understand that this query is asynchronous and the results might not have yet been added to <code>userTextArrayList</code> when you execute this log statement <code>Log.i(TAG, "User Text =&gt; userTextArrayList.get(0).toString());</code></p> <p>This log statement needs to be in <code>onComplete()</code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to collect all records at spark executor and process it as batch<p>In my spark kinesis streaming application I am using foreachBatch to get the streaming...
<p>I think this might work ... Rather than running foreach, you could use foreachBatch or foreachPartition (or or a map version like mapPartition if you want return info). In this portion, open a connection to the drools system. From that point, iterate over the dataset within each partition (or batch) sending each to ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Detect whenever click event is fired in fully transparent window<p>I have a transparent controls and window where I can click through as it would not even ex...
<p>You would need to create an event hook so that you could snoop all system wide messages before they are dispatched to the target window. Check the following <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms632589(v=vs.85).aspx" rel="nofollow">link</a> for more information...</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Swift: location not being updated when returned from background<p>I have a Swift app that I am trying to update the location when the app is returned from th...
<p>In <code>applicationWillEnterForeground</code>, the code is creating a new, local instance of <code>ViewController</code> that is never displayed, does not yet have a <code>locationManager</code> created and so has no effect.</p> <p>It is not referring to the <code>ViewController</code> instance that already exists...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to SUM Grouped and Counted Field<p>I need to <code>Sum</code> of <code>Counted</code> and <code>Grouped columns</code>. By the way I need to <code>Where ...
<p>I think you can do what you want with conditional aggregation. Something like this:</p> <pre><code>SELECT COUNT(id) AS total, SUM(CASE WHEN State NOT IN (2, 3) THEN 1 ELSE 0 END), SUM(CASE WHEN State IN (2, 3) THEN 1 ELSE 0 END) FROM Table1; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to delete a Dart future when it's no longer needed<p>This is related to <a href="https://stackoverflow.com/questions/17552757/is-there-any-way-to-cancel-...
<p>You could just set a flag which indicates to the delayed code (run from futures) that the result isn't needed anymore. When the delayed code is called it just returns.</p> <pre class="lang-dart prettyprint-override"><code>library cancel_future; import 'dart:async' show Future, Timer; import 'dart:math' show Rand...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R - show only levels used in a subset of data frame<p>I have a rather large data frame with a factor that has a lot of levels (more than 4,000). I have anoth...
<p>I modified a suggestion in the comments by Marat to use the function <code>unique</code> that seems to return the correct levels.</p> <p>Solution:</p> <pre><code>subsetrows &lt;- which(is.na(mydata$reference)) unique(as.character(mydata$factor[subsetrows])) </code></pre> <p>While I like learning new packages and ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cant find table-rows<p>I'm trying find and <code>Delete</code> the rows <code>&lt;tr&gt;</code> as you see in code below, but for some reason it can't find ...
<p>Using <code>closest()</code> then <code>find()</code> will go up to the <code>tr</code> then back down into the element using <code>find()</code>. You would need to <code>find('tbody')</code> then look inside that element to <code>find('.RMAJS')</code>.</p> <p>This wouldn't solve your issue, because you would end u...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to list all possible combinations of traversing elements in a two dimensional array?<p>There is a two dimensional array in which each element is a charac...
<p>Construct an undirected graph from the matrix where the nodes are the matrix elements and there is an edge between two nodes if the corresponding elements are adjacent to each other in the matrix.</p> <p>Then you will have to recursively compute the paths (similar to DFS, but without keeping track of visited nodes)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: dequeue function in wordpress is not working<p>I am trying to dequeue some scripts from non-relevant pages in wordpress. It is working fine with some (like c...
<p>You want to either hook it after <code>wp_enqueue_scripts</code> like <code>wp_print_styles</code> or simply try setting the priority of your <code>add_action</code>.</p> <p>Looking at the plugin source code. It enqueue's the scripts with priority 15. </p> <p>woo-variation-swatches.php line 103.</p> <pre><code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unusual bug with structs<p>In this program I need to read in information from a text file, the first line is the number of courses I am reading in to process...
<p>Add next code before your <strong>while</strong> loop:</p> <pre><code> courseArray[j].numDependencies = 0; </code></pre> <p><strong>EDIT</strong>:</p> <p>Original answer is kinda wrong. I overlooked how you are allocating that array.</p> <p>Actual problem is next: you are allocationg N+1 elements and trying a...