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:
Dialog's ShowModal() won't send EVT_PAINT<p>wx version: 2.8.12.1</p>
<p>I'm trying to build a decored Dialog (Background, Buttons, Bitmap Border, etc) but o... | <p>Following the hint on <a href="https://stackoverflow.com/questions/25756896/drawing-to-panel-inside-of-frame-in-wxpython">Drawing To Panel Inside of Frame</a>: </p>
<ul>
<li><p>I got wrong the bind of the Paint Event</p>
<pre><code>self.panel.Bind(wx.EVT_PAINT, self.OnPaint)
self.panel.Bind(wx.EVT_ERASE_BACKGROUND... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
OpenCL development on Intel CPU/GPU under Linux<p>I have an intel i7 haswell cpu, and I would like to start exploring OpenCL development. In particular, I am... | <p>Intel does not provide free support for OpenCL on their iGPUs under Linux - you have to buy the Intel Media Server Studio, minimum $499. On Windows, you can download a free driver to get OpenCL capability for the iGPU: <a href="https://software.intel.com/en-us/articles/opencl-drivers#philinux" rel="nofollow">https:/... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Alternatives to deprecated Webpack's i18n plugin and loader<p>I'm working on a TypeScript project that needs to load translations from <code>.json</code> fil... | <p>How about this?
<a href="https://www.npmjs.com/package/@zainulbr/i18n-webpack-plugin" rel="noreferrer">@zainulbr/i18n-webpack-plugin</a></p>
<p>This is forked from the original <code>i18n-webpack-plugin</code> and fixed to support <code>webpack5</code>.</p>
<p>The usage is still same with the original unmaintained r... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the proper way to acces JBPM6 Process Variables<p>I started off with this <a href="http://www.mastertheboss.com/jboss-jbpm/jbpm6/jbpm-6-web-applicati... | <p>Notice that you are accessing to the Process Definition in there, do you really need to do that? if you already know the process variables that you have defined you can just get the process variables from the ProcessInstance instead. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get Count of related records in sailsjs<p>I have an artist model that has a collection of songs. I am not populating the related songs in the blueprints con... | <p>In order to get a count back you will have two options.</p>
<p>Option A.) Run a second query </p>
<pre><code>Song.count({artist:artist}).exec(/*...*/)
</code></pre>
<p>Option B.) Keep a count value in the artist model that increases / decreases as songs are added / removed. This is probably your best option as it... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Premiere Pro Extendscript checkbox selection in MOGRT<p>When coding a Premiere Pro Panel in Adobe Extendscript I can import a MOGRT file and set the value fo... | <p>It seems you are missing the second parameter 'boolUpdateUI'...</p>
<pre><code>setValue componentParam.setValue(newValue, boolUpdateUI)
Description
Obtains the value of the component parameter stream. Note: This can only work on parameters which are not time-variant.
Parameters
The newValue must be of the approp... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Checking every element of vector with functor<p>I'm trying to detect whether every single element of the vector is fullfilling given condition, let's say it ... | <ol>
<li><p><code>find_if</code> returns the iterator pointing to the <em>first value</em> which meets the given condition. It stops there. You can put this in a loop to find <em>all</em> such elements, until it returns the <em>end iterator</em>.</p></li>
<li><p>The following line does the exact opposite of what you me... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Segue in UITableView with multiple sections, each containing objects filtered from a single array<p>I'm a beginner, clearly out of my league and I haven't be... | <p>I suggest you, to use a <strong>NSFetchedResultsController</strong>. This class have a property <strong>sectionNameKeyPath</strong>. In this property you could set your category and you won't need more iterate with a repetition in each numberOfSection and numberOfRows.</p>
<p>like this:</p>
<pre><code> let aFet... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ReactJS/Material-Table: How can I autofill a row if someone selects a certain "lookup"/dropdown option?<p><strong>Question:</strong> How can I use the Materi... | <p>You can simply override the editComponent of the field to return the matching data for the selected value:</p>
<pre><code>editComponent: ({ onChange, onRowDataChange, ...props }) => {
const onCustomChange = value => {
const lookup = props.columnDef.lookup;
const matchingValue = jsonConta... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create link to the other part of the Shiny app<p>I wonder if it is possible to create a link to other part of Shiny app. I mean, I have one page report with ... | <p>What you are looking for is an HTML <code>anchor tag</code>.
You could for example create an anchor to your distPlot2 using:</p>
<pre><code>column(12,p(HTML("intro text <a href='#distPlot2'>Go to plot 2</a> intro text ")))
</code></pre>
<p>You can replace what is after the <code>#</code> by the... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Execute shell commands using nodejs with root access<p>I want to execute the following shell commands inside a nodeJs application.
If i am doing the work man... | <p>You can combine all 4 commands into one by Ref: <a href="https://superuser.com/a/67766/224204">Super User answer</a></p>
<pre class="lang-sh prettyprint-override"><code>echo "<password>" | sudo -S "<command that needs a root access>"
</code></pre>
<p>In your NodeJs code - try one of the following:</p>
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
FFMpeg Command work in command line, but in python script the image is blueish? (Semi Solved)<p>Okay, kind of a weird problem. But I'm not sure whether it's... | <p>openCV uses BGR instead of RGB for some weird reason. Have to switch around the pixels to get the correct colours.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Bootstrap 3: Break responsive into different row<p>I'm currently trying to implement following layouts in bootstrap 3.2, but I really don't have a clue how t... | <p>You can use two right menu and hide one of them.</p>
<p><strong>DEMO</strong> <a href="https://jsfiddle.net/maxlipsky/mhfb97ed/1/" rel="nofollow">https://jsfiddle.net/maxlipsky/mhfb97ed/1/</a></p>
<pre><code><div class="container">
<div class="row">
<div class="col-md-9">
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
tf-idf function in python need help to satisfy my output<p>i've written a function that basically calculates the inverse document frequency (log base 10 ( to... | <p>Wolf,</p>
<p>Right now you are appending the entirety of <code>res</code> to the <code>[docID]</code>, but you only care about the value associated with that <code>element</code>. I suggest changing <code>res</code> to a <code>dict</code> like the following code:</p>
<pre><code>import math
def tfidf(docs,doc_freq... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Difference between Keras' BatchNormalization and PyTorch's BatchNorm2d?<p>I've a sample tiny CNN implemented in both Keras and PyTorch. When I print summary ... | <p>Keras treats as parameters (weights) many things that will be "saved/loaded" in the layer. </p>
<p>While both implementations naturally have the accumulated "mean" and "variance" of the batches, these values are not trainable with backpropagation. </p>
<p>Nevertheless, these values are updated every batch, and Ker... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Composer - No Matching Package Found<p>I have a PHP framework I've built, and I'm trying to separate everything into different repos and get it set up in com... | <p>Looks like composer won't resolve repositories recursively. From the docs:</p>
<blockquote>
<p>Repositories are not resolved recursively. You can only add them to
your main composer.json. Repository declarations of dependencies'
composer.jsons are ignored.</p>
</blockquote>
<p>So I guess I'm out of luck. I'l... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Warning: Illegal string offset 'en'<p>I get a strange (at least to me) error on my home page:</p>
<pre class="lang-none prettyprint-override"><code>Warning:... | <p>What does that error say?</p>
<pre class="lang-none prettyprint-override"><code>Warning: Illegal string offset 'en'
</code></pre>
<p>You're trying to access a string with the offest <code>en</code>. Just like you would access an array. Except strings aren't going to support named keys...</p>
<p>I assume you're ex... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Firebase App Distribution - "Waiting for developer" message<p>I'm developing an iOS application and using App Distribution to distribute my test releases to ... | <p>I had the same problem when tried to add device for Firebase Testing.
I made all instructions from Firebase troubleshooting.</p>
<blockquote>
<p>If you're installing an Ad Hoc distribution, the Waiting for developer
button appears when the developer hasn't yet configured their app to
run on your test device. To make... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to echo/print within a fuction with undefined variables in php?<p>I am not the best at php but currently I am trying to learn. I can print fine outside o... | <p>You can echo anything you want within the function but it won't show up until you call the function.</p>
<pre><code><?php
if (isset($_POST['CalcBT'])) {
global $area;
function calculateCircumference () {
$num1 = ($_POST['Length']);
$num2 = ($_POST['Width']);
$circ = $num1 + $num2;
// re... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Grails domain classes are not persisted in database<p>I have seen a strange issue in grails2.3.7 version. I have around 15 domains classes in my project, all... | <p>I have used the domain class field name as "group". I think group is a reserved word in database.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Validating and Correcting JSON data during or after deserialization<p>I have been agonizing over this problem for a few days now and have no hope left. I'm s... | <p>you can deserialize the json to <code>JObject</code> and than load it your self</p>
<pre><code>public class RootObject
{
public RootObject(JObject obj)
{
Title = obj["Title"].ToString();
var year = obj["year"].ToString();
Year = year == "N/A" ? 0 : int.Parse(y... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Displaying an URL from a different view controller in a UIWebView<pre><code> RecipesTableViewController.m
#import "RecipesTableViewController.h"
#... | <p>Skyler's answer's heading in the right direction, but it's missing a few critical pieces...</p>
<p>Yes, you need to pass the web url string in <code>prepareForSegue:</code> like he's suggesting, i.e.</p>
<pre><code>- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if([segue.identifier isE... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
erlang race condition of spawn and receive<p>I am learning erlang with book , In chapter 13, the first exercise is writing a function my_spawn, which catch e... | <p>The first thing the function on_exit does is to spawn a process that set the process_flag trap_exit to true, thus it is "protected" from crashes, and will receive instead messages of the type: <code>{'EXIT', Pid, Why}</code>.</p>
<p>On the next line it tries to link itself to Pid; 2 cases are possible:</p>
<ul>
<l... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it safe to convert function parameter `const char*` to `std::string_view`?<p>The title almost says it all.</p>
<pre><code>void f(const char*)
</code></pr... | <blockquote>
<p>Is it safe?</p>
</blockquote>
<p>Yes, it is safe, in so far as it is correct. If someone gives you garbage you'll still have garbage.</p>
<blockquote>
<p>what are the pitfalls?</p>
</blockquote>
<p>As you've said, <code>std::string_view</code> need not be null terminated. If you are going to ne... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Array formula to switch selection<p>I am trying to determine the top 3 depending on the selected criteria, amount or count. User can choose between the two. ... | <p>You could combine it into one (non-array) formula. Here is a simple example which perhaps you can adapt to your situation.</p>
<p>This is the formula in J7. Change the 2 in J2 to 1 and it will return the largest value in E rather than F.</p>
<p><code>=INDEX(OFFSET($E$3:$E$35,,J2-1,,),MATCH(1,INDEX((OFFSET($E$3:$E$... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to filter tr last child and not first child<p>See the example below. Is it possible to apply the bottom border to the <code><tr></code> in the <cod... | <p>You could use a combination of the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/:not" rel="nofollow"><code>:not()</code></a>/<a href="https://developer.mozilla.org/en-US/docs/Web/CSS/:only-child" rel="nofollow"><code>:only-child</code></a> pseudo classes to prevent the element from being selecting if it... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Best practices to use Magento rest & soap web API together for android<p>I am working on Magento based m-commerce android app. In which I have to use both RE... | <p>In my experience Magento SOAP API is too slow, So you can select REST and try to add extra features to Magento REST API by rewriting the modules. Here is a sample tutorial for do
<a href="http://web.archive.org/web/20130512072025/http://magepim.com/news/Extending-the-Magento-REST-API-part-1_13" rel="nofollow norefer... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Changing type without changing bits<p>I want to take a stack variable and <code>reinterpret cast</code> it into an unsigned integer type of the same size in ... | <p>If you don't want to have undefined behavior due to violating the aliasing restrictions (C++11 3.10/10) then you need to access the object representations as characters:</p>
<pre><code>template <typename T>
int_type<T> caster(const T& value) {
int_type<T> v;
static_assert(sizeof(value)... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In R: Group the sequence of events based on their ID and calculating the time difference between the first and last seen event<p>In the data frame below, I h... | <p>We could change the column <code>timestamp_start</code> and <code>timestamp_end</code> to <code>POSIXct</code> type, <code>group_by</code> <code>segment_id</code>, <code>first_event</code> and <code>second_event</code>, get <code>first</code> <code>timestamp_start</code> and <code>last</code> <code>timestamp_end</co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Exclude mmenu in IE8<p>As mmenu does not support IE8, I'd like to stop it from doing anything in it. That way I can apply a different menu for IE8 only. </p>... | <p>I've found the solution for this.. </p>
<p>I wrapped it in the following code. </p>
<pre><code>if ((document.documentMode || 100) > 8) {....};
</code></pre>
<p>Reference: <a href="https://stackoverflow.com/a/2202545/2440296">https://stackoverflow.com/a/2202545/2440296</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
After changing my .htaccess file, my POST method on my php no longer works<p>I recently did some research to find out how to modify my .htaccess file to hide... | <p>With external redirection POST data isn't redirected and is lost. Replace your <code>.php</code> rule by this:</p>
<pre><code># Redirect external .php requests to extensionless url
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{THE_REQUEST} /.+?\.php [NC]
RewriteRule ^(.+?)\.php$ /$1 [R=301,L,NE]
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ui-router controller or angular controller<p>I am using ui-router for routing my app. On ui-router I can define controller like </p>
<pre><code>myApp.config... | <p>'What's more common' is a very broad question, but.</p>
<p>There are few things to consider:</p>
<ol>
<li>What type of state and how nested is it (If its a nested state that only displays a bulk of data that's might be fine)</li>
<li>How large the controller is? (2-3 lines of logic can be handled inline)</li>
<li>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
native.createnavigator factory is not a function<p>I am going to design a Drawer navigation in my project.</p>
<blockquote>
<p>I installed that by this co... | <p>I don't understand what you're trying to do now. I think you want to add a drawer Navigator.</p>
<p>Your problem is you have to use one container, but you have two, and createStackNavigator has two parameters, but you have three.</p>
<blockquote>
<p>createStackNavigator(RouteConfigs, StackNavigatorConfig);</p>
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
undefined method for #<#<Class:0x007f05d8ec12d0>:0x007f05d8fa9be8> in Rails<p>Hello I am beginner to ruby on rails and I am making a form for taking student'... | <p>You don't have a route for userinfos.</p>
<p>try adding in your config/routes.rb: </p>
<p><code>resources :userinfos</code></p>
<p>I hope this help.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rendering a component in JSX vs via function<p>When using React, what is the difference (and when should each method be applied) when rendering a component?<... | <p>(<strong>Note:</strong> The OP has now changed the question, it used to have <code>return {this.getComponent()}</code> in Method 1.)</p>
<p><code>render</code> in Method 1 is incorrect <em>(well, it was before the edit)</em>, it should be:</p>
<pre><code>render() {
return this.getComponent() // No {} wrapper
}
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Max memory usage of different process in a single bash file<p>I am wondering if there is any way to compare the peak memory usage of different process in bas... | <pre><code>/usr/bin/time -f "process 1 max RSS %M kbytes" ./program1 parameterSet1
/usr/bin/time -f "process 2 max RSS %M kbytes" ./program2 parameterSet2
</code></pre>
<p>Will put the maximum resident set size on stderr for the program. You can tailor the format string (as I did) or redirect outputs to trace each sep... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mac Node-webkit menu<p>I am trying to create a menu for a mac node-webkit app. I am trying to append a preferences menu item to the first/root menu(app name... | <p>I solved this with the following code. It was just a matter of rooting around and finding the right menu to append or insert to. I used the menu to open a modal that has user preferences in it.</p>
<pre><code>var gui = require('nw.gui');
// Create menu container
var Menu = new gui.Menu({
type: 'menubar'
});
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is a service mesh?<p>In the context of cloud computing, backend developers frequently refer to building (or using) "service mesh" but I don't fully unde... | <p>In a distributed application, each part of the application is called a microservice and is assigned a very basic task to do. This can be "return profile information" or even smaller one.</p>
<p>All these microservices need to talk between each other to make up the entire application. That is exactly what a service ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Group by array using multiple values and sum of array based on group values in loop and sorting array<p>I want to group array values and find total (sum of a... | <p>If this is the result of a database query, this could almost certainly have been done more efficiently in that query. However, you can get the results you want in 3 stages:</p>
<ol>
<li>group input data by person and type</li>
</ol>
<pre><code> $arr = array();
foreach ($data as $key => $item) {
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
movetothread is in accessible<p>I have the following class:</p>
<pre><code>class commMonitor : QObject
{
Q_OBJECT
public:
commMonitor();
~commMo... | <p>In C++ <code>class commMonitor : QObject</code> means private inheritance (by default), so you can't use public members in your case. I hope you are familiar with inheritance rules. If no, <a href="https://stackoverflow.com/questions/860339/difference-between-private-public-and-protected-inheritance">see this quest... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Playing Audio on iOS from Socket connection<p>Hope you can help me with this issue, I have seen a lot of questions related to this, but none of them really h... | <p>I solved this in the end, see my answer <a href="https://stackoverflow.com/questions/28340738/playing-raw-pcm-audio-data-coming-from-nsstream/30318859#30318859">here</a></p>
<p>I intended putting the code here, but it would be a lot of copy pasting</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Url Rewrite => Internal Server Error<p>I am getting internal server errors every time i implement this code for mod-rewriting in my .htaccess file:</p>
<pre... | <p>Your rule is causing an infinite loop because it's rewriting all requests ending in <code>.php</code>. This includes <code>index.php</code> too and so it ends up rewriting it to <code>index.php</code> again and again and so on..</p>
<p>Just add a condition to your rule that excludes it.</p>
<pre><code>RewriteEngin... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
X axis and right box in stacked bars<p>In a plot like this</p>
<pre><code>library(ggplot2)
df <- data.frame(class = c("a","b","a","b"), date = c(2009,200... | <pre><code>ggplot(df, aes(x = date, y = volumnep, fill = class, label = volumnep)) +
geom_bar(stat = "identity") +
geom_text(size = 3, position = position_stack(vjust = 0.5)) +
coord_flip() +
theme(legend.title=element_text(size=22),
legend.text=element_text(size=22)) +
scale_y_continuous(breaks=c(0,2... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spring @ContextConfiguration fails to load test context from different project<p>I am writing Integration tests from my repository project that needs to load... | <p>It sounds like a test-specific <code>@Configuration</code> class from another project is not visible on the classpath. For example, if your <code>InfraTestsContextConfiguration</code> is not in the <em>main</em> source code folder, then it may not be visible. So, the solution is to make them <em>visible</em>, and th... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Changing data type does not fix loading error<p>When this dxp was originally created, the data type for one column was automatically chosen to be integer. At... | <p>Replace the data source with the same data source but when previewing the data change the type to string. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make a call to users graph API from Azure Devops Server<p>The following works for me for Azure Devops Services (cloud):</p>
<pre><code>curl ... https... | <p>This API doesn't support yet Azure DevOps Server:</p>
<p><a href="https://i.stack.imgur.com/m0LK5.png" rel="noreferrer"><img src="https://i.stack.imgur.com/m0LK5.png" alt="enter image description here"></a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
(C++) should'nt this dynamic_cast retrieve the derived class<p>after reading <a href="https://stackoverflow.com/questions/332030/when-should-static-cast-dyna... | <p>For <code>dynamic_cast<></code> to work, the object needs to have a vtable. Otherwise, there is no indication within the object to which dynamic class it belongs.</p>
<p>A vtable is added to a C++ class if, and only if that class contains at least one virtual function.</p>
<p>So, add at least one virtual fun... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# Enum validate from list of values<p>I saw somewhere (cannot find it anymore) that you can check the existence of an enum value from an enum item with a sp... | <p>You have to use the <a href="https://msdn.microsoft.com/en-US/library/system.flagsattribute%28v=vs.110%29.aspx" rel="nofollow">FlagsAttribute</a> :</p>
<pre><code>[Flags]
public enum TestEnum01
{
doc = 1,
txt = 2,
xls = 4,
csv = 8,
unknown = 5,
Available = doc | xls | csv
}
</code></pre>
<p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Celery autodiscover_tasks not working for all Django 1.7 apps<p>I have a Django 1.7 project with Celery 3.1. All the apps in my Django project work with the ... | <p>This is discussed in a number of Celery issues, such as <a href="https://github.com/celery/celery/issues/2596">#2596</a> and <a href="https://github.com/celery/celery/pull/2597">#2597</a>.</p>
<p>If you are using Celery 3.x, the fix is to use:</p>
<pre><code>from django.apps import apps
app.autodiscover_tasks(lam... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
wxPython Swap Images<p>I have been trying to swap 2 pictures in a list. I am adding the list to a GridSizer of 1 row and 2 cols. I have one horizontal BoxSiz... | <p>I quite do not understand what <code>self.ic</code> is supposed to be (a list of <code>wx.StaticBitmap</code> instances or a list of <code>wx.Bitmap</code> instances). You seem to mix up the both. A <code>StaticBitmap</code> is a <code>wxPython</code> widget, a <code>wx.Bitmap</code> is, well, just a data structure ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Oracle SQL run batch<p>So what we trying to do is create a procedure that execute a batch file.</p>
<p>We been messing around with job instruction, but it s... | <p>When I compare your example with the one from the docs <a href="https://docs.oracle.com/cd/E11882_01/server.112/e25494/scheduse.htm#CHDJHBAH" rel="nofollow noreferrer">https://docs.oracle.com/cd/E11882_01/server.112/e25494/scheduse.htm#CHDJHBAH</a>: </p>
<pre><code>BEGIN
DBMS_SCHEDULER.CREATE_JOB(
job_name ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R build lists over links between data frame rows<p>I have the following data frame:</p>
<pre><code> current_session next_session
1 811 ... | <p>If your <code>data.frame</code> is small you can stick with loops, otherwise you can use <code>igraph</code> package and build a graph of your sessions and get the connected components of the graph, i.e. :</p>
<pre><code>library(igraph)
# create a graph, edges are current_session --> next_session
g <- graph.... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Inno Setup - File in use, disallow skip/cancel<p>I have configured "Inno Setup" as needed, but there is one point which I'm not able to modify.</p>
<p>We ha... | <p>I do not think you can alter that message box.</p>
<p>There are two alternatives:</p>
<ul>
<li><p>You can delete the target file using your own code before installing the new version, not allowing to proceed until the file is gone.</p>
<pre class="lang-pascal prettyprint-override"><code>[Files]
Source: "Source: "... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spring Boot REST API using LDAP authentication<p>So I'm trying to build a REST API that will use LDAP authentication. Basically, when my login endpoint is co... | <p>This can actually be accomplished pretty succinctly with Spring Boot.</p>
<p><strong>pom.xml</strong></p>
<pre class="lang-xml prettyprint-override"><code><?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://w... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laravel - Set model connection with Auth::user()<p>In my project every user has his/her database and I have defined the connection on config/database.php. So... | <p>Solved the problem via middleware.</p>
<pre><code>public function handle($request, Closure $next, $database)
{
// check witch database connection to use
switch ($database) {
case 'self':
// Set the User Database Connection
DB::setDefaultConnection(Auth::user()->database);
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Load Background image in css by JSF<p>This is my css file <code>registrationStyle.css</code>:</p>
<pre><code>body{
background-image: url("#{resources['i... | <p><code>h:outputStylesheet</code> is for loading CSS files, to include an image file inside your JSF page you should use the <code>h:graphicImage</code> Tag like this:</p>
<p><code><h:graphicImage name="blue.jpg" library="images"/></code></p>
<p><strong>Update:</strong></p>
<p>In order to load a background Im... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Disable Button when input is empty in react<p>so I'm new at react and I have this problem when I want to disable Button when input is empty in react it only ... | <p>You could just do it like</p>
<pre><code> <form onSubmit={this.props.addCourse}>
<input onKeyUp={() => success()} id='id' value={this.props.value} type='text' onChange={this.props.updateCourse} />
<button disabled={this.props.value === ""} id="button" type='submit'... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
11 g client SQL*loader: insert datetime is not working<p>I have the following data </p>
<blockquote>
<p>85566186;DATACONTRACT;1;0;-0.0235;0.6361;0.4448;59... | <p>I found the solution. There were two problems in my code. 1st is I was using FLOAT/DOUBLE but DECIMAL EXTERNAL was required (<a href="http://psoug.org/reference/sqlloader.html" rel="nofollow noreferrer">link</a>)</p>
<p>2nd problem was with the format of decimal (always a catch with regional settings). I used the fo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I have problems implementing the ++ increment operator<p>I am trying to provide a c++ interface for a c library I just finished, and I want it to be possible... | <p><code>operator++()</code> is the prefix increment operator. Implement the postfix operator as <code>operator++(int)</code>.</p>
<p>The canonical implementations are have the prefix operator return a reference and the postfix operator return by value. Also, you would typically implement the postfix operator in terms... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
License game Java loop crash<p>In California every car license plate contains 3 letters. We have a game where the objective is to make a word of the letters.... | <p>This is bad:</p>
<pre><code>while(letters.length() <= 3){
String line = rd.readLine();
// Finds the words that follow the game rules
if(line.indexOf(one) != -1 && line.indexOf(two) > line.indexOf(one) && line.indexOf(three) > line.indexOf(two)){
println(line);
} ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
No route match even when route is defined<p>I have just started working in rails.
I have a controller that redirects to another controller to send an email f... | <p>I think <code>Verify</code> (singular) as a controller name won't easily be mapped by <code>resources</code>, instead just add a custom match</p>
<pre><code>get '/verify/sendmail', to: 'verify#sendmail', as: :verification_mail
</code></pre>
<p>Then do</p>
<pre><code>redirect_to verification_mail_path
</code></pre... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
adding the user to a many to many field upon creating a model<p>Good day, I am trying to create a viewset whereby when a showcase is created, the user gets a... | <p>I think this could be an alternative, instead of overwriting <code>perform_create</code>, overwrite <code>create</code></p>
<pre><code>class showcaseCreateViewSet(generics.CreateAPIView):
queryset = Showcase.objects.all()
serializer_class = ShowcaseSerializer
permission_classes = [IsAuthenticatedOrReadO... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
error in build.gradle.kts script using extra property<p>below is a small (build.gradle.kts) script which gives at line 9 (the classpath line) the error : <em... | <p>This works for me: </p>
<pre><code>buildscript {
extra["kotlin_version"] = "1.3.61"
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.5.3")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${extra["kotlin_version"]}")... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Instance of class in constructor<p>I'm not sure with my approach. A have two classes and call functions of first class in second class like this:</p>
<pre><... | <p>You can use dependency injection in <code>B</code> class. That approach helps you mocking classes in test.</p>
<pre><code>class B {
private $aClass;
public function __construct(A $a) {
$this->aClass = $a;
}
public function bClassFunction() {
$test = $this->aClass->aClassF... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Array.toString returns empty outside of loop<p>I am new to JavaScript so sorry if this is a stupid question or duplicate.</p>
<p>I have an Array and Loop, w... | <p>You may use <code>.then()</code>; quoting from the <a href="https://docs.cypress.io/api/commands/then.html#Syntax" rel="nofollow noreferrer">cypress documentation for <code>.then()</code></a>:</p>
<blockquote>
<p><code>.then()</code> is modeled identically to the way Promises work in JavaScript. Whatever is retur... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Nodejs Server, get JSON data from Python in html client with Ajax<p>I need to get data (json) in my html page, with help of Ajax. I have a Nodejs server serv... | <p>As I understand:</p>
<p>You have a server running</p>
<ul>
<li>an app that acts as a webserver, made with nodejs.</li>
<li>another app in python that does not expose an HTTP api, but you would like to interact with it in some way?</li>
<li>You have control over the source code of both</li>
</ul>
<p>When running b... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mysql Column 1 NOT LIKE Column 2<p>I need to find all rows where url does not contain the value from stripped_url.</p>
<p>
I tried the below query but it doe... | <p>For instance use <a href="http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_instr" rel="nofollow">INSTR()</a></p>
<pre><code>SELECT * FROM url
WHERE instr(url, stripped_url) = 0
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
create array of Label using FXML in JavaFX<p>Actually, I want to create a navigation list using Labels in Javafx. I can assign fx:id to each label and create... | <p>Some things are just better done in Java than FXML. I would not create the labels in FXML at all in this scenario; just create the pane that is going to hold them, then create the labels in the controller and add them to the pane.</p>
<p>That said, it can be done the way you are asking, using <a href="http://docs.o... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Show hidden data with mouseover in a particular colum of Jqgrid<p>how can display items of a hidden colmodel when mouse over another column which shows only ... | <p>If I correctly understand the problem you can solve it by usage <code>cellattr</code> callback which defines <code>title</code> attribute based on the value of another (hidden) column. See <a href="https://stackoverflow.com/a/7408355/315935">the answer</a> for the corresponding code example.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to close current user Control and open new User control in WPF inside user control<p>I am new in WPF application i have to develop app with user control,... | <p>I am not a pro, but this should work:</p>
<p><strong>MainWindow.cs</strong></p>
<pre><code> public static Window Current;
private Header _Header;
private Visitor _Visitor;
private Control _currentUser;
public MainWindow()
{
Current = this;
InitializeComponent();
_He... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SELECT posts, its last 3 comments and count of all comments<p>SELECT posts, its last 3 comments and count of all comments
My code:</p>
<pre><code>SELECT p.*... | <p>You need a timestamp or counter of something to determine which comments are the three you want. Add that column name between the angle brackets below.</p>
<pre><code>SELECT p.*, u.id, u.username username, u.usersurname usersurname, u.usermainphoto userphoto, GROUP_CONCAT(c.text SEPARATOR 'a!k@h#md%o^v&') comme... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to check if toggle function show item?<p>I have this code ...</p>
<pre><code><div class="btn1">Button</div>
<div class="text1">Some te... | <blockquote>
<p>1) see this <a href="http://jsfiddle.net/a6kqvLj8/" rel="nofollow">http://jsfiddle.net/a6kqvLj8/</a></p>
<p>Just make the second block <code>diaplay:none</code>, and do the same operations
on it</p>
</blockquote>
<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-cod... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
While iterator in Java<p>I'm experiencing an anomaly in java that i can't wrap my head around.</p>
<p>In my main class i have the following code:</p>
<pre>... | <p><a href="http://docs.oracle.com/javase/8/docs/api/java/util/Scanner.html#nextInt--"><code>Scanner#nextInt</code></a> <strong>doesn't</strong> consume the <code>'\n'</code> character (the enter key you hit after you insert an <code>int</code>), scenario:</p>
<pre><code>>>> How many names do you want to ente... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
npm 404 Not found, well known package<p>Trying to install 7zip-bin package using npm, bring this error:</p>
<pre><code>npm ERR! code E404
npm ERR! 404 Not F... | <p><a href="https://github.com/yarnpkg/yarn/issues/7902#issuecomment-584890654" rel="nofollow noreferrer">reference</a> to github yarn <a href="https://github.com/yarnpkg/yarn/issues/7902" rel="nofollow noreferrer">issue#7902</a></p>
<p>add <code>registry=https://yarn.npmjs.org</code> to file <strong>~/.npmrc</strong>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Login Check with Active Directory + SSL<p>I am working on a requirement where I need to validate user with active directory account.
For this I have used <s... | <p>Both of those should work just fine, as long as you specify the LDAPS port (usually 636). So your <code>ldapServerIp</code> variable should be set to something like <code>example.com:636</code>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Thousand seperator - format excel cell using XLConnect and R<p>I export tables with large values to .xlsx using XLConnect.</p>
<p>Is there a way for the res... | <p>Use # for a digit placeholder:</p>
<pre><code>setDataFormat(cs, format = "###,###.00")
</code></pre>
<p>or </p>
<pre><code>setDataFormat(cs, format = "###,##0")
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Does F# have the ternary ?: operator?<p>I'm learning F# coming from C# and I've just tried compiling an expression like</p>
<pre><code>let y = Seq.groupBy (... | <p>Yes, it's called <code>if .. then .. else </code></p>
<p>In fact in F# everything is an expression, even an <code>if .. then .. else </code> block.</p>
<p>In C# <code>var x = true ? 0 : 1; </code></p>
<p>In F# <code>let x = if true then 0 else 1</code></p>
<p>So in your case:</p>
<pre><code>let y = Seq.groupBy ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
When do MessageBoxes not act modally?<p>I have always thought MessageBoxes were sort of like break points -- they stopped a program from executing until the ... | <p>The message box is modal. But in order to service its GUI it runs what is known as a modal message loop. That message loop pulls dispatches synchronous messages, and also processes asynchronous messages. Like <code>WM_TIMER</code>. And that latter fact is what means that your timer continues firing.</p>
<p>You call... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it compulsory for app to support all iPad devices<p>I developed it only for iPhone but Apple has this rule that iPhone app must support iPad. Therefore, I... | <p>It isn't compulsory, you can set your app only for iPhone devices and you can install it in iPad too. The only thing is that the appearance of your app in iPad devices going to be similar than in iPhone devices.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to enable transparent on screen keys in app on Android Lollipop?<p>I saw this in a flashlight app on my nexus 5 the other day running Lollipop, and I now... | <p>In your theme add the following line:</p>
<pre><code><item name="android:windowTranslucentNavigation">true</item>
</code></pre>
<p>Check out iosched(I/O 14) app in github which describes the API to use. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add a text file or xml content to a TFS WorkItem description in Powershell?<p>I want to add some description in a TFS Workitem using powershell.
I wro... | <p>All of your content is added, however as it is an HTML box it is not rendered and disappears.</p>
<p>You need to HTML encode your xml before adding it to the description field.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to show dropdown list in the @Html.EditorFor() when user clicks on the text input box<p>I am passing data from the Controller to the View using the ViewD... | <p>The <code>Html.EditorFor()</code> method always creates an <code><input></code> element, though the <code>type</code> attribute can vary depending on the model property type. HTML5 actually supports exactly what you want with the <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/datalist" rel=... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to merge this functionality with argparse?<p>I have this functionality:</p>
<pre><code>import codecs
from sklearn.feature_extraction.text import TfidfVe... | <p>This is the simplest way to get started alongside with the <a href="https://docs.python.org/2/howto/argparse.html" rel="nofollow"><code>argparse</code> tutorial</a>:</p>
<pre><code>import argparse
import codecs
from sklearn.feature_extraction.text import TfidfVectorizer
parser = argparse.ArgumentParser()
parser.ad... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Updating StringGrid from Thread<p>Work is done in a number of threads and a TListView is updated from these threads. They each have a reference to their asso... | <p>TStringGrid in Delphi does not have sorting capabilities in which case you would have to sort it manually and as such you will be able to keep a list of which cell belongs to which thread. Easy.</p>
<p>With TMS TAdvStringGrid you can use the OnRawCompare event to do the comparison of each cell to do a manual sort w... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unicode Character Not Reading - C++<p>I have a simple piece of code that opens a file stream & prints out stuff.
As soon as it hits a unicode character,... | <p>It's reading fine, it's just not writing.</p>
<pre><code>std::wcout << (wchar_t)fin.get() << "\n";
</code></pre>
<p>Unfortunately <code>std::wcout</code> doesn't actually reliably get Unicode to a terminal.</p>
<p>Although the Windows terminal works natively in UTF-16 code units, <code>std::wcout</cod... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Issue converting legacy pipeline to modern openGL<p>I am in the process of converting an openGL ver 1.0 application to a more modern version. I am stuck on ... | <blockquote>
<p>[...] is there a way to combine all of the data and send it as a single call?</p>
</blockquote>
<p>If you want to render multiple <a href="https://www.khronos.org/opengl/wiki/Primitive#Line_primitives" rel="nofollow noreferrer"><code>GL_LINE_LOOP</code></a> primitives with on draw call, then I recomm... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Save Spinner with SharedPreferences in fragment (OnItemSelectedListener)<p>I am new to Android programming and at the moment I am trying to make some spinner... | <p>You are saving the value at the right place but restoring it at the wrong place. What is the purpose of doing </p>
<pre><code>String savedValue=PreferenceManager
.getDefaultSharedPreferences(getActivity().getBaseContext()) //context
.getString("savedValue","");
for(int i=0; i<4; i++)
if(savedValue.equals(s... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
initiallizing float array C<p>I work in Code Composer Studio Version: 6.0.1.00040 with the card LCDK C6748.</p>
<p>but I think it's a general C question.</p... | <p>Nothing wrong in the given code. See the code example below</p>
<pre><code>#include <stdio.h>
#define BUFF_NOISE_SIZE 10
float prn_buff[BUFF_NOISE_SIZE]={0}; // Global array of floats
int main()
{
int i;
for(i=0;i<BUFF_NOISE_SIZE;i++){
printf("%f \n",prn_buff[i]);
}
return 0;
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SAS reporting totals<p>I have a dataset that looks somewhat similar to the example below:</p>
<p>ID Year College Dept Deg Status</p>
<p>12 2014 ... | <p>Assuming X, Y, and Z are supposed to be counts, <code>proc sql</code> works great for this sort of thing. Below, four columns are defined in the <code>select</code> clause. The first column is <code>year</code>. The second column, <code>sum(status='applied')</code>, counts the number of rows where the expression <co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MATLAB produces different result than CUBLAS + Kernel<p>I have the following MATLAB code :</p>
<pre><code>[N, d] = size(X); % data size and dimensions
R = ... | <p>Your MATLAB code uses double point precision so the result is more accurate. In contrast to that, CUDA kernel you provided uses single point precision, type <code>float</code>, and therefore produces less accurate result. And as usually when facing single vs. double point precision issue, the problem only gets worse... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to Change ASP.NET Core's Built-In Web-Server (Kestrel) Default IP Binding, from 127.0.0.1 to 0.0.0.0?<p>I Installed <code>.NET Core SDK v3.1</code> on an... | <p>The <code>launchSettings.json</code> is only really meant to be used for development purposes. At that time, you are usually developing only locally and are not looking for external devices to access your server. That’s why the default on the loopback interface makes sense.</p>
<p>For production or general non-deve... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
WPF and Squirrel deployment on Azure<p>I have an application written in WPF (C#) and I deploy this application using Squirrel:</p>
<pre><code>https://intell... | <blockquote>
<p>How to make deployment using Squirrel on Azure?</p>
</blockquote>
<p>Reading the documentation <a href="https://github.com/Squirrel/Squirrel.Windows/tree/master/docs" rel="nofollow noreferrer"><code>here</code></a>, it seems there's no direct way to deploy your files in Azure Storage at least as of a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to join six tables and fetch data from six table in sql?<p>hi i have 6 tables from that i want access data.and display it in one table.the tables are</p>... | <p>Try this</p>
<pre><code>SELECT * FROM (
SELECT * FROM t1
UNION ALL
SELECT * FROM t2
UNION ALL
SELECT * FROM t3
UNION ALL
SELECT * FROM t4
UNION ALL
SELECT * FROM t5
UNION ALL
SELECT * FROM t6
) AS Total
WHERE NAME... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
NSURL with string relative to URL returning unexpected result<p>This is the call I am making:</p>
<pre><code>NSURL *url = [NSURL URLWithString:@"rooms" rela... | <p>You are missing a <code>scheme</code>. <code>NSURL</code> seems to interpret the <code>localhost:</code> part as scheme, which causes unexpected behaviour. In case of <code>http</code> you should try this:</p>
<pre><code>NSURL *url = [NSURL URLWithString:@"rooms" relativeToURL:[NSURL URLWithString:@"http://localhos... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how do I customize dialog to the detail page of an answer set?<p>In a dialog file like</p>
<pre><code>dialog (Result) {
match: Content (this)
template(... | <p>You can add this setting to your capsule.bxb file. </p>
<pre><code>runtime-version (2) {
overrides {
allow-dialogs-on-detail-pages (true)
}
}
</code></pre>
<p>In your result-view, you can define your details dialog in the message section. For example: </p>
<pre><code> message {
// A single resul... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Monitor progress of executable so it can be reported on webform<p>I've recently been looking into taking a legacy building analysis program and giving it a f... | <p>To make something like a progress bar that doesn't affect the performance of your code, you can do something like this.</p>
<ol>
<li><p>Create global variables in a module</p>
<pre><code>module progress
implicit none
real*8 :: progress_value = huge(1.d0)
integer :: progress_bar(2) = (... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MongoDB: update from ObjectId to string for many documents<p>I have a complex structure similar to:</p>
<pre><code>{
type: "Data",
data: [
"it... | <p>You may use this workaround:</p>
<pre><code>db.collection.aggregate([
{
$addFields: {
"data.content": {
$map: {
input: "$data.content",
as: "data",
in: {
otherStructure: {
testData: {
keys: {
$map: {
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Django mysql query only returns first column<p>I have a small test app i am working on and at the moment no matter what i do query wise the object only ever ... | <blockquote>
<p>So at the moment i am unsure why i am only receiving the first column of the query object and not the whole row.</p>
</blockquote>
<p>You <strong>do not</strong> receive only the first column. It simply <em>prints</em> the first column. Why? Because you instructed that in your <code>__str__</code> im... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Swift: Formatting currencies with localized million and billion text<p>I'm working on an app that shows currencies with large numbers.
To make it more user ... | <p>You will have to implement your own solution, but it is not hard. One way to go would be to create two dictionaries where the key will be the Locale identifier and the value the translation:</p>
<pre><code>let millionTrans = [ "en_US" : "million", ...]
let billionTrans = [ "en_US': "billion", ...]
</code></pre>
<p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Does it change anything to write one semicolon or more at the end of a line in C++<p>like in this case:</p>
<pre><code>void function(){
...
uint8_t type = s... | <p>It can affect things. For instance, this if statement is ill-formed</p>
<pre><code>if(foo())
bar();;
else
baz();
</code></pre>
<p>The extra semi-colon introduces an empty statement. The statement does nothing, but it breaks the association of the <code>else</code> to the <code>if</code>. Naturally, it's common... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.