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:
GlassFish 4.1 in Eclipse errors java.io.FileNotFoundException: null/config/domain.xml (file or directory does not exist)<p>I'm trying to start glassfish from... | <p>Reinstall:
<br/>- Eclipse Luna
<br/>- GlassFish 4
<br/>Delete all old file. Then reinstall Eclipse-GlassFish connector (because start up GlassFish manually still working.)</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Textarea with maximum one row<p>Is it possible to have a textarea in HTML with a single line that never wraps to a 2nd line?
I'd like to behave pretty much l... | <p>I think I got it. I wired up an jQuery listener.<br>
Using this, no word wrapping is allowed, even when pasting a multi-line string into it. And spaces are still preserved.</p>
<pre><code>$(document).ready(function () {
$('#formatTextArea').on("keyup", function () {
var string1 = $('#formatTextArea').... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
is it safe to delete log/system.log and log/exception.log files from var/log folder<p>I want to remove system.log and exception.log files from log folder and... | <p>Yes.. It is safe. But remember the following thing before you are going to delete those files. </p>
<ol>
<li>Those files note the errors that are caused at server level or database level.</li>
<li>Those files contains the Exceptions that are caused at any module or extension level.</li>
<li>On production, some used... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to post data to the same ejs view or partial after using res.render get?<p>I need to display data that gets posted after rendering view with res.render()... | <p>try this :</p>
<pre><code>const bodyParser =require('body-parser');
const urlencodedParser = bodyParser.urlencoded({ extended: false });
app.get('/', function (req, res) {
res.render('index', {
time: time,
Views: visitors,
mobileViews: mobileVisitors,
});
}
app.post('/',urlencodedP... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
iOS, 'NSInvalidArgumentException' on NSString<p>I have data coming in from a JSON source.</p>
<p>The value of key hour is an integer:</p>
<pre><code>{"busy... | <pre><code>NSInteger hour = [[[self.stats valueForKey:@"busy"] valueForKey:@"hour"] integerValue];
self.busyHour.text = [NSString stringWithFormat:@"%i", hour];
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ActiveRecord Query - Rails<p>Within my rails app, I have a Book model and a User model.</p>
<p>I'm using the <a href="https://github.com/ryanto/acts_as_vota... | <p>Something like the following code should work. It feels pretty hacky, though.</p>
<pre><code>Book.tagged_with(current_user.tags, any: true).
where.not(user: current_user).
where.not(id: current_user.find_voted_items.map(&:id)).
sample
</code></pre>
<p>If you find you are using parts of this query in oth... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to suggest a plot type from a csv file data python<p>How to build a recommender for the data visualization in python.
For example, if a csv file contains... | <p>The type of plots largely depends on if your data is categorical or continuous. </p>
<p>Assuming that your data is relatively clean, you can call <code>df.dtypes</code> to determine the data types of the columns. If they are continuous (<code>float</code>), you can use scatter plots, distribution plots, etc, depend... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
addUniqueObject property causes compiler error in xcode<p>My code:</p>
<p>In didFinishLaunchingWithOptions:</p>
<pre><code>//Parse Remote Push Notification... | <p>No, You are doing everything right, you just have a typo. As the error shows already says that it expects a separator. Often this error is misleading, but in your case, it leads straight to your problem: Just add a <code>,</code> between your parameters:</p>
<p>From: </p>
<pre><code>installation.addUniqueObject("r... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to switch right-hand strip to left side in facet_grid<p>I have the following code:</p>
<pre><code>library(tidyverse)
p <- ggplot(mpg, aes(displ, cty)... | <p>You could use <code>switch</code> in <code>facet_grid</code> to change the facet strip to left and <code>scale_y_continuous</code> to change y-axis to right. </p>
<pre><code>library(ggplot2)
p + facet_grid(drv ~ ., switch = "y") +
scale_y_continuous(position = "right")
</code></pre>
<p><a href="https://i.stac... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
overriden isEqual method not getting called every time during comparisons<p>I have a class called </p>
<pre><code>Contact;
</code></pre>
<p>In <code>Contac... | <p>Please read the discussion about <code>isEqual:</code> in the NSObject Protocol in the <a href="https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Protocols/NSObject_Protocol/" rel="noreferrer">Reference Library</a>.</p>
<p>You'll find that for objects which are inside a collection (su... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Postgres archive versions<p>Trying to import a nightly production backup locally, I ran into this:</p>
<blockquote>
<p>pg_restore: [archiver] unsupported ... | <p><code>pg_restore -l filename</code> will tell you the archive version of a PostgreSQL dump.</p>
<p>To know which PostgreSQL version uses which archive format, you'll have to look at the source: <a href="https://git.postgresql.org/gitweb/?p=postgresql.git;a=blob;f=src/bin/pg_dump/pg_backup_archiver.h" rel="nofollow ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL Server : select where with multiple values<p>I need to create a stored procedure that can check for all records matching an indefinite number of values.<... | <p>There are many split function version online, if you just google SQL Server Split function you will get 100s of results back. </p>
<p>A quick fix without a function would look something like......</p>
<pre><code>DECLARE @param1 VARCHAR(100) = '1,2,45,16,476,324'
DECLARE @param1XML xml;
SELECT @param1XML =... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Loops for sequence output - python<p>I've been struggling to figure out a way to get my sequence printed out with a 6-mer in the sequence on separate lines. ... | <p>This should work:</p>
<pre><code>width = 6
for i in range(len(sequence) - width):
print " " * i + sequence[i:i+width]
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is just checking the Referer header enough to prevent CSRF?<p>Is comparing the Referer http header enough to prevent CSRF, I have the following html code bel... | <p>Yes, it is enough but it is considered a weaker form of protection:</p>
<blockquote>
<p>Although it is trivial to spoof the referer header on your own
browser, it is impossible to do so in a CSRF attack. Checking the
referer is a commonly used method of preventing CSRF on embedded
network devices because it... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Disabling a submit button if a given field is unfilled in jQuery<p>I am currently using jQuery to disable the submit button on an edit profile section unless... | <p>Have a look at this :</p>
<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>$("input").on('keyup', function(){
$(this).next().prop('disabled', $(this).val()=="");
});</code></pre>
<pre class="snippet-code-html lan... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Linq to entities subquery<p>How can I write the following subquery in Linq:</p>
<pre><code>Context.Set<Process>()
.Include(...)
.Where(x... | <p>Try this:</p>
<pre><code>(from p in context.Set<Process>().Include(...)
from a in context.Set<Activity>()
where a.Id == activityId
where p.Activity.Name.CompareTo(a.Name) > 0
select p).Take(1);
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get some information from exception caught with catch(...)?<p>I have a try catch clause where the outermost <code>catch(...)</code> never happened until now.... | <p>You can do this using gdb or another debugger. Tell the debugger to stop when any exception is throw (in gdb the command is hilariously <code>catch throw</code>). Then you will see not only the type of the exception, but where exactly it is coming from.</p>
<p>Another idea is to comment out the <code>catch (...)<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to I write regular expression that split by include token and exclude token<p>Hi I am not good using regex.
So I have a question.</p>
<p>I want to split... | <p>The following is a simple regular expression matching the fixed constraints that you have provided. However, I suspect it might not be that usable in the end, especially if you intend to use dynamic split/ignore lists (which would imply some dynamic building of the regex pattern). In any case, I hope the pattern its... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Hide a div at the end of countdown<p>This is a countdown script and it is working properly. I want to hide #mydiv at the end of countdown. Could you please h... | <pre><code> <script type="text/javascript">
$('[data-countdown]').each(function() {
var $this = $(this), finalDate = $(this).data('countdown');
$this.countdown(finalDate, function(event) {
$this.html(event.strftime('%D gün %H:%M:%S'));
$this.countdown(finalDate)
.on('update.countdown', fu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to realize this in Matlab?<p>There is a matrix <code>X</code>, the size of which is 400-by-1000. I want to collect L = 10 samples, each of size M = 500, ... | <p>The easiest thing would be to use <a href="http://www.mathworks.com/help/stats/randsample.html" rel="nofollow"><code>randsample</code></a> from the statistics toolbox. This allows you to take a random sample from a population / data without replacement. However, <code>randsample</code> takes in <strong>a vector</s... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Strange text field behaviour with flash<p>Here is my code: </p>
<pre><code> <% if flash.now[:error] %>
<div id='login-error'>
... | <p>See if this works any better (note the <code>nil</code> arguments):</p>
<pre><code><%= label_tag :email %>
<%= text_field_tag :email, nil, class: "error" %>
<%= label_tag :password %>
<%= password_field_tag :password, nil, class: "error" %>
</code></pre>
<p>For these particular form helper... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Not able to navigate from Activity to a Fragment<p>I am trying to navigate from activity to a fragment, but I have got caught with an error. I have posted my... | <p>You should change</p>
<pre><code> android:name=".DetailViewFragActivity"
</code></pre>
<p>to</p>
<pre><code> android:name=".DetailViewFragmentActivity"
</code></pre>
<p>Check activity name. It's <code>DetailViewFragmentActivity</code> not <code>DetailViewFragActivity</code></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add vertical alignment feature to a major-mode for Emacs<p>I am using verilg-mode for emacs everyday but the code alignment is not that good for me. S... | <p>According to @homeless reply, I did modification: Use <code>narrow-to-region</code> to avoid region boundary changes. </p>
<pre><code>(defun align-decl-vertically ()
"Align verilog declarations."
(interactive)
(save-excursion
(save-restriction
(narrow-to-region (region-beginning) (region-end))
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sort between two dates in excel userform<p>I have an excel database with several dates. My dates are in range D, and I want to fine the start date and end da... | <p>For getting the start and end date use simply</p>
<pre><code>Sub test()
Dim Mindt As Date
Dim Maxdt As Date
Mindt = Application.WorksheetFunction.Min(Range("A1:A10")) 'change range as needed
Maxdt = Application.WorksheetFunction.Max(Range("A1:A10")) 'change range as needed
End Sub
</code></pre>
<p>Your cells in ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vector subscript out of range in my (unfinished) snake game<p>So I'm making a snake game(it's not finished) and I got the vector subscript out of range error... | <pre><code> for (unsigned int i = 1; i < (snek.size() - 1); i++)
{
snek[snek.size() - (i - 1)] = snek[snek.size() - i];
}
</code></pre>
<p>That loop starts at i=1. So you try to write to snek[snek.size()], which is memory one <strong>after</strong> your vector's memory.</p>
<p>Us... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Prevent "Target Unreachable" when entity is null<p>I have an focused person object in my bean. Some attributes of this focused person are connected with prim... | <p>I would very simply use two selectOneMenu components, mutually exclusive</p>
<pre><code><p:selectOneMenu id="eyeColorSelection" value=""
rendered="#{bean.noPersonFocused}" disabled="true" />
<p:selectOneMenu id="eyeColorSelection" value="#{bean.focusedPerson.eyeColor}"
rendered="#{not bean.noPers... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Firefox is ignoring more than one whitespace in SVG text and showing them smaller - compared to Chrome<p>Concerning this question:<a href="https://stackoverf... | <p>Already found it. Setting <code>white-space: pre;</code> on <strong>tspan</strong> works as aspected.</p>
<p>The remaining issue is that QGIS where I'm defining my data is not saving multiple whitespace in the presentation. So I just need to find out how that is working.</p>
<p>Edit: here the link to the QGIS ques... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Kanade-Lucas-Tomasi Tracker MATLAB<p>I am currently trying to use Kanade-Lucas-Tomasi tracker in MATLAB as used in this example: <a href="http://www.mathwork... | <p>1) The <code>step</code> method of <code>vision.PointTracker</code> returns new locations of the points, instead of the motion vectors. If you need the motion vectors, you can simply subtract the old points from the new points.</p>
<p>2) With each <code>step</code>, the new points are returned in the exact same ord... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting null pointer exception while creating JSONRPCCLIENT object in bitcoind<p>Class for creation of JsonRpcClient object for connecting my application by ... | <p>I got my solution actually the problem was of version i was using <code>rpcport</code>
which is changed to <code>test.rpcport</code> for test net from bitcoind version 17.0
hence bean were not getting the connection from my localhost server causing null pointer exception.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
know that skspritenode has completely moved over another skspritenode<p>I'm trying to figure out that a SKSpriteNode has completely iterated over another <co... | <p>Set the contactTestBitMask properties of both objects. then detect when they collide in the didBegin func and then detect when they stop colliding in the didEnd func</p>
<pre><code>player.physicsBody?.contactTestBitMask = collisionTypes.bullet.rawValue
bullet.physicsBody?.contactTestBitMask = collisionTypes.player.... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Scheme/Racket: Syntax parser matching confused<p>This code runs fine:</p>
<pre><code>(require syntax/parse/define (only-in racket [#%app racket:#%app]))
(de... | <p>I found it out how, the <code>when</code> is defined first before the <code>if</code> in <code>define-syntax-parser</code>, and its syntax include ellipsis <code>...</code> which matches everything following it, including the <code>:</code> in if-else.</p>
<p>Fixed it as below, put syntax for <code>if</code> first:... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Type checking in Erlang<p>How I understood, <code>-spec</code> uses in Erlang for dialyzer only.</p>
<p>How can I check type (e.g. in function) at compile t... | <p>Short answer: you can't.</p>
<p>Erlang is a dynamically typed language and many of the assumptions the runtime depends on require it to be that way, at least in some places. There have been discussions in the past about making a strongly-typed subset or functionally pure subset of the language, but neither approach... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Simple C++ while loop<p>I'm having trouble solving this problem from my c++ book, and there isn't a good example. </p>
<blockquote>
<p>Write a code that l... | <p>This should work. As per your question, the number needs to be doubled when entered, so you just need to move your multiplication within the loop, so that there a number to x2. Otherwise, there is no value for 'number' till that point.</p>
<pre><code>#include <iostream>
#include <cmath>
using namespace ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
what is meant by that ASP.NET VNext is cloud optimized?<p>I have recently started doing Research and Development on ASP.NET vNext and I am trying to understa... | <p>vNext apps can use a cloud-optimized subset of the .NET framework. This subset of the framework is about 11 megabytes in size compared to 200 megabytes for the full framework, and is composed of a collection of NuGet packages.
It is not required that you use this subset of the framework you can still use the full fr... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
DropzoneJs success and error callback<p>I'm building an AngularJs app and I'm using a dropzone from DropzoneJs. I need to use the success and error callback ... | <p>So, this is the workaround I found...</p>
<p>Instead of using the callbacks, I make the changes on the init function. Although this answer doesn't satisfy me, it's the best I can do for now... If anyone can explain why it works on the init but not as a callback feel free to answer.</p>
<p>This is the solution:</p>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Problem with 3D wireframe visualization in matplotlib<p>I need to plot 3D data of the form z_i as function of (x_i, y_i) using a wireframe. I wrote the code ... | <h2>What's wrong with wireframe?</h2>
<p>I am not sure, but I think the problem is in your data. It's small and if you look carefully you will see that it looks like a stack of three different lines (observations). Look at this plot:</p>
<p><a href="https://i.stack.imgur.com/7qSze.png" rel="nofollow noreferrer"><img ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why assign Something to Something.prototype.constructor?<p>I was reading about how the Javascript prototype property works along with inheritance and then be... | <p>By default, every prototype has a <code>constructor</code> property that refers to the function that it "belongs" to.</p>
<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>function A() {
}
console.log(A.prototype.co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
android progress bar not updating<p>I can't update the progress bar.</p>
<p>I tried many solutions but it still didn't help so I think there's a problem i'm... | <p>this helped me solve the bar update problem. Hope it will help you too</p>
<p><a href="https://stackoverflow.com/questions/4348032/android-progressbar-does-not-update-progress-view-drawable">progress bar not updating</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Filtering Entities Based on the type "PERSON", "ORG" etc in Spacy<p>After creating a <code>nlp</code> pipeline from <code>spacy</code>. Passed the doc into t... | <pre><code>for ent in doc.ents:
if ent.label_ in ["PERSON", "ORG"]:
print(ent.text)
</code></pre>
<p>See also <a href="https://spacy.io/usage/linguistic-features#named-entities-101" rel="nofollow noreferrer">https://spacy.io/usage/linguistic-features#named-entities-101</a> for an overview of the relevant p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing a class (not instance) in python?<p>Relatively new to python, coming from C#, so bear with me :)</p>
<p>Basically I got a ton of "nearly-duplicated"... | <p>You can actually just pass the class like this:</p>
<pre class="lang-py prettyprint-override"><code>class A:
def foo(self):
return "foo"
class B:
def foo(self):
return "bar"
def do_something(c):
e = c()
print(e.foo())
do_something(A)
do_something(... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Any way to disable Ruby on Rails app hosted by Heroku for a while in order to stop monthly payments?<p>I've got a website I created using Ruby on Rails and D... | <p>Heroku charge per dyno hours, there is a free tier, anything that pass that is charged, to avoid being charged by Heroku you can reduce to one 1X Dyno and no Workers or Clocks or if you wanna take down your app you can reduce to 0 dynos.</p>
<p>You can reduce in the Heroku dashboard, to do so go to <a href="http://... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
kubernetes gcp caching old image<p>I'm running GKE cluster and there is a deployment that uses image which I push to Container Registry on GCP, issue is - ev... | <p>I think you're looking for kubectl set or patch which I found there in <a href="https://kubernetes.io/docs/reference/kubectl/cheatsheet/#updating-resources" rel="nofollow noreferrer">kubernetes documentation</a>.</p>
<p>To update image of deployment you can use <a href="https://kubernetes.io/docs/reference/generate... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to calculate mutual friend using cypher query in Neo4j as per facebook representation?<p>I am describing a small part of facebook that is mutual friend c... | <p><strong>Example of Facebook Representation to Calculate Mutual Friend Between the Two:</strong></p>
<ul>
<li><p>Cypher Query To Represent Friends Database:</p>
<pre><code>CREATE (Keanu:Person {name:'Keanu Reeves', born:1964})
CREATE (Carrie:Person {name:'Carrie-Anne Moss', born:1967})
CREATE (Laurence:Person {name... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Lisp plist only in context of symbol's property list cell?<p>Basically, I'm wondering if there is such a thing as a plist in Common Lisp outside the concept ... | <p>Use <code>GETF</code> to retrieve values from a list, which is a property list.</p>
<pre><code>CL-USER 141 > (let ((joe '(:fav-season "Fall"
:fav-color "Blue")))
(list (getf joe 'fav-color)
(getf joe :fav-color)))
(NIL "Blue")
</code></pre>
<p>N... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Debug.Log only once instead of as many times as there are objects<p>I have 9 3d cubes. each cube has a script component, checking if the cube was touched. if... | <p>Well as you say yourself: Your script is running on all 9 cubes!</p>
<p>So 9 times you make a Raycast, 9 times you hit always the same object and print its name 9 times.</p>
<hr>
<p>You could of course simply check if you hit yourself:</p>
<pre><code>if (Physics.Raycast(raycast, out raycastHit))
{
// only do... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I use grid_forget more than once in tkinter?<p>I'm trying to give myself Excercises using imports and keeping programs and modules separate from each ... | <p>Here's a solution for you:</p>
<pre><code>import tkinter as tk
from tkinter import E, W
window = tk.Tk()
window.title("Converter")
answer_label = tk.Label(window, text="No Answer")
answer_label.grid(row=5)
def feet_to_inches_function():
answer_label.configure(text='As you want (INCHES)')
def inches_to_fee... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ffmpeg merge multiple (N) mono audio channels of a MXF video to multiple (M) stereo channels of MP4 video<p>I have an MXF file with 16 audio mono streams and... | <p>The code is organised with line breaks. A <code>\</code> breaks a line in a Unix shell.</p>
<pre><code>ffmpeg -i "in.mxf" \
-filter_complex "\
[a:0][a:1]amerge=inputs=2[ch1ch2];\
[a:8][a:9]amerge=inputs=2[ch9ch10]" \
-map 'v:0' \
-map '[ch1ch2]' \
-map '[ch9ch10]' \
-c:v copy \
-c:a aac -b:a 128k -ar 48000 -ac 2 \
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I set the default option in Visual Studio Code's Quick Open View?<p>Up until now I've been using <code>Ctrl+Q</code> to trigger <code>View: Quick Ope... | <p>See <a href="https://github.com/microsoft/vscode/issues/90232" rel="nofollow noreferrer">https://github.com/microsoft/vscode/issues/90232</a> </p>
<p>It was a regression in v1.42 that is due to be fixed in the v1.42.1 recovery update. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to apply style to the Jquery datatable column depending on the column value<p><a href="http://jsfiddle.net/ktdj3u9r/5/" rel="nofollow">http://jsfiddle.ne... | <p>Use the <a href="https://datatables.net/reference/option/columns.createdCell" rel="nofollow"><strong><code>createdCell</code></strong></a> callback in yor quantity declaration :</p>
<pre class="lang-js prettyprint-override"><code>...
"columns": [
{ "title": "Name" },
{ "title": "Price" },
{ "title": ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Event is not triggering after class change<p>I have <code><span></code> which is changing its <code>class</code>, when I click on it and ad versa.</p>
... | <p>Event handlers are bound only to the currently selected elements; they must exist on the page at the time your code makes the event binding call.</p>
<p>As you are updating class, You need to use <a href="http://learn.jquery.com/events/event-delegation/" rel="nofollow"><strong>Event Delegation</strong></a> using <a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is best option to guard your routes in React?<p>I am using this HOC to guard my routes but I find odd using this HOC in every component because I am alr... | <p>The HoC approach is right, but <strong>you should apply it to routes, not components</strong>.</p>
<p>Take a look at the pattern used in <a href="https://github.com/mjrussell/redux-auth-wrapper/tree/master/examples/react-router-4" rel="nofollow noreferrer">redux-auth-wrapper</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Matlab coder: "All inputs must be constant"<p>I'm using Matlab Coder to convert this code to C++:</p>
<pre><code>fs = 50;
[b,a] = butter(3,0.5/(fs/2),'high'... | <p><a href="https://www.mathworks.com/help/matlab/matlab_oop/properties-with-constant-values.html" rel="nofollow noreferrer">Define Class Properties with Constant Values</a></p>
<p>In ConstInput.m</p>
<pre><code>classdef ConstInput
properties (Constant)
fs = 50;
end
end
</code></pre>
<p>Then rename <code... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get list of data from database to spinner<p>I want to get all username from my user table to be displayed in my spinner for selection but instead of d... | <p>You're not actually accumulating any values in your array. You're making a new array each time you go through the loop.</p>
<pre><code>ArrayList<String> values = new ArrayList<String>();
while (cursor.moveToNext()) {
String rep = cursor.getString(cursor.getColumnIndex(User.KEY_username));
values... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to Bind a Combo Box back color to a Panel back color in C#<p>So... I am trying to program a little game in C# (mastermind), and i got 4 different panels ... | <p>My opinion, no need to update all the panels' back color when only 1 should be changed. You can bind each panel's BackColor property to corresponding ComboBox's BackColor property.</p>
<p>My code:</p>
<pre><code>public partial class Form1 : Form
{
List<string> colors = new List<string> { "red", "bl... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pass vector of card into function to print and use?<p>I'm struggling through a card program and want to pass my single card vector into my function so it can... | <p>There's a lot to critique here. You probably don't want to pass the list of cards directly, but probably want to pass the deck, instead, like:</p>
<pre><code> void DoSomething(const Deck& deck) {
// ...
}
</code></pre>
<p>However, assuming you do pass the list, the way to pass it would be as a const refer... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to access SQL Azure database using IP address?<p>Because of my <code>machine IP gets changed dynamically</code> (get ip using website whatismyip.com ... | <p>I wrote a post a while ago on how to access the SQL Azure instance using point-to-site VPN provided by Azure Virtual Network. It does not require anything to be open on the SQL Azure side. Here is a link to it: <a href="http://rtumaykin-it.blogspot.com/2015/01/using-linux-iptables-port-forwarding.html" rel="nofollow... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Child component's is recall a once problem<p>The useState's value will change when the current button is clicked, which will call the child component.</p>
<... | <p>You can send the callback function to the Child Component like this.</p>
<blockquote>
<p>StepComp.js</p>
<pre><code>const StepComp = () => {
const [isModalVisible, setIsModalVisible] = useState(false);
const btnStyled = {
margin: "10rem"
};
const setVisible = visible... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Blazor - Send Message problem using SignalR<p>I have created fairly complicated Blazor apps, calling web APIs, injecting services and using 3rd party librari... | <p>Sorry guys, my bad! </p>
<p>Very silly (syntax) issue. Mostly I used 3rd party blazor libraries (like Radzen, DevExpress etc.) to generate UI. For this blazor signalR client app, I use plain html tags. The problem was with the 'bind' & 'onclick' attributes. These should be preceded with @ symbol.</p>
<p>So, in... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is my generator not yielding the argument value passed in from the next method?<p>I am reading the documentation on generator functions on <a href="https... | <p>Generator functions use <code>yield</code> to yield at every <code>GeneratorObject.next()</code>. <code>yield</code> will even happen in a <code>console.log()</code>, so that should arguably throw a Syntax Error. When you use <code>GeneratorObject.next()</code> the first time, it yields and the Generator stops execu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# StreamReader Encoding.UTF8 not working<p>I have a C# Project in Visual studio which download and parse XML file that contains Korean, Chinese and another ... | <p>using the code below (notice I comment out 2 of your lines) </p>
<pre><code>//newRequest.Headers["If-None-Match"] = "d84e5667-3cbe-4556-b551-9d7e4be95d71";
//newRequest.Headers[HttpRequestHeader.AcceptEncoding] = "gzip";
</code></pre>
<p>and changed your line: <code>StreamReader(stream, Encoding.UTF-8);</code></p>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
IIF statement using BETWEEN<p>The following IIF expression isn't working for me:</p>
<pre><code>IIF(Fields!Number.Value BETWEEN 1 AND 1000, Fields!Number.Va... | <p>SSRS does not support <code>BETWEEN</code> as far as I can tell.</p>
<p><img src="https://i.stack.imgur.com/dYWZ1.png" alt="enter image description here"></p>
<p>Just use equivalent <code>>=</code> and <code><=</code> checks:</p>
<pre><code>=IIf(Fields!Number.Value >= 1 and Fields!Number.Value <= 1000... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Appending list elements into the correct sorted position<p>I'm trying to get a list of players within a given radius of a point, and have them sorted by thei... | <p>As an alternative to using a sorted data structure (as suggested by Martijn Pieters), you could combine the distance info with the player object. You could do that by adding it as an attribute to the player class, or by temporarily combining each player instance with its distance info. Eg,</p>
<pre><code>players = ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to select menu item programmatically in Kendo menu<p>I have a menu with values and I want to add a Key shortcut that will select that item.</p>
<p>I can... | <p>Not sure if Kendo API supports triggering select item but I was able to achieve click the menu items with keyboard shortcuts using JQuery. </p>
<p>Check this <a href="http://jsfiddle.net/ohegxjLx/1/" rel="nofollow">JSFiddle</a></p>
<pre><code>function clickMenuSpan(keyCode){
var shortcut = String.fromCharCode... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Position absolute is not relative to its SVG parent<p>I'm trying to put an element on <code>SVG</code> using the <code>position: absolute</code>, but the pro... | <p>can you try like this.. svg inside you not add any other div </p>
<p><strong>HTML</strong></p>
<pre><code><div class="container">
<div class="row">
<div class="col-md-6 mt-4 text-center">
<div class="svg-image-col">
<svg class="shape mt-5" xmlns="http://www.w3.org/20... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Run a function once per user for any endpoint in nodejs<p>My backend is written in NodeJS. I would like to push some real time data for my firestore database... | <p>This will involve storing some state per user (presumably you could do this in Firestore). As each user request comes in, you just need to check for said state and if it's not been set yet, invoke the function and set the state.</p>
<p>For example, here's how it might look if you were using <a href="https://express... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Custom Theme not applying in FragmentActivity<p>My theme is not working I have seen this <a href="https://stackoverflow.com/questions/8024706/how-do-i-change... | <p>You could not be able to change the actionbar background color because you are not using <code>Widget.Holo.Light.ActionBar.Solid.Inverse</code> as the parent of <code>MyActionBar</code></p>
<p>use </p>
<pre><code>parent="@android:style/Widget.Holo.Light.ActionBar.Solid.Inverse"
</code></pre>
<p>instead of</p>
<p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get the filename of the current file in a Perl one-liner<p>Is it possible to get the current filename (from a list of files) in a Perl one-liner like ... | <p>The name of the variable is <code>$ARGV</code>. You can find out about it in <a href="http://perldoc.perl.org/perlvar.html#%24ARGV" rel="noreferrer">perlvar: <code>$ARGV</code></a>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to debug Linux kernel modules with QEMU?<p>I am working on academic project that modifies some <code>Kernel Networking</code> code as well as include a n... | <p>The easiest way in my opinion is to use buildroot
<a href="http://buildroot.uclibc.org/" rel="noreferrer">http://buildroot.uclibc.org/</a></p>
<p>clone it, configure it to use your custom kernel (default userspace is fine for a start, you might want to change it later).</p>
<p>it will build your kernel and root fi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Big O notation, prove that 3N^2 + 3N - 30 = O(N^2) is true<p>I want to reason this out with basic arithmetic:</p>
<p>Problem: </p>
<p><code>3N^2 + 3N - 30 ... | <p>For problem 2, let <code>n_0:=10</code> and <code>c:=2</code>. Let <code>n>=n_0</code>. By the chain of inequalities</p>
<pre><code>3n^2 + 3n - 20 >= 3n^2 - 20
>= 3n^2 - 100
>= 3n^2 - n^2
= 2n^2
= cn^2
</code></pre>
<p>we obtain the desired ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
<PHP> How to make echo stay on the page permanently with sessions?<p>I have code, which is supposed to echo if it's true.
I did this with an if, but every ti... | <p>yes you can do it by adding a string in session same as variable</p>
<pre><code>$i = $_SESSION["priem"];
$i++;
$str = isset($_SESSION["str"]) ? $_SESSION["str"] : ''; //my changes
$aantaldelers = 2;
for ($j=2; $j<$i; $j++)
if ($i%$j == 0)
$aantaldelers++;
if ($aantaldelers == 2) {
$str .= "$i, "; ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Gitlab Docker login on wrong registry<p>I configured a docker runner for gitlab which works fine and the default container is the docker:stable container. In... | <p>I had a similar issue. In my case, I was not using my own gitlab running. After a lot of reading, I found out that the runner needs to run with the <code>--privileged=true</code> option. Then finally I realized that the "Group Runners" have not set that flag. The issue got fixed by disabling the "Group Runners" in t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Warning message: the condition has length > 1 and only the first element will be used<p>Below are my codes in R. I use dplyr package to arrange the data by I... | <p>solution with case_when (assuming that startdate is min of date and end date is the max of date) </p>
<pre><code>df %>%
arrange(ID,Date) %>%
group_by(ID) %>%
mutate(start_date=min(Date),
end_date=max(Date),
period= as.numeric(end_date - start_date + 1) ,
SD = case_when(D... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to getIntent().getData(); on Fragment<p>On my application is use login with twitter, in example code work in Activity
but my app use work in Fragment </p... | <p>Use <code>Uri uri = getIntent().getData();</code> in the fragment, you just need call getActivity() first:</p>
<pre><code>Uri uri = getActivity().getIntent().getData();
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Charts not showing up in D3<h1>Where I'm at</h1>
<p>Tackling an assignment, I changed one of my data variables <code>var csvData</code>, but now only one of ... | <p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>$(function() {
$("#placeholder").remove();
var margin = {top: 60, right: 20, bottom: 30, left: 40},
width = 960 - margin.left - margin.right,
height = 500 - margin... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I find jars?<p>I am using eclipse in Windows and a simple JSF example from the book Java EE7 Recipes. I cannot find the following jars: "javax.enterp... | <p>Thanks everyone for providing input. I found a download for javax.enterprise.context.RequestScoped. I found that when you type "javax.enterprise.context.RequestScoped download" in google it brings you to a download site. That's all that was needed.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Jaxb - How to avoid "xsi:" at root element<p>Im using Java 7 and trying to create an xml from an xsd with jaxb.</p>
<p>I generated Java classes from <a href... | <p>It's correct in your case. </p>
<pre><code>private static final QName EVENT_QNAME = new QName(
"http://www.w3.org/2001/XMLSchema-instance", "Veranstaltung");
</code></pre>
<p>From <a href="http://docs.oracle.com/javase/7/docs/api/javax/xml/namespace/QName.html#QName(java.lang.String,%20java.lang.Str... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
IQueryable where clause<p>Was difficult for me to find a fitting title for this post. But I have the following:</p>
<pre><code>IArticleRepository articleRep... | <p>You don't need to write two <code>Where</code> clauses; just add another condition to your first <code>Where</code>. The second condition should use <code>Any</code> function to search for the categories you're looking for.</p>
<pre><code>IArticleRepository articleRepo = unitOfWork.ArticleRepository;
List<Articl... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Node 0.12.0 + Marklogic 8<p>When I went to install the node module, I got this:</p>
<pre><code>npm WARN engine marklogic@1.0.1: wanted: {"node":">=0.10.2... | <p>The Node.js 12.0 release came out the day after the MarkLogic Node.js API 1.0.1 release -- less than two weeks ago. </p>
<p>The Node.js 12.0 release and the io.js 1.2.0 fork are likely to be shaking out initial bugs (and there are rumours the projects might merge, which sounds good but could destabilize).</p>
<p>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
i'm trying to create one to one relationship between user to education but i'm only getting the result from education table not user<p>//User Model</p>
<pre... | <p>This is because you are asking for <code>education</code> relationship, which will return only <code>Education</code> data.</p>
<p>I would first eager load relationship:</p>
<pre><code>$user_info = User::with('education')->find(1);
</code></pre>
<p>Now <code>$user_info</code> will contain <code>User</code> ins... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Access nested related objects with where clause in Laravel using Eloquent<p>I'm trying to get a list of tasks that are associated with a specific client, but... | <p>What you are looking for is <a href="https://laravel.com/docs/6.x/eloquent-relationships#querying-relationship-existence" rel="nofollow noreferrer"><code>whereHas</code></a>. It lets you query "results based on the existence of a relationship".</p>
<p>You could try something like:</p>
<pre><code>Task::where('statu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Theme independent app bar in windows phone 8.1<p>I am adding app bar in my windows phone 8.1 app . I set requested theme as dark in my app bar button. But wh... | <p>Set your button's theme colours on the CommandBar rather than on the button.</p>
<p>You cannot set the colours of the AppBarButtons in an app bar individually on Windows Phone. They buttons will always use the Foreground and Background colours from the CommandBar itself.</p>
<pre><code><CommandBar RequestedThem... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JavaScript - removing previous fieldset once radio button is selected<p>I am trying to modify this JSFiddle I found because it's almost exactly what I am loo... | <p>Here is a modified jsFiddle with the desired behavior: <a href="http://jsfiddle.net/h8CFe/121/" rel="nofollow">http://jsfiddle.net/h8CFe/121/</a></p>
<p>I modified the last lines of the <code>update</code> function to this:</p>
<pre><code> fieldsets.addClass('hide');
for (i = 0; i < options.length; i += ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
DownloadManager how to replace HttpClient?<p>I have Android 4.1.2 device.
I'm trying to download file from HTTPS and get error about not valid certificate.</... | <p>Implementing a custom "Dummy-TrustManager" is a simple but dumb idea as it destroys the security of SSL/TLS. </p>
<p>What you need instead is to trust that specific certificate of the server, not every (self-signed) certificate in the world!</p>
<p>There is a complete blog topic by Nikolay Elenkov which explains e... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Room: error: Not sure how to convert a Cursor to this method's return type (void)<p>I have this query set up to return all the records from these tables and ... | <p>Problem is <strong>Room</strong> cannot map the result from your custom query to existing <code>MoodBeforeTable</code>. It is because your return type is <code>List<MoodBeforeTable></code> but you have used joins using <code>TwistedThinkingTable</code> and <code>MoodAfterTable</code> and so on.</p>
<p>What yo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SFML 'make install' SFML_OPENGL_ES missing include file<p>I was trying to install <code>SFML</code> on my mac (running Yosemite) using CMake GUI. The issue i... | <p>If you just want to install SFML to your Mac just uncheck the SFML_OPENGL_ES in cmake. OPENGL_ES is required if you want to build apps for iOS and Android, but not for Mac OS X.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Loading bitmap manually<p>I'm trying to write some C# code, which will take an name to a .bmp located on the disk.
To that I have been following the wikiped... | <p>It's not clear why you are under the impression that pixels in a bitmap are stored in the way you describe. Two bytes of padding between every six bytes of pixel data?</p>
<p>There is no padding at all between pixels <em>within a scan line</em>. If you have a 24bpp image, then the pixels are stored three bytes at a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make conda-build work correctly and find the setup.py?<p>I am trying to create an anaconda python package. My <code>meta.yaml</code> looks like this:<... | <p>Your <code>meta.yaml</code> file is missing a <code>source</code> section. Also, it's usually best to keep your recipe files in a directory of their own, rather than in the top repo. I recommend the following:</p>
<pre><code>mkdir conda-recipe
mv meta.yaml build.sh bld.bat conda-recipe
</code></pre>
<p>Then, edit ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why do buttons go off screen on Flow Layout?<p>I'm learning flow layout from Head First Java and I'm trying to have buttons wrap around as it says a <code>Fl... | <p>If you're adding a component to a <code>BorderLayout</code> frame, the <code>East</code> and <code>West</code> regions will let the component get its preferred width. Since the panel contains three buttons and places them side by side, the preferred width of the panel is that of the three buttons side by side. There... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MySQL 8: Should I be able to write a valid IEEE 754 floating point number and read the exact value back?<p>The program below writes a floating point number t... | <p>You are encountering <a href="https://bugs.mysql.com/bug.php?id=87794" rel="nofollow noreferrer">MySQL bug 87794</a>. The float is stored with the full precision, but is not returned to the client with full precision.</p>
<blockquote>
<p>MySQL uses the <code>FLT_DIG</code> constant (which equals to 6 with IEEE 75... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
determine if connection is wired or wireless?<p>I have a bash script I made which when run on each of my computers, detects the number of CPU cores, HDDs/par... | <p>Try this:</p>
<pre><code>tail -n+3 /proc/net/wireless | grep -q . && echo "We are wireless"
</code></pre>
<h3>Details</h3>
<p>On a hardwired system, the contents of <code>/proc/net/wireless</code> consist of two header lines:</p>
<pre><code># cat /proc/net/wireless
Inter-| sta-| Quality | Dis... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use PATCH method with CL_REST_HTTP_CLIENT?<p>I am trying to consume an external REST service. Example:</p>
<pre><code>DATA : lo_client TYPE REF TO if... | <p>You can use CL_HTTP_CLIENT to set method freely, CL_REST_HTTP_CLIENT is also using this class under the hood.</p>
<pre><code>DATA : lo_client TYPE REF TO if_http_client.
cl_http_client=>create_by_url(
EXPORTING
url = 'http://my_url'
IMPORTING
client = lo_client
EXCEPTION... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do you match the value of a capturegroup/variable?<p>I'm trying to write a regular expression that will match palindromes 4 or more letters in length (so... | <pre><code>^(\w)(\w).?\2\1$
</code></pre>
<p>Guess you needed this.<code>[]</code> is not what you think.Moreover regex for detecting palindrome of any numbers is not possible.For <code>4 or 5</code> it can.See demo.</p>
<p><a href="https://regex101.com/r/mS3tQ7/5" rel="nofollow">https://regex101.com/r/mS3tQ7/5</a></... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
rewrite apache httpd complete url with query string<p>I want to rewrite url from one application to another application of diferent path with query string us... | <p>You cannot match query string in <code>RewriteRule</code> and <strong>there is no real need to match query string here</strong> since that will be carried over automatically.</p>
<p>Try these rules instead:</p>
<pre><code>RewriteEngine On
RewriteRule ^/?rforms/jsp/rform/index\.jsp$ /Project/jsps/rform/indexAIL.js... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Asynchronous server messages with python flask<p>I'm trying to get server messages pushed out to the end user that's logged into our flask website.</p>
<p>I... | <p>You <code>emit</code> events that you listen for with <code>on</code> event handler. Also I don't think it makes sense for your event listener <code>display_message</code> to be inside a rest endpoint. Here is a solution with <code>pypubsub</code> for convenience so you can easily subscribe for all events on the ser... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use android SQLite cursors to show a row in the table<p>Don't ask questions here often but I have a MyDBHelper class with a method 'databaseToString' ... | <p>The best approach is to create your custom objects to manage data for your example , create a new java file and name it Person, the following is the person class (for simplicity of code we do only 2 properties, you build yours completed with all the fields) :</p>
<pre><code>public class Person {
//Properties
priva... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I hear sound playing while scrubbing the audio from an <audio> tag?<p>In my example, I have a mp3 that a user has uploaded to a webpage. I create a v... | <p>Yes your answer is in the AudioContext API (all async and slow MediaElements are not made for this). Specifically, what you want is the <a href="https://developer.mozilla.org/en-US/docs/Web/API/AudioBufferSourceNode/" rel="nofollow noreferrer">AudioBufferSourceNode</a> interface, which is able to play audio instantl... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding Sentences From Paragraph Array With Uniqqe Id's<p>I am writing a script that takes a book as some array of sentences. I want to print each sentence ou... | <p>Simply just split your paragraph with '.', and append it to your div with IDCounter/</p>
<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code> var book = "Lorem Ipsum is simply dummy text of the printing and typesetti... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pointer not moving up or down despite using earlier and already working code<p>been trying for a while to find the problem with the following code. I'm tryin... | <p>Your issue is in the main game loop, first off, you had the blitting of Pause Screen to Screen commented out. readding that in gave the pointer seeming to multiply and go all over the place (getting closer!). </p>
<p>The reason it does that is you did not update your pauseScreen in each pass of the loop. Your di... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Returning value from thread Java/ Android<p>I have the following thread in my android class. How can I get the value of err from the thread???</p>
<pre><cod... | <p>You have two ways of achieving this.</p>
<ol>
<li><p>The <em>bad</em> way.
Create a mutable object like a <em>list</em> of integers and let the Thread (Runnable) write into the list. You can access the value in the list in the outer class / method.</p></li>
<li><p>Use a <a href="http://docs.oracle.com/javase/7/docs... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
pass value to servlet from jsp by hyperlink<p>I saw answers relating to this question and tried to solve still I am getting null in Servlet, where I am doing... | <p>Put the <code>count=4</code> in the url of your ajax request</p>
<pre><code>function callMe(count){
$.ajax({
type: "POST",
url: "/NewServlet?count=" + count,
data: { methodToInvoke: "sayHello" , data: "4" }
}).done(function( msg ) {
alert( "Data Saved: " + msg );
});
}
</code></pre>
<p>and in your jsp:</... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.