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: Drop function in Postgres<p>I have the following function:</p> <pre><code>CREATE FUNCTION "updateStat"(_request_date timestamp without time zone, _calls int...
<pre><code>DROP FUNCTION "updateStat"(timestamp without time zone, integer, integer); </code></pre> <p>You might want to consider using <code>CREATE OR REPLACE FUNCTION...</code> in your create script, so you can redefine it without needing to drop it each time.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Stored procedure returns complex type, I use AutoMapper to map it to my model but foreign key objects do not get set<p>I use AutoMapper to map from my DataLa...
<p>This is actually fairly trivial, but you might have to set up some AutoMapper configuration. Your stored procedure can really only return flattened results, but you can still pass all the fields for all the relationships. If you want to go almost configuration free, you really just need to have your stored procedure...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change color of row that contains different value using Angular 7?<p>How can I give a red color to a row that has a different value by using Angular 7...
<ol> <li>Don't use jQuery with Angular (at least for DOM manipulation)</li> <li>The way to do conditional styling in Angular is with the class directive</li> </ol> <p>This is a rough demonstration of the techniques you should be familiar with for doing this kind of task:</p> <pre><code>&lt;table&gt; &lt;tr *ngFor="le...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i fix max redirect issue in jmeter?<p>My scripts was working fine but now it starts showing that max redirects are more than the limit set up in jmet...
<p>JMeter default maximum redirects count is <strong>5</strong>. </p> <p>It is controllable via <code>httpsampler.max_redirects</code> property. You can increase its value using one of the following options:</p> <ol> <li>Uncomment <code>#httpsampler.max_redirects=5</code> line in <em>jmeter.properties</em> file. The ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: md5 hash throwing an error in PHP<p>md5 hash throwing an error in PHP</p> <p>( ! ) Notice: Use of undefined constant md5 - assumed 'md5' in C:\wamp...
<p>Check to ensure the chromephp include isn't causing this.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you create an angular material theme using ONLY hex values?<p>Absolutely every single demo I've seen for creating an angular material theme involves t...
<p>Here's the workflow I settled on to get as close as possible to what I wanted to achieve.</p> <p>First of all, make sure you know your scss fundamentals when attempting theming. If you don't know what these items and their syntax are (i.e. how they translate to css):</p> <ul> <li><a href="https://sass-lang.com/docum...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Undefined index errors from $_POST when accessing through AJAX<p>I''m trying to use ajax to show result login from php. But it's not work. It's show error Un...
<p>You should need to call <code>serialize()</code> on the <code>form</code>, not <code>serializeArray()</code> on the list of inputs. Try this:</p> <pre><code>$.post( $("#loginForm").attr("action"), $("#loginForm").serialize(), function(data){ $("div#msg").html(data); } ); </code></pre> <p>Th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I return true boolean if a specific property is set to true in all objects of an array?<p>Lets say I have the following array:</p> <pre><code>let na...
<p><code>every</code> is an array method that will test the truthiness of some predicate function for every item of an array. If the function returns a truthy value for each input, <code>every</code> return <code>true</code>; otherwise it returns <code>false</code>.</p> <pre><code>name.every(obj =&gt; obj.active) </co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change compiler called in makefile<p>I have a make file that currently uses <code>cmake</code> to compile a collection of source files, but I would like to c...
<p>You specify your toolchain settings for CMake using a <a href="http://www.cmake.org/cmake/help/v3.0/manual/cmake-toolchains.7.html#id6" rel="nofollow"><code>toolchain.txt</code></a> file with the <code>-DCMAKE_TOOLCHAIN_FILE=path/to/file</code> on the first call of CMake, that generates the makefiles:</p> <pre><cod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: When the console isn't open in chrome, some items are not longer clickable (some js calls stop working)<p>I have a section on my webpage in this form. The id...
<p>I think I found the problem. Hopefully this is it! </p> <p>Your continue button is being hidden by other elements z-indexes. So what you do is on span#contText add z-index: 1000; and that should work... Hopefully. added cursor pointer for user feedback.</p> <pre><code>span#contText{ z-index: 1000; cursor: poin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JavaFX Canvas-Drawing<p>I am currently working on a JavaFX-Drawing-Application using a canvas. With the help of the GraphicsContext I am drawing lines using ...
<p>This is a tricky one. It appears there is no way to clear graphics other than the clearRect method. (Even some blend mode and clip-based hacks I attempted did not work.)</p> <p>You can draw each line segment using clearRect, if you temporarily rotate the graphics context first:</p> <pre><code>import javafx.geome...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Knockout/Select2 remove selected options from dropdown options. Without passing down root model<p>So I have a table with two dropdown lists (per row) that I'...
<p>I was able to throw together another snippet using your idea from the previous question to use the <strong>disabled</strong> attribute instead of removing the items altogether. Knockout has a handy select options binding called optionsAfterRender which lets you do some post processing on the generated options. </p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The MySQL syntax that is not run always fails on Ubuntu<p>I am a linux beginner, especially ubuntu. I want to manage the mysql database installed on my Ubunt...
<h2><strong>Option 1: A typo in a title</strong></h2> <p>Have a look in your my.cnf file. Maybe you have a typo: There should be [mysqld] instead of [mysql] section</p> <pre><code> [mysqld] bind-address=0.0.0.0 </code></pre> <p>OR</p> <pre><code>[mysqld] bind-address=0.0.0.0 </code></pre> <p><a href="https://sup...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: OSX 10.9.4 ruby -version error<p>Not sure what happen do my ruby install</p> <p><code>$ ruby -version ruby 1.8.7 (2013-12-22 patchlevel 375) [i686-darwin13....
<p>You can string multiple parameters together when you run Ruby. In this case, -v is being interpreted as 'version' where as the 'e' is being interpreted as -e, which from the man page:</p> <blockquote> <p>Specifies script from command-line while telling Ruby not to search the rest of the arguments for a script fil...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NestJS How I make query to views in an database<p>I have one small problem, my question is how I make query to views in an database?. I'm based in this examp...
<p>You can use View Entities, as a said in updated docs: <a href="https://typeorm.io/#/view-entities" rel="nofollow noreferrer">https://typeorm.io/#/view-entities</a></p> <p>Ex:</p> <pre><code>@ViewEntity({ expression: (connection: Connection) =&gt; connection.createQueryBuilder() .select(&quot;post.id&quo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Status: 404-Not found<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="htt...
<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"&gt; &lt;listen...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is aws-vault actually used for?<p>So it says on the github documentation <a href="https://github.com/99designs/aws-vault" rel="nofollow noreferrer">here...
<p>It actually doesn't have anything related to development.</p> <p>While working with Amazon managed services we can take advantage of IAM roles but that doesn't work when you're doing it from our local environment or from some other Cloud VM like <strong>accessing a S3 bucket</strong>. It comes handy when you're doi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to write to a file in Java<p>I have been attempting to create a class that will go through a file and create a HashMap based on the values it finds an...
<p>Change the order of your commands. Create the <code>FileWriter</code> on your file <em>after</em> you create it.</p> <pre><code>public void writeAllProperties( HashMap&lt;String, String&gt; newProps ) throws IOException { // fileOut = new BufferedWriter( new FileWriter( config ) ); HashMap&lt;String, String...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: create universal variable for imageview to add uipangesture<p>My swift code below declares 2 imageviews and 2 uipangesutres. This code just ouptus 2 imagevie...
<p>A Gesture Recognizer (such as `UIPanGestureRecognizer) is an <strong>object</strong>, not a property.</p> <p>It probably seems obvious that this code:</p> <pre><code> // create a NEW instance of UIImageView each time throught the loop let imgView = UIImageView() var x: CGFloat = 50 [UIColor.red, UI...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: implementing a list view as native app with ionic framework angularjs and cordova<p>Hello I'm trying to implement a listview application for mobile devices v...
<p>you are missing the ui-router code here.</p> <pre><code>app.config(function($stateProvider, $urlRouterProvider) { $stateProvider .state('home', { url: "/home", templateUrl: "home.html" }) .state('details', { url: "/details/:id", templateUrl: "details.html", controller :function($sta...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: why is my ArrayList empty even though firebase datasnapshot contains children<p>I am attempting to pull user data from firebase realtime database, the datasn...
<p>I figured it out, had to make sure my class was conforming to the object being returned from the DB. First I had to make my user class implement serializable and add <code>@PropertyName()</code> and also make sure all the property names matched exactly what was in the Firebase.</p> <pre><code> public List&lt;User&g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting item from listView that is offscreen<p>I'm having issues getting an item from a ListView when it is off screen. If I scroll down and <strong>hit next...
<p>You can not get items that are off screen, they simply do not exist (for performance reasons, these views get re-used to show other items).</p> <p><a href="https://stackoverflow.com/q/10396345/4193263">This</a> question might help you to achieve what you want to get.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I append a div inside a image container in vue dynamically?<p>I'm new to Vue, and I'm stuck here. I understand we can use <code>$el</code> to append ...
<p>While using Vue direct DOM manipulations are not preferred (Add/Remove child elements) as changes performed like this will no longer be reactive.</p> <p>Rather you can find a solution of rendering a div element conditionally using vue v-if directive.</p> <p>You can add some code over here and let us know what exac...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make server send a message to client on button click<p>I have a client and a server. When client connects to server the server sends a message to the ...
<p>What message are you trying to get? A random message or something preset? Are using a Gui?</p> <p>IF your using a gui and your trying to get a message I'd expect you to do something like </p> <pre><code>JButton newButton = new JButton("New Message"); newButton.addActionListener(this); this.add(newButton); publi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jquery Unobtrusive validation not working on items after first in a View Model list - c# MVC 4<p>So basically I have a form that has multiple "sections" in i...
<p>It looks like you need to be iterating through that list using a for loop instead of a foreach. </p> <pre><code>@for(int i = 0; i &lt; Model.LocationList.Count(); i++) { &lt;div class="location form_new_row panel panel-primary"&gt; &lt;div id="info" class="form_half_width form_new_row"&gt; &lt;div id...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rails 4: Redirect Loop with before_filter<p>I am setting up a very simple rails app that involves a simple authentication check before you can enter the site...
<p>The issue is that, since your <code>SessionsController</code> inherits from <code>ApplicationController</code>, it actually inherits the <code>before_filter</code> as well. This means you are not allowing someone to see the login page unless they are logged in, which is usually undesirable behavior. You want to skip...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Accessing Open Graph FB page Insights without the direct user having an access token<p>I have built a platform for my local young professionals organization ...
<p>This is possible if you use a long-lived (eternal) Page Access Token.First, you'd have to get a User Access Token, for example via the Graph Explorer (<a href="https://developers.facebook.com/tools/explorer" rel="nofollow">https://developers.facebook.com/tools/explorer</a>), with <code>manage_pages</code> and <code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java - openCV - Area Selection on live camera feed<p>I am trying to do a area selection to create a mask on the camera view provided by <strong>CameraBridgeV...
<p>I found the answer on the opencv forum, here is the link if can help some one: <a href="http://answers.opencv.org/question/55734/opencv-area-selection-on-live-camera-feed/" rel="nofollow">http://answers.opencv.org/question/55734/opencv-area-selection-on-live-camera-feed/</a>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: using LinQ without Lambda expressions to define condition on a List type property<p>I have the following LinQ expression which is working fine. However, I wo...
<p>This should generate the join you want...</p> <pre><code>var users = ( from p in _db.People from r in p.Roles where r.RoleId == roleid select p ).ToList(); </code></pre> <p>Edit: If you do not have relationships defined please try this (not tested)...</p> <pre><code>var query = (from p in db.people jo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Photoshop files vs PIL psd_tools<p>I am trying to build a file finder, and as far as the file types listed in <code>extensions</code> go, I'm doing well so f...
<p>You might find this link interesting: <a href="https://www.pythoncentral.io/finding-duplicate-files-with-python/" rel="nofollow noreferrer">https://www.pythoncentral.io/finding-duplicate-files-with-python/</a> Also, you may want to read up on <a href="https://www.pythoncentral.io/hashing-strings-with-python/" rel="n...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Post processing on UNION result cypher query neo4j<p>I have written below query using lucene indexing . I know UNION doesn't have pagination support in neo4...
<p>The referenced github issue is not yet resolved, so post processing of <code>UNION</code> is not yet possible.</p> <p>As a workaround in the meantime you can split up your query into two queries. The first one combines the index lookups and returns node ids:</p> <pre><code>START user=node:peopleSearch('username:ab...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i get StackPanel's children StackPanel from code?<p>Here is my <code>StackPanel</code> "group", and i want my children <code>stackPanel</code> visibi...
<p>Answer updated to cover recursive child lookup.</p> <p>You can do something like -- </p> <pre><code>public static IEnumerable&lt;T&gt; FindVisualChildren&lt;T&gt;(DependencyObject depObj) where T : DependencyObject { if (depObj != null) { for (int i = 0; i &lt; VisualTreeHelper.GetChildrenCount(depObj)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: resizing per storyboard issue swift<p>I am wondering if someone can show me how to write this code so it resizes automatically for different screen sizes. I ...
<p>You can use <a href="https://stackoverflow.com/questions/26028918/ios-how-to-determine-iphone-model-in-swift">HAS answer in this question</a> to check, which iPhone your app is running on. Then you can use a switch statement and call different methods:</p> <pre><code>let modelName = UIDevice.currentDevice().modelNa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android intent to google play app at "my applications" section<p>Is possible to launch a intent to Google play store app to show "my applications" section?? ...
<p>After some painful retro-engineering...</p> <pre><code>Intent intent = new Intent("com.google.android.finsky.VIEW_MY_DOWNLOADS"); intent.setClassName("com.android.vending", "com.google.android.finsky.activities.MainActivity"); startActivity(intent); </code></pre> <p>Edit:<br /> <em>That works for now (Version : 5....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the unique pairs from the given data frame column with file handling?<p>sample data from dataframe: <a href="https://i.stack.imgur.com/7csTt.png" ...
<p>You could use the <strong>set</strong> method:</p> <pre><code>data = (((8, 8), (8, 8), (8, 8), (8, 8), (8, 8)), ((6, 7), (7, 7), (7, 7), (7, 6), (6, 7)), ((2, 12), (12, 3), (3, 4), (4, 12), (12, 12))) uniques = [] for col in data: for unique in list(set(col)): uniques.append(unique) for x in uniques: ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Disable ohai plugin<p>Using oahi version 8.0.0 from the chefdk on mac. </p> <p>If I run the command <code>ohai</code> in the terminal, my mac completely loc...
<p>Put the following inside <code>/etc/chef/client.rb</code></p> <pre><code>ohai.disabled_plugins = [:Passwd] </code></pre> <p>Or if using ohai 7 or newer</p> <pre><code>Ohai::Config[:disabled_plugins] = [ :Passwd ] </code></pre> <p>Or point chef-shell to a specific config file</p> <pre><code>chef-shell -c ~/foo.r...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change height of layer using caanimation<p>I am learning the caanimations and I face an issue. I want to display a rectangle which height start to 1 and goes...
<p>From your code, the height should increase. However you should use backgroundColor instead of fillColor.</p> <p>This is because although the height changed, the path does not however.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Run Script on Get and Return response immediately<p>Apologies but I am super unfamiliar with Python httpserver. I am also aware of the vulnerabilities or lim...
<p>This is exactly what multi-threading is used for, I suggest you read this <a href="https://www.tutorialspoint.com/python/python_multithreading.htm" rel="nofollow noreferrer">tutorial</a> to learn more about it.</p> <p>here is an example of how create a new thread from inside the do_GET function: </p> <pre><code>fr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AngularJS ng-show expression doesnt work on load<p>I have Select tag with 2 options and 1 default just saying "Select year". So I want a the div right after ...
<p>what is the default value for data.calendar_year? Maybe it equals null or '' so it does !=0. (if you don't define it before, thats how it is).</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Card hover animation scale background<p>Hello I'm trying to make a hover effect on my card, but I can't imagine basically when it's on hover I need my image ...
<p>I think you should place them with <code>position:absolute</code> and play with it.</p> <p>check here the updated code</p> <p><a href="https://codesandbox.io/embed/sparkling-sun-h66es?fontsize=14&amp;hidenavigation=1&amp;theme=dark" rel="nofollow noreferrer">https://codesandbox.io/embed/sparkling-sun-h66es?fontsiz...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change Windows 8.1 Group Policy programmatically in c#?<p>I am developing a Windows 8.1 kiosk-type application,and I need to set the group policy cust...
<p>The way to go is:</p> <ol> <li>Create a <strong>Custom Action</strong> and add it to the <strong>Install</strong> section of your installer.</li> <li>Use the unmanaged <strong>LsaAddAccountRights</strong> method to set any policy to any user account or group (<em>e.g. Administrators, Users, Everyone</em>). All you ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Different syntax of structure in C<p>What are the different syntax of c structure? How do decode this :</p> <pre><code>struct p { char a[1]; int b; ...
<p><code>q</code> is the array of structure of type <code>p</code>.</p> <p><code>p</code> has following elements:</p> <ol> <li><p>char pointer</p></li> <li><p>any type (int,char,short etc. even a pointer is possible)</p></li> <li><p>pointer to any type</p></li> <li><p>should be a constant </p></li> </ol> <p>The synt...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Implementing an application-wide cache in android<p>I am using an extension of an <a href="http://developer.android.com/reference/android/util/LruCache.html"...
<p>I usually do such things in the Application object itself...</p> <pre><code>class MyApplication extends Application { private LruCache cache; // or whatever public Thing getThingFromCache(String key) { /* or whatever */ } } </code></pre> <p>... don't forget to put MyApplication in the Manifest ...</p> <pre><co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: react-bootstrap-table auto column width<p>I'm using "react-bootstrap-table" for rendering table. Some of column has long text where getting elipsis. I have ...
<p>You can just specify some width and use <code>tdStyle</code> to achieve what you want:</p> <pre><code>&lt;TableHeaderColumn dataField='name' width="200" tdStyle={{ whiteSpace: 'normal', wordWrap: 'break-word' }} &gt; Product Name &lt;/TableHeaderColumn&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use a hex value for SVG in FireFox<p>I'm loading an SVG URL into a web page using a CSS class. This works in every browser I've tested except Firefox ...
<p>The character # is <a href="https://www.rfc-editor.org/rfc/rfc3986#section-2.3" rel="noreferrer">reserved in URLs</a> as the start of a fragment identifier. You must encode this as %23 for the URL to be valid. This is not a Firefox bug.</p> <p>Alternatively you could encode the whole string using base64.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the lifespan for a client's subscription (i.e. subscriber) to a topic?<p>What is the lifespan for a client's subscription (i.e. subscriber) to a topi...
<blockquote> <p>What is the lifespan for a client's subscription (i.e. subscriber) to a topic?</p> </blockquote> <p>A bit broad of a question. If you refer to a client connecting to the broker, as long as there's an uninterrupted underlying connection the client will be connected to the subscription. In case you're ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trigger once after event created using fullcalendar.io<p>Code: <a href="http://jsfiddle.net/AzmJv/1008/" rel="nofollow noreferrer">http://jsfiddle.net/AzmJv/...
<p>Rendering and creating events are separate processes.</p> <p>When you create or otherwise add an event, you are actually defining a <em>source</em>, not adding an element to the dom. The source can be a json feed, function or static object, but FC will look at it every time it needs to render it.</p> <p>Rendering ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: My User_ID miration says interger not integer. How do I change it?<p>My User_ID miration says interger not integer. </p> <pre class="lang-rb prettyprint-ove...
<p>Here is the way :</p> <p>(A) First grab the specific migration number: </p> <pre><code>[shreyas@Arup-iMac rails_app_test (master)]$ rake db:migrate:status database: app_development Status Migration ID Migration Name -------------------------------------------------- up 20150219075735 Create people ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to open excel template and save it to another path with pandas<p>I have a simple excel template <a href="https://i.stack.imgur.com/KOPCd.png" rel="nofol...
<p>Pandas deals with only tables not formatting</p> <p>Use <a href="https://openpyxl.readthedocs.io/en/stable/" rel="nofollow noreferrer">openpyxl library</a> instead</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you use pdf.js to get text content of client stored pdf?<p>I am working on a web app that needs to read a pdf with pdf.js. I have a file input on my p...
<p>This doesn't really have anything to do with pdf.js per se. pdf.js just happens to be trying to load a file using XMLHttpRequest.</p> <p>The problem is that you gave pdf.js a path to a local file (<code>c:\fakepath\vocab_list_15_8th_grade.pdf</code>). Your web browser won't let a web page load the local file for ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java how to print "x" number of stars inside brackects<p>I need to print players and star they get, answer should be:<br/> Create player...<br/> Name: Player...
<p>made changes to StarTeams.toString() method as :</p> <pre><code>public String toString(){ String rm = super.toString(); this.stars=stars; int t = stars; String s =""; for (int i=0; i&lt;t;i++){ // System.out.print("*"); s+="*"; } return rm + "("+ s +")"; } } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Split each array values and then convert into json in PHP<p>I have array values like this:</p> <pre><code> Array ( [cont_no] =&gt; Array ( [0] =&gt; 43-15...
<p>Use this code</p> <pre><code> $arr = array (cont_no =&gt; array ( 0 =&gt; '43-15', 1 =&gt; '44-18' )); $finalArr['employees'] = array(); foreach($arr['cont_no'] as $val) { $out = explode('-',$val); $finalArr['employees'][]['cont_no'] = $out['0']; $finalArr['employees'][]['repo_id'] = $out['1']; } echo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bluetooth Security Concern<p>We are developing sensors which will be distributed in large quantities and broadcast BLE every 5s in order to have access to DF...
<p>The Bluetooth standard won't help you solve this in a good way. Its pairing / bonding features are designed to prevent remote attacks while a user is pairing with the device, not to prevent any person from pairing at all. You should see the question as a general question and not a Bluetooth-specific one in my opinio...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: get field values from query<p>While using a front end form, could get values from a query?</p> <p>Something like this: <code>http://example.com/form?foo_nam...
<p><strong>UPDATE:</strong></p> <p>This has been solved, I ended up using a function using the acf/load_value filter</p> <pre><code>function my_value_( $value, $post_id, $field ) { $value = isset( $_GET['foo_name'] ) ? $_GET['foo_name'] : $value; return $value; } add_filter('acf/load_value/key=&lt;field_key&g...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Are there maintenance-mode for vue/cli app?<p>I wonder if for vue/cli / bootstrap-vue project/vue-router / "vue-resource" project with laravel 6 as backend a...
<p>I found a decision on server in bacckend app run </p> <pre><code>php artisan down --message="Upgrading,,," --retry=60 </code></pre> <p>and on client part to catch 503 error :</p> <pre><code>Vue.http.interceptors.push(function (request, next) { next(function (response) { if ( response.status === 503 ) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to remove an array element in json-c?<p>Assuming the following JSON object, an array of [epoch, value] arrays:</p> <pre><code>[ [0,1], [1912312314,2], [...
<p>I think there are two separate issues with that code: one is that it is using <code>json_object_put</code> as if <code>json_object_array_get_idx</code> had removed the element it returns from the original array (something that is not at all clear from the <a href="https://json-c.github.io/json-c/json-c-0.10/doc/html...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pivot table to "tidy" data frame in Pandas<p>I have an array of numbers (I think the format makes it a pivot table) that I want to turn into a "tidy" data fr...
<p>Use <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.reset_index.html" rel="nofollow noreferrer"><code>DataFrame.reset_index</code></a> with <a href="https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.rename_axis.html" rel="nofollow noreferrer"><code>DataF...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Linux grep String Search<p>I want to search </p> <p><code>$GLOBALS["\x61\156\x75\156\x61"]</code> using grep but <code>"</code> and <code>/</code> not wo...
<p>Since you are looking for an exact match and you don't want the expression to be interpreted by <code>grep</code>, you have to use <code>-F</code> and single quotes to avoid the variable being expanded: </p> <pre><code>grep -Frl '$GLOBALS["\x61\156\x75\156\x61"]' &lt;filename&gt; ^ ^ ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: FieldStorage input removes some characters<p>Putting "c++" in a input box, my Python script just receives "c".</p> <p>Here's the HTML code:</p> <pre><code>...
<p>You are not properly escaping your value; the <code>+</code> character in a <a href="https://en.wikipedia.org/wiki/Percent-encoding#The_application.2Fx-www-form-urlencoded_type" rel="nofollow">URL-encoded query value</a> is the encoded value for a <em>space</em>, so really you are printing:</p> <pre><code>"c " </c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pandas: calculate weighted average by row using a dataframe and a series<p>I was trying to make a weighed average and I came across a doubt:</p> <h2>Problem...
<p>Just use <code>numpy.average</code>, specifying <code>weights</code>:</p> <pre class="lang-py prettyprint-override"><code>demand["result"]=np.average(demand, weights=months, axis=1) </code></pre> <p><a href="https://docs.scipy.org/doc/numpy-1.15.1/reference/generated/numpy.average.html" rel="nofollow noreferrer">h...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is the cost of bitwise operations on 64-bit integers the same as 8-bit integers?<p>My code involves doing bitwise operations on a huge array of integers. If ...
<p>The number of clock cycles taken on a 64-bit operation is not guaranteed to be 1 even on a 64-bit machine, but obviously the processor doesn't know whether the 64-bit value stands for one 64-bit or eight 8-bit integers, so the bitwise operation itself will be as fast for both cases. <em>This part</em> of the code wi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Clarifications needed for a crash using NSArray, blocks and Manual Reference Counting<p>I need some clarifications on a crash I'm encountering using <code>NS...
<p>You are sticking an object from the stack into an autoreleased array. <em>BOOM</em> ensues.</p> <p>Consider:</p> <pre><code>typedef void(^MyBlock)(); int main(int argc, char *argv[]) { @autoreleasepool { NSObject *o = [NSObject new]; MyBlock myBlock1 = ^() { [o doSomething1...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do i get result by comparing Date column and Time column when Date and Time column are separate columns in Laravel<p>I want to fetch events based on thei...
<p>You can try to combine the two fields at a database level (assuming you are using MySql):</p> <pre class="lang-php prettyprint-override"><code>return $query-&gt;whereRaw('TIMESTAMP(`end_date`,`end_time`) &gt;= ?', [now()-&gt;toDateTimeString()]); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: After disabling Vertex Attribute Array how glDrawArrays() works?<p>I have started learning Opengl ES 2.0 for android. I am working with code segment taken fr...
<p>See Section 2.7 of the OpenGL ES 2.0 spec, "<strong>Current Vertex State</strong>":</p> <blockquote> <p>Current generic attribute values define generic attributes for a vertex when a vertex array defining that data is not enabled, as described in section 2.8.</p> <p>A current value may be changed at any ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: css animate fadeIn doesn't work in my case<p><a href="http://jsfiddle.net/9w0v62fa/1/" rel="nofollow">http://jsfiddle.net/9w0v62fa/1/</a></p> <p>I don't wan...
<p>You forgot the <code>duration</code> for animation. And you need to use <code>@-webkit-keyframes</code> for <strong>webkit browsers</strong>. </p> <p><strong>CSS affected:</strong> </p> <pre><code>.icon:before{ content: url("http://w2.aic.edu/design/32png/imgur.png"); -webkit-animation: fadeIn 5s; anima...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Defaulted destructor in base class disable move constructor in child class if there is a member<p>Why does defaulted (<em>user declared</em>) destructor in <...
<p>The implicit move constructor is not (only) <em>deleted</em>, it is not <em>declared</em> in the first place when you have a user-declared destructor, as is the case with <code>Base1</code> and <code>Base2</code>.</p> <p>Therefore the move constructor can never be considered in overload resolution and so <code>auto...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python string 2d list to mixed int/string list<p>Got this list:</p> <pre><code>test_list = [['1', '350', 'apartment'], ['2', '300', 'house'], ['3', '300', '...
<p>You have just a tiny problem with the variables.</p> <p>In this fix, <code>test_list</code> is the whole list, <code>ele</code> is <code>['1', '350', 'apartment']</code> and <code>x</code> is one single string out of it.</p> <pre><code>[list(map(lambda x: int(x) if x.isdigit() else x, ele)) for ele in test_list] <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rust Gtk set GtkImage from pixbuf using glade file<p>I'm trying to load an image from a scaled pixbuf to an existing GtkImage widget from Glade with Rust. I'...
<p>Here's the solution. Change this part :</p> <pre><code>let pixbuf = Pixbuf::new_from_file_at_scale( "/home/daniel/RUST/test/src/test.gif", 600, 700, false); </code></pre> <p>To</p> <pre><code>let pixbuf = Pixbuf::new_from_file_at_scale( "/home/daniel/RUST/test/src/test.gif...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to list only N files in directory using java<p>If I have a directory contains a lot of files (about 1000 file). Some of these files named <strong><em>.pr...
<p>Which is why you should use java.nio.file. Using Java 8:</p> <pre><code>final Path baseDir = Paths.get("path/to/dir"); final List&lt;Path&gt; tenFirstEntries; final BiPredicate&lt;Path, BasicFileAttributes&gt; predicate = (path, attrs) -&gt; attrs.isRegularFile() &amp;&amp; path.getFileName().endsWith(".proce...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error Update Crawler when using UpdateCrawler from AWS powershell tools<p>I was trying to update the Glue Crawler from a powershell script. But it seems AWS ...
<p>The regular expression pattern: <code>[\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\t]*</code> does not allow you to add <code>new line</code> characters. The JSON needs to be <em>minified</em> before sending to the API endpoint.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: removing tailing and leading strings from variable in one step<p>I have a string in the var f that is "res/some/path/file.ext.patch" and I want to remove the...
<p>Parameter expansion operators cannot be chained. The closest you can come to doing this in one step is to use a regular expression match.</p> <pre><code>[[ $f =~ res/(.*).patch ]] &amp;&amp; f=${BASH_REMATCH[1]} </code></pre> <p>I leave it up to you if that is preferable to</p> <pre><code>f=${f#res/} f=${f%.patch...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to modify error response in ModelViewSet class if detail not found for Django REST Framework?<p>I tried to implement this <a href="https://stackoverflow....
<p>You can implement <a href="https://www.django-rest-framework.org/api-guide/exceptions/#custom-exception-handling" rel="nofollow noreferrer">custom exception handler</a>:</p> <pre><code>from rest_framework.views import exception_handler def custom_exception_handler(exc, context): # Call REST framework's default...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Matlab r2014b get info which tab is active in GUI<p>I have a code in the new Matlab R2014b version with tabs in a GUI:</p> <pre><code>hTabGroup = uitabgroup...
<p>See the <a href="http://www.mathworks.com/help/matlab/ref/uitabgroup-properties.html" rel="nofollow"><code>SelectedTab</code> property of the uitabgroup</a>:</p> <blockquote> <p><code>SelectedTab</code> — Currently selected tab uitab object This property is read only.</p> <p>Currently selected tab, specifi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Struct Issue in C, using same Struct Multiple Source Files<p>I have a 'struct' which I would like to use in multiple sources files. I have declared the struc...
<p><code>Inputs</code> is not an array, so you can't just use the <code>[i]</code> index notation. You'll have to change its declaration from:</p> <pre><code>struct dataBase Inputs = NULL; </code></pre> <p>(btw the <code>NULL</code> part is pointless) to</p> <pre><code>struct dataBase Inputs[N]; </code></pre> <p>In...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Input fields are covered by the keyboard<p>Whenever a user clicks on an input field, it is covered by the keyboard and blocks the user from seeing what's bei...
<blockquote> <p>Use this line in AndroidManifest.xml</p> </blockquote> <pre><code>&lt;activity android:windowSoftInputMode="adjustPan" android:name=".activities.LoginActivity" /&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Winforms report generator, where is it?<p>I am doing maintenance on a winforms project, VS2013 framework 4.5</p> <p>Now I got to a point where some reports ...
<p>You can still use the <code>ReportViewer</code> that comes with Visual Studio to <em>view</em> reports. You can simply draw that control on your <code>Form</code>.</p> <p>For the <em>creation</em> of reports, you can add a new <code>Report</code> item to your project, which works inside the visual designer of Visua...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Right shift for signed integer<pre><code>#include&lt;stdio.h&gt; int main() { int num; printf("enter the number\n"); scanf("%d",&amp;num); int a,b...
<p>From the C99 standard N1256 (emphasis mine):</p> <blockquote> <p><strong>6.5.7 Bitwise shift operators</strong></p> <p>5 The result of <strong>E1</strong> <code>&gt;&gt;</code> <strong>E2</strong> is <strong>E1</strong> right-shifted <strong>E2</strong> bit positions. If <strong>E1</strong> has an unsigned type or i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I can't hide Floating Action Button?<p>I am trying to hide my FAB in a button click, but it's not working.?</p> <p>My XML</p> <pre><code>&lt;com.google.and...
<p>Use the method <a href="https://developer.android.com/reference/com/google/android/material/floatingactionbutton/FloatingActionButton.html#hide()" rel="nofollow noreferrer"><code>hide</code></a>:</p> <pre><code>fab.hide(); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google Admin SDK authentication with service account<p>My team is currently developing an application to list my company's domain users in GCP, using the Adm...
<p>The service account does not have permission to call Directory APi for your G Suite instance. What it does have access to do is act as a user in your domain within the context of the Directory API scope(s) you granted it access to.</p> <p>When getting service account credentials you need to add the sub=admin@yourdo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Verifying age on PHP<p>I've looked at many posts on here and I still cant figure this out.</p> <p>I am trying to verify that someone is older than 13 before...
<p>Comparaison operators work with <code>DateTime</code>, see the answer <a href="https://stackoverflow.com/questions/961074/how-do-i-compare-two-datetime-objects-in-php-5-2-8">here</a>. So something like this should work</p> <pre><code>$dateObj=new DateTime($_POST['birthday']); $ageLimit=new DateTime('-13 years'); if...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: docker build IMAGE results in error but docker-compose up -d works fine<p>I am new to the Docker. I am trying to create a docker image for the NodeJS project...
<p>Your Dockerfile is missing a <code>COPY</code> step to actually copy your application code into the image. When you <code>docker run</code> the image, there's no actual source code to run, and you get the error you're seeing.</p> <p>Your Dockerfile should look more like:</p> <pre class="lang-sh prettyprint-overri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to check battery level in Android<p>I'm trying to check the battery life of my phone for an app I'm writing. I'm currently trying to simply display it on...
<p>The <code>batteryStatus</code> Intent is not updated before you retrieve the extras, so they will never change. Move the code you have in <code>onCreate()</code> to the beginning of your <code>if</code> block.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How would I add, multiply, and subtract these Matrices with the following code using data structures?<p>So, I'm in the process of doing this program and I wa...
<p>I think the main problem is to separate matrix allocation from setting values. Right now, memory allocation happens exclusively in the context of reading from a file, but this doesn't allow you to allocate a matrix based on calculations.</p> <p>My solution would be to write a function that only performs matrix allo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: When making a new Scanner is there a downside to using the same input name?<p>I've just learned about scanners but one thing I noticed was when I wrote</p> ...
<p>See the scanner instance <code>input</code> is a <em>reference</em> and you are making it point to the <em>standard</em> input stream by <em>specifying</em> <code>new Scanner(System.in);</code>.</p> <p>In a <em>stream</em>, everything will be in <em>bytes</em>, the methods <code>nextLine()</code> , <code>nextInt()<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filtering a data frame according to values rank<p>I have a data frame(df) such as</p> <pre><code>group value a 4.2 a 4.5 a 6.2 b 5.1 b ...
<p>Here is a solution using package data.table and partial sorting:</p> <pre><code>library(data.table) setDT(DF) DF[, sort(value, partial = 2)[1:2], by = group] # group V1 #1: a 4.2 #2: a 4.2 #3: b 3.3 #4: b 3.5 DF[, sort(value, partial = 2)[-(1:2)], by = group] # group V1 #1: a 6.2 #2: ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python, Pandas, and NLTK Type Error 'int' object is not callable when calling a series<p>I am trying to get the word frequencies for terms within <strong>eac...
<p>In the first code snippet, the way you applied the function to the column is the root of the issue.</p> <pre class="lang-py prettyprint-override"><code># this line caused the problem data['words']= tweets.apply(nltk.FreqDist(tweets)) </code></pre> <p>Let's say you get this simple dataframe after cleaning up the tw...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Socket emit fails<pre><code> socket.on('sign_in', function(idA, idB) { var idA = idA; //global vars var idB = idB; //ignore this var if (!clients[idA]) { ...
<p>Turns out that my emit was written incorrectly.</p> <pre><code>io.to(clients[idA]).emit('sign_in', idA + ' has connected'); </code></pre> <p>should be </p> <pre><code>clients[idA].emit('sign_in', idA + ' has connected'); </code></pre> <p>also be sure to assign</p> <pre><code>clients[idA] = socket; </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 turtle graphics to not show turtle while its being drawn?<p>How do I get the final drawing to display without having to show the process of drawin...
<p>You need to hide the turtle:</p> <pre><code>turtle.hideturtle() </code></pre> <p>And then set the speed to fastest:</p> <pre><code>turtle.speed(0) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to make POST request using AJAX, but can do so through the browsable API when using Django Rest Framework<p>First time using Django and I am building ...
<p>The error was in the <code>ajax()</code> method call, the <code>contentType</code> property was not being set properly. DRF automatically selects the proper parser to use when using a generic view provided by the framework. It does this by looking at the <code>content-type</code> header being set, which is done by s...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: socket can t connect to localhost<p>I write this code under windows 8.1. I want to connect my socket to the localhost at first. then connect to a virtual mac...
<p>The code looks strange and it is not clear what it should do. If you want to establish connection then you need <em>two sockets</em> and they are typically in different processes. The server process normally calls</p> <pre><code>socket() // create a socket bind() // bind socket to local address and port liste...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Heroku working differently than running locally<p>I created a Nuxt app with express backend, and i have registered some api routes. When i run locally as pro...
<p>Ok, i fixed it. I had to change my procfile. It was running <code>nuxt start</code> not <code>npm start</code> so it wasn't running any of the server side code</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MongoDB nested Object field depth limit<p>If we have the following JavaScript object:</p> <pre><code>var obj = { field: { field: { ...
<p>In accordance with the official <a href="http://docs.mongodb.org/manual/reference/limits/" rel="noreferrer">documentation</a> MongoDB supports 100 levels of nesting for BSON documents. Beside this there's a size limitation for a single document which is 16 megabytes.</p> <p>If you are interested in storing larger d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular 8 to Angular 9 Migration<p>After a successful upgrade of a library from <em>Angular 8</em> to <em>Angular 9</em> when I try to build it I get the fol...
<p>The issues happened because some of the components Output property had a name which was an Enum and not a plain string. once I changed all those places to a string, it solved the issue.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fadein and Fadeout stopping jquery function from working correctly<p>I've put together an example to help explain the issue: <a href="http://codepen.io/tathi...
<p>The problem here is that <a href="https://stackoverflow.com/questions/2345784/jquery-get-height-of-hidden-element-in-jquery">width &amp; height of invisible elements</a> (i.e. elements with <code>display</code> CSS property set to <code>none</code>) are undefined.</p> <p>And because your <code>#tooltip_container</c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to open a "Bootstrap modal dialog" with variable parameters<p>Gallery html code:</p> <pre><code>&lt;div id="imgGallery" class="col-lg-3 col-md-4 col-6 c...
<p>Firstly, you shouldn't use "imgGallery" as an id for multiple elements. You should use "imgGallery" as a class for each element you need it.</p> <p>Change the HTML code as such: </p> <pre><code>&lt;div id="imgGallery1" class="imgGallery col-lg-3 col-md-4 col-6 col-xs-12 wow fadeInUp hovereffect" data-wow-delay="0....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Assigning variable in python confusion<p>I am trying to understand how a code works. I saw a variable declaration like the one below in the code, but don't u...
<p>So if m = 5, then m becomes 6: </p> <pre><code>m += 1 </code></pre> <p>means you're incrementing m by 1 (post-increment)</p> <p>its the same thing as:</p> <pre><code>m = m + 1 </code></pre> <p>You can't assign:</p> <pre><code>1 += m </code></pre> <p>that's an illegal operation, the error you should see is: ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Highlighting lines on QTextEdit document<p>Attempting to create a way (using PyQt5 and Python 3) to highlight a given line number in the document of the QTex...
<ul> <li><p>Why is there no need to instantiate a new cursor to select the entirety of the document (when resetting the highlighting), but when a single line needs to be selected, a new instance of the QTextCursor() needs to be created? </p> <p>Because selecting the entire document does not require having special info...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: GLEW: I set it to use the static library but at run time complains about not finding libGlew.so<p>I am working on a project which uses GLFW and GLEW. I can c...
<p><code>#define GLEW_STATIC</code> does in no way influence the linker - this is actually only needed for Windows platforms, where in the dynamic versions, <code>dllspec</code> declarations are added.</p> <p>If you want to link statically to GLEW, you need a static <code>.lib</code> file and have to point your linker...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is There a Way to Declare a typename for a Templatized Function?<p>So, I have <a href="https://stackoverflow.com/a/28679275/2642059">this templatized functio...
<p>In C++14, this is elegantly solved using return type deduction.</p> <pre><code>// C++14 #include &lt;type_traits&gt; template &lt;typename T&gt; decltype(auto) foo(T bar) { using R = std::conditional_t&lt;sizeof(T) == 4, char, short&gt;; return static_cast&lt;R&gt;(bar); } </code></pre> <p>In C++11, you'd hav...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Combo box selection item returning an error<p>I created a combo item in xaml as follows:</p> <pre><code> ComboBox x:Name="CmbBoxStart" HorizontalAlignmen...
<p>Use SelectedItem instead in place of SelectedIndex</p>