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:
Clear the label before calling a JavaScript function which displays timer through the same function [Session Timeout]<p>I tried to display timer on webpage i... | <p>The problem with your code might be the <code>var x;</code> declaration, because variables declared using <code>var</code> keywords, are actually function scoped. </p>
<p>So, every time <code>startTimer();</code> is called it is creating a new <code>x</code> variable within the function scope only and because of t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Difference between 'a == null' and 'null == a'<p>When checking to see if a variable is null, I have seen that the suggested coding style is <code>if(null == ... | <p>There isn't any.</p>
<p>People will sometimes write <code>null == a</code> for historical reasons, because it removes the possibility of a typo-related bug in C. If you were to write:</p>
<pre><code>if (a = NULL) { // note, only single =
...
</code></pre>
<p>in C, then that would execute the assignment statemen... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
count the number of columns for each row by condition on character and missing<p>I want to count the number of columns for each row by condition on character... | <p>You could use <code>rowSums</code> to count number of <code>NA</code>s or empty values in each row and then subtract it from number of columns in the dataframe.</p>
<pre><code>test$num <- ncol(test) - rowSums(is.na(test) | test == "")
test
# a b c d num
#1 aa aa aa 3
#2 bb <NA> ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Losing NSTextEffectLetterpressStyle when drawing into CGBitmapContext<p>I am drawing text on top of a solid background color, and while it is appearing, the ... | <p>Both <code>CFAttributedString</code> and <code>NSAttributedString</code> can apply arbitrary attributes to ranges. The attributed string types don't inherently interpret the attributes.</p>
<p>Rather, the string drawing technologies interpret the attributes. Core Text understands a different set of attributes than ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Text to Speech RSS Feed Help C# WP 8<p>I am making a simple application that gets RSS feed from a website then automatically reads the Headlines out loud (te... | <p>So I figured it out,
here is the code:</p>
<pre><code> private void UpdateFeedList(string feedXML)
{
// Load the feed into a SyndicationFeed instance.
StringReader stringReader = new StringReader(feedXML);
XmlReader xmlReader = XmlReader.Create(stringReader);
SyndicationFeed feed... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
table contact has no column named time (code 1)<p>I have this error:
table contact has no column named time (code 1): , while compiling: INSERT INTO contact... | <p>it needs just a space. instead of " INTEGER PRIMARY KEY AUTOINCREMENT," I wrote
" INTEGER PRIMARY KEY AUTOINCREMENT, " and this error is solved.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MSBuild tools offline installation<p>I am trying to create MSBuild offline installation using this <a href="https://docs.microsoft.com/en-us/visualstudio/ins... | <p>You likely need:</p>
<ul>
<li>.NET Desktop Build Tools (Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools)</li>
<li>.NET Core Build Tools (Microsoft.VisualStudio.Workload.NetCoreBuildTools)</li>
<li>Web Development Build Tools (Microsoft.VisualStudio.Workload.WebBuildTools)</li>
<li>.NET Framework 4.5 Target... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
XmlReader - only read "child xpath axis"<p>Hello I have xml that has nested elements that are the same. It's recursive (joy!)</p>
<p>Like so:</p>
<pre clas... | <p>This is what worked. Sorry it's not 100% generic, but it might give you an idea:</p>
<pre><code>public void ReadXml(System.Xml.XmlReader reader)
{
ReadAttributes(this, reader);
reader.Read(); //advance
switch (reader.Name) {
case "Record":
case "Field":
break;
default... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use Jasmine.js spy on a required function<p>I have this code (Node.js):</p>
<p>File: utils.js</p>
<pre><code>// utils.js
const foo = () => {
... | <p>Yes, it is possible.
You just need to require <code>utils</code> to <code>spyOn</code> first, then require <code>myModule</code>. The following test will pass.</p>
<pre><code>const utils = require('./utils');
// myModule.spec.js
describe('myModule', () => {
it('bizz should return bla bla bla', () => {
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make AngularDart request templates from an absolute URL?<p>When AngularDart requests an HTML template, it requests a URL relative to the broswer's cur... | <h1>Angular 1</h1>
<p>I don't have an ideal solution, but here's something that helps. I declared a <code><base href='…'></code> element at the document level so that all relative links will be resolved relative to that base URL, not the browser's location (which, as mentioned in the question, is divorced from t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why in controllers or services, we can reach lazy loaded proxy object but not in a subclass of AbstractUserDetailsAuthenticationProvider?<p>I asked this ques... | <p>Please go through the reference <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/data-access.html#tx-decl-explained" rel="nofollow noreferrer">documentation</a></p>
<blockquote>
<p>The following images shows a Conceptual view of calling a method on a
transactional proxy:</p>
</bloc... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to Split name file to count series in java?<p>i have a list of files in this form:</p>
<pre><code>name_of_file_001.csv
name_of_file_002.csv
name_of_... | <p>i resolved the problem in this mode:</p>
<pre><code>nameOfFile.split("\\.")[0].replaceall("_[0-9]*","");
</code></pre>
<p>split("\.")[0] remove ".csv" <code>name_of_file_001.csv => name_of_file_001</code><br><br>
.replaceall("_[0-9]*","") "remove, if there is, "_001" <code>name_of_file_001 => name_of_file</c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
d3.js How to draw line chart with vertical x axis labels<p>d3.js How to draw line chart with vertical x axis labels?</p>
<p><a href="https://i.stack.imgur.c... | <p><strong>Updated answer</strong>: to change the label rotation just select all text elements and apply rotate through <code>transform</code> attribute, and adjust the location using <code>dx</code> and <code>dy</code>, also if you notice I changed the padding bottom value in <code>margin</code> variable to be able to... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I capture detected image of object Yolov3 and display in flask<p>I am working on Real Time Object Detection using YOLOv3 with OpenCV and Python. It's... | <p>Using the bounding box coordinates of the detected object, you can crop a new image out of it and then save it to display.</p>
<p>Try this:</p>
<pre><code># extract the bounding box coordinates
(x, y) = (boxes[i][0], boxes[i][1])
(w, h) = (boxes[i][2], boxes[i][3])
crop_img = frame[y:y + h, x:x + w] #frame of vide... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Generate Statement in verilog for multiple Blocks<p>In the code you can see that, I want to instantiate <code>LSFR_counter</code> for 8 times using <code>gen... | <p>Multiple divers means that you have multiple modules trying to set the value of <code>Reg</code>. As a side note I really would advise to use some thing else other than <code>Reg</code> as a signal name, not least because at the top level it is a wire.</p>
<p>Thinking about your generate around the LFSR it would un... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding infinite custom field in wordpress<p>As the title explains, I am trying to add infinite custom fields for two things:</p>
<p>1.Name<br>
2.Bio</p>
<p... | <p>You can hard code it without a plugin by adding this to you functions. </p>
<pre><code>add_filter( 'postmeta_form_limit' , 'customfield_limit_increase' );
function customfield_limit_increase( $limit ) {
$limit = 1000;
return $limit;
}
</code></pre>
<p>I would think you could possibly end up with a performa... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java Regular expression does not match using Apache RE<p>I have this regular expression string: <br><br/></p>
<pre><code>^[a-zA-Z0-9\t\s\n\r!$()*,-./:;=?@`]... | <ol>
<li>You regex must not have unescaped hyphen in the middle of character class.</li>
<li>If you already have <code>\s</code> then there is no need to match <code>\n</code> and <code>\t</code> since <code>\s</code> matches all white-spaces that includes space, tab and newlines.</li>
<li><code>[a-zA-Z0-9_]</code> can... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using Parsave inside parfor loop - saves only my last variable result<p>This is a simplified version of my code. What i want to obtain is a variable1 - row v... | <p>Got an elegant solution on <a href="http://www.mathworks.com/matlabcentral/answers/179884-save-inside-parfor-loop-at-a-specific-iteration-step" rel="nofollow">http://www.mathworks.com/matlabcentral/answers/179884-save-inside-parfor-loop-at-a-specific-iteration-step</a></p>
<pre><code> parpool('local',10); % result... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to embed SVG graphics properly in JSF application using OmniFaces<p>This is a follow-up to <a href="https://stackoverflow.com/questions/28325807/how-can-... | <p>Since I discovered this to be a SVG scaling problem and I seem not to be the only one who has encountered this I'll post my solution here.</p>
<p>In short, I</p>
<ul>
<li>Retrieve the SVG.</li>
<li>Parse it using JDOM.</li>
<li>Inject a view box if it is missing based on the specified size</li>
</ul>
<p>Here's th... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
converting string to number in powershell<p>I am trying to convert a string to a 2 decimal place value</p>
<p>I have a script that has a line of code which ... | <p>If you're using implicit remoting (it sounds like you are), that's going to be a [string], so you'll need to use string methods.</p>
<pre><code>'1.008 GB (1,082,195,968 bytes)' -replace '^([0-9.]+).+','$1'
1.008
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SavedStateHandle returning null values<p>I have an <code>ActionBar</code> menu icon that opens a <code>CategoryFragment</code>. This fragment takes in a <cod... | <p><a href="https://developer.android.com/reference/androidx/lifecycle/SavedStateHandle" rel="nofollow noreferrer"><code>SavedStateHandle</code></a> was not designed to do, what you expect it to do: It ...</p>
<blockquote>
<p>... is a key-value map that will let you write and retrieve objects
to and from the saved stat... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Decoding and Printing Json Data into html table using php<p>I have the following encoded json array: </p>
<pre><code>function getMostActive($link) {
$qu... | <p>As many have said, already, your query in the first line of the getMostActive() function doesn't select any field named <em>Floor</em>. For this reason, the moment you decode the json, you get an array similar to this one:</p>
<pre><code>[
[
"staff" => "name1",
"Total" => 5
],
[
"staff" =>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Loading static files in django<p>I'm just at my wits end here. I want to load my custom js files from the static folder.
When I view the source on Chrome, it... | <p>Obligatory reading:</p>
<p><a href="https://docs.djangoproject.com/en/1.7/howto/static-files/" rel="nofollow">https://docs.djangoproject.com/en/1.7/howto/static-files/</a>
<a href="https://docs.djangoproject.com/en/1.7/ref/contrib/staticfiles/" rel="nofollow">https://docs.djangoproject.com/en/1.7/ref/contrib/static... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laying out a stack of clickable playing cards in Android<p>I'm writing a card-melding game for Android. I display the player's current unmelded cards in a se... | <p>I switched to RelativeLayout with these layout params:</p>
<pre><code> <RelativeLayout
android:id="@+id/current_cards"
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="96dp"
android:gravity="center">
</RelativeLayout>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I slow down ansible?<p>Is there a way to slow down ansible by placing a "sleep 5 seconds" between every server run.</p>
<p>For example, I would requ... | <p>Q: <strong>"<em>Is there a way to slow down ansible by placing a "sleep 5 seconds" between every server run?</em>"</strong></p>
<p>A: Yes. It is. Use <a href="https://docs.ansible.com/ansible/latest/modules/wait_for_module.html#wait-for-waits-for-a-condition-before-continuing" rel="nofollow noref... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Firefox quirk: select the first letter when an image is on the same line<p>Per <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/::first-letter" rel=... | <p>The catch here is that you've floated the image, which means the image is no longer in-flow and in particular it means the image is no longer in the first formatted line — or any line box, for that matter. Therefore the statement that the image is still inline is incorrect.</p>
<p>Firefox has a particularly devian... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vim YouCompleteMe clang does not complete C++11 'auto' variables<p>I use the clang completer for the YouCompleteMe vim plugin. I have found that it does not ... | <p>I eventually isolated the problem using the following approach:</p>
<pre><code>:YcmForceCompileAndDiagnostics # To retry new config
:YcmDebugInfo # for debug info (derp!)
:messages # for runtime diagnostics
</code></pre>
<p>This pointed to a syntax error in my .ycm_extra_conf.py template:</p>
<pre><code>import os... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there http health monitoring in crate?<p>is there an interface in crate like there is in ES - like this one /_cluster/health?pretty=true</p>
<p>I know i ... | <p>The admin-ui that is included in Crate uses some SQL queries to determine the health. That's explained in <a href="https://github.com/crate/crate/issues/1396" rel="nofollow">this issue on github</a>. Other than that there is no interface to do that. (Other than using the ES API as you mentioned)</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Removing a table row dynamically using jquery doesn't work<p>This Table is generating dynamically. </p>
<pre><code><table class='myTab' id='selectPlac... | <p>Use this</p>
<p><a href="http://jsfiddle.net/xefr4ajo/" rel="nofollow">Check Demo</a></p>
<pre><code>$(document).ready(function(){
$(document.body).on('click',".buttonRmv",function(){
$(this).parent().parent().remove();
});
});
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to know Camera Is completed taking taking picture In ios<p>Im using image picker controller to present Camera,After image has been taken it’s entering in... | <p>try this:</p>
<pre><code>[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleNotification:) name:@"_UIImagePickerControllerUserDidCaptureItem" object:nil ];
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Clojure convert currency string to float<p>I know that there's a lot of questions about converting string to float/number/decimal... but my case is quite dif... | <p>what you can do, is to use java's formatting facilities:</p>
<pre><code>(defn read-num [s]
(let [format (java.text.NumberFormat/getNumberInstance java.util.Locale/GERMANY)]
(.parse format s)))
user> (read-num "1.296,26")
;;=> 1296.26
user> (read-num "96,26")
;;=> 96.26
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to change border and color in TextInputLayout unfocus?<p>How to change border and color in <code>TextInputLayout</code> unfocus?</p>
<pre><code><com.... | <p>If you want to have different stroke width in focused/unfocused mode you can use the <strong><code>boxStrokeWidth</code></strong> and the <strong><code>boxStrokeWidthFocused</code></strong> attributes.</p>
<pre><code><!-- The value to use for the box's stroke when in outline box mode,
or for the underline ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Memory leak when transferring custom data (Type*) with QStandardItem?<p>I have a QTreeView with associated QStandardItemModel and QStandardItem's that fill t... | <p>If you declare a pointer as metatype, Qt will internally manage the pointer alone, so it's your responsibility to ensure that the object is deleted in due time (by deleting it manually and clearing references to it or assiging a parent to it and ensuring the parent is deleted. You can avoid memory leaks by using val... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Javascript html select option<p>I have a selection drop down box that shows text when an option is above 1. </p>
<p>I have many drop down boxes which are al... | <p>You can wrap it with a div and add class of: </p>
<pre><code>display:flex;
</code></pre>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>function dropdownTip(value) {
conso... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Avoid using multiple loops in update action<p>I have the following arrays to update at each call of the <code>update</code> action:</p>
<pre><code>params['t... | <p>You can use the <a href="http://ruby-doc.org/core-2.2.0/Object.html#method-i-send" rel="nofollow">Object#send</a> method to do this:</p>
<pre><code>['trajects_names', 'used_vehicles', 'nb_kms', etc.].each do |n|
n.each_with_index do |v, i|
@expense.send(n)[i] = v
end
end
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Interact with my app with GUI _and_ CLI, at the same time<p>I have a PyQt desktop application with interactive GUI.</p>
<p>Basically it is an instrument con... | <p>In these cases it is better to have a service that always runs and that the GUI and CLI are clients:</p>
<pre><code> ┌----------------- GUI
↓
┌----------┐
| Service | ←---------- CLI
└----------┘
↑
└----------------- Another Client
</code></pre>
<p>The communication between the clie... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Django ajax form - redirect to main page after form validation<p>I have a <code>sidenav_form</code> that is submitted using an ajax post to a view called <co... | <p>Actually the problem arises because the button that call the ajax had the property <code>type</code> defined as <code>submit</code>. Therefore, when the button was pressed it actually made another <code>post request</code>, so django started processing two requests at the same time.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
would you mind If I ask you that whether there is any possible way to run node.js on the base of browser<p>Without further ado, I wonder if I can execute nod... | <p>There is an npm package called <a href="https://www.npmjs.com/package/jsdom" rel="nofollow noreferrer">jsdom</a>. </p>
<p>For more clarification see this <a href="https://github.com/jsdom/jsdom" rel="nofollow noreferrer">documentation</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I use findAndModify()? to push an array?<p>My userSchema is:</p>
<pre><code>module.exports = mongoose.model('users', {
userName: String,
mess... | <p>Assuming your above query is true,</p>
<p>Your above query should have <code>upsert:true</code></p>
<p>Like </p>
<p><code>
userSchema.findAndModify({
query:{userName: "Test"},
update:{$push: {messages: {msg: "foo", time: new Date()}}},
new: true,<br>
upsert : true
});
</code></p>
<p>Here <code>ne... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laravel: Sentry Routes and Filter groups<p>I am trying Sentry for Laravel and I came accross with this problem. I have 2 group of routes:</p>
<pre><code>Rou... | <p>You have defined twice the same <strong><em>"/"</em></strong> route, once in the first (Administrator's) group, and once in the second (Doctor's) group</p>
<pre><code>Route::get('/', 'HomeController@index');
</code></pre>
<p>Since you haven't specified any prefix on either route group, the later (second) route ove... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
List of TimeSpan calculated by results from other list<p>I'm trying to create a list based on another list. The list looks like -
<code>{T1, T1, T2, T2, T3, ... | <p>This function can be made much simpler, assuming every element in heatList follows that <code>T\d+</code> pattern.</p>
<pre><code>public IEnumerable<string> TimeGet(List<string> heatList, TimeSpan startTimeSpan, TimeSpan timeGap)
{
foreach (var element in heatList)
{
var input = element.... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Jquery image show/hide not functioning<p>I have a supposedly-simple jquery task in my app that changes an image based on which thumbnail is clicked. The HTM... | <p>So first problem that I see is way You are reffering to an DOM element You are using: </p>
<pre><code>$("#thumb2").click(function()...
</code></pre>
<p><em>$('#id')</em> notation is looking for element with <strong>id="id"</strong> You are looking for element with <strong>id="thumb2"</strong> but in Your code ther... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using JDBC Driver for Hive on Amazon EMR in R<p>Amazon <a href="http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/HiveJDBCDriver.html" rel="n... | <p><a href="https://stackoverflow.com/questions/28211999/r-using-rjdbc-write-table-to-hive">Another question</a>, which has received no answer, included <code>.jinit()</code> in the example code that they had used to successfully connect to hive. This was the missing special sauce. <code>.jinit()</code> launches the ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Card Section with grid layout<p>Hello basically i have this so far
(on mobile devices I managed to make it responsive, but on larger screens I am not able to... | <blockquote>
<p>Set height in <code>vh</code> using <code>calc</code> OR simple <code>height:100vh</code> if no extra
space on page like <code>margin</code> <code>padding</code> etc</p>
</blockquote>
<pre><code>.fHHWeb {
display: grid;
grid-template-areas:
"a b c"
"a d e";
grid-gap: 4px... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Make a selection based on difference in dates<p>I want to make a select based on difference in date in the 2 tables. I am only interested in looking at value... | <p>You can use <code>abs</code> function as following:</p>
<pre><code>select aa.*
from A aa inner join B bb
on aa.ID = bb.ID
And abs(aa.date - bb.date) <= 1;
</code></pre>
<p>Cheers!!</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SwingWorker + JTable: how to change the code so that there was no error?<p>I use this code and get errors <em>java.lang.ArrayIndexOutOfBoundsException</em> .... | <p>There is no need for the "synchronized" logic in the TableModel. A TableModel should be updated on the Event Dispatch Thread when it has been added to the JTable.</p>
<p>So I would suggest that instead of using:</p>
<pre><code> dbm = new DatabaseTableModel(false);
JTable table = new JTable(dbm);
</code></p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Nesting aggregate within apply to aggregate multiple columns by multiple variables in R<p>I have a dataframe with sets of scores, and sets of grouping variab... | <p>Let us name the anonymous function in the question as follows. Then the <code>Map</code> statement at the end applies <code>aggregate</code> to <code>df[1:3]</code> separately by each grouping variable:</p>
<pre><code>mean.sd.n <- function(x) c(m = mean(x, na.rm=T), sd = sd(x, na.rm=T), n = length(x))
Map(func... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Data truncation: Incorrect DATETIME value '' when using a CREATE TABLE SELECT statement<p>I am attempting to create a table on MariaDB 10.3 from a SELECT sta... | <p>This is interesting; it seems some implicit casting in the <code>SELECT</code> query is disabled when it it used in a <code>CREATE TABLE</code> query. Your issue is in this test:</p>
<pre><code>birthdate = ''
</code></pre>
<p>as <code>''</code> is not a valid <code>DATE</code> value. You can resolve the issue by e... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Image zoom to fit Bootstrap Grid<p>I have a Bootstrap Grid and images inside. My images aren't the same size, so I get an ugly grid.
I want all the images to... | <p>I think this is what you're looking for.</p>
<p>JS:</p>
<pre><code>function squareThumbs() {
var thumbs = document.getElementsByTagName("img");
for (i = 0; i < thumbs.length; i++) {
if (thumbs[i].parentNode.className.indexOf("thumbnail") != -1){
thumbs[i].style.height = thumbs[i].clientWidth + "p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Drupal , something wrong with ajax popup forms, how to fix?<p>I have site with Drupal 7, Colorbox and Webform modules. I use it like it </p>
<pre><code><... | <p>I encountered this problem with the Modal forms (with ctools) module as well. I upgraded to the latest dev version of Webform (Feb 19, 2015) and that resolved the issue. This item from the issue queue discusses the cause and fix included that release:</p>
<p><a href="https://www.drupal.org/node/2417757" rel="nofoll... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Solving recurrence equation without the Master's Theorem<p>So, on a previous exam, I was asked to solve the following recurrence equation without using the M... | <p>The trick is to keep expanding until you see the pattern.</p>
<pre><code>T(n)
= 9 T(n/3) + n^2
= 9(9T(n/3^2) + n^2/3^2) + n^2
= 9^2 T(n/3^2) + 2n^2
= 9^2 (9 T(n/3^3) + n^2/3^4) + 2n^2
= 9^3 T(n/3^3) + 3n^2
= ...
= 9^k T(n/3^k) + kn^2
</code></pre>
<p>This keeps going until k is such that 3^k = n. </p>
<p>Assum... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can you add initial data to a volume in Docker that is available on pull?<p>I'm going to use MySQL for integration tests and I'd like to create a pre-baked i... | <p>One solution may be to create your own mysql image. Take the Dockerfile for the official image and <em>before</em> the <code>VOLUME</code> instruction, do all your database setup. </p>
<p>With any luck, you should find that your default config is now copied into the volume when it is created. </p>
<p>Another optio... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
let user draw only one circle as source but some circles for destination<p>I have a very simple application (only one page) on which user draw polygons on th... | <p>A simple approach:</p>
<p>Store all the circles, e.g. in an array, based on the length of the array you'll know if it's the first circle(source) or not(destination).</p>
<p>Setting different properties also isn't complicated, a <code>google.maps.Circle</code> is a MVCObject(and also a native JS-object), you may st... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Oracle SQL: Limiting multiple where clauses<p>Apologies if this seems like a duplicate to <a href="https://stackoverflow.com/questions/20981913/sql-oracle-ro... | <p>You can use <code>row_number()</code> for this:</p>
<pre><code>select Category, ID, IDPrefix
from (select Category, ID, SUBSTR(ID, 1, 5) as IDPREFIX,
ROW_NUMBER() OVER (PARTITION BY SUBSTR(ID, 1, 5) ORDER BY ID) as seqnum
FROM table1 JOIN
table2 t2
ON t1.INTCODE = t2.INTCODE... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can we do a sentiment analysis and create a 'sentiment' record next to each line of text?<p>I Googled for some solutions to do sentiment analysis, and wr... | <p>Not sure what this dataframe looks like, but you can use the Sentiment Intensity Analyzer on each of the strings to calculate the polarity scores of each message. According to the github page, you can use the "compound" key to calculate the sentiment of a message. </p>
<p><a href="https://github.com/cjhutto/vaderSe... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add parameter to Codeigniter URL<p>I have a problem when i try to add other parameter to URL.
before i use Codeigniter i add those parameters using JavaScrip... | <p>You can't do that with the form helper, you have to use your js function again :</p>
<pre><code>echo anchor("home/index/param2", "test", array("onClick" => "javascript:addParam(window.location.href, 'display', 'param1');"));
</code></pre>
<p>It will produce :</p>
<pre><code><a href="http://example.com/index... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SpreadsheetLight working with multiple worksheets<p>I am using <a href="http://spreadsheetlight.com/" rel="nofollow">SpreadsheetLight</a> to write log files ... | <p>The recommended and efficient way is to store all the logs to be written in memory first (with a List<> or something). Then when writing, you select the worksheet, write everything from the first List<>, select the second worksheet, write everything from the second List<>, select the third worksheet, write ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Setting Include Paths When Building Kernel Modules<p>I'm trying to compile a kernel module for Linux. I have the following files: <code>testuio.c</code> and ... | <p>You seem to be mixing up kernel and userspace stuff in your code. However all this is wrong:</p>
<pre><code>CFLAGS_testuio.o = -I/usr/include/x86_64-linux-gnu
ccflags-m = -I/usr/include/x86_64-linux-gnu # see (2) section 3.7
ccflags-y += ${ccflags-m}
</code></pre>
<p>As you're stitching some user-space include pat... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Multiple tables in one pandas dataframe split<p>I have loaded in a csv which looks like this</p>
<pre><code> Unnamed: 0 Unnamed: 1 Unnamed: 2 Unnamed: 3... | <p>If <code>Date</code> string is possible use for distinguish each group then compare and add <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.cumsum.html" rel="nofollow noreferrer"><code>Series.cumsum</code></a>, pass to <code>groupby</code> and in custom function create columns by fir... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How determine cluster assignment of each instances after clustering through weka-python-wrapper<pre><code>from weka.clusterers import Clusterer
clusterer = ... | <p>You can use the <code>cluster_instance(Instance)</code> method to obtain the 0-based index of the cluster or the <code>distribution_for_instance(Instance)</code> method to obtain the cluster distribution:</p>
<pre class="lang-py prettyprint-override"><code>for inst in data:
cl = clusterer.cluster_instance(inst)... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create a user/event tracking tool, backed by Ruby on Rails<p>are there any good references to start looking into building a simple but efficient track... | <p>You'd be reinventing the wheel, but you'll need a javascript library to track the user and a rails API. Pretty much what you seem to know you need.</p>
<p>Here's the documentation on building a rails API: <a href="https://guides.rubyonrails.org/api_app.html" rel="nofollow noreferrer">https://guides.rubyonrails.org/... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert a statement in a string into a format that can be evaluated (Ruby)<p>I am writing a quiz program where I need to store boolean statements as s... | <p>You are looking for <a href="http://ruby-doc.org//core-2.2.0/Kernel.html#method-i-eval" rel="nofollow">eval</a>. Here:</p>
<pre><code>a = "true && false"
eval a
# => false
a = "true && true"
eval a
# => true
</code></pre>
<p><code>eval</code> will let you <em>"convert a boolean statement sto... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
string.IsNullOrEmpty & string.IsNullOrWhiteSpace return false for empty string<p>I have run into a curious case where a block of code that is designed to wee... | <p>As stated in my comment, in that screenshot you can see that <code>trimmedSentence.Length</code> is 1, therefore it's not empty, and its contents is definitely not a standard space. If the string appears empty, it's because it has one of those so-called invisible characters. To check what your string has, you can di... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In a Go template range loop, are variables declared outside the loop reset on each iteration?<p>I'm trying to use a variable declared outside a Go template r... | <p><strong>Note:</strong> <a href="https://tip.golang.org/doc/go1.11#text/template" rel="noreferrer">Go 1.11 will support modifying template variables via assignment</a>. This will be valid code:</p>
<pre><code>{{ $v := "init" }}
{{ if true }}
{{ $v = "changed" }}
{{ end }}
v: {{ $v }} {{/* "changed" */}}
</code></p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
My Sprites are not showing properly in Pygame<p>My sprites aren't showing properly in my program. The map displays fine, but the sprite only shows for a spli... | <p>Remove <code>pygame.display.quit()</code> form <code>movePlayer</code> And turn the <code>while</code> loop in <code>movePlayer</code> to an selection <code>if</code>. Note, you have a loop in <code>main</code>, so use it.<br>
Further more, I recommend to do <code>pygame.display.update()</code> in main.</p>
<p>The ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to chagne admin site URL in SharePoint?<p>I've something like kailash.sharepoint.com for which the admin site URL will be kailash-admin.sharepoint.com . ... | <p>No, SharePoint Online not supported to change Admin Site url. </p>
<p>This is by design with this format: </p>
<pre><code>https://Tenant-admin.sharepoint.com
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to modify charts in Helm Stable repo<p><strong>What have I done:</strong><br>
Added Stable repo into my helm and installed a chart(eg.: Redis, RabbitMQ/s... | <h3>1.</h3>
<p>To edit the chart, you need to copy the chart to some directory. Edit the chart as per your requirement. Go to the parent directory of the chart and perform the following command:</p>
<pre><code>$ helm install <release-name> <chart-name>
</code></pre>
<p>It'll install your custom chart ins... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The same (int)doubles round up and down in Java<p>I'm having the weirdest problem with my game in java. :|</p>
<p>I can get around it, so I will be able to ... | <p>Java is doing some hidden casts. Depending on which variable is a double or an int, you might get unexpected results because some double values have been casted to ints. I would make sure all your variables are doubles.</p>
<p>Also, do not forget that floating points also have representation limitations, that can a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I get multiple values?<p>I'm learning ASP.NET MVC, I'm trying to get multiple selected checkbox values. But when I select more than one value, I only... | <p>You need to use <code>MultiSelectList</code>, like this:</p>
<p>Employee Model</p>
<pre><code>public class Employee
{
public Employee()
{
SelectedHobbies = new List<int>();
...
}
[Display(Name = "Please Select Hobbies")]
public List<int> SelectedHobbies { get... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Have Sub run upon WPF Start<p>I am looking for how to create a private sub to load data from a txt file into some textboxes and the run a message box asking ... | <p>OK, I just tried it in an empty VB WPF project.</p>
<p>If you want stuff to run when your WPF window is loaded, handle the Loaded event of your window:</p>
<pre><code><Window x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winf... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laravel echoing object property after checking for Existence<p>In Laravel there is a shortcut method for checking and printing variable if it exists: </p>
<... | <p>You can use.</p>
<pre><code>{{ @$object->property ?: 'Default'}}
</code></pre>
<p>The "@" is a <a href="http://php.net/manual/en/language.operators.errorcontrol.php" rel="nofollow">Error Control Operator</a></p>
<p>I haven't seen a Laravel specific method.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to work with recommended baselines using Jenkins ClearCase plugin?<p>I'm using Jenkins 1.596 with ClearCase Plug-in 1.5.3. </p>
<p>SCM is UCM ClearCase.... | <blockquote>
<p>1/ Is it possible to poll for the event of baseline recommendation?</p>
</blockquote>
<p>Not that I know of.</p>
<blockquote>
<p>2/ is it possible to instruct it to use the recommended baseline?</p>
</blockquote>
<p>No: an UCM view is by definition selecting the LATEST versions on the branch asso... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get input values and set it to state on click and console log it for react<p>I am trying to get the user inputs on click and set it to the state to tr... | <p>See this full minimal complete verifiable example (<a href="https://stackoverflow.com/help/mcve">https://stackoverflow.com/help/mcve</a> | <a href="https://stackoverflow.com/help/how-to-ask">https://stackoverflow.com/help/how-to-ask</a>)</p>
<p>CodePen demo: <a href="https://codepen.io/Alexander9111/pen/OJVyRvm" re... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
WinSock Non-Blocking I/O<p>I have a WSASocket which when connected calls CreateProcess and servers cmd.exe, I wanted to implement a pipe in-between the proce... | <p>First, according to the [<code>ReadFile</code>] document:</p>
<blockquote>
<p>For asynchronous read operations, hFile can be any handle that is
opened with the <code>FILE_FLAG_OVERLAPPED</code> flag by the <code>CreateFile</code> function,
or a socket handle returned by the <a href="https://docs.microsoft.com... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java 8 Lambda: Map List<Object[]> (List of Object Arrays) to List<Bean><p>I receive a List of Object arrays,</p>
<pre><code>List<Object[]> rawRows = s... | <p>First, change your lambda from</p>
<pre><code>obj -> new Report((String)((Object[])rawRows.get(0))[0] ...
</code></pre>
<p>to</p>
<pre><code>obj -> new Report((String) obj[0] ...
</code></pre>
<p><code>obj</code> is the lambda parameter, and in the <code>map()</code> function will take on the value of each... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Liferay theme template processing error<p>I'm learning how to develop a custom template for my portal.
When I'm trying to use my template the following error... | <p>You'll have to edit your template in <code>docroot/_diffs/templates/portal_normal.ftl</code>. The <strong>_diffs</strong> part is the important one.</p>
<p>Liferay's build process for themes copies the parent theme (see <code>build.xml</code>) to the output directory, then overwrites this with content from the <cod... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
jQuery Filter divs By Class display restriction<p>I am trying to filter some divs by their class, restrict the divs number to max 6 divs and to make next/ba... | <p>I've added class <em>all</em> to each of div items. Now it is easy to filter divs just by class. Divs are appended by numbers just to make page navigation obvious. There are no pretty styles, but it works fine.</p>
<pre><code><div class="category-filter box">
<a id="all" class="button">[ALL]</a>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
db contains records with empty username and suspicous db entries<p>I want to make sure that my php website and the user to login the database has only mandat... | <pre><code>GRANT USAGE, SELECT, INSERT, UPDATE, DELETE, EXECUTE, ALTER, CREATE TEMPORARY TABLES
ON *webphp.* TO 'webphp'@localhost IDENTIFIED BY 'mySuperSecretPW';
</code></pre>
<p><em>Are these rights sufficient? Did i miss any?</em></p>
<p>Be more specific on the database name and use <code>webphp.*</code>. Do no... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AngularJS - ng-change as an option in a custom directive<p>I want to add an <code>ng-change</code> function into a custom directive but I'm not sure if <code... | <p>You should be able to use a format similar to <a href="http://jsfiddle.net/o0cudzyw/2/" rel="nofollow">This fiddle</a></p>
<p>In that format, you can define the function within the directive, then specify whether or not you want the function to be called. </p>
<p>Example:</p>
<pre><code><test-change value="bla... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cout unsigned char<p>I'm using <em>Visual Studio 2019</em>: why does this command do nothing?</p>
<pre><code>std::cout << unsigned char(133);
</code><... | <p>The "sane" answer is: don't rely on extended-ASCII characters. Unicode is widespread enough to make this the preferred approach:</p>
<pre><code>#include <iostream>
int main() {
std::cout << u8"\u00e0\n";
}
</code></pre>
<p>This will explicitly print the character <code>à</code> you requested; in fa... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to draw different tiles using an IBO?<p>My aim is to draw a bunch of "blocks" using a mesh in OpenGL. I can draw a mesh with a VBO and an IBO. But I don'... | <p>Yes, you can still gain benefits from IBO.</p>
<p>Instead of sharing vertices between block faces, make new vertexes at each block corner, for each face, and assign them different texCoords. This will allow you to have different textures on each block. You'll still be able to share vertices with the triangles in th... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Docker Ubuntu 18.04 unable to install msodbcsql17 SQL Server ODBC Driver 17<p>I have the below ubuntu docker file to which I want to add SQL Server ODBC Driv... | <p>I could get it working. Below is the updated Docker file snippet </p>
<pre><code>FROM ubuntu:18.04
RUN apt update -y && apt upgrade -y && apt-get update
RUN apt install -y curl python3.7 git python3-pip openjdk-8-jdk unixodbc-dev
# Add SQL Server ODBC Driver 17 for Ubuntu 18.04
RUN curl https:/... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why am I getting null values when using gson to parse a json object in android studio?<p>I am reading in the following JSON and using GSON to convert it to a... | <p>Try with this object, you should use the same name for the vals, "imageUrl" instead of "imageURL":</p>
<pre><code>data class HomeFeed(
val user: User,
val videos: List<Video>
)
data class User(
val id: Int,
val name: String,
val username: String
)
data class Video(
val channel: Chann... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Counts of multiple variables in multiple columns R<p>This is a sample of my data frame. Each number (1-27) represents a different reason for supporting a pro... | <p>I'm understanding the question to be a request for a tabulation of the "reasons" values:</p>
<pre><code> table( unlist( df[10:15] ) )
</code></pre>
<p>If you need the count of NA's which seems unlikely then look at the optional parameters in <code>?table</code></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to split paths on Windows consistently<p>I get very confused when building paths on windows:</p>
<pre><code>HDF_OUTPUT = f'{__file__}'.split('\\')
print... | <p>These days, the built-in default of handling paths is through the <a href="https://docs.python.org/3/library/pathlib.html" rel="nofollow noreferrer"><code>pathlib</code></a> library.</p>
<pre class="lang-py prettyprint-override"><code>from pathlib import Path
p = Path(r'C:\mypath\to\my\file.txt')
print(p.parts)
# (... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Only include employees currently working for company<p>Thanks to the input I've received earlier on this site, I use the below code to summarize how many mon... | <p>It sounds like you are trying to reduce your query down to only return results where [db_name].[AGL_V_HRA_FE_R].[VW_HRA_EMPLOYEE_DETAIL].SNAPSHOT_DATE == the latest snapshot date.</p>
<p>There are multiple ways you can achieve this, but probably the simplest and most easily readable would be something like the foll... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why do you have to define methods in the class rather than the interface?<p>So, according to <a href="https://www.geeksforgeeks.org/differences-between-inter... | <p>Well, there are two points in that.</p>
<p>First, Java supports an implementation in interfaces. You need to use the default keyword, which is in Java since Java 9 (I am not quite sure about the version number). But, why would you do that?</p>
<p>Interfaces share a common interface for several classes and can ther... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
table Total column results missing certain values<p>While running an sql server 2005 query on an asp.net page and attempting to total the values at the botto... | <p>I'm curious how you were able to determine figures were left out of the total since you already admitting knowing little about how it works.</p>
<p>The one thing that jumps out is the <code>COUNT(DISTINCT)</code> on that column. Doing that aggregation day by day and then totaling is likely to give a higher number t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to efficiently calculate log-returns<p>I have a multi-dimensional array <code>double[,] results</code> where each column represent a price time series fo... | <p>If your computer has multiple cores you can easily improve the speed of your computation. To try it out myself I started by creating this function:</p>
<pre><code>Double[,] ComputeLogReturns(Double[,] data) {
var rows = data.GetLength(0);
var columns = data.GetLength(1);
var result = new Double[rows - 1, colu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
wxWidgets: Which files to link?<p>I am learning C++ and, in order to do so, am writing a sample wxWidgets application.</p>
<p>However, none of the documenta... | <p><strong>We have more of a "rule of ring finger", instead of a thumb</strong></p>
<p>Generally, if you compile the library by hand, it will produce several library files (usually <code>.a</code> <code>.lib</code> or something similar, depending entirely on your compiler and your ./configure) these are produced (typi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to return different datatypes in C#?<p>I have a method in C# that has to return 2 different objects based on input parameter.</p>
<p>How can that be don... | <p>Use the common base type of both types (as @Sriram Sakthivel suggested) or use the base class for all other classes <strong><code>object</code></strong>:</p>
<blockquote>
<p>Supports all classes in the .NET Framework class hierarchy and provides low-level services to derived classes. This is the ultimate base cla... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why do I get this error when trying to create a React Native app?<p>So I just started using expo last week to learn App development for Android and iOS, and ... | <p>I got the same error <a href="https://stackoverflow.com/questions/60187115/react-native-expo-cli-installing-error404-not-found-get-https-registry-npmj">check this link</a>. There are some errors going on in the npm registry and I think that issue is solved now. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Wrong Meta Title After New Domain<p>Google shows my oldest domain meta title on their search results on one of my website after new domain.I've updated meta ... | <p>Google is referring to old content at your domain that is no longer relevant.
But you can prompt them to re-index via Google's Webmaster Tool. Check this article for more detailed analysis - <a href="http://support.aarcade.net/how-do-i-update-or-change-the-google-search-results-for-my-site/" rel="nofollow">http://su... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
what is the difference between hostname and servicename?<p>To let other service / system / docker container talk to my container, should I give them docker s... | <p>The hostname only affects the internal hostname within your container, the container name/service name itself can be used to connect to your service from other applications and is the actual DNS hostname.</p>
<p>So the hostname only affects the 'inside' of your container and changes nothing about the networking or ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Colsum new dataframe<p>With this command it is possible to have a dataframe with the sum of every column</p>
<pre><code>df <- data.frame(id = c(1,2,3), s... | <p>You can do:</p>
<pre><code>stack(colSums(df[-1]))
values ind
1 8 stock
2 2 bill
3 10 bear
</code></pre>
<p>Or using <code>tibble</code>:</p>
<pre><code>enframe(colSums(df[-1]))
name value
<chr> <dbl>
1 stock 8
2 bill 2
3 bear 10
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Class 'Illuminate\Html\HtmlServiceProvider' not found Laravel 5<p>I'm trying to add the HtmlServiceProvider with Laravel 5.</p>
<p>I keep getting the follow... | <p>First add this line to <strong><em>composer.json</em></strong></p>
<pre><code>"illuminate/html": "~5.0"
</code></pre>
<p>Then do a <code>composer update</code>
Wait for the update to finish, then open <strong><em>config/app.php</em></strong> add this:</p>
<pre><code>'Illuminate\Html\HtmlServiceProvider',
</code>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Webpack + SSI rendering without full HTML compilation<p>I'm rebuilding a static legacy website with webpack + misc. plugins (mini-css-extract-plugin, html-we... | <p>Solved issue with <code>ssi-webpack-plugin</code> for rendering SSI includes on devServer & <code>copy-webpack-plugin</code> for SSI include buildout on production serve. I am able to watch for changes by requiring the individual includes in my entry point on my devServer as well.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to dynamically name an attribute?<p>I'm looking to get a custom attribute for anchor tag from xsl.</p>
<p>Is it possible to get the name of the attribut... | <p>Yes, it is possible. You can pass a variable as <code>name</code> value.</p>
<pre><code><xsl:variable name="attributeName" select="id"/>
<xsl:attribute name="{$attributeName}">
<xsl:value-of select="value"/>
</xsl:attribute>
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do you do a double horizontal line on top and bottom of a div?<p>I don't understand how to do a double horizontal line on top and bottom of a div.</p>
<... | <p>Increase the width of the border as illustrated in the following:</p>
<pre><code>.test {
border-bottom: 4px double #333;
border-top: 4px double #999;
padding: 10px 0;
}
</code></pre>
<p>Check <a href="http://jsfiddle.net/xnc5a1vp/" rel="nofollow">Fiddle</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting files committed and number of lines changed<p>I am able to get the files changes and lines affected along with a lot of other stuff by this command <... | <p>I guess you are looking for</p>
<pre><code>git diff --stat --summary -M HEAD HEAD~
</code></pre>
<p>it outputs the stats in the same format as a <code>git merge</code> does.</p>
<p>Or without color for two other commits, e.g.</p>
<pre><code>git diff --stat --summary --no-color -M 6c1dea3 e8f4b44
</code></pre>
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.