title stringlengths 13 150 | body stringlengths 749 64.2k | label int64 0 3 | token_count int64 1.02k 28.5k |
|---|---|---|---|
Spring-boot no maven parent and unittests not running | <p>I tried modifying the spring-boot-sample-integration project's Maven build in the samples to not use a parent spring-boot-starter-parent, but to import the spring-boot-dependencies pom in the dependency management. This is because I would like to use spring boot as a Maven module to an existing project.</p>
<p>All ... | 2 | 3,465 |
Can't include the JPEG_SUPPORT headers in a dlib cpp file | <p>I was trying to compile a cpp file: the face-finder in dlib: <a href="http://dlib.net/face_detection_ex.cpp.html" rel="nofollow noreferrer">http://dlib.net/face_detection_ex.cpp.html</a>. But when I ran it, it said I had to include the libraries for jpg and png files: </p>
<pre><code>processing image /home/james/W... | 2 | 1,504 |
How can a variadic template be used to generate a left-associative expression (aka left fold) in c++11? | <p>I would like to use a c++ template to aggregate (fold) multiple arguments using a binary operation. </p>
<p>Such a template could be used as follows:</p>
<p><code>fold<add>(100,10,5)</code> expands to <code>add(add(100, 10), 5)</code></p>
<p>The particular expansion shown above is the "left fold". The expan... | 2 | 1,438 |
Can't start Cassandra | <p>I'm trying to run cqlsh to connect to cassandra and received the following error messages.</p>
<p>a) error from cqlsh running:</p>
<pre><code>Connection error: ('Unable to connect to any servers', {'127.0.0.1:9042': error(61, "Tried connecting to [('127.0.0.1', 9042)]. Last error: Connection refused")})
</... | 2 | 1,137 |
How to use ListView in order to view SQLite Database in Android Studio? | <p>My aim is to get the database values in a ListView. I've never used ListView and don't exactly know how to do it.</p>
<p>So far I have been using an AlertDialog to view the entries of database. But it creates problem as when one entry is added in database and is viewed then it is stored in stack memory and when you... | 2 | 5,133 |
PHP Memcached sessions replica issue | <p>I have setup a couple of Memcached servers to use as PHP session storage, but despite trying various settings I'm unable to get the session keys to appear in both servers.</p>
<p>My php.ini is as follows:</p>
<pre><code>session.save_handler = memcached
session.save_path = "192.168.134.38:11211,192.168.134.234:1121... | 2 | 1,471 |
What is causing this error when I try to install the pg gem? | <p>I'm trying to install the <a href="http://rubygems.org/gems/pg" rel="nofollow">pg gem</a>. </p>
<pre><code>bens-macbook-pro:liferecord ben$ bundle config build.pg --with-pg-config=/users/ben/postgresql/bin
bens-macbook-pro:liferecord ben$ bundle install
</code></pre>
<p>I get this error:</p>
<pre><code>Installing... | 2 | 1,103 |
why in this simple test the speed of method relates to the order of triggering? | <p>I was doing other experiments until this strange behaviour caught my eye.</p>
<p>code is compiled in x64 release.</p>
<p>if key in 1, <strong>the 3rd run of List method cost 40% more time than the first 2</strong>. output is </p>
<pre><code>List costs 9312
List costs 9289
Array costs 12730
List costs 11950
</code... | 2 | 1,572 |
How to make jstree empty on initialization? | <p>On click of a button I send some key to controllerand get my lists using json , the array inside my lists acts as my children in my jstree, </p>
<pre><code> $("#btnSearch").on("click", function () {
alert("I'm also here");
$.ajax({
type: "POST",
url: "/Claims/JSTree",
... | 2 | 1,261 |
Why do I constantly get "unresolved externals" error in Qt creator? | <p>I'm making a little GUI program using <strong>Qt creator</strong>, but I get stuck with two "<strong>unresolved externals</strong>" errors. Here are all of my code:
(By the way, I following the book <strong><em>C++ GUI Programming with Qt4</em></strong>, <em>second edition</em>. This are covered in chapter 2) </p>
... | 2 | 1,926 |
How to register a dynamically added custom component as a form control within a formgroup | <p>I have created some custom components, each of which implements <a href="http://blog.thoughtram.io/angular/2016/07/27/custom-form-controls-in-angular-2.html" rel="nofollow noreferrer"><code>ControlValueAccessor</code></a>, in order that they may function as controls within a <code>FormGroup</code>. Usually, the only... | 2 | 1,541 |
Python TSP Berlin 52 with Simulated Annealing | <p>I want to know what this function does:</p>
<pre><code>def Recocido(tour1 = []):
# tour1 = tour1[:]
izquierda = random.randrange(len(tour1))
derecha = 0
while(True):
derecha = random.randrange(len(tour1))
if (derecha != izquierda):
#tour1[izquierda], tour1[derecha] = tour... | 2 | 1,216 |
"java.lang.RuntimeException: null" while querying with Reactive Mongo 0.11 | <p>I'm trying to query a collection with findAll with <code>selector = {}</code> on JsonCollection with Play 2.4.2 and Reactive Mongo 0.11.5.</p>
<p>Query fails in method <code>foldM</code> deep inside the <code>play.api.libs.iteratee</code> while calling method <code>collect[List]</code>.</p>
<p>Last code that I cou... | 2 | 1,338 |
GMSMutablePath remove/replace coordinate issue, polyline | <p>I'm building an app that uses the Google Maps Directions API to give me a route polyline so I can display on my mapView to the users. Kind of like the Google Maps turn-by-turn service, but inside my app.</p>
<p>The markers on this map are the coordinates of the polyline that Google Directions gave</p>
<p><a href="... | 2 | 1,393 |
$Injector Error on Angular Upgrade from 1.6.6 to 6 | <p>I did Angular upgrade from Angular.Js 1.6.6 to Angular 6 using Webpack 4:</p>
<pre>
import 'core-js/es7/reflect';
import 'zone.js';
import 'reflect-metadata';
import 'rxjs';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { Routes, RouterMod... | 2 | 1,381 |
Jquery disable button on a synchronous call | <p>I am trying to disable a button to prevent multiple click in a synchronous ajax call. My code is as follows.</p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-html lang-html prettyprint-override"><code><!DOCTYP... | 2 | 1,700 |
Infinite new window loop when triggering click event | <p>I have a overview page that shows the data in a table. A pop-up opens when the user clicks on the row. But the pop-up get's reloaded over and over again until it hangs.</p>
<p>The overview code: </p>
<pre><code><tbody>
<tr>
<td>
<a href="/pop-up/details/1/" onClick="MyWind... | 2 | 1,315 |
Why is my image not showing in the email? | <p>I have an ecard application that allows a user to pick an image and send an email. But I am not able to figure out how to send the email here is my code.</p>
<pre><code>protected void SendEmail()
{
StringBuilder message;
Attachment attachFile;
string sImage = System.Web.HttpContext.Current.Server.MapPat... | 2 | 1,074 |
NgbModal of ng-bootstrap is not working | <p>I have tried adding the modal box in my one of the page and for that i have gone through the document provided by the ng-bootstraphttps://ng-bootstrap.github.io/#/components/modal/examples</p>
<p>To achieve the modal dialog box i have written the code inside the components/invoice/modal
<a href="https://i.stack.img... | 2 | 1,392 |
Sending a long String over a Socket C++ | <p>I'm having a strange issue with some basic client <-> server communication using sockets. </p>
<p>The server packages an array of structs containing player information by dumping the data into one long string using an <code>ostringstream</code> object and some some simple formatting with newlines and spaces, the... | 2 | 1,052 |
Sending SOAP request with MessageCallback and MessageExtractor | <p>When sending a <code>SOAP</code> request through Spring's <a href="http://docs.spring.io/spring-ws/site/apidocs/org/springframework/ws/client/core/WebServiceTemplate.html" rel="nofollow"><code>WebServiceTemplate</code></a>, I would like to provide my payload and perform operation on both the request and the response... | 2 | 1,081 |
Overwriting the existing Worksheet of a Excel File in Perl | <p>With the reference to <a href="https://stackoverflow.com/questions/12026229/overwrite-the-existing-worksheet-in-perl">the question I had asked before</a> is:</p>
<p>My Code is as below:</p>
<pre><code> if ( !-e $xls_file ) #Checking whether to create a new Excel file or not
{
#if yes... | 2 | 1,635 |
Keycloak 8 for Angular 8 / Java app: get error "An error occurred, please login again.." when login. All Dockerized on vps with Nginx, ssl, https, dns | <p>Firstly, I inform you that i'm a junior developer. So I beg for your tolerance regarding to my question :)</p>
<p>What I'm trying to do is a simple prod POC with Keycloak for an Angular 8 frontend with a Java backend and a Postgres db. I'm using an OVH VPS, with Nginx / Certbot for the ssl and https management.</p>... | 2 | 6,800 |
How to show menu items in Toolbar in Fragment class? | <p>I have added a menu in my fragment and would like to display menu items in the toolbar. </p>
<p>the menu xml is as follows:</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
... | 2 | 1,426 |
Add text to input only if div has class `is-active` | <h1>Problem</h1>
<ul>
<li>Players that have not been selected, ie. do not have a class of <code>picked.is-active</code> should not be added to any of the input fields when they are clicked on</li>
<li>The maximum number of players that be be picked from each category is 2 out of 4 goalies, 6 of 15 defencemen and 12 ou... | 2 | 3,214 |
How do you access an attachment stored as MIME Part? | <p>It seems to me there are two ways to store an attachment in a NotesDocument.</p>
<p>Either as a RichTextField or as a "MIME Part".</p>
<p>If they are stored as RichText you can do stuff like: </p>
<p>document.getAttachment(fileName)</p>
<p>That does not seem to work for an attachment stored as a MIME Part. See ... | 2 | 1,509 |
python2.7 install python daemon package using pip | <p>When I try to install python <a href="https://pypi.python.org/pypi/python-daemon/#downloads" rel="nofollow noreferrer">daemon package</a> I get this error all the time (installation tried by using pip command & downloading the archive and using pip to install):</p>
<pre><code>pip install python-daemon-2.1.2.tar... | 2 | 1,208 |
Native crash in Android 7.0 | <p>I am seeing a lot of the below native crash which happens on Android 7.0 only. The affected devices are all from Samsumg. Any ideas what is causing this native crash or how can I debug it? Thanks.</p>
<pre><code>backtrace:
native: pc 000000000006bbd0 /system/lib64/libc.so (tgkill+8)
native: pc 0000000000069054... | 2 | 1,062 |
How to use unicode characters inside an SVG embeded as data uri in an image? | <p>Based on this SVG</p>
<pre><code><svg xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 -1463.5321025647136 1149.4431479097798 2427.064205129427"
style="width: 2.645ex; height: 5.568ex; vertical-align: -2.367ex; margin: 1px 0px;">
<defs id="MathJax_SVG_glyphs">
<path id="MJMATHI-7... | 2 | 2,373 |
Android multi stroke gesture not working | <p>I modified an existing app,GestureBuilder,to accept multiple strokes.Hence to accept the letter A,D, F and so on. I created a simple app which recognises if the letter is correct or not.My problem is:</p>
<p>1.I have successfully recorded multi stroke letter in a file called gesture with gestureBuilder.
2.My appli... | 2 | 1,659 |
Maven Jar Plug-In weird error NoClassDefFoundError: javá/nio/fiìe/FileStore | <p>The following error is received when trying to install a component.</p>
<p>What makes it weird is that the cause seems to be: <code>Caused by: java.lang.NoClassDefFoundError: javá/nio/fiìe/FileStore</code> written with those accents. Both <code>java -version</code> and <code>javac -version</code> return version 7 s... | 2 | 4,191 |
How can I make mobile bar not block the bottom of my page? | <p>I have tried everything. The body should not scroll as I run into issues with overscrolling on Safari iOS and Safari webapps (save to homescreen), so instead the main div "<code>#content</code>", has all the content with overflow scrolling.</p>
<p><strong>The problem</strong> is, when <code>#content</code>... | 2 | 2,313 |
Entity Framework Error - The cast to value type 'System.Int64' failed because the materialized value is null | <p>The below method fails when Execting ToListAsync() with the following error</p>
<pre><code>The cast to value type 'System.Int64' failed because the materialized value is null. Either the result type's generic parameter or the query must use a nullable type.
</code></pre>
<p>--</p>
<pre><code> private IQueryable&... | 2 | 1,237 |
how do I avoid the infinite loop when using the paramiko port forward demo? | <p>I need use port forwarding in Python to communicate with a remote MySQL DB through an SSH tunnel. I downloaded the paramiko package and tried out the port forwarding demo (forward.py). It works very nicely, but I am having trouble integrating it into my own scripts (similar to the one below). When the main forwardin... | 2 | 1,702 |
Cakephp saveAll continuously giving Array to string conversion error | <p>I am developing an Application using 2 models, Users and profiles.
when I am trying to editing both models at a time, I am getting continuously this error
<strong>Array to string conversion [CORE\Cake\Model\Datasource\DboSource.php, line 1006]</strong>
my <code>$this->request->data</code> array is in </p>
... | 2 | 1,043 |
HttpClient vs RestSharp: how to make the same call | <p>I can do the call with the RestSharp tool and i receive the right response, but can i do the same thing with HTTPClient call ? My problem is how to format the values to send in post. I try with :</p>
<pre><code>var values = new List<KeyValuePair<string, string>>
{
new... | 2 | 1,928 |
Spring Data Elasticsearch Bulk Index/Delete - Millions of Records | <p>I'm using Spring Data Elasticsearch 4.2.5, we have a job that does ETL (extract, transform and load data) to a particular database table. I'm indexing this data using Elasticsearch while the job is running. The data will be in millions of records and more. Currently, I'm doing index on every iteration. I read that, ... | 2 | 1,256 |
findstr match beginning of line | <p>I would like extract the Raw Value of a smartctl -a query.
Unfortunately, I can not make the findstr command so that the hit is only at the beginning of the line.</p>
<p>Here is the Example Output from smartctl:</p>
<pre><code>C:\>c:\Programme\smartmontools\bin\smartctl.exe -A /dev/hdb
smartctl 6.5 2016-05-07 r... | 2 | 1,470 |
How to get AppEngine map reduce to scale out? | <p>I have written a simple MapReduce flow to read in lines from a CSV from a file on Google Cloud Storage and subsequently make an Entity. However, <strong>I can't seem to get it to run on more than one shard</strong>.</p>
<p>The code makes use of mapreduce.control.start_map and looks something like this.</p>
<pre><... | 2 | 1,064 |
PHP Mail() attachment error and corrupt files | <p>I am trying to process an email in response to a submission. The email should grab a previously uploaded file and include it as an attachment. There are two problems occuring right now.</p>
<ol>
<li>I am receiving error messages on the page when the process runs to send the message. The errors are:
Warning: fil... | 2 | 2,270 |
Convert HTML table into a text file without losing format | <p>I am unable to find any post which has answer to my issue.</p>
<p>I have html file which has a table, need to convert this to a text file without losing the format USING php script, as it has to be printed as is on a dotmatrix printer.</p>
<p>OR if there is any other way of doing this, pl suggest !</p>
<p>The tab... | 2 | 2,046 |
UIImage cv::Mat conversions with alpha channel | <p>I'm using following codes for converting <code>UIImage*</code> and <code>cv::Mat</code> to each other:</p>
<pre><code>- (cv::Mat)cvMatFromUIImage:(UIImage *)image
{
CGColorSpaceRef colorSpace = CGImageGetColorSpace(image.CGImage);
CGFloat cols = image.size.width;
CGFloat rows = image.size.height;
cv::Mat c... | 2 | 2,127 |
How to deserialize date format in spring hibernate? | <p>i am writing a rest services where i am getting response as in format "1448994600000" for date but i need it to give response in date,month,year format.</p>
<p>if i send data by giving 12-2-2015 format it give me error</p>
<blockquote>
<p>The request sent by the client was syntactically incorrect</p>
</blockquo... | 2 | 1,230 |
react-modal is rendered at bottom of the screen | <p>I'm using react-modal in my app, but I can't easily get it to render on top of the current screen content. The modal always renders at the bottom of the screen (below the html body even). </p>
<p>This is my custom modal:</p>
<pre><code>import Modal from 'react-modal';
var SimpleModal = React.createClass({
ren... | 2 | 1,371 |
JSONException: Value .<!DOCTYPE of type java.lang.String cannot be converted to JSONObject error | <p>I have looked for solutions online on what I might be doing wrong but I am unable to find my mistake. The php works fine so am not sure what I am doing wrong. Please help! Here is my php.</p>
<pre><code> <?php
if($_SERVER['REQUEST_METHOD']=='GET'){
$Speciality = $_GET['Speciality'];
r... | 2 | 2,627 |
400 (Bad Request) or empty data when POSTing JSON string to RESTful WCF service in C# | <p>I got stuck sending data to a self hosted web service.
What I got so far:</p>
<p>The Service contract and implementation (btw. GET works like a charm)</p>
<pre><code>[WebGet( UriTemplate = "/gast/{customer_id}/{year}/{gast_id}", ResponseFormat = WebMessageFormat.Json )]
[OperationContract]
public acsEintrittGast G... | 2 | 1,599 |
Fragment no longer exists for key f0: index 0 | <pre><code>FATAL EXCEPTION: main
Process: com.riyadbankacademy, PID: 23795
Theme: themes:{default=overlay:system, iconPack:system, fontPkg:system, com.android.systemui=overlay:system, com.android.systemui.navbar=overlay:system}
java.lang.IllegalStateException: Fragment no longer exists for key f0: ind... | 2 | 1,185 |
does clickhouse have a memory leak issue? | <p>I set up a clickhouse server on a proxmox container with CentOS 7, and clickhouse version is 20.
I give the container 60G of RAM and made the clickhouse setting of limit memory to 30G.
I used a python's clickhouse_sqlalchemy to connect to it on another machine. When I start to give it some hard query, I notice it st... | 2 | 5,038 |
Cannot build Unity project from command line on fresh git cloned repository | <p>I am looking to build Unity project just after git cloning them. However when they are "fresh" (only not giignored files) the build is very short and has no output. I have to open once the project with Unity Editor to make the build command line working.</p>
<p>Build command line:</p>
<pre><code> D:/------/Unity.e... | 2 | 1,135 |
Issue with Camel route! (Very Frustrated) | <p>I have the following route:</p>
<pre><code> <!-- RC get projects -->
<route id="sqlRCprojects">
<setBody>
<constant>SELECT [No_] FROM [navview].[dbo].[job] WHERE [Project Director] = 'RC';</constant>
</setBody>
<to uri="jdbc:sql2005navview?readSize=0... | 2 | 5,980 |
compile constant memory array to immediate value in CUDA | <p>I am writing a code to approximate a function using power series and would like to exploit #pragma unroll and FMA instruction, like this:</p>
<pre><code>__constant__ double coeff[5] = {1.0,2.0,3.0,4.0,5.0}; /* constant is fake here */
__device__ double some_function(double x) {
double y;
int i;
y = coeff[0];... | 2 | 1,052 |
matlab histogram (with for loops) | <p>I'm doing an exercise where I have to plot the histogram of an image by reading each pixel's value. Then my idea is to loop through each color layers (r, g, b) and for each pixel store the value in a matrix. The following code runs but there it doesn't look right and I'm not totally sure why. First issue is that the... | 2 | 1,120 |
Referencing relative path resources from Android NDK manifest file | <p>I am currently having trouble including resources from the NDK manifest file and I am sure that it is a quick fix error. There are plenty of files that are shared between projects and operating systems in a large library. Therefore, in order to keep the files up to date with other projects and keep from updating ea... | 2 | 1,032 |
HLS NGINX-RTMP [error] 1281#0: *58 hls: force fragment split: 10.002 sec | <p>If you could shed some light for me i would appreciate it. </p>
<p>So, basically i am pulling a stream from my encoder and it works, i get the m3u8 output and it is accesible but the HLS video is jumpy and i lose frames. the play is not continuous.</p>
<pre><code>2017/06/12 16:04:09 [error] 1281#0: *58 hls: force ... | 2 | 1,192 |
how do i plot time on x-axis in canvas js chart? | <p>i have a values in date time format. I want to show the time on x-axis instead of date.</p>
<blockquote>
<p>{"dateTime":"2016-03-16
07:09:41","value":"41.0"},{"dateTime":"2016-03-16
07:09:43","value":"43.0"},{"dateTime":"2016-03-16
07:09:45","value":"45.0"},{"dateTime":"2016-03-16
07:09:47","value":"47.0"... | 2 | 1,931 |
Disabling button on a particular row in WPF gridview | <p>This is my code for generating the gridview </p>
<pre><code> User u1 = new User();
User u2 = new User();
for (int i = 0; i < files.Count; i++)
{
u1.Files = files[i];
items.Add(u1);
}
for (int i = 0; i < sharedFiles.Count; i++)
... | 2 | 1,160 |
Zurb Foundation Mobile version not showing on mobile phones | <p>So I have a site with Zurb Foundation, the css version along with my Play framework application(1.2.7). <strong>No Play code has been added yet</strong>. I have the basic layout of the site and it works perfectly on desktop. I resize the page on desktop and I can see the mobile version in action. All good. I deploye... | 2 | 2,691 |
React.useEffect: State not updating after axios request | <p>I am in the process of trying to convert a class Component into a functional component to leverage the <a href="https://reactjs.org/docs/hooks-state.html" rel="nofollow noreferrer">React.useState hook</a> and <a href="https://reactjs.org/docs/hooks-effect.html" rel="nofollow noreferrer">React.useEffect hook</a>. The... | 2 | 1,255 |
Draw shapes with mousemove, drag and drop and resize with kineticjs- KineticJS | <p>I am working on a simple paint program with KineticJS. What I have to achieve is to draw a rectangle, line or circle with mouse movement and the drawn shapes can be dragged or resized by mouse. My problem is, I have to use <code>mousedown</code> and <code>mousemove</code> event to do the drawing, but I cannot achiev... | 2 | 1,937 |
I'm not getting response in socket from flask server | <p><strong>I'm working on socket.io module in flask and I'm not getting a response in the socket after pressing yes, no or maybe button</strong><br>Here is my code<br><br>html code</p>
<pre><code>> <!DOCTYPE html>
> <html>
> <head>
> <script type="text/javascrip... | 2 | 2,681 |
Memoized Rod Cutting Algorithm | <p>I'm trying to implement memoized version of recursive rod cutting algorithm. Here is my code (I implemented it from Cormen's pseudo code)</p>
<pre><code>public class simpleMemoized {
//finds maximum of two given integers
public static int max(int a, int b) {
return (a > b) ? a : b;
}
p... | 2 | 1,122 |
Require... now exports is undefined, What am I missing here? | <p>Really like TypeScript, followed this supposed easy <a href="https://www.c-sharpcorner.com/article/quick-start-up-with-typescript/" rel="nofollow noreferrer">sample</a>, the last part "<strong>Export and Import concept</strong>", bang! First got "JavaScript runtime error: require is undefined". Google found I need t... | 2 | 1,505 |
Python 2.7 on Windows -- Too Many Open Files | <p>I'm running a script that is replacing german umlauts in file names. There are over 1700 files that I need to do this for, but I'm getting an error indicating that there are too many open files after the script runs for a while. Anyone have any ideas how to fix this? Feedback is greatly appreciated!</p>
<p>Code:... | 2 | 2,151 |
Bottom navigation bar listener not working | <p>So i just got started with android development a couple weeks ago, while trying to make navigation between two fragments with a bottom nav bar, for some reasons the click listener is just not working, no errors, no warnings, compiles no problem but it might be some logic problem? here's the code:</p>
<pre><code>clas... | 2 | 1,817 |
jQuery to get posts by ajax causes browser to crash | <p>I have a social networking site and on the main feed page I have written some jQuery so that as the user scrolls down when they get near the bottom of the page the next set of posts is retrieved with ajax and appended to the DOM. The browser gets slower after each ajax request though and by the 3rd or 4th one it cra... | 2 | 1,710 |
Javascript setting iframe src - proper format | <p>I have read the posts <a href="https://stackoverflow.com/questions/3705591/do-i-encode-ampersands-in-a-href">here</a> and <a href="https://stackoverflow.com/questions/3541711/javascript-url-encode">here</a>, but can't get the encoding right.</p>
<p>In javascript, I am writing a link to an <code><input></code>... | 2 | 2,921 |
Validating a Battleship board, 2d array, how to check possibilities for boards validity? | <p>writing a code in Java to validate a battleship board when given a 2d array with 1's and 0's where 1 is a part of a ship and the 0 is the sea.
here are the rules to know:</p>
<p>-There must be single battleship (size of 4 cells), 2 cruisers (size 3), 3 destroyers (size 2) and 4 submarines (size 1). Any additional sh... | 2 | 8,580 |
Spring Boot: getting query string parameters and request body in AuditApplicationEvent listener | <p>Spring Boot REST app here. I'm trying to configure Spring Boot request auditing to log each and every HTTP request that any resources/controllers receive with the following info:</p>
<ol>
<li>I need to see in the logs the exact HTTP URL (path) that was requested by the client, including the HTTP method <strong>and ... | 2 | 1,031 |
TEMPORARY TABLE doesn't exist, not created as expected? MYSQL | <pre><code>-- --------------------------------------------------------------------------------
-- Routine DDL
-- --------------------------------------------------------------------------------
DELIMITER $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `storage_choices_according_to_criteria`(
... | 2 | 2,452 |
How to loop and keep the output of each loop in r | <p>I have some code as per below. All I would like to do is to run this code for each of the columns in my dataframe and then keep the output somewhere (?another dataframe with associated column names).
I've tried creating a loop but keep on getting the error:</p>
<p>Error in (finalset_row_number[i] - 1):(finalset_row... | 2 | 1,163 |
jQuery Mobile custom select menu works in Mobile Safari, but not in UIWebView | <p>I am using <code>jQuery Mobile</code> in an application that runs inside a <code>UIWebView</code>. The applicaiton is written in <code>Monotouch</code> and has multiple tabs and one of the tabs shows <code>html5</code> content within a webview. <code>jQuery Mobile</code> allows the <code>html5</code> content to have... | 2 | 2,117 |
Using OnVif PullPoint Services with Zeep | <p>I'm having hard time in trying to subscribe to the OnVif pullpoint services in standard IP cameras.</p>
<p>The SOAP client I'm using is Zeep <a href="https://python-zeep.readthedocs.io/en/master/index.html" rel="nofollow noreferrer">https://python-zeep.readthedocs.io/en/master/index.html</a></p>
<p>It seems that Z... | 2 | 1,367 |
A dependent lookup field does not support relationships | <p>During feature activation of my SharePoint 2010 project, built and deployed using Visual Studio 2012, I receive this error:</p>
<pre><code>A dependent lookup field does not support relationships
</code></pre>
<p>I've played around a bit with the sequence in which items are listed within my feature files. Of the d... | 2 | 11,413 |
value in input text in JSP from result query | <blockquote>
<p>I have this index.jsp file where all the list of items is displayed and can
be updated >by clicking the item name:</p>
</blockquote>
<pre><code> <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.c... | 2 | 4,557 |
Sub-aggregate a multi-level nested composite aggregation | <p>I'm trying to set up a search query that should composite aggregate a collection by a multi-level nested field and give me some sub-aggregation metrics from this collection. I was able to fetch the composite aggregation with its buckets as expected but the sub-aggregation metrics come with <code>0</code> for all buc... | 2 | 1,923 |
Generating plots and saving automatically in R | <p>I created a list of title names and then modified a function i found <a href="http://www.r-bloggers.com/automatically-save-your-plots-to-a-folder/" rel="nofollow noreferrer"> here</a></p>
<pre><code>mcollist<-list(A,B,C,D)# where A,B,C and D are dataframes
namelist<-c("A","B","C",... | 2 | 1,187 |
Mocking moment.js react props with jest and enzyme | <p><strong>Say i have a child component that takes two moment objects as props such as:</strong></p>
<pre><code>import React from 'react';
import PropTypes from 'prop-types';
import moment from 'moment';
class ChildComponent extends React.Component {
constructor(props) {
super(props);
}
startAndE... | 2 | 1,575 |
How to create editable field in PDF using iText | <p>1) First I tried following.Below code is creates second column of the table editable,however I want to have values of myVO.getClientAuthorized() and myVO.getClientSize() also in second column in respective two rows,but with following code I am not getting any value in second column.</p>
<pre><code>public PdfPTable ... | 2 | 1,956 |
How to verify an HSQLDB's schema is correct before launching | <p>We are using hsqldb in our project and have things working well. We are currently configured to use an in-process file database, and our DriverManagerDataSource, LocalContainerEntityManagerFactoryBean, and TransactionManager are all instantiated as beans in our context XML file:</p>
<pre><code><bean id="databas... | 2 | 1,965 |
asp.net mvc onr-to-many details partial view in master main view | <p>I am sorry if im asking same thing for the nth time but i can not find the answer to my question...</p>
<p>I have problem adding partial views...</p>
<p>I have One-to-Many relation in the database tables.</p>
<p>My Model is:</p>
<pre><code> using System;
using System.Collections.Generic;
public partial class Jo... | 2 | 2,034 |
Editable tree view - changing type of editing field | <p>I have dictionary like this:</p>
<pre><code>{"key1": 1, "key2": 0, "key3": {"key": 1}, "dupa": None}
</code></pre>
<p>I would like to edit it as a tree view but I can't change <code>key1</code> to store a string. </p>
<p>I saw <a href="https://github.com/pyqt/examples/tree/master/itemviews/editabletreemodel" rel... | 2 | 3,966 |
pointers between c# and c++ - p/invoke | <p>hi im trying to call some c++ code from c#. So i followed several tutorials, amde my own dll, and now i call it from my c# wrapper. the thing is, i have a function that receives a pointer and i can't seem to make it work, visual studio just shows me red errors that i don't understand very well. can someone tell me w... | 2 | 1,323 |
Error in loop. ('The SQL contains 1 parameter markers, but 4 parameters were supplied', 'HY000') | <p>I have an issue with a loop. I have a loop as follows:</p>
<pre><code>for i in theList:
temp=process_query('SELECT FName, LName FROM Employee WHERE SSN=?', i)
known_hours=process_query('SELECT DISTINCT SUM(Coalesce(Hours,0)) FROM Works_On WHERE ESSN=?',(i))
</code></pre>
<p>where <code>theList</code> is d... | 2 | 1,774 |
Sympy fails, wxMaxima not | <p>I am trying to solve the following indefinite integral both with wxMaxima and sympy: </p>
<pre><code>integrate(r^2*sqrt(R^2-r^2),r)
</code></pre>
<p>In Maxima I do got an answer but not in sympy. I do not understand why. I am a heavy user of Python and will love to do symbolic math in Python, but since sympy did n... | 2 | 2,200 |
Second connection to Bluetooth device fails in Android | <p>I'm trying to establish a Bluetooth connection in Android 4.4 but the connect method of BluetoothSocket seems to be working strangely. My app can assume the device is already bonded, so I can connect via MAC address. The thing is that it connects perfectly and immediately the first time the device is bonded, but if ... | 2 | 3,481 |
setOnEditorActionListener not working for me | <p>I am just learning java/android and I have a problem with setOnEditorActionListener.</p>
<p>My problem is that the first time a webpage only load from clicking on the "Go" button and not from the done button on the keyboard. After the first time, the webpage can be loaded from the Done button on the keyboard.</p>
... | 2 | 3,313 |
Read data from json response | <p>I am developing an application with Delphi 10 Seattle.</p>
<p>I am trying to read a value of an item from JSON.</p>
<p>For example : </p>
<pre class="lang-json prettyprint-override"><code>{
"findCompletedItemsResponse":[
{
"ack":[
"Success"
],
"version":[
"1.13.0"... | 2 | 6,190 |
SVGs change size but won't animate on scroll transition | <p>I have a footer/row of SVGs I made, but they fail to animate during the transition between the 1st and 2nd Sections. The code is not simple to debug because this needs to animate with js controlling the size of a few elements. <strong>A number of brave users have come up with solutions that work in Chrome and Firef... | 2 | 3,346 |
Error A/libc: Fatal signal 11 (SIGSEGV) at 0x00000018 (code=1) in SkPath | <p>I am getting the following error when I tap on a button in my application:</p>
<pre><code>A/libc: Fatal signal 11 (SIGSEGV) at 0x00000018 (code=1), thread 11024
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000018
eax 00000000 ebx b7d117e8 ecx 00000001 edx b84242d8
esi b84242d8 edi 00000000
xcs 000000... | 2 | 1,045 |
How to list all items of an object in ionic 3? | <p>Personal maybe my question is not being too clear, but what I am trying to do is that by clicking on the Feed item in the categories screen, be listed all companies that are related to Feeding on the companies screen.</p>
<p>I'm very confused because as there will be several companies in each category I have no ide... | 2 | 1,063 |
How to get values from a Arraylist to Buttons? | <p>I'm trying to get random values from a <code>Arraylist</code> and then storing it in <code>Buttons</code>.
Every time when I run this code with the buttonListRbra my app crashes.</p>
<p><strong>Here is my code:</strong></p>
<pre><code> private void generateRandomNumbersRbra()
{
int rnd;
Random rand = new R... | 2 | 2,592 |
FFT implemetation in Verilog: Assigning Wire input to Register type array | <p>I am trying to implement butterfly FFT algorithm in verilog.
<img src="https://i.stack.imgur.com/y33GM.png" alt="DIT Butterfly Network" /></p>
<p>I create K(Here 4) butterfly modules . I create modules like this.</p>
<pre><code>localparam K = 4;
genvar i;
generate
for(i=0;i<N/2;i=i+1)
begin:BN
butterfly ... | 2 | 1,952 |
SwiftUI VStack spacing: not working properly | <p>I have a SwiftUI VStack that sits inside a scrollView, a Geometry reader and a NavigationView, here is the code:</p>
<pre><code>struct RezeptList: View {
@Environment(\.colorScheme) var colorScheme: ColorScheme
@EnvironmentObject private var recipeStore: RecipeStore
@State private var searching = fals... | 2 | 1,204 |
Singleton executor Java | <p>Hi i am trying to create executor for binrary file downloading, i have around 100-200 files to be downloaded and stored in disk.</p>
<p>This is my DownloadExecutor.java</p>
<pre><code>public final class DownloadExecutor {
private static DownloadExecutor executor;
private ExecutorService executorService;
p... | 2 | 1,045 |
How to prevent reload of Webview page | <p>I have created an app in which i have 3 tabs to display webpages using fragment. Every time i switch to tab 2 from tab 1 and then back to tab 1, tab 1 reloads. I have searched google and solutions which i found didn't work. So far i have tried this:</p>
<pre><code> @Override
public void onSaveInstanceState(Bundle o... | 2 | 2,153 |
How am I supposed to eagerly load an association using graphql-sequelize without `include`? | <p>I'm using graphql-sequelize to implement a GraphQL endpoint. I've just created a new secondary entity and associated it with one of my primary entities, and am now trying to include the related secondary when the primary is fetched. I get the following error when I try to implement that fetch:</p>
<pre><code>Assert... | 2 | 1,819 |
Arduino MQTT disconnect | <p>I have a ESP32 board with 2 relays and a DHT22 sensor and the bellow code in Arduino running on the ESP32</p>
<p>MQTT Broker is running on Pi4 with mosquitto and node-red dashboard.</p>
<pre><code>#include <WiFi.h>
#include <PubSubClient.h>
#include "DHT.h"
#define DHTTYPE DHT22
const char* ssid = "MY... | 2 | 1,932 |
syntax error, unexpected end-of-input, expecting end — my code is missing an 'end' and I cannot figure out why | <h1>Error</h1>
<p><a href="https://i.stack.imgur.com/w5xdU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w5xdU.png" alt="Error image" /></a></p>
<p>Error in text:</p>
<pre><code>D:/Projects/Web/RoR/ecommerce/app/controllers/search_controller.rb:46: syntax error, unexpected end-of-input, expecting e... | 2 | 2,222 |
Link inside a TailwindCSS group:focus element fails as click event prevented | <p>I have an FAQ section which has accordion type sprung sections, all made with TailwindCSS (i.e. no Javascript). Links inside open sections do not work (they just close the FAQ as the question looses focus).</p>
<p>Does anyone have any idea how i can get the link event to fire before the focus is lost?</p>
<p>Here's ... | 2 | 1,232 |
Android: ViewModel with paging 3 flow is leaking | <p>My problem is, that my <code>shopViewModel</code> which holds an instance of a <code>paging-flow</code> is somehow leaking. I've tried to solve this problem by converting the <code>flow</code> into a <code>livedata</code>, but that changed nothing.</p>
<h2>ViewModel</h2>
<pre><code>class ShopViewModel @ViewModelInje... | 2 | 4,816 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.