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:
show strings in compiled binary<p>Lets suppose I have simple C program and I compile it with <code>gcc -o hello hello.c</code>:</p>
<pre><code>#include<s... | <p>From <a href="http://man7.org/linux/man-pages/man1/strings.1.html" rel="nofollow"><code>man 1 strings</code></a> (emphasis mine):</p>
<blockquote>
<p>For each file given, GNU strings prints the printable character
sequences that are at least 4 characters long (or the number given
with the option... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to parse using boost if it is not json, but similar to it?<p>I have an application that reads some parameters from a json file, but now the file has chan... | <p>It looks like Yet Another YAML/Mustache/JSON/... derivative.</p>
<p>Without a formal spec it's hard to actually assess what effort would be required, but here's a list of implementations of similar grammars in Boost Spirit, with varying amounts of feature completeness:</p>
<ul>
<li><a href="https://stackoverflow.c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Error inflating class fragment InflateException Binary XML file<p>I am designing my first application using Material Design and the NavigationDrawer Layout e... | <p>In your <code>fragment_navigation_drawer.xml</code> give an id to your <code>Listview</code> and in your <code>onCreateView</code> of <code>NavigationDrawerFragment.java</code> file. </p>
<pre><code>View myParentView = inflater.inflate(
R.layout.fragment_navigation_drawer, container, false);
mDrawerListView... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
equals() and hashCode() override in hybris<p>Is there any way to override <code>equals()</code> and <code>hashCode()</code> methods for types from <code>*-it... | <p>If your question is about generated **Model instances, there is no possibility to have a custom implementation for <code>hashCode</code> and <code>equals</code>. Please note that the "generated" implementation considers two instances as equals if they have the same <code>PK</code> and are in the same <code>tenant</c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Oracle SQL Between Dates Query<p>I don't understand why my query is not returning anything:</p>
<pre><code> select * from emp where hiredate between to_date... | <p>Another difficulty with the statement in the OP</p>
<pre><code>select * from emp where hiredate between to_date ('01/01/81',
'mm/dd/yy') and to_date ('12/31/81', 'mm/dd/yy');
</code></pre>
<p>is that <code>hiredate</code> could contain a time part. Given the sample data, it doesn't, but there's nothing preventing... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make a specific file extension callable in DOSBox?<p>For example if I type <code>hello.asm</code> on the screen,</p>
<p>I want a specific batch file ... | <p>DosKey has been around since MS-DOS 5. I find it easiest to use with a macro file and a script to load that file. But according to <a href="https://www.dosbox.com/wiki/Commands" rel="nofollow noreferrer">DosBox</a>, they do not have support for DosKey. You've already tried <a href="http://retro.software/downloads... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Anisble: get dynamic register from with_items<p>I've tried to create a register using <code>with_items</code> that can dynamically change with any added item... | <pre><code> - name: Set Openfile for specific user in /etc/security/limits.d/{{ user }}
copy:
dest: "/etc/security/limits.d/{{ item }}"
content: |
"{{ item }}" - nofile 128000
"{{ item }}" - nproc 65536
with_items:
- kube
regist... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
IIS Express vs dotnet run<p>Actually I understand that <strong>IIS Express</strong> is lightweight development server. From the other side <strong>"dotnet ru... | <p><code>dotnet run</code> will use the embedded Kestrel server. IIS Express will use IIS Express as a reverse proxy which calls Kestrel behind the scenes. In either case a server is hosting your app.</p>
<p>You can toggle your local server choice by adjusting the run configuration. IIS Express will use...IIS Express. ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to emulate Firefox "Save File" -> OK in Python<p>My following code:</p>
<pre><code>#!/usr/bin/env python
from selenium import webdriver
from selenium.we... | <p>This particular dialog <em>cannot be controlled via selenium</em> - this is a browser popup, not a javascript popup (which can be automated with <code>swith_to.alert</code>).</p>
<p>In this case, you need to avoid the popup being shown in the first place and make Firefox download the file automatically by tweaking ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
cartjs tooltips displays in the wrong place on a chart<p>I just added <code>tooltips: { mode: 'index', intersect: true }</code> to this particular <a href="h... | <p>From the sample code you provided in your comment to my first answer, I see that the values of your datasets don't start at the same x-position. Therefore <code>mode: 'index'</code> doesn't work and you should use <a href="https://www.chartjs.org/docs/latest/general/interactions/modes.html#x" rel="nofollow noreferre... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Navigation in WIndows App<p>How does Navigation in Windows Apps work?When I call <code>Frame.Navigate(typeof(MainPage));</code> (calling MainPage) from say,<... | <p>The constructor is what actually creates the <code>Page1</code> object. There is no object before that, so no other methods could be invoked. And so, the constructor is called first, to create the object.</p>
<p>Inside the constructor, there is a call to the <code>InitializeComponent()</code> method which is automa... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a way to include timed pauses while looping through an array?<p>I am creating an app that can translate letters in a string to a vibration pattern. ... | <p>I would convert it from a for...in loop to a traditional C-style for loop so that you can keep track of the indices. Then when inside the for loop, you can wrap everything in a DispatchQueue delay based on the current index of the letter you're on. Something like this.</p>
<pre><code>for i in 0..<letterArray.cou... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Plotting masked numpy array leads to incorrect colorbar<p>I'm trying to create a custom color bar for a matplotlib <a href="http://matplotlib.org/api/collect... | <p>Pass the BoundaryNorm to the PolyCollection, <code>poly</code>. Otherwise, <code>poly.norm</code> gets set to a <code>matplotlib.colors.Normalize</code> instance by default:</p>
<pre><code>In [119]: poly.norm
Out[119]: <matplotlib.colors.Normalize at 0x7faac4dc8210>
</code></pre>
<p>I have not stepped throug... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how should a neural network learn clusters assuming a particular weight matrix and learning rate?<p>let us consider a set of six points S={a(-1,1),b(-1,2),c(... | <p>Try Genesis Software free trial or JMP SAS. They have excellent documentations and the algorithms you need are implemented therein</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to generate multiple json in vertical column in Excel VBA?<p>Using excel macro The first line is the json file name, and the second and subsequent column... | <p>Here is VBA example showing how the files could be created. <strong>Import <a href="https://github.com/omegastripes/VBA-JSON-parser/blob/master/JSON.bas" rel="nofollow noreferrer">JSON.bas</a> module from <a href="https://github.com/omegastripes/VBA-JSON-parser" rel="nofollow noreferrer">VBA JSON parser</a> into the... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
image Relative Paths only work online, but not from local disk<p>My images' relative paths <strong>do not work locally</strong>, instead they only <strong>wo... | <p>This is most likely because your paths are relative. If you run your site through WebMatrix or Visual Studio locally, it will pick up the image files as they will be present at:</p>
<p>localhost:xxxx/media/image.jpg</p>
<p>But when you open a html page in the browser, it is not running on a server so it will look ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can you compile sass to css with webpack 4?<p>Can't figure out how to compile main.scss file to styles.css with webpack4.
All javascript and scss are co... | <p>You could try redefining the use property of the .scss rule.</p>
<pre><code>{
test: /\.scss$/,
use: [
MiniCssExtractPlugin.loader,
'css-loader',
'sass-loader',
]
},
</code></pre>
<p>Then add this to your plugins:</p>
<pre><code>plugins: [
...,
new MiniCssExtra... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting distance between point of an object and another object<p>First, I'd like to apologize because this is a very basic and repetitive question, but I am ... | <p>I'm not exactly sure what you wan't to achieve... </p>
<p>If you wan't to get potential objects at 0.5, 1, 1.5, etc. on lets say the Z Axis you probably would want to do this with <a href="http://docs.unity3d.com/ScriptReference/Physics.Raycast.html" rel="nofollow">raycasting</a>. </p>
<p>If you wish to check for ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
dictionary contains only single element<p>I create a dictionary with features and styles by this:</p>
<pre><code>featureStyles = { };
myList.forEach((f) =&g... | <p>You can't use an object as an object key, it will be converted to string so each object will correspond to the <code>[object Object]</code>, all keys will be the same, so you are always overriding the previous key value.</p>
<p>You can use <code>WeakMap</code> or <code>Map</code> instead:</p>
<pre><code>var featur... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Allow additional protected appends not working in Azure Stream Analytics?<p>Allowing protected append writes to blob storage when Immutable Time based policy... | <p>Stream Analytics blob output currently always creates block blobs. With immutability enabled, put block is allowed only once and further writes to the same blob would fail. Stream Analytics's attempt to add additional content would fail and it would then create a new blob.
There is no option to create AppendBlobs i... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Customising HTTP header in calls to ASMX service<p>I am trying to add an HTTP header in calls to an ASMX service.</p>
<p><a href="https://stackoverflow.com/... | <p>Found <a href="https://stackoverflow.com/questions/1309767/adding-custom-http-headers-to-web-service-proxy/1310055#1310055">this post</a> which states that a partial class in a separate file should be used to override <code>GetWebRequest()</code> and insert the custom headers.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Line up "Back" text with heading<p>What would be the best way of lining up the Back text (by placing it on the left hand side) with the Booking heading? I am... | <p>Out of the box, <code>span</code>s are used in such cases - they are inline elements, while <code>div</code>s are blocks. Of course, that can be overridden by setting the display to inline/inline-block, or using floats, etc...</p>
<p>However, the best solution in your case seems to be setting the container to relat... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
bootstrap3 nav close when clicking with dropdown<p>i use bs3 and my mobile menu close now by clicking. But when i click on the menu from the dropdown they al... | <p>You need to change the selector for which you attach on event to:</p>
<pre><code>$('.nav li:not(.dropdown) a')
</code></pre>
<p>See updated <a href="http://jsfiddle.net/sack847t/3/" rel="nofollow">jsfiddle</a>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Active directory VBS to VB<p>Hi I need to rewrite VBS script to VB file but I have trouble with following.</p>
<p>In VBS there is this:</p>
<pre><code>Set ... | <pre><code>Item.Property("Description")(0).tostring
</code></pre>
<p>"Description" = key</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ios nsCoding set but not calling encodeWithCoder<p>I am trying to use NSCoding to save and recover application state. I haven't used it before. </p>
<p>In m... | <p>The problem is that "testfile" on its own is not a valid filename. If this is changed to "tmp/testfile" it works fine. </p>
<p>Interestingly, if you get the file name wrong on encode, it won't call the decode function, even though the decode call doesn't specify the file name. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Deploy Java application with Rest web services in Openshift server<p>I´m trying to deploy java application in OpenShift server. My application is divided in ... | <p>Openshift is expecting to compile the application on their server using the pom.xml then run the application it built. To do that your project needs to be a <a href="http://www.mkyong.com/maven/how-to-create-a-web-application-project-with-maven/" rel="nofollow">maven webapplication project</a>. Only when you have te... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
string.Format - timeSinceLevelLoad in 12:34 SS:MS<p>I wish to format the timeSinceLevelLoad into a format of 00:00 so the player can see how many seconds and... | <p>Try this...</p>
<pre><code>void Update () {
timeText.text = string
.Format("{0:00.00}", Time.timeSinceLevelLoad)
.Replace(
CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator,
":");
}
</code></pre>
<p><strong>EDIT:</strong> As stated in the comment on the que... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Cakephp + Visual Studio tools for PHP<p>I'm trying to debug my cakephp application with php tools for Visual studio (2013).</p>
<p>I'm not able to do it, it... | <p>To debug a cakephp app using MS Visual Studio 2013, I did these steps and it's working fine for me : </p>
<ul>
<li>1 - create a new PHP Web Project.</li>
<li>2 - copy your ( new created ) cakephp app to the directory of the PHP Web project and include all the app to it.</li>
</ul>
<p>So you will get something like... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Get a string output using Rply throws ParserGeneratorError: Expecting :<p>Trying to implement parser using rply its just like ply</p>
<pre><code>#Input = ['... | <p>Your code indicates that you tested the lexer. However, the test indicates that the lexer is not producing the correct tokens:</p>
<pre><code>>>> for token in l.lex('ABC'):
... print(token)
...
Token('String', 'A')
Token('String', 'B')
Token('String', 'C')
</code></pre>
<p>The expected output would hav... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is the escape character sometimes output in the interactive interpreter of Python?<p>If I type this in the interactive interpreter of Python:</p>
<pre><... | <p>The single quote needs to be escaped because the string is delimited with single quotes. If it weren't escaped then it would signal the end of the literal.</p>
<pre><code>'"Isn\'t," they said.'
^ ^
</code></pre>
<p>If the string were reproduced with double quotes on the outside then the ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Require two words in textbox, with AngularJS<p>I really struggling with this. I need to force the user to write the first and last name, in only one textbox.... | <p>Thanks, for all your help. But what really worked was this regular expression.</p>
<pre><code>\b([A-Z]{1}[a-z]{1,30}[- ]{0,1}|[A-Z]{1}[- \']{1}[A-Z]{0,1}
[a-z]{1,30}[- ]{0,1}|[a-z]{1,2}[ -\']{1}[A-Z]{1}[a-z]{1,30}){2,5}
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
plot heatmap including NA<p>I'm plotting a heatmap of the following csv file:</p>
<pre><code>"people","1","2","3","4","5","6","7","8","9"
"Ej1",0,0,0,1,0,1,... | <p>If you do not specify the <code>id</code> variable in <code>melt</code>, both <code>people</code> and column <code>8</code> are treated as ids, and you loose X8 in the variable column of the molten data. You then do not get variable X8 plotted in the heatmap.</p>
<p>Using <code>melt(data,id='people')</code> should ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pygame mask collision<p>I'm trying to get proper collision detection with rotating surfaces in pygame. I decided to try using masks. It somewhat works, but i... | <p>Your application works fine. But note, <a href="https://www.pygame.org/docs/ref/sprite.html#pygame.sprite.collide_mask" rel="nofollow noreferrer"><code>pygame.sprite.collide_mask()</code></a> use the <code>.rect</code> and <code>.mask</code> attribute of the sprite object for the collision detection.<br />
You have ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to terminate invoking setAlarm once the alarm is rang.<p><strong>My Problem :</strong> <code>setAlarms()</code> method is called again and again (64 time... | <p>Remove the line</p>
<pre><code>TRAlarmManager.setAlarms(this);
</code></pre>
<p>from the <code>onStartCommand()</code> method of <code>TRService</code>. I believe this is what is causing the problem.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to check whether a directory is readable or writable?<p>I want a way to know whether a directory/folder is readable or writable. I searched for a direct ... | <blockquote>
<p>I want a way to know whether a directory/folder is readable or
writable.</p>
</blockquote>
<p>Directly to try to open the directory with read/write access permission via <a href="https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea" rel="nofollow noreferrer"><code>Creat... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Video treatment in Visual Studio with Emgu cv in c#<p>I am currently working on a project where I have to do real-time video treatment. The first step consi... | <p>In the code of the video link you have provided uses the following line to access the live default web cam feed. </p>
<pre><code>Capture capWebCap = new Capture();
</code></pre>
<p>You can use the following line to open a video file.</p>
<pre><code>Capture video = new Capture("your_file_name.wmv");
</code></pre>
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to select dates from dual, but with joined data?<p>I got an SQL problem I'm not capable to solve.</p>
<p>First of all, an SQL fiddle with it: <a href="h... | <p>If you want the dates per <code>id</code> that are not in the database then you can use the <code>LEAD</code> analytic function:</p>
<pre class="lang-sql prettyprint-override"><code>WITH dates ( id, date_from, date_to ) AS (
SELECT id_othertable,
DATE '2020-01-01',
MIN( date_from )
FROM some... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AngularJS text input validation with counter<p>I'm developing an app containing a form which has a text input with <code>ng-model="description"</code>.
Now I... | <p>Use the form element $viewValue instead like this:</p>
<pre><code><form name='form'>
<input type="text" name='description' ng-model='description' ng-maxlength="50">
{{form.description.$viewValue.length || 0}}/50
</form>
</code></pre>
<p>See <a href="http://plnkr.co/edit/Oy98xR184TA9XMq2UIeQ?... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why can't I use Start-Process to invoke a script with parameters?<p>I am trying to write a wrapper script in Powershell which is passed the name of an execut... | <p>You need to invoke the script through <code>powershell.exe</code>:</p>
<pre><code>Start-Process powershell -ArgumentList "-File .\test.ps1 arg1 arg2 argX"
</code></pre>
<p>You can specify the argument list either as a string or an array of strings. <a href="https://docs.microsoft.com/en-us/powershell/module/micros... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
App rejected due to crash on app store<p>I had developed an app and uploaded it on app store. The app got rejected due to crash. But my problem is that I can... | <p>Actually, app was getting crashed on devices with 64 bit architecture. as older version of unity don't support 64 bit architecture. Unity 4.6.2 onwards support 64 bit architecture. Thus rebuild the ios app and it worked fine.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MS Access count query does not produce wanted results<p>I have a table (tblExam) showing exam data score designed as follow:</p>
<p>Exam Name: String<br>
S... | <p>It seems you want to display all <em>name</em> groups and, within each group, the count of <code>Score < 0.695</code>. So I think you should move <code>< 0.695</code> from the <code>WHERE</code> to the <code>Count()</code> expression --- actually remove the <code>WHERE</code> clause.</p>
<pre class="lang-s... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to read Xmx and Xms values from standalone.conf using CLI?<p>How can I check the values of Xmx, Xms, and other JVM values, which are in standalone.conf, ... | <p>You can't. These files, which live outside of the configuration directory, are native batch type files. That's why there is a <code>standalone.conf</code> and a <code>standalone.conf.bat</code> - they are O/S dependent. The CLI interacts with <code>standalone.xml</code> (or the other standalone configuration file... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Merge data and create array with Object.assign()<p>I'm trying React-Redux exercise.
I have an array in global state. I'm print it with component. Then I want... | <p>ProductList is an array, so you must treat as one. Right now you're just replacing the array with an object.</p>
<p>try:</p>
<pre><code>return Object.assign({}, state, { ProductList: state.ProductList.concat(action.payload.__item) });
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How could I redirect file name into counts by tab using one line commands in bash?<p>I have some files in fasta format and want to counts their reads and wou... | <h3>Suggested solution</h3>
<pre><code>grep -c '>' *.fa | sed 's/:/'$'\t'/ > out.txt
</code></pre>
<p>The <code>$'\t\'</code> is a Bash-ism called <a href="http://www.gnu.org/software/bash/manual/bash.html#ANSI_002dC-Quoting" rel="nofollow">ANSI C Quoting</a>.</p>
<h3>Analysis of what went wrong</h3>
<p>Your ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL Aggregate functions with groupings<p>I need to create some checks to make sure that students are enrolled in the correct courses with the correct number ... | <pre><code>SELECT
STUDENTID,
SUM(CASE BOARDCATEGORY WHEN 'A' THEN 1 ELSE 0 END) AS SUM_A_UNITS,
SUM(CASE BOARDCATEGORY WHEN 'B' THEN 1 ELSE 0 END) AS SUM_B_UNITS,
SUM(CASE BOARDCATEGORY WHEN 'C' THEN 1 ELSE 0 END) AS SUM_C_UNITS,
SUM(CASE BOARDCATEGORY WHEN 'A' THEN 1 WHEN 'B' THEN 1 ELSE 0 END) AS SUM_A_UNITS+SUM_B_UN... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
I want to copy a couple different files in different folders<p>eg.
I have sam1_1.gz sam2_1.gz sam3_1.gz ..200 of these and I have corresponding folder sam1, ... | <p>Create files:</p>
<pre><code>for i in {1..200}; do touch $i.gz; done
</code></pre>
<p>Then run:</p>
<pre><code>#!/bin/bash
for filename in *.gz; do
file="${filename%.*}"
mkdir $file
mv $filename ./$file
done
</code></pre>
<p>This extracts the filename without the extension - makes the directory and moves ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
XSL how do i test a boolean data type?<p>I am trying to test an attribute which is defined in the schema as a Boolean data type. The XML is dynamically creat... | <p>First thing: unless you are using a schema-aware processor, it doesn't really matter what your schema says. </p>
<p>Next, if you are using an XSLT 2.0 processor, as your stylesheet declares, then you can see if a value is true or false by applying the following test:</p>
<pre><code>test="xs:boolean(value)"
</code>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Android annotations gradle warning<p>I'm using <strong>Android Studio 1.1 beta 4</strong> with <strong>gradle plugin 1.0.1</strong> and trying to add Android... | <p>How @WonderCsabo already told this is a false positive. You can avoid this warning if you access the outputs explicit as collection</p>
<pre><code>androidManifestFile variant.outputs.collect()[0].processResources.manifestFile
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
MySQL, JSON and Fullcalendar<p>I am working to integrate MySQL events in Fullcalendar.</p>
<p>I've read many guide/post but i can't import events from a jso... | <p><code>events</code> should be single url to feed from database.</p>
<p>So replace events like this:</p>
<pre><code>events: 'fullcalendar/php/get-events.php',
</code></pre>
<p><strong>Check in browser inspector if it tries to reach DB file.</strong> In Chrome it opens with Ctrl+Shift+i and navigate to <code>Networ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Django - TypeError: object of type 'int' has no len()<p>I have a django model <code>Project</code> that looks like this:</p>
<hr>
<pre><code>class Project(... | <p>Your problem is with setting the default value on the ManyToMany relation for <code>project_views</code> and <code>project_likes</code>. The ManyToMany field is expecting some form of a queryset or list (since its many), but in your case you set it to <code>0</code> as int. Change your 2 fields like so (notice field... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
FSCrawler can't find existing jobs<p>I'm quite new to the Elastic Stack and want to index documents by using FSCrawler. I'm occuring a strange problem:</p>
... | <p>Sooo, after finding this video: <a href="https://www.youtube.com/watch?v=vziwQjHk1Bk" rel="nofollow noreferrer">Indexing many PDF files for full-text search using Elasticsearch</a></p>
<p>I solved it by using the command he showed in the video:</p>
<pre><code>bin\fscrawler --config_dir ./DS data_science --loop 1
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python bus between processes<p>I am completely starting over with my robots brain. All is developed in Python. </p>
<p>I want to keep everything as modular ... | <p>Try <a href="http://nanomsg.org/" rel="nofollow">nanomsg</a> (follow-up project to ZeroMQ):</p>
<blockquote>
<p>nanomsg is a socket library that provides several common communication
patterns. It aims to make the networking layer fast, scalable, and
easy to use. Implemented in C, it works on a wide range of o... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
In Java how do I convert from seconds since epoch to milliseconds since January 1, 1970, 00:00:00 GMT<p>In short:</p>
<p>I have a time that is in epoch and ... | <p>Quoting <a href="https://www.timeanddate.com/time/change/australia/sydney?year=2010" rel="nofollow noreferrer">timeanddate.com</a>:</p>
<blockquote>
<p>When local daylight time was about to reach <code>Sunday, April 4, 2010, 3:00:00 am</code> clocks were turned backward 1 hour to <code>Sunday, April 4, 2010, 2:00... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Find multiple text strings with jQuery and change its style<p>I use <a href="https://stackoverflow.com/users/144665/iambriansreed">iambriansreed</a> code fro... | <p>The reason it doesn’t work, is because you have multiple elements with the same ID in your document. So when you select an element by ID, it just selects the first element with that ID.</p>
<p><em>In HTML documents, IDs <strong>must be</strong> unique.</em> Use classes instead:</p>
<pre><code><span class="title... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Getting width and height of image without need of opening it in PS - CS6 script<p>I strugled to search the answer in documentation (<a href="https://www.adob... | <p>Not sure what sort of answer you are looking for because you seem to want to write Javascript but you don't want Photoshop to open your images, so I wanted to advise that you can use <strong>ImageMagick</strong> to get the width and height of all your JPEG/PNG images easily enough in Terminal (Command Prompt) like t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Port apps developed in Windows Phone 8.1 to run on Windows Phone 8?<p>I'm developing app for Windows Phone 8.1. Will I be able to port it to run on Windows P... | <p>Nope. Windows Phone 8 apps use Silverlight while Windows Phone 8.1 (Universal) apps use WinRT. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using a base class for an integration test<p>My base class for an integration test:</p>
<pre><code>[TestClass]
public class BaseIntegrationTest
{
protec... | <p>From MSDN:</p>
<blockquote>
<p>Will the same approach that was used for <code>[TestInitialize]</code> work with
<code>[ClassInitialize]</code> in a base class?</p>
<p>Not exactly, if you create a <code>[ClassInitialize]</code> attributed method in
the base class it won’t ever get called unless you explic... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Jupyterhub + DockerSpawner: Error in Authenticator.pre_spawn_start: APIError 400 Client Error: Bad Request ("invalid tag format")<p>I'm loading jupyterhub wi... | <p>The error comes from your local docker repository. So you probably should check the logs of the private docker repo on localhost:5000. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Proper organization and transformation of objects<p>I have a complex SQL query that returns a table like this:</p>
<p><a href="https://i.stack.imgur.com/u7q... | <blockquote>
<p>Can I write LINQ query that converts <code>IEnumerable<Invoice></code> to
<code>Dictionary<InvoiceHeader, List<InvoiceHierarchi>></code> and how to do it
right?</p>
</blockquote>
<p>Yes, you can. Try group invoices by <code>InvoiceHeader</code> and convert the result using <a hr... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating Stagger Charts in R<p>I have a df that looks like this:</p>
<pre><code>df <- data.frame(
CM = c("Jan", "Jan", "Jan", "Feb", "Feb", "Mar", "Mar... | <p>You can use <code>dcast</code> from the <code>reshape2</code> package:</p>
<pre><code>library(reshape2)
df <- data.frame(
CM = c("Jan", "Jan", "Jan", "Feb", "Feb", "Mar", "Mar", "Mar", "Apr", "Apr", "Apr"),
PM = c("Jan", "Feb", "Mar", "Feb", "Mar", "Mar", "Apr", "May", "Apr", "May", "Jun"),
Value = c(8, 5,... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Selective removal of specific char in a string<p>Suppose I have a string that may look something like this: </p>
<pre><code> "value" "some other value" ... | <p>I just thought of doing this. Below is my program. </p>
<p><strong>Note:</strong> This may not be an efficient program (bad time or space complexity), however it does what you are trying to do (if I understood your question right).</p>
<p><strong>Note</strong> Also I have used malloc() in this code. You would not ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
PHP Datetime Sub<p>I'm trying to get this datetime:sub to work. What's wrong with it?</p>
<p><strong>PHP</strong></p>
<pre><code>//Calculate working hrs
$u... | <p>From <a href="http://php.net/manual/en/datetime.diff.php" rel="nofollow">the docs</a> it's apparent that <code>DateTime::diff</code> returns an instance of <code>DateInterval</code>:</p>
<pre><code>// \/Return type\/
public DateInterval DateTimeInterface::diff ( DateTimeInterface $datetime2 [, bool $absolute = f... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I add all my users to a Role in Parse.com?<p>I'm having a class UserRatings for user to rate different places. Currently the class has a Public Read ... | <p>You need to query for the Role object on the server, then continue as you already have. </p>
<p>Try this:</p>
<pre><code>PFQuery *query = [PFUser query];
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
allUsers=objects;
NSLog(@"%@",allUsers);
}];
PFQuery *queryRole = [PFRole quer... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to use soap web services in Asp.net Core?<p>I have got some classes generated by <code>wsdl</code> for soap web services. These are using namespace <code... | <p>I have answered few days back on following question.</p>
<p><a href="https://stackoverflow.com/questions/28413756/asp-net-5-add-wcf-service-reference/28423655#28423655">ASP.NET 5 add WCF service reference</a></p>
<p>In above case there is a WCF service and in your case it is Web Service.</p>
<p>Following thing yo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Creating two pipes with three execlp small error somewhere C System Programming<p>I'm trying to create three child processes and two pipes that will execute ... | <p>The problem is that you didn't close the pipe file descriptors in the children and so, because you dup'ed them over to STDOUT_FILENO (e.g. - grep child), even though the program was done its regular output it didn't fully exit and post an EOF to the next child process (i.e. - sort) and so those children hung around ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to make a navbar stay in one line?<p>I have a working navbar in the top center of my page. However, when I reduce my resolution, my navbar spreads itself... | <p>Add <code>white-space: nowrap;</code> to your navbar</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to pass the event object to a function within an object<p>Tying to pass the event object to a function within an object using the .on and click handler. ... | <p>When you say:</p>
<pre><code>$('body').on('click', '.contact', portfolio.email(event));
</code></pre>
<p>then the event will be sent to whatever is returned by <code>portfolio.email(event)</code>, which is of course invalid.</p>
<p>Just pass the function name:</p>
<pre><code>$('body').on('click', '.contact', por... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to 'malloc' within first 4GB on x86_64<p>Platform: Mac OS X<br>
Lang: Obj-C/C</p>
<p>Is it possible to somehow make 'malloc' to allocate memory within f... | <p>It is not possible, unless you code your own implementation of <code>malloc</code> (or dive into the implementation details of some existing <code>malloc</code> then change it to suit your needs).</p>
<p>Most <code>malloc</code>-s implementations are using the system <code>mmap</code> (or <code>sbrk</code>) <a href... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Best way to read a short array from disk in C#?<p>I have to write 4GB short[] arrays to and from disk, so I have found a function to write the arrays, and I ... | <p>Shorts are two bytes, so you have to read in two bytes each time. I'd also recommend using a <code>yield return</code> like this so that you aren't trying to pull everything into memory in one go. Though if you need all of the shorts together that won't help you.. depends on what you're doing with it I guess.</p>
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Requests adding own header attributes<p>I am trying to make GET request with empty headers like this:</p>
<pre><code>response = requests.get(url="https://ww... | <p>The headers you pass are actually <strong>appended</strong> to existing defaults set by the library. You'll have to overwrite the dict directly if you want to change the headers' order or remove existing headers; for example by using a session:</p>
<pre class="lang-py prettyprint-override"><code>import requests
wit... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Grant truncate permissions on all tables with out modify<p>Is there a way I can grant truncate permission to a user without altering privileges in SQL Server... | <p>The minimum permission required is ALTER on table_name. TRUNCATE TABLE permissions default to the table owner, members of the sysadmin fixed server role, and the db_owner and db_ddladmin fixed database roles, and are not transferable. However, you can incorporate the TRUNCATE TABLE statement within a module, such as... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is it possible to create a line graph in r, where the colour of the line changes at a specific point<p>I'm currently working on forecasts with different mode... | <p>Yes, this is possible. It's typically done by graphing two lines of different colors, but they meet at a point so there is an illusion that there is only one line.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to remove all unnecessary arrays in nd array<p>I have a nd python array <em>(not a numpy array)</em>, and it looks something like this</p>
<pre><code>[[... | <p>You can just iterate until you don't reach the inner elements. Example: </p>
<pre><code>>>> def remove_unnecessary(l):
... while len(l) == 1 and isinstance(l[0], list):
... l=l[0]
... return l
...
>>> remove_unnecessary([[[1,2,3], [4,5,6]]])
[[1, 2, 3], [4, 5, 6]]
>>>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
ng-click not working when button is pushed<p>I am trying to get a function to execute when a button is clicked...</p>
<p>Here is my button:</p>
<pre><code>... | <p>That code is fine, it should work as you can see in the snippet below that is a copy paste of your code (except for the <code>ionic</code> dependency).</p>
<p>The problem probably comes from elsewhere. Please check your console for any error, Angular probably couldn't initiate for another reason (for instance canno... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to remove from a UTF-8 string?<p>My database is returning some strings like:</p>
<p><code>This&nbsp;is&nbsp;a&nbsp;string</code></p>
... | <p>This gets tricky, its not as straight forward as replacing normal string. </p>
<p>Try this. </p>
<pre><code> str_replace("\xc2\xa0",' ',$str);
</code></pre>
<p>or this, the above should work: </p>
<pre><code>$nbsp = html_entity_decode("&nbsp;");
$s = html_entity_decode("[&nbsp;]");
$s = str_replace($nbs... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
stopPropagation without preventing default<p>Is it possible to stop event propagation without preventing the default event behaviour?</p>
<p>This should let ... | <p>One possible workaround is to temporarily fix the input while mouse is over it:</p>
<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>$("input[type=number]").on("mousewheel",function(e){
e.stopPropagation();
}).o... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
RESTful webservice returning Unsupported Media Type for POST requests<p>I have been working on a RESTful webservice using Jersey. I have created my first ser... | <p>eclipse was re using the original war without any alterations as I had not refreshed my project after running mvn compile war:war</p>
<p>I ran mvn clean, refreshed my project in the project browser, ran mvn compile war:war and my restarted the server and requests are now accepted. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Building a routine to generate CREATE TRIGGER code in Postgres<p>I haven't found a straightforward way to retrieve trigger definition code. I mean the trigge... | <p>Simply use</p>
<pre><code>SELECT pg_get_triggerdef(oid)
FROM pg_trigger
WHERE tgname = trigger_name_in;
</code></pre>
<p>Besides, <em>never</em> use string concatenation when composing SQL code. The danger of SQL injection is too great. Use the <code>format()</code> function with the <code>%I</code> placeholder.</... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to allow requests to elasticsearch only from a list of ips/domains<p>I read the docs, but I couldn't make it work.</p>
<p>I have a server that holds ela... | <p>There are multiple way to achieve this. The one i would like to advice is as follows - </p>
<ol>
<li>Run Elasticsearch in localhost interface by network.host as localhost in elasticsearch.yml file.</li>
<li>Now only applications in localhost can access the application</li>
<li>Place a proxy like nginx or apache and... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to convert HH.MM.SS (object type) column to HH:MM in python?<p>I have one column (245000 row) as time shown below:</p>
<pre><code>Time
10.30.00
11.00.0... | <pre><code>your_list = df['Time'].tolist()
output_list = [":".join(i.split('.')[:-1]) for i in your_list if len(i.split('.'))==3]
for time in output_list:
print(time)
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to programmatically detect the memory size/page number of an NFC chip<p>What is the easiest way to programmatically detect the memory size or page count ... | <p>In general you can only determine this by extensive fingerprinting and by probing with read commands.</p>
<ol>
<li><p>Fingerprinting: This means that you would need to have a database of manufacturer-specific characteristics (e.g. collected from datasheets and -- unfortunately by far more often -- from empirical te... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
forcing pytorch to use gpu<p>i've recently followed a tutorial here <a href="https://www.provideocoalition.com/automatic-rotoscopingfor-free/" rel="nofollow ... | <p>If everything is set up correctly you just have to move the tensors you want to process on the gpu to the gpu. You can try this to make sure it works in general</p>
<pre><code>import torch
t = torch.tensor([1.0]) # create tensor with just a 1 in it
t = t.cuda() # Move t to the gpu
print(t) # Should print something ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Inserting cell in specific section<p>I am trying to find a way that allows me to insert a new cell under a specific section on my tableview. There is a butto... | <p>First of all you need a data source array for the section for example</p>
<pre><code>var songs = [String]()
</code></pre>
<p>Then you have to modify <code>numberOfRowsInSection</code> to return the number of songs for section 3. This method can be simplified anyway</p>
<pre><code>override func tableView(_ tableVi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to speed up file writing process for big file?<p>The following code takes a randomized number of lines from a big text file, and split the original big f... | <p>There's no need to read the entire input file into memory. All you <em>really</em> need is to know the number of lines. Let's assume you already know that, and call it <code>n</code>. (If need be, you can compute that in a separate pass of the file). Now, as you read through the input, you can choose which file to w... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
A lot of scaffold with similar layout and controller in rails<p>i have a lot of scaffold and all of them are similar in views and controller. my problem is t... | <p>In Rails you can <a href="http://guides.rubyonrails.org/generators.html" rel="nofollow noreferrer">customize the default layouts used by the generator</a>. There are several tutorials available online.</p>
<p>You can change the model file, the controller and/or the action templates. As <a href="https://stackoverflo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Resolve JDBC Oracle Index Column Names<p>Hi is there a possibility to resolve the real column names from a index?
I use:</p>
<pre><code>java.sql.DatabaseMet... | <p>That index is a function based (expression) index. </p>
<p>The expression that is referenced by that name is stored in the system view <code>user_ind_expressions</code>:</p>
<pre><code>select column_expression
from user_ind_expressions
where index_name = 'LOG_EMAIL_USERS_ID'
and column_position = 1;
</code></pre... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Execute a function "before each" method of the same class in java<p>I have several methods in a class that require a boolean to be set to true in order to ex... | <p>Considering my use case, it was a bit overkill to use AOP or other concepts. So I basically did a check in each functions.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Array out of bound exception while deleting certain information from a String<p>I have an <code>ArrayList</code> that contain <code>String</code>. I want to ... | <p>Arrays are zero based, you need < not <= so:</p>
<pre><code>private ArrayList<String> epurateInformation(ArrayList<String> list) {
String[] potentialThreat = {"Pret : ", "Nom de l'Album : ", "Style : ", "Date : ", "Nom de la piste : ", "Propriétaire : ", "Information : "};
for(String s : ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
.env constants not readable in React project<p>I have a an issue trying to get constants our of my <code>.env</code> file in a React app. My app structure is... | <p>As per my comment, you'll probably wanna close your terminal window and re-run <code>yarn start</code> from a fresh terminal. 9/10 this is the reason for env vars not showing up. :)</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Filter grouped Pandas data frame by column aggregate, when groups are from a MultiIndex level<p>How can I drop data from one level of a multi-level indexed d... | <p>You can use <code>loc</code> once you have created your mask, like so:</p>
<pre><code>mask = dfmi.groupby(level=0)['foo'].mean()>thresh
dfmi.loc[mask.index[mask]]
</code></pre>
<p>Yields:</p>
<pre><code>index_1 index_2
A1 B0 6 7
B1 8 9
B2 10 11
A2 ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R keep rows where all values are < a threshold<p>I have a data.frame with 19 columns and 2000+ rows. Column 1 is the dependent variable, and columns V1:V17 i... | <p>This should work:</p>
<pre><code>dfOutput <- dfInput[apply(dfInput[,3:19]>0.00000001 & dfInput[,3:19]<0.300, 1, all, na.rm=TRUE), ]
</code></pre>
<p>And now for a reproducible example, I'll explain what is going on: </p>
<pre><code># data
df <- data.frame(x = c(1:3, NA, 3:1), y=c(NA, NA, NA, 3, 3... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Rust says import is not used and can't find imported statements at the same time<p>I've got some structure I want to use Serde with. Like this one:</p>
<pre... | <p>You're victim of the "magic" behind automatic trait implementation, <em>i.e.</em> procedural macros. Usually, people give the procedural macro that implements a trait the same name as the trait (because it's convenient). Here, there is the trait <code>serde::Serialize</code>, but there is also the procedural macro t... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to pass custom props when using React Navigation version 5?<p>I have upgraded to <code>React Navigation v5</code> in my app. I am using watermelondb in m... | <p>You should use React context API to pass your <code>database</code> to all screens: <a href="https://reactjs.org/docs/context.html" rel="nofollow noreferrer">https://reactjs.org/docs/context.html</a></p>
<pre class="lang-js prettyprint-override"><code><DatabaseContext.Provider value={database}>
<Navigati... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Pull from a remote branch in Jgit with self certificate errors<p>I have the following code running in a script I am using. </p>
<pre><code> Git git = Git.op... | <p>My Solution was to use RSA authentication when cloning the repository. It solved my issue. I followed <a href="https://dzone.com/articles/how-to-authenticate-with-jgit" rel="nofollow noreferrer">this article</a> on how to use RSA authentication, then adjusted what I needed from there. </p>
<p>Note, that I did use a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
parsing HTML to CSV in multiple columns<p>I am new to stackoverflow and programming in python.
I'd like to parse a html containing multiple tables to a csv.... | <p>The input file is in an odd format. Normally I'd expect a single table with single header row, followed by rows of two-column data. But below parses table as given, though:</p>
<pre><code>from bs4 import BeautifulSoup
import csv
html = open("table.html").read()
soup = BeautifulSoup(html,features="html.parser")
h... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
BOCU-1 for internal encoding of strings<p>Some languages/platforms like Java, Javascript, Windows, Dotnet, KDE etc. use UTF16. Some others prefer UTF8.</p>
... | <blockquote>
<p>What is the reason that no language/platform uses BOCU-1?</p>
</blockquote>
<p>That question is far too broad in scope for Stack Overflow, and a concise answer is impossible.</p>
<p>However, in the specific case of Java note that someone raised the possibility of Java adopting BOCU-1 as an RFE (Requ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to insert comments between single line commands in Windows CMD?<p>I'm a user of Blender, a 3D software.<br>
I'm trying to run in CMD because Blender prov... | <p>The <a href="https://stackoverflow.com/a/40367121/463115">proposed solution with percent expansion</a> doesn't work on the command line, because on the command line undefined variables aren't expanded to nothing, instead they are leaved unchanged. </p>
<p>But you can use the rarely used percent modifier syntax, <c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why is a member template from private base class introduced with a using declaration inaccessible?<p>Consider the following (artificial) example:</p>
<pre><... | <p>[namespace.udecl]/p18:</p>
<blockquote>
<p>The alias created by the <em>using-declaration</em> has the usual
accessibility for a <em>member-declaration</em>.</p>
</blockquote>
<p>Not much to say here. The name <code>B::C</code> is publicly accessible, and the code is well-formed. Just another MSVC bug.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Type mismatch Error in index match in index match function<blockquote>
<p>Type mismatch error</p>
</blockquote>
<pre><code>Dim lr As Integer
lr = Range("... | <pre><code>Dim lr As Integer
lr = Range("A1").CurrentRegion.Rows.Count
Range("N2").Select
Range("N2").Formula = "=INDEX(SMSv2!$A$2:$L$" & lr & ",MATCH(SMSv1!C2,SMSv2!$A$2:$A$" & lr & ",0),4)"
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Eclipse android ID cannot be resolved or is not a field<p>I have this code:</p>
<pre><code> public void run() {
if (Build.VERSION.SDK_INT... | <blockquote>
<p>Build.VERSION_CODES.KITKAT</p>
</blockquote>
<p>As in docs : <em>October 2013: Android 4.4, KitKat, another tasty treat.</em> </p>
<p>means <code>KITKAT</code> constant added in <em>API level 19</em>.</p>
<p>So change current project target version to API level 19(Android 4.4)</p> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.