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: Rails 4 mass assign array of objects<p>I want to mass assign array of objects in rails 4. How should I set strong parameters for this requirement?</p> <p>My...
<p>Found the issue. For anyone struggling with the same issue. It should be.</p> <pre><code>if a_params a_params['attr'].each do |param,index| a = A.new(param) end end </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I write a Clojure threading macro?<p>I am attempting to write a threading macro using <code>failjure/ok-&gt;&gt;</code> (<a href="https://github.com/a...
<p>Your problem statement seems a little vague, so I'll solve a simplified version of the problem.</p> <p>Keep in mind that a macro is <strong>a code-translation mechanism</strong>. That is, it translates the code that <em>you wish you could write</em> into something that <em>is acceptable by the compiler</em>. In th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting the name of an object in a for in loop to use as a key for another object<p>So I have set up a system where my GUI Class, when initiated, sends a con...
<p>maybe this is what you are looking for:</p> <pre><code>var Focus = function(config){ this.points = config || {}; this._focus = undefined; }; Focus.prototype.add = function(point){ this.points[point.name] = point }; /* or if you dont want the property name Focus.prototype.add = function(id, point){ ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: tkinter incrementally display integers on buttons when clicked<p>In a series of say 5 Button objects, I would like that the first clicked Button sees its 'te...
<p>You need to separate your iterator definition and the <code>next()</code>calls, otherwise you were creating a new iterator each time.</p> <p>You also need to put <code>6</code> in <code>iter(range(1, 6))</code> if you want it to go up to 5.</p> <p>Try this :</p> <pre><code>import tkinter as tk root = tk.Tk() roo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get User DirectoryEntry after Windows Authentication<p>When a user is Windows authenticated in my WebAPI app, and I use <code>UserPrincipal.Current</code>, I...
<p>You need to keep the <code>IPrincipal</code> (and <code>IIdentity</code>) interfaces which are core .NET security interfaces separated from the <code>UserPrincipal</code> in AD - those are <strong>NOT</strong> the same thing and not related directly. </p> <p>In AD, you can always use</p> <pre><code>UserPrincipal c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Artifactory remote repository not up-to-date<p>I have 2 artifactory servers. Let say <code>A</code> and <code>B</code>.</p> <p>One of them, <code>A</code>,...
<p>Artifactory does not support Maven Archetypes. That means that it is not aware of the fact that <code>archetype-catalog.xml</code> is expirable and should be checked for changes.</p> <p>If your Artifactory is Pro, you can implement the re-check via user plugin.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create a dictionary and store values in Obj C<p>I'm really new to Obj-C and iOS development, and have set up a storyboard and the basic controllers. </p> <p...
<p>You're on the right track. This is the sort of thing you're looking for:</p> <pre><code>- (IBAction)addButtonTapped:(UIBarButtonItem *)sender { NSLog(@"Add button tapped"); // Create dictionary and store the values from the text fields and views // This is a class method, which you can tell because it ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Proxy in IIS to a private Prismic repo - is it possible?<p>I have an Angular(8) solution that talks to a <em>public</em> <a href="https://prismic.io/" rel="n...
<p>It is totally possible to use IIS' reverse proxy to connect to a Prismic private repo.<br> What is needed is to set up IIS' reverse proxy and to give it the secret used for authorisation at Prismic.</p> <hr> <p>By the time of writing I have found no way to install just IIS' reverse proxy but one has to install the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: python requests login authentication<p>I'm having trouble logging into my account on <a href="http://www.utahrealestate.com" rel="nofollow">this</a> site usi...
<p>I was able to work it out. Apparently I needed to get the login page, then send an initial post request to auth/login.form/ using the cookie provided by getting the login page. That responds with the id number that needs to be appended to the field names. Then, send a post request to auth/authenticate using the same...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Generate a CSV file from a JSON object<p>It's all in the title, I would like to generate a CSV file from the JSON objet get from this Ajax request,</p> <p>T...
<p>Finally found it, I used a forEach to browse the data :</p> <pre><code>$.ajax(settings).done(function (response) { console.log(response); var ronde1n = []; //on définit data qu'on va devoir parcourir avec un forEach const data = response.data; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it better to use parameter or column value when copying data from one table to another?<p>I have a SQL statement to copy records from one table to another...
<blockquote> <p>I would expect the sql server to optimize the execution plan of the first query and ommit the projection of the shopId column anyways (because the value will be the same for all the records) and use a constant value instead.</p> </blockquote> <p>No, SQL Server, does not do this. You can verify ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to install specific library using "pip" command<p>I am trying to install certain library in <code>Visual Studio Code</code> terminal using <code>pip inst...
<p>you can install library like this python -m pip install numpy</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Data type mismatch in criteria expression error when trying to insert into Access database<p>I am trying to insert values entered by a user on a Winform into...
<p><code>receiveDate</code> and <code>dueDate</code> are defined as <code>DateTime</code> in the Database but you are passing text (string) to the parameter:</p> <pre><code>oleCmd.Parameters.AddWithValue("@receiveDate", string.Format(... oleCmd.Parameters.Add("@dueDate", OleDbType.VarChar).Value = ... </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 delay to jQuery .addClass and .removeClass?<p>I need to add a <strong>delay</strong> to .addClass and .removeClass for <code>200ms</code> here:</p...
<p>You can use <a href="https://www.w3schools.com/jsref/met_win_settimeout.asp" rel="nofollow noreferrer"><code>setTimeout</code></a> to achieve it.</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 pretty...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Redirect URLs with #! dynamic content<p>I had a temporary site made on Wix, and will soon need to move to a new one made in Zend Framework 2. For SEO reasons...
<p>After some more research, I found out Wix is using Ajax crawling, which is really unfriendly when you need to move away and redirect your pages, as it uses #! in the URLs. I also found out that those URLs get parsed by Google as escaped fragments, so I used</p> <pre><code>RewriteCond %{QUERY_STRING} ^_escaped_fragm...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Custom select element in Form::select laravel<p>Is there a way to insert an element in front of the list generated with: <code>Form::select('name', Model::...
<p>Yes you can simply add an element to the array of options:</p> <pre><code>$options = ['' =&gt; 'Please choose'] + Model::lists('name', 'id'); </code></pre> <p>Ideally I would do this in the controller but you can also do it directly in the <code>Form::select()</code>:</p> <pre><code>{{ Form::select('name', ['' =&...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want to change string values in DataFrame (Python)<p>I want to change string values in DataFrame!</p> <p>My data have 25000 rows, and 2 columns like this:...
<p>Use <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.strip.html" rel="nofollow noreferrer"><code>Series.str.strip</code></a> - if <code>"</code> is necessary remove:</p> <pre><code>df['id'] = df['id'].str.strip('"') </code></pre> <p>Or if necessary remove <code>''</code>:</p> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AsyncTask - How can i pass an object as parameter to an anonymous AsyncTask class<p>I am doing some coding stuff with android. Nearly I faced a problem and t...
<p>Here is how to pass a <code>CartsPay</code> parameter to an <strong>anonymous</strong><code>AsyncTask</code></p> <pre><code>new AsyncTask&lt;CartsPay,Void,Void&gt;(){ CartsPay cartsPay; @Override protected Void doInBackground(CartsPay... params) { this.cartsPay = params[0]; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create and store values of multiple inputs in a dynamic form?<p>I have a form where user can generate new inputs to the form he wants to submit, howev...
<p>What you need is to assign every input a unique identifier that later you can use in you store. Check this example: <a href="https://codesandbox.io/s/muddy-firefly-xz31w" rel="nofollow noreferrer">https://codesandbox.io/s/muddy-firefly-xz31w</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: send a friend in modal bootstrap<p>Well, before asking here I have tried to find an answer for the issue I work with. Maybe someone who knows will help to f...
<p>change </p> <pre><code> &lt;button type="submit" name="submit" class="btn btn-sm" data-dismiss="modal" aria-hidden="true"&gt;Send&lt;/button&gt; </code></pre> <p>to</p> <pre><code> &lt;button type="submit" name="submit" class="btn btn-sm" &gt;Send&lt;/button&gt; </code></pre> <p>plus if you want to g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to save the content of each column of a row in a jQuery array<p>I am trying to create an array from the content of a table. The content of the tables loo...
<p>Check this one. I changed var content= []; to var content= {}; </p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).on('click', '#guardarBtn', function (event) { var content= {}; $('.rowUpdate')...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R - Vertex attributes - 'Inappropriate value given in set.vertex.attribute.'<p>I have a data.frame containing values I want to use as attributes in a network...
<p>So this is a bit late, but I ran into the same issue just today and figured out that this is probably because the variable is a factor. You need to convert it to a character like so:</p> <pre><code>attr2$hhid &lt;- as.character(attr2$hhid) </code></pre> <p>This should fix the issue.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CSS / jQuery - Line break with css and jQuery<p>I'm using a script that hides the text, and that text is only displayed when the user hovers the mouse in the...
<p>Use this CSS snippet:</p> <pre class="lang-css prettyprint-override"><code>.txt-note { width: 800px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-wrap: break-word; } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Solr UI Authentication required in Kerberized environment<p>I am working on a kerberized HDP cluster, in which I have infra Solr instance in 3 nodes. When I ...
<p>I did solve this issue, in fact I needed to add this lines in the Advanced topology Knox ( in ambari ui ):</p> <pre><code>&lt;service&gt; &lt;role&gt;SOLR&lt;/role&gt; &lt;url&gt;http://&lt;hostname1&gt;:8886/solr/&lt;/url&gt; &lt;url&gt;http://&lt;hostname2&gt;:8886/solr/...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JSON/jQuery - moving between child and parent objects<p>I'm currently building a tool for the card game Hearthstone. If you're familiar with the game it's ba...
<p>I think there's a problem with how the data is stored:</p> <ol> <li>Every object needs to have a unique id</li> <li>Every Child object needs to return a reference to the parentId. This needs to be stored on insert or creation of the child object.</li> <li>There needs to be a way to look up any object by id</li> </...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to calculate percentage with simple JavaScript code<p>I have already created a form in html and linked it with my style sheet and also JavaScript page. M...
<p>Use <code>oninput</code> as I did below. Also give the amount input field a name. it's missing in the OP.</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>// Percentage Calc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mongoose aggregate the property of subdocument and display the result<p>I have a document with a subdocument (<em>not referenced</em>). I want to apply the a...
<p>You need to use <a href="https://docs.mongodb.com/manual/reference/operator/query/in/" rel="nofollow noreferrer">$in</a> query operator in the $match stage, and add <a href="https://docs.mongodb.com/manual/reference/operator/aggregation/unwind/" rel="nofollow noreferrer">$unwind</a> stage before $group stage.</p> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bulk converting wav files to 16-bit with ffmpeg in batch from unix command<p>I have a folder consisting of many subfolders, each with other subfolders and th...
<p>This did the trick: </p> <pre><code>for f in $(find ./ -name '*.wav'); do ffmpeg -i $f -acodec pcm_s16le -ar 44100 ${f%.wav}z.wav; rm $f; mv ${f%.wav}z.wav $f; done </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bash VPN accepting HTML conditions<p>I am trying to configure my Linux server to connect via a VPN using the following command:</p> <pre><code>sudo pppd pty...
<p>So after reading around slightly more on curl the key is to use the POST data function:</p> <pre><code>curl --data "button=%20I%20AGREE%20&amp;sessionid=&lt;SESSION ID HERE&gt;" http://www.ukipvpn.com </code></pre> <p>Now the VPN accepts requests and is working. Thanks for the help. <a href="http://curl.haxx.se/d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find duplicate in the same cell and erase one instance in VBA<p>A separate program that I cannot change adds to a spreadsheet and sometimes it duplica...
<p>Some other way, possible through <code>RegEx</code>:</p> <pre><code>Sub Test() Dim RegEx As Object: Set RegEx = CreateObject("VBScript.RegExp") RegEx.Global = True RegEx.Pattern = "([A-Z0-9-]{18})(?=.+\1)" Dim lr As Long, x As Long With Sheet1 lr = .Cells(.Rows.Count, 3).End(xlUp).Row For x = 5 To lr ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Conditional ploting in Gnuplot using fortran 90<p>i have a truss bridge that i want to draw using fortran 90 and Gnuplot , but the truss elements should chan...
<p>It is not clear what exactly you mean by <code>x(1) &gt; 0</code> since there is no function x() defined. Assuming that <code>x(1)</code> means <code>data value in column 1</code>, then instead of </p> <pre><code>write(10,*) 'plot "1.txt" if (x(1) &gt; 0 ) {with line 7} else { with line lt 3 } ' </code></pre> <p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Retrieve Custom Object From Hashtable<p>I've written a PowerShell function to create a custom object and stores it into a hashtable. The issue I'm facing is ...
<p>There are uses for <code>GetEnumerator()</code>, but in your case you're better off just looping over the keys of the hashtable:</p> <pre class="lang-psh prettyprint-override"><code>$hashWrite.Keys | % { $hashWrite[$_].Wipe } | select -Expand FullName </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ruby method not being seen<p>I have a method <code>known_args</code> being called from the main class of my script, it is included in the module, <code>Valid...
<p>Look closely at the error message:</p> <pre><code>undefined method `known_args' for PasswordGenerator:Class (NoMethodError) </code></pre> <p>That message is saying that Ruby can't find a <code>known_args</code> method in <code>PasswordGenerator</code>, not in an instance of <code>PasswordGenerator</code>.</p> <p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# Faster way to get javascript DOM than EO.WebBrowser<p>I have code in place where I'm using EO.WebBrowser to get the html from a page using the EO.WebView ...
<p>No, <code>HttpWebRequest</code> (and other similar "get me HTML response") methods will only give you HTML itself and will not run JavaScript on the page.</p> <p>For server side processing of dynamic HTML consider using proper <a href="https://stackoverflow.com/questions/814757/headless-internet-browser">headless i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CSS GRID not able to rearrange items with order:;<p>I’m trying to rearrange the order of a CSS GRID.</p> <p>But apparently all grid items have a default ord...
<p>If you look at the docs on MDN: <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/order" rel="nofollow noreferrer">https://developer.mozilla.org/en-US/docs/Web/CSS/order</a>, you'll see the default value for order is <code>0</code> so anything without order explicitly set will be the leading elements, then e...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using hiera to set class parameters?<p>I am trying to figure out how to use hiera for setting the values for class parameters. I am testing things out with t...
<p>In Hiera you can reuse already defined variables by using <a href="https://docs.puppetlabs.com/hiera/1/variables.html#the-hiera-lookup-function" rel="nofollow noreferrer">hiera lookup funcion</a>. In your example it will be:</p> <pre><code>testhiera2::haproxy_cert_content:&quot;%{hiera('testhiera::haproxy_cert_conte...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Set proxy as an environment variable in Helm 3<p>ı would like to set proxy as an env variable in deployment.yaml which I created via Helm v3.What should be t...
<p>Taking into consideration that Helm's syntax has been discussed a few times on Stack, I'm going just to sum it up in order to have less orphaned questions and post it as a community wiki, because I didn't do much here. </p> <hr> <p>As it was discussed <a href="https://stackoverflow.com/questions/49928819/how-to-pu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add data to return of all actions in a Symfony controller<p>I have a controller in a Symfony 2.1 application, let's just call it <code>FooController</code> i...
<p>One option is to create your own base controller, and have all other controller extend it. Your base controller would override the <code>render</code> function of the <code>Controller</code> class from symfony framework</p> <pre><code>use Symfony\Bundle\FrameworkBundle\Controller\Controller; class BaseController ex...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Array resource returning integer<p>I'm just getting into android app development. I'm trying to find the value of an item in an array resource from the index...
<p>Use <code>getStringArray</code> for getting Array from resources :</p> <pre><code> public void onClick(DialogInterface dialog, int which ) { String[] arrAllData = getResources().getStringArray(R.array.PopupMenuListItems2); Toast.makeText(getBaseContext(), "Selected " + arrAllData[which], Toast....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is list index out of range, in this for loop?<p>I was working through the hp code wars stuff for 2014 and I hit this and couldn't get unstuck. I keep get...
<p>How long is upc1? The first time you loop over it here:</p> <pre><code> for x in range (0,6): cd = cd + int(upc1[ite]) ite = ite + 2 </code></pre> <p>you are accessing elements 0,2,4,6,8,10.</p> <p>The second loop which produces the error:</p> <pre><code> for x in range (1,12, 2): cd = cd + int...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Application Context in multi module maven project - Spring<p>I have a hard time understanding how application context work in multi module project.</p> <p>L...
<p>Yes it is possible. Here is why:</p> <p>Simply because Spring is able to <strong>scan the classpath</strong> of the your application (if you are using the java annotation, <code>@ComponentScan('com')</code> will load every class you have in the package <code>com.**</code>).</p> <p>If you are only running your JAR ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I get the limits of the stack in C / C++?<p>My question is pretty simple and straightforward: if I have e.g. 1MB of RAM assigned to the program's stack, ...
<p>You should question your assumptions about stack layout.</p> <p>Maybe <a href="https://gcc.gnu.org/wiki/SplitStacks" rel="nofollow noreferrer">the stack doesn't have just one top and bottom</a></p> <p>Maybe <a href="https://stackoverflow.com/q/14471564/103167">it has no fixed bottom at all</a></p> <p>Clearly ther...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Grid stopping at 10 x 50 instead of 50 x 50<p>I'm trying to generate a grid that's 50x50 using the drawing panel but for some reason it stops at 50x10. I'm u...
<p>I Think you are over complicating the code, I would go with something like that:</p> <pre><code> protected void paintComponent(Graphics g) { super.paintComponent(g); g.setColor(Color.red); for (int col = 0; col &lt; 50; col++) { for (int row = 0; row &lt; 50; row++) { g.drawRect(row ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I define parameters from one method into another<p>I am looking to design an interface method (a) that takes the parameters of another method (b), so if ...
<p>I'd rather implement (<em>extract</em>) a <em>class</em> for these parameters:</p> <pre><code> (string name, string description) -&gt; class </code></pre> <p>The class itself could be something like that</p> <pre><code>public class User { ... public String Name {...} public String Description {...} } </code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to enabled cadvisor for kubelet 1.13?<p>How to enabled cadvisor for kubelet 1.13?</p> <p>I want to cadvisor monitor containers in a pod. Somebody say yo...
<blockquote> <p>However, kubelet version is 1.13 doesn't have the --cadvisor parameter.</p> </blockquote> <p>Indeed, the <a href="https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.12.md" rel="nofollow noreferrer">ChangeLog-1.12</a> says that:</p> <blockquote> <p>The formerly publicly-avai...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PHP Why does this loop endlessly?<p>I have the following function, that should loop between two dates, adding info to a mysql database. for some reason, it l...
<p>Your loop keeps updating <code>$date</code>, but the condition is based on the relation between <code>$start</code> and <code>$end</code>. Since they are not modified, the loop will go on forever.</p> <p>Presumably, you intended to compare <code>$date</code> to <code>$end</code>:</p> <pre><code>while (strtotime($d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filter JQuery Datatable By Passing Parameter<p>I'm building an ASP.Net MVC 5 web application which using JQuery Datatables (1.10.4) to display tabular data w...
<p>I figured it out myself. What I needed to do was retrieve the querystring value then set the drop down value and redraw the table data. See code below, hopefully it helps someone else.</p> <pre><code>&lt;script&gt; $(document).ready(function () { function getParameterByName(name) { name = n...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Print Two Columns in File Output<p>How would I print my output in two columns where they are lined up side by side. I have it set up so that it prints...
<p>The problem is that you're calling <code>print</code> twice. <code>print</code> always outputs onto a new line. If you want both columns on the same line, you simply have to combine your two format specifiers into a single string:</p> <pre><code>for line in my_file: count += 1 output = "{}{:^80}".format(lin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Counting integers with hasNextInt<p>I don't know what is wrong here</p> <pre><code>import java.util.Scanner; public class CountingInts { public static...
<p>There is nothing wrong with the program<sup>1</sup>. The problem is in the way that you are using it. I assume that you are simply running it like this:</p> <pre><code> java CountingInts </code></pre> <p>To make it stop, you can either give it something that is not a number (anything!) or you can tell the con...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I make a min file in the same path or dest on gulp-rename and gulp-uglify?<p>Hi everyone I hope you having a great day, I'm trying to find a way on ho...
<p>This is happening because your <code>scripts</code> task is outputting the files to the same directory as you are watching:</p> <pre><code>.pipe(gulp.dest('./src/js/')) </code></pre> <p>and </p> <pre><code>gulp.watch('./src/js/**.js', gulp.series('scripts')); </code></pre> <p>So every time <code>scripts</code> r...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firebird connection ODBC remote when using non-standard TCP port<p>I have a server with Firebird 2.5.3 and I need read then database on another server over t...
<p>According to the configuration you posted, your Firebird instance is running on port 5050, however when you don't specify a port in the connection string, then the Firebird client will default to port 3050.</p> <p>To use the right port, you need to explicitly specify the port in your connection string, by using for...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: "$centerSphere" query in reactivemongo<p>I found <a href="http://docs.mongodb.org/manual/reference/operator/query/centerSphere/#op._S_centerSphere" rel="nofo...
<p>In reactivemongo this query would look like this:</p> <pre><code>def findNear(lng: Double, lat: Double, radius: Double)(implicit fomrat: Format[T], ec: ExecutionContext): Enumerator[T] = { collection(). find(Json.obj("loc" -&gt; Json.obj("$geoWithin" -&gt; Json.obj("$centerSphere" -&gt; Json.arr...
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 use the FOSUserBundle without a mailer service<p>I want to use FOSUserBundle but my application doesn't require a mailer service. Is there ...
<p>This is actually mentioned in the docs. You can specify <code>fos_user.mailer.noop</code> when you don't want to send out mails.</p> <p>You can find all relevant info in the <a href="https://github.com/FriendsOfSymfony/FOSUserBundle/blob/master/Resources/doc/emails.md#default-mailer-implementations" rel="nofollow">...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Keep being prompted to enter passphrase for .ssh/id_rsa<p>I followed the tutorial <a href="https://help.github.com/articles/generating-ssh-keys/" rel="norefe...
<p>Add the following to your <code>~/.bash_profile</code>. When bash starts, this does two things: 1. starts the ssh-agent (otherwise it might spawn and die for each push/pull) and 2. tells the agent to remember your passphrase. In some Linux distributions, this happens automatically, unfortunately that isn't the case ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: error syntax error at or near ":" for split_part () of createNativeQuery in spring boot for postgresql<p>I'm getting SQL exception while executing the query ...
<p>Your obfuscation layer probably chokes on the <code>::</code> operator. Use the <code>cast()</code> operator instead:</p> <pre><code>String queryStr = " select split_part(cast(value as text),':', 1) from table"; </code></pre> <p>But why do you think you need the cast to begin with? If you are storing <code>:</code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Selecting entries with a specific year and month from a Rails database<p>How can I select all database entries with a given date and month in a datetime? I t...
<p>I think you should let active record handle this, since it checks what database it's using and uses a driver for each database, the trick is to find a generic query to run, for me this is what I could come up with, might not be the best but I'm open for suggestions</p> <pre><code>scope :with_year_and_month, -&gt;(y...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Initializing LinkedList with generic parameter<p>I would like to initialize LinkedList with class who has its own generic parameter but it would be an error ...
<blockquote> <p>I would like to keep Packet generic after initializing LinkedList.</p> </blockquote> <p>Not possible. Initialization is done at runtime and generics are already resolved to a specific type by then. Generics are only variable at compile time.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove the First Value in a List that Meets a Criterion<p>I'm trying to solve this problem. This function takes two parameters. The first is a function that ...
<pre><code>removeFirst p xs = [] </code></pre> <p>This always returns the empty list and it matches all arguments. I think you mean this.</p> <pre><code>removeFirst _ [] = [] </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Searching for AD Group Membership<p>I am building a script to find AD Users that have not logged in X number of days and do not belong to a specific security...
<p>Change your if statement in inner foreach loop to match against the IDs, not the whole object. </p> <p>Since <code>$canNotDisable</code> is a list of strings, you will need to get the name out of the <code>$Account</code> variable to see if that exists (not the resulting object).</p> <pre><code>foreach ($OU in $OU...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How use sprintf to output a floating point number lesser then 1 without a leading decimal place?<p>I am trying to use sprintf to print a float number without...
<p>It's not possible to trim the zero before a decimal as any option with <code>sprintf()</code> and <code>float</code>.</p> <p><strong>sprintf() fF</strong></p> <blockquote> <p>The double argument is rounded and converted to decimal notation in the style [-]ddd.ddd, where the number of digits after the decimal...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: oncomplete of p:commandButton not firing within ui:composition<p>The following code appears in a ui:composition page and uses a template, the template insert...
<p>It appears that it was the template that was causing problems. Working now.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Setting CoreLocation Distance Filter?<p>I am new to using Swift and I want to use the Core Location framework. I want to set my distance filter so that whene...
<p>The correct way to set distance filter to 10 Metres is:</p> <pre><code>self.locationManager.distanceFilter = 10 </code></pre> <p>You don't need a semicolon.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R order geom_bar based on one level<p>How can I order the bar plot based on the first level of the variable <code>var</code>? <em>Now</em> the order is on th...
<p>With <code>forcats::fct_reorder2()</code> you do not need to modify your <code>data.frame</code>:</p> <pre><code>library(ggplot2) library(forcats) ggplot() + geom_bar(data = df , aes(x = forcats::fct_reorder2(ct, var=='first', value, .desc = F) , y = value , fill = va...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Concatenating href strings on javascript<p>I am trying to link to a website using info windows on <a href="https://developers.google.com/maps/documentation/j...
<p>You need to cut the string, concatenate the pageno, and then pick up the string again:</p> <pre><code>var contentString = '&lt;div id="content"&gt;'+ '&lt;div id="siteNotice"&gt;'+ '&lt;/div&gt;'+ '&lt;h1 id="firstHeading" class="firstHeading"&gt;display info&lt;/h1&gt;'+ '&lt;div id="bodyCo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to validate a date using Python pandas?<p>My data frame consists of a column of dates, which are not necessarily in the correct format. for example: <str...
<p>I recommend you use the <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.to_datetime.html" rel="nofollow noreferrer">built in functionality</a> for something like this:</p> <pre class="lang-py prettyprint-override"><code>pd.to_datetime(Q4_df['issdt'], infer_datetime_format=True, errors='co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check that an ID' in a Column have no particulate value in another column at the same tables<p>I have a salary table with salarySumId, salaryYear and I want ...
<p>Do a <code>GROUP BY</code>. Use a <code>case</code> expression in the <code>HAVING</code> clause to count the number of 2020-01-01 rows.</p> <pre><code>select salarySumId from Salary group by salarySumId having sum(case when salaryYear = '2020-01-01' then 1 else 0 end) = 0 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R parsing string<p>I did a request using RCurls and is giving me the token I need. The answer for the request is the following:</p> <pre><code>r&lt;-POST(ur...
<p>This is JSON format:</p> <pre><code>library(rjson) json &lt;- "{\"token\" : \"WiKuxCc2VboCLBc_MbtKrKtDkJnDSntrGjYrazbgs1FRX_BAj-p2gadILBNhk9JBti0m6o_i7DYaqf4R4i2xPh1TedYWpCrINShiFrB7xabbv8zT-8LCBTUau14HPZzv\",\"expires\" : 1425681647918,\"ssl\" : false}" x &lt;- fromJSON(json) x$token [1] "WiKuxCc2VboCLBc_MbtKrKtDk...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I create a scrollable region, that resizes with the browser, but also has fixed content region above and below the sizable area?<p>I apologize becaus...
<p>Flexbox will allow you to solve this so long as your container has a set height somewhere.</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>.page { width: 100%; displa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Disable Hover on Mobile<p>I need to disable the hover effect/selector of a button, on mobile (by media query).</p> <p>I have 20 or so CSS lines for <code>:h...
<p>Alright, you can't disable it, but you can not enable it. </p> <pre><code>@media only screen and (min-width: 768px) { .desktopOnlyHover{ background-color:salmon; } } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sort table from side menu<p>It might sounds weird. I would like to know if it's possible to sort a table by clicking on the side menu link and not from the t...
<p>You can use tablesorter's sorton event:</p> <p><div class="snippet" data-lang="js" data-hide="true"> <div class="snippet-code snippet-currently-hidden"> <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() { $("#mysortable").tablesorter(); $("#navigator div").click(funct...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: App stops working once deployed to Meteor.com?<p>So I built a weather app that gets data from the forecast.io api and the flickr api after geocoding a locati...
<p>It sounds like you've identified the problem. You can deploy to Meteor with a flag to include a settings file:</p> <p><code>meteor deploy betterweather.meteor.com --settings settings.json</code></p> <p>See if that solves it.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL Aggregation AVG statement<p>Ok, so I have real difficulty with the following question.</p> <p>Table 1: Schema for the bookworm database. Primary keys ar...
<p>You can't group by an aggregate, at least not like that. Also don't use natural join, it's bad habit to get into because most of the time you'll have to specify join conditions. It's one of those things you see in text books but almost never in real life.</p> <p>OK with that out of the way, and this being homework ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mysql query is not inserting values<p>I tryed to insert into my db some values from post values and its not working.. Tried just 1 value from 1 post and it w...
<p>Try this and post what you're getting:</p> <pre><code>$rowSQL = mysql_query( "SELECT MAX( id ) AS max FROM `topic`;" ); $row = mysql_fetch_array( $rowSQL ); $largestNumber = $row['max']; $new_id = ++$largestNumber; $newnumber = mysql_query("INSERT INTO topic SET id = '".$new_id."'"); if (isset($_POST['submit']) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jquery simpleGrid disable when loading<p>I'm using an simpleGrid like that:</p> <pre><code> t.p.operatorGrid = $("#codGrid").simpleGrid(...
<p>can get loading image using simple gif . show while data is loading , hide on completion. and can disable the dialog using </p> <blockquote> <p>$(selector).attr('disabled','disabled');</p> </blockquote> <p>See below code in action , hope it helps :</p> <p><div class="snippet" data-lang="js" data-hide="false"> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calculating robust percentiles in R<p>I have a set of data with a parameter (theta) and the density of the parameter (ghat). I am attempting to calculate 10t...
<p>First of all, if you sum your column <code>df$ghat</code>, you'll see that it sums up to <code>100</code>. So your 10th quantile should be <code>&gt;= 10</code> and your 90th <code>&gt;= 90</code>.</p> <p>After that, it seems like you are basically estimating the quantiles for grouped data. So the way you calculate...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Enabling web api on orocommerce<p>I am trying to enable web API in orocommerce. The documentation states to enable navigating to <strong>System Configuration...
<p>You are referring to the documentation for OroCommerce 4.1. In the 3.1 version, that you are using, there is no setting, and web API is enabled by default.</p> <p>For more details on using an API in 3.1, see <a href="https://doc.oroinc.com/3.1/backend/api/using/" rel="nofollow noreferrer">Using Web Services API in ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: dropdownlist selected text change on arrow key press<p>I have a Dropdownlist.I have added wrapper class on that dropdown.And this class added span after drop...
<p>So to break this down in steps, first you need to <a href="http://www.w3schools.com/jquery/jquery_get_started.asp" rel="nofollow noreferrer">include jQuery on your page</a>.</p> <p>Then you can use jQuery to <a href="http://api.jquery.com/change/" rel="nofollow noreferrer">add an event listener</a> to your <a href=...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trying to save a JSON to file but getting an AttributeError: 'str' object has no attribute 'dumps'<p>My first program is to play a game and keep a high score...
<p>Here is your error : </p> <pre class="lang-py prettyprint-override"><code>json = json.dumps(score) </code></pre> <p>You overwrite the json package in the namespace. After that line, json is not a package anyomre, it is a simple string.</p> <p>You can easily fix it by giving another name to your json variable, <co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fastest way to count the occurance of a string<p>I'm counting some string which i'm getting from text file. I have done that already but I want to know is th...
<p>You could use counter:</p> <pre><code>from collections import Counter with open("input.txt") as inf: c = Counter(l.strip() for l in inf) </code></pre> <p>Gives:</p> <pre><code>Counter({'led bulb': 2, 'earphones': 2, 'mobile': 2, 'memory card': 1, 'shoes': 1}) </code></pre> <p>or </p> <pre><code>for ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to create custom artist page by custom plugin in wordpress<p>I am researching more and use the code.. I have done this code. <pre><code>if (!defin...
<p>So code be like something</p> <pre><code>if (!defined('ABSPATH')) { die; } if(!class_exists('ArtistPublic')): class ArtistPublic { public static function createTemplate( ) { if( get_option('artist_page_id') ) : global $user_ID; $new_post = array( 'post_ti...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Symfony 5 SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed:<p>I am trying to run</p> <pre><code> php bin/console make:migration </code></...
<p>Your DB password contains '@' which breaks Symfony's parser, changing the password to not have the symbol should resolve your issue.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to avoid duplicate rquests with jQuery AJAX<p>Here I have one requirement with AJAX and I gave one <code>url(UpdateURL)</code> to the <code>url param.</c...
<p>Can't understand why you need to call a ajax and a getJson for the same thing, try this:</p> <pre><code>$("#UploadButton").click(function(){ var UpdateURL="some url"; $("#idLoading").show(); loadGrid(UpdateURL); }); function loadGrid(url){ $.getJSON(url,function (output) { try ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check for similar values VBA Excel<p>I am developing this macro in Excel vba that will loop through a column of client names that are sorted from a to z and ...
<p>The <code>Like</code> operator is often confused. It doesn't simply check if two strings match. Instead, the value to the left of the <code>Like</code> operator is the string to test against the pattern, which is to the right of the operator. <code>String_To_Test Like Pattern</code></p> <p>With that said, an expre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: c# select Folders or Files in the same method<p>Okay, so please don't flame me too much, this is my 1st question here, and maybe what I am trying to do is no...
<p>This is the easiest way I've found of solving this problem without relying on third party code, but you'll need to add some sanity checks, in case the user goofs around with the input:</p> <pre><code> OpenFileDialog ofd = new OpenFileDialog(); ofd.CheckFileExists = false; string defaultFilena...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the correct way of implementing the heapsort?<p>I spend last 5 hours looking at so many videos and readings (cormen included) and i finally decided t...
<p>Your index calculations are off:</p> <pre><code>int left = 2*i; int right = 2*i + 1; </code></pre> <p>If <code>i</code> is 0, then we want <code>left</code> and <code>right</code> to be 1 and 2. If <code>i</code> is 1, then <code>left</code> and <code>right</code> should be 3 and 4, and so on. The calculations sho...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I run my SQL query within a function?<p>I am constructing a PHP application and I want to be able to log every sql queries in the site. Therefore, I ...
<p>INSERT/UPDATE/DELETE queries will return you TRUE OR FALSE but SELECT queries return a Mysqli_Result object which is definitely NOT Boolean and therefore could never be <code>=== TRUE</code> or <code>=== FALSE</code> or <code>!== false</code> as these tests require datatypes to match.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Place on a determinated position of the screen : Tkinter<p>I would like to display the app on a specific postion (regardless of the screen models). I have at...
<p>To control placement of tk root window use geometry</p> <pre><code>from Tkinter import * root = Tk() root.geometry("+1120+110") # x and y coordinates on a screen root.mainloop() </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python Telethon get_messages offset<p>I'm using <code>Telethon</code> in my <code>Python</code> project. I'm using this code to get messages from a Group in ...
<p>According to the <a href="https://docs.telethon.dev/en/latest/modules/client.html#telethon.client.messages.MessageMethods.get_messages" rel="nofollow noreferrer">documentation</a> you can use <code>add_offset</code>:</p> <pre class="lang-py prettyprint-override"><code>full_msg_list = self.client.get_messages(GROUPI...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert image points of interest to coordinates<p>I have some images with a given height and width and a list of POIs as a list of integer values. I want to ...
<p>This can be accomplished succinctly with a list comprehension:</p> <pre><code>WIDTH = 1024 pois = [10, 1025, ...] coordinates = [(p % WIDTH, p // WIDTH) for p in pois] </code></pre> <p>Alternatively, you may use the <a href="https://docs.python.org/3/library/functions.html#divmod" rel="nofollow noreferrer">divmo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JPEGImageEncoder don't work in JDK 7<p>I try to make captcha using JCaptcha Component and i need to encode image in related servlet. So according to JCaptcha...
<p>Use <a href="http://docs.oracle.com/javase/7/docs/api/javax/imageio/ImageIO.html" rel="nofollow noreferrer">ImageIO</a>:</p> <pre><code>ImageWriter imageWriter = ImageIO.getImageWritersBySuffix(&quot;jpeg&quot;).next(); ImageOutputStream ios = ImageIO.createImageOutputStream(jpegOutputStream); imageWriter....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Plot multiple dataframes with lapply in R<p>I am trying to plot several dataframes (one plot per dataframe) with a lapply function, but despite all the posts...
<p>Try this to plot your list of data frames. Your <code>make_hist</code> function was adjusted to handle a single data.frame. Then <code>lapply</code> can apply <code>make_hist</code> to each element of the list.</p> <pre><code>make_hist &lt;- function(df){ ggplot(df, aes(x = var, y = n)) + geom_col() } plots ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Another way to print my method?<p>My program works. I was just wondering if there was a way for me to print my table by actually returning a string, and not ...
<p>The short answer is, yes you can. The long answer would involve replacing the <code>System.out.print</code> statements with something like <code>StringBuilder</code>, for example...</p> <pre><code>public String toString() { StringBuilder sb = new StringBuilder(64); for (int row = 0; row &lt; (magicSquare...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Websphere MQ unable to create initial JNDI context<p>I am trying to run a demo class (JMSJNDIProducer.java) that comes with Websphere MQ 7.0 installation at ...
<blockquote> <p>private static String initialContextUrl = "tcp://localhost:1414";</p> </blockquote> <p>First off, I don't think "tcp" is a valid value and if it is, do you have something running on port 1414 to reply JNDI lookup requests?</p> <p>Secondly, I think you are confusing MQ port 1414 with JNDI lookup.</p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Matching data from two sources and simple calculations in excel<p>I have some calculations I need to do on a data-set. The calculations are simple (i.e input...
<p>Even if you look less interested than me to solve this problem, I prepared the next code with the assumption that the array obtained from the the string "apple,banana,orange,grape" covers both sheets strange style head of columns naming.</p> <p>I used "X1" for your first sheet name, "X2" for the second one and "Re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: cfcharts plot value-box png (with numbers) from cfquery and cfloop<p>I need to create a generated png based chart file with plot labels with the numeric valu...
<p>Well all you have to do is go to bed totally defeated to fight another day.</p> <p>Here is the solution (its attached to the <code>chartseries</code> container). >>>> <code>datalabelstyle="value"</code></p> <pre><code>&lt;cfchartseries datalabelstyle="value" type="bar" seriescolor="blue" seri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Operator '+' cannot be applied to 'int', 'java.lang.Object'<p>I've just start learning how to manipulate array list.</p> <p>I have a little probleme while c...
<p>Iterator should be parameterized. Without specifying the <code>Integer</code> type, the compiler assumes <code>java.lang.Object</code> type to which the operator <code>+</code> is not applied.</p> <pre><code>Iterator&lt;Integer&gt; myIterator = myArray.iterator(); </code></pre> <p>Technically, the <code>+</code> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to parse a datetime in javascript / jquery?<p>How can I parse the following string :</p> <pre><code> 02/16/2015 10:51 PM </code></pre> <p>into this</p>...
<p><code>moment.js</code> is a nice library that handles datetime stuff related in JS. You should try it. <a href="http://momentjs.com/" rel="nofollow">http://momentjs.com/</a></p> <pre><code>moment("any datetime string", "format of input string").format('YYYY-MM-DD HH:mm:ss'); moment("02/16/2015 10:51 PM").format("YY...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to count the number of same elements which are in order in a vector in R?<p>I have for example a vector like this one: </p> <p><code>x&lt;-c(1,1,1, -1, ...
<p>you can try function <code>rle</code>:</p> <pre><code>rle(x) #Run Length Encoding # lengths: int [1:7] 3 1 6 2 2 7 1 # values : num [1:7] 1 -1 1 -1 1 -1 1 </code></pre> <p>and so <code>rle(x)$lengths</code> gives you what you want:</p> <pre><code>rle(x)$lengths #[1] 3 1 6 2 2 7 1 </code></pre> <p><strong><em>E...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C++ covariant return type error with multiple inheritance<p>I have the code which is equivalent to this one:</p> <pre><code>class X {}; class Y {}; templat...
<p><strong><em>TL;DR</em></strong></p> <p>Overriding <code>foo</code> in class <code>D</code>. <code>foo</code> methods can not covariant due to unrelated <code>X</code> and <code>Y</code> return types. Neither, can not overload due to different return types but same signature.</p> <hr> <p><strong><em>Explanation</e...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I store and access matrix elements in gnuplot?<p>I'm trying to make 19x19 hexagonal lattice and each lattice contains a cylinder with different color...
<p>You can use <code>plot ... with circles</code> to plot the cylinders. Then you can select the color with <code>lc variable</code>:</p> <pre><code>P = 0.78 pin_id = 0 do for [pin_ix=-9:9]{ do for [pin_iy=-9:9]{ cx = pin_ix*P + pin_iy*(-P/2) cy = pin_iy*sqrt(3)/2*P pin_id = pin_id + 1 set object pin_id poly from cx...