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:
How to execute multiple string SQL command in C#<p>Actually I want to make the button click and execute those 2 queries in one-time manner. </p>
<pre><code>... | <p>You cannot reuse the same connection with multiple <code>MySqlDataReader</code> objects simultaneously: <a href="https://mysqlconnector.net/troubleshooting/connection-reuse/" rel="nofollow noreferrer">https://mysqlconnector.net/troubleshooting/connection-reuse/</a></p>
<p>Since your code doesn't actually need the <... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
IP camera capture<p>I am trying to capture the stream of two IP cameras directly connected to a mini PCIe dual gigabit expansion card in a nVidia Jetson TK1.... | <p>After some days of deep search and some attempts, I turned on directly to use the gstreamer-0.10 API. First I learned how to use it with the tutorials from <a href="http://docs.gstreamer.com/pages/viewpage.action?pageId=327735" rel="nofollow">http://docs.gstreamer.com/pages/viewpage.action?pageId=327735</a> </p>
<p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Benchmarking memory use in the Keil uVision 5 simulator<p>I have a Keil uVision project that I would like to benchmark extensively. The code is currently run... | <p>There is a fairly obvious solution: Just count the ram in the memory window. First find the memory regions allocated for the heap and the stack (this can usually be found in the startup assembly file). Then go through the memory window in the debugger and just look where the memory didn't get changed. </p>
<p>Keil ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Position Sticky for Flexbox containers<p>I have built a horizontal flexbox layout with two items, each of which is a vertical flexbox.</p>
<p>Here is the cu... | <p>To achieve what you want you need to have a negative value for <code>top</code> equal to the difference between the screen height and the element height.</p>
<p>I don't know if you will have a dynamic number of element but if I consider the fact that you will have a known number of blue element you can easily do it... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Malloc assertion<p>I'm using <code>malloc()</code> in a function.
First call of the function works fine but the second time, I got </p>
<pre><code>allum1: m... | <p>Most likely you have a memory corruption somewhere in your code (for example, writing though a dangling pointer, or writing past the end of an array).</p>
<p>If you can't find the bug by reading the code, try using an automated tool such as <a href="http://valgrind.org/" rel="nofollow">Valgrind</a>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Symfony serializer cannot deserialize into \DateTime<p>I‘m trying to deserialize a json with the Symfony Serializer into a DTO, but I got always the exceptio... | <p>I found the problem: </p>
<p>As shown before, there is a <code>reporting.reader.serializer</code> service tagged as <code>serializer.normalizer</code>, but only with a small set of normalizers and encoders configured:</p>
<pre><code>services:
reporting.reader.serializer:
class: Symfony\Component\Serial... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to parse json array from mysql?<p>I have this data but I can't parse it in the way I want. this is what I get:</p>
<pre><code>{
"navigations": {
"... | <p>You need to push the row onto the array, not overwrite it each time.</p>
<pre><code>$rows = array('navigations' => []);
$result = $query_update_navigations->get_result();
while($rows1 = $result->fetch_assoc()) {
$rows['navigations'][] = $rows1;
}
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting error of Unterminated character class in jQuery<p>Uncaught SyntaxError: Invalid regular expression: /[/: Unterminated character classUncaught SyntaxE... | <p>Yes, that is a runtime error.</p>
<p>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/search" rel="nofollow">search()</a> method expects a regex as its parameter, but if you are passing a string it should be escaped for regex special characters like <code>^, |</co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas Dataframe<p>I want to represent data using pandas dataframe , the column name - Product Title and populate t .</p>
<p>For eg :</p>
<p><strong>Produ... | <p>Well this will get you started, this extracts all the titles into a dict (I use a defaultdict for convenience):</p>
<pre><code>In [163]:
from collections import defaultdict
data=defaultdict(list)
for product_title in g_data:
a_product_title = product_title.find_all("a","js-product-title")
for text_title in... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to Import more screen Web Page with Google Interactive Canvas<p>I wanna use Interctive-Cavas to customize Google NestHub by HTML, CSS and Js. </p>
<p>In... | <p>Best practice is to use the Interactive Canvas with a <a href="https://en.wikipedia.org/wiki/Single-page_application" rel="nofollow noreferrer">Single Page Application</a> (SPA). In this scheme, your index.html is responsible for displaying everything, although it can pull in resources from other URLs.</p>
<p>This ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Jquery Converting string to Object<p>I have a bit of code where I'm trying to pass the id value of a div to a function, the function then fadeout the first d... | <p>The jQuery object accepts a selector as well, so the only problem I could see is you are not using the <a href="http://api.jquery.com/id-selector/" rel="nofollow">id selector</a>, you are passing the id and is using it as a <a href="http://api.jquery.com/element-selector/" rel="nofollow">element selector</a> so</p>
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
My divs are overlapping, i'm lost<p>Hey I can't figure out why my divs are overlapping and what i should do...</p>
<p>You can watch the site here: <a href="... | <pre><code><div class="container">
<div class="header-info">
<div class="info-name" id="info-name">
.....
</div>
<div class="info-picture" id="info-picture">
<img src="images/picture.png" />
</div>
</div>
<div class="stang-1" id="... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Incorrect number of dimensions while using R.Update<p>I'm a very new R user. I teach my self to use it but I still make many mistakes :(</p>
<p>I'm trying t... | <pre><code> N= 10000
J=200
K=4
Alpha = rep(0,K)
for(j in 1:K){
temp_m = combn(1:K,m=j)
temp_mat = matrix(0,ncol(temp_m),K)
for(j in 1:ncol(temp_m)) temp_mat[j,temp_m[,j]] = 1
Alpha = rbind(Alpha,temp_mat)
}
Alpha = as.matrix(Alpha)
Y_dina <- function(Alpha,q_m,... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Apache Drill configuration<p>I need to add storage plugins for Apache Drill (basically PSVs) but I am unable to find the configuration file where I could add... | <p>You can post to Drill's REST API:</p>
<pre><code>curl -X POST -H “Content-Type: application/json” -d ‘{ “name”:dfs, “config” {“type”: “file”, "connection": "hdfs:///", “enabled”: true, "workspaces": {"root": {"location": "/", "writable": false, "defaultInputFormat": null}}, "formats": { "psv": { "type": "text", "ex... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using a 'mousemove' event in Meteor<p>I want to use a 'mousemove' event in Meteor, I know how it's done in usual JavaScript but can't figure out how to imple... | <p>Meteor affords you some built in <a href="http://docs.meteor.com/#/full/eventmaps" rel="nofollow">eventmaps</a>. Per the documentation, you get access to click, doubleclick, mousedown, mouseup, mouseenter, mouseleave, and a few others. </p>
<p>It doesn't specifically say that mousemove is included, so it might not ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Guid.NewGuid() is returning duplicate values when used in a Parallel.For loop<p>I have an application that is hitting an API. As such, it does a query for a... | <p>The thing is that having to use a <code>lock</code> inside the <code>Parallel.ForEach</code> in a DataTable, sort of defeats the purpose of using the <code>Parallel.ForEach</code> in the first place; however, I am surprised that you don't get exceptions when you call <code>DataRow workrow = CustomTabs.NewRow();</co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular JS ng-show/ hide based on drop-down list selected value<p>in the following code I have one drop-down list (serviceSmallId) for type of service.
It is... | <p>There probably is a more elegant "angular way" solution, </p>
<p>but I updated you code to work <strong>here</strong> - <a href="http://jsbin.com/tupisoriho/1/edit?html,js,output" rel="nofollow">http://jsbin.com/tupisoriho/1/edit?html,js,output</a></p>
<h3>Explanation of changes</h3>
<ul>
<li>Provided <code>ng-sh... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Async API call inside an actor and exceptions<p>I know about <a href="https://stackoverflow.com/a/25225274/1180426"><code>PipeTo</code></a>, but <a href="htt... | <p>The joys of error-handling in the TPL :) </p>
<h2>Once a Task starts running on its own thread, everything that happens inside it is already asynchronous from the caller - including error-handling</h2>
<ol>
<li>When you kick off your first <code>Task</code> inside of an actor, that task runs independently on the <... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
extract text from file using sed<p>I'm trying to write a script in bash which extracts a database name from a PHP file. For example I want to copy CRM_123456... | <p>You cannot nest single quotes. Your expression evaluates to single-quoted <code>/[</code> next to unquoted <code>db_name</code> where clearly you want to match on a literal single quote.</p>
<p>One workaround is to use double quotes for the outermost quoting, but make sure you make any necessary changes, because d... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
add horizontal limit line to time series plot in python<p>I want to add horizontal upper and lower limit line for Temparature timeseries plot. Lets say upper... | <p>I think this solution can help you</p>
<pre><code>import matplotlib.pyplot as plt
%matplotlib inline
df3.plot(x="Date", y=["Temp.PM", "Temp.AM"],figsize=(20,8))
plt.axhline(30)
plt.axhline(10)
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Split on Split overlap [ RAKU ]<p>I stumbled upon a "strange" behaviour when I tried to parse a multiline string (with tab separated strings) with the intent... | <p>You are splitting the result of the first split, which is a list; the split method will coerce whatever it's called on to a string and then splits it. A list will stringify (via its <code>Str</code> method) to its members separated by single spaces. That is the reason why some of the resulting fields have two L and ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
String Index Out of Range<p>I am using pandas and pulling information from excel into a list, that part works great and my lists are coming back and I can pr... | <p>Updated:</p>
<p>Its because you are overwriting your variables. </p>
<p>So <code>name</code> starts as an array:</p>
<pre><code>name = ['Michael Jordan', 'General Clark', 'Tony Tiger', 'Alvin Chipmunk', 'Daffy Duck']
</code></pre>
<p>Loop 1, <code>name</code> becomes a string (idx = 1)</p>
<pre><code>name = 'Mi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I record the position where the user pressed the mouse button with Python and GTK?<p>I would like to let the user of my application draw something. W... | <p>I just got it to work. Thanks to <a href="http://zetcode.com/gfx/pycairo/basicdrawing/" rel="nofollow">http://zetcode.com/gfx/pycairo/basicdrawing/</a> for the tutorial which helped me a lot!</p>
<pre><code>#!/usr/bin/python
"""Write on a canvas, store on-line data."""
from gi.repository import Gtk, Gdk
import t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vertical Nav Menu with submeu that expands<p>I am trying to create something like this <a href="http://www.thomascheng.com/portfolio.php#" rel="nofollow">htt... | <p>That is an Accordion. Check out jQuery's version here: <a href="http://jqueryui.com/accordion/" rel="nofollow">http://jqueryui.com/accordion/</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why MEAN.js applications'URL start with #!<p>I just started my first MEAN application build with <a href="https://meanjs.org/" rel="nofollow">MEAN.JS</a>. Af... | <p>Angular, like all Single Page App Frameworks, uses the hash <code>#</code> anchor to trick the browser into redirecting client links back to the JavaScript rather than making a server request. The <a href="https://docs.angularjs.org/guide/$location#!" rel="nofollow"><code>$location</code> service</a> is used to man... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add all classes in a jar to Jersey JAXBContext context<p>I have a jar with the model DTOs.
I want these classes (marked with <code>@XmlRootElement</co... | <p>I ended up scanning the jar manually...</p>
<pre><code>public static List<Class> listClassesInPackage(String jarName, String packageName) throws IOException {
packageName = packageName.replaceAll("\\.", "/");
JarInputStream jarFile = new JarInputStream(new FileInputStream(jarName));
JarEntry jarEn... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
strange issue in accessing elements that contains right to left text<p>I'm getting all the elements with className : "tickerFeedMessage"</p>
<p>if the first... | <p>The problem is that you have two different situations and you problem is at <code>stories[i].firstChild</code>.</p>
<p>In the first example you provided the return of <code>stories[i].firstChild</code> is an <code>HTMLTextNode</code> element but in the second example it's a <code>HTMLSpan</code> element. </p>
<p>Y... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PHP Condition : Script performed by cronjob<p>I have a script That should execute a piece of code only if the script is run from a cron job, but i do not kno... | <p>If you have 2 types of requests, from server and from remote, you can determine the different between them by variable $_SERVER.</p>
<p>If you run a php file from php command, $_SERVER['REMOTE_ADDR'] will not be set.
Therefore, you can use:</p>
<pre><code>if( !isset($_SERVER['REMOTE_ADDR'] ) {
// The script is... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
List of data tables of different dimensions from a grouped data table<p>I have a <a href="/questions/tagged/data.table" class="post-tag" title="show question... | <p>It can be done within <code>data.table</code>, if we wrap in a <code>list</code></p>
<pre><code>dt[, .(list(data.table(diag(sample(val, 1))))), grp]
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Make vscode open the panel on start-up<p>Every time I open vscode I have to click <code>View->Appearance->Show panel</code> or press <kbd>Ctrl</kbd>+<k... | <p>Vscode should remember whether the panel is open or not each time you close the window. But if it doesn't or you typically have it closed when you exit that vscode window and you have to <kbd>Ctrl</kbd>+<kbd>J</kbd> each time you open vscode try putting this task into your tasks.json:</p>
<pre><code>{
"label": "... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to collapse columns into row elements in pandas?<p>I have data like this in pandas</p>
<pre><code>df = DataFrame(np.random.rand(4,5), columns = list('ab... | <p><code>df.unstack()</code> will move the column labels into an index level. If you want them as a column rather than an index level, you can do <code>df.unstack().reset_index()</code>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Drawing lines that are cut sequentially in R<p>I have a script to draw segments in a plot in R. </p>
<pre><code># Make data
max = 10
y0 = rep(0,max)
x = 1... | <p>For a loop in a loop solution, and I don't see why not - it works and its not some crazy large computation being done:</p>
<pre><code>k <- 10
plot(x = c(0,k), y = c(0,1), typ = "n")
for(i in 1:k){
points(x = c(i,i), y = c(0,1), typ = "l")
for(j in 1:(i+1)){
points(x = c(i-0.1,i+0.1), y = c(seq(0,1,1/i)[... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it safe to store the value of getContext<p>When using the canvas element. Is it safe to call getContext("2d") only once after the page is loaded? Or shoul... | <p>Yes, it is save. Calling <code>getContext("2d")</code> repeatedly on the same canvas would always get you the same context object.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
monitor the value of a variable for some time<p>I am measuring the power value of a phase of a system from a meter via serial rtu modbus communication.
I'm t... | <p>You don't need any external libraries. </p>
<p>Depending if you just want to run this in your script, or if you have more things that needs to run, you could opt to make it <code>async</code>. Try something like this:</p>
<pre><code>import datetime
import asyncio
def resetTimer(duration: float):
now = da... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Javascript generated textbox value = undefined<p>First of all, let me note that although my JavaScript is fairly long, I believe all of the modifications nee... | <p>Change </p>
<pre><code>$(".wy").val()
</code></pre>
<p>To</p>
<pre><code>$("#wy").val()
</code></pre>
<p>You have set the id of the textarea and not its class to "wy".</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JIRA REST API using OAuth-Restricting access to a single project only<p>Let's say an admin user has several projects under his JIRA instance. He needs to giv... | <p>You should play with the JIRA permissions. If every project is readable by the group <code>jira-users</code>, then you'll have to move everybody to a new group (eg. <code>employees</code>), except the given service user. Then, let that user only into that one project.</p>
<p>We have ~500 projects in one of our ins... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Loops repeats twice<pre><code>$n = 0;
do {
echo "START PAGE\n";
echo "total pages: " . $response->PaginationResult->TotalNumberOfPages . "\n";
... | <p>if $n = 0 and your break condition is $n == 2, that's 2 iterations: $n = 0 and $n = 1</p>
<p>Same thing for $j.</p>
<p>Change your conditions to $n == 1 and $j == 1 (or $n < 2 and $j < 2)</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Xamarin Unified API: What about System.Int32 etc. in Shared Code?<p>I understand that – for example – the usage of <code>int</code>, which in .NET is <code>S... | <p>Now I got it. The point is, that everything that touches native APIs needs to be prepared (by the compiler) to run in x32 or x64 mode. That is what the new types like nint are made for.</p>
<p>Everything that doesn't touch native stuff can still leverage the "native .NET type system" including Int32. Which answers ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to fetch the entire div rather than inner content of that?<p>In case the item exists i am fetching the HTML as <code><h3>First Item</h3></cod... | <p>Use <code>.prop('outerHTML')</code> instead of <code>.html()</code>.</p>
<p>This will return a string of the html inclusive of the tag.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Check if OpenFileDialog.OpenFile is null<p>I've gone through this code in <a href="https://msdn.microsoft.com/fr-fr/library/system.windows.forms.openfiledial... | <p>R# is right on this one, if you decompile the class (see code below) it's implemented in a way <strong>that can never return null</strong> (it always returns a stream or throws an exception):</p>
<pre><code>public Stream OpenFile()
{
IntSecurity.FileDialogOpenFile.Demand();
string str = this.FileNamesIntern... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to access a specific menu item dropdown with CSS?<p>I am using joomla and helix_ultimate theme, and this what helix theme developers provided for accessi... | <p>You can use, .menuhome class to access dropdown with adjacent sibling combinator (+)</p>
<pre><code>.menuhome + .sp-dropdown .sp-dropdown-inner {
display: none;
}
</code></pre>
<p><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Adjacent_sibling_combinator" rel="nofollow noreferrer">details</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Invoking a function calculation in C through a pointer defined in a structure, when function is written in assembly code<p>I have a piece of code I am trying... | <p><code>sgen.calc</code> is a pointer to a function accepting one argument of type <code>void *</code> and returning nothing. It is irrelevant how the machine code of the pointed-to function was produced. In any event, the <em>value</em> of <code>sgen.calc</code> carries no information about the variable in which th... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to build a module and its dependencies in NodeJs<p>I've been trying to understand by reading many tutorials and documentation but I wasn't able to grasp ... | <p>Take a look at WebPack (<a href="http://webpack.github.io/docs/what-is-webpack.html" rel="nofollow">http://webpack.github.io/docs/what-is-webpack.html</a>).</p>
<p>It produces a single file and can take dependencies straight from npm. </p>
<p>Example: <a href="https://github.com/webpack/react-starter" rel="nofollo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Validate the Value of One Attrribute Based on Another Attribute's Value<p>How do you enforce presence of another attribute if a given attribute is present?</... | <p>An example implementation : </p>
<pre><code>validates :state, inclusion: { in: [ON, BC, AB],
message: "%{state} is not valid" }, if: :country_is_canada?
def country_is_canada?
country == 'Canada'
end
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pattern matching in VBS<p>Using this as a reference: <a href="https://msdn.microsoft.com/en-us/library/ms974570.aspx#scripting05_topic2" rel="nofollow">https... | <p>(1) Re-read the syntax details (e.g. "\alpanumeric")</p>
<p>(2) Search for "LicenseDetail" + "everthing not a '"</p>
<p>In code:</p>
<pre><code> Dim s : s = "height='40'><td colspan='1' width='20%' align='center'bgcolor='#e9edf2'><font face=verdana color=#000000 size=-1>Real Estate Broker or S... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google cloud bucket static site styling different from local copy<p>I am hosting a static site on a google storage bucket. I use cloudflare for https.</p>
<... | <p>I have a problem developing in Chrome where the browser caches a previous stylesheet. I solve it by doing a hard refresh (clearing my cache). This is the best possible problem because it means new visitors who don't have your stylesheet cached don't see the broken CSS, so I hope for you that this is the issue!</p>
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Outlook / Office Add-in fails with error: AADSTS900561: The endpoint only accepts POST requests. Received a GET == SOLVED<hr>
<p>We currently have an Office... | <h2>Resolution:</h2>
<p>To correct the problem, the following AppDomain needs to be added to the add-in’s manifest file and reloaded within the Outlook client:</p>
<pre><code><AppDomain>https://autologon.microsoftazuread-sso.com</AppDomain>
</code></pre>
<hr>
<h1>Notes:</h1>
<ul>
<li><p>The authenticat... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reload page in framework7<p>Framework7 version: Framework7 5.4.1</p>
<p>In index.html ('/') I have a login button, that open a login.html (/login/) page. Th... | <p>you have to use</p>
<pre><code>pageAfterIn(e){
mainview.router.refreshPage();
//or
this.myrefreshFunction(); //call the refresh function which actually does the hiding
thing
}
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SonarQube is unable to analyze file: bridge method not marked as synthetic<p>I've got this exception when analyzing a project with SonarQube (the project uti... | <p>Your project does '<em>AOP with compile-time weaving</em>', so you might be impacted by this AspectJ bug:</p>
<ul>
<li><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=467415" rel="nofollow">Bug #467415</a> - <em>Weaver created bridge methods missing ACC_SYNTHETIC</em> - fixed in AspectJ v1.8.6</li>
</ul>
<p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C: Last element of an array using a list<p>I have these functions that I am using to make a convex boundary from a set of ordered pairs. If anyone is familia... | <p>Normally a <code>pop</code> function would remove the item on the end of the list and, in addition, return it. Otherwise you could simply implement it as</p>
<pre><code>void popBack(list *p) {
if (p->size == 0)
return;
p->size--;
}
</code></pre>
<p>If you want to return a value then:</p>
<pr... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
java.sql.SQLException:General error<p>I'm getting <code>java.sql.SQLException: General error</code>
I'm trying to delete data from Access DataBase but it thr... | <p>Use <code>executeUpdate</code> for database write operations</p>
<pre><code>pst.executeUpdate();
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
HTML centering problems<pre><code><!DOCTYPE html>
<html>
<head>
<style>
div {
width: 320px;
padding: 15px;
border: 5px so... | <p>Try this:</p>
<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code><!DOCTYPE html>
<html>
<head>
<style>
body{
margin:0 auto;}
.centeredDiv {
width:... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Dynamically Allocated 2D-Array not initializing<p>This code is supposed to allocate, initialize and print a 2-D array. For some reason depending on the value... | <pre><code>for (i=1;i<N;i++)
for (j=1;j<N;j++)
A[i][i]=0;
</code></pre>
<p>should be</p>
<pre><code>for (i=0;i<N;i++)
for (j=0;j<N;j++)
A[i][j]=0;
</code></pre>
<p>The value of <code>i</code> and <code>j</code> should start from <code>0</code> and also <code>A[i][i]</code> should be <code>A... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Quit program on 'q' character<p>I don't know how to make a program which exit on pressing 'q' character.
I'm doing this :</p>
<pre><code>#include <iostre... | <p>You have not read "c" in code.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Swift enums: normal / non failable initializers not supported - or just broken?<p>I have read documentation on Swift's <a href="https://developer.apple.com/l... | <p>This used to work with Swift 1.1 (Xcode 6.1.1) but fails in Swift 1.2 (Xcode 6.3).
It is a bug which has been discussed in the Apple Developer Forum: <a href="https://devforums.apple.com/message/1101465#1101465" rel="nofollow">Swift 1.2 - Initializing Enums</a>.</p>
<p>Two workarounds are given in that discussion: ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Localhost not working with node js<p>Following is a small server (app.js) which is is simply calling index.jade file to add jquery.js, underscore.js and back... | <p>Dont include the <code>.jade</code></p>
<pre><code>res.render("views/index");
</code></pre>
<p>Assuming your view engine is already setup to use Jade. (<code>app.set('view engine', 'jade');</code>)</p>
<p>You also probably dont need to specify the "views" folder, check for the line</p>
<pre><code>app.set('views'... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unzipping A file in vb<p>I get exception when I try to unzip a file</p>
<p>When I remove the try I receive:</p>
<blockquote>
<p>Additional information: O... | <p>If the path is invalid for the input or output folder, it will cause this error. Check your paths before using them in the dim statement.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
child component's props not updating when parent's state updates<p>I am making a Connect-Four game. every column (component) recieves the current player colo... | <p>It is not clear where your code fails, but:</p>
<pre><code> // Here you are setting a reference to the array in state, not a copy
let newColors = this.state.colors;
// Here you are mutating directly the state (antipattern!)
newColors[i] = this.props.currentPlayer;
// You are setting the reference... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Edit distance in Java: How arrange the code?<p>I am working on a Java project about Edit Distance, i.e. the minimum number of operations (out of three operat... | <p>Java is not very well suited for this type of work (APL comes to mind here). If this is not an exercise, I would use existing libairies to do this. If this is an exercise, I would check how an open source library does this. </p>
<p>In the end, you could:</p>
<p>1) Copy the original content into a newly allocated m... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create a new column based on difference of dates<p>I have a dataframe in which I have to create a new column based on the difference of two dates. Example:</... | <p>Using <code>dplyr</code> we could change <code>Date</code> to class <code>Date</code>, <code>arrange</code> them based on <code>Date</code> and subtract <code>Date</code> from the <code>first</code> value. </p>
<pre><code>library(dplyr)
df %>%
mutate(Date = lubridate::dmy(Date)) %>%
arrange(Date) %>%
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting a bounded polygon coordinates from Voronoi cells<p>I have points (e.g., lat, lon pairs of cell tower locations) and I need to get the polygon of the ... | <p>Given a rectangular bounding box, my first idea was to define a kind of intersection operation between this bounding box and the Voronoï diagram produce by <a href="http://scipy.github.io/devdocs/generated/scipy.spatial.Voronoi.html"><code>scipy.spatial.Voronoi</code></a>. An idea not necessarily great, since this r... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to correctly unpack tuple and display it?<p>I have <code>['34242342', 'Ford focus 2015', 'Chevrolet Impala 1960', 'Ford focus 2012', 'Dodge charger 2010'... | <p>You can unpack the tuple of 1-tuples with list comprehension:</p>
<pre><code>data = (('34242342',), ('Ford focus 2015',), ('Chevrolet Impala 1960',))
result = [item for item, in data]
</code></pre>
<p>For example:</p>
<pre><code>>>> [item for item, in data]
['34242342', 'Ford focus 2015', 'Chevrolet Impa... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can someone explain --> private BrowserWindow mParentWindow { get; set; }<p>Can someone explains me below piece of code? basically what it is, what its doing... | <p>Essentially, you could set <code>mParentWindow</code> to <code>public</code> and remove the <code>m</code>.This code you've provided creates a read only property inside a class. You've added a <code>private BrowserWindow</code> which can be altered at your will from within the class it belongs to but not accessed or... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AngularJS ngRequired custom directive<p>I have small directive to add <code>required</code> class to closest label of form element. It works fine with attrib... | <p>As @PetrAveryanov pointed out in comments, it's possible to <code>$observe</code> attributes in directive to track changes of it.</p>
<p>Still, it seems that we need 2 directives. One for static <code>required</code> and one with observation of <code>ngRequired</code> added attribute</p>
<p><div class="snippet" da... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Having trouble adding an image to an svg -> tspan tag<p>I've tried to follow the tips other users got on this, but it seems that I'm not getting this right o... | <p>Using <code>document.createElementNS()</code>, it worked but not inside the <code><text></code>. </p>
<p>Created a <code><g id="pin"></g></code> outside the text and appended image to it. check the snippet.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babe... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
javascript object reference not work as expected<p>Can anyone explain me what is going on in this code below? Why does it work like this? I expected the vari... | <p>Because there are no pointers in JavaScript.</p>
<hr />
<p>At the beginning, you have something like this:</p>
<pre class="lang-none prettyprint-override"><code>base ---+
|
v
{
cars ----+
} |
v
{
color: &quo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In WPF - XAML is there a way to bind to a property change behaviour without using UpdateSourceTrigger?<p>I'm trying to code some behaviours in WPF.
Consider... | <p>The combination <code>Mode=OneWay</code> and <code>UpdateSourceTrigger=PropertyChanged</code> is pointless.</p>
<p><code>UpdateSourceTrigger</code> only has an effect in <code>TwoWay</code> or <code>OneWayToSource</code> Bindings, where it controls when exactly the source property of a Binding is updated.</p>
<p>B... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Flutter Firestore Role Based Security Rules<p>I am trying to determine if a specified field <code>role</code> in my user's collection is the one being used w... | <p>Your rule is checking documents in your "projects" collection, but your screenshot is showing contents of doucments in the "users" collection. So, there is obviously a mismatch here.</p>
<p>If you want to allow access to a document using the contents of another document, you will need to <a href="https://firebase.... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Move image in a spiral fashion in java<p>I am trying to make a simple animated intro. I have an image I am trying to move from the bottom left of the screen ... | <p>Animation is the illusion of movement over time. Normally I would use something like the <a href="https://java.net/projects/timingframework" rel="nofollow noreferrer">Timing Framework</a> (or <a href="https://kenai.com/projects/trident/pages/Home" rel="nofollow noreferrer">Trident</a> or <a href="https://code.googl... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can i merge two dom element collection into third using javascript<p>How can i merge two dom element collection into third??
as i have collection of all ... | <pre><code>var inputs = Array.prototype.slice.call(document.getElementsByTagName("input"));
var selects = Array.prototype.slice.call(document.getElementsByTagName("select"));
var all = inputs.concat(selects);
</code></pre>
<p>or with jQuery</p>
<pre><code>var collection = $('input, select');
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How To Achieve "one-way" Exchange Pattern With The new HTTP Connector In Mule?<p>I am quoting from <a href="http://www.mulesoft.org/documentation/display/cur... | <p>If you aren't interested in the response simply place the HTTP request in a async scope or in another flow that is called through a one way vm endpoint. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
RuntimeError: Working outside of application context. with app.app_context() not resolving the issue<p>I am trying to run a time consuming loop by having a p... | <p>As indicated in the Flask <a href="https://flask.palletsprojects.com/en/1.0.x/appcontext/#lifetime-of-the-context" rel="nofollow noreferrer">docs</a>, the app context isn't available outside of a request which is what happens when the <code>loopTask</code> is run in a different process. Consider passing your app ins... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
check the first element using css selector<p>I am trying to check if a particular element exists on a webpage using css. Using</p>
<pre><code>$$("css=.class... | <p>You can use <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/:first-of-type" rel="nofollow"><code>first-of-type</code> pseudo-class</a>:</p>
<pre><code>css=.class1 a:first-of-type
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python use multiple operators in a boolean expression<h2>Background</h2>
<p>As we all known, we'd better not assginment several variables use <code>chain as... | <p>This is the code given by you.</p>
<pre><code>a = 1
b = 1
c = 2
if a == b == c == 1:
print('All equal!')
else:
print('At least one variable is not equal to others')
</code></pre>
<p>Let's understand what it means.<code>a==b==c==1</code> is evaluated to <code>True</code> only when all three of them are equ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Hsqldb Stored Procedure<p>I am trying to setup a stored procedure in my in memory Hsqldb database for testing purposes. The stored proc I am working from is ... | <p>You don't need a semicolon after <code>END IF</code> and <code>END</code>. The error message is a little misleading.</p>
<p><em>EDIT</em>
You may also need to double the semicolons in your <code>CREATE PROCEDURE...</code> text since Spring itself considers semicolon to be statement separator as well.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to export functions from library to application, not able to send through provider<p>I am trying to export a function from angular library to other appli... | <p>So you can also do one this create a file which can have many functions and export that in your component where you want to use its function like below</p>
<pre><code>utils.ts
export default class Utils {
static doSomething(val: string) { return val; }
static monthDiff(dateFrom, dateTo) {
dateFro... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how do I update my votes into my sql with my dropdown, textfield and submit button?<p>how do I update my votes into my sql with my dropdown, textfield and su... | <p>I just refactored your code</p>
<p>Form file (index.php)</p>
<pre><code><?php
if (!$link = mysql_connect('localhost', 'root', 'password')) {
echo 'Could not connect to mysql';
exit;
}
if (!mysql_select_db('stackoverflow', $link)) {
echo 'Could not select database';
exit;
}
$sql = 'SELECT fa... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sylius: Additional checkout step missing listener<p>I want to add a checkout step to the sylius checkout process. It's working in the sense that when I am at... | <p>I solved it myself. Everything that was missing was the following in services.yaml:</p>
<pre><code>app.request.matcher:
class: Symfony\Component\HttpFoundation\RequestMatcher
sylius.listener.checkout_redirect:
class: Sylius\Bundle\CoreBundle\Checkout\CheckoutRedirectListener
tags:
- { name: 'ke... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Autoproperty debugging<p>When I use autoproperty for example</p>
<pre><code>public string Prop {get;set;}
</code></pre>
<p>compiler generates two functions... | <p>1) the compiler don't save source code, it compiles. The implicit backing fields are only present in the IL code.</p>
<p>2) It's a feature, not a bug, I agree it could be great.</p>
<p>3) You have to create a backing field manually in order to put a breakpoint on it.</p>
<pre><code>private string _prop;
public st... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create a lexical analyzer in ANTLR 4 that can catch different types of lexical errors<p>I am using ANTLR 4 to create my lexer, but I don't how to crea... | <p>Create an error token rule for each known error and an "catchall" error token rule at the end like this:</p>
<pre><code>// valid tokens first!
Number : [0-9]+;
Identifier : [a-zA-Z] [a-zA-Z0-9]*;
//...
// "error" tokens
// don't use these tokens in your grammar; They will show up as extraneous tokens during parsin... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to handle SQL Server NULL values<p>I'm trying to get values from my database, it works when all columns have values. When a value is <code>NULL</code>, i... | <p>You can check for null value and if the value is not null assign the variable using ternary operator:</p>
<pre><code>Signature = dr["Signature"] != DBNull.Value ? (string)dr["Signature"] : "No value",
Likes = dr["Likes"] != DBNull.Value ? Convert.ToInt32(dr["Likes"]) : 0,
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get the Query for Line Numbers from the Sales Order Form in Oracle EBS<p>From the Front-end Application, we can see the <strong>line number</strong> like 1.1... | <p>Try this:</p>
<pre><code>select t.LINE_NUMBER || '.' || t.shipment_number line_number
from oe_order_lines_all t
WHERE T.HEADER_ID = &header_id;
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
VBA Open PDFs in a list by selecting cells<p>I am working on a sheet that will allow the users to pull up PDFs based on partial file names in different folde... | <p>I had a colleague of my give me a hand with this. Thank you for all the help! Answer is below. Let me know if you see anything that can be improved upon. </p>
<pre class="lang-vb prettyprint-override"><code>Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Selection.Count = 1 Then... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Selecting a value of a variable from a set of values during object creation in Python<p>I want to create an instance for the class Player like:</p>
<pre><co... | <p>The simplest way is a <code>set</code> match. Ex:</p>
<pre><code>class Player(object):
_valid_levels = {'A','B','C','D','E'}
def __init__(self, name, level):
if level not in Player._valid_levels:
raise ValueError("Level should be {}, got {}".format(Player._valid_levels, level))
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MAX MSP // How can i controll visualisation with incoming audio signal?<p>do anyone work with <strong>MAX MSP</strong> and can help me?</p>
<p>how can i con... | <p>If you're using Max 5 or later, they have really great built in help files. For instance, when you open Max, go to Help -> Jitter Tutorials. I'd start by reading the first few just to get a handle of how jitter deals with data and matrices. Then specifically for video switching, read tutorial 8: Simple Mixing and 9:... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is my VBA ComboBox blank until I type<p>I created a simple <code>UserForm</code> <code>ComboBox</code> with a list of items:</p>
<pre><code>Private Sub ... | <p>I think the issue is that you're loading the contents of the Combobox when the combobox changes (i.e. the Combobox' <code>Change</code> event) where you should be loading the combobox on the <code>UserForm_Initialize()</code> event handler instead.</p>
<p>Try moving this line:</p>
<p><code>CourseComboBox.List = Sh... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Website on GCP cant be reached on some wifis<p>I am using GCP, nginx and domain name from "name.com" to deliever my website.
It can be reached on mobile netw... | <p>Hey everyone so I have found the problem.
When I looked online for best practice its recommended to use different ports for the backend and frontend.</p>
<p>apparently the port used for the backend was blocked by some routers.</p>
<p>Now the backend and frontend use the same port and it is fixed.</p>
<p>Hopefuly ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Jquery check for text value on page load<p>So basically I'm making a input form and I want to style it a bit. At the moment it works if you enter the form wi... | <p>Just take the function out of the <code>focusout</code> and fire it on document ready:</p>
<pre><code>$(function () {
var text_val = $(.settingsv2 .input_effect input).val();
if (text_val === "") {
$(.settingsv2 .input_effect input).removeClass('has-value');
} else {
$(.settingsv2 .input... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get a json which is distinct of columns<p>I have a PostgreSQL database table and content is as below:</p>
<pre><code>id | person_key | age | gender |... | <p>You can use aggegation and Postgres json functions:</p>
<pre><code>select
person_key,
json_build_object(
'age', age,
'gender', gender,
'email', json_agg(email order by id)
) js
from mytable
group by person_key, age, gender
order by person_key
</code></pre>
<p><strong><a href="h... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular bootstrap ngb-tabset add button to the rightside to align with tabs<p>I am using ngb tabset for tabs in my angular application. Here is the code i am... | <p><strong>SOLUTION 1:</strong></p>
<p>You should use <code>ngbNav</code> instead of <code>tabset</code>.<code>ngbNav</code> provides list of elements allow to put any element inside of it and functionality is as same as <code>tabset</code>.</p>
<p>For more info : <a href="https://ng-bootstrap.github.io/#/components/... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Running fork inside a loop produces unexpected results (measuring process switch time)<p>I am writing a program to measure the time it takes to perform a pro... | <p>This is because each child process is going to create other processes.</p>
<p>After the <code>if</code> block is executed, each child will return at the beginning of the loop and <code>fork()</code> again, until <code>i == 2</code> in all child processes.</p>
<h3>Edit :</h3>
<p>In order to avoid that, I suggest t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Handling error codes from multiple merchants<p>I need to make custom error messages based on the error message that I get back from chase/merchant.</p>
<p>T... | <p>One of the principles of SOA is that you never expose the internal of a provider to the consumer. Or in other words you don't tightly couple/bound your service provider and consumers with each other. </p>
<p>If for example Merchant A has an error message 100-wrong pin entered and you expose this error to your consu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spring Integration complete asynchronous transformation before the next<p>I have an Integration flow that regularly polls a database to retrieve any <code>Ma... | <p>The only way I see it via a custom <code>AbstractMessageSourceAdvice</code> against some <code>AtomicBoolean</code> flag (could be a bean, too) to check in the <code>beforeReceive()</code>. Since you use a <code>Pollers.fixedDelay(5000)</code> your polling policy is still single-threaded. Therefore we are good to no... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Implementing valuelike copy-assignment operator<p>In C++ Primer there is an example of using the copy-control members to make a class act "valuelike"; that i... | <p>You are correct.
Your version does not only work it is also more efficient since existing memory can be reused when <code>ps->capacity() >= rhs.ps->capacity()</code>.</p>
<p>If you want to provide strong exception guarantees you should use the <a href="https://stackoverflow.com/questions/3279543/what-is-th... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
loop inside loop activerecord<p>I have a <code>category_aliases</code> table, which has <code>aliase</code> column (array type), and <code>category_id</code>... | <p>You do not need to iterate through all categories ('each') in each product loop, you just need to find a matching category <code>detect</code>.
Furthermore: if you need to iterate over many Products, is might be better to use <code>find_each</code>:</p>
<pre><code>category_aliases = CategoryAlias.pluck(:name, :ali... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to match non-Unicode string with regexp in Ruby?<p>I wanna to match string that contain <code>\xa0</code>, Like:</p>
<pre><code>"\xa0" =~ /\xa0/
</code>... | <p>Not every byte sequence is a valid Unicode string. (or more specifically UTF-8)</p>
<p>Your single-byte string for example is not:</p>
<pre><code>str = "\xa0"
str.encoding #=> #<Encoding:UTF-8>
str.valid_encoding? #=> false
str.codepoints # ArgumentError (invalid byte sequence in UTF-8)
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Map db-functionresult to jpa entity property<p>I have here a table, where the date is a number. (days since year 0)
In the database (oracle) there is a custo... | <p>The best shot would be to look into the @Formula annotation, or simply save that date instead of the number in your database?</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
get the count of the user stories and display in grid<p>This code will display the total story count, accepted story count and completed story counts and als... | <p>I fixed you code now you can see the grid with user stories, now you can specify the fields you want to display like Team / Project,Total Story Count,Un-estimated Story Count,Accepted Story Count </p>
<pre><code> Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laravel queries: Get all vehicles without bookings in specific date range<p>These are my <code>vehicle</code> and <code>booking</code> models:</p>
<pre><cod... | <pre><code>public function availabillity(Request $request){
$selectedStart = Carbon::createFromFormat('d/m/Y H:i', $request['start']);
$selectedEnd = Carbon::createFromFormat('d/m/Y H:i', $request['end']);
//$availableVehicles = [];
$availableVehicles = $vehicles->whereDoesntHave('bookings', fu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Upload file via $_FILES or php://input? Which is better on the system?<p>I am creating a script that via my iOS application I can upload a file. I was wonder... | <p>Regardless of whichever you choose, php will always have the entire file in memory due to the way php handles file uploads.</p>
<p>I'd stick with <code>$_FILES</code>, it's already there to help you with the handling of file uploads with PHP.</p> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.