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: How to make controller wait for service to return a value and how to access the returned value in controller?<p>I am new to <strong>angularjs</strong>. I am ...
<pre><code>'use strict'; app.factory('Search',function ($firebase, FIREBASE_URL, $rootScope, $q) { var simpleuser = ""; getIdByEmail: function(counsellorEmail) { var deferred = $q.defer(); var collegeUserArray = ($firebase(ne...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel 4.2 application encoding from UTF8 to iso-8859-1<p>The database is based on MSSql and Laravel is successfully talking to it. Database is base on lati...
<p>To solve this I have done the following:</p> <ul> <li>Changed the form helper /project/vendor/laravel/framework/src/llluminate/Html/FormBuilder.php in line 106</li> </ul> <p>this: </p> <pre><code>$attributes['accept-charset'] = 'UTF-8'; </code></pre> <p>to:</p> <pre><code> $attributes['accept-charset'] = 'la...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Looking for a good/reliable API for non GUI website interaction<p>Basically I want to gather statistics of searches on various search engines (google, yahoo,...
<p><a href="http://alternativeto.net/software/selenium/" rel="nofollow">This</a> site lists some alternatives to selenium.</p> <p>That being said, I have used selenium and found it to be quite flexible. You can also set it up in <em>headless</em> mode, which would allow the Java application to work without the need of...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to handle visualizing massive datasets in D3<p>I have a dataset with around 230,000 rows, and I'm having a hard time processing the data. I cut out over ...
<p>If rendering a lot of data all at once is overwhelming, I think it'd be better to split the data into chunks and render the each chunk asynchronously.</p> <p>For example.</p> <pre><code>function chunk(arr, chunkSize) { var R = []; for (var i=0,len=arr.length; i&lt;len; i+=chunkSize) R.push(arr.slice(i,i+ch...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Read a file hex data and store into a string 2d array in c++<p>I have &quot;hex.txt&quot; file. It is some data:</p> <blockquote> <p>gdujdurkndvju;roaen'pefk...
<p>Ok, now a new try with std::string and a std::stringbstream</p> <pre><code>#include &lt;iostream&gt; #include &lt;stdio.h&gt; #include &lt;fstream&gt; #include &lt;iomanip&gt; #include &lt;sstream&gt; #include &lt;string&gt; int main(int argc, char** argv){ std::ifstream data("hex.txt", std::ios::binary | std:...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Missing operand in for loop<p>I have such a bubble sort statement;</p> <pre><code> procedure Bubble_Sort (Data: in out List) is sorted: Boolean := ...
<p>remove the <code>range</code> keyword: <code>for check in Data'Range loop</code></p> <p>The <code>range</code> keyword is used to define ranges and subtypes (sometimes anonymous), which is not needed when you use the 'Range attribute.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i check that a user is 12 and over sql<p>How do I check that when a user enters their date of birth into my database that they are 12 and over?</p> ...
<p>Oracle won't you let use <code>sysdate</code> in a check constraint (or other functions whose return value is not constant over time).</p> <p>You can, however, write a trigger that implements the same logic:</p> <pre><code>create or replace trigger trg_mytable_dateofbirth before insert or update on mytable for eac...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extjs issue with PagingToolbar - same data on the next page<p>There are so many issues I found about different problems with grid paging but still can't find...
<p>Yes, you can configure it at the proxy level. See <a href="http://docs-origin.sencha.com/ext/5.1/5.1.0-apidocs/#!/api/Ext.data.proxy.Server-cfg-startParam" rel="nofollow">startParam</a> and <a href="http://docs-origin.sencha.com/ext/5.1/5.1.0-apidocs/#!/api/Ext.data.proxy.Server-cfg-limitParam" rel="nofollow">limitP...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the primary layout if you have many layout files defined in an android app?<p>In an android project with many layouts how can I find what is the prim...
<blockquote> <p>What the user sees when he starts the application in his phone</p> </blockquote> <p>There really isn't a "primary layout", then. It may be that <em>your code</em> has a "primary layout", but that is not an Android construct, let alone a requirement.</p> <p>I am going to assume that by "starts the ap...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extract string from path/dir using Make<p>I’ve a <strong>Makefile</strong> with multiple git repo’s which I need to clone I use the following which works</p...
<p>Looping is generally something you want to avoid. Instead, declare a series of targets for each repo.</p> <pre><code>repos := ws-led tools-extension javt-ra .PHONY: all clone all: $(patsubst %,%/.built,$(repos)) clone: $(patsubst %,%/.git,$(repos)) %/.built: %/.git cd $*; docker build -t $* . touch $@ %/...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Record datatype equivalent in python<p>I am connecting to snowfalke database and fetch only 1 record. This record will have 21 columns. After i read them in ...
<p>Use a dictionary data structure to store and access like <code>tup_obj.name</code></p> <pre><code>columns = ['name', 'age', 'height', 'weight'] data = [('a', 20, 170, 80)] # This will be your select query results out = [dict(zip(columns, x)) for x in data] </code></pre> <p>Output</p> <pre><code>[{'name': 'a', 'ag...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AWS Registering Multiple Target Groups with a ECS service<p>I need to create multiple target groups for an ECS service. Does anyone have an example of how I ...
<p>This is a relatively <a href="https://aws.amazon.com/about-aws/whats-new/2019/07/amazon-ecs-services-now-support-multiple-load-balancer-target-groups/" rel="nofollow noreferrer">new feature at ECS</a>, I have not had the opportunity to test it in a project but just reading the documentation, it looks like pretty str...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Controller path in ASP.NET MVC application is not found<p>I have a ASP.NET MVC application with a navigation menu in it. The structure of that menu is define...
<p>Start your URLs with a slash, otherwise it will be relative to the current folder.</p> <pre><code>&lt;items&gt; &lt;item Text="Download" NavigateUrl="/Home/Download" /&gt; &lt;item Text="Delete" NavigateUrl="/Home/Delete" /&gt; &lt;item Text="Rename" NavigateUrl="/Home/Rename" /&gt; &lt;item Text="Upload"...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add Nuget packages to a multi-project Sidewaffle template<p>I have a basic multi-project template created with Sidewaffle in VS2013 as per the guide here;</p...
<p>The 2.0 schema tag should look like this:</p> <pre><code>&lt;Asset d:Source="File" Type="System.Collections.Immutable.1.1.33-beta.nupkg" Path="Packages\System.Collections.Immutable.1.1.33-beta.nupkg" d:VsixSubPath="Packages" /&gt; </code></pre> <p>And yes, you should author your project temp...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Tracing back deprecated warning in pytorch<p>I am training yolov3 on my data using this code here : <a href="https://github.com/cfotache/pytorch_custom_yolo_...
<p>Found the problem. line : <code>loss_x = self.mse_loss(x[mask], tx[mask])</code> the <code>mask</code> variable was a <code>ByteTensor</code> which is deprecated . Just replaced it with a <code>BoolTensor</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Export XCode 6 project to SVN repository<p>Everywhere I search, I get half the solution for exporting Xcode project on Subversion. And for Xcode6, I am not a...
<p>The easiest way is probably to do this via the terminal.</p> <ol> <li>Close Xcode</li> <li>Go to the project's folder in the Terminal (<code>cd path/to/project</code>)</li> <li><p>Use the <code>svn import</code>command:</p> <pre><code>svn import -m "New Import" MyProject/ https://myserver.me.com/svn/trunk/MyProje...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Problems in implementing the integral image in MATLAB<p>I tried to implement the integral image in MATLAB by the following:</p> <pre><code>im = imread('imag...
<p>You're implementing the integral image calculations right, but I don't understand why you would want to visualize it - especially since the sums will go beyond any normal integer range. This is expected as you are performing a summation of intensities bounded by larger and larger rectangular neighbourhoods as you m...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Search for few options in string (if .. in)<p>So what I'm trying to do is checking if a string contains one of many options. Let's say I have a <code>list["b...
<p>You can use <a href="https://docs.python.org/2/library/functions.html#any" rel="nofollow">any</a>:</p> <pre><code>st = "foobar water" l = ["bottle", "camera", "cake"] if any(w in st for w in l) </code></pre> <p>You may need to split to avoid cases like <code>foo</code> being in <code>foobar</code> <code>st.spl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: OpenLiberty startup frozen when ran tests agaist Arquillian liberty-managed<p>The sample project is <a href="https://github.com/hantsy/jakartaee8-starter" re...
<p>After reading the codes of <strong>liberty-managed</strong>, I found the reason. The liberty-managed does not read <em>server.xml</em> from either <em>src/main/liberty/config</em>(like what liberty maven plugin does) or the test classpath. It only read the server.xml file from the server config folder aka <em>&lt;wl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it a good practice to define Date fields of Persistent entities as Long type, so that we store millis in that field?<p>Whenever I create Persistent entiti...
<p>Use the Date. The class inside uses a long, so you can create equivalent code.</p> <p>What are you losing without the class is type safety and overall program semantics.</p> <p>What can you get is very small performance improvement in cases when you deal just with the long, when you are not creating any new Date o...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use Function<? super String, ? extends String><p>I am trying to connect to a server using a proxy, but the object I am creating forces me to create a ...
<p><code>Function</code> Represents a function that accepts one argument and produces a result.</p> <p>Function has basically two type arguments first is INPUT argument type and second is for OUTPUT return type</p> <pre><code>Function&lt;? super String, ? extends Integer&gt; checkvalue = (str) -&gt; str.length(); //...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: IE vertical Scrollbar Width with CSS and HTML<p>Is there a way with CSS and HTML or any javascript lib like jquery or angular i can reduce the width of the s...
<p>You can either use plugin or own css jquery for this to do so. the easiest way is to download the plugin ?</p> <p><a href="http://www.hongkiat.com/blog/css-scroll-bar/" rel="nofollow">click here</a> i hope it solved your problem .</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Keyboard hides input fields on Android WebView<p>On my Android app I have an Activity with a layout of almost WebView element. In this WebView I am loading o...
<p>I am not sure if this helps but my solution was to add some javascript to the webview to handle the resizing.</p> <p>first you need two javascript functions, I called mine noFocus which moves the body back to the 0 position.</p> <pre><code>function noFocus() { console.log('unfocus'); Android.resetWindow();...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: join a to c where table a and table c has only table b as relation<p>I have 3 tables; <code>A</code>,<code>B</code>,<code>C</code> </p> <p><code>A</code> is...
<p>In this case you need to use 2 <code>inner joins</code> to get data from <code>tablec</code> like following.</p> <pre><code>select a.*,c.coltoselect from tablea a inner join tableb b on a.abcommoncolumn=b.abcommoncolumn inner join tablec c on b.bccommoncolumn=c.bccommoncolumn </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: OpenCV: findContours(): how contours are ordered?<p>When we want to find the contours of a given image according to a certain threshold, we use the function ...
<p>I do not fully understand the question but from my understanding the Contour positions are based on the x and y pixel coordinates of the image which is what the returned vector list contain. So surely the criterion is they're position on the image. (Please consider this as a comment)</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using click to create a complex command line interface<p>I am trying to do a CLI that accepts multiple arguments that I guess you would say are nested and ar...
<p>What you are trying to do is the exact use case for <a href="https://click.palletsprojects.com/en/7.x/commands/" rel="noreferrer">click groups</a>. In your example <code>create</code> and <code>drop</code> are groups, and <code>table</code>, <code>view</code>, etc... are commands. This type of structure is (in my ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Access to constructor not allowed<p>Hi I encountered this error when I created a custom backbone app for my application. What it does is to send to its paren...
<p>Can you not do something like:</p> <pre><code>public NoteActivity() { super(); addFragment(new NoteFragment()); } protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(targetContainer); // you will have to put a getter/setter in BackboneActivit...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Refresh page until value changes in Python Selenium<p>I am trying to validate that a value changes to the correct text and if it does not to refresh the page...
<p>Can you please try the following : </p> <pre><code> while True: try: driver.find_element_by_xpath('xpath'): except NoSuchElementException: driver.refresh else: print("Text found") break </code></pre> <p><strong>Note:</strong> I suggest to c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why does a new default directory have user executable permissions where as a new file only has user read and write permissions?<p>Noticed this when creating ...
<p>A new directory created by a user and owned by the user with full permissions is no big deal. However, a new file/program if executed accidentally or before configuration could have catastrophic results. So the designers decided to give you a layer of protection. </p> <p>It also prevents other users from executi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Bootstrap Accordion Tabs Not Opening<p>I am trying to implement a bootstrap accordion with collapsible group items. I have managed to make it display on my s...
<p>Your code is working fine i think you didn't include your files correctly : </p> <pre><code>&lt;div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true"&gt;&lt;!-- begin accordion --&gt; &lt;div class="panel panel-default"&gt; &lt;div class="panel-heading" role...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Kronecker product between two tensors<p>I have two tensor: x is 2-by-2-by-3, y is also 2-by-2-by-3. Define each frontal slice of tensor is x1 x2 x3,y1,y2,y3....
<p>This could be one approach -</p> <pre><code>%// Pre-processing part [m,n,r] = size(x) %// Get size N = m*n %// number of elements in one 3D slice %// ------------- PART 1: Get indices for each 3D slice %// Get the first mxm block of kron-corresponding indices and then add to %// each such block for the indices co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: wordpress subdomain errors (2 wordpress)<p>So I have an existing wordpress in Domain and installed a completely new wordpress inside a new folder (subdomain)...
<p>Change both the config variables to use subdomains.</p> <pre><code>define( 'WP_HOME', 'http://subdomain.domain.com' ); define( 'WP_SITEURL', 'http://subdomain.domain.com' ); </code></pre> <p>This puts your .htaccess in full control and prevents wordpress from appending /subdomain anywhere.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regex to transform urls to hyperlinks on user input<p>I have a working regex that takes a user input such as "Please follow this link: <a href="http://www.go...
<p>First of all, your pattern can be refactored so that you could change it easier to your needs.</p> <p>The <code>https:\/\/|http:\/\/</code> alternation can be reduced to a short <code>https?:\/\/</code> where <code>s</code> is made optional (<code>?</code> makes a pattern match 1 or 0 times).</p> <p>The <code>[\w\...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: xslt case change transformation is removing the <br/ > tag from xml<p>I am doing a upper case to first character content in the xml data using the delimiters...
<p><strong>UPDATE: Both XSLT 1.0 and 2.0 solutions</strong></p> <p>All solutions preserve your line breaks and also work if you have inline markup of the text content.</p> <p>First I make the lc and uc parameters global for more minified templates:</p> <pre><code>&lt;xsl:param name="lc" select="'abcdefghijklmnopqrst...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Isomorphic React.js & iso-http<p>I'm building a react web application which I'd like to render both server side and client side. I've been working off <a hre...
<p>I've managed to get this working with <a href="https://github.com/andreypopp/react-async#rendering-async-components-on-server-with-fetched-async-state" rel="nofollow">react-async</a>.</p> <p>I've pulled out my async function like this so I can call it from <code>componentDidMount</code> and from the <em>asynchronou...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript: addEventListener not taking updated DOM into account?<p>I'm very new to javascript and I'm trying to give some dynamic features to a site I'm wor...
<p>Okay JSFiddle seems to be down, <a href="http://plnkr.co/edit/AX8gAbN8z5rrvQa1p6JG?p=preview" rel="nofollow noreferrer">so here is a Plunker</a></p> <p>Basically : </p> <ul> <li>Use <code>mouseenter</code> and <code>mouseleave</code> (<a href="https://stackoverflow.com/questions/7286532/jquery-mouseenter-vs-mouseo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ReferenceError: Cannot access 'Player' before initialization<p>So I've been using ES6 style syntax with import/export on Nodejs with the ESM module loader. E...
<p>I went to the Node.JS forums and asked what could be the issue. Not a babel issue at all, just circular dependencies. For example: </p> <pre class="lang-js prettyprint-override"><code>// A.js import B from './B.js' export default class A{} </code></pre> <pre class="lang-js prettyprint-override"><code>// B.js impor...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change mongodb Criteria content in spring<p>So I have a <code>Criteria</code> for <code>mongodb</code> constructed and I want to check the content of it, and...
<p>So Answering my own question: In order to achieve the above you need a piece of code like this</p> <pre><code>final Document document = (Document) filterCriteria.getCriteriaObject().get(whatever request param you need) Collection&lt;ObjectId&gt; ids = (Collection&lt;ObjectId&gt;) document.values().stream().getwhat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: registration form using Javascript and Php with MySql Database<p>I'm having problem with the registration for my website. </p> <p>If I fill out the username...
<p>you are missing ; after each alert </p> <p>try this code</p> <pre><code>&lt;html&gt; &lt;center&gt;&lt;h1&gt;Register Below&lt;/h1&gt;&lt;/center&gt; &lt;body&gt; &lt;br/&gt; &lt;script&gt; function getText() { var sub = true ; var name = document.getElementById("t1").value; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The background color does not change at each breakpoint<p>I have been studying a media query, but the background color does not change at each breakpoint I s...
<p>Change Your Media query Order like</p> <pre><code>@media (min-width: 375px) { body{ background: black; color: yellow; font-family: Helvetica, sans-serif; } } @media (min-width: 667px) { body { background: cyan; color: red; font-family: Gills Sans, sans-ser...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React Typescript how to setState<p>I am trying to learn typescript with react and I am pretty confused right now, how will I setState of an interface? My cod...
<p>The issue here is the value type that your context is defined with is <code>IMovie</code>, where as the type being passed to your context during rendering is actually an array: <code>[movies, setMovies]</code>.</p> <p>One solution would be to define and use a prop interface with your provider, that carries both the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: align grid lines on two plots<p>I have 2 subplots in matplotlib in Python. They are stacked on top of each other.</p> <p>I want to have gridlines on each pl...
<p>You could use <code>LinearLocator</code>:</p> <pre><code>from matplotlib.ticker import LinearLocator </code></pre> <p>Then on each of your x-axis or only on one of them call:</p> <pre><code>N = 6 # Set number of gridlines you want to have in each graph ax1.xaxis.set_major_locator(LinearLocator(N)) ax2.xaxis.set_...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Testing Slider onSlidingComplete from @react-native-community/slider with jest and enzyme<p>Is there a way to test what is called when the react-native Slide...
<p>I do it like this since there is no way to simulate the UI/View sliding on unit tests.</p> <pre class="lang-js prettyprint-override"><code>const mockOnSlidingComplete = jest.fn(); const wrapper = shallow(&lt;Slider onSlidingComplete={mockOnSlidingComplete} /&gt;); const sliderElement = wrapper.find(Slider); slider...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Grouping and OR in regex<pre><code>&gt;&gt;&gt; import re &gt;&gt;&gt; p='a+(\sb)|b+(\sa)' &gt;&gt;&gt; m=re.search(p, 'b a') &gt;&gt;&gt; m.group() 'b a' &g...
<p>The only way would be the <a href="http://www.rexegg.com/regex-disambiguation.html#branchreset" rel="noreferrer"><strong>branch reset</strong></a> feature using Python's <a href="https://pypi.python.org/pypi/regex" rel="noreferrer"><strong>regex</strong></a> module.</p> <pre><code>&gt;&gt;&gt; import regex &gt;&gt;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to extract string (date) from log file<p>i have log that not usual</p> <pre><code>Jan 5 11:34:00 log messages here Jan 13 16:21:00 log messages here </...
<p>For this example I might would do this: <code>.*[0-9]{2}:[0-9]{2}:[0-9]{2}</code>. Just matching anything before the time since that also needed.</p> <p>Or make it more precise with the assumption that the month is always 3 character long: <code>^[A-Z][a-z]{2}\s+\d{1,2}\s+[0-9]{2}:[0-9]{2}:[0-9]{2}</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Swing remove JTexField and JLabel<p>I have a <code>JTable</code> 2 columns, column name and check-box. If the user clicks the check box next to the name of t...
<p>You can create a <strong>Vector</strong> of all the fields that you want. And when the user clicks on the check-box, you can add it to the Vector. for eg:</p> <pre><code>Vector fields = new Vector(); </code></pre> <p>And when you get the notification, you add the name of the field in the vector, and call the <stro...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Making tab Active/Inactive is not showing the proper data<p>First, I have three tabs which were showing the proper and actual data as per my requirement, but...
<p>Use the below styles and jquery plugins.</p> <p>You can put three listviews on each tab content (div element) with tabs-1,tabs-2 and tabs-3</p> <pre><code>&lt;link rel="stylesheet" href="//code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css"&gt; &lt;div id="tabs"&gt; &lt;ul&gt; &lt;li&gt;&lt;a h...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React: Passing props to parent returns <empy string><p>First let me put my code here and I'll explain what's happening.</p> <p>Parent.js</p> <pre><code>cal...
<p>The reason this is happening is because setState is an async function. When you are trying to log this.state.des, the state would not have been set yet. If you want to console log your state to see if it has been set as expected, what you want to do is log it in the callback of this.setState (so it logs once we kno...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Meteor Timed variable resets<p>I'm making a game with meteor and I want certain variables to reset at the end of everyday.. DO you know how I would go about ...
<p>I recommend you to use <a href="https://atmospherejs.com/momentjs/moment" rel="nofollow">momentjs</a> package for this.</p> <p>First run.</p> <pre><code>meteor add momentjs:moment </code></pre> <p>Now you can do the follow</p> <pre><code>var day = moment().endOf('day').fromNow(), day1 = moment().startOf('day...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there any proposal to uniformize function type qualifiers and simplify abominable function types?<p>The <a href="http://www.open-std.org/JTC1/SC22/WG21/do...
<p>I made a similar suggestion on the std-proposals mailing list previously. See threads <a href="https://lists.isocpp.org/std-proposals/2019/09/0469.php" rel="nofollow noreferrer">here</a> and <a href="https://lists.isocpp.org/std-proposals/2019/11/0679.php" rel="nofollow noreferrer">here</a>.</p> <p>The conclusion f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you share a custom task in a SBT multi-project<p>I have a project set up as a SBT multi-build. That looks like this:</p> <pre><code>- project Depe...
<p>You can define common settings (dependencies) in an <code>object Common extends AutoPlugin</code> (in <code>project/Common.scala</code>), and then use <code>.enablePlugin(Common)</code> on sub-project descriptor (see it in <a href="https://github.com/playframework/anorm/blob/master/project/Common.scala" rel="nofollo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MultiValueDictKeyError - Django<p>I am having a problem by getting MultiValueDictKeyError in Django. I am trying to logout user from my website so I made the...
<pre><code>from django.urls import path from . import views urlpatterns = [ path('login', views.login, name ='login'), path('logout', views.login, name ='logout'), path('register', views.register, name ='register'), path('dashboard', views.dashboard , name = 'dashboard') ] </code></pre> <p>sorry guys ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Use mysql EXISTS with a const string<p>can u help me understand to difference between <code>EXISTS</code> and <code>IN</code> using mysql ?.<br> in my applic...
<p>Here are some common coding patterns:</p> <pre><code>WHERE col = 'string' WHERE col IN ('string') -- same as above WHERE col IN ('string1', 'string2') WHERE EXISTS ( SELECT * FROM tbl WHERE ... ) </code></pre> <p>The EXISTS one is really solving a different situation; I don't understand why you threw it in. Even ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AngularJS - Directive wrapping without losing connection to controller<p>Is there a way for not losing connection to the current controller when you are wrap...
<p>wrapContent directive will be processed with the scope of controller. DoAction directive will be processed with the isolateScope of wrapContent directive.</p> <p>Solution1: Get a reference to the sayHello function in wrapContent using '&amp;' and execute it in event handler.</p> <p>Solution2: Instead of using scop...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Powershell - EPOCH method filter by EndDate<p>I have already asked a question on this site to find the most recent end of warranty only, I would also like to...
<p>here's my version. [<em>grin</em>] the 1st section fakes reading in a CSV file. use the <code>Import-Csv</code> cmdlet when ready to use real data. the comments seem to cover what is happening. please ask for clarification if i was not clear enuf ... </p> <pre><code>#region &gt;&gt;&gt; fake reading in the data #...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Getting Facebook friends in background thread in iOS<p>I'm trying to get the Facebook friends of the current user using <code>[FBRequestConnection startForMy...
<p>if your handler take time to process friends you can call <code>[self getFacebookFriends]</code> in main thread and process the friends array in background i.e.</p> <pre><code>- (void)getFacebookFriends { [FBRequestConnection startForMyFriendsWithCompletionHandler:^(FBRequestConnection *connection, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sencha Touch Error...."has no method 'getId'"<p>I am getting this error, in my browser console, after running "sencha app run native testing":</p> <pre><cod...
<p>I finally rewrote the code so that I didn't have <code>var view = Ext.create('...</code>. instead I had <code>Ext.define('...</code> then I added: </p> <pre><code> `var owningNavView = list.up('main'); owningNavView.push({ xtype : 'barFoo...' });` </code></pre> <p>For sliding to the next card. </p> <p>After...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AS3 Restore Alpha of Multiple Objects on Click<p>I'm creating a simple interactive Mr. Potato Head game using AS3 and have used the following code to make ob...
<p>I would make an array of all the clips you want to fade back in; </p> <pre><code>var pieces:Array = [arms, eyes, mouth]; </code></pre> <p>then on click, assuming you make a fadeIn function similar to your fadeOut4</p> <pre><code>for (var i:int = 0; i&lt;pieces.length; i++){ fadeIn(pieces[i]); } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I create a dictionary/hashmap within a map function in javascript?<p>I wish to do this:</p> <pre><code>const ret = []; nums.forEach(num =&gt; { ...
<p>You can do something like this</p> <pre class="lang-js prettyprint-override"><code>const res = nums.map(x =&gt; ({[x]: Math.random() * 2 - 1})); </code></pre> <p>which is just a shorthand to </p> <pre class="lang-js prettyprint-override"><code>const res = nums.map(x =&gt; { return { [x]: Math.random(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: QLayout aligning widget as wrong<p>I have <code>QLayout</code> class which accept <code>QLabel</code> and align it as <code>Qt::AlignRight</code> in cell, ...
<p>This way you will get labels always center aligned, no matter what size individual labels are.</p> <pre><code>#include &lt;QLabel&gt; #include &lt;QApplication&gt; #include &lt;QLayout&gt; #include &lt;QMouseEvent&gt; class Window : public QWidget { public: Window(QWidget *parent = 0) {} virtual ~Window() ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to index your own defined type of list in F#<p>Excuse me if it's a dumb question, but I'm new with f# and couldn't find anything on this. I'm working on ...
<p>You write that "The type word has to be defined as <code>type word = (char * int) list</code>", but then you define <code>type word = Word of (char * int) list</code>. See the difference? That's what's causing you trouble. If you remove <code>Word of</code> it'll work. You'll need to remove <code>Word</code> from th...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: django modelformset_factory raises form not valid: id Select a valid choice. That choice is not one of the available choices<p>i am trying to create a stude...
<p>oops....I found my problem was the wrong usage of modelsfomset_factory...</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Scatterplot without any values in both variables or in one of them<p>As the title says, I want to see the empty plot with the coordinate system and the axis ...
<p>You can check the following code. It is large. You can reduce it using loop.</p> <pre><code> a1 &lt;- subset(a, datasource == 1) a2 &lt;- subset(a, datasource == 2) a3 &lt;- subset(a, datasource == 3) a4 &lt;- subset(a, datasource == 4) a5 &lt;- subset(a, datasource == 5) a6 &lt;- subset(a, datasource == 6) a7 &...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: zipping array of data in js<pre><code>in python: data = [50, 52, 54, 56, 58] answer = list(zip(data[0:],data[1:])) print answer [(50, 52), (52, 54), (54, 56)...
<p><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map" rel="nofollow"><code>map</code>'s</a> <code>callback</code> argument three arguments. The element from the array, the <em>index</em> of the element in the array, and the array itself:</p> <pre><code>data.slice(1).m...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TypeError: Cannot read property 'state' of undefined. Updated React<p>I'm very new to react so I'm just following youtube video but I got this error and I do...
<p>Either you pass props or directly use destructuring.</p> <pre><code>// using props if it's functional component function Todos(props) { return props.todos.map(todo =&gt; &lt;h3&gt; {todo.title} &lt;/h3&gt;); } </code></pre> <p>or </p> <pre><code>// using destructuring function Todos({todos}) { return tod...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to avoid MGT component to appears behind another<p>I'm using the Microsoft Graph Toolkit to display user information from a SharePoint SPFX webpart.</p> ...
<p>Just to provide closure here, this issue should be fixed as part of 1.2 update of the Microsoft Graph Toolkit.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error occurred while populating metadata while reading items from S/4 using java cloud sdk VDM<p><em>Using java SAP Cloud SDK version 3.9.0</em></p> <p>We h...
<p>This issue is solved as of SAP Cloud SDK version <code>3.11.0</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: pthread_mutex not waiting on timeout<p>I have the following code:</p> <pre><code>bool Mutex::timed_lock(unsigned long milliseconds) { if (!milliseconds)...
<p>The timeout to <code>pthread_mutex_timedlock()</code> is an absolute timeout, not a relative timeout. So you need to figure out the current time and calculate the future absolute time:</p> <pre><code>struct timespec ts; struct timespec now; gettimeofday(&amp;now, NULL); ts-&gt;tv_sec = now.tv_sec + milliseconds/100...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: what is '^=' operator in java<p>My code is as following:</p> <pre><code>char ch = t.charAt(t.length() - 1); // result of XOR of two char is Integer....
<p>From the functionality, they are the same: both perform an exclusive OR.</p> <p>But the data types are different:</p> <ul> <li><p>if I do <code>x = x ^ y</code>, the data type of <code>x ^ y</code> is always <code>int</code> or greater. When the result is assigned to something smaller, you have to cast.</p> </li> <l...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I configure a grails domain class attribute to be stored as (postgres 9.4) jsonb?<p>I've tried to configure a domain class like this: </p> <pre><code...
<p>To configure domain to map <code>jsonb</code> type to <code>String</code> you can:</p> <ol> <li><p>Declare your own <code>org.hibernate.usertype.UserType</code>. Add to <code>src/java</code>:</p> <pre><code>public class JSONBType implements UserType { @Override public int[] sqlTypes() { return new...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Symfony2 (doctrine2) : How to create universal method updateOrCreate?<p>I'm trying to do something like (if it possible)</p> <pre><code>function updateOrCre...
<p>You don't need logic, doctrine take care about update/insert logic for you. You try to fetch entity from DB. If it was found, you can modify it; any persist operation will result in update operation. If entity isn't found, you have to create a brand new one and then persist it; this will result creation operation.</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NuxtJS | Axios Register form reload page after submit<p><strong>How should work?</strong> When user submit form, notification should appear and inform user t...
<p>The same function in the Login.vue works fine because of <code>evt.preventDefault()</code>. You should pass the event in your register function as a parameter and call <code>preventDefault()</code> method on it to prevent the default behavior of the form (which is refreshing the page on submit):</p> <pre><code>meth...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Determining the region with data in a pcolor plot<p>I have a plot showing a map in a pcolor plot in Matlab R2012a/R2014a (=using the old graphic system) and ...
<p>I found a solution.</p> <p>The region is not stored in the axes object itself, but in one of its children (the one containing the actual plot). It is if type <code>surface</code> for <code>pcolor</code> plots and <code>hggroup</code> for <code>contour</code> plots. So you can find it via</p> <pre><code>childHandle...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Spark Streaming for Web Server<p>I'm trying to build up a web server that only processes http request (twitter data) from client side, process it (some...
<p>one of the solution can be use of Kafka message queue with apache spark streaming.</p> <p>Kafka has two parts :</p> <pre><code>1] Producer =&gt; send messages across network and act as a buffer 2] Consumer =&gt; receives messages from producer </code></pre> <p><strong>The possible design can be</strong> :</p> <p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Windows Phone 8.1 Connect to Pebble via Bluetooth Rfcomm<p>I have a problem when I trying to connect with pebble watch via bluetooth. This is my code: </p> ...
<p>I found a solution, just replace service id by <code>00000000-deca-fade-deca-deafdecacaff</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Switch too often triggered<p>I cannot get my head around this. There might be a simple solution and the problem addressed already, but I could not find an an...
<p>When case <code>1</code> is matched it will also execute case <code>2</code> and <code>3</code> unless there is a break.</p> <p>So each time through the loop the matched case and everything following is executed.</p> <blockquote> <p>First time: case <code>1</code>, <code>2</code>, <code>3</code></p> <p>Sec...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C2039 'XamlTypeInfo': is not a member of 'winrt::Microsoft::UI::Xaml' in XamlTypeInfo.g.cpp<p>I add <a href="https://github.com/microsoft/microsoft-ui-xaml" ...
<p>First, you need to declare WinUI application resources in App.xaml:</p> <pre><code>&lt;Application ......&gt; &lt;Application.Resources&gt; &lt;XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" /&gt; &lt;/Application.Resources&gt; &lt;/Application&gt; </code></pre> <p>Then also add the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to add 2 MySQL columns<p>I'm making a mysql search, in which the username can also be searched. This is my PHP (MySQL) code :<br></p> <pre><code>SELECT ...
<pre><code>WHERE CONCAT(first_name,' ',last_name) LIKE '%$search_content%' </code></pre> <p>i.e;</p> <p><code>WHERE CONCAT(first_name,' ',last_name) LIKE 'John Dalton'</code></p> <p>Does this help.?</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Prevent an empty form input from submitting an empty value to database after removing it using a jquery and ajax<p>Good day, ive been reading all the possibl...
<p>I think your issue issue is that, in your PHP, you call <code>$studid = (explode(",", $_POST['studid']));</code> before you check if the value is set.</p> <p><a href="http://php.net/manual/en/function.explode.php" rel="nofollow">From the docs for <code>explode()</code></a></p> <hr> <p>If delimiter is an empty st...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CCScrollView returns one children<p>I am working on cocos2dx 3.0, and working on <strong>cocos2d::extension::ScrollView</strong>, getting a strange problem, ...
<p>The scroll view's only child is the "content node". You should not be adding or getting children to/from the scroll view directly, instead add a content node via the <code>contentNode</code> property and add and get children from that content node.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NAudio File Conversion<p>I have Mp3 audio files with the <strong>same music</strong>, which are encoded at different sample rate and bit depth.</p> <p>For e...
<p>Yes you need to have all your <code>.mp3</code> files re-sampled to your required rate before converting them to <code>.wav</code> format. This is because the converting method <code>NAudio.Wave.WaveFileWriter.CreateWaveFile(string filename, IWaveProvider sourceProvider)</code> has no parameters that corresponds to ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: String format from Woocommerce RESTful API<p>I'm currently working with woo-commerce RESTful API and booking plugin.</p> <p>I need to parse this string from...
<p>This is a serialized string, use PHP unserialize() method, which will return an array like below.</p> <pre><code>$serializedStr = 'a:1:{i:0;a:5:{s:4:"type";s:6:"custom";s:8:"bookable";s:3:"yes";s:8:"priority";i:10;s:4:"from";s:10:"2019-12-11";s:2:"to";s:10:"2020-03-26";}}'; $unserializeOutput = unserialize($seriali...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: upstart System.in.read() crashes the process?<p>My java application is only this:</p> <pre><code> System.out.println("waiting for input..."); PrintWr...
<p>Some relevant snippets from the <a href="http://upstart.ubuntu.com/cookbook/#console" rel="nofollow">Upstart documentation for the <code>console</code> stanza</a>:</p> <blockquote> <p>For all versions of Upstart prior to v1.4, <strong>the default value for console was <code>console none</code></strong>. As of Ups...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: OnRowEditing Edit Textbox Focus<p>What I'm trying to do is, upon the GridView_OnRowEditing event, I want to focus on the textbox that appears in the cell I a...
<p>With some help from @okisinch I discovered I could do this:</p> <pre><code> $('#&lt;%=GridView1.ClientID%&gt; :input:enabled:visible:first').focus(); $('#&lt;%=GridView1.ClientID%&gt; :input:enabled:visible:first').select(); </code></pre> <p>The benefit of this is that I wouldn't need to find an tex...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Whats the right approach to create or change color of a status bar?<p>I have a quiet big problem with changing the color of my status bar. The device on whic...
<p>So last thing yes it does works this is ony one code whitch does not leave behind status bar shadow... do not know why but yes this was solution for me... i made in styles my background red... and on all screens (layouts) i add behind everything layout from edge to edge... so my background is now this layout... and ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find categorical indicator vector based on continuous thresholds<p>I have a set of <em>t</em> thresholds that separate my data vector <em>y</em> into <em>t-1...
<p>An easy option is <code>findInterval</code></p> <pre><code>categories2 &lt;- findInterval(y, t) all.equal(categories, categories2) #[1] TRUE </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django no sessionid in cookie<p>Im using Mongo Engine/REST Framework with Django 1.6.</p> <p>All I need is for the client to get a sessionid when he hits on...
<p>According to <a href="https://docs.djangoproject.com/en/3.1/topics/http/sessions/#technical-details" rel="nofollow noreferrer">the Django docs</a>, a user has no session until it is necessary:</p> <blockquote> <p>Django only sends a cookie if it needs to. If you don’t set any session data, it won’t send a session co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ServiceStack's Config.AdminAuthSecret is not working<p>I have a service using the <strong>Authorize</strong> attribute I would like to use ServiceStack's <st...
<p>Note: the API to set the configuration in ServiceStack is:</p> <pre><code>SetConfig(new HostConfig { AdminAuthSecret = "9999" }); </code></pre> <p><code>Config.AdminAuthSecret</code> was used to by-pass Services protected with RequiredRole and RequiredPermission attributes. I've just extended it to by-pass <co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Typescript make param optional<p>Here is <a href="https://www.typescriptlang.org/play/index.html?ssl=1&amp;ssc=1&amp;pln=20&amp;pc=1#code/MYewdgzgLgBAtgUwBYw...
<p>Could you use function overloads?</p> <pre><code>function meh(): { data: undefined }; function meh&lt;T&gt;(initialData: T): { data: T }; function meh&lt;T&gt;(initialData?: T): any { if (initialData) { return { data: initialData } } return { data: undefined } } type ResType = { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot Resolve Symbol "OnClickListener"<p>I am getting the error <em>Cannot Resolve Symbol "OnClickListener"</em> and <em>"Cannot Resolve Symbol "V""</em> I ...
<p>I'm not sure why you did that but please move the initializing and listeners to <code>onCreate()</code>:</p> <p>Simply cut these lines of code:</p> <pre><code> Button mButton = (Button) findViewById(R.id.More); mButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Faint line under legend using Bootstrap<p>I have the current CSS:</p> <pre><code>fieldset.bordered { border: 1px groove #ddd !important; padding: 0 ...
<p>Your styling is correct. The problem is that your <code>legend.bordered</code> style is not applying to the <code>legend</code> element because the css selector does not match it.</p> <p>To make it match, you either need to change it to <code>.bordered legend</code> (or even <code>fieldset.bordered legend</code>), ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ANDROID: How to properly link against static libraries while creating shared libraries with dependencies on the static ones<p>I have to use some c++ code in ...
<p>There may probably be other issues as well, but you at least have got a typo - it should be <code>include $(PREBUILT_STATIC_LIBRARY)</code>, as in, <code>BUILT</code>, not <code>BUILD</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does the browser find and render CSS rules<p>Let's say we have a page with the some simple HTML/CSS like below. Does the browser also read <code>.b</code...
<p>Yes all the rules are loaded in the memory, this is why when you add new element to your DOM (e.g. by using javascript) you see that the style automatically applies to them.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MVP - How to make network call in menu inflated by fragment?<p>I have a menu that is inflated by my fragment. <a href="https://i.stack.imgur.com/fzMW0.png" ...
<p>It's absolutely not correct send the presenter to the pop-up, what you can do is create a pop-up which have a callback for the buttons. So you can be notified in the fragment when the user click some button inside the pop-up. </p> <p>It's a good practice separate the network calls from the presenter as well. Create...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: WebRTC NTP Server<p>WebRTC has an experimental statistic <code>googCaptureStartNtpTimeMs</code> in the ssrc recv report of WebRTC stats. I believe it is defi...
<p><code>googCaptureStartNtpTimeMs</code> has nothing to do with NTP servers. It's in the local clock. "Ntp" in the name comes from the format in which time is passed in RTCP SenderReport packets, and doesn't imply that some NTP server synchronization is going on.</p> <p>Your understanding of the metric definition is ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I create a many to many relationship using SQLAlchemy?<p>How can I create a many to many relationship using the models below:</p> <pre><code>class A...
<p>Adapting from <a href="http://docs.sqlalchemy.org/en/rel_0_9/orm/basic_relationships.html#many-to-many" rel="nofollow">SQLAlchemy documentation</a>: You do not need to have the association model at all, if you do not need to have extra attributes for the association:</p> <pre><code>association_table = Table('associ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Toast message onClick NOT SHOWING (RecycleView)<p>Im trying show a toast msg when clicked on a item from my RecycleView, Ive tried many examples, but its no...
<p>Layout is not clickable by default. to make clickable add <code>setClickable</code> to <code>true</code> :</p> <pre><code>View itemView = LayoutInflater.from(viewGroup.getContext()).inflate( card_layout, viewGroup, false); itemView.setClickable(true); itemView.setFoc...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to multiply value from hashes in ruby?<p>I just start to study ruby. I got a simple question. I have my hash <code>exchange_rate = ["usd" =&gt; 1, "eur"...
<pre><code>class ExchangeRate def initialize (rate) @rate = rate end def exchange(from, to, value) @rate.fetch(from) / @rate.fetch(to) * value end end rate = { usd: 1, eur: 1.2, gbp: 1.3} money = ExchangeRate.new(rate) puts money.exchange(:eur, :usd, 20) # you will get 24 </code></pre> <p>note: <stro...
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 randomize the loop increase in for loop?<p>I needed a for loop to increase randomly between a given range (1 to 5). I've tried the followin...
<p>If you want to step forward by a random value, then you have to increment the control variables <code>x</code> and <code>y</code> randomly: </p> <pre class="lang-java prettyprint-override"><code>for (float x=0; x &lt;= width; x += random(1, 5)){ for (float y=0; y &lt;= height; y += random(1, 5)){ fil...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error in for loop in matlab<p>I have an error in the following <code>for</code>loop. I know because the end value of the first <code>for</code> is going to b...
<p>Replace your for <code>loop</code> by a <code>while</code> loop, so that the code in the loop is run only if the condition <code>ii&lt;=size_D</code> is verified:</p> <pre><code>ii=0; while ii&lt;=size_D ii=ii+1; %loop code </code></pre> <p>instead of the </p> <pre><code>for ii=1:size_D %loop code </code></...