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:
Setting default values for slicers when no option is selected Power Bi<p>I have a report where a user can filter and compare his/her company to others.
For ... | <p>It's possible but it also depends on how you switch the shown values.</p>
<p>If you want to use only the visual objects you can:</p>
<ol>
<li>Save the report as you want it, when it gets published to PowerBI service it will keep the filters as they were when you published the report.</li>
<li>If the slicer is of t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Display of units in HTML stepper <input type="number"><p>I want the user to enter numbers with a unit such as "cm", "kg" or "$". This can be done in jQuery U... | <p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>$(".original input").on("change", function(){
$(".duplicate input").val(this.value + '€');
});
$(".duplicate input").on("change", function(){
$(".original input").... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Multi Networking in Lollipop<p>I am working on an app that saves your credentials and logs in to the university wifi automatically when connected to a partic... | <p>I solved this problem myself.</p>
<pre><code>ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
Network[] networks = connectivityManager.getAllNetworks();
NetworkInfo networkInfo;
Network network;
for (int i = 0; i < networks.length; i+... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to call the functions of an object, without prefixing the object name?<p>I was writing javascript code for performing mathematical calculation... | <p>The way to do this is <code>with</code></p>
<pre><code>with (Math){
console.log(sin(4));
}
</code></pre>
<p>inside of the <code>with(Math)</code> block, you can use the functions defined on Math such as <code>Math.log</code> <code>Math.sin</code> etc.</p>
<p>You can find out more about it <a href="https://deve... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cannot place a wallsign or edit its text<p>I'm trying to place and edit a wall-sign facing west. I have been so far unsuccessful at both orienting the sign c... | <p>The following code resolved the issue:</p>
<pre><code>public void Generate(Location location)
{
location.getBlock().getState().setType(material);
Block block = location.getBlock().getLocation().add(-1, 0, 0).getBlock();
block.setType(Material.OAK_WALL_SIGN);
Sign sign = (Sign) block.getState();
D... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find layer rendering time in mapping API's<p>I am trying to compare performance of mapping API's- Google Maps, OpenLayers, Leaflet and ArcGis API and I would... | <p>You can use Javascript's Date object to calculate the load time.</p>
<p><code>Date.now()</code> method returns the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.</p>
<p>First, you can do the following before your function call:</p>
<pre><code>var timerStart = Date.now();
</code></pre>
<p>Secon... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Node Restart in Shell Script<p>I want to rerun the node server, whenever there's changes in file, but i want to use fswatch. i am using fswatch with the shel... | <p>I am able to do that with the help of fswatch.</p>
<pre><code>fswatch -o mydir | xargs -n1 -I{} ps | grep '[n]ode server.js$' | awk '{system("kill "$1)}'
</code></pre>
<p>or putting the same code in seperate shell file. and using it as</p>
<pre><code>xargs -n1 './location-of-shell-file.sh'
</code></pre>
<p>when... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Merge multiple rows with same ID into one row<p>How can I merge multiple rows with same <code>ID</code> into one row. </p>
<p>When value in first and second... | <p>I think there's a simpler solution to the above answers (which is also correct). It basically gets the merged values that can be merged within a CTE, then merges that with the data not able to be merged.</p>
<pre><code>WITH CTE AS (
SELECT
ID,
MAX(A) AS A,
MAX(B) AS B,
MAX(C) AS ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it okay to execute multiple queries inside onCreate?<p>Hi I'm kinda new to SQLite for Android. I'm just wondering if it's okay to execute multiple queries... | <p>There is no problem in executing multiple queries. but couple of recommendations</p>
<ol>
<li>Use <code>Room</code>, which is a wrapper created by Android dev team on top of <code>SqLite</code> (<a href="https://developer.android.com/topic/libraries/architecture/room" rel="nofollow noreferrer">Link</a>)</li>
<li>Us... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
data brick write xlsx in blob<p>trying to write a xlsx file in a blob storage</p>
<p>tryed thing like</p>
<pre><code>df_MA.to_excel("https://ACCOUNTNAME.bl... | <p>Did you mount the storage drive?</p>
<pre><code>df.write.mode("overwrite").format("com.databricks.spark.csv").option("header","true").csv("/mnt/<mount-name>")
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Acts_as_votable query - rails<p>Within my rails app, i'm using the <a href="https://github.com/ryanto/acts_as_votable" rel="nofollow">acts_as_votable gem</a>... | <p>User has the following methods available, see the <a href="https://github.com/ryanto/acts_as_votable#the-voter" rel="nofollow">github doc</a> </p>
<pre><code>@user.find_voted_items
@user.find_up_voted_items
@user.find_liked_items
@user.find_down_voted_items
@user.find_disliked_items
</code></pre>
<p>So using the... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using String's c_str() and assigning to char const*: assignment of read-only location<p>My problem is this:
I have a constant pointer to a constant char poi... | <p>Since <code>commands</code> is a <code>std::vector<const char *></code>, the expression <code>&commands[0]</code> will yield a <code>const char **</code> (also known as <code>char const **</code>) which you can happily assign to a <code>char const * const *</code>. So unless you really need a copy, you cou... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TFS query for tasks with no parent<p>I would like create a Flat list of work items query in TFS in which the results contain all of the specified PBI and Bug... | <p>You need to change the type of your query to the Direct Links query, then choose the option to pull back all work items without any matching links. The results will still be a flat list.</p>
<p><img src="https://i.stack.imgur.com/NBkYS.png" alt="enter image description here"></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Perl pack('H*', $value) in Python<p>I have code like below in Perl that I need to rewrite in Python:</p>
<pre><code> $varTmp = join( '', pack( "H*", $val... | <p>If I understand the problem correctly, $value is a string of hex digits, like for example "303132", which is being converted to a string of characters represented by the hex digit pairs ("303132" -> "012"), and then xor-ed with another string, $key?</p>
<p>You need a slightly different approach for Python 2:</p>
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Debug Angular Dart routing<p>My first few days of using Angular Dart have been delightful...</p>
<p>... except for the routing, which continues to give me p... | <p>I haven't done much with routing but maybe some hints that might help you.</p>
<p>There should be a <code>defaultRoute: true</code> option.<br>
Don't add the <code>''</code> route at all, make <code>product</code> and <code>product_edit</code> the top-level routes where <code>product</code> has the <code>default:tr... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the correct way of writing a binding for D3.js animations?<p>I wonder how to create a d3js binding to simplify animations. I trying to use something ... | <p>Have a look at my <a href="http://bl.ocks.org/PatWie/a68eed8e5773155c2571" rel="nofollow">bl.ocks</a></p>
<p>Essentially, you need to write the loop into:</p>
<pre><code>d3.transition()
.duration(parent.duration)
.ease(parent.ease)
.each(function() {
... HERE ...
});
</code></pr... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is a Pascal-style string?<p>The <a href="http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/" rel="noreferrer">Photoshop file format documentat... | <p>A Pascal-style string has one leading byte (<code>length</code>), followed by <code>length</code> bytes of character data.</p>
<p>This means that Pascal-style strings can only encode strings of between 0 and 255 characters in length (assuming single-byte character encodings such as ASCII).</p>
<p>As an aside, anot... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Need clarification on the definition of C tokens<p>From the K&R's "The C Programming Language" book:</p>
<blockquote>
<p>There are six classes of toke... | <p>This distinction between operators and other separators is something that existed in old versions of C, but has been removed.</p>
<p>The C89 standard gives this listing of operators and punctuators (punctuators being what K&R calls "other separators"):</p>
<pre><code>operator: one of
[ ] ( ) . -&g... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Common methods efficient handling<p>I'm working out on a common method that does the same thing (for now) but may eventually require expansion in the future.... | <p>Inheritance is not always the answer. Sometimes a simple helper like below can do it</p>
<pre><code>internal static class ProductsHelper // -- STATIC
{
// generic method that will work for all products
public static List<T> GetProducts<T>(IEnumerable<T> products, int count)
{
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Multiple files Makefile compilation<p>How do compile 2 .cpp files and 1 .h file in a makefile?
I am noob with makefile but I don't want to do it in the comma... | <p>Thanks for <code>anatolyg</code> for explaining:</p>
<blockquote>
<p><strong>You don't need to "compile" h-files</strong> Maybe this was the bit that made it all so difficult for you. You only need to compile the cpp files. Header files are included in the makefile just for make to figure out when to recompile th... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Module not found: Error: Can't resolve '../aws-exports' (React-Native Expo Web)<p>I've developed an app which works perfectly when I run it through <code>exp... | <p>For some reason, in the case of this app, a relative reference to aws-exports file did not work, by using the two dots. Changing to a direct path did the job.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do i Import an npm Module in vue?<p>Basically i want to implement discord rpc in my electron browser apllication and i found <a href="https://www.npmjs.c... | <p>In your code you are importing a funcion and calling it in the same line.
In ES6 you can do the same in with these two lines: first import the function, then call it.</p>
<pre class="lang-js prettyprint-override"><code>import discordRichPresence from 'discord-rich-presence';
const client = discordRichPresence('1809... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Deprecated each in code igniter xssclean helper<p>I have a codeigniter helper called xssclean for input validating form data</p>
<p>If i give array it show ... | <p>The <code>each()</code> function is deprecated with PHP 7.2. But you can replace your while-loop with a foreach-loop:</p>
<pre class="lang-php prettyprint-override"><code>function xssclean($str) {
if (is_array($str)) {
foreach($str as &$value){
$value = xssclean($value);
}
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Linux dd command: save file instead of upload file to server<p>I have this command run on Finnix OS:</p>
<pre><code>dd if=/dev/sda | pv | gzip -9 | ssh root... | <p><code>dd if=/dev/sda | gzip -9 > /path/to/output/file.gz</code>
should do it. </p>
<p>if you would still like to see the progress with <code>pv</code> then </p>
<p><code>dd if=/dev/sda | pv | gzip -9 > /path/to/output/file.gz</code></p>
<p>should be the way to go</p>
<p>EDIT: worth to note, <code>cat</code... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Render a django form in multiple templates of different view class and function<h3>I want to render the form in the the template of mydetails class i.e. deta... | <p>View file</p>
<pre><code>class mydetails(generic.DetailView):
model = details
def get_context_data(self, **kwargs):
context = super(ads_detail_vis, self).get_context_data(**kwargs)
context['test'] = Type_details.objects.all()
context['form'] = ContactForm()
return context
</code></pre>
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create multiple model instances without duplicated writable nested serializer in Django REST Framework?<p>I have two related models: <code>Product</co... | <p>To avoid duplicate product you can use <a href="https://docs.djangoproject.com/en/3.0/ref/models/querysets/#django.db.models.query.QuerySet.get_or_create" rel="nofollow noreferrer"><code>get_or_create()</code></a> method:</p>
<pre><code>class ProductDescriptionSerializer(serializers.ModelSerializer):
...
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Linq multiple left outer joins with grouping<p>I have a player class object which contains an image as one of it's properties. I am trying to do a left join ... | <p>Try using Navigation Properties:</p>
<pre><code>var players = db.Players.Where(player=> player.Equipment != null && player.Social != null).ToList();
</code></pre>
<p>No clue if your Navigation Properties are named this way though... Check your model.</p>
<p>If you want to retrieve them regardless of th... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rails multiple associations in one result set<p>I have a Video model which <code>has_many :comments</code> and <code>has_many :reviews</code>.</p>
<p>I'd li... | <p>You can make a method in your model that concatenates the two associations and then sorts them. For example:</p>
<pre><code>def feedback
results = (comments + reviews).sort_by{ |e| e.created_at }
end
</code></pre>
<p>If you have a lot of records and want to speed up the process a little bit, you can easily limit... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TGA Raw Packet with no size<p>I exported an image with gimp into a tga image while implementing a parser for tga-textures using rle. A snipped from a hex edi... | <p>After several hours i finally found the solution,
the size given inside the packet is -1, so if it says that the size is zero, it means the total size of the packet is 1. Lil' bit tricky but reasonable.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I use Jquery UI to drop into Konva (Kineticjs) stage and save to JSON string?<p>I'm trying to create a drag and drop tool using Jquery UI to drop rooms o... | <p>I have fixed by problem by getting all children from the layer of type Image using var images = stage.find('Image');</p>
<p>Then I loop through images using images.each(function (image){};</p>
<p>Inside each iteration of the images in the stage I do:</p>
<pre><code>var x = image.index - 2;
if (image.attrs['id'] =... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Easy file format for niche text printing<p>I have ahead of me a fairly specific task, and I was hoping someone on this site can give me the benefit of their ... | <p>The best recommendation I'd give is to use C to parse the input and generate a latex document, which is in turn used to generate a pdf for printing. Although it might seem more complicated, latex is much more flexible when it comes to typesetting placing manually the text in a bmp file for example (basically, latex ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting errno after a write operation<p>I have the following Go code which will eventually fill the disk and fail with <code>ENOSPC</code> (just a proof of c... | <p>File operations generally return an <a href="http://golang.org/pkg/os/#PathError" rel="nofollow"><code>*os.PathError</code></a>; cast <code>err</code> to <code>os.PathError</code> and use the <code>Err</code> field to examine the underlying cause, like this:</p>
<pre><code>patherr, ok := err.(*os.PathError)
if ok &... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Storing strings into list from Python regex over a file<p>I am using Python's regex to extract paths from a file and then trying to append the paths into a s... | <p>For sure, you're creating a new list every time you find a match. So only create one list and just continue to append to it each time you find a match</p>
<pre><code>def libinclude():
with open('options', 'r') as options:
result = []
for lines in options:
if 'LIB_SRC' in lines:
lib_src_p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to call a function depending on template type in C++?<p>I have the following hierarchy of class:</p>
<pre><code>class Boy : Child
class Girl : Child
te... | <p>You can specialize individual member functions without specifying the whole class. In this case:</p>
<p>Header:</p>
<pre><code>template<typename T>
class Anna : Parent<T> {
public:
void ProcessChild() {
// default implementation (if desired)
}
};
template<> void Anna<Boy>::ProcessC... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What HTTP code response to use when payment fails?<p>What HTTP code to use when processing payments / dealing with credit cards?</p>
<p>For instance:</p>
<... | <p>First, it is important to distinguish between failures that are </p>
<ol>
<li>caused by the client side and</li>
<li>others that have been caused by problems on the server side</li>
</ol>
<p>The latter ones normally describe errors that the client cannot solve on its own.</p>
<p>The first ones should have a statu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Windows script to merge all .html files in a directory and its subdirectories into a single .html file?<p>I have a <code>Results</code> directory, which has ... | <p>Thanks to @T3RR0R for sharing the link. My final command :</p>
<p>FOR /F "tokens=*" %G IN ('dir /b /s *_ExeReport.html') DO TYPE "%G" >> MergedOutput.html</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Double-log density plot<p>I have a generated a data set with power law distribution using <code>poweRlaw</code> package with the following code:</p>
<pre><co... | <p>I got the solution:</p>
<pre><code>library("poweRlaw")
xmin = 1; alpha = 1.5
x = rplcon(1000, xmin, alpha)
h <- hist(x, plot=F, breaks=c(seq(0,max(x)+1, .1)))
plot(h$counts, log="xy", pch=20, col="blue",xlab="Value", ylab="Frequency")
</code></pre>
<p><img src="https://i.stack.imgur.com/Hte39.png" alt="enter im... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
UISearchController change 'Cancel' button title<p>How we can change the title of cancel button in search controller?</p>
<p><img src="https://i.stack.imgur.... | <p>You can change the "Cancel" Button in search bar using this-</p>
<pre><code>for (UIView *view in searchBar.subviews)
{
for (id subview in view.subviews)
{
if ( [subview isKindOfClass:[UIButton class]] )
{
[subview setEnabled:YES];
UIButton *cancelButton = (UIButton*)s... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MongoDB Orders/sales aggregation group Per Month Sum Total + Count Field<p>Who knows a better solution to group Orders by date and sum total and count by sou... | <p>You can use <a href="https://docs.mongodb.com/manual/reference/operator/aggregation/cond/" rel="nofollow noreferrer">$cond</a> like below:</p>
<pre><code>Order.aggregate([
{
$group: {
_id: {
month: { $month: "$date" },
year: { $year: "$date" }
},
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to return from Inner function in c#?<p>I have a function that is a wrapper for an external REST web API. In my function, I am checking for the required p... | <p>Add the missing parameters to a list as you go along, then process them once (and set the response to "FAILURE" once) at the end of the method.</p>
<pre><code>public string WrapFunc(Dictionary<string, string> parameter)
{
var response = "SUCCESS";
var missingParams = new List<string>();
//C... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using C# Task for event async operation<p>Suppose I have an object <code>SomeObj</code> that performs an asynchronous operation which it has implemented as a... | <p>For more visibility to BART's link: <a href="https://docs.microsoft.com/en-us/dotnet/standard/asynchronous-programming-patterns/interop-with-other-asynchronous-patterns-and-types#tasks-and-the-event-based-asynchronous-pattern-eap" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/dotnet/standard/asynchronou... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sourcing the code<p>If my .R file name is too large, or the location of that file is (name ) is too big.</p>
<p>I observed that If I hit the return key in b... | <p>Try using <code>paste0</code> to break down the path. </p>
<p>If you want to source the following file:</p>
<pre><code>"/home/user/work_dir/my_project/source_file.R"
</code></pre>
<p>Then you can break the path by using:</p>
<pre><code>source(paste0("/home/user/",
"work_dir/my_project/",
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Changing navigation drawer icon<p>I have a problem, I have different activity with different background color (white or blue), also the menu icon need to be ... | <p>U must do like this:</p>
<pre><code>mDrawerToggle = new ActionBarDrawerToggle(
this,
mDrawerLayout,
R.drawable.ic_drawer, //<-- This is the icon provided by Google itself
R.string.drawer_open,
R.string.drawer_close
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to separate View data and ViewModel data?<p>I need to manage UI specific parameters (View) and Application data (Model/ViewModel) separately, so I'm usin... | <pre><code>DataContext = this;
</code></pre>
<p>Yuck... :)</p>
<p>Let the view model be the data context, and bind on your view's properties like this :</p>
<pre><code><Window x:Name="This" ...>
...
<SomeControl SomeProperty="{Binding MyViewProperty, ElementName=This}"/>
...
</Window>
</co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Trying to write DnD combat script, need help printing enemy HP after dice roll<p>I'm new to coding, so if I make a careless mistake sorry in advance.</p>
<p... | <p>What you need to do is saving the new hp value of the enemy into it's variable. In your code, you just calculate the remainding HP after the attack and print it but you are not saving it anywhere. In the next cycle you then just calculate what is essentially 30-damage expression and print the result. </p>
<p>Modify... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Multiple Subscriptions<p>I'm currently trying to implement Stripe in my app, but it looks like the Stripe Cloud module of Parse is missing an important part.... | <p>Was having exactly the same issue.
The answer was to do it with an httpRequest.</p>
<pre><code>var stripeKey = "sk_test_your_secret_key"
Parse.Cloud.define("subscribeCustomerToPlan", function(request, response) {
Parse.Cloud.httpRequest({
method:"POST",
url: "https://" + stripeKey + ":@api.strip... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
making comment a entire method at one time<p>sometimes it happens that we need to make comment a entire method in Java and reactive, more than once in same c... | <p>Position on the method name and use Alt+Shift+Up twice to select the entire method. Then use Ctrl+/ to comment the selected text.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Null Reference exception when assigning data to variable<p>I have a simple helper class:</p>
<pre><code>class WebsiteStatus
{
public string siteName { g... | <p>You have to use this instead:</p>
<pre><code>siteArray[0] = new WebsiteStatus { siteName = sites[0], lastDownTime = null };
</code></pre>
<p>The <em>array</em> of <code>WebsiteStatus</code> objects may have been initialized, but neither of the <em>separate</em> <code>WebsiteStatus</code> objects has been instanti... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Javascript Comparison Loop Not Working Between an Integer and an Array of Integers<p>Based on the code I have below, the user_id_org should match with the fi... | <p>The issue is with these lines of code:</p>
<pre><code>for (var i = 0; i < arrayLength; i++) {
if (orgs[i] == user_id_org) {
var intersection = 'Yes! We matched with 1 of multiple orgs!'
} else {
var intersection = 'No! We did not intersection with 1 of multiple orgs!'
}
}
</code></pre... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What does (int*) &var mean?<p>What is the meaning of <code>(int*) &i</code>?</p>
<pre><code> char i;
int* p = (int*) &i;
...
*p = 1234567892;... | <p>&i : means to take the address of i (which is a char*)</p>
<p><strong><code>(int*)&i</code></strong> : casts that pointer to be a pointer to integer (which is bad/wrong to do, but you told the compiler to do it so it won't even give a warning)</p>
<p><strong><code>int* p = (int*)&i;</code></strong> : a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can i create Master detail page in asp.net Core<p>How can i display data in views in asp.net core MVC?. </p>
<p>I have the following json format data</p... | <p><strong>Firstly,</strong> You can get the result from this one</p>
<pre><code>var listOfproducts = (await ProductsService.GetProducts().ToList());
</code></pre>
<p>After that, you can get value </p>
<pre><code>var product = listOfproducts.FirstOrDefault(a => a.ProductCode == id);
</code></pre>
<p><strong>Seco... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using a variable created in other class extension<p>I need to pass a boolean variable from one class to another. How can I archive this ?
I have 2 classes, o... | <p>There are several ways, you can try something like this:</p>
<p>Example, in <strong>class A</strong> define and set boolean variable, in <strong>class B</strong> pass the boolean variable and use your logic.</p>
<p>Code example:</p>
<p><strong>Class A</strong></p>
<pre><code>class A
{
boolean Test;
}
privat... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
DrawerLayout: Not part of android.jar?<p>By Using <code>DrawerLayout</code> (by using <code>android.support.v4.widget.DrawerLayout</code>)from Android suppor... | <p>With a <a href="https://stackoverflow.com/a/22740525/1676363">large amount of functionality being unique to support-v4</a>, most of the components in that library will remain there long term as it allows continual bug fixes and evolving of those components to meet the latest design and functionality specs without le... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Change ios display and or accessibility settings in app<p>I'm after an app that will essentially be able to change a number of display/accessibility settings... | <p>It's not possible to change an accessibility profile within iOS (as of iOS8) but it is possible to detect if accessibility is enabled from the iOS SDK, e.g. </p>
<pre><code>UIAccessibilityIsVoiceOverRunning();
</code></pre>
<p>will tell you if the user has VoiceOver (Apple's screen reader) running.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How many calls will be stored in stack?<p>Could someone please explain how many calls will be stored in stack for the recursive method below and why? When is... | <p><strong>how many calls will be stored in stack for the recursive method below and why?</strong></p>
<p>With an input of 50, the max amount of stack frames at any given moment, including the initial call to <code>fib</code>, will be 50. (So there will be at most 49 recursive calls stored on the stack at any given m... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove an HTML element from jQuery<p>I have the following basic HTML:</p>
<pre><code><select class="selector"><option value="first">FIRST</op... | <p>You can match the current value with <em>id</em> of the element to be shown:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).on('change', '.selector', function(... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Performance Implications of With Statements<p>Okay, so, I have seen this mentioned now enough in the past forty-eight hours that I need to ask it as a questi... | <p>The problems with <code>with</code> statements are all rooted in the same problem: when using <code>with</code>, scoping becomes <em>complicated</em>.</p>
<p>Consider the following sample:</p>
<pre><code>with (foo) {
with (bar) {
return x;
}
}
</code></pre>
<p>This seems simple, but it actually ca... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Refer to column from different table in COUNT() function<p>The query I am trying to build is essentially this:</p>
<pre><code>SELECT a
FROM T1
WHERE T1.b = ... | <blockquote>
<p>I have to create using a new SELECT/FROM query, but as far as I know
you can't put those in COUNT() functions</p>
</blockquote>
<p>You can write <code>where t1.b = (select count(*)...)</code> your query would look something like this :</p>
<pre><code>SELECT a
FROM T1
WHERE T1.b = (select COUNT(b) ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why can we use `std::move` on a `const` object?<p>In C++11, we can write this code:</p>
<pre><code>struct Cat {
Cat(){}
};
const Cat cat;
std::move(cat)... | <pre><code>struct strange {
mutable size_t count = 0;
strange( strange const&& o ):count(o.count) { o.count = 0; }
};
const strange s;
strange s2 = std::move(s);
</code></pre>
<p>here we see a use of <code>std::move</code> on a <code>T const</code>. It returns a <code>T const&&</code>. We have a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
(Java) "error: cannot find symbol" when compiling?<p>This is the first time I'm coding in Linux, I'm used with writing in Windows. So my problem: I have a ma... | <p><code>Lab1</code> depends on the class <code>Train</code> so you need to tell the path of the compiled <code>Train</code> class in its classpath. The easiest solution is to compile both at once:</p>
<pre><code>javac Train.java Lab1.java
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Skipping tinymce image-upload modal<p>I'm using the <a href="https://github.com/spohlenz/tinymce-rails" rel="nofollow">tinymce-rails</a> gem and the <a href=... | <p><strong>UPDATE:</strong>
Quick and dirty monkey patch <strong><a href="http://pastebin.com/qbzbZpKE" rel="nofollow">here</a></strong></p>
<p>No additional window between button press and system file selection dialog and image is inserted right after file was selected. In my chrome 40.0.2214.111 Ubuntu 14.04 (64-bit... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vim regex with back-reference to look-behind fails if a char follows the back-reference<p>I'm learning Vim-flavored regex and want to understand why this doe... | <p>Yes, this looks like a bug in the new NFA-based regular expression engine. When switching to the old engine, you have to swap the capturing group and use (all explained under <code>:help /\@<=</code>), but then, the matching works:</p>
<pre><code>\%#=1\v%(\1)@<=.*\<\/(\w+)\>
</code></pre>
<p>Also becau... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google BigQuery asking for JOIN EACH but I'm already using it<p>I'm trying to run a query in BigQuery which has two sub selects and a join, but I can't get i... | <p>You've got a <code>GROUP BY</code> inside a <code>JOIN EACH</code>. <code>GROUP BY</code> hits limits with cardinality (the number of distinct values) and the final grouping is not parallelizable. This limits BigQuery's ability to do the join. </p>
<p>If you change the <code>GROUP BY</code> to <code>GROUP EACH BY</... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java Unrecognized option: -xvf<p>I was trying to extract Java jar file as</p>
<p>java -xvf my.jar but it throws error </p>
<pre><code>Unrecognized option: ... | <p><code>java</code> is the wrong command for this, and ommit the <code>-</code>. Use <code>jar xvf my.jar</code></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is this Python array not slicing?<p>Initial data is:</p>
<pre class="lang-py prettyprint-override"><code>array([[0.0417634 ],
[0.04493844],
[0.049... | <p><code>np.mean</code> will return a <code>np.array</code>. You are taking the result and appending it into a <code>list</code>. When you are slicing it, you're getting the <code>0th</code> (and only) element in <code>paa</code>, which is an entire <code>np.array</code>.</p>
<p>Get rid of the <code>list</code> and ap... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Explain lz4 double buffer example<p>In lz4 examples, there is one named doublebuffer "<a href="https://github.com/Cyan4973/lz4/blob/master/examples/blockStre... | <p>The benefit of double buffer is better compression ratio. This is only useful if you don't have enough memory to fit your entire object/file into memory as a single block.</p>
<p>This is not obvious. So it deserves a comparison to check that.</p>
<p>You can make this exercise if you want to experience it more dire... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ScrollBar in Classes in Tkinter Python<pre><code>class CreatingWindowForEachLesson():
def __init__(self,root,t,d1,d2,d3):
self.t=t
self.r... | <p>A listbox will possibly work better than a canvas. Effbot's scrollbar and listbox example <a href="http://effbot.org/tkinterbook/scrollbar.htm" rel="nofollow">http://effbot.org/tkinterbook/scrollbar.htm</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
jquery + php - Call Function From Another Javascript Wrapper<p>How could I call function in different jQuery wrapper like this:</p>
<pre><code><?php
... | <p>You would need to put that function into a higher (shared) scope. For this example, you could use the <code>window</code> object itself.</p>
<pre><code>window.rmv = function() {
$(".adt_front_wrapper<?php echo $id; ?>").remove();
};
</code></pre>
<p>In order to make that work, the declaration and definit... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
D3 zoom is not properly reseting zoom state and translated location<p>Well I already got it working, but somehow when tested now it does not work anymore. So... | <p>I'm not 100% sure but it seems that <strong>calling</strong> the <strong>zoom event</strong> or let's say setting the zoom event <strong>later</strong> on on the svg element is fixing that issue.</p>
<p>So simply call</p>
<pre><code>zoom.on("zoom", zoomed);
svg.call(zoom);
</code></pre>
<p>after everything is fin... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google Sheets Query > Filter rows based on text in a string<p>I have a recipe database on Sheet1. Each row is a recipe and each recipe has all of the ingredi... | <p>try:</p>
<pre><code>=FILTER(Sheet1!A2:B, NOT(REGEXMATCH(Sheet1!B2:B,
SUBSTITUTE(VLOOKUP(B1, Sheet2!A:B, 2, 0), ", ", "|"))))
</code></pre>
<p><a href="https://i.stack.imgur.com/PFMbH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PFMbH.png" alt="0"></a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Grouping the Split elements into own separate arrays<p>This is my data from .txt file:</p>
<blockquote>
<p>**S12*T0*0889*B*99*N1C0~**S12*T0*0880*B*99*N1C0... | <p>Try adding them in batches</p>
<pre><code>public class Answer28535326 {
private static void addRows(PreparedStatement ps, String line) throws SQLException {
String[] records = line.split("~");
for (String record : records) {
String[] values = record.replaceAll("^\\*+", "").split("\\*+");
for ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Resolving dependencies of incompatible versions of a library in Maven<p>I have problems with dependencies in Maven-Java. My problem is that two modules have ... | <p>I do not know if you consider. In Maven exists one thing called <strong>Exclusions</strong>.</p>
<p>Extracted from the documentation:</p>
<blockquote>
<p>Since maven 2.x resolves dependencies transitively, it is possible for
unwanted dependencies to be included in your project's classpath.
Projects that you ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do you create a custom function in IBM Maximo Asset Monitor using Python and is there an SDK?<p>I would like to create my own custom function and add it ... | <p>You can create custom function using Python in IBM Maximo Asset Monitor. Use the following resources:</p>
<ol>
<li><p>Knowledge Center documentation includes a tutorial : <a href="https://www.ibm.com/support/knowledgecenter/SSQP8H/iot/analytics/tutorials/as_adding_complex_function_tutorial.html" rel="nofollow no... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
jQuery - Append and Remove HTML code<p>In jQuery, how can I append a line of HTML to some HTML, as well as remove the line of HTML?</p>
<p>Here is the befor... | <p>Simply use <a href="http://api.jquery.com/append/" rel="nofollow">.append()</a> and <a href="http://api.jquery.com/remove/" rel="nofollow">.remove()</a> methods.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ISO 8601 Date JS Interpretation Difference - IE/FF versus Chrome<p>Why do IE/FF and Chrome javascript engines <a href="http://en.wikipedia.org/wiki/ISO_8601#... | <p><a href="http://ecma-international.org/ecma-262/5.1/#sec-15.9.1.15" rel="nofollow noreferrer"><em>ES5</em></a> says that ISO 8601 format dates without a time zone should be treated as local(that interpretation <a href="https://github.com/tc39/ecma262/issues/87" rel="nofollow noreferrer"><em>has since been revised</e... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
DOJO Build how to create a layer?<p>I have the following profile for a DOJO custom build (boilerplate from <a href="https://github.com/csnover/dojo-boilerpla... | <p>I think the layer name should not have a / at the end.</p>
<p>Did you try</p>
<pre><code>'custom': {
</code></pre>
<p>???</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Durable function - activity function max. time out<p>What is the max. time out period of activity function which orchestrator function calls in Durable func... | <p>The activity function is similar to any function invocation and is bound by the <a href="https://docs.microsoft.com/en-us/azure/azure-functions/functions-scale#timeout" rel="nofollow noreferrer">same timeout durations</a> depending on the plan that they are deployed to.</p>
<p>In case of the consumption plan, its <... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to style this with css?<p>Wondering what is the best way to style this with css? I know <code>float</code> could make it happen but I don't think it is a... | <p>By using the <a href="https://developer.mozilla.org/en/docs/Web/CSS/display" rel="nofollow noreferrer">wonderous <code>display:table-*</code> options</a>:</p>
<pre><code>li {
display:table-row;
}
li > span {
display:table-cell;
padding:3px;
}
</code></pre>
<p><a href="http://jsfiddle.net/g7emb34o/" ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
FMResultSet returning nil in another ViewController<p>I am using FMDB wrapper for my database.I can fetch data using FMResultSet,but when I am trying to retu... | <p>Your resultSet is only valid while the database is open. Return something other than the resultSet (i.e., a wrapper object/dictionary/whatever). Generally you iterate the resultSet and pull out what you need and use that. Alternately you hand out the resultSet to the caller and <em>it</em> calls <code>.next</code> a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google Analytics Reporting API query by ids<p>I have an array of post ids, and i need to query the stats for each one. Idealy in 1 query.</p>
<p>My Plan:
In... | <p>One problem in the query is that you use dimensions in the filtering that you don't query in the first place (event Action, Label). You can use the filter in custom dimension even better using regular expressions eg <code>ga:dimension3=~(3|10|etc)</code>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I pass any DataGridTextColumn to a single Command which will toggle the Visibility of the DataGridTextColumn?<p>I have a DataGrid and would like to t... | <p>Given Michal's response above, I have restructured the language of my MenuItems, and instead of providing a button to toggle visibility of each DataGridTextColumn, I now offer "Show All" and "Hide Selected". With this the user can Control+Select multiple cells to indicate which columns the would like to hide. To ge... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
node can't find modules that exists in parent node_modules folder<p>I am using node 0.12.0 with express and created a Docker image.<br>
This is my directory ... | <p>In order to solve this I had to add the node_modules folder into my NODE_PATH environment variable.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get All of Mac's IP Addresses Using Objective-C<p>I'm trying to get all of my Mac's IP addresses (IPv4 + IPv6) but am not seeing the results I expect. I'm us... | <p>The answer here is that I am an idiot. As suggested by Rob Napier in their comment on my question, I was essentially filtering out the missing IP addresses:</p>
<pre><code>NSString *key = [NSString stringWithFormat:@"%@/%@", name, type];
addresses[key] = [NSString stringWithUTF8String:addrBuf];
</code></pre>
<p>Ea... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Function for Getting Direct Messages from the eBay API<p>I am making an application to handle the database storage of eBay messages sent to me as the seller.... | <p>Depending on your project the <a href="http://developer.ebay.com/DevZone/XML/docs/Reference/eBay/GetMyMessages.html" rel="nofollow">GetMyMessages</a> operation may be what you are looking for.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What are some methods to declare a reference in C++ other than type &var=var?<p>eg:</p>
<pre><code>//The standard method
int x=10;
int &y=x;
</code></pr... | <p>There are 2 types of reference:</p>
<p>rvalue - refer to persistent objects whose value you want to change
lvalue - refer to temporary objects whose value you want to change</p>
<p>lvalue Example:</p>
<pre><code>int num = 1;
int& r1 {num};
int& r2; // error: need initialization
int& r2 = num;
int* p =... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to handle retrive a data from two bundle in single form<p>Hello everyone if you would kindly help me. I'm stuck on how to retrieve the bundle data from a... | <p>In first activity on button click you can do : </p>
<pre><code>Intent in = new Intent(activtiy1, secondact.class);
Bundle b = new Bundle();
b.putString("key", "string_to_pass");
.
.
.
in.putextras(b);
startActivity(in);
</code></pre>
<p>Now in Second activity you have to get bundle items :</p>
<pre><code>Bundle b... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make two tasks mutually exclusive in Celery?<p>Is there a way to disallow two different tasks to run simultaneously in Celery? I was thinking about de... | <p>Yes, if you don't need to worry about overall throughput it is possible to create a separate queue and have a dedicated worker with concurrency set to 1. You can create as many queues as you want and configure which of those queues each worker receives messages from.</p>
<p>When starting the worker, you can pass th... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PrimeFaces paginator selection<p>I have a PrimeFaces (5) DataTable and like to store the page size selection in the view, so that the user sees the same numb... | <p>As you already noticed, the <code>page</code> event is being fired <em>before</em> the selected number of rows has been applied to the table. At the moment, there is no event being fired <em>after</em> changing the number of rows.</p>
<p><strong>However, there is a possible workaround:</strong></p>
<ul>
<li>bind y... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Access core file memory image programmatically<p>What is the (correct) way to access the memory image of a process from the corresponding ELF core dump file?... | <blockquote>
<p>What is the (correct) way to access the memory image of a process from the corresponding ELF core dump file?</p>
</blockquote>
<p>It's not entirely trivial. Also, the specific address may not even be in the <code>core</code> to begin with.</p>
<p>Let's consider an example:</p>
<p>// t.c</p>
<pre><... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using regex to find substring in Java<p>I am trying to pull two strings (which represent integers i where -999999 <= i <= 999999) out of the string 'le... | <p>Here's a self-contained example of what you're probably trying to do:</p>
<pre><code>String[] examples = {
"-123--4567",
"123-4567",
"-123-4567",
"123--4567"
};
// ┌ group 1:
// |┌ zero or one "-"
// || ┌ any number of dig... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spring Boot POST mapping with a validated form bean *and* a RequestParam gives 405 error on invalid form<p>In my Spring Boot application I have an "edit user... | <p>This is one of the rare cases where the order of the argument actually matters. The <code>BindingResult</code> parameter has to be right after the object you want to validate. </p>
<p>From <a href="https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html#spring-web" rel="nofollow noreferrer">t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# Linq Except By property values only on a dynamic List<p>I want to find the differences between two Lists of dynamic objects. The objects do not have the s... | <p>You can provide an <code>IEqualityComparer<MyObject></code> to the <a href="https://docs.microsoft.com/en-us/dotnet/api/system.linq.enumerable.except?view=netframework-4.8#System_Linq_Enumerable_Except__1_System_Collections_Generic_IEnumerable___0__System_Collections_Generic_IEnumerable___0__System_Collections... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can I run multiple CakePHP console commands from a batch file?<p>I have a batch file that contains:</p>
<pre><code>cake RunPayroll
cake RunInvoices
cake Ru... | <p>Add <code>call</code>:</p>
<pre><code>call cake RunPayroll
call cake RunInvoices
</code></pre>
<p>See <a href="https://stackoverflow.com/questions/2607856/several-ways-to-call-a-windows-batch-file-from-another-one-or-from-prompt-which">Several ways to call a windows batch file from another one or from prompt. Whi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pandas parallel apply with koalas (pyspark)<p>I'm new to Koalas (pyspark), and I was trying to utilize Koalas for parallel apply, but it seemed like it was u... | <p>I found a link that discuss this problem. <a href="https://github.com/databricks/koalas/issues/1280" rel="nofollow noreferrer">https://github.com/databricks/koalas/issues/1280</a></p>
<p>If the number of rows that are being applied by function is less than <code>1,000</code> (default value), then <code>pandas dataf... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Customize Regular Expression<p>This is my regular expression - /(\d{1,2}?h$)|(\d{1,2}h(?=\s+))/i</p>
<p>there is two 1.(\d{1,2}?h$) and 2.(\d{1,2}h(?=\s+) f... | <p>this is work.....</p>
<p>(^|\s)(\d{1,2})h(\s|$)</p>
<p>it match <strong>23h in meeting</strong> and <strong>In meeting 23h</strong>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Memoize wrapper for class member functions to return partial values<p>I am using the memoize recipe from <a href="https://wiki.python.org/moin/PythonDecorato... | <p>Methods are a different sort of object than functions (an <code>instancemethod</code> object, as the error message suggests; this type is available as <code>types.MethodType</code>). Unlike function objects, instance methods don't have a <code>__dict__</code>, so you can't set arbitrary attributes on them; 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 capture a single image with the Android Camera2 API?<p>I am using the Android Camera2 API to capture and process an image. The image processing happ... | <p>since your question I started reading and digging into it, and I believe that's the way it works. As per doc (<a href="https://developer.android.com/reference/android/hardware/camera2/CameraCaptureSession.html#capture(android.hardware.camera2.CaptureRequest,%20android.hardware.camera2.CameraCaptureSession.CaptureCal... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get all startup projects in solution<p>As the title suggests I want to query all the Startup Projects set in a <code>IVsSolution/IVsHierarchy</code>, also I ... | <p>It appears, the EnvDTE.Solution.SolutionBuild.StartupProjects is the only way to do this. I did a walk through of the underlying VS IDE code base, and the startup projects are denoted by an internal flag on an internal C++ class tracking all the loaded projects. Unfortunately, neither that particular class or it's m... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to query has_many through<p>In my Rails app, I have 3 models: User, Language and Gamification. They are linked via has_many through so: </p>
<pre><code>... | <p>If you want to join tables for your query, you need to also chain on a call to <code>#joins</code>:</p>
<pre><code>def points(language)
gamifications.joins(:language).where(languages: { name: language }).first
end
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python: pandas dataframe: Remove "  " BOM character<p>I used Scrapy on a Linux machine to crawl some websites and saved in a CSV. When I retrieve the data... | <p>Given your comment, I suppose that you ended up having <em>two</em> BOMs.</p>
<p>Let's look at a small example.
I'm using built-in <code>open</code> instead of <code>pd.read_csv</code>/<code>pd.to_csv</code>, but the meaning of the <code>encoding</code> parameter is the same.</p>
<p>Let's create a file saved as UT... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.