input_text_instruct
stringlengths
288
45.8k
output_text
stringlengths
37
33.2k
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to put FTP file into a certain map<pre class="lang-py prettyprint-override"><code>remotefile=f'{fileName}' with open(remotefile, &quot;rb&quot;) as file:...
<p>If you mean to put in folder/directory then you can do one of two things</p> <ol> <li>change remote folder before <code>STOR</code></li> </ol> <pre><code>localfile = 'test/input.txt' remotefile = 'output.txt' ftp.cwd('folder1/folder2') # go to some folder with open(localfile, 'rb') as file_handler: ftp.stor...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to silently install a certificate on Linux using .NET<p>I have a .NET exe that when I run(on windows), asks to install a certificate into the trusted roo...
<p>That prompt is a feature of the Windows OS, not of .NET. It does not exist on Linux.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set the date format on wx.adv.DatePickerCtrl<p>I am using the wxPython wx.adv.DatePickerCtrl and it presents the dates as &quot;mm dd yyyy&quot;. I wa...
<p>As time has progressed I have realised that there is a distinct need for a more flexible version of this control. I have written a control that allows the date to picked from a dialog that uses a wx.adv.CalendarCtrl.</p> <p>The initial value of the date in the control can be set using the <em>date</em> property and ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert an absolute path to a relative one?<p>Let's say I have a base path <code>D:\files</code> and an absolute path <code>D:files\images\1.jpg</code...
<p>Using <a href="https://en.cppreference.com/w/cpp/filesystem/relative" rel="noreferrer"><code>std::filesystem::relative</code></a> (C++17 needed)</p> <pre class="lang-cpp prettyprint-override"><code>#include &lt;filesystem&gt; #include &lt;iostream&gt; int main() { std::cout &lt;&lt; std::filesystem::relative(&q...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: GitHub Action to auto update Go import paths<p>Is there a GitHub action to auto-open a PR with Go import paths updated to a new major version?</p> <p>For exa...
<p>I wrote some custom logic for this: <a href="https://github.com/osmosis-labs/osmosis/pull/2094" rel="nofollow noreferrer">https://github.com/osmosis-labs/osmosis/pull/2094</a></p> <p>Basically, it has a bash script that goes over all files and increases the major version.</p> <p>A custom GA workflow then runs the sc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Apache vhost : redirect repeating pattern does not work using mod-rewrite<p>I need to prevent a repetition that may occur on my website with Apache ModSec : ...
<p>You can use this link to redirect multiple repetitions of <code>/forbidden</code>:</p> <pre class="lang-bash prettyprint-override"><code>RewriteRule ^/?(forbidden/){2,}(index\.html)$ /$1$2 [L,NC,NE,R=301] </code></pre> <p>Note that you don't match query string in <code>RewriteRule</code> but in this case you don't e...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL how to express "not equal to and not less than"<p>I am trying to use a comparison operator in SQL to say where <strong>not</strong> equal to or less than...
<p>You can simply use:</p> <pre><code> WHERE amount &gt; 0 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there any significant difference between using SELECT ... FROM ... INTO syntax instead of the standard SELECT ... INTO ... FROM?<p>I was creating a functi...
<p>There is no difference. From <a href="https://www.postgresql.org/docs/current/plpgsql-statements.html#PLPGSQL-STATEMENTS-SQL-ONEROW" rel="nofollow noreferrer">the docs</a> of pl/pgsql:</p> <blockquote> <p>The <code>INTO</code> clause can appear almost anywhere in the SQL command. Customarily it is written either jus...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TypeORM custom repository not overriding createQueryBuilder<p>I am trying to implement database i18n for TypeORM. I have been able to do that theoratically. ...
<p>Finally got it! I need to override the <code>createQueryBuilder</code> method in entity manager instead of in the repository.</p> <pre class="lang-js prettyprint-override"><code>export function TranslatableRepository(manager: EntityManager) { manager.createQueryBuilder = function createQueryBuilder&lt;Entity&gt;( ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Permission denied to run shell script by subprocess.call<p>I wrote a shell script using python and it successfully run by command <code>bash download_R1.sh</...
<p>That's the normal way the shell behaves.</p> <p>You can not directly run a program or script if it not has execution privileges (<code>+x</code>)</p> <p>But, you can instruct other program <code>bash</code>, <code>python</code> or whatever to run a file even if not has <code>+x</code></p> <p><strong>foo.sh</strong><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using member of to filter in many to many relationship<p>I have this <strong>problem</strong>, to begin I have this example class</p> <pre><code>@Entity publ...
<p>Finally, I have done a new query using a simple join, the query would be:</p> <pre class="lang-sql prettyprint-override"><code>select distinct entity from A entity join entity.b other where other.id = :id; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Axios error handler message with async/await in the react<p>My app requests axios from the react to the nestjs server, and the code is here.</p> <pre><code>c...
<p>If the server send the array message, you should be able to get them in the response object in your error, as below:</p> <pre class="lang-js prettyprint-override"><code>async function loginEvent() { try { const res = await (await axios.post('users/login')).data // your code } catch (e: any) { const s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: simple method to print star pyramid with minimal code in dart?<p>What is the simplest method to print star pyramid with minimal code? It shouldn't use more t...
<pre><code> const int row = 5; for(int i = 0;i&lt;row;i++){ stdout.writeln(&quot; &quot;*(row-i)+&quot;* &quot;*i); } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AWS Serverless Microservice Communication<p>For a project I'm building multiple AWS Serverless microservices and I'm wondering about the best option for comm...
<p><strong>Option 1: lambda calling lambda</strong></p> <p>You Invoke a lambda from another lambda architecture using boto3 (python) or the aws-sdk (javascript/other langs.)</p> <p>For that you will need to invoke lambda by using the ARN/Function name and setup IAM permissions.</p> <p>Pros:</p> <ul> <li>Very simple to ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can worksheet filters only be used in WHERE or GROUP BY Clause in Snow?flake<p>I would like to use the value selected in a filter as a returned column.</p> <...
<p>You may need to declare a local variable, assign it the value from :MyFilter, and then use in your query. See the following reference: <a href="https://docs.snowflake.com/en/developer-guide/snowflake-scripting/variables.html#working-with-variables" rel="nofollow noreferrer">https://docs.snowflake.com/en/developer-gu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to see objects of manytomany field by related_name in admin page?<p>I have these two models:</p> <pre class="lang-py prettyprint-override"><code>class Us...
<p>You can define a callable on your <code>ModelAdmin</code> class and add it to <a href="https://docs.djangoproject.com/en/4.0/ref/contrib/admin/#django.contrib.admin.ModelAdmin.list_display" rel="nofollow noreferrer"><code>list_display</code></a>. To make the courses editable on an user's page use sub classes of <a h...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What's an umbrella term for things like class, struct, interface and enum?<p>I know what I typed are keywords, but that umbrella term would also contain thin...
<p>I just found out, the Microsoft documentation calls them &quot;categories of types&quot; here:</p> <p><a href="https://docs.microsoft.com/en-us/dotnet/standard/base-types/common-type-system?redirectedfrom=MSDN#types_in_the_net_framework" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/dotnet/standard/base...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: show text as it is entered in input box<p>I have created a Q&amp;A website in Django I want to print text in the same format as it entered</p> <pre><code>Thi...
<p>The documentation for <a href="https://docs.djangoproject.com/en/4.0/ref/templates/builtins/#truncatewords" rel="nofollow noreferrer">truncatewords</a> mentions:</p> <blockquote> <p>Newlines within the string will be removed.</p> </blockquote> <p>Hence you need to use the <code>linebreaks</code> filter first and the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Basic authentication using Fetch API in JS<p>I'm working on a script featured in an HTML document to display a map of the Boston area using leaftlet, and I'd...
<blockquote> <pre><code>mode: &quot;no-cors&quot; </code></pre> </blockquote> <p>Setting the mode to <code>&quot;no-cors&quot;</code> causes any attempt to do something that requires CORS permission to silently fail (instead of throwing an exception).</p> <p>Setting <code>Authorization</code> and <code>Content-Type</co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to pass an expression to the value attribute of an input tag?<p>I tried the following, but the input field is blank.</p> <pre><code>&lt;div cl...
<p>as I understood you want to set a default value to a FormControl value, I suppose your code is like this</p> <pre><code> constructor(private fb: FormBuilder) { } public form: FormGroup = this.fb.group({ firstname: ['This is the default value', // Default value [ Validators.required //...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Split string based on a key word in r programming, keyword= BAS, Getting duplicate results. especially FRM_id = 1014<pre><code>if (!require(&quot;librarian&q...
<p>Are you looking for something like this?</p> <pre><code>library(tidyverse) Samp_Data %&gt;% filter(grepl(&quot; BAS &quot;,FRM_Name)) %&gt;% separate_rows(FRM_Name, sep = &quot; BAS &quot;) %&gt;% mutate(FRM_Name = trimws(FRM_Name)) </code></pre> <p><strong>Output</strong></p> <pre><code> FRM_ID FRM_Name...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: click button to toggle show one component and hide another component in reactjs<p>I have two separate button like grid and list button:</p> <pre><code>&lt;bu...
<p>You can display different components depending on the value of <code>cName</code>.</p> <pre><code>&lt;div className=&quot;row mt-4 book-div&quot;&gt; &lt;div className={cName}&gt; { cName === 'jsGridView' ? &lt;BooksGridCard/&gt; : &lt;BooksListCard/&gt; } &lt;/div&gt; &lt;/div&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regex match for colon separated string with double quotes and GUID using C#<p>I am trying to find a regex match for possible app IDs such as:</p> <pre><code>...
<p>using @ string, you need to escape &quot; using &quot;&quot;.</p> <pre><code>Regex appIdRegex = new Regex(@&quot;\&quot;&quot;appid\&quot;&quot;\s*:\s*\&quot;&quot;([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\&quot;&quot;$&quot;, RegexOptions.IgnoreCase); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular doesn't update object array after object is pushed<p>I am currently working on project where I use angular-google-map (agm), and I use different poly...
<h2><a href="https://stackblitz.com/edit/angular-ivy-kdyhuw?file=src/app/paths-local-storage.service.ts" rel="nofollow noreferrer">Stackblitz</a></h2> <p>As discussed in comments, if you want persistent change to data then you'll need to get data from persistent source like local storage or via server.</p> <p>I recomme...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python pandas sort columns in csv by time with an interval of 5 minutes without rounding and sum<p>A csv file with 600 thousand lines looks something like th...
<p>You could use the <code>dt.ceil()</code> function to round up to the next 5 minute interval and then use a groupby to sum matching rows:</p> <pre class="lang-py prettyprint-override"><code>import pandas as pd df = pd.read_csv('input.csv', usecols=[&quot;Time&quot;, 'value'], parse_dates=[0]) df['Ceil'] = df['T...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Method Illuminate\Database\Schema\Blueprint::unsignedBidInteger does not exist<pre><code>PS C:\xampp\htdocs\learning\laragon\lavue&gt; php artisan migrate Mi...
<p>There is a typo in your migration file on 'transaction_id' declaration.</p> <p>Your migration file should be like this. Check the line with the comment.</p> <pre><code>&lt;?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Disable table scrolling in jupyter cell<p>I am currently using a library in <code>jupyter</code> notebook which generates a scrollable HTML table. Is there a...
<p>You can set custom CSS for the library from python code:</p> <pre><code>meterstick.confidence_interval_display.CSS = ( &quot;&quot;&quot; #meterstick-container { max-height: 100% !important; } &quot;&quot;&quot; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to query group memberships of an azure devops user from an extension's backend?<p>I am working on an azure devops extension that adds a new hub to the UI...
<p><em>I finally figured it out and leaving it here for others' benefit in future.</em></p> <p><strong>TL;DR:</strong> I needed to add <em>vso.graph</em> scope to my extension's manifest's scope property.</p> <p>The <a href="https://docs.microsoft.com/en-us/rest/api/azure/devops/graph/memberships/list?view=azure-devops...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to download "cytofkit" R-package<p>I am trying to install &quot;cytofkit&quot; R-package with reference from <a href="https://bioconductor.riken.jp/pa...
<p>As per the answer available here: <a href="https://support.bioconductor.org/p/128865/" rel="nofollow noreferrer">https://support.bioconductor.org/p/128865/</a> Cytofkit was removed from Bioconductor in version 3.9 <a href="http://bioconductor.org/about/removed-packages/" rel="nofollow noreferrer">http://bioconductor...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why System.Delegate can not be used as event?<h1>Main Question</h1> <pre><code>event System.Delegate d; </code></pre> <p>Code above will raise error:</p> <bl...
<p><code>System.Delegate</code> is a class, not a delegate.</p> <p>An event is a member of a type. All members must have their own data type specified. You can use <code>Object</code> for fields and the like if you want to be able to refer to any type, or you can use a base type to refer to any derived type. Delegate t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Boolean in Racket<p>I run the test and there is always one test cannot pass. I tried every permutation. Is there an easier way like maybe try not returning a...
<p>That <code>same?</code> definition is wrong. To pass all test cases, you can use <a href="https://docs.racket-lang.org/reference/Equality.html#%28def._%28%28quote._%7E23%7E25kernel%29._equal%7E3f%29%29" rel="nofollow noreferrer"><code>equal?</code></a>:</p> <pre><code>(define same? equal?) ; &lt;-- some languages, e...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot query the value of property 'javaLauncher' because it has no value available<p>Hello Guys I am new to spring native.When I try <code>./gradlew compile...
<p>Guys the error was caused by an unset JAVA_HOME variable.I used to think that <code>archlinux-java set</code> does that for you by default.</p> <p>Thanks <em><a href="https://stackoverflow.com/users/2591131/eric">Eric</a></em> for the info.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL Query Order by intercalated<p>First of all, thanks for your time!</p> <p>I have a recurrence pattern mapped in my database (e.g. google calendar events),...
<p>If you want to &quot;group&quot; results by day while seeing all rows, add the date as part of the <code>order by</code>.</p> <pre><code>order by startsAt::date, distance, startsAt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Compile Wireshark with man pages<p>I am trying to compile wireshark 3.6.6 from source on a rhel8 server; but, can not seem to get the man pages installed. I...
<p>The problem was that wireshark-3.6 requires <code>asciidoctor</code> to create the man pages. RHEL 8 ships with <code>asciidoc</code>. Installing <code>rubygem-asciidoctor</code> and its dependancies from the epel repository fixes the problem.</p>
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 scale labels in matplotlibs contourf method?<p>I have created the image</p> <p><a href="https://i.stack.imgur.com/BvHot.png" rel="nofoll...
<p>The <code>ticks</code> parameter of <a href="https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.colorbar.html" rel="nofollow noreferrer"><code>colorbar</code></a> accepts a list of ticks, or a <code>Locator</code> such as <a href="https://matplotlib.org/stable/api/ticker_api.html#matplotlib.ticker.MultipleL...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to find a value that doesn't exist in one table through another table in SQL<p><strong>Publisher Table</strong> <a href="https://i.stack.imgur.com/npA5s....
<p>You have to use condition <code>PublisherID IS NOT NULL</code> inside sub query. Your <code>NULL</code> record was returning <code>false</code> for all rows.</p> <pre><code>SELECT PublisherID FROM Publisher WHERE PublisherID NOT IN (SELECT PublisherID FROM Book WHERE PublisherID IS NOT NULL); </code></pre> <hr />...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Format negative number C#<p>I have a variable that when it is smaller that zero it formats the number to -5,650 allowing AllowThousands using comma as separa...
<p>Besides going with the &quot;nuclear&quot; option of <code>NumberStyles.Any</code>, you can combine <code>NumberStyles</code> entries. Good news is that you already know which ones to use.</p> <pre><code>int.Parse(&quot;-5,650&quot;, NumberStyles.AllowThousands | NumberStyles.AllowLeadingSign); // gives &quot;-5650&...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I spawn repeatedly object whot 0.1 seconds between them?<p>I want to spawn a 100 object whit 0.1 seconds in between. I have this but they still spawn ...
<p>Use an <code>IEnumerator</code>. I put an example to solve the problem:</p> <pre class="lang-cs prettyprint-override"><code>public void Start() =&gt; StartCoroutine(SpawnObject(100, .1f)); public IEnumerator SpawnObject(int count, float intervalTime) { for (var i = 0; i &lt; count; i++) { Instantiat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regex for US cell phone number with all zeros not being allowed<p>I have a cellphone field that is being validated as such-</p> <pre><code>[Required(ErrorMes...
<p>You can use</p> <pre class="lang-none prettyprint-override"><code>^(?!(?:\D*0)+\D*$)\(?([0-9]{3})\)?[-. ]?[0-9]{3}[-. ]?[0-9]{4}$ </code></pre> <p>Here,</p> <ul> <li><code>^</code> - start of string</li> <li><code>(?!(?:\D*0)+\D*$)</code> - no only one or more <code>0</code> digits in the string</li> <li><code>\(?</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I put `must_not` under `filter` in Elasticsearch?<p>I'd like to use <code>not equal</code> in my filter but it doesn't work <code>[13:24] [bool] fail...
<p>May be one more bool needed inside the filter ?</p> <pre class="lang-json prettyprint-override"><code>/_search { &quot;query&quot;: { &quot;bool&quot;: { &quot;filter&quot;: { &quot;bool&quot;: { &quot;must&quot;: [ { &quot;term&quot;: { &quot;type&quot;: &qu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Simple CompletableFuture.supplyAsync() leads to IllegalMonitorStateException error<p>I'm trying this in java8:</p> <pre><code> public static void main(Strin...
<p>The exception whose stack trace is shown is thrown by <code>future.wait()</code> and is not related to the <code>error</code> argument of the second <code>CompleableFuture</code>. It occurs because <code>wait()</code> requires the thread invoking it to be holding the object's monitor. See <a href="https://docs.oracl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Nested dictionary to strings with numbering<p>I'd like to create strings with numbering (&quot;1. Comment 1&quot;, &quot;2. Comment 2&quot;,...) from a neste...
<p>Not sure if it's what you're looking for nor if it's the best way to implement it but it works:</p> <pre><code>def format_comments(nested_comments, prefix): for i, comment in enumerate(nested_comments): s_prefix = prefix + f'{i + 1}.' print(s_prefix, comment.get('comment', {}).get('text') or comment['text'...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AWS EventBridge Rule pattern "anything-but" with "prefix"<p>I'm trying to setup an AWS EventBridge rule that will filter all Okta user events with rawUserAge...
<p>You can use this pattern:</p> <pre><code>{ &quot;detail&quot;: { &quot;eventType&quot;: [{ &quot;prefix&quot;: &quot;user.session.start&quot; }], &quot;client&quot;: { &quot;userAgent&quot;: { &quot;rawUserAgent&quot;: [{ &quot;anything-but&quot;: { &quot;prefi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Implementing both IDisposable and IAsyncDisposable<p>Say I have a non-sealed class that does not deal with any unmanaged resources. I need to make a single a...
<p><strong>Example to those who still hesitate to implement both:</strong></p> <pre><code>internal class Program { static void Main(string[] args) { foreach (var a in new B()){} //IAsyncDisposable is not called - you leaking resources. //No deadlocks in UI, no warning in compilation, no...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to skip sorted part of an array in a sorting program if my array is already partly sorted<p>So we were taught bubble sort in our class and I have this co...
<p>I was able to solve this using 2 different subroutines, one is for the first check which goes through the array and checks how many elements at the end do not need further sorting and then I used another subroutine for the rest of the bubble sort runs</p> <pre><code> !This is the first run of bubble sort to know the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I am not able to send JWT token in headers in react.js<p>I am trying to send the <code>JWT</code> token in the headers in the <code>Axios</code> API call but...
<p>I think your problem is that you have <code>headers</code> twice:</p> <pre><code>const apiHeaders = { headers: { ... } } </code></pre> <p>So apiHeaders is an object with a <code>headers</code> field.</p> <p>When you use that in the <code>get</code> call, that gets expanded to what is effectively:</p> <pre><code>cons...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a way to generate an object from another object by taking all its properties with except of one?<p>Having the initial object of this shape:</p> <pre...
<p>Use <code>Object.entries()</code> to convert the object to an array. Use <code>filter()</code> to skip that element of the array. Use <code>Object.fromEntries()</code> to convert that result back to an object.</p> <pre><code>const result = Object.fromEntries(Object.entries(initial).filter(([key, value]) =&gt; key !=...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python - KeyError: 'dpi'<p>I have a python script that lists the metadata of photos inside a directory. It works however it is not fully working. When it run...
<p>You could use <code>try</code> and <code>except</code> Just reuse your code:</p> <pre><code>for file in os.listdir(rootdir): try: # read the image data using PIL image = Image.open(os.path.join(rootdir,file)) # extract other basic metadata info_dict = { &quot;Filename&quot;: os.path.basename...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Access React context in an API service<p>In my React application I use the <a href="https://reactjs.org/docs/context.html" rel="nofollow noreferrer">context ...
<p>The <a href="https://reactjs.org/docs/hooks-rules.html#only-call-hooks-from-react-functions" rel="nofollow noreferrer">React documentation</a> says that you cannot call hooks inside JavaScript functions.</p> <p>What can you do?</p> <p>Use custom hooks. rename functions as <code>useCreateProject</code> and return you...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Retrieve Path by Wildcard in custom taget CmakeLists.txt<p>I'm trying to create a custom target in a CmakeList.txt which I'm planning to execute during the b...
<p>If you want to manipulate created library after it is built, you can use <code>add_custom_command</code> with generator expressions:</p> <pre><code>#create library add_library(my_lib STATIC my_lib.cpp) # list the contents of a newly created library add_custom_command( TARGET my_lib POST_BUILD COMMAND a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Oracle: Taking columns from rows and putting them side by side<p>I'm having trouble figuring out how to do something in Oracle. I have this table:</p> <pre>...
<p>You can use <code>PIVOT</code>:</p> <pre class="lang-sql prettyprint-override"><code>SELECT id, &quot;1_CODE&quot; AS code_1, &quot;1_GIFT&quot; AS gift_1, &quot;2_CODE&quot; AS code_2, &quot;2_GIFT&quot; AS gift_2, &quot;3_CODE&quot; AS code_3, &quot;3_GIFT&quot; AS gift_3 ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pass same keyword argument to a function twice<p>This is two questions, and I'd be happy with either being answered (unless one method is preferred to anothe...
<p>On Python 3.5 and up, you can unpack <code>my_dict</code> into a new dict and override the <code>'a'</code> entry:</p> <pre><code>my_func(**{**my_dict, 'a': 'Goodbye'}) </code></pre> <p>On Python 3.9 and up, you can use the <code>|</code> operator to create a new dict by merging entries from two dicts. Values for du...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Selection of words from the object<p>I have a variable that contains the following values $a</p> <pre><code>$a Server Work TS,,login,A+,,,0,,Aplus,Z%@#$!dasg...
<p>You can simply use a loop:</p> <pre><code>foreach($line in $a){ $username1 = $line -split ',' | Select -Last 3 | select -SkipLast 2 $password1 = $line -split ',' | Select -Last 2 | select -SkipLast 1 | ConvertTo-SecureString -AsPlainText -Force New-LocalUser $username -Password $password -AccountNeverExpires -Passwo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Phaser 3 extract key out from texture<p><a href="https://i.stack.imgur.com/Qpdso.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Qpdso.png...
<p>If you want to get the <strong>key</strong> of an <strong>image</strong>, in an event-handler for example, you can pass the specific <strong><em>button/image</em></strong> as the scope of the event function <em>(link to <a href="https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html#on__anchor...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I do this reduction?<p>I'm stuck on how to do this reduction, I have read this <a href="https://stackoverflow.com/questions/34140819/lambda-calculus-r...
<p><strong>applicative order</strong></p> <p>β y := z</p> <pre class="lang-none prettyprint-override"><code>(λx.yx)((λy.λt.yt)zx) = = = (λx.yx)((λt.zt)x) </code></pre> <p>β t := x</p> <pre class="lang-none prettyprint-override"><code>(λx.yx)((λt.zt)x) = = = (λx.yx)(zx) </code></pre> <p>β x :...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ImportError: cannot import name 're_path' from 'django.conf.urls'<p>I'm following a Django tutorial and trying to update a <code>urls.py</code> file with the...
<p>I needed to change</p> <pre class="lang-py prettyprint-override"><code>from django.conf.urls import re_path, include </code></pre> <p>to:</p> <pre class="lang-py prettyprint-override"><code>from django.conf.urls import include from django.urls import re_path </code></pre> <p>Now the error has stopped. (<a href="http...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I run commands of a python script from OS process sampler jmeter?<p>I have main.py which runs certain functions... and I want to test in jmeter. I've...
<p>Given you have <code>main.py</code> file with the following code:</p> <pre><code>import sys def hello(): print('Hello, ' + sys.argv[1]) hello() </code></pre> <p>You can run it using JMeter's <a href="https://jmeter.apache.org/usermanual/component_reference.html#OS_Process_Sampler" rel="nofollow noreferrer">O...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting 403 while i try to access Cloudrun URL through browser<p>I am trying to setup a python app on GCP Cloudrun I need only authenticated users to be able...
<p>After trying out IAP as said by @guillaumeblaquiere i was able to fix this issue. Thanks a lot as there is ver less documentation on how to fix this i have recorded steps that i implemented to fix this issue :</p> <p><a href="https://medium.com/@sidharthvijayakumar7/deploying-and-accessing-authenticated-cloud-run-se...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find the specific part of code used to draw a background line<p>I'm trying to edit the Creative Common's released <a href="https://html5up.net/paradigm-shift...
<p>Look at <code>#wrapper::before</code>. It has an inline background svg image defined in the <code>background-image</code> rule. See <code>main.css:3224</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PowerShell Script - Export Data With For Cycle<p>Good evening guys,</p> <p>I need your help because I'm not getting the expected result. I need to create a p...
<p>Well, let's start with the logic behind a <code>For</code> loop.</p> <pre><code>For (&lt;define a start point&gt;; &lt;define a stop condition&gt;; &lt;define how to iterate&gt;){&lt;loop content&gt;} </code></pre> <p>Right now you have:</p> <pre><code>For ($i=101; $i -le 70; $i++) </code></pre> <p>So it starts with...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Like queries in MongoDb Using PHP<p>I want to use like queries for search in my app using MongoDb With PHP but I did not get the proper result.</p> <p>Code:<...
<p>I got an answer and I try this and it's work perfect :</p> <p>$query = array(array(&quot;first_name&quot; =&gt; new MongoDB\BSON\Regex(&quot;$search_text&quot;, 'i')))</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to remove duplicate value from nested list?<p>Here is my list:</p> <pre><code>lists=[[2], [3], [4, 5, 6], [7], [8], [9], [9, 10, 11], [10]] </code></pre>...
<p>Here's my approach.</p> <ol> <li>We'll use a set (call this <code>a</code>) to store all the elements that appear in lists length longer than 1.</li> <li>We'll go through the single element lists. If it appears in the set, we shouldn't add it. Otherwise, add it.</li> </ol> <p>Below is an implementation (which should...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use Spacy NER to identify person and make person one word?<p>I want to use Spacy NER to identify the PERSON and make it one word.</p> <p>My dataset looks lik...
<p>If you use <code>Spacy</code>, you code should be:</p> <pre><code>nlp = spacy.load('en_core_web_trf') def get_ner(txt): doc = nlp(txt) for ent in doc.ents: if ent.label_ == 'PERSON': s = ent.start_char e = ent.end_char txt = txt[:s] + txt[s:e+1].replace(' ', '_') ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add class to specific elements based on its content<p>I'm trying to add a specific class to a list item depending on its description. But when I add the scri...
<p>You don't need an <code>if</code> statement. Use the <a href="https://api.jquery.com/has/" rel="nofollow noreferrer"><code>:has()</code></a> selector to select the elements with this descendant.</p> <p><code>:contains()</code> is case-sensitive, so you need <code>Red</code> rather than <code>red</code> there.</p> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Insert and delete checkbox using MySQL and PHP. Use chcekbox like favorites button<p>I'm trying to use checkbox like favorites button where user can like som...
<p>Here's favorite button using html &amp; css. if have any query feel free to comment below <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>$(document).on('change','.cbx',function(){...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Block React Suspense to cover the whole page<p>I'm trying to use react lazy. I don't want the suspense to cover the page, but when it loads a component it sh...
<p>This probably happens because of your CSS.</p> <pre><code> position: absolute; width: 100%; height: 100%; </code></pre> <p>If you don't have a container (where your Suspense is positioned in) with <code>position: relative</code> you will end up with a ball absolute positioned and stretched over your entire scre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Modify variable in scope of a function in another function in the same scope (Python)<p>I have a variable <code>a</code> whose scope is in function <code>f()...
<p>You must replace <code>global</code> to <code>nonlocal</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I animate the color and width of a view?<p>I have a progress bar that I have written like such.</p> <pre><code>ZStack(alignment: .leading) { ...
<p>It is possible to do having each of progress view separate with own progress state that track changed value.</p> <p>Tested with Xcode 13.4 / iOS 15.5</p> <p><a href="https://i.stack.imgur.com/LtnNT.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LtnNT.gif" alt="demo" /></a></p> <p>Main part:</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Issue building docker image: Unable to locate package / command returns non-zero code 100<p>I am new to Docker. I used the following command to build an imag...
<p><code>apt-get update</code> caused the issue, it didn't work. I think your docker installation is somehow broken or you installed docker in a wrong way. Maybe you are on mac.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: return user to a view with success message after registration laravel 9.x<p>I am trying to return a view with a success message with a link to the login page...
<p>We can use session() global helper instead of Session:</p> <pre><code> // flash message create session()-&gt;flash('message', 'This is a message!'); session()-&gt;flash('alert-class', 'alert-danger'); </code></pre> <p>get flash message by key from your blade file</p> <pre><code>@if(session()-&gt;h...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to pull in additional private repositories in Amplify<p>Trying to use AWS Amplify to deploy a multi-repo <a href="https://wiki.dendron.so" rel="nofollow ...
<ol> <li>Create a custom <a href="https://docs.github.com/en/developers/overview/managing-deploy-keys" rel="nofollow noreferrer">deploy key</a> for the private repo in github <ul> <li>generate the key</li> </ul> <pre class="lang-sh prettyprint-override"><code>ssh-keygen -f deploy_key -N &quot;&quot; </code></pre> </li>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: looping and rendering the array of objects<p>I am trying to loop the data from json and display it it in table. I am having array of objects. I am having 3 v...
<p>It's easier to break it down into steps within the confines of the component. This example utilises three functions to find the headings, all the rows, and the cells for each of those rows.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="true"> <div class="snippet-code"> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I'm having issues with rendering depth<p>I'm using GLES2 to make graphics, because I intend to make a mobile application, so it has different things from cla...
<p>The <em>internalFormat</em>, <em>format</em> and <em>type</em> arguments of <a href="https://www.khronos.org/registry/OpenGL-Refpages/es3.0/html/glTexImage2D.xhtml" rel="nofollow noreferrer"><code>glTexImage2D</code></a> have to match and have follow special rules. If the <em>format</em> is <code>GL_DEPTH_COMPONENT<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Apply custom badge to specific product id on archive loop item WooCommerce<p>I'm trying to display a badge with the text &quot;Exclusive&quot; to a specific ...
<p><code>$product</code> is not passed to the callback function by default, at the <code>woocommerce_before_shop_loop_item</code> hook. That's why it doesn't work</p> <p>Use <code>global $product</code> instead</p> <p>So you get:</p> <pre class="lang-php prettyprint-override"><code>function action_woocommerce_before_sh...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is the Haskell operator * a combination of + operators?<p>How does Haskell's <code>*</code> work? Does it create a series of <code>+</code> operators, or doe...
<p>This is the <code>Num</code> type class</p> <pre><code>type Num :: Type -&gt; Constraint class Num a where (+) :: a -&gt; a -&gt; a (*) :: a -&gt; a -&gt; a -- .. I'm omitting the other methods </code></pre> <p>This is how <code>Num</code> is defined for <code>Int</code> (<a href="https://hackage.haskell.org/...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is awk so much faster than python in this case?<p>I have a clip list with 200,000 rows, each row is of the form</p> <pre><code>&lt;field 1&gt; &lt;field2...
<pre><code>import os import sys jump = open(sys.argv[1],&quot;r&quot;) clips = open(&quot;clips.list&quot;,&quot;w&quot;) text = jump.readlines() list_of_clips = str() for line in text: clip_to_add = line.split(&quot; &quot;)[0] list_of_clips = list_of_clips + clip_to_add +'\n' with open ('clips.list', ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I print text in Common Lisp so that I could format it with escape sequences (akin to display in Racket)?<p>Ho do I print a formatted output in Common ...
<p>The main issue here is how to get the proper sequence of characters. \33 is octal for ascii char 27 or #\Esc in Common Lisp.</p> <pre class="lang-lisp prettyprint-override"><code>(format t &quot;~C[3min italics~C[m~%&quot; #\Esc #\Esc) </code></pre> <p>would do what you want.</p> <p>But you could do better than that...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: COUNTIF in access Query<p>I have an Access Query that has computed columns as Rank1, Rank2, Rank3 which can be A, B or C as values.</p> <pre><code>Rank1 Ra...
<p>There is no function in MsAccess SQL that can count certain values across columns, like EXCEL's COUNTIF can. You can simulate it as:</p> <pre><code>IIF( IIF(Rank1='A',1,0)+IIF(Rank2='A',1,0)+IIF(Rank3='A',1,0) &lt; 3 , 'B', ... </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sorting a list of chromosomes in the correct order<p>A seemingly simple problem, but one that's proving a bit vexing. I have a list of chromosomes (there are...
<p>You can use <a href="https://pypi.org/project/natsort/" rel="noreferrer"><code>natsorted</code></a>, what you want is natural sorting after all ;)</p> <pre><code>l = ['chr11','chr14','chr16','chr13','chr4','chr13','chr2', 'chr1','chr2','chr3','chr14','chrX','chrY'] from natsort import natsorted out = natsorte...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Domain prefix expression in odoo<p>i am trying to modify a domain but i have first to understand the logic of this prefix expression :</p> <pre><code> &lt;fi...
<p>Yes, this is right:</p> <pre><code>[ A, '|', '|', '&amp;', B, C, '&amp;', D, E, F] </code></pre> <p>is the same than</p> <pre><code>[ '&amp;' A, [ '|', [ '|', ['&amp;', B, C,], ['&amp;', D, E,] ], ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Loop for Linked Lists<p>I really like this implementation of code but I don't want it to be hardcoded so can someone help me to make a loop for list = new_no...
<p>As you are trying to add new nodes to the tail of the list then in this case it will be reasonable to define a two-sided singly-linked list.</p> <p>For example</p> <pre><code>typedef struct node { int number; struct node *next; } node; typedef struct list { struct node *head; struct node *tail; } l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how do I stop a function to iterate through all items in a list<p>I am writing a simple word guessing game in python. Instead of using a list, I have all the...
<p>few ideas:</p> <ul> <li>make a loop over your &quot;tries&quot; - the player can play until that is 0</li> <li>the player has to provide the letter inside this loop</li> <li>check for the letter provided by the player using</li> </ul> <pre><code>if ans in word </code></pre> <p>Here is my suggestion:</p> <pre><code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pointer line trail<p>So I'm tyring to create a specific pointer trail effect. I'm pasting the code that I'm taking as an example below. The problem is that t...
<p>So I changed this in the given code:</p> <pre><code>x += (nextDot.x - dot.x) * **0.05**; y += (nextDot.y - dot.y) * **0.05**; </code></pre> <p>And added more dots, 80, to be precise.</p> <p>I also added a more smooth transition with this CSS rules</p> <pre><code>-webkit-transition:90ms; transition:90ms; pointer-even...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to sort an array of objects based on scores - Javascript<p>I have an array of objects that contain the data I want to sort (it has more properties), like...
<p>You can sort them like this: <a href="https://jsfiddle.net/Ldvja31t/1/" rel="nofollow noreferrer">https://jsfiddle.net/Ldvja31t/1/</a></p> <pre><code>const scores = { &quot;green&quot;: 5, &quot;red&quot;: 3, &quot;blue&quot;: 8 }; const myData = [ { &quot;data&quot;: { &quot;id&...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to concat/append multiple returned rows into only one row?<p>I have query which returns this result:</p> <pre><code>+------------------------------------...
<pre><code>SELECT GROUP_CONCAT(product_english ', ') FROM menuBreakfast WHERE breakfast_id = 'B1'; </code></pre> <p>Also you can apply concat</p> <pre><code>SELECT concat(product_english ) as product_english FROM menuBreakfast WHERE breakfast_id = 'B1'; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i get transactionHash by blockNumber?<p>How to get the transactionHash by blockNumber?</p> <p>I entered block.transactions.0.transactionHash but that...
<p>3 errors in your approach.</p> <p><strong>First</strong>, a <code>find()</code> on the blocks collection returns complete documents, not just the block documents (being the <code>block</code> field). So unmarshal results into a value of type that describes the complete documents, e.g.:</p> <pre><code>type Doc struct...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Obtain the interval of the thousandth of a number c#<p>I'm trying to get from a number the interval where this number is.</p> <p>For example my number is 10:...
<p>Thank @Juharr !</p> <pre><code>double n = 150; double test = Math.Floor(n / 100) * 100 + 1; double test2 = Math.Floor(n / 100) * 100 + 100; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Performing sql statement wit CTE using mysql c api<p>I'm changing sql server query into mysql syntax. I'm using mysql c api. If I try to execute my query in ...
<p>At the end, I was able to perform my query using a bash script and redirecting output in my c++ function:</p> <pre><code>#!/bin/bash mysql -u root -pPassword &lt;&lt;EOF USE mydb; SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ; WITH RECURSIVE CTE AS ( SELECT Id, ParentId, UserId, (select UserId from use...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to implement 3 nested subquery with 3 model in laravel?<p>I have 3 model <code>Transaction</code> , <code>Cart</code> , <code>Acceptedcart</code>.</p> <p...
<p>in Transaction.php your relationship to carts:</p> <pre><code>public function carts() { return $this-&gt;hasMany(Cart::class); } </code></pre> <p>in Cart.php you relationship to accepted carts:</p> <pre><code>public function accepted_carts() { return $this-&gt;hasMany(Acceptedcart::class); } </code></pre> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I limit my dygraph X axis to last 48 hours?<p>I have a dygraph from a data source with datetime. The graph shows the full 12 days of data, however I'...
<p>You could use <code>dyRangeSelector</code> with <code>dateWindow</code> parameter:</p> <pre><code># Generate data library(data.table) data = data.table(x=as.Date(&quot;2000-01-01&quot;)+0:10,y=0:10) # Draw graph library(dygraphs) enddate = max(data$x) startdate = enddate - 2 dygraph(data) %&gt;% dyRangeSelector(da...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Shiny: checkboxes in DT make row more changing height<p>I am implementing some checkboxes in R shiny DT, however for some reasons it seems like the checkbox ...
<p>You need to modify CSS of the app in order to achieve this. The quickest solution is to add a <code>style</code> tag to your UI:</p> <pre class="lang-r prettyprint-override"><code>ui &lt;- basicPage( tags$style(HTML(&quot; td &gt; div.form-group &gt; div.checkbox { margin: 0px; } ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firestore: Wherein custom object array?<p>im trying to make a sort of chat app with the following architecture:</p> <p><img src="https://i.stack.imgur.com/7M...
<p>An <a href="https://firebase.google.com/docs/firestore/query-data/queries#in_not-in_and_array-contains-any" rel="nofollow noreferrer"><code>in</code> clause</a> checks if a specific field is equal to one of a set of values, which doesn't apply here.</p> <p>You might be thinking of <code>array-contains</code>, but th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python: confused about results returned by panda .read_json using chunks<p>I am reading a large json file using the python Panda library and splitting it int...
<p><code>pandas.core.series.Series</code> have 2 methods which can help you,</p> <ol> <li><code>.iat(index)</code></li> <li><code>.iloc(index)</code></li> </ol> <p>So for example, you can get the last element of <code>location</code> as below,</p> <p><code> lastElement = location.iat[-1]</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to read only once from Android build in Accelerometer per second?<p>With help of sensorManager I am reading accelerometer reading. Currently slowest sett...
<p>Based on this <a href="https://stackoverflow.com/questions/10044158/what-is-the-difference-between-sensor-delay-normal-sensor-delay-game-sensor-de">answer</a>, you could also define your own rate, for example 1000 ms = 1s:</p> <pre class="lang-java prettyprint-override"><code> @Override public void onSensorChang...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Confusion about data types in Haskell<p>I have to write a simple pi approximation and I did and it works fine, but in the task it says to write a function wi...
<p>because <code>x</code> is an <code>Int</code>, hence <code>x * x</code> is also an <code>Int</code>, and you can not use an <code>Int</code> for <code>(/) :: Floating a =&gt; a -&gt; a -&gt; a</code>.</p> <p>You need to convert this to a <code>Double</code>, for example with <a href="https://hackage.haskell.org/pack...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel 9 authentication showing error (Solved)<p>I've created a login route and it is working ok , but when trying to store data of authenticated users it i...
<p>I've used Laravel sanctum to fix it.</p> <pre><code>Route::group(['middleware' =&gt; ['auth:sanctum']], function () { Route::post('page/create',[PageController::class,'store'])-&gt;name('page.create'); Route::post('page/post',[PostController::class,'store'])-&gt;name('post.create'); Route::post('/page/{pageId}/attac...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: android material design sample code giving missing resources errors<p>I am trying to run android material design same taken from below <a href="https://githu...
<p>Problem is solve after using current version of android studio ( updated from 4.2 to 2021.2.1 and used recommended gradle plugin )</p> <p>Got the below reply from github when i open defect for same &quot;The error message you attached says not recognizing resource tag, which requires AGP 7.2. You must use a version ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: moment js subtract'ed date equal another date by <= returns false instead true<p>I am very much confused by following behavior while comparing two dates:</p>...
<p>Moment gives us <a href="https://momentjs.com/docs/#/query/is-before/" rel="nofollow noreferrer"><code>isBefore</code></a>, <a href="https://momentjs.com/docs/#/query/is-after/" rel="nofollow noreferrer"><code>isAfter</code></a>, <a href="https://momentjs.com/docs/#/query/is-same/" rel="nofollow noreferrer"><code>is...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Data is not refreshing after new publish AWS site<p>I use DNS of a Hosted Zone of Route 53 on a Godaddy domain.</p> <p>Also, I create an AWS certificate, Clo...
<p>Because you are using CloudFront every time you change your website you should run an invalidation. To do that you will need to do the next:</p> <ul> <li><p>Go to your CloudFront distribution <a href="https://i.stack.imgur.com/vNmmj.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/vNmmj.png" alt="c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Oracle APEX - how to read a cell from interactive grid<p>The same question once again but with (I hope) better explanation:</p> <p>I created the most simple ...
<p>The best way to debug and achieve what you are trying to do is as follows:</p> <ol> <li><p>create the Dynamic action with the following setup:</p> <pre><code>-when -&gt; selection change[interactive grid], -selection type -&gt; region, region -&gt; your IG region, -client side condition -&gt; javascript expression:...