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:
Google Spreadsheet conditional formatting based on AND/OR<p>I have the following spreadsheet format:</p>
<pre><code>Company A B C
Microsoft ... | <p>Please try: </p>
<pre><code>=OR($B1<$C1,$B1<$D1)
</code></pre>
<p>with formatting and Range: to suit.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use Pandas DF values as string in Python so i can sendkeys in Selenium with the exact valeu extracted from Pandas DF?<p>So i have a csv file with stoc... | <p>You can loop through your DataFrame as such:</p>
<pre><code>import pandas as pd
df = pd.DataFrame(columns=["Symbol","Price"], data=[["APPL",319.61],["GOOG",1508.79],["AMZN",2150.80]])
for index, row in df.iterrows():
print(index)
print(row['Symbol'])
print(row['Price'])
</code></pre>
<p>There are fas... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
submit Crashlytics: Unable to submit build - iOS app Jenkins<p>I use <code>Crashlytics</code> and <code>Jenkins</code>.
I have some problem when upload app ... | <p>Following up from my comment, if you have declared one of the optional parameters such as -notesPath or -emails then make sure you also pass in a value or remove the parameter and you'll be all set :) </p>
<p>-Mike from Crashlytics</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Fatal Exception: main java.lang.RuntimeException: Unable to start activity a lot of bug<p>I added <code>scrollview</code> in my <code>activity_main.xml</code... | <p>You've got this error in <code>setContentView(R.layout.activity_main);</code> and its because of memory problems. It seems you've used a big image.
You must scale down your image. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Override/move values from bottom rows to upper rows in specific columns (pandas)<p>I'm having a dataframe as shown below, and would like to move the values f... | <p>Here is one way:</p>
<pre><code>df = df.rename(index={'expense':'income'}, level=1).fillna(0).groupby(level=[0,1]).sum()
df
</code></pre>
<p>Output:</p>
<pre><code> loan csn Salary phone spotify rent
Apr income 1200 13000 2000.0 300 49 3500
Aug income 1200 13000 2000.0 300 ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create HTTP Session in Go<p>I am currently using fasthttp for sending my requests my question is, is there a way to have a persistent session? I need ... | <p><em>Based on your question I think this is already clear to you, but just in case:</em>
Sessions aren't started on the client, they are started on the server. The server checks to see if a specific cookie exists; if it does it resumes the session that the cookie identifies; if it doesn't it creates a new session an... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Preg_grep pattern to get something between specific things<p>file contains : </p>
<pre><code> <a href="site.com/" h="
<a href="site3.com/" h="
</... | <p>Here's an example how to use <a href="http://php.net/manual/en/class.domdocument.php" rel="nofollow">DOMDocument</a></p>
<pre><code>$html = '
<a href="site.com/">link1</a>
<a href="site3.com/">link2</a>
';
$dom = new DOMDocument();
$dom->loadHTML($html);
$links = $dom->getEle... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Annoying, red highlighting of random words in vim<p>I have this problem identifying the reason word get this annoying red background in my vim:</p>
<p><img ... | <p>You have the spell check switched on. Switch it off using</p>
<pre><code>:set nospell
</code></pre>
<p>(source: <a href="http://www.linux.com/learn/tutorials/357267-using-spell-checking-in-vim">http://www.linux.com/learn/tutorials/357267-using-spell-checking-in-vim</a>)</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Wordpress - white space margin<p>I've manage to hide the top bar and menu on wordpress page but white space is being displayed on mobile devices at the top o... | <p>Edit your style.css link : [<a href="https://iroae.com/wp-content/themes/shopkeeper/css/styles.css][css" rel="nofollow noreferrer">https://iroae.com/wp-content/themes/shopkeeper/css/styles.css][css</a> file]</p>
<p>so in your file directory path will be : wp-content/themes/shopkeeper/css/ and file will be style.css... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Name Hiding in C++ vs Java<p>I learned something new about C++ the other day; the following does not work:</p>
<pre><code>class ParentClass {
public:
... | <p>If you're asking what the rules are, then name lookup stops as soon as it finds one or more overloads within one scope, and doesn't look at any wider scopes. So, in your case, the search for <code>someFunction</code> starts in the scope of <code>ChildClass</code>, finds a match, and stops.</p>
<p>Only the name is c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sending Api requests from Android to Localhost<p>Im trying to get my android app in my phone to talk with the spring boot backend. I tried setting the ip add... | <p>Instruction for the local host to physical mobile.
your mobile and laptop must be connected on same WiFi. Then you need to set your laptop ip on link from the command prompt.command ipconfig and get ipv4address from the result</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I strip dollar signs ($) from a field in Hive?<p>I'm trying to import a csv into Hive. I have a column which is a dollar value and is reported within... | <p>This should work:</p>
<pre><code>select float(regexp_replace(substr('$123,244.00', 2, length('$123,244.00')), ',', '')) from table;
</code></pre>
<p>You need to remove any commas as well as the dollar sign. You may find this link helpful as well: <a href="https://cwiki.apache.org/confluence/display/Hive/LanguageMa... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
python + flask passing data from html back to python script (specifically the value of a label)<p>I am using python and flask to make a web app. I am new to ... | <p>Why not just do:</p>
<pre><code>...
<input type="button" value="Approve" name="approve" onclick="window.location='/approve/{{post.id}};">
<input type="button" value="Deny" onclick="window.location='/deny/{{post.id}}';">
...
</code></pre>
<p>Then your flask route for <code>approve</code> and / or <co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
UITextfield output to string<p>I can't figure out how to get the output of the textfield into a string to use with parse password reset method. Here is my co... | <p>You can use the <a href="https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIAlertController_class/index.html#//apple_ref/occ/instp/UIAlertController/textFields" rel="nofollow">textFields</a> property of <code>UIAlertController</code>.</p>
<p>You can do that in two ways:</p>
<pre><co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Only one item from jdbc mysql data shows up in my html dropdown split up as characters - Appscript. Why?<p>I am setting up an HTML dropdown displaying items ... | <p><strong>Problem</strong></p>
<p>Watch your types closely - <code>subjectfromDB()</code> returns a <code>String</code>, which you then pass to the template via <code>listfiltered</code> property. Once the template evaluates, your loop starts to iterate over <code>listfiltered</code>, which means that it iterates ove... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Matching elasticsearch data indexed by Titan<p>I have indexed titan data in elasticsearch, it worked fine and indexed but when i see the data in elasticsearc... | <p>The field names are Long encoded. You can reverse encode using this class</p>
<pre><code>com.thinkaurelius.titan.util.encoding.LongEncoding
</code></pre>
<p>or, an even better option if you can use it, would be to simply specify the search field names explicitly using the field mapping:</p>
<blockquote>
<p>By d... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can jQuery give me a list of children excluding certain sub-tags by class name?<p>I am working on an editor which first generates forms (C++ code) then which... | <p>You can use the not selector to filter descendants:</p>
<pre><code>var widgets = jQuery(forms[i]).find(".snap-widget").not(jQuery(forms[i]).find(".snap-editor .snap-widget"));
</code></pre>
<p>The find will only be looking at descendents of the selected snap-editor, but not the selected snap-editor itself. So any ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the wrong with my sql query?<p>I want to make a code but it is showing me a wrong text </p>
<blockquote>
<p>Conversion failed when converting the ... | <p><code>DATEPART</code> returns integer, while 'DVR' is a string. Obviously, your SQL engine tries to cast 'DVR' to integer and fails. Try converting the result of <code>DATEPART</code> to string (e.g. varchar) using <code>CAST</code>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Running 'php artisan migrate:fresh' in Laravel code<p>Is it possible to run <code>php artisan migrate:fresh</code> in the actual Laravel code without the she... | <p>You can run <code>artisan</code> command from your controller like this</p>
<pre><code>use Artisan;
public function artisan()
{
Artisan::call('migrate:fresh');
Artisan::call('make:seeder UsersTableSeeder');
Artisan::call('config:clear');
}
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to concatenate two variable of which one is string and other is not<p>I want my function to search for two indexes say "name" and "state". This is done a... | <p>This should do:</p>
<pre><code>s = near_city + "," + str(state)
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Shader's function parameters performance<p>I'm trying to understand how passing parameters is implemented in shader languages.</p>
<p>I've read several artic... | <p>According to the spec, values are always copied. For <code>in</code> parameters, the are copied at call time, for <code>out</code> parameters at return time, and for <code>inout</code> parameters at both call and return time.</p>
<p>In the language of the spec (GLSL 4.50, section 6.1.1 "Function Calling Conventions... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Lookahead regular expression - Identify duplicate consecutive letters<p>I have a string - for example, "Hello Worrld". Notice the "r" letter repeats twice.</... | <p>You could use pcre bindings, however if you just want to remove dup letters you could use <a href="http://golang.org/pkg/strings/#Map"><code>strings.Map</code></a>, for example:</p>
<pre><code>func stripDups(s string) string {
var last rune
return strings.Map(func(r rune) rune {
if r != last {
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Android Studio Java : Cannot resolve symbol override<p>I'm a beginner with Java and Android Studio.
I try to implemet a OnEditorActionListener that listens f... | <p>It should be @Override not @override. O must be capital in @Override.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Passing path parameter to a React context provider<p>I have a React context that provides "project" information to child components, and I'd like the keep al... | <blockquote>
<p>The challenge is: <strong>how to pass the projectID</strong>, which is a URL param, into the context class?</p>
</blockquote>
<p>Of course <strong>by context</strong>:</p>
<pre><code> this.state = {
projectID: null,
project: null,
refreshProject: this.refresh
}
</code>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
NET Core 3.1 - 403 when [Authorize(Roles = "Administrator")]<p>I'm using Identity Server features, with NET Core 3.1.</p>
<p>What are the requirements in th... | <p>I was missing this. </p>
<pre><code>services.AddAuthentication(options =>
{
options.DefaultAuthenticateScheme = IdentityConstants.ApplicationScheme;
options.DefaultChallengeScheme = IdentityConstants.ApplicationScheme;
options.DefaultSignInScheme = IdentityConstants.ExternalScheme;
});
</code></pre>
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sorting array using medians<p>So lets Assume that you have an algorithm for a method that finds the median of an array and lets call this method X. X would b... | <p>You can solve this problem by applying X recursively. Consider the following sub-routine Y:</p>
<ol>
<li>Given an array of length <code>n</code> as input, we first apply the method X to find the median <code>m</code> of the input numbers, this takes time <code>O(n)</code>.</li>
<li>We then scan the input array to r... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Considering Autocompletion. How to tell Geany in which directories to look for header files?<p>I am coming from KDE to XFCE and hence arrive from KDevelop at... | <p>Geany is not supporting dynamic parsing of header files due to the performances and resources impact it would have. </p>
<p>However, you can generate a tag file from your headers as described inside <a href="http://www.geany.org/manual/current/index.html#generating-a-global-tags-file" rel="nofollow">manual</a> or m... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What are the differences with the following templated functions using default template parameters/arguments<p>I don't think I understand what the difference ... | <p>In most circumstances, the fourth version is the reasonable version.</p>
<p>For the first two versions, the default argument will not be used unless the user explicitly provides a template argument for <code>comparer_t</code>, because template argument deduction happens before default arguments are plugged in; in o... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Xcode 6.1.1 Indexing Forever on a Brand new project<p>I just created a new Project (with no pod files) in Xcode and it stuck on indexing (the spinning loadin... | <p>I solved it by downloading Xcode 6.3 Beta but I don't think that, that should be the right solution. Feel free to comment on this..</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to put a scroll view to many linear layout?<p>I have designed this User Interface since it wont show the whole activity I want to put a scrollview to the... | <p>I am sorry If I don't get you, but I think this is what you need...</p>
<pre><code><ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="0.10"
android:fil... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Currying in Haskell<p>I was manually writing a currying function in Haskell as follows.
<code>curry f = \x y -> f(x,y)</code>
Then I use this <code>max(x,... | <p>You ran into the <a href="https://wiki.haskell.org/Monomorphism_restriction" rel="noreferrer">dreaded monomorphism restriction</a>, which limits where Haskell can infer polymorphic types.</p>
<p>A binding that does not "look" like a function—has no named arguments—cannot have a polymorphic type. The problem is that... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I search for a string inside double quotes?<p>I want to search for regex by separating each word and the string of double quotes.</p>
<p>For example... | <p>What about this regex: <code>\\".*?(?<!\\\\)\\"|\S+</code></p>
<h3>Explanation</h3>
<ul>
<li><p><code>\\".*?</code> matches <code>\"</code> followed by anything with the ungreedy search.</p>
</li>
<li><p><code>(?<!\\\\)\\"</code> matches <code>\"</code> which is not preceded by <c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rails - Run Rake tasks with Capistrano<p>Im scratching my head here wondering if I'm barking up the wrong tree. I have a server which I've deployed a Rails ... | <p>If you need to update models, you can of course write a Rails migration - this will ensure that it's run if it hasn't been run yet.</p>
<p>The easiest way to execute a rake task on the server would be just via ssh if it's a one-time task. See the last paragraph in the tutorial you mentioned:</p>
<pre><code>cd /opt... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
sql count number of rows(videos) added by the CURRENT userid<p>I have this sql code but it doesn't seem to work.
I have a video site on joomla 3.3</p>
<p>he... | <p>As you've already mentioned, the <code>memberid</code> and ID of the user in the <code>#__users</code> table match, so I would recommend using the following query which uses the latest Joomla coding standards:</p>
<pre><code><?php
$db = JFactory::getDbo();
$user = JFactory::getUser();
$cuid = $user... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to reproduce experiments in a non-adhoc manner<p>For a master thesis in the field of distributed computing (think of hadoop and two-level schedulers like... | <p>Here is a a good survey on <a href="https://hal.inria.fr/hal-01087519/file/main.pdf" rel="nofollow">experiment description languages</a>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I tried to fetch bulkcollect records from sys_refcursor and tried to insert another table using forall but it throw an error message<p>--My first procedure</... | <p>This looks like some bug or restriction when you try to do bulk binding while returning <code>collection</code> or <code>sys_refcursor</code> from another Procedure.
However, you have many other options rather bulk binding (Looping using <code>FORALL</code>) which are equally performant.</p>
<p>Alternative are as ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Automatically open/close keyboard using SearchView in Toolbar<p>I'm having big problems opening and closing the keyboard using a searchview in my toolbar as ... | <p>If your searchView is not always in expanded state, then you can try below code:</p>
<pre><code>mSearchView.setIconifiedByDefault(true);
mMenuItem.setOnActionExpandListener(new MenuItem.OnActionExpandListener() {
@Override
public boolean onMenuItemActionExpand(MenuItem item) {
// Add code here
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Instagram-like filters color transform matrix<p>I'm trying to create some instagram-like filters for an iOS app, and i need the 4x5 color transform matrices ... | <p>The app was being developed using Adobe Air, and i used this library to apply the filters.</p>
<p><a href="https://github.com/inspirit/GPUImage" rel="nofollow">https://github.com/inspirit/GPUImage</a></p>
<p>I was not able to implement the filters described in the Question, and end up using photoshop curves to ach... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Replacing string variable with punctuation in R without removing other string<p>In R, I am having trouble replacing a substring that has punctuation. Ie with... | <pre><code>string <- "r.Export"
short <- "r\\."
replacement <- "Report."
gsub(short,replacement,string)
</code></pre>
<p>Returns:</p>
<pre><code>[1] "Report.Export"
</code></pre>
<p>Or, using <code>fixed=TRUE</code>:</p>
<pre><code>string <- "r.Export"
short <- "r."
replacement <- "Report."
gsub... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
a[1:-1] vs a[1:len(a)] in Python<p>I was working on the PygLatin exercise on Codeacademy and one point of the exercise asked you to slice the variable so tha... | <p>As <a href="https://docs.python.org/2/library/stdtypes.html#sequence-types-str-unicode-list-tuple-bytearray-buffer-xrange" rel="noreferrer">documented</a>, a slice <code>[x:y]</code> includes the element at index <code>x</code> but not at <code>y</code>. So <code>[1:-1]</code> is everything from (and including) the... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
InstallShield Automation can't create object<p>I am working with Installshield 2014 and 2011. I'm using major upgrades and automated build scripts to handle ... | <p>Did you install the automation interface? Typically it's an optional feature that's set to absent when you install InstallShield.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert an Eigen matrix to Triplet form C++<p>I think Eigen uses compressed methods to store sparse matrices. Is there any way that I can extract Triplet-for... | <p>Simply as shown in the <a href="http://eigen.tuxfamily.org/dox/group__TutorialSparse.html" rel="nofollow">tutorial</a>:</p>
<pre><code>#include <Eigen/Sparse>
#include <iostream>
using namespace Eigen;
using std::cout;
using std::endl;
typedef Triplet<int> Trip;
int main(int argc, char *argv[])... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Page jumps down when I click on a popup<p>When I click on a link on a page a lightbox pops up. But the page also jumps to the end of the page.
In the consol... | <p>The plugin Quform Form Builder was causing the error. It looks like a jquery conflict. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Hovering over the legend will hide all lines except the corresponding line<p>When you hover over the legend, all lines except the corresponding line will be ... | <p>The solution below hides all lines but the one that is being clicked (not hovered). This code works for Bokeh v1.3.4</p>
<pre><code>import numpy as np
from bokeh.plotting import figure, show
from bokeh.models import CustomJS
colors = ['orange', 'cyan', 'lightgreen']
p = figure()
lines = [p.line(np.arange(10), np.... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Run "Bundle Install" w/o Installing a Specific Dependency Gem - Rails<p>I'm trying to run <code>bundle</code> on a Win machine for an existing app. One of th... | <p>You can find the gem which uses the hiredis, from the Gemfile.lock. Search for hiredis, and check to see under which Gem is that hiredis appearing.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
jQuery append params to url<p>I like the way jQuery's $.ajax() method allows to specify request url:</p>
<pre><code>{
url: 'http://domain.com/?param=1',
... | <p>Since other replies didn't answer my question, i have made a few tests with the <code>$.ajax()</code> call to see how it merges urls with param data.</p>
<p>My findings so far:</p>
<ul>
<li>if url contains a <code>?</code>, then <code>$.ajax()</code> will append <code>'&'</code> + <code>$.param(data)</code></l... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Count order values in a row, over a column<p>I have a dataframe with 3 columns: A, B, C
In each column there is values going from 0 to 10
I want to figure ou... | <p>Using the sample data from <a href="https://stackoverflow.com/users/3732271/akrun">akrun</a></p>
<p>I made a simple function that returns the combination of letters in the right order and then a simple table</p>
<pre><code>set.seed(24)
df <- as.data.frame(
matrix(
sample(0:10, 3 * 50, replace = TRUE),... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Transform a list of maps in Elixir<p>I have a list of maps, that I get from querying my database.It has a datetime field that I want to transform into anothe... | <p>To transform a single map, you can do </p>
<pre><code>%{map | end: DateTime.to_unix(map.end), start: DateTime.to_unix(map.start) }
</code></pre>
<p>So just <code>Enum.map</code> over the list to apply this to all list members:</p>
<pre><code>Enum.map(list, fn map -> %{map | end: DateTime.to_unix(map.end), star... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to change string in shell (and copy file-script)<p>I usually work with bash, and I know how to do it there</p>
<p>but this script must be added to a </p... | <p>You will be writing in some version of sh thanks to the shebang.
Try the following:</p>
<pre><code>newdir=$(basename "$1" | cut -d. -f1)
if [ -d ../logs/${newdir} ]; then
cp ../../files/customSettings.ini ../logs/${newdir}
else
echo I do not want to mkdir -p ../logs/${newdir}, maybe something wrong with scrip... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Automator Apple Script to convert jpeg image<p>I used below automator function to convert png image to jpeg in bulk. It worked fine and converted all images ... | <p>Unfortunately this functionality is just not available in that Action (weirdly). I would suggest using the "Run Shell Script" Action.</p>
<p><strong>[EDIT: I've replaced everything here with new graphic and thorough explanation.]</strong></p>
<p>Explanation:</p>
<p><strong>In the red box:</strong></p>
<p>These a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Append a attribute in xml using Powershell based on a condition<p>Below is my XML code:</p>
<pre><code><office>
<staff branch=" Culver City" Type="... | <p>I would use XPath to filter the XML nodes by the <code>age</code> value:</p>
<pre><code>$xmlPath = "C:\Users\rparpani\Desktop\test.xml"
$xml = New-Object XML
$xml.Load($xmlPath)
$nodes = $xml.SelectNodes("/office/staff/employee[number(age) >= 40]")
foreach ($node in $nodes) {
$node.SetAttribute("status", "fir... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Closing Zabbix problems through Grafana interface?<p>There is
zabbix_server (Zabbix) 4.4.4
and Grafana v6.5.3</p>
<p>A template with problems from Zabbix is... | <p>I assume that you are using the Zabbix Grafana Plugin from Alexander Zobnin.</p>
<p>Regarding your request: It's not possible right now, but there's a <a href="https://github.com/alexanderzobnin/grafana-zabbix/issues/524" rel="nofollow noreferrer">feature request</a> about it.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating a JSON Array?<p>I'm trying create a JSON Array using PHP. But I want this JSON receive a master key like this: <code>cidades:[{"id":"1", "nome":"Gua... | <p>Try this:</p>
<pre><code>$arr["cidades"] = array();
array_push($arr["cidades"], $result);
</code></pre>
<p>This code produces a JSON formatted data with a key named "cidades" attached to it so that something like <code>cidades:[{"id":"1", "nome":"Guaira"}]</code> is produced. For clarity check out <a href="http://... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Client cannot connect to SignalR hub of a Blazor WebAssembly app running on IIS hosting environment<p>I have created a Blazor WebAssembly Solution according ... | <p>WebSockets is enabled by default on IISExpress (used for local testing) but disabled by default on full-fat IIS. </p>
<p>So when deploying an application using WebSockets, such as SignalR (or server-side Blazor) you need to enable WebSockets on IIS.</p>
<p>The instructions for enabling IIS WebSockets are found at ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I use my custom ImageView with DataBinding?<p>So I checked this <a href="https://codelabs.developers.google.com/codelabs/advanced-andoid-kotlin-train... | <p>I found the problem in the code sample you posted on Github. Actually, this one was tricky to solve from the snippet you posted, but the error was correctly indicating a problem with the class name.</p>
<p>Your XML referred to the class
<code>com.example.bindingcustomimageview.CustomImage.RatioImageView</code>. ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I properly nest serializers in Django REST Framework?<p>I need to start saying that none of the solutions provided in similar question seem to work fo... | <p>The simplest approach would be to add a latlng field to the Building serializer and implement a method to retrieve it:</p>
<pre><code>class BuildingSerializer(serializers.ModelSerializer):
class Meta:
model = Building
latlng = serializers.SerializerMethodField()
def get_latlng(self, obj):
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Haskell- looping every second element of list<p>I want to be able to loop every second element of a given list. I can do this recursively as so:</p>
<pre><c... | <pre><code>second (x:y:xs) = y : second xs;
second _ = []
</code></pre>
<p>List comprehension may not be useful.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
VB6 get a value selected in a combobox<p>I'm building a combobox with the following: </p>
<pre><code>Select 1 or 2 seats:
1
2
</code></pre>
<p>And I need t... | <p>You can use the <code>ListIndex</code> property of the <code>ComboBox</code> control to get / set the index of the selected item. You use it like so:</p>
<pre><code>Dim nSelectedIndex As Long
nSelectedIndex = cmbNumberOfSeats.ListIndex
If (nSelectedIndex < 0) Then
'No selected item in the combo box
Else
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to replace multiple instances that match one pattern, with a modified version of that instance using RegEx in Python?<p>In a sentence containing multiple... | <p>You can make use of a positive lookbehind and lookahead to make sure you capture spaces which rest in between your conditions:</p>
<pre><code>(?<=[a-zA-z]) (?=[a-zA-Z]'[a-zA-Z])
</code></pre>
<p><a href="https://regex101.com/r/zUCbo0/1" rel="nofollow noreferrer">https://regex101.com/r/zUCbo0/1</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Use a While loop to add to array list<p>I have an array list containing books. What I am trying to do (for various reasons) is use a While loop to keep on ad... | <p>Separate the logic of asking the question for more information from that of updating the list</p>
<pre><code>String decision = "No";
do {
System.out.println("Would you like to add another book?");
decision = keybd.nextLine();
if (decision.equals("Yes")) {
// Get information about book
St... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
session maintenance in Shoping Cart using java servlet<p>i am working on a shopping Cart. which i have to built on Java. which Session maintenance technology... | <p>Hi you can give redis a shot.
<a href="http://redis.io/" rel="nofollow">http://redis.io/</a></p>
<p>Redis is an open source, BSD licensed, advanced key-value cache and store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets, sorted sets, bitmaps and hyperloglogs... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Ember custom conventions<p>I'm build a list-view, which renders a list of records in a table. The list-view is build as a reusable mixin, and has a reusable ... | <p>After some further research (and some fresh eyes), I found the solution:</p>
<pre><code>import Ember from "ember";
export default Ember.Mixin.create({
renderTemplate: function() {
var currentController = this.container.lookup('controller:' + this.routeName);
if (currentController.isGenerated) {
cu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do i remove blank array() php<p>I am retrieving post in CI using get_where query, my where variable is chaking for category is this.</p>
<p>I had pass t... | <p>Add an <code>if</code> condition in there.</p>
<p>For example: </p>
<pre><code>$errors = array_filter($_POST);
if (empty($errors)) {
echo "array is empty.";
}
else
{
echo "It is not empty.";
}
</code></pre>
<p>Or </p>
<p>There are two elements in array and this definitely doesn't mean that array is empty. As... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to pass structures to a function in C<p>I wrote a C code which is formed by these files: <em>main.c</em>, <em>kernel.c</em>. Here are the files:</p>
<p>... | <p>You should change this</p>
<pre><code>collisione(coll_vcm1[i].x,i);
</code></pre>
<p>to</p>
<pre><code>collisione(coll_vcm1, i);
</code></pre>
<p>you where passing the <code>x</code> field at position <code>i</code> in the array, instead of the pointer to the array <code>coll_vcm1</code></p>
<p>Also, note that ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
mysql query to find engine on duration<p>I have data like,</p>
<ul>
<li>engine - time</li>
<li>on - 2015-02-16 10:00</li>
<li>on - 2015-02-16 10:3... | <p>(As per comments, previous attempt was <em>wrong</em>; trying again.)</p>
<pre><code>SELECT @oo := engine FROM tbl ORDER BY time DESC LIMIT 1; -- get 'on'
SELECT @prev := time FROM tbl
WHERE engine != @oo
ORDER BY time DESC LIMIT 1; -- 2015-02-16 11:10 (last 'off')
SELECT CONCAT(
'... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error while drawing a ellipse with python PIL.ImageDraw<p>I used this code to open a window and draw vertices for a graph in a specific place:</p>
<pre><cod... | <p>I suspect you're calling the function wrong. See the <a href="https://pillow.readthedocs.io/en/3.1.x/reference/ImageDraw.html#PIL.ImageDraw.PIL.ImageDraw.Draw.ellipse" rel="nofollow noreferrer">documentation</a>, which suggests you should pass the coordinates as two tuples inside a list:</p>
<pre class="lang-py pre... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert dates with different formats in data frame over multiple columns<p>I have data frame (test) that looks like this:</p>
<pre><code> abx start ... | <p>Here's one way to change the <code>test</code> data frame.</p>
<pre><code>g <- grep("st(art|op)", names(test), value = TRUE)
test[g] <- lapply(test[g], function(x) {
x <- as.character(x)
as.Date(x, format = paste0("%m/%d/%", ifelse(nchar(x) == 8, "y", "Y")))
}))
</code></pre>
<p>which gives</p>
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Linq Conditional Include<p>I am trying to find the most efficient way to solve this problem:</p>
<p>I am retrieving a File from the database. If the FileSiz... | <p>How about:</p>
<pre><code>var item = z.Select(x => new {
File = x,
Content = x.FileSize >= sizeLimit ? null : x.FileContent
}).FirstOrDefault(x => x.File.Id == id);
return item.File;
</code></pre>
<p>Should make the trick, but you'd have to confirm by looking at generated SQL.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Marble testing observable that changes after a method call?<p>In Angular 8, I have a service with a readonly <code>Observable</code> property, spawned from a... | <p>Subscribing to a cold observable produced via the test helper seems to work:</p>
<pre><code>it('should flow states correctly', () => {
scheduler.run(({ expectObservable, cold }) => {
const svc = new StateService();
cold('--a-b-c', {
a: 'begin',
b: 'finish',
c: 'reset'
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
If i import exit() from sys, which exit will it run?<p>In python if i import the exit module from sys will it run the normal exit() or sys.exit()</p>
<pre><... | <p><code>from a import b</code> assigns the variable named <code>b</code> to the imported object, so you're overshadowing the built-in <code>exit</code>.</p>
<p>You can also just print out a string representation of <code>exit</code> to see this. Run</p>
<pre><code>print(exit, type(exit))
from sys import exit
print(e... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
GKE Jenkins can't download image for slave<p>I'm running Jenkins on GKE and having issue when running job - it can't download image for slave - anyone met si... | <p>It happens because the slave is not authenticated within GCP</p>
<p><a href="https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry" rel="nofollow noreferrer">Private registries</a> may require keys to read images from them. Credentials can be provided in several ways:</p>
<ul>
<li>Per-clust... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
javascript events, onfocus<p>Now I'm changing default behavior of onfocus(onclick etc) events like this:</p>
<pre><code><div onfocus="my(this);"> <... | <p>Try this. Change your html to this:</p>
<pre><code><div onclick="my(event);"> test</div>
</code></pre>
<p>And your JS to this:</p>
<pre><code>function my(e){
e.target.style.backgroundColor = "red";//here we do not use getElementById
}
</code></pre>
<p><code>e.target</code>is the element which rec... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Autoreload failed. ModuleNotFoundError : spec not found for the module<pre><code>[autoreload of R17_Plot_profiles failed: Traceback (most recent call last):
... | <p>I did few modifications yesterday and it seems to be solved. Since the error occurence started to be random at some points, i'm not sure for 100% but it can maybe solve the issue. </p>
<p>The problem could be came from the use of <code>os.chdir</code> function, I replaced it by specifying the entire path to save my... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cannot access value from function node.js<p>I am trying to access what a function returns in node.js</p>
<p>I have the following function:</p>
<pre><code>f... | <p>It is a callback style function which wouldn't return any thing. Better to convert it to promise sttyle and use <code>async/await</code> to get the value in a variable</p>
<pre><code>function getImg() {
return new Promise((resolve, reject) => {
https.get('https://api.nasa.gov/planetary/apod?api_key=api-key... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I use different provider to send SMS from Acumatica ERP?<p>Out-of-box Acumatica has <code>Twilio</code> and <code>Amazon SNS</code> providers to send... | <p>Yes, it is possible to use different provider to send SMS. </p>
<p>In Acumatica, SMS service is used for </p>
<ol>
<li>sending access code during <a href="https://help-2019r2.acumatica.com/Help?ScreenId=ShowWiki&pageid=e612d54b-72d9-400c-b913-cdfa02220c58" rel="nofollow noreferrer">two-factor authentication</a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Camel: POST-request routing by URL-pattern<p>I'm trying to catch some POST-request, log a message (and maybe a body or params in future); then pass them furt... | <p>Thanks to @vikingsteve I've started to read about <strong>recipientList</strong>.</p>
<p>I've modified my code according to <a href="http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html" rel="nofollow">this FAQ question</a></p>
<p>The final version looks like this:</p>
<pre><code> from("restlet:http://l... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python: Iterate over dict and list at the same time<p>I want to write a function that can iterate over <code>dict</code> and <code>list</code> in the same wa... | <p>You need to <em>call</em> the <code>dict.items()</code> method:</p>
<pre><code>iter = arg.items() #arg is a dict
</code></pre>
<p>otherwise you'll indeed get an exception telling you that the method itself isn't iterable:</p>
<pre><code>>>> d = {}
>>> for key, value in d.items: # not called
..... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Collision/overlap detection of circles in a d3 transition<p>I'm using d3 to animate a route (path) on a map. When the route reaches a point along the route I... | <p>You can <a href="http://bl.ocks.org/mbostock/3231298">detect collision</a> in your tween function. Define a <code>collide</code> function to be called from inside the tween function as follows:</p>
<pre><code>function collide(node){
var trans = d3.transform(d3.select(node).attr("transform")).translate,
x1... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sum one value in a multidimensional associative array based on matching two other values (php)<p>I have an associative array that is essentially static dummy... | <p>If you write your array like the outpout that you want is better, I suppose that you're array $monthly_sales is like:</p>
<pre><code>Array
(
[0] => Array
(
[YEAR] => 2014
[TitleText] => 1984
[units] => 27
[XML_KEY] => 9992
[MON... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is a node process protected if its JavaScript files changes on the filesystem?<p>I have a nodejs project, and I run a local script</p>
<pre><code>node somet... | <p>Here is an example were something is not yet loaded, and you will get the modified version.</p>
<p>file1.js</p>
<pre><code>require('./file2');
</code></pre>
<p>file2.js</p>
<pre><code>console.log("Waiting 10 seconds");
setTimeout(() => {
require('./file3');
}, 10000);
</code></pre>
<p>file3.js</p>
<pre><c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Django ORM - join a subquery<p>I have to translate this query into Django ORM, but can't seem to get to it.</p>
<p>I tried about every annotate/values/filte... | <p>It's going to be tough to reproduce that exact query. However, you can manage the results in one query, but the generated sql isn't clean. And you don't have access to all of the deal properties.</p>
<pre><code>Task.objects.annotate(
deal_id=Subquery(
DealTask.objects.filter(
task_id=OuterRe... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to cast correctly from long to int?<p>I have such method</p>
<pre><code> public int foo()
{
return (int) MainJsonValues[JsonK... | <p>A boxed value type may only be unboxed to <em>the unboxed type</em> or <em>the nullable unboxed type</em>. That is, if you have a boxed long, you may unbox it to <code>long</code> or <code>long?</code>, but not any other type. (See the comments for details.)</p>
<p>Therefore you need to do the conversion in two ste... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular js 1.7 $onInit function syntax<p>I recently updated my app from angularjs 1.5.9 to angularjs 1.7.9. In one of my controllers I had the following code... | <pre><code>vm.$onInit = _init();
</code></pre>
<p>This is equal to simple <code>_init();</code>, you probably meant <code>vm.$onInit = _init</code>.</p>
<p>In 1.5 you can run init yourself and there was no real difference, but in latest Angularjs bindings are set after your controller main function, but before on ini... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
NSMutableDictionary VS NSMutableArray speed<p>I am using a cache for images that are downloaded from Parse.com. Images are used as the background images for ... | <p>The whole reason to use a dictionary is to have items accessible by a property, not by a numeric index. By using the row index, you are defeating the purpose of having a dictionary.</p>
<p>Instead of <code>[@(indexPath.row*4+i)]</code> use a more stable key, for example the <code>username</code> or the URL of the i... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Difference between Mono/Flux.fromCallable and Mono.defer<p>I usually have the requirement of generating a Mono/Flux whose values will be generated/calculated... | <p><code>Mono.defer</code> is usually used when you already have a <code>Mono</code> from a third-party source, but you want to delay its creation until subscription time because during its creation something is done eagerly.</p>
<p>Consider the following example:</p>
<pre class="lang-java prettyprint-override"><code>p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
manage.py runserver not doing anything<p>Upon using this command, nothing happens. No error or anything. Python is in environment variables and I'm not havin... | <p>Well, I don't have a clear cut answer for you, and I am no expert, but this is what I would suggest. </p>
<p>Try <code>py manage.py check</code> to self check your django app.</p>
<p>Try <code>py -m django --version</code> to ensure django is installed.</p>
<p>Try <code>py manage.py runserver 0.0.0.0:8080</code>.... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why doesn't Erlang/OTP use several supervisors (or does it)?<p>Looking at the documentation for OTP, it appears that a typical way to set up these systems is... | <p>Here's how an OTP application might be set up on one machine:</p>
<p><img src="https://i.stack.imgur.com/ql0oU.png" alt="enter image description here"></p>
<p>There's two <code>-behavior(application)</code> pieces running. Each one has a top-level <code>-behavior(supervisor)</code> modules. It's not unusual to hav... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
React navigation 5 hide tab bar from stack navigator<p>I wanted to know how to hide the bottom tab bar from a specific screen inside my stack navigator that ... | <p>I had almost the same issue with a tabnavigation as parent and stacknavigation as childs and rearranging my screen layer wasn't an option. So I looked for another solution and from the <a href="https://reactnavigation.org/docs/nesting-navigators/#parent-navigators-ui-is-rendered-on-top-of-child-navigator" rel="noref... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
When to create a new Flux Store<p>I was wondering what the best practice or convention is when creating stores in Flux when working with an API</p>
<p>Let's... | <p>I would use the <code>ProjectStore</code>to store both <code>_projects</code>and <code>_activeProject</code>.</p>
<p>I have done as a rule in my React projects to create a new store for each model.
For instance: Let's say that I have an application that serves messages and accounts. I would then have a <code>Messag... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the difference between Authorization and Authentication in Google Analytics API?<p>I am still getting confused in understanding the concepts of autho... | <p><strong>Authentication</strong> is the process of identifying yourself. When you log in to a service, you authenticate yourself by using some credentials. This credentials usually are a pair of username and password. If the provided credentials are correct then we can say that you have successfully authenticated you... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can't save and display data correctly<p>When I'm trying to add data in database and fetch it in data-grid, all the Sindhi characters turn in "???????????" as... | <p>You need to change the characterset to utf8, for instructions on how to do that reffer to the answer to this question. </p>
<p><a href="https://stackoverflow.com/questions/19156727/navicat-utf8-not-working-on-mysql-database">Navicat utf8 not working on mysql database</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Working of == in the Comparable interface used in ArrayList<h2>Working of == operator in Comparable Interface</h2>
<p><strong>Employee.java</strong></p>
<p... | <p>The contract of <code>compareTo</code> says:</p>
<blockquote>
<p>The implementor must ensure <code>sgn(x.compareTo(y)) == -sgn(y.compareTo(x))</code> for all x and y.</p>
</blockquote>
<p>So, when using it like this:</p>
<pre><code>Employee emp = (Employee)obj;
if(age==emp.age)
return 0;
else
return -1;... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ImportError: No module named app<p>I working with Flask-Testing and make file test_app.py to test But I got this error File "test_app.py", line 4, in from a... | <p>From the comments:</p>
<p>There could have been two issues:</p>
<ol>
<li><p>The path to <code>myapplication/</code> hadn't been added to the <code>$PYTHONPATH</code> environment variable (more info <a href="http://users-cs.au.dk/chili/PBI/pythonpath.html" rel="noreferrer">here</a> and <a href="https://stackoverflo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Plot Multiple Y axis + 'hue' from Seaborn<p><strong>Hello World</strong>,</p>
<p>Below is an example of my df</p>
<pre><code>df
Date Name x1 x2 x... | <p>with dataframe melt as per J.K., some chart options:</p>
<pre><code>import seaborn as sns
sns.barplot(x="Date", y='values', hue='Name', data=df, ci=None)
sns.catplot(data=df, x='Date', y='values', hue='Name', kind="bar", ci=None)
</code></pre>
<p>the ci removes the confidence interval draw if you do not need it</... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AMP Story being marked as noindex on Google AMP Validation, but there is no noindex tag inside the AMP Story<p>I have an AMP story page that even if the AMP ... | <p>This is not caused by the contents of your page but rather the HTTP headers. The headers of this page are:</p>
<pre><code>HTTP/1.1 200 OK =>
Date => Wed, 05 Feb 2020 16:39:25 GMT
Server => Apache
Cache-Control => max-age=0, must-revalidate, private
pragma => no-cache
expires => -1
X-Robots-Tag =&... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make an invisible character in HTML, that still get's picked up on text selection?<h3>Backstory</h3>
<p>So I am doing a webchat as a side-project, an... | <p>As all of the elements are organized within their own tags, you could use <code>:after</code> with the character that you want as separator in the content (with <code>font-size:0</code>). As far as I know, this solution will only work on IE, as the other browsers don't select the pseudo-elements):</p>
<pre><code>sp... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to echo current post title in comment form array?<p>I have this code:</p>
<pre><code> comment_form(
array(
'fields' ... | <pre><code>'title_reply' => 'Wat is jouw ervaring met ' . get_the_title($ID)
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vectorize window.zoo over start= and end=<p>I have input data that look like that (reduced to two time-series for the example).</p>
<pre><code>library(zoo)
... | <p>Create the zoo object to be used, convert it to a list of zoo objects and <code>Map</code> (or <code>mapply</code>) over it.</p>
<pre><code>z <- zoo(data, x.Date)
Map(window, as.list(z), start = begin, end = end)
</code></pre>
<p>Note that the key is to use <code>as.list</code>, not <code>list</code>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Loading many CSVs with Pandas<p>I have 3000 CSV files stored on my hard drive, each containing thousands of rows and 10 columns. Rows correspond to dates, an... | <p>Simple Solution.
Go and Download DB Browser for SQlite.
Open it, and create New Database.
After That, go to File and Import Table from CSV. ( Do this for All of your CSV Tables ) Alternatively, you can use Python script and sqlite3 library to be fast and automated for creating table and inserting values from your CS... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Replace null values using groupby.first() in pandas<p>I have a requirement where I have to replace null(NaN) values using the groupby.first element.</p>
<p>... | <p>Try <code>fillna</code> with <code>map</code></p>
<pre><code>s = df.groupby('Name')['Cost'].first().to_dict()
df['Cost'] = df['Cost'].fillna(df['Name'].map(s))
</code></pre>
<hr>
<pre><code>print(df)
ID Name Cost
0 1 A 12.0
1 2 B 16.0
2 3 C 28.0
3 4 A 12.0
4 5 D 33.0
5 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.