title stringlengths 13 150 | body stringlengths 749 64.2k | label int64 0 3 | token_count int64 1.02k 28.5k |
|---|---|---|---|
Shows exception in java code (Selenium + Jsoup) | <p>I am working on an project. In that, I have to get HTML page source code. For that, I invoke firefox driver using <code>Selenium</code>, and store page source code in String, and then parse using <code>Jsoup</code> </p>
<p>My code worked fine for single <code>url</code>. But when I put my code in testing, where it... | 2 | 2,485 |
how could i set menu bar position in middle using netbeans ide | <pre><code>public class frame extends JFrame {
/**
* Creates new form frame8
*/
public frame8() {
initComponents();
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jMenuBar1 = new javax.swing.JM... | 2 | 1,092 |
array map split join, javascript | <p>I need help in understanding this piece of code.
What is it doing and what is the type its returning. Possibly break it in smaller chunks to understand.</p>
<p>Why would it join array elements on '.' and then split them using the same dilimentor'.' What type of array is being passed back from search results?</p>
<p... | 2 | 1,220 |
Bootstrap 4 sass two gradient colors to navbar links hover not working | <p>i'm really new to sass and i have search a lot for this i cloud not find any solution, help me</p>
<p>i have created bootstrap 4 navbar with gradient background and gradient navbar links its working perfectly and again i add gradient font color to a:hover its working but also if i add gradient background color to a... | 2 | 2,086 |
Paypal Express checkout not working? | <p>I have been using Paypal Express checkout for payment in my application.Still its in sandbox mode. It was working fine without any problem till last week.But from this week, the transaction ID not generating.</p>
<p>First of all, I will explain my full flow of transaction.</p>
<p>1.When I checkout, I will call the... | 2 | 9,785 |
How to inject arguments to a constructor of a service for testing using jasmine testbed.configureTestingModule | <p>Hi I need to pass two arguments to my constructor when testing using testBed.configureModule</p>
<p>Here is my base.service.spec.ts</p>
<pre class="lang-ts prettyprint-override"><code>import { TestBed } from '@angular/core/testing';
import { HttpClientTestingModule } from '@angular/common/http/testing';
import { B... | 2 | 1,661 |
make error in OpenCV installation on ubuntu (ffmpeg CODEC_ID_XXXX was not declared in scope) | <p>I am trying to install OpenCV following <a href="https://www.youtube.com/watch?v=ubOa_tJDM_U" rel="nofollow">this</a> tutorial. I am through cmake.(The configuration is given at the end.) However make shows error :<code>make[2]: ***[modules/highgui/CMakeFiles/opencv_highgui.dir/src/cap_ffmpeg.cpp.o] Error 1</code>
O... | 2 | 3,988 |
Including files outside of the project in MSBuild | <p>I have found other posts here on StackOverflow that deal with my issue I am experiencing, for example:</p>
<p><a href="https://stackoverflow.com/questions/12852236/msbuild-deploying-files-that-are-not-included-in-the-project">MSBuild: Deploying files that are not included in the project</a> as well as <a href="http... | 2 | 1,613 |
Webpack HMR browser not outputting hot-update.json | <p>I'm running webpack with the --watch command to compile my browser code with the webpack.HotModuleReplacementPlugin. It seems that it keeps looking for a http://localhost/3df194f7935a8d2781e4.hot-update.json which doesn't get generated until the next update occurs. Here's the flow:</p>
<ol>
<li><p>Start the server u... | 2 | 3,853 |
SSH from shared Gitlab runner stopped working | <p><em>This <strong>did</strong> work previously!</em></p>
<p>My deployment step in my pipeline SSH's onto a DO box & pulls the code from a docker registry. As mentioned, this worked previously & this was my <code>deploy</code> step in my <code>.gitlab-ci.yml</code> back then which worked fine inspiration from ... | 2 | 4,607 |
how to work with checkox in mvvm model in android | <p>I am working on Recyclerview in which checkboxes are there. I want to know how to use the below to achieve MVVM data binding in android.</p>
<pre><code>@BindingAdapter({"app:setCheckBoxListener"})
public static void setCheckBoxListener(AppCompatCheckBox checkBox, final OnCheckListener onCheckListener) {
checkBo... | 2 | 2,073 |
Spring Boot Rest Service Bean Creation Exception | <p>I am getting the below exception in my Spring boot rest service Application.This exception occurs sometimes when I start the service.I am able to start the service after 4 or 5 attempts.Any solution is appreciated.</p>
<pre><code>RuntimeException generated in Method : org.springframework.beans.factory.support.Abstr... | 2 | 4,209 |
Why does using the negation of a variable break data binding in Angular2? | <p>This seems like it should be straight-forward, but I can't see what I'm doing wrong. I have a form on which some components are optionally enabled based on a yes/no radio button. I'm attempting to set the disabled attribute based on the boolean behind that radio button. If I set [disabled] to the radio button eve... | 2 | 1,282 |
Link static member from dll | <p>I've a strange problem with linking a static member from a dll using Visual Studio Express 2010. On Linux platform
and MSYS/MinGW (GCC) this failure doesn't occurs.</p>
<p>I've a Math library using an export macro explicitly for this library module:</p>
<pre><code>#ifdef WIN32
#ifdef MATH_LIBRARY_EXPORT
#def... | 2 | 1,683 |
TwoWay binding on "linked" variables (Top/Left & Height/Width) with .NET 4.0 | <p>I have encounted a problem when switching to the .NET Framework 4.0.
I have a window that uses twoway binding on its Top/Left & Widht/Height properties.</p>
<p>A problem occurs when i need to change the viewModel.</p>
<p>After changing the underlying ViewModel, when triggering the PropertyChanged event on the ... | 2 | 1,543 |
Cannot open source file avr/io.h (dependency of hal.h) with Visual Studio Code on windows 10 | <p>I want to implement an embedded project using stm32F0 (arm-based) with VS Code. The project ran properly on other systems.</p>
<ol>
<li>I Added C/C++ extension to visual studio</li>
<li>I installed a compiler for cortex-m0 arm: GNU Arm Embedded toolchain/gcc arm for windows.</li>
<li>Makefiles installed: binaries fi... | 2 | 1,412 |
ClientHandlerException in REST client only when executing jar file | <p>I have set up a REST Webservice and a Client. The Webservice is deployed on a Glassfish server. If I run the main class of the client out of netbeans everything works fine. Now I use Maven to create a executable jar file and if I try to run this jar file I get the following exception message: </p>
<pre><code>21.07.... | 2 | 1,193 |
Telerik KendoUI Angular2 Grid- Page Size drop-down not updating displayed record items in Grid | <p>I am trying to use Telerik's new KendoUI Angular 2 Grid control, and the drop-down that changes pageSize doesn't seem to update the size of the grid to display the amount of records selected. It changes the number of pages and the pageInfo (1-10 of 100 items), but not the grid itself. Am I doing something wrong? Fol... | 2 | 1,439 |
Custom Searchbar in iOS | <p>Hello i am using <code>UISerchbar</code> in <code>tableview</code> but is there any easy way to create custom <code>searchbar</code> in <code>tableview headerview</code>?</p>
<p>i already check below link but i am not understand.</p>
<p><a href="https://stackoverflow.com/questions/25904213/custom-uisearchbar-with... | 2 | 1,162 |
Command Line input for Python Script | <p><strong>What I am trying to do here:</strong></p>
<p>I am trying to crawl yelp and get reviews from a particular page. However, I just want to modify this script to give "<em>Restaurant name</em>" as input.</p>
<p>For example: </p>
<p>User Input:
<strong>dennys-san-jose-5</strong></p>
<pre><code>URL: http://www... | 2 | 1,053 |
Angular JS does not render view in IE 8 | <p>Internet explorer 8 seems to hate the Angular.js used in my contact form, and I am not sure how to debug. Using emulation mode in IE 11 shows that the view is not rendered, but the console doesn't seem to report any errors. Is there something obvious I have overlooked, or is there a better method of troubleshooting ... | 2 | 2,820 |
Spring MVC - The @Controller annotation does not get autodetected | <p>I am new in spring, therefore maybe my question is stupid! I am trying to add a controller to Spring's Petclinic example. However, the mappings in this controller do not work and I get 404 error. I added the same mapping to the other existing controllers and it works. I want to see what I am doing wrong. Here is my ... | 2 | 1,193 |
I can't make corners of images and buttons rounded | <p>I'm creating the cells of a UITableViewController.
In one of them, a small image is contained. I tried the following to make its corners rounded:</p>
<pre><code>profileImage.layer.cornerRadius = 8;
profileImage.clipsToBounds = YES;
</code></pre>
<p>In another cell prototype, I tried to make the corners of a button... | 2 | 1,601 |
Trouble Compiling App.Js code using use Effect and use State hooks in React | <p>I am trying to run a web page using useState for Game State and setting game state on a website rendered using React. There are problems compiling with three variables undefined. (Set_GAME_State, SNIPPETS and Snippet Index). </p>
<p>This is based on Daniel Katz's tutorial on using Hooks (useEffect and use State) fr... | 2 | 1,378 |
SwiftUI ScrollView won't center content with GeometryReader | <p>I have a horizontal ScrollView in SwiftUI that I would like to 'dynamically' center. the content within the scrollview will be a dynamic chart, and the user can change the width of it by changing years (5, 10, 15 year chart grows horizontally).</p>
<p>Anyway I have <strong>two problems</strong>:</p>
<ol>
<li><p>My c... | 2 | 1,314 |
SWT Horizontal line after Text fully expanded | <p>I'm trying to display a history in a Textfield in SWT. </p>
<p>The history generates a new shell which has two Composites. The first displays the Header part which contains the Label "History" and a horizontal line underneath. The second is Footer part which display the actual data. This works, but the horizontal l... | 2 | 1,395 |
How to render links as elbow connectors in d3 force directed graph | <p>I'm very new to D3 and this is what I have done till now <a href="http://jsfiddle.net/gj2y87z8/13/" rel="nofollow noreferrer">here</a>. </p>
<p>The actual code is over here:</p>
<pre><code>var width = 1840,
height = 1480,
constant = 100,
color = "#BCD8CD"
var nodes = [
{label: '1st stage', x: c... | 2 | 1,918 |
console application wait for keyup | <p>I´m currently working on a roguelike in c#.
The world, player etc. are rendered inside of a console. But when there are too many changes in the console, it lags.
To bypass this, I´m trying to let programm wait for the player to un-press the key the player is pressing.
Anyone has an idea on how to make this?
Bad, tha... | 2 | 1,052 |
Ignite Remote Cluster [Failed to map keys for cache (all partition nodes left the grid)] | <p>I am having some issues creating cache K,V pairs on my remote Ignite cluster. My Ignite nodes are built on a Maven project in Java8, clustered via multicast configuration, with partitioned cache. The problem faced here is that ignite can only successfully create and retrieve cache via SqlFieldQuery or NoSQL when the... | 2 | 1,988 |
Adding JTextField to JPanel on button click (IntelliJ GUI Designer) | <p>I realize this question has been asked before but none of the solutions I tried worked. I am trying to swap content in a JPanel based on user input.
For example, I would like to remove two buttons and add several JTextField. </p>
<p>No matter what I do, I get a null pointer exception. I tried creating the element ... | 2 | 4,745 |
NLog is not logging into the database when its configured to log from code | <p>I have following console application which implements logging using NLog using the programmatic config. Currently, It is currently not logging into the database and also it does not throw any exceptions while running it. Can anybody please let me know the reason behind it?</p>
<pre><code>using NLog;
using NLog.Conf... | 2 | 1,289 |
how to sum the values from an XML file based on certain criteria | <p>i need to sum up the values from an XML file based on some criteria<br/>
my XMl Is as follows</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<transactions>
<transcation ID="1">
<BankName>ABC</BankName>
<TemplatModel>CT1</TemplatModel>
<... | 2 | 1,662 |
Uncaught Error: Route parameter missing: id - Javascript console | <p>this is my first time trying to use ajax and javascript and I've come across this problem:</p>
<p>Uncaught Error: Route parameter missing: id </p>
<p>I'm not sure how to fix it/where to look as I don't understand what the error is telling me. what does 'route parameter missing: id' mean?</p>
<p>I'm not sure what ... | 2 | 2,524 |
MPI Gather Corrupting Arrays | <p>I have written an MPI code in C++ for my Raspberry Pi cluster, which generates an image of the Mandelbrot Set. What happens is on each node (excluding the master, processor 0) part of the Mandelbrot Set is calculated, resulting in each node having a 2D array of ints that indicates whether each xy point is in the set... | 2 | 1,925 |
Rendering Freetype glyph to OpenGL (3.3+) texture results in repeated texture with artifacts | <p>I was simply trying to display a glyph (letter Ě) loaded from Freetype as a bitmap picture onto an OpenGL texture that is stretched across the whole window. Result is here: </p>
<p><img src="https://i.imgur.com/R8r6FGZ.png" alt="OpenGL + Freetype"></p>
<p>To get to this result I had to set an extremely large FT_Se... | 2 | 3,022 |
pass Jacobian for lmfit least squares | <p>I am using the lmfit python package for non-linear optimisation (url: <a href="http://lmfit.github.io/lmfit-py/" rel="nofollow">http://lmfit.github.io/lmfit-py/</a>). I would like to know if it is possible to pass the Jacobian function when using the least squares fitting method ? If yes, would it be possible to pro... | 2 | 1,870 |
Read, delete some records and write the same XML file using Perl XML::Simple | <p>I have been struggling with this at work today. Trying to read in an XML file like the one below (that I have quickly just typed in). I have a CSV file of <code>show_id</code> codes. So I read them in and put them in a hash. Then I read in the XML file using <a href="https://metacpan.org/module/XML%3a%3aSimple" rel=... | 2 | 1,131 |
React-Dropzone not uploading File to AWS S3 | <p>So I have downloaded the library of react-dropzone and I'm trying to use in a component that will act as a parent....</p>
<p>This is the logic code that I have for the parent component:</p>
<pre><code> const [uploadPercentage, setUploaderPercentage] = useState(0); // Done
const [ID, setID] = useState(0);
... | 2 | 2,614 |
JPQL: SIZE function causing strange exceptions on EclipseLink | <p>I'm porting from Hibernate. What's wrong with SIZE function in the JPQL statement (assuming the mappings are correct)?:</p>
<pre><code>SELECT NEW de.poyry.pqgenerator.view.PqListItem(
pq.id,
pq.name,
pq.submissionDate,
pe.firstName,
pe.lastName,
SIZE(pa))
FROM Prequalification pq
JOIN pq.user us
JOIN us.per... | 2 | 3,510 |
scala read config to Map of Map of case class | <p>I need to read from a config file and map the config to a case class .It works fine if i have one table as below </p>
<p><strong>CONFIG</strong> </p>
<pre><code>mapping {
target {
oracle = {
type = "oracle"
schema = "orcl"
tableName = "my_table"
query = "select key ... | 2 | 2,612 |
Flot line chart time xaxis series fixed labels | <p>I want to create a flot line chart with time xaxis series which will have always fixed numbers of labels that is 6. Those 6 labels will be half of each year for 3 years. For example the labels could be <code>Jan-2016, June-2016, Jan-2017, June-2017, Jan-2019, June-2018</code>. Here the year can be changed based on c... | 2 | 1,391 |
How to select a v-list-group child in vuetify? | <p>Im trying to get the value of any sub item that i select, this is possible natively with vuetify?. I tried using sub-group but i think i dont how to use it, any idea on how to solve this problem?</p>
<pre><code> <v-list>
<v-subheader>Categories</v-subheader>
<v-list-group v-for=&quo... | 2 | 1,173 |
No speedup with OpenMP | <p>I am working with OpenMP in order to obtain an algorithm with a near-linear speedup.
Unfortunately I noticed that I could not get the desired speedup.</p>
<p>So, in order to understand the error in my code, I wrote another code, an easy one, just to double-check that the speedup was in principle obtainable on my har... | 2 | 1,305 |
constant framerate Gameloop using System.Diagnostics.Stopwatch and delta time in C# from tutorial | <p>I picked up a tutorial on how to do a game loop where the framerate is always the same no matter how big the rendering space gets or the speed of your CPU. It involves using a time interval, but I've poured over this a hundred times and I can not see why my version does not work, so I don't know if it's mine or if ... | 2 | 1,492 |
Netsuite: How to pass variable from client script to suitelet? | <p>I am just a fresh beginner so forgive me for any silly mistake.</p>
<p>I have two codes, one for the client script page init and the other is for suitlet script. What I am trying to do is a form and a sublist on a suitelet script, then pass exisiting record fields to the sublist form using a client script getValue f... | 2 | 1,886 |
Spring Batch 'beanName' must not be empty | <p>In my simple <code>Spring Batch</code> application, I get the error <code>'beanName' must not be empty</code>.
I don't know, what is missing in spring configuration.</p>
<p>spring-beans.xml</p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
... | 2 | 3,879 |
Importing jSON Array into Hive/Hadoop | <p>I'm using the <a href="http://hortonworks.com/products/hortonworks-sandbox/#tutorial_gallery" rel="nofollow">HortonWorks Hadoop Sandbox</a> and I have imported a jSON string into a table, as per <a href="http://pkghosh.wordpress.com/2012/05/06/hive-plays-well-with-json/" rel="nofollow">this guide</a> however I run i... | 2 | 6,144 |
Not able to Save records using JPA table per sub class strategy | <p>I have one parent entity and two child entities.
ReportDetails is my parent entity and ReportBarChart and ReportPieChart are my child entities. The above three share some common fields.
So to while saving the details I'm using table per sub class strategy in JPA.
But after setting the Parent entity values, while per... | 2 | 1,331 |
Having issues when trying to store data into Hive database using HCatStorer() | <p>I'm using PIG to store table data into hive database using HCatalog. I was able to load and dump the data in PIG grunt shell but when i'm trying to store the loaded data into HIVE table which i created as myweather.weathertable1 (myweather-database name ,weathertable1 -table name1) using the below command </p>
<pre... | 2 | 1,026 |
React-Native Expo issue with TextInput | <p>I'm creating a simple event tracker app using React-Native, Redux, React-Navigation and Expo and I'm having a bit of trouble with a fairly trivial part.</p>
<p>I have a form screen where you enter the event name, date and other information. I'm using <code><TextInput/></code> to enter the event's name but it ... | 2 | 2,477 |
Can't attach a form value to Jquery autocomplete source | <p>I spent a lot of time, to add additional parameters to the Jquery-Autocomplete-Source. But I can't get it finished. </p>
<p>What I'm trying to do: I have an autocomplete form with a jQuery datasource. If you select something from the autocomplete, it will be inserted into a table (text and a hidden field with the i... | 2 | 1,299 |
Pip install failing with error: command 'clang' failed with exit status 1 on Big Sur 11.1 | <p>I'm on MacOs Big Sur 11.1. I'm unable to use pip install. When trying to run <code>pip install -r requirements.txt</code> I get the following error:</p>
<pre><code>copying pandas/tests/indexes/timedeltas/test_construction.py -> build/lib.macosx-11.0-x86_64-3.7/pandas/tests/indexes/timedeltas
copying pandas/tests/... | 2 | 8,950 |
How would I parse a string in @RequestBody? | <p>Here is my HTML Page :</p>
<pre><code><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Sports</title>
</head>
<body>
... | 2 | 1,087 |
How to have 2 related objects stored in different databases using Entity Framework | <p>I'm redoing an old application using C#, .net 4.5, ASP.NET MVC 5 and Entity Framework 6.</p>
<p>Because this web app will be used at the same time the old app, it needs to share the same databases.</p>
<p>To save me some time I've generated my model based on the existing databases. (to do this I first gathered all... | 2 | 1,662 |
failing at downloading an image with "urllib.request.urlretrieve" in Python | <p>If possible point the solution as well</p>
<p>My Code:</p>
<pre><code>import random
import urllib.request
def download_web_image(url):
name = random.randrange(1,1000)
fullname = str(name) + ".jpg"
urllib.request.urlretrieve(url, fullname)
download_web_image("https://upload.wikimedia.org/wikipedia/com... | 2 | 1,561 |
Firebase initialization fails for Android on Xamarin.Forms app | <p>I'm following the tutorial <a href="https://docs.microsoft.com/en-us/azure/notification-hubs/xamarin-notification-hubs-push-notifications-android-gcm" rel="nofollow noreferrer">here</a> to set up Firebase Cloud Messaging for Android in my Xamarin.Forms application. This is an app that currently uses Google Cloud Mes... | 2 | 6,140 |
What can be the reason for getting this log output - Lost connection to device - when executing flutter run? | <ul>
<li>Why is the device getting disconnected with the log stating - Lost connection to device - after
excuting flutter run?
<br/> </li>
<li>Everything works fine till the login
screen, where the user is able to correctly login using google Sign
in, but the next 'HOME' screen, as it starts loading, breaks & I
re... | 2 | 1,437 |
SAP GUI Macro doesnt work when I had more than one session open at the same time | <p>I had develop a macro which search some information in SAP(SAP GUI)and copy it in a excel worksheet, but sadly it only works if I had open ONLY ONE session.
Even if I try to create a new session by code("session.createSession"), the next steps(the important ones) are done in the first session that had been open befo... | 2 | 4,757 |
Is this a bug in Visual C++ 2010, or am I missing something? | <p>Given the following code:</p>
<pre><code>#include <vector>
template<class C1, class C2, class Op>
std::vector<typename Op::result_type>
f(Op op, const C1& src1, const C2& src2)
{
}
template<class It, class Op>
std::vector<typename Op::result_type> g(Op op, It begin, It end... | 2 | 1,041 |
Unit of Work Not Saving On POST Call | <p>I am following the Repository pattern and implementing UnitOfWork.</p>
<p><strong>Here is the issue:</strong></p>
<p>Within the <code>EmployeeController</code>, there is a post call titled <code>AddEmployee()</code>. This action method gets the appropriate data and the result comes back successful, but <strong>the d... | 2 | 2,690 |
Tensorflow restore `tf.Session` saved checkpoint using `tf.train.MonitoredTrainingSession` | <p>I have code for training a CNN using <code>tf.train.MonitoredTrainingSession</code>.</p>
<p>When I create a new <code>tf.train.MonitoredTrainingSession</code> I can pass the <code>checkpoint</code> directory as an input parameter to the session and it will automatically restore the latest saved <code>checkpoint</co... | 2 | 1,119 |
Jquery does not work in 0.10 sails | <p>(Sorry for my English) </p>
<p>I am new Sails, and I'm trying to use jquery. Following the steps in this <a href="https://www.youtube.com/watch?v=_wL2cS0GmJQ&list=PLf8i4fc0zJBzLhOe6FwHpGhBDgqwInJWZ&index=10" rel="nofollow">Tutorial of YouTube</a>. But I made it through and as the tutorial is in version 0.... | 2 | 2,731 |
EditText in TextInputLayout lagging | <p>I have two views using <code>TextInputLayout</code>. The first one is a login view which has only 2 input fields and the second one is a register view which has many input fields. I am using <code>TextInputLayout</code> and <code>EditText</code>/<code>AppCompatEditText</code> with custom themes for my inputs.<br>
Th... | 2 | 4,279 |
Json input of a stored Procedure | <p>I have a Stored Procedure with a JSON in input ,Is it possible to use the JSON as input for a stored procedure? how could i do that ?</p>
<pre><code>CREATE PROCEDURE [warm].[stored _table]
(
@Json NVARCHAR(MAX)
)
AS
BEGIN
SET NOCOUNT ON;
BEGIN TRY
BEGIN
WITH JsonToTable AS
(
... | 2 | 1,412 |
What is Order of Growth and How do you compute it? | <h2>Why I am asking this question</h2>
<p>I have recently started reading Sicp, and I have worked
my way through to <a href="http://www.sicp-book.com/book-Z-H-11.html#%_sec_1.2.3" rel="nofollow noreferrer">Section 1.2.3</a>.
I am unable to understand some of the details of Order of Growth. Please bear with me and
my ov... | 2 | 2,021 |
Pandas Filtering and convert to Date to datetime64ns | <p>I am trying to figure out a problem but so far I could not find any solution I hope you might can help.
I have a DataFrame and I would like to convert <code>str</code> to <code>datatime</code> but there are some invalid rows which I would like to filter out. Here are two examples:</p>
<pre><code>Out[6]:
# name ... | 2 | 4,286 |
How would I unit test code like this? | <p>I have the following class and am currently testing it via running a file which calls the methods in this file. I then use a mixture of print statements and checking the blog to make sure the code has worked.</p>
<p>I'd really like to write some pytest unit tests for this and automate it all, but how can I do this?... | 2 | 1,642 |
android calculator | <p>i was designing a calculator similar to win 7 calc i have used colspan to make 0 button to size of two cols but i am not getting how to make = button to size of two rows i am using table layout..
i tried it with android:layout_span but its working only for colspan is ther any thing for row span </p>
<pre><code> ... | 2 | 3,296 |
Multiple belongs_to joins to the same table (In Rails 4.2 did the ability to do this in a clean way change?) | <p>With the latest way that joins and the where clauses work in Rails 4.2, it appears there is not a clean (using symbols...or just not using string SQL) way to join to the same table from a single query.</p>
<p>For instance, we have a user model, and it has a reference to a home address, and a work address. If we wan... | 2 | 1,429 |
How to export RadHtmlChart to PDF | <p>I am trying to change the orientation of my RadHtmlChart when printing. Here is the code I am using which, basically, takes an image of the chart and puts it in another window to print. It is working, but I need to change the orientation to landscape without the user needing to change their settings. I read that thi... | 2 | 1,079 |
Convert nested table xml to CSV, where table elements are concatenations of table name, row, and column | <p>I have Source XML in this format. The relevant part of the source is under the <strong>values</strong> tag, nested about four levels down, and represents one or more tables of data where the elements are of the format: name = <strong>TableName-Row#.FieldName</strong> and value = <strong>fieldValue</strong>. </p>
... | 2 | 6,613 |
Django form not saving password when creating user | <p>I have made a custom form for my django app which allows users to register themselves for the website.</p>
<p>This is the form for my django app:</p>
<pre><code>class TeacherRegistrationForm(UserCreationForm):
email = forms.EmailField(required = True)
school = forms.CharField(required = True)
subject =... | 2 | 1,323 |
How to make intellisense work for my modules using TypeScript in VSCode | <p>I'm building an application using nodejs and electron in VSCode.</p>
<p>I use javascript currently but I'd like to switch to typescript for better code validation and intellisense.</p>
<p>Intellisense is working fine for external modules (electron, lodash, node core modules) but I can't make it work with my own mo... | 2 | 1,081 |
Formatting radgrid exporting to PDF | <p>I have a datatable dt, and want to make a PDF file from it. Everything is dynamic and it works but I can't format the layout such as alternate row background etc. Here is my code :</p>
<pre><code> private void MakeGridExportToPDF(string strTitle, DataTable dt)
{
using (RadGrid grid = new RadGrid { AutoGenerat... | 2 | 1,274 |
cross compile ghc curses not found | <p>I tried to crosscompile from linux i386 to arm-linux-gnueabihf, but i cant make it happen, because it gives me this weird error while running 'make':</p>
<pre><code>checking ncurses.h usability... yes
checking ncurses.h presence... yes
checking for ncurses.h... yes
checking for setupterm in -ltinfo... no
checking f... | 2 | 1,758 |
NuGet package restore fails for several packages on AppHarbor | <p>My app deploys fine locally and on Azure but fails on AppHarbor for no apparent reason. Nuget can't find most of the packages.</p>
<p>Here is a the build log:</p>
<blockquote>
<p>GET
<a href="https://www.nuget.org/api/v2/Packages(Id=" rel="nofollow">https://www.nuget.org/api/v2/Packages(Id=</a>'Microsoft.AspNe... | 2 | 6,908 |
Hide redundant error message in ASP.Net ValidationSummary | <p>I have a asp.net page accepting two input values – Name and Address. Both of them are required fields. I have used required field validators and validation summary. </p>
<p>When user does not enter both the values the error message if fired two times though the error message is redundant. I need to display only one... | 2 | 1,690 |
(node:5321) UnhandledPromiseRejectionWarning: error: password authentication failed for user "postgres" | <p>I'm taking a web dev course and currently coding along with this video: <a href="https://www.youtube.com/watch?v=RhJwCD0tT5Y" rel="nofollow noreferrer">https://www.youtube.com/watch?v=RhJwCD0tT5Y</a></p>
<p>I've made a github repository for the app which can be found here: <a href="https://github.com/JohnTarvis/node... | 2 | 1,167 |
Adding a table around the pop-up information in Leaflet | <p>I want to create a table around the pop-up information in Leaflet. I am using bootstrap for the mark-up. I tried the following code but it didn't work:</p>
<pre><code>onEachFeature: function (feature, layer) {
layer.on({
click: function showResultsInDiv() {
var d= doc... | 2 | 2,118 |
cakephp 3 form with file type not saving image data in database | <p>I am trying to upload image using cakephp 3. I tried it in cake 2.x, it worked fine there but not in cake 3.0. My image is uploaded but it is not getting saved in DB.</p>
<p><strong>view</strong></p>
<pre><code><div class="col-lg-8">
<div class="articles form large-9 medium-8 columns content">
<... | 2 | 1,786 |
Store Data to ZOHO CRM using LARAVEL and ZOHO CRM API | <p>This is how to save data to zoho crm api using laravel, the process of this is the data will be check before uploading to crm to avoid duplicate data on zoho crm.
public function importToZoho(){</p>
<pre><code> $publicUser = User::withRole('User')->get();
$count = 1;
$auth="YOUR TOKEN I... | 2 | 1,522 |
MSAL access token refreshing not working through AcquireTokenSilent | <p>I am implementing MSAL authentication for our SPA. I've followed various official and unofficial guides and so far this is my auth implementation:</p>
<pre><code>loginMicrosoft() {
myMSALObj
.loginPopup(msalConfig.loginRequest)
.then((response) => {
console.log(response);
this.username = res... | 2 | 1,528 |
multi line and center align x axis labels using ggplot | <p>I know <code>hjust</code> is used for the x <strong>title</strong> axis, but how would I go about centering and multilining the x axis <strong>labels</strong>? Here is my plotting function:</p>
<pre><code>gg_fun<-function(){
ggplot(tab,
aes(x = Var1, y = Percent)) +
#theme_light()... | 2 | 1,034 |
WPF ProgressBar & Dim Controls on Operation | <p>I'm looking to implement a progress bar (on my applications status bar) and at the same time dim all the MainWindow controls except minimize/maximize/close window buttons when I execution.</p>
<p>Right now, I have a Progress Bar User Control with a Background worker process but it pops the progress bar control in a... | 2 | 1,308 |
Connection refused (os error 111) after few successful Selenium Geckodriver tasks (Python) | <p>OS: Ubuntu 20.04 no GUI.</p>
<p>I'm doing a quite simple task there in headless mode:</p>
<ol>
<li>Installing and enabling firefox addon.</li>
<li>Navigating to about:debugging#/runtime/this-firefox and getting addon's uuid.</li>
</ol>
<p>The problem is that after a few successful .py script completions, next ones j... | 2 | 1,986 |
Jena changes my owl file after adding an instance | <p>I have an owl file created with protege 4.2. when I add some Instance with Jena, Jena changes the file structure but the file extension remains the same (.owl) the file is readable in protege with some error. Anyone knows where is the problem with my code?</p>
<p>Because the result of the <a href="/questions/tagged... | 2 | 1,940 |
Threading in Android to process long running processes | <p>Ok, here is my problem. I want to learn AsyncTask, Threading and Handler to process long running tasks. I used Android Cook Book and New Boston Android tutorial, but I can't make it work. </p>
<p>I need to change the progress bar message. This is not for project, but to learn threading. Threading is really hard for... | 2 | 1,131 |
URLSession Cancellation in swift while auto search | <p>My moto is Auto search, I have been trying with URLSession, When i am trying to search slowly the requests are handled as expected(when there is no text the response is empty i mean the placesarray) but when i am trying to clear the text or hit any searchtext speedily then the previous request response are being app... | 2 | 1,489 |
How to run SSH command in android programmatically | <p>I would like to run a simple SSH command like <code>ssh -R 80:localhost:1337 serveo.net</code> , I know there is library <a href="http://www.jcraft.com/jsch/" rel="nofollow noreferrer">jsch</a> to do this , but it will not work without username and password . In my case there is no authentication is required . How c... | 2 | 1,847 |
Lazy loading datatable shows duplicate results with FetchType.EAGER | <p>I know there's a lot of questions about this but none of the solutions helped me.</p>
<p>I'm using PrimeFaces to build a lazy loadind datatable. That means that this datatable list is a LazyDataModel list, and I had to develop a LazyDataModel implementation where I overrode the load method. All of this can be lear... | 2 | 2,071 |
Sails.js Skipper aborting file upload | <p>I'm writing a Sails-js based application where user can upload an image file to server. I'd like to check if the file is truly an image file before saving it to disk. </p>
<p>After struggling with skipper disk adapter I noticed that apparently I couldn't check file properties before finishing the upload. If I check... | 2 | 3,031 |
Deserialize dynamic XML | <p>The <code>XML</code> below always comes in this format, but the elements under the <code><Hit></code> node are dynamic, the name or number of items could be different each time. Is it possible to get the elements under the <code><Hit></code> node dynamically.</p>
<pre><code><SearchResponse>
&l... | 2 | 1,681 |
How to add two models in one view ASP.NET MVC | <p>I have two models. The 1st model contains every record in the database. The 2nd model contains the highest amount in the records. </p>
<p>How can I get two models in one view? I am new to Asp.NET MVC and just trying to get the hang of it.</p>
<p>Here is the code.</p>
<p><strong>Model</strong></p>
<pre><code>name... | 2 | 1,211 |
Get range from unicode character symbols. Swift | <p>I use <code>textView(_: shouldChangeTextIn: replacementText:)</code> function to change the input data depending on the situation. I use range, but I can not get the Swift Range when using unicode character symbols (eg <strong>( ͡° ͜ʖ ͡°)</strong> ). Please, tell me how it can be done?</p>
<pre><code> func textView... | 2 | 1,260 |
textbox from popup modal always return empty | <p>i need explanation about my problem... "textbox from popup modal always return empty" when i clicked the save button from popup modal.. i need to get the value of the txtCityName.Text and the txtCityDescription.Text;</p>
<pre><code>here's my code...
======================
THE HTML
=======================
<%@ Pa... | 2 | 2,471 |
MVCMailer sending multiple Messages with no body | <p>I'm using ASP.Net MVC 4 and MVCMailer 4.0 from Nuget. When I create a message and send it to the scaffolded Welcome message everything works fine and I'm able to send the email just fine (the only thing is that its in plain text where as I have html in it)</p>
<p>My problem comes when I use the Contact form to send... | 2 | 1,233 |
"Failed to validate oauth signature and token" when acquiring a request_token from Twitter OAuth1.0a | <p>Good day, I am writing an iOS app that needs to authenticate with Twitter. When I POST a request to <a href="https://api.twitter.com/oauth/request_token" rel="nofollow">https://api.twitter.com/oauth/request_token</a> I get a 401 error with the message "Failed to validate oauth signature and token".</p>
<p>Here is a... | 2 | 1,845 |
gtk 3.4 resize widget and label attached to entry widget | <p>I'm trying to give a GTK+3 gui to a my future project (client FTP) but I've some problems.
This is my first code:</p>
<pre><code>#include <gtk/gtk.h>
/* When "connect" button is clicked a message will appear */
static void print_hello (GtkWidget *widget, gpointer data)
{
g_print ("Connect button clicked\n"... | 2 | 1,163 |
loading xml data into database using datatable | <p>Hi friends hope all are doing well. I am facing one problem while saving data into sql server database from xml file using datatable using vb.net i.e. <code>"Conversion from type 'DBNull' to type 'String' is not valid"</code>. But not always getting error may be based on xml file. Below follows one of my xml files. ... | 2 | 3,373 |
Find standard deviation of first differences of series defined with GROUP BY using RSQLite | <p>In SQLite I would like to find the standard deviation of the first differences of a (logged) series that I define with <code>GROUP BY</code>. My data provider gives me a daily price series, but I would like to find annualized daily volatility (the standard deviation of daily returns -- first difference of the natura... | 2 | 1,093 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.