input_text_instruct
stringlengths
288
45.8k
output_text
stringlengths
37
33.2k
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I get the sum of a SQL rollup statement to the top of the resultset<p>I have a SQL query</p> <pre><code>Select city, sum (tax) from db group by roll...
<p>By default you should be specifying the expected sort order, if you do not then the rollup will be appended to the end.</p> <p>So the first step is to specify that you want to sort by the <code>city</code> column in ascending order. But different RDBMS treat <code>NULL</code> differently, in your case as judged by t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Applying group by and sum on array of objects in javascript<p>I need some advice on the proper way to attain my goal of applying group by and sum on JSON dat...
<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 myData = [ { "siteDetails": { "printerCode": "660103684", "siteId": "UTT212303-STB-2040-00...
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 check the value of a specific field in a document?<p>I'm trying to compare the text inputted by user to my firestore collection.</p> <p>But...
<p>try this if this works.</p> <pre><code> static Future&lt;bool&gt; checkPass({String? id, String? passArg}) async { final collection = FirebaseFirestore.instance.collection('users'); final docs = await collection.doc(id!).get(); final Map&lt;String,dynamic&gt; map = docs.data() as Map&lt;String,...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Entities won't join even if there is a relation between them when calling find or findOne functions<p>I'm trying to create an entity called author that have ...
<p>just add eager to you author entity. Like this :</p> <pre><code>import { Entity, Column, PrimaryGeneratedColumn, ManyToMany, JoinTable, } from 'typeorm'; import { Book } from '../entities/book.entity'; @Entity() export class Author { @PrimaryGeneratedColumn() id: number; @Column() FirstName: str...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Explicit concurrent copying GC freed, Xamarin.Forms<p>I want to create the data model asynchronously. I am using MVVM. My code looks like this.</p> <p><stron...
<p>The extreme lagginess with an ObservableCollection having 8000 elements, was due to <code>Hot Reload</code>.</p> <p><a href="https://docs.microsoft.com/en-us/xamarin/xamarin-forms/xaml/hot-reload" rel="nofollow noreferrer">UNCHECK Hot Reload in Tools/Options</a> resolved the performance issue.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Thread.Sleep() doesn't work with Cv2.ImShow, OpenCvSharp, C#<p>Very Simple C# Winforms App, OpenCVSharp4, Thread.Sleep() doesn't work. It seems like (as I gu...
<p><code>waitKey</code>'s purpose is not waiting, it's to <em><strong>spin the GUI event loop</strong></em> that OpenCV uses. If you don't call it, OpenCV's GUI doesn't work.</p> <p>You're using C# and WinForms already (judging by the tags), so you should use WinForms instead of <code>imshow</code>. OpenCV does its own...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dictionaries in different lengths comparison in Python<p>I am trying to figure out how to compare two dictionaries having different number of keys. For insta...
<p>Try something like:</p> <pre class="lang-py prettyprint-override"><code>person = {'name': 'John', 'birthYear': 1995, 'month': 1} time = {'birthYear': 1995, 'month': 1} if all(person[key] == time[key] for key in ['birthYear', 'month']): print(person['name']) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TextField hides behind Keyboard in Flutter 3.0.0<p>I cannot get <code>CustomScrollView</code> to work properly.</p> <p>Before flutter 2.13.0-0.2.pre, tapping...
<p>I found the solution. I had installed the <code>flutter_screenutil</code> package and inserted it above my widget tree - above MaterialApp and I'd also set <code>useInheritedMediaQuery: true</code>. This prevented widget rebuilds for things like keyboard state change.</p> <p>Moving the <code>ScreenUtils</code> widge...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Strapi login/register and authentication<p>I have a peculiar problem here guys. While working with strapi (first timer), I'm attempting to set up login and r...
<p>should remove <code>Json.Stringfy</code> in LoginSubmit when call <code>fetchLogin</code> and use spread operator. Body of request must be <code>{id:&quot;&quot;, password:&quot;&quot;}</code>, not like <code>{data: &quot;{id:&quot;&quot;,password:&quot;&quot;}&quot;}</code></p> <p>so should use spread operator <cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can't log any data from API call<p>I'm pretty new to kotlin, and I feel pretty much overwhelmed by it. I'd like to ask - how I can display any data from Muta...
<p>You never call <code>viewModel.getLatestRates()</code> in your <code>onCreate()</code> to fetch an initial value for your LiveData, so it never emits anything to observe. The only place you have called it is inside your error listener, which won't be called until a fetch returns an error.</p> <p>Side note, I recomme...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python multithreading (Concurrent Futures) resutls in recursive results, how to set multithreading properly?<p>I put together the following Python script whi...
<p>The ONLY things that should be outside of your <code>if __name__</code> guard are the setting of global inputs, and the function to be executed. THAT'S IT. Remember that, with multiprocessing, each new thread starts a brand new interpreter, which re-runs your file, but with <code>__name__</code> set to a different v...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spreadsheet uploading appropriate for business/end-users in Foundry<p>Does Foundry have native support for uploading and appending spreadsheets (identical sc...
<p>There are a number of robust approaches to enable this workflow. Foundry Actions combined with Workshop present a robust option to enable ad-hoc uploads and appends of spreadsheets (or any file formats) to a specific dataset, with an interface appropriate for business/end-users.</p> <p>Actions can be configured to s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I bind an App registration to a specific Power BI instance?<p>I have two app registrations for two different projects in Azure Active Directory. I al...
<p>In the PBI embedded capacity resources in azure, you can add/remove users/SPNs(apps) as <code>PBI capacity Administrator</code>.</p> <p>PBI capacity Admin gives you the ability to assign that PBI capacity to a workspace. <br><em>e.g, If you are given the capacity admin, then you can assign that capacity to any works...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I extract only executable path and args from cmdline in linux?<p>I am writing a python application, which uses Popen to start other exectutables. I t...
<p>Looks like I would have to answer my own question. I wished there was a better way to do this but looks like there isn't.</p> <p>The workaround I ended up doing assumes that the cmdline list ends with the arguments of the executable, preceded by the absolute executable path (which I know). So I use this to extract i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java changing method return without access to the class Class<p>I'm modifying someone else's code to implement a new functionality and I can't do it without ...
<p>Probably the best way to do this is Java Instrumentation, but it was too complex for me so I did the following (assuming you have the .jar, and the .jar it's not already loaded):</p> <ol> <li>Open the .jar as a Zip using ZipFile class</li> <li>Send the .java to ClassFileToJavaSourceDecompiler (from <a href="https://...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to modify an array to get another array<p>I have a manually filled array with directory names that are used to run a function for image modification. Num...
<p>From what I understand, you need to manipulate your array generated by scan dir as that of the manually filled array.</p> <p>As you can see the $dir is an array so you can loop through it to access individual directory and subdirectory names. You just have to create an array with that name.</p> <p>You can do it usi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: extracting string patterns that repeat to a separate column or columns<p>Hi I have not seen a similar solution to this problem I am having. I am trying to ma...
<p>First, (almost) <em>never</em> use <code>test$</code> within a dplyr pipe starting with <code>test %&gt;%</code>. At best it's just a little inefficient; if there are any intermediate steps that re-order, alter, or filter the data, then the results will be either (a) an error, preferred; or (b) silently just wrong. ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hebrew dictionary remove all non - hebrew characters<p>I want to create a Hebrew dictionary</p> <p>and patram after something that removes all things that ar...
<pre><code>alphabet = &quot; אאִבבּגדהםווּןזחחָטיכָךלמנסעפףצץקרשת&quot; def letters_only(source): result = &quot;&quot; for i in source.lower(): if i in alphabet: result += i return result with open(&quot;&quot;+str(&quot;random&quot;)+&quot;.txt&quot;, encoding='utf-8') as fname: ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: python how to cleanup a subprocess<p>I'm running a python script that will restart a subprocess every 2 hours. code as follow.</p> <pre><code>import datetime...
<p>passing <code>preexec_fn=os.setpgrp</code> to subprocess popen works for me.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel Queue Failed after certain numbers of queries<p>I'm working with Laravel 9 Queue for the first time I'm looping over a CSV file and Inserting the dat...
<p>So I found the solution, Job may need several minutes to complete. However workers by default will give every job 60 seconds to finish. we need to tell our workers to give us more time by doing <code>php artisan queue:work --timeout=18000</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is " const wchar_t* " a pointer?<p>Normally when we write:</p> <pre><code>int a = 10; int* ptr = &amp;a; std::cout &lt;&lt; *ptr; </code></pre> <p>Code outpu...
<p><code>L&quot;This is a simple text!&quot;</code> is an array of type <code>const wchar_t[23]</code> containing all the string characters plus a terminating 0 char. Arrays can decay in which case they turn into a pointer to the first element in the array which is what happens in</p> <pre><code>const wchar_t* str = L&...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Delete Variable only if ALWAYS 0 in Panel Data?<p>I have a panel data frame in which the number of children a woman has is asked. Now I would like to delete ...
<p><code>dplyr</code> option:</p> <pre><code>librar(dplyr) df %&gt;% group_by(ID) %&gt;% filter(sum(child) &gt;= 1) </code></pre> <p>Output:</p> <pre><code># A tibble: 8 × 3 # Groups: ID [3] ID year child &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; 1 1 2012 0 2 1 2014 0 3 1 2016 1 4 ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to correctly position another image and buttons on top of the background in Flutter/Dart?<p>Here is the screen I want to get:</p> <p><a href="https://i.s...
<p>Try this code.. The height was missing in the top most Container</p> <pre><code>@override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: const Text('Background with Image and Text'), ), body: Container( height: MediaQuery.of(context).size.height, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Edit regex to recognise very short street name or number for Python 2.7 script and avoid fatal attribute error<p>I have a little script in Python 2.7 with re...
<p>You can merge your two conditions inside your function, then you can match any non-space characters <code>\S+</code> followed by a space and the keywords &quot;<em>Street</em>&quot; or &quot;<em>Avenue</em>&quot; (<code>\s(Street|Avenue)</code>).</p> <pre><code>import re def street(search): if bool(re.search('(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get image src from backend to frontend<p>I have 2 folders utalk and server, in my server folder I have a public folder in src folder to save images, t...
<p>There is not a lot of context provided. From what i gather, if the folder is public, the resources should be directly accessible. Something like <code>http://backend/image/file.mp3</code>.</p> <p>Also i would recommend using any static file hosting solution for hosting the content file (mp3 in your case). Serving al...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas: convert a dictionary of dataframes into a single one with keys as columns and fields as new sub columns<p>This question is related to <a href="https:...
<p>You can create multi index for the columns, then concat them into a single row.</p> <pre><code>import pandas as pd dict1 = { &quot;exchange&quot;: &quot;binance&quot;, &quot;base&quot;: &quot;kp3r&quot;, &quot;quote&quot;: &quot;busd&quot;, &quot;resolution&quot;: 15, &quot;ohlcv&quot;: [ ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SVG exported from Inkscape are rendered with different font<p>I have opened a pdf with Inkscape and exported it in Plain SVG. However, when I open it in any ...
<p>This happens because the <code>font-family</code> property in the SVG file might be set to a font that is not installed on the system. In my case it was <code>DejaVuSans</code>.</p> <p>You should open the SVG file in a text editor and replace all <code>font-family:DejaVuSans</code> with for example <code>font-family...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: postgres - creating table with array of positive integers<p>Basically I want to put a CHECK for all items of an array to be positive, something like this:</p...
<p>This can be done with <code>0 &lt; ALL</code>:</p> <pre><code>create table mfield ( fields int[] check(0 &lt; ALL (fields)) ); </code></pre> <p><em>db&lt;&gt;fiddle <a href="https://dbfiddle.uk/?rdbms=postgres_14&amp;fiddle=a24db49fc2330246ef64adddf9fdc424" rel="nofollow noreferrer">here</a></em></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Question about values out of bounds of an array in C<p>I have a question about this code below:</p> <pre><code>#include &lt;stdio.h&gt; char abcd(char array...
<p>OP seems to think accessing an array out-of-bounds, something special should happen.</p> <p>Accessing outside array bounds is <em>undefined behavior</em> (UB). Anything may happen.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: 403 Forbidden / authentification blocked by token sequelize<p>So I create my route user and I use this tutorial <a href="https://www.bezkoder.com/node-js-jwt...
<p>While it would have helped if you had provided a screenshot of where you are putting your token on postman, make sure you are using the appropriate header. According to your code, you are searching the 'x-access-token' header, so in postman, you should attach your jwt token to the same header property. It should be ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to write into specific mipmap using Metal kernel?<p>When using GLSL, it's easy writing into specific mipmap level.</p> <p>But I found out it seems missin...
<p>You have two options here:</p> <ol> <li><p>If you are using Metal 2.3 or higher, you can use <code>void write(Tv color, uint2 coord, uint lod = 0)</code> or <code>void write(Tv color, ushort2 coord, ushort lod = 0)</code> methods on <code>metal::texture2d</code>. The problem is, that even with Metal 2.3 <code>lod</c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spring Integration SFTP: Using PrivateKey Credentials<p>I had a few hickups setting up private keys for Spring Integration SFTP.</p> <p>Thought I may share m...
<p>The solution is to instead set the private key for the session factory:</p> <pre><code>DefaultSftpSessionFactory factory = new DefaultSftpSessionFactory(new JSch(), true); byte[] privateKeyBytes = privateKey.getBytes(StandardCharsets.UTF_8); factory.setPrivateKey(new ByteArrayResource(privateKeyBytes)); return setCo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Zod: Create a primitive object from defaults<p>I'm pretty sure this exists, but I haven't been able to find anything about it despite some digging. Say that ...
<p>I know that I am a little late to the party but maybe it will help someone in the future.</p> <p>You could extend your <code>zod</code> schema in the following way:</p> <pre class="lang-js prettyprint-override"><code>const Person = zod.object({ name: z.string().default(''), age: z.number().nullable().default...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calculate availability with dates<p>I have a tibble and want to compute monthly availability (A), defined as</p> <p>A = uptime / (uptime + downtime),</p> <p>...
<p>First, you have inconsistent <code>&quot;tzone&quot;</code> attributes, one is <code>&quot;UTC&quot;</code> and the other is <code>&quot;GMT&quot;</code>. It's minor (and slightly noisy), so I'll preempt the noise (though no change in the results):</p> <pre class="lang-r prettyprint-override"><code>attr(dat$end, &qu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: However you parse the data from the email<p>I am very desperate, I need to get data from each new email, which will be saved to a file on my PC, where I will...
<p>You have to install the EAGetMail package from NuGet</p> <pre><code>Install-Package EAGetMail </code></pre> <p>EAGetMail is a POP3 and IMAP4 component which supports all operations of POP3/IMAP4/MIME/Exchange Web.</p> <p>You can find all the information that you need here: <a href="https://www.emailarchitect.net/eag...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fix "login failed for user.." error in connecting Microsoft SQL server in Python<p>I am receiving a very common error while trying to connect Microsoft SQL S...
<p>Admittedly my python skills are not the best but I'm suspicious of all the single quotes in your connection string.</p> <p>In the error message <code>Login failed for user ' '</code> is that blank value for the use what you <em>actually</em> see or have you stripped that out? If that's what you actually see then I ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you add varible in UWP xaml?<p>I want to add a variable to my xaml.</p> <p>My xaml looks like this</p> <pre><code>&lt;Page x:Class=&quot;UwpTest.MainP...
<blockquote> <p>I want to add a variable to my xaml</p> </blockquote> <p>You could add x:String into resource as variable for example</p> <pre><code>&lt;x:String x:Key=&quot;var1&quot;&gt;Hello&lt;/x:String&gt; </code></pre> <p>For more please refer to <a href="https://docs.microsoft.com/en-us/windows/uwp/xaml-platform...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PhpStorm deployment successful but does not update remote file<p>I am using a shared hosting platform to host my website and I am using PhpStorm as my IDE.</...
<p>The deployment seems to work fine: if it says uploaded then it did.</p> <p>You can use &quot;Compare with Deployed...&quot; on such a file (or &quot;Synchronize with Deployed...&quot; on a folder) to see if it will show any differences: if it shows the difference then we have an issue; otherwise it's a misconfigurat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Build failed gem5 with error file not found when the file exists in fact<p>When I try to build gem5 on wsl2 Ubuntu_20.04, it failed.</p> <p>I use the steps i...
<p>Fine, I have found the key problem. I download the gem5 zip on the windows and cp it to the wsl system. Maybe the windows downloading make the files to a dos format and when I restart from the beginning on a vmware, it works correctly. Thx for all answers.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to split list data and populate to a DataFrame?<p>I have a list of items and want to clean the data with certain conditions and the output is a dataframe...
<p>I'd using a map; try:</p> <pre class="lang-py prettyprint-override"><code>ids = { 5: [0, 2, -1, 3, 4], 8: [0, 2, 4, 6, 7] } datas = pd.DataFrame() for i in item: i = i.split(&quot;|&quot;) long = len(i) data = { &quot;name&quot;: i[ids[long][0]], &quot;unit&quot;: i[ids[long][1]...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to arrange items in ascending order in list Python<p>I have the below files in a directory:</p> <p><a href="https://i.stack.imgur.com/eDN7Z.png" rel="nof...
<p>Do this to sort your files in the order shown in image uploaded in your question:</p> <pre><code>files = os.listdir() files.sort(key=lambda x: int(x.split(&quot;-&quot;)[3])) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: COFF x86_64 relocation types<p>I am working on linker development for an open source project. The target architecture is <code>AMD_X86_X64</code>. In <code>A...
<p>COFF relocation types are enumerated at <a href="https://docs.microsoft.com/en-us/windows/win32/debug/pe-format#type-indicators" rel="nofollow noreferrer">COFF Relocations for x64</a>.</p> <p><code>IMAGE_REL_AMD64_ABSOLUTE</code> corresponds with <code>R_X86_X64_COPY</code> (no relocation),<br /> <code>IMAGE_REL_AMD...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is this method in a class is not getting extended to the next class, instead I see - [Function (anonymous)] in TypeScript<p>register() works fine with th...
<p>Now you are console logging</p> <pre><code>console.log(emp.register); </code></pre> <p>which returns:</p> <pre><code>register() { return `${this.name} is now registered`; } </code></pre> <p>aka a function, if you add parenthesis</p> <pre><code>console.log(emp.register()); </code></pre> <p>it will return</p> <pr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Concat two fields in JSON using jq<p>I would like to have output like this with second IP:</p> <p><code>intranet.site.com : 59.89.8.8</code></p> <p>running t...
<p>Just use <code>+</code> to concatenate the strings:</p> <pre class="lang-bash prettyprint-override"><code>jq -r '.[] | .name + &quot;: &quot; + .networks.v4[].ip_address' </code></pre> <pre class="lang-json prettyprint-override"><code>intranet.site.com: 10.136.95.40 intranet.site.com: 59.89.8.8 intranet.site.com: 57...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to check if a noun exists in a text file with C#?<p>I have tried to find a library in C# that can help me do parts of speech tagging to recognize a noun ...
<p>Your original code has a couple problems:</p> <ol> <li><p>You are splitting by space, so in your case, you get (for example), <code>television,</code> with a comma in your word list. When comparing, you are comparing <code>television</code> with <code>television,</code> so it doesn't match.</p> </li> <li><p>You are ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regular expression with Unicode Characters<p>I need help with a regular expression, I need to catch the characters , ⚡,❓ and others in a string. If this char...
<p>Right, it's lengthy but I interpreted your question as such:</p> <ul> <li>Keep leading/trailing spaces intact;</li> <li>Keep consecutive emoticons intact.</li> </ul> <p>Therefor, try:</p> <pre><code>(?:(?&lt;![\x{000ff}-\x{fffff}\s]|^)(?=[\x{000ff}-\x{fffff}])|(?&lt;=[\x{000ff}-\x{fffff}])(?!$|[\x{000ff}-\x{fffff}\s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: is it possible to detect selfie image in android?<p>I have list of images from <code>MediaStore.images.media</code>. is it possible to detect selfie images? ...
<p>You can try getting EXIF data from images and compare some parameters. Add the following dependency to your build.gradle if you wish to utilize ExifInterface:</p> <pre><code>implementation &quot;androidx.exifinterface:exifinterface:1.3.3&quot; </code></pre> <p>After that you can get EXIF data from photo following ne...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I implement paging logic in C#?<p>I am requesting data from an API with built in paging. I am successfully able to request data (100 rows at a time) ...
<p>With the help of @hina10531 I was able to rewrite the task with success. The issue I am now running into is too many requests (429) as my tier of access to this API only allows 60 calls per minute - another question, another post.</p> <p>Answer below:</p> <pre><code> private static async Task&lt;List&lt;Emplo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to reuse added field in output with logstash<p>My use case is simple. I have a Kafka in input, and some indexes in Elasticsearch (topic name === index na...
<p>You can do it like this:</p> <pre><code>input { kafka { bootstrap_servers =&gt; &quot;kafka:29092&quot; topics =&gt; ['cars', 'bus'] decorate_events =&gt; true codec =&gt; 'json' } } filter { translate { source =&gt; &quot;[@metadata][topic]&quot; target =&g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Translate Excel Formula to Power Query<p>In my Power Query I have a column that shows different durations on certain items, but it displays an error when at...
<p>You can add a custom column with the formula:</p> <pre><code>Duration.FromText( Text.Combine( List.LastN( {&quot;00&quot;} &amp; List.ReplaceValue(Text.Split([Age],&quot;:&quot;),&quot;&quot;,&quot;00&quot;,Replacer.ReplaceValue), 3), ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why are the variables I'm requesting showing up as 0.0 when called from another class?<p>So basically my program is a StudySchedule where it takes user input...
<p>That's not what subclassing is for.</p> <p>A class describes what a given instance can do. &quot;Dog&quot; is a class. &quot;Lassie&quot; is an instance of it.</p> <p>Subclassing is a thing you do to concepts, not instances. You might for example have a class &quot;Animal&quot;, and a subclass &quot;Dog&quot;: Dog s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How would I generate API call via Python while reading data from csv flle? I am using Pandas library and would need some guidance<p>I am still learning Data ...
<p>I think the code works fine except that you have called entire columns of dataframe in the for loop. I think if you modify it to the following you should be fine.</p> <pre><code>api_token = &quot;my_token&quot; df = pd.read_csv('edited_csv.csv') for i in range(len(df)): endpoint = f&quot;/api/mystore/produ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Apply function to each unique value of column seperately<p>I have a dataframe with more than 500 cities which look like this</p> <div class="s-table-containe...
<p>You can do it with groupby methods</p> <pre class="lang-py prettyprint-override"><code>df.groupby('city').apply(rolling_mean) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the reverse result to a sql query<p>I am using the following sql query to get the name of a branch that has submitted a report.</p> <pre><code>SEL...
<p>In the first one you don't really need distinct and also you shouldn't use the old style join anyway:</p> <pre><code>SELECT b_name AS branch from branch where exists (select * from report_activity2 where branch.branch_id=report_activity2.branch_id and report_activity2.week =16 and report_activity2.year =2022); </cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reset png cache in react native<p>When I add some image from my assets folder using require, the image is apparently being taken from a folder <code>.png-cac...
<p>My problem was solved by resetting the react native cache with the command:</p> <p><code>npm start -- --reset-cache</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JS regex pathname match<p>i'm a bit lost about regex. What I want is to create is a simple check and match a path. (regex noob)</p> <p>To clarify;</p> <p>The...
<p>You could simply use <code>.*\/</code></p> <p><a href="https://regex101.com/r/5vvaoO/1" rel="nofollow noreferrer">Regex101 example and description</a></p> <p>If you want to <em><strong>filter-match</strong></em> sections (vs. pages), use: <code>.*\/$</code></p> <p><a href="https://regex101.com/r/SiEOFh/1" rel="nofol...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Updating multiple cells in gspread using Python<p>I'm Inserting values in Google Sheets but the loop doesn't go to the next cell it keeps inserting only in A...
<p>In your script, how about the following modification?</p> <h3>Modified script:</h3> <p>I thought that your commented <code>wks.update()</code> will be able to be used.</p> <pre class="lang-py prettyprint-override"><code>wks.update(&quot;A1&quot;, [[e[&quot;name&quot;]] for e in data[&quot;_embedded&quot;][&quot;even...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ASP.NET Core dual routes for web and api<p>This is for an ASP.NET Core application. A json Web API needs to be added alongside a normal website.</p> <p>So in...
<p>You have to remove the second option from your config</p> <pre><code>app.UseEndpoints(endpoints =&gt; { endpoints.MapControllerRoute( name: &quot;default&quot;, pattern: &quot;{controller=Home}/{action=Index}/{id?}&quot;); }); </code></pre> <p>and make a controller route id optional, since your test for example does...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you convert and append sequence numbers of same named elements to attributes<p>I have this source XML.</p> <pre><code>&lt;?xml version=&quot;1.0&quot;...
<p>If you're using Saxon 10 you should probably use XSLT 3.0 rather than 2.0. That lets you use an <code>xsl:mode</code> element to copy elements, rather than write your own identity templates.</p> <p>Here I've used the <code>position()</code> function to produce the numbering of the <code>line</code> attribute names. ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to select dataframe in R filter max( ) min( ) and conditional value?<p>I have this little fragment of a dataframe:</p> <div class="s-table-container"> <t...
<p>If you want to conditionally select the row with the <code>min</code> and <code>max</code>, you can use the following code:</p> <pre><code>res %&gt;% dplyr::group_by(year) %&gt;% dplyr::filter(year==10 &amp; p.value == min(p.value) &amp; df == max(df)) </code></pre> <p>Please note that in your example <code>r...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ZPL Barcode missing front 2 digit<p>I am trying to print an EAN barcode vertically on a label with below ZPL code:</p> <pre><code>^FO895,273^BY3^BUB,200,Y,N ...
<p><code>^BE</code> is the EAN command. It will calculate the check digit for you.</p> <blockquote> <p>^BE; EAN-13 Bar Code. Description: The ^BE command is similar to the UPC-A bar code. It is widely used throughout Europe and Japan in the retail marketplace. The EAN-13 bar code has 12 data characters, one more data c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The JDK 18.0.1 isn't compatible with Gradle 4.4.1<p>I used Mac Machine and IntelliJ Idea. I found this Compatibility Matrix of <code>Gradel</code> and <code>...
<p>The compatibility matrix you mentioned (<a href="https://docs.gradle.org/current/userguide/compatibility.html" rel="nofollow noreferrer">https://docs.gradle.org/current/userguide/compatibility.html</a>) specifically says no version of Gradle (currently at version 7.4.2) is compatible with Java 18 yet.</p> <p>Your be...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React Native, passing data between screens when using BottomTabsNavigator<p>I am trying to make a react native application. I am using Bottom Tab Navigation,...
<p>In <code>EttermekScreen</code>, you already have this line, <code> const { varisId } = route.params</code>, and grabbing from the props <code>route</code>, so you should be good with it.</p> <p>Assuming you wanna send <code>data</code> in <code>handleBarCodeScanned </code> to <code>EttermekScreen</code> as a paramet...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Full Page Layout with Bootstrap and Vue 3<p>I'm trying to create a Single Page Application with a simple layout of Header -&gt; Content -&gt; Footer using Vu...
<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>&lt;style&gt; #app { display: flex; flex-direction: column; justify-content: space-between; height: 98vh; f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to split a string with space into two lines in python<p>I am trying to split github.com/pmezard/go-difflib v1.0.0 into name and version</p> <p>I tried li...
<p>Considering all string of format <code>github.com/pmezard/go-difflib v1.0.0</code></p> <pre class="lang-py prettyprint-override"><code>path = foldername + &quot;/example.txt&quot; print(path) file = open(path) Lines = file.readlines() file.close() # close file List = [] for line in Lines: try: link,...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: format pandas column with strings and numbers<p>I have a pandas dataframe, which consists of numbers and strings. It looks something like this:</p> <pre><cod...
<p>You can replace <code>,</code> to <code>.</code>, so possible use <code>to_numeric</code> with <code>errors='coerce'</code> for missing values for <code>-</code> (and another no numbers values) and then use <code>map</code> with <code>if-else</code> for processing <code>NaN</code>s:</p> <pre><code>f = lambda x: '${:...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to deliberately fail a network request in a Cypress test<p>We have added a new feature to our app for offline continuity, and I need the API requests not...
<p>The intercept command has an option <code>forceNetworkError</code> for this scenario</p> <p><strong>Blanket fail for all requests</strong></p> <pre class="lang-js prettyprint-override"><code>cy.intercept('**/api/**/*', { forceNetworkError: true }) .as('failed') cy.wait('@failed').should('have.property', 'error') ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: With Service account, Not getting any files / folder list with PHP<p>What will extra setting to get files / folder from google drive API with service account...
<p>When you use a web client. It pops up and requests authorizaiton. In this way a user is granting your application access to their data. So a file.list will return the files on the users google drive account.</p> <p>The same thing is happening with your service account. Only service accounts are pre authorized. Yo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to draw prespctive image in android canvas<p>i have searched about how to draw prespctive image in canvas like in the picture but i dont find anything th...
<p>This is possible by magic method of <code>canvas</code> <code>drawBitmapMesh</code>.</p> <p>This is example from my project:</p> <pre><code>static void Draw( Canvas canvas, Rect rt, Ini ini ){ final int sections = 256; Point size = new Point(); float[] verts = Mesh.GetVertices( rt, sections, ini, size );...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RequestError: RequestError(400, search_phase_execution_exception failed to create query For input string in elasticsearch<p>Below is my dictionary</p> <pre><...
<blockquote> <p>Issue 1: if &quot;fields&quot;: [&quot;id^12&quot;,&quot;description^2&quot;, &quot;name^2&quot;] then i am getting error RequestError: RequestError(400, 'search_phase_execution_exception', 'failed to create query: For input string: &quot;brazil@fifa.com&quot;'</p> </blockquote> <p>Above issue you are g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django Rest API JWT authentication - No active account found with the given credentials<p>I have a question concerning the Django Rest Framework JWT auth pro...
<p>My colleague found the issue.</p> <p>In my settings.py file my config for ACCOUNT_AUTHENTICATION_METHOD is set to email.</p> <p>settings.py:</p> <pre><code>ACCOUNT_AUTHENTICATION_METHOD = &quot;email&quot; </code></pre> <p>So the HTTP command should look like this:</p> <pre><code>http http://127.0.0.1:8000/api/token...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use on-mouse function in Racket?<p>I am trying to make a text mover, which is the text will move to where I clicked. Also, when I press &quot;left&quo...
<p>Read <a href="https://docs.racket-lang.org/teachpack/2htdpuniverse.html#%28form._world._%28%28lib._2htdp%2Funiverse..rkt%29._on-mouse%29%29" rel="nofollow noreferrer"><code>on-mouse</code></a> description: function called with <code>on-mouse</code> has arguments <code>state x y event</code> and different types of mo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find the coordinate of center point on an edge of OSMNX<p>I am looking to find the coordinates (Lat, Lon) of a center point on any edge of a network of OSMNX...
<p>Use the <code>interpolate</code> function from shapely.</p> <pre><code>import osmnx as ox G=ox.graph_from_place('San Diego', network_type='drive') nodes, edges = ox.graph_to_gdfs(G, nodes=True, edges=True) </code></pre> <p>Derive midpoint for every edge of the graph.</p> <pre><code>edges['midpoint'] = '' for i in ra...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: composed boolean for checking undefined or null<p>I have a composed computed boolean of possible <code>undefined</code> or <code>null</code> values. Even tho...
<p>TS will not narrow the type based on conditions like that.</p> <p>You need to define a new variable and use a branch to call your function. You have 2 options here:</p> <pre><code>const finalVal = alternativeToAnotherMaybeNullOrUndefined || anotherMaybeNullOrUndefined if (finalVal) { anyFun(finalVal); } </code></p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Best way to choose different child class to create new instance based on a boolean<p>Hi my question is simple.<br /> I have 3 classes, <code>BaseObject</code...
<p>I'd recommend going with the Factory approach, such as:</p> <pre><code>public class BaseObjectFactory { public static BaseObject create(boolean isGood) { return isGood ? new GoodObject(...) : new BadObject(...); } } </code></pre> <p>If you want a Design Pattern approach. In my actual code, I'd proba...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: xcodebuild command but it exited with error code 74<p>I am trying to run my react-native project. With the android app I have no problem, but when I run</p> ...
<p>I though that somehow, my xcodeproj was influencing my build, so I tried to remove the fbsdk, as I didn't need anymore, and this steps were necessary:</p> <p>1- Removing in package.json</p> <blockquote> <p>&quot;react-native-fbsdk&quot;: &quot;^3.0.0&quot;,</p> </blockquote> <p>2- Removing directly in the file <stro...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can't delete document in Firestore from React/Redux<p>I'm building a CRUD application using redux toolkit and firestore, and I cannot figure out how to delet...
<p>The <code>deleteDoc()</code> functions takes <a href="https://firebase.google.com/docs/reference/js/firestore_.documentreference" rel="nofollow noreferrer"><code>DocumentReference</code></a> of the document and not the snapshot. Also try using <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Referenc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error while importing 'en_core_web_sm' for spacy in Azure Databricks<p>I am getting an error while loading 'en_core_web_sm' of spacy in Databricks notebook. ...
<p>I suspect that you have cluster with autoscaling, and when autoscaling happened, new nodes didn't have the that module installed. Another reason could be that cluster node was terminated by cloud provider &amp; cluster manager pulled a new node.</p> <p>To prevent such situations I would recommend to use <a href="ht...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Select text in TextField on Double Click in Flutter Windows App<p>Is there an option to select the text written in TextFormField or TextField on double click...
<p>Put your TextField inside GestureDetector</p> <pre><code>GestureDetector( onDoubleTap:() { if(_controller.text.isNotEmpty) { _controller.selection = TextSelection(baseOffset: 0, extentOffset:_controller.text.length); } }, child: TextField(controller: _controller, ), ) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Random Input From A List<p>I want to display a random input option for the user and if the condition is not met it picks another random input from the list.<...
<p>I think this <em>might</em> be closer to what you're looking for. It will only show the first question, and then it will keep displaying a random question until you type &quot;smores&quot;. It also saves all of the answers in a dictionary where the question is the key index</p> <pre class="lang-py prettyprint-overri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating a new column based on values obtained from different column, using mutate() and case_when function in R<p>I am a student relatively new to R and hav...
<p>You can try this using <code>dplyr</code> <code>rowwise</code> function which treat each row separately</p> <pre><code>library(dplyr) df |&gt; rowwise() |&gt; mutate(Outcome = case_when(any(c_across(Y1:Y4) == 1) ~ &quot;1&quot; , all(is.na(c_across(Y1:Y4))) ~ NA_character_ , TRUE ~ &quot;0&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 read last two line of values and assign values to previous line from log file using power shell<p>I have log text file (solution.log). How to read las...
<p>To read the last line you could use this:</p> <pre><code>Get-Content solution.log -tail 1 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pass Setter from Parent to Child Blazor<p>In Blazor Server Side, how can I pass a setter method from a parent component to a child? This seems super simple b...
<p>You haven't shared the child, but I'm assuming you call <code>SetMediaOption?.InvokeAsync(true);</code> at some point in your child. Your event handler is void, which (I believe) will not trigger <code>StateHasChanged</code> authomatically. So you should add <code>StateHasChanged()</code> at the end of the <code>Set...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert list from python into comma separated values in python with jinja or javascript<p>I want to synchronize my dropzone allowfiles templates with ...
<p>You should use <a href="https://jinja.palletsprojects.com/en/3.1.x/templates/#working-with-automatic-escaping" rel="nofollow noreferrer">safe filter</a> like this:</p> <pre class="lang-html prettyprint-override"><code>&lt;script&gt; let allowed_files = &quot;{{ config.UPLOAD_EXTENSIONS|safe }}&quot;; console...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: template or partial inheritance with Vue.js<p>I'm making a client side website with only HTML+CSS+JS for my portfolio, I've been copy-pasting my header and f...
<p>I solved using a Vue.js components <a href="https://vuejs.org/guide/essentials/component-basics.html" rel="nofollow noreferrer">https://vuejs.org/guide/essentials/component-basics.html</a></p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Select named range via VBA and let user edit cell directly<p>I have a small issue, but I cannot find the code for it. For simplicity I made a simple example....
<p>This should work:</p> <pre class="lang-vb prettyprint-override"><code>Private Sub lsb_dataval_man_DblClick(ByVal Cancel As MSForms.ReturnBoolean) Dim named_range As String named_range = Me.lsb_dataval_man AppActivate ThisWorkbook.Windows(1).Caption 'switches focus from userform to workbook ThisWorkbook.Names(na...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Types for referencing another schema in mongoose<p>I would like to ask a question in <a href="https://stackoverflow.com/questions/18001478/referencing-anothe...
<p>Yes, it is possible to use types other than <code>ObjectId</code> for <code>ref</code>s, but Mongoose recommends using <code>ObjectId</code>s unless you have a good reason to do otherwise.</p> <p>From the <a href="https://mongoosejs.com/docs/populate.html#populate" rel="nofollow noreferrer">documentation for Populat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why C++ template array length deduction need to be like "f(T (&a)[N]"?<p>Use C++ template to know the length of C-style array, we need this:</p> <pre><code>#...
<p>In this function declaration</p> <pre><code>template&lt;class T,size_t N&gt; size_t length(T a[N]){ return N; } </code></pre> <p>the compiler adjusts the parameter having the array type to pointer to the array element type.</p> <p>That is this declaration actually is equivalent to</p> <pre><code>template&lt;class T,...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Understanding broadcasting and arithmetic operations on different dimension tensors<p>I'm currently working on computing various similarity metrics between v...
<p>You could use fancy indexing on both input tensors to unsqueeze a dimension such that <code>A</code> and <code>B</code> have a shape of <code>(1, 867, 768)</code> and <code>(621, 1, 768)</code> respectively. The subtraction operation will then automatically broadcast the two tensors to identical shapes.</p> <pre><co...
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 keep references to game objects from prefabs in Unity?<p>I am making a game where I have to spawn enemies. Currently I have the enemy saved...
<blockquote> <p>Is it possible to keep the references?</p> </blockquote> <p>No, you cannot save a reference to an in-scene object in a .prefab file.</p> <blockquote> <p>If not, what are some alternative ways of spawning things that do not require prefabs?</p> </blockquote> <p>The best way to go about this would be to:<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ansible-playbook without --ask-vault-pass?<p>How can I skip entering the vault password for an ansible playbook?</p> <p>I run the playbook with <code>--ask-v...
<p>Add to your environment the path to the file to store the vault password (to make the change permanent, add this line to your <code>~/.bashrc</code> file):</p> <pre class="lang-sh prettyprint-override"><code>export ANSIBLE_VAULT_PASSWORD_FILE=~/.vault_pass.txt </code></pre> <p>Write the vault password to that file:<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Updates to code on Xamarin iOS application are not applying at runtime/debug<p>I have an application which I am developing. Everything has been going smoothl...
<p>I was able to solve the problem with the following steps:</p> <ol> <li>Open the location of my iOS project (note that I also have Android projects and other libraries, but I only did this for the iOS location)</li> <li>Delete the <strong>bin</strong> and <strong>obj</strong> folders</li> <li>Build project, observe t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: openGL with glew - file missing<p>I tried getting <a href="https://github.com/fmor/demo_ffmpeg_vaapi_gl" rel="nofollow noreferrer">this repository</a> to wor...
<p>You should be able to find the missing header file from here which is the official site: <a href="http://glew.sourceforge.net/" rel="nofollow noreferrer">http://glew.sourceforge.net/</a></p> <p>If not, you can defiantly find the missing header here: <a href="https://chromium.googlesource.com/external/github.com/goog...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: react-hooks/exhaustive-deps warning with custom IntersectionObserver hook<p>I have this custom react hook copied more of less straight from this dev.to artic...
<p>The warning exists because, in some cases, the <code>.current</code> value referenced in the body of an effect will be different from the <code>.current</code> value referenced in the cleanup function. In general, if you do</p> <pre><code>useEffect(() =&gt; { // code that references someRef.current return () =&g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting error when uploading csv to Snowflakes<p>Trying to upload a csv of size 100GB and getting this error after compressed files are created in tmp</p> <p...
<p>Loading very large files (e.g. 100 GB or larger) is not recommended. Try to chuck the files into 100-250 MB size(compressed) and try.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do i make my div square responsive to clicks<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="...
<p><a href="https://dmitripavlutin.com/javascript-event-delegation/" rel="nofollow noreferrer">Event delegation</a> is the best solution for this. Instead of adding listeners to all the grid squares add <em>one</em> to the parent element and have that watch for events from its child elements as they &quot;bubble up&quo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In Enterprise Architect What does it mean if the package icon has a red one?<p>We have a remote repository in postgres which is accessed by ODBC, no process ...
<p>That means this package is marked as a namespace root.<br /> You can set this property using the option<br /> <strong>Develop | Source Code | Options | Set Package as Namespace Root</strong> <a href="https://i.stack.imgur.com/RraNd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RraNd.png" alt="en...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can you read and delete chunk of a file?<p>I am using ofstream and ifstream to read a chunk from a file post it over middleware (DDS) to another process and ...
<blockquote> <p>I am using linux, so I can use any linux APIs directly, but would probably prefer a pure c++ approach. I can't really see any good options here. i/ostream does not appear to let you do this. Options like sed will (I think) end up using more memory by copying.</p> <p>Are there any better mechanisms for d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ImportJson() print the data only when I return the function in Google App script<p>I want to implement a Loop on <code>ImportJson()</code> but it doesn't wor...
<p>I assume you want to join results from several urls in one big list. You can use Array.concat, like this</p> <pre><code>function ImportData1() { veunueid_arr = [&quot;KovZpZA7AAEA&quot;, &quot;KovZpa2gne&quot;]; var results = []; for (var Veunue_id1 = 0; Veunue_id1 &lt; 2; Veunue_id1++) { v...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hikari NoSuchMethodError on AWS EMR/Spark<p>I am trying to upgrade <code>EMR</code> from <code>5.13</code>to <code>5.35</code> using <code>spark-2.4.8</code>...
<p>Just in case, anyone else faces this, the fix was <a href="https://github.com/sbt/sbt-assembly#shading" rel="nofollow noreferrer">shading</a> (Process that allows renaming packages on the Uber jar), I basically had to make sure the dependency I use doesn't get overridden with the one that's stale in <code>EMR-5.35.0...