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:
How can I injector Angular module in webpack?<p>I install <strong>ngRoute</strong> from <strong>npm</strong>, my webpack default load <code>default.js</code>... | <p>You can set an alias from <code>ngRoute</code> to <code>angular-route</code> like this:</p>
<pre><code>resolve: {
alias: {
'ngRoute': 'angular-route'
}
}
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Datastore Small Operations quota reached<p>After a ton of research, I decided to do a lot of keys only queries in my code. Part of the reason being the follo... | <p>There is no limit on the number of small operations if you have billing enabled. Without it, the limit is only 50,000 operations.</p>
<p>Since these operations are free, it would not hurt to enable billing.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Printing for loop<p>The problem I am having is related to the output from for loops. I currently have 3 of them and get the following output:</p>
<pre><code... | <pre><code>for t,p,s in zip(title, price, shipping):
print(f"{t.text.strip()}, {p.text.strip()}, {s.text.strip()}")
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Migrate Magento 1.3/1.2 project(s) on PHP 5.2 to 5.3/5.5 platform(s) without changing theme, and keeping all existing product and customers data?<p>My workpl... | <p>Now I feel like driving antique classic car on express-way. </p>
<p>Start project files & database migrates:</p>
<ol>
<li>Ref: <a href="https://www.siteground.com/tutorials/magento/magento_move.htm" rel="nofollow noreferrer">https://www.siteground.com/tutorials/magento/magento_move.htm</a></li>
</ol>
<p>Oh Go... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using elm-test in a git hub action<p>I want to use the an git hub action to test and build my elm package whenever a commit is pushed to the master branch fo... | <p>Thanks to @toastal comment I found another solution. That is to set up a <code>package.json</code> file using <code>npm</code> and then adding <code>elm-test</code> as a dependency with the command</p>
<pre><code>npm install -D elm-test
</code></pre>
<p>also you might want to add <code>node_modules</code> to your ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PJSIP library compile error for iOS Simulator<p>I am trying to compile pjsip library for iOS, but getting an error and I am following below steps</p>
<p><st... | <p>Refer to <a href="https://trac.pjsip.org/repos/wiki/FAQ#missing-sep-err" rel="nofollow noreferrer">https://trac.pjsip.org/repos/wiki/FAQ#missing-sep-err</a></p>
<blockquote>
<p>This happens because of corrupt dependency file, probably because make dep stopped or was stopped abruptly previously. The solution is ei... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I INSERT a new row or UPDATE an existing row effeciently?<p>So I have a 'recently_viewed' table with columns</p>
<pre><code>product|user|time
</code>... | <p>You can use define (product, user) as UNIQUE, for example you can set it as the PRIMARY KEY of your table:</p>
<pre><code>CREATE TABLE tablename (
product INT,
user INT,
time DATETIME,
PRIMARY KEY (product, user)
);
</code></pre>
<p>(or you can also create a UNIQUE index) and then use an <a href="http://de... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
C# string to datetime wrong format output<p>I'm trying to convert a string into Datetime format this is the my code</p>
<pre class="lang-c prettyprint-overr... | <p>You are not formatting string representation of the <code>DateTime</code> object. If you haven't specified format then you will get <strong><em>default format based on the current culture</em></strong>. </p>
<p>For getting the desired output you can try this:</p>
<pre><code>endDateDt.ToString("dd-MM-yyyy HH:mm");
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Raspberry and nodered-nodejs-npm SyntaxError<p>I'm trying to install a sensor node in nodered for my raspberry pi3. The sensor is the air quality sensor SDS0... | <p>NodeJS v4.4.5 is VERY old and totally out of support (it went EOL in April 2018).</p>
<p>Node-RED currently requires at least NodeJS version 8.x (<a href="https://nodered.org/docs/faq/node-versions" rel="nofollow noreferrer">https://nodered.org/docs/faq/node-versions</a>)</p>
<p>You will need to upgrade your syste... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to create unique XML for each row of dataframe in Python<p>I have dataframe like below.</p>
<pre><code>df3.head(5)
ORDER STS_CODE Date
202002102... | <p>You can stick to your <code>itertuples</code> if you prefer. All you need to do is to create the file inside your loop.</p>
<pre><code>for row in df3.itertuples():
with open(f'{row[1]}_{row[2]}.xml', 'w') as f:
f.write(head.format(glogdate))
f.write(body.format(row[1], row[2], row[3]))
f... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ruby model naming conventions can uppercase characters be used<p>I have run a migration and am getting a 500 error saying <code>seen_by_hw</code> does not ex... | <p>If you created the model file/class yourself then yes, this is probably the issue.</p>
<p>The filename should be: <code>seen_by_hw.rb</code> and in that the class name will be <code>SeenByHw</code>.</p>
<p>If you use the generators that comes with Rails then it would have done this for you, type <code>rails genera... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java: Simple HTTP Server application that responds in JSON<p>I want to create a very simple HTTP server application in Java.</p>
<p>For example, if I run th... | <p>You could use classes from the package <a href="http://docs.oracle.com/javase/8/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/package-summary.html" rel="nofollow noreferrer"><code>com.sun.net.httpserver</code></a>:</p>
<pre><code>import com.sun.net.httpserver.Headers;
import com.sun.net.httpserver.HttpServ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Build webapp to IOS app without xcode<p>I dont know If someone did this so far I heard of a project which allows u to use the build scheme in windows but I c... | <p>I'm not sure what kind of program or framework you're look for, but you can checkout this:</p>
<p><a href="https://gigaom.com/2010/02/12/how-to-create-an-iphone-web-app/" rel="nofollow noreferrer">https://gigaom.com/2010/02/12/how-to-create-an-iphone-web-app/</a></p>
<p><a href="http://snippetspace.com/portfolio/i... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python flask for loop<p>I am trying to accomplish dynamically creating a html table populated by a a dict that is created from a sqlite query. each row has i... | <p>try this and tell me if you had issues.</p>
<pre><code><table border='1' align="center">
<tr>
<th>Post ID</th>
<th>Photo Name</th>
<th>Photo</th>
<th>Blurb!!!</th>
<th>Actions</th>
</tr>
{% ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to solve the Gulp error: imagemin.jpegtran is not a function<p>I am getting this error whenever I try to make imagemin work for any kind of image:</p>
<... | <p>I found the answer and I write it here in case someone will have the same issue.
imagemin.jpegtran has been substitute by imagemin.mozjpeg. Also, I had to install mozjpeg (npm install --save-dev imagemin-mozjpeg) as, for the time I am writing, it seems it is not installed together with imagemin.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Trying to install NPM for Node.JS using YUM<p>I am trying to get Node.JS working using <a href="http://blog.modulus.io/absolute-beginners-guide-to-nodejs" re... | <p><code>npm</code> is a package on his own and you need to install it sepatately from nodejs</p>
<pre><code>sudo yum install nodejs npm
</code></pre>
<p>Where is a chance you'll need to use an EPEL repository (depends on your distro)</p>
<pre><code>sudo yum install nodejs npm --enablerepo=epel
</code></pre>
<p>BTW, of... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Take Photo In Background Service Not Working If Apps closed (Android Studio)<p>I made an application to take photos in the background service. works when the... | <p>it's not possible since the android 8.0 update, you cannot use this kind of service in background without letting the user know that you are doing it, (some king of notification in the notification bar)
you may find this link helpful: <a href="https://developer.android.com/guide/topics/ui/accessibility/service" rel=... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Restrict MVC action to a contentType<p>Is where any attribute in MVC that restricts an action method so that the method handles only accept <code>contentType... | <p>There isn't any out of box feature which can restrict requests based on ContentType.But you can always write custom Action Filter and make the necessary restrictions there.</p>
<pre><code>public class RestrictionAttribute : FilterAttribute, IActionFilter
{
public void OnActionExecuted(ActionExecutedContext filt... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can we remove save changes button from edit manager of a rad grid<p>Work on Asp.net webpage vs2012 C#.Need suggestion how to remove Save changes button f... | <p>To remove save button, and to change the cancel button text:</p>
<pre><code><CommandItemSettings ShowSaveChangesButton="false" CancelChangesText="Clear"/>
</code></pre>
<p>I didnt understand what the other thing you want to do, sorry.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
set new element into list with jquery<p>i try to add a new li element into the list with jquery.</p>
<p>In this example it´s work fine, but when i want to g... | <p>Just change the code to this :</p>
<pre><code>$("ol").append("<li>"+$("#test").val()+"</li>);
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How use Android supplied (custom) fonts?<p>According to the <a href="https://developer.android.com/design/style/typography.html" rel="nofollow noreferrer">An... | <p>Hi you would need to set the typeface on a TextView like below:</p>
<pre><code>Typeface yourTypeface = Typeface.createFromAsset(getContext().getAssets(), "fonts/" + fontName + ".ttf");
yourTextView.setTypeface(yourTypeface);
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Lessthan(<) symbol is not allowed in jQuery Datatable<p>Have small requirement, I would like to display datatable with JSON data,
Here I have small challenge... | <p><strong><a href="http://jsfiddle.net/hns1gr41/2/" rel="nofollow noreferrer">Demo</a></strong></p>
<p>You can use</p>
<pre><code>row.append($("<td>" + rowData.lastName.replace("<","&lt") + "</td>"));
</code></pre>
<p>Instead Of</p>
<pre><code>row.append($(&qu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to merge two google cloud storage files into one<p>Is it possible to merge two google spread sheets or two regular documents into one document... | <p>This is not byte, but object composition. It is useful for sequential files, like csv, txt or log files, or chunks for the same object. Compositing the chunks will give the original object back. As jterrence explained, this won't merge two formatted files into one. Have a look <a href="https://productforums.google.c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cloud Scheduler Results Failed, Although Http Request still running<p>I used Cloud Scheduler in triggering HTTP endpoint, http request still processing but c... | <p>I understand that, after few minute of processing, your Cloud Scheduler job print failed even if the http call continue its processing with error code in return. If so, it's because the default timeout of Cloud Scheduler is about 180s.</p>
<p>I assume that is not a well documented part, and you can't set this up by... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is Phonegap SMS function executing both, success and error<p>I am using an SMS send function in my phonegap app.</p>
<pre><code>send(number, message, in... | <p>The correct answer is to add the following lines to your config.xml:</p>
<p><code><gap:plugin name="com.cordova.plugins.sms"/></code></p>
<p>You can find the plugin documentation to send SMS here: <a href="https://github.com/cordova-sms/cordova-sms-plugin" rel="nofollow">https://github.com/cordova-sms/cordov... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Yii2: How to mass extract Yii::t() messages for localization?<p>I have lots of Yii::t() commands in my application. Now I need to extract them somehow but I ... | <p>Yii2 provides already somthing to help you with this topic. You can use the console with two yii commands:</p>
<ul>
<li><code>message/config</code>: With the first command you create a configuration file</li>
<li><code>message/extract</code>: and with the second you extract the <code>Yii:t()</code> messages based o... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google Drive API Access my own account<p>I wish to run a simple process on my server/laptop that will upload files to my google drive on a daily basis, once ... | <ol>
<li><p>Yes. See <a href="https://stackoverflow.com/questions/19766912/how-do-i-authorise-a-background-web-app-without-user-intervention-canonical?s=7|2.2264">How do I authorise an app (web or installed) without user intervention? (canonical ?)</a></p></li>
<li><p>Yes. It becomes a complicated script if your file i... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Wildcard certificate not valid for mydomain.com<p>I created Wildcard certificate to support my site domain and subdomains.
The new certificate works for my s... | <p>For supporting both <code>example.com</code> and <code>subdomain.example.com</code> the certificate needs to include both <code>*.example.com</code> and <code>example.com</code> as subject alternative names. I assume that the last one is missing from your certificate.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Stylelint rule to enforce selector and attribute on same line<p>Is there a <a href="https://stylelint.io/user-guide/rules" rel="nofollow noreferrer">stylelin... | <blockquote>
<p>Is there a stylelint rule that can enforce a selector and attribute to be on the same line if there is only one attribute.</p>
</blockquote>
<p>Not yet.</p>
<p>The <a href="https://stylelint.io/user-guide/rules/declaration-block-single-line-max-declarations" rel="nofollow noreferrer"><code>declarati... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Behavior not understood in C program that prints out initials<p>I have a simple C program that is supposed to accept a name given by a user and then print ou... | <p>The less invasive change for your program (and there are many points to discuss) is to change <code>strcmp</code> into <code>strncmp</code> . Because <code>strcmp</code> compares strings of equal length as equal. With <code>strcmp</code> that will never happen because the first parameter string is always longer than... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python: get 2nd idxmax from nsmallest if there is a draw<p>I have <code>DataFrame</code> as below. What I want to get is mininim 1st, 2nd, ... , n <code>Valu... | <p>I hope your solution should be simplify - first <a href="http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.sort_values.html" rel="nofollow noreferrer"><code>DataFrame.sort_values</code></a> by 2 columns:</p>
<pre><code>df = df.sort_values(['Article','Value'])
print (df)
Article Name Va... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Drag CMDIChildWnd using client area<p>I'm trying to create a <code>CMDIChildWnd</code> without title bar draggable using the mouse on the client area.</p>
<... | <p>I did it using a little trick. The class to implement the behaviour is the derived class of the CFormView and I'm able to move the window as expected sending the htcaption message to the parent</p>
<pre><code>void derived_CFormView::OnLButtonDown(UINT nFlags, CPoint point)
{
CFormView::OnLButtonDown(nFlags, poi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to persist a document in json format using elasticsearch-dsl<p>I am trying to update an existing elasticsearch data pipeline and would like to use elasti... | <p>I've had some success at this by using elasticsearch.py bulk helpers rather than elasticsearch-dsl.
The following resources were super helpful:</p>
<ul>
<li><a href="https://kb.objectrocket.com/elasticsearch/how-to-bulk-index-elasticsearch-documents-from-a-json-file-using-python-753" rel="nofollow noreferrer">Blog ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is the reason for having both preserveDrawingBuffer and autoClear renderer properties?<p>The renderer will clear its output before rendering even if <co... | <p>They are separate issues.</p>
<p><code>renderer.autoClear = false</code> is appropriate if you have <a href="https://stackoverflow.com/questions/13309289/three-js-geometry-in-top-of-another/13309722#13309722">multiple render passes</a>, or if you are doing post-processing with <code>THREE.EffectComposer</code> and ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Print all possible paths using BFS + no more than K edges far<blockquote>
<p>I see similar solution is available in <a href="https://www.geeksforgeeks.org/... | <p>I have successfully created my solution code!
Feel free to discuss and suggest to improve its complexity (time & space) or some better approach. People might find its over engineered but my point was...in real life who inputs two ints as src and dest ? I needed solid Nodes too:</p>
<pre><code>import java.util.A... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I think this two divs shoule be the same height, but they aren't<p>The following code snippet shows that the height of <strong>black</strong> area is 4 pixel... | <p>Images are inline elements and default their <code>vertical-align</code> to <code>baseline</code>. Just add a style for <code>img</code> making it <code>vertical-align: top</code> or <code>vertical-align: middle</code>.</p>
<p>Alternatively, remove the text from beside the image and make it <code>display: block</co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Where to mount EFS on ECS wordpress?<pre><code>root@e532hrwha:/# ls
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys ... | <p>I guess you're using the official WordPress docker image, what you need to persists is your <code>wp-content</code> folder... so you should mount your EFS volume at <code>/var/www/html/wp-content</code></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Go regexp: match three asterisks<p>So I did this:</p>
<pre><code>r, _ := regexp.Compile("* * *")
r2 := r.ReplaceAll(b, []byte("<hr>"))
</code></pre>
... | <p>Adding to @VonC's answer, regexp aren't always the answer and are generally slower than using <code>strings.*</code>.</p>
<p>For a complex expression, sure regexp is awesome, however if you just want to match a string and replace it then, <a href="http://golang.org/pkg/strings/#Replacer" rel="nofollow"><code>string... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Kubernetes communication between microservices<p>We are developing an application microservices based. They will be deployed to kubernetes with Helm Package... | <p>The recommended way to manage the communication between microservices in Kubernetes is to use <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">Services</a>.</p>
<p>Basically, you need to wrap each of your microservices into a cluster IP service, then you are able t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
FineUploader - Passing customers parameters to the "Signature Endpoint"<p>I've been looking around for a bit, and I found that there is no method to allow me... | <p>You are correct in that there is no API method or option to specify your own custom parameters to be sent with the S3 or Azure signature requests. You can track case <a href="https://github.com/FineUploader/fine-uploader/issues/996" rel="nofollow">#996</a>, which will be updated when we begin work on this. </p>
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What happens when I add multiple inline JavaScript functions to an onclick handler?<p>I simply want to know what happens in this case:</p>
<pre><code><in... | <p>They will both run as if they were written in a JS block one after the other</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to remove duplicate from SQL Aggregate MAX<p>I want to retrieve the distinct tuple of a birthdate from my SQL Server table.</p>
<pre><code>Select id,ins... | <p>Find all rows for an id which have date = max date for that id:</p>
<pre><code>with cte as
(
select id, insCode, birthdate
from birthDateTable
where id IN (785412,852963)
)
select id, insCode, birthdate
from cte c1
where birthdate = (select max(birthdate) from cte c2
where c1.id = c2.id)
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
using Parse.Cloud.httpRequest I am unable to set correct header for AWS request?<p>On Parse.com, from CloudCode I need to send httpRequest to AWS (Kinesis); ... | <p>Check out the blog post on sending raw bytes through httpRequest: <a href="http://blog.parse.com/2013/04/04/sending-bytes-from-cloud-code/" rel="nofollow">http://blog.parse.com/2013/04/04/sending-bytes-from-cloud-code/</a></p>
<p>If <code>http_req_body</code> is a JS object, then you can use the following method ca... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to result the contents of a javascript variable using cheerio (jquery like selectors, but no dom)<p>There is a large html file with many javascript tags ... | <p>I got it!</p>
<pre><code>function findTextAndReturnRemainder(target, variable){
var chopFront = target.substring(target.search(variable)+variable.length,target.length);
var result = chopFront.substring(0,chopFront.search(";"));
return result;
}
var text = $($('script')).text();
var findAndClean = findTe... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can't perform credit card formatting in angular reactive form<p>I am trying to perform credit card validator i.e adding space after every fourth digit like 1... | <p>First let's use <code>ionChange</code> to get the changed value from your input. Connect your input with the <code>creditCardNumber</code> defined in the ts file. Now convert the credit card number and add it to the dynamic variable.</p>
<pre class="lang-html prettyprint-override"><code><ion-item>
<ion... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Two databases with the same data, are reporting different times<p>I live in Arizona, MST with no DST if it matters.</p>
<p>I have two different Oracle Datab... | <p>Turns out something was different. When redeploying the code in one the environments, it started to show the "2021-01-02T07:00:00Z" like the other. My working theory is that for some reason one of the pods was set to UTC time, but now at MST time.</p>
<p>Also, the whole one entry being out of order was due to it no... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SELECT highest time without repeating<p>I'm not expert in MYSQL,
I have a list of videos, (ID,ANIME_ID,TIME)
I want to select top 25 rows ordered by TIME wit... | <p>Since you're using <code>mysql</code>, you can just use <code>group by</code> for this -- however, realize this will just return an arbitrary <code>id</code> if ties exist:</p>
<pre><code>select id, anime_id, max(time) time
from videos
group by anime_id
order by max(time) desc
limit 25
</code></pre>
<ul>
<li><a hr... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Wrapper class to download image + Stream was not readable<p>I have read many articles but im not sure if this can be resolved the way i have constructed this... | <p>I think what you want to do is expose the stream as the result of the <code>SendRequest</code> method. I think you're ok not disposing of the <code>HttpWebResponse</code> itself since I think that only cleans up the response stream if you make sure to dispose of the stream that is being returned.</p>
<pre><code>pu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
mssql convert xml structure into table<p>I have a user profile stored in xml in a sql database column.<br>
I am trying to build a flat table structure to sho... | <p>You can simplify your initial query, just pivot the data:</p>
<pre><code>with data as (
select
ProfileId,
vfields.value('(Name)[1]','varchar(500)') as FieldName,
vfields.value('(Value)[1]','varchar(500)') as FieldValue
from dbo.[Profile]
cross apply VarFields.nodes('/ArrayOfX... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Set up Slurm accounting (sacct) with AWS ParallelCluster<p>I'm trying to set up a Slurm computing cluster on AWS using AWS ParallelCluster to use for some of... | <p>On a later date to when this question was asked, a detailed set of instructions for enabling Slurm accounting with AWS ParallelCluster was posted at <a href="https://aws.amazon.com/blogs/compute/enabling-job-accounting-for-hpc-with-aws-parallelcluster-and-amazon-rds/" rel="nofollow noreferrer">https://aws.amazon.com... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Unable to open module file mainform.vb<p>This error happened and I don't know what caused it:</p>
<p><img src="https://i.stack.imgur.com/w7AYD.png" alt="Err... | <p>Simply the answer is using Previous versions. For more information I refered to <a href="http://winhowto.blogspot.se/2012/09/" rel="nofollow">http://winhowto.blogspot.se/2012/09/</a>… .</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Migrating project from swift3 to swift4 not able to override init<p>I am trying to override init in my DatabaseHelper but somehow. I am getting an error <cod... | <p>The code doesn't even compile in Swift 3.</p>
<p>As <code>dateFormatter</code> is a declared but not initialized property in the class you have to initialize it before calling <code>super</code> for example</p>
<pre><code>public override init() {
dateFormatter = DateFormatter()
super.init()
dateFormatt... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to extract part of an attributes value using XSLT<p>I have the following line of code in a HTML file (or something similar):</p>
<pre><code>...
<a hr... | <p>As already pointed out in the answer given by michael.hor257k, you have to adjust the <code>&</code> character to have valid XML. Given an input containing for example</p>
<pre><code><a href="#SCRIPT_NAME#?a=b&amp;id=a/b/c/d">Link Content</a>
</code></pre>
<p>the following template</p>
<pre><c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove loading spinner in SwipeRefreshLayout<p>I use a SwipeRefreshLayout to reload the content of a listview.
It works and the onRefreshListener is trigger... | <p>Do you mean <code>SwipeRefreshLayout</code>? if so use <code>SwipeRefreshLayout.setRefreshing(false)</code></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Implementing complex file upload scenario with pipeable RxJs operators?<p>I have a scenario where I need to upload a series of files to a web server sequenti... | <p>Use <code>expand</code> to process a dynamic amount of Observables. <code>expand</code> recursively maps to an Observable and receives its output as the next input. End this recursion by returning <code>EMPTY</code>.</p>
<pre class="lang-ts prettyprint-override"><code>// Upload mutiple files one after another with ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Convert yuv420p to rgb888 in C<p>I'm trying to convert planar YUV (yuv420p) to RGB24 in C.</p>
<p>I'm not controlling the input, and have the YUV data as 3 ... | <p>You're getting the U and V values incorrectly.</p>
<p>The U and V values for pixel (<code>i</code>, <code>j</code>) are :</p>
<pre><code>u[((j / 2) * (width / 2)) + (i / 2)];
v[((j / 2) * (width / 2)) + (i / 2)];
</code></pre>
<p>So, try a loop like this :</p>
<pre><code>for (int j = 0; j < height; j++) {
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Specified months previous month data in mysql<p>I want to display data of specified month and year's previous month's data.</p>
<p>Example : My input is Dec... | <pre><code>SELECT * from tbl_usertask
where userBalance.username='e00b6542-b5c6-11e4-aee9-00016c0fd125' and
month( DATE_SUB(userBalance.createddate,INTERVAL -1 MONTH))=monthint and
year( DATE_SUB(userBalance.createddate,INTERVAL -1 MONTH))=yearint;
</code></pre>
<p>?Using this query i got output as expected. Thank yo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use Grouping in LINQ?<p>I just wish to make my question clear. This is my <strong>database</strong>.</p>
<pre><code>Title Amount Tags
Food... | <p>As I understand your question, you don't know how to get the results per tag, right?</p>
<p>First of all, I strongly recommend to use meaningful names in complex LINQ queries instead of x, y, etc. Also it seems to me that you group by TagsReport for which I don't see a reason. And finally, instead of y.First().Titl... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Install Aircrack-ng on ubuntu 14.10<p>I am trying to install Aircrack-ng. All of the instructions are working now up until the point of doing the make. Whe... | <p>I have tried using Aircrack on several Linux distribution and issues like this one happened quite often (usually because of dependency problems).</p>
<p>I solved all problems by installing <a href="http://www.backtrack-linux.org/" rel="nofollow" title="Backtrack">Backtrack</a>, which contains all the packages you n... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to store access token for facebook in social auth<p>I am using social auth for integration of social app like facebook, google and many more. I successfu... | <p>you can go with most easiest way <code>shared preferences</code> .. or use <code>session</code>... where you can save and retrieve <code>string</code> with <code>key value</code>.. </p>
<p>SessionManager.java</p>
<pre><code> public class SessionManager {
// Shared Preferences
SharedPreferences pref;
// Editor for... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cron job not able to establish connection with postgresql database<p>I have tried to run the cron job with the following shell script. </p>
<pre><code>#!/bi... | <p>To access remote server you should execute command <code>psql</code> on this way:</p>
<pre><code>psql -h postgress_host -d apidb -U apidb << EOF
....
</code></pre>
<p>otherwise <code>psql</code> try to connect local server. And when create cron scripts always use fill path to the executables </p>
<pre><co... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get transcational email id by name<p>Does someone know how do I get the id of an email by name set on backend? I have an email created in backend in transact... | <p>please check the codes below. any way this is my first answer on stackoverflow.</p>
<pre><code>$templateName = "Tests";
$templateID = Mage::getModel('core/email_template')->loadByCode($templateName)->getId();
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sending large json data to breezecontroller fail<p>I'm using breezejs to handle my entities on a web application.</p>
<p>Specifically i start with the Angul... | <p>My problem was the default limit on requestLenght that ASP.NET have.
Increasing that limit on the web.config allow breeze to post large data.
(default size is 4096 KB)</p>
<pre><code><system.web>
<httpRuntime targetFramework="4.5" maxRequestLength="5120" />
</system.web>
</code></pre>
<p><a h... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Independent t-test with an aov-object in R<p>Is there a simple way to compute independent t-tests with an aov object, similar to how pairwise comparisons can... | <p>I'm trying to discern what the question really is. This answer is based on this guess: </p>
<blockquote>
<p>Is it possible to use <code>emmeans()</code> to do all independent <em>t</em> tests comparing several samples, two at a time?</p>
</blockquote>
<h3>Pooled t tests: NO (similar but not exactly)</h3>
<p>The... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
wxDC plot a waveform wxwidgets<p>Hello I use CodeBLocks + WxWidgets + Portaudio . I want to draw a wavefrom during the record the voice from microphone. How ... | <p>Drawing sample included in wxWidgets shows how to use <code>wxDC</code>. You can see at how plotting is done by looking at the sources of any of the various plotting libraries for wxWidgets and, perhaps, you should consider just using one of them instead of doing this on your own.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to calculate string occurence in racket<p>Write a Racket function red-vs-blue which consumes a list ramble, and produces a string according
to the follow... | <p>You just need to call the function for each color, store the results and compare them with a conditional:</p>
<pre><code>(define (red-vs-blue lst)
(let ((reds (calculate lst "red"))
(blues (calculate lst "blue")))
(cond ((> reds blues) "red")
((< reds blues) "blue")
(else "t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In C, is there a way to get the size of multiple files with names matching a string?<p>I have files something like this: </p>
<ul>
<li>file1_a_etc.txt, </... | <p>For Windows console there is function <code>_findfirst</code>. For first parameter put <code>*a*.txt</code>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
CSS prevent multiple transition on div children<pre><code>.product-item :hover{
transition: background-color 0.5s ease-out;
background-color: lightgrey;
... | <p>First off, there shouldn't be a space between <code>.product-item</code> and <code>hover</code>. Then there is no need for the second CSS rule.</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>.product-item:hov... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
possible to use javascript to change a html td into a link?<p>Is it possible to use only JavaScript to turn one <code><td></code> in below table into a... | <p>This puts all <code><td></code> elements in an array, which you could iterate through and assign a url to each if you want.</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><table style="width:100%"&... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can i use an else function in xslt 1.0 / xml<pre><code> <cac:InvoiceLine xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComp... | <p>Try it this way:</p>
<pre><code><xsl:template match="/ubl:Invoice">
<xsl:for-each select="cac:InvoiceLine[cac:Item/cac:CommodityClassification/cbc:ItemClassificationcode='83101800']">
<xsl:choose>
<xsl:when test="cac:Item/cbc:Description='Netbeheerkosten'">Net1</xs... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Haskell is slower in parallel<p>I've been experimenting with parallelizing Haskell programs. To my surprise most of my attempts made my examples run slower, ... | <p>I just did the test again and like expected the parallel version is faster.</p>
<p>It turns out, it is a bad idea to measure performance, while the CPU is 100% busy converting videos.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remove values from DropDownList<pre><code>$("#Month option:selected").val()
</code></pre>
<p>this is giving me a selected value from my dropdownlist. But i ... | <p>You can use <code>.remove()</code> to completely remove element from DOM.</p>
<pre><code>$("#Month option[value='whatever']").remove();
</code></pre>
<p><strong>EDIT</strong></p>
<pre><code>$("#Month option[value='whatever']").hide();
</code></pre>
<p>and you can later get them back by</p>
<pre><code>$("#Month ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create specific time variable in Flutter<p>With <code>TimeOfDay.now()</code> we can get the actual time, but how can we create a variable with a different ti... | <p>Simply do this:</p>
<p><code>TimeOfDay(hour: 12, minute: 0)</code></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Automatic padding to assemble certain instructions into predetermined addresses<p>I'd like to use CA65 to assemble a 6502 ROM that needs to run on its own, i... | <p>Turns out the CC65 wiki has <a href="https://github.com/cc65/wiki/wiki/The-.ORG-directive" rel="nofollow">a page on .ORG</a> that, while trying to dissuade me from doing this, also shows a neat solution using <code>.res</code> and some PC arithmetic:</p>
<pre><code> .org $C000
reset: ;; Some code from here
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Excel Macro: If the final characters in each row of a column is "something", then<p>I'm trying to concatenate two cells if certain conditions are met in one ... | <p>Here is your reverse loop with some error control added.</p>
<pre><code>Sub concat()
Dim i As Long, l As Long
l = Cells(Rows.Count, 4).End(xlUp).Row
For i = l To 1 Step -1
If Not IsEmpty(Cells(i, 4)) Then
If Not IsError(Cells(i, 4)) Then
If LCase(Right(Cells(i, 4).Val... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pthreads and signals C++<p>I'm new to threads and seem to be having a timing problem. When I run my code my output is... </p>
<blockquote>
<p>Data receive... | <p>A condition variable is near-useless without a <em>predicate</em>, a conditional state that dictates <em>what</em> has changed. The condition variable is little more than a signaling mechanism to announce that "something" may have changed, but you still need to manage the "what". And that mutex is what protects that... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL: Find out the expense that each customer has made through card and cash<p>I have three tables: </p>
<pre><code>transactions
customers
credit card
</code... | <p>This is an odd data model. You have to go through the credit card to get the customer, but some transactions are partially in cash and partially by credit card.</p>
<p>In any case, you can impute a credit card using window functions and <code>join</code>. And then aggregate:</p>
<pre><code>select cu.Cust_id, cu.... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java newbie: cutting a string off?<p>I'm new to programming (taking a class) and I'm not sure how to accomplish this one task.</p>
<p>"Ignoring case, find t... | <p>For finding the last occurence of 'a' or 'A' you can use...</p>
<pre><code>int index = Math.max(str.lastIndexOf('a'),str.lastIndexOf('A'));
index = (index==-1)?Math.min(2,str.length()):index+1;
</code></pre>
<p>Once you get the index you can use the following to remove the characters after it...</p>
<pre><code>st... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SAM Adding s3 website to API Gateway + Lambda with single custom domain name<p>I'm working to create a notes application (api + website) on a single custom d... | <p>You would:</p>
<ul>
<li>Set up CloudFront with two origins, S3 and API Gateway.</li>
<li>Use API gateway to proxy your s3 endpoint</li>
</ul> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Use TLS and Python for authentication<p>I want to make a little update script for a software that runs on a Raspberry Pi and works like a local server. That ... | <p>In a word: <strong>yes</strong>, this is quite possible, and all the necessary stuff is
ported to python 3 - I tested all the following under Python 3.4 on my Mac and it seems to
work fine.</p>
<p>The short answer is
"<a href="http://twistedmatrix.com/documents/15.0.0/api/twisted.internet.ssl.Certificate.html#peerF... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
VB.Net Regular Expression that allows spaces<p>How to I create a RegEx that allows string input (letters) and allows spaces?</p>
<p>Originally I used:<code>... | <p>This regex won't allow spaces at the start or at the last.</p>
<pre><code>"^[a-zA-Z]+(?: [a-zA-Z]+)*$"
</code></pre>
<p><a href="https://regex101.com/r/yP1kI0/1" rel="nofollow">DEMO</a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a windows keyboard layout that would both be QWERTY and allow for french accents without disturbing code<p>I'm currently using a Thinkpad on windows... | <p>Since I had not found a Keyboard layout that would fit my needs I created one using the Microsoft Keyboard Layout Creator.</p>
<p>This layout features the <strong>regular QWERTY layout</strong> plus it adds <strong>all of the accent combinations of QWERTY International with the characters (" ' ` ~ ^) if you hold Al... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
WatchKit Extension Bundle ID Unavailable<p>I've added a watch kit app to my iOS app and everything was working fine and running well until I wanted to share ... | <p>It turns out that another developer account that I use in Xcode had the missing ID. The apps are completely unrelated and belong to different clients of mine so I've no idea how it ended up there.</p>
<p>I deleted the Bundle ID from that account and everything is working as expected now.</p>
<p>If this happens any... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Should I pass request object to goroutine in blocking for-select loop coming from channel?<p>I have the following for-select structure in code:</p>
<pre><co... | <p>No (<strong>does not apply here</strong>), you have new variable (memory address) on each loop iteration:</p>
<pre><code> case request := <-runCh:
</code></pre>
<p>Because this <code>:=</code> creates new variable distinct from previous one, proof:</p>
<pre><code>package main
import (
"fmt"
"time"
)
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
unable to target specific css class<p>trying to target <code>.product-price on-sale</code> to change the color to green but i'm not able to. </p>
<p>HTML</p... | <p>A few problems with your selector:</p>
<blockquote>
<p>section#buy h2.product-price-on-sale span</p>
</blockquote>
<ul>
<li><p>First part:</p>
<blockquote>
<p>section#buy</p>
</blockquote>
<p>It's ok assuming you have an extra wrapper with id <code>buy</code></p>
<pre><code><section id="buy">
</code><... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Vim map :q to quit without saving<p>I would like Vim to quit without saving when I enter <code>:q</code>.</p>
<p>It annoys me when Vim prompts me to save wh... | <p>You can use <code>cabbrev</code>, that works like a map from a command line instruction to another one, like:</p>
<pre><code>:cabbrev q q!
</code></pre>
<p>So now just type:</p>
<pre><code>:q
</code></pre>
<p>and it will omit changes to exit without asking.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Javascript - Convert serialized date string to short date string<p>How can I convert a serialized date value (1424246400000) to a short date string ("2/23/20... | <p>You should be able to get a simple date string in your current locale format using <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleDateString" rel="nofollow"><code>Date.prototype.toLocaleDateString</code></a> without any parameters or you can pass <em>"en-US"</e... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Android Thread vs AsyncTask vs IntentService called from BLE onCharacteristicChanged()<p>I have an Android app from which I receive BLE data (every 62ms via ... | <blockquote>
<p>But the docs say execute must be invoked on the UI thread, and I'm calling it from the BLE callback. Is that a problem? And how should I fix it?</p>
</blockquote>
<p>The framework triggers the <code>AsyncTask</code> callback methods on the same thread it was called from (presumed to be the main threa... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mysterious crashes in Swift 1.2 - in Release builds only<p>After updating to Xcode 6.3 (beta 1) and Swift 1.2, all my apps are mysteriously crashing <em>in R... | <p>Amazingly, I <em>did</em> track this down, mostly by deleting code in large swatches until I was down to just this (it's a view controller):</p>
<pre><code>class LessonListController: UIViewController {
var terms : [Term]
// var terms : NSArray
init(terms data:NSArray) {
let arr = data.sortedArr... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular UIRouter resolve unknown provider<p>I'm trying to use ui-router resolve to grab some data for use in the controller:</p>
<pre><code>$stateProvider
... | <p>You have included the controller twice. Once in the HTML, and once in the ui-router. Therefore, you're actually getting two instances of the controller.</p>
<p>Solution: remove the controller include from the HTML, and add this to the ui-router $stateProvider:</p>
<pre><code>controllerAs: 'home'
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Finding and deleting sub-strings in dataframe column Python<p>I would like to find all the rows in a column that contains a unique ID as a string which start... | <p>Do a conditional row-wise apply to the same column:</p>
<pre class="lang-py prettyprint-override"><code>df['ID'] = df.apply(lambda row: row['ID'][:9] if '.20_P' in row['ID'] else row['ID'], axis=1)
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Jmeter master slave not all threads finishing<p>I have a master/slave for jmeter set up using jmeter 5.1
For time to time I am noticing the tests just hangs ... | <p>If you want to "understand" the issue you need to understand what this thread is doing and the only way to get the information is <a href="https://helpx.adobe.com/experience-manager/kb/TakeThreadDump.html" rel="nofollow noreferrer">taking a JVM thread dump</a>, the options are in:</p>
<ol>
<li><p>Starting from <a h... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Execute two programs in separate screen windows with bash<p>I’ve been toying around to create a functional bash script to solve my problem, but have’t been s... | <p>The simple answer would be:</p>
<pre><code>screen -d -m -S fluid fluidsynth -a alsa -c 3 -g 3 /usr/share/sound/sf2/piano.sf2
screen -d -m -S connect bash -c "sleep 10; aconnect 20:0 128:0"
</code></pre>
<p><code>-d -m</code> tells screen to start in detached mode.</p>
<p>If you have a way to detect fluidsynth's p... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting non-zero data position from csv file_Python<p>I have a csv file with data like this:</p>
<p><a href="https://i.stack.imgur.com/6himS.png" rel="nofol... | <p>You can achieve it with following code.</p>
<pre><code>import csv
with open('test.csv', newline='\n') as csvfile:
spamreader = csv.reader(csvfile, delimiter=',', quotechar='|')
row_id = 1
for col_val in spamreader:
# Moving through each Row
col = 1
for val in col_val:
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cannot find symbol 'DirImp1'<p>Corba client file:</p>
<pre><code>import DirApp.*;
import org.omg.CosNaming.*;
import org.omg.CosNaming.NamingContextPack... | <p>You have declared your variable as <code>DirImpl</code> but you're using <code>DirImp1</code>, so change them to <code>DirImpl</code> or declare the variable as <code>DirImp1</code>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is Kibana trends not working?<p>I have created an data river from Twitter and loaded that data into Kibana dashboard using elasticsearch. While all the a... | <p>I also faced this exact issue. The problem was that kibana assumes the timestamp to be @timestamp field , you need to override this to created_at timefield.
This can be done by going to the global settings in kibana and change @timestamp to created_at field.
After this , you can first change the dashboard settings t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Sorting sheets by name when the names are dates<p>I have a google spreadsheet where some of the sheets names are text and others are dates in "dd/mm/yyyy/" f... | <h3>Cause:</h3>
<ul>
<li>As written in the <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/Date" rel="nofollow noreferrer">documentation</a>, <code>Date.parse(timestring)</code>, where timestring is a date only iso8601 compatible string, returns a date in UTC. When you fo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ListView setting background color to an item ERROR<p>Well, I have a horizontal LinearLayout, with items of a custom class.</p>
<p><strong>What I want:</stro... | <p>why not use the adapter for the modification?I presume you are using a custom adapter?</p>
<p>in You Adapter</p>
<pre><code>public int selectedItem;
.
//Rest of the stuff
.
.
@Override
public View getView(final int position, View convertView, final ViewGroup parent) {
if (null == convertView) {
Layout... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I define a project variable with candle in WIX?<p>I want to take an existing project variable and extend it but I want it to be global so that I don'... | <p>You can define preprocessor variables with Candle as so:</p>
<pre><code>candle.exe -dMyVariable=whatever.
</code></pre>
<p>This is not a hard answer to find with google but my problem was that I was trying to do:</p>
<pre><code>candle.exe -dMyProject.TargetDir.Help=$(var.MyProject.TargetDir)Help\
</code></pre>
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Ruby #to_enum: what's the best way to extract the original object from the enumerator?<p>Suppose I have an object:</p>
<pre><code>obj = Object.new #<Obj... | <p>I am not sure why all this talk of enums.</p>
<p>I'll presume hands are in a format similar to this:</p>
<pre><code>hands = [Hand.new([[12, "H"], [10, "H"], [8, "D"], [3, "D"], [2, "C"]]),
Hand.new([[10, "D"], [9, "H"], [3, "C"], [2, "D"], [2, "H"]]),
Hand.new([[12, "D"], [10, "S"], [8, "C"], [3,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.