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: matplotlib: Get resulting bounding box of `bbox_inches=tight`<p>I often produce individual figures with matplotlib which are supposed to be aligned verticall...
<p>Thanks to @Schorsch and <a href="https://stackoverflow.com/a/19335925/1804173">@tcaswell</a> for pointing out that <code>ax.get_tightbbox</code> almost solves this problem. The only tricky part is to convert the renderer dependent bbox into an "inches" bbox. The general solution is:</p> <pre><code>tight_bbox_raw = ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Identity User FK<p>I've an application in Asp.NET Core 3.1 MVC with EF Core and Identity.</p> <p>I've two tables <code>Calls</code> and <code>AspNetUsers</c...
<p>You can set <code>ApplicationUser</code> like :</p> <pre><code>public class ApplicationUser : IdentityUser { public virtual ICollection&lt;Call&gt; Calls { get; set; } } </code></pre> <p>Call.cs:</p> <pre><code>public class Call { public int ID { get; set; } public string name { get; set; } // o...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calculator in one string with priority<p>How can I create a better solution without stacks or otherwise optimize this code.</p> <pre><code>import java.uti...
<p>First, you can create an Operation interface:</p> <pre><code>public interface Operation { double apply(double x, double y); } </code></pre> <p>Then, you create your concrete operations:</p> <pre><code>public enum BasicOperation implements Operation { PLUS("+") { public double apply(double x, doubl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Printing out a string from a struct defined array<p>When I run the code I only get "amsung" for the 2nd ID and a "" for the 4th, I tried putting some spaces ...
<p>I see 3 problems i think </p> <ol> <li><p>you need to give a size to your char brand[] or you need to malloc it.</p></li> <li><p>in the main you use tvs[answer] but you need to use tvs[answer -1] to have the right one in the array (array start at 0)</p></li> <li><p>in the main you else printf("please select a valid...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Automapper with a collection of abstract objects<p>Please take a look at this rather contrived example of what I'm trying to do.</p> <p>First, the dat...
<p>Your view model doesn't contain any <code>Id</code> field so I set those up as <code>Ignore</code> in the mapping. Then, I just used LINQ's <code>Union</code> clause to combine the two source lists into a single collection (after converting each one using Automapper). Here's the mapping:</p> <pre><code>Mapper.Cre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter: how to create a List with header from a firebase object<p>I have a collection with subcollections and documents in firebase and I would like to pres...
<p>You can copy paste run full code below <br> You can use package <a href="https://pub.dev/packages/grouped_list" rel="nofollow noreferrer">https://pub.dev/packages/grouped_list</a> <br> code snippet</p> <pre><code>GroupedListView&lt;dynamic, String&gt;( groupBy: (element) =&gt; element['group'], ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add a form after ul<p>How i can add form after ul? Here is my code:</p> <pre><code>&lt;article&gt; Lorem ipsum dolor sit amet, consectetur adipisicing e...
<p>You can use <code>next('ul')</code> to find the <code>ul</code> related to the <code>a</code>:</p> <pre><code>$(this).parent().next('ul').after('Form after ul'); </code></pre> <p><a href="http://jsfiddle.net/9q1aao0e/2/" rel="nofollow"><strong>Updated fiddle</strong></a></p> <p>I'm obviously assuming here that <c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: implode breaks Ajax call<p>So I'm making an Ajax call which will first check to see if that post ID has already been voted on.</p> <p>Currently I'm just wor...
<p>I just did a quick test with your code, and found a couple of issues that throw errors:</p> <p><strong>1.</strong> This line:</p> <p><code>$currentPosts = get_user_meta($user_id, 'pages_voted_on');</code></p> <p>should be</p> <p><code>$currentPosts = get_user_meta($user_id, 'pages_voted_on', true);</code></p> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating image which sweeps across the screen<p>I'm trying to create a banner that sweeps across the current scene. I want to create a banner which sweeps do...
<p>As hamobi said, it's best to use an 'SKSpriteNode' in Sprite Kit and not UIKit. Assuming your'e adding to an 'SKScene', your code above translated to Sprite Kit is:</p> <pre><code>-(void)createBanner{ SKSpriteNode* spriteNode = [SKSpriteNode spriteNodeWithImageNamed:@"Banner"] //It's good practice not to re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Insert record into table where ID is hashed?<p>I am trying to insert a record into a table which has two keys: <code>TableNo int</code> and <code>RateID varc...
<p>Generates a random 32 bit character which is unique</p> <pre><code>REPLACE(NEWID(),'-','') </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get elm to display HTML from an ajax call<p>I have the following Elm code, it is doing an Ajax call which will return some HTML which I want to embed ...
<p>You can use <a href="http://package.elm-lang.org/packages/evancz/elm-markdown/1.1.2/Markdown#toElement" rel="nofollow">Markdown.toElement</a> from the <a href="http://package.elm-lang.org/packages/evancz/elm-markdown/latest" rel="nofollow">elm-markdown library</a>. I tried this the following code on <a href="http://...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to prevent singleton object creation?<p>I have singleton class like below.</p> <pre><code>class X { static let shared = X() } </code></pre> <p>If ...
<pre><code>class X { static let shared = X() private init() { } } let b = X() // wrong . 'X' initializer is inaccessible due to 'private' protection level let c = X.shared // right </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Qt: Compare QVariable with Enum of DLL<p>I try to compare a QVariable of a QSignalSpy with a Enum in a test function. I found <code>Q_ENUM_NS</code>, but I g...
<p>I think you need to add an explicit export/import directive to the QT_NAMESPACE macro.</p> <pre class="lang-cpp prettyprint-override"><code>namespace CCS { Q_DECL_EXPORT Q_NAMESPACE ... } </code></pre> <p>But you'll most likely need to abstract the <code>Q_DECL_EXPORT</code> part so it is a <code>Q_DECL_I...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Accessing vec3b in a vector in opencv<pre><code>vector&lt;Vec3b&gt; dedColors; </code></pre> <p>Could someone please explain me how I can read and write val...
<p>You do it something like this:</p> <pre><code>vector&lt;Vec3b&gt; dedColors; dedColors.push_back(Vec3b(1,2,3)); dedColors.push_back(Vec3b(4,5,6)); dedColors.push_back(Vec3b(7,8,9)); </code></pre> <p>Where <code>1,2,3</code>, <code>4,5,6</code> etc are the BGR values of the elements that you want to store.</p> <p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is correct to call a function from a BackGroundWorker?<p>I have an application that gets data from a database, processes it, and then sends it to a defined I...
<p>Yes, that is perfectly acceptable, if not preferable. The question is not whether or not you are calling other methods from the <code>BackgroundWorker</code> event. Rather, the question is what those functions actually <em>do</em>. If they are modifying UI controls, that is unacceptable, whether it is done or the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I restrict the use of commands to only someone without a certain role on discordjs?<p>I have my bot in a discord server with quite a few troublemaker...
<p>Take away their roles, or just mute them.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filter Array object by title key<p>I am trying to get each data by filtering 'page_title' key. This is my sample json object.</p> <pre><code>{ "page_compone...
<p>You are missing <code>return</code> keyword</p> <pre><code>getPageComponents(title: string) { return this.pageComponents.filter((page) =&gt; { return page.page_title === title; }); } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Deleting similar elements from a nested list<p>I am creating a nested list using the following code:</p> <pre><code>from itertools import combinations def...
<p>Instead of deleting the similar ones, don't bother generating them in the first place. Really you don't want combos, you want overlapping chunks (except for the ones which contain more than one odd item, which your code already accounts for, and I adapted here).</p> <pre><code>def overlapping_chunks(size, sequence)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to generate primefaces PickList component programmatically?<pre><code>public void populateForm(ComponentSystemEvent event) { HtmlForm form = (HtmlFor...
<p>This is how I solved the PickList issue:</p> <pre><code>FacesContext context = FacesContext.getCurrentInstance(); ExpressionFactory ef = context.getApplication().getExpressionFactory(); PickList pickList = new PickList(); ValueExpression pickListValue = ef.createValueExpression( context.getELContext(), "#{rul...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: XSLT 2.0 for-each-group, sum based on parent value<p>I have tried to get <code>for-each-group</code> to work without success in my xml, I want to group the a...
<p>The problem is that for the case where the <code>area</code> attribute is "area1", there are only two <code>price</code> nodes involved. The <code>sum</code> function will not sum the same node more than once. (Change <code>sum</code> to <code>count</code> and you will see it return 2).</p> <p>Try changing the stat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python, find a word and the location of each character in that word in a string<p>Let's say in Python I have this sentence:</p> <pre><code>my_sentence = "I ...
<p>Simple: Just find the first occurrence of the word, then add offsets for the letters.</p> <pre><code>&gt;&gt;&gt; my_sentence = "I like to drive my car around the round block twice daily" &gt;&gt;&gt; word = 'round' &gt;&gt;&gt; pos = my_sentence.find(word) &gt;&gt;&gt; [(c, pos + i) for (i, c) in enumerate(word)] ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AngularJS template is not rendered correctly in MSIE 10<p>I'm trying to show a progressbar with a percentage value. The no angular version works in Chrome an...
<p>Use <code>ng-style</code> directive to change style dynamically with proper scope binding.</p> <p>Changed <code>style="width:{{value}}%;"</code> to <code>ng-style="{width: value + '%'}"</code></p> <p><a href="http://plnkr.co/edit/SQhVvrCRFI0GA0E2Zbhi?p=preview" rel="nofollow"><strong>Working Plukr</strong></a> </...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java to Swift - How to use math.pow and math.exp in Xcode 6<p>I'm in the process of trying to apply my java code to work under swift language and am running ...
<p>First, in order for these functions to be available, your code needs to have one of these imports at the top:</p> <pre><code>import Foundation //Generic import UIKit //iOS import Cocoa //OS X </code></pre> <p>The Swift version of Java's <code>Math.pow</code> is simply <code>pow(Double, Double)</code>. Th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: python intercept logging to email or sms<p>I'm wondering whether it's possible to intercept a logging call to send an email or sms based on the level.</p> <...
<p>You could use a <a href="https://docs.python.org/3/library/logging.html#filter-objects" rel="nofollow">Filter</a>:</p> <pre><code>import sys, logging class SMSEmailFilter(logging.Filter): def filter(self, record): if not record.args: if record.levelno == logging.WARN: email(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PySpark: How to apply a Python UDF to PySpark DataFrame columns?<p>I have a PySpark DataFrame with two sets of latitude, longitude coordinates. I am trying t...
<p>Don't use UDF when you can use Spark built-in functions as they are generally less performant. </p> <p>Here is a solution using only Spark SQL functions that do the same as your function : </p> <pre><code>from pyspark.sql.functions import col, radians, asin, sin, sqrt, cos df.withColumn("dlon", radians(col("p2_l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: error opening the storyboard files<p>in my project i have different Storyboard files to support different iPhones, i have this code in my appDelegate:</p> <...
<p>Here is an excerpt from UIStoryboard Class reference </p> <p>Parameters name<br> The name of the storyboard resource file <strong>without the filename extension.</strong> This method raises an exception if this parameter is nil.</p> <p>I made the relevant part bold. In case you are not a native speaker, it means d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Accessing CustomFieldDefinition metadata via tooling api<p>So, I've been attempting to gather picklist dependencies per Opportunity record type for my lightn...
<p>I think you're doing it wrong.</p> <p>"Controlling field" would be another picklist or a checkbox for example, something you change during same edit action. If you have dependency to record type - in that sense it's not a controlling field. Sure, you change record type and picklist changes - but really everything w...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: azure data factory lookup activity - parameterize sql query<p>How do I parameterize the where condition in a lookup activity query in azure data factory? I h...
<p>Official doc here: <a href="https://docs.microsoft.com/en-us/azure/data-factory/control-flow-expression-language-functions" rel="noreferrer">https://docs.microsoft.com/en-us/azure/data-factory/control-flow-expression-language-functions</a></p> <p><em>Expressions can also appear inside strings, using a feature calle...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filtering by title inside the category(many-to-many)<p>I have a page where I can choose the category of my item, then it takes me to a different template and...
<p>Your form action is taking you back to the same page, but with no <code>category_id</code>. That gives you a 404, because you don't have a url path defined for <code>'bike-category/'</code>. You need to set your action to <code>'search/'</code>, or better yet use the <code>url</code> template tag with the name of yo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL: Conditional Field output based on another field's value<p>I have an interesting situation. my Table has a numeric field called "Discount". It's an integ...
<p>You already have the boolean value stored. Simply do an if on it and concat the correct sign :</p> <hr> <p><strong>MySQL</strong></p> <pre><code>select if(isPercent, concat(discount, '%'), concat('$', discount)) from ... </code></pre> <hr> <p><strong>PostgreSQL</strong></p> <pre><code>SELECT CASE WHEN isPer...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Accessing Mount from Azure Files in Cloud Service<p>I successfully created and manually tested a share in Azure Files using instructions in <a href="http://b...
<p>I was able to resolve this by calling map using the P/Invoke method explained <a href="http://fabriccontroller.net/blog/posts/using-the-azure-file-service-in-your-cloud-services-web-roles-and-worker-role/" rel="nofollow">here</a>. The only trick was that I had to build the storage layer from <a href="https://github...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cant open Jar file which is open using a batch which is opened using another batch file<p>I am trying to open a batch file which is opened by another batch f...
<p>You are accessing the jar file RELATIVE to the folder you are executing it.</p> <p>Try this in your ServerStart.bat</p> <pre><code>java -Xms2048m -Xmx2048m -XX:PermSize=128m -jar "C:\Game Host\mc_ftb_monster-1.6.4\FTBServer-1.6.4-965.jar" nogui </code></pre> <p>so if you execute your ServerStart it will look for ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a trick to get weinre to connect (WP8.1 via Tools for Apache Cordova CTP3)<p>so, I need console output via the console plugin and in order to get th...
<p>If you are targeting only WP8.1+ and are building a "packaged app" (you do not web pages access Cordova APIs), then try using the "Windows Phone (Universal)" target. This uses the updated "Windows" Cordova platform instead of WP8 and therefore has full access to the VS debugger. weinre is not required in this case ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Apache running on which Port<p>Is there a way to programatically find out which PORT Apache is running on from within a Python program (WEB Application using...
<p>Environment variable SERVER_PORT should give it to you:</p> <pre><code>def application(env, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) return [ env['SERVER_PORT'] ] </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Module-scoped css files<p>TLDR in Angular 9, is it possible to lazy load CSS styles (not component-specific)?</p> <hr> <p>My module structure:</p> <pre><c...
<p>You can use the root component of the <code>AdminModule</code>, let's call it AppComponent, and use the <code>::ng-deep</code> (deprecated) selector in combination with <code>:host</code>. Even though this selector is deprecated, they will not remove it until there is a suitable replacement option:</p> <p>app.compo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: <copy> doesn't support nested "chainedmapper" error in Ant<p>I have an Ant task that should copy some files and rename them on the fly. For example:</p> <bl...
<p>I was using an old version of ant (1.6). The chainedmapper type is only available since Ant 1.7.0.</p> <p><a href="https://ant.apache.org/manual/Types/mapper.html" rel="nofollow">Ant Mapper Type</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Leaks never show up in Xcode 6.1.1 Instruments tool<p><a href="https://stackoverflow.com/questions/1056073/no-leaks-appearing-in-instruments-even-though-im-s...
<p>Are you using ARC? In so, then that's not a leak. </p> <p>If you are not using ARC, then please note that the static analyzer ("Analyze" on Xcode's "Product" menu) is absolutely brilliant at identifying all sorts of problems. It would have immediately identified the issue you reference in your question, bringing it...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regex with multiple groups<p>I have the following single line string</p> <pre><code>10101010110001 </code></pre> <p>I want to capture all 0s between 1s </p...
<p>You almost had the idea. The problem with your solution is that you already consumed the 1 that you want to use in the next match. </p> <p>To get around this, use a positive lookahead:</p> <pre><code>/1(0+)(?=1)/ </code></pre> <p>The first 1 will be consumed when matched, but the positive lookahead prevents the 2...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use several splitters in Kivy?<p>I'd like to use two splitters in a single screen, so that the user can have either one of the 3 parts to fill the who...
<p>After some tweaking, here is a working example for 2 horizontal splitters, so the parts between them have a minimum size:</p> <pre><code>BoxLayout: id: all min_view_size: sp(30) strip_size: sp(13) Splitter: id: splitter1 sizable_from: 'right' strip_size: all.strip_size max_size: all.wid...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: bitmap image not displayed in imageview<p>I am created a app in which i am allowing user to select image from gallery or take a picture from camera and uploa...
<p>You should scale image before display it to ImageView. Once i was facing same problem and scaling of bitmap solve my problem.</p> <p>Below is code to do so-</p> <pre><code>Bitmap b = BitmapFactory.decodeByteArray(bitmapProfilePic , 0, bitmapProfilePic .length) ivProfilePic.setImageBitmap(Bitmap.createScaledBitmap(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Determine if a language is context free<p>Lets say you have a language L and you want to determine if it is context free. Context free languages intersected ...
<p>No, your statement is <strong>not</strong> true. Consider the following counter-example:</p> <p><code>L = {0<sup>n</sup>1<sup>n</sup>2<sup>n</sup> | n > 0}, P = T = Ø</code>. Clearly we have <code>L ∩ P = L ∩ Ø = Ø = T</code>, and <code>Ø</code> is both regular and context-free.</p> <p>Note it is well-known that <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Make sure MATLAB does not recalculate symbolic expression<p>I am building (my first...) MatLab program, it needs to differentiate an equations symbolically a...
<p>You could wrap your function into some kind of Function-Factory, which does not return numerical results, but a function that can be evaluated:</p> <p>(I had to replace the call <code>syms</code> with <code>sym('mu')</code>, because for some reason it kept calling a <code>mutools</code> function in line <code>omega...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: open62541 Client is disconnect from OPC-UA Server<p>first thanks to read this question</p> <p>I have some problem about open62541 disconnect issue</p> <p>I...
<p>I solve this problem myself</p> <p>I tested other open62541 version.</p> <p>It is work. Just changed open62541</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Querying into a Cube from View SQL Server using Laravel 6<p>I'm trying to access data to an SSAS CUBE server using SQL Server and Laravel (v.6), the problem ...
<p>it's worked after changing the connection from SQL Auth to Windows Authentification into Laravel, by removing the username and password from .env file.</p> <p><a href="https://i.stack.imgur.com/hSt0a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hSt0a.png" alt="enter image description here"></...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java lambda expression best practices<p>Java stream operators can sometimes become very cumbersome and hard to debug. Is there a best practice guideline as t...
<p>Java streams are not a silver bullet and you don't have to use it everywhere. There are a lot of cases where you could solve the problem using standard <code>for</code> loop approach.</p> <p>As for your code.. It is a good example where streams complicate the code and make it hard to understand/maintain. But still ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Insert values in a table based on entries of other table in Redshift<p>I have two tables in AWS Redshift and need to insert some values into one table based ...
<p>You could just do it in an SQL query, something like:</p> <pre class="lang-sql prettyprint-override"><code>INSERT INTO Selection ( SELECT Id, CASE WHEN firstName || lastName IN ['JohnLuie' , 'FranklinWatson] THEN 1 ELSE 0 END FROM person ) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firebase storage rules for bucket not allowing access<p>According to these <a href="https://stackoverflow.com/questions/38661958/making-firebase-storage-publ...
<p>Security rules only control access to objects storage buckets when going through web and mobile clients using the Firebase SDKs for those platforms (e.g. Android, iOS, web, Unity). It doesn't have any effect on access via URLs in the domain "storage.googleapis.com".</p> <p>Even though Cloud Storage is a Google Clo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parse data not loading before Table View shows<p>I'm using Parse to pull data into a <code>Table View</code>. I'm using <code>PFQueryTableViewController</co...
<p>Here is the problem in your code. The following code is running in background. Therefore, you will need a <code>[tableview reload]</code> after it is done. And you will need to do this in main thread. </p> <pre><code>[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { // a lot of stuf...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Iterator function miss-understanding concept<p>If I'm not mistaken, an Iterator function serves as a way to build a collection faster because it remembers th...
<blockquote> <p><strong>No</strong>, you cannot access the auto generated iterator at design-time.</p> </blockquote> <p>The <a href="https://msdn.microsoft.com/en-us/library/hh156569.aspx" rel="nofollow">Iterator</a> keyword offers a quick and easy way to create an iterator without actually having to create one. It'...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make smooth animation in css?<p>I have used animation of translate(). The link to the code is here <a href="http://codepen.io/Falcon43/pen/azYqxO" rel...
<p>@harcos answer is correct, but does not have a smooth start. Add the <code>transform:translateY(-90px);</code> to all the different animation classes for them to be rendered where the animation starts.</p> <p><div class="snippet" data-lang="js" data-hide="true"> <div class="snippet-code snippet-currently-hidden"> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to parse XML With XmlPullParser?<p>I read an Xml file with XmlPullParser but it gives Exception (unterminated entity ref (position:TEXT @817:4 in java.io...
<p>After much research I realized that I couldn't use the <strong>&amp;</strong> character in the Dscp Value and I need to use alternate codes.<br> What are the special characters in XML?</p> <pre><code> &amp;lt; (&lt;), &amp;amp; (&amp;), &amp;gt; (&gt;), &amp;quot; ("), and &amp;apos; ('). </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to decode a byte[] of List<Objects> to Dataset<Row> in spark?<p>Me using spark-sql-2.3.1v , kafka with java8 in my project. I am trying to convert topi...
<p>Your struct got named with "col" when exploding.</p> <p>Since your Bean class doesn't have "col" attribute, it is failing with mentioned error.</p> <blockquote> <p>Exception in thread "main" org.apache.spark.sql.AnalysisException: cannot resolve 'companyName' given input columns: [col];</p> </blockquote> <p>Y...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to select five values of a column with the top 5 in their corresponding row?<p>So I have two columns <code>date</code> and <code>norder</code> in my SQL ...
<p>This should do.</p> <pre><code>SELECT date FROM orders ORDER BY order DESC, date DESC LIMIT 10; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to query to get all documents referenced to another collection based on one field as username<p>In my Node API and MongoDB, I'm trying to make an endpoin...
<p>You can use the <a href="https://docs.mongodb.com/manual/reference/operator/aggregation/lookup/" rel="nofollow noreferrer">$lookup</a> aggregation to join collections.</p> <pre class="lang-js prettyprint-override"><code>db.profiles.aggregate([ { $match: { username: "Jakos" } }, { $lookup: { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: rolling 30-day geometric mean with variable width<p>The solution to <a href="https://stackoverflow.com/questions/52558593/rolling-geometric-means-using-dplyr...
<p>Easiest way to compute rolling statistics depending on datetime windows is <a href="https://gogonzo.github.io/runner/" rel="nofollow noreferrer">runner</a> package. You don't have to hack around to get just 30-days windows. Function <a href="https://gogonzo.github.io/runner/articles/apply_any_r_function.html" rel="n...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Need to generate a new text file and save it every time I run a script in python<p>I currently have a program that appends to an already existing file called...
<p>You can do something on the lines of the following</p> <pre><code>class my_class: _data_fd = None def __init__(self,create,filename): if(create): self._data_fd = open(filename,'w') def __del__(self): if(self._data_fd != None): self._data_fd.close() def measureSampl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel 5 Request - altering data<p>I have come across an instance where I need to alter the data that needs to be validated i.e. when no slug has been submi...
<p>You should do it in <code>formatInput</code> method. Data you return in this method will be used for validator to check:</p> <p>For example:</p> <pre><code>protected function formatInput() { $data = $this-&gt;all(); if( $data['slug'] === '') { // if the slug is blank, create one from title data ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Scrape Embedded Google Sheet from HTML in Python<p>This one has been relatively tricky for me. I am trying to extract the embedded table sourced from google ...
<p>Well if you would like to get the data into a DataFrame, you could load it directly:</p> <pre class="lang-py prettyprint-override"><code>df = pd.read_html('https://docs.google.com/spreadsheets/u/0/d/e/2PACX-1vQ--HR_GTaiv2dxaVwIwWYzY2fXTSJJN0dugyQe_QJnZEpKm7bu5o7eh6javLIk2zj0qtnvjJPOyvu2/pubhtml/sheet?headers=false&...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Primitive assembly performance<p>I am currently experimenting with some terrain/height-map rendering. Each tile of that terrain is rendered with a VBO and IB...
<blockquote> <p>How does the GPU know which vertices to process? Maybe some of them are not indexed. Do they still get processed?</p> </blockquote> <p>Your index buffer and the range of vertices in your draw call determine which vertices are processed and also define the order of use during primitive assembly. Any v...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Local Database for Windows Phone 8<p>I have started working on windows phone development recently. I have come across how to maintain relational database loc...
<p>SQL Server CE uses it's own methods to store the database within isolated storage.</p> <p>If you want to use SQL Server CE with linq, then you need to define your model classes as a <code>System.Data.Linq.Table</code> object, which will be placed in a class of type <code>System.Data.Linq.DataContext</code>.</p> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is method hiding a form of Polymorphism?<p>Polymorphism is the ability to take many forms. Method overriding is runtime polymorphism. </p> <p>My questions a...
<p>If we run this test</p> <pre><code>class A { static void x() { System.out.println("A"); } } class B extends A { static void x() { System.out.println("B"); } } class Test { public static void main(String[] args) throws Exception { A a = new B(); a.x(); } } </...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: VB .Net My.Application.CommandLineArgs<p>I'm using My.Application.CommandLineArgs.Item(0) and My.Application.CommandLineArgs.Item(1) , I pass in the argument...
<p>That is how command line arguments work. If you really don't want to enclose the path in double quotes, I think you will have to be prepared to loop through all the arguments (joining them together with spaces in between) until you either find an argument that begins with -f: or you reach the end of the arguments.</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove a particular section from {{ content_for_layout }} in shopify template<p>I am trying to customize <strong>Supply</strong> theme in shopify In <strong>...
<p>Please find for setting_data.json there you can find all declared values. There you can search for "content_for_index".</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Center Path inside SVG<p>Is it possible to center a path vertically within an SVG element? </p> <p>This is one of the paths I need to center: </p> <pre><co...
<p>If you mean automatically, without intervention, then no. However you can add a transform to the path to centre it in the SVG.</p> <p>The bounding box for the path is:</p> <pre><code>{ x: 8.859999656677246, y: 40.347999572753906, width: 125.81500244140625, height: 94.6520004272461 } </code></pre> <p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to close previous activity from current activiy in android<p>Hi i am working with IME in android. In my keyboard i have a special key which start quick-A...
<p>I'm not certain it's the best user experience, but you can usually accomplish that behavior with intent flags. In particular, adding <a href="https://developer.android.com/reference/android/content/Intent.html#FLAG_ACTIVITY_NO_HISTORY" rel="nofollow">FLAG_ACTIVITY_NO_HISTORY</a> to the launch intents for your option...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Median with groupby and frequency<p>Suppose I have this dataframe called 'market'</p> <pre><code>market = pd.DataFrame({'product': ['milk', 'milk', 'milk', ...
<p>Using <code>numpy.repeat</code> and <code>numpy.median</code>:</p> <pre><code>new_df = market.groupby('product').apply(lambda x: np.median(np.repeat(x['price_each'], x['frequency']))) print(new_df) </code></pre> <p>Output:</p> <pre><code>product bread 8.0 milk 4.5 dtype: float64 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Swiftui hide disclosure arrow<p>I have this View</p> <pre><code>NavigationView { GeometryReader { geometry in List { ...
<p>Thanks to @Asperi I figured out what is the problem.</p> <p>With a zero EdgeInsets in listRowInsets the arrow still show.</p> <p>So I create this trick (Works in Xcode 13.3.1)</p> <pre><code>List { ForEach(self.viewModel.items) { item in //code for creating the row }.listRowInsets(EdgeInsets.init(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: foreach: how to repeat one whole table cell<p>How do I repeat a table cell in knockout? The code I have is only repeating the cell contents and not the whole...
<p>Pull the foreach into a comment element:</p> <pre><code>&lt;!-- ko foreach: { data: permissableAccess.accessTypes, as: 'accessType' } --&gt; &lt;td&gt; &lt;div class="checkbox"&gt; &lt;label&gt; &lt;input type="checkbox" data-bind="checked: accessType.hasAccess" /&gt; &lt;span da...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: One Bus Instructions for Arm Instructions<p>I am currently trying figure out one instructions given each clock cycle using an ARM processor. I have been int...
<h1>Machine Code</h1> <p><a href="https://www.scss.tcd.ie/%7Ewaldroj/3d1/arm_arm.pdf" rel="nofollow noreferrer">The ARM Architecture Reference Manual</a> specifies the machine code for instructions. Page A7-68 describes the format for an LSR instruction with an immediate input.</p> <pre><code>//I can't post an image be...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: User is being sporadically logged out (only happens in Chrome)<p>Using a script I've previously used to start and store a session, except, instead of the use...
<p><strong>Here is the problem:</strong></p> <pre><code>if(!isset($_SESSION['user']['username'])){session_start();} </code></pre> <p>You are attempting to read a session before you declare <code>session_start()</code>.</p> <p>Reading from the <a href="https://www.php.net/manual/en/function.session-start.php" rel="...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: If-loop for small console game<p>Hopefully you can help me! I have drawn a blank with this. I am making a small console game. I am entirely new to c#, so ma...
<p>This is just an example of how you could make the battle.</p> <pre><code>var Battle = new Task(() =&gt; { for (int ctr = 1; ctr &lt;= 3; ctr++) { Console.WriteLine(" In battle {0}", ctr); Task.Delay(1000).Wait(); //Code that makes Ran...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kubernetes multiple nginx ingress redirecting to wrong services<p>I want to deploy two version of my app on the same cluster. To do that I used namespace to ...
<p>The problem is that I was using the same "nginx" class for both ingress. Both nginx controller was serving the same class "nginx".</p> <p>Here is the wiki of how to use mutilple nginx ingress controller: <a href="https://kubernetes.github.io/ingress-nginx/user-guide/multiple-ingress/" rel="nofollow noreferrer">http...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: displaying my toolbar image as background to status bar effecting navigation bar in android<p>I want my toolbar to take the space of status bar and the image...
<p>This is the solution I used for testing on android 10 and other versions, so check if this is of any help. </p> <p>In your <code>styles.xml</code> create a custom theme, you can set parent theme to what your app theme is if it has any of the NoActionBar (AppCompat/DayNight/material etc.) set as parent or set one di...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unity Hub constantly keeps asking for the same update, but downgrades after computer restart<p>Right now, my Unity Hub is version 2.1.2. Every time I start t...
<p>Eventually, all I did was just completely reinstall (uninstall, along with Unity) the Unity Hub, and I didn't run into this issue again. Strange...</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: indirect reference to a structure variable using a string variable in Matlab<p>I'm trying to create a variable where I can type in a string corresponding to ...
<p>The way to do this in matlab is to encapsulate the variable in parentheses when using it to reference a struct field.</p> <p>For example:</p> <pre><code>&gt;&gt; thisstruct.A = [1 1 1]; &gt;&gt; thisstruct.B = [0 0 0]; &gt;&gt; variable = 'A'; &gt;&gt; thisstruct.(variable) ans = 1 1 1 &gt;&gt; variable =...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Best way to store a large amount of floats in a file with Python?<p>I have a program that generates a very large sequence of floating point numbers, usually ...
<p>You can store the floating point numbers as 64-bit doubles using the <code>struct.pack</code> function:</p> <pre><code>from struct import pack, unpack array = [39534.543, 834759435.3445643, 1.003024032, 0.032543, 434.0208] with open('store', 'wb') as file: file.write(pack('d' * len(array) , *array)) </code></...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filter not working appropriately- when inner joining tables<p>I have a list of students with placement scores that can be sorted or filtered. I noticed (visu...
<p>Your modelstate is stale, so you will want to clear it using <code>ModelState.Clear()</code> prior to your async call to the database.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do buffers work in java IO?<p>I'm having trouble understanding how do buffers work in Java IO.</p> <p>Excuse me if I don't express myself as clearly as ...
<p>It may help you to understand the difference between a writer and a stream. An OutputStream is a binary sink. A Writer has a character encoding and understands about newlines. The OutputStreamWriter allows you to send character encoded data, and have it correctly translated to binary for consumption by an OutputStre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I move object values to an array in MongoDB?<p>I'm would like to do a data transformation using MongoDB Aggregation Framework. I'm stuck for several h...
<p>I'm assuming you want to run such aggregation dynamically (not knowing key names). In such case you need to start with <a href="https://docs.mongodb.com/manual/reference/operator/aggregation/objectToArray/" rel="nofollow noreferrer">$objectToArray</a>, then run double <a href="https://docs.mongodb.com/manual/referen...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to do train composition - compositon of classes<p>I am currently working on a train simulation project for uni.</p> <p>This is my class hierarchy:</p> ...
<p>Im not sure about what are you asking, but I will try to give you my aproximation:</p> <p>You need to create a composite object where every object has an unique ID and need to pass some validations.</p> <p>I would implement an "StoregeManager" a "ComposerManager" and add an abstract validator method in "RollingSto...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cordova SQLite plugin promises javascript chain<p>Hello guys so I'm trying to call 3 promises in one iteration then after they are done iterate one more time...
<p>A good way to think about this is that the construction of your promise chain is independent of their execution. Once you get that mental model in place, it's easy to reason about.</p> <p>Let's break it down into steps and build up our code from there.</p> <p><strong>Execute asynchronous code and allow actions to ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get inline-block elements to print straight across?<p>I have the following block of code:</p> <pre><code>&lt;div class="1"&gt; Foo&lt;br&gt;1 &lt;/...
<p>Like the others said, <code>1</code> and <code>2</code> won't work for class names; I've changed them to <code>a</code> and <code>b</code> respectively. And they're also correct that your CSS is nested but you didn't select SCSS for your fiddle so that's invalid CSS. Fix those two things and it works:</p> <p><div c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to convert multiple EditText value into one date String in android studio?<p>its an age calculator project I need to know how to convert multiple EditTex...
<h2>Go all-in on Joda-Time</h2> <pre><code> String day = "11"; String month = "4"; String year = "2012"; String sDate = "" + year + '-' + month + '-' + day; LocalDate dob = new LocalDate(sDate); LocalDate today = new LocalDate(); if (dob.isBefore(today)) { Period period = new Peri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Solr query to beans - java.lang.IllegalArgumentException<p>I am inserting POJO's into Solr and now attempting to query and deserialize back into the POJO's. ...
<p>It seems that even though I kept the typecast at the setter method:</p> <pre><code>public void setStatusCreatedDateFromDate(Date created) { this.statusCreatedDate = (DateTimeFormat.forPattern("yyyy-MM-dd'T'HH:mm:ss.S'Z'")).print(new DateTime(created)); } </code></pre> <p>Solr doesn't look at the type it can pr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Exception in ssl certificate code<p>I made a client server socket connection with sslStream but there is a a exception on server when the code reaches to lin...
<p>thank you my friends, i finally could find my problem.</p> <p>the code needed a little edit but the main problem wasnt the code. </p> <p>the problem was from the way certificate files work. i just had generated a pfx file and gave its address to code below:</p> <pre><code>sslStream.AuthenticateAsServer(server); <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sparse Multidimensional Array taking huge space - HashTable better?<p>Is there a better approach to use of Multidimensional Arrays to compute values to be di...
<p><strong>This answer is outdated, because the OP added the information, that the data is a sparse matrix</strong></p> <hr> <p>Not really. Maybe a one dimensional array (would save the pointers to the dimensions - but that's err... pointless).</p> <p>An array is the data structure with the fewest metadata (because ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: c++ WriteFile unicode characters<p>I'm trying to write a wstring into a UTF-8 file using WriteFile function. I want the file to have these characters "ÑÁ" bu...
<p>You need to convert the UTF-16 data to UTF-8 before writing it to the file.</p> <p>And there is no need to create the file with <code>std::ofstream</code>, close it, and re-open it with <code>CreateFileW()</code>. Just open the file once and write everything you need.</p> <p>Try this:</p> <pre><code>#include &lt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Any way to intercept access to internal Dictionary in C# with DynamicProxy?<p>I've a simple class and interceptor set up (heavily based on the freezable exam...
<p>Executing <code>rex.Dict["key"] = 2;</code> is similar to </p> <pre><code> Dictionary&lt;String, Int32&gt; dico = rex.Dict; dico["key"] = 2; </code></pre> <p>As you can see, calling <code>rex.Dict["key"] = 2;</code> don't call any set method on rex instance. Your interceptor won't intercept anything. </p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Renci SSH C#, open a client in Rpi and send commands using that client<p>I am looking for a way to help me ssh open a binary client in raspberry pi and send ...
<p>I just found a way to solve my question : ) For this situation, just using CreateShellStream and StreamReader/StreamWriter to achieve this purpose.</p> <pre><code> SshClient sshclient = new SshClient(HostAddress, "pi", "raspberry"); sshclient.Connect(); string default_set_statu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: check input from console<p>I'm trying to read user input in console and check if file or folder exists without them entering full path? This is my code:</p> ...
<p>The method you are looking for is <a href="http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#exists-java.nio.file.Path-java.nio.file.LinkOption...-" rel="nofollow">java.nio.files.File.exists(Path,LinkOption)</a>. </p> <p>In your case the usage for this method would be:</p> <pre><code>Path file; do ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Static variable lifetimes, file-scope vs. function scope<p>suppose I have a <code>.cpp</code> file:</p> <pre><code>static Foo aFoo; Foo&amp; staticFoo(){ ...
<ol> <li>No. If someone calls <code>singletonFoo</code> from another translation unit during static initialization then it's unspecified.</li> <li>No because the destruction happens in reverse order of construction and we already established that construction is not guaranteed.</li> <li><code>aFoo</code> will be destro...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Oracle : Grant select on a View<p>I'm trying to perform a select operation on a view which contains a few tables as follows</p> <pre><code>SELECT count(1) F...
<p>Your view uses DBA_VIEWS. You have privileges to select from DBA_VIEW but not the privilige to grant select to other users.</p> <p>This is the difference between:</p> <pre><code>Grant select on some_table to_some_user </code></pre> <p>and </p> <p><code>Grant select on some_table to_some_user with grant option</c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to split string into list nodes?<pre><code>def add(num1,num2): str1 = str(num1) str2 = str(num2) size1 = len(str1) size2 = len(str2) ...
<blockquote> <p>if input is 123235, then list1=["3235","12"]</p> </blockquote> <p>Getting string into reversed chunks of max 4:</p> <pre><code>def chunkate(str_num, n=4): s = "".join(reversed(str_num)) a = [s[i:i+n] for i in range(0, len(s), n)] return ["".join(list(reversed(k))) for k in a] print(chun...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to store symmetric secret key in Java PKCS12 keystore<p>I need a secure store for symmetric keys that works for both .NET and Java. I need to be able to ...
<p>The <code>KeyStore</code> implementations of Java SE have gained a lot of attention in the later releases. Your code should run fine on Java SE 8 for JCEKS key stores, but not on Java SE 7.</p> <p>You probably need to wait for Java 9 for PKCS#12 support. Java 9 will focus on support for PKCS#12 key stores.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extract data between br Tag with beautifulsoup<p>how can I extract <code>INFO1</code> and <code>INFO2</code> from following html code with beautifulsoup? </p...
<p>Use following <code>Css selector</code> and <code>find_next_sibling(text=True)</code></p> <pre><code> import requests from bs4 import BeautifulSoup res=requests.get("https://swisswrestling.ch/wrestlers?id=91") soup=BeautifulSoup(res.text,'lxml') print(soup.select_one('span.text-danger:nth-of-typ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Elastic search filter query with bool returns invalid results<p>I'm using Elastic search in Laravel.</p> <p>So I have query that returns correct result:</p>...
<p>This is your trouble spot:</p> <pre><code> 'must' =&gt; [ 'term' =&gt; [ 'type' =&gt; 11 ], 'term' =&gt; [ 'public' =&gt; 1 ] ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: str_replace Replacing same occurence of string as many times as it founds it<p>I am trying to replace some strings from an array with other strings, just tha...
<p>Try <code>preg_replace</code>:</p> <pre><code>foreach($array as $elem) { $html = preg_replace("/$elem(?! \| added)/", "$0 | added", $html); } </code></pre> <p>Replace each item if it is not already followed by <code>| added</code>. You could use <code>$elem</code> instead of <code>$0</code>. There might be a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: android sqlite query slow<p>I have a database (sqlite) where I do this query :</p> <pre><code>String query = "SELECT * FROM "+DATABASE_TABLE+ " WHERE " +COL...
<p><code>Indexing</code> made my queries <strong>about 400x faster</strong>.</p> <p>Here you'll find a nice tutorial: <a href="http://www.tutorialspoint.com/sqlite/sqlite_indexes.htm" rel="noreferrer">http://www.tutorialspoint.com/sqlite/sqlite_indexes.htm</a>.</p> <p>Index all the fields involved in <code>WHERE</cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AWS Lambda remove unwanted rows of text<p>I have a text file which is dropped in to an s3 bucket <strong>(bucket_name_1)</strong>, I would like to use AWS La...
<p>I would recommend:</p> <ul> <li>Download the file to <code>/tmp/</code> using <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/s3.html#S3.Client.download_file" rel="nofollow noreferrer"><code>download_file()</code></a></li> <li>Manipulate the file, or copy the desired lines to an ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set value of integer inside of TextView element?<h2>What do I want to achieve?</h2> <ul> <li>I want to have a <code>TextView</code> element updating ...
<p>Solution: Add two more <code>TextView</code>s in your <code>view</code> and update those accordingly.</p> <p>You don't have to use array of numbers to get the random number.. just use random number with <code>bound</code> as a parameter. (this is optional though, your array based approach is also well).</p> <p>Act...