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:
Codeforce Round #617 "Div3-B"<p>It works well in my computer, but when I submit my code, it reminds me of 'runtime error in test 1', what is the problem?</p>... | <p>That code gets the input from a file, but this problem send the data from the standard input (stdin). Just use the input function.</p>
<p>You can verify if the problem send you data from a file or from the standard input on the header of the problem.</p>
<p>A example of file input problem: <a href="https://codefor... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Android webView evaluateJavaScript executes undefined function<p>I'm developing an Android application that contains a WebView.
I am trying to override onKey... | <p>[SOLVED]</p>
<p>That was not a problem of Android's WebView or cache. That's a problem of javascript.
When a function is defined in as "global" it assumes the global scope when it is evaluated for the first time. So when I visited the .jsp which contains pageGoBack() for the first time the function became globally... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to bind nested inputs using knockoutjs<p>I have a from where I want to bind all the nested input fields of each radio button to it's option so I can show... | <p>As mentioned in my comments you should be doing like this .</p>
<p><strong>ViewModel:</strong></p>
<pre><code>var viewModel = function () {
var self = this;
self.optionRadio = ko.observable();
self.input1 = ko.observable();
self.input2 = ko.observable();
self.try1 = ko.observable();
self.tr... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Entry::or_insert executes despite a value already existing<p>In <a href="https://doc.rust-lang.org/book/ch13-01-closures.html" rel="nofollow noreferrer">chap... | <p>The problem with your code is that function arguments are always evaluated before calling the function in Rust (and most imperative languages). This means before <code>or_insert()</code> is even called, the code will unconditionally call <code>(self.calculation)(intensity)</code>. The <code>or_insert()</code> functi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
place div on top of div<p>I have the following 3 divs. filler is on top of logo. All 3 div's line up correctly when logo has margin-left:100px. But when I c... | <p>Not sure if I answered this before but you achieve this with giving position:absolute to the background div. if you want the background to apper behind the two div reduce the z-index. Also i think you see the other two div over each other is because of negative margin.</p>
<p><div class="snippet" data-lang="js" da... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Tips on writing a vim function to set printerheader<p>I know i can use <code>:set printerheader=%-%This\ is\ a\ file</code> to set a string as a printerheade... | <ul>
<li>You can use options as variables by prefixing them as ampersand: <code>set foo=bar</code> is equivalent to <code>let &foo="bar"</code></li>
<li>You don't need to escape spaces in normal strings</li>
<li>When <code>-nargs=1</code>, the (single) argument can contain spaces</li>
</ul>
<p>So:</p>
<pre><code>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Declaring a function before using it, does it make a difference?<p>What is the difference between these two function body codes? (The first code is from The ... | <p>The first example of source code explicitly tells the compiler information that the compiler must infer in the second example of source code.</p>
<p>The following discussion makes the assumptions that the function <code>atof()</code> is not declared or defined in any way (include file, etc.) before its use in the e... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why do I get the empty tuple if I type / in iPython?<p>Open up iPython and type this:</p>
<pre><code>/
</code></pre>
<p>Hit enter and wonder about the resu... | <p>It is a convenience feature for callable objects/names. It's not an empty tuple, but parentheses completion. From iPython's help system (<code>?</code>):</p>
<blockquote>
<ul>
<li><p>Auto-parentheses and auto-quotes (adapted from Nathan Gray's LazyPython)</p>
<ol>
<li><p>Auto-parentheses</p>
<p>Call... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to check length of value in onchange method in flutter<p>Check value of Textfield in onChange method is empty or not if user remove all values from Textf... | <p>Use <code>text.trim().isEmpty</code> to check whether there has value on <code>textField</code>. </p>
<pre><code> onChanged: (text) {
if (text.trim().isEmpty){
_paidController.text = "0"; // set to zero if no value
unpaid = grandTotal.toInt();
}else{
unpaid = grandTotal.toInt()... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Recoding factor using fct_recode: "Unknown levels in `f`"<p>I have created the following factor with success:</p>
<pre><code>conti <- factor(
c("Eu... | <p>You get a warning message on them since you have assigned new factor levels incorrectly. Try, </p>
<pre><code>forcats::fct_recode(conti,
"S. Amerika" = "S.America",
"Europa" = "Europe",
"Asien" = "Asia",
"Afrika" = "Africa")
#[1] E... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
GDAL hillshade artifacts<p>I'm using gdal to create different kinds of layers, such as color reliefs and hillshades, and Mapnik to combine them into a single... | <p>The reason for the artefacts in the first attempt is because the raster horizontal distance units are in degrees, and the vertical are in meters. You can use a <a href="http://www.gdal.org/gdaldem.html" rel="nofollow noreferrer">scale option</a> to normalise horizontal and vertical distance units, e.g. try:</p>
<pr... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JQuery Click the first one item and the other same class toggle<p>I want to click the first one item("title1"), and toggle the content next to the other same... | <p>I think you want something like this:</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-js lang-js prettyprint-override"><code>$(".content").toggle();
$(".title1").click(function() {
$(this).next().toggle();
});<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can one make <input> to show *** instead as plain text<p>I want <em>id=demo</em> <code>(/document.getElementById("demo").innerHTML)</code> for the value ... | <p>You can repeat the character (<code>*</code>) up to the length of the character in the password field using <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/repeat" rel="nofollow noreferrer"><code>repeat()</code></a>:</p>
<pre><code> var pass = document.getElementById... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
moving divs with JAVASCRIPT like CSS3 with no lags<p>I have a problem with my javascript code ,I m moving a div in a page with javascript (NOT CSS3) and it c... | <p>You can do this easily with jQuery. To move the div by increasing it's margin use :</p>
<pre><code>function go_next(){
var firstDiv=$('#first_ltr'),
secondDiv=$('#second_ltr'),
thirdDiv=$('#third_ltr');
//Rest of your code.To move with margins :
firstDiv.animate({"margin-left":"+= 2.75... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get All records with parent Child relationship to the Nth Level<p>I have a Company table having ParentCompnayID column in it along with other columns which t... | <p>You can do this with the help of <a href="https://technet.microsoft.com/en-us/library/ms186243(v=sql.105).aspx" rel="nofollow">common table expression</a></p>
<pre><code>declare @companyId int
set @companyId = 1
;WITH cte
AS
(
SELECT CompanyId, CompanyName, ParentCompanyId, 0 as steps
FROM dbo.tblCompany
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Loop through buffer in javascript<p><strong>Background</strong></p>
<p>I am attempting to iterate over a buffer object which basically contains hex values. T... | <p>Like T.J. mentioned in his answer, you probably want the numbers. But, if you do need the numbers formatted like you say you can do something like this:</p>
<pre class="lang-js prettyprint-override"><code>function* hexFormatValues(buffer) {
for (let x of buffer) {
const hex = x.toString(16)
yield hex.padS... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can a button from an element call a function of another element<p>I have an polymer element login:</p>
<pre><code><polymer-element name="quizzito-log... | <p>Wrong scope for 'toggle'. 'quizzito-login' must have 'toggle' function in on-register-tap="{{toogle}}" case.
Why you don't call 'quizzito-register-dialog' function directly? Get 'quizzito-register-dialog' element and call toogle.</p>
<pre><code><polymer-element name="quizzito-login" attributes="">
<templa... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python: Best practice for large app?<p>I have been learning python as I go and getting ready to start a large application to test what I have learned. The ap... | <p>Rule #1 for big-app programming: test, test, and then test some more -- at all levels -- unit testing of single classes, functions, methods -- integration testing of cooperation among a few units -- end-to-end tests. Getting fanatical about testing (automated, thus fully repeatable, testing, at all levels) is reall... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
A durable entity does not deserialize<p>I am trying to use a durable entity in my Azure Function to cache some data. However, when I try to retrieve the ent... | <p>I did manage to get around this by following @silent suggestion. I re-designed the entity class to only use CLR types. In my case, that meant replacing <code>Dictionary<string, ActionTargetIdsCacheItemInfo></code> with two dictionaries <code>Dictionary<string, List<string>></code> and <code>Dicti... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
rake db:migrate not working when using ActiveRecord with Sinatra<p>I am trying to create a very basic Sinatra app which uses only Active Record and Sqlite3. ... | <p>I was having the same problem, and I believe I found the answer to your second question, why you had to revert to an older version of Active Record (5.2 instead of 6.0).</p>
<p>If you look at the <a href="https://github.com/sinatra-activerecord/sinatra-activerecord" rel="nofollow noreferrer">sinatra-activerecord rep... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# -- How To Properly Hash A Password (String)<p>I am currently working on a <strong>Form Application in C#</strong> that has a <strong>login system</strong>... | <ol>
<li>You should generate random string called "salt"</li>
<li>Combine your plain password string with salt and hash result</li>
</ol>
<p>IN DETAILS:</p>
<ol>
<li>Generate a long random salt. Note: salt must be different for every login-pass pair!</li>
<li>hash = sha(salt + password) //pseudocode</li>
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to update an IndexedDB ObjectStore Name?<p>One way to do it is to create a new objectStore with the new name and copy the data of the original over, but ... | <p>I took another look at the <a href="http://www.w3.org/TR/IndexedDB/#object-store" rel="nofollow">spec</a>, and it does not look like there is a way to modify the name of an existing object store. Your idea of creating a new store, copying over the objects, and deleting the old store, is probably the only and best wa... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Average number of observation for group conditional on second identifier in data.table<p>I have a data frame that has the following structure</p>
<pre><code... | <p>One <code>dplyr</code> option could be:</p>
<pre><code>df %>%
group_by(V1) %>%
summarise(V2 = n()/n_distinct(V2))
V1 V2
<chr> <dbl>
1 X1 1
2 X2 2
3 X3 1.5
4 X4 3
</code></pre>
<p>The same with <code>data.table</code>:</p>
<pre><code>setDT(df)[, .(V2 = .N/un... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Im trying to use time in python as a trigger for a comand<p>im trying to make a command happen when its a certain time but its not working someone please hel... | <p>The odds of calling <code>datetime.now().time()</code> at a precise <em>microsecond</em> are slim. One-second accuracy would probably be sufficient, and if so, you don't want to call <code>datetime.now().time()</code> as fast as you can; even a one-second delay in the loop saves thousands of unnecessary calls.</p>
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sending images over http to browser in C<p>A am new to C and I am trying to implement a web server in C. I can successfully send .txt and .html files to the ... | <p>I managed to fix it. There were multiple problems. First, I removed all (str*()), because, as mentioned on the comments, they ARE NOT meant to deal with binary data. I removed the unnecessary number of buffers. Now I have two: the first one is for storing the response headers, it is safe to use strcat/strcpy, etc on... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Are .txt files and .json files equally good for storing javascript objects?<p>Can I simply change the extension of a .json file to .txt without problems?</p>... | <blockquote>
<p>Can I simply change the extension of a .json file to .txt without problems?</p>
</blockquote>
<p>Yes.</p>
<p>Think about it; the sole purpose of file extensions is to let a file browser (Windows Explorer, Finder Windows) choose a program to open that file with.</p>
<p>By default, <code>.html</code>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the corresponding androix library for com.android.support:support-compat?<p>What is the corresponding <code>androidx</code> library for <code>com.and... | <pre><code>implementation 'androidx.core:core:$core_version'
</code></pre>
<p>Use the library above in your code. Android provides a list of changes in libraries in case you need to check in future <a href="https://developer.android.com/jetpack/androidx/migrate/artifact-mappings" rel="nofollow noreferrer">link</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
i cannot use the router.post method in node.js<p>i try to use a post request in my node.js application but for some reason that i cannot find it is not worki... | <p>The <code>method</code> attribute should be on the <code><form></code> tag, not the <code><button></code> tag. The default method is <code>GET</code> so that's what the form is doing. Try this:</p>
<pre><code><form method="POST">
<div class="form-group">
<label>To Do:</label&... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MVC, uploading CSV, int.Parse(), "Input string was not in a correct format."<p>I know that this has been asked before and I have tried my best to find an ans... | <p>Change your CSV file to this (first line removed):</p>
<pre><code>1;Node1;her er node 1;22
2;Node1;her er node 2;33
</code></pre>
<p>Alternatively, jump the first line when parsing the file.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
set or add value to pandas cell // optimisation<p>Provided a string like <code>XYZ</code> I need to set a value in a pandas cell or append it depending on th... | <p>You can use <code>np.where</code>:</p>
<pre><code>dff = pd.DataFrame({'D':['a','b','','c'],
'E':['d','','','']})
mystring='XYZ'
dff["D"] = np.where(dff["D"]=="",mystring,dff["D"]+";"+mystring)
print (dff)
D E
0 a;XYZ d
1 b;XYZ
2 XYZ
3 c;XYZ
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to understand Mysql/php<p>I am going through a PHP Script and the code/syntax I saw is totally new to me. Can anyone tell me in detail what actually i... | <p>What happens is the database selector receives an array. </p>
<ul>
<li>In the <code>$array['table']</code> part are all the table and join instructions</li>
<li>In the <code>$array['fields']</code> part are the fields from the array that are in need of selecting</li>
<li>In the <code>$array['condition']</code> are ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Matlab Timer function to start another function<p>I want to use the timer function to execute another function, PowerOnFunc, 60 seconds after the timer has s... | <p>Callback functions in matlab automatically get two parameters <strong>source, event</strong> you need your callback function to support this</p>
<pre><code>function [] = ftimer(src,evnt)
</code></pre>
<p>or more realistically, since you aren't using them just do</p>
<pre><code>function [] = ftimer(~,~)
</code></p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Group child nodes based on the values of their siblings<p>I've got this XML: </p>
<pre><code><RECORDS>
<RETREC>
<heading>Green... | <p>The output you show can be generated simply by:</p>
<p><strong>XSlT 1.0</strong></p>
<pre><code><xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:key name="heading" match="RETREC" use="heading" />
<xsl:template match="/RECORDS"&... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert RGB24 to RGB for web?<p>I have some colors in RGB24 format, for example: <code>1581613</code>
How to convert it to RGB for web usage?
If I und... | <p>I'm guessing a lot here, but here goes:</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-js lang-js prettyprint-override"><code>const color = 1581613;
const red = (color >> 16) & 255;
const green = (... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the purpose of left shifting zero by any amount?<p>Upon reading the ASM 4.1 source code I've found instances of the following:</p>
<pre><code>int AS... | <p>Indeed they are equivalent but one possible explanation is that they wanted to map the version numbers including both the <em>major</em> and <em>minor</em> numbers to a unique ID in their code. So in the following:</p>
<pre><code>int ASM4 = 4 << 16 | 0 << 8 | 0; // this looks like 4.0.0
int ASM5 = 5 <... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does AWS Elastic Beanstalk Python insert a 'static' rule ahead of all others in priority?<p>The 'static' routing rule for my Python application is behavi... | <p>This is a result of the Apache server configuration in <code>/etc/httpd/conf.d/wsgi.conf</code> which contains</p>
<pre><code>Alias /static/ /opt/python/current/app/static/
</code></pre>
<p>If you delete or comment out that line, the server will no longer "intercept" paths that start with 'static'.</p>
<p>Accompl... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Most efficient way to handle large arrays of data in C#?<p>Currently I am using XNA Game Studio 4.0 with C# Visual Studio 2010. I want to use a versatile met... | <p>You may try <code>List<T></code> and <code>ToArray()</code> method associate with List. And it's supported by XNA framework too (<a href="https://msdn.microsoft.com/en-us/library/6sh2ey19%28v=vs.110%29.aspx" rel="nofollow noreferrer">MSDN</a>).</p>
<p><code>List</code> is a successor to <code>ArrayList</code>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
perl match function for C program<p>Trying to use perl API functions in C program. Couldn't find the function to do regular expression match. Wish there is ... | <p>Don't mess with Perl's private internals. Call a Perl sub that uses the match operator.</p>
<p>Say you previously compiled the following in your interpreter (using <code>eval_pv</code>),</p>
<pre><code>sub regex_match { $_[0] =~ $_[1] }
</code></pre>
<p>Then you can call</p>
<pre><code>static bool regex_match_sv... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
UIVisualEffectView: Enabling Vibrancy in IB Disables Blur Effect<p>I have a background <code>UIImageView</code> behind a <code>UIVisualEffectView</code>. Whe... | <p>Place your views according to the hierarchy bellow:
<img src="https://i.stack.imgur.com/UbNhS.png" alt="enter image description here"></p>
<p>(a short tutorial on creating
<a href="http://dannyshmueli.com/blog/2015/03/07/interface-builder-and-blur-with-vibrancy/" rel="nofollow noreferrer">blur on iOS8 using interf... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I test is a Python variable is a set<p>If I have an object: </p>
<pre><code>w = {'A'}
</code></pre>
<p>how do I test if this is a set or not?</p> | <pre><code>if isinstance(w, set):
</code></pre>
<p>Add this if statement to check, replace w with the variable you want to check.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laravel - How to Implement Search from Controller and View<p>I am using Laravel-5.8 for web application. I have this model class:</p>
<pre><code>class HrEmp... | <p>you can add $request var or just use $_GET on index function to get param/query of search and use where "LIKE" to filter your data</p>
<p>make form in your view</p>
<pre><code><form action="">
<div class="input-group col-md-4">
<input type="text" name="s" class="form-control" value="{{ $_GET[... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CSS z-index not working<p>I created a user hovercard but i have z-index problem. </p>
<p>If you can check this demo then you can see there are tree avatar =... | <p>This should work:</p>
<p><a href="http://jsfiddle.net/sw4ev8b4/14/" rel="nofollow">http://jsfiddle.net/sw4ev8b4/14/</a></p>
<p>Remove all the fancy z-index styling you have in there and just add a positive z-index <code>z-index:999;</code> to your tooltip:</p>
<pre><code>.summary {
margin: -50px auto 0;
w... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
javascript function not called in $(document).ready<p>How come my javascript function doesn't get called if I have it inside a document.ready call.</p>
<pre... | <blockquote>
<p>called from a onchange event in my html element</p>
</blockquote>
<p>I assume that means you have something like</p>
<pre><code><input onchange="Test()" />
</code></pre>
<p>in your HTML.</p>
<p>In that case the answer is: Because of <a href="https://developer.mozilla.org/en-US/docs/Web/JavaS... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Way to use email as the authentication field?<p>I am using django's inbuilt authentication system. Everything seems to be working fine. There are two fields ... | <p>The answer is directly in <a href="https://docs.djangoproject.com/en/1.7/topics/auth/customizing/#specifying-a-custom-user-model" rel="nofollow">django documentation</a>, in short words you should subclass <code>AbstractBaseUser</code> or <code>AbstractUser</code> (in second case you can't totally remove username fi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
iOS, DfP and Google Mobile SDK: Frequency Capping fails<p>I am running into a problem in our iOS app. I have set up interstitials in both DoubleClick for Pub... | <p>Answering my own question here: the problem was that this behavior occured when using a Testflight build. Frequency capping works by storing the Advertising Identifier in the adserver and thus identifying users. </p>
<p>With <a href="https://stackoverflow.com/questions/26648840/ios-testflight-beta-app-get-new-adver... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Eliminate duplicate values from xsl exporting Crystal report to XML<p>I have a crystal report which created the following XML for import. (new to xml coding)... | <p>Try changing:</p>
<pre><code><xsl:value-of select="Section/Field[@Name='ZCFCONTR8ZCFCONTR1']"/>
</code></pre>
<p>to:</p>
<pre><code><xsl:value-of select="Section/Field[@Name='ZCFCONTR8ZCFCONTR1']/Value"/>
</code></pre>
<p>etc.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Insert a 3x3 2D array into a 9x9 2D array<p>I need a Java function that takes a 2D 3x3 array and puts it into the center of a 2D 9x9 array. For example, the ... | <pre><code>for(int y = 0; y < 3; ++y)
for(int x = 0; x < 3; ++x)
array9x9[y+3][x+3] = array3x3[y][x];
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Powershell -replace when replacement string contains $+<p>I am doing a string replacement in PowerShell. I have no control over the strings that are being re... | <p>Instead of using the <code>-replace</code> operator, you can use the <code>.Replace()</code> method like so:</p>
<pre class="lang-bsh prettyprint-override"><code>PS> 'word'.Replace('word','@#$+')
@#$+
</code></pre>
<p>The <code>.Replace()</code> method comes from the .NET String class whereas the <code>-Replace... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React/Redux: focus is lost in the input field<p>When you enter text in the field, focus is lost. Why?</p>
<p>If remove the label prop, then the problem is s... | <p>I noticed that when using <code>Label</code> as child of <code>SimpleItem</code> (instead of prop), the input doesn't lose focus on keyup event (I tried digging in the docs, but I couldn't find a reason why this would happen):</p>
<pre><code><SimpleItem
dataField="surname"
editorOptions={{
value: formEdi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
"Hierarchical Select" alternate module for Drupal 8<p>I am currently migrating from Drupal 6 to Drupal 8, and we do not find the contributed module "Hierarch... | <p>Upgrading already? wow, ambitious.<br>
Anyway..<br>
The <a href="https://www.drupal.org/project/cshs" rel="nofollow">Client-side hierarchical select</a> module seems to have a Drupal 8 branch and is the only hierarchy select module I can find that does.<br>
I think it is superior too as afaik it does not require aja... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
App stops working when calling Http.PostAsync when returning a string<p>I have a Blazor app that's calling a WebAPI method that returns a string, however whe... | <p>Apart from the comment by @enet, there're likely two more bugs:</p>
<ol>
<li>There's a risk of dead lock in the way you get <code>Result</code> by using <code>.Result.Content</code>. You need change the code to <code>await ...</code></li>
<li>Also, if you're using Blazor Server side, be aware that invoking <code>Ht... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
automatic scroll animation disables user scrolling - ability to override it<p>i want to make a website that is scrolled very very slowly to the bottom all th... | <pre><code>var doc=$('html,body');
var docEnd= doc.height();
doc.animate({scrollTop:docEnd}, 120000,'linear');
$(window).scroll($.debounce( 250, true, function(){
console.log("scrolling");
doc.clearQueue();
doc.stop();
} ) );
$(window).scroll($.debounce( 250, function(){
console.log("done");
doc.... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What's Difference between NSNotification 'object' and 'userInfo'?<p>What's difference between <code>NSNotification</code>'s <code>object</code> and <code>use... | <p>The <code>object</code> represent the object which posted the notification. <code>userInfo</code> contains the additional information/data for the receiving object/function.</p>
<p>According to <a href="https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSNotificationCenter_Cla... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to cancel QSqldatabase::open immediately in a running thread?<p>I have a Thread, which opens a database and emits a signal. The main idea is to check if ... | <p>After some years of experience I do know an answer: You shouldn't at all. Just leave it open or terminate, but the best option is to let it run, complete and then close the thread.</p>
<p>I managed to keep the thread running until the test has finished. The UI is able to close at any time - and the database thread i... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
RibbonActions.js Deprecated in Dynamics 365 Unified Interface. Is there any new JS Library replacing RibbonActions.js?<p>I am using the OOTB <strong>Send Dir... | <p>When you type <code>$webresource:RibbonActions.js</code> & press the enter button/lens icon, it will prompt you to choose one, then click on <code>$webresource:Sales/_static/_common/scripts/RibbonActions.js</code>. This should work.</p>
<p><a href="https://i.stack.imgur.com/RFcFP.png" rel="nofollow noreferrer">... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Azure Redis delete cache command not executing<p>I'm trying to delete the cache I created to reset the data, but when I run the following command </p>
<pre>... | <p>I believe you're using the command incorrectly. Based on the documentation <a href="https://docs.microsoft.com/en-us/cli/azure/redis?view=azure-cli-latest#az-redis-delete" rel="nofollow noreferrer"><code>here</code></a>, this command actually deletes the redis cache account and not the data itself.</p>
<blockquote>
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
(Swift) popping back to navigation controller<p>I will describe what I want to do. I have 3 viewControllers. The first one should be navigation one, and I th... | <p>Use below code in btnTapped:</p>
<pre><code> for controller in self.navigationController!.viewControllers as Array
{
// here YourViewController is your firstVC
if controller.isKind(of: YourViewController.self) {
self.navigationController!.popToViewController(controller, animated... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I navigate to another page after CircularProgressIndicator completed in Flutter?<p>Hello I am new in Flutter and I am currently building a chat appli... | <p>you should set your navigator inside of your upload function after upload finished</p>
<pre><code>Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
CircularProgressIndicator(
backgroundColor: Colors.blue,
),
SizedBox(
height: ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Calling a function from the return statement of a void function<p>If I return a void function from a void function, will that function be called before retur... | <p>Yes. From N3337 (draft C++11 standard):</p>
<blockquote>
<p>[stmt.return]/3 A return statement with an expression of type
<code>void</code>can be used only in functions with a return type of <em>cv</em> <code>void</code>;
the expression is evaluated just before the function returns to its
caller.</p>
</bloc... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I am writing a method but i get error expected an indented block<p>I am practicing writing to a csv file Python 2.7
I had my code working but i am trying to ... | <p>Your indentation is messed up for your def:</p>
<p>should be ...</p>
<pre><code>def writeTo_csv():
with open('test.csv', 'wb') as csvfile:
write_to_csv = csv.writer(csvfile, delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL)
write_to_csv.writerow(['id,' 'TITLE,' 'FNAME,' 'SNAME,' 'GENDER,... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to change content inside table when condition search is false using javascript<p>I have a code for table and search text : </p>
<pre><code><div class... | <p>Use the whole table body to search for the text, so if it returns <code>-1</code> you could use it to negate and toggle the element that shows the message ( I have placed it as an additional row, that is hidden on load) about no results. </p>
<p>Also, you could use a <code>.toggle()</code>, instead of the condition... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I compare a variable to see if it is null in SQL Server Transact SQL<p>I would like to check if the variable <code>@Test</code> is null. I tried (<co... | <p>Use the following:</p>
<p><code>@Test IS NULL</code></p>
<p>So, e.g. as a predicate in a <code>WHERE</code> clause:</p>
<p><code>WHERE (@Test IS NULL) OR ...</code></p>
<p>or in an <code>IF</code> statement inside a stored procedure:</p>
<pre><code>IF (@Test IS NULL) AND ( ... some other predicate )
BEGIN
...
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to rearrange array sequently (not by keys)<pre><code>[4]=>
array(2) {
["element1"]=>
string(3) "sad"
["element2"]=>
string(1) "2"
}
[1]=>
... | <p>Bit confused about what you actually want. If you just want to reindex the array, use</p>
<p><code>$newArray = array_values($array);</code></p>
<p>If you want to sort the array by key, use</p>
<p><code>ksort($array);</code></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python: Merge up to 3 columns of a Dataframe into 1 but either of the 3 could not exist<p>I have a Dataframe formed like this:</p>
<pre><code>+------+------... | <p>Let's use string manipulation and <code>groupby</code> with <code>axis=1</code> and <code>max</code>:</p>
<pre><code>df.groupby(df.columns.str[:4], axis=1).max()
</code></pre>
<p>Output:</p>
<pre><code>| | Col1 | Col2 | Col3 |
|---:|-------:|-------:|-------:|
| 0 | 1 | 0 | 1 |
| 1 | ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
php echo filenames in a directory?<p>I am using the following php code to echo out the names (and extensions) of all the files in a folder.</p>
<p>This work... | <p>Add Condition to check that is it file or not.. try this code</p>
<pre><code>if ($fileinfo->isFile()) { // add this condition
echo '<table><tr><td><p>' . $fileinfo->getFilename() . "\n" . '</p></td><td><p>Existing File</p></td><td><p>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spring MVC - json string is truncated to 500 characters<p>I would like to send image encoded in base64 format in json. The problem is that the string has mor... | <p>Problem resolved.</p>
<p>There was just a problem with the return type. The response seems to be complete when the return type is array of bytes.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get JWT token from Appsync Resolver Mapping Template<p>I am using <strong>oidc</strong> as authentication in AWS Appsync. For some purpose I need the <strong... | <p>I found a way here:</p>
<pre><code>#set($token = $context.request.headers.get("authorization"))
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can't get reactive var from helper in meteor js<p>I'm trying to write the value of a reactive var to a meteor template:</p>
<pre><code>Template.form.rendere... | <p>You should place the <code>ReactiveVar</code> definition in your <code>template.created()</code> function, not the <code>template.rendered()</code> function.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Divide each three numbers of vector of by values in another vector<p>I would like to perform a simple calculation.</p>
<p>I have a vector of numbers:</p>
<... | <p>Assuming 1st vector is called <code>x</code> and 2nd <code>y</code> we can put <code>x</code> in a matrix and do</p>
<pre><code>n <- 3
c(t(matrix(x, ncol = n, byrow = TRUE)/y))
</code></pre>
<p>Or with <code>sweep</code></p>
<pre><code>c(sweep(matrix(x, nrow = n), 2, y, `/`))
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I deal with Coupon database design?<p>I have create a simple e-commerce via Laravel, and have some questions about COUPON database design, what I nee... | <p>Very interesting! I think may be a good approach should be a pivot table with a polymorphic relation. Somthing like this:</p>
<pre><code>id - couponable_type - couponable_id - coupon_id - "whatever_data"
------------------------------------------------------------------
1 - category - 1 - 1 ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JavaScript if statement optimization<p>I have the following code:</p>
<pre><code> function() {
if (foo && foo.bar !== baz) { //needed ... | <p>This can be converted into a one-liner:</p>
<pre><code>foo && foo.baz === baz ? function2() : function1();
</code></pre>
<p>If <code>foo</code> is falsey then it will execute <code>function1</code> and if <code>foo</code> is truthy but <code>foo.baz !== baz</code> then it will still execute <code>function1... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to send email to users who has changes in jenkins build<p>I am using jenkins scripted pipeline. If the build fails I wish to send email to list of users ... | <p>The solution is to use the jenkins-pipeline <strong>post task</strong> with the <strong>email-ext</strong> plugin. Please refer to:</p>
<ul>
<li><p>Pipeline <strong>post</strong> section: <a href="https://jenkins.io/doc/pipeline/tour/post/" rel="nofollow noreferrer">https://jenkins.io/doc/pipeline/tour/post/</a></p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting elements of the array MySQLi + PHP<p>Trying to get array from using MySQLi and PHP, so that I could work with each element of the array (like <code>$... | <p>Like what exactly says on the error message, it needs no parameters:</p>
<p><a href="http://php.net/manual/en/mysqli-stmt.fetch.php" rel="nofollow">http://php.net/manual/en/mysqli-stmt.fetch.php</a></p>
<blockquote>
<p>bool mysqli_stmt::fetch ( void )</p>
</blockquote>
<pre><code>$titlesquery->bind_result($r... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to match regular expression up to end of string?<p>I am trying to use regular expressions to check user input as they type. For example if I wanted to ch... | <p>You need to add all the alternatives like below.</p>
<pre><code>^\\s*H(?:ello|el?l?)?\\b
</code></pre>
<p>Note that <code>?</code> repeats the previous token zero or 1 time. Don't consider the <code>?</code> present inside lookarounds <code>(?<=..)</code> , <code>(?=..)</code> or non-capturing group <code>(?:..... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Log Parser2.2 TO_DATE & TO_TIMESTAMP conversion<p>Just started using log parser 2.2, so please excuse me if this is too silly, but I am stuck at converting a... | <p>Try with lower-case 'y':</p>
<pre><code>M/d/yyyy
</code></pre>
<p>Here is a description of the timestamp elements:</p>
<pre><code>y 1-digit year
yy 2-digit year
yyy 3-digit year
yyyy 4-digit year
M month as digit without leading zeros
MM month as digit with leading zeros
MMM month... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Active Storage still detects attachement even after validation failure<p>This is an issue that has been going on for quite some time and to this day, I still... | <p>To error prevent you can use <code>persisted?</code></p>
<pre><code><% if person.avatar.attached? && person.avatar.persisted? %>
<%= image_tag(person.avatar)%>
Remove <%= form.check_box :remove_avatar%>
<%end%>
</code></pre>
<p>And you can use <a href="https://rubygems.org/gems/... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
XSLT not producing desired result<p>I'm trying to transform an XML document into CSV, which is something I have done successfully before, however my current ... | <p>This is an issue caused by the additional namespace in the input XML</p>
<pre><code>xmlns="http://developer.cognos.com/schemas/xmldata/1/"
</code></pre>
<p>You can add the namespace with a prefix to the XSLT, e.g. as </p>
<pre><code>xmlns:c="http://developer.cognos.com/schemas/xmldata/1/"
</code></pre>
<p>and th... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can not create a mobil in azure recieve The upstream server reported that the resource was not found<p>I am trying to create a mobile service with a new data... | <p>To resolve you will need to contact Microsoft support to resolve. There is something incorrect in the Metadata of the account and Microsoft will need to resolve it on their end. Microsoft just put out a patch yesterday that resolved the issue for me. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting permission exception when run docker-compose up with dpage/pgadmin4 image<p>I'm trying to build a ruby rails docker-compose postgreSQL db with pgadmi... | <p>I had the same problem. I could solve it by mounting the volume at a slightly different location:</p>
<pre><code> volumes:
- pgadmin:/var/lib/pgadmin4/storage
</code></pre>
<p>Note that in your script it was mounted at <code>/var/lib/pgadmin/storage</code>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Changing MongoDB Isolation level when Mongo Sessions involved<p>Whats is the default Isolation level for MongoDB4.0 when transactions are used. </p>
<p>One ... | <p>MongoDB allows the client to determine the required isolation level depending on requirements via a combination of write concern, read concern, and the use of sessions.</p>
<p>With regard to transactions (which requires the use of sessions), the default isolation is snapshot.</p>
<p>Read uncommitted is the default... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Barcode wasn't printed as many as the Request<p>I was able to <a href="https://www.neodynamic.com/articles/How-to-print-raw-Zebra-ZPL-commands-from-PHP-direc... | <p>What I did to solve this was to make each request on a separate tab and closed the tab once it's executed. To make it simple I make it into a separate function.</p>
<p><strong>Request script</strong> changed into:</p>
<pre><code>for (var i = 0; i < rows.length; i++) {
if (i > 0)
delayPrint(rows[i], i);... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Handling a logout in nativescript with angular on both android and iOS<p>I am new to both NativeScript and Angular so I appreciate any assistance/guidance. I... | <p>While navigating from login to dashboard, you may clear your history. If you do, hitting back button will close the app instead of taking user back to login.</p>
<p>Also you must use <a href="https://docs.nativescript.org/angular/core-concepts/angular-navigation" rel="nofollow noreferrer">RouterExtensions</a> inste... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does this string.punctuation code not work for stripping punctuation?<p>I am confused why this code doesn't work the way I want. I am reading in a txt fi... | <p>You are trying to strip unicode punctuation while <code>string.punctuation</code> only includes ascii punctuation.</p>
<p>Instead of using <code>string.punctuation</code>, you can use the code below to generate a string contains all of the Unicode punctuation characters: </p>
<pre><code>import unicodedata
import s... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Webview missing from list of contexts<p>I am running tests using WebdriverIO with Appium. Recently my tests started failing when trying to switch to webview ... | <p>On the device navigate to Settings > Safari > Advanced and enable Web Inspector.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I list all tables in a schema having specific column in oracle sql?<p>I have found the list of all tables using this query -</p>
<pre><code>SELECT DI... | <p>You could use <code>USER_TAB_COLS</code> view.</p>
<p>For example,</p>
<pre><code>SQL> select table_name, column_name, data_type from user_tab_cols where column_name ='DEPTNO';
TABLE_NAME COLUMN_NAM DATA_TYPE
---------- ---------- ----------
DEPT DEPTNO NUMBER
EMP DEPTNO NUMBER
SQL>
</... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Combining several JSON objects into one<p>I need to put an array of JSON objects into a new JSON object.</p>
<pre><code>{“megaObject”:[
{ “key”:8,... | <p>If you represent the JSON object as a <code>NSDictionary</code>, you can simply use the methods of this. I.e.</p>
<pre><code>NSDictionary *jsonDict1;
NSDictionary *jsonDict2;
NSDictionary *jsonDict3;
NSArray *resultAry = @[jsonDict1, jsonDict2, jsonDict3];
NSDictionary *resultDict = @{@"megaObject" : resultAry};
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Azure B2C MFA response<p>We have a scenario where a logged-in user (SFA, authentication has been done by Azure policies) needs to do some high-value transact... | <p>The usual approach is for the application to look at the "acr" claim. This claim tells the app which B2C Auth policy the user has last arrived with. Therefore, in your app implement this logic: </p>
<ol>
<li>User clicks high risk item </li>
<li>App checks current token "acr" claim </li>
<li>If acr != "B2C_1_MFA"... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why the output parameter of my ADODB.Command does not retrieve a value when executing?<p>I have a code in Classic ASP and SQL Server, the idea is simple, to ... | <p>As <a href="https://stackoverflow.com/users/690460/diana">@diana</a> has <a href="https://stackoverflow.com/a/28685355/692942">already pointed out</a> you cannot access the output parameter because it isn't set until the query has executed.</p>
<p>This is a common problem and in this case you might think but I'm no... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Query PFInstallation and add to channels key from cloud code<p>I am trying to get subscriptions added to all PFInstallations for a particular PFUser (for cas... | <p>Ok, after hours of work, I finally figured it out, and thought would post the solution. If you want to edit all your PFInstallation entries of a certain type (I do this by always putting my PFUser objectId as a new value on PFInstallation), here you go.</p>
<p>For cloud code use:</p>
<pre><code>Parse.Cloud.define... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I'm trying to make a snake with opengl but some vertices seem to go off, what can I do?<p>I've been trying to make a Snake in c++ with Opengl, the main compo... | <p>So hi, basically the answer was that I did an error that took me hours to find, it was such a simple error and yet it made opengl all act wrong, </p>
<p>I was setting up the buffer by using this : </p>
<pre class="lang-cpp prettyprint-override"><code> glBufferData(GL_ARRAY_BUFFER, size, data, GL_STATIC_DRAW);
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to align three divs to meet responsiveness using bootstrap<p>I want to display three divs horizontally on a web page in my laptop screen and show them ve... | <p>As you can find in <a href="http://getbootstrap.com/css/#grid" rel="nofollow">grid system Bootstrap</a>:</p>
<blockquote>
<p>Bootstrap includes a responsive, mobile first fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases. It includes predefined classes for easy ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to identify the mapped/owned sides of a self-referencing one-to-one relationship in Hibernate?<p>My Hibernate schema has a Port entity. Each Port should ... | <p>From the <code>OneToOne</code> API doc:</p>
<blockquote>
<p>If the relationship is bidirectional, the non-owning side must use the <code>mappedBy</code> element of the <code>OneToOne</code> annotation to specify the relationship field or property of the owning side.</p>
</blockquote>
<p>So, either your <code>con... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Function type signature in Haskell without using interpreter<p>For example I have following function: </p>
<pre><code>g x y z = [x] ++ (g x (z:y) (x:z))
</c... | <p>First, the type. This will be short version, as it's not too complicated.</p>
<p>In any exercise like this, you start by assuming values have unknown types. We'll start with <code>x</code>, which we assume has some type <code>a</code>. Now, where does <code>x</code> get used? One place is with <code>(:)</code> and ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using @Inject Instance to get EJB and CDI beans that implements specific interface<p>In our application we have CDI (@ApplicationScoped annotation) and EJB (... | <p>Quote from section 4.9.2.1 of EJB 3.2 specification:</p>
<blockquote>
<pre><code>@Stateless
public class A implements Foo { ... }
@Stateless
public class B extends A implements Bar { ... }
</code></pre>
<p>Assuming Foo and Bar are local business interfaces and there is no associated deployment descriptor, ses... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
NSForegroundColorAttributeName not working for UILabel<p>I have a problem changing substring color using "NSForegroundColorAttributeName". I'm confused since... | <p>The problem is this line:<br>
<code>NSMutableAttributedString *str = [addActivityLbl.attributedText mutableCopy];</code></p>
<p>I don't know the previous lines of your code, but it might be the case that <code>addActivityLbl.attributedText</code> is empty.</p>
<p>Secondly, using <code>NSAttributedString</code> wit... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R define levels without observations<p>Is it possible to define factor levels for values that are not present in a vector?</p>
<p>I'm trying to convert an i... | <p>It can be done, for example like this:</p>
<pre><code>x <- c(3L,3L,3L,3L,3L)
factor_levels <- c("Strongly disagree","Disagree", "Agree", "Strongly agree")
x <- factor(factor_levels[x], levels = factor_levels)
summary(x)
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Powershell tail multiple files command<p>I can tail one file via the following command:</p>
<p><code>Get-Content -Path C:\log1.txt -Tail 10 –Wait</code></p>... | <p>Based on @mjolinor's comment, I have come up with the following that appears to work,</p>
<pre><code>Workflow My-Tail
{
Param([string[]] $Path)
foreach -parallel ($file in $path)
{
Get-Content -Path $file -Tail 1 -Wait
}
}
My-Tail (dir C:\*.log -Include log1.txt,log2.txt)
</code></pre>
<p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Compare two tables and select records based on two conditions - not exists and no match<p>I have two tables and need to compare based on the first and last n... | <pre><code>select a.firstname
, b.firstname
, a.lastname
, b.lastname
, case
when a.firstname is null then 'B only'
when b.firstname is null then 'A only'
else 'both'
end
from TableA a
full outer join TableB b
on b.firstname = a.firstname
and b.lastname = a.lastname
order by coalesce (a.firstname, ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I Check how many queries a LinqToSql DataContext ran?<p>Is there any way I can check how many DB queries a <code>DataContext</code> ran?</p>
<p>I kn... | <p>In LINQ to SQL you have the option to log the generated SQL to a <code>TextWriter</code>. For instance you can log to the console:</p>
<pre><code>ctx.Log = Console.Out;
</code></pre>
<p>This will not give you a count of queries but it will provide you with the actual SQL executed which probably gives you a better ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Finding k-Nearest-Neighbor in R with knn() from class package<p>This is home work.</p>
<p>I have a 2 matrices, 1 for training and 1 for test.
The data has ... | <p>As the documentation states <code>cl</code> is the <code>factor of true classifications of the training set</code> i.e. your <code>y</code> variable (the third column of your training set). </p>
<p>This means that the function should be as follows:</p>
<pre><code>cl <- factor(c(2,0,2,1)) #or alternatively facto... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.