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: Disable clang warnings across functions<p>In clang we can ignore warnings as described <a href="http://clang.llvm.org/docs/UsersManual.html#controlling-diagn...
<p>The warning is emitted for the comparison using <code>==</code>, not for the call. If you have two functions that both call <code>compare&lt;float&gt;</code>, and you would somehow manage to suppress the warning for the first call, there wouldn't be anything left to warn for in the second call: <code>compare&lt;floa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: When building Go programs for release is it standard practice to just use 'go build'?<p>When building Go programs for release is it standard practise to just...
<p>According to <a href="http://dave.cheney.net/about" rel="nofollow">Dave Cheney</a> the answer is yes, just use <code>go build</code>.</p> <p>Source: <a href="http://www.reddit.com/r/golang/comments/2woogl/when_building_go_programs_for_release_is_it/" rel="nofollow">http://www.reddit.com/r/golang/comments/2woogl/whe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: My redirect from http to https in Nginx not working<pre><code>server { listen 80; server_name www.21cl.ca 21cl.ca; return 301 https://21cl.c...
<p>I think it has been cached in the browser try it in private or incognito window, It is redirecting properly for me </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I get Oracle.DataAccess.Client?<p>I am getting this error where Visual Studio 2019 is unable to find </p> <pre><code> Imports Oracle.DataAccess.Clien...
<p>As the aim is to modernize the software, using the most up-to-date Oracle library would be best, which would currently be <code>Oracle.ManagedDataAccess</code>.</p> <p>It is available as a Nuget package (in Visual Studio, "Tools" menu -> "NuGet Package Manager" -> "Manage NuGet Packages for Solution..." -> choose t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Uninstall teradata ulitilies issue<p>I am trying to install teradata utilities 15.x, </p> <p>I earlier installed teradata ODBC drive and .NET Data Provider ...
<p>The Teradata ODBC driver typically requires three components to be installed on the client:</p> <ol> <li>ICU Libraries </li> <li>GSS Libraries</li> <li>ODBC Driver</li> </ol> <p>You must ensure that all three of these have been removed before you can replace them with another version. Typically, they can be found ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Best authentication method for Node.JS RESTful API<p>I'm suppose to build a web application and a mobile application (for iOS) that share the same database. ...
<p>Use OAuth 2.0 so you have an extensible standard and token-based authentication which enables users to revoke authentication tickets, e.g. if their phone was stolen.</p> <p>OAuth 2.0 supports various grant types. Those that you from facebook and twitter logins can be summarized as '3-legged oauth', but there's also ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using a session variable in a php mysql query with like<p>I've been trying to create a search for my website and when I try using the variable as in </p> <p...
<p>When "<code>global $size;</code>" is used inside a function, it imports <code>$size</code> variable from global scope, which perhaps is <code>NULL</code> and overwrites local <code>$size</code> variable. Have you checked the <code>$size</code> value after <code>global</code> statement?</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to open unique, per-user instance of firefox in linux through command line?<p>In my team, multiple people use same account on linux based server. If one ...
<p>From mozilla <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Command_Line_Options" rel="nofollow noreferrer">website</a> I found command line to open new instance, not a new window in running instance, which allows multiple copies of application to be open at a time. It is </p> <p><code>firefox -new-insta...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ubuntu cronjob without saving output<p>I want to call a php script on my VPS with cronjob, but I want it to do simple get request, without saving any logs, o...
<p>Try <code>wget -q -O - http://example.com/cronjob/save_currency_rates &gt;/dev/null 2&gt;&amp;1</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to transition data in a JSONB column in to separate columns for millions of rows in Rails/Postgres?<p>I've got a JSONB column in Postgres and I need to s...
<p>I would do this with SQL directly instead of creating everything in Ruby. This won't run validations or callbacks that your Ruby models would have in place, so will be a bit more dangerous, but it would be much faster.</p> <p>The SQL syntax would look something like:</p> <pre class="lang-sql prettyprint-override">...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting OAuth2 token from ansible tower with python?<p>I am trying to get/create an OAuth2 access token with this python script:</p> <pre><code>import reque...
<p>As per the official documentation. You can create a OAuth 2 token using the below curl command.</p> <pre><code>curl -u user:password -k -X POST https://&lt;tower-host&gt;/api/v2/tokens/ </code></pre> <p>which can be translated to Python using request package by </p> <pre class="lang-py prettyprint-override"><code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trouble getting at values in JSON with json.net in c#<p>I am trying to use an <code>RESTFUL API</code> for an application we use internally. One call to the ...
<p>You can use <a href="https://www.newtonsoft.com/json/help/html/LINQtoJSON.htm" rel="nofollow noreferrer"><code>Json.Linq</code></a> for that and parse a response into <a href="https://www.newtonsoft.com/json/help/html/T_Newtonsoft_Json_Linq_JObject.htm" rel="nofollow noreferrer"><code>JObject</code></a>, then iterat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to detect click on ImageView in ViewPager's PagerAdapter (android)?<p><strong>What is happening:</strong> </p> <ol> <li>i am trying to detect a onclick ...
<p>I have been able to do it this way: override the <code>onViewCreated()</code> method of the <code>Fragment</code>s held by your <code>ViewPager</code> as:</p> <pre><code>@Override public void onViewCreated(View view, Bundle savedInstanceState){ view.setOnClickListener(new OnClickListener(){ public void...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: p-values for Linear Discriminant and Quadratic Discriminant analyses (LDA, QDA)<p>I've been searching for a long time for a method to pull the p-value for LD...
<p>Summary shows how statistically significant the model coefficients are. Actually, LDA and QDA don't estimate any coefficients as logictic regression does. Therefore, it's impossible to measure the coefficients performance of LDA and QDA.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reverse order of words in a string<p>I am working a problem to reverse the order of words in a string. For example, if you have str1 = "the sky is blue" then...
<p>this compiles fine, so yes the ++iter is a valid statement. Incrementing is valid, jumping is not:</p> <pre><code>list&lt;string&gt; words; void createList(string s) { istringstream iss(s); string token; while(getline(iss, token, ' ')) { words.push_back(token); } } string reverseWords...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TypeError Involving Addition<h1>One-Time Pad (Polyalphabetic Sustitution Cipher)</h1> <pre><code>import pyperclip, os.path LETTERS = r""" !"#$%&amp;'()*+,-...
<p>Your problem is that <code>key[keyIndex]</code> is not a string. The <code>string.find</code> method only accepts a string.</p> <p>This program works just fine AS IS in python 2.7, but in python 3.2 this is what is causing the issue.</p> <h1>Solution A</h1> <p>Wrap <code>key[keyIndex]</code> in a <code>str()</cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Are CSS shaders applicable to 2d canvas?<p>We have "fragment" shaders in the form of CSS shaders, are these applicable/available to 2d canvas/contexts also?<...
<p>Only to the canvas <em>element</em> itself, so whatever is drawn to canvas will be affected visually.</p> <p>You cannot use them to process directly what you draw using the context - context is isolated to only work on the bitmap itself while CSS is limited to work on the element(s) (you could always emulate what t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: receiving error when using if statements with a constant variable - C<p>I have <code>#define MAX_PERSONS = 20;</code> after my headers. I'm trying to do an i...
<p>Replace</p> <pre><code>#define MAX_PERSONS = 20; </code></pre> <p>with</p> <pre><code>#define MAX_PERSONS 20 </code></pre> <p><code>#define</code> is a pr-processor directive which replaces <code>MAX_PERSONS</code> with the followed text before compilation. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ignore the case in part of the search pattern in Vim<p>In the next search on <em>Vim</em> I would like to ignore the case of the first letter:</p> <pre><code...
<p>In general, this isn't possible in Vim. The <a href="https://vimhelp.appspot.com/pattern.txt.html#%2F%5Cc" rel="nofollow noreferrer"><code>/\c</code></a> and <a href="https://vimhelp.appspot.com/pattern.txt.html#%2F%5CC" rel="nofollow noreferrer"><code>/\C</code></a> regexp modifiers unfortunately turn the whole pat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Preserve a value across component redraw<p>I have a component something like this </p> <pre><code>Ember.Component.extends({ text : null, }); </code></pr...
<p>To preserve the value used in component, you can define value at controller level and pass it to component while using it. This way you can retain the value and reuse it in component.</p> <p>component/message.js</p> <pre><code>Ember.Component.extends({ text : Ember.computed.alias('messageText'), }); </code></p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to create XML file from list with another lists and dicts automatically?<p>I have some list with another lists and dicts, for ex.</p> <pre cl...
<p>Sure, but since there's no single way to map things to attributes vs. subelements, you'd have to figure that out yourself... or just make everything elements and hope for the best, like below.</p> <p>I added an affordance for setting the XML tag of a dict with <code>_tag</code>.</p> <pre class="lang-py prettyprint...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Firebase with Google Business for receiving email<p>On my personal non-business account I have created a Firebase project and set up the hosting which ...
<p>I can answer this from the Firebase side at least -- Firebase Hosting is not aware of anything related to Google Business and will continue to work so long as your DNS A records are pointed at the correct IP addresses and your domain does not have CAA records preventing certificates from being created.</p> <p>If ad...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: tick interval is not working while applying tick interval its showing x and y both values<p>i want to show each day date , but im getting alternative dates ,...
<p>You need to set <code>tickInterval</code> to one day and use the <code>formatter</code> function:</p> <pre><code>xAxis: { ..., tickInterval: 1000 * 60 * 60 * 24, labels: { formatter: function(){ return Highcharts.dateFormat('%e-%b-%Y', this.value); } } } </code></pre> <hr> <p><strong>Live de...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I find task ids for Celery task events based on the arguments passed to them?<p>I'm stuck with something I imagine to be simple. <strong>I am trying t...
<p>I dug through the <code>django_celery_results</code> module and found that it provides a TaskResult model that provides a native Django ORM interface to the result model. Thus you can search the result with <code>TaskResult.objects.filter</code></p> <p>As a side note, though the Celery docs cover <a href="http://do...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Embedded Tomcat JNDI Map with Spring Boot<p>we are using Glassfish, where we set JNDI resource of type Map, we define some Bean factory and after that we are...
<p>The first thing to do is to create an <code>ObjectFactory</code> implementation that can return a <code>Map</code>:</p> <pre><code>public class MapObjectFactory implements ObjectFactory { @Override public Object getObjectInstance(Object obj, Name name, javax.naming.Context nameCtx, Hashtable&lt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to delete all keys from redis cluster<p>I want to delete all keys from redis cluster by using fast process. I know how to delete the keys by using "redis...
<p>You see the keys after restart because there is either RDB or AOF persistence enabled. See <a href="https://redis.io/topics/persistence" rel="nofollow noreferrer">https://redis.io/topics/persistence</a>.</p> <p>RDB is enabled by default. To disable persistence, you need to edit your redis.conf or start as <code>red...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: rearranging ggplot axis groups in plot<p>I am trying to rearrange my plot such that it follows the correct confusion matrix structure from the <code>caret</c...
<p>I tried and came up with this minor changes:</p> <pre><code> library(tidyverse) d %&gt;% ggplot(aes(x = status, y = fct_rev(pred_status), color = correct)) + geom_jitter() + geom_text(aes(label = n), size = 15, color = "black", family = "serif") + facet_wrap(~Model_Name) + ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the structure of the public key of a signed assembly in C#?<p>Using this code to retrieve the public key bytes...</p> <pre><code>var pubKey = A...
<p>I couldn't stop biting my nails trying to work backwards from CALG_RSA_SIGN = 0x00002400, and stumbled upon RSAPUBKEY, then PUBLICKEYSTRUC and finally PublicKeyBlob. Well now I can parse it formally. Wonder if there is any struct already in the .NET framework for handling this?</p> <p><a href="https://msdn.microsof...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to pbpaste in .bash_profile alias?<p>I try to make a small alias script to automatically reset my OS X Fuse connection.</p> <p>If I run this command in ...
<p>You need to wrap the alias in single-quotes, rather than double-quotes. The relevant difference is that bash expands <code>$something</code> (including <code>$(command)</code>) inside double-quotes <em>before</em> executing the command. The way you have it at the moment, <code>pbpaste</code> is executed <em>when .ba...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: def show_batch( ) not showing my train images<p>I am preprocessing data in TensorFlow following the instruction on their website: <a href="https://www.tensor...
<p><code>return plt.show</code> was inside the for loop. It needs to be outside like this:</p> <pre><code>def show_batch(image_batch, label_batch): plt.figure(figsize=(10,10)) for n in range(25): ax = plt.subplot(5,5,n+1) plt.imshow(image_batch[n]) plt.title(CLASS_NAMES[label_batch[n]==...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add new value in the value already available in sql row<p>I want the code to work so that when users earn an amount it should be added to the <code>Pa...
<p>I'll assume MySQL / MariaDB - Add a <code>ON DUPLICATE KEY</code> update (provided your address is a primary key)</p> <pre><code>$address = trim($_POST["address"]); $claimlog_reward = $reward; if ($reward&lt;1) { $claimlog_reward = number_format($reward, 8, '.', ''); } $q = $sql-&gt;prepare("INSERT INTO ".$dbtab...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to copy a div from a website to another?<p>is it possible to copy a div from a site to another? Managing many websites I need to copy some sta...
<p>I was surfing around looking for an answer and found this code. If you can't use an Iframe.</p> <p>As an alternative, you could just use a simple and use the jQuery "load" function to load the whole page and pluck out just the section you want:</p> <pre><code>$('#target-div').load('http://www.mywebsite.com/portf...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Template deduction syntactical differences<p>I wrote a basic program for binary trees as follows</p> <pre><code>#include &lt;iostream&gt; #include &lt;memor...
<p>With <a href="https://en.cppreference.com/w/cpp/language/injected-class-name" rel="nofollow noreferrer">injected-class-name</a>, in the scope of the class <code>Node&lt;T&gt;</code>, <code>Node</code> also refers to <code>Node&lt;T&gt;</code>.</p> <p>So, in</p> <pre><code>left = std::make_unique&lt;Node&gt;(val); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the simplest way of finding the distance between two pixels?<p>This is maybe a bit of a noobish question - but say I want to find the distance betwee...
<p><a href="http://www.mathworks.com/help/stats/pdist.html" rel="nofollow"><code>pdist</code></a> is an OK answer, but I would argue that it's slow (at least for a larger amount of points). Also, <code>pdist</code> requires the statistics toolbox, so if you don't have that toolbox, you can't use that answer.</p> <p>I...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: If column A is null then use column B. If column B is null then use column C<p>I am using MS Access.</p> <p>I want to create an IIF expression where if Colu...
<p>You can use a <a href="https://support.office.microsoft.com/en-us/article/Switch-Function-d750c10d-0c8e-444c-9e63-f47504f9e379" rel="nofollow">Switch Function</a> to express the logic you want. </p> <p>This is the output from the query below. The first 5 columns are contained in <em>DataTable</em>, and the final ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Excel: conditional formatting, check if column contains text from other sheet<p>First sheet:</p> <pre><code>First name Last name Role Valeria Bia...
<p>This will do the trick. You will have to fix the cell references to match your sheet.</p> <p>Also make sure you have the order of the rules correctly and stop processing more rules if there is a match.</p> <p>The concatenate adds first and lastname columns in first sheet Sheet2!$a$1:$a$6 is the range for the names...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rascal: Can a Function return a Function<p>The Rascal documentation has an <a href="http://tutor.rascal-mpl.org/Rascal/Concepts/Functions/Functions.html" rel...
<p>Here is an example:</p> <pre><code>int two(int n) = 2 * n; int(int) g() = two; </code></pre> <p>Function <code>two</code> multiplies by 2 and <code>g</code> returns the function <code>two</code>. Observe that the return type of <code>g</code> is <code>int(int)</code>, a type describing a function which returns an ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What "sql:"-"" represents in Go lang GORM?<p>In this <a href="https://medium.com/@adigunhammedolalekan/build-and-deploy-a-secure-rest-api-with-go-postgresql-...
<p>In the old version of GORM, <code>sql:"-"</code> means ignore that field. The new version of GORM uses <code>gorm:"-"</code> instead. <a href="http://jinzhu.me/gorm/models.html#model-definition" rel="nofollow noreferrer">here</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MediaRecorder start error codes<p>I want to record raw h.264 video without sound and possibly HW accelerated (and stream it later). So I decided to use <code...
<p>Alright, I think I have an answer for you. The start function that is failing is defined in a file called <code>mediarecorder.cpp</code>. Found here:</p> <pre><code>frameworks/av/media/libmedia/mediarecorder.cpp </code></pre> <p>This start function returns a variable of type <code>status_t</code>, and corresponds ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I borrow an Iterator?<p>I have a piece of code that I'm using that I found <a href="https://stackoverflow.com/questions/24542115/how-to-index-a-string...
<p>You don't need to clone the underlying data (<code>bytes</code>), but you do need to clone the iterator:</p> <pre><code>fn is_palindromic(num: i64) -&gt; bool { let string = num.to_string(); let bytes = string.as_bytes(); let iter = bytes.iter(); let n = bytes.len() / 2; equals(iter.clone().take...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I install pandas for Python 3.4 in Windows?<p>According to <a href="http://pandas.pydata.org/pandas-docs/dev/install.html" rel="nofollow noreferrer">t...
<p>This works for 64-bit machines:</p> <ol> <li>Download &amp; install 64-bit Python: <a href="https://www.python.org/downloads/release/python-342/" rel="nofollow">https://www.python.org/downloads/release/python-342/</a></li> <li>Download the 64-bit version of numpy from here: <a href="http://www.lfd.uci.edu/~gohlke/p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: c++ private static member variables compared to free nonmember<p><br> I'm relative new to C++ and have a question regarding <strong>private</strong> static m...
<p>Design decisions in this space need to balance a few things, which are good to understand so you can weigh the pros and cons each time such a choice is needed:</p> <ul> <li><p>Anonymous namespaces or static non-members allow <em>all</em> later code in the <em>translation unit</em> full access.</p> <ul> <li><p>Used...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: EXC_BAD_INSTRUCTION happens when using dispatch_get_global_queue on ios 7(swift)<pre><code> let downloadGroup = dispatch_group_create() var images = [...
<p>found out the reason seconds after i posted. it seems not me being stupid, but apple's document</p> <pre><code>QOS_CLASS_USER_INTERACTIVE, QOS_CLASS_USER_INITIATED, QOS_CLASS_UTILITY, or QOS_CLASS_BACKGROUND </code></pre> <p>can not be used on ios7, though <a href="https://developer.apple.com/library/ios/documenta...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The INSERT statement conflicted with the FOREIGN KEY SAME TABLE constraint | ASP.NET Core & Entity Framework Core Code First<p>I have a table named <strong>C...
<p>You wanna add <code>00000000-0000-0000-0000-000000000000</code> as a <code>CompanyId</code>, so you faced with this error occurs because in your table there is no company with this <code>Id</code>. </p> <p>In your scenario there is a possibility of having a company with <strong>no</strong> parent, so your table des...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to know when a method finish in controller<p>I have a problem with this method, i want to return a PDF file and when the method it's over i want to delet...
<p>You can use <code>System.IO.File.ReadAllBytes</code> to read all the file contents to memory, then delete the file and return the contents with another overload of Controller.File method:</p> <pre><code> public ActionResult GetFile() { var fileName = Path.GetTempFileName(); System.IO.File.Wri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why class data members can't be initialized by direct initialization syntax?<p>I am curious to know that why class' data members can't be initialized using (...
<p><a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm">Early proposals leading to the feature's introduction</a> explain that <a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm#konaissue">this is to avoid parsing problems</a>.</p> <p>Here's just one of the examples prese...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The user of Exists in SQL<p>I have searched an while their are multiple entries for my issue they do not assist me in pinpointing my syntax issue.</p> <p>th...
<p>Remove <code>*</code> and keep the <code>column name</code> that you want to assign to <code>@CID</code></p> <p>Also there is no use in keeping <code>top 1</code> inside <code>exists</code> </p> <pre><code>set @CID = ( select top 1 CID --here remove * and keep column name from contact where exists (select mar --...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What exactly is coef_ from sklearn LinearRegression? and how to interpret a formula from it<p>When I use LinearRegression in sklearn, I would do</p> <pre><c...
<p>Thanks to <a href="https://www.youtube.com/watch?v=Hwj_9wMXDVo" rel="nofollow noreferrer">https://www.youtube.com/watch?v=Hwj_9wMXDVo</a> I've gotten insight and found out how to interpret formula for polynomial regression. </p> <p>So <code>poly_reg_2.coef_ = array([[0.93189329, 0.43283304]])</code> </p> <p>you kn...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Need help on a sine curve equation where crest increases in each iteration but trough stays the same<p>As stated in Title, I need help with an equation of a ...
<p>Are you searching for something like this:</p> <pre><code>-1 + x + x Sin[x] </code></pre> <p><a href="http://www.wolframalpha.com/input/?i=Plot%5B-1%20%2B%20x%20%2B%20x%20Sin%5Bx%5D%2C%20%7Bx%2C%200%2C50%7D%5D" rel="nofollow" title="Wolfram-Alpha-Plot">Wolfram-Alpha Plot</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: unable to backup elastic search data?<p>Hi I am having an elastic search (version 6.6.0) running on a machine . It has some indexes .</p> <pre><code>curl -X...
<p>Try to use <a href="https://www.npmjs.com/package/elasticdump" rel="nofollow noreferrer">elasticdump</a> to transfer data from one elastic to another.</p> <p>You can also output your data into a <code>.json</code> file.</p> <p>A working example:</p> <p>Export your indices (data) from a remote elastic server to a ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the actual class and the prediction class for all data in R?<p>I create the model and do the predicition with this script in R,</p> <pre><code>mo...
<p>You can use <code>pred = predict(model, dataset1[1:100, 7])</code> to get the predicted classes followed by <code>cbind.data.frame(dataset1[1:100, 7], pred)</code> to get actual class and the prediction class side by side. You can also use <code>plot(model)</code> to get a beautiful decision tree. </p> <p>The opera...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Database connection in my webhost home directory<p>I am having an issue related to <code>cron job</code> and accessing database connection in my home directo...
<p>You need to specify the location of the file, like this:</p> <pre><code>&lt;?php include_once('/home/mails/cronjobs/connection_database.php'); ... //the file is not in public_html it is in user/home/mails/cronjobs ?&gt; </code></pre> <p>Make sure you have access to that directory as some hosting providers...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to remove top space from UILabel paragraph?<p>I'm trying to make a description text like this, but it's not quite pretty. I want the content strings to b...
<p>Just set the <code>UILabel</code>'s bottom constraint relation <code>to greater than or equal</code> with <code>constant</code> of 0.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Permutations for all possible sets ( 3 digits) including zero<p>I am creating a small game program in which there are two types of games. <code>Single</code>...
<p>You can do a <a href="https://www.php.net/manual/en/function.preg-match.php" rel="nofollow noreferrer"><code>preg_match</code></a> on numbers by creating regular expression such as:</p> <pre><code>/^[235046]+$/ </code></pre> <p>This means we are trying to match a string which has digits <code>235046</code>(meaning...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: gstreamer on Android: exception when unrefing pipeline?<p>I have a very strange problem in my App. The plan is to use gstreamer to play a videostream and dis...
<p>My pipeline used queues (with leaky=downstream) in the wrong places which somehow prevented the pipeline from entering PAUSED state (some elements where still in READY). Freeing the pipeline probably caused an illegal pointer access (maybe on the message bus listener) which caused said exception. </p> <p>Visualizin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to check how many times a word appears in a txt file in php?<p>How can you check how many times a word occurs in a txt/log file?</p> <p>For example:</p>...
<p>It can be done much easier:</p> <pre><code>$filename = "C:\Users\Elsa\Desktop\TMA\may.log"; $searchFor = "articles"; $fileContent = file_get_contents($filename); $count = substr_count($fileContent, $searchFor); echo "'$filename' contains '$searchFor' $count times"; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Selenium auto closing window<p>I tried to write selenium bot with ruby, but it just close chrome window after loading page. What can i do? Please help</p> <...
<p>If you're running just the code above with nothing else after, what you're experiencing makes a lot of sense. It's exiting after it navigates to Google.</p> <p>Add this to the end, and the window should stay open</p> <pre><code>$stdin.gets </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to upload a Firefox OS app on Android<p>I'm developing an app for Firefox OS and I would like to test it on my Android phone. Is it possible? I only foun...
<p>The <a href="https://hacks.mozilla.org/2014/06/testing-your-native-android-app/" rel="nofollow">Testing Your Native Android App</a> blog post describes using the <a href="https://www.npmjs.com/package/mozilla-apk-cli" rel="nofollow">mozilla-apk-cli</a> to do this.</p> <p>(Eventually that documentation should migrat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why do popular Java Base64 encoding libraries use OutputStreams for Encoding and InputStreams for encoding?<p>I have been trying to solve a memory issue in a...
<p>Well, yes, you can reverse it, but this makes the most sense. Base64 is used to make <em>binary data</em> - generated or operated on by the application - compatible with a text based outside environment. <em>So the base 64 encoded data is always required on the outside and the decoded binary data is required on the ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Moving 'people' into time slots based on answer,<p>I'm trying to create an internal database on Excel 2013 for managing people, sort of HR based.</p> <p>For...
<p>Basically you can do something like this. I assumed you have 2 sheets as following:</p> <p>Sheet "Applicants": <img src="https://i.stack.imgur.com/UoQgM.jpg" alt="enter image description here"></p> <p>Sheet "Time Slot": <img src="https://i.stack.imgur.com/JmmUJ.jpg" alt="enter image description here"></p> <pre><c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TFS API Slowness<p>I am writing an extension for Visual Studio 2013/Team Foundation Server 2012.</p> <p>I have a user control with a treeview and a listview...
<p>Thanks to Ahmed ilyas for getting me to think about this in a different way.</p> <p>After pulling the itemSet I am now getting all changesets for the selected folder in one query and storing them in a local variable. I can then pull the appropriate changeset locally. Even a folder with over 600 files now takes on...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: sum unique data from multiple array<p>I have two arrays from a different database, now I have to print it's in a table as a combined report. those arrays are...
<p>It can be done but probably just easier to combine them via the database query in the first place.</p> <pre><code>// Your arrays of data $data = [$array1, $array2]; // The fields you want to sum $sumFields = ['order_qty', 'balance_qty', 'stock_qty', 'order_req']; // The final array $combined = []; foreach ($data...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas - very slow when using groupby() with rolling() and apply()<p>I am having a very slow performance when calling groupby together with rolling and apply...
<p>If I understand you correctly, you can try:</p> <pre class="lang-py prettyprint-override"><code>grp=df.groupby('i2')['x'] df['rolling']=grp.shift(2).mul(0.1).add(grp.shift(1).mul(0.9)) </code></pre> <p><strong>Now to elaborate:</strong></p> <p>Why not <code>.apply(...)</code>:</p> <p><a href="https://stackoverfl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spring Boot v2.2.2.RELEASE throw error when Pagination Size more than anticipated<p>I'm using <strong><em>Spring Boot (v2.2.2.RELEASE) + Spring Data Mongo + ...
<p>I was able to solve this issue with the below code and this works very fine.</p> <pre><code>@Configuration public class WebConfig implements WebMvcConfigurer { ... .... @Override public void addArgumentResolvers(List&lt;HandlerMethodArgumentResolver&gt; resolvers) { PageableHandlerMethodArg...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does the units of Range.ColumnWidth not match either points or Centimeters (default unit used)<p>I am producing a VBA subroutine in an Access database wh...
<p>The .ColumnWidth property refers to the number of zeros you can type in a cell in the default font without exceeding the cell's width.</p> <p>In a new workbook where presumably your default column width is 8.43, type <code>'000000000</code> in a cell and you'll see that the 9th zero overflows the right cell border ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python: WindowsError: exception: access violation reading 0x00000000<p>This short function is simply getting the available free space of a storage device, ho...
<p>You are not calling the full function signature which I believe is leading to access violations (due to random memory writes) and errors. The full function signature is (fully documented <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa364937(v=vs.85).aspx" rel="nofollow">here</a>):</p> <pre><cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Probability of a number occurring given restrictions<p>I am limited to only using </p> <pre><code>SUM RAND RANDBETWEEN COUNT COUNTIF ROUNDDOWN </code></pre>...
<p>You can use the <code>RANDBETWEEN(1,100)</code> function to simulate the probability. If there is a <code>x%</code> probability, you check if the generated numeber is &lt;= to x, if it is you print 1, else 0.</p> <p><code>=IF(RANDBETWEEN(0,100)&lt;=40,0,1)</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to capture jquery datepicker input in php validation script?<p>I have a demo here: <a href="http://hane-content.com/datepick/" rel="nofollow">http://han...
<p>You have spelled if <code>dateoa</code> wrong... Your code</p> <pre><code>(empty($_POST['datoa'])) </code></pre> <p>Should be:</p> <pre><code>(empty($_POST['dateoa'])) </code></pre> <p>(Or change the inputs name in the HTML-form).</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sending JSON data in API via Ajax error and JSON data traversing problem<pre><code>var data = { "ApplicationName": "Zadmin", "KanMainGroupLis...
<blockquote> <p>What is wrong with my API call</p> </blockquote> <p>As you've already found, that's because the server expects a payload of <code>application/json</code>. You need include such a header in your request.</p> <blockquote> <p>How does one actually gets to know what to set the content type/ data manipulatio...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spark MLLIB TFIDF Text Clustering Python<p>I am new to Spark and trying to cluster news articles as clusters using Spark API in Python. News articles have be...
<p>The function <code>wholeTextFiles</code> returns an RDD of <code>(filename, string)</code> pairs. So you first would need to do something like <code>split_data=txtdata.map(lambda (k, v): v.split(" "))</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Count word occurrence for all the files in a folder using Powershell<p>I have a lot of text files like this</p> <pre><code>D1|This is text H1|This is line ...
<p>It turns out I missed the left parenthesis for the command</p> <pre><code> (Get-ChildItem -Filter "*.manifest" -Recurse | Select-String -pattern "D1" -AllMatches).matches.count </code></pre> <p>Works fine for me.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NullPointerException for OnClickListener android Java<p>I feel bad for asking about this but for 2 hours now I can't find any way to solve this: **The Proble...
<p>You can pass a reference to your button from main activity to AnimatedView class.</p> <pre><code>package com.example.julle.bounce; import ... public class MainActivity extends ActionBarActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: draw Broken line graph using dynamic data display?<p>Can i draw Broken line graph using dynamic data display ? </p> <p>In my application i need to draw a re...
<p>What you need is a class emmiting new ObservableDataSources (or adapters that you can stop emmiting new points) whenever the last datapoint has Y of >0. Whenever the Voltage is 0 you need to make the UI stop listening to that datasource. You emmit an event and Add another Linegraph to the chart when the Voltage is >...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how can work with regExp in jQuery from getting class name<p>I want to get classname from click, and use RegExp to get text from class like <code>sort_alpha<...
<p>You can try something like this:</p> <pre><code>$('#displayData').on('click', '.tb_data thead th', function(){ var className = $(this).attr('class').match(new RegExp(/sort_[\w]+/g)); var str = className[0].replace(/^sort_/g,""); alert(str); }); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Problem: Page is crashing and consuming a lot of memory after that (Blazor + EF 3.1.1)<p>I recently started to work with Blazor and Entity Framework and ran ...
<p>Looks like the solution was really simple, I didn't check for null for 'Project' property of 'Environment' object. After I added this check to the page problem is gone.</p> <p>I'm still not sure why the page was consuming a lot of memory after it had encountered the 'Object reference not set to an instance of an ob...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to remove AST nodes with pycparser?<p>Let's start by considering this snippet:</p> <pre><code>import sys from pycparser import c_parser, c_ast, c_gener...
<p>It looks like <code>c_generator.CGenerator</code> calls <a href="https://github.com/eliben/pycparser/blob/master/pycparser/c_generator.py#L334" rel="nofollow noreferrer"><code>_generate_stmt</code> method</a> for scope-like structures <a href="https://github.com/eliben/pycparser/blob/master/pycparser/c_generator.py#...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: EF Code First Data Annotations and Inheritance<p>I am using code generation to create sets of entities and I want to be able to set them up like so:</p> <pr...
<p>I just went with using partial classes since it seems inherited classes have issues.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create Activity logs diagnostic setting for Azure resources using ARM template<p>We are referring this documentation <a href="https://docs.microsoft.c...
<p>The documentation <a href="https://docs.microsoft.com/en-in/azure/azure-monitor/platform/diagnostic-settings-template#deployment-methods" rel="nofollow noreferrer">here</a> which you are referring for Creating diagnostic settings.</p> <p>So If you will check the <a href="https://docs.microsoft.com/en-in/azure/azure...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AttributeError: 'org.modelio.metamodel.impl.uml.behavior.activityMo' object has no attribute 'getOwnedNode'<p>I'm using a script to find all paths in an <cod...
<p>In fact, elt is the selected Element. This script works if you launch it from an Activity Element and not a Activity Diagram.</p> <p>Best,</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Drawing FFT discrete signal using continuous sine-waves ?!<p>I do np.fft.fft() to decompose discrete-signal to frequencies. Then I pick top N freqs and now I...
<p>I found my mistakes.. first the correct way to calculate the waves is (sum of those for topN freqs) :</p> <pre><code>cos_amp * np.cos( 2 * np.pi * freq * time) + sin_amp * np.sin( 2 * np.pi * freq * time) </code></pre> <p>not just sin()..second it is incorrect to use abs-amplitude and angle-phase extraction from t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rotating multiple texts in canvas<p>I am trying to create graph in a HTML5 canvas. But text in the x axis is overlapping. I am trying to rotate it so it look...
<p><img src="https://i.stack.imgur.com/IMKHl.png" alt="enter image description here"></p> <p><strong>You could angle your text so it always fits the graph like this:</strong></p> <ol> <li>Save the starting context state (untransformed)</li> <li>Set the desired font</li> <li>Measure the pixel width of the text</li> <l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: No Backend Icons FLUID Powered TYPO3 - wrong path?<p>after my first steps with FLUID POWERED TYPO3.</p> <p>The latest versions <code>flux 7.1.2</code>, <cod...
<p>While in the backend, Flux creates a relative path to your Icon. To be precise, it creates a relative path to <code>PATH_site</code> constant. This means in your iframe, the path is plain wrong. This is a common issue with backend images. There's a few ways to solve this:</p> <ol> <li><p>Create a custom, absolute u...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hide ActionBar title just for one activity<p>If I apply theme for whole application it hides ActionBar title successfully:</p> <pre><code>&lt;?xml version="...
<p>Set the theme on your activity in the manifest.</p> <pre><code>&lt;activity android:name=".MyActivity" android:theme="@style/MainActivityTheme" /&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python wave: Extracting stereo channels separately from *.wav-file<p>I have a 32 bit *.wav-file 44100Hz sampling. I use use wave and python struct.unpack to ...
<p>Left and right channel in stereo files are interleaved. You can find lots of information about this online, e.g. look at the figures <a href="http://techpubs.sgi.com/library/tpl/cgi-bin/getdoc.cgi?coll=0650&amp;db=bks&amp;srch=&amp;fname=/SGI_Developer/MLSDK_PG/sgi_html/ch08.html" rel="nofollow">here</a>.</p> <p>So...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using PHP function in_array with array from foreach loop<p>I am writing some values into an array from a comma separated text file like this...</p> <pre><co...
<p>I suppose you forgot about spaces or \n \r symbols. Try to use <code>var_dump()</code> instead of <code>print_r</code> to see the difference in strings. And don't forget to use <code>trim()</code> function to remove extra symbols on both ends of a string.</p> <pre><code>$tokenFile = "tokens.txt"; $tokenSet = file_...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to automatically rotate Azure Search keys?<p>We're wanting to automatically rotate our Azure Search Admin and Query keys with our Key Vault on a regular ...
<p>The key rotation process relies on the fact that the services have both a primary and a secondary key. Both keys are valid for any requests, and they can be changed independently of each other. We’ll deploy our azure search, which will include referencing that key and making sure our application uses it. Then we’ll ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set HubSection Header Style<p>I want to change Font Family, Font Size and Foreground color for HubSection Header.</p> <p>Something like this:</p> <p...
<p>The property you want to change isn't <code>Header</code> but <code>HeaderTemplate</code>. Here's my working example:</p> <pre><code>&lt;Style TargetType="HubSection"&gt; &lt;Setter Property="HeaderTemplate"&gt; &lt;Setter.Value&gt; &lt;DataTemplate&gt; &lt;TextBlock Text="{B...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Loop every five seconds in Javascript<p>I'm trying to write a simple loop in JS (or JQuery) that updates an image every five seconds, for a total of 15 secon...
<pre><code>var time = 1; var interval = setInterval(function() { if (time &lt;= 3) { alert(time); time++; } else { clearInterval(interval); } }, 5000); </code></pre> <p>you can simply create an interval and kill it after the 3rd time</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Loading a geoJSON object directly into google maps v3<p>I'm trying to create a map, using floor plans that I've stored in mongodb. If I put the JSON into a f...
<p>Use the <code>addGeoJson</code> method of <code>data</code> instead of <code>loadGeoJson</code>. <code>loadGeoJson</code> expects an URL as parameter, not a GeoJSON featurecollection object.</p> <pre><code>map.data.addGeoJson(tempObject); </code></pre> <p>Check the reference: <a href="https://developers.google.com...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript object show null but after click to see there are value but cannot access<p>I am developing the project by using ReactHook and I have problem with...
<pre><code>import React, {useEffect, useRef} from 'react'; const googleMap = useRef(null); useEffect(() =&gt; { console.log(googleMap &amp;&amp; googleMap.currentValue) }, [googleMap]) </code></pre> <p>Notice I used the hook for creating the ref. What this will do is run a use effect whenever the value of the go...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Modifying the middle of a selector in Sass (adding/removing classes, etc.)<p>I have the following SCSS for styling links in my menu:</p> <pre><code>nav { ...
<h1>The short answer</h1> <p>Since the element we want to replace has a unique name, what we're looking for is this:</p> <pre><code>nav { ul { li { a { color: red; @at-root #{selector-replace(&amp;, 'ul', 'ul.opened')} { color: green; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Theorem on insertion into BST in coq<p>I have created BST tree in coq, then I create a definition on correctness of BST. Now I have to demonstrate that inser...
<p>You can prove an auxiliary lemma showing that the <code>correct_on_*</code> variants are preserved under insertion. Naturally, you will need to add a hypothesis that says that the root of the tree <code>e</code> is less than (or greater than) the inserted element.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Call to a possibly undefined method '' through a reference with static type Class<p>I made small .fla file in Flash Professional, and I have added .as (Actio...
<p>You're useing get like it is a mettod, but thay are accessors for properties so intead of:</p> <pre><code>Bag.setFirstBag("First slot in the bag has been filled up!"); </code></pre> <p>use </p> <pre><code>Bag.setFirstBag ="First slot in the bag has been filled up!"; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Multicontext Core Data: merging to unsaved context<p>I'm trying to implement this core data stack:</p> <pre><code>PSC &lt;--+-- MainMOC | +-- ...
<p>First, when posting core data code, I suggest you not post code that depends on a third party library, unless that third party library is directly related to your problem. I assume MR is magical record, but I don't use it, and it seems to just muddy the waters of the post because who knows what it is (or is not) do...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: c++11: Calling a variadic function with the elements of a vector, and deduce number of arguments automatically<p>Trying to expand on the example found here: ...
<p>There was two mistakes:</p> <ol> <li>In <code>call_helper&lt;get_args_count(decltype(f))&gt;(f, args)</code>, <code>get_args_count(decltype(f))</code> is meaningless as <code>get_args_count</code> takes a function pointer and not a type (obviously);</li> <li>A function argument can never be constexpr (I'll let you ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: unable to create table in dynamodb-local - aws<p>I'm using <a href="http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tools.DynamoDBLocal.html"...
<p>It seems like you are missing the required ProvisionedThroughput parameter in the CreateTable request. So what is happening is the CreateTable returns a validation error and ListTables executes successfully without returning any tables (The "err" variable in your code seems to be for the ListTables call)</p> <p>E.g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fix IE/Edge CSS clip-path<p>I'm having troubles with clip-path property with IE11/Edge browsers while using clip-path CSS property.</p> <p>The snippet below...
<p>IE 11 only supports the CSS <code>clip-path</code> property <a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/clip-path" rel="nofollow noreferrer">in SVG</a>. It's hard to make it exactly the same in IE 11 like using <code>clip-path</code> in other modern browsers. I think the easiest way is to use...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: loop through certain elements inside div<p>I'm having html code like this</p> <pre><code>&lt;div class="myLinks"&gt; &lt;div class="menu"&gt; &lt;a hr...
<p>You can simply use <code>.each()</code> to achieve the goal here:</p> <pre><code>$(".myLinks a").each(function(i){ this.id=i; }); </code></pre> <p><strong><a href="http://jsfiddle.net/qx05m0x9/" rel="nofollow">Working Demo</a></strong></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why will my getter and setter with a constant not work with string.length()?<p>Is anyone able to explain why when I use a constant within my if statement for...
<pre><code>public static final int UPPER_NAME_LIMIT = 1; public static final int LOWER_NAME_LIMIT = 20; </code></pre> <p>change it to </p> <pre><code>public static final int UPPER_NAME_LIMIT = 20; public static final int LOWER_NAME_LIMIT = 1; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to replace Object.entries for ie?<p>I develop this little script : </p> <pre><code>const filteredAttributes = Object.entries(meta.attributes) .filter(...
<p>Just take <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys" rel="nofollow noreferrer"><code>Object.keys</code></a>.</p> <p>You need to replace destructuring parts as well.</p> <pre><code>var filteredAttributes = Object .keys(meta.attributes) .fil...