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: Knockout Text mix-blend-mode not working for <nav> element over <body> with background img<p>I'm trying to create a navigation bar with knockout text. I've t...
<p>For whatever reason, it does not like that you are using your <code>&lt;body&gt;</code> element to try to do this. Wrapping everything inside the <code>&lt;body&gt;</code> in a separate <code>&lt;div class="background-2"&gt;</code> division, and applying the exact same styles to it as the body seems to solve the iss...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to find principal components and orientation of a point cloud using point cloud library<p>I have a point cloud of a wooden block. I have found the centro...
<p>If you need a rotation matrix representing an orientation, we can choose the axis in which the volume distribution of the object is highest (normalised first eigenvector - that is the eigenvector associated with the largest eigenvalue) as the first column of the matrix. </p> <p>For the 2nd column of the matrix choo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: websocket vs rest API for real time data?<p>I need to constantly access a server to get real time data of financial instruments. The price is constantly chan...
<p>The most efficient operation for what you're describing would be to use a webSocket connection between client and server and have the server send updated price information directly to the client over the webSocket ONLY when the price changes by some meaningful amount or when some minimum amount of time has elapsed a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to change cell value of an html table through javascript<p>What I want to do actually, I have a html table,bellow is the example, It is possible that whe...
<p>Here ya go:</p> <h2>HTML</h2> <pre><code>&lt;form&gt; &lt;table class="table"&gt; &lt;tr&gt; &lt;td class="td editable"&gt;MODIFY/EDIT/DELETE/NEW CONTENT&lt;/td&gt; &lt;td class="td editable"&gt;MODIFY/EDIT/DELETE/NEW CONTENT&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Access OutPutTo to folder<p>I have been struggling to output the PDF report to the relevant folder within the server. The error which is showing is </p> <bl...
<p>I believe the ampersand in the directory path is causing the issue. </p> <pre><code>ath1 = "\\AZBAK-FP02\Work\Old Server Data\V&amp;C\" &amp; RFQNumber &amp; "\" &amp; RFQNumber &amp; " " &amp; InNumber &amp; ".pdf" ^^^ </code></pre> <p>you may need to add chr code</p> <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C++: How can I access a method of an inner class?<p>I was going through <code>classes</code> and thought of doing nested classes.So I have the below class de...
<p>1) Because <code>Class2()</code> is not a member of <code>myClass</code>.</p> <p>2) You need to instantiate a <code>myClass::myClass2</code> object and call the member on it. <code>myClass2::Class2()</code> is a member function, so it needs an object to act on. For example</p> <pre><code>myClass::myClass2 obj; obj...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mongoose script to seed database hangs<p>I have the following script:</p> <pre class="lang-js prettyprint-override"><code>const db = require('../db') const ...
<p>Here is my solution - would love some feedback on improving it!</p> <pre class="lang-js prettyprint-override"><code>const db = require('../db') const User = require('../models/user') db.on('error', console.error.bind(console, 'MongoDB connection error:')) const main = async () =&gt; { const users = [ ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Azure devops infrustructure pipelines<p>I'm learning how to build the infrastructure provisioning pipelines in Azure DevOps and looking for some step-by-s...
<p><strong>ARM template:</strong> </p> <p>Firstly, you need have one template which it can be deployed to azure to create VM and Vnet. Just refer to this sample: <a href="https://github.com/Azure/azure-quickstart-templates/tree/master/101-1vm-2nics-2subnets-1vnet" rel="nofollow noreferrer">azure-quickstart-templates</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Handling comments stored parent document using MongoDB<p>I am using MongoDB for a CMS. I want to store the user-submitted comments in the parent document - a...
<p>I've considered this problem recently.</p> <p>One possibility would be to limit the size of comments on the front end and then only store a certain number of comments in the parent document as well as storing an <code>_id</code> of the next document full of comments and then use pagination widgets to continue makin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: when to use decorator and decorator factory?<p>This gets bit of confusing with decorator takes no argument while decorator factory takes argument and still d...
<p>A decorator <em>factory</em> is just a callable that produces the actual decorator. It is used to make it possible to 'configure' a decorator.</p> <p>So instead of:</p> <pre><code>@decorator def decorated_function(): </code></pre> <p>You'd use:</p> <pre><code>@decorator_factory(arg1, arg2) def decorated_function...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Nodes of a list being freed before usage<p>I have a one-dimensional template list that contains nodes, each node has a link to next node. It works rather wel...
<p>The problem is that you are storing references to objects that are going out of scope, causing undefined behavior when you try and access them. Your <code>LinkedList&lt;string&gt; newDNA</code> gets created and destroyed with each iteration of the while loop, yet you pass a reference to be stored in <code>DNAStorag...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: @JsonFormat Jackson Annotation Incorrectly Outputs Date due to GMT Difference<p>I have DTO that I'm outputting to Jackson where a field is defined as </p> <...
<p>I solved it by adding the <code>timezone</code> attribute as below.</p> <pre><code>@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "MM/dd/yyyy", timezone = "America/New_York") Date reportingDate; </code></pre> <p>Now it doesn't add +5 to make it GMT.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CSS background color not registering<p>Not really worried about the javascript part of this because I need to figure that out on my own, but something that g...
<p>In your CSS, you probably accidentally closed a statement by <code>)</code> (after <code>orange;</code>), you should be closing it using <code>}</code>. That is the reason the rest of the CSS code didnt work and the table didnt get styled as you expected.</p> <p>I have added sample rows with the relavant classes fo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular highchart and ng-grid headers not respecting frame widths<p>I have several charts utilizing the highcharts plugin and directive, and tables using ng-...
<p>This issue was being caused by errant css rules that were being applied with the ng-class directive. The css was not being removed until after the new state had loaded, so even though it wasn't visible, it affected the page width that ng-grid and highcharts use to determine their size. After rewriting the css and re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sqlite Database not inserted Using Script in Proguard Build<p>I have to display some data from database even after un-install the app. For that I am writing ...
<p>I found that DB classes and other fields are being renamed by Proguard. As @jim commented. So I added following configuration statements in proguard-project.txt file to resolved issue</p> <pre><code>-keep class com.db.models.** -keepclassmembers class com.db.models.** { *; } </code></pre> <p>where com.db.models ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replace value one last valid item - Pandas<p>I want to replace a value in a column based off another column in a <code>pandas</code> df. Specifically, where ...
<p>You can use <code>shift</code> along with <code>numpy.where</code></p> <pre><code>import numpy as np b1 = df["B"].shift(-1) df["C"] = np.where((df["B"]=="X") &amp; (b1!="X"), "str" , df["C"]) </code></pre> <p>Output:</p> <pre><code> A B C 0 1 X 1 1 1 X 1 2 1 X str 3 1 D 1 4 1 ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: String comparison in a Bash script called from terminal or keyboard shortcut gives different output<p>I have two monitors and I am calling a bash script to m...
<p>Jdamian's suggestion to use: if [ "$currentWindowPosition" = below ] works. Notice the single equal sign. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Difference between byte[] Files.readAllBytes(), and FileChannels.map (ByteBuffer/MappedByteBuffer)<p>I see all sort of benchmarkings and a direct/non-direct ...
<p>readAllBytes copies the entire contents of a file into a new on-heap byte array, whereas mapping a file into a ByteBuffer permits access to the bytes of the file without loading it all into memory at once. You should expect some performance overhead to accessing bytes from the mapped byte buffer, but on the other h...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Component template inheritance/composition<p>How is one supposed to share duplicate UI functionality among Angular components?</p> <p>Angular makes this ver...
<p>I ended up using content projection along with <code>select</code> and the deprecated <code>:host ::ng-deep</code> to solve my issue.</p> <p>form-card.component.html</p> <pre><code>&lt;mat-card class="crm-form-card" matRipple&gt; &lt;div class="crm-form-card-container"&gt; &lt;ng-content select=".crm-form-ca...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I group a MySQL query by two different columns?<p>The question I am working on is:</p> <blockquote> <p>Provide the average answer for questions in bro...
<pre><code>SELECT province,survey_question_id, AVG(survey_response) FROM survey_responses JOIN survey_responders ON survey_responses.id = survey_responders.id WHERE survey_responders.province='Ontario' GROUP BY province,survey_question_id; </code></pre> <p>if you need all the provinces just remove the <code>Where</co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to remotely control an EA on a PC from another PC?<p>I have an EA (i.e Robot) i want people to have it on their PC. is it possible to activate...
<p>You can use your PC (need to make sure that you have a static IP address and then launch a web application). Simpler is to rent a VPS. Then, create a simple web application, probably using Django (Python) or PHP, with REST webservice and admin panel.</p> <p>EA side: every robot is compiled, EX4 file is provided to ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hashing with chaining and use table of size `m`<p>I ran into an example in Computer Science Course. </p> <p>suppose we use Hashing with chaining and use tab...
<p>You can empirically check it with a simple code:</p> <pre><code> int[] mVals = {11, 7, 9, 12}; for (int m : mVals) { int[] cells = new int[m]; for (int i = 1; i&lt;= 100; i++) { int x = i*i % m; cells[x]++; } System.out.println("m=" + m + " cells=" + A...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fill with NA's until a number, after that fill with 0<p>What I need is to transform NA's to 0 after a number appears in the timeserie. This is an example: </...
<p>I pivoted back to "wide" form after replacing the NAs to match your desired output, but as a side note, it's probably better to store this in long form anyway.</p> <pre><code>library(dplyr) long &lt;- x %&gt;% pivot_longer(-ID) %&gt;% group_by(ID) %&gt;% mutate(value = ifelse(cummax(!is.na(value)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hide product title with WooCommerce<p>I'm on WooCommerce 2.11.</p> <p>I want to remove the top page title which shows the product name. Here is an example (...
<pre><code> .single_product_title { display: none; } </code></pre> <p>The above worked for me when on your test site.</p> <p>On a sidenote - tucking away the (supposedly) H1 title isn't something Google likes and will affect your SEO, unless you're going to show the title in some other way?</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to "restart" a program<p>I am a beginner that has been coding in c++ for a few weeks now. I have written a my program to have a menu from which a user se...
<p>You can add an endless loop that will return your user to the beginning of the program indefinitely. If you want it to stop, you can add a case that sets <code>active</code> to <code>false</code>. </p> <p>I also fixed your switch cases. As someone mentioned, it's not necessary to <code>switch</code> for each case -...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to save data into database<p>How to send new grade for given student and subject redirect to student grades in AddGradeView(View)?</p> <p>forms.py</p> ...
<p>It is solution form my question.</p> <p>''' </p> <pre><code>class AddGradeView(View): def get(self,request): form = AddGradeForm() return render(request, 'exercises/form.html', {'form':form}) def post(self,request): form = AddGradeForm(request.POST) if form.is_valid(): ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JQuery Resizable Touchscreen<p>i am using jQuery resizable method to resize the div, its working fine with mouse but on touchscreen its not working..it doesn...
<p>I tried touchpunch and it worked.</p> <p>Here are the instructions from <a href="https://github.com/furf/jquery-ui-touch-punch" rel="noreferrer">their github page</a>:</p> <blockquote> <p>Just follow these simple steps to enable touch events in your jQuery UI app:</p> <p>Include jQuery and jQuery UI on yo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Swift: call overloaded method with ambiguous return type<p>Suppose I have the following code:</p> <pre><code> public class A {} public class B : A {}...
<p>The compiler needs to be able to determine which variation of <code>bar()</code> you want to execute. You can be explicit about the type of <code>func</code> you want to execute, and take advantage of currying to access the correct implementation for a given instance.</p> <pre class="lang-swift prettyprint-override...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why are my pipes fuzzy?<p>I am creating a sitemap, and for some reason on all browsers the different separation pipes have different fuzziness.</p> <p>Chrom...
<p>Chrome and Firefox use different techniques for rendering fonts. That's why they look different (more or less smooth and fuzzy) in each browser. It is then also different on the several operating systems. </p> <p>If you need it to look consistent every time, you should probably use an image or the CSS <code>border<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it faster to try and avoid UNIQUE violations when inserting into a PostgreSQL database with efcore, or to catch the resulting exception?<p>Assuming I have...
<p>Checking whether a row exists before inserting is definitely the worse option, for two reasons:</p> <ul> <li>You are executing two SQL commands: one query to check if the row exists, and another to insert a new one. This means two network roundtrips, two commands executed in the database... It's quite a lot heavier...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Read in values of a script tag using JavaScript<p>I am attempting to add values within a script tag and reading it and parsing the values in JavaScript. I ha...
<p>Your code is fine, make sure that <code>&lt;script type="text/plain" id="bound-bunny"&gt;</code> is loaded, and executed before the moment of execution <code>document.getElementById('bound-bunny').innerHTML</code></p> <p>Examples:</p> <p>This example will work fine because of <code>#running-script</code> is being ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android video saving with 1000x the required space<p>I made this code for saving making videos in my app but for some reason that I don't understand it is sa...
<p>Your loops:</p> <pre><code> for (int i = 0; i &lt; bFile.length; i++) { outStream.write(bFile); } </code></pre> <p>end up writing the entire bFile byte array bFile.length times. Effectively you are writing (bFile.length)<sup>2</sup> bytes. Just have one <code>outStream.write(b...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jquery Mobile 2 ListView inside Tab issue<p>I am having issues or i should say the whole list breaks if i use the following code</p> <pre><code>&lt;div data...
<p>The problem may be in the ordering of the segments. I don't know why is it behaving like this, but putting tab segment in the end works. <a href="http://jsfiddle.net/toct7x0u/1/" rel="nofollow">http://jsfiddle.net/toct7x0u/1/</a></p> <pre><code> &lt;div data-role="content" class="ui-content-menu"&gt; &lt;di...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to load assets when testing website localy<p>I have tested website on my server where everything works fine, its a simple html/css/js based website wi...
<p>The problems you are having may be related to how you are opening your web pages in the browser.</p> <p>You cannot just open them as files: <code>c:\website\index.html</code></p> <p>Instead, you should install a stack such as WAMP, or XAMPP, or EasyPHP. I recommend <a href="https://www.apachefriends.org/download.h...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java: Design by Contract annotations<p>I've recently started to read up on the Design by Contract design method but I don't understand some aspects of it. Wh...
<p>JavaDoc is inaccessible at runtime. The <code>.class</code> file doesn't contain them. (Reference see here <a href="https://stackoverflow.com/questions/15312238/how-to-get-a-javadoc-of-a-method-at-run-time">StackOverflow question</a>) Therefor, any code that would check for a javadoc is impossible.</p> <p>The comme...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: what does "at" sign @ stand for in R?<p>I would like to know about functionality of "@" (at sign) in R.<br> Let's say:<br> In the example below if I call <co...
<p><a href="http://rgm3.lab.nig.ac.jp/RGM/R_rdfile?f=methods/man/Methods.Rd&amp;d=R_rel" rel="nofollow">S4</a> objects are lists with nodes or leaves (which are technically calls <a href="http://rgm3.lab.nig.ac.jp/RGM/R_rdfile?f=methods/man/slot.Rd&amp;d=R_rel" rel="nofollow">'slots'</a>) that are accessible with the <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: perl and bash variable substitution, with hexadecimal characters and repeat count<pre><code>alex@d120432:~$ echo $0 bash alex@d120432:~$ perl -e 'print "\x41...
<p>You will have to escape inner double quotes and use double quotes in shell for variable expansion:</p> <pre><code>perl -e "print \"\x41\x42\x43\x44\x0a\" x $i" </code></pre> <p></p> <pre><code>ABCD ABCD </code></pre> <p>Following variant may also work:</p> <pre><code>perl -e 'print "\x41\x42\x43\x44\x0a" x '$i ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Enter a valid date error received in django form<p>I've seen a lot of questions like this one but not specifically for generic class views. I get the error "...
<p>Instead of pass <a href="https://docs.djangoproject.com/en/3.0/ref/forms/fields/#django.forms.DateField.input_formats" rel="nofollow noreferrer"><code>input_formats</code></a> into <code>get_context_data</code> you should set in on form's field:</p> <pre><code> class PrestamoFormCreate(forms.ModelForm): fecha_p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python heatmap with unequal block sizes<p>I have the following dataset:</p> <pre><code>results=[array([6.06674849e-18, 2.28597646e-03]), array([0.02039694, ...
<p>One approach is to equalize the row lengths with <code>np.repeat</code>. This only works well if all rows have a length that is a divisor of the longest row length.</p> <p>The data suggest using a <a href="https://matplotlib.org/api/_as_gen/matplotlib.colors.LogNorm.html" rel="nofollow noreferrer">LogNorm</a>, alth...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Return empty string as True in given string<pre><code>def first_and_last(message): if (message[0] == message[3]): return True eli...
<p>You can use <code>if not message:</code> to check if the message variable is empty.</p> <p>You could, for example, do as follow :</p> <pre class="lang-py prettyprint-override"><code>def first_and_last(message): if not message: return True elif (message[0] == message[3]): return True ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Report with Report Writer duplicating last line<p>I find myself sorting an input file, and using a control break to compute some data. We need headers in th...
<p>Here's a link to some Report Writer documentation from Micro Focus. It is not the only documentation they provide, but it is all that I have scanned through: <a href="http://documentation.microfocus.com/help/index.jsp?topic=%2Fcom.microfocus.eclipse.infocenter.studee60win%2FGUID-48E4E734-F1A4-41C4-BA30-38993C8FE100....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Not able to pass parameter to SSRS report from c# Microsoft.Reporting.WebForms.ReportViewer<p>From an aspx, I have code behind to call a SSRS report. Most of...
<p>A change to the ReportParameter as array works.</p> <pre><code> rptViewer.ServerReport.SetParameters(new ReportParameter[] { new ReportParameter("ManifestPeriod", reportManifestPeriod) }); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use CONCAT inside CONCAT in mysql<p>I have a stored procedure and a part of it is:</p> <pre><code>SET @TableAlias = " ls_flock AS _flk "; SET @Select = CONC...
<p>I suspect that you want to generate a query string that uses <code>CONCAT()</code> - because I see that the table alias <code>_em</code> is declared further in the <code>@Join</code> variable. For this, you would need to move the function <em>inside</em> the query string. </p> <pre><code>SET @Select = CONCAT( "...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I find someones hostname?<p>To go more indepth i have a program where I want to prompt the user to type their given username and password (Given from...
<p>If you want to get the hostname for the local computer on Windows, you can just call <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms738527(v=vs.85).aspx" rel="nofollow"><code>gethostname()</code></a>, or one of the related winsock functions, depending on your needs.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: New to Power BI looking for a count of results after applying slicers<p>I have a data set comprised of 4 columns</p> <p>DateTime(UTC), time(ms), user IP, us...
<p>You just need to write a measure and drop it in a visual like a card.</p> <pre><code>CountResults = COUNTROWS( TableName ) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jquery mouseenter mouseleave not working correctly<p>I'm trying to move the title of wp plugin from thumbnails when the mouse hover and place these in anothe...
<p>Dont use <code>prepend</code> if you want to replace entire title. You can just use <code>$(".captiondiv").html(str);</code></p> <p><strong>EDIT</strong> the problem was that element <code>(".caption-title:visible")</code> had multiple values. It was solved using <code>$(this)</code> element to get the wanted eleme...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AES_128_CBC Encryption/Decryption using OpenSSL<p>I am currently trying to develop a C program to implement AES_128_CBC using the OpenSSL library. When I com...
<p>You have overlooked a few things in your code.</p> <p>First, you have declared your <code>aes_input</code> array without initializing it:</p> <pre><code>/* Input data to encrypt */ unsigned char aes_input[BUFSIZE]; </code></pre> <p>Since you have not initialized this array, it may hold any value after this. Diffe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change shape, size, colour in ggplot objects<p>I really like the ggplot2 package, but often run into supposedly basic problems that stops me for many hours. ...
<p>I simplified your code some, corrected one point, and illustrated the technique with shapes.</p> <pre><code>state &lt;- c(TRUE,FALSE) effect &lt;- c(0.5, 1.0) test &lt;- c("A","B") # Create combinations. df &lt;- expand.grid(Test=test, State=state, Effect=effect) set.seed(1234) # needed for reproducibility df$Val ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: xyplot panels in the wrong order<p>I have a problem plotting my xyplot. My table is ordered by day but I can't get the right order from Tuesday to Sunday. I ...
<p>you can try this code without creating factors and reordering levels</p> <pre><code>xyplot(Nos~Period|I(Day),layout=c(6,1),type="o", index.cond=list(c(5,4,6, 1:3))) </code></pre> <p><strong>index.cond</strong> reorder the plot as you wish</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to define a constant record containing other constant records in Delphi? Specific case: matrix using vectors<p>Say I have a simple record in a unit, such...
<p>That's not possible. In a constant record declaration, the member values must be <a href="http://docwiki.embarcadero.com/RADStudio/en/Declared_Constants#Constant_Expressions" rel="noreferrer">constant expressions</a>. That is, you cannot use typed constants as you have attempted to do.</p> <p>The <a href="http://do...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Display data into dropdown list from database using php<p>Here i am trying to fetch data from database and display it into dropdown list using PHP. Though th...
<p>I think one of the problem is that you are missing single qoutes in your echo <code>$row[project_id]</code> which should be <code>$row['project_id']</code>. what happens if you change your code to the following?</p> <pre><code>&lt;?php $sqll="SELECT * FROM project_master"; echo "&lt;select class='form-cont...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Heroku Connect, detect salesforce update in postgres<p>So I have an app taking advantages of Heroku Connect to sync datas between platforms. I need to find a...
<p>The solutions that come to my mind (likely there are more): </p> <ol> <li><p>check out the <a href="https://devcenter.heroku.com/articles/heroku-connect-database-tables#system-tables" rel="nofollow noreferrer">Heroku Connect system tables</a> like <code>_trigger_log</code>. This table will give you an exact log of ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How practical are units of measure ontologies in RDF?<p>I am creating a collection of materials in RDF. I have come across two approaches for handling units ...
<p>The problem that is mentioned in the question is a known issue within the RDF community and has been discussed in peer-reviewed papers. </p> <p>With respect to the second approach mentioned in the question, one may think that is completely unnatural to write using intermediary objects. However, ontologies to descri...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: iOS Swift Briefly Display Info<p>I want to have some information drop down from the top of a view, stay on the screen for a second or two, and then go back u...
<p>Don't use notifications and banners, because that might not work: the user can turn them off. In any case this is not a notification of anything, so it's a misuse of notifications.</p> <p>Just do what you described, yourself: animate a view onto the screen, and then (in the animation's completion handler) use delay...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Firebird 2.5 commit/rollback (using autonomous transaction) in loop<p>I have to process records in a stored procedure's loop, for example:</p> <pre><code>cr...
<p>You don't need anonymous transactions for this. When an exception is thrown out of a stored procedure, the effects of that stored procedure is automatically undone. If a stored procedure contains <code>SUSPEND</code>, only the effects up to the last <code>SUSPEND</code> is undone (think of it as a savepoint). For an...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to add a year to given date with javascript<blockquote> <p>i need to add a year to given date. I have try this code</p> </blockquote> <pre><code>&lt;s...
<p>Try this : </p> <pre><code>var da = new Date(regDate); da.setFullYear(da.getFullYear()+1); var curr_date = ("0" + (da.getDate())).slice(-2) var curr_month = ("0" + (da.getMonth() + 1)).slice(-2) var curr_year = da.getFullYear(); document.form1.txt2.value = curr_date + "-" + curr_month + "-" + curr_year; </code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do we use @Html.RadioButton in our View .cshtml page?<p>I've successfully integrated the Contoso University ASP.NET MVC project in my VS Solution. I'd li...
<p>if you have an attribute in your course entity like courseradio,</p> <pre><code> @Html.RadioButtonFor(modelitem =&gt; item.courseradio,&lt;value you want to send to controller&gt;) </code></pre> <p>as an example if you want to send male or female using radio buttons</p> <pre><code>@model HotelReservationSystem.Mo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: LINQ - Sum depending on multiple conditions<p>I want to create a linq query that will sum up a total of customer orders. Depending on what customer have alre...
<p>Please try this:</p> <pre><code>var totalls = customers.ToDictionary(customer =&gt; customer.ID, customer =&gt; customer.OrderItems.Sum(oi =&gt; oi.Product.Type == EnumProductType.PAAS ? oi.PriceNet * 1.5m : oi.PriceNet * 0.8m)); </code></pre> <p>So, please modify your <code>Calcula...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: My app force close when call putString on SharedPreference.Editor<p>The problem occurs when I call putString to SharedPreference. My program is first run thr...
<p>As the error message states, the Intent in your service class is null when you call <code>intent.getAction()</code></p> <p>Intent is nullable here <a href="https://developer.android.com/reference/android/app/Service.html#onStartCommand(android.content.Intent,%20int,%20int)" rel="nofollow noreferrer">according to th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: c program doesn't give me errors<p>Consider the following program</p> <pre><code>#include &lt;stdio.h&gt; #include &lt;stdlib.h&gt; #include &lt;string.h&gt...
<p>There's no undefined behaviour in your code.</p> <p>The string literal <code>"Foo"</code> has <em>static storage duration</em>. You are passing its address to <code>init_my_string</code> and simply store that address (essentially a pointer to <code>"Foo"</code>).</p> <p>Your code is equivalent to (except we have o...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python binary format exception<p>Given following <code>Python</code> codes:</p> <pre><code>binaryE = "{0:b}".format(11749) print binaryE one = binaryE[0] ...
<p>They are of different types:</p> <pre><code>print(type(one), type(1)) # (&lt;type 'str'&gt;, &lt;type 'int'&gt;) </code></pre> <p>So you are comparing string to an integer. To fix this, convert the strings to int:</p> <pre><code>if int(one) == 1: print 'equal' else: print 'not equal' if int(zero) == 0: ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to import a package on startup in the Julia REPL, if available<p>I'd like to import a package anytime I start the REPL. Placing the following in <code>~...
<p>Try the following - bit of a hack until something better comes along in base Julia:</p> <pre><code>humanize_exists = isdir(Pkg.dir("Humanize")) if humanize_exists &amp;&amp; isinteractive(); using Humanize; end </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 open Windows Powershell through Python<p>I already know how to open windows command prompt through python, but I was wondering how if there is a way...
<p>You can just call out to powershell.exe using <code>subprocess.run</code></p> <pre><code>import subprocess subprocess.run('powershell.exe Get-Item *') </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PassportJS req.user not deserializing<p>I have tried to serialised and deserialised the user successfully within SailsJS's policy. An example would be this:<...
<p>I have found out that within <code>passport.authenticate</code>, there is a object that is returned within it's callback. Therefore, req.user will now be the returned user that was created by <code>passport.use(new LocalStrategy(..)</code>'s callback.</p> <p>To fixed that, we have to add the attributes we want for ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Apply a function data frame column<p>I have a data frame where 4th column contain ASCII values.</p> <pre><code>mydict=[('1385145553847005', '54', 'NPAVI...
<p>There are a number of problems here, your values is a literal string of a list of values: </p> <pre class="lang-py prettyprint-override"><code>In [295]: df[4] Out[295]: 0 [89,111,117,114,32,78,80,65,86,32,79,110] 1 [78,80,65,86,32,79,110] Name: 4, dtype: object </code></pre> <p>I don't kno...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use R to create start time and end time columns based on first occurrence of events in another column<p>I was wondering how to synthesis starttime and endtim...
<p>We can first <code>filter</code> out rows where <code>CallStatus</code> is <code>"Busy"</code> or the previous value of <code>CallStatus</code> is <code>"Busy"</code>, create groups of them and select <code>first</code> and <code>last</code> entry in each group. We replace <code>EndTime</code> with <code>NA</code> w...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Replace values with predefined mapping with ELK<p>I have a file that I read with Logstash containing a certain parameter called <code>type</code>. The possib...
<p>I already got what I consider the best possible answer through Google Groups. </p> <p>The answer can be found by following this link: <a href="https://groups.google.com/forum/?utm_medium=email&amp;utm_source=footer#!msg/elasticsearch/88dajXfzSwk/80gVTXws8VcJ" rel="nofollow">https://groups.google.com/forum/?utm_medi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Stuck on extended slices when attempting to combine lists by alternating values<p>I have a piece of codes as follows:</p> <pre><code>ascii_key = [None]*(len...
<p>What you are trying to do is an interleave of two sequences. The reason you are seeing the error is because <code>ascii_username</code> and <code>ascii_password</code> are not the same length. When you are trying to assign to the slice of the list, you have to supply the exact number of elements in the slice.</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: regex with preg_match anything and all line breaks<p>i am not too good with regex and can't seem to find the answer</p> <p>I am writing a class file to chec...
<p>Use:</p> <pre><code>'/^(.*)$/ms' </code></pre> <p>You need the <code>m</code> and <code>s</code> modifiers here. <a href="http://php.net/manual/en/reference.pcre.pattern.modifiers.php" rel="nofollow">http://php.net/manual/en/reference.pcre.pattern.modifiers.php</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: issues about using async_write right after async_read_until<p>My code is as follows:</p> <pre><code>boost::asio::streambuf b1; boost::asio::async_read_unti...
<p>The <a href="http://www.boost.org/doc/libs/1_57_0/doc/html/boost_asio/reference/async_write/overload3.html" rel="nofollow"><code>async_write()</code></a> overload being used is considered complete when all of the <a href="http://www.boost.org/doc/libs/1_57_0/doc/html/boost_asio/reference/streambuf.html" rel="nofollo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: when calling new Date() on server running nodejs, date returns when server was started<p>On my OpenShift server with Node, my server.js has a <code>var curre...
<p>Perhaps you are caching currentTime at server start instead of creating a new Date object on each request? Is your code like this?</p> <pre><code>var currentTime = new Date(); // Date object created at server start function callback (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); console.log(c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add legend to bar + line ggplot chart in R<p>I have a plot with variables A (bars) and B (line) where <strong>legend is not showing</strong>. I have a couple...
<p>I believe you want to make sure you have <code>color</code> in your <code>aes</code> to create the legend.</p> <p>Also added <code>guides</code> to remove the fill from the black line in legend.</p> <p>You can add <code>breaks</code> to <code>scale_x_continuous</code> to show all x-axis labels, if that's what you ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does the certificate need to be official or self signed?<p>I am putting a web test up for clients that visit "<a href="https://oursite.com/poodlesecurityfail...
<blockquote> <p>Do I need a valid certificate even though its on a test domain for certificate negotiation? If client can visit it, they failed the poodle test. (SSLv3 is enabled) on that host.</p> </blockquote> <p>Depends on the client.</p> <p>If the clients is has enough knowledge to understand, that "invalid cer...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Not able to map field in JAXB unmarshalling, fields getting populated as null<p>I have an XML that I would like to convert to a POJO using JAXB but I am not ...
<p>Try with @XmlElement annotation, this annotation maps a field to an xml element</p> <p>Response.java</p> <pre><code>@XmlElement private Parameters parameters; </code></pre> <p>Parameters.java</p> <pre><code>@XmlElement private String Id; @XmlElement private String Status; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set State, multiple objects value in the stateless component in react?<p>I am using a stateless component and got value from the json file, When I fet...
<p>You are doing it wrong. setXyz() is not a synchronous action, it takes some time. You need to implement this in a different way. First calculate and then set values.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Jest in a REST API NODEJS couldn't find a Right test for the Controller.js<p>I created an REST API for logistics controls where is possible to create a truck...
<p>Here is the unit test solution:</p> <p><code>controller.js</code>:</p> <pre class="lang-js prettyprint-override"><code>const Driver = require('./models.js'); exports.create = (req, res) =&gt; { const { oLongitude, oLatitude } = req.body; const { dLongitude, dLatitude } = req.body; if (!Object.keys(req.body...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Issue while calculating max sum in a binary tree<p>I am not sure why and how is the maxsum getting reset to 0 during the iteration.<br> There is some step I ...
<p>You are modifying local variable (maxsum), not class field (this.maxsum) Use "this.maxsum" instaead of "maxsum"</p> <pre><code>private void maxSum(Node n,int maxsum,int curr_sum,int rank){ if(n==null){ ... this.maxsum=curr_sum; ... } } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: horizontally aligning multiple divs (CSS)<p>I need to align these <code>div</code>s so that the space between "content1" and the red <code>div</code> equals ...
<p>You can use the incredible property box-sizing: border-box; supported by all modern browser, IE8 included! And set the width and margin on % :</p> <pre><code>.red, .blue { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } .red { width:650px; height...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to distinguish JavaScript Built-in Object<p>I'm currently learning JavaScript from ECMA <a href="http://www.ecma-international.org/ecma-262/5.1" rel="nof...
<blockquote> <p><strong><a href="http://www.ecma-international.org/ecma-262/5.1/#sec-4.3.7" rel="nofollow">4.3.7</a> built-in object</strong></p> <p>object supplied by an ECMAScript implementation, independent of the host environment, that is present at the start of the execution of an ECMAScript program</p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the required .Net framework to work with API Gmail and VB.NET<p>I am trying to integrate gmail-api into my Vb.Net application. I want to know what is...
<h3>Answer:</h3> <p><em>.NET Framework <strong>Version 4.5.1.</strong></em></p> <h3>References:</h3> <ul> <li><a href="https://developers.google.com/gmail/api/quickstart/dotnet" rel="nofollow noreferrer">Gmail API - .NET Quickstart</a></li> <li><a href="https://en.wikipedia.org/wiki/.NET_Framework_version_history" rel=...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React/JSX: Can I use a state variable in another state variable?<p>I have something like this, where I would like to create array in the state from a variabl...
<p>You can do this in javascript as follows:</p> <pre><code>const cards = [...] const names = = cards.map(...) this.state = { cards: cards, names: names } </code></pre> <p>You should probably not do this though and set state to only the cards and move the call to calculate the names to your render method</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Inconsistent text rendering between iOS and Mac<p>iOS 8 Safari (Retina) vs Mac OS X Yosemite Safari (Retina)</p> <p><img src="https://i.stack.imgur.com/Nssw...
<p><strong>SOLVED</strong></p> <p>Use Typekit instead of Google font.</p> <p><img src="https://i.stack.imgur.com/YMFNT.png" alt="enter image description here"></p> <p>You get what you pay for.</p> <p>Here's the code which did the trick.</p> <pre><code>&lt;script&gt; WebFontConfig = { typekit: { id: 'xzw9...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to GET data from firebase by REST via curl?<p>I'm trying to <a href="https://firebase.google.com/docs/database/rest/retrieve-data" rel="nofollow noreferr...
<p>Your URIs have to end with <code>.json</code>, as shown in the <a href="https://firebase.google.com/docs/database/rest/retrieve-data" rel="nofollow noreferrer">documentation</a> you refer to.</p> <p>For example:</p> <pre><code>curl 'https://smwtest-15295.firebaseio.com/9099.json' </code></pre> <p>or</p> <pre><co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: refrormating the output of print and save it as a data.frame in R<p>I'm trying to reformat the output of <code>print</code> and save that as a <code>data.fra...
<p>If we convert to <code>table</code>, can use <code>melt</code> from <code>reshape2</code></p> <pre><code>out &lt;- reshape2::melt(as.table(fit3[[2]])) head(out) # Var1 Var2 value #1 Q1 Factor1 0.22366038 #2 Q2 Factor1 0.17247766 #3 Q3 Factor1 0.13137496 #4 Q4 Factor1 0.05196747 #5 Q5 Factor1...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Typeahead afterselect fill to another input text<p>I want to fill some value to another input text. how to do that?</p> <pre><code>&lt;script&gt; var projec...
<p>Problem solved. I'm using typeahead:select for my cases. Thanks</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Aggregating returns in xts object from mondays to fridays<p>I have a vector of discrete returns.</p> <pre><code>require(xts) set.seed(1) x &lt;- xts(rep(0....
<p>You don't want <code>cumprod</code> if you want to aggregate. <code>cumprod</code> will return an observation for every observation in the object passed to it. You want <code>prod</code> instead.</p> <p>Since you're defining weeks as Monday-Friday, you can do this easily with <code>apply.weekly</code>:</p> <pre><c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: create subclasses or set types as strings?<p>I have a board with pieces of different types. These types only differ in their range and directions they are ab...
<p>You should leverage inheritance and create 4 different sub-types. Implement the common code, properties, and behaviors in the parent class.</p> <p>Define in the children anything that is different, such as the movement <code>behavior</code>. </p> <p>What you want is your <code>class piece</code> to have a <code>m...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: sjplot sjt.frq in new window / tab<p>I'm working with sjPlot in order to get "pretty" tables. I managed to create a really nice contingency and another table...
<p>Currently, there is no history feature for the Viewer pane in RStudio. You may open the tables in your browser instead (or additional, there's an icon in the Viewer pane), so you have multiple browser tabs, each with a table output.</p> <p>Or you "concat" multiple tables and show them in the Viewer pane, however, t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Split out column that contains both str and ints<p>I have a column that should only contain ints however, due to data errors, it currently contains both stri...
<p>Use <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.str.extract.html" rel="nofollow noreferrer"><code>Series.str.extract</code></a> for get years to new column with convert to floats:</p> <pre><code>df = pd.DataFrame({'IO8':['2000','2009','20','dwd21']}) df['num'] = df['IO8'].str.e...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Enabling page load samples for Google Analytics Site Speed<p>When I look at Behavior | Site Speed |Overview in GA I get the message: </p> <p>"0 of pageview...
<p>You need to set your sample set higher. I believe the default is only 10%. I'll paste code below once I get it from my BitBucket repo.</p> <p>Notice the "siteSpeedSsampleRate" property. I set mine to 100% because I'm greedy and want to know about ALL page views. Helps when I don't have more than 100k page views per...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: getResources().getDrawable(rippleResourceId, null) return rippleDrawable with the wrong color<p>I use android resourceId <code>android.R.attr.actionBarItemBa...
<p>sending a null theme caused this difference</p> <p><code>getDrawable(rippleResourceId, null);</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Storm Bolt not printing/logging Kafka Spout<p>Edit: I added an .ack() to the Bolt (which required me to use a Rich Bolt instead of the basic bolt) and am hav...
<p>The answer was simple. I was never telling the bolt which stream to subscribe to. Adding <code>.shuffleGrouping("Kafka Spout");</code> fixed the issue.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Qt: Scale polygons but not children<p>I am new to Qt. I am representing events from my application as polygons in my scene, using a custom class that inherit...
<p>The <code>QGraphicsScene</code> forms a scenegraph hierarchy based upon the parent-child relationships, transformations are inherited down this hierarchy - there is no way round this (see the Transformations section <a href="http://doc.qt.io/qt-5/qgraphicsitem.html#details" rel="nofollow">here</a>).</p> <p>So to fi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android RecyclerView: Change layout file LIST to GRID onOptionItemSelected<p>I am developing an Android Application for Online Shopping. I have created follo...
<p>I found solution with the starting of activity I have set <strong><code>LinearLayoutManager</code></strong> like:</p> <pre><code>mLayoutManager = new LinearLayoutManager(this); mProductListRecyclerView.setLayoutManager(mLayoutManager); </code></pre> <p>after that <strong><code>onOptionsItemSelected</code></strong>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is wrong in this binding?<p>I have an angular ui-grid in which data is displayed and in every row there is an "Edit" and "Delete" button. When the user ...
<p>Nothing is wrong with the binding. The root if the problem is that the datacontext doesn't have hasChanges method due to that the breeze's entityManager is wrapped in it. I had to rework the code a little bit, rethinking the responsibilities and it is working now.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find out when document.location.href has been completed<p>I have a button that lets users download a file. The file is returned from the server in the Respo...
<p>Assuming you can download the file twice, you could load the file in a hidden iframe and detect when the iframe is done loading. Then, the file is already cached and should download quickly.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bootstrap 4 change tooltip color for a specific element<p>I'm trying to change the tooltip background-color for the <code>icons</code> with the classes <code...
<p>In this case, you are using <code>+</code> selector, that will select the <strong>adjacent sibling</strong>. If you change it to <code>~</code> selector, it will select any next sibling, not only the next one (adjacent). Even so, it may not work for you. It depends on how your HTML code is structured and how complex...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pidgin facebook IM protocol line<p>I spent my last 3hours trying to remove this annoying line from Pidgin facebook IMs. Does anyone know how can I make it di...
<p>Set an alias for yourself. Setting one in facebook directly might work.</p> <p>If not check the <code>Accounts-&gt;[your facebook account]</code> menu for a <code>Set nickname</code> menu item or <code>Set User Info</code> menu item.</p> <p>If those don't exist or changing them doesn't help your problem then a loc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: java loop does not increase array index<p>let's say I have an integer array <code>int[] A = {0, 1, 2, 0}</code> the main method is</p> <pre><code>int i = 0,...
<p>When this line of code executes, these are the (simplified) states of each variable in existence at the time. </p> <pre><code>int i = 0, a = A[i], b = A[i + 1] --------------------- | A | {0, 1, 2, 0} | | i | 0 | | a | 0 | | b | 1 | --------------------- </code></pre> <p>Notice...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: QScrollBar QPlaintextEdit setValue does not work<p>I have a simple <code>QPlainTextEdit</code>. In <code>MainWindow</code> constructor:</p> <pre><code>for(i...
<p>For efficiency reasons, the scrollbars are updated only after displaying the widget, so it must be set a moment after the synchronous task is executed, and for this you can use <code>QTimer::singleShot()</code>: </p> <pre class="lang-cpp prettyprint-override"><code>QTimer::singleShot(0, [this](){ ui-&gt;plainTe...