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:
Test subscribe functionality of paypal<p>I've created the paypal subscribe button and after going through the docs I'm having a real hard time understanding ... | <p>You just need to make sure you have 1 sandbox seller account (which it sounds like you've got working already) and 1 sandbox buyer account. Then you'll login with the buyer account, and make sure it's running on the sandbox.paypal.com server, of course. </p>
<p>As long as your login credentials for that sandbox b... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find matching element in list using delegate and lambda<h1>Edit</h1>
<p>My original question was not very clear, so I'd like to try to rephrase it now. Plea... | <p>Consider this example:</p>
<pre><code>var foos = new[] { "aaa", "aba", "aca" };
var bars = foos.Where(f => f.Contains("b")).Select(f => Regex.Replace(f, "b", "d"));
foreach (var bar in bars)
Console.WriteLine(bar);
// Output:
ada
</code></pre>
<p>Edit: I'll try to address your comment</p>
<p>A lambda... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to value-initialize aggregate types with list-initialization<p>How can one value-initialize aggregate types in C++14 with the list-intialization syntax?<... | <p><strong>[dcl.init.aggr]</strong>:</p>
<blockquote>
<p>7 - If there are fewer <em>initializer-clauses</em> in the list than there are members in the aggregate, then each member not explicitly initialized shall be initialized [<em>C++14</em>: from its <em>brace-or-equal-initializer</em> or, if there is no <em>brace... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Intellij can't import Java Libraries to use with Kotlin<p>Today I reinstalled Intellij on the version 2020 EAP (since I formatted my pc), and imported back m... | <p>Try to change the project SDK in <code>File | Project Structure | Project</code>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Scaffold-DbContext does not check-out updated files in TFS<p>I've done some ALTER changes in the database then I performed the scaffold command to update my ... | <p>Assuming you are using <code>Server workspace</code>, as with a <code>Server workspace</code>, modifying a file outside of Visual Studio, TFS doesn't seem to detect the change to the file.</p>
<p>It's suggested to use <code>Local Workspace</code>, with <code>Local workspace</code>, when you modify files outside Vis... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
why globalization in web.config makes fullcalendar not to render events<p><strong>This problem I am seeing is in mozilla, but works fine in IE</strong></p>
... | <p>Ok. After googling so much I found out answer for this. </p>
<p>I just need to set date as below for the events:</p>
<pre><code> events: $.map(data, function (item, i) {
var event = new Object();
event.start = moment(item.StartDate).utc();
event.title = i... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert string with point to symbol<p>I am trying to convert the string <code>"country."</code> to a symbol. I expect to receive <code>:country.</code... | <p>It's working as expected.
A symbol most of the time looks like:</p>
<pre><code>:symbol_name
</code></pre>
<p>However when the symbol contains special characters such as spaces or hyphens, or in your case a period, it needs to be enclosed in quotes:</p>
<pre><code>:"symbol name with-many special characters."
</co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Strange exception with Java8 Nashorn regex engine<p>I ran into a strange <code>java.lang.ArrayIndexOutOfBoundsException: 64</code> error while parsing text u... | <p>This is a bug in our regexp implementation. I've filed a bug for it:</p>
<p><a href="https://bugs.openjdk.java.net/browse/JDK-8073818" rel="nofollow">https://bugs.openjdk.java.net/browse/JDK-8073818</a></p>
<p>Update: You can use the <code>-Dnashorn.regexp.impl=jdk</code> option as a workaround. This makes Nashorn... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
NodeJS and MongoDB losing the definition of a variable even with module.exports<p>Hello i'm trying to fetch some partner names from my mongodb database and p... | <p>Your problem is not with module.exports, it's with <a href="https://stackoverflow.com/questions/16336367/what-is-the-difference-between-synchronous-and-asynchronous-programming-in-node">asynchronous programming</a>. When you call MongoClient.Connect, the code in your callback does not get executed synchronously. It ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Location of persistence.xml in appengine-skeleton-archetype<p>Where is the place of <strong>persistence.xml</strong> in <em>appengine-skeleton-archetype</em>... | <p>According to the official <a href="https://cloud.google.com/appengine/docs/java/datastore/jpa/overview-dn2#Setting_Up_JPA_2_0" rel="nofollow">Google App Engine Documentation for JPA</a>:</p>
<p>"<b>Creating the persistence.xml File</b></p>
<p>The JPA interface needs a configuration file named persistence.xml in th... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CSVHelper: logging errors when BadDataException is thrown<p>I'm trying to configure the BadDataException message to include more information like the where t... | <p>You created the <code>CsvConfiguration</code>, but you never use it. You can use it in the creation of the <code>CsvReader</code>.</p>
<pre class="lang-cs prettyprint-override"><code>CsvConfiguration csvConfig = new CsvConfiguration(CultureInfo.InvariantCulture)
{
BadDataFound = context => {
throw ne... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert one element lists to float<p>I'm trying to extract pressure values from openFoam output log.</p>
<p>I read the lines of file as strings and e... | <p>Try this:</p>
<pre class="lang-py prettyprint-override"><code>[press.append(float(p1)) for p1 in pressure]
</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 read Data that is not changing?<p>I am trying to read Data from a Firebase Realtime Database that is not changing. I need to know a Variable the Mo... | <p>When you attach a <code>ValueEventListener</code> with <code>addValueEventListener</code>, its <code>onDataChange</code> is called right away with the data at that location. It then gets called for any change to the data after that.</p>
<p>From <a href="https://firebase.google.com/docs/database/android/read-and-wri... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing data from $ajax call to highcharts<p>I have an ajax call</p>
<pre><code>$(function () {
$.ajax({
url: '../../getdaily.php',
type... | <p>Just wrap your <code>highcharts</code> in a function, pass the ajax response as the function's argument and load the data (in argument) to your <code>high charts</code>, as:</p>
<pre><code>function my_chart(response) {
$('#container').highcharts({
...
...
series: [{
type: 'pi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I count the characters in a string and then sort them alphabetically?<p>I am taking input from the user. I have that bit done. The input can be a word... | <p>How to count occurences in a string is explained here:
<a href="https://stackoverflow.com/a/881111/8935250">https://stackoverflow.com/a/881111/8935250</a>
I tried to mimic your example output in this code fiddle.</p>
<p>Methods I used:
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Globa... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
<H2> Underlined title auto-width on IE<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-co... | <p>With your help, I resolved my question.
The correct solution was to add an intermediate div like this :</p>
<pre><code><div class="box">
<div class="intermediate"><h2 id="skills">skills</h2></div>
<p>Lorem Ipsum.</p>
</div>
</code></pre>
<p>And then define as... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove a <script> tag in the <head> of all Drupal 7 pages<p>I inherited a Drupal 7 site that uses the Bootstrap 2.3.2 javascript via their CDN:</p>
<pre><co... | <p>To remove the cdn version of js, you need to log in as the drupaladmin/superadmin. Than go to Appearance > settings > your theme </p>
<p>In bootstrap settings go to Advance tab, expand BOOTSTRAPCDN. You can see BootstrapCDN version as a select box. You need to select option "Disabled" than save.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to make parent class Generic in java?<p>I have a situation where I have multiple DAO classes which I use to fetch result from hibernate querie... | <p>Generics simply provides a way to omit explicit casts.</p>
<p>If you can't do something with casting, you can't do it with generics either.</p>
<p>You can't do this with casting, so you can't do it with generics.</p>
<hr>
<p>I would question whether inheritance is really what you want here. An alternative would ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python: Filling colors between curves and axes & to regionalize the areas<p>I have a set of x,y values for two curves on excel sheets.
Using <code>xlrd</code... | <p>Here is a way to recreate the curves and the gradients. It resulted very complicated to draw the background using the logscale. Therefore, the background is created in linear space and put on a separate y-axis. There were some problems getting the background behind the rest of the plot if it were drawn on the twin a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Intuition behind Tortoise and Hare algorithm<p>I can write code using the Tortoise and Hare algorithm, and it works. But it doesn't make intuitive sense to m... | <p>If there is a cycle, you can think of it as an infinitely repeating number line.</p>
<p>At the start of the Tortoise and Hare algorithm, we place the hare one node ahead of the tortoise. But once they enter the cycle, you can think of the hare being positioned <em>behind</em> the tortoise.</p>
<p>The typical steps... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
System.IdentityModel.Protocols.WSTrust; Not Found<p>I been beating my head against the wall trying to get this to work. I have a project I did a while ago t... | <p>Check if the assembly is showing any warnings under Project -> References. I've sometimes found that one has a warning. Most commonly this is because there is a mismatch in the .Net version. </p>
<p>I've had a package add a .net 4.5.2 assembly into a project targeting .net 4.5 which exhibited similar behavior.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I determine if the mouse button is pressed in java<p>I've been looking for a while and could only fine semi-useful code and people nothing useful I kn... | <p>I am going to provide you a very simple and organized sample program that you can build on! Make sure to check out the main Java website if you need help understanding what each method does. Also in the program I have included a very simple main function for a frame, you are welcome to add onto it and test it. I hop... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how can delivry price in prestashop 1.6 vary depending on weight<p>I'm using prestashop 1.6
I want to know if prestashop allow me to display price of order t... | <p>You can setup this directly from your PrestaShop Back office within Carriers options, no need to create your own module.</p>
<p>To do so just go to :</p>
<ul>
<li><p>Carrier > Edit / Add Carrier > Go to step 2 of carrier setup.</p></li>
<li><p>Here you should see something like this: <a href="http://bit.ly/1AJQXZ9... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Nested namspace javascript<p>I'm writing a user interface in javascript, it will take data from the HTML and pass it through an API using javascript. I am tr... | <p>Just use the controller and action part as separate keys, instead of combining them:</p>
<pre><code>apiHandler[apiObject.controller][apiObject.action]();
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to echo a single session with Codeigniter?<p>I would like to read a single session.</p>
<p>This is how I set all my sessions:</p>
<pre><code>$data = ar... | <p>Try this:</p>
<p>build array</p>
<pre><code>$data = array(
'connection' => true,
'sender_db' => $this->input->post('sender_db'),
'sender_host' => $this->input->post('sender_host'),
'sender_user' => $this->input->post('sender_user'),
'sender_pw' => $this->inpu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Play! - how to reuse common logic for path fragment<p>I am currently using <strong>Play 2.3</strong> and I have to deal with similar URL mappings:</p>
<pre>... | <p>You said you are calling the method again and again in each controller function instead you can use <code>@With</code> annotation.For ex</p>
<p>create a class <strong>CheckUrl.java</strong></p>
<pre><code>public class CheckUrl extends play.mvc.Action.Simple {
public F.Promise<SimpleResult> call(Http.Con... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get report solutions from SQL Server Reporting Services?<p>How can one extract report solutions from SQL Server Reporting Services?</p>
<p>I may need... | <p>Yes that is possible. It depends on how many reports you have, but if you edit the properties of a report in the reporting services manager web site you can choose to download the rdl file, just add those to a new solution in visual studio.
Have a look at <a href="http://sql-articles.com/articles/general/download-ex... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Raw mysql statement with bindings in Laravel<p>I'm trying to run a raw mysql statement to Laravel's query builder, to create a new MySQL user.
Of course, I m... | <p>It looks like DDL queries are officially not supported by the most database servers. Check: <a href="https://stackoverflow.com/questions/17648861/can-we-use-ddl-commands-in-a-prepared-statement-postgresql">Can we use DDL Commands in a prepared statement (PostgreSQL)?</a></p>
<p>So, manually sanitising user input is... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to copy to memorystream from gzipstream<p>I want to compress a binary file in memory using <code>System.IO.Compression.GZipStream</code>. For this, I ... | <p>You need to "inverse" your logic: create GZipStream over empty MemoryStream and copy your original content into this gzip stream:</p>
<pre><code>using var compressedData = new MemoryStream();
using var gzip = new GZipStream(compressedData);
originalUncompressedStream.CopyTo(gzip); // <- "magic" happens here
gzip... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to call a Java program from PowerShell?<p>I need to call a java program (jar file )from PowerShell.
The following code works:</p>
<pre><code>java -jar $... | <p>You will need to use following format for powershell:</p>
<pre><code> Start-Process java -ArgumentList '-jar', 'MyProgram.jar' `
-RedirectStandardOutput '.\console.out' -RedirectStandardError '.\console.err'
</code></pre>
<p>Or other option you can use is Start-job:</p>
<pre><code>Start-Job -ScriptBlock {
&... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Case with NULL expression in SQL Server<p>I have a problem with this piece of code and i'm pretty sure the solution is quite easy, but i don't see it.</p>
<... | <p>If you would just like to replace the <code>'/'</code> with <code>NULL</code> and leave all other strings untouched, you can use the <code>NULLIF()</code> function e.g. <code>NULLIF(@Lo, '/')</code></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cannot render: React.renderComponent in my meteor app<p>Hi there I just started making my meteor app with react(jsx) in webstorm and I can't seem to find out... | <p>It looks like its just complaining about jsx and doesn't like the tags. Maybe try it without jsx for the renderComponent call?</p>
<pre><code> React.renderComponent(React.createElement(APP, null), document.getElementById('content'))
</code></pre>
<p>Otherwise, try converting all your jsx (including class defini... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do i perform click() on existing data-element in PDFTron?<p>Basically the scenario is, I have my custom button outside the viewer and i want to bind the ... | <p>vivek answer is the correct way to get the same behavior as the click event. Since the UI is using React, using <code>.click()</code> won't work because the button won't always exist on the DOM.</p>
<p>Also if you only want to set the tool mode without the header popup appearing, you can do something like the follo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
delay foreach until xmlhttprequest finishes the work<p>I tried to find an answer in StackOverflow and even searched elsewhere on the Internet, but I've had n... | <p>If your <code>uploadFile</code> function returns a Promise, then you can use <code>await</code> or a <code>.then(...)</code> callback with <code>Promise.all</code>:</p>
<pre><code>function uploadFile(file, i) {
return new Promise((resolve, reject) => {
var Url_imageAdd = "mytargetUrl...."
var xhr = ne... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Moving a value from 1 table to another<p>What's the best way to do the following using access 2007?</p>
<p>I want to move a value from 1 table to another. ... | <p>Using VBA you can do the following (on a button click for example):</p>
<pre><code>Private Sub Button1_OnClick()
Dim s as String
s = " insert into table2 (value) select 50 from table1 where id = 1; "
CurrentDb.Execute s
s = " update table1 set value = (value - 50) where id = 1; "
CurrentDb.Exe... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
spring-boot container not restarting after database-container booted<p>I am setting up CI for Gitlab right now. The goal is to deploy a docker container for ... | <p>I found the solution. I updated Spring to a newer version, from 2.1.4 to 2.1.6. Somehow, the version of Spring i used caused this problem.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
caller_method returns not the value, that i expected<p>I want to know, what method calls another method (I'm just trying to create simple expect("string").to... | <p>I would recommend against using <code>caller_method</code> in this case. Rather, make a class whose methods return <code>self</code> - that way they will be chainable:</p>
<pre><code>module Expectation
attr_accessor :caller_method
def expect(arg)
self.caller_method = "expect"
self
end
def to
cal... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Try to delete some duplicated white spaces with ' 'join(x.split()) but failed<p>My first question here for a very basic question in python but I've stuck for... | <p>You are splitting the value and then again joining them with spaces. This will create the original value again.</p>
<p>Also yopu are not assigning the value after split to the df. So checking the length of df value will return same.</p>
<p>Try this :</p>
<pre><code>print(df['NAME'][0])
len(df['NAME'][0])
df['Nam... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Babel Not Working Outside of Main Node.js App<p>My Express.js server is currently being started by running <code>start.js</code>, which in turn runs <code>s... | <p>As we discussed in the comments, the issue is that your seed file was not including the <code>@babel/register</code> code, hence it didn't transpile it. Per the suggestion with CLI args, you could modify it to use a single <code>module.exports</code> like:</p>
<pre class="lang-js prettyprint-override"><code>// Defa... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Typescript specialized overloads defined on a subclass or interface<p>Is there a way to make the following work without having to define an implementation in... | <p>Function overloads only get combined if they are call signatures on an object type. The easiest fix (for the interface case) is to separate out the function type into its own interface and extend that:</p>
<pre><code>interface EmitterEvent {
(name: 'one', handler: (value: number) => void): void;
(name: s... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google Maps v2 in the Android Studio. Not found GeoPoint<p>I am working on a code that was made in the Eclipse and i am migrating to Android Studio, however ... | <p>To work, i had that to replace the below line in the my Gradle file.</p>
<pre><code>android {
...
compileSdkVersion 16
...
}
</code></pre>
<p>To</p>
<pre><code>android {
...
compileSdkVersion "Google Inc.:Google APIs:16"
...
}
</code></pre>
<p><br/></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Need to copy all fields value of specific item on table to another item in SQL Server<p>SQL Server database snapshot:</p>
<p><a href="https://i.stack.imgur.... | <p>If I understand, you wan the IEDetails table to have the values for art_id = 7545 copied with a different art_id value while still retaining the original values? With the data shown, I am going to assume that the Id column is defined as an IDENTITY column</p>
<p>If so then this should work for you:</p>
<pre><code... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
uglifyjs javascript inside php files<p>My project has a lot of JS code inside PHP files. I want to minify the JS code in these files and I like the <a href=... | <p>What you're looking for does not exist.</p>
<p>The only real reason to have inline JavaScript inside your PHP files is because you need to interpolate PHP and JavaScript in order to dynamically generate some or all of the script. You cannot reliably minify such JavaScript <em>before</em> the PHP is actually process... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cast 2 decimal values only if currency is not 0.0000<p>I'm trying to print</p>
<p><strong>Condition 1</strong>: If currency appears as 0.00, then remove the... | <p>If you care about such details, then you need to cast the result as a stirng:</p>
<pre><code>(case when CAST([Money] AS NUMERIC(10,2)) = 0.00 then '0'
else cast(cast([Money] as numeric(10, 2)) as varchar(255))
end)
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reading integers from a txt file; not coming being recorded as itegers<p>I'm reading a long list of numbers from a text file.</p>
<p>The numbers are:</p>
<... | <p>Try:</p>
<pre><code>with open('file') as f:
array = []
for line in f:
array.append([int(x) for x in line.split()])
</code></pre>
<p><code>a.read()</code> takes an argument of file size and only returns a string type</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What does gcc __thread do?<p>I am really confused what does the keyword of gcc <code>__thread</code> do behind the back.</p>
<p>Could any one give me some i... | <p>It declares a variable as being <a href="https://gcc.gnu.org/onlinedocs/gcc-3.3.1/gcc/Thread-Local.html" rel="nofollow noreferrer">thread local</a> much in the same way as the C++11 <code>thread_local</code> keyword, the important difference being that <code>thread_local</code> allows static initialization whereas <... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The model's Hidden bool field remains False after it was set True in the controller<p>I have this property in my ViewModel class:</p>
<p><code>public bool A... | <p>I can't be sure that this is the problem from your question, but I would bet a lot of money that it is...</p>
<p>MVC's <code>ModelState</code>, which keeps a representation of the view's model data, preferentially pulls values from the POST data rather than getting them from a bound model. That is, if the HTTP POST... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Palindrome Checker in Mips<p>I'm taking a computer organization class that teaches the low level functions of computers through MIPS Assembly. One problem on... | <p>try this:</p>
<pre><code>.text
strlen:
# ------------
# arguments:
# a0 = string
# ------------
li $v0, 0 #set return value to 0
strlen_loop:
lb $t0, 0($a0) #load byte from beginning of the string
beq $t0, $0, st... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Calculate distance between vector of coordinates in 1 df and single coordinates in other df<p>Suppose I have the following two dataframes (with uneven rows)<... | <p>working with the sample data provided, I came to this <code>data.table</code>-approach</p>
<pre><code>library( data.table )
#set as data.tables
setDT(dfAB)
setDT(dfXY)
#melt to long format
dt1 <- melt( dfAB, measure.vars = names(dfAB) )[, c("x_AB","y_AB") := lapply( tstrsplit( value, ",&q... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert base64 artifact to json/yaml in spinnaker?<p>I'm trying to use the SpEL in Spinnaker pipeline to convert an artifact from base64 to JSON becau... | <p>Use <code>#fromBase64(string)</code> and <code>#readJson(string)</code> helpers</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error request for member getName which is of non-class type 'char'<p>I'm trying to make a program involving files <code>assign2.cpp</code>, <code>Player.h</c... | <p>In the <code>Team</code> constructor on this line</p>
<pre><code>playerObject = newPlayerObject;
</code></pre>
<p>you're trying to assign a value of type <code>char*</code> to a member of type <code>char[40]</code>, which doesn't work, since they are two different types. In any case, you probably would need to cop... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mockitio - returning null when expecting mock in unit test<p>I have a method in a class called <code>FruitBasket</code> which I would like to test as so:</p>... | <p>Your call to <code>fruitBasket.getFruit("Apple");</code> results in invocations of <code>FruitDao</code> which has not been configured yet so as to know what invocations to expect and how to respond to them. I suppose mockito's default behavior when it has no clue what to do is to just return null instead of throwi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Setting dataSource for NSTableView across scenes in a storyboard<p>I am using XCode 6 on OS X 10.10 and have a storyboard containing a window with a split vi... | <p>In your <code>NSSplitViewController</code>-subclass <code>viewDidLoad</code>-method set the data source programmatically. You need to implement the child view controller class as well (with the <code>tableView</code> outlet connected to the control).</p>
<p>MySplitViewController.m</p>
<pre><code>- (void)viewDidLoa... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I retrieve all elements from a form?<p>I want to get all the elments in a form. I can do that using <code>document.getElementById('form').elements</co... | <p>Fastest way:</p>
<pre><code>var result = document.getElementById('form').elements;
console.log(result);
for(var key in result)
{
if(result.hasOwnProperty(key))
console.log(key, ' = ', result[key]);
}
</code></pre>
<p><a href="http://jsfiddle.net/8Lt6xrb8/2/" rel="nofollow">http://jsfiddle.net/8Lt6xrb... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to download YouTube video subtitles in English using youtube-dl?<p>I have tried to download subtitles along with the video using the following Python 3.x... | <p>You need to set <code>'writesubtitles': True</code> for youtube-dl to download subtitles. Also, you should specify <code>[ext=mp4]</code> or the program may download .webm files which are incompatible with mp4 format. The following code solves these problems:</p>
<pre><code>from __future__ import unicode_literals
im... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to write a program to print a floating number up to 2 decimal places using string formatting in Pyhton<p>I have this, but it does not work</p>
<pre><cod... | <p>In place of "int" you can use "eval" <a href="https://towardsdatascience.com/python-eval-built-in-function-601f87db191" rel="nofollow noreferrer">more about eval</a> </p>
<pre><code> number = eval(input("Please give the number"))
print("Formatted Number: " + "{:.2f}".format(number));
print(number)
</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 change the color of this text?<p>This is the site:</p>
<p><a href="http://avocat.dac-proiect.ro/wp/?page_id=19" rel="nofollow">http://avocat.dac-p... | <p>Try this</p>
<pre><code>.contactform11
.wdform-label {
#000;
}
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Identify The People A User Follows In TableView Swift<p>I am implementing a search for users in my app that shows all users and displays a follow button next... | <p>At the advice of @Jay, I built an array in the parent tab and then accessed that array from my <code>SearchUsersViewController</code> with the following:</p>
<pre><code>let tbvc = self.tabBarController as! CustomTabBarController
follows = tbvc.follows
for person in follows {
//Check if the person in t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to styling picture in div?<p>So i making shop and i want to styling the image.
Right now i don't see the faces in the div:</p>
<p><a href="https://i.sta... | <p>When you are using background-position: top -50px center you will break the intention of background-size: cover; because it (cover) will determine whether to "crop" the image horizontally or vertically based on the size of the image, so if the cropping is happening on the sides, 50px of the top of the image will be ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
android.content.res.Resources$NotFoundException: String resource ID #0x4<p>I've been trying to make a timer app. The user will input seconds and the seek bar... | <p>I think problem is here:</p>
<pre><code>textView.setText(secondsLeft);
</code></pre>
<p>try:</p>
<pre><code>textView.setText(String.valueOf(secondsLeft));
</code></pre>
<p>It's not possible to place integer values into TextView.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
thread_info returns MACH_SEND_INVALID_DEST instead of KERN_SUCCESS<p>A call to <code>thread_info</code> now returns <a href="https://developer.apple.com/libr... | <p>I now <code>wait</code> for an <code>NSCondition</code> inside the <code>NSOperation</code> (after it invoked the asynchronous service, i.e. at its very end) and <code>signal</code> it in the completion handler. That seems to have resolved the issue.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JavaScript: Regex to replace this "2018Jun12-2018Jul11" date string with this "Jun 12, 2018 - Jul 11, 2018" date string<p>If I have the following string:</p>... | <p>Though this involves a bit of string formatting logic via a "replacer" callback, one solution that is based on <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace" rel="nofollow noreferrer"><code>String#replace()</code></a> would be:</p>
<p><div class="snippet" d... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What's the most efficient inter-process communication method for a high-bandwidth data stream on a Mac?<p>I have a C++ program (running under MacOS/X) that g... | <p>You certainly can't beat shared memory if you can manage the synchronization. Single copy in memory, no other movement. Your only "slow" point will be any fighting over who can do what, and where.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why app name not showing on the top while installing?<p>please help I extracted my apk but app name not showing on the top of install wizard. See the image</... | <p>You probably didn't set the <code>android:label</code> name in <code>AndroidManifest.xml</code>.</p>
<p>Make sure you have something like this:</p>
<pre><code><activity
android:label="App Name"
android:icon="@drawable/icon"
android:name=".activity.LauncherActivity">
</activity>
</code></p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Very slow StreamReader for medium sized files.<p>I am reading text files into program(they are code in Unicode, the output must be in utf-8). The code below ... | <p>Use StringBuilder instead of String:</p>
<pre><code>int next;
StringBuilder storage = new StringBuilder();
using (StreamReader sr = new StreamReader(path)) {
while ((next = sr.Read()) != -1) {
storage.Append(Char.ConvertFromUtf32(next));
}
sr.Close();
}
string result = storage.ToString();
</code... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Resample numpy array with interpolation<p>I am processeing 5 images in Python that have been imported as numpy arrays and have the following shape:</p>
<pre... | <p>I came up with a solution but I am wondering if it is correct from a technical/scientific point of view. Is this good procedure to solve my issue? Practically, it is doing what I want...</p>
<pre><code>for i in range(len(S_images)):
if S_images[i].shape[1] !=1524:
S_images[i] = scipy.ndimage.zoom(S_imag... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# web api, how to handle exceptions and return appropriate status code<p>I am creating a .net core web api that may throw an exception, in this case it cant... | <p>you could handle this in the <code>Configure</code> method of your <code>Startup.cs</code>. Something like the following:</p>
<pre><code>public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
{
app.UseExceptionHandler(appBuilder =>
{
appBuilder.Run(a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
UITabBarController Header with Title<p>I have been trying to hours to implement a simple UITabBarController where each view (or tab) has an active header (or... | <p>Changing the values of those simulated metrics fields on a storyboard or nib will not actually have any effect on the UI. It's a design/layout aid. </p>
<p>You will need to embed the view controllers within navigation controllers or drag navigation bars into the views. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a syntax to define cyclic reference between anonymous nodes in Turtle RDF?<p>I'm looking for a turtle syntax for calling the anonymous node who call... | <p>RDF's data model is graph-based, not hierarchical, so there is no notion of parent/child relationships between resources, and hence no built-in syntax to refer to 'parent' nodes when nesting anonymous resource descriptions with the <code>[]</code> construct (which is really just syntactic sugar for grouping together... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert group by SQL query to Entity Framework<p>Please guide me how to convert this query into an Entity Framework query? </p>
<pre><code>select
... | <p>Assuming the type of your CreatedOn column is datetime, you can make a good use of DbFunctions.TruncateTime for this situation:</p>
<pre><code>ICollection<GroupedRow> result = context.TableName.GroupBy(t => DbFunctions.TruncateTime(t.CreatedOn))
.Select(g => new GroupedRow()
{
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Summing sliced list using arrays of indices<p>I have an array of indices of the form</p>
<pre><code> b1c_loc= [
(1843, 1854, 63),
(32144, 32155, 56)... | <p>If you want to access the first and second elements of each tuple just unpack:</p>
<pre><code>b1c_loc= [
(1843, 1854, 63),
(32144, 32155, 56),
(32516, 32556, 71),
(32589, 32600, 60),
(34081, 34092, 66),
(35600, 35611, 67),
]
print([b - a for a, b, _ in b1c_loc])
[11, 11, 40, 11, 11, 11]
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Empty array returned when calling AlphaVantage APIs for NASDAQ tickers<p>I cannot get <em>any</em> NASDAQ data from the Alpha Vantage TIME_SERIES_DAILY, TIME... | <p>TLDR;</p>
<p>Just look up the symbol (ie. <code>AAPL</code> or <code>GOOGL</code>). The <code>IXIC</code> is an index, Alpha Vantage currently does not cover indexes. </p>
<hr>
<p>Further notes:</p>
<ol>
<li><p>Quotes from <a href="https://www.alphavantage.co/" rel="nofollow noreferrer">Alpha Vantage</a> are agg... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Finding elements in the shadow DOM<p>Protractor 1.7.0 has introduced a new feature: a new locator <a href="https://github.com/angular/protractor/commit/d220e... | <p>To answer your question, here's a related question: "what information does shadow dom provide that looking at raw html does not?"</p>
<p>The following snippet creates a shadom dom (view via chrome or firefox):</p>
<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snip... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Elements vs Components in Flutter<p>Our team is planning on rewriting a mid sized app that was mostly in React. We are drawing a new architecture in Flutter.... | <p>I think "components" is vocabulary for Material Design. Components are design concepts. <a href="https://material.io/components/" rel="nofollow noreferrer">https://material.io/components/</a> </p>
<p>"Widgets" are classes in Flutter. </p>
<p>Flutter widgets are often implementations of Material Design components.<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Circular linked list in Java, when to point to first node?<p>I need to implement a circular single-linked list data structure. What I'm having trouble unders... | <p>The only special case is when <code>firstNode == null</code>, which is the initial case.</p>
<p>After that, the first <code>add</code> will give a node whose next element is self:</p>
<pre><code>public void addLast(E newElem) {
SNode<E> newNode = new SNode<E>(newElem);
if(firstNode == null) {
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
mySql match any character from the string<p>I'd like to be able to match any of the given characters to the WHERE clause.</p>
<p>For example if I have entry... | <p>I ended up doing it like this:</p>
<pre><code>$filter = implode('%',str_split($filter));
$filter = '%'.$filter.'%';
</code></pre>
<p>and then executing sql:</p>
<blockquote>
<p>select * from products where name like $filter</p>
</blockquote> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make automatic assignment of id values in the form of creating an item<p>I have form of creating shop item which was generated by Gii.</p>
<p>So i my... | <p>You should not include attributes that are managed automatically or by programmer in model validation rules. Validation make sense only for user entered data.</p>
<p>Remove <code>id</code> from that line and everything should be OK:</p>
<pre><code> [['id', 'category_id', 'price', 'in_stock', 'discount', 'created_a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to locate elements using text in xpath<p>I'm trying to locate an element by using text in xpath like this <code>//*[contains(text(),'Provider is 3243 ... | <p>After spending a couple of hours I found a solution. For my case, every word was showing with a new line and I resolved it by this way</p>
<p>Either: <code>//*[contains(., 'Provider is 3243 miles away')][normalize-space(text())]</code></p>
<p>Or: <code>(//*[contains(., 'Provider is 3243 miles away')])[last()]</cod... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cross Sub Domain Cookie<p>I'm trying to carry my cookie across sub domains, but I can't seem to get it to carry. I want the domain to be .apus.edu in the coo... | <p>Well I'm not 100% sure what is going on in that huge block of code. However if you set your cookies domain to <code>.apus.edu</code> then it will be available to <code>*.apus.edu</code>.</p>
<p>I.E. Where you have:</p>
<pre><code>Set_Cookie(CookieNameAMU, CookieValueAMU, '', '/', '', '');
</code></pre>
<p>Should ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vuex promise reject returns undefined<p>I want the promise reject to return the error to my method but the response is empty inside my methods then() functio... | <p>My solution is to 1. dispatch an action whenever an error is thrown which updates state 2. watch state change in view and do something with it</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
node.js server and HTTP/2 (2.0) with express.js<p>Is it possible currently to get node.js HTTP/2 (HTTP 2.0) server? And http 2.0 version of express.js?</p> | <p>If you are using <code>express@^5</code> and <code>http2@^3.3.4</code>, then the correct way to start the server is:</p>
<pre><code>const http2 = require('http2');
const express = require('express');
const app = express();
// app.use('/', ..);
http2
.raw
.createServer(app)
.listen(8000, (err) => {... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Put Null results of SSRS column group to the last<p>I am struggling with a challenge in SSRS and your help would be appreciated.
I have a dataset of hours an... | <p>If you add a row number to each record you can do this easily.</p>
<p>Make your dataset query something like </p>
<pre><code>SELECT
A_Service_Hours, Service_Minute
, ROW_NUMBER() OVER(PARTITION BY A_Service_Hours ORDER BY Service_Minute) AS RowN
FROM myTable
</code></pre>
<p>This will give you the follow... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Storing tibbles inside of tibbles<p>I want to create a tibble column that stores other arbitrary tibbles.</p>
<p>I have managed to do this with the followin... | <p>We can use <code>map</code> to create a new column</p>
<pre><code>library(dplyr)
library(purrr)
df_outer %>%
mutate(data = map(row_number(), ~ .x * df_nested))
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Subscript out of range / listobject exists but not found<p>I want to automatically add a row if the last row is filled of my listobject. But the listobject i... | <p>maybe you can adjust this to your needs? Again, I'm unsure what exactly you want so I wrote it as generic as I could. </p>
<pre><code>
Sub test()
'Goes through all sheets
For i = 1 To ThisWorkbook.Sheets.Count
'And through all listobjects on those sheets.
For j = 1 To ThisWorkbook.Sheets(i).ListObj... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Intercept and retry call by means of OkHttp Interceptors<p>I need to retry request inside of <code>OkHttp Interceptor</code>. For example there is incoming r... | <p>Use <code>.interceptors()</code> instead of <code>.networkInterceptors()</code> which are allowed to call <code>.proceed()</code> more than once.</p>
<p>For more information see: <a href="https://square.github.io/okhttp/interceptors/" rel="noreferrer">https://square.github.io/okhttp/interceptors/</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Javascript using if else to determine array value<p>I'm trying to repeatedly get 2 inputs and store them into an array until the word 'end' is typed, afterwh... | <p>Aside from <a href="https://stackoverflow.com/a/60186615/157247">the arrow function thing Nina points out</a> <em>(how did I miss that?!)</em>:</p>
<p>You're comparing strings, not numbers. When you compare strings containing digits, the results are not the same as comparing the numbers they would evaluate to.</p>
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing Methods in Java<p>I'm trying to accomplish passing a method in Java.</p>
<p>Here is the birds-eye-view of what I'm trying to do as a dummy example:<... | <p>You're writing the expression <code>B::methodOne</code> in a static context.</p>
<p>non-static methods have an invisible parameter, called 'the receiver': It's the instance.</p>
<p>So, in a static context, <code>B::methodOne</code> has the signature: <code>(B, String) -> String</code>. What your bind method wan... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the efficient way to hit api of Autocomplete text on keyup/keypress event in React / JavaScript?<p>We want to implement autocomplete input functional... | <p>Anyone can use this <strong>debounce and throttle</strong> functionality in WebApps and React native apps too. It's very useful while we want autocomplete Input text with api call.</p>
<p><strong>Throttling</strong></p>
<blockquote>
<p>Throttling is a technique in which, no matter how many times the user
fires... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Hibernate log per HTTP request directly in HTML page<p>I would like to display all the SQL queries executed by Hibernate in order to serve a particular HTTP ... | <p>I use custom Hibernate Interceptor implementation to count executed queries per request and Spring's HandlerInterceptor to intercept requests and start the timers/counters.</p>
<p>General idea is the following:</p>
<ol>
<li>Register HandlerInterceptor to intercept all reqeusts</li>
<li>Before request starts, store... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MongoDB Erlang Driver find limit occurs where?<p>I'm trying to integrate MongoDB driver in Erlang.</p>
<p>After some coding it appears to me that the only w... | <p>I think you could use the <code>batch_size</code> parameter.
The following code is from <code>mongo.erl</code> file</p>
<pre><code>%% @doc Return projection of selected documents starting from Nth document in batches of batchsize.
%% 0 batchsize means default batch size.
%% Negative batch size means one b... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to run `pip` in a virtualenv with subprocess.check_call()?<p>I'm trying to launch a command in different Python virtualenvs using <code>subprocess.check_... | <p>PATH is not the first place where <code>CreateProcess()</code> used by <code>Popen()</code> on Windows looks for the executable. It may use <code>pip.exe</code> from the same directory as the parent <code>python.exe</code> process. The shell (<code>cmd.exe</code>) uses different rules. See <a href="https://stackover... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spring Boot Logging and Google Cloud Platform Log Viewer<p>I'm running a Spring Boot application within the Google Cloud Platform and viewing the log files v... | <p>Since recent runtimes, <code>AppEngine</code> is evolving with a behaviour that is more and more converging with a container based approach, more "opened" as new other products (like Cloud Run for example). </p>
<p>This is changing a little the way we're developing with <code>GAE</code>, specific legacy libraries a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
font awesome line chart not showing up correctly<p>I want to use the font awesome line chart icon in my code. I am using the <code>font-awesome.css</cod... | <p>In the head section of your website add this:</p>
<pre><code><link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
</code></pre>
<p>Usually, an empty square means that the font is not loaded properly, so hopefully this will solve your problem</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rewriting file using O_TRUNC<p>I need to read the contents of a binary file into a buffer, perform an operation on that buffer, than to rewrite the contents ... | <p>Change your second open call to</p>
<pre><code>file = open(argv[1], O_WRONLY | O_TRUNC);
</code></pre>
<p>and I think you will get what you want.</p>
<p>BTW, you should check return results from things like open, read, write and close. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can you create a clipped NavigationDrawer below the AppBar?<p>How can you create a clipped NavigationDrawer below the AppBar?</p>
<p>The latest Android S... | <p>This turned out to be a little trickier than I thought i'd be but this error message helped get me there:</p>
<blockquote>
<p>DrawerLayout must be measured with MeasureSpec.EXACTLY</p>
</blockquote>
<p>Here is the <strong>Kotlin</strong> solution:</p>
<ol>
<li><p>Create a new class that extends the DrawerLayout... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
circular array Queue (conceptual)<p>for circular arrays Queues, is a scenario possible where back < front and size < capacity? </p>
<p>or is that when... | <p>Yes, back < front and size < capacity is valid state in a circular buffer/queue. Note that size is generally implicit and calculated as <code>(back-front)%capacity</code>. The Wikipedia article on circular buffers has a great description of how circular buffers function: <a href="http://en.wikipedia.org/wiki/C... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Writing output to text file in a class in java?<p>I'm having an issue of writing output to a text file. I'm not too sure on how to go about it. I've tried to... | <p>You have asked a very good question, because it describes an instance of a design consideration common to all software.</p>
<p>The topic here is separation of business logic from interfaces. Even more generally, it's a discussion of well-defined responsibilities in an object-oriented program.</p>
<p>Ideally your b... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to count words with one syllable in a list of strings of one word using regular expressions<p>I'm trying to count the number of words, in a pretty long t... | <p>Because you're trying to use findall function against the list not the string, since <code>findall</code> works only against the string . So you could try the below.</p>
<pre><code>import re
f = open('file')
war = f.read()
warlow = war.lower()
warsplit = warlow.split()
def syllables():
count = 0
for i in w... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What's the best way to initialize an object with defaults where values are omitted in Ecmascript 6?<p>Let's say I want to declare an object <code>bar</code> ... | <p>You can elegantly use the spread operator to achieve this,</p>
<pre><code>var foo = {prop1: "", prop2: "works"};
console.log(foo);
var defaults = {prop1: "default1", prop2: "default2", prop3: "default3"}
var bar = {...defaults, ...foo}
console.log(bar);
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Laravel Request::all() Should Not Be Called Statically<p>In Laravel, I'm trying to call <code>$input = Request::all();</code> on a <code>store()</code> metho... | <p>The error message is due to the call not going through the <code>Request</code> facade.</p>
<p>Change</p>
<pre><code>use Illuminate\Http\Request;
</code></pre>
<p>To</p>
<pre><code>use Request;
</code></pre>
<p>and it should start working.</p>
<p>In the config/app.php file, you can find a list of the class ali... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.