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: Join 2 tables and display by ID<p>I have 2 tables :</p> <p>Table clienti :</p> <pre><code>CodClient | NumeClient | AdresaClient __________________________...
<p>in your SQL you're not passing the <code>$CodClient</code> id and instead you're simply joining both SQL tables based on generic relationship between attributes ... you need to add something like <code>SELECT NumeClient, AdresaClient, NrFactura, DataFactura, FacturaRetea FROM clienti c join facturi f on c.CodClient ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL query for database find the nr of students<p>I am a beginner in databases and I have the following: I need to show the courses which have the biggest num...
<pre><code>select c.course_code, min(c.course_name) course_name, count(distinct pc.pupil_id) as max_pupil_cnt from courses c inner join pupils_on_courses pc on ps.course_code = c.course_code inner join books_out_on_loan b on b.pupil_id = pc.pupil_id where b.date_returned is null or b.d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: stack get 8 byte more than its need<p>I write very simple program in c as below:</p> <pre><code>include&lt;stdio.h&gt; #include&lt;string.h&gt; main(int arg...
<p>The extra 8 bytes are for the parameters to <code>strcpy</code>. For some reason your compiler chooses to preallocate them on the stack, and directly store their values using <code>esp</code> as an index register, instead of using <code>push</code> instructions which is the way it is usually done.</p> <p>So, the c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular Jasmine UI router inject resolve value into test<p>In my Angular app, UI router resolves a promise into the controller. When trying to test this cont...
<p>Since there is no route involved in unit test you would have to inject the <code>allTemplates</code> as a normal object with <code>$controller</code> function. Can you try:</p> <pre><code>controller = $controller('QueriesCtrl as ctrl', { '$scope': scope, 'allTemplates':allTemplates ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SQL COUNT all rows with same or smaller value<p>I'm very new to Access and SQL. I have two columns with dates. I'm trying to get for every date in the first ...
<p>I think your approach is actually pretty good. But . . .</p> <pre><code>SELECT t.[Incident Date], (SELECT COUNT(*) FROM MyTable as t2 WHERE t2.[Incident Date] &lt;= t.[Incident Date] AND (t2.[Completion Date] &gt;= t.[Incident Date] OR t2.[Completion Date] IS NULL) ) AS ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Processing Touch and Gesture Events<p>I am working on a GUI that involves gesture input coming from a capacitive touch panel that is connected to a Windows 7...
<p>After some digging I found that the delay was actually intentional and served as a timeout for a gesture to be recognized and complete. Unfortunately, this timeout cannot be modified (see: <a href="https://msdn.microsoft.com/en-us/library/ms827533.aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/ms82753...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does mzero match guard type signature?<p>I have trouble understanding how <code>guard</code> works. Why does it type check? Isn't <code>mzero</code> capa...
<p>Yes, <code>mzero</code> <em>is</em> capable of returning some <code>m a</code> where <code>a /= ()</code>. But it's also capable of returning <code>m ()</code>. <code>guard</code> uses it in this second case.</p> <p>It's similar to this:</p> <pre><code>n :: Int n = 5 </code></pre> <p><code>5</code> can be a <code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter custom actions in AppBar<p>In order to have the same AppBar through my whole application, I created a separated file containing the AppBar which I in...
<p>I'd be inclined to try something like</p> <pre class="lang-dart prettyprint-override"><code>actions: (dropdownChoices.length &lt; 1) ? null : &lt;Widget&gt;[ PopupMenuButton&lt;DropdownChoices&gt;(...), ], </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Docker fails on npm install<p>I'm new to Docker, and I've wanted try Dockerizing my node app.</p> <p>I've tried following the directions on <a href="https:/...
<p>I used to get this error due to low or intermittent internet bandwidth.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to add new wifi credentials<p>I have an SSID and a password, I'd like to know how to save this new WiFi into the Smartphone known WiFis.</p> <p>Thanks f...
<p>I don't think so it's possible form code.You must insert it manually form settings menu</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular generator for large application<p>Is there an Angular example app or Yeoman generator out there that would satisfy the following needs?</p> <ul> <li...
<p><a href="http://www.dancancro.com/comparison-of-angularjs-application-starters" rel="nofollow">Here</a> is a detailed comparison of the ones I've studied.</p> <p>These have nested routing (ui-router):</p> <ul> <li>generator- ng-poly</li> <li>MeanJS.org.</li> <li>generator- angular- fullstack</li> <li>MEAN.io.</li>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Update command gets executed but doesn't change anything<pre><code>if (n != true) { cmd = new OleDbCommand("select max(Angebotsnummer) from tbl_Angebote"...
<p>The <code>OleDbCommand</code> does not actually take named parameters. So the order in which the parameters occur in the query, need to be the same as the order you add the parameters to your command.</p> <p>So in your case, for the update command, the value of the last parameter <code>@bet</code> is being used for...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: react-bootstrap ModalTrigger doesn't hide when the parent element is unmounted<p>We encountered a strange behavior when using react-bootstrap's ModalTrigger ...
<p>Turns out it was a misuse of React's "key" property. We gave the mapped objects integer keys, so when the render was called again, the same initial keys were given, which is why React thought it should reuse the same DOM element.</p> <p>If instead we give it key={item} (where item is a simple string) it solves it i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Migrate Hadoop System from 0.20.1 to Hadoop 2.6.0?<p>I am using a system created by Koichi Shirahata, Hitoshi Sato, and Satoshi Matsuoka where they cr...
<blockquote> <p>With that information, do I just need to edit the respective classes in the source code for Hadoop-2.6.0?</p> </blockquote> <p>Not exactly. They made changes to version 0.20.1, <a href="http://hadoop.apache.org/releases.html" rel="nofollow noreferrer">which was released in September 2009</a>. You wan...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to compress C++ vector of unsigned chars for quick comparisons? No decompression needed<p>I have a lot of vectors of unsigned chars that will be frequent...
<p>Use a hash function instead of compression. Generate a small hash, e.g. 32 bits, from the 100 elements of each vector. Then when you get a new vector, compare the hash of the new vector with the hashes of all of your old vectors. If the hashes are not equal, then the vectors are not equal. If the hashes <em>are<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sitecore Remove Button<p>I have a "Slide Show" control and I'd like to remove the first "X" button in the tool bar of the control. I have checked .ascx and ....
<p>Find <code>Slide Show</code> sublayout in your Sitecore tree. </p> <p>Scroll to <code>Editor Options</code> section and remove <code>Delete</code> from the <code>Page Editor Buttons</code> field.</p> <p><img src="https://i.stack.imgur.com/n0sng.png" alt="enter image description here"></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel5 - Carbon hardcode translating<p>Stackers!<br> I'm pretty new to L5 yet I know it a bit already. I've recently come across a problem I can't resolve....
<p>You need to install a localized package or localized extension of Carbon like <strong><em>localized-carbon</em></strong></p> <p><a href="https://github.com/LaravelRUS/localized-carbon" rel="nofollow">https://github.com/LaravelRUS/localized-carbon</a></p> <p><del>However, support for L5 is not yet ready, as can be...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Converting php loop to python<p>I need help to convert some php code to python. The code takes the result from mongodb cursor and using loop generates an spe...
<pre><code>from collections import defaultdict def repack(mongo_data): result = defaultdict(list) for data in mongo_data: result[data["host"]].append(data) return result </code></pre> <p>then</p> <pre><code>mongo_data = [ {"value": "example.com", "host": "246.156.18.221"}, {"value": "exa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MySQL look for duplicates on multiple fields<p>I have a MySQL database with the following fields:</p> <pre><code>id, email, first_name, last_name </code></p...
<p>If you just want to return the id and email that are duplicated, you can just use a GROUP BY query:</p> <pre><code>SELECT id, email FROM yourtable GROUP BY id, email HAVING COUNT(*)&gt;1 </code></pre> <p>if you also want to return the full rows, then you have to join the previous query back:</p> <pre><code>SELECT...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there any way to detect which monitor a window is on?<p>I want to make an app that behaves differently for different monitors (e.g. changing antialias tec...
<p>Yes, it's possible. I'll simplify my answer into grabbing the monitor based on the top x,y position of the <code>Window</code> (so this would fail of course if you had top half of the frame off any monitor, in general this code isn't robust but an example to get you started).</p> <pre><code>public GraphicsDevice ge...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: OK to have text in div without paragraph tag?<p>I'm trying to understand the utility of the <code>&lt;p&gt;</code> tag. I want to write less HTML, and am al...
<p>Yes, it is ok to use a <code>&lt;div&gt;</code> element without <code>&lt;p&gt;</code>. </p> <p>A <code>&lt;p&gt;</code> would tell that the text within a <code>&lt;div&gt;</code> element is split into paragraphs, thus if you have text split into paragraphs, you should use <code>&lt;p&gt;</code>; on the other hand,...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I separate reads and writes in CodeIgniter to avoid replication lag?<p>I'm trying to have some parts of our applications to read form a read-only data...
<p>As per CodeIgniter <a href="http://www.codeigniter.com/user_guide/database/connecting.html" rel="nofollow">Documentation</a>, you can use </p> <pre><code>$DB1 = $this-&gt;load-&gt;database('group_one', TRUE); $DB2 = $this-&gt;load-&gt;database('group_two', TRUE); </code></pre> <p>to connection to multiple database...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: cliping a webm file using moviepy and ffmpeg parameters<p>Using moviepy, I am trying to trim a section of a webm file like this:</p> <pre><code>my_file.writ...
<p>The parameter you are looking for is "bitrate" (for some reason I omitted it in the docs, it will be fixed for the next versions). If you don't provide it, ffmpeg has a default value which is indeed very low.</p> <pre><code>myclip.write_videofile("test_1.webm", bitrate="50k") # low quality. myclip.write_videofile("...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SecretClient class in azure-keyvault-secrets python package throws unexpected errir<p>I've been trying to get my python script to retrieve a secret from an A...
<p>We cannot use the ServicePrincipalCredentials to create a SecretClient. Because the ServicePrincipalCredentials cannot provide the access token. If you want to access key vault, please try to use the Credentials provided by sdk <a href="https://docs.microsoft.com/en-us/python/api/azure-identity/azure.identity?view=a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Swap positions between three Panels<p>I have three panel type objects (A, B, and C), which have been dynamically generated within another panel type control....
<p>You just need to find the controls. Swapping is the easy part.</p> <p>Finding controls is also easy if you use <a href="https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.control.controlcollection.find?redirectedfrom=MSDN&amp;view=netframework-4.8#System_Windows_Forms_Control_ControlCollection_Find_Sy...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reading an external file with cli Go package<p>I'm using the cli Go package: <a href="https://github.com/codegangsta/cli" rel="nofollow">https://github.com/c...
<p>cli.Context.Args returns args form the current context. Meaning, not the global arguments supplied. If you print the length of c.Args you'll see it is zero.</p> <p>You can either use c.String("file") or remove the app.Flags, supply a command in the format of go run io.go path/to/file.txt and use c.Args.First()</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Apply permutation matrix to pandas DataFrame<p>I have two identically sized DataFrames (call them <code>A</code> and <code>B</code>) with the same set of ind...
<p>You could use <a href="http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.reindex_like.html" rel="nofollow"><code>reindex_like</code></a> to reorder the rows/columns of one DataFrame to conform to another DataFrame.</p> <pre><code>&gt;&gt;&gt; vals = np.arange(9).reshape(3,3) &gt;&gt;&gt; df1 = pd....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Regarding MAINFRAME bin files , how to read/compare any bin files?<p>I am planning to create a sample application in .NET WPF which reads MAINFRAME bin files...
<p>There is no such thing as a "MAINFRAME bin file" - mainframe datasets neither have the concept of filetypes nor of file-extensions. After transfering files from the mainframe to some Windows/Unix-machine some people use the <code>.bin</code>-extension to indicate that the content should be treated as binary.</p> <p...
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 modify a string to remove a decimal?<p>I have a file with a lot of images. Each image is named something like:</p> <ul> <li>100304.jpg</li...
<pre><code>splitOn = '.' nameOfFile = text.split(splitOn, 1)[0] </code></pre> <p>Should work</p> <p>if we take your file name eg 12345.0 and create a var</p> <pre><code>name = "12345.0" </code></pre> <p>Now we need to split this var. In this case we wish to split on <code>.</code> So we save this condition as a sec...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Function to accept a matrix as input and goes element by element using for-loops adding one to each of the elements<p>I have created a function to add one to...
<p>In Matlab, you don't need a special function to do this. Matlab natively supports adding a scalar to a matrix. For example:</p> <pre><code>x = [1 2 3; 0 0 0; 4 5 6]; y = x + 1 </code></pre> <p>will produce:</p> <pre><code>y = 2 3 4 1 1 1 5 6 7 </code></pre> <p>However, if ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I need to type number 2 times after my scanner scan the input<p>Could you help me to understand why I need to type 2 times to allow scanner to scan my input ...
<p>You initialize <code>Scanner</code> 2 times thats why - </p> <p>In while loop - </p> <pre><code>while (!scan7.hasNextInt() || scan7.nextInt() &lt; 0) { System.out.println("Type number of players"); //Issue here scan7 = new Scanner(System.in); } </code></pre> <p>You can simply use <code>scan7.next()</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to remove specific phrase from csv file<p>So I've got a CSV file, <code>test.csv</code>, with the following:</p> <pre><code>Apples Pears Oranges </code>...
<p><strong>You can use <code>sed</code> to do that.</strong></p> <p>If you want to remove the <strong>entire row</strong> that contains <code>test</code> variable's value. Then try- </p> <pre><code>user@localhost$ sed "/$test/d" test.csv &gt; output.csv </code></pre> <p>If you want to replace the <strong>word</stron...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why should I use "setSeed()" in my java card program?<p>I wrote the below program to generate a <em>16 byte</em> random number in my java card. I used the ap...
<p><code>setSeed()</code> supplements rather than replaces the seed for a Java Card <code>RandomData</code> object, just like <code>SecureRandom</code> on Java SE. This is however not made explicit in the API up to 3.0.4.</p> <p>However, if you read the text of the constant <code>ALG_PSEUDO_RANDOM</code> you'll get:</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Loop over different Dataframes Pandas<p><strong>Hello World,</strong></p> <p>I have 52 dataframes (df and data) with each of them containing only Name with ...
<p>For those who might be interested, below is what I have done:</p> <p><strong>Step 1: re-merge all df's and data's. <br></strong></p> <p>The output is :</p> <ul> <li>Df (containing all letters)</li> <li>Data (containing all letters)</li> </ul> <p><strong>Step 2: Retrieve First letter of Name</strong></p> <pre><c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: mvnw confusing error message NoPluginFoundForPrefixException<p>Why does:</p> <pre><code>./mvnw -X versions:set -DnewVersion=${VERSION_TO_DEPLOY} </code></pr...
<p>With the help of some tracing (set -x in mvnw) it appears that mvnw uses the environment variable $MAVEN_CONFIG on our build server which happens to be used by other software as well for different purposes.</p> <p>Thanks to <a href="https://issues.jenkins-ci.org/browse/JENKINS-47890" rel="nofollow noreferrer">this ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MvcReportViewer - posting multiple parameters<p>I have an MVC project and I'm using the MvcReportViewer from <a href="https://github.com/ilich/MvcReportViewe...
<p>Basically you have to loop through all the values and add them one by one as keyvaluepairs.</p> <p>ex: </p> <pre><code>reportParams.Insert(reportParams.Count, new KeyValuePair&lt;string, object&gt;("myArrayOfLocations", "UK")); reportParams.Insert(reportParams.Count, new KeyValuePair&lt;string, object&gt;("myArra...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Best practice for Phalcon model relationship<p>Loving working with Phalcon, but have concerns about the best practice for model relationships. For example, i...
<p>For building more complex queries you probably want to check those <a href="http://docs.phalconphp.com/pl/latest/reference/phql.html#creating-queries-using-the-query-builder" rel="nofollow">query builder examples</a>. </p> <p>Essential (not tested) is:</p> <pre><code>$things = $this-&gt;modelsManager-&gt;createBui...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Chrome 80: Pause script execution (F8) does not work when DevTools is not focused<p>since Chrome 80 I cannot pause the script execution when the focus is on ...
<p>It's a bug in Chrome, I found the bugreport here:</p> <p><a href="https://bugs.chromium.org/p/chromium/issues/detail?id=1049910&amp;q=f8&amp;can=2" rel="nofollow noreferrer">https://bugs.chromium.org/p/chromium/issues/detail?id=1049910&amp;q=f8&amp;can=2</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Angular resolve when using ui-router<p>I am sure this is a configuration error, but not sure how to get round it correctly with angular.</p> <p>I have my st...
<p>We also had infinite loops when there were errors in resolves, so we ended up having more logic in the $stateChangeError event handler. Since we have this, we had no more troubles with loops.</p> <p>See how we check where we were trying to go to and if we failed while going to a home state, we do not try again and ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Search with Sphinx<p>I have 2 tables:</p> <pre><code>book ( id, name, category_id ); category ( id, name ); </code></pre> <p>Can I use <code>sql_j...
<p>I add new index <code>books</code> with <code>category_id</code> and <code>name</code>. And for filtration categories by book names I search through <code>books</code> for category_id and then filter categories by ids...</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: setting static IP for wifi connection in QT<p>I am trying to create a QT based application that scan and connect WiFi networks. I am using <a href="http://do...
<p>No you can't. At least not with just Qt APIs. </p> <p>Please read <a href="http://doc.qt.io/qt-5/topics-network-connectivity.html" rel="nofollow noreferrer">this</a> and in particular <a href="http://doc.qt.io/qt-5/bearer-management.html" rel="nofollow noreferrer">this</a>. <code>QNetworkConfiguration</code> is jus...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Issue with navbar margin on hover their links<p>I have an issue with Bootstrap Navbar, I am trying to do the same navbar as Twitter, once you hover on the li...
<p>Instead of using border use box-shadow, it doesn't have this problem.</p> <p>For your a:hover in css use this instead</p> <pre><code> a:hover, a:focus { background: getColor(snow) !important; color: red; box-shadow: inset 0px -4px 0px 0px red;//this &lt;-- margin: 0px; transition: all 0.3s ease...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel controller action returns error 404<p>I'm getting a 404 error when trying to access a route linked to a controller action.</p> <p>I have the route d...
<p>Somehow I found the problem. </p> <p>For some reason, my apache server doesn't rewrite <em>mytestdomain.com/error/</em> * route. Probably is something related with the word error and the apache module mod_rewrite.</p> <p>Anyway, defining the route as follows solves the problem.</p> <pre><code>Route::controller('f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: XMLHttpRequest testing in Jest<p>I want to test AJAX methods (vanilla XHR) and I can't find the way to do it with <strong>Jest</strong> framework. I found <c...
<p>The jest api has changed a bit. This is what I use. It doesn't do anything but it's enough to render my components.</p> <pre><code>const xhrMockClass = () =&gt; ({ open : jest.fn(), send : jest.fn(), setRequestHeader: jest.fn() }) window.XMLHttpRequest = jest.fn().mockImplementation(xhr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android view.animate() just jumps to final position instead of animating<p>I have a basic test project to isolate this problem. its just a blank Activity, a ...
<p>Turns out I had animations disabled on my emulator. The reason this option exists is cuz animations sometimes cause problems for UI tests, which was the case for us. I disabled animations on my emulator a bout a year ago and totally forgot about it</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What could be causing this "Fatal Exception: CALayerInvalidGeometry CALayer bounds contains NaN: [nan nan; nan nan]" crash?<p>I have the following bit of cod...
<p>The reason for this is when users load in photos from their photo library, if there isn't enough memory to load the photo in, then <code>nil</code> will be returned for the <code>UIImage</code>. So my code above was trying to create an <code>UIImageView</code> with a <code>frame</code> based on the sized of a <code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RSpec controller testing with paperclip<p>So with rails 4.2.0 and the latest rspec I generated a basic test for my controller. I'm just stuck with how to tes...
<p>Try setting the Paperclip metadata attributes, instead of providing a real <code>:picture</code> attachment.</p> <pre><code>... picture_file_name: 'room-controller-valid.jpg', ... </code></pre> <p>If you are validating attachment content type or size, set those attributes as well:</p> <pre><code>... picture_file_...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Problems with position:fixed and responsive / adaptive Layout<p>First look at this website: <a href="http://irismediainfo2.lili.de/spip.php?article4924" rel=...
<p>All you need is a wrapper-div that centers the whole block and algin the toolbar after that, since your <code>#page</code> has a fixed width in every viewport.</p> <p>HTML:</p> <pre><code>&lt;div class="wrapper"&gt; &lt;div id="toolbar"&gt; content &lt;/div&gt; &lt;/div&gt; </code></pre> <p>CSS:</...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot Redirect to a page in React Redux with Sagas<p><strong>When I want to redirect</strong> to the '/welcome' page at the end of the 'submit()' function n...
<p>Use the <code>withRouter</code> HoC from React Router to provide <code>{ match, history, location }</code> to your component as follows;</p> <pre><code>import { withRouter } from "react-router"; ... export default withRouter(connect(mapStateToProps, mapDispatchToProps)(LoginPage)); </code></pre> <p>With <code>hi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why when setting active true the canvas object it's not setting active true also the childs?<pre><code>using System.Collections; using System.Collections.Gen...
<p>in short: because this is not what <a href="https://docs.unity3d.com/ScriptReference/GameObject.SetActive.html" rel="nofollow noreferrer"><code>SetActive</code></a> is used for .. <strong>it only applies to the object itself</strong>, not the children.</p> <hr> <p>You seem to deactivate each and every child in you...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Rails routing: What does only: [] do here?<p>I saw a piece of Rails code for routing like this:</p> <pre><code>namespace :my do resource :auth_states, onl...
<p><code>only: []</code> contains an array of whitelisted actions to be routed for the resource. For instance, if you specify</p> <pre><code>resource :auth_states, only: [:index] </code></pre> <p>then only the index action will be generated, therefore</p> <pre><code>GET /auth_states </code></pre> <p>will work, wher...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: textarea that can stretch outside of its parent?<p>I'm looking at a reddit.com subreddit post page and it looks like the textarea's on the submit page can st...
<p>That's effect of resize:both; </p> <p>Check this: <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/resize" rel="nofollow">https://developer.mozilla.org/en-US/docs/Web/CSS/resize</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Looking for an optimized Regex/other solution for mass string matching<p>A part of my current code involves (pseudo)randomly generating quite a few pairs of ...
<p>A few comments, in total too long for a comment...</p> <p>The regex that you're building in your current code is not actually correct. The character class <code>[**]</code> you create when you encounter a <code>*</code> in <code>strang</code> will only match a <code>*</code> in <code>set</code>, where you actually ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: GitHub how to give a user admin access based on repo's tags<p>Is it possible to give a specific user admin access to certain repositories in your organisatio...
<p>I'm unaware of a way to grant permissions by repository tags, but a <a href="https://help.github.com/en/github/setting-up-and-managing-organizations-and-teams/about-teams" rel="nofollow noreferrer">GitHub Team</a> would be a good option for this.</p> <p>Create a new GitHub Team, <a href="https://help.github.com/en/...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to copy constraints from one view to another?<p>Suppose I use Interface Builder to create UI in Storyboard with Auto Layout. Can I copy or mov...
<p>If you are using interface builder, some constraints will be automatic copied if you use the cmd-c or edit/copy: the ones that include the copying view hierarchy. Otherwise, no, you can't. Copy the whole view if you want to preserve the constraints.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I properly use Mocks when testing Camel routes?<p>I am trying to write a Camel test that checks to ensure a content based router is routing XML files ...
<p>The solution is to use <a href="http://camel.apache.org/maven/camel-2.15.0/camel-test/apidocs/org/apache/camel/test/junit4/CamelTestSupport.html#replaceRouteFromWith(java.lang.String,%20java.lang.String)" rel="noreferrer"><code>CamelTestSupport.replaceRouteFromWith</code></a>.</p> <p>This method is completely lacki...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is Lock in Python _thread module?<p>I read "Core Python Applications Programming", in which this code is written.</p> <pre class="lang-py prettyprint-o...
<p>Re (1), you can make as many locks as you require -- presumably they're needed to protect different shared mutable resources in a many-threads environment (personally, I think a programming environment with many threads sharing many mutable resources is where programmers go after passing if they've led really terrib...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: D3js Zoom With Manually Drawn Circle<p>I am working on a d3 scatter plot where an area of the chart will be circled (a Youden Plot). Based on available samp...
<p>I believe this will get you most of the way there. You need to update your <code>circle</code> attributes in the <code>zoomed</code> function along with the other elements:</p> <pre><code>function zoomed() { var new_xScale = d3.event.transform.rescaleX(xScale); var new_yScale = d3.event.transform.rescaleY(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Nuxt js - window or document is not defined<p>I have seen many questions related to this topic. But none of them solved my problem. </p> <p>I have a situati...
<p>There's nothing wrong with your code. It works as it should. Let me explain.</p> <p>Do you see that text in the console <code>Nuxt SSR</code>? It means that the output below is the result of <code>console.log</code> executed on the server side, not in your client. If you look in your console a little bit below this...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can a function "remember" it's result for its next use?<p>How can I make a function that remembers its returned result?</p> <p>For example:</p> <pre><c...
<p>I'm answering your title, which is "How can a function “remember” it's result for its next use?". Your title implies the general case, and I'm not interested in the particular function in your question body. </p> <p>First, I'd like to say kudos to Python for the <code>yield</code> keyword, unfortunately, in C there...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: c++\cli project dependent c++ dll not copied to c# output directory<p>I have c++ native dll, lib and headers file. After I reference lib from c++\cli project...
<p>Thus, I have found only two possible solutions:</p> <ul> <li>post-build event in wrapper library, that copies native dll to all c# projects that require it</li> <li>add native dll in c# projects directly and set build action to "Copy to output directory" (in accordance with the Lucas response)</li> </ul>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: TYPO3 tx_news entries within a date range<p>I am currently migrating tt_news to news. The old news system also has news-entries shown as events. Is it someho...
<p>The news extension has a TypoScript option to set a minimum date/time: <a href="https://docs.typo3.org/typo3cms/extensions/news/stable/AdministratorManual/Configuration/TypoScript/Index.html#timerestriction" rel="nofollow noreferrer">https://docs.typo3.org/typo3cms/extensions/news/stable/AdministratorManual/Configur...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Calculate Remaining Vacations Days for employees in MVC web application?<p>I am developing absent application "C# - MVC5" which will store the state of absen...
<p>After many tries I found the solution and it is worked: </p> <ol> <li><p>Since the year in my company start from 01/07 to 30/06, I write this code to get the start date and the end date which I will use in the query: </p> <pre><code> int month = DateTime.Now.Month; int year = DateTime.Now.Year; string...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: tab pane not clickable?<p>I want to make a tab pane not clickable, is a form, then i only want to go that pane if the first form is complete, but i couldn't ...
<p>You could make the other tabs disabled until the first one is complete.</p> <p>For example:</p> <p>Write a class to disable the tabs:</p> <pre><code>.disabled-tab { cursor: disabled; } </code></pre> <p>Then we want to write some jQuery to remove the class when the first tab is complete:</p> <pre><code>var fie...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Serialize into XML a list with multiple types without root element name<p>I'm trying to serialize my object below but I cannot serialize it without root name...
<p>Use the <code>XmlElement</code> attribute instead of <code>XmlArrayItem</code>, it will give you the output you want.</p> <pre><code>[XmlElement(typeof(Hub), ElementName = "Hub20")] [XmlElement(typeof(Switch), ElementName = "Switch")] [XmlElement(typeof(Device), ElementName = "Device")] public List&lt;AbstractNode&...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: CompletableFuture recoverWith equivalent? i.e. exceptionally but return CompletableFuture<U><p>I don't see an obvious way to handle an exception with an asyn...
<p>After a lot of frustration in trying to figure out the proper way of doing Scala's recoverWith in Java 8, I ended up just writing my own. I still don't know if this is the best approach, but I created something like:</p> <pre><code>public RecoveryChainAsync&lt;T&gt; recoverWith(Function&lt;Throwable, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Extending Node's EventEmitter in ES5<p>I'm learning JavaScript/Nodejs and I've decided to start with ES5 before looking at ES6. I'm looking at prototypical i...
<p>The issue with my code was with this and closures. See the updated readMessages below.</p> <p>But thanks to @Yarsolav who has probably pointed at a better solution.</p> <pre><code>var EventEmitter = require('events').EventEmitter; var MyEmitter = function() { EventEmitter.call(this); this.messages = [] } ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to launch a click event of a button?<p>I hope to launch a click event of the button btnAdd if the app is run for the first time.</p> <p>I have read <a h...
<p>Mmm. Easiest way I can think of is to make a preference. </p> <pre><code>private Button btnAdd; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.unlock_main); IniControls(); SharedPreferences sp = PreferenceManager.getD...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Xamarin Forms TemplateBinding to Command In BasePage<p>I have a BasePage created using ControlTemplates that contains a loading overlay for each child to use...
<p>Problem solved. Thanks to Mikolaj Kieres for the answer, it was a simple case of initialising the Command earlier so I moved it up above the InitializeComponent and that kicked it into life. Thanks! </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I center multiline text in a label<p>Has anyone figured out how to center (or justify or in any way horizontally effect) text in a Xamarin Forms Label...
<p>You should use HorizontalTextAlignment="Center" in this case.</p> <pre><code>&lt;StackLayout&gt; &lt;Label Margin="75,0,75,0" FontAttributes="Italic" FontSize="Large" HorizontalOptions="Center" HorizontalTextAlignment="Center" LineBreakMode="WordWrap" Text...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The state doesn't update as it should<p>A simple inputfield to update the state.</p> <p>If you input 5 and click 'Pledge', the 'before' log show 0, but the ...
<p>The setState() function runs asynchronously so if you want to see the updated state after setState() has finished running you can pass a callback function to setState as follows</p> <pre><code>getAmount = amount =&gt; { console.log('before', this.state.amountFunded) const parsedAmount = parseInt(amount) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fail without logging passwords in plain text<p>So we have code that looks something like this:</p> <pre><code>template my_template do #stuff varia...
<p>Use the new <code>sensitive</code> attribute. From the <a href="https://docs.chef.io/resource_common.html" rel="nofollow">docs:</a></p> <pre><code>sensitive - Use to ensure that sensitive resource data is not logged by the chef-client. Default value: false. This setting only applies to the execute, file and templa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pod is in pending stage ( Error : FailedScheduling : nodes didn't match node selector )<p>I have a problem with one of the pods. It says that it is in a pend...
<p>Solution : You can do one of the two things to allow scheduler to fullfil your pod creation request.</p> <ol> <li><p>you can choose to remove these lines from your pod yaml and start your pod creation again from scratch (if you need a selector for a reason go for approach as on next step 2)</p> <pre><code>nodeSelec...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to manually acknowledge message from ActiveMQ using Spring JmsListener<p>I am using ActiveMQ (with JMS) with Spring's JmsListener. I am able to consume m...
<p>You should use the <code>setSessionAcknowledgeMode</code> method on your <code>org.springframework.jms.config.DefaultJmsListenerContainerFactory</code> instance to set <a href="https://docs.oracle.com/javaee/7/api/javax/jms/Session.html?#CLIENT_ACKNOWLEDGE" rel="nofollow noreferrer"><code>CLIENT_ACKNOWLEDGE</code><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SED commandd to check DATE is palindromic<p>I have file with dates in format MM/D/YYYY, called dates.txt</p> <pre><code>02/02/2020 08/25/1998 03/02/2030 12/...
<p>You may delete any line that does not match the <code>d1d2/M1M2/M2M1d2d1</code> pattern. To check that, match and capture each day and month digits <em>separately</em>:</p> <pre><code>sed -E '/^([0-9])([0-9])\/([0-9])([0-9])\/\4\3\2\1$/!d' file &gt; outfile </code></pre> <p>Or, with GNU <code>sed</code>:</p> <pre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to pass variables "$tid, $id" into raw function?<p>when i call <code>$id</code> and <code>$tid</code> in raw function to fetch some data from sub documen...
<p>It will work great with bulk addition, this way you just need to create on array and pass it.</p> <pre><code>$temp = [ [ 'item' =&gt; "envelopes" ], [ 'item' =&gt; "envelopesas" ], [ 'item' =&gt; "lala" ] ]; $userData = DB::table('log') - &gt; raw(function ($collection) use($temp...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using SUM in a query to retrieve non negative values<p>I am trying to use the Yii framework to perform a SUM() in a query and return the data in the 'Yii' wa...
<p>Filtering negative values using the sign function:</p> <pre><code> SELECT user_id, points, SUM(GREATEST(SIGN(points),0) * points) AS current_points FROM `codes` WHERE classroom_id = 219 GROUP BY user_id; </code></pre> <p>Alternative:</p> <pre><code>SUM ( CASE WHEN points &gt; 0 THEN points ELSE 0 END ) </...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to install lua-zlib with LuaRocks on Windows?<p>I've written a program with Lua, in a Linux environment, and it uses the Lua module <code>ZipWriter</code...
<p>It should work using a static zlib instead. To do so, you can follow this <a href="https://github.com/brimworks/lua-zlib/issues/42" rel="nofollow noreferrer">guide</a> on Github. Basically, you need</p> <ol> <li><p>Functional zlib library installed<br> Download from <a href="https://zlib.net" rel="nofollow noreferr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Messaging: The notification permission was not granted and blocked instead<p>Firebase messaging error in https server.</p> <p><code>An error occurred while ...
<p>This indicates that you have blocked the push notifications permission on the deployed website. It's <code>messaging.getToken()</code> that is likely erroring out (<a href="https://firebase.google.com/docs/cloud-messaging/js/client#retrieve-the-current-registration-token" rel="noreferrer">see the docs for more</a>)....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get the output SQL from a Liquibase changeset<p>I'm having a SQL syntax error when my Spring Boot application tries to start. It cannot instantiate the Sprin...
<p>You can try <code>liquibase updateSQL</code> command</p> <ul> <li><a href="http://www.liquibase.org/documentation/command_line.html" rel="noreferrer">http://www.liquibase.org/documentation/command_line.html</a></li> <li><a href="http://www.liquibase.org/documentation/update.html" rel="noreferrer">http://www.liquiba...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Javascript Replacement With Object Destructuring<p>I have a variable like below:</p> <pre><code>var temp = 'Hello world {variable1}. It is just a {variable2...
<p>You could take a function for replacement and hand over the key for getting the value.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code>var temp = 'Hello world {variable1}. ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ios swift parse: Saving to keychain and print out data from keychain and do a login<p>I implemented this code <a href="https://github.com/exchangegroup/keych...
<p>Add this <code>!</code> in your code like this:</p> <pre><code>let currentNickname = TegKeychain.get(KeyChainNickname)! self.helloUserLabel.text = "Welcome \(currentNickname)" </code></pre> <p>But you can use this <code>!</code> if you are sure that currentNickname will defiantly get a value.</p> <p>And your outp...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why would one use ELMAH if the application is using NLog<p>I have to write a centralized logging framework. </p> <p>Basic requirements are:</p> <ul> <li>Lo...
<p>Elmah is used for handling uncaught exceptions, and is generally a "last line of defense" to be able to identify when things go completely belly up. You can read what it provides on its github page: <a href="http://code.google.com/p/elmah/" rel="noreferrer">http://code.google.com/p/elmah/</a></p> <p>NLog and othe...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: $(this) not working in custom function inside .each<p>I'm trying to use $(this) inside a function, inside a .each loop but it's not selecting the correct ele...
<p>Always play safe...</p> <pre><code>$('.pixel-looper').each(function() { var self = this; function fxNoneNext() { $(self).css('background', 'red'); } $(self).find('a').bind('click', function() { fxNoneNext(); return false }); }); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Which FileStream constructor is identical to CreateFile()?<p>I want to use a <a href="https://msdn.microsoft.com/en-us/library/system.io.filestream%28v=vs.11...
<blockquote> <p>I just want to know which constructor allows me to set all of the parameters supported by the underlying CreateFile().</p> </blockquote> <p>None of them do that. For instance:</p> <ul> <li><code>FileStream</code> doesn't support the full range of devices that <code>CreateFile</code> does.</li> <li>N...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Please explain Meteor's Iron Router DATA and Subscribe/publish rendering<p>I am frustrated with the lack of documentation around Iron Router and Collections/...
<p>On this piece of code.</p> <pre><code>waitOn: function(){ return Meteor.subscribe( "getProject", this.params._id ); } </code></pre> <p>Like the name say you are waiting to the client, get the "data ready" Aka the subscription.</p> <p>And about the <code>data:function()</code> field on others word "template ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Flutter Audio with Circle Progress<p>I need to create a screen that plays back mp4 audio files, with play, pause, stop controls and shows progress via a circ...
<p>I made a clone of the Circular Progress Indicator using the documentation described by pskink in the comments <a href="https://github.com/flutter/flutter/blob/0b8abb4724/packages/flutter/lib/src/material/progress_indicator.dart#L411" rel="nofollow noreferrer">enter link description here</a> . Many thanks and gratitu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: nested lists / unnest_wider: losing digits after comma?<p>I am downloading a json file which contains coordinates (mercator format) in a list format. When I ...
<p>This is more of a display issue which could be solved using <code>options</code></p> <pre><code>library(dplyr) library(tidyr) options(digits = 12) #Or any higher number df$geometry.coordinates[[1]] #[1] 1816122.40 6131865.58 </code></pre> <p>and for display of tibbles, use</p> <pre><code>options(pillar.sigfig =...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R Shiny – Make wellPanel pop-up follow as you scroll with CSS<p><strong>PROBLEM:</strong> R Shiny – Make wellPanel pop-up follow as you scroll with CSS</p> ...
<p>Use this JavaScript code:</p> <pre><code>js &lt;- " $(document).ready(function(){ var tbl = document.getElementById('my_table'); $('#my_panel').css('top', tbl.getBoundingClientRect().top); $(window).scroll(function() { var tbltop = tbl.getBoundingClientRect().top; var x = tbltop &lt; 0 ? 0 : tbltop; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to assign some one function to several events?<p>Maybe it is dumb question, but how can I do something like this in JavaScript:</p> <pre><code>document....
<p>Like this:</p> <pre><code>function typeText() { ... } document.onload = typeText; window.onscroll = typeText; </code></pre> <p>If you'd also like to pass in parameters, I'd recommend looking at the <code>.bind()</code> method <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Object...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add class to Django PasswordInput field in forms.py? (Can add the class toTextInput fields with no problem)<p>I am building a user sign up form and am trying...
<p>I don't see a problem in your code but I cannot test it right now.<br> You could try adding the widget like this to see if it works:</p> <pre><code>class SignUpForm(UserCreationForm): class Meta: model = User fields = ('username', 'first_name', 'last_name', 'email', 'password1', 'password2',) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel migrate failing on "renameColumn" when running<p>I have about 30+ migration files. </p> <p>When it gets to a migration which contains a column renam...
<p>It seems to be solved in v2.7 <a href="https://github.com/doctrine/dbal/pull/3089" rel="nofollow noreferrer">[bug] Don't skip column options. #3089</a>.</p> <p><a href="https://github.com/doctrine/dbal/issues/3091" rel="nofollow noreferrer">2.7 breaks renaming columns in mysql 5.7 #3091</a></p> <p>Upgrade the pack...
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 find the first element to match a Predicate?<p>With Java 8+, you can easily find all elements of a collection that match a <a href="http://...
<p>It does exactly what you want. It doesn't run over all the elements. The <code>filter</code> method creates a stream and on top of it <code>findFirst</code> creates another stream.</p> <p>So when you try to get the element of the stream that was created after <code>findFirst()</code> you'll get only the first one t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert calendar date to ldap date<p>Currently I have tried this code, but the problem is the first line of code gives this output 20150217172651+0100...
<p>Ran your code </p> <pre><code>public class poc { public static void main(String[] args) { GeneralizedTime gt = new GeneralizedTime(Calendar.getInstance()); String gtADString = gt.toGeneralizedTime( GeneralizedTime.Format.YEAR_MONTH_DAY_HOUR_MIN_SEC, GeneralizedTim...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Many DLLs in System namespace are included when installing library via Nuget<p>I'm writing a C# library targeting .NET Standard 2.0 and .NET Framework 4.6</p...
<p>This is expected. Those additional files are required at runtime to make sure your .NET Standard 1.* libraries run on .NET Framework 4.6 and higher.</p> <p>You can read more about this <a href="https://github.com/Microsoft/dotnet/blob/master/releases/net471/KnownIssues/514195-Targeting%20.NET%20Framework%204.7.1%20...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Accessing Sizzle methods via jQuery<p>In the jQuery source it clearly says <code>jQuery.find = Sizzle;</code></p> <p>but when i try to access a particular S...
<p>AFAIK you can use $.find.tokenize - see issue <a href="https://github.com/jquery/sizzle/issues/242" rel="nofollow">https://github.com/jquery/sizzle/issues/242</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Module 'Alamofire' has no member named 'request'<p>I'm new to iOS Development, I installed Alamofire as said in README, but I have this error as other users ...
<p><em>Alamofire.xcodeproj -> Build Phases -> Complie Sources</em></p> <p>If <em>(0 item)</em>, then "<strong>[+]</strong> <em>Alamofire.swift</em>".</p> <p>It's OK :)</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set proper chracter encoding for GNU/Linux<p>I am creating text file in Linux server system, to upload the data to some other system. I am reading the...
<p>Your default charset is Latin-1 (aka. ISO 8859-1). This charset does not seem to contain the character <code>™</code>. Chances are your JVM runs with this default because your system is configured to use Latin-1. You make sure that both your system and your JVM use UTF-8.</p> <p>See <a href="https://stackoverflow.c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I want to set a Qt QML Combobox to a PyQt5 object property<p>I am writing a small program which uses Qt5 QML as the GUI layer and Python3-PyQt5 to implement ...
<p>Here is my solution which works good enough for me. In the python code I have the following:</p> <pre><code>class CarManufacturers(enum.Enum): BMW, Mercedes = range(2) mfcChanged = pyqtSignal() @pyqtProperty('QStringList', constant=True) def carmanufacturers(self): return [mfc.name for mfc in CarManufactu...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What's is the equivalent of to jQuery .one() in AngularJS?<p>How can you created an event emitter that is only triggered once and self-destructs after that. ...
<p>You actually have one() available to you in AngularJS via the jqLite library. jsLite is an abridged version of jQuery that is the minimum needed to power Angular. </p> <p><a href="https://docs.angularjs.org/api/ng/function/angular.element" rel="nofollow">https://docs.angularjs.org/api/ng/function/angular.element</a...