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: Is it possible that a docker-container brings down a whole system?<p><br/>I hope my question isn't to abstract. I'm kind of stuck during troubleshooting my d...
<p>It depends on several factors:</p> <ul> <li>If your container is privileged or has volumes that allows it to access the host system, it can do anything (erase files, shutdown, etc). This is usually not the case tho.</li> <li>If this container manages to starve the system of resources, it'll act as a sort of <a href...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add meta data into CSV file to instruct Excel how it should open<p>I'm exporting CSV files which column headers texts change from English to French in an Ang...
<p>Try adding a BOM (Byte Order Mark) to the beginning of your csv, so that Excel recognizes the character encoding correctly:</p> <pre><code>let bom = "\uFEFF"; let csv = "a;b;c;"; let blob = new Blob([`${bom}${csv}`], { type: 'text/csv;charset=utf-8;' }); // proceed with saving the blob ... </code></pre> <p>I've cr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I make individually self-sizing UICollectionViewCells with multiple labels in Swift?<p>Here is my view controller:</p> <pre><code>// ReadArticleView...
<p>I did this by modeling my view after what was done in this repository: <a href="https://github.com/algal/SelfSizingCellsDemo" rel="nofollow">https://github.com/algal/SelfSizingCellsDemo</a></p> <p>First you make a labelView and then add them to the subview (cell). Then you make a newLabel and size it and whatnot. <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to register generated resources in Android Gradle task?<p>I am trying to generate some Android resources in a Gradle task. </p> <p>I've written a task w...
<p>To create resources, android requires </p> <p>1) A resource directory above <code>values</code> folder then you can add desired resources as per your requirement</p> <p>2) Instruct the build process to add the generated resources while building <code>R.java</code></p> <p>So first configure your build resource tas...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to ignore lines in a file starting with "##" and load the table in csv module?<p>So, I have a file which has some 40 lines starting with '##'. After thos...
<p>You can use an iterator, which does not realize all of the file in memory (can be a concern if the file is big)</p> <pre><code>def read_fn(): path = "./text.tsv" with open(path, "r") as f: for line in f: if line.startswith('##'): continue yield line reader = ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Make NPM remove module deleted from package.json, ie reflect the state of package.json<p>If I remove a dependency in package.json, is there a command I can r...
<blockquote> <p>I want a command to make my node_modules directory reflect the dependencies I set up in package.json. Is there any way to do this?</p> </blockquote> <p>Not yet. This is functionality that may come in <code>npm@3</code> -- you can read the blog post that lays out the plan for <code>npm@3</code> depen...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What's the rationale behind "Serializable" interface?<p>If we want to serialize an object, we can simply do the following implementation:</p> <pre><code>cla...
<p>Because:</p> <ol> <li>Not all objects have meaningful semantics for this. Example: singleton object</li> <li>Security. If you pass objects to someone else's code and they could always capture and transmit the object then there would need to be an opt out for security related code and there would be security bugs wh...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Application based on qxmpp can't connect to server on Android, but working well on windows<p>I'm using qxmpp library in my project. I've tried to write simpl...
<p>That was because of QDnsLookup was not developed for Android. And i pass this problem by using IP address of my own servers. (Its didn't work by Google servers using ip address)</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Avert value duplicating<p>Suppose we have table A:</p> <pre><code>Customer_number | Region_id ----------------------------- 123 | 1 132 ...
<p>I think creating trigger on the table should work as you wish.</p> <pre><code>create or replace trigger trg_a_region_id before insert on A for each row begin delete a where Region_id=:new.Region_id; if sql%rowcount&gt;0 then dbms_output.put_line(sql%rowcount ||' rows deleted'); end if; end; <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to loop through array and push it into a seperate array based on some conditions using react?<p>i have an array named "all_items" and i want to split tha...
<p>There are a couple ways to approach this problem. I think the cleanest approach in terms of readability and length is to leverage Javascript's built in prototype <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter" rel="nofollow noreferrer"><code>Array.filter()</cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to write batched transactions for firebase admin realtime db?<p>is there a way to perform batched transactions on different fields in realtime database w...
<p>You can't pass a bunch of transactions into a <code>update()</code> call, which is what the error message is (admittedly somewhat confusingly) is trying to tell you.</p> <p>Firebase has no concept of nested, or batched, transactions. If you need to perform a transaction over multiple locations, you will need to run...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jquery window location not work inside php echo?<p>jquery window location is not work inside the php echo statement, is there any wrong in my code?</p> <p>t...
<p>If you really want to use jQuery/javascript , make sure you include jQuery library before Any jQuery code . If your posted code is the Starting code <code>Before HTML</code> , make sure you include js library first. </p> <p>I would say if you use jquery to redirect , you will need DOM to be loaded (it will take a f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to handle non traditional queries in Node.js REST APIs<p>I have some PHP and front-end JavaScript experience, but am trying to make a Node.js REST API to...
<p>I believe this really depends on the consumer of your API, and isn't really a question specific to NodeJS.</p> <p>You have a resource at <code>/customers</code>, and for basic CRUD you might have <code>GET</code>,<code>PUT</code>, <code>POST</code>, <code>DELETE</code> methods. </p> <p>In taking a cursory glance a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Any way to get a gif as a background with swiftUI?<p>I am trying to get a gif to be a background layer of a view but swiftUI doesn't seem to allow that. I've...
<p>I've used a WKWebView to display a gif. The resulting view can be set anywhere. To set it as a background, you'll probably want to resize the contents of the WKWebView according to the contents of the superview.</p> <pre><code>import SwiftUI import WebKit struct HTMLRenderingWebView: UIViewRepresentable { @Bin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is my loop function to create 4 divs wrong?<p>Im practicing using loops and what I did was:</p> <pre><code>var writing = function() { for (var i = 0, n...
<p>My solution is kind of same. Talking about your code,</p> <p>this line..</p> <pre><code>document.createElement("div") += 1; </code></pre> <p>is an invalid assignment and will not increment the DOM element count. Keep the things simple. Following is my edit..</p> <pre><code>var writing = function() { var elm; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Member function pointer error: Reference to non-static member function must be called<pre><code>this-&gt;scheduleOnce(schedule_selector(SelectGameScene::star...
<p>XCode compiler thinks that SelectGameScene::startGameCallback is static method but it is just a member function pointer. So I decide to rewrite this statement.</p> <p>from </p> <pre><code>this-&gt;scheduleOnce(schedule_selector(SelectGameScene::startGameCallback),0.0f); </code></pre> <p>to </p> <pre><code>auto f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CSS columns have a horizontal gap?<p>I am having some issue trying to align css columns and a grid. Do css columns have some horizontal gap by default? If so...
<p>Yes. But you can get rid of it by setting <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/column-gap" rel="nofollow noreferrer"><code>column-gap</code></a> to <code>0</code>:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reference custom php codesniffer sniffs from a ruleset that is not in the standards directory<p>I have a ruleset with some custom sniffs. I have the ruleset ...
<p>Sorted it.</p> <p>It does work. My problem was that the sniff class name was not named correctly.</p> <p>The folder that contains the ruleset has to be part of the sniff class name. The following paths are required.</p> <pre><code>/path/to/project/MyRuleset/ruleset.xml /path/to/project/MyRuleset/Sniffs/SniffGroup...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Powershell script which will detect installed software on clients and servers<p>My powershell module is not working as it should. I have used a <a href="http...
<p>The script as it is does query your local computer:</p> <pre><code> $Objs = @() $RegKey = "HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\*" $InstalledAppsInfos = Get-ItemProperty -Path $RegKey </code></pre> <p><strong>Get-ItemProperty -Path $RegKey</strong> refers to the local computer. </p> <p>The ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: WPF Expander - Highlight Header on mouse over<p>I have an ItemsControl where the datatemplate is an expander. Below is the template and style used for the e...
<p>The simplest solution I could come up with was to create a second DataTemplate to switch to on mouse over.</p> <pre><code>&lt;DataTemplate x:Key="expanderHeader"&gt; &lt;ContentPresenter Content="{Binding}" TextBlock.Foreground="Blue"/&gt; &lt;/DataTemplate&gt; &lt;DataTemplate x:Key="expanderHeaderMouseOver"&g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reference hell accessing .netstandard with framework VS2019 preview<p>I can get my .net standard 2.0 package working in a .net framework 4.7.2 dll if I do th...
<p>Go <code>Tools=&gt;Nuget Package Manager =&gt;General =&gt; Package Management</code> You can control the behavior by <code>Allow format selection on first package install</code>. Enable the checkbox and restart VS, this change will take effect.</p> <p>And note the dialog only appears when we install <strong>first ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: .scrollIntoView any element with data- tag, or using classes to section content with data- tags<p>Right now, I separate my content with a class called "secti...
<p>Iterating over all your elements sounds innefective, yes:) I would use document.querySelectorAll to select your data-elements. It is supported by IE8 and up. It will give you a NodeList of the matching elements. It's not actually an Array, so forEach won't work for iterating over them, unless you use it like this:</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Select attributes from different joined tables with Flask and SQLAlchemy<p>Can't get myself to do something as easy as good ol'</p> <pre><code>SELECT phrase...
<pre><code>q = db.session.query(Phrase.content, Meaning.content).join(Meaning).all() </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 build breadcrumbs for an eCommerce application?<p>I've been working on building an eCommerce using NetBeans but I have customized most of the code s...
<p>You don't need to necessarily build it yourself, there are a few frameworks out there that already have this pagination component built-in, since you mentioned you are using Java and JSTL, so I would suggest you take a look at these Java Server Faces frameworks:</p> <ul> <li>Primefaces: <a href="http://www.primefac...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: switch statement in while(true) loop, text appears twice<p>i have a problem with switch statement in a while(true) loop, basically the text - "Write action (...
<p>This should work..</p> <pre><code>boolean active = true; while (active) { System.out.println("Write action (buy, fill, take):"); String action = scanner.nextLine(); switch(action) { case "buy": System.out.println("What do you want to ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Query with WITH clause and COUNT subquery<p>In the query below, I don't get the results i would expect. Any insights why? How could i reformulate such query ...
<p>I would just use:</p> <pre><code>select cnt.*, count(*) over (order by y) from cnt; </code></pre> <p><a href="https://dbfiddle.uk/?rdbms=sqlite_3.27&amp;fiddle=98f5c70f554d3a4ac2e5fee12026c49d" rel="nofollow noreferrer">Here</a> is a db&lt;>fiddle.</p> <p>The issue with your code is probably that the CTE i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: msvc precompiled header warning suppress<p>In my C++ project, I use precompiled headers as a compile time optimization. However, when I enable /Wall option i...
<p>Don't use <code>/Wall</code> with Visual C++. It doesn't mean the same as <code>-Wall</code> with g++. Use <code>/W4</code> (rough equivalence with g++ <code>-Wall</code>).</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Retrofit. Android. Can I download json object to String without parsing?<p>Can I download json object as a String without parsing with Retrofit on Android de...
<p>This happens because the response is a JSON Object and not a String. You could do the following: First change the getter method:</p> <pre><code>@GET("/api.php?action=bundle") public void getWholeScheduleString(Callback&lt;JsonObject&gt; response); </code></pre> <p>Then in the <code>success(JsonObject json, Respons...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AppleScript works in Script Editor but not as application<p>I am pretty new to programming, especially with AppleScript. I wrote a simple script for Valenti...
<p>I agree with Jerry Stratton's comment that it could be an accessibility issue. However it also could be that you are issuing the keystroke command before Safari is ready to accept it. If it's opening a file then it could be busy and miss the keystroke command.</p> <p>Also, I would move the system events code outsid...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# DateTime.Parse Error<p>Anyone have any idea why this fails? I was able to work around it with ParseExact, but I would like to understand why it is failing...
<blockquote> <p>Dates &lt; "Dec 24" work fine. Dates >= Dec 24 fail with this error</p> </blockquote> <p><code>DateTime.Parse</code> uses the <a href="https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx">standard formats</a> for parsing date and the reason it is failing for Day >= 24, is that it is cons...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Web API controller and MVC controller - Authentication<p>I have an MVC app. It also uses services exposed by Web API controller.</p> <p>Hosting environment ...
<p>Web Api is REST-based. Among other things, REST is <em>stateless</em>, meaning no concept of a session. Authentication in MVC is handled via sessions, so simply authenticating in MVC side of the app does nothing for the Web Api side.</p> <p>Each Web Api request must have all the information necessary to fulfill tha...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to see the JSON created by Jackson Annotations?<p>I'm using <a href="https://github.com/FasterXML/jackson-annotations" rel="nofollow noreferre...
<p>You could try with this -</p> <pre><code>ObjectMapper mapper = new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT); try { String json = mapper.writeValueAsString(&lt;your-class-here&gt;); System.out.println(json); } catch (JsonProcessingException e) { e.printStackTrace(); } </code></pre> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NSView doesn’t catch keyDown events<p>I need to catch mouseDown and keyDown events in a subclass of NSViewController and as it’s not possible (please, correc...
<p>Your view accepts first responder when offered it, but nothing is attempting to make it the first responder until you click.</p> <p>Set the window's <code>initialFirstResponder</code> some time before showing it. If you're using a NIB, it can be set there. Or you could do it programmatically.</p> <p>After the wind...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel Foreach From Array<p>Here is the <code>print_r</code> of my object;</p> <pre><code>Array ( [country] =&gt; Illuminate\Database\Eloquent\Collection O...
<p>What you're looping over isn't an array. It's a Laravel Collection. However it behaves like an array so it doesn't really matter. The loop itself actually looks correct. But instead of just outputting <code>$country</code> you have to actually access the attribute on <code>$country</code> called <code>country</code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Linux command line get mongodb version<p>I could get the version in command line, but how could I store it in variable:</p> <pre><code>In [28]: if subproces...
<p><code>subprocess.check_call</code> returns the return code of the command.</p> <p>Use <a href="https://docs.python.org/2/library/subprocess.html#subprocess.check_output" rel="nofollow"><code>subprocess.check_output</code></a> which reutrn the output of the command as a byte string:</p> <pre><code>try: output =...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pass command line argument/fstream into function<p>I invoke my program with the name of a text file, which gets put into argv[2 &amp; 4] (there's two files)....
<p><a href="http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization" rel="nofollow">RAII</a> is thematic C++ resource management - whenever possible have the <code>}</code> handle clean-up. In your case, this guideline suggests that an automatic duration <code>ifstream</code>, which only lives in the scope ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Formatting bold text XML<p>I am using MTURKS to create the following survey question:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;Questi...
<p>You can make use of the <code>&lt;FormattedContent&gt;</code> tag as in this example:</p> <pre><code>&lt;Selection&gt; &lt;SelectionIdentifier&gt;${choice1}&lt;/SelectionIdentifier&gt; &lt;FormattedContent&gt;&lt;![CDATA[ &lt;b&gt;Subject 2:&lt;/b&gt; Science ]]&gt;&lt;/FormattedContent&gt; &lt;/Selection...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to increase the margin below this form<p>I'm not able to add some blank space below this form. The bottom of it still sticks to the edge of the page.</p>...
<p><img src="https://i.stack.imgur.com/6HbtO.jpg" alt="enter image description here"></p> <p>You can't add <code>margin-top</code> and/or <code>margin-bottom</code> to an element with <code>display: inline</code> because it will simply have no effect (although <code>margin-left</code> and <code>margin-right</code> wil...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting values from PHP multidimensional array<p>I have one Array just like the one above:</p> <pre><code>Array ( [4] =&gt; Array ( ...
<p>I managed to figure out the right way to do this:</p> <pre><code>foreach (array_keys($array) as $key) { } </code></pre> <p>and it will give us the figures desired</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create a new dictionary list from other lists?<p>I have a list of repeated words and another list of words not repeated as follows (They are all located in t...
<p>Your desired output is invalid. It looks like you actually want nested dicts:</p> <pre><code>{'file1.txt': {'aaa': 2, 'bbb': 2, 'ccc': 1, 'ddd': 2, 'eee': 0}, 'file2.txt': {'aaa': 1, 'bbb': 2, 'ccc': 0, 'ddd': 1, 'eee': 2}} </code></pre> <p>Making that happen in your code would look like this: </p> <pre><code>.....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android executes task sequentially or not?<p>I am getting a very interesting behavior by Android Studio in my project. The calls to different activities are ...
<p>I think this is more of a design issue. Should you really be opening more than one activity at once?</p> <p>When an activity is started, it's put on top of the history stack, which could give the illusion that it's happening the other way round.</p> <p>But I can't comment any further until I see code.</p> <p>UPDA...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Retrieve all files from a server side folder<p>I have the following C# method that retrieves all the files in a folder, and is used in an asp.net application...
<p>You can simplify this using the following code.</p> <pre><code>public string GetSoundFile() { var files = Directory.GetFiles(HttpContext.Current.Server.MapPath("~/sounds")); return String.Join("|",files); } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Formula to get number between percent<p>I need to calculate a % between two numbers.</p> <pre><code>255 = 100% 153 = 0% </code></pre> <p>What is the formul...
<p>for 50% (halfway) the formula is simply</p> <pre><code>result = (a + b) / 2 </code></pre> <p>in general for a generic percentage <code>k</code> the formula is</p> <pre><code>result = (a*(100-k) + b*k) / 100 </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: recv() not triggering with libevent<p>I am trying to connect to the local openvpn client over its managment socket and query its state/status.</p> <p>I have...
<p>silly ,mistake...events ev,ev1,ev2 with event_new() come AFTER creating a socket+making it nonblock... not before</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular http Get API string params for mat table<p>I have an on click event. Which routes to a new component B. As part of component B it would create a mat ...
<p>If you want to pass params from component A to B then you need to pass while routing from A to B &amp; component B should be received that passed Param values.</p> <pre><code> export class AppCardsComponent { public app:String; constructor(private route: Router) { } onCardClick(app:string) { this.ap...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: primeng checkbox with reactive form with array<p>I am trying to add my array of object to map the primeng checkbox and would like to get the values for selec...
<p>for reactive dynamic form first thing we have to generate the formGroup base of the form control data</p> <p>getFormGroup method will return a formGroup object by loop over the data and create a form controls with name base of the <code>text</code> value .</p> <pre class="lang-js prettyprint-override"><code>getFormG...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Finding certain keywords with " and :<p>I have a question about "for" function and "json". I want to find very specific keywords written English from Twitter...
<p>Looks like the condition you need is</p> <pre><code>if keyword in line and '"lang":"en"' in line: </code></pre> <p>You had simply spelled the second part of this weirdly, and incorrectly.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get a number value from an input field?<p>I have some issues with calculating some stuff with JS and getting the right values out of the input fields ...
<p>You had some mistakes in your HTML, but here is a working JSFiddle: <a href="http://jsfiddle.net/chs9x9wj/" rel="noreferrer">Fiddle</a></p> <p>You you are trying to get elements by their ID, but you don't give them an ID you give them a Name. Also, stop using inline JavaScript calls; it is bad practice.</p> <p><di...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: No icon for addon created with jpm<p>I can't seem to get my addon icon to show up when I use <code>jpm</code>. The relevant items in <code>package.json</code...
<p>This is a <a href="https://github.com/mozilla/jpm/issues/197">known issue</a> with jpm, and I just updated that bug report asking for an update on what we can do about it. It's a mystery to me why it doesn't work as-is.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to access a file in a mapped network drive with PHP & IIS 7<p>I'm trying to read a file on a mapped network drive(shared folder on a Windows XP machine) ...
<p>Solved the problem SOLUTION: Created a new user account with password. In IIS Manager, changed IIS Anonymous Authentication from IUSR to the new user account and gave the same password. Windows XP sharing has been set to 'Everyone' with Read permission</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to load a controller in another controller in ruby on rails<p>Like php we can import all the functionality of a simple php file name as myfile.php in ano...
<p>As the above problem you generate scaffold product and you want to render index action of product controller in home controller but you are getting undefined method `each' for nil:NilClass Extracted source Error.</p> <p>Try this</p> <p>in view/homes/index.html.erb</p> <pre><code>&lt;%= render :template=&gt;"produ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can I add a resize function to this script?<p>I am not really good in PHP but the images that will show on the webpage of mine will be the main resolution. I...
<p>It seems like you just want to resize the image shown in the browser, right? In that case some simple styling would do the trick:</p> <pre><code>. "&lt;img src='" . $image . "' style='width: 200px'&gt;&lt;br&gt;&lt;br&gt;"; </code></pre> <p>Change the 200px to whatever width you want, the height will scale proport...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Implement basic Authentication for rest api using Jersey 2<p>I have exposed some rest api using <code>Jersey 2</code>(Tomcat server) and successfully impleme...
<p>The <a href="https://eclipse-ee4j.github.io/jersey.github.io/documentation/latest/security.html" rel="nofollow noreferrer">documentation gives you examples</a> on how to configure this via web.xml. You'll need to configure this using a <code>login-config</code> that belongs to a realm. The web container then takes c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Asymptotic Analysis for nested loop<p>I would like to understand Asymptotic Analysis better since I believe I don't have solid understanding on that. I would...
<p>The first example is <code>O(nlogn)</code> because the outer loop repeats <code>log(n)</code> times, and each of its repeat require <code>O(n)</code> repeats of the inner loop - so this totals in <code>O(log(n) * n) = O(nlogn)</code>.</p> <p>However, in the 2nd example - the outer loop requires <code>O(n)</code> it...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: 2 ways binding error into ng-repeat<p>When trying to create dynamic directives into a ng-repeat with 2 way binding, they dont render, the case goes as follow...
<p>When you are using app: '=' in directive definition there is not need in {{}} when you are passing attribute value. Passed value will be executed anyway. Working code:</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-overrid...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Linked List selection sort implementation performance issue?<p>I've developed the below code, but I'm seeing some unusual behavior which I'm struggling to un...
<p>This is actually being caused by a flaw in your <code>insert_at</code> member. <code>deleteAt</code> decrements <code>count</code>, but <code>insert_at</code> can potentially never call <code>insert</code> to increment it. This leads to your loop in <code>selection_sort</code> exiting prematurely because you're doin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jQuery function doesn't work<p>Why is this not working on my website? It worked on the code snippet function from stackoverflow</p> <p>It's exactly the same...
<p>Most likely causes:</p> <ul> <li>You haven't included the jQuery library</li> <li>You have placed the script element before the div element, so that when it runs, the div doesn't exist, so there isn't an element to bind to. Move the script to later in the document or learn about <code>ready()</code>.</li> </ul>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Gradle Kotlin DSL: how to configure subprojects using typesafe api<p>Gradle 6.1.1</p> <p>I have been trying to convert my projects' Gradle files using Kotli...
<p>Gradle <code>6.1.1</code> <a href="https://docs.gradle.org/current/userguide/kotlin_dsl.html#type-safe-accessors" rel="nofollow noreferrer">Type-safe model accessors</a> reads:</p> <blockquote> <p>Only the main project build scripts and precompiled project script plugins have type-safe model accessors. Initializ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python cv2.imshow() crashes with Abort trap: 6<p>My code:</p> <pre><code>import cv2 print(cv2.__version__) img = cv2.imread("img.jpg") print(len(img)) print...
<p>I ran into the same issue and found a solution.</p> <ol> <li><p>pip uninstall opencv-python or opencv-contrib-python</p></li> <li><p>pip install opencv-python-headless</p></li> </ol>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Itertools return value NOT used in combinations<p>I am using <code>for num in combinations(nums[0], number):</code> to return all combinations of numbers in ...
<p>Since your list can have duplicates:</p> <pre><code>from itertools import combinations nums = [1, 2, 3, 3] # get combinations of all possible lengths combos = [] for n in range(len(nums)): combos += combinations(nums, n) # create the pairs you want, but with all nums combo_pairs = [(combo, list(nums)) for co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the usage record of USB device on Linux<p>I want to write a linux inspection tool to check the usb device usage records on a certain machine. Pars...
<p>Linux doesn't natively provide this functionality. It isn't seen as an intrinsically important feature to have, and as mentioned, it can be done easily with a <code>udev</code> rule for those who want it. It's generally assumed that anyone with physical access to the machine can read any unencrypted data on it and...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Comparing Rational Numbers<p>I have made the following rational numbers C++ class with all the general arithmetic functions (<code>+</code>, <code>-</code>, ...
<p>Yes, it is feasible to implement the test for inequality using floating point operations. And, yes, that will potentially give "error prone results" due to finite precision of floating point.</p> <p>It is not actually necessary to use floating point at all. Mathematically, a test of "a/b > c/d" (assuming a,b,c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Triggers doesn't work on content loaded via ajax<p>I have following problem. I was forced to rewrite all below functions to create this:</p> <p><code>$(docu...
<p>Thank you all for your attention.</p> <blockquote> <p>Finally with your help I've found the soluton!</p> </blockquote> <p>After suggestions from @peterpeterson and @jAndy I came up with a great idea. I was replace <code>$(document).ready(function() {</code> to <code>function readydoc ()</code> and I'm calling It...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python minidom can't parse xml<p>I have xml.file as below, and I'm trying to parse it with python minidom, but there are some problems. I want to extract som...
<p>You are including an attribute name in your tag name:</p> <pre><code>model= xmldoc.getElementsByTagName('ManagedElementId string = ') </code></pre> <p>The <code>string =</code> part in not part of the tag name; there are no such tags in your document. Drop the <code>string =</code> part:</p> <pre><code>&gt;&gt;&g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Function not repeating in Javascript?<p>I have a function in <code>Javascript</code> that I need to repeat every 5 seconds.</p> <p>Here is the simple code:<...
<p>You have to add and remove the class.</p> <p>Set an interval that adds the class, then set a timeout inside to wait a bit that removes it, just before the next interval.</p> <p>Forked yours here: <a href="http://codepen.io/snlacks/pen/KwoELp" rel="nofollow">http://codepen.io/snlacks/pen/KwoELp</a></p> <pre><code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is Eclipse's ecj compiler extensible?<p>I am interested in modifying Java syntax and some implicit paradigms. Since I develop with Eclipse which provides it'...
<p>As Object Teams has been mentioned in comments:</p> <p>(1) Object Teams itself extends JDT for its own language <a href="https://wiki.eclipse.org/OTJ" rel="nofollow noreferrer">OT/J</a> which is an extension of Java. This is done in a dual strategy:</p> <ul> <li>We maintain a <a href="https://git.eclipse.org/c/obj...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spark running in local machine instead of standalone cluster<p>I've created a spark cluster on ec2, after that, I installed Jupyter on the master node and st...
<p>You need to set the master url to <code>spark://...</code> when creating your <code>SparkContext</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java ftp4j - List files in FTP server when connecting in amn active mode<p>I am using ftp4j library to implement my FTP clients however a server that I am tr...
<p>Yes, you can use the <code>.listNames()</code> in the active mode.</p> <p>The problem is likely that the server cannot connect back to your client to open the data connection. You have to open the ports from FTP data connection range on your local firewall (if any), as well as route the incoming connections on your...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating unique index seems to fail, but is created anyway?<p>Am creating a unique (multi-column) index, but it fails, because there non-unique rows in the t...
<p>This is <a href="https://www.postgresql.org/docs/current/sql-createindex.html#SQL-CREATEINDEX-CONCURRENTLY" rel="nofollow noreferrer">documented in the manual</a></p> <blockquote> <p>If a problem arises while scanning the table, such as a deadlock or a uniqueness violation in a unique index, the CREATE INDEX comm...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Custom AlertDialog error when click second time<p>This is the code :</p> <pre><code>class Widgets_TextView : AppCompatActivity() { override fun onCreat...
<p><strong>You can Create one Function ShowAlertDailog and call this function in your onCreate Activity.</strong></p> <p><strong>See below Code of ShowAlertDailog</strong></p> <pre><code>private fun showFilterDailog() { val layoutInflater: LayoutInflater = context.getSystemService(Context.LAYOUT_INFLATER_SERVICE)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to update MicroMeter gauge according to labels<p>I use MicroMeter gauges in a Spring Boot 2 application to track statuses of objects. On status change, t...
<p>Since all your gauges are referencing the same <code>currentStatus</code>, when the new value comes in, all the gauge's source is changed. Instead use a map to track all the current status by id:</p> <pre class="lang-java prettyprint-override"><code>public class PrometheusStatusLogger { private Map&lt;String, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Big-O notation of 8^log2(n)<p>I'm confused about what the big-O notation of <code>8^(log2(n))</code> would be.</p> <p>Would you just be able to change it to...
<p>We'll need the following properties of logs and exponents to understand this one:</p> <blockquote> <ol> <li><p>b<sup>Log<sub>b</sub>(x)</sup> = x</p> </li> <li><p>k . Log<sub>b</sub>(x) = Log<sub>b</sub>(x<sup>k</sup>)</p> </li> <li><p>(x<sup>a</sup>)<sup>b</sup> = x<sup>a.b</sup></p> </li> </ol> </blockquote> <hr /...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to check if element is HTMLElement in template Angular?<p>I tried to check if element is HTML element:</p> <pre><code>&lt;div *ngFor="let item of links"...
<p>You can try like this</p> <p><strong>component.html</strong></p> <pre><code>&lt;div *ngFor="let item of links"&gt; &lt;div *ngIf="checkData(item)"&gt; &lt;div [innerHTML]="item"&gt;&lt;/div&gt; &lt;/div&gt; &lt;div *ngIf="!checkData(item)"&gt; &lt;div [innerHTML]="item"&gt;&lt;/div&gt; &l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fingerprint Hardware ID GetHexString<p>I found a fingerprint class in C# <a href="http://sowkot.blogspot.com/2008/08/generating-unique-keyfinger-print-for.ht...
<p>This</p> <pre><code>s += ((char)(n1 - 10 + (int)'A')).ToString(); </code></pre> <p>is the same as</p> <pre><code>s &amp;= Chr((n1 - 10 + Asc("A"))) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: is it possible to run a external web application in iframe?<p>Is it possible to run a external web application in iframe?</p> <p>For example, I have below <...
<p>To tell you frankly, it is completely dependent on the external website. For the example you provided - <code>w3schools.com</code>, all the hyperlinks have an attribute <code>target="_top"</code> which forces the webpages to open on the parent most window. I guess you really cannot control it.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make resource dynamic routes?<p>I need to define route like this.</p> <pre><code>api/:some_entity_id/bla api/:some_entity_id/bla/new </code></pre> <...
<p>Please try it</p> <pre><code>scope '/api/:some_entity_id' do resources :bla end </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jQuery get value after change of price slider<p>I'm trying to retrieve value from price slider after change.</p> <p>Price slider:</p> <pre><code>&lt;script...
<p>Have you tried: $("#amount").slider( "value" ) instead of $("#amount").val(ui.values[0])</p> <p><a href="http://jqueryui.com/slider/#rangemin" rel="nofollow">http://jqueryui.com/slider/#rangemin</a></p> <p>make sure you display the source code on the jquery site.</p> <p>Or, if you try to call this in your filter...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parsing XML document missing enclosing parent entity<p>I want to process an XML document that lacks an overarching enclosing entity. (Yes, that's the file I...
<p>You might create a <a href="http://www.rubydoc.info/github/sparklemotion/nokogiri/Nokogiri/XML/DocumentFragment" rel="nofollow"><code>DocumentFragment</code></a> rather than <code>Document</code> (especially taking into account that your content is <em>actually</em> a document fragment):</p> <pre><code>▶ doc = Noko...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Upload Previewed File to PHP from JS<p>I'm working on a project where I'm trying to allow for a user to upload an xlsx file (not preview) for processi...
<p>I'm the developer of smallpdf. We upload the files directly in the request body, without multipart/form-data. There is also no need to use the FileReader API. XMLHttpRequests send method accepts a File/Blob etc as argument. </p> <p>A simplified version of our upload looks like this:</p> <pre class="lang-js prettyp...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Determine User Online Status/Offline status using Laravel?<p>I want to show online status on user's panel when user login admin panel How to do this ?...
<p>You may use</p> <p><strong>Authentication Directives</strong></p> <p>The <code>@auth</code> and <code>@guest</code> directives may be used to quickly determine if the current user is authenticated or is a guest:</p> <pre><code>@auth &lt;a href="#"&gt; &lt;i class="fa fa-circle text-success"&gt;&lt;/i&...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Save from structure variable<p>If I have a structure variable 1x1 with a name of <code>Data</code> that contains three fields <code>voltage</code>, <code>dat...
<p>You can try:</p> <pre><code>save('volt_field.mat', '-struct', 'Data', 'V1', 'V2') save('time_field.mat', '-struct', 'Data', 'T') </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Azure Active Directory needs Admin Approval after setting prompt =consent<p>In my application in Azure Active Directory I have added one of the Admin's conse...
<p>Regarding <code>prompt=consent</code>, <a href="https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest" rel="nofollow noreferrer">OpenID Connect says</a>:</p> <blockquote> <p>The Authorization Server SHOULD prompt the End-User for consent before returning information to the Client. If it cannot obtain ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: UCWA: error when sending multiple messages<p>I'm trying to code a Skype for Business chatbot using UCWA. For now, I can successfully create an application, s...
<p>I just solved the problem. It seems that there is an encoding error, so no message containing a accented character can be sent ("é", "è", "à", "ù", ...) without causing a failure. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: get an empty SpatialPolygonsDataFrame via subset?<p>I'm looking to subset a SpatialPolygonsDataFrame by an attribute, but I want to allow it to return an emp...
<p>Right now you can't. This is somewhat inconsistent, as for <code>SpatialPointsDataFrame</code> objects you can:</p> <pre><code>library(sp) demo(meuse, ask = FALSE) x = meuse[F,] </code></pre> <p>although with warnings; also, <code>validObject(x)</code> returns <code>FALSE</code>, so they are intended to be not all...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Determine average of all Node values within a Tree Structure<p>Given this interface...</p> <pre><code>public static interface Node { int getValue(); ...
<ol> <li><p>You can use recursion, but it is possible to solve this problem without it, too. What you need is just a depth-first search. You can implement it iteratively using a stack.</p></li> <li><p>Yes, it is possible. A version with a stack does not require any additional methods. </p></li> <li><p>Yes, it is possib...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the difference between these two Python Notebooks in Jupyter?<p><strong>Background</strong></p> <p>I'm a data analyst setting up a new data environm...
<p>This is always confusing when you work with environments. One work around and good way is to link the environment with kernel.</p> <p>After you activated the environment in the terminal, use these two commands(need to do it only once you create the environment):</p> <pre><code>conda install ipykernel python -m ipy...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R mapply() on specific function with recursive form (using for)<p>I am working with some R code that I'm sure must be able to written using one of the apply ...
<p>Couple of things: </p> <p>1) each call of your function expects full <code>para_h</code> vector, but in your <code>mapply</code> code it will receive only one value at a time, so you probably wants something like this:</p> <pre><code> mapply(function(S,T) f(para_h,S,T,a=0.4,t=1,b=0.1), data$S, data$T) </code></pre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python and Pi Rc Car<p>Ok so i'm working on controlling an rc car with the keyboard directional keys, using Python and a Raspberry pi, I was just wondering i...
<p>You could use Pygame to read joysticks, but you'd eventually need GPIO to flow current to the motors. As such, I'd probably use GPIO for button input as well. See the video <a href="https://www.youtube.com/watch?v=AZSiqj0NZgU" rel="nofollow">here</a> for more.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Button disappears<p>I have next Layout (TOP: Two Spinner Half: TableLayout Down: Button) , I have filled the TableLayout with WebService with... "for (int i ...
<p>Your button is actually on the right of your tableLayout. Change the orientation of the linearlayout to Vertical instead of horizontal. </p> <p>Moreover the buttonView should be part of the scrollview if you want to see it at the end of the scrollview.</p> <p>You can also nested all your xml in a Relative layout e...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I display detail view by fetching details entered to the database before on clicking an item of list view<p>I have a List View displaying list of Tas...
<p>To see if we need a database or not depends on how much complex will your app's data get.</p> <p>If this is the only data it will host still you have to decide if the data needs to be persist on in the device even if no internet is available.</p> <p>If the data gets complex (more tables etc) or data must persist y...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: When updating a row in asp.net gridview with datatable bootstrap. The editrow becomes the last row<p>I'm having trouble with my datatables(<a href="http://ww...
<p>I'm not certain if this will work with your setup, but in my case the edited row bubbled up to the <em>top</em> of the table. To get the row to "edit in place" I had to disable ordering:</p> <p><div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js pret...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why is a tidyverse function erroring out when the function contents work?<p>The following code fails with an error message "Error in .f(.x[[i]], ...) : objec...
<p>As it is unquoted, we can use <code>{{}}</code> for evaluation. It does the <code>enquo</code> + <code>!!</code></p> <pre><code>uniqdashc &lt;- function(x,y) { x %&gt;% select({{y}}) %&gt;% group_by({{y}}) %&gt;% dplyr::mutate(count=n()) %&gt;% distinct %&gt;% arrange(desc(count)) } </code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Avoiding special case for `void` return types for functionals<p>When writing a function template that should return whatever a passed functional returns -- h...
<p><strong>You don't need to!</strong></p> <p><code>return void()</code> is <em>valid</em> (in a function returning <code>void</code>), allowing precisely this.</p> <p>What you're <em>not</em> allowed to do is to name a function <code>do</code>, as that is a keyword.</p> <p>So, when I rename <code>do</code> to <code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android Camera Application: Capture button not working?<p>I've been working on this Camera app for a little while now. Basically what I want to do is take a ...
<p>I think the reason for the crash is because you are trying to get the camera instance twice: when your activity is created and when button <code>captureButton</code> is pressed. When you try to get it the second time, it returns <code>null</code> because it is already in use by your activity.</p> <p>You should get ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel - Min Date and Max Date failed to Update<p>Using Laravel-5.8 for my web application, I have this code in my controller:</p> <pre><code>public funct...
<p>The <code>$min_date</code> and <code>$max_date</code> are objects. You need to get their attributes like this:</p> <pre class="lang-php prettyprint-override"><code>$min_date = AppraisalGoalDetail::select('start_date')-&gt;where('appraisal_goal_id', $goal-&gt;id)-&gt;orderBy('start_date', 'asc')-&gt;first(); $max_da...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Forwarding (Downloading/Uploading) Large File via Akka HTTP / Akka Streams<p>I have a service that takes an HttpRequest from a client to get a file from anot...
<p>As you are already getting the file as a stream from the second server, you can forward it directly to the client. You only need to build your <code>HttpResponse</code> on the fly :</p> <pre class="lang-scala prettyprint-override"><code>def downloadFile(request: HttpRequest) : Future[HttpResponse] = { Http().si...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why are Elasticsearch aliases not unique<p>The Elasticsearch documentation <a href="http://www.elasticsearch.org/blog/changing-mapping-with-zero-downtime/" r...
<p>It allows you to easily have several indexes that are both used individually and together with other indexes. This is useful for example when having a logging index where sometimes you want to query the most recent (logs-recent alias) and sometimes want to query everything (logs alias). There are probably lots of ot...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: i would like to convert oracle function to big query can some one let me know the best way<pre><code> NVL (SUBSTR (ARY_TE, INSTR (ARY_TE, '|', 1, 3) + ...
<p>SPLIT(column_name, '|') [SAFE_OFFSET(4)] )</p> <p>this will pick the value where you want the data from an the offset value </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change the font size in Visual Studio<p>What is this font in the Visual Studio options? </p> <p><a href="https://i.stack.imgur.com/ejBfU.png" rel="nofollow ...
<p>To change the size of the <code>CodeLens</code> font:</p> <ol> <li>Open Options (Tools -> Options)</li> <li>Go to Environment -> Fonts and Colors</li> <li>Choose <code>CodeLens</code> from the <code>Show settings for</code> dropdown.</li> <li>Change the font as needed.</li> </ol> <p>See the attached screenshot:</p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Converting an Objective-C block of code into Swift<p>I'm failing to properly understand how to convert this into Swift notation. Could someone help me? I cle...
<p><code>@[a,b]</code> is an Objective-C array literal with objects <code>a</code> and <code>b</code>.</p> <p><code>@{akey:avalue, bkey:bvalue}</code> is an Objective-C dictionary literal.</p> <p>The <code>(CGRect){{0,0},{45,45}}</code> creates a CGRect. In Swift <code>CGRect(origin: CGPoint(x: 0, y: 0), size: CGSize...