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:
Unable to compare two instances of opaque types<p>It's interesting to see that we can now declare return values that are protocols with associated types.</p>... | <p>When you declare a function to return <code>some Plant</code> then the compiler will look at the content of the function to see what real type is returned and in your example you are returning different types, <code>Rose</code> and <code>Orchid</code>.</p>
<p>This breaks the requirement from <code>Equatable</code> t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Firebase Anonymous Auth (Android): Lifetime?<p>I'm thinking about using anonymous login in one of my apps as I don't really need to know anything about the u... | <blockquote>
<p>What is the "lifetime" of the anonymous account?</p>
</blockquote>
<p>An anonymous user looses his account if the option to log-out is available or if the user uninstalls the app. So you can use Firebase anonymous aAuthentication to create and use <strong>only</strong> temporary anonymous accounts to... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find closest value above current row that meets condition and apply function for each group<p>I want to do a simple calculation for each row by group, but I ... | <pre><code>df %>%
group_by(name) %>%
mutate(t = na_if(lag(value * (tag == 'Y' & !is.na(code))), 0)) %>%
fill(t) %>%
mutate(results = t * value)
# A tibble: 8 x 7
# Groups: name [2]
name id tag code value t results
<chr> <int> <chr> <dbl> <dbl>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating play/pause functions with current audio javascript<p>I have an extension for chrome I am working on, I have an HTML popup that has buttons that play... | <pre><code>var audios= Array.prototype.map.call(document.getElementsByClassName("myButton"),function(el){
var audio=new Audio();
audio.preload="none";//=> not preloaded
audio.src="mp3/"+el.id+".mp3";
el.onclick=audio.play.bind(audio);
return audio;
});
</code></pre>
<p>Simply iterate over your b... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to handle the padding when brush moving<p>I encountered a problem when using d3.brush.<a href="https://i.stack.imgur.com/17sNt.png" rel="nofollow norefer... | <p>See this example: <a href="https://bl.ocks.org/mbostock/4015254" rel="nofollow noreferrer">Zoomable Area</a></p>
<p>You can define a <code>clipPath</code> to crop the graph to the area you wish. Code from the example:</p>
<pre><code>var areaPath = g.append("path")
.attr("clip-path", "url(#clip)")
.attr("fi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sorting a singly linked list by changing the value of elements<p>According to my assignment, I need to sort the elements of a single linked list in two ways.... | <p>You are confusing the <em>sorting algorithm</em> with the <em>swap method.</em></p>
<p>To sort a list, you can use the bubble sort algorithm, the insertion sort algorithm, or any of many others.</p>
<p>But no matter what algorithm you use, sorting will involve <em>changing the order</em> of elements in the list. How... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
"The operation couldn’t be completed. Device was allocated but was stuck in creation state." (Xcode 13 iOS simulator on external device)<p>In order to save s... | <p>Ended up simply moving all the simulator stuff back onto my local drive anyway and the problem disappeared. Not sure why Xcode complains when the simulators aren’t on the system drive though.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Zoom in IE breaks adjacent elements<p>I have several adjacent elements that I calculate their position according to another element on the page.<br>
The elem... | <p>I ended up changing the opacity of the divs to 100%, making them overlap each other and putting all of them in a new div with opacity 50%.
It solved the issue :)</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
static varibale cant be changed from a thread<p>in the below code, I create the class FMSHandler to process a string value passed to it from the main method ... | <p>You should declare the <code>sIsProcessing</code> variable as <code>volatile</code> or use an <code>AtomicBoolean</code>. </p>
<p>Also, currently, a lot of the messages passed to <code>process(...)</code> will be skipped, I'm not sure if that is your intention.</p>
<p>If you want to prevent messages from being ski... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Populate DataGrid using SqlDataReader with null<p>I use <strong>SqlDataReader</strong> to write database rows onto <strong>DataGrid</strong> in a while-loop ... | <p>Calling <a href="https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.isdbnull(v=vs.110).aspx" rel="nofollow noreferrer">IsDBNull</a> on the column will allow you to check for null values:</p>
<pre><code>Column01 = rdr.IsDBNull(0) ? "EMPTY" : rdr.GetInt32(0).ToString();
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Bigcommerce Creating new variation product via API<p>How does one go about creating a new product with variations via the API?</p>
<p>Let's say I want to cr... | <p><a href="https://i.stack.imgur.com/5g3I3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5g3I3.png" alt="enter image description here"></a></p>
<p>Hopefully this helps clarify some of the workflow for how you create variants for something like small, medium, large, and red, blue, green. Colors ar... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to check if a button is clicked after 2 secs?<p>I have an android app which sends likes to the server.</p>
<p>What i want to do is not to send a like to... | <p>Try this approach:</p>
<pre><code>boolean isReadyToPost= false;
boolean liked = false;//control like click (witch)
public void onLikePressed() {
if (liked && isReadyToPost) {
sendLikeToServer();//send to server after 2 secs
return;
}
this.isReadyToPost= false;
Toast.makeText(this, "waitin... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MySql Pivotal table query group by multiple columns<p>The below MySQL table looking something like this below.</p>
<pre><code>consulted_on (DATE) consulte... | <p>Please use Below query: </p>
<pre><code>SELECT
consulted_on,
SUM(CASE WHEN (consulted_by='Mr.Bob') THEN 1 ELSE 0 END) AS Mr_Bob,
SUM(CASE WHEN (consulted_by='Mr.Jhon') THEN 1 ELSE 0 END) AS Mr_Jhon,
FROM table_name
GROUP BY consulted_on
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a way to modularize cloudformation template?<p>Right now I am using a template in such a way:</p>
<ol>
<li>Create initial resources</li>
<li>Import ... | <p>Looks like there is an issue open for this, but AWS aren't too interested in fixing it: <a href="https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/79" rel="nofollow noreferrer">https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/79</a></p>
<p>In the mean time, you ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular 12 error '"ng2-charts"' has no exported member named 'ChartsModule'<p>I get the above error when trying to add the ChartsModule to my app.module.ts f... | <p>Seems like charts library has had a new release and they replaced ChartsModule with NgChartsModule.</p>
<p>Try to:</p>
<p>import { NgChartsModule } from 'ng2-charts';</p>
<p>And use it as you would use ChartsModule ( ofc there might be some other changes ).</p>
<p>Or you can downgrade and install not latest charts.j... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Storing a positive floating point number in a known range in two bytes<p>I know that a number x lies between n and f (f > n > 0). So my idea is to brin... | <p>Why multiply by <code>0.65535</code> and then by <code>10000.0</code>? That introduces a second rounding with an unnecessary loss of precision.</p>
<p>The data will be represented well if it has equal likelihood over the entire range <code>(f,n)</code>. But this is not always a reasonable assumption. What you're doi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Headless webview<p>Is there a way to create a headless WebView instance in Nativescript (Vue) for use with <a href="https://github.com/shripalsoni04/nativesc... | <p>Try the core way of creating elements</p>
<pre><code>import { WebView } from "tns-core-modules/ui/web-view";
...
methods: {
createWebView: function() {
const webView = new WebView();
// Remember to pass in context in case of android
wv._setupAsRootView({});
wv.onLoaded();
...
}
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CSV to JSON with primary key to Firebase<p>I am trying to save a CSV to the database on Firebase, but the problem is that I have thousands of this:</p>
<pre>... | <p>How about :</p>
<pre><code>my_df = pd.read_csv('NewYork-03-19-0.csv', sep=";")
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
OSError: [WinError 193] %1 is not a valid Win32 application Python<p>i'm trying to setup a simple OCR with python, I'm now doing tests.
I use notepad++, Pyth... | <p>The problem is this line:</p>
<pre class="lang-py prettyprint-override"><code>pytesseract.pytesseract.tesseract_cmd = 'Lib/site-packages/pytesseract/pytesseract.py'
</code></pre>
<p>You need to set <code>pytesseract.pytesseract.tesseract_cmd</code> to the location of the Tesseract executable. You have instead set it... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SwiftUI how to set the button style toggle taking the whole highlighted width<p>I have 2 button styled toggles in a row like this:</p>
<p><a href="https://i.... | <p>try the following code, to make the buttons expand the highlighted width so each of them takes half of the available screen width.</p>
<pre><code>HStack {
SUITextToggle(label: "roundUp", isOn: stateUp) { _ in
viewModel.toggleRoundingType(.up)
}
SUITextToggle(label: "roundDown", ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Apply loc to the entire dataframe but one column (keep the one column as it was and not remove it)<p>I am trying to divide the entire dataframe by a fix numb... | <p>Set "Year" as index, do the division, then <code>reset_index</code>:</p>
<pre><code>df = df.set_index("Year").div(100).reset_index()
</code></pre>
<p>Alternatively, divide all columns except "Year":</p>
<pre><code>subset = df.columns.difference(["Year"])
df[subset] = df[subset... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to plot interactions of predictors when the response data is ordinal in r?<p>I have a dataset with an ordinal target variable. I need to draw an interact... | <p>You have to make the binary field numeric for it to work.</p>
<pre><code>library(tidyverse)
data("diamonds")
str(diamonds)
df1 <- diamonds %>%
filter(cut %in% c("Fair", "Good")) %>% # Make it binary
mutate(cut = ifelse(cut == "Fair", 0, 1)) # Make it numeric... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can not use a singleton class to return its properties<p>Hello Guys I have the following code</p>
<pre><code>class DeviceListViewController {
private va... | <p>You need to call the method on the shared instance, not on the class</p>
<pre><code>DeviceListViewController.sharedInstance.getCurrentPeripheral()
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Implementing stroke drawing similar to InkCanvas<p>My problem effectively boils down to accurate mouse movement detection.</p>
<p>I need to create my own imp... | <p>I ended up being able to partially solve this.</p>
<pre><code>var position = e.GetPosition(this);
if (!Rect.Contains(position))
return;
if (DrawBrush == null)
return;
var ratio = new Point(Width / PixelDisplay.Size.X, Height / PixelDisplay.Size.Y);
var intPosition = new IntVector(Math2.FloorToInt(position... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
XmlHttpRequest getting status 0 only with cordova android<p>i'm working on a cordova project and i'm trying to connect to a restful api but it keeps on retur... | <p>since <strong>localhost</strong> doesn't exist in mobile you need to replace your <strong>localhost</strong> with your ip address as following </p>
<pre><code>ajax.open("GET","http://your ip address:8001/layer/hospitals",true);
</code></pre>
<p>Hope it help you</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to default format response when statusCode is 200 or another successful one in NestJS?<p>How to format the response when I got successful response?</p>
... | <p>There are many ways for this response but in my opinion, is best practice is to use an <code>interceptor</code>
based on <a href="https://docs.nestjs.com/interceptors" rel="nofollow noreferrer">documentation</a></p>
<pre><code>// src/common/interceptors/format-response.interceptor.ts
import { CallHandler, Execution... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Difference between 1. Poetry add <package> vs 2. a) Poetry shell then b) pip install <package><p>I am wondering what is the difference when we do <code>poetr... | <p>"poetry add " is used in place of "pip install "; "poetry shell" is the command used to activate the virtual environment...</p>
<p>here is some good reading on virtual environments (and how to use poetry specifically):</p>
<ul>
<li><a href="https://realpython.com/python-virtual-environm... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Toggle not showing container<p>I have a system made up to toggle different sections. It works pretty much how I want it, except for some reason all of the co... | <p>You have <code>display:none</code> for the description ... remove that</p>
<pre><code> .project-name-description {
/*display: none;*/ REMOVE THIS LINE
font-size: 1em;
margin-top: 25px;
}
</code></pre>
<p>And if you want the title of the project trigger the function just change that selector and instea... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to let only a certain percentage of turtles die every 10 ticks?<p>After trying all somewhat applicable solutions here to no avail, I still would like to ... | <p>Your first code is correct. Try this in a new model to see:</p>
<pre><code>to testme
clear-all
create-turtles 150 [set color red setxy random-xcor random-ycor]
print count turtles
ask n-of (count turtles / 2) turtles [ die ]
print count turtles
end
</code></pre>
<p>You describe the problem as the code ki... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
GCP: Network load balancer changes HTTP version from 1.1 to 1.0<p>I'm using two type of load balancers: HTTP LB for front-end and Network load balancer as an... | <p>Problem solved. The cause was our nginx setting.
We use nginx proxy. The proxy's default setting is HTTP 1.1.
We put the following line. Then fixed it.</p>
<pre><code>proxy_http_version 1.1;
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Search and replace specific strings with floating point representations in python<p><strong>Problem:</strong> I'm trying to replace mutiple specific sequence... | <p>You can use regular expression's <a href="https://docs.python.org/3/library/re.html#re.sub" rel="nofollow noreferrer"><code>re.sub</code></a> together with a replacement function that performs the logic on the capture groups:</p>
<pre class="lang-py prettyprint-override"><code>import re
def replace(line):
retur... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
flash messaging not appearing in flask<p>When i logged in flash message is not displayed.How can i fix it ?</p>
<p>My login def is below</p>
<pre><code>@ap... | <p>You're passing in one argument (a tuple) instead of two.</p>
<p>Change <code>flash(("wrong password","warning"))</code> to <code>flash("wrong password","warning")</code></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 UNION but instead of putting at the bottom it will put in left side in MYSQL<p>I have three tables :
<strong>billing</strong>,
<strong>debitcr... | <p>Try this... corrected your inner select fields and display</p>
<pre><code>SELECT
a.subsid,
sum(debitamt) as debitamt,
sum(debitcredit) as debitcredit,
sum(amount) as amount
from (
SELECT a.subsid, sum(debitamt) as debitamt, 0 as debitcredit,0 as amount --only need the column defined in first union FROM
new... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Stagger elements along an angle<p>I'm trying to stagger a random number of elements along an angle using javascript (jQuery used for this question).</p>
<p>F... | <p>Seems you want to find X-offset of point, which has some Y-coordinate <code>Y_offset</code> - corner of rectangle.</p>
<p>Here <code>Y_offset</code> is cumulative height of rectangles before the current one (like your <code>boxHeight * ( i + 1 )</code> for case of equal heights), <code>angle</code> is desired angle ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
A better way to map data to a column in a dataframe?<p>I have several large data frames that I need to merge, and sometimes add a unique identifiable column ... | <p>We could use <code>match</code></p>
<pre><code>library(dplyr)
df %>%
mutate(y = match(x, unique(x)))
</code></pre>
<hr>
<p>or with <code>factor</code></p>
<pre><code>df %>%
mutate(y = as.integer(factor(x, levels = unique(x))))
</code></pre>
<hr>
<p>Or with <code>group_indices</code></p>
<pre><... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I configure a Jenkins Pipeline to be triggered by polling SubVersion?<p>We have been using Jenkins for Continuous Integration for some time.
A typical... | <p>The solution that I have found to work is:</p>
<ol>
<li>Move the pipeline script into a file (the default is JenkinsFile) and store this in the root of my project in SubVersion.</li>
<li>Set my pipeline job definition source to "Pipeline script from SCM", enter the details of where to find my project in SubVersion ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I am trying to append two dataframes but its giving an empty dataframes<p>Here is the code:</p>
<pre><code>with open('Epoch_SN001.pickle','rb') as f:
p=p... | <blockquote>
<p>p_deddf.append(p_des)</p>
</blockquote>
<p>append returns a copy of the dataFrame rather updating the dataFrame inplace.<br />
try:
<code>p_deddf = p_deddf.append(p_des)</code></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Finding the nth occurrence of a number using regex<p>I am trying to write a regex that can find the nth occurrence of a number match (where N is a number tha... | <p>You can use this regex to pick <code>N</code>th number:</p>
<pre><code>(?:\D*(\d+)){2}
</code></pre>
<p>Replace <code>2</code> by any number you want. Your number is available in captured group #1</p>
<ul>
<li><code>\D</code> matches any non-digit</li>
<li><code>\d</code> matches a digit</li>
</ul>
<p><a href="h... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to check if value from one column has multiple values from another column and based on the result how to update\remove data correctly?<p>I have such tabl... | <p>Use <code>exists( select something *from the same table* with the same sku)</code>:</p>
<hr>
<pre><code>DELETE FROM partner_stockrecord del
WHERE del.partner_id = 2
AND EXISTS (
SELECT 11 FROM partner_stockrecord x
WHERE x.partner_sku = del.partner_sku
AND x.partner_id = 3
);
</code></pre>
<hr... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Save some columns from a matrix to a new one using criteria<p>I have this matrix that contains for columns. </p>
<pre><code>61.09 126.1 0.95252 1
43.26 ... | <pre><code>%% Your data
matrix_1 = [61.09 126.1 0.95252 1;
43.26 761.71 0.97846 2;
40.38 1506.4 0.98107 2;
39.79 1892.1 0.98351 3;
39.11 2865.4 0.98563 3;
38.27 4159.3 0.9874 4];
%% Indices of column 4 = 2
idx = matrix_1(:,4) == 2;
%% Create new matrix with condition
new_matrix = matrix_1(idx, [1,... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I implement code into an Alexa Skill?<p>I'm running into significant problems understanding how to turn my Python or JS code into a skill for Alexa. ... | <h2>Short answer:</h2>
<p><strong>Anywhere really, it just depends on your logic</strong>.</p>
<p>In that case, if you want this part of code to run after the <code>ChoresIntent</code> is invoked, then within the handle function.</p>
<h2>Long answer:</h2>
<p><a href="https://github.com/alexa-samples/skill-sample-nodejs... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unsure how to NOT include a match in REGEXREPLACE<p>How do I turn <strong>Bay 13 | Brand PS/CPP</strong> into <strong>13</strong> using REGEXREPLACE in Googl... | <p>I think you want to use <code>REGEXEXTRACT</code> here rather than <code>REGEXREPLACE</code>:</p>
<pre><code>REGEXEXTRACT("\d+(?:\.\d+)?", "Bay 13 | Brand PS/CPP")
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Extract data from column of selected row in excel vba userform combobox<p>I have a combobox (cbInventory) populated with a named range in the RowSource prope... | <p><code>column(0)</code> would be the 1st column.</p>
<pre><code>Private Sub CommandButton1_Click()
MsgBox Me.ComboBox1.Column(0)
MsgBox Me.ComboBox1.Column(1)
MsgBox Me.ComboBox1.Column(2)
End Sub
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add filter to get required items in inner array inside a document in mongoose<p>I have a "trip" collection item in mongoDB as </p>
<pre><code>{
"_id": "... | <p>You can project over the nested fields using dot notation in quotes like this:</p>
<pre><code>var tripFieldsRequired = {details:0, "routePoints._id":0, "routePoints.creationDate":0};
</code></pre>
<p><a href="https://docs.mongodb.com/manual/tutorial/project-fields-from-query-results/#projection-on-embedded-documen... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Contributing multiple separate features to github repository properly via fork<p>I currently contribute to a repository A which I do not own via a fork A-for... | <blockquote>
<p>But how can I now contribute another separate feature?</p>
</blockquote>
<p>If your new feature does not require the changes you made in a previous pull request, then you can just start working on a new branch based on master:</p>
<pre><code>git checkout -b my-next-feature origin/master
</code></pre... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL joining two columns on single column to get count<p>I am strugling to figure out how to receive what I need with t-sql. <br>
My goal is to count distinct... | <p>Here are 2 queries which show the information that you are looking for.</p>
<ul>
<li>The first query is the format requested. It looks for all combinations of 2 codes. If you have operations with many codes the number of rows returned will grow exponentially.</li>
<li>The second query will group all the item_codes a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Apply multidimension array data to an object<p>For a given PHP object (loaded from CouchDB) <code>$obj</code>:</p>
<pre><code>class stdClass#1 (3) {
pub... | <p>You could do it like this:</p>
<pre><code>function setObjectFromArray($obj, $arr) {
foreach ($arr as $k => $v) {
$obj->{$k} = is_array($v) ? setObjectFromArray($obj->{$k}, $v) : $v;
}
return $obj;
}
</code></pre>
<p>The major difference with your code is the assignment to <code>$obj-&g... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
server returns list of tuples to an ajax request but back in the html I need to work on it and html(data) doesn't give a proper structure<p>I manage to send ... | <p>As you note, dictionary.items() returns tuples, so that may not be the best approach.</p>
<p>You can use an intermediary step like converting to JSON to pass such structures</p>
<p>in your view</p>
<pre><code>import json
dictionary = {
"key1": "value1",
"key2": ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reducing space between y-axis and plot title/axis ticks<p>I am outputting a scatterplot in R using <code>plotly</code> with the code below:</p>
<pre><code>li... | <p>We can use the <a href="https://stackoverflow.com/questions/60596977/r-plotly-large-unused-space-on-top-and-bottom-of-graph-when-setting-height">same procedure</a> for a categorical axis.</p>
<p>Please run <code>schema()</code> and navigate: object ► layout ► layoutAttributes ► yaxis ► range:</p>
<blockquote>
<p>[..... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Gridlineerror with Cartopy<p>I used this line thousend times:</p>
<pre><code> gl= ax.gridlines(crs=ccrs.PlateCarree(), draw_labels=True,
lin... | <p>I only reinstall my conda environment it finally works</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
A very basic Android app is incompatible on a lot of devices<p>So I have an app with some very basic functionalities, including writing to external Download ... | <p>Your <code>minSdkVersion</code> is 24. According to <a href="https://developer.android.com/about/dashboards/index.html#Platform" rel="nofollow noreferrer">google</a> only ~7% of the devices support API level 24 or greater. Consider decreasing it and testing your app on those API levels</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding attributes to laravel collection<p>i have to put some attributes to my laravel collections.</p>
<p>My laravel collection original attributes :</p>
<pr... | <p>You can't use <code>->put</code> in an <code>->each</code> loop for this case, because <code>->each</code> does not loop the items by reference. So all modifications to the item are lost after the loop.</p>
<p>You can map the array to return your actual <code>$item</code> merged with the extra key <code>amo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to set a number for epoch in tf.python_io.tf_record_iterator<p>I was trying to iterate over my data set several times. I used a tf.python_io.tf_record_it... | <p>Finally, the new tensorflow Dataset api encoded this functionality. The full documentation is found at: <a href="https://www.tensorflow.org/api_docs/python/tf/contrib/data/Dataset" rel="nofollow noreferrer">https://www.tensorflow.org/api_docs/python/tf/contrib/data/Dataset</a>. </p>
<p>Long story short, this new ap... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to combine two Angularjs form validation directives conditions in CSS?<p>I want the input fields to have red bg when both $dirty and $invalid is true but... | <p>If you want <em>both</em> to be true, you have to do the following:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>input.ng-dirty.ng-invalid {
background-color:pink;... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ElasticSearch Filter Aggregation in .Net Nest<p>I'm trying to run the following <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/sear... | <p>Your query is <em>not quite</em> correct; the sub aggregation should be using the <code>AggregationContainerDescriptor<T></code> passed as the argument for <code>aa</code> in the anonymous function </p>
<pre><code>Dim queryResults = elasticClient.Search(Of Mail)(Function(s) s.
Size(0).
Aggregations(Function(a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can attributes be applied to templates?<p>Does the C++ standard allow setting attributes on template declarations? For example:</p>
<pre><code>[[attr1]] tem... | <p>I digged into C++ grammar and here are relevant parts:</p>
<pre><code>declaration:
block-declaration
template-declaration
template-declaration:
template < template-parameter-list > declaration
</code></pre>
<p>That forbids <code>[[attr1]]</code> and <code>[[attr3]]</code>, if you believe me, tha... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
mongodb: decrease all values (in -1.5) that match with specific filters<p>I'm trying to decrease all "temperature values" that match with "sen... | <p>Use <code>arrayFilters</code> to match and update array elements. Note that in your sample dataset, none of the document is matched, so I modified the find criteria a bit to demonstrate the query.</p>
<pre class="lang-js prettyprint-override"><code>db.collection.update({
"sensor_id": 1,
"location_... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Combine lists of strings of different lengths to a data frame<p>I have a text data that need correcting of English mistakes.</p>
<p>I want an output of a ta... | <p>We could keep <code>mistakesList</code> as it is and convert the <code>suggestionsList</code> to comma-separated values using <code>toString</code>.</p>
<pre><code>data.frame(mistakes = mistakesList, suggestions = sapply(suggestionsList, toString))
# mistakes suggestions
#1 thhis... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Specifying constraints on Xcode<p>I would like to know whether there is any way to <strong>specify constraints explicitly</strong> for a particular device(iP... | <p>Yes, you can assign constraint to particular device size, it's not a specific device like iPhone 5Se or iPhone 6 but is kind of specific size classes, like compact or regular.</p>
<p>Click on view as on the bottom left of storyboard and you will see different options of devices size, now on the bottom right of stor... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular: Looking for an explanation on custom directive syntax<p>I copied a custom directive that <a href="https://stackoverflow.com/questions/17922557/angul... | <p>Firstly, if you're planning on calling a method from a directive's <em>API</em> (so to speak), you need to identify it as a callback:</p>
<pre><code>scope: {
'onChange': '&ngFileInputChange'
}
</code></pre>
<p>This simply means you're defined/exposing a way to declare a callback when the <code>scope.onChan... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Same ImageDataGenerator but different class_indices - How to remap the classes within a generator?<h2>Background</h2>
<p>I am training a model that takes as... | <p>When you don't explicitly set the classes using <code>classes</code> argument, the <code>flow_from_dataframe</code> internally uses pandas Series <a href="https://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.unique.html" rel="nofollow noreferrer"><code>unique</code></a> method on the <code>y_col</cod... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Set Row Color Using Epplus<p>using Epplus how can I set an entire row background color to red? I've got this</p>
<pre><code>int rowNumber = ws.Cells[rowInde... | <p>Because <code>ws.Cells</code> is an <strong><code>ExcelRange</code></strong> class, when you use <code>[ ]</code> with one parameter you should get a string of <code>Address</code>:</p>
<pre><code> ws.Cells[string Address]
</code></pre>
<p>You can use this with <code>rowIndex</code> and <code>col</code> to reach a ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can i build a form with one textfield at the time?<p>I was trying to make a form that shows one field at the time that acomplishes the next things:</p>
<... | <p>You can achieve this using Visibility widget(which is used to show a widget on condition) and maintaining flags.</p>
<pre><code>bool goToNextField = false;
TextButton(
onPressed: () {
if (_formKey.currentState!.validate()) {
goTo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sort table on multiple Comparator items<p>I need a way in Java 8 to sort a list of Item objects using on multiple Comparator objects.</p>
<p>The application... | <p>You can use the <code>thenComparing(Comparator)</code> method available from the Comparator interface to chain multiple Comparators together. See the example below, to create such a chained Comparator from a List using streams.</p>
<p>The domain class we want to use for sorting:</p>
<pre><code>public static class ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to fix Bad state: field does not exist within the DocumentSnapshotPlatform Firebase Flutter FutureBuilder<p>I'm getting an error in a FutureBuilder while... | <p>You are parsing it wrong. You need to do something like.</p>
<pre><code>factory AppUser.fromDocument(DocumentSnapshot<Map<String, dynamic>> doc) {
// it's the data map which has all the info
final map = doc.data()
return AppUser(
bio: map[FirebaseString.bio],
....,
....,
);
}
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
__RefactorLog table in SQL Server - safe to drop it?<p>SSDT (I suspect) creates a table called __RefactorLog in any database you point it towards.</p>
<p>If... | <p>It is created by SSDT when you use a refactor in SSDT (like Refactor -> Rename) if you do a deployment and just clear out the table it will retry to do any old refactorings which could just fail or cause a disaster!</p>
<p>If you clear the table make sure you also remove the entries from the refactorlog.xml in your... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Merge close centroids<p>suppose I want to cluster data with 3 features. After running a clustering algorithm as a result I got the following 6 cluster center... | <p>I suggest the following approach:</p>
<ol>
<li>define a threshold which represents the minimal possible Eucledean distance between two centroids.</li>
<li>iterate over all the possible pairs, and if some their distance is lower then the thresohld - unite them.</li>
</ol>
<p>You can perform this calculation as foll... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to calculate the difference between rows and divide the difference with the value from the previous row in R?<p>Let's say I have the following dataframe:... | <p>We can use <code>across</code> with <code>lag</code> - loop <code>across</code> all the columns (<code>everything()</code>), apply the formula, and create new columns by modifying the <code>.names</code> - i.e. adding suffix <code>_r</code> with the corresponding column names (<code>{.col}</code>)</p>
<pre><code>lib... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Different choices for each guild slash command using discord js<p>I am building a discord bot that is going to be used on multiple guilds (a.k.a servers). Th... | <p>As mentioned on the comments, using choices with data from the DB is not possible. The workaround is to use the 'autocomplete' option.</p>
<p>To do that, inside the builder, we add a <code>.setAutocomplete(true)</code> . Now, we need to handle the autocomplete interaction, and fill it with the values that we want f... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unity crashes on iPhone at GetCloudProjectId()<p>I have a Unity project and am building for iPhone.</p>
<p>When the app starts, it is open for about 1 secon... | <p>In the Info.plist, the UnityCloudProjectID was missing.
I added it manually and this fixed it.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C++ OpenCL kernel setArg returns CL_INVALID_ARG_VALUE for __read_only image2d_t<p>I'm taking my first, wobbly steps with OpenCL (the C++ API) and I've run in... | <p>Create your program with a context, like so:</p>
<pre><code>auto program = cl::Program(context, my_kernel, CL_TRUE);
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How To add * in Textbox Starting value and print into label in C#<p>I have some <code>text boxes</code> in my form where the user need to enter the different... | <p>You can use the <code>PadLeft</code> method for a string:</p>
<pre><code>textBox1.Text = textBox1.Text.PadLeft(6, '*');
</code></pre>
<p>See an example here: <a href="https://dotnetfiddle.net/GPfFsx" rel="nofollow noreferrer">https://dotnetfiddle.net/GPfFsx</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Changing color of points based on increasing or decreasing values<p>in Plots I am trying to use pch= ifelse but I am unsure how to test the condition.</p>
<... | <p>The first point uses <code>pch = 1</code>:</p>
<pre><code>plot(x, y, pch = c(1, ifelse(y[-1] < y[-length(y)], 8, 0)))
</code></pre>
<p><a href="https://i.stack.imgur.com/vXEDz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vXEDz.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:
Shadow dom children not appeared in DOM<p><strong>My goal there is I want to create a shadow DOM in test ID. However, the problem there is children of my sha... | <p><code> <div id="test">Test</div></code></p>
<pre class="lang-js prettyprint-override"><code>let test = document.getElementById("test");
test.attachShadow({ mode: "open" });
let shadowHeader = document.createElement("p");
shadowHeader.className = "kit-hea... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove outlier from five-number summary statistics<p>How can I force <code>fivenum</code> function to <strong>not put</strong> outliers as my maximum/minimum... | <p><code>boxplot</code> returns a named-list that includes things you can use to remove outliers in your call to <code>fivenum</code>:</p>
<ul>
<li><p><code>$out</code> includes the literal outliers. It can be tempting to use <code>setdiff(data$`Weight(g)`)</code>, but that may be prone to problems due to <a href="http... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing value from screen to screen then to API<p>I'm trying to pass a variable from screen to screen and to pass it as a parameter in my API to make a delet... | <p>you can just call the fetchuser method on onpressed method you dont need to route to the product delete screen it will not call that method .</p>
<pre><code>Container(
child: IconButton(
icon: Icon(Icons.delete),
onPressed: () {
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Trying to display different colors through bash script<p>I'm new to scripting and have decided to learn with this homework that I gave myself.<br />
The goal... | <p>Take a look at this <a href="https://gist.github.com/dtmilano/4055d6df5b6e4ea87c5a72dc2d604193" rel="nofollow noreferrer">gist</a>.</p>
<p>You can invoke it as</p>
<pre><code>colors --256
</code></pre>
<p><img src="https://user-images.githubusercontent.com/982482/69592010-84077080-0fec-11ea-94fe-e71330731133.png" al... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rudimentary caching not working in a Google App Engine application<p>I'm making a blog using Google App Engine, which for now just allows me to post entries ... | <p>You are caching at instance level and you can have number of instances or an instance can be recycled (<em>shut down</em>) and a new one instantiated on a request.</p>
<p>Try to use Memcache if you want to share cache between instances:
<a href="https://cloud.google.com/appengine/docs/python/memcache/" rel="nofollo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to Change Keys To Save a Multidimensional Array into DB using a Loop?<p>I have a form with many rows of data where each row has data of all the same type... | <p>You're making life very difficult for yourself with how you've defined your form fields. Change your form fields so that your data is posted in a better format.</p>
<pre><code><td>{!! Form::text("category[$category->category_id]['category_id']", $category->category_id) !!}</td>
<td>{!! Form:... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Phpstan fails with "Syntax error, unexpected T_STRING, expecting ';' " in definition of function<p>I am using Phpstan on a Drupal project that needs to be up... | <p>I have no idea what happened here, but the code is completely wrong. It's supposed to be an array definition, not a function. From the source code at <a href="https://github.com/asm89/stack-cors/blob/master/src/Cors.php" rel="nofollow noreferrer">https://github.com/asm89/stack-cors/blob/master/src/Cors.php</a>, the ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I graph data that I got from SQL?<p>I'm doing an exercise in DataQuest where I'm trying to graph a set of data that I got from SQL.</p>
<p>It gives m... | <pre><code>bar_heights = density['Pop_Density'].values
bar_positions = np.arange(len(bar_heights)) + 0.75
tick_positions = range(1, len(bar_heights) + 1)
ax.bar(bar_positions, bar_heights, 0.5)
ax.set_xticks(tick_positions)
ax.set_xticklabels(density['name'], rotation=90)
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Deleting duplicates on combination of two columns in oracle<p>I have a table for example :
Port Table</p>
<div class="s-table-container">
<table class="s-tab... | <p>You can use a single <code>MERGE</code> statement and the <code>ROW_NUMBER</code> analytic function combined with <code>GREATEST</code> and <code>LEAST</code> to find and delete the duplicates:</p>
<pre class="lang-sql prettyprint-override"><code>MERGE INTO table_name dst
USING (
SELECT ROWID rid,
ROW_NUM... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error: "Module build failed (from ./node_modules/happypack/loader.js):"<p>This is the theme I am using for a dashboard project (I am under serious timeline p... | <p>This is because of the Node v17 which has a different SSL provider. You can either</p>
<ul>
<li>install Node v16 via <code>nvm</code> and reinstall <code>node_modules</code> (<a href="https://github.com/nvm-sh/nvm#installing-and-updating" rel="nofollow noreferrer">instructions here</a>)</li>
<li>run v17 with the leg... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
check if cumsum of the column is greater than range value than increment the element in list<p>I have a list</p>
<pre><code>sample_dates = ["10/07/2021&... | <p>You can compute the cumsum per group and either <code>cut</code> is manually or use a mathematical trick to make groups.</p>
<p>Then <code>map</code> your dates:</p>
<pre><code># round to thousands, clip to get min 1000 km
kms = df.groupby(['Truckid', 'Tripid'])['kms'].cumsum().floordiv(1000).clip(1)
# OR use manua... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to keep program unclosed after ctr+c in named pipe?<p>I have 2 programs.
One is server one is client. The Client sending string to the server, the server... | <blockquote>
<p>To avoid closing a program you should capture and
manage the signal sent by CTRL + C, that is SIGINT, I have modified the code so that it captures the signal CTRL + C</p>
</blockquote>
<pre><code>#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#i... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
tcsh error: while loop<p>This is a basic program but since I'm a newbie, I'm not able to figure out the solution.</p>
<p>I have a file named rama.xvg in the... | <p>In your <code>awk</code>-line the variable <code>i</code> is an awk-variable not shell variable! If you want use shell-variable <code>$i</code> you can do:</p>
<pre><code>awk -v i="$i" '{if( NR%147 == i ) printf $0 "\n"}' rama.xvg > all_"$i".dat
</code></pre>
<p>But I think would better put your <code>while</co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Close tab when focus on cross icon of tab in ChromeTabs Library WPF C#<p>I want to create close tab when user click on cross icon.I were search out many alte... | <p>I have created the GotFocus event on windowform.Then I have create back an event to close ChromeTab that I were created. This code close the current tab that is open.
Go to XAML file create window event like this.</p>
<pre><code> XAML:
GotFocus="Window_GotFocus"
Code Behind :
private void Window_GotFocus ( ob... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
NumPy/Pandas: remove sequential duplicate values (equivalent of bash uniq without sort)<p>Given a Pandas Series (or numpy array) like this:</p>
<pre><code>i... | <p>Compare by <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.ne.html" rel="noreferrer"><code>ne</code></a> (<code>!=</code>) with <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.Series.shift.html" rel="noreferrer"><code>shift</code></a>ed <code>Series</code> and filte... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spring Integration : Read from JMS -> Handle message -> Persist in DB<p>I use Spring Integration to read messages from JMS, handle them and then persist them... | <ol>
<li><p><code>inputChannel</code> should not be a queue channel - the JMS transaction will commit when the message is inserted in the queue - the DB transaction won't be performed in the scope of the JMS transaction. You must use direct channels for that (remove the poller and <code><queue/></code>). See <a h... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PostgreSQL Dollar quoting and SELECT LIKE<p>Is it possible to use dollar-quoted strings within a SELECT ... LIKE?</p>
<p>i.e.</p>
<pre><code>SELECT "firstN... | <p>The LIKE wildcard needs to be part of the string, not <em>after</em> the string:</p>
<pre><code>SELECT * FROM person WHERE "firstName" LIKE $xx$j%$xx$;
</code></pre>
<p>or simpler</p>
<pre><code>SELECT * FROM person WHERE "firstName" LIKE 'j%';
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to search for rdfs:labels in dbpedia which are partial matches to a given term using SPARQL?<p>I am using this query to search for all labels that contai... | <p>Your query has to iterate over all labels in DBpedia - which is quite a large number - and then apply String containment check. This is indeed expensive.</p>
<p>Even a count query leads to an "estimated timeout error":
</p>
<pre class="lang-sql prettyprint-override"><code>select count(?label) where
{
?concep... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
FSCalendar How To Understand If User Scrolled the Calendar Page<p>I hid the fscalendar header (previous, current and next date texts) and added two buttons (... | <pre><code>calendarCurrentPageDidChange(yourfsCalender)
</code></pre>
<p><strong>To get Month Name</strong></p>
<pre><code>func calendarCurrentPageDidChange(_ calendar: FSCalendar) {
let currentPageDate = calendar.currentPage
let month = Calendar.current.component(.month, from: currentPageDate)
let monthNam... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to apply the condition 'book id which consists of six alphanumeric characters and starts with B' during creating table in SQL?<p>My query in SQL to creat... | <p>You can use a check constraint like the constraint concerning the genre which is already part of your command. So your create table command will be:</p>
<pre><code>CREATE TABLE book(bookid VARCHAR(6)
CHECK (bookid LIKE 'B_____'),
bookTitle VARCHAR(50),
author VARCHAR(20),
genre VARCHAR(10)
CHECK(genre IN('Myste... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Realm XCODE plugin does not find DB for newly created simulators<p>I have installed the Realm plugin for XCode to easily having access to the <code>Realm Bro... | <p>I just tested it myself. I went to 'Add Additional Simulators', added a new iPhone 5s one, and then built and ran the app using the same Simulator. Once it was open, I clicked 'File>Open Realm...' and it worked.</p>
<p>One thing to be aware of is that not only does the app need to be open in the Simulator, but Real... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to delete gitlab CI jobs pipelines logs/builds and history<p>How can we configure gitlab to keep only the last 10 CI jobs/builds and keep deleting the re... | <p>I think Gitlab doesn't support this feature. But you can create this functionality on your own using Gitlab API and webhooks.</p>
<p>When you push to repo (and pipeline started) it will trigger webhook which can read your CI history via API => you can delete whatever you want.</p>
<p>Here is docs for <a href="http... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Map legecy url to MVC Controller and action<p>Assume my web form application is migrated to a MVC application. Legacy web form url is <a href="http://localho... | <p>The problem is that you are returning <code>null</code> from your route, which makes MVC never consider it a matching route. But a route cannot issue a 301 redirect on its own - for that, you need a controller. So, the solution is to <a href="https://stackoverflow.com/a/36168395/181087">route to a controller and do ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Identity Server does not validate SAML LogoutRequest Signature<p>I've got WSO2 IS running and a service provider that has SAML inbound authentication set up.... | <p>Seems the signature validation [1] is skipping in the logout request due to an issue in the code. Please refer the git issue [2] to track this.</p>
<p>[1] <a href="https://github.com/wso2-extensions/identity-inbound-auth-saml/blob/ee338982c1add8f75f1132a6b3bacb30cee7989b/components/org.wso2.carbon.identity.sso.saml... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
@ngrx Effect does not run the second time<p>I've just started learning about @ngrx/store and @ngrx.effects and have created my first effect in my Angular/Ion... | <p>It sounds like an error is occurring. In that situation, the action in the observable returned by <code>catch</code> will be emitted into the effect's stream and the effect will then complete - which will prevent the effect from running after the error action is emitted.</p>
<p>Move the <code>map</code> and the <co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Horizontal scrolling in SVG<p><a href="https://jsfiddle.net/5kL8cvav/4/" rel="nofollow noreferrer">JSFiddle</a></p>
<pre><code>body {
background-color: ... | <p>In order for the scrolling to happen, you have to give the container a fixed width. The contents (the SVG) needs to have a width that is greater than the container element. Usually that means giving it a specific width, because otherwise it will just resize to its container.</p>
<pre><code>.svgrow {
max-width:... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find A Cell In Sheet1 Then Copy The Entire Row That It Is In To The First Empty Row in Sheet2<p>I receive a "subscript out of range" at the line starting: S... | <p>The three errors you have are:</p>
<ul>
<li>using <code>“</code> and <code>”</code> instead of <code>"</code>. For instance, <code>“Sheet1”</code> is a valid <strong>variable name</strong> and can be used in statements such as <code>“Sheet1” = 5 * 2</code>. Syntactically, it is quite different to <code>"Sheet1"</... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.