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: How to prevent RSpec from running specs twice in Rails plugin with dummy app?<p>I'm writing a Rails extension. To test it, I use RSpec. In order to make mode...
<h1>The cause</h1> <p>It was caused by this line:</p> <pre class="lang-rb prettyprint-override"><code>Gem.find_files('yaffle/**/*.rb').each { |path| require path } </code></pre> <p>Apparently, <code>Gem.find_files</code> gets all files in gem directory that match that pattern - not only the files relative to gem roo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Struggling to update list in object array<p>Hi im having some issues when it comes to updating a specific object in my list based on the key inside the objec...
<p>Because <code>valgtUnderFilter</code> is an array, not object, so <code>[...valgtUnderFilter, { [addToFilter]: [...[addToFilter], valg] }]</code> will just just return a clone array with adding new object at the end.</p> <p>You can change the code so <code>addToFilter</code> is the object that have the key equal <c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get user Access Token and Access Secret with the Twitter API<p>I'm trying to code a couple of PHP pages for getting users tokens the Twitter API 1.1. ...
<p>Alright, actually managed to figure it out myself. Here is my code for those who need it:</p> <h2>First page: twitter-go.php</h2> <p>The user opens it and gets redirected to twitter.com for authorizing the app.</p> <pre><code>&lt;?php //LOADING LIBRARY require &quot;twitteroauth/autoloader.php&quot;; use Abraham\Tw...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why Spring boot JPA native update is giving PSQLException with postgres Database?<p>I have this Entity class:</p> <pre><code>@Entity @Table(name = "inbox_in...
<p>Using aliases in the update query is not allowed. Please, use the following:</p> <pre><code>@Modifying @Transactional @Query(value = "update inbox_inbox set status = ?2 where id = ?1", nativeQuery = true) int setInboxStatusById(int id, String status); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Azure Data Lake Storage Gen2 label appearing as Containers and NOT File System<p>I just started with Data Lakes in Azure and countered an issue with the ADLS...
<p>You're not missing anything. Some time ago, we also noticed that the portal UI of ADLS GEN2 made the change: change the label <strong>Data Lake Gen2 File System</strong> to <strong>Containers</strong>.</p> <p>It does not break any feature, just a simple UI change.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Make a chart with area charts having both positive and negative y axis in dc or d3.js<p>I want to make a chart like that shown in the image below.</p> <p><i...
<p>I think this is what you want, but remember, this will work only for two series and you have to calculate y domain dynamically.</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>var margin = { top: 20, rig...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Divide the interval of months with respect to value from other column<p>The problem: I have a data frame recording status of customers over periods of time. ...
<p>Use <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.groupby.html" rel="nofollow noreferrer"><code>groupby</code></a> by <code>Group</code> and by a helper Series of contiguous <code>Status</code>. With <code>pandas</code> <strong>v 0.25.0+</strong> you can use <a href="https://pa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: URL of Blobs in Azure with directory structure<p><strong>Assembly in use</strong>: Assembly Microsoft.WindowsAzure.Storage, Version=9.3.1.0</p> <p><strong>Wh...
<p>The <code>ListBlobsSegmentedAsync</code> method has 2 overloads that contain the <code>useFlatBlobListing</code> argument. These overloads accept 7 or 8 arguments, and I count 6 in your code. </p> <p>Use the following code to list all blob in container.</p> <pre><code>public static async Task test() { StorageC...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: HTML Problem in displaying the items in different lines<p>I am trying to show three copies of the image in each line dynamically when I read it from the data...
<p>According to a long discussion with the owner of this question, I'm posting my solution.<br> In your code you have to just move the <strong>table tag</strong> inside function. </p> <pre><code>&lt;?php // LOGIN USER function login(){ // write remaining code.... and then use this while loop echo '&lt;table border="...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Confusion about abbreviating map<p>I would have thought the following code:</p> <pre><code>val a = Array(1, 2, 3, 4, 5) println(a.map(n =&gt; "x")) </code><...
<p><code>Strings</code> are also functions <code>Int =&gt; Char</code> which fetches the char at the given index into the string. Therefore</p> <pre><code>a.map("x") </code></pre> <p>is equivalent to</p> <pre><code>a.map(i =&gt; "x".charAt(i)) </code></pre> <p>The first element of <code>a</code> is <code>1</code> s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Solving a mathematical equation recursively in Python<p>I want to solve an equation which I am supposed to solve it recursively, I uploaded the picture of fo...
<p>You need to reorganize the formula so that you don't have to calculate P(3) to calculate P(2). This is pretty easy to do, by bringing the last term of the summation, P(n+1)a(0), to the left side of the equation and dividing through by a(0). Then you have a formula for P(n+1) in terms of P(m) where m &lt;= n, which...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting an exception while trying to reach value of the "Set-Cookie" key in C#<p>I want to reach HTTP / SOAP Header of the response (note that, response is a...
<pre><code> using (OperationContextScope scope = new OperationContextScope(Parameters.ClientService.InnerChannel)) { var response = Parameters.ClientService.SearchFlight(Parameters.AuthenticationHeader, Operations.CreateSearchRequest(fsf)); var messageProperty = (HttpResponseMess...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MFC - Deactivating all buttons except one<p>I have a legacy C++ MFC application with a complex GUI with Ribbons. I have a use case as follows : User clicks b...
<p>This way, you get all IDs of the ribbon buttons:</p> <pre><code>CList&lt;UINT, UINT&gt;&amp; lstItems; CMFCRibbonBar *pRibbon = ((CMDIFrameWndEx*) AfxGetMainWnd())-&gt;GetRibbonBar(); pRibbon-&gt;GetItemIDsList(lstItems); </code></pre> <p>Put the three lines in your view's <code>OnInitialUpdate()</code> handler.</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Running javascript when document loads<p>I am trying to implement a script that will enable a submit button once a check-box is checked.</p> <p>I am followi...
<p>As per this article: <a href="https://stackoverflow.com/questions/13196596/how-to-add-ondomready-to-my-document">How to add onDomReady to my document?</a>, I put my code inside:</p> <pre><code>window.onload = function() { //code here } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Split string of concatenated digits into a numeric vector of individual values<p>Suppose I have a long string of concatenated digits, <code>0</code> and <cod...
<pre><code>a &lt;- "1010101010101010100011011" b &lt;- unlist(strsplit(a,"")) c &lt;- as.numeric(b) class(c) #&gt; [1] "numeric" </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I need some help writing custom Assertion methods for my API testing<p>So the two assertions I am doing is checking the status message which should give me "...
<p>I would make a helper class to test it:</p> <pre><code>public static class HttpWebResponseDebug { public static void Assert(HttpWebResponse response) { Assert.AreEqual(HttpStatusCode.OK, response.StatusCode); statusNumber = (int)response.StatusCode; Assert.AreEqual(200, statusNumber)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to underline input string in c language<p>How to underline input string in c language.</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;string.h&gt;...
<p>I don't know about windows on linux this is pretty simple</p> <pre><code>#include &lt;stdlib.h&gt; #include &lt;stdio.h&gt; #include &lt;string.h&gt; int main(int argc, char **argv) { char text[100]; if (fgets(text, sizeof(text), stdin) != NULL) { size_t length; length = strlen(text); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error: Unable to find module 'opennebula' (Meteor.JS)<h1>I already tried meteorhacks:npm with the same errors.</h1> <p>In a Meteor.JS application, with iron...
<p>It turned out that the answer was:</p> <ul> <li>OpenNebula made a bad NPM (Node package).</li> </ul> <p>I put in a pull request (PR#3) to have this fixed.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rails 4: how to make exceptions to wildcard routes so I an access mail previews?<p>In <code>routes.rb</code> I have the following:</p> <pre><code>get '*cate...
<p>I tried the solution in @gregates' comment (set <code>get '/rails/previews'</code> above the wildcards) but got the error <code>uninitialized constant RailsController</code>. However, the suggestion made me think to look at how the request is being processed when it works correctly, so I removed the wildcards, just ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is is possible to downgrade the Netmiko version from 3.0.0 to 2.4.2<p>I ran into some issues after upgrading to Netmiko's latest version 3.</p> <p>Is it pos...
<p>I was able to achieve this by doing below - 1) pip3 unsintall netmiko 2) pip3 install netmiko==2.4.2 Thanks</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error #1932 with MySQL in phpMyAdmin database and XAMPP<p>Recently my XAMPP -> MySQL started crashing for unknown reason and I was needed to reinstall xampp,...
<p>The problem was in ibdata1 file. If you have old copy of that file copy it over new one and if you dont than check this post it was very helpful. Thank everyone who put time aside to read this.</p> <p><a href="https://dba.stackexchange.com/questions/71596/restoring-mysql-tables-from-ibd-frm-and-mysqllogbin-files">h...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Entity Framework - Database generated identity is not populated after save if it is not the key of the entity<p>I have a model like</p> <pre><code>public cl...
<p><strong>Disclaimer</strong>: I'm the owner of <a href="http://entityframework-extensions.net/" rel="nofollow noreferrer">Entity Framework Extensions</a></p> <p>It was indeed an issue in our library. This scenario was not yet supported for EF6.</p> <p>However, starting from the v4.0.50, it should now work as expect...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to show error console log for stylelint Node API?<p>When using the stylelint on the CLI like <code>stylelint "**/_main.scss"</code> and there's an error ...
<p>The default formatter for the stylelint Node API is <code>"json"</code>, whereas the stylelint CLI uses the <code>"string"</code> formatter.</p> <p>You can use the <code>formatter</code> property to use the <code>"string"</code> formatter when using the Node API, like so:</p> <pre><code>var stylelint = require("st...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Subdomain routing with Laravel<p>I have some trouble setting up subdomain routing properly. I think I have some problems regarding htaccess or virtual hosts ...
<p>You should enable <strong>mod_rewrite</strong> in your apache2. You can do this simply in your webserver </p> <pre><code>sudo a2enmod rewrite </code></pre> <p>after that you should restart your apache2</p> <pre><code>sudo service apache2 restart </code></pre> <p>That should solve your problem</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Authenticate Pasword of User against Azure AD using c#<p>I am trying to get token with username and password but Authentication is throwing exception ...
<p>This code is fine.You need to check the configuration in Azure portal. </p> <p>1.Treat your application as a public client.</p> <p><a href="https://i.stack.imgur.com/59OFw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/59OFw.png" alt="enter image description here"></a></p> <p>2.Add Azure Servi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make a multicomponent Swing Class in Java<p>So I am trying to make multiple JLabels inside a JPanel then add it to a JFrame, I am using the constructi...
<p>Add <code>pack();</code> before you set the frame to visible. So the constructor for Window should look like:</p> <pre><code> public Window() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 450, 300); setLayout(new GridBagLayout()); InfoPane stats = new InfoPane(); layout...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: border-bottom not working in pseudo selector section: after HTML, CSS<p>My code is below but it is not working. I want to add a dotted line after each sectio...
<p>I hope this works for you : </p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;style&gt; section { displa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Converting a number to a date<p>I have a calculation where I subtract two date values from each other. I receive a decimal value which I multiply with 60 (se...
<p>It seems very unwieldy, but if your really have to convert to a date datatype then you can add the date difference to another arbitrary date:</p> <pre><code>select date '1970-01-01' + (t2.time_event - t1.time_event) as ... </code></pre> <p>The fixed date can be anything, so I've just picked the Unix epoch.</p> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to generate a dome by using points in MATLAB<p>I am trying to generate a semi ellipsoidal dome shape by using x, y, z values. In my code below, I define ...
<p>It will be simpler or at least more elegant to use the parametric equations of an ellipsoide.</p> <pre><code>% semi axis parameters a = 65; % x-axis b = 65; % y-axis c = 47.5; % z-axis %% Parametrisation % % To reach each point of the ellipsoide we need two angle: % phi ∈ [0,2] % theta ∈ [0, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: _.where with RegExp in object return empty lodash<p>I am creating a filter for a JSON object to filter the result depending on the value of the field.</p> <...
<p>Try using find</p> <pre><code>Voucher = _.find(vo, function (item) { return item.programName.match(new RegExp('^' + '[' + req.query.alphabet + ']', 'i')); }); </code></pre> <p>jsFiddle - <a href="http://jsfiddle.net/tz279fv0/" rel="nofollow">http://jsfiddle.net/tz279fv0/</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Prefetch_related on queryset.get()<p>Today I have written a DRF view method using <code>prefetch_related</code>:</p> <pre><code>def post(self, request, post...
<p>Looks kinda unnatural. Without looking at your database structure I can only guess, that what you really want to do is: <code>PostImage.objects.filter(post__uuid=post_uuid)</code> (mind the usage of a dunder between <code>post</code> and <code>uuid</code> - that simple trick follow the relation attribute) which shou...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use Powershell to download attached excel file from Servicenow ticket<p>I'm currently working on a powershell script that should be able to download an attac...
<p>Yes, you need credentials but don't hard code them like that. Instead you can use built-in method <code>Get-Credential</code> that will securely collect your username and password. The user will have to enter their own ServiceNow credentials each time this is run. </p> <p>My version only has one thing you need to c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spark structured streaming acknowledge messages<p>I am using <a href="https://spark.apache.org/docs/2.4.0/structured-streaming-kafka-integration.html" rel="n...
<p>Two considerations:</p> <ol> <li><p>Messages are not removed from Kafka once you have committed. When your consumer executes commit, Kafka increases the offset of this topic respect to the consumer-group that has been created. But messages remain in the topic depending on the retention time that you configure for t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trying to use express middleware to serve third party API requests<p>Sorry if I posted this incorretly, it is my first question on Stack Overflow. I am curre...
<p>You aren't doing anything to send a response back to the client. If we look at the <code>/applist</code> route:</p> <pre><code>router.get('/applist', controllers.getAllSteamGames) const axios = require('axios'); const getAllSteamGames = async () =&gt; { try { const resp = await axios.get('https://api....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to remove file paths with a specific file extension from an array of paths?<p>I have an array that contains multiple file paths, with multiple file exten...
<p>You do not actually need a <code>Foreach-Object</code> here. Just pipe the array to the <code>Where-Object</code> directly:</p> <pre class="lang-powershell prettyprint-override"><code>PS &gt; $Array = @("C:\aaa\aaa\abc.txt", "C:\aaa\aaa\bbb.txt", "C:\aaa\aaa\abc.c", "C:\aaa\aaa\abc.h") PS &gt; $Array | Where {$_ -...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Tkinter: Focus issue when raising frame<p>The following code is a GUI for a touch screen (no mouse, no keyboard). The input is the touch screen and it respon...
<p>Something always has focus, even if it's just the root window. </p> <p>The simplest solution in your case is to verify that the focus is on an entry widget, which you can do like this:</p> <pre><code>def append(self, text): widget = self.focus_get() if widget.winfo_class() == "Entry": widget.ins...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove duplicate option from select (with multiple select on the same page) jQuery<p>Below is my jQuery code. It works for the first select of the page but n...
<p>Since you have more than one select on the same page, you would need to iterate through each of them to process duplicate options:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Show last 24 hours from selected date in SQL Server<p>I have 2 columns in my table, one has the hours and the other one has the dates. However, I want to sho...
<p>You need to combine the time with the date so you have a proper <code>DATETIME</code> column so you query against it. If the date and time was stored correctly this would be easy.</p> <p>If you are going to store <code>DATE</code> and <code>TIME</code> values seperately then use the correct datatypes (i.e. not <cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MeshLabServer - Simplification : Quadric Edge Collapse Decimation (WITH TEXTURE) Failure<p>I test some decimation / simplification tools to reduce triangles ...
<p>You have two alternatives to do that:</p> <p>First takes two steps:</p> <ol> <li>Convert your mesh to per-wedge-textured using the command <code>meshlabserver -i inputMesh.obj -o tmpMesh.obj -m wt</code></li> <li>Apply your other filters using <code>meshlabserver -i tmpMesh.obj -o outputMesh.obj -m wt -s myScript....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: class-validator validate union type<p>I have a <a href="https://mongoosejs.com/docs/discriminators.html" rel="noreferrer">mongoose discriminator schema</a>, ...
<p>it can be achieved by using <code>validateNested()</code> together with <a href="https://github.com/typestack/class-transformer#providing-more-than-one-type-option" rel="nofollow noreferrer">class-transformer discriminator</a></p> <pre class="lang-js prettyprint-override"><code>class BaseFeature { kind: 'size' | '...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get model property name in a partial view<p>I have an ASP.NET Core partial view that solicits (for example) a person's first and last name. The partia...
<p>Using <code>partial</code> tag helper when you pass a model using <code>for</code>, the property name will be accessible through <a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.viewfeatures.templateinfo.htmlfieldprefix?view=aspnetcore-3.1" rel="nofollow noreferrer"><code>ViewData.Templa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: looking at the next column in a data frame based on a condition in previous column<p>Say I have a data frame as follows which has classes(Low,Medium,High) an...
<p>Assuming that the columns occur in "key/value" pairs, subset the dataset ("df") in to value ('df1') and key ('df2') datasets.</p> <pre><code>df1 &lt;- df[seq(2, ncol(df), by=2)] df2 &lt;- df[seq(1, ncol(df), by=2)] </code></pre> <p>To get the "count" of each class ("High", "Low", "Medium") in each row, we can use ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to cluster docs based on their similarity measures?<p>I read the posts on the topic like how to cluster docs based on their similarity <a href="https://s...
<p>Clustering is one of the biggest areas of machine learning (proportionally you could compare it to, say, "integration" in mathematics, or "sorting" in programming), and there are literally hundreds of different algorithms, focused on different problem settings and requirements. Some of them require to specify the nu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: comma separated string with Advance Search<p>I've added an Advance Search to my Book App using this <a href="http://railscasts.com/episodes/111-advanced-sear...
<p>Here is a simple solution. Just add a <code>like</code> statement for each keyword.</p> <p>To filter books with all the tags</p> <pre><code>if keywords.present? books = books.joins(:tags) keywords.tr(' ','').split(',').each do |keyword| books = books.where("tags.name like ?", "%#{keyword}%") end end </c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trying To Store an Index From df['column_name'].str.split(' ')[index] is Throwing an Index Error in Pandas<p>I am working with a data set from kaggle on NBA ...
<p>The problem is you have some values in <code>df1['NBA Draft Status']</code> which only have 3 spaces in them, so when you call <code>.split()</code> on them the resultant list is 4 items long, which with 0 indexing is causing your index error. </p> <pre><code>df1['length'] = df1['NBA Draft Status'].apply(lambda dra...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to add email signin with phone signin or multiple signin providers together in firebase using flutter?<p>I've done the email sign in and also phone sign ...
<p>You will want to use <a href="https://pub.dev/documentation/firebase_auth/latest/firebase_auth/FirebaseUser/linkWithCredential.html" rel="nofollow noreferrer">linkWithCredential()</a>. It will work similar to what you see in the <a href="https://firebase.google.com/docs/auth/android/account-linking" rel="nofollow no...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Nodejs mongojs install error<p>I'm having some problems installing mongojs via npm. Whenever I try to install it (on windows 8) I just get a page full of red...
<p>Not ideal, but I did a fresh reinstall of node and visual studio and things seem to work OK now</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: After I limit letters enter in the input, cannot backspace or type anything?<p>click <a href="http://jsfiddle.net/qPvch/291/" rel="nofollow">http://jsfiddle....
<p>You can test to see what was entered, e.g. whether it is a character. For example:</p> <pre><code>var maxWords = 2; jQuery('#txt1').keypress(function(e) { var $this, wordcount; var code = e.keyCode || e.which; var char = String.fromCharCode(code) $this = $(this); wordcount = $this.val().length; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there an equivalent of an OnModal message in MFC?<p>My MFC application has multiple top level (parented to the desktop) windows, any one of which can host...
<p>When a modal dialog is shown EnableWindow(FALSE) is called for the parent. It is deactivated now and will not accept any mouse input. Also it will not receive the keyboard focus.</p> <p>When EnableWindow(FALSE) is called <a href="https://msdn.microsoft.com/de-de/library/windows/desktop/ms632621%28v=vs.85%29.aspx?f=...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to load file or assembly mongocrypt<blockquote> <p><strong>System.BadImageFormatException</strong>: 'Could not load file or assembly 'mongocrypt' or...
<p>Same thing happened to us. It appears that in v2.10.0 a new dependency library was introduced libmongocrypt that causes this error.</p> <p>Try to go back to v2.9.3 to workaround this issue until it is fixed by mongodb programmers.</p> <p><a href="/questions/tagged/mongodb" class="post-tag" title="show questions ta...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I access objects in the code-behind of ASP.NET in the Markup?<p>I have the following event handling code:</p> <pre><code>Public Class Details In...
<p>Add the equals sign to output the variable:</p> <pre><code>&lt;%= veh.make %&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to do two requests in parallel<p>I have the following code which requests something from Amazon's API:</p> <pre><code>params = {'Operation': 'GetRequest...
<p>You can use a <a href="https://docs.python.org/3/library/multiprocessing.html#multiprocessing.pool.Pool" rel="nofollow"><code>multiprocessing.Pool</code></a> to parallelize the requests:</p> <pre><code>from multiprocessing import Pool class Foo: def __fetch(self, statistic): params = { 'Ope...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filter grouped data in r<p>I've a large grouped data I would like to filter. The sample data is shown below.</p> <pre><code> Data &lt;- data.frame (ID1 = c(...
<p>We can group by 'ID1' and <code>slice</code> the first row</p> <pre><code>library(dplyr) Data %&gt;% distinct(ID2, .keep_all = TRUE) %&gt;% group_by(ID1) %&gt;% slice(1) </code></pre> <h3>Update</h3> <p>With the updated dataset, one option is</p> <pre><code>lst1 &lt;- split(Data, Data$ID1) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Powershell - export csv value into specific column<p>Having some issues with the syntax. I'm trying to copy the variable value into another csv column. </p> ...
<p><code>$row</code> is a reference to an object in <code>$file2</code>. When you update <code>$row</code>, <code>$file2</code> is automatically updated. Therefore, you can just wait until you have made all your updates before exporting to CSV. So assuming your logic is correct for when you want to update <code>col2</c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regular expressions in python to javascript<p>How to convert the regular expression in the function below which I have done in python to javascript?</p> <pr...
<p>The following snippet matches the passed regex literal in javascript and returns false if it is not a match (incidentally your python function will not return a value when the string is not 6 or 7 characters in length).</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre cl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: plot same entries intro different bars in ggplot2<p>The ggplot R code below will plot a barplot where <code>NA</code> entries are automatically combined into...
<p>You can try something like this...I hope I got you correct</p> <pre><code>df&lt;-cbind.data.frame("Spp"=c("calb",NA,NA,"cglab"), "col"=c("black","red","blue","green"), "N"=c(10,20,30,40)) df$col &lt;- factor(df$col, levels = c("black","red","blue","green")) ggplot(df, aes(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Making acceptence tests order dependent?<p>is there any way i can make tests order dependent so test 2 doesn't start until test one has finished? going to lo...
<p>Have you tried using the <a href="http://api.qunitjs.com/QUnit.config/" rel="nofollow"><code>reorder</code> config option</a>?</p> <pre><code>&lt;script&gt; // after you include QUnit... QUnit.config.reorder = false; &lt;/script&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JSF Call javascript function after Ajax update<p>I have jsf code which after javascript click calls hidden button click function, that performs ajax request ...
<p>Since you are using Primefaces you could call the Javascript function from your Action Method at your ManagedBean itself using Primefaces <a href="http://www.primefaces.org/docs/api/4.0/org/primefaces/context/RequestContext.html" rel="nofollow">RequestContext</a>'s <a href="http://www.primefaces.org/docs/api/4.0/org...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to disable warning in CMake 3.1 about cygwin WIN32 not being defined?<p>I have never used CMake before, but I'm trying out an IDE (CLion) that doesn't su...
<p>According to Nils Gladitz (is he on SO?) on the CMake mailing list:</p> <blockquote> <p>The code that emits the warning is run by &quot;project()&quot;. Since you do not have an explicit project() call in your top-level CMakeLists.txt CMake adds one to the top implicitly. [1]</p> <p>A project file that explicitly ca...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to define exceptions for a wildcarded Azure app service subdomain<p>I have an Azure app service which has a custom domain configuration with <code>*.exam...
<p>You don't need a new app service as a router. In fact, all other subdomains will go to the first app service, only the specific subdomain <code>admin.example.com</code> will go to the second app service if there is hostname <code>admin.example.com</code> according to your current configuration.</p> <p>In this case,...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting DevExpress Chart Series Values From Array VB.NET<p>I was trying to set DevExpress Chart Series from Data inside SQL Table. Everything went fine excep...
<p>Your problem is here:</p> <pre><code>ChartControl1.DataSource = myDataSet ChartControl1.DataAdapter = myDA </code></pre> <p>In each iteration of cycle you are creating the new <code>DataSet</code> and it's overrides previous <code>DataSource</code> in your <code>ChartControl1</code>. Your must use <code>Series.Dat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a SQL Server table with a column and its values to be generated automatically as a GUID<p>I need to design a table in SQL Server having some co...
<p>Just create a table with a column <code>ID</code> of datatype <code>uniqueidentifier</code> and set it's default value to <code>newsequentialid()</code>:</p> <p><img src="https://i.stack.imgur.com/xYYp2.png" alt="enter image description here"></p> <p>Then, when you go insert rows into that table, just <strong>omit...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to SELECT a.* FROM a WHERE EXCEPT SELECT b.* FROM b WHERE a.id != b.id<p>I am having quite a struggle with the presented postgres request.</p> <p>I have...
<p>I am thinking <code>not exists</code>:</p> <pre><code>select o.* from objects o where not exists (select 1 from object_couples oc where (oc.id = oc.left and 42 = oc.right) or (oc.id = oc.right and 42 = oc.left) ); </code></pre> <p>For per...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regex trouble in JavaScript<p>I am trying to extract data from a string using RegEx , but i am getting a NULL value as result.</p> <p>here is my current co...
<p>Your expression matches PCRE regular expression syntax but not JavaScript because JavaScript requires that square brackets inside a character class be escaped with <code>\</code>. This is what you want:</p> <pre><code>(\[cid=(?:\d*)(?:(?:,\[[^\]]*\][^\]]*)?|(?:,[^\]]*))\]) </code></pre> <p>Explained: <a href="http...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use jq to replace many values with variable values<p>Using <code>jq</code>, is it possible to replace the value of each parameter in the sample JSON with the...
<p>Export those variables so that you can access them from within jq.</p> <pre><code>export SUBSCRIPTION_ID TOPIC_NAME jq '.parameters[].value |= (env[.[1:]] // .)' file </code></pre> <p><code>//.</code> part is for leaving variables absent in the environment as is, you can drop it if not necessary</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jquery phone number masking and validation<p>The code below works fine, but I would like to Supplement it by checking for a plus sign at the beginning of the...
<p>Your regex is ok, and complies with your jquery solution. I have just filter that with an if condition at the beginning to prevent multiple <code>+</code> after first character. And at the end if <code>+</code> not being provided then added it.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-cons...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jQuery: remove resizable handles on clickout and add them on click in?<p>I'm trying to to create a simple drag, drop and resize page using jquery.</p> <p>So...
<p>If you want to detect a click falling outside of a particular element, you can do that by attaching a click handler to a top-level element (commonly <code>document</code>) and look at <code>event.target</code>.</p> <p>To reinsert elements you've previously removed from the DOM you have to use <code>.detach()</code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a way to remove transition effect on a particular element within transition element?<p>I'm applying transition for background image.Now I placed tex...
<p>You're animating the <code>left</code> and <code>padding-left</code> properties, which by their very nature will effect all the child elements. To achieve the same effect, you could animate the <code>background-position</code> property.</p> <p>Something along the lines of:</p> <pre><code>#target { background-pos...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R read.csv didn't load all rows of .tsv file<p>A little mystery. I have a .tsv file that contains 58936 rows. I loaded the file into R using this command:</p...
<p>I had a similar problem lately, and it turned out I had two different problems.</p> <p>1 - Not all rows had the right number of tabs. I ended up counting them using awk</p> <p>2 - At some points in the file I had quotes that were not closed. This was causing it to skip over all the lines until it found a closing q...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL server duplicates, results with XY, YX duplicates<p>i have table containing some information about some companies. the table contain this columns.</p> <...
<p>You want to change...</p> <pre><code>Dup.supplierid &lt;&gt; Dup1.supplierid </code></pre> <p>to...</p> <pre><code>Dup.supplierid &lt; Dup1.supplierid </code></pre> <p>Now you will only get each pair once!</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Set /p in a loop?<p>This is probably impossible, but I have a loop that displays a animated logo by using <code>TYPE</code> to type <code>logo_(framenumber)....
<p>Although this topic is somewhat old, I just discovered it. This is a pure Batch file solution that works pretty well:</p> <p><strong>EDIT</strong>: I slightly modified the code in order to made it simpler.</p> <pre><code>@echo off setlocal EnableDelayedExpansion if "%1" equ "Animate" goto %1 for /F %%a in ('echo ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Delay inside Background Fetch EXEC_BAD_ACCESS<p>I am creating an application that works in background mode (minimized), and every 90 seconds it performs a ce...
<p>You can't run forever in the background, iOS just doesn't offer you that ability.</p> <p>The crash currently is because you're calling the completion handler multiple times and after it has been invalidated.</p> <p>Basically, you should change your approach, and perhaps your requirement, and use the background pro...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Please assist me with creating SQL Script<p>I am trying to join following this two table and get the sum of id #2 from table 1 and join it with table 2 </p>...
<p>Instead of <strong>Group by</strong> we can use <strong>ROW_NUMBER()</strong> and <strong>PARTITION BY</strong>.</p> <pre><code>DECLARE @TABLE1 TABLE(Customer varchar(100), Id int, Amount int) INSERT INTO @TABLE1 SELECT 'Nick', 1, 150 UNION SELECT 'Jack', 2, 100 UNION SELECT 'Jack', 2, 130 DECLARE @TABLE2 TABLE(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PFCloud callFunctionInBackground:withParameter:block: return value<p><strong>In have a problem to Change CalUsed value I want to put Data in NSNumber *CalUse...
<p>Some Parse methods have a <code>block</code> in them. Because there will always be a delay in retrieving the data, there needs to be someone that the app "waits" until the data is retrieved. Unfortunately there is no easy way to do this so the <code>block</code> is there so anything that is within it will run AFTER ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get this form to be in the center of the page horizontally<p>I simply need the form to be within the center of the screen, and for its width to be 325...
<p>I just look at your code and change some. </p> <p><strong>YOUR CSS</strong></p> <pre><code> .form { position: absolute; // remove this one background: #fff; width: 325px; margin: -140px 0 0 -182px; // change this code to margin: 0 auto; padding: 40px; box-shadow: 0 0 3px rgba(0, 0, 0, 0.3); } </code></...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I call a partial view with IEnumerable collection in a view<p>i want display a Slider within the webpage slider page is partial </p> <pre><code> &lt;...
<p>iam sloved this problem </p> <pre><code> @Html.Action("slidshow", "slider") public ActionResult slidshow() { return PartialView("~/Views/slider/slidshow.cshtml", GetSliderImages()); } public IList&lt;slidShow&gt; GetSliderImages() { var q = db.slidShows.OrderByDescending(x =&gt; x....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Implementation detail of lock-free single-writer multi-reader list<p>I am attempting to understand the implementation of the single-writer multi-reader doubl...
<p>Instead of pointing to the previous node, the <code>Prev</code> member points to the <code>Next</code> member of the previous node. It's a bit strange, but perhaps it saves some arithmetic, since we only look at the <code>Key</code> member during forward traversals, and it saves having to allocate a whole node for t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: mysql workbench 6.2 CE : on windows 7 x64 ASCII<p>while launching mysql workbench an execution problem occurs: </p> <blockquote> <p>mysql workbench cannot...
<p>Regardless where you installed MySQL Workbench this path must not contain any non-ANSI characters atm (ANSI not ASCII, which is even more limited). Especially check out paths that include your user name (if you have non latin chars in the name). The reason is that a third-party lib (libzip) cannot handle utf-8 filen...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find hash/crc32 algorithm with known hash value and original value<p>If this kind of question is not allowed or suitable here I apologies and in such case pl...
<p>You can use <a href="http://reveng.sourceforge.net/" rel="nofollow">CRC RevEng</a> to search for CRCs. This one turns out to be easy, as it is a standard CRC:</p> <pre><code>% ./reveng -w 32 -s 2630303a30323a39423a39333a34413a38342631323926315d2852c5 width=32 poly=0x04c11db7 init=0xffffffff refin=false refo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to count the sum of values in an array of objects in JavaScript?<p>It's such an easy task, but somehow I'm stuck. I have an array of objects of product i...
<p>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce" rel="noreferrer"><code>Array.prototype.reduce()</code></a> method is best suited for operations like this (sum total).</p> <p>In my answer below, <code>sum</code> is the accumulator and is initially set to <c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to use where condition from stored data in array<pre><code>id | name | permission 1 | John | 1,4,3 2 | mike | 7,4,3 3 | sky | 3,2,1 </code></pre> <p...
<p>Select * from friend where FIND_IN_SET('4',permission);</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to trim whitespaces while setting data-automation-id dynamically<p>I'm making a simple timeselection widget in Angular to compare our current performance...
<p>If you want to remove white space in between a string, you can pass the string to a function and get it <code>split</code> (with white space) and <code>join</code> (with dash - ) like,</p> <pre><code> getModifiedText(mode){ const splitMode = mode.split(' '); const joinMode = splitMode.join('-') return ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Build process hangs when recursively building solution<p>While trying to answer <a href="https://stackoverflow.com/q/28540015/3242721">this SO question</a> I...
<p>MSBuild has an internal protection about recursion in the projects. Normally your build will fail with error MSB4006 in a case if any sort of circular dependency is discovered in the build graph. That said, if I were to guess what might have caused the hang, and if it is related to recursion, I would have inclined o...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQLite database backup<p>For backup of SQLite database, I went through <a href="https://www.sqlite.org/backup.html" rel="nofollow">https://www.sqlite.org/bac...
<p><code>':memory:'</code> as a "filename" is how you tell sqlite to keep a small DB in memory rather than on-disk. But yes, <code>sqlitebck</code> is fine to copy from file to file -- though the arguments it takes are sqlite <strong>connections</strong> so you'd need to <code>sqlite3.connect</code> to each file first...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to fix "The type of namespace name "Fault" does not exist in the namespace" for gRPC and C#?<p>I've defined a lot of types and methods (messages and serv...
<p>I'm answering my own question because I get a feeling this is a common problem. It's also hard enough to figure out because the error message is (although helpful) very general. I.e you get the same error message all the time for various reasons.</p> <p>The solution was to set the "Build Action"-property for each ....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I delete PouchDB Database indefinitly, to free space?<p>How can I drop a database in PouchDB to get the space on the disk free again? Remove only se...
<p>It sounds like you are looking for <a href="http://pouchdb.com/guides/compact-and-destroy.html">compaction</a>. It will do exactly what you describe. :)</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I split a column in R into two columns when I have no delimiter?<p>I have a dataset called data1 that I need to split the first column into two column...
<p>An option is a positive look-behind and look-ahead to split on a digit followed by an <code>"m"</code> or <code>"f"</code>.</p> <pre><code>df %&gt;% separate(1, c("date", "sex"), sep = "(?&lt;=\\d)(?=[mf])") # date sex #1 12/1/09 male #2 1/9/20 female #3 13/1/19 female #4 4/12/12 male </code></pre> <p>F...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the equivalent of the "is" operator for reflected generic types?<p>Using the <code>is</code> operator in C# with generic types is straightforward:</p...
<p>Use Type.IsAssignableFrom(Type)</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it bad (performance wise) to pass unused viewdata to every page in MVC5?<p>So I have a site that support multilanguage, I use ViewData to achieve this, fo...
<p>It will affect the performance, but not by much (assuming of course that the <code>GetLang</code> method isn't expensive to call).</p> <p>Instead of putting the data in the <code>ViewData</code>, you can use a model for the view that gets the data when needed:</p> <pre><code>public class LanguageModel { private...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Datatables.net for large data sets<p>I'm reading <a href="http://www.datatables.net/examples/data_sources/server_side.html" rel="nofollow">http://www.datatab...
<p>To answer both 1 and 2 at the same time: yes, this is exactly how the server side functionality works and it's pretty easy to implement. An object is sent to the server side component with information about what to search for and how many to return (equal to the number of elements you specify on a page at a time) an...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using pandas groupby and numpy where together in Python<p>I am a newbie to python!</p> <p>I need to use pd.groupby() function under np.where().</p> <p>Belo...
<p>Use <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.core.groupby.GroupBy.transform.html" rel="nofollow noreferrer"><code>GroupBy.transform</code></a> with mean of boolean mask, so get <code>Series</code> with same size like original, so possible pass to <code>np.where</code> for new column:...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: HTML autocomplete/snippets stopped working when I changed the file language type to `HTML (EEx)` for a .html.eex file<p>I guess there's some built in snippet...
<p>I got it working with:</p> <pre><code>"emmet.includeLanguages": { "HTML (EEx)": "html" }, </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find which Database Roles are associated with a given User?<p>In SSMS I have a User <code>X</code> and there are <code>Y</code>, <code>Z</code> and <c...
<p>You can use the <code>sys.database_principals</code> object to find this out:</p> <pre><code>SELECT u.[name] AS [UserName], r.[name] AS RoleName FROM sys.database_principals u JOIN sys.database_role_members drm ON u.principal_id = drm.member_principal_id JOIN sys.database_principals r ON drm.role...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: void() function return a value instead of char or string?<p>this is my code that I have been working for quite a while. I got stuck mainly on my</p> <pre><c...
<pre><code>#include &lt;iostream&gt; #include &lt;cmath&gt; #include &lt;cstdlib&gt; #include &lt;stdlib.h&gt; #include &lt;time.h&gt; using namespace std; void displayProblem(int, int, char); bool checkGuess(int, int); char getOperator(int); int operand(int); int doIt(int, int, char); int main() { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript combat turn system<p>I will try to be as clear as possible but I may miss information. If you need more information to answer feel free to ask.</p...
<p>There is too much wrong with your code. Basically your code should look like this:</p> <pre><code>var Fighter = function (life, armor, initiative, dmg) { this.life = life; this.armor = armor; this.initiative = initiative; this.dmg = dmg; }; Fighter.prototype.fight = function(opponent) { if (opponent.init...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create array from ajax call<p>I'm having trouble getting this into the right format.</p> <p>I have this:</p> <pre><code> $.ajax({ url: 'att_co...
<p>The commented out code is trying to invoke a <code>join</code> method on a <code>string</code> object which does not exist (or rather is <code>undefined</code>) hence the error message you are receiving. </p> <p>When trying to <em>append</em> data onto an array you would need to use <a href="https://developer.mozil...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript Countdown to stop at 0:00<p>I've found this countdown script and made some basic formatting changes but I can't figure out how to get the timer to...
<p>You need to check if seconds and mins are both zero and if they are return out of the Decrement function rather than calling setTimeout again.</p> <pre><code>function Decrement() { if (document.getElementById) { minutes = document.getElementById("minutes"); seconds = document.getElementById("sec...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java: How to get specific information from xml using stax<p>I am having trouble with getting specific information from my xml using stax. Inside my xml I hav...
<p>You just have to keep track of where you are in the document. For example, it's common practice to keep a stack of element names: push a name onto the stack when you hit a startElement, pop it off when you hit endElement, and then inspect the stack to discover the context of the element you are currently processing....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to join two tables based on substring values of fields?<p>I am having problem with sql. I want to join two tables, employee and class instructor. Condit...
<p>So many ways to do this. It would be a good idea to look at the explain plan for various ways before committing to a particular method. For example, if there is a function-based index on <code>EMPLOYEE</code> such as <code>SUBSTR(id, 2, LENGTH(id) - 1)</code> then you'll want to use that in your query:</p> <pre><co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Intersystems caché - sql storage definition<p>How to set Name property of %Dictionary.StorageSQLMapDefinition class? I have this code:</p> <pre><code>set st...
<p>You maybe forgot about %Dictionary.StorageDefintion.</p> <pre><code> set clsDef=##class(%Dictionary.ClassDefinition).%OpenId("User.Test") set storage=##class(%Dictionary.StorageDefinition).%New() set storage.Name="Test" set storage.Type="%CacheSQLStorage" // this is important set storageMap=##c...