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: Identifying Data Type From Binary File<p>Using javascript, I want to read data from a file that looks like this:</p> <pre><code>1003 0000 1b0c 0900 0300 100...
<p>That is hexadecimal. Each one of those 4-digit chunks are the equivalent of 2 bytes or 16 bits. </p> <p>As far as what it's supposed to represent, that is completely dependent upon how you choose to interpret it. The data itself does not provide context. For example, you could choose to interpret that as a very...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a function in c++ that has a matrix's size determined by a parameter?<pre><code>void prob6 (int n) { int f,c,z=0, mat[n][n]; //error becaus...
<p>You can't statically allocate a variable amount of memory. You may want to allocate memory on the heap. You also need to remember to delete them when you're done. This is tedious, so use a std::vector.</p> <pre><code>std::vector&lt;std::vector&lt;int&gt;&gt; myVector; //Vector inside vector. </code></pre> <p>(Note...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Layered div not displaying in layers<p>I have two separate sections for a page that I am trying to build out. Layer 1 is over layer 2 and layer 2 is position...
<p>You need an enough space availabe to show the second layer.<br> It's possible to make it adding some <code>margin-bottom</code> to wrapper element, for instance the body element:</p> <pre><code>body { margin: 0 0 100vh 0; } </code></pre> <p>It applies a space height enough to view the layer underneath.<br> <code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Output row with null value only if there isn't the same row with a non-null value<p>Trying to formulate my question as good as I can...</p> <p>I have a pric...
<p>With <code>NOT EXISTS</code>:</p> <pre><code>select t.* from tablename t where t.vendorid is not null or not exists ( select 1 from tablename where itemid = t.itemid and vendorid is not null ) </code></pre> <p>See the <a href="https://www.db-fiddle.com/f/frFVGLqDyNb3dkEE4M8Ljk/0" rel="nofollow noreferrer">demo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Concat 2 created element into html attribute<p>How can I concat 2 dynamic created HTML elements (var foo + bar) in jquery into html attribute? Expected resul...
<p>You need to fetch the Outer HTML of <code>foo</code> and <code>bar</code></p> <pre><code>var foo = $('&lt;i&gt;123&lt;/i&gt;', { 'class': 'glyphicon glyphicon-file fileinput-exists' }); var bar = $('&lt;span&gt;456&lt;/span&gt;', { 'class': 'fileinput-filename' }); var formControl = $('&lt;div&gt;&lt;/div&...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use pagination with custom query in cakephp<p>I am working on Reporting of the Postal service Project and i wanted to display data with the help of pa...
<p>Thanks for reply. I went through below link . i have given limit => 3 . it is giving me data upto 3 for Payments Not for Bills which are multiple against one Payment. I need to paginate 'PaymentBillMap' data .</p> <pre><code>public $paginate = array('limit'=&gt;'3', 'order'=&gt;'Payment.pay_d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to specify missing feature in coremltools<p>I have a MLModel with feature names "f0", "f1", etc. Not all the features are presented in the input data, so...
<p>I found that you can specify <code>numpy.nan</code> to indicate missing features. My model was converted from XGBoost. And as the <code>DMatrix</code> documentation says:</p> <blockquote> <p><strong>missing</strong> (float, optional) – Value in the input data which needs to be present as a missing value. If None,...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Most efficient way for rendering string templates using javascript<p>I need to render a template string in my node.js application. I don't want to use Jade, ...
<p>Here's a String extension I use for 'templating', without the need for regular expressions. Maybe it's of use to you. It should be faster than regex/replace, cf <a href="http://eli.thegreenplace.net/2013/07/16/hand-written-lexer-in-javascript-compared-to-the-regex-based-ones" rel="nofollow"><strong>this test</strong...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Where should I put my try and catch in my game?<p>I'm building a Number Guessing Game for a lab in school, the basic rules of the game are you have 10 guesse...
<p>Your game logic should be unconcerned with the where and how you get the guesses (numbers) so there really shouldn't be any need for try/catch in the game logic. I'd imagine it would expose a method that might look like this:</p> <pre><code>public GuessResult MakeAGuess(int guess) </code></pre> <p>Notice that it t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to determine a path is a file or directory in vb6?<p>I'm working on a project that I need to get a path from the user and do sort of things on that path ...
<p>Check if the original string is a valid string too.</p> <pre><code>Function FileOrFolder(strg As String) Dim fs, FExists, DirExists Set fs = CreateObject("Scripting.FileSystemObject") FExists = fs.FileExists(strg) DirExists = fs.folderexists(strg) If FExists = True Then FileOrFolder = "It's a file" ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: 3 dimensional array with different sizes of 2d array in each index<p>I'm trying to create a 3 dimensional array where each index contains a 2 dimensional arr...
<p>It should be</p> <pre><code>all [0] = alpha; all [1] = beta; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to run Parse Cloud Code on Android<p>I want to run Parse Cloud Code on Android and for this purpose I follow the instructions provided in the <a href=...
<p>I figured it out. There should be a 'public' access modifier on the done method. </p> <pre><code>... public void done(String result, ParseException e) { ... </code></pre> <p>Now everything works fine.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Combining PySpark and DBSCAN with pandas_udf<p>I was reading the documentation on pandas_udf: <a href="https://spark.apache.org/docs/latest/sql-pyspark-pand...
<p>So I've managed to do this by my own:</p> <pre><code>from pyspark.sql.types import StructType, StructField, DoubleType, StringType, IntegerType from sklearn.cluster import DBSCAN data = [(1, 11.6133, 48.1075), (1, 11.6142, 48.1066), (1, 11.6108, 48.1061), (1, 11.6207, 48.1192), ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Postfix chroot dns resolve problem (Ubuntu 18.04.4 LTS, Postfix 3.3.0)<p>I have a Postfix setup configured with chroot=y in master.cf file(full original conf...
<p>Ive found the solution. </p> <p>If your system run ZFS or have any separated partitions (like /var/spool), than you need to make sure that partion (where is the postfix chroot) have exec rights.</p> <p>Defaults are usually enough for the ext4 file system, zfs need exec flag. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get Public IP in Flutter?<p>In my case, i need public IP Address. But, after research almost all documentary related to Local IP like: <a href="https:...
<p>As far as I'm aware, there's no way to get the public IP of a device from within that device. This is because the vast majority of the time, the device doesn't know it's own public IP. The public IP is assigned to the device from the ISP, and your device is usually separated from the ISP through any number of modems...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to access table's last column in pure javascript or typescript<p>Tried to access last column for each row in pure javascript not in jquery but not workin...
<p>I am not sure why you want it in pure javascript way while you use angular,</p> <p>Anyhow I am able to make a solution for you in pure javascript way with <a href="https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector" rel="nofollow noreferrer">dom querySelector() methods</a> ..</p> <pre><code>ng...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google apps script get range of bytes from binary file<p>I'm aware that in the <a href="https://developers.google.com/drive/api/v3/manage-downloads#partial_d...
<ul> <li>You want to retrieve the partial body of the file.</li> <li>You want to achieve this using Google Apps Script.</li> </ul> <p>If my understanding is correct, how about this answer? Please think of this as just one of several possible answers.</p> <p>In order to achieve <a href="https://developers.google.com/dri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jqGrid multiple table columns sorting<p>in JqGrid, i enabled the multisort options and in grid view table i am fetching the columns from two table which havi...
<p>It seems that you don't use <code>loadonce: true</code> option. So the sorting are implemented <strong>in your server code</strong>. You should examine exactly the values <code>sidx</code> and <code>sord</code> which send jqGrid to the server in case of multisort scenario. I suppose that your current server code use...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R - lapply - getting data frames back out of lists?<p>I have the same problem as this guy: <a href="https://stackoverflow.com/questions/38021491/returning-fr...
<p>You can assign names to the list and then use <code>list2env</code>. </p> <pre><code>dfPreList = list(yearlyFunding, yearlyPubs, yearlyAuthors) a = lapply(dfPreList, DoThis) names(a) &lt;- c('yearlyFunding', 'yearlyPubs', 'yearlyAuthors') list2env(a, .GlobalEnv) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why when thread starts, the form crashes?Is Thread-safe?<p>I've a game with 90 grey numbers and, periodically, some of them become blue.(Simplified!)</p> <p...
<p>I'm using my girlfriend laptop so I'll edit my answer and give you a much better answer ASAP. the problem occurred because most of the execution is in the UI thread. you should execute most of your execution in background. when you want to update the UI you need to change context to the UI thread(only updates!).</p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android AudioTrack.write returns -4<p>I'm playing some audio on Android using the <code>AudioTrack</code>. Sometimes I get a return value of '<code>-4</code>...
<p>The native implementation of <a href="https://www.codeaurora.org/cgit/quic/la/platform/frameworks/av/tree/media/libmedia/AudioTrack.cpp?h=aosp-new/master#n1379" rel="nofollow"><code>AudioTrack::write</code></a> calls <a href="https://www.codeaurora.org/cgit/quic/la/platform/frameworks/av/tree/media/libmedia/AudioTra...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to validate user when he login and wants to change his old password with new password<p>I am creating a dynamic web project where the user first register...
<p>Once you have check that email and old password of user are correct then you can check if <code>npass</code> is equal to <code>rpass</code>,if this is true then just update the password ,else if both are different give message to user not same password .i.e:</p> <pre><code>if(email.equals(sa[0]) &amp;&amp; opass.eq...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: perfect forwarding failing for lvalues<p>I have a utility function which iterates over a tuple, and for each element, calls a function with that element, and...
<pre><code>template&lt;typename Func, typename ForEachFunc, typename... Args&gt; static auto apply(Func&amp;&amp; func, ForEachFunc&amp;&amp; forEachFunc, std::tuple&lt;Args...&gt;&amp;&amp; args) </code></pre> <p>the 3rd argument is an rvalue <code>tuple</code>, not a tuple of forwarding references, or a forwarding r...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: HtmlAgilityPack node value is correct but InnerText is empty<p>I am trying to parse HTML page using HtmlAgilityPack on WindowsPhone 8 application. This is th...
<p>inner text of option tags are <em>blank</em> by default. Just add</p> <pre><code>HtmlAgilityPack.HtmlNode.ElementsFlags.Remove("option") </code></pre> <p>before loading HtmlDocument.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to extract entire columns from multidimensional (2d) array<p>I am trying to automate an Excel consolidation and conversion (pre-ETL) process as efficient...
<p>Try this:</p> <pre><code>var source = new int[,] { { 1, 2, 3 }, { 1, 2, 3 }, { 1, 2, 3 }, { 1, 2, 3 }, }; int[] third = Enumerable.Range(0, source.GetLength(0)).Select(x =&gt; source[x, 2]).ToArray(); </code></pre> <p>It gives:</p> <pre> 3 3 3 3 </pre>
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 update the data inside the application? Without updating the entire application?<p>I'm trying to build an application, "Journal for Drivers...
<p>There are three main ways to accomplish this:</p> <ol> <li>You can create a webpage and use webview component to load this website in your application. In this case you will have full control on the data (backend) while you can change the ui of this webview on the fly without releasing new versions of your applicat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Symfony 2 : How to concatenate multiple fields into one in a form<p>I have searched through the internet to find a way to concatenate multiple fields into on...
<p>you could add a new property to your class e.g </p> <pre><code>private $singleField /* a getter that builds up the unified value */ public function getSingleField(){ return $this-&gt;disponibilite.$this-&gt;integrite.$this-&gt;confidentialite.$this-&gt;preuve } /* a setter that sets the properties by unif...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Call function as user drags and makes selection and get selected text<p>I am trying to replicate the behavior of <a href="http://dwieeb.github.io/jquery-text...
<p>You can use the <code>mousemove</code> event to check for text selection. This is a basic example. The listener (callback) will only be called when there is a new selection.</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-overr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pass list of strings to webservice<p>I have this code:</p> <pre><code>List&lt;string&gt; emailsToFollow = new List&lt;string&gt;(); ASMXWebServiceReference....
<p>I finally got the answer and updating my post. Well, it seems that you have to make a bit of conversion here</p> <pre><code>ASMXWebServiceReference.ArrayOfString myArray = new ASMXWebServiceReference.ArrayOfString(); myArray.AddRange(emailsToFollow); </code></pre> <p>It seems that out of th service you have to use...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Running Bash script using Java<p>I am attempting to run a Bash script to compare two files to see if they are identical (except for the last few lines). The ...
<p>You're invoking sh, which will just run this script; the top 'comment' that tells the system to run it with bash is ignored by sh, and sh may not be bash, so that's something to look into. This is also rather dubious and is likely to fail on many systems; I'd advise invoking explicitly '/bin/bash' at the very least....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why doesn't Seq.groupBy work like I think it will with lists? (F#)<p>Here's a sample code:</p> <pre><code>let x = [5, 6, 65, 2, 3]; let p = x.Head; let y = ...
<p>The issue is that your list is a list containing a single tuple:</p> <pre><code>let x = [5, 6, 65, 2, 3]; </code></pre> <p>This is because commas define a tuple. This is effectively the same as writing:</p> <pre><code>// Build a tuple let temp = (5,6,65,2,3) // Make a list where the single item is the tuple let ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NullReferenceException: Object reference not set to an instance of an object When accessing ViewModel list through controller<p>So my View Model is not givin...
<p>You just need to change 2 things in your <code>ViewModel</code></p> <p><em>ViewModel</em></p> <ul> <li>Remove <code>List&lt;Stock&gt;</code> and assign directly, which looks like <code>Stocks = new List&lt;Stock&gt;();</code></li> <li><code>IEnumerable&lt;Stock&gt;</code> to <code>List&lt;Stock&gt;</code> which be...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Understanding array manipulation pointers syntax in C<p>I have a struggle understanding a syntax of pointers, for example, I have this code below:</p> <pre>...
<p>I'll break up the expressions <code>(*arr)[3] - 1</code> and <code>*arr[2] + 3</code> in order of precedence.</p> <p>Expression <code>(*arr)[3] - 1</code>:</p> <ul> <li><code>arr</code> → <code>{"It's", "wide", "and", "wonderful"}</code></li> <li><code>(*arr)</code> → <code>"It's"</code></li> <li><code>(*arr)[3]</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JAX-WS RI does not stream data from client<p>I have written a simple upload service with JAX-WS RI. Classes are generated with <code>DataHandler</code> type ...
<p>After further debugging sessions and searches on the net, I have found several JIRA issues and blog posts that it is plain broken in JAX-WS RI. As soon as you have a handler, you're lost. This applies to outgoing but especially to incoming streams.</p> <p>At the end, JAX-WS RI is <strong>unusable</strong> for file ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jmeter - OpenJDK : java.lang.module.FindException: Module java.activation not found<p>I have</p> <ul> <li><p>Openjdk 12.0.2</p> </li> <li><p>jmeter 4.0</p> <...
<p>You're suffering from <a href="https://bz.apache.org/bugzilla/show_bug.cgi?id=62065" rel="noreferrer">JMeter bug #62065</a></p> <p>As per <a href="https://www.blazemeter.com/blog/9-easy-solutions-jmeter-load-test-%E2%80%9Cout-memory%E2%80%9D-failure/" rel="noreferrer">9 Easy Solutions for a JMeter Load Test “Out of...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Incomplete View Loading Before Firebase GetRecord is Resolved<p>I'm having a problem loading a record from firebase into my view when directly linking to the...
<p>As mentioned in the comments, you should use the Angular route resolution process based on promises. Here is a <a href="http://plnkr.co/edit/Maiscc?p=preview" rel="nofollow">working plunkr demonstration</a>, but the highlights are:</p> <p><strong>Build a Data Service that Returns Angularfire's Promises</strong></p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Indirect references to functions in javascript<p>I was just reading the book, "You don't know JS" by kyle simpson and came across the following sinppet of co...
<p>The final line is passing along the reference to the <code>foo</code> function and then executing in the global scope, just as you see. It is equivalent to this</p> <pre><code>var f = p.foo = o.foo; f(); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spring Boot - Jackson unable to POST / PUT when using list fields (@ManyToMany)<p><strong>Explanation</strong></p> <p>I made a sample code to test http meth...
<p><strong>Original problem as described</strong></p> <p>The solution was to remove any <code>@JsonManagedReference</code> besides the one from the top layer, so in my example <strong>Parent</strong> is the only one who has that annotation, the other two (<strong>Child</strong> and <strong>Nested</strong> are just usi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NavigationProperty.GetDependentProperties() returns an empty collection<p>I am trying to use Entity Framework's <code>MetadataWorkspace</code> to figure out ...
<p>I've figured it out - I was using <code>DataSpace.OSpace</code> to retrieve the navigation properties. Instead I should have used <code>DataSpace.CSpace</code>, which is the conceptual model which contains the foreign key mappings.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android app is able to make network calls without network permissions defined in the manifest<p>I am developing an Android app.</p> <p>I haven't added the p...
<p>Most likely, a library that you are using has added that permission. If you want, use the "Merged Manifest" sub-tab in the <code>AndroidManifest.xml</code> editor to try to track down which library (or libraries) are contributing the <code>INTERNET</code> permission.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Several Leaderbords in sandbox mode<p>I have created 4 leaderboards for my app. One of them is default. I am using 3 different sandbox users. Scores are upl...
<p>Well seems that there is a lag (1-2 days) while boards have this problem. After some time passes all leaderboards behave as intended.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ArrayIndexOutOfBounds, can't locate its origin<p>I have written a class <code>TokenizableString</code> that tokenizes a string given as input from the user. ...
<p>your while conditions has wrong order, first check for i being inside the range then for the space.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to speed up a complex image processing?<p>Every user will be able to upload 100 TIFF (black and white) images.</p> <p><strong>The process requires:</stro...
<h2>0. Two approaches</h2> <p>Basically, this challenge can be tackled in two different ways, or a combination of the two:</p> <ol> <li>Construct your commands as clever as possible.</li> <li>Trade speed-up gains for quality losses.</li> </ol> <p>The next few sections discuss the both approaches.</p> <h2>1. Check which...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to filter based on two columns where one column may not be defined using SQLAlchemy?<p>I have a ShippingRate table with a minimum_price and a maximum_pri...
<p>Assuming if minimum or maximum doesn't exist, there is no maximum or minimum respectively, and if neither exist then all values are true, how about something like this:</p> <pre><code>from sqlalchemy import and_, or_ db.query(ShippingRate).filter(or_( \ and_(ShippingRate.minimum == None, ShippingRate.maximum =...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: roUrlTransfer in BrightScript<p>I am creating my own channel for Roku. I need to get the streams of my videos and images from a JSON file from a server. I fo...
<p>Yes, as long as the url is accessible to the Roku, you can host it as a static json or xml file. You don't need a full blown web service.</p> <p>In fact, a significant number of the channels available on the Roku are driven by static MRSS feeds.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to bundle multiple static libraries into single library in CMake for windows<p>I want to bundle five static libraries into one library in CMake. How can ...
<p>If you are using Visual Studio, you can take advantage of the <a href="https://docs.microsoft.com/en-us/cpp/build/reference/lib-reference?view=vs-2019" rel="nofollow noreferrer">Microsoft Library Manager</a> (LIB.exe) to <strong>combine</strong> your static libraries into one. Your CMake could follow these steps:</p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CSS styles overlay<p>I have a modal window, which i dinamically load to the client web site. That modal contains some css styles. In some cases my form is br...
<p>In order to avoid the problem with other CSS on the page common approach is to make <em>your</em> rules more specific. Make sure you are familiar with <a href="http://www.smashingmagazine.com/2007/07/27/css-specificity-things-you-should-know/" rel="nofollow">CSS Specificity</a> - those rules dictate what CSS is appl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: .htaccess rewrite this/kind/of/address to this_kind_of_address.php<p>Hi stackoverflow users!</p> <p>I need to set an url rewrite via access to make these ur...
<p>Try:</p> <pre><code>RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/(.*)$ /$1_$2 [E=SLASH:Y,DPI] RewriteCond %{ENV:SLASH} Y RewriteRule ^([^/]+?)(?:\.php)$ /$1.php [L,R=301] </code></pre> <p>It's a little tricky to get your head around, but the first rule checks to make s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add Change Event Handler to New Excel Sheet<p>How do I add a change event handler to a newly inserted sheet? Basically, I have a button that copies a hidden ...
<p>You need to subscribe to the <a href="https://msdn.microsoft.com/en-us/library/office/ff839775(v=office.15).aspx" rel="nofollow">Change</a> event of each Worksheet separately. Thus, after inserting a new one you need to subscribe to the event. </p> <pre><code>worksheet.Change += WorksheetChangeEventHandler; </code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NullReference issue in Unity C#<p>I'm trying to get a reference to two of my game objects in Unity which are "ScoreEntryContainer" and its child "template": ...
<p>Okay, so I've figured it out.</p> <p>The problem was because I used TextMeshPro instead of Text in the UI which threw the null exception. So I changed it accordingly in the script.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript prompt box without the cancel button?<p>Is there a way to create a input prompt box that doesn't have the cancel button, or doesn't allow the user...
<p>Put your <code>promt</code> inside a while loop and continue asking for input until user gives any.</p> <pre><code>do{ input = prompt("Give input"); }while(input == null || input == "" ); console.log(input); </code></pre> <p><a href="http://jsfiddle.net/codeSpy/d0kgt77o/" rel="noreferrer"><strong><em>jsFiddle...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is filteredArrayUsingPredicate: an instance method or a class method?<p>I'm confused about the method <code>filteredArrayUsingPredicate:(NSPredicate *)predic...
<blockquote> <p>I've looked under the class reference for <code>NSArray</code> and it looks to be an instance method.</p> </blockquote> <p>That is absolutely right.</p> <blockquote> <p>But if it results in the creation of a new array, why isn't it classified as a class method?</p> </blockquote> <p>Because it nee...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: php - single page login form (form+validation) not working properly<p>I try myself a single page login (form + validation). It works slightly good. I'm using...
<p>After you echo out the error you need to remove the variable from the session.</p> <p>Add <code>unset($_SESSION['result']);</code> under:</p> <pre><code>if($_SESSION['result']=="false") echo "&lt;font color=white&gt;Invalid Credentials. Try again!!! &lt;/font&gt;"; if($_SESSION['result']=="false1") echo ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: rspec - before(:all) Hook ignored when running all tests<pre><code>RSpec.configure do |config| config.before(:suite) do cleaner.strategy = :truncation ...
<p><code>before(:all)</code> is evil and is the source of many headaches, so many rspec has considered multiple times <a href="https://github.com/rspec/rspec-core/issues/573" rel="nofollow">to remove the command at all</a>. This block is not wrapped in a transaction, so the data will not be rolled back after the test. ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular 2+ - modal component rendered always at same place<p>I'm currently solving quite tricky problem. I would like to have in my root app.component.html p...
<p>Will doing the following not solve it?</p> <pre><code>&lt;div class="app"&gt; &lt;app-navigation&gt;&lt;/app-navigation&gt; &lt;app-header&gt;&lt;/app-header&gt; &lt;main class="app__content"&gt; &lt;router-outlet&gt;&lt;/router-outlet&gt; &lt;/main&gt; &lt;app-order-detail&gt;&lt;/app-order-detail&gt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MDX ORDER by multiply measures<p>Suppose that i have next MDX query</p> <pre><code>select { [Measures].[Measure1], [Measures].[Measure2], } on column...
<p>This works on AdvWrks for me:</p> <pre><code>SELECT { [Measures].[Reseller Order Quantity] ,[Measures].[Reseller Sales Amount] } ON 0 ,Order ( Order ( [Product].[Product].[Product].MEMBERS ,[Measures].[Reseller Sales Amount] ,BDESC ) ,[Measures].[Reseller Order Quantity...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Failed to load document PHPMailer PDF Base64 string<p>I want to send PDF document using the BASE64 string. The PDF sends but when you download/open the PDF d...
<p>That code will not generate a valid binary attachment, because a complete <code>data</code> URL is not a base64 string. Remove the header from the data and decode that, i.e. strip the <code>data:application/pdf;filename=generated.pdf;base64,</code> prefix before attempting to decode it.</p> <p>If you're getting the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: HTTP requests in Intel XDK<p>I previously built an app in the Intel XDK platform pre the Feb 23rd update and now the software has updated when i try to run t...
<p>There is a regression bug with regards to relative location URL referenced through emulator, a fix is being worked on. This is related to emulator only. Your app should work fine with test tab using App Preview on the device and using the build.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fullcalendar - Cannot read property 'DayGrid' of undefined<p>I'd like to use the <strong>Fullcalendar 4.2.0 Plugin</strong> to my website, but I get an error...
<p>I managed to reproduce your error in this demo: <a href="https://codepen.io/ADyson82/pen/KKppyxq" rel="nofollow noreferrer">https://codepen.io/ADyson82/pen/KKppyxq</a></p> <p>Since the stack trace shows that the error occurs in "timegrid.min.js" it was easy to reason that the timeGrid plugin appears to rely on the ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does Python know which number type to use in order to Multiply arbitrary two numbers?<p>In <strong>C</strong>, I have to set proper type, such as <code>i...
<blockquote> <p>I mean, how does Python carry out the different of number type in the result of 98*76 or 987654321*123457789, does Python detect some out of range error and try another number type?</p> </blockquote> <p>Pretty much. The source code for integer multiplication can be found in <a href="https://hg.pytho...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: spring WARNING: Request method 'HEAD' not supported<p>I receive warning message per second after successful deployment on tomcat 7:</p> <blockquote> <p>or...
<p>This is a bug of IntelliJ IDEA</p> <p><a href="https://youtrack.jetbrains.com/issue/IDEA-135196#comment=27-909624"><strong>>> see issue</strong></a></p> <p>it will be fix in next release and until that there is a patch was created by them <a href="https://youtrack.jetbrains.com/_persistent/javaee-impl.jar?file=74-...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jetpack Compose and Android Room compatibility<p>I am trying to set up Android Room in my Jetpack Compose project. However, when trying to add...</p> <pre><...
<p>I'm pretty sure that we're still in a state where annotation processors (for Room, Retrofit, etc.) and the experimental Kotlin compiler are not getting along. The recommended approach at the moment is to isolate the Compose stuff in a module that is independent of modules that need annotation processors.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Access Resources.resx file within Properties folder from razor view<p>From a view cshtml in my ASP.NET MVC app I am trying accessing a string in my Resources...
<p>I have solved by importing the correct namespace:</p> <pre><code>@using MyCompany.MyProject.Properties </code></pre> <p>instead of:</p> <pre><code>@using MyCompany.MyProject.Resources </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is my table creation failing when trying to recreate a deleted DynamoDB table?<p>I have a simple table in DynamoDB</p> <p>Name: TEST</p> <p>Primary par...
<p>Given the async nature of most AWS operations, the following flow would be correct :</p> <ul> <li><p><a href="https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_DescribeTable.html" rel="nofollow noreferrer"><code>DescribeTable</code></a> to capture the existing table's details.</p></li> <li><p><a hr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mysql get both highscores and all submitted scores<p>I have the following highscores table:</p> <pre><code>CREATE TABLE IF NOT EXISTS `highscores` ( `lid`...
<pre><code>select h.username, h.highScores, s.submittedScores from ( SELECT h.username, count(h.username) as highScores FROM highscores h inner join (select lid, min(score) as minscore,COUNT( * ) AS totalScores FROM highscores GROUP BY lid) t on h.lid = t.lid and h.score = t.min...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Second container does not load jquery masonry in my rails app<p>I am trying to display my posts organized by date created. Jquery Masonry works fine for the ...
<p>HTML doesn't like it when you have more than one id per page. And jQuery will only find the first one. So if you're ever iterating over a partial or a template, make sure that you either don't use ids, or have the id be dynamic.</p> <p>So instead of <code>id="pins"</code> try:</p> <pre><code>&lt;div class="masonry...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fastest way to get all the same elements from an array existing in an other one<p>I need a faster way to get all the same elements from an array existing in ...
<p>Turn the B array into a Set first. <code>Set#has</code> is <code>O(1)</code>, but <code>Array#indexOf</code> / <code>Array#includes</code> is <code>O(n)</code>:</p> <pre><code>const bSet = new Set(B); const result = A.filter(item =&gt; bSet.has(item)); </code></pre> <p>That'll improve performance a ton. You <a hre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Dereferencing pointer to incomplete type openSSL<p>I'm using the <code>openssl</code> library. In the <code>apps/s_client.c</code> file, I am trying to acces...
<p>All headers are already included, you just need to remove OPENSSL_NO_SSL_INTERN before ssl.h inclusion.</p> <p>apps/s_client.c:</p> <pre><code>... #undef OPENSSL_NO_SSL_INTERN #include &lt;openssl/ssl.h&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I make the text shrink automatically to fit in the div?<p>I know i can adjust the font size, but I want it to shrink to fit the div automatically when...
<p>You can do it like this....and don't forget to add js library.</p> <p>this is the fiddle...<a href="http://jsfiddle.net/f6sx474j/" rel="nofollow">http://jsfiddle.net/f6sx474j/</a> Try by increasing the text i checked it and its working properly.</p> <pre><code>&lt;div style="width:600px; height:58px; max-width: 6...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java BaseAdapter - ArrayList as Return Value - NullpointerException<p>i´m trying to display a ListView of the last ten Database Objects. If i display those O...
<p>The only thing that could throw a NPE at line 16 is if aController is null. You didn't post the code where this object is created so I assume it simply wasn't.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: System-calls with c<p>Hi I'm trying to make a couple pipes in c for communication between a 'server' and an 'interface'. I'm getting a weird error though tha...
<p>I think I know what is wrong, it's this</p> <pre><code>buffer[BUFLEN] = '\0'; </code></pre> <p>if the recieved message is smaller than that, then you are not <code>nul</code> terminating the string correctly, you should</p> <pre><code>buffer[err] = '\0'; </code></pre> <p>because <code>read()</code> returns the n...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: @Import - An Annotation argument must be a compile time constant<pre><code>@Configuration @Import(UserpassportConfig::class) class UvdConfig </code></pre> <...
<p>Converting my analysis from the comments to an answer, so that the question is not left hanging without answer:</p> <p>I think the root of the problem manifests on the following error line: <code>e: config\UvdConfig.kt: (5, 22): Unresolved reference: userpassport</code> . Apparently the package where <code>Userpass...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adjusting Batch read size using Teradata as a Source in ADF pipeline<p>I was wondering if anyone had a chance to use Teradata as a Source and if so do you kn...
<p>The batch write size is the property which is on the sink side and if I understand that you are reading the data from Terradata which is the source . I think you are looking for a Read Batch Size property which to my understanding does not exist at this time . </p> <p>But I think since Terradata support TOP N in t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: WPF draggable and clickable button<p>I have a borderless, transparent <code>Window</code> with only one <code>Button</code>.</p> <p><a href="https://i.stack...
<p>For your first problem:<br> You must handle the case when your button is pushed down but not moved. I think a better way to do this (instead of the 100ms delay) would be to specify a minimum threshold of movement above which the dragging will start.<br> You could do it like this:</p> <pre class="lang-cs prettyprint...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Return or break as a side effect in python mock?<p>I have a multiprocessing application that has workers running in "while True" loops. For testing, I'd lik...
<p>You can use an <code>Exception</code> as <code>side_effect</code> to simulate <code>sys.exit</code> behavior without exit from your test.</p> <p><a href="https://docs.python.org/3/library/unittest.mock.html#unittest.mock.Mock.side_effect" rel="nofollow"><code>side_effect</code></a> documentation say:</p> <blockquo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Node.js: Referencing custom class within another custom class<p>I'm writing a web backend that has a User class. It also has an Attributes class which recor...
<p>Assuming you just want to call the other module...</p> <pre><code>var Attributes = require('/path/to/attributes.js') function User (id) { this.id = id this.attributes = new Attributes() } module.exports = User </code></pre> <p>If you want to extend <code>User</code></p> <pre><code>var Attributes = require('...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Input data must be multiple of cipher block size in AES CTR mode<p>I get this exception when I use Dart's <a href="https://pub.dev/packages/encrypt" rel="nof...
<p>This is a problem in Dart's encrypt package. It cannot handle something encrypted using AES CTR mode if it isn't a multiple of the block size. This package is wrapper for <a href="https://pub.dev/packages/pointycastle" rel="noreferrer">Pointy Castle</a>, which I was able to use successfully to decrypt a string enc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using VB.net Collection class via COM returns error: "Class doesn't support automation"<p>I have an existing VB.net class library which has a public property...
<p>OK, the problem was that the indexer is overloaded and you shouldn't use that in COM-visible interfaces: <a href="https://msdn.microsoft.com/en-us/library/ms182197.aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/ms182197.aspx</a></p> <p>Extract from the page about what happens to overloaded methods: ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: gathering statistics on tables without indexes<p>Does it make sense to gather regularly statistics on table without indexes in Oracle database? I'm asking fr...
<p>Yes it's still worth gathering the statistics. Information about the number and size of rows is of use to the optimizer, even though there are no indexes</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: If I add an extension to AddControllersWithViews() will it also apply to AddRazorPages()<p>If I use both <code>.AddControllersWithViews()</code> and <code>.A...
<p>First of all, the <code>Add~</code> methods that you can run within the <code>ConfigureServices</code> method are usually built in a way that you can call them repeatedly without any additional side effect. For the most part, they just add or configure services for the depenndency injection container, and they do th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: android ImageView setContentDescription with ListAdapter<p>I have a news list. I use this;</p> <pre><code>ListAdapter adapter = new SimpleAdapter(this, getX...
<p>You'll need to use custom binder to do this. It can be accomplished with adding something like this in the next line:</p> <pre><code>adapter.setViewBinder(new SimpleAdapter.ViewBinder() { @Override public boolean setViewValue(View view, Object data, String textRepresentation) { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel excluding resourceful functions in a clean way<p>Currently I have these 4 resourceful routes in my <code>web.php</code> file.</p> <pre><code>Route::...
<p>This question is already pretty old, but i just faced the same problem and solved it this way:</p> <pre class="lang-php prettyprint-override"><code>Route::resources([ 'campaigns' =&gt; 'CampaignController', 'users' =&gt; 'UserController', 'models' =&gt; 'ModelController', 'trims' =&gt; 'TrimControlle...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parse the output of subprocess.call() from Python<p>I am callign a webservice from my Python code : </p> <pre><code>response = subprocess.call(['curl', '-k'...
<p>Don't <code>PIPE</code> just call <code>check_output</code> passing a list of args and remove <code>shell=True</code>:</p> <pre><code> out = subprocess.check_output(["curl", "-k","--data", etree.tostring(tree)+"@SampleRequest.xml", "-v", "https://world-service-dev.intra.aexp.com:4414/worldservice/CLIC/CaseManageme...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL selecting name, number, and a count in a single query<p>I have 2 tables, Courses and Register. Courses holds a name and a number of a course, Register ho...
<p><code>SELECT C.ID, C.NAME, COUNT(R.STUDENT_ID) FROM COURSE C INNER JOIN REGISTER R ON C.ID = R.COURSE_ID GROUP BY C.ID</code></p> <p>I believe it would like this. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to turn off ANY optimisation flag in GCC<p>I am trying to understand how to turn off specific optimisation flags compiling with GCC. I understand that so...
<p>As stated in <code>man gcc</code>:</p> <pre><code>Most optimizations are only enabled if an -O level is set on the command line. Otherwise they are disabled, even if individual optimization flags are specified. </code></pre> <p>So basically by <em>not</em> passing any <code>-O</code> flags you aren't using confi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Postgres COPY FROM file throwing unicode error while referenced character apparently not in file<p>First of all, thank you to everyone on Stack Overflow for ...
<p>I would recommend loading the <em>SQL</em> file (which appears to be <strong>/tmp/tables_processed/Carbon.consensus.observations</strong>) into an editor that has a <em>hex</em> mode. This should allow you to see it (depending on the exact editor) in context.</p> <p><em>gVim</em> (or terminal-based <em>Vim</em>) is...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Stored procedure vs simple SQL performance comparison<p>Performance comparison between a stored procedures and simple SQL queries in C# OR linq queries.</p> ...
<p>To not use a stored procedure.</p> <p>The performance benefit of precompiled stored procedures was eliminated with SQL Server 7 (yes, that is 7 - 25 years or so ago, IIRC). Since then plans are cached and reused for dynamic SQL. Now stored procedures make only sense if</p> <ul> <li>The SQL is VERY large and he res...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to render a dynamic Select (ChoiceType)?<p>So I am trying to generate a dynamic select for <strong>Product Table</strong> form</p> <p>instead of writing ...
<p>If you have relation between the two entities (and i guess you have) you can easily use the entity type from Symfony to avoid problem like this which will show all the content inside the category table and submit the chosen object to be saved depending on your association :</p> <pre><code>$builder-&gt;add('category...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trouble pulling button in btn-group to right<p>I have the following code which displays some buttons:</p> <p><a href="https://jsfiddle.net/DTcHh/4360/" rel=...
<p>I would put the close ("X") button in its own <code>.button-group</code> and pull the group to the right:</p> <pre><code> &lt;!-- previous button location --&gt; &lt;/div&gt;&lt;!-- close the existing group --&gt; &lt;div class="button-group pull-right"&gt; &lt;!-- new button location --&gt; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ObservableCollection loses its collection<p>Using WPF with Prism and Unity - </p> <p>I have a strange defect where an ObservableCollection is losing its col...
<p>Thanks Aleksey. You got me on the right track. </p> <p>I forgot I had added auto-wiring in the view, so I had two instances of the view model. </p> <p>This is the part I removed from the xaml markup - </p> <pre><code>viewModel:ViewModelLocator.AutoWireViewModel="True" </code></pre> <p>Update for clarity -<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I need help using recursion to navigate every element in the DOM<p>I need to use recursion to navigate every element in the DOM, and for every body element, ...
<p>Given "every body element" actually means "every element in the body", you can start with an element and get all its child elements. Loop over the child elements and if any is type 1 and has a child nodes, you call the function again with the element.</p> <p>If it doesn't have children, go to the next child, etc. T...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reify random lookup value so it stays the same each time it is used<p>If I have this var defined in my playbook:</p> <pre><code>vars: - random_ref: "{{ loo...
<p>You can try as below</p> <pre><code>- name: Test set_fact: random_ref: "{{ lookup('password', '/dev/null chars=ascii_letters,digits') | to_uuid }}" run_once: true </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does this type of static XAML Binding work?<p>I cam across the following code in a XAML document, and I do not understand the syntax, nor do I understand...
<p>The ATF CommandService is a custom <code>MarkupExtension</code> provided by the framework. An example of a mark up extension can be found <a href="http://www.c-sharpcorner.com/uploadfile/mamta_m/creating-a-custom-markup-extension-in-wpf/" rel="nofollow">here</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to save local data in a Swift app?<p>I'm currently working on a iOS app developed in Swift and I need to store some user-created content on the device bu...
<p>The simplest solution for storing a few strings or common types is <a href="https://developer.apple.com/documentation/foundation/userdefaults#topics" rel="noreferrer">UserDefaults</a>.</p> <blockquote> <p>The UserDefaults class provides convenience methods for accessing common types such as floats, doubles, integers...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Searching for existence of multiple values in a dictionary<p>Is there a better(pythonic) way of achieving the below result. Looking for existence of multiple...
<p>You could check if <code>{a,b}</code> is a subset of the set made with the values of each dictionary.</p> <pre><code>if any({a,b}.issubset(set(d.values())) for d in mylist): print('found') </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Randomly distributing amount X to n items<p>The following exemplary data are available:</p> <p><strong>df_1</strong></p> <pre><code>DATE AMOUNT 201701...
<p>Try this one:-</p> <pre><code>import pandas as pd from random import randint # intialise data of lists &amp; Create DataFrame data1 = {'DATE': ['20170101', '20170102', '20170103', '20170104'], 'AMOUNT': ['500', '600', '400', '800']} df_1 = pd.DataFrame(data1) data2 = {'DATE': ['20170101', '20170101', '201...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I create random dots concentrated in a particular area in JS?<p>Need some conceptual help here. Currently, I have a random-dot function that creates t...
<p>You can use an exponential function to determine the distance with some random angle to achieve this.</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>// dot count const dot...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel filter a value in all columns<pre><code>public function getBooks($input) { $books= Book::where('book_name', 'LIKE', '%' . $input . '%')-&gt;get()...
<p>Most databases do not support searching all columns simultaneously. I'm afraid you'll likely have to chain all of the columns together:</p> <pre><code>$books = Book::where('book_name', 'LIKE', '%' . $input . '%') -&gt;orWhere('another_column', 'LIKE', '%' . $input . '%') // etc -&gt;get(); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firebase web: upload multiple files to Storage an then download their URLs<p>I am creating a blogging website, and am writing code that does the following in...
<p>Each time you call <code>storageRef.put(...)</code> it starts an asynchronous operation. Right now your `` doesn't wait for these asynchronous operations to complete, and instead returns the list of URLS before it's been populated.</p> <p>The easiest way to see this is by adding some simple logging to your code:</p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: IOS recursive dispatch async<p>I'm using xcode6 with ARC.</p> <p>I have a login storyboard with login stuff. I have a login process wich a wish to run in ba...
<p>I'm not sure you need to complicate things this much. You are <code>dispatch_async</code> to the same queue and you indicate that the calls you're making are themselves asynchronous.</p> <p>Assuming that <code>// Call Async URL withcallback block</code> indicates the call you're making is also asynchronous and take...