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:
moving jquery function to external js file<p>I have a jquery function that works great hard coded onto the html page right above the head tag</p>
<pre><code... | <p>Without seeing your page I don't know how you are laying it all out, but since it works inline but not externally you could make sure you put:</p>
<pre><code><script type="text/javascript" src="js/external.js"></script>
</code></pre>
<p>...in the same place as you had:</p>
<pre><code>$(document).ready... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting ng-token-auth to work with devise_token_auth<p>I have a Rails and Ionic project. The back-end uses the devise_token_auth Gem, and the front end ng-t... | <p>As it turns out, the solution was rather simple. It seems that in most of the examples everyone provides, they neglect to permit <code>access-token</code>, along with all the other CORS headers.</p>
<p>We used rack-cors for this, at the bottom of <code>config.ru</code>:</p>
<pre><code>require 'rack/cors'
use Rack... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Print out words that are found in an ArrayList but not a file?<p>I have a spell check program that has these containing words:</p>
<blockquote>
<p>Mary ha... | <p>A quick way to do this would be to introduce a boolean variable as shown below :</p>
<pre><code> boolean isWordFound;
while (s.hasNext()) {
String temp = s.next();
isWordFound = false;
for (int i = 0; i < dict.size(); i++) {
if (temp.equalsIgnore... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Displaying Data from Database PDO<p>I want to present the data from my database in a fairly readable and organized fashion. At the moment, my data looks like... | <pre><code>$pdo = new PDO( "mysql:dbname=$dbname;host=$host" , $user , $password );
if ( $pdo )
{
echo "<pre>";
foreach( $pdo->query( "select * from survey",PDO::FETCH_ASSOC) as $k )
{
print_r( $k );
}
}
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how modify oncontextmenu in js<p>I'm trying to change an existing "oncontextmenu" of a div.</p>
<p><strong>The div:</strong></p>
<pre><code><td id="line... | <p>The <code>oncontextmenu</code> <em>property</em> accepts a function, but you'll probably also need to wrap that function in an IIFE to protect the scope of <code>linekey</code> depending on how that function is called:</p>
<pre><code>document.getElementById('linetitle_' + input ).oncontextmenu = (function(key) {
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why am I getting IllegalArgumentException error while deleting data by id by Retrofit2? And how to fix it?<p>I am trying to delete an user in phpmyadmin by i... | <p>Replace this: </p>
<pre><code> @DELETE("delete_user.php?id={id}")
Call<Void> deletePost(@Path("id") int id);
</code></pre>
<p>With this </p>
<pre><code> @DELETE("delete_user.php")
Call<Void> deletePost(@Query("id") int id);
</code></pre>
<p>@Path is used for building a dynamic endpoint, but for Query... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Saving excised data from dplyr functions: how to prevent conflict/overwrite<p>EDIT: More complete explanation, as requested:
This is going to be hard to expl... | <p>Ok, well here's version 3. I've solved the interference issue by allowing users to specify their own name for the bank and the index.</p>
<pre><code>library(stringr)
library(stringi)
library(dplyr)
library(dplyrExtras)
library(pipeR)
library(lazyeval)
library(gtools)
construct_bank_index = defmacro(bank, index, ex... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Detect when asked and granted permission to iOS notifications?<p>In the iOS client when you first run it you get a UIAlert asking for permission to grant acc... | <p>On iOS 8 and later, implement the following method in your AppDelegate:</p>
<pre><code>- (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings {
// You could check here [[UIApplication sharedApplication] currentUserNotificationSett... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
loop through array and save x observations in new array<p>I am trying to loop through array and for <code>i</code>. I need to MAX values of previous 10 value... | <p>here is another version in LINQ</p>
<pre><code>var list = new List<int>();
var max = list.Select((x, i) => //get items (x as value, i as index
list.Skip(Math.Max(i - 10, 0)) //forget about previous items
.Take(Math.Min(10, i + 1)) // get 10(or less) elements before thi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Licensing for Python ANTLR4<p>I know that ANTLR4 is BSD license however what license does the python runtime for ANTLR 4.5 have?</p>
<p>There is no license ... | <p>The intent is BSD. I'll notify the author.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Xcode 6 swift sample app memory usage<p>I'm just starting to learn swift for the first time and I was running the sample spritekit project that comes with xc... | <p>I assume you are running it in the simulator, which will have different memory usage characteristics than running it on an actual device. You'll also have slightly different memory usage when running it in debug vs running it in release mode. In other words, I wouldn't pay too much attention to the memory usage wh... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Best way to display floating action button on top of another one<p>What if I want to display a smaller floating action button on top of another one? Using a ... | <p>I think this is an edge case but you can achieve it with this hack. </p>
<pre><code> <LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:gravity="center">
<com.google.android.material.floa... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
decltype for the return type of recursive variadic function template<p>Given the following code(taken from <a href="https://codereview.stackexchange.com/ques... | <p>The error message for your first option is due to the fact that in</p>
<pre><code>std::declval<func_type>()(std::forward<Ts>(ts)...)
</code></pre>
<p>you're trying to call the <code>f1</code> functor with two arguments of type <code>double</code> (the ones passed to <code>operator()</code>), but it tak... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Specifying iterator value in stable_sort function<p>I am using the below code to sort rectangles.
In the stable_sort function, how can I specify the iterato... | <p>Since <code>stable_sort</code> requires random access iterators, you can do simple addition on the iterators:</p>
<pre><code>stable_sort(boundRect.begin()+5, boundRect.begin()+10, /* ... */
</code></pre>
<p>Unless you're dealing with an ancient (pre-C++11) compiler, you can use a lambda expression for the comparis... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to query over list of tables in BigQuery?<p>This returns a list of all tables in the dataset:</p>
<pre><code>SELECT table_name
FROM data.INFORMATION_SCH... | <blockquote>
<p>I've tried using wildcards with:<br>
<code>SELECT max(date_of_data) FROM data.*</code><br>
but this only returns a single value for the most up-to-date table <strong>instead of the max(date_of_data) for each table</strong>.</p>
</blockquote>
<pre><code>SELECT _TABLE_SUFFIX AS table_name, MAX(d... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get current modified record in custom entity listener in envers<p>I created a Listener CustomRevisionEntityListener which implements RevisionListener ... | <p>Extended hibernate 'post-update' event, so that we can fetch dirtyProperties of entity 'Employee' and add the properties along with old and new values to CustomRevisionEntity.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CSS:: Second layer of solid non transparent background on top of transparent background is not working?<p>Title is pretty much self explanatory (and surprisi... | <p>It is happening because of the opacaity given in the parent div.</p>
<p>Check this <a href="http://jsfiddle.net/gu0ndhbx/1/" rel="nofollow">fiddle</a>.</p>
<pre><code>body{
background:url('http://moreimg.com/wp-content/uploads/2015/02/iPhone-Wallpaper-HD-010-640x600.jpg');
/* z-index:0; */
}
#heziGangina... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Android - Parse complex json in fragment (listview)<p>How can I parse my complex json data inside fragment (listview). I can't all the json data inside fragm... | <p>As in <code>User</code> class all methods are <code>non-static</code> but trying to access all method using class name(<em>static methods only accessed using class name</em>). </p>
<p>Create class object to access all methods </p>
<pre><code>User user = new User();
</code></pre>
<p>Now use <code>user</code> to ac... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create Bitmap from longBlob data in android<p>I am trying to retrieve images that stored as Blobs in Mysql on my server and create Bitmap in Android.
php cod... | <p>the returned data seems to be Base64 encoded. To convert the Base64 string in a bitmap, you can use <code>BitmapFactory.decodeByteArray</code>. For instance, in your case:</p>
<pre><code>HttpEntity httpEntity = httpResponse.getEntity();
String base64String = EntityUtils.toString(httpEntity);
byte[] decodedString = ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Struct in C with (.) or → operator<p>Guys I'm a little confused with the -> operator in C, can someone explain to me how it works and how it can be used, and... | <p>The dot picks members of structures. The arrow dereferences pointers to structures and then picks a member.</p>
<pre><code>struct dashboard user, *up = &user;
. . . user.name . . .
. . . up->name . . .
</code></pre>
<p>are equivalent (assuming up still points to user).</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JQuery how to remove element based on content of sub-element<p><img src="https://i.stack.imgur.com/x6EFW.png" alt="enter image description here"></p>
<p>I'm... | <p>Try this:</p>
<pre><code>$(document).ready(function(){
$('.item.ui-draggable').each(function(){
var val = parseInt($(this).find('.socialMetaCount').text(),10);
if (val < 100) {
$(this).remove();
}
})
});
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Known motivation for multiple SubPropertyOf?<p>In OWL/DL, it is possible to have a property/role that is a Sub[Object/Data]PropertyOf/subrole of more than on... | <p>This might be too broad of a question, but it's easy to think of properties that have multiple superproperties.</p>
<h2>Logical motivation</h2>
<p>After all, that p is a subproperty of q just means that "x p y" <em>implies</em> "x q y". So all you need is some kind of relationship that simultaneously implies two ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Possible way to resolve conflict on click action button<p>I am using bootstrap library on button:</p>
<pre><code><input type="submit" onclick="$(this).bu... | <p>finally got solution:</p>
<p>Either you can apply loading state on form submit event <code><form method="post" action="" onsubmit="$(this).find('.btn-primary').button('loading')"></code>, like this <a href="http://jsfiddle.net/xk2om9hm/44/" rel="nofollow"><strong>jSFiddle</strong></a></p>
<p>or you it can al... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Xcode Archive Error<p>When i try to archive me app in Xcode, it gives me an error that i don't have a provisioning profile. how do i get one. i have an IOS D... | <p>There are certificates and there are profiles, they are two different things. It sounds like you have a distribution certificate. Go to the developer portal, and then go the the identities, certificates, and profiles.</p>
<p>Profiles will be at the bottom. You need a distribution profile for your app id. Distri... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What does ?? in gdb backtrace mean and how to get the actual stack frames?<p>I was trying to learn how to use <code>gdb</code> on core dumps.</p>
<p>Here is... | <p>Those <code>??</code> are usually where the name of the function is displayed. GDB does not know the name of those functions and therefore displays <code>??</code>. </p>
<p>Now, why is this happening? Depends. GCC compiles including symbols (e.g. function names and similar) by default. Most probably you are working... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to validate check datetime input as ISO 8601<p>I try to validate an input and then i can get input like that i want to.</p>
<p>Example:</p>
<pre><code>... | <p>To check valid <code>DateTime</code>, you need correct <code>DateTime</code> format (i.e <code>"yyyy-MM-ddTHH:mm:ss.fffzzz"</code>) and use <a href="https://docs.microsoft.com/en-us/dotnet/api/system.datetime.tryparseexact?view=netframework-4.8" rel="nofollow noreferrer"><code>DateTime.TryParseExact()</code></a> to... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Trigger method in sub component inside slot, $refs not working<p>I have the following template in a specific modal component:</p>
<pre><code><template>... | <p>My suspicion is that at runtime, the DOM is not rendered until the <code>BaseModal</code>'s <code>open</code> method is invoked. Therefore, <code>this.$refs.DetailCard</code> will returned undefined since the body slot of your component has not rendered with the nested component.</p>
<p>As you have mentioned in the... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Spring cache constant as a key<p>As part of my code I have a method with empty parameters. For e..g,</p>
<pre><code>public MasterData fetchMasterData() {
//... | <p>The <code>key</code> attribute is a <a href="http://docs.spring.io/spring-framework/docs/current/spring-framework-reference/htmlsingle/#expressions" rel="noreferrer">SpEL expression</a> so if you want the key to be <code>masterdata</code> you would write something like this</p>
<pre><code>@Cacheable(cache="master",... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Oracle / SQL command for showing only rows where criteria is changed<p>my database looks like this (ordered by <code>DATETIME</code>):</p>
<p><img src="http... | <p>In Oracle, you can use combination of lead and lag analytical functions to get your desired results:</p>
<pre><code>WITH table_ AS (
SELECT DATETIME, TOTALTIME1, RAWOUTPUT1,
LEAD (RAWOUTPUT1) OVER (ORDER BY datetime) next_,
LAG (RAWOUTPUT1) OVER (ORDER BY datetime) priv_
FROM pump_box_hist)... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Extract excel data from multiple folders to a DataFrame and extract the folder names for each rows to the Dataframe<p>I am trying to extract the data from xl... | <p>Consider building a list of data frames to be concatenated <strong>once</strong> outside the loop. Also, use <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.assign.html" rel="nofollow noreferrer"><code>assign</code></a> to generate the <em>Date</em> column during the loop:</p>
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PHP array displaying for values and variables<pre><code>$states = array(
"NSW" => "NSW",
"VIC" => "VIC",
"QLD" => "QLD",
... | <p>Substitute <code>$key[1]</code> for <code>$value</code>:</p>
<pre><code>foreach ($states as $key => $value) {
$form_ret .= "<option value='".$key."'>".$value."</option>";
}
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
G+ Sign-In Ian Barber Implementation : onConnectionFailed not getting called when disconnecting rebuilding GoogleApiClient<p>I have integrated google+ sign i... | <p>That's a valid state to get into! You can get there if the user has previously signed in, but you have lost the refresh token on the server. </p>
<p>If you look at the gist (which is out of date now since moving to GoogleApiClient of course), you can see we have a getCode call in the onConnected as well: <a href="h... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding HTML markup in react bootstrap tooltip<p>Is it possible to show some custom HTML markup in react bootstrap tooltip component</p>
<pre><code><Overl... | <p>Can you try with <code>dangerouslySetInnerHTML</code>?</p>
<pre><code><Tooltip id='Description__tooltip'>
<div dangerouslySetInnerHTML={{ __html: record.desc}} />
</Tooltip>
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Warning: Type library exporter encountered a type that derives from a generic class and is not marked as [ClassInterface(ClassInterfaceType.None)]<p>I was ma... | <p>I can't find the file reference.cs in my Solution Explorer, yet i can get into it via Search function (searching "class CrSeedClient")</p>
<p><a href="http://puu.sh/g3Yv8/3e8f11c975.png" rel="nofollow">http://puu.sh/g3Yv8/3e8f11c975.png</a></p>
<p>So I've added the missing lines and now it's working properly.</p>
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add multiple UITextfield in UIAlertview<p>I need to put 5 <code>UITextField</code> in <code>UIAlertView</code>. I use this project:
<a href="https://www.coco... | <p>You have to use something like:</p>
<pre><code>ARAlertController *alert = [ARAlertController alertControllerWithTitle:@"My Alert" message:@"This is an alert." preferredStyle:ARAlertControllerStyleAlert];
ARAlertAction* defaultAction = [ARAlertAction actionWithTitle:@"OK" style:ARAlertActionStyleDefault handler:^(AR... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find ANY text without tags<p>I have some text without tags. I try to find it. With jQuery</p>
<p>(this is dinamic text, so I do not know how many peaces of ... | <p>One solution to avoid wrap and white spaces is to use trim like:</p>
<pre><code>$("#tot")
.contents()
.filter(function () {
// get only the text nodes
return this.nodeType === 3 && this.nodeValue.trim() !== "";
}).wrap("<p />");
</code></pre>
<p><a href="http://jsfiddle.net/oyb4adff/"... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
sails make route exclusive post<p>I've added a post route to sails in the routes config file this way:</p>
<pre><code>'post /auth/register': 'AuthController... | <p>You need to turn off the automatic routes sails creates for you. </p>
<p>You can do this by udpating your config/blueprings.js file accordingly</p>
<pre><code>module.exports.blueprints = {actions: false};
</code></pre>
<p><a href="http://sailsjs.org/#!/documentation/concepts/Routes?q=automatic-routes" rel="nofoll... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
VB NET regexp matching numerical substrings<p>I'm trying to make a vb function that takes as input a String and returns, if exist, the string made of numeric... | <p>Here's a LINQ solution that doesn't need regex and increases readability:</p>
<pre><code>Dim startDigits = valoreRaw.TakeWhile(AddressOf Char.IsDigit)
Dim result As String = String.Concat(startDigits)
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
dplyr mutate a sequence from two columns<p>I have a seres of lists that I want to "expand" and by taking sequences. The data looks like:</p>
<pre><code>[[10... | <p>We can use <code>map</code> to loop over the <code>list</code>, extract the one row column with <code>$</code> and apply <code>seq</code></p>
<pre><code>library(purrr)
map_dfr(var_lists, ~ tibble(x = seq(.x$minX, .x$maxX, length.out = 100),
y = seq(.x$minY, .x$maxY, length.out = 100)), .id = 'grp')
#... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Change Pay button with image on checkout based on Woocommerce chosen payment method<p>Through this function I can change the text on the pay button.
I would ... | <p>As in the frontend the button text will be changed by using <code>.text()</code> function of jQuery, adding html like img tag won't work here.</p>
<p>I suggest instead though to you use javascript with jQuery. It should be something like this:</p>
<pre><code>$( document.body ).on( 'payment_method_selected', functi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Netbeans + Maven (Updating Central Repositories)<p>I recently faced issues building my project due to "HTTPS Required" error. This issue was solved by modify... | <p>If you are using NetBeans 8.0 (8.1,8.2) with bundled <code>maven</code> also you could edit <code>settings.xml</code>. For example, for bundled maven with NetBeans 8.1, the file should be in directory <em>C:\Program Files (x86)\NetBeans 8.1\java\maven\conf</em>. </p>
<p>Just add another mirror with https protocol ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Traefik/Portainer - ERR_TOO_MANY_REDIRECTS<p>I'm trying to setup Traefik and Portainer but seem to be hitting some issues. I think mainly around Traefik and ... | <p>Okay, so I figured out my issue.</p>
<p>The above is correct and valid. I use CloudFlare for proxy/DNS etc... I had added my subdomain to my DNS settings, but my Proxy Status was Proxied rather than DNS ONLY. After setting DNS only the above worked.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
join two lists which don't have same length, repeating shortest<h1>I have two lists:</h1>
<pre><code>l1 = [1,2,3,4,5]
l2 = ["a","b","c"]
</code></pre>
<h1>... | <p>You can use <a href="https://docs.python.org/3/library/itertools.html#itertools.cycle" rel="nofollow noreferrer"><code>itertools.cycle</code></a> so that <code>zip</code> aggregates elements both from <code>l1</code> and a <em>cycling</em> version of <code>l2</code>:</p>
<pre><code>from itertools import cycle
list... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Scala drop elements from a list<p>Given the following list: </p>
<pre><code> sealed abstract class IntList
case class Empty() exte... | <p>Nearly there, but there's no need to wrap the recursive call in <code>Element()</code></p>
<pre><code>def drop(n: Int, xs: IntList): IntList = xs match {
case _ if n == 0 => xs
case xs : Empty => xs
case xs : Element => drop(n-1, xs.tail)
}
</code></pre>
<p>This avoids the need to call <code>xs.tai... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to update Kendo Grid row from window<p>The set-up:</p>
<ul>
<li>ASP MVC project</li>
<li>Kendo Grid in a view via Razor</li>
<li>Column custom command, ... | <p>Using your method you are doing double request so my suggesting:
On edit open a window binded to row via MVVM :</p>
<pre><code>function edit(e) {
//get the row which belongs to clicked edit button
var item = this.dataItem($(e.currentTarget).closest("tr"));
//bind the window to the item via mvvm http://... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Django: Relating a property that returns a QuerySet to a SubQuery annotation<p>I'm not sure how best to go about this. I have the following <code>@property</... | <p>I think @RossRogers is on the right track. Using <code>prefetch_related</code> seems like it would work better than an annotation here, since you want to return all of the related objects and not some aggregate or exists check.</p>
<p>To leverage this, you'd do a <code>prefetch_related</code> and update your proper... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reshaping & Selecting Pandas from Pivot<h1>Problem</h1>
<p>I have the following data frame (note values are just to show format):</p>
<pre><code>>>&g... | <p>You can use swap levels to swap them. <a href="http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.swaplevel.html" rel="nofollow">http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.swaplevel.html</a></p>
<p>df.pivot(index=df.index,columns='Country').fillna('').swaplevel(0,1, axis=1)... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cassandra nodes working alone when network is disconnected<p>I have to face a complex requisite in my design for cassandra cluster and I dont know if it is p... | <p>You can build a multi-datacenter cluster with NetworkTopologyStrategy, where every data emitter will write data to a local datacenter nodes. Your emitters will have to be forced to write data only to a specific datacenter through the driver configuration. The consistency levels will need to be <code>LOCAL_ONE</code>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Router.use() requires middleware function but got a undefined<p>I am trying to set up my node server / REST api.</p>
<p>For this i have a few different file... | <p>You must return a router in your middleware here:</p>
<pre><code>app.use('/division', division_model);
</code></pre>
<p>So, your module export function should end with:</p>
<pre><code>return router;
</code></pre>
<p>You also have conflicting ideas when setting this up. If you want the app to define the route as ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Struggling with xml - want to read any of various types of file into a dataset<p>I need to read in various types of xml files and parse the data. It seems th... | <p>Try using <code>StreamReader</code> instead of <code>StringReader</code>, and try it without <code>XmlReadMode.IgnoreSchema</code>.</p>
<pre><code>Dim thisFileReader As System.IO.StreamReader = New System.IO.StringReader(readFiles.Item(thisFile))
ds.Clear()
ds.ReadXml(thisFileReader)
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
asp.net how to retrieve data from database in my controller<p>I have a model like this</p>
<pre><code>class Student
{
public int Id {get; set;}
publi... | <p>Model </p>
<pre><code>using System.ComponentModel.DataAnnotations.Schema;
[Table("StudentMaster")] //write here table name
public class Student
{
public int Id {get; set;}
public string Name {get;set;}
public string College {get;set;}
}
</code></pre>
<p>and then create a context class for your database... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert UTC timestamp to yyyyMMddHHmmss.SSS format in hive<p>I have a scenario like below in hive</p>
<p>convert the current_timestamp to UTC. I am able to ... | <p>You can use the <a href="https://cwiki.apache.org/confluence/display/Hive/LanguageManual+UDF#LanguageManualUDF-DateFunctions" rel="nofollow noreferrer"><code>date_format</code></a> function if the Hive version >= 1.2.0.</p>
<pre><code>select date_format(to_utc_timestamp(current_timestamp, 'America/Los_Angeles'),'yy... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I change memory bytes in Visual Studio 2017?<p>I am trying to change bytes in memory, in a memory window, when debugging a C++ project in my Visual St... | <p>I found a kind of work-around, that works even for modifying executable code memory.
Here are the steps:</p>
<ol>
<li><p>Define a spare global pointer in your code (you can actually use any memory pointer in your code as long as you do not care that you will change its value):</p>
<p><strong>char* memptr;</strong>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why signed char can hold bigger values than 127?<pre><code>int main()
{
char MCU = 0b00000000;
char al_av = 0b10100000;
// Before bit operation
... | <blockquote>
<p>Why signed char can hold bigger values than 127?</p>
</blockquote>
<p>It cannot.</p>
<pre><code>char x = 231;
</code></pre>
<p>here, there is an (implicit) integer conversion: 231 is a <em>prvalue</em> of type <code>int</code> and takes value <code>-25</code> before it is converted to <code>char</code> ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to access query path properties in a resolver? GraphQL<p>I have a database with the following structure.</p>
<p><a href="https://i.stack.imgur.com/JBeSm... | <p>You can extract the path from the GraphQLResolveInfo object passed to the resolver:</p>
<pre><code>const { responsePathAsArray } = require('graphql')
function resolver (parent, args, context, info) {
responsePathAsArray(info.path)
}
</code></pre>
<p>This returns an array like <code>['google', 'accounts', 0, 'us... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
code-coverage of the getter through the assert<p>While unit-testing, is there a way to enable code-coverage analysis only during some steps?</p>
<p>I wish t... | <p>No, I am not aware of any tool that supports this functionality.</p>
<p>The code coverage expresses which portion of your source code was run through by the tests. By checking the result of a get method you are testing also the correctness of the getter. Thus, a test checks more than what is directly covered by ass... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python - count the number of words in text file that are also in csv word list<p>I have this code which counts how many times the words from "wanted" appear ... | <p>Read CsvFileWithWords.csv and put its words in a list. You can do the same you are doing to get the words in textFile.txt.</p>
<pre><code>wanted = re.findall('\w+', open('CsvFileWithWords.csv').read().lower())
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using Extension Methods in ASP.NET MVC<p>I am new to ASP.NET MVC. I have inherited a code base that I am trying to work with. I have a need to add some basic... | <p>Add an optional parameter in your extension method for disabling named <code>enabled</code>and bydefaut it will be <code>true</code> and from view pass <code>bool</code> parameter to disable or enable it:</p>
<pre><code>public static MvcHtmlString DropDown<TModel, TValue>(this HtmlHelper<TModel> html, E... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Does supported android apps in Delphi XE6 with Qualcomm-Snapdragon-800-MSM8974?<p>Android Devices Supported for Application Development
<a href="http://docwi... | <p>Yes. It uses a Krait 400 CPU which says it has NEON.</p>
<p><a href="https://en.wikipedia.org/wiki/Krait_%28CPU%29" rel="nofollow">https://en.wikipedia.org/wiki/Krait_%28CPU%29</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make QCombobox expandable for hierarchical items? (PyQT5)<p>I have a some dictionary variables such as :</p>
<pre><code>{"Courses" : ["Math" , "Scien... | <p>One way to solve this is adding a helper function to your class, that prints the key for you:</p>
<pre><code> def getKey(self):
current = self.sender()
for key, val in self.combo.items():
if val == current:
print(key, val.currentText())
</code></pre>
<p>Then I connect... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get the content of a module passed to an inner attribute macro?<p>So I have defined the following procedural macro:</p>
<pre class="lang-rust prettyp... | <p>The problem you are describing is due to the fact that using procedural macros in position of inner attributes is currently unstable. There has been a <a href="https://github.com/rust-lang/rust/issues/54726" rel="nofollow noreferrer">tracking issue</a> for this problem for about 1.5 years now and <a href="https://gi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java Copyring an array to itself<p>Can I copy an array to itself without creating a new array object (purpose of increase it size)?
I know that with using Co... | <p>System.arraycopy can be used to copy an array to iteself.</p>
<p>From the <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/System.html#arraycopy-java.lang.Object-int-java.lang.Object-int-int-" rel="nofollow noreferrer">Javadoc</a> :</p>
<pre><code> * If the <code>src</code> and <code>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R - Change value names in data.frame but keeping a distinguishing mark<p>i have the following data.frame:</p>
<pre><code>> goals.names
id ... | <p>You could try mutate() from the dplyr package, like this:</p>
<pre><code>library(dplyr)
goals.names <- mutate(goals.names, id = paste("goal",id,sep=""))
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mongodb schema design validation<p>I am building an app which allows users to do some "tasks" to earn points. The "tasks" are part of a "campaign" which them... | <p>I would create collections dedicated to tasks and responses. It <em>will</em> require you to write some 'relational plumbing' logic on the server-side. That's the price to pay for using MongoDB. Some libraries provide helpers to assist you in this (such as Mongoose's <code>populate</code> operator).</p>
<p>Having a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
"index not backed by a repository" error from libgit2 when writing tree from index for 'pull' commit<p>When I do <code>index.write_tree())</code> (<code>inde... | <p>You have an <em>in-memory</em> index, you don't have <em>the repository's index</em>. This is the distinction that is preventing you from writing it.</p>
<p>You have a few options for dealing with an in-memory index:</p>
<ol>
<li>You can convert it to a tree (and then you could create a commit that uses that tree... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to setup MVC mock.Setup and.Returns for a repository method, which has on out parameter and a return type<p>I need to mock a method in a repository, but ... | <p>Another way could be to use <code>delegate</code> in the <code>Callback</code> hook provided by <strong><code>moq</code></strong>. Something like this:</p>
<pre><code>public delegate void SetupOutList(out List<AccountSetup> a);
mockedAccountSetupBo
.Setup(x => x.List(out It.Ref<List<AccountS... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing the Data Argument in R User Defined Functions<p>For functions like <code>lm()</code> in R, you pass the "data" argument into the function, usually a ... | <p>Since you are using <code>tidyverse</code> functions, it would make sense to use tidy evaulation for this type of task. For this function you could do</p>
<pre><code>test_corr <- function(data, x, y) {
quo( cor({{x}}, {{y}}) ) %>%
rlang::eval_tidy(data=data)
}
test_corr(df, x, y)
</code></pre>
<p>Fir... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
FileProvider crash XmlResourceParser and ProviderInfo.loadXmlMetaData on a null object reference<p>I am very new to java and android studio. Im trying to ope... | <p>This line looks suspicious:</p>
<pre><code>Uri contentUri = FileProvider.getUriForFile(MainActivity.this, "com.your.package.fileProvider", pdfFile);
</code></pre>
<p>Which probably should be:</p>
<pre><code>BuildConfig.APPLICATION_ID
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to suggest all values in sap.m.Input<p>I have implemented assisted <code>sap.m.Input</code> control in my project. I also have a value help request fo... | <p>The model has a length limit of 100 elements.
If you want to fetch more values in your model you can increase its size limit with the <code>setSizeLimit</code> function (quick and dirty solution) or (much better) use the dynamic suggestion implementing the <code>suggest</code> event callback of the input.</p>
<p><a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Regex Confusion Literal vs Nonliteral<p>I understand the concept of backslashes and their use in escape sequences, but</p>
<h3>Why do these produce the same... | <p>In the first case, you are asking the regex engine to search for a newline character. Python converts the <code>\n</code> to a newline character and passes it to <code>re.findall</code>.</p>
<p>In tthe second case, you are asking the regex engine to search for <code>\n</code>. Python passes <code>\n</code> to <code... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I make my request asynchronously without importing a new file<p>I am trying to perform a SOAP call but sometimes the response is thousands of record.... | <p>Just for fun...</p>
<pre><code>Sub AsyncTester()
Static col As Collection
Set col = New Collection
col.Add AsyncFetcher("https://stackoverflow.com/", New clsTest)
col.Add AsyncFetcher("https://google.com/", New clsTest)
col.Add AsyncFetcher("https://news.ycombinator.com/", New clsTest)
De... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use do() to replicate a result from plyr<p>Here's a piece of code in <code>plyr</code>. I split a dataframe dta by a grouping variable A, then apply a... | <p>I think this works.... </p>
<p>you should check the results are as desired...</p>
<pre><code>dta %>%
group_by(A) %>%
do(fn(.))
# A B
#1 A 0.22276975
#2 A 0.01183619
#3 A 1.84315247
#4 A 0.19809142
#5 A 0.08114770
#6 A 1.48606944
#7 A 0.84864389
#8 A 0.60060566
#9 A 0.25362720
#10 A ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Comparing two csv files using comm<p>I am working on a script that verifies differences between two csv files (file_1.csv and file_2.csv).</p>
<p>file_1.csv ... | <p>You might want to sort the files before comparing, try:</p>
<p><code>comm -23 <(sort -u file_1) <(sort -u file_2)</code></p>
<p>this would give you all tasks that have not been processed</p>
<p>For example, try the below code snippet:</p>
<pre><code>diff=`comm -23 <(sort -u file_1) <(sort -u file_2)`... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Ignore typescript overload error<p>I am getting the following error when i am compiling my Typescript project</p>
<pre><code>Overload signatures must all be... | <p>A quick look in</p>
<pre><code>Program Files (x86)\Microsoft SDKs\TypeScript\1.0
</code></pre>
<p>showed me that all browser apis are defined in</p>
<pre><code>Program Files (x86)\Microsoft SDKs\TypeScript\1.0\lib.d.ts
</code></pre>
<p>so since I commented out</p>
<pre><code>declare function setTimeout(handler:... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Complex query prolog<p>Yeah, I just was wondering if it is possible to make complex queries in Prolog.</p>
<p>I have a database of tablets with many attribu... | <p>Such queries are easily done in Prolog.</p>
<p>Select all tablets that have (OS: ios OR android, AND their Release_Year is above 2013).</p>
<pre><code>setof(N, Id^OS^Y^( tablet(Id, N),
( tablet_operating_system(Id, OS),
member(OS, [iOS, android]),
tablet_release_year(Id,... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
NodeJS Async - Pass parameters to callback<p>I'm setting up a scraper using NodeJS, and I'm having a hard time figuring out the right way to pass data around... | <p>You can do a self invoking anonymous function and pass the parameters that you want to retain after the method is called like this:</p>
<pre><code>(function(asyncTasksArr, index, zipResults, jobVersion){
return function(){
asyncTasksArr.push(Scraper.batchOne(zipResults['zip_codes'][index], jobVersion));... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CSS - bottom border using :after pseudo-element that's the length of text<p>I have a <code><h3></code> that I need to style to contain a red bottom bor... | <p>Your approach is overcomplicated, just use a gradient background:</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-css lang-css prettyprint-override"><code>h3 {
border: solid 1px
}
span {
background: linear-... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
WPF/XAML - Use 'Style' to create tooltip with model element name<p>We have a very complex questionnaire in WPF with 100s of controls. Groups of controls are... | <p>You can do this by calling <code>GetBindingExpression</code> on the element in question, passing in the dependency property you're interested in. The name will be in the <code>ResolvedSourcePropertyName</code> property of the resulting expression.</p>
<p>The converter you're looking for is something like this:</p>
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Today UILabel auto updating<p>I have a problem updating a current date label in a 'home' view controller like this:</p>
<pre><code>func settingTodayLabel() ... | <p><code>UIApplicationDidBecomeActiveNotification</code> will be fired only if the application becomes active, so you need another notification that fires each day at 0:00 to update the label. </p>
<p>Create a local push notification, that fires at 0:00 and let it broadcast a custom NSNotification that your tune in fo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Trying to clear all input boxes on click<p>Okay, so I am making a madlibs website anyways, I am trying to get all input box's to clear after they submit thei... | <p>this preserves most of your code and just fixes what wasn't working. The solution above is a bit better as the javascript is minimized</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-html lang-html prettyprint-... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ManytoMany relations in Laravel, retrieve data from related tables and display in blade<p>I have two tables related by many to many relation in Laravel Frame... | <pre><code>@foreach($procedures as $procedure)
<li>{{$procedure->underperformances->id}}</li>
@endforeach
</code></pre>
<p>^ This right there <code>$procedure->underperformances</code> will return a <strong>collection</strong>, not a single item, so you need to treat it as array, you will not ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Zend Framework JSON request url<p>I am new with ZF1. I am trying to get JSON response for a particular id. I can get all values from table using following co... | <p>your url should be like :</p>
<pre><code>http://yourdomain.com/index/email/id/14
</code></pre>
<p>And u can acces like in action </p>
<pre><code>$this->getRequest()->getParam("id");
</code></pre>
<p>you can pass multi paramater :</p>
<pre><code>http://yourdomain.com/index/email/id/14/name/john/surname/doe... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Javascript get returned value of inside functions<p>I have the following function that gets a username and by making a query to mssql checks if already exist... | <p>Of course I can't check if the following code works, but you can try rewriting your code for something like this:</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>const chec... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to fail the test by timeout using the mocha with protractor<p>I found on mocha web site then we can set the timeout fot it blocks, but looks like it d... | <p>I found the problem in my <strong>exports.config</strong>:</p>
<pre><code> mochaOpts: {
reporter: 'good-mocha-html-reporter',
slow: 5000,
enableTimeouts: true
}
};
</code></pre>
<p>enableTimeouts was in <strong>false</strong> state.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
IONIC 4 - Angular / Firestore<p>I'm facing to a problem concerning authentication and user profile.
I'm using ionic v4 / angular and firestore.
Currently I c... | <p>Finally, I found and resolved my issu.</p>
<pre><code> constructor(
private afAuth: AngularFireAuth,
private afs: AngularFirestore,
private router: Router,
public auth: AuthService
) {
this.user$ = this.afAuth.authState.pipe(
switchMap(user => {
if (user) {
console.... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use a double while loop in python?<p>Does a python double while loop work differently than a java double loop?
When I run this code:</p>
<pre><code>i... | <p>Because your j gets 11 after first iteration. Need to reset it:</p>
<pre><code>i = 0
j = 1
while i < 10:
j= 1 #<-- here
while j < 11:
print i, j
j+=1
i+=1
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is tag35=4 sent via ToApp or ToAdmin<p>I want to stop all duplicate messages(orders really) but allow message
tag 35=4 through. This is needed after a reconn... | <p>It's an administrative message, so it will be sent via <code>ToAdmin</code>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
StatsModels formula Polynomial Regression does not match numpy polyfit coefficients<p>My polynomial regression using statsmodels formula does not match nupy ... | <p>Polynomials can become very badly scaled if the underlying data is not in a small range around zero.
As a consequence, computation become numerically unstable and the results can be dominated by numerical noise.</p>
<p><a href="http://jpktd.blogspot.com/2012/03/numerical-accuracy-in-linear-least.html" rel="nofollo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Store variable in azure logic app to use in next run<p>I'm fetching data from API, but I want to fetch data from the last time when logic run app to current ... | <p>For now logic app doesn't support such variable could be shared in different runs.</p>
<p>So if you want to implement this feature, you could use azure storage queue or service bus to do it, create a message to store value you want to use in next run. And every time after getting the value remember to delete the o... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can i convert this function to prepared statment?<p>I have this ajax request and it inserts data into the database without any problems but when I tried ... | <p>You're certainly getting closer but you must pay very close attention to PHP syntax. This is programming, <em>every character matters</em>.</p>
<p>Here's a reworked version:</p>
<pre><code>$sql = $db->prepare("INSERT INTO navigations (secret_api_key, title, link) VALUES (?, ?, ?)");
$sql->bind_param('sss', $... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to sum values for the same key<p>I have a file </p>
<pre><code>gu|8
gt|5
gr|5
gp|1
uk|2
gr|20
gp|98
uk|1
me|2
support|6
</code></pre>
<p>And I want to ... | <p>To answer the title of your question: "how to sum values for the same key" - well, there is the builtin class called <code>collections.Counter</code> that is a perfect match for you:</p>
<pre><code>import collections
d = collections.Counter()
with open(file) as f:
tld, cnt = line.strip().split('|')
d[tld] +... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
bash script to remove previous backup<p>I set up a daily cron job to backup my server.</p>
<p>In my folder backup, the backup command generates 2 files : th... | <p>If the file is generated daily, a simple approach would be to take advantage of the -mtime find condition:</p>
<pre><code>find /home/archives/ -daystart \( -name '*.json' -o -name '*.tar.gz' \) -mtime +1 -exec echo rm -f {} +
</code></pre>
<ul>
<li><code>-daystart</code> - use the start of the day for comparing mo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Zend form validation - NotEmpty + StringLength<p>In form element, I have edited error messages:</p>
<pre><code>$this->addElement('text', 'type', array(
... | <p>You can try something like this:</p>
<ol>
<li><p>Comment the second validator</p>
<pre><code>$this->addElement('text', 'type', array(
'label' => 'Type: ',
'class' => 'form-control',
'placeholder' => 'type',
'required' => true,
'validators' => array(
//array('validator'... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use props and navigation together in one functional component in react native<p>I want to use <code>props</code> and <code>{navigation}</code> in one ... | <p>You need to lookup destructuring: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment" rel="nofollow noreferrer">https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment</a></p>
<p>Example:</p>
<pre class="lang-js... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# Wrong Value stored in variable<p>I am fairly new to programming so have some mercy ;)
I am trying to build a program that can solve equations and give gra... | <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.console.read" rel="noreferrer"><code>Console.Read()</code></a> returns an <code>int</code>, but not in the way you think. It returns the numeric value of the typed character, <em>not</em> the human-intuitive interpretation of a character that coincidentall... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Stop animation from array in Unity and C#<p>In my Unity project I have several levels and several steps. Each step and level have their own animations. With ... | <p>Your arrays are static, so they are created before <code>Awake</code>.</p>
<p>Your <code>animAnimation</code> is filled with nulls, and it doesn't change when you put components to <code>Start_Script.AnimationStep001</code> and others. You need to fill <code>animAnimation</code> with components after <code>Awake</c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to restrict associations to a subset of another association in Doctrine?<p>I got a bit stuck with multiple mappings of the same object in Doctrine. The a... | <p>To implements this check low-level as possible (nearest to the db) I think the only solution is a <a href="http://symfony.com/doc/current/cookbook/doctrine/event_listeners_subscribers.html" rel="nofollow">Doctrine Event Listener</a> that in the pre-persist event check for your custom constraint. Read more about <a h... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Multiple constant to a matrix and convert them into block diagonal matrix in matlab<p>I have a1 a2 a3. They are constants. I have a matrix A. What I want to ... | <h2>Discussion and code</h2>
<p>This could be one approach with <strong><a href="http://in.mathworks.com/help/matlab/ref/bsxfun.html" rel="nofollow noreferrer"><code>bsxfun(@plus</code></a></strong> that facilitates in <strong><a href="http://in.mathworks.com/help/matlab/math/matrix-indexing.html" rel="nofollow norefer... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I plot box-plots for principal components 1, 2 and 3 for three different groups?<p>I have computed a principal component analysis (PCA) and derived a... | <p>It is quite weird to plot the component scores like, but try the below to get a dot plot for the combinations you mentioned:</p>
<pre><code>df = data.frame(disease=rownames(data.mat.1),data.mat.1.pca$x[,1:3])
df %>% pivot_longer(-disease) %>%
ggplot(aes(x=name,col=disease,y=value)) +
geom_point(position=pos... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Program with dynamic matrix crashes upon reaching printf<p>This program has some parts of it in spanish, so I'll explain: It's a dynamic 2D array, a message ... | <p>Here is the problem</p>
<pre><code>s("%f", ((a + i) + j));
</code></pre>
<p>this</p>
<pre><code>scanf("%f", &a[i][j]);
</code></pre>
<p>always use the proper function names, and this <code>(*(a + i) + j)</code> is also ok, but is confusing as you can see.</p>
<p>Use the array indexing notation to avoid prob... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.