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: Lagged function within group<p>I would like to write code to compute within each group, sum of lagged differences as shown in the table below:</p> <pre><cod...
<p>Here's a <code>tidyverse</code> solution:</p> <pre><code>library(dplyr) library(tidyr) dat %&gt;% as_tibble() %&gt;% group_by(ID) %&gt;% mutate(output = ifelse(x, lag(rank) * R - lag(cumsum(U)), R)) </code></pre> <p>Result:</p> <pre><code># A tibble: 14 x 6 # Groups: ID [3] ID x rank U ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AngularJS ng-options from CakePHP Data<p>I have some json data I receive from a cakePHP server. this is a snippet of what is found in my current <code>$scope...
<p>Expounding on <em>aleberguer's</em> answer (which pointed out I needed a model) – I was still having a hard time having the correct options selected when staring my app. The whole "using select as and track by don't work together" thing... so this solution not only populated the options but enabled them to be select...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JUNG change Layout dynamically<p>I created a graph using JUNG, and I want to add a combobox that give the user the possibility to change the used layout (Cir...
<p>The source file for this demo (in your distribution) demonstrates how to do it: <a href="http://jung.sourceforge.net/doc/api/edu/uci/ics/jung/samples/ShowLayouts.html" rel="nofollow">http://jung.sourceforge.net/doc/api/edu/uci/ics/jung/samples/ShowLayouts.html</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Obtaining an iterator from the element passed to a lambda when using std::find_if<p>I am trying to simplify a recursive function that receives an iterator. S...
<p>Messy, but <code>v.begin() + (&amp;foo - &amp;v.front())</code> is the iterator pointing to <code>foo</code>. Note that this only works because <code>vector</code> has contiguous storage: don't try it with a <code>list</code> or <code>deque</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I detect a case-insensitive file system in Perl?<p>I tried using <a href="https://metacpan.org/pod/File::Spec#case_tolerant" rel="nofollow"><code>File...
<p>In truth, every directory considered must be checked on its own. This is because, on Unix-like systems, <em>any</em> directory can be a different file system than some other directory. Furthermore, use of <code>glob</code> is not very reliable; from <a href="http://perldoc.perl.org/perlport.html#System-Interaction" ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android Studio crashed now can't push to GitHub<p>This morning AS crashed on statup. I rebooted and it seemed to startup fine. However, when I try to commit ...
<p>Ok after some help from the comments I have got git to work again from Git Bash and from AS. I did the following:</p> <ol> <li><p>git status: says my upstream is gone.</p></li> <li><p>Read this to understand git jargon better: <a href="https://stackoverflow.com/a/21616241/2815375">https://stackoverflow.com/a/216162...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Evaluating code blocks in Rebol3<p>I'm trying to improve <a href="http://learnrebol.com/rebol3_book.html#section-1.2" rel="nofollow">the Sliding Tile Puzzle ...
<p>First, I would say it's better to construct a block directly, instead of constructing a string and converting it to a block. But if you really want to do that, this should do the trick:</p> <pre><code>view/options compose/only [ hgroup (load hgroup-data) ] [bg-color: gameback] </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why doesn't creating video var from jquery work and from getElementById does?<p>It doesn't make sense to me, getElementById works just fine but I want to use...
<p>If you use <code>$("#myVideo");</code> it returns jQuery object that does not have methods like <code>.play</code> or <code>.pause</code>, in our case you need get DOM element like <code>$("#myVideo").get(0)</code></p> <p><a href="http://api.jquery.com/get/" rel="nofollow">jQuery .get</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SVM ValueError: Input contains NaN, infinity or a value too large for dtype('float64')<p>Please help me for this! I don't know why this error happened when I...
<ol> <li><p>Check if you have nulls in your data, using <code>your_data.isnull().any()</code>. If you have nulls, use <code>your_data = your_data.dropna()</code>.</p> </li> <li><p>Check if your data contains inf using <code>np.isfinite(your_data)</code>. If there are inf values, you can use <code>your_data.replace([np....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use PARI/GP for calculating the inverse of a power series?<p>I want to invert a power series with PARI/GP:<br> if <code>$y=a[1]*x+a[2]*x^2+...+O(x^N)$...
<p>PARI has a built in function to do power series reversion, so there is no need to get into a low level implementation which is certainly very sub-optimal and complicated.</p> <p>Example use:</p> <pre><code>serreverse( x / (1 + x)^2 + O(x^20)) </code></pre> <p>A second example (based on an example in the link give...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Running event by clicking button c++<p>I'm trying to run simple event by clicking button, but my code doesn't seems to work. There are two issues. First, I n...
<pre><code>int nmr(); </code></pre> <p>This <strong>declares</strong> a function named <code>nmr</code>. That's not what you want. You want to <strong>call</strong> the function of the same name that you defined elsewhere. You mean to write, simply:</p> <pre><code>int retval = nmr(); </code></pre> <p>That calls the ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make a moving transition of points from a to b<p>I have a scatterplot and I have two different sets of datapoints I am visualizing from the dataset. I...
<p>Yes it's possible. Using the property transition and combining with duration in milliseconds. Look below:</p> <p><a href="https://jsfiddle.net/mathyaku/L5bpaxwv/1/" rel="nofollow noreferrer">https://jsfiddle.net/mathyaku/L5bpaxwv/1/</a></p> <pre><code>function drawScatterplot(data, selector) { // set the dimensi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I preserve the assign order in a structure in ColdFusion <2016<p>ColdFusion doesn't preserve the order in which elements were assigned to the structu...
<ol> <li><p>Order.<br> The solution is to use a java LinkedHashMap which can be used just like a structure in ColdFusion.<br> So, I just need to replace <code>StructNew();</code><br> with: <code>createObject("java", "java.util.LinkedHashMap").init();</code></p></li> <li><p>Uppercase:<br> Assign/address them though the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: mixing "exploded" slices and regular parameters in variadic functions<p>I'm wondering why it's not possible to do the following in go:</p> <pre><code>func m...
<p>The value for a variadic argument can be specified <em>either</em> by enumerating the elements, <em>or</em> using an existing slice, specified by its name followed by <code>...</code>.</p> <p>You want to mix the 2 possible ways which is not permitted by the Go Language Specification (<a href="http://golang.org/ref/...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting latitude and longitude of the Sun on a world map with PyEphem<p>I'm trying to determine the latitude and longitude of say the Sun, the Moon and Mars....
<p>I finally figured it out. Sort of. Actually I just ported the relevant bits of libastro to Python. Note that this code runs against the current git version of Skyfield (be6c7296).</p> <p>Here goes (<a href="https://gist.github.com/trehn/03b80d137fbfa39b09af" rel="nofollow">gist version</a>):</p> <pre class="lang-p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: why can't I load another page into an iframe the following way?<p>I want to have an Iframe, so that when I click on a button, another page loads into it.</p>...
<p>This does not work because it violates the "same origin policy".</p> <p>Try running this in Chrome, and check your console.</p> <p>This is what you should see:</p> <blockquote> <p>Refused to display '<a href="https://www.google.is/?gws_rd=cr,ssl&amp;ei=lMffVJSdJ5LfaseMguAD" rel="nofollow">https://www.google.i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regular Expression to Match OData Query<p>I have the following string</p> <pre><code>(absolute_performance eq 12.2M) </code></pre> <p>The only variance I m...
<p>You need to use a <a href="http://www.rexegg.com/regex-disambiguation.html#noncap" rel="nofollow"><strong>grouping</strong></a> construct to group your alternations. You can write this as: </p> <pre><code>\(absolute_performance\s(?:eq|ge|le)\s(\d+(?:\.\d+)?)M\) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Requery a form based on current record in another form<p>I have a form that has two subforms; AvailablePublicFolderUsersSubform and RelatedSharedMailboxSubfo...
<p>Since your code runs in another subform, <code>AvailablePublicFolderUsersSubform</code>, you need to "navigate" from there:</p> <ul> <li>up (to the main form), </li> <li>sideways (to the other subform), </li> <li>down (form + properties of subform)</li> </ul> <p>which translates to</p> <pre><code>Me.Parent.Relate...
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 keras cnn model to pytorch version<p>This is the example keras code that I want to convert to pytorch. My input dataset is 10000*1*102...
<p>Welcome to pytorch. :) I am really glad you decide to switch from Keras to PyTorch. It was an important step for me to understand how NNs work in more detail. If you have any specific questions about code or if it isn't working please let me know.</p> <pre><code>import torch.nn as nn a0 = nn.Conv1D(n_timesteps, 64,...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using AND in a DELETE FROM statement<p>I'm having trouble using the AND operator in a DELETE FROM statement. I can get the query to run successfully, but it'...
<p><code>AND</code> means a row has to satisfy both conditions (think about how you use it when matching different columns). It's not possible for the row to have two different <code>employeeNumber</code> values.</p> <p>If you want to delete both employees, you should use <code>OR</code>, not <code>AND</code>.</p> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python: Where to put logging.getLogger<p>I tried to put getLogger in the module level. However, it has some disadvantages. Here is my example:</p> <pre><cod...
<p>Short answer, you just need to make sure you do your logger set up after the directory is created.</p> <p>If you want to import the above and only then create the file, one way to do it is to put your code in a function.</p> <pre><code>def monitor_log_setup(): log_monitor = logging.getLogger('monitorlog') ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there possibility to use optional by checking reference to object instead of method result?<p>I have following code:</p> <pre><code>if(myObject != null){...
<p>As Jon Skeet points out, you haven't said what benefits you expect from using <code>Optional</code>.</p> <p>You'll get the same result as the original code with</p> <pre class="lang-java prettyprint-override"><code>return Optional.fromNullable(myObject) .transform(new Function&lt;MyObject, String&gt; { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I improve the performance of the Symfony Serializer?<p>I try to get a json variable from my database:</p> <pre><code>$table = $this-&gt;em-&gt;getRe...
<p>This really depends on the output you need it takes too long because in my opinion you have nested attribute in your DATA entity to make it faster use serialisation groups <a href="https://symfony.com/doc/current/components/serializer.html#component-serializer-attributes-groups-annotations" rel="nofollow noreferrer"...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: codeigniter: alteration of PHP array<p>i am sending $_POST['checkbox_name'] to function insert_to_table.</p> <pre><code>function insert_to_table($valid_arra...
<p>Your probably looking for something like <a href="https://ellislab.com/codeIgniter/user-guide/database/active_record.html#insert_batch" rel="nofollow"><code>$this-&gt;db-&gt;insert_batch();</code></a></p> <p><strong>So for example:</strong></p> <pre><code>&lt;?php function insert_to_table($valid_array) { $thi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React-Native Picker cannot initialize a default value<p>I have a Picker and I have to show my default value on initialization of Picker but selectedValue is ...
<p>You should use something that is comparable for the picker item value prop. </p> <p>I am assuming what is happening here is that the object comparison between <code>this.props.expense.currency</code> and the <code>value</code> prop on each <code>Picker.Item</code> is failing so it is defaulting to the first. Try ma...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reading an INI file and setting them as global variables in batch<p>I have a batch file that does a bunch f things already and been trying to expand it to ge...
<p>Have a look at the below example. I used your existing code, even though it can be improved. You can see how I utilized the <code>for /l</code> loop to give you an idea of what can be done. You can shape this to fit your desired result. You can consider the same solution for different sections as well.</p> <pre><co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Suggestion on approach to compare XMLs (instead of using regex with Java's String replaceAll)<p>I'm writing a test utility that I intend to use to create art...
<p>Do the "replace" normalization using an XSLT transformation, then use the XPath 2.0 deep-equal() function (perhaps within the same transformation) to do the comparison with reference results. This enables proper XML comparison semantics, e.g. ignoring insignificant whitespace, or arbitrary distinctions such as singl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What happens when I assign a pointer to another pointer?<p>I am facing a problem understanding this code were a pointer points to another pointer. I am requi...
<p>The line</p> <pre><code>p = q </code></pre> <p>is setting the value stored at <code>p</code> (which is a pointer) to be equal to the value stored in <code>q</code> (also a pointer). Pointers store addresses as their value, so that line is making <code>p</code> and <code>q</code> store the same address now.</p> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Multiple values at $response<p>On my HTML file i have the following:</p> <pre><code>First Name &lt;input type="text" name="username" size=100&gt; Last Name ...
<p>try this <code>$response = $_Client-&gt;doHallo($_username.' '.$_lastname);</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ternary operator not working?<p>This java codingbat problem is very very easy but, I was told to do it only using ternary operators. Here is the prompt:</p> ...
<p>Change your return statement to:</p> <pre><code>return nums.length &lt; 1 ? new int[] {} : (nums.length &lt; 2) ? new int[] {nums[0]} : new int[] {nums[0], nums[1]}; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: setState not work by onChange inside useState<p>I am using useState Hook to store a form to manage view when user click. The interface display good but I can...
<p>If you are passing something to the function on <code>onChange</code> you need to call it like: </p> <pre><code>onChange={e =&gt; seturl({ url: e.target.value })} </code></pre> <p>Or you can simply achieve this by doing:</p> <pre><code>const [url, setUrl] = useState(''); return ( &lt;div&gt; &lt;form&gt; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pytorch nllloss function target shape mismatch<p>I'm training a LSTM model using pytorch with batch size of 256 and NLLLoss() as loss function. The loss func...
<p>Your input shape to the loss function is <code>(N, d, C) = (256, 4, 1181)</code> and your target shape is <code>(N, d) = (256, 4)</code>, however, according to the docs on <a href="https://pytorch.org/docs/stable/nn.html?highlight=nllloss#torch.nn.NLLLoss" rel="nofollow noreferrer">NLLLoss</a> the input should be <c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I find out which cloud service a site is hosted on?<p>I'd like to find out whether a site is hosted in a cloud service like AWS or Google Cloud or not...
<p>You can check whois records online for any website, and check DNS pointing from which you will get idea about the provider where it is pointing. Or simply use third party websites like <a href="https://hostingchecker.com" rel="nofollow noreferrer">https://hostingchecker.com</a> to find the hosting provider.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to close sidebar when clicking link?<p>I am trying to get my sidebar to close when I click on any of the menu options. I was able to get the sidebar to c...
<p>You could create a method to hide the sidebar and pass it to the Sidebar component, so it executes when you click the links.</p> <pre><code>const Sidebar = ({hideSidebar}) =&gt; ( &lt;div className='sidebar'&gt; &lt;Link onClick={hideSidebar} className='sidebar-option' to='/projects'&gt; PROJECS &lt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I force any links clicked within a WebView to open in Safari?<p>I have a WebView in my application and I would like any links clicked within the WebV...
<p>This is done essentially the same way in Swift as in Obj-C:</p> <p>First, declare that your view controller conforms to <code>UIWebViewDelegate</code></p> <pre><code>class MyViewController: UIWebViewDelegate </code></pre> <p>Then implement <a href="https://developer.apple.com/library/prerelease/ios/documentation/...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What's the right way to create OsStr(ing) from a FFI-returned slice?<p>I have a function that accepts a callback with args <code>data: *const u8, length: usi...
<p>You can use <a href="http://doc.rust-lang.org/std/slice/fn.from_raw_parts.html" rel="nofollow"><code>from_raw_parts</code></a> to go from the raw pointer to a slice, then <a href="http://doc.rust-lang.org/std/os/unix/ffi/trait.OsStrExt.html" rel="nofollow"><code>OsStrExt::from_bytes</code></a>:</p> <pre><code>use s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to render Altair / Vega in a PyQt widget<p>Is it possible to have Altair or Vega(-Lite) render to a PyQt widget, similar to Matplotlib supporting multipl...
<p>The best option to visualize a plot with Altair is to use QWebEngineView since altair what is to create javascript code based on the instructions you set. IMHO the best solution is to obtain the html of the chart and set it in a QWebEngineView. In the following example I show how to do the above, in addition to enab...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does my fixed positioning no longer work?<p>I'm having issues with fixed positioning and 3d transforms, where elements don't appear to respect positionin...
<p>I am on linux machine, so I don't have <strong>IE11</strong> browser to test, but I think I know where is the problem. If Chrome and IE11 behave differently than I suppose it is a bug in one of them. I tested on <strong>Chrome</strong> and everything is OK. It respects the <strong>W3C</strong> specification.</p> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Shopify Embedded App authenticating requests to my postgresql db<p>Does shopify have a method of authenticating requests to my postgresql db. I was given cod...
<p>Shopify usually passes a <code>hmac</code> argument that needs to be validated in the backend.</p> <p>This hmac includes mostly static information like your store name, timestamp, language etc... but the important part is that is salted with the APP password.</p> <p>You can read more about this here: <a href="http...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I get rid of the `this` keyword in local functions?<p>I'm writing a small JavaScript game framework and often use objects' properties, like</p> <pre...
<p>Your question is hard to answer without seeing any code, but in general, "modern" JavaScript <a href="http://en.wikipedia.org/wiki/Object-oriented_programming" rel="noreferrer">OOP</a> based on factories and closures is less verbose and more idiomatic than the old "wannabe Java" style with <code>new</code>'s and <co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to remove NAs with the conditions in R?<p>I'd like to remove some rows with the condition. Here is my data:</p> <pre><code>df_A &lt;- tribble( ~produc...
<pre><code>df_A %&gt;% group_by(product_name) %&gt;% filter(!is.na(id) | is.na(id) &amp; is.na(clicks)) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Split list of lines into 2d array<p>I have set of sequences in a list which looks like this :</p> <pre><code>[agghd,gjg,tomt] </code></pre> <p>How to split...
<p>You can split a string to characters by calling <code>list()</code> on it</p> <pre><code>list1 = ['agghd', 'gjg', 'tomt'] list2 = [list(string) for string in list1] # output: [['a', 'g', 'g', 'h', 'd'], ['g', 'j', 'g'], ['t', 'o', 'm', 't']] </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Move divs with specific class to top<p>On button click, I want to add "active" class to divs that have "sort" class. Then, move divs with "active" class to t...
<p>The issue you have is here:</p> <pre><code>if($('.container div').hasClass('sort')) { $(this).addClass('active').prependTo('.container'); } }); </code></pre> <p>You need to reference the current element in each loop rather than the entire collection.</p> <p><div class="snippet" data-lang="js" data-hide="false...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why can't nested describe() blocks see vars defined in outer blocks?<p>I've run into this issue in real code, but I put together a trivial example to prove t...
<h3>The body of a <code>describe</code> block is executed before the <code>beforeEach</code> blocks.</h3> <p>This is exactly as expected. The problem is that your <code>var trees</code> variable is trying to access <code>orchard</code> before it has been initialized. <strong>The body of a <code>describe</code> block is...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: UISearchController Not Redisplaying Navigation Bar on Rotate<p>I have implemented the UISearchController and it is working great except...</p> <p>When I cli...
<p>It looks like the <code>UISearchController</code> forgets to reset the frame of the <code>searchBar</code> when the status bar reappears. I think this is probably a bug in <code>UISearchController</code>; there seem to be a few listed in <a href="http://openradar.appspot.com/search?query=UISearchController" rel="no...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript: Why do I put "()" after a variable when calling it in console.log?<p>I'm working through examples in the ebook "eloquent javascript." On page 51,...
<p>Exactly: those parentheses are used to call <code>wrap2</code>, because it's a function.</p> <p>You use</p> <pre><code>var wrap2 = wrapValue2(3); </code></pre> <p>And the function <code>wrapValue2</code> returns another function.</p> <p>So <code>wrap2</code> is a function.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I use Devise's `confirmation_url` outside of a mailer?<p>I am using Devise in a rails project. I want to pass the confirmation url to a third party. ...
<p>Ok so after fighting with this for a while I decided to read the explanation near the top of this file:</p> <p><a href="https://github.com/plataformatec/devise/blob/master/lib/devise/controllers/url_helpers.rb" rel="noreferrer">https://github.com/plataformatec/devise/blob/master/lib/devise/controllers/url_helpers.r...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: send multiple emails from a table using send dbmail stored proc in sql<p>I am trying to send multiple emails from my table using sp_send_dbmail but i am gett...
<p>Since you're not attaching a query to the mail using the <code>@query</code> variable for the procedure <code>sp_send_dbmail</code> either set <code>@attach_query_result_as_file = 0</code> or remove the variable altogether. Or attach a query if that is what you want to do - you could try to add <code>@query = 'SELEC...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java TCP Simple Webserver Problems with response codes (homework)<p>This is an assignment for a course we are having and i need some help.</p> <p>I am havin...
<p>Make sure that you write e.g. <code>HTTP/1.1 404 Not Found</code> to the client, not just the <code>400</code>. </p> <p>Actually no, your problem is that you don't end the response properly. The browser keeps receiving data and shows no response code received. Let me see how this can be fixed in your code. </p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jquery toggle not working within if-else statement<p>I'm trying to hide/show sections of a page using the following script:</p> <pre><code>$(function () { ...
<p>Replace:</p> <pre><code>} else if (contentType == "train" || "manual") { </code></pre> <p>with:</p> <pre><code>} else if (contentType == "train" || contentType == "manual") { </code></pre> <p><code>"manual"</code> is always evaluated as <code>true</code> therefore this whole <code>else-if</code> branch is evalua...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to do responsive design in MS Access forms?<p>So there are a couple of custom forms in an Access 2007 that gets skewed when viewed in different resolutio...
<p>You can adopt control anchoring and thus controls on a form will flow down and to the right very much like a web page.</p> <p>The anchoring works much better in 2010, but 2007 does have this feature.</p> <p>So note VERY close how the buttons and the size of the text box in this Access form re-sizes:</p> <p><img s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to handle different device sizes<p>I know how to handle screen sizes, but it is quite a different matter when using OpenGL ES. The thing is that normally...
<p>Actually, I was very stupid when asking this. After a bit of experimenting it turned out that the size of the squares of the grid will stay of the same size, because of the way opengl es vertices work. On bigger devices is the size the same as on smaller ones, because the scale stays the same, only the corner indice...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: php trying to check if user's input does not contain banned words<p>Trying to check if user's input does not contain banned words</p> <p>Created array, for ...
<p>Maybe do something like this, where you split the input into an array of words, and then check to see if any words in the input array are also present in the <code>$prohibited_words</code> array:</p> <pre><code>$prohibited_words = array('Hello!'); $input = 'Hello!'; $input_array = explode(' ', $input); $intersect =...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create different format for a table<p>I have a table with over 500 columns, dynamically created and named by the user. New columns can be created by the user...
<p>Another option just for fun</p> <pre><code>Declare @YourTable Table (EmpID int,EmpName varchar(50),Salary int,Location varchar(100)) Insert Into @YourTable Values (1,'Arul',100,null) ,(2,'Jane',120,'New York') </code></pre> <p><strong>If 2016+ use JSON</strong></p> <pre><code>Select* From @YourTable A Where ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Custom range slider issue on Internet Explorer<p>Below is the css for my slider. The problem is that the slider is totally failing on IE. Here is also the o...
<p>First, since <a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event" rel="nofollow noreferrer">the input event</a> only supports input of type <strong>text</strong> and <strong>password</strong> in the IE browser, I suggest you could try to use the <strong><code>mouseup</code></strong> eve...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot drop/alter column in SQL Azure<p>As the title says, I cannot drop or alter a column in SQL Azure. I wanted to change its datatype from int to tinyint....
<p>The default value is a constraint you have in place, you have to delete it first:</p> <pre><code>ALTER TABLE xxxxx DROP CONSTRAINT &lt;name of your default here&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: No synced vagrant folder to be found<p>I am trying to work through the "Getting Started" section at the vagrant <a href="http://docs.vagrantup.com/v2/getting...
<p>By default, Vagrant will share your project directory (the directory with the Vagrantfile) to <code>/vagrant</code> on the guest machine.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using maybePop and pop<p>I know that <code>maybePop</code> and <code>pop</code> have a similar function for popping screen to previous screen, but <code>mayb...
<p>It depends on your use case. <a href="https://api.flutter.dev/flutter/widgets/Navigator/pop.html" rel="nofollow noreferrer">Navigator.pop()</a> doesn't interact with the <a href="https://api.flutter.dev/flutter/widgets/WillPopScope-class.html" rel="nofollow noreferrer">WillPopScope</a> callback if that's what you're...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: A Java builder class with JsonDeserialize Optional fields set as Optinal.empty. Set default value when JsonDeserialize<p>Set default values when deserializin...
<p>Jackson has a set of modules that deal with JDK 8 datatypes, including Optional.</p> <p>First, add the latest version as a Maven dependency:</p> <pre><code>&lt;dependency&gt; &lt;groupId&gt;com.fasterxml.jackson.datatype&lt;/groupId&gt; &lt;artifactId&gt;jackson-datatype-jdk8&lt;/artifactId&gt; &lt;versio...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: UITableView extra space at bottom<p>My tableview has an extra space at the bottom, as you see in the picture:</p> <p>All the rows in the tableView have a fi...
<p>Ok, I got it.</p> <p>The "Adjust Scroll View Insets" was marked on my viewController (not my tableView).</p> <p>Here is an <a href="https://stackoverflow.com/a/22022366/1107651">answer</a> with a detailed explanation</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to install properly Alamofire SwiftyJSon and Alamofire-SwiftyJson<p>Has you can see from my previous questions, I got a lot of trouble parsing JSON Data....
<p>Add <a href="https://github.com/Alamofire/Alamofire" rel="nofollow noreferrer">Alamofire</a> and <a href="https://github.com/SwiftyJSON/SwiftyJSON" rel="nofollow noreferrer">SwiftyJSON</a> to the project. Then you can use Alamofire to request the data from the server and SwiftyJSON for serialization.</p> <h2>Alamof...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R: raster comes up with NAs even though values were added<p>When I make a raster from scratch and use <code>length(is.na(raster))</code> I get all cells as N...
<p>This answer is a little involved, so please bear with me.</p> <p>First of all, think about the following code:</p> <pre><code>x &lt;- c(1, 2, 3, 4, 5) </code></pre> <p>What result would you expect to get from the following line?</p> <pre><code>length(is.na(x)) </code></pre> <p>If you think the answer should be ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: byte[] array to struct with variable length array<p>I'm receiving an array of bytes from a socket and the structure of the bytes is simply a large char array...
<p>Just don't try too hard to make your C# declarations match the packet format exactly. You'd favor this:</p> <pre><code>[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 1)] public class Header { //.... } public class Packet { public Header Header; public byte[] VariableLengthData; } ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ReplicaSet fails with invalid: spec.template.metadata.labels<p>I am trying to do some research on replicaSet for my learning purpose. I was able to create a ...
<p>Can you try with the following by changing the label in template section.</p> <pre><code>apiVersion: apps/v1 kind: ReplicaSet metadata: name: replicaset-2 spec: replicas: 2 selector: matchExpressions: - {key: tier, operator: In, values: [frontend1]} template: metadata: labels: ti...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Out Of Memory Error in Android Studio<p>I'm trying to create my first android app, so I'm really new to android development. I'm trying to make a nice backgr...
<p>You should recycle bitmap after <code>canvas.drawBitmap(background, 0, 0, null);</code>, or create bitmap once, in the constructor, and then use it, it is very costly to create bitmap each time in the onDraw method, it even costly to create simple objects in the onDraw, you shuold avoid from it, <code>android:largeH...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change Spring Batch Control Table Locking Strategy<p>We have a system that allows an operator to stop a long running Spring Batch job by using the <code>JobE...
<blockquote> <p>stop a long running Spring Batch job by using the JobExplorer to get a reference to the JobExecution and calling stop() on it.</p> </blockquote> <p><code>JobExecution#stop</code> will be deprecated in the next minor version 4.3 and removed in the next major version (See <a href="https://github.com/sp...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it dangerous to allow user to give arguments to ndb.Query()?<p>I'm writing a search tool, and one of the things I have to do is to let the user search for...
<p>Arguments to the <code>ndb.Query</code> constructor cannot modify nor delete data. They could easily crash this instance of your server, if erroneous, or provide access to data you might not want that user to see, e.g by an undesired <code>namespace</code> setting -- but that's about the worst of it.</p> <p>Nevert...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to generate a random n-bit number where n is arbitrary<p>For example, if n is 32 bits, a random number between 2147483648 and 4294967295 would be generat...
<p>This will give you the range you are asking for:</p> <pre class="lang-cpp prettyprint-override"><code>uint32_t n = 30; // Change to whatever value you need - at runtime. uint32_t umin = uint32_t(uint64_t(1) &lt;&lt; uint64_t(n - 1)); // Extend to 64-bit ints... uint32_t umax = uint32_t((uint64_t(1) &lt;&lt; uint6...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to calculate the fb likes in admin panel using php?<p>I'm creating one admin site with login system using php. In that I need to calculate the number of ...
<p>You can try this code for fb like count</p> <pre><code>$ch = curl_init("http://graph.facebook.com/tarehub"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $raw = curl_exec($ch); curl_close($ch); $data = json_decode($raw); echo $data-&gt;likes . " likes"; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Specify order of tables to copy using the Copy Data tool in Azure Data Factory to respect foreign keys<p>The <a href="https://docs.microsoft.com/en-us/azure/...
<p>Here is a simple pipeline that copies data from one database to another - it has a ForEach with 2 activities inside it. It copies each table and then runs a stored procedure after each table. The column names in the tables are the same. It has a variable called tableMapping that is a json array that defines the '...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ada - Is there a way to traverse through each character of an unbounded string?<p>I basically have a unbounded string called a for example. And a is currentl...
<p>See <code>Ada.Unbounded_Strings.Element</code> (<a href="http://www.ada-auth.org/standards/12rm/html/RM-A-4-5.html#p20" rel="nofollow">ARM A.4.5(20)</a> and <a href="http://www.ada-auth.org/standards/12rm/html/RM-A-4-5.html#p82" rel="nofollow">(82)</a>, and <a href="http://www.ada-auth.org/standards/12rm/html/RM-A-4...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Windows Forms chart and databinding<p>I'm trying to create a databinding for a chart on Windows Forms. This is my code:</p> <pre><code>ch.Series["Dep"].Poin...
<p>You don't need to call DataBind() at all. DataBindXY is what you want to do when you first bind it, and after you update the data source. For instance, this works:</p> <pre><code> public partial class Form1 : Form { List&lt;int&gt; exes = new List&lt;int&gt; { 1, 3, 7, 9 }; List&lt;int&gt; wh...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: 'str' object has no attribute 'decode'. Python 3 error?<p>Here is my code:</p> <pre><code>import imaplib from email.parser import HeaderParser conn = imapl...
<p>You are trying to decode an object that is <em>already decoded</em>. You have a <code>str</code>, there is no need to decode from UTF-8 anymore.</p> <p>Simply drop the <code>.decode('utf-8')</code> part:</p> <pre><code>header_data = data[1][0][1] </code></pre> <p>As for your <code>fetch()</code> call, you are exp...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Nested ng-repeat with no nested divs?<p>I have an object that looks like:</p> <pre><code>var obj = [ [{x:3,y:3},{x:6,y:1},{x:3,y:5}], [{x:1,y:3},{x:6,y:1},...
<p>Short answer: as it is, no you can´t do it without nesting your divs</p> <p>To do that you must modify your array, flattening it on your controller and then bind to the flattened array. Here is a working plunker: <a href="http://plnkr.co/edit/KPHurN2XBkvwMW22X3MP?p=preview" rel="nofollow">http://plnkr.co/edit/KPHur...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java on double: How to properly implement 'd' or 'D if there are many numbers or an expression to calculate?<p>It's said that we should put 'd' or 'D' after ...
<p>Just use dot with numbers or one of them Result = (6 % 4) / 10.0; Resoun: dividing int / int = int , otherwise int / double = double</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Showing data in view files while sending mails<p>Am trying to send mails to users upon registration, In view file i need to send the details submitted by use...
<p>You're missing the public <code>$user</code> property in your mailable class:</p> <pre><code>class WelcomeMail extends Mailable { use Queueable, SerializesModels; // ADD ME!!!! public $user; // ADD ME TOO!!!! public $password; /** * Create a new message instance. * * @retur...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Image not showing in TSpeedButton<p>I'm working with Embarcadero C++Builder. I'm using the <code>TSpeedButton</code> component with a <code>.bmp</code> image...
<p>I have find the solution of my issue. it was just a problem of compatibility mode applied by default by windows 10. I have just disabled the running of the application under compatibility mode Win XP SP2 and then no showing issue.</p> <p>Thanks for all your support.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How To Rebind to Server in GO<p>I am writing a Go Web App that displays data to a webpage. The database is in Microsoft SQL Server 2008. When running the pro...
<p>The issue was that I was trying to connect to the sql database on every page. The key is to connect only once and defer the close</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ant.design table is not updated<p>Trying to use this component <a href="https://ant.design/components/table/" rel="nofollow noreferrer">https://ant.design/co...
<p>You're mutating the <code>data</code>, which does not force your Table to re-render. Your example will work if you add <code>this.forceUpdate()</code> before and in the end of <code>setTimeout</code>. This is ugly fix, but it might help to understand the root case.</p> <p>Better solution is to extract actions into ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Charts.js Formatting Y Axis with both Currency and Thousands Separator<p>I'm using Charts.js to show a graph on my site. Currently, the label shows as a long...
<p>You should be able to include currency prefix in composition of label inside function...</p> <pre><code>var options = { animation: false, scaleLabel: function(label){return '$' + label.value.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");} }; </code></pre> <p><a href="http://jsfiddle.net/vy0yhd6m/80...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: change specific elemnt of ngFor where list is changes<p>i have this <code>HTML</code> for show list of users :</p> <pre><code> &lt;div *ngFor="let item...
<p>I have updated the code that should work for your scenario. Here I am mutating the actual data inside users array. Please check and let me know if it resolves your issue.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snipp...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PULP optimization solution undefined<p>I was trying to optimize the following problem using python pulp</p> <pre><code>import pulp # Instantiate our problem...
<p>When I implement the same code I get the result 'Infeasible'.</p> <p>This makes sense as your variables <code>W, X, Y, Z</code> all have to be integers, but you then bound them to be more than 0.1, and less than another number which is less than 1.</p> <p>There are no integers inbetween 0.1 and 0.XX, so there is n...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: While loop and boolean function<p>Hello guys I'm not an expert on the subject so please excuse my pour skills. I finished my program and it works fine (calcu...
<p>So here is few moments.</p> <p>Call </p> <pre><code>using namespace std; </code></pre> <p>just believe - is bad idea;</p> <p>In conditions like if() or while() use operator == instead of =. Because "=" - is assigne operator, and return value depended on success of operation. And "==" is compare operator.</p> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert a 3d model into an array of points<p>I'm building my own 3d engine, I need to import 3d models into it, but I don't know how to do it. I wonde...
<p>3d models come in file formats such as .obj, .stl, .fbx and many many more. These files, which represent the 3d model, are usually lists of vertices themselves (or other data about the model, such as normals or texture coordinates). You can find the formats of these files online and in your engine, read from the fil...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do i format a java.time.Duration mm:ss<p>I have a java.time.Duration and I want to output it in the form of mm:ss. It doesnt seem possible to use DateTim...
<p>You could create a <code>LocalTime</code> representing the duration from midnight (00:00) and use a <code>DateTimeFormatter</code>:</p> <pre><code>LocalTime t = LocalTime.MIDNIGHT.plus(duration); String s = DateTimeFormatter.ofPattern("m:ss").format(t); </code></pre> <p>Note that this will only work for durations ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Stata: estimating monthly weighted mean for portfolio<p>I have been struggling to write optimal code to estimate monthly, weighted mean for portfolio returns...
<p>This does appear to be a casebook example of how to do things as slowly as possible, except that naturally you are not doing that on purpose. All it lacks is a loop over observations to calculate totals. So, the good news is that you should indeed be able to speed this up. </p> <p>It seems to boil down to </p> <pr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Select top 2 rows different from each other<p>I have this table</p> <pre><code> | date | sum | |--------------|-------| | 2015-02-19 | 10000 |...
<p>You can try like this </p> <pre><code>select top 2 * from ( select distinct date FROM stock ) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Merge Sorted Linked Lists with head node and without new nodes (void function)<p>I am writing a void function <code>void merged_lists (cell * l1, cell * l2, ...
<p>This function declaration</p> <pre><code>void merged_lists (cell * l1, cell * l2, cell * l3); </code></pre> <p>is invalid because the pointers are passed by values. That is the function deals with copies of original pointers to head nodes of lists. As a result the original pointers will not be changed.</p> <p>Her...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parsing JSON rounds Negative Values<p>I am using NewtonSoft's JSON.NET assembly to load a .json file in a C# console application. I think I have done most of...
<p>Some code to Andrew's correct answer:</p> <pre><code>var settings = new JsonSerializerSettings(); settings.FloatParseHandling = FloatParseHandling.Decimal; string json = @"{ ""rings"" : [ -9221300.3411999997, 4120326.8838 ] }"; var rss = JsonConvert.DeserializeObject(json, settings); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Stop D3 parsing date strings<p>This appears to be D3's default behavior, since no specific configuration has been made.</p> <p>If it gets a <code>2019-10-26...
<p>I found where the type coercion was taking place: we were calling <code>csvParse</code> from <code>d3-dsv</code>, and were providing it with the default, optional <code>autoType</code>.</p> <p>The call was:</p> <pre><code>csvParse(__.filter(row =&gt; row[0] !== "#").join("\n"), autoType) </code></pre> <p>and is n...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Random background image with corresponding attribution link?<p>I have a page that displays a random background image from an array of 5 images. I want to als...
<pre><code>&lt;!doctype html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;&lt;/title&gt; &lt;meta name="viewport" content="width=device-width, initial-scale=1.0"&gt; &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt; &lt;!-- javascript/jQuery --&gt; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I am trying to divide a 19 digit number by 100 (19 digit number/100) in java<p>I am trying to divide a 19 digit number by 100, i.e. 19 digit number/100, in j...
<p><code>long</code>s are large integers, and when you divide one by another you use <a href="https://en.wikipedia.org/wiki/Division_(mathematics)#Of_integers" rel="nofollow noreferrer">integer division</a>, which omits everything right of the decimal point.</p> <p>You could use a <code>BigDecimal</code> instead:</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Default Durable Function errors out with Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'starter'<p>I just started to work with Azure functions, specifi...
<p>You missed changing the <code>OrchestrationClient</code> attribute to <code>DurableClient</code> as mentioned in the <a href="https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-versions#public-interface-changes-net-only" rel="nofollow noreferrer">migration doc</a> --- <code>Orchestratio...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cancel previous release azure pipeline yaml<p>When creating a release pipeline via the UI (Release) in Azure Devops you have the option cancel previous relea...
<blockquote> <p>Cancel previous release azure pipeline yaml</p> </blockquote> <p>For this issue ,I am afraid it is currently not supported in yaml. </p> <p>From this <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/process/stages?view=azure-devops&amp;tabs=yaml#specify-queuing-policies" rel="norefer...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: GetKey method returns null in dataSnapshot<p>I'm a beginner struggling to grasp Android Studio and I'm currently stuck on a problem. I'm trying to pull a rea...
<p>If you want to retrieve the <code>name</code>, then try the following:</p> <pre><code> ref = FirebaseDatabase.getInstance().getReference("Users").child(currentuser).child("Teams"); ref.addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Options for data-attributes react<p>I got an app that requires more API calls, so I have my first API call than gets me 20 Objects in which, every object has...
<p>The answer here might depend on how you want the UX to work in your App and how you want to design the data fetching. </p> <p>For example, clicking on a row could simply be link (or you could have code to manually fetch the data and update the URL), which updates the URL of your app to <code>/branded_food_data/:id_...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: New deployment gives nested exception is java.lang.NoClassDefFoundError: org/postgresql/core/types/PGLong<p>Every time I deploy my application on apache tomc...
<p>check your version of postgresql make sure it is 9.1-901.jdbc4 change the version in your pom.xml if you using maven else check the bit of your server along with the installed postgresql version</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: HTTPS POST Request in node.js with express.js<p>I'm having trouble making an https post request in node.js with express.js. I have generated my key.pem and s...
<p>For starters, I would think your <code>https</code> post should be made to port 443, not port 80.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Redirecting domains to another and append redirected domain as query string<p>I have the following in my htaccess file which forwards all domains pointing to...
<p>Sure that is possible: </p> <pre><code>RewriteEngine on RewriteCond %{HTTP_HOST} !^www\.somedomain\.uk$ RewriteRule ^ http://www.somedomain.uk%{REQUEST_URI}?url=%{HTTP_HOST} [R=301] </code></pre> <p>I would however suggest to use another parameter name, since a host name is <em>not</em> a "url". </p> <p>It is a g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Show views based on authentication status in asp.net mvc<p>If user is logged in I want to show my department view, if not logged in want to show login page. ...
<p>Your <code>HttpContext.Current.User==null</code> logic would go in the controller, not your route registration</p> <p>Note- the correct call is <code>Request.IsAuthenticated</code></p> <p>Assuming you have an action method like this:</p> <pre><code>public ViewResult Index() { if(Request.IsAuthenticated) ret...