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: Preventing user to access data of other user's data in PHP<p>I have two rows of data of different users having id= 54 and 55. If user having id=54 get signed...
<p>Please share your code. Otherwise, here is an example of how it can be done. Once a user is signed in, keep track of his user id by session. You could use that to pass to your select statement or if you insist on keeping it in the URL;do an if - else check before displaying the data. For example.</p> <pre><code>$se...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i add 2 functions in void main before run app , in Flutter?<p>I need to run 2 function inside my main.dart file, before run app. One is the bottom na...
<p>There are two separate parts to your question, and the answers are different.</p> <ol> <li><p>You're making main() async, and that handles your localization. If you want even more control, we had a discussion about using async functions before rendering the first frame on HumpDayQandA this week, and went into how yo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert Specific Field of Rows into seperated columns in oracle<p>i've face with a challenging case. I really appreciate if someone helps ... imagine we have...
<p>If the no of dates are maximum 3, You can use the conditional aggregation method along with ROW_NUMBER, to achieve your result -</p> <pre><code>SELECT ID, MAX(CASE WHEN RN = 1 THEN DATE ELSE NULL END) Date1, MAX(CASE WHEN RN = 2 THEN DATE ELSE NULL END) Date2, MAX(CASE WHEN RN = 3 THEN DATE ELSE...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to create array of errors in mongoose validation based on certain conditions?<p>i'm trying to generate array of errors based on certain conditions , how ...
<p>Create an <code>array</code> in the <code>validator</code> function and <code>throw</code> this array as <code>new Error()</code>. Then use this array in the callback of the <code>save()</code> function.</p> <p><code>validate</code></p> <pre><code>validate: { validator: function (username) { let ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to track source of rules (functions) in bazel? Is there any order of initialisation or query to discover it?<p>How to find places where the rule is defin...
<p>In general, <code>query --output=build</code> will emit a comment indicating where a target's rule class is defined:</p> <pre><code>$ bazel query --output build //src/proto/grpc/core:stats_py_pb2 py_proto_library( name = &quot;stats_py_pb2&quot;, deps = [&quot;//src/proto/grpc/core:stats_descriptor&quot;], ) # R...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can't update extension in chrome web store, no errors<p>I've been struggling to get my update to go through. I incremented my version in the manifest and upd...
<p>There were a few .pem files in a random node module. I hadn't realize I should just remove node_modules from the zipped up package, but for some reason it only errored out and warned me about including .pem files sometimes. Most of the time updating the package seemed to work fine and didn't error. Very strange. Reg...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: django admin Inline model is not storing id for related table<p>I've combine two models into one in admin panel using <code>admin.TabularInline</code> and fo...
<p>I've used the <code>save_formset</code> method instead save_related My code looks something like this and it works</p> <pre><code>def save_formset(self, request, form, formset, change): for inline_form in formset.forms: inline_form.instance.user = request.user inline_form.instance.name = &quot;sa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python script automatic interaction without 'expect' or 'pexpect'<p>I'm trying to write a python script that call a bash script with user interaction. For se...
<p>Two options come to mind:</p> <ol> <li>use the shell to send the input:</li> </ol> <pre class="lang-py prettyprint-override"><code>con = subprocess.Popen(&quot;{ echo; echo; } | ./confirm.sh&quot;, shell = True, stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr = subprocess.PIPE, universal_newlines = False) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Copy Text from a webpage to Excel sheet using VBA, error "Object Required"<p>I want the delivery status of a shipment from a website.</p> <p>For this I need ...
<p>I think the problem is that the data is retrieved through a XHR request. You want to query the API endpoint <code>https://track.aftership.com/api/v2/direct-trackings/batch</code>. This will give you a response as JSON object, which you will need to parse (use Google to find JSON libraries for VBA). Your code would l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ASP.NET Core 6.0 MVC - Populating a viewmodel from list<p>Currently I am dabbling in ASP.NET Core 6.0 and got stuck on trying to populate a view model.</p> <...
<p>In your controller:</p> <pre class="lang-cs prettyprint-override"><code>public IActionResult Gallerie(int id) { ... var fotoGeneratedNames = _context.Foto .Where(x =&gt; fotoIds.Contains(x.Id)) .Select(x =&gt; x.generatedName) .ToList(); return View(fotoGeneratedN...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I update data records by trim a text array in PostgreSQL<p>I have a DB where one column is a <code>_text</code> type which means an <code>ARRAY</code...
<p>You can go on with the current query <em>except for using row_number() function</em> such as</p> <pre><code>UPDATE institutional_review_boards AS i0 SET attached_sites = (SELECT ARRAY_AGG(TRIM(e)) FROM (SELECT UNNEST(attached_sites) e FROM institutiona...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Starting new session on every curl request<p>My question is about SESSIONS in PHP.</p> <p>I am using the following code to start a new session when user open...
<p>PHP uses cookies to manage sessions. In order to use cookies with <code>curl</code> you need to enable a <code>cookie jar</code></p> <p>For example:</p> <pre><code>curl --cookie-jar cookies.txt http://www.example.com </code></pre> <p>Note: <code>cookies.txt</code> must be placed somewhere your instance of <code>cur...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to escape Athena INSERT INTO error if string contains single quote and comma?<p>I have to INSERT a record into Athena, I have used below INSERT INTO quer...
<p>You need to escape single quote in <code>'Waxpol Vinyl &amp; Leather Polish (35', Ltr.)'</code> otherwise it becomes <code>'Waxpol Vinyl &amp; Leather Polish (35'</code> string followed by some invalid SQL. You can do it by using extra single quote:</p> <pre class="lang-sql prettyprint-override"><code>insert into da...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can a NAS that is only connected to the router be accessible by my computer that is connected to the router via ethernet?<p>I'm looking to purchase a Synolog...
<p>Yes! Just as computers on the same local network can talk to each other, your computer will be able to talk to your NAS (which is really just another type of computer). NAS stands for Network Area Storage. The preferred usage of a home NAS is to plug it into your router and communicate with it via the network interf...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Expression does not evaluate to a constant<p>I've just started to learn C++ and I don't understand this error:</p> <pre><code>std::string AFunction(const std...
<p>The <strong>problem</strong> is that in standard C++ the size of an array must be a <strong>compile time constant</strong>. This means that the following is incorrect in your program:</p> <pre><code>size_t s = str.length(); char inProgress[s]; //not standard C++ because s is not a constant expression </code></pre> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Linux rename s/ - regex for wildcard single characte r<p>I have found a simple solution to my actual requirement, but I would still like to understand how to...
<p>So, regular expressions aren't globs. If you wanted to keep the middle (e.g. catch the season/ep) and replace everything else, you'd need to use <a href="https://perldoc.perl.org/perlre#Capture-groups" rel="nofollow noreferrer">capture groups</a>. e.g. <code>s/^.*(S\d+E\d+).*\.(.*?)$/Foo-$1.$2/</code></p> <p>This wo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is Reentrant Lock a Object level lock or Class level lock?<p>I see in many tutorials for Reentrant lock, they create a new Reentrant lock and resource is inj...
<p>In one sense, a <code>ReentrantLock</code> is neither a class-level nor an object-level lock. In a more practical sense, it's the same as either of them.</p> <p>Really, you should forget about &quot;class level&quot; and &quot;object level&quot; locking. Those are not useful distinctions.</p> <p>You can use <em>any<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create something like a sniffer?<p>I want to create an app to monitor and save the received data (for test my program!). The device I'm working with h...
<p>After sometimes, figuring out that I should read two endpoint asynchronously not synchronously.</p> <pre><code>std::tuple&lt;std::vector&lt;uint8_t&gt;, std::vector&lt;uint8_t&gt;&gt; USB::getData() { OVERLAPPED ov1, ov2; ov1.hEvent = CreateEvent(NULL, false, false, L&quot;CYUSB_IN&quot;); ov2.hEvent = CreateE...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ( Nuxt's Vue-router ) How to differentiate path ending with "/" and without<p>Using the <a href="https://nuxtjs.org/docs/configuration-glossary/configuration...
<p>Have you tried this?</p> <pre class="lang-js prettyprint-override"><code>const router = createRouter({ history: createWebHistory(), routes: [ { name: 'articles', path: '/articles/:category', strict: true, component: resolve(__dirname, 'pages/-overview.vue') }, ... ] }) </...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: divs appear above the footer instead of inside the footer<p>I am just practicing CSS/HTML and am trying to make a google clone. Everything else seems fine bu...
<p>It is inside the footer. Just this property:</p> <pre><code>background-color: rgb(32, 33, 36); </code></pre> <p>which you set for <code>*</code> gets inherited, and the bg color makes you think text it outside the footer. Comment it out for a while and you will see.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NextJS hydration errors (Text content does not match server-rendered HTML.)<p>I have two errors only when the app is deployed, not in dev mode nor the local ...
<p>I got an answer from <a href="https://github.com/vercel/next.js/discussions/38263" rel="nofollow noreferrer">GitHub discussions</a> on next.js, I will paste it here for anyone facing the same problem as me:</p> <p>Quote <a href="https://github.com/icyJoseph" rel="nofollow noreferrer">icyJoseph</a>:</p> <blockquote> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get JSON values in angular<p>I want to print values &quot;Image Management&quot; and &quot;Order Management&quot; from the following JSON. based on Im...
<p>You can't iterate an object with <code>forEach</code>. You can use <code>Object.entries</code> to convert the object to an array of key value pairs and iterate through that like so:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre cl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: updating one data.table from another data.table in R<p>im trying to update one table (bigDta, fields smiles) using data from another table, but it produces a...
<p>i have solved the problem..in case that anyone need it, this is solution:</p> <pre><code> bigData[ dtChembl , on=.(compound_id = chembl_id) , `:=` ( smiles= canonical_smiles , comment = paste(comment,'smiles added from chemblDB by chemblID;') , filteringStep=12 ) ] </code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to customize a bottom navigation bar in flutter with floating action button and and also curve design to the left and right?<p><a href="https://i.stack.i...
<pre><code>import 'package:flutter/material.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( debugShowCheckedModeBanner: false, title: 'Bottom Nav Bar...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Close bottomsheet and when open it again the changes will still be there<p>I made a bottomsheet with a couple of items, I make some changes into it and apply...
<p>When you close a bottom sheet fragment it's view gets destroyed. So when you create it again it reinitialize all of it's views hence the data is lost.</p> <p>So, if you want to keep the data saved you can use a viewModel, and in onStop of bottom sheet fragment you can store all of the required data in view model and...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React request to wrong endpoint<p>my react app is running on <a href="http://www.frontend.com" rel="nofollow noreferrer">www.frontend.com</a> it makes an API...
<p>Do you restarted the environment after you added the <code>API_URL</code> inside the .env? Normally it returns <code>undefined</code> when the Node.js does not detect a newly variable. Try to restart.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Principals of type Application cannot validly be used in role assignments<p>I am deploying a new App Registration via Terraform and then assigning a Role in ...
<p>I managed to work this out. Working config is:</p> <pre><code>resource &quot;azuread_service_principal&quot; &quot;eventhub&quot; { application_id = azuread_application.eventhub_auth.application_id } resource &quot;azurerm_role_assignment&quot; &quot;receiver&quot; { scope = resource.azurerm_even...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting syntax error when using CASE to check if column is more than 0, else use other column<p>I am trying to use the CASE function to check if the <code>di...
<p>I think you don't need a case statement, everything could be in one query with some logic:</p> <pre class="lang-sql prettyprint-override"><code>SELECT * FROM product_variants WHERE discount_price &gt;= 60 OR (discount_price &lt;= 0 AND price &gt;= 60) </code></pre> <p>Assuming <code>discount_price</code> cannot be n...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to shift column one only with a particular number and keep all the column as such in a text file<p>I have a text file with 30 colums. I want to shift col...
<p>Something like that?</p> <pre class="lang-bash prettyprint-override"><code>awk '{$1 -= 0.01; print}' data.txt </code></pre> <p>If you want to save first column formatting:</p> <pre class="lang-bash prettyprint-override"><code>awk '{$1 = sprintf(&quot;%0.4f&quot;, $1 - 0.01); print}' data.txt </code></pre> <p>And for...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fail to interact with smart contract as owner<p>I'm trying to interact with a smart contract (<a href="https://en.wikipedia.org/wiki/Solidity" rel="nofollow ...
<p>Add the &quot;from&quot; parameter in the function call. If you don't add it then the contract sees your address as &quot;0x00000000000000&quot;. It seems like a wallet like myetherwallet cannot call owner-only functions.</p> <p>I'm adding the correct code.</p> <pre><code>class Test { private string contractAbi ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Run function when global variable is updated lua<p>Hello I have a lua global variable used as a settings config made of a list of arrays. I have buttons that...
<p>The pattern you are looking for here is called &quot;Observer&quot;. You need to send some kind of 'signal' whenever you change some setting. And you need to implement 'observers' that will be watching for that 'signal' in order to do something, like update the state of your buttons.</p> <p>So for instance, you coul...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it hacky to do RF=ALL + CL=TWO for a small frequently used Cassandra table?<p>I plan to enhance the search for our retail service, which is managed by Dat...
<p>The quick answer to your question is yes, it is a hacky solution to do <code>RF=ALL</code>.</p> <p>The table is very small so there is no benefit to replicating it to all nodes in the cluster. In practice, the tables are so small that the data will be cached anyway.</p> <p>Since you are running with <a href="https:/...
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 put a button to open the Flyout in Maui<p>I am making a mobile and pc application and i want to add a button to open the flyout because i d...
<p>To open the FLyout with Button .</p> <pre><code> private void Button_Clicked(object sender, EventArgs e) { Shell.Current.FlyoutIsPresented = true; } </code></pre> <p>To hide the Bar , on top of your xaml on the page</p> <pre><code>Shell.NavBarIsVisible=&quot;False&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 make table cells that contain images to resize without braking?<p>I have an image that I divided into several small images, each contained in a cell. ...
<p>Like I already said within the comments it would be the easiest way to wrap all the images in a single <code>div</code> and use <code>CSS-Grid</code> on the container. You have a total width of 1001px to cover as such create a 1001-column grid with <code>grid-template-columns: repeat(1001, 1fr);</code></p> <p>Then d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Join 2 dataframes in pandas using join<p>I have two data frames df1 and df2</p> <p>df1</p> <pre><code>id name ada1 mike ad23 tom cev2 tim </code></pre...
<p>Use <code>pd.merge</code>:</p> <pre><code>&gt;&gt;&gt; df2.merge(df1, on='id', how='left') id month sales name 0 ada1 1/11 23 mike 1 ada1 4/11 34 mike 2 ad23 3/12 34 tom 3 cev2 4/11 32 tim </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: autocmd does not detect *.ott files<p>I'd like to have syntax highlighting on files with the <code>.ott</code> extension (using <a href="https://github.com/p...
<p>This is a conflict with the <code>zipPlugin</code> that is distributed with vim (<code>/usr/share/vim/current/plugin/zipPlugin.vim</code>), and which recognizes a <code>.ott</code> file as a zip archive. Hacky fix to remove that extension from those recognized by <code>zipPlugin</code>:</p> <pre><code>&quot; ~/.vimr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use JavaScript to fetch all HTML elements containing text,and filter out the specified element and its children?<p>In simple terms</p> <blockquote> <p...
<p>Your expectations are not quite accurate according to the code you've shown in your question. For example: the top-level text node which includes <code>Don't get code:</code> is a valid node according to your criteria.</p> <p>You can use the <a href="https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker" rel="...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Generate a random number or null<p>I want to generate a random number or null. So lets say i have the option to fill in a number or leave a field blank (null...
<p>Following my comment above, I would suggest you generate a first random number between n options (based on how many odds you want the number to be null) and based on that outcome, decide to return null or a random number.</p> <p>The function since can return a nullable int, must declare the type as nullable using <c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What are the downsides of using -gline-tables-only instead of -g?<p>The debug info generated with <code>-g</code> for my project adds a substantial amount of...
<p>-gline-tables-only really does only record the address-&gt;line number part of the debug information. So break setting by file &amp; line will mostly still work (some of the inlining information doesn't go in the official &quot;line table&quot;, and that will be missing), and you will see line information in backtr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does eslint automatically exclude node_modules/?<p>I don't have an .eslintignore file and .eslintrc has no ignore patterns. When I run the following: <code>....
<p>node_modules is ignored by default</p> <p>It is in the doc: <a href="https://eslint.org/docs/latest/user-guide/configuring/" rel="nofollow noreferrer">https://eslint.org/docs/latest/user-guide/configuring/</a></p> <p>relevant part:</p> <blockquote> <p>In addition to any patterns in the .eslintignore file, ESLint alw...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I am simply not able to bring the PAHO / Eclipse MQTT Android Service into an Android Studio project<p>I am simply not able to bring the PAHO / Eclipse MQTT ...
<p>GOTO settings.gradle and <strong>replace</strong></p> <pre><code>repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) </code></pre> <p><strong>with</strong></p> <pre><code>repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS) </code></pre> <p>That installed MQTT lib into my project.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use .replace() with "<p>I am currently working on getting data from an API, and I want to remove some characters from what it returns.</p> <p>What I get back...
<p>As others commented, parse your data as JSON and then get the value using your currency variable, something like this (not sure about what framework you are using, so the currency replacement may vary from what's shown here):</p> <pre><code>data = {&quot;usd&quot;:323.67}; value = data.${currency}; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: If my datastore transaction fails, will code after the transaction run?<p>What happens if my datastore transaction fails and I have some more code that is su...
<p>If the transaction fails you will get an exception. If you don't handle the exception it will propagate.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Conditional rendering with useEffect / useState, why is there a delay in the DOM when switching components?<p><strong>Intro / Context</strong></p> <p>I am tr...
<p>You set your visual option right after you set your <code>appState</code>, this is why <code>appState.activeImage</code> in <code>changeVisualOption</code> is not updated because state updates in React is asynchronous. You can either use <code>useEffect</code> to update visual option when the <code>appState</code> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: difference between simple ret and _exit function in nasm x8664<p>I have been in pain for the last couple of days with x8664 assembly (using nasm on macOs). I...
<p>I'll answer the question in the title:</p> <blockquote> <p>difference between simple <code>ret</code> and <code>_exit</code> function</p> </blockquote> <p><code>ret</code> is used to return to the caller, while <code>_exit</code> is a request that the operating system terminate the program immediately, so it will ex...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Resource timing doesn't add up in Chrome / Edge dev tools<p>What could be the reason that the timing of a resource loading doesn't add up?</p> <p>As can be s...
<p>This is a known issue from making queries to <code>localhost</code>. <a href="https://stackoverflow.com/questions/28762402/ajax-query-weird-delay-between-dns-lookup-and-initial-connection-on-chrome-but-n">Related SO question here</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cutting a DataFrame with pandas.iloc doesn't change its copied variable? (Copied with "=" not pd.copy())<p>I have a DataFrame <code>df</code> :</p> <pre clas...
<p>When you do:</p> <pre><code>df2 = df </code></pre> <p>both df2 and df point to the same object.</p> <p>If you were to modify one in place (<code>df.loc[&quot;earth&quot;, &quot;mass&quot;] = 100</code>), the &quot;other one&quot; (actually same) would be modified.</p> <p>However when you do:</p> <pre><code>df = df.i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# linq remove duplicates from the top and bottom of the list and keep the duplicates in the middle<p>C# linq remove duplicates from the <em>top</em> and <em...
<pre><code>var myList = new List&lt;int&gt; { 1, 1, 2, 2, 3, 4, 5, 5, 9, 9 }; var topDublicate = myList.First(); var lastDublicate = myList.Last(); myList.RemoveAll(l =&gt; l == topDublicate); myList.RemoveAll(l =&gt; l == lastDublicate); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set Relogin on JWT expire MERN?<p>I am facing an issue, my app is getting crashed with JWT Token Expired Error. I have changed the secret key also bu...
<p>The issue is likely your <code>catch</code> statement:</p> <pre class="lang-js prettyprint-override"><code>const auth = async (req, res, next) =&gt; { try { // ... } catch (error) { console.log(error); res.status(403).json({ message: &quot;Token is not valid&quot; }); throw Error(); // &lt;--- Re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ElasticSearch Illegal list shortcut value [id] "Update By Query"<p>I get <code>Illegal list shortcut value [id].</code> trying to update this document with t...
<p>I ended up doing a check if the object is a list vs. an object and it seems to be working.</p> <pre><code>for (event in ctx._source.events ){ if(event instanceof List &amp;&amp; event.size() &gt; 0) { if(params.event_ids.contains(event[0].id)){ event[0].location = params.location; break; } }e...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: shifting result using <<<p><a href="https://i.stack.imgur.com/MqBeP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MqBeP.png" alt="enter ...
<p>Your NEW problem is one of precedence. <code>+</code> has higher precedence than <code>&lt;&lt;</code> so your statement is parsed like <code>value = value_high &lt;&lt; (18 + value_low)</code>.</p> <p>To solve this, add parentheses explicitly, like: <code>value = (value_high &lt;&lt; 18) + value_low</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: my chat application crashes when ever in try to react on a message<p>When ever I try to send messages from device to device the app works fine a ,But when ev...
<p>You have a NPE for the argument <strong>pathString</strong> but I cannot find it in your code. You should add a null-check to the relevant part and see if it works.</p> <pre><code>E/MessageQueue-JNI: java.lang.NullPointerException: Can't pass null for argument 'pathString' in child() </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Antdesign table not rerendering on new column values<p>I am having trouble rerendering the columns of my table, the library i am using is ant design and I am...
<p>The <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort" rel="nofollow noreferrer">sort() method</a> sorts the elements of an array in place and returns the reference to the same array, now sorted. But you should pass a new array into setOrderedColumn to rerender</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JHipster + Vue : How to use with PrimeVue<p>As title stated, I want to use <a href="https://www.primefaces.org/primevue/" rel="nofollow noreferrer">PrimeVue<...
<p>So after some hours, I finally integrate PrimeVue with JHipster. I am going to post my findings here for begineers who want to do the same and for my future reference.</p> <p>First of all, check your Vue version for JHipster generated application. In your project file, open <code>package.json</code> and find <code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Where does PostgresSql localtime come from?<p>I've inherited a PostgreSQL database backup that was created with a version around 9.3. During the restore I'm ...
<p>I'm sure there's a more elegant solution, but the simple solution was just to copy one of the files in the timezone directory and rename to localtime.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NodeJS + Express + PDFKit + node-qrcode: Not able to add QR code to PDF<p>I am trying to implement a QR code in a PDF document using PDFkit (<a href="https:/...
<p>toDataURL() is a asynchronous method. I didn't wait for it to complete. Closed the PDF document after it completed, and that worked.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replace white space with a dash using javascript inside a hyperlink?<p>I'm trying to format a bunch of auto generated links containing white spaces, into ver...
<ul> <li>You don't need to modify the innerHTML, just use <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/getAttribute" rel="nofollow noreferrer">Element.getAttribute</a> and <a href="https://developer.mozilla.org/en-US/docs/Web/API/Element/setAttribute" rel="nofollow noreferrer">Element.setAttribute<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: find memory allocated between time A and time B which remains unfreed at time C<p>I know that Visual Studio allows you to compare memory between two time sna...
<p>Assuming the target platform is Windows since VS2019 is mentioned, I've found a tool similar to what you are looking for. <a href="https://www.codeproject.com/Articles/11221/Easy-Detection-of-Memory-Leaks" rel="nofollow noreferrer">https://www.codeproject.com/Articles/11221/Easy-Detection-of-Memory-Leaks</a></p> <p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bundle R with a python exe application (using Pyinstaller)<p>I'm working on a python application using Eel framework and I'm using the python subprocess libr...
<p>Posting my solution in case anyone falls into the same issue:</p> <p>I ended up bundling the whole R by executing this pyinstallter command: <code>python -m eel flight_checker.py web --add-data &quot;map.R;.&quot; --add-data &quot;C:\Program Files\R;.&quot; --icon=web\drone.ico --clean</code></p> <p>Notes:</p> <ol> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What permissions do I need to grant a user that wants to view the definition of a stored procedure, function, view or trigger?<p>If I want to allow a user to...
<p>With a few exceptions like <code>pg_authid</code>, all PostgreSQL metadata tables are readable by <code>PUBLIC</code>, that is everybody. In particular, you can get the function definition with</p> <pre><code>SELECT prosrc FROM pg_proc WHERE proname = 'myfunc'; </code></pre> <p>(The source of new-style SQL functions...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calculate quantiles with grouping for multiple columns with dplyr<p><a href="https://www.tidyverse.org/blog/2020/03/dplyr-1-0-0-summarise/" rel="nofollow nor...
<p>Here, we don't need both <code>everything()</code> and <code>is.numeric</code>. In addition, there should be a <code>,</code> between the <code>where</code> expression and the lambda expression</p> <pre><code>library(dplyr) library(tidyr) df %&gt;% group_by(grp) %&gt;% summarise(across( where(is.numeric), ~ qu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is the following code using options pattern?<p>I'm reading this article on <a href="https://dotnetcoretutorials.com/2019/09/27/creating-windows-services-in-n...
<p>Here is another way to write the same code....</p> <pre><code>public static void MyRun (System.ServiceProcess.ServiceBase service) { service.Service&lt;LoggingService&gt;(); service.EnableServiceRecovery(r =&gt; r.RestartService(TimeSpan.FromSeconds(10))); service.SetServiceName(&quot;TestService&quot;); ser...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' Can't configure antMatchers after anyRequest<p>I get this error afte...
<p>When you call super.configure(http) it actually does the following:</p> <pre><code> protected void configure(HttpSecurity http) throws Exception { this.logger.debug(&quot;Using default configure(HttpSecurity). &quot; + &quot;If subclassed this will potentially override subclass configure(H...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pass variable from custom hook to TPL file<p>I have created a custom module. Which simply registers a hook, whose only function is to obtain a list of produc...
<p>in which TPL are you trying to print the <strong>$caronteProducts</strong> variable ?</p> <p>You'll need to fetch/render your TPL inside your hook, and the variable will be available there as there is no global scope..</p> <p>Something like :</p> <pre><code>$this-&gt;smarty-&gt;assign(array('caronteProducts', $caron...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Navbar logic - assigning a class to a button when navigating to a user route except for a specific user<p>I am trying to create a navbar with buttons that ga...
<p>I think the issue lies with your <code>!userInfo.username</code> logic. That is returning a false or true value, and is not doing any comparison to the logged in user. So what that template literal is evaluating to is:</p> <pre><code>&quot;users/false&quot; </code></pre> <p>Instead, I think you could change the log...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Performance indices for unequal datasets in R<p>I wanted to do the performance indices in R. My data looks like this (example): <a href="https://i.stack.imgu...
<p>Perhaps just do a left join, and compare the columns directly?</p> <pre><code>library(dplyr) left_join(d2,d1 %&gt;% rename(simData=Data), by=&quot;Time&quot;) </code></pre> <p>Output:</p> <pre><code> Time Data simData &lt;dbl&gt; &lt;dbl&gt; &lt;dbl&gt; 1 1 57 52 2 3 88 78 3 5 1...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there any way no to return a document if the word present in one list<p>I have document below</p> <pre><code>[ {'id':1, 'name': 'sachin messi', 'descripti...
<p>You can use <code>must_not</code> <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-bool-query.html" rel="nofollow noreferrer">query</a> inside <code>bool</code> from Elasticsearch.</p> <pre class="lang-json prettyprint-override"><code>{ &quot;query&quot;: { &quot;bool&quot;: {...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: typecast GzipStream to MemoryStream<p>I need to write Gzip decompressed output to file (in binary).<br /> Here is the powershell code i'm currently using:</p...
<p>You can't typecase <code>GzipStream</code> to <code>MemoryStream</code> but you can decompress to a file directly, without decompressing the whole input to memory first.</p> <pre class="lang-sh prettyprint-override"><code>$out = [IO.File]::Create(&quot;$PWD\out.bin&quot;) $gzip = [IO.Compression.GzipStream]::new( $i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Identify if Socket server is running from client side<p>When the socket server is not running, client-side java script codes creates a connection, and then ...
<blockquote> <p>There is apparently no way to detect if socket server is running or not.</p> </blockquote> <p>Not specifically, by design. Differentiating <em>why</em> the connection fails is a security risk, per the WebSocket interface spec:</p> <p><a href="https://websockets.spec.whatwg.org/#feedback-from-the-protoco...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: swift how to initialize a Codable Object<p>I want to initialize a Codable Object, for example:</p> <pre><code>struct Student: Codable { let name: String? ...
<p>add this to <code>Student</code>:</p> <pre><code>init(name: String?, performance: String?) { self.name = name self.performance = performance } </code></pre> <p>and use it like this:</p> <pre><code> var student = Student(name: &quot;Bruce&quot;, performance: &quot;A+&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 hide element with style in angular<p>I'm new in angular and I want to make something like:</p> <p><code>document.getElementById('div').style.display =...
<p>I think you can try this solution</p> <pre><code>showModal() { const div = document.getElementById('modal'); if(div) { div.style.display = 'none' } } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Open/read multiple .tif images from multiple folders on different levels<p>So, the scheme is that I have a folder, inside which there are other folders with ...
<p>The <code>glob</code> module helps with this.</p> <pre><code>from glob import glob import os.path parent_dir = &quot;C:\\folder_1&quot; # Or wherever your parent folder is all_tif_file_paths = glob(os.path.join(parent_dir, &quot;**&quot;, &quot;*.tif&quot;), recursive=True) </code></pre> <p>The <code>&quot;**&quot;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Not getting updated state value in socket callback react native<p>I have listend an event in customhook and when that event works, I have to do some logic th...
<p>Try to log your data first to make sure the data is there, then set your state with the data.</p> <pre><code>const [state, setState]= useState([]); const _onReceived = (data) =&gt; { // Here is your data from socket console.log(data); // Then set state value with data setState(data); } useEffect(()=&gt;{ ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unity problem with creating my own fps controller<p>So I'm making a first person player controller for my game, but I have one small problem. My code works f...
<p>You need to specify what gameObject the script is attached to and the hierarchy of the gameobjects involved in the scene. Probably you are translating one gameObject based in others gameObject transform and they are not parented, so if they don't move along you dont get the outcome you want.</p> <pre><code>gameObjec...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting different weeks for my two january orders<p>I am just facing issue with getting right week for my orders which I want put the numbers of orders in di...
<p>In order to use week numbers that start on Jan 1, you need to calculate your own week numbers instead of the standard week number.</p> <pre><code>$day_of_year = date('z', strtotime($date) ) + 1; $week = ceil( $day_of_year / 7 ); print $week; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert from react router dom v5 to react router dom v6 when using useRouteMatch<p>I am having issues with what the new syntax should be when it comes to mig...
<p>App</p> <ul> <li>Switch the <code>Switch</code> component for the <code>Routes</code> component that replaced it in v6</li> <li>Move <code>MyComponent</code> into the <code>Route</code> component's <code>element</code> prop, passed as a <code>ReactNode</code>, a.k.a. JSX.</li> <li>Include a trailing route path wildc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: iOS Core Data CloudKit sync not working on AppStore<p>I've built an app where I want t sync my data between devices. I've started from the default code creat...
<p>Ok, this is a little embarrassing. Typical RTFM moment. What you need to do, is deploy the CloudKit container schema to the production environment. Once I did this everything started to work as it should!</p> <p>The manual to read: <a href="https://developer.apple.com/documentation/cloudkit/managing_icloud_container...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I need to delete rows that are newer than 2019<p>I am sending files from 12 years back to the server. For some reason, 2019 did not transfer in full and I ha...
<p>It is not <code>DELETE * FROM</code>, but <code>DELETE FROM</code>.</p> <pre><code>DELETE FROM mlode WHERE kd &gt;= DATE '2019-01-01'; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PowerShell workflow failed when Install-ADServiceAccount<p>I have a workflow script that runs on local server and will do Install-ADServiceAccount after rebo...
<p>Case solved with creating scheduled task in WorkFlow and trigger the task after restart to run Install-ADServiceAccount. As far as I know, the user credential (or AD cred.) in WorkFlow might have changed after restart.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I specify nursery-size for Android in .NET MAUI app?<p>I am new to .NET MAUI and Xamarin.</p> <p>I'm building an Android app using .NET MAUI.<br /> I ...
<p>You should be able to do it by adding a file by the name of <code>env.conf</code> make sure the build action is set to <code>Android Environment</code></p> <p>In that file then you can add the config something like this:</p> <pre><code>MONO_GC_PARAMS=bridge-implementation=tarjan,nursery-size=128m,soft-heap-limit=512...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas array filter NaN and keep the first value in group<p>I have the following pandas dataframe. There are many NaN but there are lots of <code>NaN</code> ...
<p>Take only values that aren't nan, but the value before them is nan:</p> <pre class="lang-py prettyprint-override"><code>df = df[df.col1.notna() &amp; df.col1.shift().isna()] </code></pre> <p>Output:</p> <pre><code> col1 27 357.0 247 357.0 304 58.0 334 237.0 </code></pre> <hr /> <p>Assuming all values are ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replace single quote ( ' ) from each record in list JS<p>so I have a list like this:</p> <pre><code>[ '32350.0*51355000*9999', '6604.5*23680102*9999', ...
<p>The single quotes denote the <code>type</code> of data that you're representing... You're representing a <code>String</code> (a text element), so you get <code>''</code> around the elements in the console.</p> <p>That's just the way it is.</p> <p>If you were to render them, say on a webpage, they wouldn't have the q...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Architecture, Logging user activity on rest backend server for handle custom user UI<p>I want to make logging module user activity on the rest backend server...
<p>Is it fast enough? With indexes? Then keep what you have. Don't optimize if you don't need to.</p> <p>If you find that this approach is unacceptably slow, you could denormalize the data and create a table like:</p> <pre><code>user_id project_id last_access_time </code></pre> <p>You probably already have a table with...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does docker bother of context if we do not copy all<p>In various sites of Docker official web, it warns about the folder that is sent to <code>docker dae...
<blockquote> <p>Let say that my build context is a 1GB folder, but in <code>Dockerfile</code>...</p> </blockquote> <p>The Dockerfile is normally transferred as part of the build context. Perhaps the easiest place to see this is in the <a href="https://docs.docker.com/engine/api/v1.41/#tag/Image/operation/ImageBuild" r...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check for precision loss when converting string to float<p>I have a string representing a rational number.</p> <p>I want to convert the string to a float wit...
<blockquote> <p>How does one catch this precision loss?</p> </blockquote> <p>One doesn't, at least not with anything in the standard library; none of the <code>strto*</code> conversion functions will tell you if the value cannot be represented exactly.</p> <p><strong>Edit</strong></p> <p>I know that's not terribly help...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to extract values from column to another two?<p>I use Pandas first time. There is a regex rule that extract mm, yy from string <code>0122</code> or <code...
<p>You can try</p> <pre class="lang-py prettyprint-override"><code>df = pd.DataFrame({'column_name': {0: '0122', 1: '012022', 2: '01/22', 3: '9922', 4: '03/23'}}) df_filtered = pd.DataFrame(df['column_name'].apply(extractMMYY).tolist(), columns=['MM', 'YY']) </code></pre> <pre><code>print(df_filtered) MM YY 0...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get cell address based on value of another cell?<p>I have a column in date format (A column).</p> <p>In the <code>E1</code> cell, I enter a certain da...
<h2>Answer</h2> <p>The following formula should produce the behaviour you want:</p> <pre><code>=ADDRESS(MATCH(E1,A:A,0),1,4) </code></pre> <h2>Explanation</h2> <p><code>=MATCH</code> searches a specified range for a specified value, and returns the index of that value (it's row number). In this case, the value to searc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pass input data from Angular to NodeJS<p>I am currently learning the MEAN stack and I'm wondering how I can pass data from the inputs in .html to my nodeJS a...
<p>First, your form should apply the two-way binding.</p> <pre><code>&lt;form (ngSubmit)=&quot;register()&quot;&gt; &lt;input type=&quot;text&quot; name=&quot;surname&quot; [(ngModel)]=&quot;input.surname&quot; /&gt; &lt;input type=&quot;text&quot; name=&quot;name&quot; [(ngModel)]=&quot;input.name&quot; /&gt; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bitwise XOR on unsigned char is terminating program without error<p>I'm trying to create a 64 bit integer as class in C++, I know this already exists in the ...
<p>You're trying to dereference invalid pointers. You want to get rid of a lot of those <code>*</code>s.</p> <pre><code>unsigned char a = 1; unsigned char b = 2; unsigned char c = 3; unsigned char* result = (unsigned char*) malloc(sizeof(unsigned char)); std::cout &lt;&lt; &quot;Trying&quot; &lt;&lt; std::endl; *resu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: postgresql jsonpath support<p>I am running postgresql 12 and am trying to use jsonpath.</p> <p>I'd like to use jsonb_path_query_first to get the length of an...
<p>You can use the <code>.size()</code> method for this:</p> <pre><code>test# select jsonb_path_query_first( '{&quot;a&quot;:3,&quot;b&quot;:6,&quot;s&quot;:[1,2,3,4,5], &quot;d&quot;:{&quot;v&quot;:4}}'::jsonb, '$.s.size()'::jsonpath ); jsonb_path_query_first ═════════════════...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to fix scrapy resetting connection<p>I keep getting an error when trying to scrapy several urls with scrapy when using Selenium Middleware.</p> <p>Middle...
<p><code>the target machine actively refused it</code> means that the server responds, but the specified port (52304) is closed. Could you check if you can access it? Maybe it is a local firewall that is blocking it?</p> <p>UPD: it looks like you're calling <code>self.driver.quit()</code> in each <code>process_request<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Align span to center of div<p>I am trying to find a way how to understand and solve this problem with centering span in a div. My problem is that when the wi...
<blockquote> <p>Answer for Question: &quot;Align span to center of div&quot;</p> </blockquote> <p>To align the <code>span</code> tag to the center of the <code>div</code>, just use &quot;CSS Flexible Box Layout&quot; directly to the <code>span</code> tag.</p> <pre><code>.table-cell-service { display: flex; justify-...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create index with concatenating two columns in Procedure/Function using pl/sql<p>I want to create index of concatenating two columns, using this query...
<p>Try this:</p> <pre><code>'create index trx_cst_indx ON '| | t_name || ' (trx_date,customer_id) local unusable'; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Correct way to do Ledger system in MongoDB<p>So we are trying to work out in what format do we store money values in MongoDB we are talking dealing with cent...
<p>There are couple of ways to do this:</p> <pre><code>{ price: 9990, currency: &quot;USD&quot; } //See it is not string </code></pre> <p>As in the above example, you can store. Here the thing is that number of decimals is fixed at any point of time.</p> <p>The scale factor is consistent for a currency; i.e. same scali...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert elements in an array into integer type<pre><code>let datas = &quot;1,5,8,4,6&quot; </code></pre> <p>I want to convert this datas into an array. I use...
<p>Works like charm</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>let datas = "1,5,8,4,6" console.log(datas.split(",").map(elem =&gt; Number(elem)))</code></pre> </div> </div...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is the first char* null in this char **?<p>I am working on a few functions that will work together to initialize a list of <code>char *</code>'s as a com...
<p>C uses <a href="https://en.wikipedia.org/wiki/Evaluation_strategy#Call_by_value" rel="nofollow noreferrer">pass by value</a>.</p> <p><code>commandList</code> is a local variable in <code>insertCommand</code>, completely independent of <code>testCommands</code> in <code>initializeCommands</code> (except <code>comman...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set column value based on string (mis)match between two other columns?<p>I want to create a match variable in a dataframe that</p> <ul> <li>is 1 if th...
<pre class="lang-r prettyprint-override"><code>library(tidyverse) data &lt;- tribble( ~str1, ~str2, ~match, &quot;left&quot;, &quot;right&quot;, &quot;-&quot;, &quot;right&quot;, &quot;somewhat left&quot;, &quot;-&quot;, &quot;left&quot;, &quot;very left&quot;, &quot;-&quot;, &quot;right&quot;, &quot;right&q...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: cx_Freeze ImportError: No module named 'kivy-deps.gstreamer'<p>I am trying to create an exe file from my python code via cx_Freeze. When I run my setup.py fi...
<p>Try to use <code>&quot;kivy_deps.gstreamer&quot;</code> (with underscore) instead of <code>&quot;kivy-deps.gstreamer&quot;</code> (with hyphen) in the <code>build_exe_options</code>.</p> <p>The corresponding import statement would namely read</p> <pre><code>import kivy_deps.gstreamer </code></pre> <p>not</p> <pre><c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filtering tuples within a range from a reference list<p>I have a reference list of tuples containing different range of values.</p> <pre><code>[(1042, 1056),...
<p>There are a number of issues with your code. Firstly, you need to check <em>both</em> values of every tuple, since either one could be in range, but not necessarily <em>both</em>. Secondly, it's inefficient to constantly re-create a <code>range</code> object to make a simple bounds check, and your implementation als...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why Multipart form "restream" from gateway microservice isn't working and attached file isn't resent?<p>I have a controller in gateway microservice that acce...
<p>The main stuff I was missing was putting the Http headers per specific multipart form's parts. They should be identical to what has been sent to the gateway service.</p> <pre><code> public ResponseEntity upload(@ApiParam(name = &quot;file&quot;, value = &quot;Файл&quot;, required = true) MultipartFile file) ...