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: Dart editor “source not available” in linux?<p>When I try to debug a dart application on Linux Mint 17 using Dart Editor 1.8.5.release (STABLE) with Dart SDK...
<p>Unfortunately, you cannot solve this problem. At least without the choosing the other version of the Dart Editor to use.<br> This is a bug and other people also have the same problem.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Form Fields Not Fitting Bootstrap Modal<p>I am trying to implement a bootstrap modal form in my Django project. When I do this, everything works except the ...
<p>Try placing each crispy form field inside a Bootstrap <code>form-group</code> <code>&lt;div&gt;</code> container. Like this:</p> <pre><code>&lt;div class="modal-body"&gt; &lt;div class="form-group"&gt; {{form.Reference_Number|as_crispy_field}} &lt;/div&gt; &lt;div class="form-group"&gt; {{form.Ultimat...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spool request not linked to background job<p>I have a program that outputs some logs to the spool log via <code>WRITE</code> statements. When I run the progr...
<p>This behaviour seems to occur because the output list in the spool is not linked to the job until the program finishes processing, which triggers an implicit COMMIT operation. If you run a ROLLBACK without first having done a COMMIT, the pending save of the relationship between job and spool is apparently lost.</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: String with number on each line to list of floats<p>I am building a Python code that should read a text file using <code>askopenfile</code> in <code>tkinter<...
<p>To parse the string x</p> <pre><code>x = '300.0 \n300.0 \n250.0 \n250.0\n250.0\n250.0 \n270.61032473 \n289.91197172 \n290.23398559 \n275.90792547\n263.86956625 \n264.8385967' </code></pre> <p>into a list of numbers, you could do:</p> <pre><code>x_as_list_of_numbers = [float(xx.strip()) for xx in x.split('\n')] </...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Swift language. How to initialise my class by variable of superclass?<p>I have class inherited from UIButton</p> <pre><code>public class MyButton: UIButton ...
<p>You can't mimic this exact pattern in Swift, because of this line:</p> <pre><code>self = [button copy]; </code></pre> <p>Swift won't allow you to assign to <code>self</code>. If you want to keep using this pattern, you'll have to copy over the attributes you want individually.</p> <p>Also, in Objective-C, you're ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can't resolve undeclared identifier C++<p>I am trying to call the Size() function of base class Array. The error from Clang is "use of undeclared identifier ...
<p>You need to use <code>this-&gt;Size()</code>, this is a bit awkward, but that's how C++ works. When you derive from a template class, the compiler doesn't look at the members of the template base at declaration point (basically, at declaration, the base part is un-instantiated, and it is a bit painful for the compil...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a variable describing that a PR is being run from a fork?<p>The code/PRs in question are coming from github. Currently I have our pipeline set up (v...
<p><code>SYSTEM_PULLREQUEST_ISFORK</code> is available. Can use it like:</p> <p><code>and(succeeded(), ne(variables['SYSTEM.PULLREQUEST.ISFORK'], 'true'))</code></p> <p>Here is a one liner to get all the environment variables for future reference:</p> <pre><code>- task: PowerShell@2 inputs: targetType: 'inline...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does it mean that something is vary from machine to machine?<p>Sometimes when reading books, Like The C Programming Language, The author talk about that...
<p>There are hundreds of different CPU architecture with different instructions, register numbers and length etc.</p> <p>With regards to C, it is machine dependent how for example an <code>int</code> is represented. Most architecture treat it as 32 bit integer, but others may as 64 bit, so there are machine dependent ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Definitive if check<p>Consider this kind of if-statment in a function:</p> <pre><code>int Foo( void ) { if ( HostCPUInfo::IsSSE3Supported() ) //...
<p>You could use a function pointer that is initialized to a function that performs the test. This way, you don't have to call a special initialization function before using <code>foo()</code>:</p> <pre><code>int foo_init (void); int foo1 (void); int foo2 (void); int (*Foo) (void) = foo_init; int foo_init (void) { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Combine two files on linux based on the same column in Linux file<p>I want to combine 2 files into one file based on the same column on Linux.</p> <p>File1....
<p>Could you please try following.</p> <pre><code>awk 'FNR==NR{a[$1]=$2;next} a[$1]{print $0,a[$1]}' file2 file1 </code></pre> <p><strong><em>Explanation:</em></strong> Adding detailed explanation for above code here.</p> <pre><code>awk ' ##Starting awk program from here. FNR==NR{ ##Checking c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Google Drive API v3, is there anyway to list of files and folders from a root folder?<p>Looking at the V3 api, <code>files.list</code> is able to list folder...
<ul> <li>You want to retrieve files and folders in the root folder using the search query.</li> </ul> <p>If my understanding is correct, how about this answer?</p> <h3>Pattern 1:</h3> <p>You want to retrieve the folders in the root folder, you can use the following query.</p> <pre><code>mimeType = 'application/vnd....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to make react bootstrap tooltip to fit into container?<p>I am making a simple react app for which I am using react-bootstrap. Here I am trying to display...
<p>You can simply use the <code>word-break</code> css property, and supply it with the 'break-all' value, such that it will be broken into different lines if the text is too long.</p> <pre><code>&lt;Tooltip id="tooltip" style={{ width: "100%", wordBreak:'break-all' }}&gt; thisisalongstringthanusualhencenotfilledinco...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to check whether the file name contains some strings values in entire file name<blockquote> <p>I have a File names of around 37k and have 8k of string ...
<p>A quick solution could be:</p> <pre><code>var results = files.Any(r =&gt; r.IndexOf(res) &gt;= 0); </code></pre> <p>That's because <code>Contains</code> search for matching string, not just part of it.<br> Algorithm could be optimized and something else could be tried, but this is just a wuick fix.</p> <hr> <p><...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Picasso Main Errored<p>I am trying to use Picasso Android library but i'm not able to get it working.</p> <p>For starting, i am trying the simplest of the t...
<p>To download images from the internet, you will need the INTERNET permission in your manifest.</p> <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to push controller after dismiss presented controller in swift?<p>Hey I am showing a controller (A) in main controller with presentation style (not push)...
<p>First you need to make this segueDelegate weak</p> <pre><code>protocol segueFromController : class { func segueFromController() } weak var segueDelegate: segueFromController? func openController() { let preController = AController() preController.segueDelegate = self preController.moda...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to call a javascript function inside ajax success?<p>I want to activate the update button once the validate button is clicked and also when the data valu...
<p>Why you use a function syntax inside your code?! Just change your code to this</p> <pre><code>$(document).ready(function () { activateupdate(); }) $(document).on('click','.validatebtn', function(){ let ValidId = $('#span_id').text(); let ValidDesc = $('#Desc').val(); let causeObj = new Object(); c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Best way to put 20 elements in a coordinate system with neighbouring elements unique<p>This question is regarding libGDX, but I think it's in fact more Java/...
<p>Ok, I think I understood your solution and this is what I thought of initially. But I think it can be slightly optimized by eliminating extra pairs and maps (or maybe not :)</p> <p>First, create a map of locations where key is location position (or the location itself) and value is a list of location's parents who ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Selenium test with PhantomJSDriver is hanging and not finishing<p>First, I start the local webapp.</p> <p>Next, when I run the following test in Eclipse as ...
<p>Solved, just </p> <p>1) change the dependency (<a href="https://twitter.com/jselenide/status/540612294255050752" rel="nofollow">reference</a>):</p> <pre><code> &lt;dependency&gt; &lt;groupId&gt;com.codeborne&lt;/groupId&gt; &lt;artifactId&gt;phantomjsdriver&lt;/artifactId&gt; &lt;version...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Finding sentences contained in other sentences<p>Given two lists of sentences, how do I find the sentence pairs, where all the words from one sentence are co...
<p>Here's an approach using a dictionary of hashsets for preprocessing <code>list2</code> - this overall is O(n*m), n = number of words in list 1, m= number of sentences in list 2 (excluding the preprocessing):</p> <pre><code>var list1 = new List&lt;string&gt;() { "free bar", "hello world", "foo" }; var list2 = new Li...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fatal signal 11 (SIGSEGV), code 128, fault addr 0x0 in tid 12680 when using Gson.fromJson<p>My app crashed without any stacktrace besides having this error:<...
<p>The root cause of this is the bitmap in the <code>VideoDetails</code> data class. Apparently, Gson can't handle bitmaps. Instead of removing the bitmap, I decided to create a custom <a href="https://www.javadoc.io/doc/com.google.code.gson/gson/2.8.0/com/google/gson/TypeAdapter.html" rel="nofollow noreferrer"><code>T...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Go: How to loop through files and compare ModTime to a date?<p>I'm trying to loop through files in a directory and compare their ModTime against a certain da...
<p>The return from <code>ioutil.ReadDir</code> is <code>([]os.FileInfo, error)</code>. You would simply iterate the <code>[]os.FileInfo</code> slice and inspect the <code>ModTime()</code> of each. <code>ModTime()</code> returns a <code>time.Time</code> so you can compare in any way you see fit.</p> <pre><code>packag...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Convert dataframe to dictionary ignoring certain values<p>I need help in converting dataframe into dictionary like below where id is the main key and value o...
<p>I assume your expected output is a dict of dicts, you can use</p> <pre><code>df.set_index('id').agg(lambda x: x[x != 0].to_dict(), axis=1).to_dict() </code></pre> <p></p> <pre><code>{1: {'score2': 0.1087, 'score4': 0.0786, 'score5': 1.0}, 2: {'score1': 0.0532, 'score2': 0.3083, 'score3': 0.2864, 'score4': ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to bind to a property of a UserControl in WPF?<p>I'm trying to bind to a property of a user control, but it doesn't seem to work.</p> <pre><code>&lt;Con...
<p>You are not supposed to do anything except then <code>SetValue</code> in the CLR wrapper of a dependency property, as the wrapper may be bypassed by WPF. See the <a href="https://msdn.microsoft.com/en-us/library/bb613563.aspx" rel="nofollow">XAML Loading and Dependency Properties</a> article on MSDN for details.</p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Update UICollectionViewCells sizes when UICollectionView frame is updated<p>How can I update all the cell sizes of <code>UICollectionView</code>? I am chang...
<p>I'm not sure what actually the problem is, but here is steps, that can help you to achieve what you want:</p> <ol> <li><p>Define your collection view layout delegate (I assume that you use flow layout or its descendant)</p></li> <li><p>Implement <code>- collectionView:layout:sizeForItemAtIndexPath:</code> (see <a h...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Im using vim to check man page, and there is some weird character,how to make it normal?<p>I'm trying using </p> <pre><code>man ascii | vi - </code></pre> ...
<p>What you're seeing here is the man page convention for typesetting bold and underlined characters.</p> <p>The <code>^H</code> character is the "backspace" or BS character, which you can find in <a href="http://man7.org/linux/man-pages/man7/ascii.7.html" rel="noreferrer">ascii(7)</a> as ASCII 8.</p> <p>Displaying a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: awk split string on commas ignore if inside double quotes<p>I know it may sounds that there are 2000 answer to this question online but I found none for this...
<p>gnu awk has a function called <code>patsplit</code> that lets you do a split using an <code>FPAT</code> pattern:</p> <pre><code>$ awk '{ print "RECORD " NR ":"; n=patsplit($0, a, "([^,]*)|(\"[^\"]+\")"); for (i=1;i&lt;=n;++i) {print i, "|" a[i] "|"}}' file RECORD 1: 1 |Hi| 2 |I| 3 |"am,your"| 4 |father| RECORD 2: 1...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I give attributes to an element on XMLWriter?<p>Can't find a way to get the result I need to replicate in "Documento", I tried to use </p> <pre><cod...
<p>Try something along these lines:</p> <pre><code>$xml-&gt;startElement('Documento'); $xml-&gt;startAttribute('ID'); $xml-&gt;text('T33F50363'); $xml-&gt;endAttribute(); .... $xml-&gt;endElement(); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: value to be passed to the fileName of appengine/file.Delete () is?<p>I want to know is fileName to pass when you delete a file of gcs from gae/go.</p> <p>Al...
<p>I'm not an expert on Go but to work with Cloud Storage you need the Google Cloud Storage Go Client Library as indicated here [1].</p> <p>Take a look at this sample code [2], more specifically to the deleteFiles() fuction. You can see that the function to the delete files is DeleteObject [3].</p> <p>[1] <a href="ht...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How does vkEnumeratePhysicalDevices retrieve information about the system configuration?<p>I recently installed a new Nvidia proprietary driver on linux, eve...
<p>The ICD discovery on Linux works per this document: <a href="https://github.com/KhronosGroup/Vulkan-Loader/blob/master/loader/LoaderAndLayerInterface.md#icd-discovery-on-linux" rel="nofollow noreferrer">https://github.com/KhronosGroup/Vulkan-Loader/blob/master/loader/LoaderAndLayerInterface.md#icd-discovery-on-linux...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PHP path string turns into '\/'<p>I have a mySqli table with image paths such as:</p> <pre><code>assets/images/profile_pics/00fa5fa61df8a9e22e3444c </code><...
<p>If you need to encode that array into JSON, but don't want the slashes, you should pass <code>JSON_UNESCAPED_SLASHES</code> flag as a second parameter to <code>json_encode</code>: </p> <pre><code>echo json_encode($arr, JSON_UNESCAPED_SLASHES); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Spring REST ambigious method<p>I need a spring rest controller for inserting data. This is what i already got:</p> <pre><code>@RestController @Transactional...
<p>If you want to map more than one request to a given path, you will have to use different HTTP methods; eg. POST, PUT.</p> <p>In your situation, I would make the URLs different; i.e. one /mycontext/as-entity and /mycontext/as-list.</p> <p>Or you MUST have the same URL - it must be able to handle all kinds of reques...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Sql Azure storage key info<p>I need to build the secondary key to access storage table The questions are:</p> <ol> <li>Is there a limit of lengths for the s...
<p>Assuming you're talking about Azure Storage Service Key (for Blobs, Tables and Queues) and not SQL Database (formerly known as SQL Azure), to answer your questions:</p> <ul> <li>Primary and secondary keys are created by Azure for you. You can't specify these keys. When you create a storage account, these keys are a...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is this a type mismatch<p>I'm new to AppleScript and having trouble understanding something. Why doesn't the function valid_hex return true for these items? ...
<p>The problem is in the line </p> <pre><code>repeat with c in (text items of s) </code></pre> <p>At this moment <code>text item delimiters</code> is set to <code>tab</code> so there is only one text item which is always the entire string.</p> <p>To get each character replace it with </p> <pre><code>repeat with c i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: window.open lnk not getting rendered<p>I have used following javascript function on button click:</p> <pre><code>function searchItems() { alert...
<p>It seems to be a problem with concatination. You could make "&lt;%#VMPath %>" a part of the string from the beginning:</p> <pre><code>window.open('&lt;%#VMPath %&gt;/SearchItems.aspx?Value=' + $("#ctl00_txtSearch").val(), '_self'); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: JQuery, ajax and js OOP<p>I have the following code:</p> <pre><code>var Foo = function(){ this._temp="uh"; }; Foo.prototype._handler=function(data, tex...
<pre><code>$.ajax({ url: '....', success: this._handler.bind(this) }); </code></pre> <p>You need to bind the context of the function.</p> <p>If you using the debugger (available in the web browser), you will see that <code>this</code> was not referring to your object instance.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel Pivot - Getting same model through related model<p>I have a table setup like this with pivot relationship already set.</p> <pre><code>users ...
<p>You may need to eager load the users for each colony you're a part of:</p> <pre><code>$user-&gt;colonies()-&gt;with(['users' =&gt; function ($q) use ($user) { $q-&gt;whereKeyNot($user-&gt;id); }])-&gt;get(); </code></pre> <p>Then you'd loop over the colonies and can access all the users.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: sqlalchemy.exc.ProgrammingError for flask<p>I have a flask application with postgresql and I want to sort the users based on their bestfriend name. To explai...
<p>You forgot to add friend.name.label('fn') to the group by</p> <pre><code>join(friend, Users.is_bestfriend).group_by(Users.name).group_by('fn').subquery() </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Xamarin Forms label across entry border<p>How could I achieve rendering a label in a cutoff portion of a round-corner border around an Entry in Xamarin Forms...
<p>There are two ways to achieve this:</p> <ol> <li>(The simple way) Using the <a href="https://help.syncfusion.com/xamarin/text-input-layout/overview" rel="nofollow noreferrer">SfTextInputLayout</a> with <code>ConainerType</code> as <code>Outlined</code></li> </ol> <pre class="lang-cs prettyprint-override"><code>&lt;i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: OpenCV python Bayer conversion error<p>The following code:</p> <pre><code>filePath = os.path.join(root,file) image = cv2.imread(filePath) convertedImage = c...
<p>You forget to specify the type of the input image to be read. By default, cv2.imread will read image with flag cv2.IMREAD_COLOR (as indicated in <a href="http://docs.opencv.org/trunk/doc/py_tutorials/py_gui/py_image_display/py_image_display.html" rel="noreferrer">their documentation</a>). You can change your code to...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Yii Framework Undefined Variable model<p>I tried my best to solve this , but I can't seem to figure out where the problem is. Here is my code:</p> <p>views/...
<p>in your <strong>SupermarketsController.php:</strong> you have a mistake:</p> <p>you have rendered this</p> <pre><code> return $this-&gt;render('index', [ 'supermarkets' =&gt; $supermarkets, 'pagination' =&gt; $pagination, ]); </code></pre> <p>which doesn't have any model named variable,</p>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: force hasmany with same ids (or ids ember doesn't know about)<p>I want ember to list all foo's on <code>{{#each foo}}</code> even though the id's are the sam...
<blockquote> <p>Have you considered switching to a URL based model... – GJK</p> </blockquote> <p>This is exactly what I was after. I didn't notice the <a href="http://emberjs.com/api/data/classes/DS.RESTAdapter.html#method_findHasMany" rel="nofollow">findHasMany</a> method in my search. More info <a href="http://js...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Customizing sequelize-cli generated IDs<p>Created a model using:</p> <pre><code>sequelize-cli model:create --name User --attributes "dispName:string,email:s...
<ol> <li>Yes</li> <li>You should declare custom named PK in your model</li> <li>see p.2. If you don't declare PK in your model then sequelize assumes you have <strong>id</strong> PK with an integer type, autoincremented. If you wish to assign your PK another name you should declare it in the model.</li> <li>Depends on ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: 7zip CLI whitelist files to add by extension<p>If I'm running the 7z a -tzip myDestFile.zip some/dir command and I want to add to it a file extension whiteli...
<p>This Question shouldn't remain open. The answer that worked for me is below:</p> <p><code>7za a -tzip test.zip ./*.txt ./*.xlsx</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How I customize each color in cmap with difference interval values in heatmap seaborn subplot Python 3.6.0?<p>I have a subplot with heatmap seaborn in Python...
<p>One approach is to create the list of colors with dark blue once, light blue 4 times and green 3 times. And to set <code>vmin=0</code>, <code>vmax=8</code> to have all values clamped to that desired range.</p> <p>The code below does just that. The values are added as text to easily check what's happening.</p> <pre...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: parsing url using php<p>I am having problem parsing this url using php language. I don't know if it is JSON or a normal API. I need to get "ask" and "bid" fr...
<pre><code>$json = file_get_contents('http://www.fxgrow.com/quotes/quotes.php'); $data = json_decode($json); foreach ($data as $key =&gt; $value) { echo $key . ": ask = " .$value-&gt;ask ." | bid =".$value-&gt;bid . " &lt;br /&gt;"; } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android : Error inflating class fragment<p>XML layout file</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" ...
<p>Given that you have used 'support fragment' you need to replace <code>MapFragment</code> with <code>SupportMapFragment</code>. Doing this should fix it.</p> <p>Use:</p> <pre><code>class="com.google.android.gms.maps.SupportMapFragment" </code></pre> <p>instead of :</p> <pre><code>android:name="com.google.android....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can to generate error for testing exception in unit test?<p>I have same code:</p> <pre><code>def foo(self): x = self.a + self.b try: res = self....
<p>If <code>object</code> is an instance of your class such that object.b = 0 then you can do this </p> <pre><code> import pytest from unittest.mock import MagicMock object.foo_2 = MagicMock() with pytest.raises(ZeroDivisionError): object.foo() object.foo_2.assert_called_once() </code></pre> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to fill a div with text except for the last three characters<p>Basically, I want to fill a div with some descriptive text that might be shorter or longer...
<p>You can use the <code>text-overflow: ellipsis</code> property of css to handle the overflowed text.</p> <p>Here is the Fiddle: <a href="http://jsfiddle.net/fy1qa6o8/" rel="nofollow">http://jsfiddle.net/fy1qa6o8/</a> <br><br><br> <strong>Alternate Answer:</strong></p> <p>Here is a css solution to the multiline text...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Access Response Headers from spotify-web-api-node call<p>Using the <a href="https://github.com/thelinmichael/spotify-web-api-node" rel="nofollow">spotify-web...
<p>It's not possible to access the header using the wrapper methods at this point in time, but I've added an <a href="https://github.com/thelinmichael/spotify-web-api-node/issues/24" rel="nofollow">enhancement issue on Github</a> and will have a look at it shortly.</p> <p>Update: The headers are now available from ver...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Brightness, saturation and contrast with ColorMatrix in Swift<p>I'm trying to re-write my Android app in Swift to launch for iOS and I've reached a wall...</...
<p>The colorMatrix property is <code>nil</code> because you never initialized it properly.</p> <p>Delete <code>dynamic var colorMatrix: CIFilter?</code> from your controller and use the code below.</p> <pre><code>class editionViewController: UIViewController { @IBOutlet weak var editionImageView: UIImageView! ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AngularJS redirect to view after data save<p>After saving data from the employee-maintenance view, I am trying to redirect to the employee-details view. I wa...
<p>I figured it out. It appears in order to use $location.path, you have to add $locationProvider to your app module config:</p> <pre><code>var app = angular.module('myApp', ['ngRoute']); app.config(function ($routeProvider, $locationProvider) { $routeProvider .when('/', { controller: 'HomeController'...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to mutate NA on multiple rows (rowwise) in tibble<p>I spend sometime try to figure out how to mutate <code>NA</code> values on multiple rows on row persp...
<p>A slightly inefficient way would be to <code>gather</code> and <code>group_by</code> it:</p> <pre class="lang-r prettyprint-override"><code>sample_tibble %&gt;% tidyr::gather(k, v, -ID) %&gt;% group_by(ID) %&gt;% mutate(v = if_else(is.na(v), mean(v, na.rm = TRUE), v)) %&gt;% ungroup() %&gt;% tidyr::spread...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Composer could not find the config file: C:\Users\Username\AppData\Roaming\Composer\vendor\bin<p>I cannot seem to install Laravel using the following command...
<p>I managed to fix this problem. I had to delete the <code>composer</code>environment variable. Which can be found here: <code>Control Panel&gt;System&gt;Edit the system environment variables&gt;Environment variables&gt;composer&gt;delete</code></p> <p>After I deleted this I could run the command I wanted with out an...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set class to input when data returned from api. Vue<p>I have inputs with labels that rise when input has data, like materialize ( <a href="https://mat...
<p>Use <a href="https://v2.vuejs.org/v2/guide/forms.html" rel="nofollow noreferrer">v-model</a> for 2 way bind and use it for altering class(it will ignore the <code>:value</code> property).</p> <pre><code>&lt;input type=&quot;text&quot; v-model=&quot;nameValue&quot; :class=&quot;{'with-data' : nameValue !== ''}&quot; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove leading '0's from all strings in a list<h2>My code</h2> <pre><code>l=['99','08','096'] for i in l: if i.startswith('0'): i.replace('0',''...
<p>You can use <a href="https://docs.python.org/3/library/stdtypes.html#str.lstrip" rel="nofollow noreferrer"><code>str.lstrip()</code></a> for this in a list comprehension - to remove all leading <code>'0'</code>s from each string.</p> <pre><code>&gt;&gt;&gt; l = ['99', '08', '096'] &gt;&gt;&gt; [x.lstrip('0') for x ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Move a canvas image back and forth using setInterval<p>I'm trying to get an image in a canvas to move back and forth using setInterval. I've been struggling ...
<p>Your code is infinite-looping.</p> <p><a href="http://plnkr.co/edit/EVbcHWlFBtVkk34i0kT3?p=preview" rel="nofollow" title="&#40;Working plunkr&#41;">(Working plunkr)</a></p> <p>Everytime your Image loads, it runs the 'start' function; however, that function changes the image url, so it loads again, which runs the '...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: exception in tests after upgrading from django 1.5 to 1.7<p>this is the test that broke:</p> <pre><code>def test_registering_user_twice_cause_error_msg(self...
<blockquote> <p>So what's going on?</p> </blockquote> <p>As stated, <a href="https://stackoverflow.com/questions/21458387/transactionmanagementerror-you-cant-execute-queries-until-the-end-of-the-atom">this is a duplicate</a>.</p> <p>But I'll separately address the reason it breaks if you access <code>users</code>. ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to run app after moving it from Ubuntu to Windows 7?<p>I finished my app and I have to bring it for company to show them what it is and how it works. I d...
<p>Looks like you have't installed nodemon globally on the new OS.</p> <p>Try:</p> <pre><code>npm install -g nodemon </code></pre> <p>And see if that works</p> <p>Edit: You are now getting the error "react-scripts is not recognized as an internal or external command..." yada yada... You could install react-scripts,...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can be Selection or ActiveRange an optional parameter?<p>i've been trying to write down some code snippets in VBA for excel. I tried to make this:</p> <pre>...
<p>As you've noticed, you cannot default an optional parameter to a non-constant. However, if you change the parameter's variable type to <em>Variant</em> you can use the <code>IsMissing</code> function to determine if a values was passed to the sub and reassign it if not.</p> <pre><code>Sub Populate(Optional r As Var...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: cin >> integer and while loop<p>With below code,</p> <p>if I enter a letter or a really long number, the while loop will go haywire, why is that? </p> <pre...
<p>The problem is that <code>operator&gt;&gt;</code> is expecting to draw an integer off of the input stream, but there is something else sitting there (the non-integer that the user typed). This sets an error state on the input stream. In this state, the <code>cin &gt;&gt; ...</code> construct no longer blocks for i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: .NET Websphere MQ to create a message recognized as JMS BytesMessage?<p>We have .NET MQ client sending messages to MQ queues, it works fine. On the receiver...
<p>The below snippet can be used to write a bytes message.</p> <pre><code> MQMessage msg = new MQMessage(); msg.Format = MQC.MQFMT_NONE; // Ensures jms_bytes type message is delivered to JMS application msg.WriteBytes("HelloWorld in bytes"); MQPutMessageOptions pmo = new MQPutMessageOptions(); queue.Put(msg,p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Online Predictions for Keras model via API<p>I have an image classification deep learning CNN model (.h5 file) trained using Keras and Tensorflow 2 that I wa...
<p>There's two basic options:</p> <ul> <li><p>Use <a href="https://www.tensorflow.org/tfx/serving/docker" rel="nofollow noreferrer">TensorFlow Serving</a> - it provides ready-to-go REST API server, the only thing that you need to do is to convert your model to .pb format.</p></li> <li><p>Write your own simple REST ser...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Insert og:image in wordpress<p>I have the following hook for facebook's <code>og:image</code> tag.</p> <p>In my template file:</p> <pre><code>&lt;?php do_a...
<p>Ok, I found out how to do it.</p> <ol> <li><p>Don't call <code>do_action('wp_head')</code> in the templates section.</p></li> <li><p>In the functions.php, do:</p> <pre><code>add_action('wpseo_head', 'add_fb_og'); function add_fb_og($mypost) { global $post; $mypost = get_post_custom($offid); if (isset($mypos...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can't set environment variables for container in ApplicationLoadBalancedFargateService<p>(CDK 1.18.0 and Python 3.6)</p> <pre><code>task_role = iam.Role( ...
<p>The approach you follow seems to work here on the latest version (1.23.0). But I could not find any hint in the release notes why this might have changed. Can you update to the latest version? </p> <pre><code> task_def.add_container("container", environment={"a": "b", "c": "d"}, image=aws_ecs.ContainerImage...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Gulp vinyl-ftp newer and different size files does not upload<p><a href="https://github.com/morris/vinyl-ftp#usage" rel="nofollow">vinyl-ftp</a> has this fea...
<p>As Heikki points out, the remote paths must be the same; otherwise <code>newerOrDifferentSize</code> will compare <code>images/foo.png</code> with <code>test2/images/foo.png</code>, and then definitely upload to <code>test/images/foo.png</code>.</p> <p>If that does not fix it, would you mind opening an issue at <a ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Byte array to Date in Java<p>I have a byte array with 4 bytes taken from a header of a drv and these 4 bytes represent the timestamp of a videoframe. So I ne...
<p>Thanks everybody I already did it. Here you have the solution:</p> <pre><code>String binary=toBin(head[11])+toBin(head[10])+toBin(head[9])+toBin(head[8]); long unixSeconds=stringToInt(binary); Date date = new Date(unixSeconds*1000L); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss z"); sdf.setT...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: SceneKit – Display multiple scenes in same SCNView<p>Is there a way I can display multiple scenes in the same SCNView at the same time? So let's say I have a...
<p>Ok I already figured it out. The thing is to not add another scene but nodes from the 2nd scene to the first like this:</p> <pre><code>let scene = SCNScene(named: "world1.dae")! let subScene = SCNScene(named: "pyramid.dae")! let pyramid = subScene.rootNode.childNodeWithName("pyramid", recursively: true)! scene.ro...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to center divs in row in bootstrap?<p>I want to center my 7 divs and I don't know really how to do it. Any idea? I don't want to change margin all elemen...
<p>Do you need something like <a href="http://jsfiddle.net/yguqnyxn/1/" rel="noreferrer">this</a>?</p> <pre><code>.row { text-align: center; } .col-md-1 { display:inline-block; } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to filer key, value pair and construct rdd of keys only based on logical condition on values?<pre><code>val MED1_dates = medication.map{rec =&gt; ...
<p>Consider the following code that does what your question says. It uses a sample RDD built to demonstrate this. You can apply the similar logic to your problem.</p> <pre><code>val list = List((1 -&gt; "Pune"),(2 -&gt; "Mumbai"),(3 -&gt; "Delhi")) val rdd = sc.parallelize(list) val filtered = rdd.filter{case (k,v) =&...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is it possible to show spinner while inline editing JQGrid?<p>I am using JQGrid. While inline editing the JQGrid and saving data to DB, it takes some time, d...
<p>Well, you can show your spinner on <code>beforeSubmit</code> event and hide your spinner on <code>afterSubmit</code> event in edit options section of your jqgrid difinition, but you can use some different events from <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki:form_editing" rel="nofollow">documentati...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MySQL : Error Code: 1215. Cannot add foreign key constraint<p>I have two tables:</p> <pre><code>Table: utenti Columns: userId varchar(255) PK password varc...
<p>You should be able to run:</p> <pre><code>show engine innodb status </code></pre> <p>and search for the phrase <code>latest foreign key error</code> (may be upper case).</p> <p>That should provide more detail on <em>why</em> the constraint creation failed.</p> <p>Of course, given the utter uselessness of the err...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: combine jQuery on ready + change<p>i want to change this line of code to run ready and change</p> <pre><code>jQuery('#form_auction_type').change(function(e)...
<p>Change it to</p> <pre><code>jQuery(function($) { $('#form_auction_type').on('change', function() { $('#form-row-rapper-price_bin').toggle($('#form_auction_type').val() == '2'); }).trigger('change'); }); </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 flex-wrap these items the way I want them?<p>I have 5 images:</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" dat...
<p>Add <code>justify-content: center;</code> and change <code>flex-wrap</code> to <code>wrap</code> in your <code>.ribbons</code> class. Then populate your <code>&lt;img&gt;</code> in reverse order in the HTML.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div cl...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: adding two attributes in a table and then use AS<p>I want to use two attributes in one table, and then making them as one by using AS.</p> <p>the data insid...
<p>You want to use <a href="http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat" rel="nofollow"><code>CONCAT()</code></a></p> <pre><code>SELECT CONCAT(user_lastname, ' ', user_firstname) AS name </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java comparator with relative distance<p>I'm trying to create an ordered map which uses relative distance comparisons. However, the way ConcurrentSkipListMap...
<p>You can always distinguish instances that have the same distance to the reference number by doing further comparison when the distances are the same. For instance, assuming you represent your numbers as <code>Integer</code>s:</p> <pre><code> public int compare(Integer i1, Integer i2) { Integer r1 = hammi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Issues with INavigationAware in Prism 5<p>I'm fairly new to WPF and MVVM with Prism and I'm having an issue with Prism navigation. Each time I navigate to a...
<p>Have you done some troubleshooting on Navigation? Set a breakpoint to when the page is navigated to and see how all the data is coming back in. I thought I had the same problem before and I was foolishly loading a object into my VM that was never getting destroyed. </p> <p>Because of this, it appeared the VM was be...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trying to add two ints,in x86, however when i add I get garbage instead of a value. what am I doing wrong?<pre><code>section .rodata ask1 db "Enter an intege...
<p>Your last <code>call printf</code> needs arguments (EAX, format string, ...).</p> <p>Add a line to <code>.rodata</code>:</p> <pre><code>printf_format db "%lld",0 ; lld: 64-bit integer </code></pre> <p>and change</p> <pre><code>... exit: call printf ... </code></pre> <p>to</p> <pre><code>... exit: ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: regex to accept phone number with or without spaces and also with or without +<p>I have to write reqex to accept phone number with or without spaces and also...
<pre><code>^\+?[\d ]+ </code></pre> <p><code>^</code> From the beginning<br/> <code>\+?</code> check for a plus, but doesn't need it<br/> <code>[\d ]+</code> check for numbers and spaces<br/> you can also use</p> <pre><code>[\d ]{lower_limit,upper_limit} </code></pre> <p>to accept between lower and upper amount of ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ember CLI / browser refresh / production / 404<p>I developed my webapp using Ember CLI 0.1.15, with emberjs. 1.8.1</p> <p>I built the app with this command:...
<ol> <li><p>Inside <code>config/environment.js</code> file, there is a property called <code>locationType</code>. Set its value to <code>hash</code></p></li> <li><p>Manually moving files from your <code>/dist</code> folder is time consuming and annoying. Instead, you can specify an <code>output-path</code> property in ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to Calculate Gap Between two Dates in SQL Server 2005?<p>I have a data set as shown in the picture. I am trying to get the date difference between eligen...
<p>SQL2005:</p> <p>One solution is to insert into a table variable (@DateWithRowNum - the number of rows is <em>small</em>) or into a temp table (#DateWithRowNum - the number of rows is <em>high</em>) the rows with a row number (generated using <code>[elig]startdate</code> as <code>order by</code> criteria; also see n...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Neo4j - JPA for server database<p>I have a <strong>server</strong> Neo4j database. I'd like to connect it with my Java application using JPA. There are few p...
<p>The latest Hibernate OGM, comes now with Remote Neo4j server support: <a href="http://hibernate.org/ogm/" rel="nofollow noreferrer">http://hibernate.org/ogm/</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does connect action do in iOS development?<p><img src="https://i.stack.imgur.com/QSekG.png" alt="Connect Action in Xcode 6"></p> <p>I am writing code f...
<p>This particular connection means that you assign an <strong>action</strong> to the slider: In this case your <code>calculateTip</code> method. By default the slider sends a message to this method, when its value has changed. This connection can also be done programmatically, but Xcode makes that easier for you.</p> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I automatically accept Artifactory EULA?<p>I have been using Artifactory OSS and set it up with a deploy script. The deploy script also uploads some ...
<p>For deployments using a scripts, you can sign the JCR EULA in a YAML configuration file you have prepared ahead. As JCR is based on Artifactory, the configuration files are usually similar.</p> <p>Create a YAML file at <code>$JCR_HOME/etc/artifactory.config.import.yml</code></p> <p>Add the below</p> <pre><code>Ge...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: read complex json file with spring batch<p>i have a complex json file( with nested json arrays) structure like this: <br/></p> <pre><code>{"persons":[ {"id...
<p>Unfortunately, you have two options:</p> <ol> <li>Write your own record separator that ignores the wrapper persons element/line.</li> <li>Edit the file in a step before reading it to remove that wrapper line using something like a sed command.</li> </ol> <p>If you choose option 2, you can execute it via the <code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What's the way to update dynamic state using React hooks?<p>I'm trying to update my code to React Hooks. My function is updating data inside async function a...
<p>Try using the functional form of <code>setState</code>:</p> <pre><code>const updateData = (id, itemAttributes) =&gt; { setData(currData =&gt; { const index = currData.rows.findIndex(x =&gt; x.eventID === id); if (index === -1) { console.log('error'); } else { return { ...currData, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Falcon's role in Hadoop ecosystem<p>I am supposed to work on cluster mirroring where I have to set up the similar HDFS cluster (same master and slaves) as a ...
<ul> <li>Apache Falcon simplifies the configuration of data motion with: replication; lifecycle management; lineage and traceability. This provides data governance consistency across Hadoop components.</li> <li>Falcon replication is asynchronous with delta changes. Recovery is done by running a process and swapping the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to omit empty strings in output<p>I'm splitting a csv on the comma and taking the 6th cell:</p> <pre><code>Get-Content .\BSEG_EXPORT.csv | foreach { $_....
<p>What about:</p> <pre><code>Get-Content .\BSEG_EXPORT.csv | foreach { $cell = $_.Split(",")[6] if ($cell -ne '""' ) { write-output $cell } } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Filter with Spring-Data and QueryDSL on nullable reference attribute<p>I have following issue. I am using Jquery Datatable serverside and I am now implementi...
<p>I really like working with Spring-Data and Query-DSL, cos it makes my code really tidy. But I am really suprised, that for the case of nullable references there seems no solution. Sure you can use another solution like @vtorosyan mentioned and thank you again for that solution, but when you project is builded up wit...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why do I need a C++ compiler to compile Rust?<p>This could be a very dumb question, but I'm wondering why the Rust compiler (written in Rust itself) require ...
<p>It is actually a reasonable question. The answer is that currently, the rust source includes a slightly patched version of <a href="https://github.com/rust-lang/llvm" rel="noreferrer">LLVM</a>, LLVM is written in C++, and that is not distributed in binary form. So you need a C++ compiler to build that.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AngularJS: Firing an Event to Invoke a Service Method inside a Controller Method<p>In code below I've created a module with a service and a controller. The s...
<p>Well, specifically answering your question, issues about whether it is the correct way or not, when you attach a click handler to anything, when it fires, it receives an <code>Event</code> object, and not <code>rootService</code>. </p> <p><code>Event</code> has no method <code>exampleFunction</code> and so you get ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Material Design support below Lollipop - crashes<p>I've been trying to implement the Material Design theme, following <a href="http://android-developers.blog...
<p><strong>SOLVED...</strong> </p> <p>2 of my jar libs apparently have <strong>generated</strong> <code>values.xml</code> that contains styles of both <code>AppTheme</code> and <code>AppBaseTheme</code>. I verified only our dependencies modules, as jar libraries shouldn't declare application themes, specially not with...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: 'require' keyword not being recognized by webstorm<p>I'm using <strong>WebStorm</strong> as the IDE.</p> <p>Here's my folder structure and express.js insall...
<p>In Webstorm, there are three places in your settings (<code>ctrl-alt-s</code>) where you can update settings for Node.js projects.</p> <p><strong>Settings: Javascript Libraries</strong></p> <p>First, in <code>Javascript | Libraries</code> you can specify that Node libraries should be loaded. Your set of libraries...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to remove a std::function<void()> in vector?<p>I'm trying to create C# event in c++ for my game engine. I'm implementing the event system now but I don't...
<p>If you are willing to limit <code>Delegate</code> to only using function pointers the you can do it with what you have. That would look like</p> <pre><code>struct Delegate { std::vector&lt;void(*)()&gt; funcs; template&lt;class T&gt; void operator+=(T mFunc) { funcs.push_back(mFunc); } ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why should i exactly write that way in Kotlin?<p>I'm beginner in Kotlin for Android. I have some stupid questions which i can't find answers.</p> <p>First q...
<blockquote> <p>Why should i to provide arguments to ArrayAdapter and what are they affected?</p> </blockquote> <p>Basically when you have a line like <code>class MyClass(xxx) : SuperClass(yyy)</code> it means you're creating a new class called <code>MyClass</code> with a constructor that takes 1 argument <code>xxx<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: regex add symbol in first and second line<p>please help..</p> <p>I have 300k data, that need manage use regex add some symbol. what symbol I need to add is ...
<ul> <li><kbd>Ctrl</kbd>+<kbd>H</kbd></li> <li>Find what: <code>\A.+\K(\R.*$)</code></li> <li>Replace with: <code>|$1|</code></li> <li><strong>CHECK</strong> <em>Wrap around</em></li> <li><strong>CHECK</strong> <em>Regular expression</em></li> <li><strong>UNCHECK</strong> <code>. matches newline</code></li> <li><kbd>Re...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: 1px space on fixed toolbar - jQuery Mobile using Cordova on Microsoft Surface<p>I'm building an Application using jQuery Mobile and using it with Cordova on ...
<p>Well, by process of elimination I was able to find the culprit.</p> <p>I was including Bootstrap 3 in my project and it contains the following CSS declaration that was messing everything up on the surface inside of Cordova.</p> <pre><code>@-ms-viewport { width: device-width; } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Problem with ANSI Encoding file with Encryption in Linux, Java<p>I export a database with mysqldump a database in Ubuntu with java, then I encrypt and decry...
<p>Oh, that one is simple. That idiotic (but funny enough, seeming largely correct otherwise) method of file encryption using CBC stores the IV in a separate file, overwriting any old one. So if you overwrite or take the wrong IV file then you'll get 16 random bytes at the start after decryption. So unless you can find...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Wrong input shape when using InceptionResNetV2<p>When feeding an image to a pretrained InceptionResNetV2 network, I have the following results.</p> <pre cla...
<p>try reshape your input with shapes (1, 200, 150, 3) or (200, 150, 3, 1).</p> <p>You can use <code>image = np.expand_dims(image, axis=0))</code> or <code>image = input_data.reshape((-1, image_side1, image_side2, channels))</code></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Access array element in templates ruby on rails<p>I want get the elements of array, call appliants, he are object from class services as show my code</p> <p...
<p>If you want all the <code>type</code> values then you can consider joining them in a sentence, use <code>Array#map</code></p> <pre><code>&lt;%= service.applicants&amp;.map{ |applicant| applicant['type'] }&amp;.to_sentence %&gt; </code></pre> <p>More info on <code>Array#map</code> - <a href="https://www.geeksforgee...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: why is there white space under the canvas when I scroll down<p>I have set my canvas's height to the window's inner width. Whenever I scroll down, the canvas ...
<p>There is white space under your canvas, because the HTML <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas" rel="nofollow noreferrer"><code>&lt;canvas&gt;</code></a> element has a default style of <code>display: inline;</code>. Inline elements are designed to contain text, and therefore white...