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 do i add SAN DISK to a virtual server using knife command?<p>Currently we create VS using following command </p> <pre><code>knife softlayer server crea...
<p>I believe you need to add the <code>--san-storage</code> and specify <code>--block-storage 0:100</code>. SoftLayer virtual servers always reserve device 1 for a swap device, so 0 would represent the primary drive and 2-5 would represent additional drives. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Having problems with my Udacity MyReads React Project props<p>Can somebody please help me in fixing this code. I have created two files called <code>app.js</...
<p>As per the review and from the code,</p> <p>In you <code>app.js</code> file you are passing props</p> <pre><code>&lt;SearchBooks bookShelfHandler= {this.bookShelfHandler} books={this.state.books} /&gt; </code></pre> <p>but the required props in you component is </p> <pre><code>myBooks: PropTypes.array.isRequ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a column that is the result of a division of two existing columns?<p>I have the following table in my <code>PowerBI</code> dashboard</p> <p><a...
<p>Create a measure using the <code>DIVIDE</code> function:</p> <pre><code>MyMeasure = DIVIDE ( SUM ( MyTable[budgetfree] ), DISTINCTCOUNT ( MyTable[patient] ), BLANK() ) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use dplyr or data.table to perform look-ahead calculations by groups of data subsets?<p>I'm interested in using dplyr (for ease) and/or data.table (fo...
<p>A <code>data.table</code> solution. Instead of looking ahead going forward, look behind going backward.</p> <pre><code>setDT(data)[, State1 := ifelse(rev(cumsum(rev(Values_1 + Values_2))), State, &quot;XX&quot;), ID] data #&gt; ID Period Values_1 Values_2 State State1 #&gt; 1: 1 1 5 5 X0 ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you get the source element which fired an event when using an object method<p>When you do</p> <pre><code>event.addeventlistener("event", somefunction...
<p>I have just discovered that an event object has a <code>currentTarget</code> property. which is precisely what the 'this' is set to. Couldn't find any documentation that said that explicitly though.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Print All Children Columns from Firebase - iOS Swift 4<p>I have 2 records in my users table </p> <p><a href="https://i.stack.imgur.com/iEu0Q.png" rel="nofol...
<p>You can try</p> <pre><code>let fcmTokenRef = Database.database().reference().root.child("users").observe(DataEventType.value, with: { (snapshot) in print("&gt;&gt;",snapshot) let dic = snapshot.value as! [String:[String:Any]] Array(dic.values).forEach { let str = $0["fcmToken"] as! Stri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Tagging a Similar category with repeated sequence of numbers in pandas dataframe<h3>Below is the reproducible code</h3> <pre><code>colo = ['red', 'red', 'red...
<p>Here's one way using <code>eq</code> + <code>diff</code> + <code>ne</code> + <code>cumsum</code> to greate groups; then use boolean indexing to fill in values:</p> <pre><code>cond = dt['col'].eq('red') s = dt.loc[cond, 'seq'].diff().ne(1).cumsum() dt['Expected_col'] = dt['col'] dt.loc[cond, 'Expected_col'] = 'RED' +...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: created a simple middleware game with Nodejs, and an http header error occurs<p>I am a beginner studying Nodejs.</p> <p>I have recently studied node middlew...
<pre><code>const express = require('express'); var app = express(); app.use(/^\/$/, (req, res, next) =&gt;{ res.send('hello'); return; }); app.use((req, res, next) =&gt; { if (+new Date() % 2 === 0) { console.log('continue'); res.send('lucky!'); next(); } else { consol...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to include https to restart service on https ping result<p>Hi I would like to to a https request on my server. How can I include https to do get the res...
<p>It wont be possible to ignore the SSL Errors due to the fact that it runs on https. Alternative run it on the server with http example: <a href="http://localhost" rel="nofollow noreferrer">http://localhost</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Wordpress plugin register_activation_hook doesnt work<p>So In my main plugin file I have this</p> <pre><code>class RegistrationHooks { /** * @var st...
<p>You're misusing <a href="https://developer.wordpress.org/reference/functions/register_activation_hook/" rel="nofollow noreferrer">register_activation_hook(</a>). That hook only runs when you Activate your plugin (immediately after installing it, usually). It's used for things like creating plugin-specific tables an...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Azure Functions: StatusCode cannot be set because the response has already started<p>I am trying to stream data from my Azure Function and all is fine but I ...
<p>After reproducing from our end we could able to get this work when we tried fixing the return type and return the EmptyResult i.e., <code>return new EmptyResult();</code>.</p> <pre><code>[FunctionName(&quot;Function1&quot;)] public static async Task&lt;EmptyResult&gt; Run( [HttpTrigger(Authorizat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular table index is undefined with multiTemplateDataRows directive<p>I'm having trouble getting my table indexes to show up. Here's an example table:</p> ...
<p><code>multiTemplateDataRows</code> have a different variable to hold the row's index called <code>dataIndex</code>. Access the row's index using <code>let k = dataIndex</code>.</p> <pre class="lang-html prettyprint-override"><code>&lt;!-- Row content--&gt; &lt;mat-row *matRowDef="let row; columns: displayedColu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SwiftUI app doesn't run when supporting iOS 13<p>App was working fine when the deployment target was 15.2, but then I needed to change the deployment target ...
<p>The <code>StateObject</code> is available from SwiftUI 2.0 (iOS 14) and is designed to work in View, not in class (like <code>SceneDelegate</code>)</p> <p>For provided scenario a possible solution is to use <code>logicState</code> as just property at top level (in delegate or main view), but inject it completely int...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the Python equivalent of Ruby's Base64.urlsafe_encode64(Digest::SHA256.hexdigest(STRING))<p>I am trying to port parts of a ruby project to python and...
<p>In your original Python code, you used <code>digest</code> instead of <code>hexdigest</code> which will give different results, as it's not the same thing. Keep in mind that converting code to different languages can be very difficult, as you need to understand both languages well enough to compare the code. Try and...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get file hash in specific changeset in Mercurial<p><strong>Is there a way to get file hash in a specific changeset/revision in Mercurial?</strong></p> <p>Si...
<p>I don't think so, since for mercurial the atomic unit is the changeset, not a single file (and rightly so!).</p> <p>On the other hand, you can use <code>hg cat</code> and pipe to any hash utility as follows</p> <pre><code>$ hg cat -r REV FILE | md5 $ hg cat -r REV FILE | shasum ... </code></pre> <p>But again, are...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does Types::Standard break Scalar::Util::readonly?<p>Perl 5.30.0. Libraries are up-to-date as of today.</p> <p>I expect Scalar::Util::readonly to return ...
<p>That's not the proper way to use <code>readonly</code>.</p> <p>It's impossible to pass a hash to a sub. Only scalars can be passed as arguments to subs. Prototypes can be used to make it look like you are passing a hash to a sub, but that's not the case here.</p> <pre class="lang-none prettyprint-override"><code>$ p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Displaying categories from database in Laravel<p>I have this in my category model</p> <pre><code>class Categories extends Eloquent { protected $table = ...
<p>In your <code>index</code> method you've already return view, so no more code will be executed after return statement.<br> You should do something like this</p> <pre><code>public function index() { $products = Product::paginate(15); $categories = Categories::paginate(15); return View::make('site.index'...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to fill the index in Pandas Pivot_table<p>I use pandas.pivot_table to show the following DataFrame:</p> <pre><code>A B a SH 1.0 b BJ 2.0 ...
<p>It is not necessary, only <code>pandas</code> display <code>MultiIndex</code> this way.</p> <p>You can change it by <a href="http://pandas.pydata.org/pandas-docs/stable/options.html#available-options" rel="noreferrer"><code>multi_sparse</code></a>:</p> <pre><code>#temporaly display it with pd.option_context('displ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firefox loads parallax image size wrong (only on refresh)<p>I have an odd bug in the current Firefox. I'm running a parallax script (I think it comes from Ma...
<p>This most certainly seems to be a FF bug (<a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1281438" rel="nofollow noreferrer">https://bugzilla.mozilla.org/show_bug.cgi?id=1281438</a>)</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: When writing a list to a .txt file with python, '\n' (backslash n) appear?<p>The result of my script is not as expected. I want to be able to write a word in...
<p>If they are on the end or start of the strings, you can use <code>strip()</code> but if you would just like to remove all \n's from the strings try this. </p> <p><code>line = line.replace('\n','')</code></p> <p><a href="https://docs.python.org/2/library/string.html#string.replace" rel="nofollow noreferrer">replace...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flask Login is not working properly on Python Anywhere<p>This morning I tried to login in my account from my website(deployed on pythonanywhere</p> <p>After ...
<p>You should see whats being sent over when you post by printing the form data.</p> <pre class="lang-py prettyprint-override"><code>@application.route('/logmein', methods=['POST']) def logmein(): print(request.form) # print each method so you can look around print(dir(request.form)) return 'test' </co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: HTML/JQuery - Element Hiding by its ID<p>I need help hiding an HTML element with its ID example:</p> <pre><code>&lt;p id="myelemnt"&gt;Hello all&lt;/p&gt;&l...
<p>First approach:</p> <pre><code>document.getElementById("myelemnt").style.display = "none"; </code></pre> <p>Second approach (jQuery):</p> <pre><code>$(".myelemnt").hide(); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Count from multiple tables with group<p>I have two tables. The first tables registers admissions. The second one has exits, as shown below:</p> <pre><code> ...
<p>I didn't find the answer. Here's an answer from one of my friends, below is a MySQL version:</p> <pre><code>select aa.date, IFNULL(aa.joins, 0) joins, IFNULL(bb.exits,0) exits, (IFNULL(aa.joins,0) - IFNULL(bb.exits,0)) net from ( select join_date date, count(name) joins from Admissions group by join_date ) aa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unfreeze UI whilst performing a task<p>Threading noob here.</p> <p>I'm trying to make a program that pulls a user's profile data from the osu! website, and w...
<p>You can't access UI elements (or any <code>DispatcherObject</code> in general) from a thread other than the UI thread (dispatcher thread). Either use the <code>Dispatcher.InvokeAsync</code> to access those objects or access them (to copy their values) before you run the background operation:</p> <pre class="lang-cs ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Insert update based on value<p>I have a request to modify / insert new data in the products based on Value.<br> Currently I'm using SSIS to insert data into ...
<p>Two choices:</p> <ol> <li>Write an update statement to update any existing rows and follow it up with an insert statement that will insert new rows. This will run in two operations but will allow you to maintain the logic completely independently.</li> <li>Use the <a href="https://msdn.microsoft.com/en-us/library/b...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Multifaceted Patches with structs (matlab)<p>matlab newcomer here. I have a problem understanding how to use patch() using a structure with given vertices an...
<p>Pulling an example from the MATLAB help page for <a href="https://www.mathworks.com/help/matlab/ref/patch.html#busd9x8-1" rel="nofollow noreferrer"><code>patch</code></a>:</p> <pre><code>clear S S.Vertices = [2 4; 2 8; 8 4; 5 0; 5 2; 8 0]; S.Faces = [1 2 3; 4 5 6]; S.FaceVertexCData = [0; 1]; S.FaceColor = 'flat'; S...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Finding the intersection of an arbitrary number (n) of arrays (n <= 6, always), PHP<p>I have code that for every client <code>$client</code> I end up with an...
<p>I think you can use splat operator</p> <pre class="lang-php prettyprint-override"><code>&lt;?php $clients = [ [1,2,3], [1,5,6], [1,7,8], ]; var_dump(array_intersect(...$clients)); </code></pre> <pre class="lang-sh prettyprint-override"><code>array(1) { [0]=&gt; int(1) } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: DiagrammeR: Devise a graph from a dataframe<p><strong>Objective</strong> (In the R environment): extract <strong><em>nodes and edges</em></strong> from a dat...
<p>You can do this with the <code>igraph</code> package. Your data frame is an adjacency matrix and igraph contains a function to make that into a graph. My code below adds a layout to position the vertices in the positions that you indicated in your sample graph. </p> <pre><code>## Your data df = read.table(text="a b...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Visual Studio 2022 duplicate shortcut has changed<h3>Microsoft Visual Studio Community 2022 (64-bit) </h3> <p><strong>Version 17.0.6</strong></p> <p>I have b...
<p>I managed to fix the issue by clicking reset mapping scheme.</p> <ol> <li>Tools</li> <li>Options</li> <li>Environment</li> <li>Keyboard</li> <li>Reset</li> </ol> <p><a href="https://i.stack.imgur.com/vISDW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vISDW.jpg" alt="enter image description here...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a difference in behavior of parameterized vs. literal regular expressions in Rascal?<p>I was working on a method that accepts a regular expression a...
<ol> <li>you deduced correctly, at interpolation time Rascal will escape meta characters (I do hope all of them) so you can not construct regular expressions dynamically. So <code>regex=".";</code>//<code>:= "bla"</code> will expand to <code>/\./ := "bla"</code> before even compiling the regular expression.</li> <li><p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting the frequency of a certain value in each column<p>I have a data frame in which all the missing values are denoted with <code>?</code>. I need the cou...
<p>Compare all values with <code>?</code> and get occurencies by <code>sum</code> of <code>True</code> values:</p> <pre><code>out = (mydata == '?').sum() </code></pre> <p>Similar:</p> <pre><code>out = mydata.eq('?').sum() </code></pre> <hr> <p>In your solution first should be replaced <code>?</code> to <code>NaN</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to connect and read files from Azure FTP folder using Python in Azure Databricks?<p>I need to use Python in Azure Databricks to do the following:</p> <ol...
<p>You can rely on this <a href="https://stackoverflow.com/a/58640753/11289386">answer</a>. Just change the method of storing to retrieving, e.g., <a href="https://docs.python.org/3/library/ftplib.html#ftplib.FTP.retrbinary" rel="nofollow noreferrer"><strong>retrbinary</strong></a>, or <strong>retrlines</strong> as wel...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Webscraping using R - Table content<p>New to webscraping. I am trying to scrape specific data from websites.</p> <p>For eg. <a href="https://www.vesselfinder...
<p>We can just get all the tables from website by,</p> <pre><code>df = 'https://www.vesselfinder.com/vessels/KOTA-CARUM-IMO-9494577-MMSI-563150100' %&gt;% read_html() %&gt;% html_table() </code></pre> <p>The table of interest is,</p> <pre><code>df[[2]] # A tibble: 4 x 2 X1 X2 &lt;chr&gt;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Implementing sequenceAL for lists<p><a href="https://wiki.haskell.org/Typeclassopedia" rel="nofollow noreferrer">Typeclassopedia</a> (Haskell Wiki) has this ...
<p>It can use <code>&lt;$&gt;</code> and <code>&lt;*&gt;</code> operator in <a href="http://hackage.haskell.org/package/base-4.12.0.0/docs/Control-Applicative.html#v:-60--42--62-" rel="nofollow noreferrer">Control.Applicative</a> to do it:</p> <pre><code>sequenceAL :: Applicative f =&gt; [f a] -&gt; f [a] sequenceAL [...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to fill text with 2 different color/texture<p>I draw text on top of a image using Path.Addstring and filling it with a color and it works perfectly. Now ...
<p>Possible.</p> <ol> <li>Fill the path with the solid brush.</li> <li>Get the rectangle that bounds the path through the <a href="https://docs.microsoft.com/en-us/dotnet/api/system.drawing.drawing2d.graphicspath.getbounds?view=dotnet-plat-ext-6.0" rel="nofollow noreferrer"><code>GraphicsPath.GetBounds</code></a> metho...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Window not resizeable / moveable if onBoxReady() method implemented<p>Simple question... </p> <p>Looking at <a href="https://fiddle.sencha.com/#fiddle/1cfq"...
<p><code>onBoxReady</code> is a protected method, you need to call the parent method in it:</p> <pre><code>onBoxReady: function(width, height) { this.callParent([width, height]); console.log('do something...'); } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: node.js on google app engine: different version running vs specified in package.json<p>I have a node application on GAE (Google App Engine) flex environment....
<p>The <a href="https://cloud.google.com/shell/docs/" rel="nofollow noreferrer">Cloud Shell</a> is a GCP product separate from GAE (flexible). It does <strong>not</strong> execute on your GAE flexible app instance. From <a href="https://cloud.google.com/shell/docs/features#virtual_machine_instance" rel="nofollow norefe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ant - how to get a zero resource count if the folder does not exist<p>I'm trying to base a task on whether a folder has content, not on whether it merely exi...
<p>You can use <code>erroronmissingdir=&quot;false&quot;</code>, to avoid the error for a non-existing directory. Add <code>else=&quot;false&quot;</code> if you need the property to always exist</p> <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt; &lt;project name=&quot;Test resourcecount&quo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Joining two table in oracle<p>I have two tables Mention and Retweet </p> <p>Mention</p> <pre><code>ID USER_SCREEN_NAME USER_ID MENTIONED_USER_ID...
<p>Simply add a <code>JOIN</code> clause to mention/retweet id fields. No need for <code>GROUP BY</code> and unclear why you need subquery. However, your full desired result cannot be achieved with <code>FULL OUTER JOIN</code> since <em>nulls</em> will be present for corresponding unmatched left or right tables:</p> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Chain 3 or more dependent observables<p>I know this question has been asked before <a href="https://stackoverflow.com/questions/51210629/angular-6-pipe-rxjs-...
<p><strong>mergeMap</strong> operator is fine here since Api requests emit 1 event and then complete, but to be precise <strong>please use switchMap or concatMap instead of mergeMap</strong>. Please have a look at this post about these operators as well, if you are interested. <a href="https://blog.angular-university.i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create Cron Job in shared host and laravel<p>i want send notification every Minute to my users with laravel framework and shared host ,ssh access not accessi...
<p>Change your command to run the <code>artisan schedule:run</code>. Note that there is a space after <code>php</code> and the path, this tells the cron job to execute the php script which is the artisan file.</p> <pre><code>php /path-to-your-project/artisan schedule:run &gt;&gt; /dev/null 2&gt;&amp;1 </code></pre> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: KeyError: 'NormalizeUTF8' loading a model to another jupyter notebook<p>I'm trying to reload another model to another jupyter notebook using this code:</p> <...
<p>I had this issue before. To solve it, you need to install tensorflow_text. You should try to :</p> <pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; tf.__version__ 2.8.2 &gt;&gt;&gt;!pip install tensorflow-text==2.8.2 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Meteor generate dev bundle on Arm(raspberry pi)<p>ive updated all the necessary files so that the dev bundle script starts building. my issue occurs when it ...
<p>not sure what you try to do with meteor but we have just updated our meteor universal for to the current stable 1.3.3.1 release.</p> <p>If you check the README you will find also the guide "how to build your own". Take a look at the commits to the release-1.3.3.1-universal branch. Since we started there are a numbe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dataset (a reactiveValue) can not be found inside regular R functions<p>I have a dataset (called mydata$data) that I would like to keep updated at all time. ...
<p>Try returning the data from your function instead of modify it:</p> <pre><code>CodeMissingData&lt;-function(datax) { for (v in 4:ncol(datax)) { if (!("*NA*" %in% levels(datax[,v]))) {levels(datax[,v])&lt;-c(levels(datax[,v]),"*NA*")} } datax[,-(1:3)][is.na(datax[,-(1:3)]) | datax[,-(1:3)]=="NA"]&lt;-"*NA*...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can intellij plugins have a window that itself has tabs?<p>New to intellij plugin development.</p> <p>It's <em>hard</em> to find an open source codebase on ...
<p>An IntelliJ plugin can have any UI it wants; there are no limitations.</p> <p>If by "UI window" you mean a toolwindow (a panel on the side of the screen), you can use <code>toolWindow.getContentManager().addContent()</code> to create tabs in that toolwindow. You can search for usages of this method in the IntelliJ ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extending Vuetify's VBtn component to create a reusable icon button component<p>I've been using the example Codepen (<a href="https://codepen.io/whoistobias/...
<p>The problem is your icon names are incorrect. The default icon names are prefixed with <code>mdi-</code>. You can see the list of available icons from <a href="https://materialdesignicons.com/" rel="nofollow noreferrer">https://materialdesignicons.com/</a>.</p> <p>I'm assuming <code>mdi-plus</code> is a good icon fo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JS how stop function - from clicking button to automatically (timer)<p>The following function changes background-color with random colors clicking on a start...
<p>Here is an improved version</p> <p>I use setTimeout to stop after x seconds</p> <p>Also I define the various buttons and other elements once</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-...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ignore view validation when element has attributes `display: none`<p>I have the following html text input that will show/hide using jQuery's <code>slideUp</c...
<p>How about this?</p> <pre><code>.slideUp('slow', function(){ $('#HomeNumber').removeAttr('required'); }); .slideDown('slow', function(){ $('#HomeNumber').attr('required'); }); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Web API call sent 3 times in Azure App Service<p>We are using Azure Web App Service to host our backend API in .NET 4.6.</p> <p>We saw a particular web API r...
<p>Highly unlikely the API ran by itself unless its a time triggered function which can sometimes run under weird circomstances, but if its a HTTP triggered API 99.9% its your code calling it, just log the invocations and find out the details.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In R why does a factor resulting from interaction() have a different length of levels vs length of unique values<p>There is something special about <code>int...
<p>By default <code>interaction()</code> will create a level for all possible combinations of values between the two input vectors, even if those observations don't actually occur. For example it created a level for <code>b.1</code> even though that did not occur in your data.</p> <pre><code>table( with(test, interacti...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RGB image masking using opencv and numpy arrays (shape mismatch)<p>I have a problem using a mask to keep only few parts of an image. What I do :</p> <p>1 -&g...
<p>Based on my understanding you need to mask the image based on the mask you created, You can use multiplication to achieve this affect.</p> <pre><code>def mask_image( img, mask ): newImg = img.copy() newImg[:,:] = img[:,:] * mask[:,:] return newImg </code></pre> <p>With this you don't have to convert the mas...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Swagger Endpoint return HTTP 500 in Azure Function App<p>I have an azure functions app (.NET 5 isolated) that has swagger enabled. Everything works fine loca...
<p>I've been able to figure this out. The trick was understanding that it works fine locally but fails when deployed in Azure. The question I raised to myself &quot;what's different in Azure than when running locally?&quot; It turns out the HTTP trigger authorization level. By switching all HTTP trigger authorization l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Majority of my column headers are dates in my dataframe, not able to use the loc function - how do I fix this?<p>I have a dataframe that shows the number of ...
<p>Convert headers to string</p> <pre><code>df.columns = df.columns.astype(str) </code></pre> <p>or</p> <pre><code>df.columns = df.columns.map(str) </code></pre> <p>then, if you want to access all the column</p> <pre><code>df['2017-08-01 00:00:00'] </code></pre> <p>or if you want to access for example cell 5 of this co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extract and convert from JSON by Regex<p>Good afternoon, it is necessary to extract the data inside the token_dict object from the data received by the api a...
<p>Firstly, note that Regex is very far from the best solution to this issue.</p> <p>A better approach to achieve what you require is to use <code>Object.keys()</code> to retrieve a list of all the unique property names within <code>token_dict</code> and then use <code>map()</code> to create an array of their associate...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R Studio Fatal error: 'R_TempDir'contains space<p>I tried to download the latest version (4.2.0) of R on my windows computer and received this error message ...
<p>I also experienced this issue with 4.2.0 of R on Windows 10 but not prior versions of R.</p> <p>In my case, the reason was the default temporary file folder was within my user directory and my user ID has a space in it. Apparently this causes an issue.</p> <p>I was able to work around it by setting the global enviro...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: using getData on a spreadsheet retaining font formatting<p>I have the following script in my Code.hs file:</p> <pre><code>function getData() { return Spre...
<p>Unfortunately there is not a way to get the in-string formatting. The closest I can find is a <a href="https://developers.google.com/apps-script/reference/spreadsheet/range#getfontstyle" rel="nofollow">Range method getFontStyle()</a></p> <p>However this returns 'italic' if the whole string is italic, and 'normal' i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want run a job on buissness days only in the python schedule module<p>does anyone know how to do this in the python schedule module? there is little to no ...
<p>You can give it a try and confirm if it works for you.</p> <h3>Run schedule from Monday to Friday</h3> <pre><code>schedule.every().monday.to(friday).at(&quot;06:00&quot;).do(job) schedule.every().monday.to(friday).at(&quot;07:40&quot;).do(job) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Verify a testing filename in Python using a certain schema<p>I am building a testing framework and have outputs going into folder structures. I would like to...
<p>Regex would be the easiest choice:</p> <pre><code>import re name = &quot;test_outputabc_success_0.json&quot; result = re.fullmatch(r&quot;test(_[^\W_]+){2}_\d+\.json&quot;, name) if result: print(&quot;matching!&quot;) </code></pre> <p>Regex explanation:</p> <ul> <li><code>test</code> - starts with <code>&quot;tes...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Are linux/input.h keycodes layout independent?<p>For example, in <code>input.h</code>, <code>KEY_D</code> is equal to 32. On a QWERTY keyboard, D is the thir...
<p>You will get <code>KEY_D</code>. These values are abstraction of keys as they are placed on a typical physical keyboard (see <a href="https://en.wikipedia.org/wiki/ISO/IEC_9995" rel="nofollow noreferrer">ISO 9995</a>), after abstracting from all interface details (see e.g. <a href="http://www.win.tue.nl/~aeb/linux/k...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Simulate array with scatter & known relation to X<p>This is a very basic R question, but I can't seem to find the right packages to do what I want.</p> <p>I...
<p>Here is a function that creates the deterministic part of the correlation and then adds noise via <code>rnorm</code></p> <pre><code>make_correlation &lt;- function(alpha, beta, scatter, x){ # make deterministic part y_det &lt;- alpha + beta*x # add noise y &lt;- rnorm(length(x), y_det, scatter) return(y) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: when i create a new .net core mvc project the Startup.cs file doesnt create in project<p>i create new .net core mvc project in vs 2022 .net6 it hasn't Startu...
<p>After .NET Core 6.0,</p> <p>Program.cs includes Startup.cs as well.</p> <p>You can do everything in Program.cs that you can do at Startup.cs</p> <p>I guess they made this to simplify the code.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: An unhandled exception occurred: The requested module 'sourcemap-codec' does not provide an export named 'decode'<p>On Upgrading, to angular 13, My build ste...
<p>I was facing the same issue which is why I stumbled across this post.</p> <p>My issue was I was using the wrong node version. I faced a similar issue after upgrading to <strong>Angular 13</strong> but I was using node version <strong>v14.2.0.</strong></p> <p><a href="https://i.stack.imgur.com/Letvn.png" rel="norefer...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# MongoClient Profiling Query Duration<p>I like to profile my MongoDB commands and if duration exceeds a limit I like to write a warning into log. Profiling...
<p>I found &quot;hidden&quot; documentation <a href="https://github.com/mongodb/mongo-csharp-driver/blob/c8a34e1c0ef355dde28c2556e56d87b32782600a/Docs/reference/content/reference/driver_core/events.md" rel="nofollow noreferrer">here</a>.</p> <p>And the solution I applied is:</p> <pre><code> public MongoClient Create(st...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want to change the height of the appbar using the value of json style file<p>I have a <code>app_bar_base.dart</code> file where i have an AppBar.</p> <pre>...
<p>You can add the type to your <code>loadAppStyle</code> method. Since your method is <code>async</code> it returns a Future.</p> <pre><code>Future&lt;double&gt; loadAppStyle() async { ... return getHeight; } </code></pre> <p>Now your error should be</p> <pre><code>type 'Future&lt;double&gt;' is not a subtype ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AccessDeniedException in JUnit test using a TemporaryFolder<p>I'm having an issue with a JUnit test I made. The method I'm testing takes an <code>InputStream...
<p>You're trying to read from testFile, which is not a file but a directory; you're creating with</p> <pre><code>Files.createDirectories(tempFolder.getRoot().toPath().resolve(&quot;testFile&quot;)); </code></pre> <p>whose <a href="https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#createDirectories%28ja...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Wordpress configuration : can’t write the wp-config.php file<p>I have install WordPress in my AWS Amazon linux machine(EC2). Also i am able to connect to SQL...
<p>Get access to wp-config.php file and add DB Name, User, Password directly if possible.</p> <p><strong>OR</strong></p> <p>Check File permission of wp-config.php it should be 644. or Write permission should be given to it. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Inno Setup - Deny ACL for registry keys<p>I need my setup to create a registry key or value which has deny-type read policy.</p> <p>I've tried that:</p> <p...
<p>It's not possible with Inno Setup. It does not support anything like <code>users-deny</code>-style permissions.</p> <p>What you can do, is to execute the <code>regini</code> command or PowerShell script from <code>[Run]</code> section or Pascal Script:</p> <ul> <li><p><a href="https://docs.microsoft.com/en-us/troubl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get the body text from https.request<p>I've this example from <a href="https://nodejs.org/api/https.html#https_https_request_options_callback" rel="nofollow...
<p>In the example given above, <strong>process.stdout.write(d)</strong> writes the response body to the console. If you want to use <strong>console.log()</strong>, you can use it as given bellow,</p> <pre><code> res.on('data', (d) =&gt; { process.stdout.write(d); console.log(d.toString('utf8')); }); </code><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: openGL on raspberry pi, indexed vertices<p>I'm trying to learn some basic opengl on raspberry pi. I folow these tutorials <a href="https://solarianprogrammer...
<p>GLES 1.x/2.x does not support 32 bit indices by default. You can use at most 16 bit indices, so you should change your code to:</p> <pre><code>GLushort indices[3] = {...} [...] glDrawElements(..., 3, GL_UNSIGNED_SHORT, ...); </code></pre> <p>Note that trying to use <code>GL_UNSIGNED_INT</code> as the type paramete...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Entity Framework CORE Seeding Joining table<p>I am working on .NET CORE 6 along with EF CORE 7. I need to seed data in joining table but unable to do so and ...
<p>There is not much to say about the concrete issue (which btw is not specific to joining entity, but any entity model seeding):</p> <blockquote> <p>I am seed <code>FileTypeId</code> but not sure why EF core migration throwing error...</p> </blockquote> <p>as the cause of the issue is included at the beginning of the ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Instance member 'getPopularProductList' can't be accessed using static access<p>I have been trying to called a method from another dart file from below file....
<p>it's because <code>PopularProductRepo.getPopularProductList()</code> is the way you would access the method if it was defined as a static method, you want to use the instance of the class to access the method instead, so instead us <code>popularProductRepo.getPopularProductList()</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bokeh - access the axis label from within CustomJS trigger an error but works in Python code<p>I have a standard figure</p> <pre><code>p=figure(plot_width =...
<p>Plots may have more than one y axis, so <code>p.yaxis</code> is actually a list containing all the y axes on a plot:</p> <pre><code>&gt;&gt;&gt; p.yaxis [&lt;bokeh.models.axes.LinearAxis at 0x106fa2390&gt;] </code></pre> <p>However, more often than not, there is only y-axis. So Bokeh has a convenience that allows ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Transform / move one end of a path<p>As a simplification of my code I have a number of svg rectangles. Each of these are connected to one another with a svg ...
<p>No. There is no way to do that in the general case. You need to modify the path.</p> <p>The exception, of course, would be the very specific case where you were dragging the rectangle vertically or horizontally, where you could perhaps get away with scaling the path in one direction.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Aframe dynamic importing of gltf file<p>So I have a simply gltf file and i would like to import it with a-frame during runtime.</p> <p>I already tried to con...
<p>There was a typo in the string, here's a simple way to find out whats wrong:</p> <ul> <li>Save the buffer in a file <code>test.gltf</code>.</li> <li>Throw it into the <a href="https://gltf-viewer.donmccurdy.com/" rel="nofollow noreferrer">gltf-viewer</a></li> <li>Find out there is a typo (from the error <code>this.j...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: InDesign cc 2015 - Right to Left<p>Im totally new to InDesign and struggling a lot with it whenever I try to use Arabic... So I figured how to make arabic wo...
<p>First, you need to install arabic version. See <a href="https://helpx.adobe.com/indesign/kb/access-install-hebrew-arabic-indesign-illustrator-CC.html" rel="nofollow noreferrer">here</a> how.<br> Then, use the Paragraph panel to select Right to Left feature:<br> <a href="https://i.stack.imgur.com/Lz7bB.png" rel="nofo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to implement recursion in JMeter?<p>I'm trying to create performance test for ASYNC API calls. Steps:</p> <ol> <li>Send HTTP POST request. In response I'...
<p>The easiest is going for <a href="https://jmeter.apache.org/usermanual/component_reference.html#While_Controller" rel="nofollow noreferrer">While Controller</a>, you can put the JDBC Request sampler under the While Controller and it will be executed in loop until the condition you specify is <code>true</code></p> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Make the length of "a" and "b" to be the same if they are not in R<h1>Background:</h1> <p>Suppose I have a <strong>function</strong> that requires the <stron...
<p>Assuming A and B are both vectors, you can chop off the end of the longer vector like so:</p> <pre><code>sdf = function(a, b) { if(length(b) &gt; length(a)){ b = b[1:length(a)] } else(if(length(a) &gt; length(b)){ a = a[1:length(b)]}) return(a+b) #sample return operation } &gt; sdf(a = 2:5, b = 4...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Makefile share a target by overriding build variable<p>I have a makefile, a part of which which looks like this:</p> <pre><code>.PHONY: all all: master disp...
<p>You can't use dependencies like this, <code>buildbin</code> is just another target and will be remade at most once per invocation. You can fix this as follows:</p> <pre><code>.PHONY: all master dispatcher all: master dispatcher master: BUILDTARGET=master dispatcher: BUILDTARGET=dispatcher master dispatcher: @...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Maven - Remove Generated Folders<p>I'm using the maven-compiler plugin to generate my .jar</p> <pre><code>&lt;groupId&gt;org.apache.maven.plugins&lt;/groupI...
<p>You cannot prevent those folders from being generated as they are essential to making the build work. <code>generated-sources</code> most likely contains Java source code that was generated during the build and is needed to make the rest of the code compile; <code>classes</code> contains the compiled Java source cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: While (web services netbeans)<p>i have this method adn i have to remove all the orders from the same client. here is the .xml file from which i am removing <...
<p>It's because you return the method immediately when you remove something. You can take <code>return "order removed";</code> out of the for loop, and have something like a flag variable to check whether there's something removed.</p> <pre><code>@WebMethod(operationName = "removeorder2") public String removeorder2(@W...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android firestore using "whereTo()" many times causes cost a lot?<p>I am making a function to classify by user's region and MBTI.</p> <p>Here is a code.</p> ...
<p>You are charged for number of documents that match your query and are returned. Number of query clauses do not affect cost. Using more filters like <code>whereEqualTo().whereEqualTo().whereEqualTo()</code> will ideally reduce number of matches and cost less.</p> <p>For example, if you have a collection of 50 restaur...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change the specified cell in the data frame in Python<p>I have a data frame like below:</p> <pre><code>0 INT_ID F1_ID chr start T1 T2 1 F143-F...
<p>Use <code>loc</code> and your conditions. It is important to use <code>loc</code> to <a href="https://stackoverflow.com/questions/20625582/how-to-deal-with-settingwithcopywarning-in-pandas">avoid <code>SettingWithCopyWarning</code></a>.</p> <pre><code>df.loc[df['F1_ID'].eq(144) &amp; df['start'].eq( 15000), 'T1'] = ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Set time to automatically run and close the program Qt in Pi4<p>For some reason I need to run a Qt program on my Pi4 between 7am and 10pm, the rest of the ti...
<p>You can use crontab to run some script to start your program at 7am, then run another script to close the program at 10pm.</p> <p>For example, add codes below in crontab and you can run and stop some program everyday.</p> <pre><code>0 7 * * * start.sh 0 22 * * * stop.sh </code></pre> <p><a href="https://www.tutorial...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: dynamically limit the number of chars considered in sscanf?<p>(Context, thanks to the comments: I need to parse a substring of a longer string. The length o...
<p>What you have is pretty much your only option.</p> <p>As you've found, <code>scanf</code> format specifiers don't allow the field width to be specified by a separate argument, unlike <code>printf</code> format specifiers.</p> <p>So the way you're constructing the format string is really the only way to dynamically s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pandas concatenating columns with repeated indexes<p>I have two Dataframes that I want to concatenate horizontally, grouping them by the value of a column. F...
<p>One possible solution with <a href="http://pandas.pydata.org/pandas-docs/stable/generated/pandas.merge.html" rel="nofollow noreferrer"><code>merge</code></a> with matching by index, default <code>how='inner'</code> should be omit:</p> <pre><code>result = pd.merge(df1, df4, left_index=True, right_index=True) print (...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I change the movement of the ball on pressing any keys from the keyboard in processing?<p>Below is the code I am working with in processing. I want t...
<p>You can use the in-built <code>keyPressed</code> function to handle user input, so after your original code, you could add this:</p> <pre><code>void keyPressed() { switch (keyCode) { // the keyCode variable is used to identify which non-ASCII key was pressed case LEFT: xSpeed -= 0.1; break; cas...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Theme is not working when use codemirror with elfinder<p>I am using elfinder with codemirror editor.When i used codemirror theme without elfinder its working...
<p>I am solving this problem.Actually the problem is in mimes.Now the woeking code is:</p> <pre><code> $(document).ready(function() { $('#elfinder').elfinder({ url: 'path of connector file' // add more options here commandsOptions: { edit: { editors: [{ mimes: [], load: function(textarea)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python regular expression for string with the following format<p>I'm having trouble making a Regex to find a string matching the format of:</p> <pre><code>'O...
<p>You can use a character class in between the words to allow what characters should be matched. In this case you could add a <code>.</code> and a <code>-</code></p> <p>Note to escape the dot to match it literally.</p> <pre><code>\d+///\d+\.\d+///\w+(?:[.-]\w+)*///\d+\.\d+ </code></pre> <p><a href="https://regex101.co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SAS for following scenario (most frequent observation)<p>Assume I have a data-set <code>D1</code> as follows:</p> <pre><code>ID ATR1 ATR2 ATR3 1 ...
<pre><code>/* read and restructure so we end up with: id attr_id value 1 1 A 1 2 R 1 3 W etc. */ data a(keep=id attr_id value); length value $1; array attrs_{*} $ 1 attr_1 - attr_3; infile cards; input id attr_1 - attr_3; do attr_id=1 to dim(attrs_); value = attrs_{attr_id}; output; end; cards; 1 A ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Updating table row indexes using JavaScript<p>I want my table row numbers to get updated when a row is deleted.How can I do that with my existing code? Belo...
<p>I would choose a CSS solution. Just add this to your css:</p> <pre><code>table { counter-reset: rowNumber; } table tr:not(:first-child){ counter-increment: rowNumber; } table tr td:first-child::before { content: counter(rowNumber); min-width: 1em; margin-right: 0.5em; } </code></pre> <p>Here ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spring- Difference and use case @Repository and @RepositoryRestResource?<p>When I started to use spring boot I was annotating my interface with <code>@Reposi...
<p><code>@RepositoryRestResource</code> means you have REST endpoint to the repository. So user calls it directly via REST calls.</p> <p><code>@Repository</code> is a marker to a component which somehow stores data (CRUD operations). It is not necessary be accessible from external users directly.</p> <p>So in case of...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript looping through object to find match pair url<p>I am working on a reactjs project - where I have say an English url like "/en/how-it-works" and wi...
<p>You will have to loop through 'en' and 'de' simultaneously and use recursion since you have nested links. Here is my version. I already took out the 'en' and 'de' array and used them in the function.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="sni...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How handle with object keys when we type dynamic objects?<p>I have some component that can render data of any object, so I use generic here, but I have some ...
<p>Change the <em>compilerOptions/lib</em> in <em>tsconfig.json</em> to &quot;es2017&quot;, and use <code>Object.entries()</code> that will extract the value directly (<a href="https://codesandbox.io/s/quiet-paper-gige0n" rel="nofollow noreferrer">sandbox</a>):</p> <pre><code>{data.map((el) =&gt; { return Object.entr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PHP Contact Form redirects to php/mail.php<p>There is a contact form at the bottom of <a href="http://vegastudios.ca/staging/Skeleton-2.0.4/events/" rel="nof...
<p>When you submit the contact form, the page redirects to <a href="http://vegastudios.ca/staging/Skeleton-2.0.4/events/php/mail.php" rel="nofollow">http://vegastudios.ca/staging/Skeleton-2.0.4/events/php/mail.php</a> like it is supposed to, however, I believe that your mail.php is located at <a href="http://vegastud...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I pass window.screen to the back-end via AJAX?<p>If I do : <code>window.screen</code>, I got :</p> <pre><code>Screen {availWidth: 3440, availHeight: ...
<p>Only enumerable properties of an object will be serialized by <code>JSON.stringify</code>.</p> <p>Copy the properties you care about to a new object and encode that if you want to encode them as JSON.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Transform (shuffle) just 2 Fields in a Dataframe<p>I have a data frame with firstname, lastname and I want to permutate them but ONLY for the rows that have ...
<p>What helps is shuffling only the nonempty entries:</p> <pre><code>permtest$lastname[permtest$lastname != ''] &lt;- sample(permtest$lastname[permtest$lastname != '']) permtest # number firstname lastname # 1 1 # 2 2 Eddie Van Halen # 3 3 Edward Vedder # 4 4 ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to perform a function before a redirect with passport.authenticate<p>I am using WebDevSimplifieds version of a login script. So far its working but I am ...
<p><code>passport.authenticate</code> returns a function that has the signature <code>(req, res, next)</code>, i.e. a middleware.</p> <p>Compare <a href="https://github.com/jaredhanson/passport/blob/932c1b8a6ab17f81ff44a69825ce43c6434bb53a/lib/middleware/authenticate.js#L94" rel="nofollow noreferrer">the source code</a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: tensorflow dividing each row by a different sum<p>Say I have a tensor like this: </p> <pre><code>T = [[1,2,3,4], [5,6,7,8], [9,10,11,12]]. </code...
<p>This is easy to achieve just by dividing your matrix element-wise by a vector which represents a sum in each dimension:</p> <pre><code>import tensorflow as tf a = tf.constant([ [1, 2, 3, 4], [5, 6, 7, 8] ], dtype=tf.float32) b = tf.reduce_sum(a, axis=1) c = a / tf.reshape(b, (-1, 1)) with tf.Session() as ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: 'Suspected' Odd behavior from output of Selenium using Python<p>Good Day, I am running the following snippet and find the following behavior which I am not s...
<p>You're iterating twice. So in the first URL, you get Null. In subsequent URLs you get a list of webelements. You can't print <code>secref2[i].text</code> because the first time you hit it, it is "Null" and "Null" is a <code>str</code>.</p> <p>Did you mean to assign something else to the variable here? I don't know ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: can not access sql server developer sp1 ssis from ssms<p>I am installing Sql server 2016 Sp1 developer on Azure VM Windows 2012 R2 datacenter. The database e...
<p>On SQL2005, SSIS service doesn't do much - are you sure you need it?</p> <p>This <a href="https://social.msdn.microsoft.com/Forums/sqlserver/en-US/279d724f-fb97-4d9a-ac6f-b0de4de8d0fb/ssis-port?forum=sqlintegrationservices" rel="nofollow noreferrer">https://social.msdn.microsoft.com/Forums/sqlserver/en-US/279d724f-...