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: Logi Analytics: write rows in a table in XML<p>How do I write a table in the Logi XML? I start with: </p> <pre><code>&lt;PanelContent Height="1000"&gt; ...
<p>Lumpi,</p> <p>For dynamic rows (where a row is displayed for each row in your datasource), add Label elements under each DataTableColumn element, like so:</p> <pre><code>&lt;DataTable ID="tblPreview" Width="1000" ResizableColumns="True"&gt; &lt;DataTableColumn ID="colLabel" Header="Label"&gt; &lt;Label Capti...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: mysql take N random from group<p>I'm trying to build a query that it would be easy with OVER(), but mysql doesn't have these analytical features...</p> <p>I...
<p>Probably the simplest way to do this in MySQL (or most databases) is just to use <code>union all</code>. Unless you have a lot of questions (many thousands), the performance should be fine:</p> <pre><code>(select q.* from questions q where idTopic = 1 order by rand() limit 2 ) union all (select q.* from quest...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Powershell Invoke-Sqlcmd restarts the scripts from the beginning after an error<p>I have a <code>.sql</code> file which is similar to the below</p> <pre><co...
<p>Looks like this is an issue with the SQL Server itself. Microsoft has confirmed this issue at <a href="https://support.microsoft.com/en-us/help/4010159/fix-invoke-sqlcmd-cmdlet-executes-a-query-statement-multiple-times-if" rel="nofollow noreferrer">https://support.microsoft.com/en-us/help/4010159/fix-invoke-sqlcmd-c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Uncaught ReferenceError: XXX is not defined<p>I made a simple digital clock in JavaScript:</p> <pre><code>window.onload = function runMiniClock() { var time...
<p>Because <code>runMiniClock</code> is not a global function, it's a local name of the function expression that you assign to <code>window.onload</code>.</p> <p>That <code>eval</code>-string you are passing to <code>setTimeout</code> is however evaluated in the global scope, where it does not find the function to be ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Custom Indexes on TimeScaleDB Hypertable<p>I'm using a TimeScaleDB and PostgreSQL to manage timeseries data.</p> <p>When optimizing the table is it recommen...
<p>TimescaleDB creates an index on the time dimension by default. If your queries often select data on values from other columns, it can be helpful to create indexes on such columns as you would do with normal tables. However, in the case of TimescaleDB all indexes should be compound and include the time dimension colu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to use scoped variant of transmute and still keep first column in dplyr?<p><strong>Question</strong></p> <p>I use time-series data regularly....
<p>We can use <code>if/else</code> inside the function. </p> <pre><code>library(dplyr) library(ggplot2) data(economics) economics %&gt;% transmute_at(vars(date:psavert), ~ if(is.numeric(.)) .* 10 else .) # A tibble: 574 x 4 # date pce pop psavert # &lt;date&gt; &lt;dbl&gt; &lt;dbl&gt; &lt;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to access a specific string from pickle loaded file?<p>I have an array of model pickle files I'm loading into a new variable within a for loop, and I'm a...
<p>Try this:</p> <pre><code>for i in range(len(model_files)): infile = open(model_files[i], 'rb') model = pickle.load(infile) infile.close() print(type(model).__name__) </code></pre> <p>This will give you class names and in this case <code>'LogisticRegression'</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to apply validation in real time while typing itself [Typescript]<p>I'm new to Angular. The closest question I found was:</p> <ol> <li><a href="https://...
<p>Hi I've read the comments, if you don't want to change the html code , to achieve your goal you have to add this:</p> <pre><code>import { Component, DoCheck, ViewChild } from "@angular/core"; import moment from "moment"; @Component({ selector: "app-timeselector", templateUrl: "./timeselector.component.html", ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Count on mysql GROUP BY<p>I would like to count the number of unique days each user visits my site using the following two (simplified) tables:</p> <pre><co...
<p>If I understand your question right I think this is what you want:</p> <pre><code>SELECT u.userid, u.firstname, u.lastname, COUNT(DISTINCT CAST(v.visitdate AS DATE)) AS visits FROM users u LEFT JOIN visitors v ON v.userid = u.userid GROUP BY u.userid, u.firstname, u.lastname </code></pre> <p>This will show you th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I get an svg symbol to reference another symbol in an external file?<p>I'm trying to reference a symbol inside a symbol in an external file, but can'...
<p>The external svg is invalid as it's missing an xlink namespace definition i.e. xmlns:xlink="http://www.w3.org/1999/xlink". Once I fixed that the circle shows up fine in Firefox.</p> <pre><code>&lt;svg&gt; &lt;use xlink:href="test.svg#ext-sym" x="0" y="0" width="100" height="100" ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: encoding / decoding special characters in python 2.7<p>Trying to do some reverse engineering using the Raspberry Pi. I am piping the output of a Can Analyzer...
<pre><code>&gt;&gt;&gt; print '3631B043'.decode('hex').decode('iso-8859-1') 61°C </code></pre> <p>The first <code>decode</code> decodes the hex to bytes. The second <code>decode</code> converts from bytes using Latin-1 (aka ISO-8859-1) to Unicode. At this point, you have a proper Unicode string, which can be further...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extracting data from a file and sort it in a new file with powershell<p>I'm working on a script which should give me the Time per Request of an Invoke ID. Th...
<p>Seeing your last comment, and if I understand the question correctly, this should do it:</p> <pre><code>$result = (Get-Content -Path 'X:\TheInputFile.txt').Trim() | Where-Object { $_.Length -gt 8 } | Group-Object @{Expression = {$_.Substring($_.Length - 8)}} | # group by InvokeID (last 8 characters of the trim...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular logs error to console before raising promise.catch<p>I feel like I am going a little crazy, but Angular appears to throw an error for a promise even ...
<p>angular by default logs all errors to console. </p> <p>angular also provides a way to override this behavior. <code>$exceptionHandler</code> is a global service that is given a chance to process any exceptions ($http, errors during $digest, etc).</p> <p>If you add this piece of code:</p> <pre><code>myApp.factory(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In EF core, after adding an entity in one class, how do I access the entity from a different class without calling SaveChanges()?<p>I have a moderately compl...
<p>This is by design according to <a href="https://docs.microsoft.com/en-us/dotnet/api/microsoft.entityframeworkcore.dbset-1?view=efcore-3.1" rel="nofollow noreferrer">summary from DbSet</a>:</p> <blockquote> <p>The results of a LINQ query against a DbSet{TEntity} will contain the results returned from...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel multiple guard in blade<p>How make multiple watch same div to admin and manager using middleware?</p> <p>Admin middleware</p> <pre><code>public fun...
<p>why not do this?</p> <pre class="lang-php prettyprint-override"><code> Blade::if('managerOradmin', function () { return auth()-&gt;check() &amp;&amp; (auth()-&gt;user()-&gt;role == "Administrator" || auth()-&gt;user()-&gt;role == "Manager"); }); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How inject 3 instances of same type with different dependence by Guice?<p>I am using Guice to manager my class dependence. I have a LogicHandler class which ...
<p>Assuming I am understanding your question correctly, you would like to pick a particular concrete implementation to bind based on a particular parameter. One way to do this is to create a module that takes as a constructor the parameters you need for deciding which module to bind. The logic to bind the particular c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python 3: How to use subprocess.run() as admin (windows 10)<p>I need to run the following information in windows command line. Someone kindly helped me with ...
<p>You're almost there but you cannot use <code>runas</code> because it will prompt you for password. You need something similar that allows you to provide password in the command line, it is:</p> <p><a href="https://docs.microsoft.com/en-us/sysinternals/downloads/psexec" rel="nofollow noreferrer">https://docs.microso...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adding svgr to create-react-app via craco<p>I want to use <a href="https://react-svgr.com/docs/webpack/" rel="noreferrer">svgr's webpack plugin</a> with crea...
<p>It looks like CRA supports converting SVGs by default, thus making craco+svgr redundant.</p> <pre><code>import { ReactComponent as GoogleLogo } from "../assets/images/googlelogo.svg"; </code></pre> <p><code>GoogleLogo</code> is a component now.</p> <p><code>ReactComponent</code> is a required magic string.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kotlin and discriminated unions (sum types)<p>Does Kotlin have anything like discriminated unions (sum types)? What would be the idiomatic Kotlin translation...
<p>The common way of implementing this kind of abstraction in an OO-language (e.g. Kotlin or Scala) would be to through inheritance:</p> <pre><code>open class OrderMessage private () { // private constructor to prevent creating more subclasses outside class New(val id: Int, val quantity: Int) : OrderMessage() ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does Autocomplete in TwoTerm mode find the second term?<p>When I have TwoTerm selected for autocomplete mode and I do a search with "john smith is" the f...
<p>No, these results do not exist in the index but the phrases <code>is a</code> <code>is active</code> <code>is the</code> <code>is an</code> <code>is also</code> do exist in the index.</p> <p>Please take a look at the <a href="https://azure.microsoft.com/en-us/blog/autocomplete-in-azure-search-now-in-public-previe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Setting a variable based on TypeScript Generic<p>Is it possible to set a variable based on a TypeScript Generic? </p> <pre><code>class Foo&lt;T&gt; { cons...
<p>What I see is that you are mixing value and type level. We need to understand the difference, you need to have real value for given type to assign it, you cannot just assign a type.</p> <p>I believe this is what you are looking for:</p> <pre><code>class Foo&lt;T&gt; { constructor(key: T extends number ? 'myNumbe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Select query to show missing values per day as 0<p>I have one table with product id's and another with daily data for these products. When there is no data I...
<p>You can <code>cross join</code> to get the rows and then <code>left join</code> to bring in the data you want:</p> <pre><code>select p.id, c.date, coalesce(d.value, 0) as value from products p cross join (select distinct date from daily) c left join daily d on d.product = p.id and d.date = c.date; </...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add Node data and Link data dynamically in GoJS?<pre><code> myDiagram.model = new go.GraphLinksModel( [ { key: "Alpha", color: "lightblue" }, { k...
<p><strong>Node data</strong> (source: <a href="http://www.gojs.net/latest/api/symbols/Model.html" rel="noreferrer">GoJS docs, class Model</a>): </p> <blockquote> <p>If you want to add or remove node data from the nodeDataArray, call the <a href="http://www.gojs.net/latest/api/symbols/Model.html#addNodeData" rel="no...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: LLVM - Atomic Ordering Unordered<p>I'm working on a library that heavily relies on bitwise operations, where the most important operate on shared memory. I w...
<p>The short answer is: whatever your problem is, <strong>unordered</strong> is screamingly unlikely to be the solution !</p> <p>The longer answer is...</p> <hr /> <p>...the <a href="https://releases.llvm.org/3.8.1/docs/LangRef.html?highlight=atomic#memory-model-for-concurrent-operations" rel="nofollow noreferrer">LLVM...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to store the values of two lists in a single dictionary where values of first list is a key and the values of second list are attributes?<pre><code>road=...
<p>Use <a href="https://docs.python.org/3.3/library/functions.html#zip" rel="noreferrer"><code>zip</code></a> and <a href="https://docs.python.org/3.3/library/functions.html#func-dict" rel="noreferrer"><code>dict</code></a> built-in functions.</p> <pre><code>dict(zip(road,distance)) </code></pre> <p><strong>Example:<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting subviews of type UIView in loop of cellForRowAtIndexPath<pre><code>for progressView:UIView in cell.IBimgCellImage.subviews as UIView{ //do someth...
<p>You cast is wrong, subviews is an array of UIView, so use [UIView]</p> <pre><code>for progressView:UIView in cell.IBimgCellImage.subviews as [UIView] { //do something } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How get multiselect values from form using Golang?<p>I have a multiple select input in my form and I'm trying to get the selected values in my handler, but I...
<p>You can't/shouldn't use the <a href="http://golang.org/pkg/net/http/#Request.FormValue"><code>Request.FormValue()</code></a> function because that only returns 1 value. Use <code>Request.Form["new_data"]</code> which is a slice of <code>string</code>s containing all the values.<br> But note that if you don't call <c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: WPF DataGrid Slow Loading during render<p>I have a WPF DataGrid with almost 8000 Rows. It's taking approx. 25 seconds to load. Any clues how do I improve its...
<p>DataGrid does a lot of stuff but it also has a lot of overhead. </p> <p>ListView / GridView is more work but is faster.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to run tests with jest.each<p>I am trying to load files into an array and then run tests on them. This is my code:</p> <pre class="lang-js prettyprin...
<p><a href="https://jestjs.io/docs/en/api#describeeachtablename-fn-timeout" rel="nofollow noreferrer"><code>test.each</code></a> expects a table value as input. which means an array of arrays. But that is fixed automatically so don't worry about it.</p> <p>But the call order is important here! Notice that the tests are...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Set port in next.js<p>one application is running on port 3000 and I want to run another application on a different port of the default port. How I cha...
<p>This work for me</p> <pre><code> &quot;scripts&quot;: { &quot;dev&quot;: &quot;next -p 8080&quot; }, </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you refer to an xml node that has two namespace definitions?<p>I have an xml message from a 3rd party that has a node:</p> <pre><code>&lt;ClinicalDoc...
<p><code>ClinicalDocument</code> has no prefix and it has an <code>xmlns="urn:hl7-org:v3"</code> namespace declaration, which means that its namespace is <code>urn:hl7-org:v3</code>. The rest of the namespace declarations there are completely irrelevant for the purpose of selecting this particular element.</p> <p>So w...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: mongodb - capped collections with nodejs<p>I'm trying to set up and update some capped collections in MongoDB using Node.js (using the native MongoDB driver)...
<p>Regarding your questions 1 - 4 about capped collections and creating them automatically, there are several ways to do this. On the one hand, you could run a script to initialise your database so that it has the capped collections available to your client when you run it for the first time. On the other hand, you cou...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Zend Framework 2 Doctrine prePersist not working<p>I am trying to use the doctrine listener prePersist in my entity class but it is not working.</p> <p>My e...
<p>I have just figured it out, the prePersist method was protected not public.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Efficiently create indexes in couchbase<p>I have a huge database on which the users can query using multiple filters. I have about 10 filters which the user ...
<p>That is a difficult question to answer without any knowledge of your system. Here are my recommendations:</p> <p><strong>1)</strong> Couchbase 6.5 has an index recommender, install it on your machine and run the most common queries there. It will give you the proper index for each one.</p> <p><strong>2)</strong> O...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does the main function in Java reside in a class?<p>I just started studying Java. And the main function of the program always resides in a class. </p> <...
<p>Probably for the same reason you put question marks at the end of a question: that's just how they decided it's done. </p> <p>The <code>main</code> method is the result of a convention that says "this is how the entry point's method signature should look" which doesn't exempt it from language semantics.</p> <p>Jav...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Anchor replace with '#id1' , '#id2' , '#id3' ... Sphinx<p>I named using number in rst file but after building it the anchor is replaced with '#id1', '#id2', ...
<p>First of all, the underlines and overlines must be the same length as the text.</p> <p>Unfortunately you want anchors that start with numbers, but Sphinx does not support this. You could instead use an arbitrary anchor that starts with a string. See the documentation for <a href="https://www.sphinx-doc.org/en/maste...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to pause a video after a certain time? video.js<p>I've been messing with video.js whilst learning javascript but can't seem to figure out how to make the...
<p>Check the <code>currentTime</code> in the <code>timeupdate</code> event callback:</p> <pre><code>var pausetime = 2; // stop at 2 seconds var myPlayer = videojs('example_video_1'); myPlayer.on('timeupdate', function(e) { if (myPlayer.currentTime() &gt;= pausetime) { myPlayer.pause(); } }); myPlaye...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get a file from a plugin in Microsoft Dynamics 365<p>I´ve installed Dynamics Version 1612 (8.2.2.112) (DB 8.2.2.112) on-premises. I wrote a plugin to connect...
<p>If you have an URL then get unzip and process.</p> <p>Example how to get and unzip file. </p> <pre><code>WebClient wc = new WebClient(); using (MemoryStream stream = new MemoryStream(wc.DownloadData("URL"))) { using (var zip = new ZipArchive(stream, ZipArchiveMode.Read)) { ... } } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python losing list of objects<p>When I execute this program I get an empty list: </p> <p>I am expecting it to create the list of objects and append the obje...
<p>Why are you using 'multiprocessing' to create address objects? Different process don't share memory, i.e. they don't share objects. This is not a python thing, it's the same whatever language you use.</p> <p>Replace these three lines</p> <pre><code> process = multiprocessing.Process(target=self.worker, args...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Setting up Supervisord on a AWS AMI Linux Server<p>I'm trying to get supervisor working to make sure my queue system is always running.</p> <p>Here are the ...
<p>Here is the solution I went with. AWS AMI includes pip for installing Python applications. Here are the setup commands:</p> <pre><code>$ sudo pip install supervisor $ echo_supervisord_conf $ sudo su - $ echo_supervisord_conf &gt; /etc/supervisord.conf </code></pre> <p>After you install supervisor you will need to ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sychronous animations in knockout binding<p>I want to apply animations when certain properties change with my knockout models (specifically a movement). I ne...
<p><a href="http://api.jquery.com/queue/" rel="nofollow">jQuery queues</a> are your friend. With them you can serialize asynchronous animations.</p> <p>Usually they are used implicitly for all animation effects you do on one element, i.e. tied to the animated element <em>itself</em>:</p> <pre><code>$("element").show(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Moq Verify() on a mocked HttpClientHandler can't access the Content object because it is disposed<p>I'm doing a mock HttpClient so I can unit test my code. I...
<p>I've solved this with the help of the other answers, by reading the Content in the message handler itself and storing it, then resetting the stream.</p> <pre><code>public class FakeHttpMessageHandler : HttpMessageHandler { public string Content { get; set; } public virtual HttpResponseMessage Send(HttpReq...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Interal hyperlink to automethod in Sphinx<p>I am using Sphinx to document a python project. The documentation includes both an API reference and a user guid...
<p>You don't need to define a label. A hyperlink to <code>method_b</code> can be created using the <code>:py:meth:</code> role:</p> <pre><code>:py:meth:`module_name.class_name.method_b` </code></pre> <p>This markup can be customized and simplified in various ways (for example, the <code>:py</code> prefix is not neces...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: efficiency of linked list sorting code c++<p>I have written a code that adds new random numbers to linked list in sorted order. Looks like it works properly ...
<p>If your algorithm follows that sketched in the comment by MDo, then the search for the correct place could be made with fewer comparisons (by using larger steps than merely one element and reducing the step size as you home in). However, when using a linked list, this won't make your code much faster, since the trav...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using eval() safely with $scope in Angular<p>Is this safe? Or will this be vulnerable to code injections?</p> <pre><code>$scope.placeholder = function(value...
<p>Is there any reason why you can't do this? Your question does smell of the XY problem, as Claies says:</p> <pre><code>&lt;input type="email" ng-model="user.email" placeholder="{{ user.email || 'Email...'}}" /&gt;&lt;br/&gt; &lt;input type="text" ng-model="user.Address.addr1" placeholder="{{ user....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django REST Framework - Set request in serializer test for ApiClient<p>I already read: <a href="https://stackoverflow.com/questions/38771852/django-rest-fram...
<p>Use <a href="https://github.com/django/django/blob/9cc743d0c82e019306d80eb8a83f86f8c6244610/django/test/client.py#L146" rel="nofollow noreferrer"><strong><code>wsgi_request</code></strong> (source code-Django)</a> of <strong><code>APIClient</code></strong> to get the WSGI request object.</p> <pre><code>self.client ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Entity Framework 6 Fails Under High Load<p>I am stress testing my website. It uses Entity Framework 6.</p> <p>I have 10 threads. This is what they are doing...
<p>I doubt EF has anything to do with it. Even though you are reading/writing independent rows, locks can escalate and lock pages. If you are not careful with your database design, and how you perform the reads and writes (order is important) you can deadlock, with EF or any other access technique.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Button doesn't call the function for the first click<p>I have a checkbox and a button that when it's checked, then, the button suppose to submit, but when it...
<p>Consider using v-model for this.</p> <p><a href="https://v2.vuejs.org/v2/guide/forms.html#v-model-with-Components" rel="nofollow noreferrer">https://v2.vuejs.org/v2/guide/forms.html#v-model-with-Components</a></p> <p>Your checkbox can have its v-model bound to a data property, and the disabled property on the button...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Messages sent over socket not being printed on the receiving side<p>I am currently learning Java, and I tried to make a simple chat program, which communicat...
<p>As @Russell Uhl mentions in his comment, a read loop whose termination condition is <code>reader.readLine()) != null</code> is only going to terminate when the output stream is closed.</p> <p>If the output stream is not closed, that call simply waits for new information, and shall continue to do so indefinitely.</p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: angular way of getting value of ng repeat inside directive<p>i'd like to have a liste, generated by a ng-repeat. Each list item contains a name and an input...
<p>Just change it to:</p> <pre><code>scope.$apply(function(){ scope.item.amount++; }); </code></pre> <p><a href="http://plnkr.co/edit/brRDm8eGttcr8yUPSEyY?p=preview" rel="nofollow">http://plnkr.co/edit/brRDm8eGttcr8yUPSEyY?p=preview</a> </p> <p>You can also use @inorganik suggestion: (if this is the behavior you ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Powershell using windows API to drag drop mouse<p>I have code that is supposed to do a drag and drop with powershell that I don't understand why it's not wor...
<p>After spending some time to debug the code, it seems that we need to slowly move the cursor for drag-and-drop to work correctly.</p> <p>Below code is tested for several times for moving an icon on the desktop, it worked just fine on my PC:</p> <pre><code>Add-Type @" using System; using System.Runtime.Inter...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Websphere MQ Explorer (AMQ4036) error when trying to access to MQ running in docker (ibmcom/mq)<p>I'm running a Queue Manager on docker using the latest <str...
<p>If you truly want to disable security and don't care anything about access to this queue manager, just do the following (in addition to all the turning off of security settings you have already done).</p> <pre><code>ALTER CHANNEL(SYSTEM.DEF.SVRCONN) CHLTYPE(SVRCONN) MCAUSER('user-id-in-mqm-group-on-docker') </code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Check whether email column contains @ and . using pyspark<p>I have a data Frame that contains 8M data. There is one column name <code>EMAIL</code> contains E...
<p>In fact, there is a Python library designed for it, <code>validate_email</code>.</p> <p>You can use the below code snippet to validate the email id.</p> <pre><code>from validate_email import validate_email from pyspark.sql.types import BooleanType from pyspark.sql.functions import udf valid_email = udf(lambda x: ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Problem with passing data to graphql from react<p>I have username and password which I want to send to graphql backend from react on frontend. I'm using apol...
<p>The <code>resolve</code> function has <code>source</code>, <code>args</code>, <code>context</code> and <code>info</code> as params. You can read more about it in <a href="https://www.apollographql.com/docs/graphql-tools/resolvers/#resolver-function-signature" rel="nofollow noreferrer">resolver function signature</a>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to click elements under ng-repeat in Protractor<p>I want to click check box under the repeat, I tried code also but its not working for me- </p> <pre><c...
<p>Try <code>element(by.model('spid.isSelected'))</code>. It should work.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PHP-EWS: Set multiple extended properties on calendar item<p>Is it possible to set multiple custom properties on a calendar item using PHP EWS? I haven't bee...
<p>Here's my workaround in the mean time (just the pertinent pieces). Store multiple values as a JSON string in the <code>$Value</code> property:</p> <p>Set the property when saving the calendar item:</p> <pre><code>// define custom property $extendedProperty = new EWSType_PathToExtendedFieldType(); $extendedProperty...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: hibernate MySQL57Dialect why is it trying to drop indexes on update?<p>When I boot up my server on an empty database, it tried to DROP indexes. Why would it...
<p>Most probably those are dropped to prevent eventual constrain checks and failures due to those checks. The similar thing is done when you import mysql dump file - except then indexes are disabled with mysql internal-use-only directives. </p> <p>Postrgres does not have to do that as constrains are validated after wo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: InDesign Applescript Resizing Placed Images<p>Please explain how to make applescript understand I want to select all images on the active page (which in my c...
<p>Just to give you some ideas:</p> <pre><code>tell application "Adobe InDesign CS5.5" activate set myPagecount to count pages of active document tell active document set myPage to page 1 tell page myPage tell item 1 of all graphics of myPage set geometric bo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calculate AWG from Cross section unit mm² and vice versa<p>I want to convert values in the <a href="http://en.wikipedia.org/wiki/American_wire_gauge" rel="no...
<p>While waiting for a better solution I use this code:</p> <pre><code>double Awg2CrossSection(int awg) { var diameter = 0.127 * Math.Pow(92, (36.0 - awg) / 39.0); return Math.PI / 4 * Math.Pow(diameter, 2); } int CrossSection2Awg(double crossSection) { var diameter = 2 * Math.Sqrt(crossSection / Math.PI);...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dangers of allowing a db_datareader to run any query?<p>On a certain site there is report system. The system is based on running SQL queries that are stored ...
<p>Users with the db_datareader role can only issue SELECT queries against tables and views in the database, and no other kinds of queries.</p> <p>So while a malicious user might be able to view some data that you don't want him to see, he can not do anything that is dangerous by your definition.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting the gcc linker to place multiple functions at the same address<p>I have an embedded system with internal and external flash. The controller is an MSP...
<p>You need to use the linker <a href="https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_22.html" rel="nofollow noreferrer">OVERLAY</a> command. This allows the storage location and the execution location to differ. You need to implement an overlay manager (code to copy the code to the execution address at ru...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Follow the minimum value in a collection of values which can only increase<p>I have a large collection of integers, the value of which can only grow (I'm cou...
<p>Keep a hash table of counts for each value, then update it and also the min if there are no more values equal to <code>min</code> in your hash table.</p> <pre><code>// when increasing the i'th count coll[i] += 1; --hashTable[coll[i] - 1]; ++hashTable[coll[i]]; // check whether also to update the max: if(coll[i] &gt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: POST array in AJAX<p>My problem is </p> <pre><code>jQuery.ajax({ type: "POST", url: "../ajax/si-notificar_investigacion.php", data: { id...
<p>Arrays are expected to have sequential, numeric indexes. That is what they are for. You can give them named properties, but tools designed to do something with the data in the array tend to ignore them.</p> <p>Given an array anywhere in <code>data</code>, jQuery will only pay attention to the numeric indexes.</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java LinkedList.get() does not return deep copy?<p>I have a question about using a <code>LinkedList</code> and the <code>.get()</code> operation. Java as I u...
<blockquote> <p>Java as I understand passes objects by reference..</p> </blockquote> <p>No. Java pass everything by value. If you have a reference type, the <em>reference</em> is passed by value. See <a href="https://stackoverflow.com/q/40480/1401257">this question.</a></p> <blockquote> <p>if I have a linked list...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why do projects like angular have their own version of common functions?<p>I am trying to understand or refresh my logic on this better - for example in angu...
<p>Directly from github source code of Angular.js that you can find <a href="https://github.com/angular/angular.js/blob/09ee82d84dcbea4a6e8d85903af82dcd087a78a7/src/Angular.js" rel="nofollow">here</a></p> <pre><code>/** * @ngdoc function * @name angular.forEach * @module ng * @kind function * * @description * Invokes ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating a parent 'workspace' component in ReactJS<p>Using ReactJS, I am trying to create a common workspace component that will have toolbar buttons and a n...
<p>As to whether or not it is the right approach is subjective, but I <em>can</em> provide insight into one way to make a "wrapper" type component:</p> <pre class="lang-js prettyprint-override"><code>// Your workspace wrapper component class Workspace { render() { return ( &lt;div className="wo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Select SQL column to get in shiny<p>shiny and SQL server are linked.<br /> We succeeded in specifying search conditions by input from shiny.<br /> Isn't it p...
<p>This answer covers your first query attempt:</p> <pre><code>observeEvent(input$go,{ output$table &lt;- renderTable({ sql &lt;- 'SELECT ?select FROM City;' query &lt;- sqlInterpolate(pool, sql, select = input$select) dbGetQuery(pool, query) }) }) </code></pre> <p>No, you can't do thi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rails STI vs Polymorphic vs Neither<p>I have a Users class in my rails app. I need two types of users, 1) Players, 2) Managers. Users will all log in using...
<p>STI can work for this, but since the difference between the types of users is basically a flag that says a user is an admin, you just need something on a user to check whether they are allowed certain actions. Roles can be either exclusive or inclusive (so that a user can be both a Player and a Manager), but once se...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: easiest way to read a java file - is there a simpler auternative to JSON<p>I am writing a small java method that needs to read test data from a file on my wi...
<p>You can also map the text file into java objects (It depends on your text file).</p> <p>For example, we have a text file that contains person name and family line by line like:</p> <pre><code>Foo,bar John,doe </code></pre> <p>So for parse above text file and map it into a java object we can :</p> <p>1- Create a ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a Prefix Header (or something with this functionality) in Swift?<p>Is there a way to get the functionality of a prefix header in Swift? I don´t want...
<p>No. But you don't need it — there's no cost to <code>import UIKit</code> beyond the time it takes you to type twelve characters. (Or use an Xcode New File template that has them there already.)</p> <p>That's the TLDR. For the whole story, read on...</p> <hr /> <p>In (Obj)C, the old way to make API available for use ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to get a true/false answer as to whether a given document matches a previously defined Elasticsearch query?<p>Is it possible to get a true/fal...
<p>elasticsearch has a percolate query ( <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-percolate-query.html" rel="nofollow noreferrer">documentation here</a> ) that corresponds to your needs.</p> <blockquote> <p>The percolate query can be used to match queries stored in an index. Th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Doing math with sprintf<p>When creating a label for GNUplot, reading from text files, how would I get the difference in hours:minutes from two columns which ...
<p>To parse a time, use the <code>strptime</code> function:</p> <pre><code>print strptime('%H:%M', '12:34') </code></pre> <p>This prints <code>45240.0</code>, which is the number of seconds parsed from the time string.</p> <p>If you parse the strings from the two columns like this, you can subtract the values and re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can a Shared Script be Hidden from the User the Script is Shared With?<p>Is it possible to deploy some scripts (along with triggers) for sheets, docs, forms ...
<p>It might be possible to keep <strong><em>some</em></strong> of your script hidden. The issue is; who's account does anything run under. You could share some script with someone that ran an HTTP Request with <code>UrlFetchApp.fetch()</code> to your Apps Script Content Service script. So, you would have a Stand Alo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Copy N lines from File1 to File2, then delete copied lines in File1<p>I want to take 5 lines from File1 and copy them into File2, and then delete the lines I...
<p>I think this works:</p> <pre><code>def batch(size): num_lines = sum(1 for line in open('File1.txt')) if num_lines &gt;= size: with open('File1.txt', 'r+') as File1: head = [next(File1) for x in xrange(5)] File2 = open('File2.txt', "w") for i in head: ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to test split char test to search?<p>I'm trying to create select search to to find people by first name or last name but when the user type search for na...
<p>There were a few issues with the code.</p> <ol> <li><p>The first conditional "!String.IsNullOrEmpty (query)" would force any non-null or empty query value to stop processing at this time. <em>Solution:</em> Increased the scope of the conditional, so if the case is true, the application would end.</p></li> <li><p>T...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jquery animated Line with animated gif from left to right loop<p>I managed to make it work but i want the loop to be from left:0 to 100%. Imagine you have a ...
<p>You can probably do something like</p> <pre><code> (function loop(){ // Reset position to original 0% $("#mark").css('marginLeft', '0%'); // animate it to 100% $("#mark").animate({ 'marginLeft': '100%' }, 5000, loop); // call itself again after it's done (5000 ms) })(); </co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Excel Add Sheet or Overwrite if Exists<p>In excel I have a macro that converts all of columns of an active sheet into an new sheet called "MasterList"</p> <...
<p>You can put the sheet creation between on error resume and on error goto 0. The other solution is to loop through the workbook sheets collection and check if a sheet with that name exists.</p> <p>Solution 1:</p> <pre><code>On Error Resume Next Sheets.Add.Name = "MasterList" On Error GoTo 0 </code></pre> <p>Soluti...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can a socket be made non-blocking only for the recv() function?<p>I want to be able to call <code>recv()</code> without having to block, so I want to make it...
<p>There is no way to make the socket non-blocking just for the <code>recv()</code> function.</p> <p>However there is something close to that (but flawed), which is by using <code>ioctlsocket()</code> with the <code>FIONREAD</code> flag. For example:</p> <pre><code>unsigned long l; ioctlsocket(s, FIONREAD, &amp;l); <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Text/Image processing in Python<p><em>Brief introduction</em>:</p> <p>I'm trying to get certain texts from an image of a lot of texts.</p> <p>By just think...
<p>So, you decided not to parse text, but save it as an image and then detect text from this image. </p> <p><strong><em>Text -> Image -> Text</em></strong></p> <p>It is worst scenario for parsing webpages. </p> <p>While dealing with OCR you must expect many problems, such as:</p> <ol> <li><p>High CPU consumption;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why mixing + and cast does not produce an error in "+(int)+(long)-1"?<p>Why does this print 1? </p> <pre><code>import java.util.*; import java.lang.*; impor...
<p>You are not adding nor substracting. Those + and - operators are unary sign operators.</p> <p>See <a href="http://docs.oracle.com/javase/tutorial/java/nutsandbolts/op1.html" rel="nofollow noreferrer">documentation</a> at <strong>The Unary Operators</strong> section.</p> <p>The sequence at stake: </p> <pre><code>(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: cross table and calculated field<p>I'm just starting using Powerpivot, and my first application raised some harder problems that I would have thought... Here...
<p>You are right to think that many-to-many is an non-trivial problem in PowerPivot!</p> <p>The good news is that this is probably more of a data structure issue than a pure underlying many to many situation and can be easily solved with a calculated column on the <code>factCross</code> table. This works a bit like a ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript, passing 'e' to new Function, scope<p>I have a function block which is dynamic and I need to call with either eval or new Function (preferably the...
<p>So basically, you have buttons right now with</p> <pre><code>onclick="MyFunc(e); OtherFunc('a')" </code></pre> <p>...and you want to change those to</p> <pre><code>data-click="Call" data-func="MyFunc(e); OtherFunc('a')" </code></pre> <p>...and you're trying to figure out how to write your <code>Call</code> funct...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to using Javascript prototypes without using the "new" keyword?<p>The fact that Javascript uses functions to create objects was confusing to m...
<p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/create" rel="nofollow"><code>Object.create</code></a> gets you the behavior that you are looking for, but you have to call it instead of <code>new</code>:</p> <pre><code>// Using ES6 style methods here // These translat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Loop with addEventListener is not dynamic for function()<p>I want to make an extremely easy for loop to call a function with a different parameter for each b...
<p>The problem is that function is being called at a later point in time – after for loop is finished. The variable contained in the body has already been updated in the last iteration of for loop. That's what you are seeing.</p> <p>The fix is to somehow push the variable to the function inside.</p> <pre><code>functi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reg ex to get a substring within a string with special characters<p>I need to extract: d101461b-a280-431c-b2bf-a3b200c6e575 from the below string</p> <block...
<p>Try to match GUID as such:</p> <p><code>guid.match(/[0-9a-f]{8}(?:-[0-9a-f]{4}){4}[0-9a-f]{8}/)</code></p> <p>So I shortened the following regular expression to match 5 groups of hexadecimal numbers (a group can be matched with <code>[0-9a-f]{length}</code>):</p> <p><code>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find an iOS bundle identifier in the flutter application<p>I am working on a flutter app and cannot find the bundle identifier. According to the documentati...
<p>Easiest way to find it is doing the following:</p> <ul> <li>Open your Flutter Project on <strong>Android Studio</strong> or <strong>VS Code</strong></li> <li>Search <code>PRODUCT_BUNDLE_IDENTIFIER =</code></li> <li>Hit Enter, open the file and check your <code>Bundle Identifier</code></li> </ul> <p><a href="https:...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Saving a canvas in Android does not work every time<p>I'm having this code:</p> <pre><code>public void saveimage() { Bitmap bitmap = Bitmap.createBitmap...
<p>This worked for me:</p> <pre><code>Bitmap bitmap = Bitmap.createBitmap(colorGFX.getWidth(), colorGFX.getHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); canvas.drawColor(Color.WHITE); canvas.drawBitmap(colorGFX.bitmap, 0f, 0f, null); canvas.drawBitmap(colorGFX.pictureBitmap, 0f, 0...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: My c# program for square roots only works when the discriminant is 0 or less than 0, but not when it's greater than 0<pre><code>private void btnCompute_Click...
<p>Try this:</p> <pre><code> txtOutput.Text = "Equation has two real roots: " + "\r\nroot1: " + (-coefficientB + Math.Sqrt(discriminant)) / (2 * coefficientA) + "\r\nroot2: " + (-coefficientB - Math.Sqrt(discriminant)) / (2 * coefficientA); </code></pre> <p>You were bracketing the ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ReCaptcha3: How to call execute when user takes the action?<p>I managed to get ReCaptcha3 working when including it like this:</p> <pre><code>&lt;script src...
<p>The problem is that the form is submitted before the async call <code>grecaptcha.execute</code> is complete. To fix the issue, one need to submit it manually:</p> <pre><code>&lt;script src="https://www.google.com/recaptcha/api.js?render=mykey"&gt;&lt;/script&gt; &lt;script&gt; grecaptcha.ready(function() { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does python disambiguate between module paths and member functions<p>In Python, the dot <code>.</code> is used to write paths to modules (e.g. <code>path...
<p>With <code>import mod</code> you are in practice binding the results of that search to a name in the local scope</p> <pre><code>&gt;&gt;&gt; import numpy &gt;&gt;&gt; numpy &lt;module 'numpy' from 'etc/site-packages/numpy/__init__.py'&gt; </code></pre> <p>With <code>mod = [3,2,1]</code> you reassign mod to a list...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does nesting structures affect DocumentDB query performance?<p>The question might otherwise be stated as "to flatten or not to flatten?"</p> <p>If I wer...
<p>There isn't a single "correct" answer to this.</p> <p>Choosing whether to represent relationships as a single embedded document (aka de-normalizing) or as references as you would in a RDBMS (aka normalizing) depends highly on your use-case / scenario.</p> <p>Typically you will want to de-normalize for read-heavy s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Oracle MERGE statement error (ORA-30926)<p>I inherited an Oracle script running on Oracle 11g that contains the following MERGE statement:</p> <pre><code>ME...
<p>The first (and most obvious) answer is to clean up the data so you don't have duplicates. It seems likely that the sample data you provided is the result of a bug.</p> <p>As for the <code>merge</code> statement, if the data is actually purely duplicated, you can just use <code>distinct</code>:</p> <pre><code>MERGE...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Lua wireshark dissector extract timestamp in OLE automation format<p>ref: <a href="https://stackoverflow.com/questions/30391788/ole-automation-date-in-lua">O...
<p>I had to learn a bit about OLE dates but found relevant information at <a href="https://docs.microsoft.com/en-us/dotnet/api/system.datetime.tooadate?view=netframework-4.8" rel="nofollow noreferrer">DateTime.ToOADate Method</a>. I also used information from the <a href="https://stackoverflow.com/questions/30391788/o...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Select last 3 children based on the number of children<p>I'm in a situation where the number of elements shown is variable, and I need solution which I'm not...
<p>Is this what you are looking for?</p> <p><code>.flex-item:first-child:nth-last-child(7)</code> </p> <p>targets the first child when there are only 7 items so that </p> <p><code>.flex-item:first-child:nth-last-child(7)~.flex-item:nth-child(n+5)</code></p> <p>is only triggered when there are 7 items</p> <p><div c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Powershell - WMI & AD Objects<p>Can someone please show me a solution to the following problem or a better way to approach it - all I am trying to do is retu...
<p>You have 2 issues that I see. First is the one that <a href="https://stackoverflow.com/users/3515885/notjustme">notjustme</a> pointed out. You are trying to cast the output of <code>Get-AdComputer</code> into a WMI object... hence the error. </p> <p>On the same line you are returning and object with a description <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Owl Carousel 2 Navigation In Slide<p>I am using the <strong>Owl Carousel 2</strong> jquery plugin, and am trying to have the navigation buttons contained wit...
<p>Hope this might help you mate.</p> <pre><code>$('.owl-carousel').owlCarousel({ loop: true, items: 1, }); owl = $('.owl-carousel').owlCarousel(); $(".prev").click(function () { owl.trigger('prev.owl.carousel'); }); $(".next").click(function () { owl.trigger('next.owl.carousel'); }); </code></pre> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Variable Not in Scope from Tuple<p>I have a function that looks like the following:</p> <pre><code>format input = let input (name,_,_,_) = name ...
<p>The variable <code>input</code> goes on the right-hand side; the pattern <code>(name, _, _, _)</code> by itself goes on the left.</p> <pre><code>format input = let (name, _, _, _) = input n = 15 - length name in ... </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to enable backend layout selection for users<p>I create a site based on Typo3 9.5.12 / Bootstrap Package 11.0.2.</p> <p>I need to enable my editors to s...
<p>Have you granted access to these fields in the BE-Group definition?</p> <p><a href="https://i.stack.imgur.com/WpAmt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WpAmt.png" alt="list pages"></a><br> <a href="https://i.stack.imgur.com/42ma3.png" rel="nofollow noreferrer"><img src="https://i.stac...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I send data from a GKPlayer to another in a match?<p>I would like to send <code>NSData</code> from a <code>GKPlayer</code> to another in a match. Ther...
<p>This version for encapsulating an <code>Int</code> (or other type) into or extracting it from<code>NSData</code> should work even between devices with different byte orders:</p> <pre><code>// at sender before sending data let data = NSMutableData() let archiver = NSKeyedArchiver(forWritingWithMutableData: data) arc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Determine the size of an image using ImgScalr<p>Hi I am currently using ImgScalr library and I have few markers to download images from an HTML document , ho...
<p>imgscalr author here - the library is focused on image operations only, operating on the uncompressed BufferedImage objects.</p> <p>To know the actual file size you would just download all the images from the HTML page to a directory and then iterate through the files using the standard Java File operations to dete...