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:
Implement extension Method C#<p>I need to implement this method :<code>Reflectable reflect<T>(IEnumerable<T> src)</code>
but i'm having troubles ... | <p>I still think this idea of yours should be murdered in its sleep, or before birth...</p>
<pre><code>public class ReflectionHelper<T>
: IEnumerable<string>
{
private string[] _properties;
private IEnumerable<T> _list;
public ReflectionHelper(IEnumerable<T> list, string[] prop... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Password Validator<p>I'm currently trying to make a password validator work with boolean method, since the teacher asked us to do so. This is driving me nuts... | <p>I suggest you start by creating multiple <code>private</code> and <code>static</code> test methods, and then <em>delegate</em> to them in your <code>public</code> <code>isSecurePassword(String)</code> method. Implement test methods like <code>boolean oneUpper(String)</code>, <code>boolean oneLower(String)</code>, <c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How To Set Button Below In Layout in android<p>hello I want To set Two Button at Bottom
i have Tried So Much but unable To set i want my left right button at... | <p>For aligning views on bottom in Linear layout, just add an empty view with weight="1" so it will take up all the empty space.</p>
<pre><code> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_gravity="bottom"
android:orientation="verti... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Ansible: Invalid JSON when using --extra-vars<h2><strong>Hi community,</strong></h2>
<p>I have been struggling with an issue in ansible issue for days now.
... | <p>There are two answers to your question: the simple one and the correct one</p>
<p>The simple one is that had you actually fed the JSON into <code>jq</code>, or <code>python -m json.tool</code>, you would have observed that <code>namespace</code> is unquoted:</p>
<pre class="lang-js prettyprint-override"><code> ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting No data received for go language form<p>It's the simple form from astaxie's book
when I try '/login' , I get</p>
<pre><code>No Data received { Una... | <p>The problem with your original question (which has been edited several times) was that your <code>ParseFiles()</code> function failed, it was not able to read your template file. You didn't know about this because the <code>error</code> it returned you just discarded. <em>Never do that!</em> The least you can do is ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Batch File to reformat list in text file<p>Been researching a bit, but havent found an answer as of yet, so heres my first official post.</p>
<p>I have an a... | <p>Try this:</p>
<pre><code>@echo off
for /f "usebackq delims=" %%a in ("c:\lame_file.txt") do (
for %%b in (%%a) do >>"c:\better_file.txt" echo %%b
)
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Access 'name' property on React Dropzone component<p>I'm looking to create multiple dropzones in the same component with React Dropzone and I want to handle ... | <p>Ended up solving this by making a Dropzone component and altering what I needed for each dropzone with props thanks to Alvaro's suggestion. Here's what I did</p>
<p>UploadMedia.js</p>
<pre><code>import Dropzone from './Dropzone'
function UploadMedia({ title }){
const [masterFile, setMasterFile] = useState({
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Multiple spans in same String<p>I've got problems to set StyleSpan and ForegroundColorSpan in the same string. Here's my code:</p>
<pre><code>SpannableStrin... | <p>Can you try this</p>
<pre><code>text_1_2.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), 0 , text_1_2.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
text_1_2.setSpan(new ForegroundColorSpan(getResources().getColor(R.color.custom_blue)), 0, text_1_2.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
</code></pre>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to save image to custom album?<p>I have a brand new iOS app that generates images and lets the users save them into the Camera SavedPhotosAlbum. However,... | <p>I came up with this singleton class to handle it:</p>
<pre><code>import Photos
class CustomPhotoAlbum {
static let albumName = "Flashpod"
static let sharedInstance = CustomPhotoAlbum()
var assetCollection: PHAssetCollection!
init() {
func fetchAssetCollectionForAlbum() -> PHAssetColl... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java: Writing out all N-bit sequences containing K 1s<p>I am supposed to write a program that would print out <strong>all possible N-bit sequences with K 1s<... | <p>You almost got it right.</p>
<p>Your problem is here :</p>
<pre><code>int[] seq2 = sequence;
</code></pre>
<p>and here :</p>
<pre><code>int[] seq3 = seq2;
</code></pre>
<p>These assignments mean that you have only one array that you keep changing and adding to the output list.</p>
<p>Change them to :</p>
<pre... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What does <!-- mean in javascript?<p>I saw that <code><!--</code> and <code>--></code> characters sometimes are used around javascript codes as the fol... | <p>Nothing. It's an HTML comment opening stanza.</p>
<p>It has not been necessary to write scripts like that for a very long time. The idea was that it would prevent ugly things from happening in browsers that don't understand the <code><script></code> tag. In 2015, it's pretty safe to operate under the assumpti... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
adding Set<String> into a Java ArrayList<p>I am writing a programme that reads a word String from a file. I am translating the string but the translator ret... | <p>I would suggest not using a list. If you want to know which word was translated into which Set, use a Map (or a dictionary in other languages} </p>
<pre><code>Map<String, Set<String>> translations = new HashMap<>();
while (sc.hasNext()) {
String entry = sc.next();
translations.put(entry, t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
bootstrap: bitcoin glyphicon not appearing<p>I can't seem to show a bitcoin glyphicon:</p>
<p>Code: (in jade)</p>
<pre><code>.input-group
... | <p>You are not using the latest version of Bootstrap. The Bitcoin glyphicon was only introduced in version 3.3.2.</p>
<p>Example:</p>
<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code><script src="https://ajax.go... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to replace partial text on a TextView?<p>I have a text in a textview which says "you have 60 seconds left in the final lap".I am planning to do a countdo... | <p>there is not need to update a partial String. Just change the whole content.</p>
<p>If your string is localized,</p>
<pre><code><string name="my_message">text, %1$d! other tex.</string>
String text = String.format(res.getString(R.string.my_message), number_of_seconds);
</code></pre>
<p>and then</p>
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Firebase - 'pushWithPriority' - and validation<p>I really want to 'push with priority'. But this doesn't exist, so I am planning on doing a push with out par... | <p>Push simply creates a unique id and returns a reference to it. It is a pure client-side operation, so no server-side validations (e.g. Firebase's security rules) are triggered.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
HTTP Status code >= 300 Returning JSON<p>I was wondering if it is acceptable/common to have a server return a JSON response along side a 3xx or 4xx response?... | <p>It's perfectly fine for 3xx or 4xx responses to have body entities, sometimes it's even required.</p>
<p>For example, for <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3" rel="nofollow"><code>300 Multiple Choices</code></a>:</p>
<blockquote>
<p>Unless it was a HEAD request, the response S... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How LXC implements network namespace?<p>I would like to know how LXC implement network namespace. One particular aspect is how it connects the virtual interf... | <p>There are different ways to connect containers to the network, described <a href="https://wiki.debian.org/LXC#Setup_networked_containers" rel="nofollow">here</a>. I always use the SimpleBridge method, because it's easy to setup and I never had any problems with it.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get coordinates of multiple touches in Swift<p>So I've been messing around trying to get the coordinates of touches on the screen. So far I can get the coord... | <p>** Updated to Swift 4 and Xcode 9 (8 Oct 2017) **</p>
<p>First of all, <strong>remember to enable multi-touch events</strong> by setting</p>
<pre><code>self.view.isMultipleTouchEnabled = true
</code></pre>
<p>in your <code>UIViewController</code>'s code, or using the appropriate storyboard option in Xcode:</p>
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Wasm-bindgen: arrays of u8 as inputs and outputs, generated javascript has different function signatures<p>I've written a function that takes an u8 array as ... | <p><code>wasm_bindgen</code> generates two JS files. You're looking at the <code><name>_bg.js</code> file, which exposes the "raw" bindings to the webassembly module, where the arguments are pointers. It should also have generated a <code><name>.js</code> file, which has the functions that use the expected ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to find next N elements from a cursor with MongoDB, without _id and on a sorted cursor<p>Let's say I have three person documents in a MongoDB, inserted i... | <p>Every MongoDB's Aggregation Framework operation's context is restricted to a single document. There's no mechanism like window functions in SQL. Your only way is to use <code>$group</code> to get an array which contains all your documents and then get <code>Austin</code>'s index to be able to apply <a href="https://... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Jest - ReferenceError: imported function is not defined<p>I have been at this for 2 hours now, but couldn't figure out what I am doing wrong. I have followin... | <p>Alright, after a week since I asked this question, I just picked the test back up to solve this. I just didn't think of the below code. I guess staring at the code for hours, that breaks for no reason, can do that to you.</p>
<p>Just do the conversion after the evaluation ..</p>
<pre class="lang-js prettyprint-ove... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove objects from array/hash which is only referenced from that array/hash<h3>Is it possible to remove objects from an array/hash which is only referenced ... | <p>Instead of storing the object itself, you could store a <a href="http://ruby-doc.org/stdlib-2.2.0/libdoc/weakref/rdoc/WeakRef.html" rel="nofollow"><code>WeakRef</code></a>. It allows the referenced object to be garbage-collected:</p>
<pre><code>require 'weakref'
@@long_living_array = []
class Foo
def initialize... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sonarqube, get a difference of issues between 2 runs<p>I am using </p>
<blockquote>
<p>/api/issues/search API</p>
</blockquote>
<p>, but the problem i ha... | <p>The issue key is a randomly generated UUID that is by definition immutable (so you can't change it).</p>
<p>If you want to computing the diff between 2 runs of the same project, you have to:</p>
<ul>
<li>list all issues of the project (unresolved & resolved issues)</li>
<li>check the changelog of each issue to... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
php explode on xml file<p>Here is the xml file I have. ( I do not have editing abilities of the parser that creates this file... so hince why I am asking my ... | <p>If what you are looking for is a way to cleanup the corrupt XML file, you can just add the string that gets missing when the explode is run. It is all a bit hackish, but it works.</p>
<pre><code>$file = '/Users/jasenburkett/Sites/jobsark/feed.xml';
$data = file_get_contents($file);
$split = "</JobSearchResults&... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
want to set y-axis label values in line chart<p><img src="https://i.stack.imgur.com/tCo6J.png" alt="line chart "></p>
<p>want to display the yaxis label in... | <p>This can be setted with yticks and np.arrange as follows:</p>
<pre class="lang-py prettyprint-override"><code>import matplotlib.pyplot as plt
import numpy as np
plt.plot([0.2,0.25,0.3,0.35,0.4,0.45],[0.5,0.6,0.60,0.5,0.5,0.6])
plt.yticks(np.arange(0.2, 0.8, step=0.2))
plt.show()
</code></pre>
<p><a href="https://... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular app is not running on (Ubuntu) digitalocean server?<p>I uploaded my angular app distributed file to a server now i am trying to run angular app on a ... | <p>You must verify the Angular CLI version in your server by using <strong>ng version</strong> command. If you haven't installed CLI you must install it <strong>npm install -g @angular/cli</strong> . Otherwise, you can use <strong>npm start</strong> for the angular app as well</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
flink when to use timewindowAll<p>I have a pipeline that consumes data with the following shape :
<code>case class Foo(source: String, destination: String){d... | <p>You should only use <code>timeWindowAll</code> in cases where you don't want to have key-partitioned windowing. Since you are keying by destination, you should use <code>timeWindow</code>, not <code>timeWindowAll</code>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R Shiny - Wordcloud2 breaking downloadButton<p>I want to create several wordclouds, using <code>wordcloud</code> and <code>wordcloud2</code> packages.
I can ... | <p>This seems to be a bug in the CRAN version of <code>wordcloud2</code>. Install the development version from GitHub with
<code>remotes::install_github("lchiffon/wordcloud2")</code>
for a fix.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Kettle data integration: dates always blank on excel output or excel writer<p>On kettle data integration v. 5.2.0.0 running on windows 8.1 under Java v. 1.8.... | <p>I had the same problem and this worked for me:
<p>I inserted a "Select values" step before the excel writer step that changed the date metadata Type to "Date" and Format to "dd/MM/yyyy" (this is italian locale, may be different for you).
<p>I only added one line in the third sheet of the "Select values" step (the me... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to check if OWLObjectPropertyExpression between classes exists?<p>Assuming two types of classes, one (A) "isManagedBy" by the other (B). The following ow... | <p>I can suggest two solutions to your problem:</p>
<ol>
<li><p>Go through all Bs, but instead check satisfiability of
<code>A and (isManagedBy only (not B))</code>. If this expression is unsatisfiable for some B, then such B has to be connected with a given A via <code>isManagedBy</code>.</p></li>
<li><p>If you are u... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Start Firebird Service under OSX Yosemite<p>Since OSX Yosemite no longer supports StartupItems i am unable to start the Firebird-Service on Bootup. </p>
<p>... | <p>Here is Paul response and fix for Firebird SuperServer on Yosemite</p>
<p><a href="http://paulbeachsblog.blogspot.fr/2015/02/yosemite-superserver-and-startupitems.html" rel="nofollow">http://paulbeachsblog.blogspot.fr/2015/02/yosemite-superserver-and-startupitems.html</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mocking factory pattern in Java<p>It may look similar to my <a href="https://stackoverflow.com/questions/28539036/java-mocking-custom-objects/28539229?noredi... | <p>You're not violating the dependency inversion principle if there are no dependencies to inject.</p>
<p>In any case the <code>Factory</code> is a <em>creational</em> design pattern and you should test that it does indeed create (instantiate) the right things.</p>
<p>Yes, you should test that it does return objects ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to match a repeated pattern within two characters<p>Here is the string:</p>
<pre><code>a:4:{i:1;s:2:"on";i:2;N;i:3;s:2:"on";i:4;N;}
</code></pre>
<p>It... | <p>Your string is an array that was serialized using PHP serialize(). If, as it appears, you are getting this from a PHP program, you should instead unserialize it before giving it to your Javascript.</p>
<p>For example, at the host:</p>
<pre><code>$json = json_encode( unserialize( $array));
</code></pre>
<p>Now you... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Copy cell from on sheet to another, if other cell in row matches values<p>What I want, is to copy a cell(s) from one sheet to another, only if another cell i... | <p>Please try: </p>
<pre><code>=query('Sheet one'!A:D,"Select A where D='Yes' or D='Maybe'")
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Object being changed by returning value?<p>This is very basic, but I don't understand why when I do: </p>
<pre><code>int main(int argc, const char * argv[])... | <p>"does the value of myRect.origin change?"</p>
<p>Yes, because you are modifying the same object. <code>XYPoint *theOrigin</code> is a pointer to an object, and it points to the same object as <code>myRect.origin</code> (which is also a pointer.) I would suggest reading a little about pointers, that will help you un... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to fix this division script so it won't display decimal results<p>So I have this script (see the entire HTML below) that displays random divisions and th... | <p>First you need to get factors of divisor, You can use this function:</p>
<pre><code>function factors(x){
var factors = [];
for (let i = 1; i <= x; i++) {
if (x % i === 0){
factors.push(i)
}
}
return factors;
}
</code></pre>
<p>Now from returned array choose (maybe ran... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
useEffect not triggered by onChange<p>Im receving some products on props in the OrderContent component to use them in a select component, when I select the p... | <p><code>updateQuantity</code> is mutating state. This means that react will see that you've tried to update state with the same object reference and the re-render will be skipped, meaning no <code>useEffect</code> triggers.</p>
<p>Change it to this to create a new array with new nested objects:</p>
<pre class="lang-... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to enable and disable qDebug() messages<p>I disable the qDebug() messages by writing </p>
<pre><code>CONFIG(release, debug|release):DEFINES += QT_NO_DE... | <p>You can add your own function for handling Qt debug messages with <a href="http://doc.qt.io/qt-5/qtglobal.html#qInstallMessageHandler" rel="noreferrer">qInstallMsgHandler</a></p>
<p>This will allow you to control whether to print the messages.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Do I need to use redux-persist if I am trying to use firebase with my react native application?<p>I am trying to check the authentication status of a user wh... | <p>See the whole point of redux-persist is to store the redux state even when the app is closed via either AsyncStorage/sql-lite-storage. </p>
<p>I believe previously you used to store your JWT token and check if its valid and show the user the respective screens. </p>
<p>Now since FirebaseAuth doesnt have any such f... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Selecting the values from a table in sql using a loop<p>I have a table with a certain amount of ids and I want to use these seperate ids to retrieve data fro... | <p>If you absolutely need to loop through this data, you will need to add something to your script that will move to the next record in @QuestionsPrimaryTable. The way it is currently written it sets @Id to the same value during every iteration.</p>
<p>Depending on how you plan to use @QuestionsPrimaryTable, you coul... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
My program throws an exception when encountering very high numbers<p>So my problem is that when I write in my 4 numbers and they are something like <code>987... | <p>Your assigning a big number to <code>int</code>, Integer numbers cannot hold this big value.</p>
<p>You may want to use <code>long</code> instead of <code>int</code>, along side with using <code>nextLong()</code> instead of using <code>nextInt()</code></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
iOS Swift Dequeued Reusable Cell not showing up<p>I followed a tutorial earlier to get the basics of the Storyboard down and I'm using that code as a referen... | <p>you have to set the dataSource for the table view, i guess the delegate methods get never called.</p>
<p>Additionally add <em>UITableViewDataSource</em>, not necessary but more declarative than just the implementation</p>
<pre><code>class DetailViewController: UIViewController, UITableViewDataSource {
</code></pre... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Return &dyn Trait1 from Box<dyn Trait1 + Trait2><p>If I have a <code>Box<dyn Trait1 + Trait2></code>, can I return a <code>&dyn Trait1</code> ?</p>... | <p>You can't. A <code>HashMap<String, Box<dyn SpecialisedGraphNode></code> is not a <code>HashMap<String, Box<dyn Node></code>, so you can't form a reference of that type to it. If you do it with unsafe code, you invoke undefined behavior, because those boxes don't have the same data.</p>
<p>I also t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
UILabel not wrapping after the text is changed<p><a href="https://i.stack.imgur.com/CQpJ0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/... | <p>When you change the text in a label in a table view cell, the table view does not automatically re-calculate cell sizes.</p>
<p>To do so, you either reload the data - as you've seen - or, execute these two lines:</p>
<pre><code>tableView.beginUpdates()
tableView.endUpdates()
</code></pre>
<p>If you are updating t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Declaring events in polymer<p>I have the following element declared in polymer</p>
<pre><code><polymer-element name="Map-List-Element" attributes="mapNam... | <p>Your event handler declaration is correct (<code>on-show-settings="{{showSettings}}"</code> and the corresponding function).</p>
<p>But you got a typo in the <code>fire</code> statement .The event name must be all lowercase. So replace <code>this.fire('show-Settings'</code> with <code>this.fire('show-settings'</cod... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Websocket Frame Length Size & Bandwidth<p>I'm a bit worried about my chat app in my game and how the bandwidth will be consumed.</p>
<p>For example, I'm not... | <p>(Average number of sent messages TIMES average message length in bytes) DIVIDED BY time in seconds.</p>
<p>You should get bytes per second.</p>
<p>Binary messages might save something, but if you plan to send short text messages, it might not be worth doing.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Change Datatype in Pandas Dataframe Column<p>I have a dataframe and one column Quantity has the below values</p>
<pre><code>Col1
20,000
20
-10,000
-50
</cod... | <p>This will do the work:</p>
<pre><code>pd.to_numeric(df['Col1'].astype(str).str.replace(',',''))
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to redirect URL with htaccess (RewriteRule) and prevent direct access<p>using .htaccess I'd like to transparently redirect requests for folder "old" to f... | <p>You can use:</p>
<pre><code>RewriteEngine On
# if directly requesting /new then block it
RewriteCond %{THE_REQUEST} \s/+new(/\S*)?\s [NC]
RewriteRule ^ - [F]
# forward /old/abc to /new/abc
RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$ [NC]
RewriteRule ^old(/.*)?$ new$1 [L,NC]
</code></pre>
<p>We used <code>THE... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
TortoiseSVN does not filter QT GeneratedFiles Folder as ignorelist<p>I have some QT projects..
and i want to commit to my svn server with TortoiseSVN Client ... | <p>If your folder is already under version control: <code>right click GeneratedFiles folder > TortoiseSVN > Unversion and add to ignore list... > GeneratedFiles(recursively).</code></p>
<p>When you try to commit you will see that <em>GeneratedFiles</em> and it's content will be deleted in SVN repo and parent ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to wire Kendo UI Angular Chart to a datasource?<p>I have a Kendo UI chart with some series data. When I update the series, the chart data does not change... | <p>There is no <code>datasource</code> directive, you don't need anything like that. The problem is Angular not picking up changes to <code>this.chartConfig.series</code>.</p>
<p>Angular change detection checks for reference changes, not simply value changes. The simplest solution for this problem is after whatever up... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Testing React form components<p>In my tutorial-like application I have a <strong>AddForm</strong> component:</p>
<pre><code>var React = require('react');
va... | <p>React TestUtils allows you to simulate form submission:</p>
<pre><code>var addForm = TestUtils.renderIntoDocument(AddForm(null));
var form = TestUtils.findRenderedDOMComponentWithTag(addForm, 'form');
TestUtils.Simulate.submit(form);
</code></pre>
<p>The way I would test the actions is by manually mocking out <cod... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
IndexedBD select objects from upper to lower?<p>For example:</p>
<pre><code>const customerData = [
{ id: 444, name: "Bill", age: 35, email: "bill@company.... | <p>The <a href="https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore.openCursor" rel="nofollow">openCursor</a> method accepts two arguments. The second argument is optional and specifies the direction of the cursor. Because it is optional, you rarely see the second argument specified in example code, so mayb... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to define that a return type of method is an implementation of superclass<p>Taking the code below for example:</p>
<pre class="lang-py prettyprint-overr... | <p>Use <a href="https://docs.python.org/3/library/typing.html#typing.Type" rel="nofollow noreferrer"><code>typing.Type</code></a>.</p>
<pre><code>from typing import Type
def get_launch_impl() -> Type[_Launcher]:
...
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Seconds into time elapsed in JS<p>I'm trying to convert a total amount of seconds into time elapsed using jQuery and struggling.</p>
<p>I have as an example... | <p><strong>--Update</strong></p>
<pre><code> function DDHHMMSS(seconds){
var t = seconds
var cd = 24 * 60 * 60 * 1000,
ch = 60 * 60 * 1000,
cs = 60 * 1000,
d = Math.floor(t / cd),
h = Math.floor( (t - d * cd) / ch),
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Report Builder 3.0 Exporting to Excel<p>I have created a layout that works just fine. However, when I export it to Excel, the data starts in column C. Anot... | <p>Probably the answer is that the table in your report does not start at exactly the 0,0 position. Select it and in the Properties panel on the right hand side scroll down to Position, make sure location says "0cm, 0cm".</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Parse javac compilation errors<p>I have done lots of looking around and can't seem to find an existing library for parsing javac compilation errors. I am con... | <p>I think <a href="http://docs.oracle.com/javase/7/docs/api/javax/tools/JavaCompiler.html" rel="nofollow noreferrer"><code>JavaCompiler</code></a> and <a href="http://docs.oracle.com/javase/7/docs/api/javax/tools/Diagnostic.html" rel="nofollow noreferrer"><code>Diagnostic</code></a> classes are something you want to c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Windows API, VB.Net GetModuleFileNameEx, Entry Point Not Found<p>I'm trying to run the code below:</p>
<pre><code>Public Class Form1
Public Declare Func... | <p>ok found the solution:</p>
<pre><code>Public Class Form1
Public Declare Function GetModuleFileNameExW Lib "PSAPI.DLL" (ByVal hProcess As Integer, ByVal hModule As Integer, ByRef lpFilename As String, ByVal nSize As Integer) As Integer
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Butto... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to save Toggle Button's "on/off" mode on Page Refresh for website?<p>I am trying to use the <a href="https://www.w3schools.com/howto/tryit.asp?filename=t... | <p>First update below code on "// On page load se the theme." section </p>
<pre><code>var tSwitcher = document.getElementById('theme-switcher');
let element = document.body;
let onpageLoad = localStorage.getItem("theme") || "";
if(onpageLoad != null && onpageLoad == 'dark-mode'){
tSwitcher.checked = true;
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python 3:random.choice command with if statments<p>I'm very new to python/programing, and, i've been playing with a small random choice generator. I'm really... | <p>Assign the result of <code>random.choice(Desert)</code> to a variable, and use it in both places where it's applicable. (and while you're at it, change <code>Goodbye1</code> to a variable that exists, such as <code>Goodbye</code>)</p>
<pre><code>x = random.choice(Desert)
print("And finally Desert:", x)
if x=="No Th... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Returning pointer to a class variable in C#<p>I'm currently writing lab work for my study, and I'd like to make a function return a pointer to the variable f... | <p>Have the method return a delegate that, when invoked, will evaluate the value of the variable in question:</p>
<pre><code>public Func<int> getProc(int id)
{
switch (id)
{
case 1:
return () => proc1tasks;
case 2:
return () => proc2tasks;
}
}
</code></pr... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
XSLT concat, trasnlate to uppercase<p>I am trying to concat and trasnlate to upper-case in XSLT with the below coding:</p>
<pre><code> <xsl:va... | <p>I am guessing (!) you want:</p>
<pre><code>translate(concat(E_Firstname, ',', E_Lastname), $lowercase, $uppercase)
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error polyline google maps<pre><code>$.getJSON('/polyline/', function(data) {
$.each( data.markers, function(i, line) {
var infowindow... | <p>You need to pass the polyline an array of google.maps.LatLng objects:</p>
<pre><code>$.getJSON('/polyline/', function(data) {
var line_lat_lon = [];
$.each( data.markers, function(i, line) {
var infowindow = new google.maps.InfoWindow({
content: line.title,
});
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C++ Subclass Constructor<p>I am having trouble understanding how to construct a subclass. My parent class is called "package" and the children are called "ov... | <p>The class <code>overnight</code> <em>is a</em> <code>package</code>, you don't need composition and embed a <code>package</code> object in the class.</p>
<p>As for the constructor, do e.g.</p>
<pre><code>overnight::overnight(std::string initFirst, std::string initLast, std::string initLineOne,
std::string init... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
two level add more filed in Javascript<p>I'm trying to make Create Quiz Page. there should be dynamically inputs on-page. there is no defined number of quest... | <p>There is other way to make the code better and cleaner.
I hope it helps.</p>
<pre><code>$(document).ready(function () {
var next = 0;
$("#add-more").click(function(e){
e.preventDefault();
let _html = `
<div class="card">
<div class="card-header" id="heading ${nex... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MYSQL geometry functions polygon<p>I'm struggling with MySQL geometry functions. I really want to draw a polygon from various different tables in my database... | <p>You have missed brackets while defining the POLYGON string. And avoid using <code>TEXT</code> which is a reserved word. Also <code>POLYGONFROMTEXT</code> is deprecated, better use <code>ST_POLYGONFROMTEXT</code>, so:</p>
<pre><code>SET @n_Yval = -5;
SET @p_Yval = +5;
SET @n_Xval = -10;
SET @p_Xval = +10;
SET @... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
function unique change the data type of columns in data.frame in R<p>Suppose I have a dataframe, and get the unqiue values of one column:</p>
<pre><code>df ... | <p>We can convert to <code>character</code> and then concatenate to avoid coercing to integer storage values for the <code>factor</code> 'b'</p>
<pre><code>c(as.character(unique(b$b)), 'xx')
#[1] "1" "2" "3" "x" "xx"
</code></pre>
<hr>
<p>Or while creating the <code>data.frame</code>, use <code>stringsAsFactors ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting Manifest merger failed Error While Updating Places Api<p>Hey My Google Places Api Was Not Working And i see in The Log They Asked To Updated Places ... | <p>According to Google's documentation version <strong>2.0.0</strong> of the Places SDK for Android now depends on AndroidX. In order to retain compatibility, you must migrate your projects to use AndroidX.</p>
<p>You should remove one of those implementation</p>
<pre><code>com.google.android.libraries.places:places... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
php file reading displaying unwanted content<p>I am working on some code and i have scraped together the following some from stackoverflow and some from my o... | <p>See the following lines inside <code>checkCSVContentForEmail</code> method.</p>
<pre><code>else
{
$show = 'No Entry for Email address field - WILL NOT BE ADDED TO DATABASE! '.print_r($partedCSV);
return $show;
}
</code></pre>
<p>Use of <code>print_r</code> must be causing the output.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
parameters in Swift<p>I have linked my Xcode project to a firebase real-time database. To read from the database, I have used a completion handler a variable... | <p>I don’t know what type account is. But the syntax should be something like this:</p>
<pre><code>func getAccounts(username: String, account: String, completion: @escaping (_ noOfAccounts: Int) -> Void){
ref.child("Accounts").observeSingleEvent(of: .value) {(snapshot:DataSnapshot) in
let noOfAc... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Onsen UI: Get content height<p>I have tried everything but can't seem to get the height of the page content. I am using Onsen UI with JQuery. Can anyone prov... | <p>You don't need to calculate any height, just put the map in a div and set the style to something like that:</p>
<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-css lang-css prettyprint-override"><code>#map_canvas {
position: absolute;
width:100%... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get pointer to unmanaged memory in C# from C++<p>I've been given a C++ DLL that allocates memory. It has several functions that need me to pass it the point... | <p>Thanks to Lucas' comment I got it working. I was on the right track...just missing the <code>out</code> keyword.</p>
<pre><code>[DllImport("data_accessor.dll")]
public static extern void get_pointer_to_new_memory(out IntPtr memory_ptr);
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Date conversion and manipulation in javascript with Arabic months<p>I want to change an arabic long-form date, i.e.</p>
<pre><code>الخميس 26 فبراير 2015
(T... | <pre><code>var months = ["يناير", "فبراير", "مارس", "إبريل", "مايو", "يونيو",
"يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"];
var days =["اﻷحد","اﻷثنين","الثلاثاء","اﻷربعاء","الخميس","الجمعة","السبت"];
var date = new Date();
console.log("The current month is " + months[date.getMonth()]);
con... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using matlabFunction, how can I specify which is the variable and which are constants?<p>I have a function I want to evaluate as an integral (using the funct... | <p>Here there is a workaround.</p>
<p>The function <code>integral</code> integrates numerically a function. Therefore to use it, you need a numerical expression, thus you need to give values to <code>a</code>, <code>g</code> and <code>v</code>.</p>
<p>If you dont want to do it you could symbolically integrate the equ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
java.util.InputMismatchException error reading file<p>I know there are a lot of topics with this error but I cannot find any solution to my problem. I am try... | <p>An <code>int</code> uses <code>32</code> bits thus ranges from -2<sup>31</sup> to 2<sup>31</sup>-1, so the maximum is:</p>
<pre><code>maximum bound 2 147 483 648
value 1 234 567 890 123 456
</code></pre>
<p>So it's clear you can't parse this in an <code>int</code>. A <code>long</code> has <code>64</code> bit... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
App did not run at iPhone resolution when reviewed on iPad<p>My application on iTunes is rejected because:</p>
<p>"We noticed that your app did not run at i... | <p>Use AutoLayout and fix the position of the button to the bottom right corner.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Prime numbers as public key - clarification?<p>I've read <a href="http://mathophilia.com/prime-numbers-beautiful-and-useful/" rel="nofollow noreferrer">here<... | <p>As noted in my comment, RSA keys are usually way larger in size. Your examples can be brute forced easily (!). RSA keys as used for SSH and similar are usually 2048 or even 4096 bit long (approx 616 resp. 1233 decimal digits). At that point, trying to brute-force them takes essentially forever, even the best algorit... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
kohana ORM - add new record for has_many, has_one relationships<p>Kohana ORM has the following relationships between model:</p>
<ol>
<li>has_one </li>
<li>h... | <p>The key to the question is that on the "other" side of every <code>has_many</code> and <code>has_one</code> is a <code>belongs_to</code>. And this is the model where the information is saved.</p>
<p>In your case <code>Model_CompiledText</code> has the column <code>idText</code> (under a specific alias). To (un)set ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
JSoup - Parsing this nested HTML unordered list<p>I'm trying to parse this nested HTML from a website but I just can't seen to figure out how to get the data... | <p>As I understand you are looking for href attribute inside <strong>a</strong> tag
Your's select statement is not correct because you use space instead of dot in order to choose class</p>
<p>Instead of this </p>
<pre><code>doc.select("ul.no-bullet participants-list")
</code></pre>
<p>Use this</p>
<pre><code>doc.se... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to set drop-down value in Angular<p>I have a drop-down menu where I would like to set a value using some logic in my TS file. This is what my drop-down l... | <p>Try this out my friend, ngModelChange is the way to go. You can hook to the event.value to get access to your values</p>
<pre><code> <select [(ngModel)]="selectedEntity" (ngModelChange)="onChange($event)">
<option *ngFor="let item of Entities" [ngValue]="item.EntityID">{{item.EntityName}}</option>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to change xticks interval in all my subplots?<p>I using this code in order to have 6 plots in one figure. I want to change the interval of the x-axis for... | <p>Give this a try</p>
<pre><code>xticks( datetime( 1995:5:2020 , 1 , 1 ) )
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove steps in time series<p>I am analyzing lizards increase of temperature. Problem is that the animals sometime move moving the thermometer we are using f... | <p>There are a couple methods attempted in the code below attempting to capture the changes: by percent change and by using a rolling median method. </p>
<p>First import a couple useful libraries. Also changing your data into a tibble called 'lizard_data'</p>
<pre><code>library(tidyverse)
library(RcppRoll)
lizard_da... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Launch Activity from Fragment throws ClassNotFoundException<p>I know it's a long shot but I tried a lot of solutions and none worked.
I'm trying to launch an... | <blockquote>
<p>I don't know why the other way rises an ClassNotFoundException</p>
</blockquote>
<p><code>es.uam.eps.dadm.SESSION</code> is Action name which you have added during Activity declaration in <code>AndroidManifest.xml</code>.</p>
<p>From Activity on Button click using action to prepare Intent for starti... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use the IsWindowsXPOrGreater function correctly?<p><strong>Update</strong></p>
<p>I have re-wrote the original question as the previous text was more... | <p>You can use <a href="https://msdn.microsoft.com/en-us/library/yx9zd12s.aspx" rel="nofollow">/DELAYLOAD</a> when you link so that your application will only attempt to load DLLs when you call a function from that DLL.</p>
<p>From there, you can use older functions to print out an error message if a new-enough versio... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to concatenate many std::vectors?<p>There is already a question on how to concatenate two vectors: <a href="https://stackoverflow.com/questions/201718/co... | <p>You can do this in C++11:</p>
<pre><code>std::for_each(aVector.begin(), aVector.end(), [&](AClass i){const auto& temp = i.getCoeffs(); coeffs.insert(coeffs.end(), temp.begin(), temp.end());});
</code></pre>
<p>C++03 is more difficult because it lacks lambdas and <code>bind</code>.</p>
<p>About as good as ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Monolog: log different channels and multiple handlers to grouped log file + dedicated log files<p>I'm facing some problems with configuring Monolog to handle... | <p>Channels in monolog works exactly like you want. Sample monolog configuration</p>
<pre><code>app/config.yml
monolog:
channels: ['deletion']
handlers:
main:
type: fingers_crossed
action_level: error
handler: grouped_main
formatter: "monolog.formatter.request"
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
drop rows that have duplicated indices<p>I have a DataFrame where each observation is identified by an <code>index</code>. However, for some indices the DF c... | <p>You could use <code>groupby/transform</code> to create a boolean mask which is <code>True</code> where the group count is greater than 1 and any of the values in the row equals <code>'-'</code>. Then you could use <code>df.loc[~mask]</code> to select the unmasked rows of <code>df</code>:</p>
<pre><code>import panda... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
When phone is offline GCM stores a LIST of messages or only the last one, just like APNS?<p>When phone is offline GCM stores a LIST of messages or only the l... | <p>It depends on some options you can set when sending messages from your server.
There are two things to keep in mind here: the <code>collapse_key</code> and the <code>time_to_live</code> settings.</p>
<p>The collapse key is used in <a href="http://developer.android.com/google/gcm/server.html#adv" rel="nofollow">send... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
3 column div layout not working for me<p>I'm trying to do three simple columns but i'm not having any luck. </p>
<p>I have done a few searches and tried dif... | <p>Your code looks very complicated for trying to troubleshoot. I would suggest starting at the barebones (3 floated divs) and then working up from there. In addition, I notice that the entirety of your content code is within your head tags and not your body tags. Close your head tag before you open your body tag and s... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How would I place my logo on top of the space background?<p><a href="http://codepen.io/anon/pen/WbdaVB" rel="nofollow">http://codepen.io/anon/pen/WbdaVB</a><... | <p>First target the image tag with the <code>class="logo"</code>, also you need use double quotes(<code>""</code>) in the src, not <code>¨¨</code>.</p>
<pre><code><img class="logo" src="http://i.imgur.com/CIwEPgT.png">
</code></pre>
<p>Them, in your CSS, add this:</p>
<pre><code>.logo {
position: relative;
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Incorrect behavior of groupby with "datetime64[ns, UTC]" sampling in pandas 1.0.1?<p>I am trying to groupby a dataframe by column <code>f493</code> such that... | <p>Problem is there is returned one item <code>Series</code>, not scalar.</p>
<p>Solution is convert <code>Series</code> to scalar by <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.iat.html" rel="nofollow noreferrer"><code>Series.iat</code></a>:</p>
<pre><code>df['f496'] = pd.to_date... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
URL without parameters but PHP gets Parameter (.htaccess?)<p>(Sorry for my bad english. I’m from Germany)</p>
<p>I'm trying to get nice URLs for an Imagevie... | <p>Create a file called <code>/imageviewer/.htaccess</code> and have this code:</p>
<pre><code>RewriteEngine On
RewriteBase /imageviewer/
# If the request is not for a valid directory
RewriteCond %{REQUEST_FILENAME} !-d
# If the request is not for a valid file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.+) inde... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PFQueryTableViewController text of cell issue<p>First, let me explain what it is that I am trying to do. I have three classes: User, Show and ShowAssignments... | <p>Finally got it working. Here is my solution now for those interested.</p>
<pre><code>required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
self.parseClassName = "UserShowAssignments"
self.textKey = "Show"
self.pullToRefreshEnabled = true
self.paginationEnabled... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Android: How to avoid restart after Animation finish?<p>the image will go back to 0,0 after animation finish
how to set not go back?
still stay in 100,100</p... | <p>Use <code>Animation.setFillAfter(true)</code> to persist the final animation state.</p>
<p><a href="http://developer.android.com/reference/android/view/animation/Animation.html#setFillAfter(boolean)" rel="nofollow">http://developer.android.com/reference/android/view/animation/Animation.html#setFillAfter(boolean)</a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Telegram Bot. How set command /cmd in user text input?<p>I need to create command (for example - /cmd). When user click on this command in list - bot set thi... | <p>Based on question & comments;</p>
<blockquote>
<p>bot set this command text(/cmd) in user input </p>
</blockquote>
<p>A regular Telegram bot can't place text in Input field. This is only possible with an <a href="https://core.telegram.org/bots/inline" rel="nofollow noreferrer">Inline bot</a>.</p>
<p>If you ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
L20n translate the placeholder/attribute from textarea and input field<p>How to localize the placeholder from textarea or input?<br>
If i use the following e... | <p>Your language file should be</p>
<pre><code><Message placeholder:"Foo Bar">
</code></pre>
<p>You need to specify wich attribute to translate. Given your HTML, setting the attribute <code>placeholder="Message"</code> is not needed.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Have router resolve domain to local IP<p>I need my router to resolve mydomain.com to a private IP.
Alternatives like modifying hosts file or using a paid dyn... | <p>Well, you need to create an A record for "mydomain.com" to point to whatever your public IP is (I am assuming this is the IP that your ISP is assigning). This can only be done, afaik, where you registered the domain. </p>
<p>On your home side, you need to enable port forwarding (80,8080,443) on your router. Point t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ReactJS: Empty component's old fetched data before fetching again<p>I am fetching remote data from my React component. When data is ready, child components a... | <p>A quick fix would be to add a key prop to your List:</p>
<pre><code><List key={page} page={page} />
</code></pre>
<p>When the value for page changes, the List component will be unmounted, and a new one rendered. The new one will not have any previous data in it, so you will only get 2 renders instead of 3.</... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Signal of Signals ? Reactive Cocoa<p>I am trying to understand this piece of code and why it returns a signal of signals.</p>
<pre><code>[[[self.signInButto... | <p>The code looks incorrect. You are correct in understanding that the code takes the signal of button taps and maps it to a signal of "sign-in signals". Yes, a signal of signals. While a signal of signals is common and very useful, it will do nothing without the use of one of these three operators: <code>flatten</code... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Objective-C - wrap attribute value with commas in NSPredicate CONTAINS<p>Here is the situation. I have some Core Data data and I want to get the data where t... | <p>You can't do that. What you're trying is attempting to change the key to be queried to something invalid, hence the parse error.</p>
<p>You can't really do what you want to if you just store a plain type. Presumably your type may be a string list of things?</p>
<p>So, you need to rethink your approach, there are a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Query or deserialize json with dynamic keys using System.Text.Json<p>I have json that looks like this, the key "123" could be any number.</p>
<pre><code> {
... | <p>Something like:</p>
<pre class="lang-cs prettyprint-override"><code>public class Rootobject
{
public string key1 { get; set; }
public InnerObject key2 { get; set; }
}
public class InnerObject
{
public Dictionary<string, ObjectTheThird> items { get; set; }
= new Dictionary<string, Objec... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.