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: why flutter run not working on manjaro linux?<p>I'm running flutter 3.0.0</p> <blockquote> <p><code>$ flutter run -d linux or flutter run</code></p> </blockq...
<p>I had the same issue.</p> <p>From discussions on <a href="https://github.com/canonical/flutter-snap/issues/45" rel="nofollow noreferrer">this Github issue</a>, it looks like the issue might boil down to the libraries shipped with the snap itself.</p> <p>I managed to get it running on Manjaro (had the same issue as y...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AzureAD Group Provisioning to ServiceNow - Cannot change group details in ServiceNow due SYSID being stored<p>I am trying to understand AzureAD Provisioning ...
<p>Whenever an object (user, group..) is created or located for the first time, the target system ID value (sys_id for ServiceNow SOAP API) is stored internally to the provisioning service. That value cannot be manually cleared. Your options are either to remove the original group entirely so that the next time AAD Pro...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I fix an empty dropdownlist when binding ASP.NET MVC using Dapper?<p>I am attempting to bind a dropdownlist to values in an SQL table using dapper, bu...
<p>Dapper: cares about names.</p> <p>You have the SQL:</p> <pre class="lang-cs prettyprint-override"><code>SELECT [Id], [Programs] FROM tbl_ProgOverview </code></pre> <p>but your c# property is <code>Program</code> (or at least, I presume that's what you intend to map it to). Dapper is going to ignore the <code>Program...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas - how to flag if a dataframe column has a non-permitted value in it?<p>I have a dataframe that looks a bit like this:</p> <pre><code>offer | type ----...
<p><a href="https://stackoverflow.com/a/72940924/9769953">Chris's answer</a> is the better solution, but to show where your method went wrong:</p> <pre><code>if (~df[&quot;type&quot;].isin([&quot;A&quot;,&quot;B&quot;,&quot;a&quot;,&quot;b&quot;])).any(): print(&quot;WARNING - Not all offers are the correct types!&...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I'm getting null when I fetch an array from cloud firestore<p>I am trying to fetch an array from the firestore and want to store it in a list but I keep gett...
<pre class="lang-dart prettyprint-override"><code>static TableModel fromJson(Map&lt;String,dynamic&gt; json){ return TableModel(tableName: json['Table'], tableServing: json['Serving']); } </code></pre> <p>Fromjson method is missing tableBilling</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hyperledger fabric with M1 Macbook<p>I am using hyperledger fabric 2.2 on the intel chip Mac Pro right now. However, I am look forward to buy a new Macbook P...
<p>Hyperledger Fabric does not currently support ARM architecture, however as M1 MacBooks includes Rosetta2 you can continue to use the <code>amd64</code> architecture images and binaries. See <a href="https://github.com/hyperledger/fabric/issues/2994" rel="nofollow noreferrer">https://github.com/hyperledger/fabric/iss...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Looping through multiple column : optimization<p>I am completely new to Macro/VBA. We have a requirement ,where I need to check different condition against m...
<pre><code>set lc = ActiveSheet.ListObjects(1).ListColumns set range1 = lc(&quot;Activation Status&quot;).DataBodyRange set range2 = lc(&quot;Call Down Start Date&quot;).DataBodyRange set range3 = lc(&quot;Call Down Start Date_CUSTOM&quot;).DataBodyRange set range4 = lc(&quot;Date Added&quot;).DataBodyRange on error g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Connect to MySQL server for client failed<p>I'm writing an application to upload data for my customer's database. When I tested it on my PC, it works ok but ...
<p>Try it as following:</p> <pre><code> def connect_sql(self): mydb = mysql.connector.connect( host=host, passwd=pw, port=port, database=db, user=user, charset='utf8', use_unicode=True ) return mydb </code></pre> <p>Here's <a href="https://dev.mysql.c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the proper way doing *ngfor?<p>Hi Could someone tell me how to do *<strong>ngFor</strong> properly?</p> <p><strong>Error:</strong></p> <blockquote> <...
<p>I think that you've put the wrong variable here, your 'item' array is empty but you're trying to iterate on it. If you switch with 'data' constant which has your data, it works fine :</p> <pre><code>&lt;div class=&quot;item-list&quot; * ngFor=&quot;let item of data.colorways&quot;&gt; {{ item.thumbnail[0] }} &lt;/...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Failing to scrape a webpage<p>I have problems trying to scrape a web with multiple pages with Spyder: the web has 1 to 6 pages and also a next button. Also, ...
<p>The data you see is loaded from external URL via javascript. You can simulate these calls with <code>requests</code> module. For example:</p> <pre class="lang-py prettyprint-override"><code>import requests import pandas as pd from bs4 import BeautifulSoup from urllib.parse import urlparse, parse_qs url = &quot;http...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set the variables in a class that has been generated by Entity Framework from another partial class<p>I need to add an constructor to a class which is...
<p>The only reason for the missing variable can be that you have both classes in different namespaces. Partial classes are generally the same class split into 2 or more files.</p> <p>So, give the both classes the same namespace, independent from where are they placed and try again:</p> <p>Folder: Entities</p> <pre><cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does Promise.race rejects the other promises after first fulfillment?<p>Something that I cannot find the exact answer. In <code>Promise.race</code> after the...
<p>The answer is <strong>yes</strong>, they keep running. You can see the answer yourself</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>const promise1 = new Promise((resolve,...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there another way to return an array in C instead using pointers?<p>I thought I could return an array like I do in Java, but I think there is no way to de...
<p>No. You return an array via a pointer (possible embedded in a struct either as a pointer or an array). The array is either dynamically allocated in the function, or passed into the function as an argument and then returned again:</p> <pre><code>char *f() { char *s = malloc(42); ... return s; } </code></pre> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ReactJS add component to Javascript object<p>I'm using a Javascript object to hold the info for a side menu (e.g. name, path), then using a couple of nested ...
<p>Did you mean <code>&lt;InboxIcon /&gt;</code>? Since I cannot see where you opened it, so I believe that's the problem.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Grouping objects of different types based on common fields<p>I want to group different objects types based on same content of fields <code>incomeCode</code>,...
<p>As it has been pointed out in the comments, if you need to mix different type of objects your resulting <code>List</code> will be a <code>List&lt;List&lt;Object&gt;&gt;</code>.</p> <p>To group them by like that, you could use the <code>collect()</code> terminal operation in conjunction with a <code>Collectors.groupi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Get only numeric value in text file using powershell?<p>I have a text file sample.txt containing</p> <p>computer computer.pc = 1 pc</p> <p>i want only...
<p>You can extract the number by using the <a href="https://docs.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.match?view=netframework-4.7.2" rel="nofollow noreferrer">Regex Match</a> method.</p> <p>Example code to do this:</p> <pre><code>$number = ([regex]::Match((Get-content &quot;sample.txt&quo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: bash test injection vulnerability with -v<p>One of my bash scripts contains this test:</p> <pre><code>if [ ! -v &quot;$3&quot; ]; then exit else ... fi...
<p>Yes, there is an injection vulnerability here. The problem is that <code>-v</code> test evaluates its argument as a variable, and in bash v4.3 and later that can include an array element (e.g. <code>arrayVar[5]</code>), and since array indexes (for non-associative arrays) are numbers, the index part gets evaluated a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add to export default class extends Component - ({navigation})?<p>I have a problem with adding the {navigation} parameter to the export default class ...
<p>You need to get navigation from props you can either deconstruct this.props and get navigation like this</p> <pre class="lang-js prettyprint-override"><code>const { navigation } = this.props; </code></pre> <p>or you can directly use it like this</p> <pre class="lang-js prettyprint-override"><code>this.props.navigati...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Improve SQL: NOT LIKE being repeated 3 times to filter out 3 different strings<p>I am new at SQL so any help is appreciated. How can I improve on the followi...
<p>Convert the string literals to upper-case and get rid of the second line as it is already covered by the first line.</p> <pre class="lang-sql prettyprint-override"><code>AND Upper(customer_name) NOT LIKE '%DEMO%' AND Upper(customer_name) NOT LIKE '%PRACTICE%' </code></pre> <blockquote> <p>Is there a way I can do thi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can you explain please, why I get "non-valid function does not return a value in all control paths" error if I use 'else if' instead of else? (C)<p>I'm learn...
<p>With this code:</p> <pre><code> if (compared_value == main_value) // ending condition return 0; else if (compared_value &lt; main_value) return find_the_amount_of_smaller_numbers(main_value) + 1; else if (compared_value &gt; main_value) return find_the_amount_of_smaller_numbers(m...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Object is of type 'unknown' error while setting data in react d3<p>I am trying to set up a custom hook that fetches data, does some manipulations on the data...
<p>There are a number of issues with your code:</p> <h4>Untyped JSON response</h4> <p>There is no way for the TypeScript compiler to infer what type will be retrieved from the <code>jsonUrl</code>.</p> <p>According to the <a href="https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/d3-fetch/index.d.ts"...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make Index & Match functions on GG Sheets match blank cells?<p>I have one table of data (A) with data values, and a second table (B) which serves as a...
<p>use ifna like:</p> <pre><code>=IFNA(INDEX(D2:D13, MATCH(A2:A13, E2:E13, 0))) </code></pre> <hr /> <h2>update:</h2> <pre><code>=INDEX(IF(A2:A13=&quot;&quot;,,IFERROR(INDEX(D2:D13,MATCH(A2:A13,E2:E13,0)),&quot;Other&quot;))) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Avoid replacement in the terraform code while changing module versions<p>Well, I have some resources in AWS that were created via terraform module. But now I...
<p>Changing the terraform state to add the prefix <code>-dev</code> in the resources names will force terraform to diff from your Cloud environment, any update on those resources afterwards will force a replacement unless you do not touch those resources anymore.</p> <p>If you cloud environment has this bucket named <c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Exception while trying to invoke method, which invokes method from other class through object of said class<p>In a program I made, I have a class canteen and...
<p>You defined the variables named p1, p2, and p3 in your global scope. Inside your Cantina constructor, you create new variables, again with the names p1, p2 and p3. By writing the type of the variable before the name, you create a new variable with the same name, overwriting the variable in the parent scope. Because ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter user not being able to log in from firebase<p>I am trying to build a log in and logout feature in flutter using firebase auth. I have created the UI ...
<p>This code should work.</p> <p>1 - Make sure the user is created in Firebase Console (authentication).</p> <p>2 - If you are not using Google SignIn, I suggest using the recent launched &quot;automatic&quot; Firebase configuration (instead of the manual). That will rule out any configuration issues you might have. Fi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reverse part of a .csv file using Python<p>I had a csv file looking like this:</p> <pre><code>index label observation groundTruth 0 1 10.00 0 1...
<p>If all observations are of length=5 then you can use next example how to move all rows with label=&quot;0&quot; to front:</p> <pre class="lang-py prettyprint-override"><code>import csv from itertools import zip_longest def grouper(iterable, n, fillvalue=None): &quot;Collect data into fixed-length chunks or blo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Access to fetch at 'https://localhost:7144/api/employees' from origin 'http://localhost:3000' has been blocked by CORS policy<p>Im getting this error when I ...
<p>you have to remove a trailing &quot;/&quot;, should be</p> <pre><code> builder.WithOrigins(&quot;http://localhost:3000&quot;) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Correct scraping of a CSV file from government website<p>I am very new to python - and I am trying to scrape this website <a href="https://itc.aeso.ca/itc/pu...
<p>It is returning a json string. You can convert it using the json library.</p> <pre><code>import json json_resp = json.loads(req.text) </code></pre> <p>Or probably better yet, requests has json built into it:</p> <pre><code>json_resp = req.json() </code></pre> <p>A real example of how to access data in your returned...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Constant garbage collection from converting Bitmap to BitmapImage<p>My code is essentially attempting to create a video feed by constantly updating a BitmapI...
<p>Instead of creating a new BitmapImage for each frame, you should use a WriteableBitmap that is once assigned to the Source property of an Image element.</p> <pre><code>int frameWidth = ... int frameHeight = ... var pixelFormat = PixelFormats.Bgr24; // must match Bitmap.PixelFormat var writeableBitmap = new Writeabl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extracting a time period changing from a Pandas dataframe<p>I am trying to find a way to extract the date cell where the date column starts changing the time...
<p>Since the frequency is changing from month to year, you can determine the date after which the consecutive difference becomes more than 31 days.</p> <pre class="lang-py prettyprint-override"><code>df = pd.concat([df2, df1]).reset_index(drop = True) df.loc[df[0].diff(1).apply(lambda d: d.days &gt; 31).idxmax()-1] </c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Copy files from Azure File Shares to a specific OneDrive or SharePoint location with Java<p>I have a scenario which we use a Azure File Share storage to stor...
<ul> <li><em>Here is the Sample code where you can create an Azure file share using Java Application.</em></li> </ul> <pre><code>public static Boolean createFileShare(String connectStr, String shareName) { try { ShareClient shareClient = new ShareClientBuilder() .connectionString(connectStr)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Iterate through list in nested list - Python<p>I have a long list with nested lists with each list consisting of multiple xy-coordinates. In short, my lists ...
<p>Try this:</p> <pre><code>flatlist = [el for lst1 in MyList for lst2 in lst1 for el in lst2] number1, number2 = flatlist[0::2], flatlist[1::2] </code></pre> <p>First you flat the list, and then you split it into two lists with alternating elements.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: a value of type "int" cannot be assigned to an entity of type "Node<int> *"C/C++(513)<p>I have a linked list that contains a pointer to the first and last no...
<p><code>Queue&lt;T&gt;::front()</code> is returning a <code>Node&lt;T&gt;*&amp;</code> when it should return a <code>T&amp;</code>.</p> <p>Example:</p> <pre><code>template &lt;class T&gt; T&amp; Queue&lt;T&gt;::front() { if (this-&gt;m_size == Queue&lt;T&gt;::SIZE_EMPTY) { throw Queue&lt;T&gt;::EmptyQueue(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ImportError: cannot import name 'load_learner' from 'fastai'<p>I'm new to <code>fastai</code>.</p> <ul> <li>fastai 2.7.5</li> <li>fastcore 1.4.5</li> <li>nbd...
<pre><code>from fastai.vision.all import * </code></pre> <pre><code>conda create -n venv python==3.6.13 </code></pre> <pre><code>pip install -r requirements.txt </code></pre> <p><code>requirements.txt</code>:</p> <pre><code>fastai==2.5.3 fastcore==1.3.27 python==3.6.13 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Exact match with filter() Flask<p>I'am new to python and iam coding a small webapp to search in a database. Its fonctionnal but doesnt function well.</p> <p>...
<p>This is because you are using &quot;if&quot; the second time and not &quot;elif&quot;. So if there exists the Signataire, then your results are always all the signataire. To resolve this you should use something like this:</p> <pre><code>def search_results(search): results = [] lieu = search.data['Lieu'] annee = se...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: BeautifulSoup find() returns None and findAll returns an empty list<p>Trying to scrape the change of price of the symbols on CNBC but I get an empty <code>li...
<p>As mentioned content is generated dynamically and is provided by additional calls that response with JSON data.</p> <p>If you know the symbols you could request them and get all information (AMD and TSLA):</p> <pre><code>https://quote.cnbc.com/quote-html-webservice/restQuote/symbolType/symbol?symbols=AMD%7CTSLA&amp;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PHP - Combine multiple API endpoints in array<p>I am trying to create a small function to load data from different API endpoints into one array to work with ...
<p>Huge thanks to @barrycarter for his help in pushing me into the right direction.</p> <p>The actual code needed to be like this:</p> <pre><code>$url1 = 'gameinfo.albiononline.com/api/…'; $url2 = 'gameinfo.albiononline.com/api/…'; $url3 = 'gameinfo.albiononline.com/api/…'; $url4 = 'gameinfo.albiononline.com/api/…'; $u...
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 use a common method to take Iterable of String and Long<p>I have the following 2 methods:</p> <pre><code>boolean iterableContainsStr(Iterab...
<p>The compile error is because your method expects a class Iterable of type String and you pass it a class Iterable of type Object.</p> <p>Just use generics (or whildcard as suggested by @Stephen c)</p> <pre><code>&lt;T&gt; boolean iterableContains(Iterable&lt;T&gt; iterable, Object matcher) { return StreamSuppor...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel Request validation for 4 digits which is also not requried parameter<p>I want to validate a pin code that is just for 4 digits and it should not be r...
<p>You can validate the request (or use a form request) that allows <code>pin</code> to be <code>null</code> otherwise validates it is a 4 digit number. You can then get the <code>pin</code> from the input or fallback to the default value of <code>1111.</code></p> <pre class="lang-php prettyprint-override"><code>$reque...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# JSON deserialize: failing stating I need an array when everything is already an array<p>I must be blind. This is what I am receiving from API:</p> <pre><c...
<p>JSON does not contain array, it contains single object with array <code>temperatures</code>, that's why serialzer cannot deserialize it as a collection. Do it that way:</p> <pre><code>var temperatures = JsonConvert.DeserializeObject&lt;Temperatures&gt;(content); ObservableCollection&lt;Temperatures&gt; res = new Obs...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fold expression: Replacing specific type but forwarding all others: How to achieve this?<p>I've trying to replace a specific type within a fold expression wh...
<p><code>if constexpr</code> within a wrapper is the key to the solution (thanks @<a href="https://stackoverflow.com/users/17732522/user17732522">user17732522</a> for the hint), however it needs to be combined with a second <code>std::forward</code> and for not receiving only r-value[s| references] <code>decltype(auto)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: .NET 6 Mobile App without Cross Platform UI<p>Is it possible to write a mobile app using .NET 6 but still maintain platform specific implementation of UI</p>...
<p>I haven't tried to follow the instructions yet but the links provided by @Paramjit in the comments to my original question seem to provide the answer I was looking for, namely that MAUI isn' the only mobile option in .NET 6:</p> <p><a href="https://www.andreasnesheim.no/converting-xamarin-android-template-to-net-6/"...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Loop through array of objects, if value exists, return another value<p>With the information below I am trying loop through <code>cards</code>, if there is a ...
<p>Using <code>.filter()</code> and checking if the object has a prop named <code>helper</code>. In case of multiple objects matching the criteria, their title's will be joined as a comma-separated string.</p> <p><strong>Snippet</strong></p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Joining two incomplete data.tables with the same column names<p>I have two incomplete data.tables with the same column names.</p> <pre><code>dt1 &lt;- data.t...
<p>You can group by ID and get the unique values after omitting NAs, i.e.</p> <pre><code>library(data.table) merge(dt1, dt2, all = TRUE)[, lapply(.SD, function(i)na.omit(unique(i))), by = id][] # id v1 v2 #1: 1 w a #2: 2 x b #3: 3 y c #4: 4 z &lt;NA&gt; </cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: need to retain column spacing in awk script<p>Seen tons of examples but I cannot seem to get any to work in this script from <a href="https://stackoverflow....
<p>Assumptions:</p> <ul> <li><code>GNU awk/FIELDWIDTHS</code> is available to OP (in comments OP mentions not able to get <code>FIELDWIDTHS</code> to work which I take to mean that OP is running <code>GNU awk</code> otherwise I'd expect OP to state something about an error or <code>FIELDWIDTHS</code> not available)</li...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PostgreSQL NULL value cannot be found<p>select * from test;</p> <p><a href="https://i.stack.imgur.com/Jfmbb.png" rel="nofollow noreferrer"><img src="https://...
<p>As others have said, the problem here is, that you're comparing against a <code>null</code> value, so it returns nothing, because it considers it as <code>false</code>, and I'll go even further that even if you say <code>where name &lt;&gt; 'admf'</code> it wont work, and even if you add more rows it will ignore the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert binary to char or char to binary<p>I know we can convert binary to char by any program but I wanna know how to convert that by myself. For example; 1...
<p>First convert binary to decimal which is 87 then you refer to the ascii table for number 87 which is W</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rust: async is not concurent<p><a href="https://rust-lang.github.io/async-book/01_getting_started/04_async_await_primer.html" rel="nofollow noreferrer">Here'...
<p>Like tkausl's comment states, std::thread::sleep makes the whole thread sleep, which prevents <em>any</em> code on the thread from executing during the sleeping duration. You could use <a href="https://docs.rs/async-std/latest/async_std/task/fn.sleep.html" rel="nofollow noreferrer">async_std::task::sleep</a> in this...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to scrape multiple pages with puppeteer<p>I'm trying to scrape prices from multiple pages using puppeteer. What i'm having trouble with, is to write a si...
<p>When <code>console.log</code> appears in a function instead of returning results, that's a dead end. Return the results if you want to use them later. Since you're returning promises, you can <code>await</code> them in the caller, either <a href="https://stackoverflow.com/a/65000065/6243352">serially or in parallel<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change font in BigQuery data [Data Cleaning]<p>In a Bigquery table I have the same value but with 2 different type of fonts (ℂ and Cartagena), for a d...
<p>Use <a href="https://cloud.google.com/bigquery/docs/reference/standard-sql/string_functions#normalize" rel="nofollow noreferrer">NORMALIZE</a> function as in below example</p> <pre><code>with your_table as ( select 'ℂ' col union all select 'Cartagena' ) select *, normalize(col, NFKC) normalized_col from your_tab...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React Cookie Consent banner not popping up<p>Recently, I published my first website using the Gatsbyjs Framework (and using the GC): Site: <a href="https://w...
<p>When accessing your website the background is grayed out, as if the cookie banner was there, unless this is on purpose. Have you tried giving the banner a z-index of 99 or so?</p>
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 add spaces into a score without using rests?<p>Something that looks like this:</p> <p><a href="https://i.stack.imgur.com/J7HN6.png" rel="no...
<p>The solution that I found is to use \hideNotes, then just use filler; for instance,</p> <pre><code>\stemOff bes,4 \hideNotes bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 bes,8 \bar &quot;|...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: python print jinja2 rendered output in json format<p>my variable file/data (i get this info from other source)</p> <p>final_lst:</p> <pre><code>[ { &qu...
<p>I'd suggest <strong>not</strong> to generate json with means of template language. It is slower and much more error prone.</p> <p>In your python code:</p> <pre class="lang-py prettyprint-override"><code>import json from jinja2 import Template, Environment, FileSystemLoader data = [ { &quot;service_role&quot;:...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How I can keep aggregate initialization while also adding custom constructors?<p>If I don't define a constructor in a struct, I can initialize it by just pic...
<p>Similar to what ellipticaldoor wrote:</p> <pre><code>struct FooBase { int x = 0, y = 0; }; struct Foo : FooBase { Foo(int x_) : FooBase{.x = x_} { } Foo(FooBase &amp;&amp;t) : FooBase{t} {} }; Foo foo = {{.y = 1}}; Foo foo2{1}; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to pull data from one table into another using a column value as reference<p>I am completely new to MySql with absolutely zero experience with databases ...
<p>I hope I got all the column names correct</p> <pre><code>UPDATE customer1 c, postcodes po SET c.new_col1 = po.street_address, c.new_col2 = po.town_address WHERE c.customer_postcode = po.postcode; </code></pre> <p><a href="https://dbfiddle.uk/?rdbms=mysql_8.0&amp;fiddle=421ad19110b26027ceb81cd9d723380d" rel="nofo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Type inference changing from unknown to known type after using method<p>I have a class with single generic <code>T</code>, where sometimes it may be construc...
<blockquote> <p>is there a way I could make it such that <code>any</code> is default?</p> </blockquote> <p>Yes, simply use a <a href="https://learntypescript.dev/06/l6-generic-parameter-defaults" rel="nofollow noreferrer">default type</a> for your generic:</p> <pre><code>class Foo&lt;T = any&gt; {} </code></pre> <p><a ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript: array as useEffect depencendy<pre><code>useEffect(() =&gt; { changeColumnsState(mapOrder({array: columnsState, order: columnOrder, key: 'name...
<blockquote> <p>What is the best way to check if array changed?</p> </blockquote> <p>The best way is not to check at all. You don't need that <code>columnOrder</code> array state and an initialisation and an effect depending on it. Just directly set the order of your <code>columnsState</code> array in the handler funct...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: When i try to use Regex.Replace it throws out System.ArgumentException<p>I have this peace of code:</p> <pre class="lang-cs prettyprint-override"><code>strin...
<p>Like @GSerg pointed out, a typical directory path is unlike to be a valid regex pattern, and even if it is, it is unlikely to do the replace like you would expect. You should use the plain <code>string.Replace</code> instead.</p> <p>However, there are better approaches than string replacement. Depending on what you ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kubernetes pull from image private network / fails to respect /etc/hosts of server<p>I am running a small 3 node test kubernetes cluster (using kubeadm) runn...
<p>After going through many different solutions and lots of research and testing. The answer was actually very simple.</p> <h3>Solution in my case</h3> <p>The /etc/hosts file <em>MUST</em> contain the host for the registry (and possibly the entry for the gitlab instance as well) on <em>EVERY</em> node of the cluster i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: When Joining Tables, If I pass Object I get result but null when passing ViewModel<p>at the moment I have 2 models, 1 called Customer and 1 called ContactDet...
<p>It Turned out to be impossible to bind this query to the view model because the query return the result as combined result so binding them to either CustomerDto or ContactDetailsDto is impossible.</p> <p>to fix this issue I had to return result list from the first table (customer) and then query the second table (co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: inner join without unique identifier<p>On the screenshot below you see two tables. On the left side I have a table with accidents, in this case the ID is uni...
<p>Instead use a subquery to get your average temperature for that time:</p> <pre><code>UPDATE accident_copy as a LEFT JOIN ( SELECT avg(temperatur) temparatur, year, month, day, hour FROM wetterdaten GROUP BY year, month, day, hour ) as w ON a.year = w.year and a.monthDE = w.month an...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create dynamic url in Spring Thymeleaf<pre><code>@GetMapping(&quot;/deposit&quot;) public String deposit(@RequestParam(&quot;amount&quot;) double amou...
<p>As it is mentioned by @andrewJames it would be mush easier to submit this value using form. For example:</p> <p><strong>In your HTML</strong></p> <pre><code>&lt;form th:action=&quot;@{/account/deposit(id=${account.id})}&quot; method=&quot;post&quot;&gt; &lt;input type=&quot;number&quot; id=&quot;amount&quot; nam...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does anyone know how to remove this weird shaddow?<p><a href="https://i.stack.imgur.com/NAYLn.png" rel="nofollow noreferrer">Image demonstrating it</a></p> <...
<p><strong>Aftermath</strong></p> <p>After a lot of research I was able to fix it by adding this:</p> <pre><code>SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle( systemNavigationBarColor: Color.fromARGB(255, 246, 247, 246), //specific color because of the color scheme of my app, you can put whatever y...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can nuxt 3 rewrite url with sub directory<p>I have project structure like this</p> <pre><code>- pages - login.vue - index.vue auth - about.vue </code></p...
<p>You can use a <a href="https://v3.nuxtjs.org/guide/directory-structure/pages/#alias" rel="nofollow noreferrer">page alias</a> if you want to have another entry point</p> <pre class="lang-html prettyprint-override"><code>&lt;script setup&gt; definePageMeta({ alias: ['/about'] }) &lt;/script&gt; &lt;template&gt; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using plain-draggable library with React<p>I want to use the <a href="https://www.npmjs.com/package/plain-draggable" rel="nofollow noreferrer">plain-draggabl...
<p>You can install the missing dependencies in your main project rather than going to the <code>node_modules</code> folder and reinstalling it each time.</p> <p>Try it in the root directory of your application;</p> <pre><code>npm install --save anim-event cssprefix m-class-list pointer-event </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create a nested dictionary with multiple columns in pandas<p>I'm trying to group the data in this way - {10:{10:[Pole], 5:[Carl]}</p> <p>Right now, I have gr...
<p>Grouping can be done by groupby, but building dictionaries can only be done by custom functions. create_dict is used to dynamically create nested dictionaries based on grouping keys, with the innermost element setting the value</p> <pre><code>import pandas as pd def create_dict(key_lst, val): global res ke...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Performance of the splat operator when accessing a matrix<p>Let's say we have a matrix and a vector of the indices at which we want to access that matrix:</p...
<p>Splatting a tuple seems to be as fast as explicit destruction:</p> <pre><code>julia&gt; @btime $matrix[point...] setup=(point = [1244, 3353]) 91.024 ns (4 allocations: 64 bytes) 0.0 julia&gt; @btime $matrix[point[1], point[2]] setup=(point = [1244, 3353]) 2.530 ns (0 allocations: 0 bytes) 0.0 julia&gt; @btime ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I read the last line of a text file in a C program?<p>I'm trying to study the C language and basically what I want to do is read a file and put it int...
<p>Compare these two programs, one (mis)using <code>feof()</code> and one not using it at all. The first corresponds closely to the code in the question — it ignores the return value from <code>fgets()</code> to its detriment. The second only tests the return value from <code>fgets()</code>; it has no need to use <co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: create an edgelist from same date & location<p>I want to create an edge list from data that contains actors, dates and locations. My assumption is that when ...
<p>You could join the frame on itself, rename, and remove duplicates</p> <ol> <li><code>data.table</code></li> </ol> <pre><code>library(data.table) setDT(dt) unique(merge( dt[, .(id,location,actors,event_date)], dt[, .(id,location,actors,event_date)], by=c(&quot;location&quot;, &quot;event_date&quot;), allow....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to display the charts row-wise instead of column wise<p><code>marrangeGrob</code> apparently displays the charts by column first. How to arrange these ch...
<p>Using the <code>layout_matrix</code> argument you could specify to add the plots by row (<code>byrow=TRUE</code>):</p> <pre class="lang-r prettyprint-override"><code>library(gridExtra) library(ggplot2) dat &lt;- c(2,3,4,5,6,7,8,9,0,1) time &lt;- 1:10 data &lt;- data.frame(dat, time) p1 &lt;- ggplot(data, aes(x= time...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: While retrieving the dataStore.js object throws undefined in js file<p>I have created a <code>dataStore.js</code> object and tried to pass below string to ob...
<p>Checking out the Cypress tests, with some slight mods for folder paths and different baseUrl.</p> <p>Since Cypress v10 no longer has &quot;Run all&quot; option I also added a barrel spec called <strong>all.cy.js</strong> which allows running multiple specs and <strong>also</strong> enforces the order of the spec (wh...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python: How to ensure keys are type int<p>In my code, I have a nested dictionary and I want to ensure that key <code>id</code> is an integer (note: it is a p...
<p>JSON objects can only use JSON strings as keys:</p> <pre><code>&gt;&gt;&gt; json.dumps({3: 4}) '{&quot;3&quot;: 4}' </code></pre> <p>While the key in you <code>dict</code> is certainly an <code>int</code>, it gets converted to a string when encoding as JSON. JSON itself doesn't have a way of &quot;remembering&quot; ...
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 add dotted borders between images in css<p>So I'm new to html and css and wanted to copy a design I saw on the web for practice. However, t...
<p>Here's some sample you can play with base on your code. Let me know</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-css lang-css prettyprint-override"><code>.brands-sec{ justify-content: center; display: grid; gr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Git Fetch not updating tracking branches in 'packed-refs'<p>Here is what I have done.</p> <ol> <li>I have made a new commit in GitHub</li> <li>Did &quot;git ...
<p>There's no guarantee when or if references are stored unpacked or packed, or if some future version of Git will store them in some third way (e.g., a real database). You should generally not look at the files inside the <code>.git</code> directory (except to satisfy curiosity), but rather use the provided APIs (e.g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flatten List without using Flat() function in Javascript<p>I am trying to flatten a given data without using flat() function. here is my implementation</p> <...
<p>The error you see is because you are trying to interpret <code>This is a string</code> as JSON. What you should do, if you want to interpret JSON values, is to try-catch the <code>JSON.parse</code> that way the error will be silenced. Here's the modified code.</p> <p><div class="snippet" data-lang="js" data-hide="fa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: sql split yearly record into 12 monthly records<p>I am trying to use common table expression to split an yearly record into 12 monthly records. I have to do ...
<p>You can simply join onto a list of months, and then use a bit of arithmetic to split the <code>Value</code></p> <pre class="lang-sql prettyprint-override"><code>SELECT t.Id, t.Year, v.Month, Value = t.Value / CASE WHEN t.Year = 0 THEN 13 - MONTH(GETDATE()) ELSE 12 END FROM YourTable t JOIN (VALUES (1),(2),...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jsony newHook has `SIGSEGV: Illegal storage access. (Attempt to read from nil?)` when deserializing into ref-objects<p>I am writing a web-application and am ...
<p>The answer lies in the fact that norm-object-types are <strong>ref objects</strong>, not normal (value) objects (Thanks to ElegantBeef, Rika and Yardanico from the nim-discord to point this out)! If you do not explicitly 'create' a ref-type at one point, the memory for it is never allocated since the code doesn't do...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Finding distance between 2 coordinates in solidity<p>It is said that distance is equal to the following formula:</p> <pre><code>distance = sqrt( (x2 - x1)**2...
<p>Instead of using uint256 use int256 so you can accept negative number</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get original pixel color before shader<p>I have an <code>ImageLayer</code> and a <code>RasterSource</code> which uses a shader to manipulate the color...
<p>I found a workaround by adding a duplicate RasterLayer with a no-op operation. The trick is to add the layer just after the color manipulated layer, but with an opacity of 0.005 (apparently the lowest possible value) so it's rendered but you don't see it. Then combine the grey color's alpha with the original color's...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot bind socket to network in C<p>I am trying to create a simple HTTP server in C.</p> <p>Unfortunately, I'm not quite sure why this is the case, but I am...
<p>I think you may have the assignment of these two lines reversed:</p> <pre><code>servaddr.sin_port = INADDR_ANY; servaddr.sin_addr.s_addr = htons(PORT); </code></pre> <p>Try:</p> <pre><code>servaddr.sin_port = htons(PORT); servaddr.sin_addr.s_addr = INADDR_ANY; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The body might complete normally, causing 'null' to be returned, but the return type<p><strong>The body might complete normally, causing 'null' to be returne...
<p>Your function must return widget. For now <code>buildSingleMessage</code> only call <code>FutureBuilder</code> but return nothing. so you should add <code>return</code> before <code>FutureBuilder</code></p> <pre><code>Widget buildSingleMessage(Message message) { return FutureBuilder&lt;List&lt;Message&gt;&gt;( ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Small commits in one branch as one commit to another<p>I have a question about refurbishing workflow.</p> <p>Suppose I have two branches, <em>master</em> and...
<p>You ought to create a third branch, with multiple commits from the devel branch. Then, you merge the third branch into the master branch, and there you have it: two commits into the master branch. Here is the example</p> <ol> <li>Master branch</li> <li>Devel branch</li> <li>Temp branch</li> </ol> <pre><code>git che...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Move scheduled query to a different project BigQuery<p>I have a scheduled query in a project x. I need to move it to project y where i will use a service acc...
<p>There is no feature in GCP to migrate scheduled query in Bigquery to a different project. You can <a href="https://cloud.google.com/bigquery/docs/table-snapshots-scheduled#configure_the_service_account_to_run_the_scheduled_query" rel="nofollow noreferrer">setup directly the service account</a> to run the scheduled q...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How not to reexplicit instance components properties in generic components?<p>In react, I implement generic components like this :</p> <pre><code>export func...
<p>You can transfer props using the <code>spread syntax</code> as follows.</p> <pre class="lang-js prettyprint-override"><code>export function CustomTextInput(props) { return ( &lt;TextInput {...props} style={{margin:20}} /&gt; ) } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What do the in- and out-tangents in glTF's cubic splines visually represent?<p>Keyframe animations in <a href="https://www.khronos.org/gltf/" rel="nofollow n...
<p>The <a href="https://github.khronos.org/glTF-Tutorials/gltfTutorial/gltfTutorial_007_Animations.html#cubic-spline-interpolation" rel="nofollow noreferrer">glTF Tutorial on Animations</a> offers this further explanation:</p> <blockquote> <p>The input and output tangents are normalized vectors that will need to be sca...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I operate with MultiIndexed columns in pandas in specific levels?<p>In pandas with simple columns, you can operate with columns quite straightfowardl...
<p>We can <code>reshape</code> the dataframe to simplify the operations:</p> <pre><code>df.stack().eval('C = A + B').unstack() </code></pre> <p>Alternatively, you can use <code>concat</code> to append the extra level <code>C</code>:</p> <pre><code>df.join(pd.concat({'C': df['A'] + df['B']}, axis=1)) </code></pre> <hr /...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: LARAVEL 9 - Session conditions if admin or not<p>I'm doing a Laravel 9 project and I would like to realize a user management. I made a template with a basic ...
<p>you can retrieve the user id through <code>request()-&gt;user()-&gt;id</code> to check if the user is an admin. Or you can create an <code>isAdmin()</code> method in your User model to see if an user is an admin and then call it this way:</p> <p><code>@if(request()-&gt;user()-&gt;isAdmin())</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trying to setup unit stats based off a class in another script using objects name as a filter. (Unity)<p>I'm new to coding games, so my logic may not be righ...
<p>Searching by class name does not make sense because your class name may not have a health attribute. Then it will error the compiler. You need another logic. If you want to have different entities in the game, all you have to do is inherit them from the Entity class and then customize the variables. Finally prefab t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Average of the numbers in a given list<p>I have been told to write a function which calculates the average of the numbers in a given list. Empty arrays shoul...
<p>The <code>for</code> loop isn't necessary, since you're already using <code>sum()</code>. Once you've summed all the elements, the only thing you need to do is divide the sum by the number of entries in <code>numbers</code>:</p> <pre class="lang-py prettyprint-override"><code>def find_average(numbers): if not nu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Generate Start Date and End Date based on the contiguous rows<p>I have a table :</p> <div class="s-table-container"> <table class="s-table"> <thead> <tr> <th...
<p>Mostly a fix-up of Greg's Answer..</p> <p>With a CTE for the <code>pass1</code> data:</p> <pre><code>select * from values ('0011', '2022-02-07', '2022-02-07', 'TEXT1'), ('0011', '2022-02-04', '2022-02-05', 'TEXT2'), ('0011', '2022-02-06', '2022-02-06', 'TEXT3'), ('0011', '2022-02-03',...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parsing characters into an std::map<char,int> using boost::qi<p>I am trying to parse a sequence of characters separated by a &quot;,&quot; into an std::map&l...
<p>You cannot use Phoenix place holders outside Phoenix deferred actors. E.g. the type of <code>std::make_pair(qi::_1, 0)</code> is <code>std::pair&lt;boost::phoenix::actor&lt;boost::phoenix::argument&lt;0&gt;&gt;, int&gt;</code>.</p> <p>Nothing interoperates with such a thing. Certainly not <a href="https://en.cpprefe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Callback function can be changed in Compose?<p>As I am doing <a href="https://developer.android.com/codelabs/jetpack-compose-advanced-state-side-effects" rel...
<p>In the example in Codelab provided timeout doesn't change but it's fictionalized as it might change many default Composable use <code>rememberUpdatedState</code> which is</p> <pre><code>@Composable fun &lt;T&gt; rememberUpdatedState(newValue: T): State&lt;T&gt; = remember { mutableStateOf(newValue) }.apply { val...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: modal for all items shown in one click ( Reactjs )<p>I have a todo-list app and I want to show more details of a task when its clicked so I'm using the react...
<p>First of all, you are creating N modals, with N being the number of the todo items.</p> <p>So Modal should be outside of your map function. Then you can set the currently selected todo item in your state and load it in your modal.</p> <pre><code>const [currentTodo, setCurrentTodo] = useState(null); const openModa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to query multiplte row in one json object<p>table provider</p> <p><a href="https://i.stack.imgur.com/plsOe.png" rel="nofollow noreferrer"><img src="https...
<p>Since your expected results need specific formatting in json. You want to refer to <a href="https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-json-output.html" rel="nofollow noreferrer">JSON Formatted output</a>. This is for shell though.</p> <p>You might also want to try this...</p> <p>This would give you a ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: multiply the values of a ton of arrays then put it back in origianl form<p>I am trying to make a chart that gets data from an API endpoint with open, close, ...
<p>Actually, it's easy. If you have an array of objects, you can just use the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax" rel="nofollow noreferrer">spread operator</a> to spread the rest of the object and multiply the values you'd like to change by 213:</p> <pre><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dart and perl does not yield the same result withh regex<p>In port of a perl application to dart, I have to deal with regular expressions of the form below. ...
<p><code>$</code> are not equivalent in both regex languages.</p> <p>Dart uses the same regex language as JavaScript, and <a href="https://stackoverflow.com/q/22937618/589924">Reference - What does this regex mean?</a> says the following:</p> <ul> <li><p>In Perl regex, <code>$</code> matches at a LF at the end of the s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google Sheets App Script: Automatically sort tabs based on custom order<p>We use Google Sheets for concert production. A TEMPLATE tab serves as template for ...
<p>To sort, use moveActiSheet (see references).</p> <p>The aim here is to build an array with the name of each tab and the <em>date</em> as follows</p> <ul> <li>2022-MM-dd for tabs as xx/yy</li> <li>2022-MM-00 for tabs as MMMM</li> <li>z for others</li> </ul> <p>and sort according to the second value of each row</p> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change column value from character to number or duplicate row in R<p>I'm having an issue with a variable in some data that I have in R. I have a table that l...
<p>You can first remove the square brackets and then <code>separate_rows</code>:</p> <pre><code>library(dplyr) library(tidyr) df %&gt;% mutate(Y = gsub(&quot;\\[|\\]&quot;, &quot;&quot;, Y)) %&gt;% separate_rows(Y, sep = &quot;,&quot;) # A tibble: 6 × 2 X Y &lt;dbl&gt; &lt;chr&gt; 1 11 1 2 15 ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I can't understand what is the red line code is want to say<p><a href="https://i.stack.imgur.com/Z7HzE.png" rel="nofollow noreferrer">enter image description...
<p><code>CategoryCard</code> class declared icon and name. Using constructor you can initiate it.<br /> Red line code indicates the <code>constructor</code> with <code>values</code>. You can make it <code>nullable</code> or <code>required</code> as per your requirement.</p> <p>For <code>Required</code> ::</p> <pre><cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why doesn't this function change the case of the string when it has a similar character like the first letter?<p>Can't understand why the following function ...
<p>The function <code>String.prototype.replace</code> replaces the first occurrence when the first argument is a string.</p> <p>You can split the string change the index to uppercase and finally join the chars.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div cla...