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:
Where does Jupyter QtConsole save its past commands<p>If I close an instance of Jupyter QtConsole, and open a new instance, hit the <code>Up</code> key. Then... | <p>Going through the source the call stack is like:</p>
<pre><code>HistoryConsoleWidget.history_previous()
HistoryConsoleWidget._get_edited_history()
HistoryConsoleWidget._set_history()
JupyterWidget._handle_history_reply()
</code></pre>
<p>Can't find anything further, so thought this might be a Jupyter thing. Googli... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PHP move_uploaded_file successfully uploads but returns false<p>I am trying to create an upload for a picture to a website. I am also trying to resize the im... | <p>The problem is you create the image with <code>imagejpeg($tmp,$newtarget)</code> which creates the image and store it the specified path and you try to move the same file that is already created and stored on the server. <code>imagejpeg</code> will create the image and store it on the server without using <code>move... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
shuffle then sort a db query ruby<p>I am trying to display a list of articles, sorted by day, but displayed randomly for each day. </p>
<p>This is what I ha... | <p>A little insight on your code first: <code>all</code> will fetch ALL records from the database and pass it to your ruby code, this is resource and time consuming. Then the <code>shuffle</code>, <code>sort_by</code> and <code>reverse</code> are all executed by ruby. You will quickly hit performance issues as your dat... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Auto Layout: Square Image View with equal width / height<p>The title might seem a bit complicated so I'll just show you what I want in some pictures.</p>
<p... | <p>First of all switch mode from <strong>w:Compact/h:Any</strong> to <strong>w:Any/h:Any</strong>.
By adding constraints in this mode you will apply them for all devices and orientations.</p>
<p>Here is list of constraints that you need to apply:</p>
<p><img src="https://i.stack.imgur.com/8DEdM.png" alt="enter image ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using an ArrayList of objects in Java (Processing)<p>I have created the following sketch in Processing (Java):</p>
<pre><code>ArrayList<Piece> pieces ... | <p>I believe</p>
<pre><code>x = x;
y = y;
</code></pre>
<p>should be </p>
<pre><code>this.x = x;
this.y = y;
</code></pre>
<p>in your Piece() constructor. x=x just sets the value to itself, using the <code>this</code> keyword will set your Piece's values according to the ones you are trying to pass in.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why are these two overloaded functions declared differently?<p>I am currently reading up on overloading functions and I came across two examples in my book, ... | <p>You need the value returned by the <code><<</code> operator to be a reference, so that it actually returns the original <code>ostream</code> object and not a copy of the object. This is why it works to string several <code><<</code> calls together:</p>
<pre><code>std::cout << "Hey"; // Prints "Hey... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get app download link from Diawi on Laravel<p>How can i get the downloadable link of uploaded apps in laravel? I want to store the links in mysql. I h... | <p>It's simple, when your upload succeeds Diawi returns you a Job ID, by which you can create a tracker link and make a GET request on it. There in response you can get the download link (or error message if the file failed Diawi's checks.. wrong format?)</p>
<p>The link format is like </p>
<pre><code> https://upload... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding url path to backend HAPROXY<p>I want to add a path to url if only no path defined. E.g. </p>
<p>hostname:8080 -> then add /fe: -> hostname:8080/f... | <p>This part is little tricky to implement, but not that hard to work. Something like this works.</p>
<pre><code>acl p_root path -i /
acl is_domain hdr(host) -i myhostname.io
redirect code 301 location myhostname.io/fe if is_domain p_root
</code></pre>
<p>Hope this is helps.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Migrating my analytical project from log4j 1.x to log4j 2.x and observed third party dependency as log4j 1.x<p>Recently, we migrated my project from log4j 1.... | <p>In 99% or more of the cases removing the Log4J 1.x jar should cause no problems. However, some libraries try to manipulate logging by calling Log4J internal methods. For the most part those will all be ignored, which shouldn’t cause a problem. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I make the data values to be in three decimal places?<p>This app is almost over, but I need the output data values to be in three decimal places for t... | <p>You can format a double, specifying the number of decimal places as follows:</p>
<pre><code> double d = 1.234567;
DecimalFormat df = new DecimalFormat("#.###");
System.out.print(df.format(d));
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add specific word randomly to targeted txt file using php?<p>I want to add words into a txt document into sentences from the selected list in a text d... | <ul>
<li>you can use <code>file_get_contents</code> to read the file</li>
<li><code>explode(" ", $content)</code> to split the contents of the file on a space so you get an array with words. </li>
<li>then you can insert the new words in random places in that array using <code>array_splice</code>. </li>
</ul>
<p>-</p>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
The mappings Entity and another Entity are inconsistent with each other<p>I have a problem with my relations between my entities.</p>
<p>My first entity User... | <p>If one side of the relationship is <code>ManyToOne</code>, then the other side of the relationship has to be <code>OneToMany</code>.</p>
<p>You have two relationships going from Ticket to User. One is a <code>ManyToOne</code>, where your mapping seems to say: a <code>User</code> may have many <code>Ticket</code>s. ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Embedded Google calendar not displaying unless logged into Google account<p>I'm trying to embed my Google calendar using an iframe in a small website that I ... | <p>Set your calendar to be publicly viewable.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to increase font of a Multi page caption<p>I have a userform with 12 multi pages. I want to increase the font size of each page caption,as the default fo... | <p>You can do that only for the whole multipage not for a single page. Use this example:</p>
<pre><code>Private Sub UserForm_Initialize()
MultiPage1.Font.Size = 16
MultiPage1.Font.Name = "Courier"
MultiPage1.Font.Bold = True
MultiPage1.Font.Italic = True
End Sub
</code></pre>
<p><strong>Edit:</strong> You can... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I export my iOS project in Xcode 6.1.1?<p>I fell pretty stupid but I am to the point where I want to send my app to some friends to be tested. I was w... | <p>Without a developer account, you can't. </p>
<p>After you get your developer account, you have to create your <strong>Distribution Certificate</strong> and <strong>Ad Hoc Provisioning Profile</strong> based on the UDID collected from your friend's device.</p>
<p>Alternatively, you can use TestFlight feature in iTu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to pass parameter on onSelectNotification for flutter_local_notification plugin<p>Sorry, I am new to flutter and currently facing difficulties... | <p>You can encode your <code>Note</code> object to a JSON string and pass that into the method to set your reminder like below:</p>
<p>Say this is your <code>Note</code> class:</p>
<pre class="lang-dart prettyprint-override"><code> import 'package:meta/meta.dart';
import 'dart:convert';
class Note {
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Simple DB query - GAE cloudSQL<p>I have a DB of size 50GB where the number of columns are 12. I have indexes on few of the columns. I am unable to get result... | <p>To make you query work faster you could add a multi-column index, for your <code>domain</code> + <code>type</code> + <code>time</code> columns (or at least <code>domain</code> + <code>type</code>):</p>
<pre><code>CREATE INDEX idx ON logs (domain, type, time);
</code></pre>
<p>If you have just separate indexes on <... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MySQL PDO Name-Value Prepared Statement Using Last Parameter Only<p>As titled, I'm using MySQL PDO with a prepared statement, and when executing, I'm getting... | <p>Thanks for all the help everybody!</p>
<p>I went with Michael's solution, but tested Ryan's too.</p>
<p>i.e.</p>
<p>Update to note as solved. Using...</p>
<pre><code>$stmt->execute($params); // scrap the foreach nonsense...
</code></pre>
<p>bindValue() rather than bindParam() is also appropriate.</p>
<p>To ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing precision as parameter to python format<p>I want to format a float with the precision as parameter</p>
<pre><code>"{0:,.2f}$".format(1000 + 1/float(... | <p>You can nest the format fields to dynamically specify the precision:</p>
<pre><code>>>> "{1:,.{0}f}$".format(2, 1000 + 1/float(3))
'1,000.33$'
>>>
</code></pre>
<p>From the <a href="https://docs.python.org/2/library/string.html#formatstrings" rel="noreferrer">docs</a>:</p>
<blockquote>
<p>A <c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I get the correct scale of a band array in GDAL Python?<p>I am new to using GDAL in Python and I am trying to use it to retrieve the band data from Se... | <p>It's good to be aware that even if the scale/offset are specified in the file, GDAL won't automatically apply them. </p>
<p>In the case of Sentinel 2 they are not specified in the file, but in the metadata (xml). You can look in the xml-file you are using in your example with a text editor. And search for "QUANTIFI... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
XML DOM SelectSingleNode() with namespace not returning the node<p>I have hit a problem with selecting nodes with namespaces in MSXML. The XML has been gener... | <p>The cause of this problem lay in not understanding that namespaces represented by prefixes must match. The source xml generated by the ADODB recordset has its own namespaces declared as follows:</p>
<pre><code>xmlns:rs='urn:schemas-microsoft-com:rowset'
xmlns:z='#RowsetSchema'
xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mongoose doesn't save array with mixed type<p>Do I have to define an <code>errorMessages</code> subdocument to save an array with mixed types? (Also how woul... | <ol>
<li><p>Using <code>[Object]</code> is unnecessary, as it is equivalent to <code>[]</code>, which is an array of the <a href="https://mongoosejs.com/docs/schematypes.html#mixed" rel="nofollow noreferrer">Mixed SchemaType</a>.</p></li>
<li><p>Mongoose doesn't (or at least in my case) save the default Node errors, wh... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Azure API Management - how to enable HTTP/2 via PowerShell command?<p>I'm looking for the correct PowerShell syntaxt to enable HTTP/2 setting for an Azure AP... | <p>For some reason the PowerShell command did not work for me, so I did this with bash (and jq). First modify the customProperties and store it in a variable:</p>
<pre><code>customPropertiesNew=$(az apim show -n $APIM_NAME -g $APIM_RG --query customProperties | jq '."Microsoft.WindowsAzure.ApiManagement.Gateway.Pr... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
jquery click event not working in a usercontrol<p>I have a button in a usercontrol and some jquery javascript, the click callback wont call.</p>
<p><div cla... | <p>I found that putting the javascript inside a js file and importing it in the main page worked.</p>
<p>I also used the pageLoad function solution within that file. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Receive SMS Messages only when Activity in Running<p>I am building an Android application that receives SMS messages and displays them from a particular gate... | <p>Just check whether your Activity is in foreground or not </p>
<p>Add this to your Activity
private static boolean isInForeground;</p>
<pre><code>onResume(){
super.onResume();
isInForground = true;
}
onPause(){
super.onPause();
isInForground = false;
}
</code></pre>
<p>And in your Receiver class check lik... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Open graph tag HTML not working in Whatsapp, when I share my Url<p>Hello there why link url on my website does't show preview or thumbnail when I share the l... | <p>Try to use the link direct to images as urls. For example:</p>
<pre><code><!-- Open Graph -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://periferia.app">
<meta property="og:title" content="My site fro... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
While loop with A+ promises in JavaScript / node.js<p>I need to keep calling remote API until I get the response I need, and I would like to use the Official... | <p>Something like this should work well: </p>
<pre><code>var remoteApiCall = function(num){
// fake function to resolve promise if random number in range
return new Promise(function(resolve, reject){
return ((Math.random()*10) < num)
? resolve(true)
: reject(false);
})
}
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
400 BadRequest while loginning in to website on Android<p>whenever I try to login to a website on my app I recieve a 400 BadRequest error. But when I do the ... | <p>I found the mistake by myself</p>
<p>The OutputStream method writeBytes() has to be</p>
<pre><code>wr.writeBytes("request=" + postParams);
</code></pre>
<p>instead of </p>
<pre><code>wr.writeBytes(postParams);
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ValueError: You are trying to merge on object and float64 columns. If you wish to proceed you should use pd.concat<p>I want to find FRAUD rate for all featur... | <p>Here you go:</p>
<pre><code>import pandas as pd
df = pd.DataFrame({'Model': ['audi', 'audi', 'bmw', 'bmw', 'ford', 'ford'],'Age':[1,2,1,2,1,2] , 'Fraud': [1,1,0,0,1,0]})
# group df by Age
grouped_age = df.groupby('Age', as_index=False).mean()
merged_df = pd.merge(df, grouped_age, on=['Age'], how='inner')
df = mer... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Decode regex into dictionary in Python<p>I have regex string in Python string</p>
<p>I want to be able to decode the following string
and map them into a di... | <p><code>tt</code> is not a valid JSON string - it seems you failed to post the <code>ValueError</code> message you received when calling <code>json.loads(tt)</code>. </p>
<p>If you <code>json.dumps(tt)</code>, then you simply encode the whole multiline string to a JSON object that, when parsed, decodes back to a stri... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using swap! on a nested map<p>I'm following Chapter 6 of the book Professional Clojure.</p>
<p>App state is currently defined as follows:</p>
<pre class="l... | <p>I think you can just use <code>assoc-in</code> in this case which is a bit simpler than <code>update-in</code> and better describes what you're trying to achieve:</p>
<pre><code>(def app-state
(atom
{:projects
{"aaa"
{:title "Build Whip"
:stories {1 {:title "Design a data model for projects ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to access the SUMO vehicles from highway_overtake.py in Webots?<p>I'm modifying the highway_overtake.py controller to be able to track the position and s... | <p>If it's for debugging, you could use this supervisor function to get the positon of all cars in the simulation, and then figure out which one is closed to your target car (which ID you know).
<a href="https://cyberbotics.com/doc/guide/supervisor-programming#tracking-the-position-of-robots" rel="nofollow noreferrer">... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Kotlin - How to lock a collection when accessing it from two threads<p>wondered if anyone could assist, I'm trying to understand the correct way to access a ... | <p>You are only synchronizing the getter and setter, so when you start using the reference you get to the list, it is already unlocked.</p>
<p>Kotlin has the Mutex class available for locking manipulation of a shared mutable object. Mutex is nicer than Java's <code>synchronized</code> because it suspends instead of bl... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
check if is in array a value bigger than zero<p>How do I check if in my array values is there a value bigger than 0?</p>
<p>Example: </p>
<pre><code>array ... | <p>This should work for you:</p>
<p>(If one array element is bigger than 0 the entire array sum is bigger than 0 and you can return true)</p>
<pre><code><?php
$arr = array(0, 0 , 1);
if(array_sum($arr) > 0)
echo "true";
else
echo "false";
?>
</code></pre>
<p>Output:</p>
<pre... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I cannot read a stream using Promise in Node<p>I have the following scenario: </p>
<p><strong>getStream</strong> returns a stream from request</p>
<p>And I... | <p>It's not clear why you are marking <code>getStream</code> as <code>async</code> when you do not use <code>await</code> inside the method. You also need to use <code>this</code> when calling class methods (e.g. <code>this.getStream(...)</code>).</p>
<p>It looks like you're trying to write a method that downloads an ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
HSV ranges for color filter<p>I am working on a project on detecting traffic signs in opencv. I need a good HSV range to filter out red, blue and yellow traf... | <p>You might want to read this <a href="http://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_imgproc/py_colorspaces/py_colorspaces.html" rel="noreferrer">link</a>. I extract the interesting part here:</p>
<blockquote>
<p>How to find HSV values to track?</p>
<p>This is a common question found ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get inserted document's ObjectID after insert in MongoDB PHP<p>I have inserted a row to mongodb with php and I need to get the row's is.</p>
<pre><code><... | <p>The <code>insert</code> method doesn't return the (modified) document, but only a status object. </p>
<p>Instead, you'll have to pass a named variable so you can access the modified variable for reading. As explained in the docs]<a href="http://php.net/manual/en/mongocollection.insert.php" rel="nofollow">1</a>:</p>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Azure Blobs billing break down of "All Other Operations"<p>I am looking at the billing for my Azure Storage Account and trying to understand managing its cos... | <p>After a support call with Azure, they pointed me to some of the (somewhat hidden) tracing capabilities.</p>
<p><strong>First and easiest is to check the type of transactions.</strong></p>
<ul>
<li>Go to the storage account > Metrics</li>
<li>Select <code>Transactions</code> as the metric</li>
<li>Click <code>Add F... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
more syntax in Java<p><a href="https://i.stack.imgur.com/8C5VE.png" rel="nofollow noreferrer">enter image description here</a></p>
<p>Hey everyone, i'm just ... | <p><a href="http://man7.org/linux/man-pages/man1/more.1.html" rel="nofollow noreferrer"><code>more</code></a> is a unix command to display the contents of a file, paginated. It has nothing to do with Java.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to read many files using a loop in R<p>I am trying to open many .csv files in a folder, and read one value in each csv file. The csv files have the same ... | <pre><code> setwd("WHATEVER-YOUR-WD-PATH-IS")
#Create a list of all file names in directory
#Save File names to a variable
filenames <- list.files(pattern="factory+.*csv")
## Get names without ".CSV" and store in "names"
names <- substr(filenames, 1, 10)
## Read in all data frames using a loop
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to insert Google Analytics after clicking a button?<p>I'm trying to insert Google Analytics snippet after clicking a button, and therefore counting it as... | <p>First save the Analytics code into a variable.</p>
<p>Then append it to the <code>head</code> tag when the button is clicked.</p>
<pre><code>ga = "(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){" +
"(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o)," +
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
using select to set a filter on api data<p>scratching my head on this one. I'd like to be able to apply a filter based on a tag. I am using the poke api and... | <p>Filtered by <strong>electric</strong> type for example:
<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 pokedex = document.getElementById('pokedex');
const fetchPokemon = () ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to sum user amount who visited my shop more than once<p>I am trying to sum the total number of customers who visited more than once per year. If I use an... | <p>Why are you going through such convolutions to get the year? The subquery can look like this:</p>
<pre><code> select year(datevisit) as datevisit_year, v.cst_mobile,
count(*) as num_visits
from users v
where class_user = 'Premium' and
cst_id <> 0 and
cst_mobile not like '%000000... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Datatables - prepopulate search box<p>I want to be able to store a list of common search terms, which a user can click and thus automatically filter a datata... | <p>You can specify the initial search term in the dataTables options:</p>
<pre><code>$('#table').dataTables({
search: {
search: initialSearchTerm
}
});
</code></pre>
<p>where <code>initialSearchTerm</code> is the variable that holds the initial search term.</p>
<p>See <a href="http://datatables.net/re... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get context from ActivityManager.RunningTaskInfo?<p>I want to get context from the below code.</p>
<p>I have not able to find the how to get activity... | <blockquote>
<p>How to get context from ActivityManager.RunningTaskInfo?</p>
</blockquote>
<p>Call <code>createPackageContext</code> method for getting Context using top Activity package name:</p>
<pre><code>ActivityManager.RunningTaskInfo ar = RunningTask.get(0);
String packageName = ar.topActivity.getPackageName(... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adobe Analytics overwriting visitorID<p><br/>I need to overwrite the default visitorID, that's automatically set by Adobe Analytics s_code, with a custom val... | <p>Some thoughts and words of warning about setting the vistor id yourself:</p>
<p>There are some benefits to setting the visitor id yourself. The main benefit is that you are 100% in control of how visit(or)s are tracked. Another good reason to do this is if you already have a visitor id infrastructure in place on yo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Change UIImageView height on scroll<p>I need to resize imageview on scroll and tried some answers in stackoverflow but failed to implement those. Not sure wh... | <p>When using auto-layout you shouldn't be directly setting the frame of any of your views, you should be changing the layout constraint constants to reposition and size your views and then updating the layout.</p>
<p>So, change the 'top' and 'height' constraints each time the delegate method is called, then <code>lay... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
aws rds/mysql security group for aws-glue python shell jobs<p>I have a Python shell job in aws-glue that talks to a rds/mysql server. I receive an error when... | <p>It looks like you need to modify the security groups so that connections are accepted from Glue job.As you didn't mention your security groups in your question it is hard to tell what might be the issue. So refer to <a href="https://docs.aws.amazon.com/glue/latest/dg/setup-vpc-for-glue-access.html" rel="nofollow nor... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Converting data type varchar to numeric throws<p>I'm working with data factory flow. In my input CSV file I have numbers like <code>10617,9 -3360</code>, i... | <p>I have used below for my decimal mapping in ADF.</p>
<p><a href="https://i.stack.imgur.com/JE9Yo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JE9Yo.png" alt="enter image description here"></a></p>
<p>In The Table column</p>
<p><a href="https://i.stack.imgur.com/TNITd.png" rel="nofollow noref... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JavaScript number validation<p>I have trying to validate a number in JS. I have a while loop that checks the number is in a range and that it is a number. Th... | <p>true is a symbol, not a string. You have 'true' instead of true. Try this.</p>
<pre><code>var midday = 'asdf';
if (isNaN(midday) ||
midday >= 50) {
alert('isNan == true or >= 50');
}
else {
alert('none is true');
}
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to show formatted HTML in Tooltip<p>I have an existing Classic ASP site that I am converting to C#/ASP.NET. In this legacy site, they use the followin... | <p>This code allows you to have html in a tooltip. Please change the css styling as needed:</p>
<pre><code><!DOCTYPE html>
<html>
<style>
.tooltip {
position: relative;
display: inline-block;
border-bottom: 1px dotted black;
}
.tooltip .tooltiptext {
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python 3.4.1 script syntax error, arcpy &<p>I am used to working in python 2.7 so there was some new things like the print function being different. So excu... | <p>Backslashes (used by you as Windows path separators) signal escape sequences in Python strings. Double the backslashes or use a raw string literal:</p>
<pre><code>"F:\\Pro_Projects\\NAIP2013\\raster.sde"
</code></pre>
<p>or</p>
<pre><code>r"F:\Pro_Projects\NAIP2013\raster.sde"
</code></pre>
<p>Windows also accep... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add many buttons dynamically giving a line jump before arriving at the edge in Android?<p>I am trying to add many button into <code>Relativelayout</co... | <p>Instead of using <code>Relative Layout</code> or <code>Linear Layout</code> I would rather suggest you to create custom <code>flow layout</code>.Custom flow layout will adjust child views accordingly in rows, and will jump the button in new row according to screen width. </p>
<p>Please have a look here : <a href="h... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a way to temporarily remove PyInstaller's nonconsole option?<p>I build my code using the nonconsole option when distributing my tools to users:</p>
... | <p>I am not sure this is possible - hiding/showing the console is a compile/build option, rather than a run time one.</p>
<p>Have you considered using the <a href="https://docs.python.org/2/library/logging.html" rel="nofollow noreferrer">logging</a> module?
This will give you an easy way to log messages to a file, wh... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Recursively call a directive in AngularJS<p>This is my directive:</p>
<pre><code>ngjoola.directive('configItem', function() {
return {
restrict: 'AE',... | <p>From the docs: </p>
<blockquote>
<p>Note: The compile function cannot handle directives that recursively
use themselves in their own templates or compile functions. Compiling
these directives results in an infinite loop and a stack overflow
errors. This can be avoided by manually using $compile in the postL... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
encoding and decoding in oracle select statement<p>Is there a way i can encode a string from a select statement in oracle. </p>
<p>i.e. </p>
<pre><code>SEL... | <p>Oracle has the <code>UTL_ENCODE</code> package, including the <code>BASE64_ENCODE</code> and <code>BASE64_DECODE</code> functions. Both functions work on <code>RAW</code> data type (both the input and the return value are <code>RAW</code>); so, if you want to use this for character data types, like <code>VARCHAR2</c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
non-www. to www. *but* for unknown TLD<p>Does anyone know of a RewriteRule that will redirect a non-www. to www. version, <strong><em>but</em></strong> witho... | <p>It's pretty simple actually.</p>
<pre><code>RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</code></pre>
<p>The condition checks if the domain name does not start with <code>www.</code> and if that's true redirects the complete request with the... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to correctly implement strategy design pattern<p>I'm trying to implement strategy design pattern, and want to know if I do it correctly.</p>
<p>Lets say... | <p>You asked 2 questions that are not directly linked to TypeScript. The code can be directly converted to C# / Java, the usual mainstream OOP languages. It's even more interesting because it's about both <em>Design Patterns</em> and <em>SOLID</em> principles, both pillars of the <em>Object Oriented Programming</em>.</... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Need an efficient way to change factor values from one column of a data frame to another columns<p>I am currently dealing with categorical data in <code>data... | <p>We can use <code>fct_collapse</code> and it returns a <code>factor</code> with new <code>levels</code></p>
<pre><code>library(dplyr)
library(forcats)
library(magrittr)
df %<>%
mutate(B = fct_collapse(B, CHANGED = as.character(B)[A== "Kelly"]))
glimpse(df)
#Rows: 7
#Columns: 2
#$ A <fct> Jerry, Kell... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
java.lang.ClassCastException while extracting error message from SOAPFault<p>I am trying to extract the error code and error message for the soapFault respos... | <p>Are you sure that first two times you are getting TextImpl. Clearly, it is failing because it is trying to type cast TextImpl to SoapElement. If you are expecting only SoapElement types, then maybe you can check </p>
<pre><code>if (childElementIter.next() instanceof SoapElement)
{
// business logic
}
</code>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Oculus DK2 installation on Ubuntu 14.04 - cannot find ludev<p>When I run the command, make from the 0.4.4 oculus linux package, I keep getting this error: </... | <p>You need to install the <code>libudev</code>and <code>libudev-dev</code> packages.</p>
<pre><code>sudo apt-get install libudev-dev libudev0
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cannot get form array values<p>I have a form that is dynamic where a user can add additional rows to the form. Ultimately, I would like to get this data and ... | <p>You need to get all fields by it's index:</p>
<pre><code><?php
require_once '../../../wp-load.php';
global $wpdb;
$newdb = new wpdb( 'user' , 'pass' , 'table' , 'localhost' );
if(isset($_POST['submit'])) {
$username = $_POST['username'];
$first_name = $_POST['first_name'];
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
c# empty textboxs after click<p>I have this problem where I run my code and it gives me empty text boxs and I'm not sure why. I have debug it and found that ... | <p>I just see some problems with the parsing itselve. You parse the text of <code>txtTableAvgTemp.Text</code>.
This text is extended for each while loop with a new line of temperature: </p>
<p><code>txtTableAvgTemp.Text += number.ToString() + "\r\n";</code></p>
<p>This will never parse.</p>
<p>Further on, on the fi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# (Windows Form) - Using ToUpper for State Abbreviation<p>I have a textbox on my form that allows the user to enter in a state. I also have a button that I'... | <p>Calling <code>ToUpper</code> on your string will change the entire string to uppercase.</p>
<pre><code>if (state.Length > 0)
{
state = state.ToUpper();
}
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using jQuery with Ember action handler<p>I am trying to access jquery object ($) from inside a action handler in ember controller. But it says <code>$</code>... | <p>First of all it is not recommended to do dom operation in controller. The better approach can be you set target="view" and handle this action there. Then your code inside action will work fine. If you want to handle it in controller itself, then use this code snippet</p>
<pre><code>App.IndexController = Ember.Arra... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Objective c allow white space between two words only, not before nor after<p>I am working on an ios app using objective c, at one screen i have a name field,... | <p>How about this?</p>
<pre><code>NSString *firstNameActual = firstNameTF.text;
NSString *firstNameTrimmed = [firstNameTF.text stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if ([firstNameActual isEqualToString:firstNameTrimmed]) {
// there is no space at start or end
} else {... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I split and rank text/character?<p>It may be easy to do but as a beginner it seems to me trivial.</p>
<p>I have text like this or file containing th... | <pre><code>>>> from collections import Counter
>>> s = 'fdhdhjduvduvfbvhufbvufvhifbusdbjhkbueigvuerafvguavgugvg'
>>> for item in Counter(s[i:i+3] for i in range(len(s))).most_common():
... print item
...
('fbv', 2)
('vgu', 2)
('duv', 2)
('raf', 1)
('fbu', 1)
('dbj', 1)
('uei', 1)
('bvu',... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can a js script get a variable written in a EJS context/page within the same file<p>As I wrote in the title, I'd like to get a value from a variable written ... | <p><strong>Edit</strong>: this Half considers you are using EJS on <strong>server</strong> side</p>
<blockquote>
<p>1) You can pass an ejs variable value to a Javascript variable</p>
</blockquote>
<pre><code> <% var test = 101; %> // variable created by ejs
<script>
var getTes... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spring MVC - Ehcache best practices<p>I have a question about best pratices using spring and ehCache.</p>
<p>For example if I have two methods annotated wit... | <p>According to <code>@Cacheable</code> javadoc <code>key</code> is a SpEL expression, so you might to make smth like that:</p>
<pre><code>@Cacheable(value="imagesCache",key="'user' + #id_image")
public Image getUserImage(id_image){ //stuff }
//and
@Cacheable(value="imagesCache",key="'product' + #id_image")
public ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to assure atomicity without AtomicInteger in java?<p>Assuming Java 6/7/8:</p>
<p>Is there any chance of marking some statement atomic without using e.g.... | <p>Your options are:</p>
<ul>
<li>intrinsic locks via the <code>synchronized</code> keyword</li>
<li>using explicit locks from <code>java.util.concurrent.locks</code> to wrap operations you want to make atomic</li>
</ul> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Display name of original module when calling another module<p>I'm creating centralised logging. That basically looks like the scripts below. </p>
<p>The log... | <p>The question isn't very clear, but you can use <code>inspect.stack()</code>.</p>
<h1><code>loggy.py</code></h1>
<pre><code>import inspect
def log(s):
caller = inspect.stack()[1]
print(f"{caller.filename} line {caller.lineno} says: {s}")
</code></pre>
<h1><code>thing.py</code></h1>
<pre><code>import logg... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add text to a <p> tag by using the ID of the body tag in JavaScript<p>I want to insert some text in a <a href="https://developer.mozilla.org/en-US/docs/Web/H... | <p><strong>JavaScript solution:</strong>
To add text in the first <code>p</code> tag.</p>
<pre><code> document.getElementsByTagName("p")[0].innerHTML="Whatever text!";
</code></pre>
<p><strong>Snippet:</strong></p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
<div class="snippet-code... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java Regex to replace a character and empty lines<p>I have the following input text:</p>
<pre><code>"rd_tagged_text"
" Amt<SPLIT>
\nSecurity<SPL... | <p>Just add another <code>replaceAll</code> function.</p>
<pre><code>parsedRow[i]=output[i].replaceAll("(?m)^n", "").replaceAll("[\\r\\n][\\r\\n]+", "\\n").trim();
</code></pre>
<p><strong>OR</strong></p>
<pre><code>parsedRow[i] = output[i].replaceAll("(?m)^n", "").replaceAll("(?m)([\\r\\n])[\\r\\n]+|^ +| +$", "$1")... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to generate a table of random data from existing database table through oracle procedure<p>I have to generate a table (contains two columns) of random da... | <p>The rownum=value would not work for a value greater than 1</p>
<p>hence try the below</p>
<pre><code> create or replace procedure a05_random_plant(p_count in number)
as
v_count number := p_count;
cursor c is
select plant_id, common_name
from ppl_plants
where ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cooldown is not working [Minecraft Bukkit plugin]<p>so I got a problem with the cooldown in my command. The command work perfectly but when I try to put a co... | <p>You never run the <code>setupCooldowns()</code> method you have inside your <code>CooldownManager</code> class. I would recommend you remove this method anyways and simply instantiate the cooldown using <code>Map<UUID, Double> cooldowns = new HashMap<>();</code></p>
<p>The reason you’re getting a NullPo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Filtering an audio signal and then reading the meter without sending it to master<p>I'm trying to filter a signal and then analyse the values of the filtered... | <p>I guess you tested the code in Chrome because there is a problem with Chrome which causes it to not process anything until it is connected to the destination. When using Tone.js that means you need to call <code>.toMaster()</code> at the end of your chain. I updated you fiddle to make it work: <a href="https://jsfid... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What classifies as a Child on html tags?<p>I want to parse this and need to know the number of children has. I am told that comments should also count as ch... | <p>once you parse the event class by DOM/Curl its convert the String to the nodes objects. the Objects are called to all the breaking points ie. or .
the each node can also contain other childs such as </p>
<pre><code><div class= 'event'> <p class='class2'>something here</p></div>
</code></pr... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
react is posting data to console, but data is not successfully making it mysql database<p>i'm having an issue where my form data is posting to the chrome con... | <p>The issue is in your <code>handleSubmit()</code>. Specifically in the setup of the <code>data</code>/body for the axios POST request. You are setting the value of <code>body</code> to that of the function <code>this.setState</code>, instead of just the component's <code>this.state</code>:</p>
<pre><code>handleSubm... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Global React does not play nice with AMD React<p>I'm getting weird weird behaviour when rendering a component using an AMD-loaded React, when a global <code>... | <p>This has been fixed in version 0.14.2: <a href="http://jsbin.com/tesodoxape/1/edit?html,js,output" rel="nofollow">http://jsbin.com/tesodoxape/1/edit?html,js,output</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create link in popup.js and make it clickable in popup.html<p>I have two variables in <code>popup.js</code>. I want put them together to an url , anyhow like... | <p>To pass/add code(hyperlink in your case) to popup.html, make use of chrome.extension.getViews method which returns an array of the Window objects for each of the pages running inside the current extension which includes any popup pages, if defined and loaded. Then simply in the popup window add the hyperlink to the ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Strange output when using float instead of double<p>Strange output when I use <code>float</code> instead of <code>double</code></p>
<pre><code>#include <... | <p>This is happening because the <code>float</code> and <code>double</code> data types store numbers in base 2. Most base-10 numbers can’t be stored exactly. Rounding errors add up much more quickly when using <code>float</code>s. Outside of embedded applications with limited memory, it’s generally better, or at least ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How would I make my Python program unpack a compressed file I drag over it?<p>I am trying to make a program which when I drag my .zip file over the program.p... | <p>Save the following code as <code>unzip.py</code> and then run it by typing <code>python unzip.py file_to_unzip_.zip C:\Destination</code> in cmd.</p>
<pre><code>from sys import argv
from zipfile import ZipFile
def unzip(source=None, destination=None):
zip = ZipFile(source)
return zip.extractall(destination... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to correctly consume a produced Web Service? (Apache CXF)<p>I have created a SOAP WS and deployed it on a localhost. On the same server, I want to create... | <p>You can use URL, QName, and Service.</p>
<p>Let's say you have a service endpoint interface as follows :</p>
<pre><code>@WebService
@SOAPBinding(style = Style.RPC)
public interface HelloWorld{
@WebMethod
String getString(String name);
}
</code></pre>
<p>And a service endpoint implement... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C++ duplicate symbol linker error with proper include guards?<p>I'm writing a program to test concrete inheritance, though I cannot resolve the duplicate sym... | <p>You are <code>#include</code>ing your <code>.cpp</code> file in your <code>.h</code>, which will result in the <code>.cpp</code> code being included in every file that uses the <code>.h</code> (hence the duplicate symbols). You are also misusing include guards: only header files need include guards; <code>.cpp</code... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is a "switch" in a Git command?<p>I was reading a book which shows the syntax of git commands as:
<a href="https://i.stack.imgur.com/tMzpu.png" rel="nof... | <p>The switches are all the parameters passed <em>before</em> any Git actual command: see <a href="https://git-scm.com/docs/git" rel="nofollow noreferrer"><code>docs/git</code></a></p>
<pre><code>git [--version] [--help] [-C <path>] [-c <name>=<value>]
[--exec-path[=<path>]] [--html-path] [-... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Syncing Route 53 static website to github website repository (allowing offline/destop editing)<p><p>I have had a github.io website for quite some time, and w... | <p><p>Got It!
<p>@ceejayoz helped to point me in the right direction.
<p>after some fiddling, I got a CNAME record that points towards my github website, while maintaining https. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular Material Row when looping through data<p>My Data Source is like below</p>
<pre><code>[{"isGroup":true,"groupName":"MV Reddy","items":[{"id":1,"name"... | <p>Your approach goes in the right direction as you're using the <code>rowspan</code> attribute. The template however is unnecessary complex and can be simplified if you pre-process your data. </p>
<p>I solved a similar problem in the open source project <a href="https://github.com/centeractive/koia" rel="nofollow nor... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
using apply to solve ODEs with mutliple initial conditions in R<p>I am trying to use apply instead of a for loop to solve an ode for different initial condit... | <p>Here is a piece of R code that simulates ODE matrix and plots the graphs. This answers the posted question using some closures and other functional programming paradigms.</p>
<pre><code># This is the linear system analysis
library("deSolve")
odefunc <- function(A)
{
function(t,x,p) {
with(as.list(c(x,p)),
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
color schemes interaction in terminal, zsh, and vim<p>I noticed that the color-scheme setting in <code>.zshrc</code> does not affect the background color of ... | <p><strong>Terminal</strong></p>
<p>Terminal.app lets you change its default color palette in its preferences. Those colors are referenced by your shell and the programs you run in it either with standard names like "blue" or with numbers from 0 to 15. Changing your terminal emulator's palette will obviously change th... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Accuracy of comparison of runtime<p>All, I am wondering whether the following will give me an accurate assesment of the runtimes of these functions. I would ... | <p>If you check the source code of <code>replicate</code> you will see that is this:</p>
<pre><code>> replicate
function (n, expr, simplify = "array")
sapply(integer(n), eval.parent(substitute(function(...) expr)),
simplify = simplify)
<bytecode: 0x000000000b3b1ee8>
<environment: namespace:base>
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to select fields on different indents in json output<p>I am trying to pull two fields in a JSON output that are on different indents. How can I select th... | <p>You need to show us the full JSON you're trying to parse, because the from the first 2 characters it doesn't look like well-formed JSON <code>],</code>.</p>
<p>You need to either delete everything in the json above that, or find the value before the <code>hostname</code> and do this,</p>
<pre><code>for i in data[1... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Submit multiple checkbox together with textbox input value using PHP and MySQL?<p>I'm making online test/quiz for students and using PHP and MySQL. Currently... | <p>You can use an <code>IF statement</code> if the checkbox is checked or not.</p>
<pre><code>for ($j = 0; $j < count($_POST['selected_item']); $j++) {
if(!empty($_POST['selected_item'][$j])){ /* CHECK IF CHECKBOX IS SELECTED */
answer = mysql_real_escape_string($_POST['dynamic'][$j]); // returns multiple... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is causing the horizontal scrolling in my responsive WordPress layout?<p>I am developing a website using WordPress and a modified version of the Quark t... | <p>add this to your body tag : </p>
<pre><code>body {
overflow-x: hidden;
}
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Lightswitch using editable Grid which uses View as data source<p>I am trying to develop a screen in Light-Switch, in which data shown is combined from 3 or 4... | <p>I was following the following article:</p>
<p><a href="http://www.c-sharpcorner.com/UploadFile/raj1979/how-to-use-wcf-ria-service-in-lightswitch-2012/" rel="nofollow noreferrer">Using WCF RIA Service in LightSwitch</a></p>
<p>But had problems making Grid Editable.</p>
<p>After looking for the solution around the ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
react-native-maps which api use and how is its costs?<p>I'm creating an app based on maps.
From 11 June 2018 Google changes his price plan of the Google Maps... | <p>I found all information about it. </p>
<p>react-native-maps use Maps SDK for iOS and Android. </p>
<p>This page <a href="https://cloud.google.com/maps-platform/pricing/?utm_source=google&utm_medium=cpc&utm_campaign=FY18-Q2-global-demandgen-paidsearchonnetworkhouseads-cs-maps_contactsal_saf&utm_content=... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
unfolding map library: get map tiles from provider for offline use<p>I'm using UCSD's starter code to make a visualization of earthquake location and magnitu... | <p>Unfortunately I can't provide a tested answer at the moment, however here are a couple things I spotted: </p>
<ol>
<li><a href="http://unfoldingmaps.org/javadoc/de/fhpotsdam/unfolding/tiles/MBTilesLoaderUtils.html" rel="nofollow noreferrer">MBTilesLoaderUtils docs</a> points to an outdated <a href="http://web.archi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating regular expression for splitting<p>I'm currently studying informatics and know what a regex is (not in java so).
I have an input like :</p>
<pre><c... | <p>Yes, it will split on those characters but not produce the expected results. You need to use a quantifier with your character class. I recommend using <code>+</code> meaning "one or more" times.</p>
<pre><code>String s = "String1 ( Nr = 323) String2 String3 (Nr = 3)";
String[] parts = s.split("[ ()=]+");
System.o... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Window width detection in Ext.js using Ext.getBody.getViewSize()<p>I am sizing a window based on the Browser Window. For now I am using Ext.getBody.getViewSi... | <p>You should probably look at using Ext.Viewport instead. You can then call getWidth and getHeight on this.</p>
<p>See the docs <a href="http://docs.sencha.com/extjs/5.1/5.1.0-apidocs/#!/api/Ext.container.Viewport" rel="nofollow">http://docs.sencha.com/extjs/5.1/5.1.0-apidocs/#!/api/Ext.container.Viewport</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Simple jQuery Personality Quiz<p>Attempting to create a simplfied version of the following quiz: <a href="http://codepen.io/jannypie/pen/DcHdo?editors=101" r... | <p>The problem is the following line:</p>
<pre><code>ansOpts = currentStep.children('.quiz-answer');
</code></pre>
<p>You want to use <a href="http://api.jquery.com/find/" rel="nofollow"><code>.find()</code></a> instead of <a href="http://api.jquery.com/children/" rel="nofollow"><code>.children()</code></a> because t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the use of @RunAs javax security annotation?<p>I tried understanding the use of @RunAs annotation from the <a href="https://docs.oracle.com/javaee/7/... | <p>The @RunAs annotation can be used for the use cases that @Steve C points out, but also for exactly the use case you are describing.</p>
<p>Your code and your assumptions are correct. It's not working because the way some containers (Wildfly for example) implement EJB method permissions by default. When no security ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.