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: Read a JSON array from a cell and write part of the last object to another cell in the same row<p>I am trying to pull some information from a JSON array in a...
<ul> <li><a href="https://developers.google.com/apps-script/guides/support/best-practices" rel="nofollow noreferrer">Use <code>getValues()</code> and <code>setValues()</code> to batch up operations</a></li> </ul> <h3>Snippet:</h3> <pre><code>let parseRange = sheet.getRange(1+1,12,lastRow-1,1);//col L let values = parse...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Editing Firefox Preferences without Firefox<p>I am trying to edit a Firefox preference in the <code>about:config</code>, <code>general.useragent.override</co...
<p>On my machine (a Windows 7 machine), under my home directory there are:</p> <p><code>AppData/Local/Mozilla/Firefox/Profiles</code></p> <p>and</p> <p><code>AppData/Roaming/Mozilla/Firefox/Profiles</code></p> <p>directories. My profile name appears under each, but only the latter contains a <code>prefs.js</code> f...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to convert a log file to JSON format using shell script?<p>I have three lines of syslog, I need to convert this data to JSON in order to forward it to el...
<pre><code>This is the Solution I have come up with we can use the same in a while loop to convert the whole log to Json :D Feb 3 17:26:36 servername augenrules: failure 1 dt=$(echo $line | awk '{print ($1" "$2" " $3)}') ser_nm=$(echo $line | awk '{print ($4)}') error_msg=$(echo $line | awk '{print ($5$6$7$8$9$10)}...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NoReverseMatch Django 2 Python<p>NoReverseMatch Reverse for 'Edit_Product' with no arguments not found. 1 pattern(s) tried: ['shop/product/Edit_Product/(?P[0...
<p>You should try to understand the error:</p> <blockquote> <p>NoReverseMatch Reverse for 'Edit_Product' with no arguments not found.</p> </blockquote> <p>This error is saying that you asked Django to <strong>reverse</strong> a url pattern with the <strong>name</strong> <code>Edit_Product</code>, that it expects an...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Cycle Nested Functions Technical Word<p>I´m writing my thesis and I don´t know the technical word to define functions that create a cycle in a Call Graph. If...
<p>They are <a href="https://en.wikipedia.org/wiki/Mutual_recursion" rel="nofollow noreferrer">mutually recursive</a> functions.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: If no Table View results, display "No Results" on screen<p>I have a <code>tableview</code>, where sometimes there might not be any results to list, so I <str...
<p>You can easily achieve that by using <code>backgroundView</code> property of <code>UITableView</code>.</p> <p><strong>Objective C:</strong></p> <pre><code>- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { NSInteger numOfSections = 0; if (youHaveData) { yourTableView.separatorSty...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add A Block is not working on dashboard in moodle?<p>I am working on moodle version 3.5.10 and fordson theme version 3.5</p> <p>I was trying to add a link o...
<p>Add the HTML block on the " Default dashboard page " to display the block on all users dashboard page.</p> <p>Setup your block on the below location and use the button "Reset Dashboard for all users" to reset the changes on dashboard blocks for all users.</p> <pre><code>Site Administrator &gt; Appearance &gt; Defa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Parse Cloud: Unable to return value of query of max value in a column<p>I am new to the Parse cloud code, and would like to obtain the max value in a column ...
<p>To clarify my comment, the code retrieves a <code>Recording_db</code> object that is represented by the row with maximum <code>Ref_int</code>. Treat this like a parse object in the cloud logging....</p> <pre><code> success: function(result) { max = result; response.success(max.get(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Pixel tracking code not working when redirecting to PDF<p>I'm working on firing tracking pixel code when a form is submitted and redirects the user to a PDF ...
<p>The browser leaves the page before the tracking hit actually fires. You need to delay the form submission slightly to account for this:</p> <pre><code>jQuery.noConflict(); (function( $ ) { $('form').on('submit', function(evt) { evt.preventDefault(); if (formIsValid) { try{ __pixel({"name": "t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can i construct this three level hierarchy Query,<p>I have a scenario. </p> <p>I have sql server table structure like below</p> <pre><code>ID ...
<p>just two joins </p> <pre><code>select base.ID, base.Name, div.Name, grp.Nave from table as base join table as div on div.ID = base.parentID and base.ID = 51 join table as grp on grp.ID = div.parentID </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: inet_ntop returning partically incorrect IPv6 address<p>I am aware of this <a href="https://stackoverflow.com/questions/38848281/inet-ntop-printing-incorrect...
<p>The man page of <code>getpeername(2)</code> gives a hint as to why this is happening:</p> <blockquote> <p>The address_len parameter should be initialized to indicate the amount of space pointed to by address. On return it contains the actual size of the address returned (in bytes).</p> <p>The address is tru...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: The type or namespace name 'ContractClassFor' could not be found (are you missing a using directive or an assembly reference?)<p>I am using the following cod...
<p>It is happened because of an ambiguity issue. I removed Microsoft.Contracts from reference. Now its working fine. Thanks Mr.Frebin Francis for your support.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using Azure DevOps with Ansible<p>I want to deploy an Ansible playbook through Azure DevOps but the Ansible extension requires us to have a Linux VM configur...
<p>To run this Ansible extension, <code>Linux VM</code> just be one of choice. If you don't want use VM, you can choose another method: <code>Private Linux agent</code>.</p> <p>Just install a <a href="https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/v2-linux?view=azure-devops" rel="nofollow noreferrer">p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Find and Replace characters in a string<p>I am a newbie to Java and looking for an optimized code to find certain characters and replace them with another ch...
<p>You can just use:</p> <pre><code>String repl = input.replaceAll("[^\\w-]+", ""); </code></pre> <p><code>^</code> negates the whole character class and <code>\w</code> includes <code>[a-zA-Z0-9_]</code> and we are adding hyphen in the mix here as per your requirements.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Add a Tooltip - Javascript without jquery<p>I would like to add a tooltip that combines javascript values without using jquery</p> <p>This is my div :</p> ...
<p>is this what you are after?</p> <pre><code>var modifyForce = 0; var forceBase = 15; var Force = (forceBase + modifyForce); var el = document.getElementById("Force"); el.innerHTML = Force; el.setAttribute('tooltip', forceBase + ' + ' + modifyForce); </code></pre> <p>fiddle - <a href="http://jsfiddle.net/40chzfh6/"...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to convert C++ tesseract-ocr code to Python?<p>I want to convert the C++ version <a href="https://tesseract-ocr.github.io/tessdoc/APIExample" rel="nofoll...
<p>I think the problem is that <code>api-&gt;Recognize()</code> expects a pointer as first argument. <a href="https://github.com/tesseract-ocr/tesseract/blob/420cbac876b06beeee271d9f44ba800d943a8a83/include/tesseract/baseapi.h#L491" rel="nofollow noreferrer">They mistakenly put a <code>0</code> in their example but it ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Laravel Passport invalid_grant for password grant_type<p>I've been trying to create an <code>access_token</code> for my api. I've <a href="https://laravel.co...
<p>as it is stated <a href="https://github.com/laravel/laravel/pull/4797" rel="noreferrer">here</a>, from the 5.8 version the default password "secret" has beeen updated to "password". so you are entering the old password.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: $.get to retrieve YouTube video using google API returning nothing in IE<p>Below is the code that I have in order to retrieve YouTube videos using Google API...
<p>If you're using IE8 or IE9, it's because although IE8 and IE9 <em>do</em> support <a href="http://www.w3.org/TR/access-control/" rel="nofollow">Cross Origin Resource Sharing</a> (which you need for that request to work), they don't support it using the usual <code>XMLHttpRequest</code> object; instead, you have to u...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: log4j2 doesnt write log in files<p>following XML configuration is my log4j config, I see the log messages in console but the log file is empty, whats wrong i...
<p>How does your code obtain Logger instances? Assuming your code looks something like this:</p> <pre><code>Logger log = LogManager.getLogger(com.mycompany.MyClass.class); log.info("Where is my message?"); </code></pre> <p>Note that the fully qualified name of your logger is <code>"com.mycompany.MyClass"</code>. This...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: ExtJS - Store proxy loading data using Array Reader<p>I am having problems loading an array of data from an external file into my store.</p> <p>This is the ...
<p>Okay, I realized what I did wrong. It was a very stupid user error made by me.</p> <p>In my data file: /data/contacts, what I really had was this:</p> <pre><code>[ ["Lisa", "lisa@hotmail.com", "555-222-3333"], ["Bart", "bart@hotmail.com", "555-222-3333"], ["Homer", "homer@hotmail.com", "555-222-3333"],...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Autoregressive Recursive Filtering in Statsmodels - 0.5.0 v. 0.6.0<p>Version 0.5.0 of Statsmodels does not contain an obvious function to run an autoregressi...
<p>Can you not use <code>conda update</code>?</p> <p>The source for recursive_filter is here.</p> <p><a href="http://statsmodels.sourceforge.net/devel/_modules/statsmodels/tsa/filters/filtertools.html#recursive_filter" rel="nofollow">http://statsmodels.sourceforge.net/devel/_modules/statsmodels/tsa/filters/filtertool...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using empty boost::accumulators<p>How to check an empty boost::accumulators acc or not? </p> <p>For example: </p> <pre><code>if (acc.isEmpty())//I don't kn...
<p>You could use the accumulator <a href="http://www.boost.org/doc/libs/1_57_0/doc/html/accumulators/user_s_guide.html#accumulators.user_s_guide.the_statistical_accumulators_library.count" rel="nofollow"><code>count</code></a>:</p> <pre><code>if (boost::accumulators::count(acc) == 0)//I don't know what function here ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: sqlite3.ProgrammingError: Incorrect number of bindings supplied. The current statement uses 1, and there are 2 supplied<p>I managed to delete some id, but I ...
<p>Try format strings: </p> <pre><code>db.execute("DELETE FROM mp3player WHERE ID = {myid}".format(myid=myid)) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: why custom tasks on windows scheduler do not execute..?<p>I tried creating a task in windows task scheduler, where i put trigger on some specific time. but e...
<p>From what I can gather you're trying to call <code>Powershell.exe</code> and run <code>Start-BitsTransfer -Source D:\a.exe -Destination C:\ -Asynchronous</code> with it?</p> <p>If this is the case you need to use the <code>-command</code> argument. Also I would recommend just calling <code>Powershell</code> rather ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to connect MS Access to Python using pyodbc<p>I'm having trouble connecting a database in access with pyodbc. I've seen other example codes that appear n...
<p>Since you are using the 32-bit versions of both Microsoft Office and Python you should be good to go once you have the right connection string. It should look like this:</p> <pre class="lang-python prettyprint-override"><code>connStr = ( r"DRIVER={Microsoft Access Driver (*.mdb, *.accdb)};" r"DBQ=C:\full\pa...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to run pytest.main("-v test_script2.py") when test_script2.py needs some command line arguments in order for the test functions to run?<p>I have two scri...
<p>If I understand your question correctly, you can create a <code>conftest.py</code> file and add options to <code>pytest</code> using <code>pytest_addoption</code> hook:</p> <pre><code>def pytest_addoption(parser): parser.addoption( '--arg1', dest="arg1", help="first argument") </code></p...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: No suggestions for triggers when using Pytransitions<p>Trying to use <code>transitions</code> package as per examples provided here <a href="https://github.c...
<p><code>transitions</code> adds triggers at runtime to the model (<code>Matter</code>) instance. This cannot be predicted by IDEs before the initialization code is actually executed. Imho, this is the biggest disadvantage of the way in which <code>transitions</code> works (but again imho, it is also its strength when ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to get the x axis labels to fit the width of the graph?<p>Here is my code:</p> <pre><code>import matplotlib.pyplot as plt fig, ax = plt.subplots() fig.c...
<p>This is because the plot is not only drawing points for the points you specify, but additional ones too. The problem is obvious if you don't change the axis labels:</p> <p><img src="https://i.stack.imgur.com/j8CKU.png" alt="enter image description here"></p> <p>If you want to have 5 ticks for your data, then you n...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: store userId in session_id()<p><em>(I was looking some tips for php session security but in my total ignorance I miss lot of basic things. I'm doing a very b...
<p>It is safe, not.</p> <p>But it depends on the context. Of course, it has nothing to do with $_COOKIE['logged_in']=true, which, for sure, is unsafe. </p> <p>But the following is unsafe too</p> <pre><code> session_id($user_id); $_SESSION['logged_in']=true; </code></pre> <p>Because session_id will be stored in a c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: What's the meaning of suffix icons in Android Studio autocomplete feature?<p><strong>Screenshot:</strong></p> <p><a href="https://i.stack.imgur.com/oAHaW.pn...
<p><code>p</code> is for <em>Property</em></p> <p><code>f</code> is for <em>Field</em></p> <p><code>m</code> is for <em>Method</em></p> <p>(<a href="https://www.jetbrains.com/help/idea/symbols.html" rel="nofollow noreferrer">source</a>)</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I implement onActivityResult and onNewIntent on FlutterActivity<p>I would like to implement onActivityResult and onNewIntent on my Android native sid...
<p>The <code>FlutterActivity</code> class implements the <code>PluginRegistry</code> interface. The <code>PluginRegistry</code> interface defines a method <code>registrarFor</code> which is what you want.</p> <p><a href="https://api.flutter.dev/javadoc/io/flutter/plugin/common/PluginRegistry.html#registrarFor-java.lan...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Mean by levels of factor in R, append as new column<p>I have what I fear may be a simple problem, to which I almost have the solution (indeed, I do have a so...
<p>You could use <code>ave</code> from <code>base R</code></p> <pre><code> test$meanbyname &lt;- with(test, ave(value, name)) </code></pre> <p>Or using <code>mutate</code> from <code>dplyr</code> or <code>:=</code> in <code>data.table</code>, can get the results</p> <p>i.e.</p> <pre><code> library(dplyr) group_by(...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Understanding Firestore's Underlying Serialisation Mechanism<p>I would like to get some information on how the serialisation/deserialisation mechanism works ...
<blockquote> <p>Firestore requires values created from classes which have an empty public constructor, why is this a constraint?</p> </blockquote> <p>When you load data from Firestore, you have the option to read a Java object from the document by calling <a href="https://firebase.google.com/docs/reference/android/c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I automate opening sqlite3.exe shell and running a command, with a single script?<p>I'm looking to run <code>sqlite3.exe</code> then enter the follow...
<p>According to the <code>--help</code> message, and a little experimentation, this seems to work to me:</p> <pre><code>sqlite3 -cmd '.open "file:database.db?node=primary&amp;bind=tcp://0.0.0.0:1234"' </code></pre> <p>This does the same thing, I think:</p> <pre><code>sqlite3 "file:database.db?node=primary&amp;bind=t...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Send Whatsapp Message From Another Android App<p>Is it possible to send someone whatsapp Message with significant number from an android app. For example you...
<p>The way to do it is like this:</p> <pre><code>public void sendWhatsAppMessage() { PackageManager pm = getPackageManager(); try { Intent i = new Intent(Intent.ACTION_SEND); waIntent.setType("text/plain"); String text = "SOME TEXT"; PackageInfo info=pm.getPackageInfo("com.w...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Trying to make a menu that keeps repeating if the user enters something invalid<p>Total beginner here, literally started learning programming for the first t...
<p><code>Convert.ToInt32(Console.ReadLine())</code> will throw an exception if the string cannot be converted to an integer. Instead, you should use <code>int.TryParse</code>, which takes in a <code>string</code> and an <code>out</code> parameter that gets set to the converted value (if successful). It returns a <code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Collapsing all inner braces in Visual Studio 2019<p>Suppose we have something like this:</p> <pre><code>{ // 1 A(); { ...
<p>The feauture I was looking for was in <strong>Edit.Outlining.Collapse All in:</strong></p> <p>It seems to not have a shortcut assigned by default, so</p> <ol> <li><p>I went to <strong>Tools.Options...</strong></p></li> <li><p>Then in the left panel select <strong>Environment > Keyboard</strong></p></li> <li><p>Fin...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Hide tooltip for all page controls Silverlight<p>Recently, I started to work with Silverlight 5. I need to implement the possibility to optionaly hide toolti...
<p>I can't find a convenient way offered by the Silverlight <code>ToolTipService</code> itself.</p> <p>I can think of two possible solutions:</p> <p><strong>First solution:</strong> Introduce a coding rule for your project that basically says:</p> <blockquote> <p>all ToolTip Bindings shall either use the <code>Swi...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to access webcam in OpenCV on PythonAnywhere through Javascript?<p>I have developed a WebApplication in Django that has a view method which contains the ...
<p>I used to do something similar, the scheme I used was as follows:</p> <p><img src="https://i.stack.imgur.com/6QbLP.png" alt="Data flow"></p> <p>As you are already aware, we need javascript to get user's picture from the webcam. I found <a href="https://medium.com/@alexcambose/webcam-live-streaming-with-websockets-...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Not being able to store a DocumentSnapshot in react-redux results in Maximum call stack size exceeded error while paging<p>I am building a react-native app. ...
<p>So, since you cannot store document snapshots in react-redux and since I did not want to switch to redux-firestore which would probably result in changes in my codebase that I don't want to go through at this stage, I came up with this alternative solution. </p> <p>After getting my records from firestore backend, I...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Can you define a global click event handler in .NET (Silverlight and ASP.NET)?<p>As a followup to this question (<a href="https://stackoverflow.com/questions...
<p>In Silverlight you can attach a mouseClick event handler to the UI tree RootElement. You do not need to traverse the tree, the mouseclick event bubble up the whole tree - even if they are handled by intermediate nodes. If you want to catch also events that are already handled, you have to specify this when attaching...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: React selectively not passing new props to rendered object<p>I'm working on a multi-stage form that gets some intermediate data via AJAX based on <a href="ht...
<p>Based on the comments, you are copying the props to state in your ChoiceFields component in getInitialState. getInitialState doesn't get called again when the props are updated, and so you're left looking at stale state. You can add a <a href="http://facebook.github.io/react/docs/component-specs.html#updating-compon...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Removing Unnecessary JSON fields using SPARK (SQL)<p>I'm a new spark user currently playing around with Spark and some big data and I have a question related...
<p>If you are using Spark 1.2, you can do the following (using Scala)...</p> <p>If you already know what fields you want to use, you can construct the schema for these fields and apply this schema to the JSON dataset. Spark SQL will return a SchemaRDD. Then, you can register it and query it as a table. Here is a snipp...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to query on cassandra table using custom index in select clause<p>I have a custom index created by solr on cassandra table</p> <pre><code>CREATE CUSTOM ...
<p>In order to run CQL queries based on your lucene-solr indexes, you have to install DataStax Enterprise 4.6 and use the "solr_query" special column, as described here: <a href="http://www.datastax.com/documentation/datastax_enterprise/4.6/datastax_enterprise/srch/srchCql.html" rel="nofollow">http://www.datastax.com/d...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to fix No Instance(s) Available in wmic?<p>When I put the command wmic qfe list appears No Instance(s) Available and I want to see all the hotfixes insta...
<p>Try Get-HotFix with PowerShell.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Display Student ID and highest score from an array<p>I am having issues figuring out how to properly display a student's ID, out of 10 students, along with t...
<p>Your <code>TestScore</code> function doesn't really do anything. I've modified your code to have a function which returns the index of the student with the best score. Using this index, you can then access that element of the array, and print out its details.</p> <pre><code>#include &lt;iostream&gt; using namespace...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R applying a user-defined function to each row of a column<p>I have a dataframe containing uniprot accession and IDs like this:</p> <pre><code>&gt; a &lt;- ...
<p>I think you are complicated a bit your problem (besides the "typo").</p> <p>As I understand it, you are interested in the last part of the first "sequence", the one after the last <code>|</code>?</p> <p>If so, you can do:</p> <pre><code>a$uniprot_ID &lt;- gsub("^sp\\|{1}[^|]+\\|{1}([^|,]+)($|,.*)","\\1",a$protein...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: java - double cannot be dereferenced<p>I have searched about this error but those didn't solve my problem.</p> <p>field is, JTextfield as:</p> <pre><code>p...
<p>This looks suspicious :</p> <pre><code>//bank = rs.getDouble( "bank" ); </code></pre> <p>If it wasn't commented at some point, it would imply you have a <code>double</code> variable named <code>bank</code>, which may hide your <code>bank</code> class. That would explain the error you got, since <code>double</code>...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Android postDelayed does not delay<p>I have the Problem that my Android app does not delay a second (or 10 seconds), if I use the <code>postDelayed</code> me...
<p>When you call <code>postDelayed()</code>, it just places the <code>Runnable</code> in a queue and returns immediately. It does not wait for the runnable to be executed.</p> <p>If you need something to happen after a delay, put the code in the <code>run()</code> method of the runnable.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: UIFont size not changing in UIPicker<p>I'm attempting to change the font and size of the elements in my UIPicker with the following code: </p> <pre><code>- ...
<p>You have used wrong font name. Try <code>HelveticaNeue</code>. You can find all available font names <a href="http://iosfonts.com/" rel="nofollow">here</a></p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Operator= not working C++<p>I have this in my code:</p> <pre><code>const Member &amp; Member::operator=( const Member &amp; rhs ) { strcpy( this-&gt;fi...
<p>More than likely you're trying to use an rvalue, something like the following:</p> <pre><code>A a; a = A(); </code></pre> <p>If this is the case, the temporary cannot bind to a non-const reference. Hence, the error. You can use the more conventional signature for a copy assignment operator where the parameter is <co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Insert unique rows only and update rows that already exist<p>I have a table called 'Day Zero' which contains a listing_id column, address column and status c...
<p>You could load each file in a separate temporary table, and then implement the logic using <a href="https://docs.microsoft.com/en-us/sql/t-sql/statements/merge-transact-sql?view=sql-server-ver15" rel="nofollow noreferrer">SQL Server's <code>merge</code> syntax</a>:</p> <p>The following query merges data from the LI...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can I terminate a Stream if I don't need any value from termination?<p>I have a Stream that does all processing in <code>peek()</code> methods. I don't n...
<p>This is how I've rewritten the code from the question:</p> <pre><code>Collection&lt;NetworkPart&gt; partsOwningEdge = edgesToNetworkParts.get(originalSegment); partsOwningEdge.forEach(part -&gt; part.integrate(cutSegment)); cutSegment.stream() .map(this::obtainCollectionFor) .forEach(gh -&gt; gh.addAll(part...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Is there a simpler way to write this(java)<pre><code>class apples{ public static void main(String args[]){ int gas = 4; int miles = 50000...
<pre><code>System.out.println(total1 &lt; total2 ? "Buy car 1" : "Buy car 2"); </code></pre> <p>Instead of </p> <pre><code>if (total1 &lt; total2) System.out.println("Buy car 1"); else System.out.println("Buy car 2"); } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Simple for loop for graph<p>So I have produced a matrix B of weights and a vector b of the order in which I want to select nodes.</p> <p>My <code>b=(3 5 1 2...
<p>You can try:</p> <pre><code>sum(B[cbind(head(b,-1),b[-1])]) </code></pre> <p>And fyi, your loop should have been:</p> <pre><code>s = 0 for(i in 1:n-1){ s=s + B[b[i],b[i+1]] } </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to highlight main label for checkbox input using css or jQuery<p>Let's assume i have code like below; </p> <pre><code> &lt;div&gt; &lt;span&...
<p>You can do it quite easily: <div class="snippet" data-lang="js" data-hide="false"> <div class="snippet-code"> <pre class="snippet-code-js lang-js prettyprint-override"><code> $('input[type="checkbox"]').change(function(){ if($('input[type="checkbox"]').is(':checked')){ $('.title').css('color','red'); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Ambiguous reference to template class (C++)<p>I am new to template classes, and tried to implement a very simple program, just to try out the functionality a...
<pre><code>using namespace std; </code></pre> <p>You've just discovered <a href="https://stackoverflow.com/questions/1452721/why-is-using-namespace-std-considered-bad-practice">why <code>using namespace std;</code> is bad practice</a>.</p> <p>This injects the C++ library's <code>std::distance</code> template into you...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Center image on another image<p>I am fairly new to C# GDI+ graphics.</p> <p>I want to draw an image over another, which should be centered horizontally and v...
<p>Solved it , I was drawing the image of fixed width, whereas it should have been with a new width based on the aspect ratio and new height,</p> <p>Also I was taking trying to find the center of the image from Container, which should have been the center of the whole parent Image </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to implement native accelerator readout code in Codename 1 for Android?<p>I am trying to develop a native code in Codename One to read out the accelerome...
<p>Don't extend an Activity, in CodenameOne there is 1 main activity and you should use that. Get a reference to that activity like this:</p> <pre><code>android.app.Activity ctx = com.codename1.impl.android.AndroidNativeUtil.getActivity(); </code></pre> <p>Then get the service:</p> <pre><code> mSensorManager = (Sens...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Get bundle path from c++ without using foundation<p>I am currently developing on a Chromium Embedded framework app. The project consists of a client and a he...
<p>You're importing <code>Foundation.h</code> when you mean <code>#include &lt;CoreFoundation/CoreFoundation.h&gt;</code>. Foundation is an ObjC API (which is not compatible with C++). Core Foundation is a C API. When you include CoreFoundation, <code>CFBundleGetMainBundle()</code> should be fine. Note the <code>CF</co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Creating Cordova Project Netbeans 8.0.1?<p>I use Netbeans v. 8.0.1 normally for HTML5 Applications, either launching them through Chrome or a Android Emulato...
<p>I don't use Netbeans to work with cordova as I do it all through the CLI but I have found this link for you which may help. Seems that uninstalling the IDE and doing a clean install and a bit of configuration worked. </p> <p>Check it out..</p> <p><a href="http://forums.netbeans.org/topic61056.html" rel="nofollow">...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Override style for "Collapse" of antd react component library<p>I am using JSX syntax with *.css for my react component. Below is the <a href="https://ant.de...
<p>I ran into a similar issue where I wanted to conditionally style the background color of the header in each Panel component but not the content. I elected to use a css variable to provide a rule for the background color in my style sheet.</p> <p>You can add a css variable with the value you derive in JavaScript thro...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Django modify or reset migrations<p>I wanted to edit my Models who was working fine(Data was stored with no problem). So I edited the models class, and I run...
<p>Well, if you dont care about the data:</p> <p>1) Drop the database. Create it again. Give and flush privileges to django.</p> <p>2) Erase all migrations folders, but not the <strong>init</strong>.py file, (or just run this in the proyect folder)</p> <pre><code>find . -path "*/migrations/*.py" -not -name "__init__...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to use spinner list in database<p>Now, i create a spinner list which show in programme and there are several choices. If i want to use an spinner list to...
<blockquote> <p>Using OnItemSelectedListener</p> </blockquote> <pre><code>private String category; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); dbhelper = new DBhelper(this); db = dbhelper.getWritableDatabase(); ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Oracle11g SQL - Error missing right parenthesis while creating table<p>I've read many thread concerning my problem, but I still can't find what's the problem...
<p>The error is in these lines:</p> <pre><code>BOOL_COMPTEUR_AFF char(1) not null default 0, BOOL_LOGO_AFF char(1) not null default 0, </code></pre> <p><code>0</code> is a number, not a character literal. Character literals need to be enclosed in single quotes <code>'0'</code>. <a href="https://docs.oracle.com/cd/E11...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: NServiceBus with azure storage queues will process messages without headers indefinitely<p>I am experimenting with a new NServiceBus project using Azure Stor...
<p>NServiceBus Storage Queues transport is making an assumption that the messages arrive with the correct envelope. If that envelope is not found, you will get the exception you see above. For messages that are not constructed by NServiceBus or with a custom envelope, please see the documentation <a href="https://docs....
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Interpret EXC_BAD_ACCESS crash logs related to SwiftUI<p>So i'm getting a recurring crash in my app, when the debugger is attached it just jumps to the first...
<p>In my case this ended up just being bugs on Apple's side in SwiftUI. I submitted feedback reports and they eventually got fixed in later versions of iOS without me making any changes to my code.</p> <p>I don't think there was anything that I could have done myself to track down the crashes and resolve them since the...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: wrap() doesn't work well with after()<pre><code>$(".modal-body").after($('.myDiv').wrap('&lt;form&gt;&lt;/form&gt;')); </code></pre> <p>the after method of ...
<p>You are wrapping the <code>.myDiv</code> element with a <code>form</code> but the <code>wrap</code> element will return the element set which called it that is the <code>myDiv</code> element, so the <code>after()</code> call will receive the <code>myDiv</code> element as its param, so it will move the <code>myDiv</c...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: how to change values in a dropdown list using ajax in Yii<p>in view page i have 2 dropdown</p> <pre><code>&lt;?php $list = CHtml::listData($category, ...
<p>In Your controller you can </p> <pre><code>public function actionMysubcategory(){ $model = new YourModel(); $cid = Yii::app()-&gt;request-&gt;getPost('cid'); $subcategory= Subcategory::model()-&gt;findAll( array('order'=&gt;'sid', 'condition'=&gt;'cid=:cid', 'params'=...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Invoking rake task for specific environment<p>Hello I'm writing a deploy script(rake task) for my mini project. And I have this part when I invoke the db see...
<p>In Rails, you can do as :</p> <pre><code>[arup@app (master)]$ rails g task my_namespace my_task1 create lib/tasks/my_namespace.rake [arup@app (master)]$ cat lib/tasks/my_namespace.rake namespace :my_namespace do desc "TODO" task my_task1: :environment do end end [arup@app (master)]$ </code></pre> <p>N...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Apache Storm - spout and bolts not present in Storm UI<p>I am developing a storm topology locally. I am using the Storm 0.9.2-incubating and have developed a...
<p>Are you running Storm Supervisor? If you deploy a new topology and Supervisor isn't running the topology will show up in the UI but since its never initialized it doesn't show any stats when you click into it.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: 'DataFrame' object is not callable in pyspark<p>I want employee names who are having higher salary than their department average salary in pyspark.</p> <pre...
<h1>Creating Sample DataFrame:</h1> <pre><code>from pyspark.sql import functions as F from pyspark.sql.window import Window data= [[200,'Marketing','Jane','Smith'], [140,'Marketing','Jerry','Soreky'], [120,'Marketing','Justin','Sauren'], [170,'Sales','Joe','Statham'], [190,'Sales','...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Merge multiple streams join in Flink<p>I have three different streams coming from different sources (<strong>Objects:</strong> <code>Trade,MarketData, Weight...
<p>If I understand your goals correctly, there are a couple of points that need to be handled differently:</p> <ul> <li>Don't call <code>clear()</code> on any of the state, because you need to continue to remember the last value you've seen from each of the three streams.</li> <li>Always call <code>out.collect()</code...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How Do I Deal With This C++ Multimap Issue?<p>I am a beginner in C++ working on simple program and I ran into an issue which left me stumped... Basically I c...
<p>Hi the comment of @1201ProgramAlarm is absolutely right, however, I thought by myself, how would I go about "rescuing" the program (a) with minimal effort, (b) to get a correct version and (c) very much in terms of the original version.</p> <p>So here's a new <code>main.cc</code> version (<code>Person.h</code>, <co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Which book teaches the inner workings of how Xcode builds apps from code?<p>I do iOS development and I'd like to have a deeper understanding of what is happe...
<p>You can check this <a href="http://www.objc.io/issue-6/" rel="nofollow">objc.io</a> series of articles about build tools.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: detect 4 interesting pixels<p>I read this picture using OpenCV:</p> <p><img src="https://i.stack.imgur.com/Dnl6M.jpg" alt="enter image description here"></p...
<p>You can stack all contours into one array <code>green</code> and search for the minimum/maximum x/y value:</p> <pre><code>green = np.vstack(contours).reshape((-1, 2)) print "Min X:", green[np.where(green[:, 0] == green[:, 0].min()), :] print "Man X:", green[np.where(green[:, 0] == green[:, 0].max()), :] print "Min ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Exceljs package not retrieving some cell values<p>I am using <a href="https://www.npmjs.com/package/exceljs" rel="nofollow noreferrer">ExcelJS</a> package wh...
<p>Since CSV files don't contain any information about data types, ExcelJS tries to guess: anything that even remotely looks like a date is converted to a Date. But the test isn't perfect, and something like <code>123-456-7890</code> gets converted to <code>7891-01-13T22:00:00.000Z</code>.</p> <p>You can disable date ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Concatenate csv files in powershell, without the first line (except for the first file)<p>I have multiple *.csv files. I want to concatenate them into a sing...
<p>Note: The solution in <strong>this answer intentionally uses <em>plain-text processing</em></strong> to process the files, for two reasons:</p> <ul> <li><p>Use of <code>Import-Csv</code> and <code>Export-Csv</code> incurs significant processing overhead (though that may not matter in a given situation); <strong>pla...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Change default directory src for openwrt compiling package<p>I'm creating a package for openwrt that contains several modules. The package compiles right if ...
<p>The OpenWRt package structure <a href="https://openwrt.org/docs/guide-developer/packages" rel="nofollow noreferrer">can be found here</a>. The interresting part for you is <code>Bundle source code with OpenWrt Makefile</code>. </p> <p>(I am afraid the <code>Makefile</code> should be just <code>Makefile</code> witho...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How can you create a command to run other applications in Windows Batch?<p>My goal is to run other programs through the command of one in Windows Batch. <a h...
<p>you can use <code>&amp;&amp;</code> if you wanna run the commands in a single terminal using a queue.</p> <pre><code>command1.bat &amp;&amp; command2.bat &amp;&amp; command3.bat &amp;&amp; test.html </code></pre> <p>if you use <code>start</code> before any commands here it opens on a new window.</p> <pre><code>st...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Accessibility of inner class members from enclosing class<p>I thought members of an inner class, even when declared private, is accessible from its enclosing...
<p>Because the return type of your method <code>iterator()</code> is <code>Iterator&lt;Item&gt;</code>, and you don't have any variable <code>i</code> in the class <code>Iterator&lt;Item&gt;</code>.</p> <p>If your method was:</p> <pre><code> public ShuffleIterator iterator() // iterator() method { ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: this.redirect load only blank page<p>This code works good</p> <pre><code> { action: function() { this.render('userprofile'); },...
<p>I realized this is the case (maybe it will help someone):</p> <pre><code>Router.route('/:uname', function() { if (Meteor.user().profile.uname == this.params.uname) { window.location.href = "/mypage"; &lt;--------------------------------- } else { this.render('userprofile') } }); </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Multiple “when”-conditions for a State<p>Say I have following states:</p> <pre><code>State { name: "red_state" when: color === "red" }, State { ...
<p>There is nothing wrong about having multiple conditions for a <code>State</code> in a <code>when</code>, the problem here is having <code>blue_state</code>, <code>circle_state</code> and <code>blue_circle_state</code> all evaluating to true at the same time. The <a href="http://doc.qt.io/qt-5/qml-qtquick-state.html...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: R: Sliding one-ahead forecasts from equation estimated on a fixed period<p>The toy model below stands in for one with a bunch more variables, transforms, lag...
<p>The common way to use the coefficients is by calling the predict(), coefficients(), or summary() function on the model object for what it is worth. You might try the ?predict.lm() documentation for details on formula. </p> <p>A simple example:</p> <pre><code>data.$lagx &lt;- dplyr::lag(data.$x1, 1) #create lag var...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: .NET + C# - Validation not stopping writing to database<p>I have made this very very simple registration and login page. But my validations doesnt work. This...
<p>You aren't checking that the page has passed validation in your server-side post back event handling code. You should include a check on <code>Page.IsValid</code> in your click event handler <em>before</em> submitting data to the database, e.g.</p> <pre><code>if(Page.IsValid) { //try/catch block } else { //...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: error could not parse command in python<p>I'm following <a href="http://flowingdata.com/2014/05/07/downloading-your-email-metadata/" rel="nofollow">a tutoria...
<p>I think you converted the wrong thing. It looks like the library is working with <code>bytes</code> rather than <code>str</code>. Try:</p> <pre><code>b','.join(uids) </code></pre>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Orchard CMS causing System.StackOverflow Exception in w3wp.exe<p>I recently installed Orchard V1.8.1 via the Web Platform Installer. It was set up to run on ...
<p>I had this exact issue, it turned out that I was trying to call the partial it was actually in, therefore getting into a loop.</p> <p>So within my 'Parts/TabledData/Pagination' .cshtml file I had this:</p> <pre><code>@Html.Partial("Parts/TabledData/Pagination") </code></pre> <p>Hope this helps! </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: WPF: How to achieve a dependency property editng as a percentage/slider in the designer<p>I have a dependency property of type double that expresses a percen...
<p><strong>EDIT</strong></p> <p>Just realised you are talking about DesignTime editor.</p> <p>Please see: <a href="https://msdn.microsoft.com/en-us/library/bb907382(v=vs.100).aspx" rel="nofollow">Creating Custom Editors</a></p> <p>More specifically: <a href="https://msdn.microsoft.com/en-us/library/bb546970(v=vs.100...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: javascript removing characters from multiple strings using a for loop<p>I'm reading a log file using file reader and then want to do some text manipulation u...
<p>Strings are immutable, you have to write it back</p> <pre><code>for(x=0;x&lt;arrayOfLines.length;x++) { arrayOfLines[x] = arrayOfLines[x].replace(/ /g,''); } </code></pre> <p>You could also just trim it to remove leading and following whitespace</p> <pre><code>arrayOfLines[x] = arrayOfLines[x].trim(); </co...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to open WhatsApp programmatically and then get back to my app?<p>In my app I need to send links via WhatsApp. So this is how I do that:</p> <pre><code> ...
<p>It's not possible. The only theoretic way for this to work would be to send URI for your app to be opened by whatsapp in their completion handler. However, whatsapp scheme doesn't support such things so there is no way to force it to open your app after it has sent the message.</p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: is it possible to declare a Java Class variable using getClass()?<p>All of the relevant classes in my application instantiate a version of the class <code>Lo...
<p>Yes, it is possible to do it with reflection. You might iterate the fields and then call your method on a <code>Logger</code> field. Something like,</p> <pre><code>public void writeText(Object parameter) { Class&lt;?&gt; aClass = parameter.getClass(); for (Field f : aClass.getDeclaredFields()) { if ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Aligning multiple plot in egg::ggarrange<p>I'm making a multiplot with egg::ggarrange for 5 figures. I'm wondering how can I aligning plot area of b,d and c,...
<p>You could just make the y scales equal, or at least have the same number of decimal points:</p> <pre><code> library(egg) library(ggplot2) library(ggpubr) data("ToothGrowth") data("mtcars") P1 &lt;- ggplot(mtcars, aes(x = wt, y = mpg, color=cyl))+ geom_point() # Add correlati...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: C string one character shorter than defined length?<p>Very new to c++ and I have the following code:</p> <pre><code>char input[3]; cout &lt;&lt; "Enter inp...
<p>Remember that c-strings are null terminated. To store 3 characters you need to allocate space for 4 because of the null terminator. </p> <p>Also as the @MikeSeymour mentioned in the comments in c++ its best to avoid the issue completely and use std::string. </p>
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Selecting another radio button inside OnClick event<p>I have two radio buttons rdoA &amp; rdoB. My requirement is whenever user clicks rdoA, I have to check ...
<p>I was once fighting a similar issue and found the solution to be (adapted to your code)</p> <pre><code>procedure TForm6.rdoAClick(Sender: TObject); var save: TNotifyEvent; begin if MessageDlg('Allow change?',mtConfirmation, [mbYes,mbNo],0) = mrNo then begin save := rdoB.OnClick; rdoB.OnClick := nil; ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Reading and printing a file in C<p>Ok, I'm trying to read in a text file with my information. The text file contents is this:</p> <p><strong>gasData.txt</st...
<p>You are likely overflowing the buffers and overwrinting the <code>'\0'</code> terminator try this</p> <pre><code>fscanf(fileInput, "%9s%9s%f", id, odometer, &amp;gallons); </code></pre> <p>and also, check that <code>fscanf()</code> did succeed, otherwise the values will be uninitialized and the same thing will hap...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: mysql trigger after update column from another table<p>I have 2 tables which are below. </p> <p>I would like to create a trigger for table_one. when changed...
<p>Do a <code>BEFORE UPDATE</code> trigger, not an <code>AFTER UPDATE</code> trigger.</p> <p>(I don't think it's possible in an AFTER UPDATE trigger to modify the row that was updated, that fired the trigger. I could be wrong about that, but I just can't wrap my brain around how that would work.)</p> <p>This is a dem...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: MySQLWorkbench doesn't run on Windows 8.1<p>I have downloaded the MySQLWorkbench from <a href="http://dev.mysql.com/downloads/workbench/" rel="nofollow">this...
<p>Did you read the section about require prerequisites?</p> <p><img src="https://i.stack.imgur.com/fDBZn.png" alt="enter image description here"></p> <p>The installer should also have given you a notice if something is missing. I recommend however to use the <a href="http://dev.mysql.com/downloads/windows/installer/...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: golang defining dict like python with and appending value to list in dict<p>I am new to go and trying to implement python like nested structure as below, I a...
<p>Its not quite as clean .. but this does roughly what you want and should get you started on the right path:</p> <pre><code>type someObj struct { } func main() { items := map[string][]someObj{ "item1": []someObj{someObj{}}, "item2": []someObj{someObj{}}, "item3": []someObj{someObj{}}, ...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: How to turn off the pager for AWS CLI return value?<p>I am attempting to utilize the AWS CLI along with a <code>for</code> loop in bash to iteratively purge ...
<p>Just running into this issue myself, I was able to disable the behaviour by invoking the aws cli as <code>AWS_PAGER="" aws ...</code>.</p> <p>Alternatively you could simply <code>export AWS_PAGER=""</code> at the top of your (bash) script.</p> <p>Source: <a href="https://github.com/aws/aws-cli/pull/4702#issue-3449...
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions. Stackoverflow question: Using a variable for path in drupal_get_normal_path<p>I am new to drupal coding and still fairly new to PHP. I have gotten myself to a certain point, and am ...
<p>Think this is fairly similar to this question <a href="https://drupal.stackexchange.com/questions/120402/how-to-get-nid-from-url-alias-in-drupal-7">here</a>.</p> <p>What you're doing wrong is assuming that that function returns a node - it doesn't, just returns the internal path to that node. So you still have to g...