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:
Dozer Mapper does not map despite fields having same names and XML mappings specified<h2>Supposing I have:</h2>
<ol>
<li><strong>ObjectWithList</strong>, <s... | <p>Collections are special and the type erasure makes them more challenging. If all you want is for the items in wrappedList to be in the list in the resulting ObjectWithList instance, this can be accomplished without the converter. Dozer will handle nested property mapping, so you can describe the mapping in such a wa... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Three digit lottery program in java<p>I just started an intro to java programming class so I do not know much. I am having trouble obtaining the middle digit... | <p>try this code</p>
<pre><code>int lottery = 123;
System.out.println(lottery);
System.out.println(lottery % 10);
System.out.println(lottery % 100 / 10);
System.out.println(lottery / 100);
</code></pre>
<p><strong>output</strong></p>
<pre><code>123
3
2
1
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cache variable in list comprehension<p>Lets say I have an expensive operation <code>expensive(x: int) -> int</code> and the following list comprehension:<... | <p>Using the walrus:</p>
<pre><code>[cache for i in range(LARGE_NUMBER) if check(cache := expensive(i))]
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How important is it to specify LongRunning on a Task?<p><a href="https://stackoverflow.com/questions/26921191/how-to-pass-longrunning-flag-specifically-to-ta... | <p>The <code>LongRunning</code> flag is omitted by default when calling the <a href="https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.taskfactory.startnew" rel="nofollow noreferrer"><code>Task.Factory.StartNew</code></a> method without passing the <code>TaskCreationOptions</code> argument, so you can ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to hide elements when another element is clicked<p>Having a bit of difficulty getting this jquery to work. I have a form where all fields are nested in a... | <p>jQuery provides a <code>.hide()</code> method as a shortcut to setting the various CSS directives that hide an element (<code>display: none</code> and <code>visibility: hidden</code>, for example).</p>
<pre><code>$(".form-group").hide();
</code></pre>
<p>If you prefer to set the CSS directly, place quotes around b... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
in bootstrap there is <hr>, is there something like that but for vertical divider?<p>I am trying to accomplish something like this</p>
<p><img src="https://... | <p>In this case "More" and "My Account" are <code>DIV</code>s or other <code>block-type</code> elements.
Give them the same css class and apply the following style:</p>
<pre><code>.sideborders {
border-width: 1px 2px 1px 1px;
border-style: solid;
border-color: #cccccc;
margin: 0px;
float: left;
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Optimize table does not run right after table mutation<p>I'm updating a table with table mutations like this:</p>
<pre class="lang-sql prettyprint-override"... | <blockquote>
<p>I can see the rows are not updated yet.</p>
</blockquote>
<p><code>ALTER TABLE T1 UPDATE</code> -- asynchronous</p>
<p>You should check <code>select count() from system.mutations where not is_done;</code> that your mutation is done.</p>
<hr>
<p>In next versions you can run mutations synchronously
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Navigation Drawer & Toolbar with tabs<p>Well guys, my error is simple.</p>
<p>I'm implementing an Custom Toolbar like action bar on and Android Application ... | <blockquote>
<p>How to make the status bar a little bit transparent and the make the
background getting dark when show the navigation drawer?</p>
</blockquote>
<p><strong>Translucent system bars</strong></p>
<blockquote>
<p>You can now make the system bars partially translucent with new
themes, <a href="https... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do i setup BroadcastReceiver to only display sms received from specific numbers?<p>I need help modifying a broadcastReceiver I wrote so that it only disp... | <p>Just put one if there :)</p>
<pre><code>public class IncomingSms extends BroadcastReceiver {
private static final String MY_PHONE_NUMBER = "your number here";
final SmsManager sms = SmsManager.getDefault();
public void onReceive(Context context, Intent intent) {
// Retrieves a map of extended data ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Allow just one PHPSESSID per user<p>I've created a webservice, on which users can log in sending an oauth token. As response, this webservice returns a PHPSE... | <p>If you want that then it's better to use your own cookies instead of php sessions.</p>
<p>You'll need to generate a random cookie key when someone log in, I'll call that random cookie key as cookie_id.</p>
<p>Then you need to store it in the database with the user_id it's connected to, so you can make a new table ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Merge multiple rows in column SQL SERVER without temporary table<p>I have following result set that i am creating by query.</p>
<pre><code>ID | Name | CRAmo... | <p>You seem to want simple aggregation:</p>
<pre><code>select id, name, sum(cramount) cramount, sum(dramount) dramount
from mytable
group by id, name
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Android Studio Can't find file in Assets Folder<p>New to Android Studio and am stumbling on fairly simple things. I'm trying to open a file that I have store... | <blockquote>
<p>I'm trying to open a file that I have stored in the assets folder of
my project.</p>
</blockquote>
<p>To access file from assets folder use <code>AssetManager</code> for getting InputStream using file name:</p>
<pre><code>AssetManager assManager = getApplicationContext().getAssets();
InputStream i... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is "let" used instead of var in Swift?<p>On this page <a href="http://www.raywenderlich.com/85578/first-core-data-app-using-swift" rel="nofollow">http://... | <p>As a matter of fact, as a Swift programmer, the question to ask is why <em>not</em> use <code>var</code> over <code>let</code>? This is one area where Swift differs greatly in semantics from other languages such as C#.</p>
<p>The reason is because once you obtain a reference to a table cell, that reference is not g... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Iterating on Python 2d array indexes and values<p>I have a 2-d array as below and I would like to know the indices of the non-negative numbers such as an ind... | <p>You could try the following where n is the element you are looking for.
I am assuming from your example that these are distinct elements.</p>
<pre><code>def indexOf(n, array_2d):
idx = 0
for arr in array_2d:
for element in arr:
idx += 1
if element == n:
retur... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JPA join multiple table one to many and one to one<p>I have this 4 tables on Oracle DB</p>
<blockquote>
<p>FACTORY_MASTER </p>
<p>FACTORY_DETAILS</p>... | <p>May be using a cross join like this would help:</p>
<pre><code>select distinct fm
from
FactoryMaster fm
inner join fm.details fd
inner join fd.lotDetail ld1
,LotMaster lm
inner join lm.details ld2
where
ld2.id = ld1.id
and
lm.id = :lotMasterId
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Umbraco True/False custom property value parsing issue<p>dVery confusing on how Umbraco did this, and I'm looking for some sort of explanation if possible. I... | <p>It seems that <code>x.GetPropertyValue("closedQuestions")</code> is returning <code>null</code> in some cases (or maybe an <code>int?</code> with a null value), which is why you're getting that error when trying to call <code>ToString()</code> on it. If <code>x.GetPropertyValue<int>("closedQuestions")</code> ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
jQuery/CSS - Full width on click<p>I have three links, which will, onClick, show a different container (containing a chart). This is the HTML code for this:<... | <p>Remove the <code>display:none</code> from the charts and hide them on document ready. This allows the chart to be rendered at the correct size then hidden.</p>
<p>HTML </p>
<pre><code><div id="rentedref-chart" style="width:100%;height:180px;"></div>
<div id="directref-chart" style="width:100%;height... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
va_arg glitches for char<p>I try to use <code>va_arg</code> to retrieve next argument in function. It works well for all types (including char*) but char:</p... | <p>Arguments smaller than <code>int</code> are promoted to <code>int</code> before being passed to variadic functions, and such functions should thus retrieve the arguments as type <code>int</code>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Control Binding Times in XAML<p>I want To know if there is a way to Define how many times a Grid can bind to a list ?</p>
<p>for example , If I have a list ... | <p>in that case</p>
<pre><code>public List<something> MyTopItems
{
get { return myItems.Take(10); }
}
public List<something> MyItems
{
get { return myItems; }
}
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Felix Dependecy-Manager not creating GoGo-Command<p>I am trying to create a GoGo-Shell-Command using the Felix-Dependency-Manager (Version 3.2.0) without Ann... | <p>First of all, your assumption about how to register gogo commands is correct: a whiteboard pattern is used and the scope and function properties determine the commands.</p>
<p>You did not post the code for <code>MyConsole</code>. Does it actually contain a method called <code>command</code>? If not, that could be t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unwanted scroll bar fading in at top of browser<p>I have an html page which is behaving strangely when I click on a link in the navigation bar. When I click ... | <p>There is a minus margin of <code>-15px</code> on <code>.navbar-right</code> that causes the width to overlap the parent <code>.container</code> div. </p>
<p>If you reset the minus margin, the navbar won't overlap the container, and you won't see the scrollbar:</p>
<pre><code> .navbar-right {
margin-right:0;
}... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
mysql null pointer exception<p>I am running a scheduler in which email is generated automatically. I have set crontab file in Linux window and when I try to ... | <p>Add a jar file that is required for connection in your lib folder
com.mysql.jdbc.Driver
Follow this link to open connection
<a href="http://www.mkyong.com/jdbc/how-to-connect-to-mysql-with-jdbc-driver-java/" rel="nofollow">http://www.mkyong.com/jdbc/how-to-connect-to-mysql-with-jdbc-driver-java/</a>
Download the ex... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is only the first case of my switch list working correctly?<p>For the life of me, I can't figure out what's wrong with it. When I run this script, the fi... | <p>Use <code>console.log</code> instead of <code>console.prompt</code>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to correctly query OData with filter in nested type based on property from parent type?<p>I am getting a dynamic value (_FilterDate) on the parent type t... | <p>There are two issues going on here:</p>
<blockquote>
<p>this response is specifically regarding the OData v4 specification and the .Net ODataLib implementation.</p>
</blockquote>
<ol>
<li>You have correctly identified that when filtering results based on a nested collection you you must separately apply the filt... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Font not properly displayed<p>I have a webpage where I'm using the <code>"font-family: Poppins-Medium;"</code>
In my PC the font is displayed correctly.
Howe... | <p>I recommend using websafe fonts instead.</p>
<p><a href="https://www.w3schools.com/cssref/css_websafe_fonts.asp" rel="nofollow noreferrer">https://www.w3schools.com/cssref/css_websafe_fonts.asp</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to run two SQL queries using only one statement in NodeJS<pre><code>app.get("/total", function(req,res){
var q = "SELECT COUNT(*) AS new FROM voters_deta... | <p>I guess you should make a file of xyz.sql and then write the two queries in that file and then parse it to the code.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ZeroMQ PUB/SUB topology on the same machine<p>Is it possible for a publisher to publish to multiple clients on the same machine using ZeroMQ? I'd like a set ... | <blockquote>
<p><strong>Q</strong> : <em>Is it possible for a publisher to publish to multiple clients on the same machine using ZeroMQ?</em></p>
</blockquote>
<p>Oh <strong>sure</strong>, it is. No doubts about that.</p>
<hr>
<p>Check the code. The responsibility of the order-of-execution is there. In <strong><a ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to import SQL Azure V12 BACPAC: "type Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider is not valid"<p>I am trying to import the expo... | <p><strong>Updated:</strong> The new <a href="https://msdn.microsoft.com/en-us/library/mt238290.aspx" rel="noreferrer">SQL Server Management Studio Preview</a> is the best way to Import to Azure SQL DB. It has support for all the latest Azure SQL DB features and validations. In addition it has a standalone web installe... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Count the number of lists containing specific element in a nested list<p>I have a list, for example:</p>
<pre><code>res = [['a', 'b', 'a'], ['a', 'b', 'c'],... | <p>When you find yourself saying "I want to count how many ...", there's a good chance <a href="https://docs.python.org/2/library/collections.html#collections.Counter" rel="noreferrer"><code>Counter()</code></a>, from the <code>collections</code> module, can help.</p>
<p>In this case, we want to count how many lists e... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
setLayoutManager NullPointException in RecyclerView<p>I'm trying to receive a list with an array in RecyclerView and get error:</p>
<pre><code>java.lang.Nul... | <p>As @StenSoft noted in comments the problem was in
<code>setContentView (R.layout.activity_main_appbar);</code> because of wrong activity layout content, instead of
<code>setContentView (R.layout.activity_main);</code> </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Nesting apply in lapply to loop over columns of a list of matrices<p>I have a list of matrices, and I'm trying to apply a function to each column of each of ... | <p><code>FUN=my.mse</code> is hijacking your attempt to <code>lapply</code> <code>apply</code>. I think you want:</p>
<pre><code>lapply(B.list, function(x) apply(x, 2, my.mse))
</code></pre>
<p>You can't specify <code>FUN</code> for both <code>lapply</code> and <code>apply</code> in the same call (unless you use pos... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to delete the today extension in iOS8<p>I just delete the files(just storyboard, viewController) of a today extension, then I create a new one. But, when... | <p>delete the schema
select your project then select widget from Targets and delete it</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to join multiple rounded images one by one using line in css or css3<p>I have been created rounded images, using html and css3.</p>
<p>Here is my code:<... | <p>You can create a line using css :after</p>
<p>Here's a <a href="https://jsfiddle.net/ojfvc4d6/1/" rel="nofollow">demo</a></p>
<pre><code>.circular:after {
background-color: red;
content: "";
display: block;
height: 48px;
position: absolute;
bottom: 100px;
width: 2px;
left: 50px;
}
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Bind to DataGridView using a Stored Procedure<p>I have a DataGridView with 5 columns all setup in the Form Designer. I also have a Stored Procedure that will... | <p>For anyone in future looking for how to get this done, I've attached the code I used to achieve this. This is based primarily on jmcilhinney examples posted <a href="http://www.vbforums.com/showthread.php?469872" rel="nofollow noreferrer">here</a>.</p>
<pre><code>Module DataGridViewRetrieve
Public db As New Sql... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
calling a function containg enum in java<p>I have defined a class </p>
<pre><code>class Prop{
public static enum property{
NAME,
CITY,
ADDRE... | <p>To run this program you need a <code>public static void main(String[])</code> method first. That's your entry point into any Java program. Since, you want to assign the values inside <code>callPro</code>, add the <code>main()</code> method there.</p>
<p>Next, you want to call <code>getProperty()</code> which is an ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
c++ : using parameter pack in constructors?<pre><code>#include <iostream>
class A
{
public:
A(bool b, int i)
: b_(b) , i_(i) {}
... | <p>With your current code, your instantiation of <code>F<A></code> makes the <code>Args</code> template argument <em>empty</em>, which means the constructor only have the <code>a</code> argument, not <code>args</code>.</p>
<p>It seems that you want only the <em>constructor</em> to have a template parameter pack,... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to identify page elements in protractor with no obvious identifiable property<h2>Background</h2>
<p>I have some (Angular JS template) HTML as follows:</... | <blockquote>
<ol>
<li>Is there n ideal way to identify the metrics for testing?</li>
</ol>
</blockquote>
<p>I would go with <a href="http://angular.github.io/protractor/#/api?view=ProtractorBy.prototype.binding" rel="nofollow noreferrer">by.binding</a> locator which acts as a partial match:</p>
<pre><code>var i... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Animate.Scroll html,body after page hits offset - Very close (see Fiddle)<p>I'm trying to trigger the window to scroll to a new location after the page has b... | <p>If you want to run it just once</p>
<pre><code>var scrolled = false;
$(window).scroll(function() {
var y_scroll_pos = window.pageYOffset;
var scroll_pos_test = 50;
if(!scrolled && y_scroll_pos > scroll_pos_test) {
scrolled = true;
$('html, body').animate({
scrollTop: $( ".he... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
WPF - Where to add CRUD actions in MVVM<p>I'm new to WPF and I'm trying to implement MVVM model into my WPF application. I have this scenario: a Customers mo... | <blockquote>
<p>if I want to add more queries, such as retrieve customers by Id, grouping customers by a certain column or update a customer, where would I need to add these? </p>
</blockquote>
<p>For example in a service that you inject the view model with, e.g.:</p>
<pre><code>class CustomersViewModel
{
priva... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Networkx drawing axes with frameon = False and axes = False<p>I am drawing and saving my figure with the following:</p>
<pre><code>nx.draw_networkx(dG,pos,l... | <p>Here is the call signature of <code>savefig</code> (see <a href="http://matplotlib.org/api/pyplot_api.html#matplotlib.pyplot.savefig" rel="nofollow">here</a>):</p>
<pre><code>savefig(fname, dpi=None, facecolor='w', edgecolor='w',
orientation='portrait', papertype=None, format=None,
transparent=False, bbox_i... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sort varchar with alpha numeric and special character values<p>I have a invoice_number field as <code>varchar(20)</code> </p>
<p>I have the select query as ... | <p>Your problem is that some of your invoice numbers (for example <code>20190313176617593442</code>) are too large for the <code>BIGINT</code> data type. You can work around this by keeping the values as strings, and left padding with <code>0</code> the numeric ones out to 20 digits for sorting. For example:</p>
<pre>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to parse xml , linq c#<p>i am trying to load the xml file as below and read the value for each element but the Result count always = Zero , below my xml ... | <p><code>ROOT</code> and all child elements are in the namespace <code>authenticateUser</code>, thanks to the <code>xmlns="authenticateUser"</code> default namespace attribute. So you need to query on on the the element local name plus the namespace name, which can be constructed using <a href="https://msdn.microsoft.... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find minimal set of subsets that covers a given set<h3>General problem</h3>
<p>Given a set N of X unique strings: <code>{a1, a2, ... , aX}</code><br>
And a ... | <p>You should use actual sets to perform the operations. For a brute force approach, a recursive function is easiest to program:</p>
<p>This one expects a list of sets and tries each one with a recursion on the remaining sets in the list. It returns the shortest list of sets that it finds.</p>
<pre><code>def setCov... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ngrx - passing in payload of triggering action to next action<p>I'm new to ngrx and Angular development. I have a collection of trades in my store. An effect... | <p>The constructor of you action must receive two params:</p>
<pre><code>class LoadTradeSuccess {
constructor(readonly id: any, readonly trade: any){}
}
</code></pre>
<p>Or a payload object, but then you have to create the object in the effect</p>
<pre><code>class LoadTradeSuccess {
constructor(readonly payload... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Match incremented class with incremented ids from different loops [jQuery / Wordpress]<p>After hours of research and try and errors I start my first question... | <p>If i'm understanding correctly this might help</p>
<pre><code>$('.gallery li').on('click', function(e) {
e.preventDefault();
var className = $(this).find('a').attr('class');
var imgContent = $('#'+className).html();
});
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
When all jQuery promises returned<p>I am having an issue where I want to know when ALL of the jquery promises have returned. Is there a <strong>clean</strong... | <p>You should pass all promises into $.when as individual arguments:</p>
<pre><code>$.when(
promiseOne(),
promiseTwo(),
promiseThree(),
promiseFour(),
promiseFive()
).done(function() {
alert("ALL DONE");
});
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Printing contents of DataFrame returned from function<p>I have the following function:</p>
<pre><code> import pandas as pd
def foo():
d1 = {'dat... | <p>Fix your indentation, create a function that iterates over the <code>df</code> and prints its content without inserting extra data information like <code>itertuples</code>, use a number of <code>spaces</code> instead of <code>\t</code> to accomplish the padding you want, <code>\n</code> means newline, so something l... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Does pep8 fail to recognize `# noqa` in some instances?<p>For readability reasons, I prefer to align some types of statements, such as in the following case ... | <p>The <code>pep8</code> script only lets you disable specific error codes with a <code># noqa</code> comment.</p>
<p>See the <a href="http://pep8.readthedocs.org/en/latest/intro.html#error-codes" rel="noreferrer"><em>Error Codes</em> table</a>; only error codes marked with <code>(^)</code> can be silenced this way. E... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add an Empty singleton to Dictionary type?<pre><code>module Extension =
type Dictionary<'T,'U> with
member this.Update (x: Diction... | <p>Per F# spec:</p>
<p><strong>14.11 Additional Constraints on CLI Methods</strong></p>
<blockquote>
<p>F# treats some CLI methods and types specially, because they are common in F# > programming and cause extremely difficult-to-find bugs. For each use of the > following constructs, the F# compiler imposes addition... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TextEdit: Simple JS code snippet throws exception<p>I just tried to write some little js code piece. I use macs TextEdit (until I choose a better editor). Co... | <p>Ok, i could solve the problem. There are two settings which you need to set in TextEdit:</p>
<ol>
<li>new document/format -> change to plain text</li>
<li>new document/options -> deactivate "intelligent quotation marks"</li>
</ol>
<p>Then it works perfectly.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
keyset pagination with full text search on postgresql<p>I have a table 'users' with +100,000 records. I want to start making use of keyset pagination to spee... | <p>You have to provide a fully deterministic ORDER BY. Assuming user_id is unique:</p>
<pre><code>ORDER BY rank desc, user_id
</code></pre>
<p>Then your WHERE would include:</p>
<pre><code>AND (rank < :last_rank or (rank = :last_rank and user_id > :last_user_id))
</code></pre>
<p>But this will not be efficie... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Checking if List contains all items from another list<p>What is the easiest/fastest way to check if a list of tuples contains all the the tuples that another... | <p>You can use <code>set</code>s</p>
<pre><code>t1 = [ (1,2), (3,4), (5,6), (7,8), (9,10), (11,12) ]
t2 = [ (3,4), (11,12) ]
set(t2).issubset(t1)
# returns true
# or equivalent use '<=' so
set(t2) <= set(t1)
# returns true
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sum recursively to each node all the nodes that come after it<p>Hi I need to do a recursive function that takes in input the head of a list and sum to each n... | <pre class="lang-c prettyprint-override"><code>int modify(node *head){
if(!head) return 0;
head->val = modify(head->next)+head->val;
return head->val;
}
</code></pre>
<p>If you want to print the values too, you have to use a wrapper function since the recursion runs in reverse order.</p>
<pre ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does Ctrl-S disable the save button on Azure blob storage file editor?<p>When you edit a file in Azure blob storage the 'save' icon turns blue, indicatin... | <p>After some research, I think this should be a bug(or it's not supported since it is not listed <a href="https://docs.microsoft.com/en-us/azure/azure-portal/azure-portal-keyboard-shortcuts" rel="nofollow noreferrer">here</a>).</p>
<p>I use the develop tool(press F12 button) of Edge browser for the debug.</p>
<p><st... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to compute Gradient of an image with kernel in python<p>Using python numpy or scipy I am trying to perform cross-correlation on each pixel of an image us... | <p>You should use the OpenCV <code>filter2d</code> function to filter an image with your own custom kernel. <a href="http://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_imgproc/py_filtering/py_filtering.html" rel="nofollow">Here</a> is a tutorial for the same and <a href="http://docs.opencv.org/modu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to evaluate values in a dictionary?<p>I have a dictionary (<code>d</code>).
I want to use this dictionary with different values for <code>a</code> and <c... | <p>Based on your feedback to my <a href="https://stackoverflow.com/a/60192541/355230">first answer</a>, it sounds like what you want is something that behaves more-or-less like a spreadsheet. Below is how to implement one that is very dictionary-like. It's based on Raymond Hettinger's ActiveState <a href="https://code.... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
simplexml works on one host but not another. PHP xml directives are correct. Why?<p>The following code works on Host1</p>
<pre><code>$url = "https://<red... | <p>Seems likes you host is blocked by that website. You call many times with that url?</p>
<p>Check this one : </p>
<blockquote>
<p><a href="https://stackoverflow.com/a/34505846/11426374">https://stackoverflow.com/a/34505846/11426374</a></p>
</blockquote> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
get cpu time of an external process and it children while it still running on OS X<p>On linux I can use <code>/proc</code> as stated in <a href="https://stac... | <p>You can get process information using <a href="https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/sysctl.3.html" rel="nofollow">sysctl</a>. So, let's assume that you have the pid for a process: -</p>
<pre><code>#include <sys/sysctl.h>
struct kinfo_proc *getProcessInfo(pid_t ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Centering a link<p>I'm trying to center a bordered READ MORE link on a web page, but haven't succeeded yet. The link still sits on the left of the page:</p>
... | <p>Use the text-center class but use it on the parent div container for the link:</p>
<pre><code><div class="container text-center">
<h2 class="text-center more"><a href="#">read more</a></h2>
</div>
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to do update the database through the browser? DJANGO<p>I've successfully completed the ADDING stage, however I'm really stuck on the EDITING stage. This... | <p>If you're wanting to edit a specific <code>Member</code> instance, you need to retrieve the instance from the database, then pass it to your <code>ModelForm</code>:</p>
<pre><code>def edit_member(request, member_id):
member = get_object_or_404(Member, id=member_id)
form = MemberForm(request.POST or None, in... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MVVM Light pass ViewModel to ObjectDataProvider via ViewModelLocator<p>I have an <code>ObjectDataProvider</code> that binds to the <code>GetProducts()</code>... | <p>I managed to achieve this by getting rid of <code>ObjectDataProvider</code> entirely and adding some properties to my viewmodel instead, e.g.</p>
<pre><code> // This property took place of MethodParameter[0]
public Subcategory SelectedSubcategory
{
get { return _selectedSubcategory; }
set... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to execute multiple commands on machineB from machineA efficiently?<p>I have a tar <code>(abc.tar.gz)</code> file in my <code>machineA</code> which I nee... | <p>You can do it all in a single <code>ssh</code> round-trip, and the tarball doesn't need to be stored at the remote location at all.</p>
<pre><code>#!/bin/bash
set -e
readonly SOFTWARE_INSTALL_LOCATION=/opt/data
readonly MACHINE_LOCATION=(machineB)
readonly TAR_FILE_NAME=abc.tar.gz
ssh david@${MACHINE_LOCATION[0]}... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove gap between next column in a flex list<p>I have created a list that has 2 columns. But there is a gab between the content. How can I remove this? I ha... | <p>Use <code>inline-flex</code> instead of <code>flex</code> there is known issues when using block level elements but using the inline equivalent fixes the issue</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... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I limit my database request according to the pagination of the datatable?<p>I am loading data from my database, which is a very high amount of data. ... | <pre><code>public function parts($offset, $limit) {
return $this->createQueryBuilder('documents')
->setFirstResult($offset)
->setMaxResults($limit)
->getQuery()
->getResult();
}
</code></pre>
<p>But i recommend to use the <a href="https://github.com/KnpLabs/KnpPaginatorBundle... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Trying to start a new app from war file I get java.net.BindException: Address already in use<p>Our server has already two running apps which are running prop... | <p>This warning means that your applications is attempting to listen on a port (<code>localhost:8005</code> in your case) that is already in use by another process.</p>
<ul>
<li>If that port is intentionally in use by another application then you
can do nothing about it (you can not have multiple servers on the
same p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
d3fc webgl candlesticks - setting fillStyle equivelant in webgl<p>I'm using d3fc+canvas to render candlesticks to a chart and change their fill color based o... | <p>Now this functionality has been released, the code should look like this -</p>
<pre><code>const fillColor = fc
.webglFillColor()
.data(data)
.value(d =>
d.close > d.open ?
[0, 0, 1, 1] : [1, 0, 0, 1]
);
const series = fc
.seriesWebglCandlestick()
.xScale(xScale... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Trying to do a text file viewer<p>I'm trying to build a minimalist text file editor using Python and wxWidgets.</p>
<p>It's the first time I'm building a gr... | <p>The line</p>
<pre class="lang-py prettyprint-override"><code> self.Bind(wx.EVT_BUTTON, self.GetNextFile())
</code></pre>
<p>is wrong, it <em>calls</em> the function instead of setting it up as handler. You should remove the <code>()</code>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Android studio layout editor. Waiting for build to finish<p>Android studio layout preview is stuck in waiting for build to finish even though there is no bui... | <p>I am getting same problem since I added material components. Are you using material components in your project? I am using com.google.android.material:material:1.2.0-alpha04 and since I added either switch or slider, the problems starting happening.. I am still investigating.</p>
<p>UPDATE: Ok, solved the problem f... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I cast a string in a format 'dd.mm.aaaa' to a data type in Hive?<p>I have a table with some date columns as string in the format 'dd.mm.aaaa'. How ca... | <p><strong><code>dd.MM.aaaa</code></strong> is not hive compatible <strong><code>date</code></strong> type format, so we need to use <code>from_unixtime</code> and <code>unix_timestamp</code> functions to change the format!</p>
<p><strong><code>Example:</code></strong></p>
<pre><code>hive> select date( --cast to d... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Export SQLite file in document directory via email<p>I am trying to export a SQLite file via email located in the document directory when a user taps on the ... | <p>Turns out I was searching in the wrong directory.</p>
<pre><code> NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentationDirectory, NSUserDomainMask, YES);
</code></pre>
<p>should be:</p>
<pre><code> NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Javascript: Link runs function not working<p>I am creating a BF4 weapon selector (tells you random weapons/attachments to equip), using the function below, a... | <p>If you want the Primary and Secondary weapons to change in each click, you have call Random method inside the CreateWeapons method.</p>
<p>Also it is not good way to use href to call js function, you can use onclick instead of that.</p>
<p>Here is the updated working code for you.</p>
<pre><code>function Random(a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Ansible - When condition not working with meta task<p>I appear to be having issues with using a when condition in a meta tag. I have tried a few variations a... | <p><strong>Update (sharing answer for the sake of completion)</strong></p>
<p>Sharing the prescribed workaround. In my use-case I essentially wanted to "try" a task on the entirety of the inventory until successful</p>
<p>Ended up using host vars. This will always attempt the task if its the 1st host in the inventory... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Multiple lambda functions in zipped list not executing<p>I want to execute multiple functions that have different arguments when a condition is satisfied, bu... | <p>I hope this helps:</p>
<h3>Option 1:</h3>
<pre class="lang-py prettyprint-override"><code>class MyTestClass:
def loopTest(self, type, value, value2):
# necessary to iterate over the values later on
possibleArgs = [value, value2]
conditions = [type == 'YES', type == 'MAYBE', type=='TRY ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to load a javascript module in html<p>I receive an error whenever I import a library in my <code>index.js</code> file and try to use it in <code>index.ht... | <p>You need to provide the URL to an <strong>ES6 module</strong> file, not the URL to an automatically generated HTML document showing an index of files in the <code>axios</code> <strong>directory</strong>.</p>
<p>The Axios distribution includes:</p>
<pre><code>node_modules/axios/dist/axios.min.js
</code></pre>
<p>…... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
unble to convert data table to list in c#<p>i want to show datatable data into html for that im trieng to convert datatable to list. but getting erorr cannot... | <p>Below line won't work </p>
<pre><code>model = dt.AsEnumerable().ToList();
</code></pre>
<p>You have to manually map your properties from the data table, like</p>
<pre><code> foreach(DataRow row in dt.Rows)
{
string deviceDate = row["DeviceDate"].ToString();
string units = row["Units"].ToString();
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React - Form submit fires onSubmit attached to parent of the form<p>I am wondering if someone can explain this behavior to me. I have a React component made ... | <p>The <code>onSubmit</code> that's typically caught by the form's submit handler is just bubbling up through the DOM.</p>
<p>If you attach a <code>e.stopPropagation</code> to the <code><form></code> element, you'll see that <code>submitForm</code> is no longer called.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create a Dataproc cluster with time to live using Python SDK<p>I try to create a Dataproc cluster which has a <strong>time to live of 1 day using pyth... | <p>You should use <code>100s</code> format for a duration type when you construct protobuf in a text format (i.e. json, etc), but you are using a Python object to construct API request body, that's why you need to create a <a href="https://developers.google.com/protocol-buffers/docs/reference/python-generated#duration"... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
(In)correct use of a linear time trend variable, and most efficient fix?<p>I have 3133 rows representing payments made on some of the 5296 days between 7/1/2... | <p>I think some kind of transformation to regular (continuous) time series is a good idea.
You can use <code>xts</code> to transform time series data (it is handy, because it can be used in other packages as regular ts)</p>
<h2>Filling the gaps</h2>
<pre><code># convert myDate to POSIXct if necessary
# create xts fro... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Returning a std::string_view to a const char *<p>So, I was reading about <code>using enum</code> as part of the new C++2a standards <a href="http://www.open-... | <blockquote>
<p>To my mind "red", "green", ... are temporary variables and the thus should not work</p>
</blockquote>
<p>No. <a href="https://en.cppreference.com/w/cpp/language/string_literal" rel="nofollow noreferrer">String literals</a> have <a href="https://en.cppreference.com/w/cpp/language/storage_duration" rel... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Hosting multiple sites on a single IIS installation<p>I have been working on several small ASP.Net MVC websites running on .Net 4.5 and IIS 8 for some time n... | <p>a) yes, it's possible but it will run under the same RAM and CPU limits. Also, if one app pool crashes all the sites under that apppool will crash and will be restarted.</p>
<p>b) I don't know, but if you have enough RAM I think it's better to have each site on each app pool.</p>
<p>c) Yes for RAM and CPU. In IIS8... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Dense Vector Column to Sparse Vector Column<p>I have a unique situation where I need to go from a DenseVector to a Sparse Vector Column.</p>
<p>I am trying ... | <p>It usually doesn't make too much sense to convert a dense vector to a sparse vector since dense vector has already taken the memory. If you really need to do this, look at the sparse vector API, it either accepts a list of pairs (indice, value) or you need to directly pass nonzero indices and values to the construct... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Issue with db2_bind_param passing in string parameters<p>I'm currently having an issue with running a query that requires passing in string parameters. Norma... | <p>After some investigation, I ended up finding the root cause. In my original parameters loop, I had used a foreach loop and assigning the $this->parameters to $param. What I did not know is that the binding of the parameters actually occurred right before execution. Therefore I had something like this:</p>
<pre><cod... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Userform textbox fills in if Vlookup finds the information related to the numbers inserted<p>I have an userform where people have to fill in with data. If th... | <p>I always use this kind of thing. Could be cleaned up and stuff but I like the flexibility and I change stuff all the time so this works for me.</p>
<pre><code>Private Sub DocumentTitleBox_Change()
If IsNumeric(DocumentTitleBox.Value) Then
ReturnRow = Application.IfError(Application.Match(DocumentTitleBox.Value... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using JavaFX in Nashorn with embbeded scripting (no -fx)<p>I have a Java 8 application that runs JavaScripts. I see that I can run JavaFX applications by ru... | <p>You can use System property nashorn.args to pass options to script engine instances created programmatically. See also: "setting options for Nashorn script engine" section at <a href="https://wiki.openjdk.java.net/display/Nashorn/Nashorn+jsr223+engine+notes" rel="nofollow">https://wiki.openjdk.java.net/display/Nasho... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
get protocol from URL if not typed in<p>I am trying to find a way to get the protocol from a URL that the user types in. I have an EditText set as uri in an ... | <pre><code>/**
* Protocol value could be http:// or https://
*/
boolean usesProtocol(String url,String protocol){
boolean uses = false;
try{
URL u = new URL( protocol.concat(url) );
URLConnection con = u.openConnection();
con.connect();
// the following line will be hit only if t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Confusing Key Errors in Pandas<p>I am encountering various Key Errors when I am running various commands in Python and I have no idea why this is happening. ... | <p><code>df=df['LOB'!='Triggered']</code> is wrong. Key error exception is what is raised when you try to access a key that isn't in a dictionary or a column. Python is checking if the name inside the brackets (<code>'LOb'!='Triggered</code>) is a column of <code>df</code>, since the column is <code>LOB</code>, it rais... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get a 2-project view<p>I am a beginner in Visual Studio. I followed the tutorial provided by Microsoft and encounter a problem as follows.</p>
<p><a ... | <p>From your pictures, it appears you have two different solutions, you can actually create two projects from a single solution. Use the <strong>QuickDate</strong> Solution as your main solution, then follow these simple steps:</p>
<ol>
<li>Right-Click on the solution (The first option stating the number of projects (... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Difference between these 2 functions?<p>I have 2 degree-to-radian functions pre-defined using <code>#define</code>:</p>
<p>Function 1:</p>
<pre><code>#defi... | <p>Non of the two "functions" mentioned above is a functions, they are macros, and the first macro is not safe, for example, expanding the macro <code>degreesToRadians(10 + 10)</code> gives <code>(M_PI * 10 + 10 / 180.0)</code>, which is interpreted as <code>((M_PI * 10) + (10 / 180.0))</code> and this is clearly wrong... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Django views as_view()<pre><code>Example views.py:
from django.http import HttpResponse
from django.views import View
class MyView(View):
def get(self,... | <p>The <code>urls.py</code> will call the callable that is passed to the <code>path(..)</code>. Here <code>.as_view()</code> will thus return a function that is called. You can find the source code for this in the <a href="https://github.com/django/django/blob/stable/3.0.x/django/views/generic/base.py#L48-L81" rel="nof... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why sessions data in my db differ from sessions data when i use session->all?<p>I'm trying to use sessions (i need to save sessions in mySql db) in my applic... | <p>The payload in your db you need to decode and unserialize it so that you can have the same result.
For example:</p>
<pre class="lang-php prettyprint-override"><code> return Session::all();
</code></pre>
<p>and</p>
<pre class="lang-php prettyprint-override"><code> $data = DB::table('sessions')->get();
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
submit form withour refreshing whole page<p>I am making a URL shortener with react and when I send a request to get a shortened URL, the whole page reloads a... | <p>When submitting a form it will go to the location defined in <code>action=""</code>. The form values will be sent via POST as URL parameters. If no action is defined, the form will post the values to the same path (<code>./</code>). </p>
<p>You can use <code>type="button"</code> on your button to prevent the form s... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I sort data for an aggregate function?<p>I have a custom CLR aggregate function. This function concats strings within a group. Now the question is, can I... | <p>Based on information from Damien_The_Unbeliever, Vladimir Baranov, Microsoft pages and from few other users (see comments to the question), I can deduce that:</p>
<ul>
<li>Ordering rows for aggregate function cannot be done directly in the database; However there are hints that this is\might have been a planned fea... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Change date format with pandas<p>I have a data frame with a column 'object type' called 'Fecha' and I would like to cast it as DateTime type.
However, pandas... | <p>If you set the locale to <code>es_ES</code> you can convert the string series to datetime using <code>pd.to_datetime</code> and the appropriate format codes from <a href="https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior" rel="nofollow noreferrer">here</a>.</p>
<p>In this case the forma... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create a json array from these json objects in iOS<p>I have a dictionary that looks like this. </p>
<pre><code>NSDictionary *dict = @{@"cpu" : self.p... | <p>Firstly add all dictionaries to a array.</p>
<pre><code>NSMutableArray *mutArrData = [NSMutableArray array];
//Add dictionaries which vary to your requirement.
[mutArrData addObject:yourDictionary]; //1
[mutArrData addObject:yourDictionary]; //2
[mutArrData addObject:yourDictionary]; //3
</code></pre>
<p>Now creat... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
open a chrome tab from content script<p>I need to open a chrome tab using content script.
I checked message passing in chrome example and tried this<br/>
<st... | <p>When you run the content script it also runs in the new tab that you opened so it ends up opening an infinite amount of tabs. To limit this, you can put the <code>tabs.create</code> inside of a function that doesn't run immediately on page load.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using sympy's latex() function without calculating the input<p>I want to get latex output from a sympy expression without calculating the expression. For ins... | <p>You can manually adjust the long_frac_ratio</p>
<blockquote>
<p>long_frac_ratio: The allowed ratio of the width of the numerator to the
width of the denominator before we start breaking off long fractions.
The default value is 2.</p>
</blockquote>
<pre><code>>>> latex(e,long_frac_ratio=3)
'\\frac{2 ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular UI router, how to get a list of ancestors of current state from controller?<p>My states hierarchy is (from top to bottom):</p>
<ol>
<li><code>root</... | <p>Have a look at <code>$state.$current.includes</code>; it appears to return an object with keys matching the current and parent states. I believe these are all states that would pass a <code>$state.includes()</code> test.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to divide with each other the two queries with different conditions?<p>There is a table in which the managers column and the status column. How to calcul... | <p>You can do conditional aggregation:</p>
<pre><code>SELECT
"Manager Name",
COUNT(*) FILTER(WHERE "Performance Score" = 'Fully Meets') Perfomance_Fully_Meets,
COUNT(*) Performance_Not_NA,
AVG( ("Performance Score" = 'Fully Meets')::int) Performance_Ratio
FROM public.hr_dataset
WHERE "Performance S... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MongoDB and Spring MVC: PATCH operation?<p>I have the following simple <code>Java</code> Controller with the <code>Spring Web</code> framework:</p>
<pre><co... | <p>According to me, the best practice should not be the use of the POST for doing an update/patch.</p>
<p>Keep you POST to do only Round creation.</p>
<p>If you use spring data mongodb just call the save method of your repository with your entity
see <a href="https://docs.spring.io/spring-data/mongodb/docs/current/ap... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Removing a specific cell from a Collection View<p>I'm trying to remove the first collection view cell. I'm having trouble getting the indexPath for the first... | <p>You don't need to call <code>indexPathForCell</code> as you know that you want to delete the first cell - index 0. You can use the <code>NSIndexPath</code> class method <code>indexPathForItem:inSection:</code> to create the index path directly -</p>
<pre><code>- (void)removeFirstItemFromCollectionView
{
NSLog(... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.