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: select-string with multiple conditions with powershell<p>I'm looking for a way to find 2 different lines in a file and only if those 2 line exist I need to p...
<p>The <code>Select-String</code> cmdlet selects lines matching <strong>any</strong> of the patterns supplied to it. This means that the following file contains a match:</p> <pre><code>PS&gt; Get-Content file.txt This file contains only stringA PS&gt; Select-String -Pattern 'stringA', 'stringB' -Path file.txt file.txt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ModelState Validation in MVC<p>the class has a property <code>UserId</code> which type of <code>ApplicationUser</code> and its required, and of course we can...
<p>anyhow thanks for the cooperation for solving this problem the easiest way that i found to return a <strong>UserId</strong> from a class, just one line of code is required inside class constructor</p> <pre><code>public constructor() { UserId = ClaimsPrincipal.Current.Identity.GetUserId(); } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can't install scipy to Raspberry pi 4 (raspbian)<p>I am trying to install the <code>scipy</code> library with <code>python3 -m pip install --user --no-use-pe...
<p>Try this:</p> <pre><code>sudo apt update sudo apt install -y python3-scipy </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Element not found when executing findElement in Selenium<p>I'm trying to fill in multiple forms that come after each other, all the forms get filled swiftly ...
<p>I couldn't find time to solve your problem. If you want to do it on your own, please Search this on Google, "Shadow Root, Selenium", I had this kind of error before. What I know is, you cannot directly reach an element that stays inside of a shadow root, This is why you are not getting the source code inside of it.<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fetch all the brands from the product array on the sub category page<p>An array of Products is fetched on the subcategory page but, how to get a distinct bra...
<p>Use <code>where()</code> before the <code>get()</code> will improve the performance.</p> <p>And you can use <code>pluck('brand_id')</code> on <code>$products</code> collection to get the <code>brand_ids</code>:</p> <pre class="lang-php prettyprint-override"><code>$product_sub_categories = ProductsSubCategory::wher...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Whats the difference between Console App and Console App (.NET Framework)?<p>I am new to .NET Framework and Visual Studio. On my Visual Studio Community 2022...
<p>The difference is that .Net Core Console app is cross platform, meaning it can run on macOS, Linux and Windows machines and .Net Framework Console app can only run on windows machines.</p> <p>Resource: <a href="https://www.geeksforgeeks.org/differences-between-net-core-and-net-framework/" rel="nofollow noreferrer">h...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Github action check hanging forever<h1>Issue</h1> <p>After removing an action, sync this change in master, all prs started to have this hanging job.</p> <p><...
<p>This happens because the status check is set as &quot;required&quot; in the branch protection rules.</p> <p>To disable, in the GitHub repo &gt; Settings &gt; Branches &gt; Branch protection rules &gt; Edit master &gt; Status checks that are required &gt; remove <code>test</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: When I use typeid() to judge a type, different type will compile error<p>When I use typeid() to judge a type, different type will compile error.</p> <p>This ...
<p>Compiler will compile both branches no matter the condition, the C++17 solution is <code>constexpr if</code></p> <p>There is no reason to use <code>typeid</code> machinery for this, <code>std::is_same_v</code> from <code>&lt;type_traits&gt;</code> will do its job just fine:</p> <pre><code>if constexpr (std::is_same_...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Programmatically change app background image (>gallery, internal memory) by another image that doesn't cover the first one. Should have same priority<p>I'm c...
<p>The trick to solving it is that I made the priority in the XML file to the smallest image, then while trying to apply the full image to the screen background, I changed ImageView from Full to the smallest (which has the highest priority), in that way: first, I applied again the background to reset the applied former...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove objects with duplicate property<p>I have 'data' which is this array of objects:</p> <pre><code>{ &quot;data&quot;: [ { &quot;name&quot;: &...
<p>You can use the <code>unique</code> filter:</p> <pre><code>{% for item in data|unique(attribute='name') %} {{ item }} {% endfor %} </code></pre> <p>You can see that in action in the following code:</p> <pre><code>import jinja2 t = jinja2.Template( &quot;&quot;&quot; {% for item in data|unique(attribute='name') ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to scroll within an element with Jquery?<p>I'm trying to scroll down in a specific element on a page. I have already tried scrolling down like...
<p>This is to scroll to the end:</p> <p><code>$container[0].scrollTop</code> can be of the range <code>0</code> to <code>$container[0].scrollHeight - $container[0].clientHeight</code>, which means scrolled to the very end:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="fa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: regular expression which can treat a string containing '#' as illegal input<p>I wrote a regular expression <code>(https?:\/\/)+([a-x]*)?.[a-z]*.(com|io|cn|ne...
<p>If you use a RegEx tester online (like <a href="https://regex101.com" rel="nofollow noreferrer">regex101.com</a>) it will tell you that it's matching because the <code>.</code> is not escaped as <code>\.</code> so it will match the <code>#</code> character.</p> <p>Try: <code>^(https?:\/\/)([a-z0-9_]*\.)?[a-z0-9_]*\....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: beautifulsoup creates an incomplete result?<p>I want beautifulsoup to parse a page from lexico dictionary</p> <p>what I want to parse is the content under th...
<p>Since you want just the definitions, try the following, which will get all of the definitions under each grammar type (in the example page linked, it will get the noun and verb definitions)</p> <pre><code>import requests from bs4 import BeautifulSoup url = 'https://www.lexico.com/definition/iron' req = requests.get...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using parameters as operators in LISP lambda function (The Roots of Lisp)<p>I'm teaching myself lisp, mostly because I like the idea of being able to build p...
<p>You have two errors here:</p> <ol> <li>You shouldn't quote this expression <code>'(lambda (x) (cons 'a x))</code>, it has to evaluate to function.</li> <li>As Common Lisp is <a href="https://stackoverflow.com/questions/4578574/what-is-the-difference-between-lisp-1-and-lisp-2">Lisp-2</a>, you have to use <a href="htt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Paketo buildpack spring-boot-maven-plugin doesn't find sbom<p>I'm using <em>spring-boot-maven-plugin</em> to generate the buildpack (uses internally Paketo b...
<p>This is a limitation of the Spring Boot Maven &amp; Gradle plugins in Spring Boot 2.6.</p> <p>This version of Spring Boot implements an older version of the buildpacks platform specification, which predates the new SBOM specification. The buildpacks and buildpacks tooling have moved on to using this new SBOM specifi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: hoe to fix task :app:mergereleaseresources failed in react native release apk build<p>I am trying to release apk in react native but getting this error task ...
<p>Navigate to the android folder and run</p> <pre><code>npx jetify </code></pre> <p>this will solve your <code>mergereleasesource</code> issue.</p> <p>after that, if you are facing a duplicate resource issue then run the following command</p> <pre><code>rm -rf ./android/app/src/main/res/drawable-* rm -rf ./android/app...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firebase functions: onChange for subcollections<p>Im making a type of chat app. The structure is something like this: there is a special type of user, a stin...
<p>You can write a Cloud Function that triggers on all <code>stingrays</code> subcollections with:</p> <pre><code>exports.myFunction = functions.firestore .document('/stingrays/{docId}') .onWrite((change, context) =&gt; { /* ... */ }); </code></pre> <p>Also see the documentation on <a href="https://firebase.google....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create TypedTable from names (strings) and vectors?<p>Consider</p> <pre><code>import TypedTables as TT TT.Table(this=[1,2,3]) </code></pre> <p>Fine. N...
<p>You can skip <code>NamedTuple</code> construction and just pass this as <code>kwargs</code>:</p> <pre><code>julia&gt; Table(;Symbol(a) =&gt;b) Table with 1 column and 3 rows: this ┌───── 1 │ 1 2 │ 2 3 │ 3 </code></pre> <p>Regarding the multi-column comments:</p> <pre><code>julia&gt; as = [&quot;this&quot;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make auto refreshing on recyclerview Android while getting data from firebase firestore<p>I added a swipe SwipeRefreshLayout but the data only show wh...
<p>When you're calling <a href="https://firebase.google.com/docs/reference/android/com/google/firebase/firestore/Query#get()" rel="nofollow noreferrer">Query#get()</a> it means that you're reading the database precisely once. If you want to listen for real-time updates, then you should use a real-time listener. Here ar...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: regex pattern to find words in any order<p>I have the following strings :</p> <p>Each string is a user's answer given via the command line to answer the que...
<p>What about a list of "allowed words" only including a space and comma?</p> <pre><code>^(?:combine|online|store| |,)+$ </code></pre> <p><a href="https://regex101.com/r/pIle9X/3" rel="nofollow noreferrer">Test here</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What should I do to create a Android Build for React Native CLI App?<pre><code>[![I am trying to build APK but I am getting this error.][1]][1] </code></pre>...
<p>It says the cli is missing. you need to run <code>npm install @react-native-community/cli</code> in your project root.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What's the use for Kotlin's @JvmSynthetic on a file target?<p>The <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.jvm/-jvm-synthetic/" rel="nofo...
<p>The original proposal that caused this annotation target to be added was <a href="https://youtrack.jetbrains.com/issue/KT-41884" rel="nofollow noreferrer">KT-41884</a>:</p> <p>The rationale given was:</p> <blockquote> <p>This would apply to the synthesized class which encapsulates top-level members. This allows hidi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: compare 2 text file lines and put # in new file lines present in old file<p>I am having 2 files with service details.</p> <p><strong>File 1:</strong></p> <pr...
<p>You mean to 'hash-out' any lines in file2 that are present as 'hashed-out' lines in file1 ?</p> <p>Try</p> <pre><code>$file1 = Get-Content 'D:\Test\file1.txt' $file2 = Get-Content 'D:\Test\file2.txt' | ForEach-Object { if ($file1.Contains(&quot;#$_&quot;)) { &quot;#$_&quot; } else { $_ } } $file2 | Set-Cont...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Count the number of sets of columns separated by strings in python<p>I am reading a .txt file in python. It contains five columns of numbers. I have tried to...
<p>The <code>csv</code> library does not depend on the filename suffix. It's the data in the file that it deals with. Therefore you can definitely still use the <code>csv</code> library for this.</p> <pre><code>import csv with open('XdataTXT.txt','r') as f: numcols = len(next(csv.reader(f, delimiter=' '))) </code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: .FindNext keeps returning to the first match, instead of the next<p>I have a SourceFile.xlsm that contains an X number of field definitions and their content...
<p>Instead of this line:</p> <pre><code>Set source_range = sourceSheet.Cells.FindNext(source_range) </code></pre> <p>try this line:</p> <pre><code>Set source_range = sourceSheet.Cells.Find(What:=&quot;[&quot;, After:=source_range, LookIn:=xlValues) </code></pre> <p>I'd also add some more options to the <code>Find</code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to properly re-encode a type that is sometimes encoded as an object, and sometimes as an array?<p>I am encoding and decoding coordinates that are sometim...
<p>This is actually an XY problem. Instead of trying to be super smart, I just added an <code>array</code> computed property to <code>Coordinates</code> and will encode that instead of the Coordinates themselves when that is required :</p> <pre class="lang-swift prettyprint-override"><code>/** A spatial position with ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ROC curve and AUC for a multiclass and multilabel problem. ValueError: Target scores need to be probabilities for multiclass roc_auc<p>so, I would like to ca...
<p>You can see in PyTorch <a href="https://pytorch.org/docs/stable/torch.html?highlight=sigmoid#torch.sigmoid" rel="nofollow noreferrer">documentation</a> that <code>torch.sigmoid()</code> output is not guaranteed to sum to 1 over classes. </p> <pre><code>&gt;&gt;&gt; a = torch.randn(4) &gt;&gt;&gt; a tensor([ 0.9213,...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change date from xml to more readable content using php?<p>XML is outputting time like this:</p> <pre><code>&lt;time from="2020-02-03T12:00:00" to="2020-02-...
<p><strong>UPDATE :</strong> Simple solution With php self.</p> <pre><code>&lt;td&gt;Bergen &lt;br /&gt;&lt;?php echo date("j M, g:i", strtotime($value['from'])); ?&gt; - &lt;?php echo date("g:i", strtotime($value['to'])); ?&gt;&lt;/td&gt; </code></pre> <blockquote> <p>Result : 3 Feb, 2:00 - 6:00</p> </blockquote> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python subprocess terminal/space need to be adjusted to a value other than 80/24<p>I am working on invoking and executable as a part of script in python usi...
<p><code>subprocess.Popen(command,stdin=subprocess.PIPE, stdout=subprocess.PIPE)</code> executes a command and returns the result text.</p> <pre><code>import os command = &quot;some command&quot; res = os.popen(command).read() # get all content as text res = list(os.popen(command)) # get lines as array elements </code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Binding Grid.RowDefinition Height to Width of Grid in Xamarin<p>I've been struggling with this issue for too long. Something that is supposed to be very simp...
<p>I have updated your XAML, please see the changes below with the comments. This should make your board grid always square.</p> <pre><code> &lt;Grid x:Name="rootGrid"&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="*"/&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Grid.RowDefinitions&g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Binding component prop on input and instance variable<p>In the following example, I have the vue instance variable "formTerms" that I want to bind to the co...
<p>If you want to bind a v-model to a custom component you have to do it like this</p> <pre><code>Vue.component('terms',{ props: ['value'], template: '&lt;div&gt;&lt;input ref="input" type="text" name="terms" class="form-control" title="" @input="$emit('input', $refs.input.value)" :value="value"/&gt;&lt;/div&g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Access data from Microsoft SQL Server into Unity3d<p>We have spent more than a couple of days on this have gone though almost all available threads online bu...
<p><strong>Check this for Connect to MS SQL database:</strong></p> <p><a href="https://forum.unity.com/threads/connect-to-ms-sql-database.484855/" rel="nofollow noreferrer">https://forum.unity.com/threads/connect-to-ms-sql-database.484855/</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hidden friend to_json function unexpectedly resolves for shared_ptr<p>The code below (<a href="https://godbolt.org/z/nPveGzxjb" rel="nofollow noreferrer">Gol...
<p>A friend function definition not declared elsewhere is declared in the same namespace as the class it is defined in.</p> <p>There are two reasons your <code>to_json</code> and <code>from_json</code> are found.</p> <p>The first, and simplest reason is that <code>Example</code> is in the global namespace, so lookup wi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I control the zindex of a leaflet layer?<p>I have a codepen at <a href="https://codepen.io/ericg_off/pen/qBoPQGX" rel="nofollow noreferrer">https://c...
<p>The <a href="https://leafletjs.com/examples/map-panes/" rel="nofollow noreferrer">tutorial on panes</a> explains how to change the zIndex of a pane.</p> <p>After reading the documentation on <a href="https://leafletjs.com/reference.html#map-pane" rel="nofollow noreferrer">Panes</a> and learning that the marker pane ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Icon in top Corner using Bootstrap 4<p>Hi I am trying to add an icon in the top right corner of a span.</p> <p>But I cannot figure it out.</p> <p>Can anyon...
<p>Boostrap-4 does have <code>.classes</code> for a situation like this. So You need to write some custom CSS.</p> <p>Use <code>postion:relative</code> on <code>.badge</code> elements and <code>postion:absolute</code> on icons. </p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to append an item in a list for use later in a If-statement<p>I am creating a text-based game, and I have a problem when I try to add a Knife to pass to ...
<p>A simple approach to this is to make a data structure to hold all the game locations, and then maintain a player position which is some kind of index into this structure. I'm trying to keep this answer <em>really</em> simple, so I'm leaving out more complex details that perhaps might make this more efficient.</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create new data frame based on conditions<p>Need your suggestion, I have below table generated dynamically based on monthly data:</p> <p><a href="http...
<p>Another approach with base R with <code>match</code> and <code>max.col</code>:</p> <pre><code>prior_vec &lt;- c('cat', 'horse', 'dog', 'fish') s &lt;- sapply(df, match, table = prior_vec, nomatch = 0) df[cbind(1:nrow(df), max.col(s))] </code></pre> <p>which gives:</p> <pre><code># [1] &quot;fish&quot; &quot;dog&qu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SwiftUI what is the return-type of my own render's function?<h1>can i define something like <code>func myRender() -&gt; Image | Text</code> (union-types) ?</...
<p>You can use <code>@ViewBuilder</code> and your return type should be <code>some View</code></p> <pre><code>@ViewBuilder func tryRender() -&gt; some View { if let image = try? Image(nsImage: NSImage(data: self.data!)!) { image } else { Text(&quot;image_format_error&quot;) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I solve the problem of script blocking?<p>I want to give users the ability to customize the behavior of game objects, but I found that unity is actua...
<p>You can implement threading, but the UnityAPI is <strong>NOT thread safe</strong>, so anything you do outside of the main thread cannot use the UnityAPI. This means that you can do a calculation in another thread and get a result returned to the main thread, but you cannot manipulate GameObjects from the thread.</p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating a function that compares 2 different arrays and passs down each matching pair into a component<p>I am trying to create a component that calls upon t...
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>const Stores = [{ id: 1, name: 'Store One', }, { id: 2, name: 'Store Two', }, ] const Users = [{ id: 100,...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replace date from one dataframe to another if it's newer<p>So I've hit a wall here and I feel it's pretty simple but can't get it to work.</p> <p>I have two...
<p><strong>Case 1: same units in both dataframes</strong> Let's first create the 2 dataframes with:</p> <pre class="lang-py prettyprint-override"><code>df1 = pd.DataFrame( { "Unit_Number": ["SAH-459", "SAH-450", "SAH-399"], "Date": ["1/24/2019", "2/3/2019", "10/5/2019"], "Score": [0.951, 0....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating a scope from an array constant<p>I have a situation where I have an array constant that I'd like to perform a string search on through a scope. I us...
<pre><code>class Skills SALES_SKILLS = %w( Accounting Mentoring #... ) def self.sales_skills(skill) SALES_SKILLS.select do |sales_skill| sales_skill.downcase.include?(skill.downcase) end end end </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Issue With Deserialization Json Array with Ktor<p>I am trying to use Ktor and Kotlinx Serialization to pull some dummy post data form jsonplaceholder.typicod...
<p>I am going to close the question. Figured out that the following message was being displayed on my data class: &quot;kotlinx.serialization compiler plugin is not applied to the module, so this annotation would not be processed. Make sure that you've setup your buildscript correctly and re-import project.&quot; The i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to scale SVGs that use real world units<p>I need to generate SVGs using real world units (e.g. inches) and have them scale proportionately to fit inside ...
<p>Remove the width and height attributes from your SVG (they're not necessary). Then your SVG will scale automatically to your DIV's size. (Keep the viewBox since that will remind you that your dimensions are probably in inches)</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add Product Taxonomy Terms To Image Alt & Title<p>I'm trying to add the product title and some taxonomy terms to the image alt and image title text on the fr...
<p>You have to pass the product id to the <code>get_the_terms</code> function which is you already getting in <code>$parent</code>. Try the below code.</p> <pre><code>function change_attachement_image_attributes( $attr, $attachment ){ // Get post parent $parent = get_post_field( 'post_parent', $attachment); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NodeJS Check type of exception<p>I'm sending JSON via a socket connection and would like to check if the JSON received is complete. If I try parsing incomple...
<p>The straigh forward way would be using <code>try ... catch</code> and checking <code>name</code> and <code>message</code> of the exception. Of course there may be different messages for different error scenarios, but if you only need that specific error, this should work:</p> <p><div class="snippet" data-lang="js" d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: combine OR and And Condtion without repeating in sql<p>I'm trying to select phone number that is between date_from and date_to or the date_to is null but th...
<p>Put your <code>OR condition</code> within braces</p> <pre><code>select pho.PHONE_NUMBER from per_phones pho where pho.parent_id = :p_id and pho.phone_type='M' and rownum &lt;=1 and (sysdate &gt; pho.DATE_FROM and sysdate &lt; DATE_TO or DATE_TO is null) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to jq to copy array inside the dictionary?<p>I have the following json</p> <pre><code> [ { "name":"bucket1" }, { ...
<p><strong>The solution is the following:</strong></p> <pre><code>{"buckets":.} </code></pre> <p><strong>In the Command line:</strong></p> <pre><code>jq '{"buckets":.}' </code></pre> <p>See:<a href="https://jqplay.org/s/MJ-GoLOBX2" rel="nofollow noreferrer">https://jqplay.org/s/MJ-GoLOBX2</a> </p> <hr> <p>There i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: div expanding animation max-height doesn't work. always height is 0<p>I'm trying to make expanding animation on pop-up div element.</p> <p>I want to show th...
<p>Don't use max-height, class for animation. Directly set the transition and height in CSS and JS respectively:</p> <p>Key points:</p> <ul> <li>Set initial height and transition in the CSS rule.</li> <li>Increase only height from JS. Adding class does not trigger the CSS animation</li> </ul> <p>JS:</p> <pre><code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JSON escape characters using json.stringify() in Karate Scenarios<p>I would like to convert each request to the following format before the request is sent. ...
<p>Please avoid <code>JSON.stringify()</code> and use the "type conversion" features in Karate designed specifically for this. And read the docs: </p> <p><a href="https://github.com/intuit/karate#type-conversion" rel="nofollow noreferrer">https://github.com/intuit/karate#type-conversion</a></p> <pre><code>* json temp...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Removing leading and trailing zeros and have the result in two decimal places<p>I wanted to remove both leading and trailing zeros, and want to have the resu...
<p>While I agree with D Stanley that 'Formatting is the responsibility of the display layer', I know sometimes you need some dirty functions to be used inside stored procedures or other functions. Try with this one:</p> <pre><code>CREATE FUNCTION dbo.toStr(@a float) RETURNS varchar(12) AS BEGIN DECLARE @ret var...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Gridster2 implementation<p>I implement Gridster2 in the angular project, basically following documentation. <a href="https://github.com/tiberiuzuld/angular-g...
<p>I found the issue. The problem was the old version or <strong>rxjs</strong> as @Naren Murali mentioned. Thank you, Naren!</p> <blockquote> <p><strong>Rxjs package must be at least 7.5.5</strong></p> </blockquote> <pre><code>&quot;rxjs&quot;: &quot;^7.5.5&quot; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas not found, although installed via Anaconda and seeming to work in debug console<p>I have created a conda environment to manipulate existing excel file...
<p>In VS Code make sure the right python interpreter is selected, it should be from your conda env you have defined (this helps with the linting, if pandas not found it will highlight the import pandas line)</p> <pre><code>Shift + Cmd + P &gt; Python: Select Interpreter </code></pre> <p>Then, in terminal check you are ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ngModel not loading value dynamically<p>So I have this json returning from spring service as "etapaData" variable.</p> <pre><code>0: id: 266 aplicacao: {id:...
<p>I think your code should be:</p> <pre><code>&lt;input placeholder="Ordem da etapa no Workflow" type="text" class="form-control" id="ordem{{etapa.id}}" required value="{{ etapa.ordem }}" name="etapa.ordem"&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ASP.NET use local API Controller Endpoint<p>I currently have two separate API Controllers in a single project. Controller B requires some functionalities cov...
<p>First Create a Common class and put your common logic inside some method like below:</p> <pre><code>public class Common { public string CommonMethod() { return &quot;something&quot;; } } </code></pre> <p>Now your both controller will look like the below:</p> <p><strong>1.</strong> <strong>Let's suppose Co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SPF and DMARC for domain that should not send any emails<p>I have a domain that is used for some purposes, but not for any incoming or outgoing emails.</p> <...
<p>You should add:</p> <ul> <li>SPF: <code>TXT</code> record on your main domain with <code>v=spf1 -all</code></li> <li>DMARC: <code>TXT</code> record on the <code>_dmarc</code> subdomain with <code>v=DMARC1; p=reject</code> (you can also add a reporting address, of course)</li> </ul> <p>Optionally (if you want to allo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: nodejs rhea npm for amqp couldn't create subscription queue on address in activemq artemis<p>I have an address "pubsub.foo" already configured as multicast i...
<p>What you're observing actually is the expected behavior. </p> <p>Unfortunately, the documentation you cited isn't as clear as it could be. When it says a subscription queue will be created in response to a client connecting it really means a <em>subscriber</em> not a producer. That's why it creates a <em>subscripti...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filebeat is not forwarding nginx ingress controller logs<p>Filebeat 7.12.1 ECK operator 2.2</p> <p>I'm trying to setup the filbeat for the Nginx-ingress acce...
<p>Adding the answer here in case someone else run into this issue.</p> <p>The issue is how I'm checking the contains condition. It should've been kubernetes.pod.name instead of kubernetes.container.name. So I replaced</p> <pre><code>- condition: contains: kubernetes.container.name: ingress </cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ignoring the images at the time of crawl<p>How can I ignore the images during the crawl with the scrapy to speed up the crawl? <br> This will speed up the cr...
<p>Based on the test I did. I realized that Scrapy doesn't download any images and videos by default.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating or question in bootstrap form for better user experience<p>I am building a user form that using <code>form-group</code> and <code>row</code>. I want...
<p>This may seem a bit simplistic, but have you considered a simple bit of text saying 'or'</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;div class="container"&gt; &l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to hide scrollbar but still be able to scroll through a div with a height exceeding the viewport?<p>Lets say I have a div with a height of 10 000px. Sinc...
<p>you can try this </p> <pre><code>.parent::-webkit-scrollbar { width: 0px; } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Apache Flink and Lucene in-memory index<p>Currently I'm trying to implement my first job for Flink engine and here is the thing: In a nut shell the task is q...
<p>First, depending on the rules for &quot;join them by a list of parameters&quot;, and how big the parameter list can be, there might be a way to do this still using keyed state.</p> <p>Second, since the small data set is going to be broadcast, I think you'll need to implement your own TTL, versus trying to leverage F...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to define a function-local constant in Common Lisp?<p>I have a function like this:</p> <pre><code>(defun lookup-data (index-key) (let* ((key-table '(&...
<p>Your code is fine. <code>key-table</code> is a constant, it will be created once, when the function is compiled.</p> <p>PS. You can also use <a href="http://clhs.lisp.se/Body/02_dhf.htm" rel="nofollow noreferrer"><code>#.</code></a> to create more complicated constants that require code:</p> <pre><code>(defun ... (....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error using googletrans api in python translate() missing 1 required positional argument: 'self'<p>I want to translate some text using googletrans. This is m...
<p>You need to initialize an instance of <code>Translator</code>:</p> <pre><code>translator = Translator() inputtext = &quot;Ich mag Schokolade&quot; srclang = &quot;de&quot; dstlang = &quot;en&quot; translation = translator.translate(text=inputtext, src=srclang, dest=dstlang) </code></pre> <p><code>translate(...)</c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: For complex queries which is better sql or mongodb?<p>I just want to know which one is better performance-wise for complex queries "SQL" or "MongoDB".</p>
<p>As your queries are complex, SQL is the way to go. MongoDB is what's known as a NoSQL database. It is very fast, however it sacrifices robustness and has weak relational guarantees. Contrasting, SQL is resistant to outages and guarantees consistency between queries. Furthermore, NoSQL doesn't support unions, while S...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why not use indexwriter to build index in Lucene?<p>I didn't find any lucene forums, so this was the only relevant place to ask this question. Hope for the ...
<p>&quot;<em>the sources that I refer don't even mention it like this</em>&quot;</p> <p>There can be more than one way to do things in Lucene. For example. the official documentation includes a <a href="https://lucene.apache.org/core/9_3_0/demo/index.html" rel="nofollow noreferrer">basic demo</a> which uses an <code>In...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I save the output of a Python generator into memory?<p>This question probably has a straightforward answer, but I'm not finding it. I'm working with ...
<p><code>i</code> is the value you want to save; you can write</p> <pre><code>wkday_list = [] for i in iter1: wkday_list.append(i) </code></pre> <p>or simply</p> <pre><code>wkday_list = list(iter1) </code></pre> <p><code>list</code> itself will iterate over the iterator for your and build a list from the elements i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Faker Python generating chinese/pinyin names<p>I am trying to generate random chinese names using Faker (Python), but it generates the names in chinese chara...
<p><code>fake.romanized_name()</code> worked for me.</p> <p>I got lucky by looking through <code>dir(fake)</code>. Doesn't seem to have a method for pinyin address that I can see...</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extractin only numbers from text with additional text ml,kg,l<p>I would like extract only numbers that have kg, ml, l or kilograms from my DataFrame column. ...
<p>Almost there, try:</p> <pre class="lang-py prettyprint-override"><code>df['new_col'] = df.text.str.extract(r'(\d+[.]{0,1}\d*\s*(kg|ml|l|kilograms))')[0] </code></pre> <p>Outputs:</p> <pre class="lang-py prettyprint-override"><code> id ... new_col 0 1 ... 5kg 1 2 ... 10 ml 2 3 ... ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can someone please explain this bit manipulation code to me?<p>I am new to competitive programming. I recently gave the Div 3 contest codeforces. Eventhough ...
<p>Mask is 9-bits long, each bit represents a digit from 1-9. Thus it counts from 0 and stops at 512. Each value in that number corresponds to possible solution. Find every solution that sums to the proper value, and remember the smallest one of them.</p> <p>For example, if mask is 235, in binary it is</p> <pre><cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ffmpeg map mkv with multiple audio to mkv with more audio<p>I've an MKV like this:</p> <pre><code>Input #0, matroska,webm, from 'MyVideo.mkv': Stream #0:0...
<p>Found my error, missing ab:x and ac:x to specify the bitrate and the channel to each output audio stream</p> <p>from:</p> <pre><code>-c:a:0 eac3 -ab 384k -ac 6 -c:a:1 eac3 -ab 384k -ac 2 -c:a:2 eac3 -ab 384k -ac 6 -c:a:3 eac3 -ab 384k -ac 2 </code></pre> <p>to:</p> <pre><code>-c:a:0 eac3 -ab:0 384k -ac:0 6 -c:a:...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I switch between contexts in K9s when the contexts have already been set up?<p>I have few contexts setup in K9s. How do I switch between them?</p> <p>...
<p>You can switch to another context by typing <code>:ctx &lt;context-name&gt;</code>. For example:</p> <pre><code># Switch to the PROD context :ctx PROD # Switch to the NONPROD context :ctx NONPROD </code></pre> <p>A full list of commands and keybindings are available <a href="https://k9scli.io/topics/commands/" rel=...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to install npm modules using a python script in the directory where my script is located<p>The file structure should look like :</p> <p><code>test.py</c...
<p>This worked for me! </p> <pre><code>import subprocess import os dir_path = os.path.dirname(os.path.realpath(__file__)) #holds the directory where python script is located os.chdir(dir_path) subprocess.check_call('npm init', shell=True) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Buttons received from Ajax are not clickable<p>I'm using the following code to receive some content from a page called filter.PHP. But the issue is the butto...
<p>You have to add the event listener from JavaScript, when you fetch the html from an ajax response.</p> <pre><code>document.querySelector('.buttonnew').addEventListener('click', () =&gt; { location.href=''}); </code></pre> <p>Or</p> <pre><code> document.querySelectorAll('.buttonnew').forEach(btn =&gt; { btn.addEv...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fetch() is not working with async await while if I am working without async await it is working fine<pre><code>import classes from &quot;./LoginForm.module.c...
<p><code>response.json()</code> also returns a promise, you have to <code>await</code> for it as well</p> <pre><code>const data = await response.json(); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to connect my facebook page with my app<p>I am having a trouble. I am currently in my final yrs in college and we are developing an application using flu...
<p>for the website, you need same database which is being used on the web. For example, if you add some information using your app, it will make changes in your website also. About the Facebook part, Can you be more specific what are you trying to do with Facebook page?</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I make a NavTypeSerializer for a lambda for Compose Destinations?<p>I am trying to pass a simple lambda of type <code>(Item) -&gt; Boolean</code> as a...
<p>Trying to serialize lambdas will never work. Even if it did, the one who is listening for this callback to be called would not get notified because in the end, the callback instance passed to the destination would not be the same.</p> <p>You can share the same view model on both destinations. For that, you can defin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What type is a function that returns an enum member?<p>I don't know what would be the type of the function that returns an enum member. Here is my code so fa...
<p>The type you're looking for is <code>() =&gt; Color</code>, i.e. a no-argument function that returns a <code>Color</code> enum value:</p> <pre><code>interface Letter { character: string, color: () =&gt; Color } enum Color { Green, Yellow, Grey } const letter: Letter = { character: '', c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Group values into bins and then plot using plotly (R, Dplyr)<p>I have a dataset, df, which is telling us that X is the frequency and Category is the 'bin in...
<p>So based on what you are doing, I did not filter for any kind of data. But using <code>tidyverse</code> package, here is what I would do:</p> <pre><code>dfs %&gt;% mutate(newvar = as.numeric(gsub(" secs", "", Category)), new_cat = cut(newvar, breaks = seq(0,round(max(newvar), -1), by = 10), include.lowest = T)) %...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: create button 'copy' telegram api<p>I am creating a simple telegram bot. I send a message from the server: <a href="https://api.telegram.org/bot%7BAPI_KEY%7D...
<p>Even if you created a button in the chat with your bot, it's impossible to write a functionality that would copy given text to clipboard by clicking the button (see <a href="https://stackoverflow.com/questions/62678191/is-it-possible-in-telegram-to-copy-to-clipboard-by-button">Is it possible in Telegram to copy to c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter - FCM message not coming when app is closed<p>I have used FCM along with Flutter local notification for receiving messages. Flutter local notifiation...
<p>The error seems to occur when running the app in debug mode. If you stop the debugging, it is treated as force-stop or killing the application.</p> <p>Firebase documentation states that notification will not show on a force-stop or killed app unless the app is opened again.</p> <p>DOCUMENTATION: <a href="https://fir...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to empty/clear a react form fields after passing form data to fire base data base?<p>I am validating and passing react form data to fire base data base t...
<p>There's a <a href="https://react-hook-form.com/api/useform/reset" rel="nofollow noreferrer">reset</a> function inside <code>useForm</code> that you can use</p> <pre><code>function App() { const { register, handleSubmit, formState: { errors }, reset, } = useForm(); const onSubmit = async (data)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to access methods inside custom pivot model<p>I'm using Laravel 8, and having many-to-many relationship using custom pivot model as explained <a href="ht...
<p>Same as accessing any attribute from pivot.</p> <p><a href="https://laravel.com/docs/8.x/eloquent-relationships#retrieving-intermediate-table-columns" rel="nofollow noreferrer">https://laravel.com/docs/8.x/eloquent-relationships#retrieving-intermediate-table-columns</a></p> <pre><code>use App\Models\User; $user = ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to pass the auth code from popup window to parent window in angular?<p>I have created an angular component where users can log in to Instagram and get th...
<p>got the solution. <code>Windows.opener.postMessage</code> method helped me to pass the data from the popup window to the parent windows. Here is my solution down below. Hope that might help others.</p> <pre><code>ngOnInit(): void { this.activatedRoute.queryParamMap.subscribe(queryParam =&gt; { this.code = ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is showing the payment pages using Webview solves the App-store's In-App Purchase issue?<p>I got a new message from Appstore for my new app submission:</p> ...
<p>If you offer <strong>digital goods &amp; services within your app, you must use in-app purchases</strong> and give Apple their 30% cut.</p> <p>You cannot use any other method, no matter which technology (webview, link, etc.) or provider (Stripe, PayPal etc.) you are using.</p> <p>If you offer <strong>non-digital g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Group By row format / regex in SQL?<p>Let's say I have different formats of phone numbers stored as strings in my database:</p> <pre><code>Phone (812)...
<p>If I understand correctly, you are looking for distinct patterns of phone numbers. If so, <code>translate()</code> would be a good option</p> <pre><code>Declare @YourTable Table ([Phone] varchar(50)) Insert Into @YourTable Values ('(812) 283-2013') ,('701 857 7000') ,('207-623-0389') ,('5592369797') Select di...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I check length of the uI, Cypress test is yielding only 1<p>The below(highlight in green) is a dropdown, it has about 10 options. When I try <code>cy...
<p>The <code>&lt;ul&gt;</code> is parent of the 10 <code>&lt;li&gt;</code> underneath.</p> <p>If you select <code>ul</code>, use <code>children()</code> to count the options.</p> <pre class="lang-js prettyprint-override"><code>cy.get('ul[data-cy=&quot;offerBreakUpJobTitleAndIdFilterComboboxOptions&quot;]') .children(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Your report has an error and couldn 't be processed!\ Try to output the command using the function `output();` and run it manually in the console<p><strong>I...
<p>Did you try the output() command as mentioned in the message?</p> <p>You can try something easy as this and check the output of it:</p> <pre><code>$x = $jasper-&gt;process( $input, $output, $options )-&gt;output(); print_r($x); exit(1);//just to avoid get...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Understanding intel SUB instruction<p>I am currently trying to deepen my understanding of assembly code and I am stuck since weeks with a seemingly simple in...
<p>You can think of it in two different ways, and they both give the same result.</p> <p>As unsigned, the result is computed mod 256. So <code>0x00 – 0xaa mod 0x100 = 0x56</code>.</p> <p>As signed, <code>0xaa</code> represents <code>–0x56</code>. (Not <code>–0x2a</code> as in the question.) So, <code>0x00 – (–0x56) =...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: unban based on reason discord.py<p>so my discord server got hacked and everyone got banned with &quot;gotcha&quot; reason is there a way to make this code re...
<p>i solved it</p> <pre><code>import discord from discord.ext import commands intents = discord.Intents.default() intents.members = True bot = commands.Bot(command_prefix = '!', intents=intents) @bot.event async def on_ready(): print('ready to go') @bot.command() async def help(ctx): await ctx.send(&quot;!s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can't access sharepoint web services using Integrated Windows authentication after activating Trusted Identity Provieder / SAML Provider<p>I have a SharePoin...
<p>As a workaround you can extend web application and on the new site use only windows authentication.</p> <p><a href="https://docs.microsoft.com/en-us/SharePoint/administration/extend-a-claims-based-web-application" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/SharePoint/administration/extend-a-claims-ba...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python framework Kivy didn't notice the file with extension .kv<p>I have a problem with Kivy framework. I defined parent and child classes in file main.py. A...
<p>The problem is that the line:</p> <pre><code>obj = ObjectProperty(Child()) </code></pre> <p>is evaluated before the <code>my.kv</code> file is loaded, so at that point there is no rule to add a <code>Label</code> and a <code>Button</code> to the <code>Child</code> instance. That results in a <code>Child</code> ins...
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 method from a different script? (Python)<p>I have three scripts:</p> <blockquote> <p>main.py</p> </blockquote> <blockquote> <p>encrypt.py</p>...
<p>If your goal is to simply run them like scripts then you could use the <code>subprocess</code> module.</p> <pre class="lang-py prettyprint-override"><code>import subprocess PATH = r&quot;/path/to/scripts&quot; + &quot;/&quot; def encryption(): subprocess.Popen(['python3', PATH + 'encrypt.py']) def decryption()...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I create a "product queue" for a subscription service?<p>I'm trying to create a &quot;product queue&quot; for a monthly subscription service.</p> <ul...
<p>What you describe is basically correct. The one thing that you are missing for the &quot;queue&quot; to work are &quot;cron jobs&quot;. Cron jobs allow you to schedule a script in a predefined interval.</p> <p>In a most basic scenario, you want to write a script / entry point for your application that will process a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What to use in place of union in above query i wrote or more optimize query then my given query without union and union all<p>I am counting the birthdays , s...
<p>Another approach is to create a CTE with all available <code>ranking</code> values ​​and use <code>CROSS APPLY</code> for it, as shown below.</p> <pre><code>WITH ranks(ranking) AS ( SELECT * FROM (VALUES (1), (2), (3)) v(r) ) SELECT r.ranking, CASE WHEN r.ranking = 1 THEN 'Birthdays' WHEN r.ran...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript: Open new window and send the result back to parent window<p>On many pages you can log in with google. When you click the button, a new window is ...
<p>There is a relationship between the browser windows that is maintained. In the child window (the popup), for instance, you can send a message to the window that created it</p> <pre><code>window.opener.postMessage("a message"); </code></pre> <p>How this is implemented can vary, but the basic answer to your question...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: moment.js being added to array<p>I'm trying to rack my head on why the object contents of my variable is being added to my array instead of an actual Date ob...
<p>It's because your first value is a moment object. you need to convert this to timestamp</p> <pre><code>let apptStartArr = [formattedDate] </code></pre> <p>SHould be </p> <pre><code>let apptStartArr = [formattedDate.toDate().getTime()] </code></pre> <p>And if you want Date objects instead of timestamp number, don...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ionic 4: ion-chip activatable / clickable by default; how to turn off?<p>Using Ionic 4 with React, I have the following code:</p> <pre class="lang-js pretty...
<p>If you look at the <a href="https://github.com/ionic-team/ionic/blob/master/core/src/components/chip/chip.tsx" rel="nofollow noreferrer">implemetation</a> of the <code>ion-chip</code> Webcomponent, you can see that the <code>ion-activatable</code> class is added by default (you can only modify the class and the even...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find all external relationships in an OOXML/Excel spreadsheet<p>I am trying to register all external relationships in a OOXML spreadsheet. The code below pro...
<p><strong>TL;DR</strong>: You're traversing the OOXML Spreadsheet document structure incorrectly.</p> <p>The <em>quick-fix</em> is to use the built-in <code>GetAllParts()</code> extension method, then for each <code>OpenXmlPart</code> entry inspect its <code>ExternalRelationships</code> property (it's a lazily-evaluat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the being called here: return _()<p>I have come across this code in MoreLinq, in file <code>Batch.cs</code> (<a href="https://github.com/morelinq/Mor...
<p>The <code>_()</code> here is a call to the <a href="https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/local-functions" rel="noreferrer">local function</a> called <code>_</code>. Unusual, but valid.</p> <p>A local function is broadly like a regular method, except that it can only b...