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:
Selecting xpath - Selenium<p>I am coding a bot for tinder with selenium but its not working. Here is my code.</p>
<pre><code>fb_button = self.driver.find_e... | <p>you can wait until the element can clickable and present in HTML dom.</p>
<pre><code>from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
fb_button = WebDriverWait(driver, 10).until(
EC.eleme... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Keras Custom Layer ValueError: An operation has `None` for gradient<p>I have created a custom Keras Layer. The model compiles fine, but gives me the followin... | <p>You cannot backpropagate through functions that are not differentiable.
And your function is not differentiable. </p>
<p>You discarded the values <code>top_values</code> and kept only integer constants <code>top_indices</code>. </p>
<p>The only way to use this layer in a model is if everything before it is not tr... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
LINQ - looping through rows of 2d array<p>I have a 2d string array like this:</p>
<pre><code>string myarr[,] = new string[100,4];
</code></pre>
<p>And I wa... | <pre><code>var count = Enumerable.Range(0, myarr.GetUpperBound(0)+1)
.Count(r => myarr[r,1] == "vpp");
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Why does mesh.rotation.set work but mesh.rotation.copy doesn't?<p>If I do:</p>
<pre><code>mesh.position.copy(p);
mesh.rotation.copy(r);
</code></pre>
<p>Th... | <p><code>THREE.Object3D.rotation.copy()</code> takes a <code>THREE.Euler</code> as an argument, not a <code>THREE.Vector3</code>.</p>
<p>Have a look at the source code so you can see what it does.</p>
<p>three.js r.70</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Wordpress comments have footer tag<p>I am developing at wordpress theme, and ran into a problem.
my comments are showing up with the same background image as... | <p><strong>Found the answer:</strong>
The file i was looking for is called "comment-template.php" and i located in "wp-includes/" and on line 1940 i found this: <code><footer class="comment-meta"></code></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to partially specialize a template function for a specific template with int paramater<p>I can't find another question which seems to answer this.</p>
<... | <p>You would use:</p>
<pre><code>template <int N> class classX<classA<N>>
{
// Add the details of the specialization
};
</code></pre>
<p>BTW, your posted code has syntax errors.</p>
<pre><code>template <int N> classA;
</code></pre>
<p>should be:</p>
<pre><code>template <int N> clas... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Socket send with MSG_WAITALL got 22 EINVAL<pre><code>bool AbstractSocket::send(void *data, const size_t &size)
{
ssize_t result = ::send(m_sfd, data,... | <blockquote>
<p>What argument is invalid?</p>
</blockquote>
<p><code>send</code> function does not have the <code>MSG_WAITALL</code> option. So <code>MSG_WAITALL</code> is invalid. </p>
<p><code>send</code> only support:</p>
<ul>
<li>MSG_EOR</li>
<li>MSG_OOB</li>
</ul>
<p><a href="https://linux.die.net/man/3/send... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
R sum vectors in list of list<p>I have a list of lists with vectors. It can be generated with </p>
<pre><code>test <- lapply(1:10, function(x){
list(... | <p>We can <code>transpose</code> the <code>list</code> and <code>reduce</code> by <code>+</code></p>
<pre><code>library(purrr)
library(dplyr)
transpose(test) %>%
map(reduce, `+`)
#$a
#[1] 35 19 30 33 33
#$b
#[1] 30 27 29 35 29
#$c
#[1] 46 53 59 67 62
</code></pre>
<p>NOTE: There was no <code>set.seed</cod... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Add variable to dockerfile{} section in Jenkinsfile to enable docker_buildkit<p>This is snipshet of my code:</p>
<pre><code> stage('tf run') {
agent {
... | <pre><code>environment {
DOCKER_BUILDKIT='1'
}
</code></pre>
<p>Putting it in as an env variable in your pipeline will work</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Install specific PHP version on Ubuntu 16.04 server<p>I need a bit of help. I have AWS EC2 server running on Ubuntu 16.04. My question is how do I install sp... | <p>You will not have any issue between PHP 7.3.12 and 7.3.14.</p>
<p>A version is split in 3 parts, 7(for main version).3(for current minor version).12(for bugfixes).</p>
<p>Do not try to exec php code on two differents main version 5.0 / 7.0 because of many big changes.</p>
<p>Also there is no many changes in minor... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Google Directory API is not strong signed<p>BEFORE ANY OF YOU CLAIM THIS IS NOT WHERE THE API IS SUPPORTED PLEASE SEE THIS LINK: <a href="https://developers... | <p>I'm sorry for the late response, and I'm sorry to bring the bad news: There is already an open issue for this one - <a href="https://code.google.com/p/google-api-dotnet-client/issues/detail?id=238" rel="nofollow">https://code.google.com/p/google-api-dotnet-client/issues/detail?id=238</a>, and yeah it's old. We will ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Specializing Template Classes with Parameter Packs<p>I'm using inheritance with a set of classes. One of the child classes takes in an <code>std::function(Re... | <p>The problem is that your specializations are of the same level (no one is more specialized that the other) and <code>Child<void></code> matches both.</p>
<p>If you want that <code>Child<void></code> matches the <code>Child<ReturnTy></code> case (otherwise the solution is simple and elegant: in the... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Jquery, using value of a variable inside a function, to set the value of another variable out side of that function<p>I've abstracted and isolated a chunk of... | <p>There is no way to access the inner scope of your function (if not bind to an object). As is, I would suggest to put your <code>rorator</code> variables into an object, for instance here called <code>collection</code>, which you can easily access:</p>
<pre><code>;(function ( $, window, document, undefined ) {
$.... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
6x6 sudoku puzzle, Finding what sector you're in<p>I'm making a Sudoku solver, and I need to check if a number is free in the current sector, I already check... | <p>If you have a grid that is divided into sectors you can find a corner of that sector and then base all or indexes of of that corner. Assuming [0][0] is the top left corner of your puzzle then the top left corner sector you are in if you are at [3][5] would be</p>
<pre><code>rows_per_sector (2) * (current_row (3) /... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Given a predicate, count number of objects for each subject?<p>I'm trying to write a SPARQL query that will return a subject and the number of objects it has... | <p>Your query isn't legal. If you check at <a href="http://sparql.org/query-validator.html" rel="nofollow">sparql.org's query validator</a>, you'll get the response:</p>
<blockquote>
<p>Syntax error:</p>
<blockquote>
<p>Non-group key variable in SELECT: ?quote</p>
</blockquote>
</blockquote>
<p>You need... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
empty hazelcast iqueue size in memory<p>We create a simple iqueue in Hazelcast:</p>
<pre><code> HazelcastInstance h = Hazelcast.newHazelcastInstance(conf... | <p>There is some fixed cost of each structure even if it doesn't contain any data. The cost is rather low, you can see the structure backing each instance of a queue here: <a href="https://github.com/hazelcast/hazelcast/blob/master/hazelcast/src/main/java/com/hazelcast/queue/impl/QueueContainer.java" rel="nofollow">htt... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
For-Loop stops working after 2 iterations<p>I am setting up a temporal convolutional network in tensorflow 2.0 using Keras API for timeseries prediction and ... | <p>I mean, func <code>sequence[next_timestep: range_to_predict]</code> creates sequence with length <code>range_to_predict - next_timestep</code>. On first iteration <code>next_timestep</code> equals 0, and sequence has length 150. On second iteration <code>next_timestep</code> equals 1, and <code>predict - next_timest... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to get AutoCompleteTextField to accept a substring<p>I can generate a list of strings used to select an item using AutoCompleteTextField but it puts the ... | <p>You can use <strong><em>AbstarctAutoCompleteRenderer</em></strong>.</p>
<pre><code>AbstractAutoCompleteRenderer<String> autoCompleteRenderer = new AbstractAutoCompleteRenderer<String>() {
private static final long serialVersionUID = 1L;
protected final String get... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Async puppeteer browser disconnect after few iterations<p>I tested iterations with puppeteer in a small case. I already have read the common reason for puppe... | <p><code>forEach</code> executes synchronously. replace <code>forEach</code> with a simple for loop. </p>
<pre class="lang-js prettyprint-override"><code>const arrIDs = [8322072, 1016816, 9312604, 1727088, 9312599, 8477729];
const page = await browser.newPage();
for (let id of arrIDs){
await page.goto(`http://som... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
extract a casout SAS table to pandas dataframe<p>I am using python API of SAS, and have uploaded a table by:</p>
<pre><code>s.upload("./data/hmeq.csv", caso... | <p>I found the solution below and it works fine. For example, here I have used <code>dataSciencePilot.exploreData</code> action and I can get the results by:</p>
<pre><code>casout = dict(name = 'out1', replace=True)
s.dataSciencePilot.exploreData(table=tbl_name, target='bad', casout=casout)
fetch_opts = dict(maxrows=1... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular component's selector is blocking its content styling<p>So, I was building a wrapper component around Bootstrap's Input Group as follows:</p>
<pre><c... | <p>You apply the <code>display: flex</code> on your <code>.form-row</code> element, but the <code>col-*</code> classes (with <code>flex:</code> css rules) on the element inside the wrapper. <code>flex:</code> rules should be applied on the children of the <code>display: flex</code>.</p>
<p>You should apply the column... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to send multiple music files using sockets?<p>I am using python 3.6 and ubuntu 18.04. </p>
<p>I am able to send single music file using socket-python (i... | <p>TCP is a stream-oriented protocol. It is designed for sending streams of data. At TCP level there are no files. It doesn't split streams in any file-oriented chunks.</p>
<p>Look at your code:</p>
<pre class="lang-py prettyprint-override"><code>for i in file_names:
f = open(i, 'rb')
buf = f.read(1024)
w... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Trouble with an one page navigation - updating/highlighting active state and scroll to anchor<p>I'm already busy with a one page navigation. Below you will f... | <p>Looking at your code, I've updated the line you said for the below one:</p>
<pre><code>if (target.position().top - $('#header').outerHeight() <= windowPos) {
$('#primary-navwrapper li a').removeClass("current");
anchorId.addClass("current");
}
</code></pre>
<p>In this way, it'll get the target's differe... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular JS - View Scrolling Issue *CSS*<p>So my problem is that I have set my view to be width & height 100%; which works well but once some of the conte... | <p><strong>Resolved:</strong>
The Issue was the css. by setting the top level containers overflow property to hidden and using margins instead of position: relative; with pixel adjusts my content now fits within the page.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to assert values in a Json response of List of dictionaries<p>Here is the Json response that I get from a GET request.</p>
<pre><code>
[
{
"... | <blockquote>
<p>EDIT: You can use some schema library like Marshmallow to assert if each run belongs to a certain schema</p>
</blockquote>
<p>I would try something like this:</p>
<pre><code>def assert_runs(runs, assertions, success_ids):
for run in runs:
for assertion in assertions:
assert a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Will this prevent image caching on external pages? looking for a solution<p>i store images on my server.
Other websites/ pages can display these images.
I wa... | <p>Yes, it will. THis is a typical cache busting approach.</p>
<p>You could make the number not random but i.e. a number based on the file write time. Anything that only changes when the image changes, so caching STILL applies for repeated loads of the same unchanged image.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
how to check if path exist and copy folders and files using python<p>I have a python script that must check first if folder exist in giving path then if exis... | <ol>
<li><p>why do you even check? Just rmtree the destination and ignore the error if it doesn't exist. You're not getting any significant saving by first checking, you're just making your code more complex.</p></li>
<li><p>why do you delete src for every folder you're copying? Just delete it once <em>before</em> the ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
printf uses sbrk, conflicting with custom memory allocator<p>Hi I have Written a memory allocator, and works perfectly. I use sbrk/brk for page allocation an... | <p>The comment by Ctx:</p>
<blockquote>
<p>This is not possible; <code>sbrk()</code> is used by the libc memory allocator internally, so many libc functions use it implicitly. Either do not use libc at all, or do your memory allocations with <code>malloc()</code> or <code>mmap()</code>.</p>
</blockquote>
<p>is corr... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
AddEventListener only working with Id and not class<p>Trying to create a white box when the first button has been clicked. Oddly enough it only works when I ... | <p>This yields the following error:</p>
<pre class="lang-none prettyprint-override"><code>[Error] TypeError: undefined is not a function (evaluating 'bttn.addEventListener('click', draw, true)')
domloaded (js, line 125)
</code></pre>
<p>This error occurs because you're calling <code>addEventListener</code> on <code>g... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add an additional fake null column to select result in Informix?<p>I need to select an additional column which does not exist in the current table in ... | <p>Cast the <code>NULL</code> to the desired type:</p>
<pre><code>SELECT CURRENT AS col1, NULL::INTEGER AS col2
FROM sysmaster:"informix".sysdual;
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
DataRow get values of duplicate column of join table in c#<p>I have following query </p>
<pre><code>string query = string.Format("select * from `{0}` inner ... | <p>Change your query and use alias for column in join table. Like:</p>
<pre><code>select table1.*, table2.CreatedOn as CreatedOn2 from `{0}` as table1 inner join `{1}` as table2 on table1.Id = table2.RecordId where table2.recordid= {2}
</code></pre>
<p>And select <code>CreatedOn2</code> field,</p>
<pre><code>Created... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to force valueUpdate (knockoutJS) with spinner input<p>I have a spinner with the following HTML:</p>
<pre><code><input id="infoX" data-bind="spinner... | <p>Seems just posting to SO has a great effect on my problem solving. ;)</p>
<p>The solution is very simple. I changed the event hander to respond on "spinstop" rather than "spin change". </p>
<pre><code>ko.utils.registerEventHandler(element, "spinstop", function () {
var observable = valueAccessor();
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python Boto3 for ECS Help needed<p>I'm trying to list all the clusters in my AWS ECS account. I have approximately 13 Clusters running.</p>
<p>The below code... | <p>If you look at the <a href="https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ecs.html#ECS.Client.list_clusters" rel="nofollow noreferrer">list_clusters</a> api, the response syntax is:</p>
<pre><code> Response Syntax
{
'clusterArns': [
'string',
],
'nextToken': 'string... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Watching a folder for changes on external SD card<p>I'm trying to listen for folder changes on an external SD card on Android Api 26+ , The problem is I don'... | <p>So after debugging, I found a way to get the path of the picked folder.</p>
<p>First, I build uri using the document tree </p>
<pre><code>Uri docUri = DocumentsContract.buildDocumentUriUsingTree(uri,
DocumentsContract.getTreeDocumentId(uri));
</code></pre>
<p>and performed a query on it </p>
<pre... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to add more than one horizontal line? One solid and one dashed?<pre><code>p + geom_hline(yintercept=5.17, col="red")
p + geom_hline(yintercept=20.69, lin... | <p>Use any of of these:</p>
<pre><code>p +
geom_hline(yintercept=5.17, col="red") +
geom_hline(yintercept=20.69, linetype="dashed", color = "red")
</code></pre>
<p>Or</p>
<pre><code>p <- p + geom_hline(yintercept=5.17, col="red")
p + geom_hline(yintercept=20.69, linetype="dashed", color = "red")
</code></pre... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to sign a file with smartcard and Chilkat for Go<p>I am using Chilkat version 9.5.0.80 with Go bindings.</p>
<p>I am able to sign a PDF file with a smar... | <p>At this point in time (8-April-2020), the Chilkat smartcard functionality is limited to the Windows operating system. The Chilkat Go Language package is for multiple operating systems (Windows, Linux, MacOSX, etc.) and we excluded the Windows-only functions because Go does not have a preprocessor to control the inc... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
"constructor JSONParser in class JSONParser cannot be applied to given types" error occured<p>I am trying to build a weather app in Java language and Netbean... | <p>Check your import statements. You will be importing it from jdk.nashorn.
The code you are trying to attempt is from org.json.simple.parser.JSONParser</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Installing SQLite NuGet Package installs the package but the reference is not available. VS2019 Community<p>I"m writing a c# application using SQLite and I n... | <blockquote>
<p>Installing SQLite NuGet Package installs the package but the reference
is not available. VS2019 Community</p>
</blockquote>
<p>I assume you have installed <a href="https://www.nuget.org/packages/sqlite/3.13.0" rel="nofollow noreferrer">sqlite version 3.13.0</a> nuget package.If so, it is the behavi... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Hibernate table not mapped<p>I've got entity</p>
<pre><code>@Entity
@Table(
name = SomeEntity.TABLE_NAME,
uniqueConstraints = {@UniqueConstr... | <p>Have you defined the packages to scan in your application context?</p>
<pre><code><property name="packagesToScan">
<list>
<value>com.package_to_someentity</value>
</list>
</property>
</code></pre>
<p>Alternatively, define it in you <code>hibernate.cfg.xml</code></p>
<pre><c... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Wordpress redirect url when user access homepage and is not following anyone<p>So, I'm developing a Behance-like network with following option. As default, w... | <p>I think this is what you're looking for:</p>
<pre><code>if ( is_home() && count( _core::method( '_follow' , 'get_following' , $author_id ) ) == 0 ) {
wp_redirect( '/page/to/redirect/to' );
wp_die();
}
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What would be the fastest method on average for accessing a dictionary of hashed passwords?<p>I'm currently writing a password cracker in Python and was thin... | <p>My method for completing this task would be the same as you to check the most common passwords first. The size of this will be depend on the size of your database, a bit of trial and error wouldn't go a miss here as the correct number we will depend on how random passwords are.</p>
<p>For the the full search I woul... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Included source of javascript via PHP, onmousemove event, function is not defined<p>I have i php require:</p>
<pre><code>if ($infoSystem['timeout'] == 1) {r... | <p>You have to write js function before you add it in event. – Knase Feb 20 '15 at 22:29</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Entity Framework EDMX Diagram table missing properties after update<p>I'm maintaining an asp.Net MVC 3 web application using Entity Framework 4.1 Database fi... | <p>Got it fixed. I had to delete all references to the new properties in the XML file. Then recreate the update model from database procedure, this time ensuring the two checkboxes where ticked, Pluralize or singularize generated object names, and, Include foreign key columns in the model (I thought I had these ticked ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
tcsh, save command in a history, only if the command was successful<p>I'm new to <code>tcsh</code> so please advice me. Now I use <code>postcmd</code> variab... | <pre><code>set savehist = (3000 merge lock)
alias precmd 'if($? == 0) history -S; history -c; history -M'
</code></pre>
<p>then</p>
<pre><code>tcsh% true
tcsh% false
tcsh% false
tcsh% true
tcsh% history
20 0:15 true
21 0:16 true
22 0:16 history
</code></pre>
<h3>Why the <code>history -c</code... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Must I generate an additional salt, even though password_hash() already provides a salt?<p>In using PHP's native password_hash() function, must (or should) I... | <p>You should <em>not</em> generate your own salt, because the function <a href="http://www.php.net/manual/en/function.password-hash.php" rel="nofollow">password_hash()</a> does it as best as possible, using the random source of the operating system. In other words, you won't be able to generate a better salt, though y... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Issue when using itemssource to save and retrieve itemselected in xamarin<p>I have created a template that fits in to a system that allows the user to comple... | <p>Thanks Leon for the code you provided above. Apologies for my poor explanation of what I needed I have inherited this app from an external company and there is a lot going on that I was trying to cram into that question. I think my poor explanation and lack of any images showing what I had working led you down the w... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
c++ combine path of file as a string with file name<p>I want to read some input files in my c++ code and I want to define the path of input files as a string... | <p>You would use something like:</p>
<pre><code>string path ("yourFilePath");
string filename ("filename");
</code></pre>
<p>You could then open the file like this:</p>
<pre><code>ifstream inputFileStream;
inputFileStream.open(path + fileName);
</code></pre>
<p>Depending on your requirements, you will have to decid... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using IF/CASE conditioning in SQL<p>I have a question regarding how you use the IF statement in SQL, so I have 3 tables</p>
<ul>
<li>user</li>
<li>mechanics... | <p>The double <code>JOIN</code> will produce a full cross product between the mechanics and users. This is probably not what you want. You should use a single join with each table, and then combine them with <code>UNION</code>.</p>
<pre><code>SELECT m.name, e.message
FROM mechanics AS m
JOIN exchanges AS e ON m.id_mec... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
s:property not shown value Struts2<p>I have the following:</p>
<pre><code>select name="nroPartido" style="color:#F5FFFA; background-color: #CC9900; font-wei... | <p>The following line is wrong, both syntactically and conceptually:</p>
<pre><code><s:property value="nroPartido"></<s:property>
</code></pre>
<p>there is an extra <code><</code> , and the <code><s:property/></code> tag should self-closed, like a void element in XHTML:</p>
<pre><code>... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Java - reflection getDeclaredMethods in declared order strange behaviour<p>This is a strange behavior happening with <code>getDeclaredMethods</code> ,here is... | <blockquote>
<p>How can I keep the declared order as it is in the class file, no matter what fields I set?</p>
</blockquote>
<p>You can't, with <code>getDeclaredMethods</code>. The <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Class.html#getDeclaredMethods--" rel="noreferrer">documentation</a> is very ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Array to string conversion - Associative Array<p>I use this code below to parse a question and its choices.</p>
<pre><code>$entries = preg_split('/(?=[a-z\d... | <p>Edit: More generic</p>
<pre><code>$strDbQuery_2 = "INSERT INTO `answers` (`choices`, `question`, `correct`) VALUES ";
for($i = 1; $i <= count($arrAnswers); $i++) {
$strDbQuery_2 .= implode(", ", $arrAnswers[$i]) . ', ';
}
$strDbQuery_2 = substr($strDbQuery_2, 0, -2) . ';';
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Create new array based an array<p>I have an array as follows:</p>
<pre><code>const data = [
{ new_id: "56", old_id: "229", ratio: "0.1", week: "20" },
{ n... | <p>You could take a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flatMap" rel="nofollow noreferrer"><code>Array#flatMap</code></a> approach and map <code>old_id</code>/<code>ratio</code> as well.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-consol... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Nitpicking booleans in C<p>I was reading <a href="http://c-faq.com/bool/booltype.html" rel="nofollow">comp.lang.c</a>s description of booleans values, pre-C9... | <p><code>(1==1)</code> and <code>(!TRUE)</code> are useful definitions on some compilers (I don't have a concrete example off of the top of my head) that track whether an integer came from a boolean comparison. This enables them to warn for</p>
<pre><code>if (i)
</code></pre>
<p>while at the same time not warning for... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What's the difference between async and sync in swift<p>In this example, what's the difference between <code>queue.sync</code> and <code>queue.async</code></... | <p>Both snippets append a closure to the queue.</p>
<p>But there is one difference.</p>
<h2>Sync</h2>
<p>Synch will wait for the closure to be executed before processing the next line.</p>
<p>So in this case, the <code>print("Hello")</code> is executed <strong>always after</strong> the closure.</p>
<pre><code>queu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How unchecked int overflow work c#<p>We know that an int value has a maximum value of 2^31 - 1 and a minimum value of -2^31. If we were to set int to the max... | <p>In C#, the built-in integers are represented by a sequence of bit values of a predefined length. For the basic int datatype that length is 32 bits. Since 32 bits can only represent 4,294,967,296 different possible values (since that is 2^32), </p>
<p>Since int can hold both positive and negative numbers, the sign o... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Where is Library-Win32 on Delphi 10.3.3?<p>Recently i upgraded from D2007 to 10.3.3 and i simply could not find where is the equivalent option of this on the... | <blockquote>
<p>Tools > Options > Language > Delphi Options > Library</p>
</blockquote>
<p>See the <a href="http://docwiki.embarcadero.com/RADStudio/en/Library" rel="nofollow noreferrer">Library</a> documentation in Embarcadero's DocWiki. </p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How do I iterate through a directory in bash<p>I need to write a script that will iterate through a directory that the user has input, then I need it to find... | <p>You could loop over the entries in a directory like so:</p>
<pre><code>#!/bin/sh
for f in *; do
[ -f "$f" ] && echo "$f is a regular file."
[ -d "$f" ] && echo "$f is a directory."
[ -h "$f" ] && echo "$f is a symbolic link."
done
</code></pre>
<p>See <code>man test</code> for furthe... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python - Updating JSON objects in a file<p>I have a (valid) JSON file contaning JSON objects, each object taking up one file line. These JSON objects map to... | <p>You cannot do what you want, because you can only surgically replace <em>fixed length records</em> in a file. You cannot replace the line with something that is longer or shorter, as files don't store data as separate lines.</p>
<p>In addition, your code doesn't take into account that on some platforms (like on Win... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Understanding variable scope in given code<p>I'm a beginner in Emacs lisp, so this is really a noob question. Let's say that I have to write a function that ... | <p>Let does not make a copy of anything, so this assigns the value referenced by the variable <code>x</code> to the variable <code>res</code>. Hence any changes to the list referenced by <code>res</code> also change the list referenced by <code>x</code></p>
<p><code>(let* ((res x) ; make a copy of X</code></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
hazelcast mapper class not found<p>I`m trying to run map/reduce task on hazelcast 3.4, but I keep getting classs not found exception</p>
<p>I created severa... | <p>You have to deploy all the classes on the server side as well.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Grab a character from a word based on specified parameters<p>So say I have a couple of words of various length, and I want to have a MsgBox display the third... | <p>Look at Left, Right, and Mid (with or without Reverse). The traditional ways.</p>
<pre><code>Left(Right(A,3),1)
Mid(A, Len(A) - 3, 1)
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Scroll down a scroll bar from a div c#<p>I'm trying to scroll to the bottom of the div.
Here is a code from python which is working.</p>
<pre><code>element ... | <p>The same code, in C# would be:</p>
<pre><code>var elements = driver.FindElements(By.ClassName("paginated"));
if (elements.Any())
{
((IJavaScriptExecutor) driver)
.ExecuteScript("arguments[0].scrollTop = arguments[0].scrollHeight",
elements.First());
}
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding View, Removing it, and Adding it Again Breaks AutoLayout Constraints<p>I have a very simple <a href="https://developer.apple.com/library/ios/featureda... | <p>The problem is that you have the height of the child view controller defined in more than one way. These three lines are important</p>
<pre><code>"<NSLayoutConstraint:0x7fa57a71d1c0 V:[UIButton:0x7fa57a71bce0'Switch to Yellow View']-(413)-| (Names: '|':UIView:0x7fa57a71cff0 )>",
</code></pre>
<p>This tells... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Restrict Pyramid to require login by default<p>How can I use pyramid so, that it requires a User to be logged in, unless I explicitly say it does not for a c... | <p>Use <a href="http://docs.pylonsproject.org/docs/pyramid/en/latest/api/config.html#pyramid.config.Configurator.set_default_permission" rel="nofollow"><code>config.set_default_permission</code></a> to set a permission for views for which none is set explicitly.</p>
<p>Thus you could do </p>
<pre><code>config.set_def... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Backspace not working in Firefox for TextArea when reached its limit<p>I'm trying to limit the text in textarea using JavaScript. It works fine in Chrome but... | <p>try as following</p>
<pre><code><textarea onkeypress="return textboxMultilineMaxNumber(this,5,event);">dfgdfg</textarea>
function textboxMultilineMaxNumber(txt, maxLen,evt) {
if (txt.value.length > (maxLen - 1) && evt.keyCode !==8) {
return false;
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mysql Cluster without replication<p>Is posible to do a MySQL Cluster without replicated database in the diferent nodes, I need to do a kind of RAC with MySQL... | <p>I looked into Mysql HA a while back. I was not able to find a satisfactory solution, but I will share my discovery nevertheless.</p>
<p>First of all, Mysql has very limited HA capabilities; mostly confined to async replication and clustering with semi-sync replication. The only way that I have seen that will achiev... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Adding list item using jQuery and Bootstrap<p>I had a simple to-do list app that worked fine, recently I overhauled the app using Bootstrap, before I wasnt u... | <p>Mine works fine, does is what you needed to do ?</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>$(function() {
// configuration
// button
var add = $('#add');
// list container
var listContainer = $('#lis... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to navigate through modal pages in Xamarin.Forms using Fresh.MVVM<p>I was trying to push a modal page in my xamarin forms app using MVVM when pressing a ... | <p>The problem was a misunderstanding of concepts, I thought that a content page and a navigation page were two different types of pages, like a tabbed page, master detailed page, carousel page, and content page. So I was trying not to use the following code thinking that FreshNavigationContainer forced me to use a nav... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Selecting elements in an array based on what column and row they are in in order to complete a loop in python<p>Say I had the following:</p>
<pre><code>x = ... | <p>You can use <a href="http://docs.scipy.org/doc/numpy/reference/generated/numpy.hsplit.html#numpy.hsplit" rel="nofollow"><code>np.hsplit()</code></a> (Split an array into multiple sub-arrays horizontally (column-wise).) then chose the fist part :</p>
<pre><code>>>> np.hsplit(x,2)[0]
array([[ 1., 2.],
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Difference between MongoDB and Mongoose<p>I wanted to use the mongodb database, but I noticed that there are two different databases with either their own we... | <p>I assume you already know that MongoDB is a NoSQL database system which stores data in the form of BSON documents. Your question, however is about the packages for Node.js.</p>
<p>In terms of Node.js, <a href="https://www.npmjs.com/package/mongodb" rel="noreferrer">mongodb</a> is the <strong>native driver</strong> f... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
operands could not be broadcast together with shapes (16,) (21,) -pandas<p>I have pandas pivot table datafrme "df_summary_table". print(df_summary_table) giv... | <p>Problem is there is no <code>Multiindex</code>, so need <code>m1</code> for filter rows and <code>m2</code> for filter columns, <code>"cost"</code> has to be removed and mask cannot be chained by <code>&</code>, because different lengths and different filtering (first filter per rows, second per columns):</p>
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Is there a way of making "npm ci" install devDependencies, or "npm install" not update package-lock.json?<p>I'm trying to put together documentation for new ... | <p><code>npm ci</code> does install both dependecies and dev dependencies. But if you use <code>npm ci --production</code> or if your <code>NODE_ENV</code> is set to production, then it avoids installing dev dependencies.
Please check docs <a href="https://docs.npmjs.com/cli/install" rel="noreferrer">here</a>.</p>
<bl... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Strings and UIImages in the same Dictionary Swift<p>I am quite new to Swift and Xcode. I have made a UITableView to display specific posts from instagram. Du... | <p>I'm not sure if it's the problem you're having, but Swift dictionaries can only contain data with the same type - only numbers or only Strings, not a mix of both.</p>
<p>This may be the cause of problem you're having?</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How can I get mongo documents with multiple non-exclusive selectors using Mongoose?<p>I need to build a single query to return :</p>
<ul>
<li>Documents from... | <p>Mongoose <code>aggregate()</code> function uses <code>$match</code> stage which is equivalent to the <code>find()</code> but accepts some stages as array of elements to filter the documents. You can check the example here <a href="https://mongoosejs.com/docs/api/aggregate.html#aggregate_Aggregate" rel="nofollow nore... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Mongodb doesn't start as a service<p>When I try to run Mongodb as a service <code>sudo service mongodb start</code>
I get</p>
<p><a href="http://pastebin.co... | <p>The answer is removing all data from mongo data (Ty Blizz)</p>
<p>For my case clear <code>/var/lib/mongodb</code></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to turn off the highlighting of folded code in VSCode?<p>Today, something has changed in my VSCode. Can anyone help me with this?</p>
<p>Does anybody kn... | <p>File -> Preferences -> Settings</p>
<p>Then search for 'Folding highlight' and uncheck the box. That will turn off the highlight.</p>
<p><a href="https://i.stack.imgur.com/u72gu.png" rel="noreferrer"><img src="https://i.stack.imgur.com/u72gu.png" alt="enter image description here"></a></p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Incompatible pointer types and constness<p>I have a function taking a static two-dimensional array and treating the elements of the elements of the array as ... | <p>GCC is right to the letter of the standard and Clang is wrong.</p>
<p>6.3.2.3/2:</p>
<blockquote>
<p>For any qualifier <em>q</em>, a pointer to a non-q-qualified type may be converted to a pointer to the <em>q</em>-qualified version of the type;</p>
</blockquote>
<p>Looks very promising. But hold on.</p>
<p>6.... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
program get stuck after psql delete statement<p>My programm connects with ssh (ssh.net) to a host, with the data provider npgsql to a psql database and delet... | <p>After researching and testing different scenarios, I finally found the timeout. I needed to disable the Connection Pooling, where the Connection is still open after closing, if it is needed again.
I just disabled it with <code>Pooling=false</code>.</p>
<pre><code>string sqlpool = "false";
string sqlconn = String.Fo... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
KendoSortable in Angular doesn't enable input fields<p><a href="http://plnkr.co/edit/ba8TioaM7PQYflPIwgzw?p=preview" rel="nofollow">In this plunk</a> I have ... | <p>You can provide an <a href="http://docs.telerik.com/kendo-ui/api/javascript/ui/sortable#configuration-ignore" rel="nofollow">ignore</a> option:</p>
<pre><code><ul kendo-sortable="list" k-ignore="'input'">
<li style="list-style-type:none" ng-repeat="c in conditions">
{{$index}}
<inpu... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Jenkins job HTML output, it's possible to render it as HTML page<p>My jobs generate logs and result with html tags.
However I see only plain text. I would li... | <p>You can use the <a href="https://plugins.jenkins.io/htmlpublisher" rel="nofollow noreferrer">HTML test report plugin</a> with some custom script to write job logs to file.</p>
<p>Here is the simple example</p>
<pre><code> set +x
# echo some html tag with content
echo "<html> <body> <h1> Heading... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Entry::Occupied.get() returns a value referencing data owned by the current function even though hashmap should have the ownership<p>My goal was to implement... | <p>Let's take a look at <a href="https://doc.rust-lang.org/stable/std/collections/hash_map/struct.OccupiedEntry.html#method.get" rel="noreferrer"><code>OccupiedEntry::get()</code></a>'s signature:</p>
<pre><code> pub fn get(&self) -> &V
</code></pre>
<p>What this signature is telling us is that the referen... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Keep app working even when phone is locked/sleep - Ionic4<p>App is an ionic4 capacitor app which uses few cordova plugins as well. I have a timer feature ass... | <p>I got it working using the wakeup method from the cordova background mode plugin inside the ble's startNotification method. @Paulw11's suggestion helped!</p>
<hr />
<p>Hi,
I am having this same problem. I did not understand MJ2410's answer - " got it working using the wakeup method from the cordova background m... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Remedy for both revision and filename<p>I've seen this error in other parts of the forum, but never in this particular situation. </p>
<p>I'm a git beginner... | <p>First, you can force <code>gitk</code> to treat the argument as a filename by using <code>--</code> before it:</p>
<pre><code>gitk -- file.py
</code></pre>
<p>Alternatively, as you noted, it's a bad practice to have names that are both branch names and file names. You can rename your branch by using <code>git bran... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to read a list of strings from a vector in C++<p>The context of my question is this: I am making a text-based game that has a very basic inventory system... | <p>Your vector of tool names is empty, so the loop does nothing.</p>
<p>Replace</p>
<pre><code>vector<string> inv;
</code></pre>
<p>with e.g.</p>
<pre><code>vector<string> inv = {"shotgun", "crowbar"};
</code></pre>
<p>This initialization is supported in C++11 and onward (currently C++14), but was not ... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reading the run mode in Yesod<p>How can I determine the run mode (<code>Development</code>, <code>Testing</code>, <code>Staging</code>, <code>Production</cod... | <p>In the newest versions of the scaffolding, we no longer have the concept of environments. Command line arguments can be used to switch which config files we read from, but that's it. If you'd like access to that information, you could use <code>getArgs</code>.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Reverse list in Racket in O(n)<p>I need to write a recursive function in Scheme which takes a list of atoms and reverses it in linear time. I am only allowed... | <p>The problem is that if <code>(reverse (cdr lat))</code> returns a list eg <code>(3 2)</code> then <code>(cons '(3 2) (1))</code> turns into <code>((3 2) 1)</code>.</p>
<p>A classical way to do this would be to make a local procedure that takes an accumulator as well as the argument of the global procedure. As you a... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Using domain in Odoo colors attribute<p>Is it possible to have a domain-like condition in Odoo <code>colors</code> attribute instead of a single condition ?<... | <p>Yes we can use multiple condition on colors with the help of <code>and</code> and <code>or</code> for example: </p>
<pre><code>colors="blue:state=='approved' and doc_type=='revisi' "
colors="blue:state=='approved' or doc_type=='revisi' "
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
SQL select the first and the last row based on another column (timestamp)<p>Hello I am trying to do a select of certain elements on a table.
here is what my ... | <p>First find the Min and Max <code>time</code> per <code>userID</code> then join the result back to the main table to get the other information. Try this.</p>
<pre><code>select A.Time, A.UserID, A.Data from yourtable A
join
(
SELECT UserID, MIN(Time) AS Min_Time, MAX(Time) AS Max_Time
FROM yourtable
GROUP BY U... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Python generator vs list as array initializer<p>Here's an example of initializing an array of ten million random numbers, using a list (<code>a</code>), and ... | <pre class="lang-py prettyprint-override"><code>[randint(1, 100) for _ in range(0, 10000000)]
</code></pre>
<p>This is a list comprehension. Every element is evaluated in a tight loop and put together into a list, so it is generally faster but takes more RAM (everything comes out at once).</p>
<pre class="lang-py pre... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to identify file name that has parsing error in Python?<p>I have over 100 csv files and am trying to combine them to a single file, but a file, say "x.cs... | <p>You can try to catch the file using the following <code>try</code> & <code>except</code> blocks:</p>
<pre><code>try:
#your code to open files and parse their contents
#...
#...
except ParseError:
print("Parsing error for: ", filename)
</code></pre>
<p>This would print out the problematic file.<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Strange NPE: primitive field null inside instance method<p>I'm having a strange NPE with the following stacktrace:</p>
<pre><code>Fatal Exception: java.lang... | <p>It's not obfuscation but optimization done by the same tooling such as proguard or r8.</p>
<p>Basically, the simple accessor is optimized as inline in the caller and it's in fact the <code>GVPConfiguration</code> object at call site that is null.</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Invalid value specified for connection string attribute<pre><code>import pyodbc as po
connection_string = """
driver=ODBC Driver 17 for SQL Server;
serv... | <p>According to <a href="https://docs.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqlconnection.connectionstring?view=netframework-4.8" rel="noreferrer">this microsoft documentation</a>, recognized values are <code>true</code>, <code>false</code>, <code>yes</code>, <code>no</code>, and <code>sspi</code></p>
<... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
change db value AJAX PHP JS<p>I want for user to click a button to delete de div, and for it to no longer show on he webpage i want to change a value in my d... | <p>The error is in <code>$query = 'UPDATE entoffers SET preview = 1 WHERE id = "$id" ';</code> <strong>8th</strong> row of your PHP file:</p>
<p><strong>From <a href="http://php.net/manual/en/language.types.string.php#language.types.string.syntax.single" rel="nofollow noreferrer">php.net</a>:</strong></p>
<blockquote... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Bootstrap 4 navbar collapse does not work [doesn't stay open]<p>I am trying to implement a Navbar using Bootstrap 4. Currently, the Navbar correctly collapse... | <p>you are adding the below css in your style.css</p>
<pre><code>.collapse {
display: none !important;
}
</code></pre>
<p>kindly remove this css from your style.css file then check your header it works fine.</p>
<p>I hope this will work for you.</p>
<p>Thank you...</p> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Can you declare an attribute private within an abstract class?<p>Let's say you have an abstract class:</p>
<pre><code>abstract class PersonAbstract
{
pr... | <p>Yes, you can have a private field within an abstract class. This field will only be accessible to functions within that abstract class though. Any classes which inherit from your abstract class will not be able to access the field.</p>
<p>You can declare both fields and functions as public, protected or private wit... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Angular ui-router: how to prevent access to a state<p>Hello I'm new to angularJS and have been trying to prevent access to certain states based on user crite... | <p>If a state has no <code>data</code>, then <code>to.data</code> is undefined. Try this:</p>
<pre><code>if (to.data && to.data.needAdmin && auth.user.roles[0] !== 'admin') {
</code></pre> |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How exactly does the ?: operator work in C?<p>I have a question, how the compiler operate on the following code:</p>
<pre><code>#include<stdio.h>
int... | <p>In <code>int d = (b == c++) ? (c+1) : (c-1);</code>:</p>
<ul>
<li>The value of <code>c++</code> is the current value of <code>c</code>, 11. Separately, <code>c</code> is incremented to 12.</li>
<li><code>b == 11</code> is false, since <code>b</code> is 12.</li>
<li>Since <code>(b == c++)</code> is false, <code>(c-1... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
Check if user is EST timezone and within a set EST time range using JS<p>I have a situation where I'm trying alert users that are <strong>not</strong> in an ... | <p>Using <a href="http://momentjs.com/" rel="nofollow">moment.js</a> with <a href="http://momentjs.com/timezone/" rel="nofollow">moment-timezone</a>:</p>
<pre><code>// get the current time in the user's local time zone
var nowLocal = moment();
// get the current time in the US Eastern time zone
var nowEastern = momen... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
How to hide empty parens when children are empty<p>I am trying to build a dynamic search box to filter items in a list - the list is setup as a series of uno... | <p>JS</p>
<pre class="lang-js prettyprint-override"><code>var $ul = $('.sorted-list');
var $li = $ul.find('li');
$("#search-input").on("keyup", function () {
var inputValue = $.trim(this.value); // Trim values!
var rgx = new RegExp(inputValue, "i"); // Case insensitive
// LI
$li.show().filter(function() {
... |
Please answer the following Stackoverflow question on Programming. Answer it like you are a developer answering Stackoverflow questions.
Stackoverflow question:
What is Azure functions Cron Expression to trigger on 2nd Sunday of every month?<p>I have Timer Trigger Azure function, which I want to trigger on 2nd Sunday... | <p>The second Sunday of the month falls on one (and only one) of the dates from the 8th to the 14th inclusive. Then the cron expression will be easy to get it.</p>
<p>Suppose it should be <code>0 0 0 8-14 * Sun</code> and the below is my test, it shows the first five date.</p>
<p><a href="https://i.stack.imgur.com/pl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.