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: Magento transactionID and transactionAmount in javascript<p>I am trying to implement a tradetracker-script to my checkout-success page, and I need to add <st...
<p>I think you're taking the wrong approach here. From what I know, there are no javascript variables on the success-page that keep transactional data.</p> <p>What I would do is: create a new child block of the order success page; then inspect the behaviour of the current success message, that clearly shows the order-...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add Color Palette to MapView-Map<p>I'm trying to change the colours of a map (shapefile data), created by a code similar to this:</p> <pre><code>mapView(MyD...
<p>Here is an example that should clarify the point.</p> <pre><code>library(mapview) library(sf) library(RColorBrewer) mapview(franconia, zcol = "SHAPE_LEN", col.regions=brewer.pal(9, "YlGn")) </code></pre> <p><a href="https://i.stack.imgur.com/18hCz.png" rel="noreferrer"><img src="https://i.stack.imgur.com/18hCz.pn...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: laravel: protecting against query that comes back null<p>I had a query that checks the User table for a user who has a specific code and grabs that user , an...
<p><code>return User::where('code', '=', $value_code)-&gt;firstOrFail();</code></p> <p>The method will retrieve the first result of the query; however, if no result is found, a <code>Illuminate\Database\Eloquent\ModelNotFoundException</code> will be thrown: If the exception is not caught, a 404 HTTP response is automa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Font-Awesome css not working locally<p>I would like to use Font Awesome locally without using the cdn. </p> <p>My code fails to add font awesome icons to my...
<p>What you have to do when you use bootstrap/font-awesome files locally is:</p> <ol> <li>Path stored must be clear.</li> <li>Path written inside the font-awesome.min.css should equal to (1)</li> <li>Version must have the same.</li> <li>the fonts in folder fonts/ are indeed related to font-awesome.min.css you've got r...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Zabbix: Response time for web step indicates until HTTP code is received or everything is loaded?<p>Response time for web steps (of a web scenario) indicates...
<p>Just the page content is evaluated: the HTML body, not the linked content. It's the same time it would take curl or wget to download the page, without recursive options.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: In Apache Airflow, how do I pass result from macro as parameter to sql query in stored in separate .sql file<p>I am writing a DAG using the MySqlOperator and...
<p>The params is not templated, meaning that you cannot use macros.ds_add in it. You can move your templated code into the sql file itself and that would solve the problem.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Overwrite range in Excel Worksheet with values from array<p>Can I overwrite a range in Excel with values from an array?</p> <p>I have tried something like t...
<p>Eg:</p> <pre><code>Dim rng As String, arr rng = "A1:B10" arr = WB.Worksheets("Sheet_1").Range(rng).Value '&lt;&lt; read to array arr(1, 1) = "Hello" 'modify array data WB.Worksheets("Sheet_1").Range(rng).Value = arr '&lt;&lt; write array back to sheet 'or WB.Worksheets("Sheet_1").Range("A1").Resize(ubound...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Adding Varible to VBScript from Text File<p>Good Morning Guys and Girls,</p> <p>I'm trying to create a VBscript to automate a function in SAPGUI </p> <p>Bu...
<p>to get the user ID You can use the WScript:</p> <pre><code>Dim objNetwork Set objNetwork = CreateObject("WScript.Network") MsgBox objNetwork.UserName </code></pre> <p>or from the shell:</p> <pre><code>Set wshShell = WScript.CreateObject( "WScript.Shell" ) strUserName = wshShell.ExpandEnvironmentStrings( "%USERNAM...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the important of the use of codeigniter database session (ci_session)<p>I need an answer from someone who have an experience with using codeigniter s...
<p>This is from codeigniter you can read more here <a href="http://www.codeigniter.com/user_guide/libraries/sessions.html" rel="nofollow noreferrer">http://www.codeigniter.com/user_guide/libraries/sessions.html</a> <img src="https://i.stack.imgur.com/Xcd6r.png" alt="this is from codeigniter you can read more here."></p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: python 'int' object has no attribute 'sort'<p>Hey I am new to Python and I have this exercise I want to complete but I get the following error: 'int' object ...
<p>You must understand for loops.</p> <pre><code>for square_list in start_list: square_list ** 2 </code></pre> <p><code>square_list</code> in this example doesn't refer to the empty list you made. It is used as an ambiguous variable to extract values from a list. As such, this is just the each value in the list d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: run-time error "boost_log-vc100-mt-1_49.dll"<p>this may sound like a silly question, but it would be really useful if there was a way around this.</p> <p>I ...
<p>It's solved! Matlab has some boost libraries and the link between MSV and matlab was not working though it was mentioned in linker. I copied those dll files to the current folder and now it is working.</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 generate Pseudo Random Numbers with a seed in TCL 8.5?<p>I can make the rand() work but it only has the output from 0 to 1 and I can't use ...
<blockquote> <p>I can make the rand() work but it only has the output from 0 to 1 and I can't use any seed value in that.</p> </blockquote> <p>What about <a href="https://www.tcl.tk/man/tcl/TclCmd/mathfunc.htm#M33" rel="nofollow noreferrer"><code>srand</code></a>?</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: UML - Use Case Diagram choices<p>I have heard conflicting things about this and just wanted to clarify.</p> <p>I have always thought that when constructing ...
<p>It is not included because the "User is paid cash in hand from job" is outside the scope of a project and would not be needed for what you are trying to create.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: image not displaying in rails app<p>I'm having a very confusing problem with my rails app. I am trying to display an image on a page, and I know the path is...
<p>You need to use <code>image_tag</code> helper to display images in your application. See <a href="http://api.rubyonrails.org/classes/ActionView/Helpers/AssetTagHelper.html#method-i-image_tag" rel="nofollow">documentation</a>.</p> <p>You should use something like this in your view:</p> <pre><code>&lt;%= image_tag( ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unexpected 0 appear in bubble sort function<p>I am new to C language and I am currently learning to write a basic function of bubble sort. Everything seems g...
<p>When you are comparing the values. You also compare the last one, with the first one outside the array. This happens to be 0(undefined behaviour,totally dependent on compiler) and gets switched in. The for-loop should become:</p> <pre><code>for (p=0;p&lt;10;++p) { for(t=0;t&lt;9;++t) { if(num[t]...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Multiple if conditions for ad code<p>I'm trying to set multiple conditions to display my ad code, but don't know how to combine the statements. Here is the f...
<pre><code>&lt;?php if (function_exists('wpmd_is_notdevice') &amp;&amp; wpmd_is_notdevice() &amp;&amp; in_category('blog')) :?&gt; // YOUR AD CODE &lt;?php endif; ?&gt; </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Script not logging to log file<p>trying to get this bat file to work, think I am close... can someone please help?</p> <pre><code>@echo on for /f "delims=" ...
<p>Have you tried running your code without the file redirection? </p> <p>Try this:</p> <pre><code>@echo on for /f "delims=" %%i in ('netstat -anp TCP^| find "ESTABLISHED"^| find "3389"') do ( echo %date% %time% %%i ) pause </code></pre> <p>You needed to escape your pipes and use single quotes in the fo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Resolving multiple instances in collection with MEF<p>Is it possible to fill a collection-type property with MEF-resolved entities? Just like</p> <pre><code...
<p>Well, it is helpful to read documentation before starting to use some framework. It can be simply achieved by using ImportMany MEF attribute</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I speed up unzipping / reading files with a mounted Google Drive in Colab?<p>I'm using Colab with a mounted Google Drive to unpack zips and consolida...
<p>A typical strategy is to copy the .zip file from Drive to the local disk first.</p> <p>Unzipping involves lots of small operations like file creation, which are much faster on a local disk than Drive, which is remote.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a graph from an incidence list with C igraph?<p>With C igraph we can create a graph from an adjacency list with <code>igraph_adjlist</code>. It...
<p>Unfortunately no such functionality is implemented. Feel free to open an issue at <a href="https://github.org/igraph/igraph" rel="nofollow noreferrer">https://github.org/igraph/igraph</a> to suggest such a feature. Alternatively, if you want to discuss it, the <code>igraph</code> project recently opened a new forum ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: jQuery trim and length<p>I have the following HTML and jQuery code</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-bab...
<p>Change your code to this</p> <pre><code>&lt;form method="post" id="addNeedleManagement" name="addNeedleManagement"&gt; &lt;div class="form-group"&gt; &lt;div class="row"&gt; &lt;div class="col-sm"&gt; &lt;label for="addNeedle"&gt;Needle Type&lt;/label&gt; &lt;input type="text" class="for...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Added layouts folder but not appear in Android Studio<p>I follow this <a href="https://medium.com/mindorks/how-to-put-android-layout-files-in-subfolders-1f7c...
<p>You are spelling them wrong, It should be <code>layout</code> and not <code>layouts</code>. If your doing subfolders your parent sub folder need to have layout folder and you need to place all your xml in them. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Decide order of CSS Transitions<p>Funky problem i'm having, although i bet theres a slick way to solve it.</p> <p>The circumstance is that i have a table th...
<p>It sounds like what you want is for the arrow to disappear, but not to rotate back to its starting orientation as it disappears. </p> <p>Since you are handling and tracking all this with React state, you could just set those two states separately, timed .3s apart (since that is your CSS transition time).</p> <p>Yo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to split this String using Regex Java<p>As the title says I want to split a string specifically but I don´t know what to put inside the String.split("reg...
<p>Don't use <code>split()</code>. Use a <code>find()</code> loop.</p> <pre><code>String regex = "[0-9]+\\.?[0-9]*" + // Match number (e.g. 999 or 999.99) "|\\.[0-9]+" + // Match number (e.g. .999) "|[a-zA-Z]\\w*" + // Match identifier "|:=" + // Match complex oper...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to set django model field value based-on value of other field in the same Model<p>I want to assign a <code>NullBooleanField</code> value to always oppose...
<p>I'm not sure I understood your criteria, but you can use validation:</p> <pre><code>def clean(self): if self.scam and self.whitelist: raise ValidationError("Can't set whitelist and scam simultaneously.") if self.scam is False and self.whitelist is False: raise ValidationError("Negate either ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do you add existing objects to a ManyToMany field using Serializer?<p>I am trying to create an API with Artists and Songs, with a ManyToMany relationship...
<p>On you Artist model you have a constrain on the artist_model field (unique=True)</p> <p>if you print the serializer in question with:</p> <pre><code>print(SongSerializer()) </code></pre> <p>you get something like this:</p> <pre><code>SongSerializer(): id = IntegerField(label='ID', read_only=True) song_title = Ch...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Confustion with realpath() buffer<p>Here's my function, which is looking for regular files in given directory, and then storing full path to them in a list. ...
<p>In <code>List_push(list, buf);</code> you store a pointer to <code>buf</code> in the list. You do this for each file, so you end up with several pointers to the same <code>buf</code> in the list. When printing the list items it then will show the (current) contents of <code>buf</code>.</p> <p>To avoid this you need...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PHP stripos() return only false<p>I'm making a filter of Badword that return true if their is a bad word in a string. but what happen is that whatever the us...
<p>By default, the strings returned by <code>file()</code> include the newline character at the end of each line. So <code>$word</code> ends with a newline, and will only match if the bad word is at the end of the line.</p> <p>Use the <code>FILE_IGNORE_NEW_LINES</code> flag to remove the newlines.</p> <pre><code>$ban...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Python reading string of dictionary incorrectly when using .format()<p>I am creating a string of a dictionary (to add to a .txt file later) in Python 3.6.6.<...
<p><code>format</code> triggers replacements on curly braces. You have a curly brace at the start of the string. Incidentally, after a field name, you can append format modifiers, separated by a colon. Consequently, everything between a curly brace and a colon is taken as a field name, and you don't have a field named ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Unable to create ember.js project<p>I've been trying to create a new <code>ember.js</code> project via cmd all I keep getting is this error</p> <pre><code>F...
<p>That could be because the protocol git (using the port 9418) is blocked in your case.</p> <p>You can instruct git to use https instead of git with:</p> <pre><code>git config --global url."https://".insteadOf git:// </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What does regular expression (?<=[\\S])[\\S]*\\s* do?<p>I saw a regex expression in <a href="https://stackoverflow.com/questions/7573817/get-the-first-letter...
<p><code>(?&lt;=[\\S])</code> states that the match should be preceded by <code>\\S</code>, that is, anything except for a space.</p> <p><code>[\\S]*</code> states that the regex should match <em>zero or more</em> non-space characters</p> <p><code>\\s*</code> matches zero or more spaces.</p> <p>In essence, the regex...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: StreamReader does not stop reading C#<p>I have a TCP connection between two computers using windows forms. I have an array of integers which I am serializing...
<p>When sending data via TCP, if there are any boundaries within the stream of bytes, it is up to you to define and implement them.</p> <p>In your particular example, it seems reasonable that you could precede the XML data with a byte count. It would also be reasonable to use a null byte to terminate the data (since t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to combine 5 separate functions using jQuery?<p>I have 5 separate select menus with 5 buttons. When an option is selected, the displayed price and the ur...
<p>You can use jQuery's <a href="https://api.jquery.com/next/" rel="nofollow noreferrer"><code>next()</code></a> and <a href="https://api.jquery.com/prev/" rel="nofollow noreferrer"><code>prev()</code></a> effectively here. I've also replaced your used of <code>id</code> with a <a href="https://developer.mozilla.org/en...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to search a question mark in the visual filter in power BI?<p>I am looking the way to search a question mark (?) in a string in a Filter inside Power BI?...
<p>I am not entirely sure about the filters, but when it comes to the search function, prefixing the question mark (?) with a tilde (~) usually does the trick. You can simply search for <code>~?</code>.</p> <p>Hope this helps.</p> <p><em>Note: I tried searching for <code>?</code> in the slicer filter and it seems to ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Display The Map WIth some Address Entered by user using Google Places Api<p>I am Working on Google Maps Integration with My Application.</p> <p>I have requi...
<p>You should be looking at the geocoding service in the api docs - <a href="https://developers.google.com/maps/documentation/javascript/reference#Geocoder" rel="nofollow">https://developers.google.com/maps/documentation/javascript/reference#Geocoder</a></p> <p>Also see this working example <a href="https://developers...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: When I click submit button in my form, create action is supposed to work but it is rather processed by new action<p>In my application, I have a form that is ...
<p>It is really weird that it works in the first case and not in the second. </p> <p>Try this,</p> <pre><code>&lt;%= simple_form_for @task, url: tasks_path, method: :post, html: {class: 'form-horizontal'}, wrapper: :horizontal_input_group do |f| %&gt; </code></pre> <p>this will force the form to submit to tasks_path...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Handling IE's clear button with AngularJS binding<p>IE has an "X" in each text input that will clear the input. However, when clicking this button, while it ...
<p>The X button in input forms is native for IE10+ and you can`t do anything about it, but only hide it with CSS:</p> <pre><code>input[type=text]::-ms-clear { display: none; } </code></pre> <p>Then you can create your own directive to mimic this kind of behaviour. Just create a span, position it inside of an input...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Swift struct adopting protocol with static read-write property doesn't conform?<p>Why doesn't this compile in Swift 1.2?</p> <pre><code>protocol Proto { ...
<p>At this point I'm persuaded by Nate Cook's example that this is nothing but a bug in the Swift compiler. As he points out, merely adding an empty <code>didSet</code> observer on the static variable allows the code to compile. The fact that this could make a difference, even though it makes no <em>functional</em> dif...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android : Retrofit and using dynamic URLS<p>Good morning. I am pretty new to Retrofit, taking on the project from another. We need to talk to a API that us...
<p>Don't you do something like this: </p> <pre><code>@GET("/group/{id}/users") List&lt;User&gt; groupList(@Path("id") int groupId); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: HitTest Object Bug when 2 object from same array hit<p>Hey guys so I ran into a Bug with my code I have a Movie Clip Object called <code>mainFish</code> that...
<p>The problem is that while you're only allowing one fish to be moved by the hook, you're still checking for hits for all the fish. This both stops them, and creates a new sound file.</p> <p>The way to avoid this is to stop checking for fish collisions after a fish has already been hooked. To do this you can break ou...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Vuetify input autocomplete bug<p>I tried to google it a couple of times but got no luck, basically, when the page loads since the password is on autosave the...
<p><strong>Update June 4, 2021</strong>. Tested on Vuetify 2.5.3 and Google Chrome 90:</p> <p>You can still use <strong>placeholder</strong> prop with one space in combination with <strong>persistent-placeholder</strong> prop.</p> <pre><code>... &lt;v-text-field label=&quot;Login&quot; v-model=&quot;loginItem.login...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PHP mysqli fetch_row - iterate over multiple records<p>I have been messing with this for 3 days now, researching and experimenting: it's time to ask for some...
<p>The new rows are started here:</p> <pre><code>foreach ( $apptnamestop as $name) { print str_repeat($tab, 8) . "&lt;tr&gt;\n"; print str_repeat($tab, 9) . "&lt;td class=\"td1s\"&gt;$name&lt;/td&gt;\n"; </code></pre> <p>As you can see, this new row is started once per element in <code>$apptnamestop</code>, r...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: find documents having a specific count of matches array<p>I've searched high and low but not been able to find what i'm looking for so apologies if this has ...
<p>Using <code>aggregation</code></p> <pre><code>&gt; db.spam.aggregate([ {$unwind: "$items"}, {$match: {"items.category" :"A"}}, {$group: { _id: "$_id", item: {$push: "$items.category"}, count: {$sum: 1}} }, {$match: {count: {$gt: 1}}} ]) </code></pre> <p><strong>Output</stron...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reroute URL parameters to path and keep HTML references working (htaccess)<p>I have a URL <code>http://example.com/?r=FOO&amp;c=BAR</code> which I want to ac...
<p>You need to ignore files by adding this condition under your <code>RewriteBase</code>:</p> <pre><code>RewriteCond %{REQUEST_FILENAME} !-f </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: AVPlayer fails to playback .mov uploaded to server<p>I have uploaded a .mov file to my server and it fails to playback in my app, this code works fine with a...
<p>The uploaded file exceeds the hosting plan limit. See from your console:</p> <pre><code> curl http://shahnewazkhan.ca/iOS/henrik_penalty_shot.mov </code></pre> <p>The uploaded file exceeds the hosting plan limit. Please, consider upgrading to a more powerful hosting package.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Background Work: Use single background thread or launch one thread per loop?<p>I'm doing some video analysis in python and I want to use multithreading to sp...
<p>Making thread is heavy operation, so create as many threads as cores you have and can effectively utilize. I think that in your case, without changing the algorithms, the maximum number of threads is 3.</p> <p>To reduce switching costs do not move light operations to the separate threads. Use fastest sync primetive...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Validation message not found<p>I'm trying to implement a custom error message for my bean validation. I've annotated my field <code>firstName</code> with the...
<p>Try putting your message key in <code>ValidationMessages.properties</code> instead of <code>message.properties</code>.</p> <blockquote> <p>The ValidationMessages resource bundle and the locale variants of this resource bundle contain strings that override the default validation messages. The ValidationMessage...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Git throwing errors attempting to commit to github<p>I am trying to clone a locally existing repo to github. They suggest doing this:</p> <pre><code>$ git r...
<p>It looks to me like your credentials for GitHub aren't configured correctly. Have you followed this guide <a href="https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line" rel="nofollow noreferrer">Creating a personal access token for the command line</a>? </p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Merge dictionaries with minimum value of common keys<p>I have two dictionaries. I want to merge these dictionaries such that the value for any key in the res...
<p>You can do it like this</p> <pre><code>&gt;&gt;&gt; {k: min(i for i in (h1.get(k), h2.get(k)) if i) for k in h1.viewkeys() | h2} {'a': 1, 'c': 2, 'b': 5, 'd': 10} </code></pre> <p><code>h1.viewkeys() | h2</code> actually finds the set union and gets all the keys which are either in <code>h1</code> or <code>h2</code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cannot read property of undefined React Hooks<p>I am trying to create a search feature using react hooks but it keeps returning the error:</p> <blockquote> ...
<p>You can either get to the value of passed event by changing </p> <pre><code>&lt;input type="text" value={search} onChange={(event) =&gt; updateSearch(event}/&gt; </code></pre> <p>or you can keep the input element as it is and change the update updateSearch callback to </p> <pre><code>const updateSearch = (event) ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: proper malloc bug fixing<p>I had this line of code : </p> <pre><code>conf-&gt;table = malloc(sizeof(struct Categorie)*(csv_nbLines(filename))); </code></pre...
<p>I'm afraid, NO.</p> <p>Assuming the <em>string</em> you mentioned is in form of</p> <pre><code>struct Categorie { . . char * str; } </code></pre> <p>You're supposed to first <code>malloc()</code> the memory for <code>conf-&gt;table</code> with <code>sizeof(struct Categorie)</code>, and then, <code>malloc()</code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: PySpark: Job aborts due to stage failure, but resetting max size isn't recognized<p>I'm attempting to display a dataframe in PySpark after reading the files ...
<p>It all depends on your code and partitioning of the code with respect to the cluster size. Increasing spark.driver.maxResultSize is the first option to solve the problem and eventually look for a permanent solution to modify the code or design. Please do avoid collecting more data to driver node.</p> <p><strong>OR<...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: create shell script for parameterized variable<p>I am very much new to shell script and i want to create and run shell script.</p> <p>I want to run my java ...
<p>Don't store code in a variable, use a function:</p> <pre class="lang-sh prettyprint-override"><code>#!/bin/sh run() { cd /opt/import/import/current &amp;&amp; java -Dlog4j.configurationFile=/opt/import/config/logging/log4j2_Importer.xml \ -Djava.security.egd=file:///dev/urandom \ -classpa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: UPDATE FROM another table value with CASE SUBSTRING and WHERE<p>I tried to update my main table --> <strong>budget</strong> with values from <strong>item_mas...
<p>I would express this using an update join:</p> <pre><code>UPDATE budget b LEFT JOIN item_master im ON b.item_code = im.item_code SET b.coa_production = CASE WHEN LEFT(b.purpose, 3) = 'PRO' THEN im.coa_production END, b.coa_general = CASE WHEN LEFT(b.purpose, 3) = 'GEN' THEN im.coa_general END WHERE ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C# Prevent a started app from writing in the console<p>I have an app which starts another app. This other app prints a few lines into the Console but noone n...
<p>In your code ensure that you are <em>re-directing</em> both <code>StandardOutput</code> and <code>StandardError</code> that way everything that the "ThirdPartyApp" writes will be captured in either of these <em>streams</em>.</p> <p>I have written a small Helper Class that helps with this </p> <p>You can use like <...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Query to get rows for specific user where revenue > revenue of earliest date for that user<p>I have a table called user_revenue which looks like this<a href=...
<p>You can alias the table <code>user_revenue</code> like <code>u</code> in the main body of the query and use <code>u.user_Id</code> in the subquery wherever needed:</p> <pre><code>SELECT u.* FROM user_revenue u WHERE u.user_Id = 'AAA' AND u.revenues &gt; ( SELECT revenues FROM user_revenue WHERE user_Id = u.user...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React JS: CORS Error causing NetworkError when attempting to fetch resource<p>I already found <a href="https://stackoverflow.com/a/55674095/12383456">this</a...
<p>After countless hours of debugging it turns out that I didnt put an <code>http.cors();</code> into my WebSecurityConfig.java I discovered this after i read this tutorial: <a href="https://www.baeldung.com/spring-security-cors-preflight" rel="nofollow noreferrer">https://www.baeldung.com/spring-security-cors-prefligh...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to get random object from array every x sec<p>I want to display an image randomly every x sec.</p> <p>I have an array of images:</p> <pre><code>$scope....
<p>You need to generate an integer from 0 to your array length, and then pick an image in your array using this index. See example:</p> <pre><code>$scope.images = [{'imageUrl': 'img/1.jpg'},... {'imageUrl': 'img/10.jpg'}]; $interval(function() { var randomIndex = Math.round( Math.random() * ($scope.images.length-1)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: RSelenium: failing to send input to text box<p>This script is entirely working apart from the input text into the longitude and latitude fields, which for so...
<p>Not an expert with RSelenium but I see you are identifying latitude as</p> <pre><code>latitude &lt;- remote_driver$findElement(using = 'id', value = 'latitude') </code></pre> <p>, when id is in fact <em>latitudeProj</em></p> <p>All your fields are lists, except latitude and longitude, but you seem to be sending k...
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 get the progress info when download file/web page in XMLHttpRequest<p>the cpde below is to download web page from yahoo.com homepage</p> <...
<pre><code>http.onprogress= function(){ //event.loaded and event.total usage } </code></pre> <p>Read more about <code>XMLHttpRequest</code> and <code>oprogress</code> here...<a href="https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest" rel="nofollow">XHR</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create a new table that summarises data from another data frame?<p>I have a data frame df whose data looks like,</p> <p><div class="snippet" data-lan...
<p>Here a solution, probably not the best one but it works...</p> <pre><code>## Load Data customer_id &lt;- c(12,12,34,234,781,456) Sales_id &lt;- c(20013211129, 20013217122, 20013149844, 20013273151, 20013222724, 20013171637) Rev &lt;- rep(1000, 6)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What are ways to transfer data between activities<p>I am reading User class from database with this code :</p> <pre><code> mDatabase.orderByChild(...
<p>Using Intent, you can share data between two activities. In your case, you have to make user object parcelable.</p> <ol> <li><p>Implement Parcelable interface in your user class.</p></li> <li><p>Send the user object in intent like intent.putExtra("user", userObject)</p></li> <li><p>In your second activity get user ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Why strings are not coming in same line in ruby<p>In this code in three places i am having <code>puts</code>, Where first one prints variables in different l...
<p><a href="http://ruby-doc.org//core-2.2.0/Kernel.html#method-i-gets" rel="nofollow"><code>Kernel#gets</code></a> gives you a string with the <code>\n</code> added to the end of the <em>string</em>. That causing the output in the <strong>multiple lines</strong>.</p> <p>To make your output as you wanted it to be, you ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Remove commits before clone (forgot --depth 1)<p>I forgot to add <code>--depth 1</code> to my clone before starting a project. Is there a way to remove all c...
<p>Clone your <em>local</em> repository using the <code>file://</code> protocol, and if you have made five commits since cloning, use the <code>--depth</code> option with <code>6</code>.</p> <pre><code>git clone file://C:/Users/&lt;user&gt;/Documents/my-repo --depth 6 my-repo2 </code></pre> <p>Now you're in the same ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Identifying 24hour periods in GPS data<p>I would like to identify sequential 24 hour periods in GPS data. I have a datetime column that is numerical (ex: 414...
<p>Here is one approach, assuming <code>df</code> is the data assigned in your question. I created a new variable, <code>need</code> which I believe is your desired outcome.</p> <pre><code>transform(df, need = trunc(DT_LMT - DT_LMT[1]) + 1) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MNE volume source estimation with template MRI<p>I want to do volume source estimation with template MRI provided by <a href="https://mne.tools/stable/index....
<p>I figured it out. It was painful to piece things together though.</p> <pre class="lang-py prettyprint-override"><code># %% Importing libraries import os.path as op import mne from mne.datasets import fetch_fsaverage from mne.minimum_norm import apply_inverse #################################### ## data manipulati...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Aggregate data of the same id and date<p>I have this dataframe</p> <pre><code>df &lt;- data.frame(id = c(1,1,2), date = c("2008-08-04 05:4...
<p>Here is a suggestion using <code>dplyr</code>:</p> <pre><code>library(dplyr) df %&gt;% arrange(date) %&gt;% mutate(date_day = format(as.Date(date, "%Y-%m-%d %H:%M:%S"), "%Y-%m-%d")) %&gt;% group_by(id, date_day) %&gt;% summarise(text = paste(text, collapse=" ")) </code></pre> <p>Which returns:</p> <pr...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Update dictionary inside of dictionary when key is already present<p>I know there are variations of this question already present and I have already gone thr...
<p>Here's one solution:</p> <pre><code>for k, v in entity_sentiment_int_int_dict.items(): if k in entity_sentiment_dictionary.keys(): entry = entity_sentiment_dictionary[k] for update_key, update_val in v.items(): if update_key in entry: if isinstance(entry[update_key], ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to create generic type reference with Roslyn?<p>I want to create a reference to "<code>System.IEquatable&lt;MyType&gt;</code>", where the open generic ty...
<p>You can use the following pattern:</p> <pre><code>SF.GenericName( SF.Identifier(@"IEquatable")) .WithTypeArgumentList( SF.TypeArgumentList(/.../)) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Customizing ViewPagerIndicator Tabs (All of them appears on the screen?)<p>I am using <code>ViewPagerIndicator</code> in my project. Can I customize ViewPage...
<p>You can do try some other alternatives. </p> <p>The PagerSlidingTabStrip library with the attribute pstsShouldExpand set to true or;</p> <p>The SlidingTabsBasic android sample but with the modification used by the open sourced Google I/O 2014 app that includes the method setDistributeEvenly which you have to set t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I , using Numpy, compute how many entries in my array that gives the cumulative sum of 0,9 as an example?<p>After preforming PCA I have my (rescaled ...
<p>My solution would be to use <code>numpy.cumsum</code> together with <code>numpy.where</code>:</p> <pre><code>arr = np.arange(6) # dummy data max_cum = 6 # your stop certerion arr_cum = arr.cumsum() # calculate cumulative sums of your array num = np.where(arr_cum &gt;= max_cum) # get indices where arr_cum passes yo...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can placing the Rails app in an SSD and running rails server in it damage the drive?<p>In a development environment, running <code>rails s</code> is a bit sl...
<p>Practically, no. </p> <blockquote> <p>People say that we should not do too many writes and reads to an SSD.</p> </blockquote> <p>These people are probably referring to doing orders of magnitude more disk I/O than starting a rails app does.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I split a vector into a table with columns?<p>I have a vector with some missing data, and I would like to convert this to a dataframe with 4 columns.<...
<p>We could <code>split</code> the vector ("a") into a list ("lst") based on creating a grouping variable from finding the presence of "building" in the vector (<code>grepl('^building',..)</code>. <code>grep</code> the list elements in a loop (<code>sapply(</code>) for individual elements ('building', 'sq ft' etc.). ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get Pandas DataFrame readable datatypes<p>I am trying to get into a list the data types of the columns in pandas dataframe.</p> <p>I can see the types by do...
<p>Sure, <code>dtype</code>s have a <code>name</code> property:</p> <pre><code>&gt; [d.name for d in df.dtypes] ['datetime64[ns]', 'float64'] </code></pre> <p>(I'm guessing you don't need help transforming <code>'datetime64[ns]'</code> to <code>'datetime64'</code>)</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Create proportional tables of a single variable with a list of variables<p>This is probably a very easy question, but I cannot seem to figure it out. </p> <...
<p>Here, we can use <code>map</code> to loop over the 'cols' instead of <code>for</code> + <code>map2</code> to return a <code>list</code> of output</p> <pre><code>library(purrr) lst1 &lt;- map(cols, ~ prop.table(table(mtcars[[.x]], mtcars[["cyl"]]))) lst1 #[[1]] # 4 6 8 # 0 0.03125 0.09375 0....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ErrorCode: InvalidBlobType when appending to a blob<p>I'm trying to append new lines of json to existing json file in container. Below is my code:</p> <pre>...
<p>I believe you're getting this error is because you're calling a method applicable only for <code>Append Blob</code> on a <code>Block Blob</code>.</p> <p>Following code of yours creates a Block Blob:</p> <pre><code>blobService.create_blob_from_text(container_name, filename, self.resp) </code></pre> <p>However you'...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Inserting a string in the middle of another string or splitting the string into two parts<p>I wanted to know how I could place a <code>String2</code> inside ...
<pre><code>StringBuilder sb = new StringBuilder(); sb.Append(string1.Substring(0,string1.Length/2)); sb.Append(string2); sb.Append(string1.Substring(string1.Length/2,string1.Length- string1.Length/2)); Console.WriteLine(sb.ToString()); </code></pre> <p>This is a <a href="https://dotnetfiddle.net/" rel="nofollow">som...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: UIRefreshControl? does not have a member named 'endRefreshing'<p>I am trying to do a simple pull refresh with my UITableView, but is giving me the error: UIR...
<p>Since UITableView's <code>refreshControl</code> property is an optional you must unwrap it before using it. You can unwrap with the <code>!</code> operator however a safer way is to use the <code>?</code> operator to unwrap, which will not result in a runtime error if refreshControl is ever nil.</p> <p>So in your o...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I set a different backgroundImage in <div> element in a .map() function?<p>I want to give each <code>CategoryCard</code> div a different <code>backgr...
<p>I solved it with importing of each image and inline styling of the CategoryCard. </p> <p>then i pushed the imports in an array. And every item in the .map() function gets the own background through the array.</p> <p><a href="https://i.stack.imgur.com/DfAM1.png" rel="nofollow noreferrer"><img src="https://i.stack.i...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use unscoped enumerator as if its type is its underlying type<p>This doesn't work as expected:</p> <pre><code>template&lt;typename T&gt; struct PHI {...
<p>Let's get rid of the templates. Minimized repro:</p> <pre><code>#include &lt;iostream&gt; enum bar : unsigned long long { baz = 11400714819323198485ULL }; void foo(int v) { std::cout &lt;&lt; "int "&lt;&lt; v; } void foo(unsigned v) { std::cout &lt;&lt; "uint " &lt;&lt; v; } void foo(unsigned long long v) { std::...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: vagrant with salt provisioning - running a particular state<p>Is there a way I can use the salt provisioner to run only a handful of states rather than doing...
<p>The plugin itself only currently supports running a full highstate.</p> <p>As a workaround, you could first tell vagrant not to run highstate:</p> <pre><code>config.vm.provision :salt do |salt| salt.run_highstate = false end </code></pre> <p>Then you could use a shell provisioner to run the chosen states:</p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I fit recurrence relations using scipy.optimize.fmin_l_bfgs_b?<p>I recently watched a <a href="https://www.youtube.com/watch?v=ovJcsL7vyrk" rel="nofol...
<p>If I understand your question correctly, you want to find the value of $\theta$ minimizing $\sum_{n=0}^{N-1} (\hat y_{n+1} - \theta \hat y_{n} (1 - \hat y_{n}))^2$, given a sequence ${\hat y_k}_{k=0}^N$. If so, assuming your data is <code>ys</code> and your initial guess <code>x0</code>, you could do that through</p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: VB.NET Auto Save Text File Mulitple<p>So i declare save text file without using save file dialog.</p> <pre><code>Private Sub strt2_Click(sender As Object, e...
<p>It appears thst you're trying to use the current time to distinguish the filenames, which is often reasonable, so perhaps something like this will work better:</p> <pre class="lang-vb prettyprint-override"><code>Private Sub strt2_Click(sender As Object, e As EventArgs) Handles strt2.Click Dim timeStamp = DateTi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reading from a textfile and creating a string variable?<p>I have a basic class FileOutput that will write to a textfile HighScores. I also have a class fileR...
<p>Yes.</p> <p>I'm not sure if this is the most clever method of doing so, but you could create an ArrayList and create a collection of strings. Instead of out.print'ing you could try this:</p> <pre><code>ArrayList&lt;String&gt; al = new ArrayList&lt;&gt;(); while (sc.hasNext()){ String s = sc.next(); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using fields in a csv file as variable in sge array job - awk<p>I can use the following bash script to assign a variable ID from each line (first 1000 lines ...
<p>Imagine you have the following csv file (named super.csv): </p> <pre><code> name,postcode,dob alan,XXXAAA,11/11/55 bruji,AAAXXX,20/10/88 ... zorri,AXAXAX,01/01/01 </code></pre> <p>and you want to use the first and third fields as arguments in your sungrid engine array job. The following will extract the field...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How do I get the most recent processdate in a group?<p>I'm wanting to get the most recent entry per month using acct.processdate. I've tried using the MAX() ...
<p>You can put your result in a cte and use not exists function</p> <pre><code>DECLARE @StartDate AS INT , @EndDate AS int SET @StartDate = '20190131' SET @EndDate = '20191130' ;with cte as ( SELECT count(*) as [Account Count] , datename(MONTH, CAST(CAST(ProcessDate AS VARCHAR(10)) AS SMALLDATETIME)...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Does setting autocommit=0 within a transaction do anything?<p>I am reviewing code by another developer. He has a commit that explicitly adds <code>set autoco...
<p>If a transaction is active, it is not affected by <code>SET autocommit = 0</code>.</p> <p>Otherwise, if the former value of <code>autocommit</code> was <code>1</code>, <code>SET autocommit = 0</code> starts a new transaction.</p> <p>If you are using MariaDB and you are in doubt, you can check the <code>in_transact...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Required format for month-day-year plot in matplotlib<p>I have a .csv file with one column containing the date using backslashes '/' to separate the month, d...
<p>Use the <code>datetime</code> module to create a <a href="https://docs.python.org/2.7/library/datetime.html#datetime-objects" rel="nofollow"><code>datetime</code></a> object</p> <pre><code>&gt;&gt;&gt; import datetime &gt;&gt;&gt; dt = datetime.datetime.strptime('3/5/14', '%m/%d/%y') &gt;&gt;&gt; dt datetime.dateti...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Error SetWindowsHookEx and GetRawInputData<p>I have two questions.</p> <p>First, I wrote a little program to catch all mouse events. I start it in a separat...
<p>First, you needs to wait the thread exit, use <code>mouse.join()</code>. If the main process returns directly, the thread it owns will also be terminated, which will cause this issue.</p> <pre><code>int main(int argc, char* argv[]) { std::thread mouse(mouseHook); mouse.join(); return 0; } </code></pre> ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: I cant get element by Id in a loop<p>Im trying to get an element by id from every object with specified class, so i can get value from that but it says: </p>...
<p>We have <code>document.getElementById</code>, but not <code>element.getElementById</code>. You can use <code>querySelector</code>:</p> <pre><code>li[i].querySelector('#prodFilter'); </code></pre> <p>And notice that <code>id</code> should be unique in the document, consider replacing with <code>class</code>.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What is the grammar rule for this Haskell code?<p>I have basic knowledge of Haskell (so forgive me if my question looks trivial for Haskellers here) and rece...
<p>That's an <a href="https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/type-families.html#assoc-decl">associated type family declaration</a>, part of the <code>TypeFamilies</code> extension.</p> <p>It's basically used inside a class declaration to tell that the class has a type associated to each instan...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React native custom navigation header not shown<p>I'm trying to use a custom navigation header but it isn't showing. My codes are as follow :</p> <p><strong...
<p>I'll tell you how ive implemneted the same. I dont trust react navigation custom headers. So what i did is first ive disabled the header of react navigation by :</p> <pre><code>{ defaultNavigationOptions: { headerShown: false, }, initialRouteName: 'HomeCard', transitionConfig: () =&gt; fromRig...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Fastest way to read 2mb binary file in decimal or hex?<p>im trying to read a binary file into my own hex editor using a datagridview.</p> <p>this was my ini...
<p>I placed a DataGridView from the toolbox onto a Form and used this code:</p> <pre><code>static void Demo(DataGridView dgv) { string src = @"C:\temp\currentData.txt"; var data = File.ReadAllBytes(src); int nCols = 16; //number of columns to use in the DGV DataTable dt = new DataTable(); for (int...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MVC5 - OWIN - IAuthenticationManager<p>I am using structuremap.mvc5 although this question would apply equally to any DI container. I need to configure the ...
<p>Found it:</p> <pre><code>_.For&lt;IAuthenticationManager&gt;().UseSpecial(expression =&gt; expression.ConstructedBy( i =&gt; HttpContext.Current.GetOwinContext().Authentication)); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Java JDBC search field<p>Helllo I have a question regarding Java and JDBC, I got everything up and running. I am creating a searchfield and everything works ...
<p>Because when the search field is empty, your SQL statement will be like</p> <pre><code>SELECT * FROM flats WHERE Rent BETWEEN AND AND No_of_rooms BETWEEN AND </code></pre> <p>You can run the statement on SQL server directly to see what is returned.</p> <p>If you want to return everything, simply query with the st...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get rid of white background for excel export ssis<p><img src="https://i.stack.imgur.com/roxM6.png" alt="How to go from this:"></p> <p><img src="https://i.st...
<p>Inside the excel file you are exporting to go to the View Ribbon and tick the "Gridlines" in the show section. As far as I am concerned this is not an SSIS issue. </p> <p><img src="https://i.stack.imgur.com/G74Rr.png" alt="how to enable gridlines"></p> <p>If this box is ticked, tell us how you exporting to Excel: ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Choosing at random from an array but inside a for loop isn't working as expected<p>I am trying to cycle through a list of elements and give them a random col...
<p>Here is your error: you need to return the recursive value. <strong>return</strong> this.getColor();</p> <pre><code>if(color === this.oldColor){ console.log('need to choose another'); return this.getColor(); } else { console.log('return now'); this.oldColor = color; return color;...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to encrypt in php5 and decrypt in windows store 8.1 and c# using aescbc<p>Hi guys I have encrypted the word hello in a string in PHP using the AesCbc met...
<p>The key isn't hashed in your PHP code. So, don't do it in C#:</p> <pre><code>AES = SAP.CreateSymmetricKey(CryptographicBuffer.CreateFromByteArray( System.Text.Encoding.UTF8.GetBytes(pass) )); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Maintain ration on textarea resize<p>Is it possible to scale the FONT SIZE of a textarea and maintain its ratio when a browser window is resized?</p> <p>My ...
<p>If you use jQuery, then the following code will adjust both the size of the textarea and the size of the font based on the resizing of the window.</p> <p>Before executing the code, make sure that the size of the textarea and the font size are set (i.e. anything that will change the size of those has loaded and exec...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get the latest date in UNIX<p>I have data like this:</p> <pre><code>Code Date(YYYYDDMM) VNM 20141202 VNM 20141203 VNM 20141204 BHR 20141203 BHR 2014120...
<p>I would use <code>awk</code> to convert the dates into timestamp, then compare them with <code>sort</code> and finally print the first column from the biggest one:</p> <pre><code>awk 'NR&gt;1{y=substr($2,0,4) d=substr($2,5,2) m=substr($2,7,2) date=sprintf("%d %d %d 0 0 0",y,m,d) ...