title stringlengths 13 150 | body stringlengths 749 64.2k | label int64 0 3 | token_count int64 1.02k 28.5k |
|---|---|---|---|
Unclosed character class near index nnn | <p>I'm borrowing a rather complex regex from some PHP Textile implementations (open source, properly attributed) for a simple, not quite feature complete Java implementation, textile4j, that I'm porting to github and syncing to Maven central (the original code was written to provide a plugin for blojsom, a Java bloggin... | 0 | 1,304 |
Error in UseMethod("select_") : no applicable method for 'select_' applied to an object of class "NULL" | <p>I get a strange error when <code>knitting</code> this R Markdown into an HTML file. I think it has to do with some sort of incompatibility in the <code>dplyr</code> package with <code>knitr</code>.</p>
<p><strong>UPDATE: I replaced the <code>cbind</code> chunk with the <code>dplyr::bind_cols</code> command, as some... | 0 | 1,488 |
How to convert columns of data into z-scores? | <p>I have a tab separated text file containing several columns of data. I want to convert the values in each column into z-scores, so that I can better compare the distributions in each column. Does anyone know of a fast way to do this? I have been learning <strong>R</strong> and think that <strong>R</strong> probably ... | 0 | 1,048 |
Constructor ... is not applicable (actual and formal argument lists differ in length) - but it does match | <p>So i'm doing an assignment for school in java... It's a class hierarchy kind of assignment and we are supposed to make a "Triangle.java" class that extends a "ClosedShape.java" class which extends a "Shape.java" .... the ClosedShape and Shape are both given to us, so most likely nothing wrong with them (i'll post th... | 0 | 1,702 |
No podspec found for `FBLazyVector` after RN upgrade | <blockquote>
<p><strong>EDIT</strong>: the solution for me was to use my previous PodFile before upgrading, ios app is working now.</p>
</blockquote>
<p>I upgraded an RN app to 0.59.1 (it was at 0.57.8) using <code>react-native upgrade</code>,
android version is working but for the ios version i'm stuck with pod instal... | 0 | 4,260 |
Google Map Drawing freehand | <p><img src="https://i.stack.imgur.com/4Az4l.jpg" alt="enter image description here"></p>
<p>LATEST CODE - <a href="http://jsfiddle.net/YsQdh/88/" rel="noreferrer">http://jsfiddle.net/YsQdh/88/</a> -</p>
<p>THIS VERSION USES gDouglasPeuker to create a rudamentary polygon shape from the drawn version - <a href="http:/... | 0 | 1,418 |
$http POST request with AngularJS post's my data to server but fails with error message "not allowed by Access-Control-Allow-Origin" | <p>I am literally scouring the internet looking for ways to find the right approach to post my data to server using AngularJS.</p>
<p>When I do a $http POST request with Angular JS it post's my data to server but fails with error message "Origin <code>http://localhost:8000</code> is not allowed by Access-Control-Allow... | 0 | 2,000 |
connect: cannot assign requested address | <p>I have the following error message from a Go app in Docker:</p>
<pre class="lang-sh prettyprint-override"><code>panic: failed to connect to `host=localhost user=postgres-dev database=dev`: dial error (dial tcp [::1]:5432: connect: cannot assign requested address)
</code></pre>
<p>which appear in the environment of... | 0 | 1,113 |
NHibernate one-to-many mapping problem | <p>I have to map two simple table with a foreign key relationship. One of the tables is <strong>Contact</strong> containing columns <strong>id</strong> (primary key of type int),<strong>name</strong>, <strong>address</strong> and <strong>guid</strong> (newly added and is not the primary key). The other one is <strong>p... | 0 | 1,238 |
How to enable LHLS in FFMPEG 4.1? | <p>I am trying to create a low latency CMAF video stream using FFMPEG.
To do so, I would like to enable the <code>lhls</code> option in FFMPEG in order to have the <code>#EXT-X-PREFETCH</code> tag written in the HLS manifest.</p>
<h3>From the FFMPEG doc :</h3>
<p><a href="https://www.ffmpeg.org/ffmpeg-all.html" rel="... | 0 | 2,325 |
How to ensure three DIV are the same height regardless of content | <pre><code><div class="section group">
<div class="col span_1_of_3 articleTeaserBoxColor">
<div class="test2n">
<div class="imgHolder"><img id="NewsArticle_2790_image" class="imgArtThumb" title="" alt="" src="artOne.png" /></div>
<div class="textHolder">
... | 0 | 1,677 |
Error while parsing XML file with StAx | <p>I wrote a xml parser with StAx that I use to parse XML streams received from the server.Here is my code : </p>
<pre><code>private Map<String, IUnitaryAction> parse(InputStream is) throws XMLStreamException {
XMLInputFactory factory = XMLInputFactory.newInstance();
XMLStreamReader reader = factory.cre... | 0 | 2,241 |
How to implement transaction in Spring Data Redis in a clean way? | <p>I am following RetwisJ tutorial available <a href="http://docs.spring.io/spring-data/data-keyvalue/examples/retwisj/current/" rel="noreferrer">here</a>. In this I don't think Redis transactions are implemented. For example, in the following function, if some exception occurs in between, the data will be left in an i... | 0 | 1,182 |
How to easily listen for xhr requests with Javascript? | <p>I am working on a Firefox extension and I want to know when a page initiates a xhr request, I saw a few codes but they were pretty big, is there any simple sample to achieve this?</p>
<p>I am testing this code :</p>
<pre><code>function TracingListener() {
//this.receivedData = [];
}
TracingListener.prototype ... | 0 | 2,947 |
websockets with Tomcat 8 and Spring 4 ClassCastException before handler is invoked | <p>I am trying to get a simple websocket to work to integrate into my application. However I have not been able to get it to work with the Spring API's, with a ClassCastException somewhere before my handler is invoked trying to convert a Tomcat type to a javax object. If I just use Tomcat directly without Spring (so th... | 0 | 1,840 |
WebSocket connection establishment error from browser | <p>I have mosquitto MQTT broker running on my machine. And I want to run the MQTT client from browser. This is what I have done in a Django app:</p>
<pre><code><html>
<head>
<title>Mosquitto Websockets</title>
{% load staticfiles %}
<meta name="viewport" content="width=device-w... | 0 | 1,722 |
How to handle multithreading in simple cash deposit withdraw program | <p>My instructor said to use multi-threading for update an account management system. Given below is a rough idea of the system.
<img src="https://i.stack.imgur.com/Z5vBv.png" alt="enter image description here"></p>
<p>Here is my source code for it. </p>
<p><strong>Account class</strong></p>
<pre><code>public class ... | 0 | 1,233 |
What is the reason of this error java.io.IOException: Content-Length and stream length disagree | <p>I am getting this error</p>
<pre><code> java.io.IOException: Content-Length and stream length disagree
</code></pre>
<p>on this line of code <code>return response.body().bytes();</code></p>
<p>this is full code </p>
<p>edit: after some google the reason of the error is from <a href="https://github.com/sq... | 0 | 2,008 |
Failed to read schema document 'http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd | <p>I'm writing a simple Swing app for university and using Hibernate and Oracle XE.</p>
<p>I'm stuck with that error:</p>
<pre><code> 29.06.2011 14:54:10 org.hibernate.cfg.annotations.Version <clinit>
INFO: Hibernate Annotations 3.3.1.GA
29.06.2011 14:54:10 org.hibernate.cfg.Environment <clinit>
INFO: ... | 0 | 1,395 |
exclude weekends in javascript date calculation | <p>I have two sets of codes that work. Needed help combining them into one.</p>
<p>This code gets me the difference between two dates. works perfectly:</p>
<pre><code>function test(){
var date1 = new Date(txtbox_1.value);
var date2 = new Date(txtbox_2.value);
var diff = (date2 - date1)/1000;
var diff = Math.abs(... | 0 | 1,067 |
The getter 'bodyText2' isn't defined for the class 'TextTheme' in flutter | <p>When I import <code>flutter_linkify/flutter_linkify.dart</code> package in my flutter project, I got this error in my console:</p>
<pre><code>Launching lib\main.dart on CRO U00 in debug mode...
Running Gradle task 'assembleDebug'...
Compiler message:
/C:/src/flutter/flutter/.pub-cache/hosted/pub.dartlang.org/flutt... | 0 | 1,190 |
Resizing images using php | <p>I'm using a neat little php script to resize my images to fit in a 300x300 pixel square, while keeping the aspect ratio. I got the script from <a href="http://www.white-hat-web-design.co.uk/blog/resizing-images-with-php/" rel="noreferrer">here</a>.</p>
<p>Here is the whole script:</p>
<pre><code><?php
/*
* Fil... | 0 | 1,850 |
Clickable TableRow on Android | <p>I have a simple program i have made in java for android but am having difficulty in making the tablerow clickable. When the user clicks a row i wish for a certain picture to be displayed in the imageview below. Here is my xml code:</p>
<pre><code> <?xml version="1.0" encoding="utf-8"?>
<TableLayout xml... | 0 | 3,050 |
Entity framework throws exception while executing UPDATE statement | <p>I have an EF6 powered program that crashes on an UPDATE statement, when running for the first time.
I tried renaming the columns via data annotations (I didn't test fluid API, since it should result in the same database). I also looked at the class visibilities, but they didn't change since the last time the program... | 0 | 10,691 |
Fail of org.apache.maven.plugins goal execution | <p>I'm trying to generate a war file using maven but i'm getting this error (most of downloading log output is omitted to make log more clear):</p>
<pre><code>Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-war-plugin/2.1.1/maven-war-plugin-2.1.1.pom
Downloaded:
...
[INFO] ... | 0 | 1,425 |
android and sqlite-has 5 columns but 4 values were supplied | <p>I copied an example of sqlite use from somewhere. They defined 5 columns and I change it to 4 columns.
The relevant part is here:</p>
<pre><code> private final String DB_NAME = "mcustomerDbName";
private final String TABLE_NAME = "mcustomeTableName";
SQLiteDatabase customersDB = null;
/** Called whe... | 0 | 1,539 |
terminate called after throwing an instance of 'std::logic_error' what(): basic_string::_S_construct null not valid | <p>I have been trying to read cfg into a multilinklist but im getting this error please someone help. It keeps on giving this error. I dont think there's any error. Please check this code and tell me where is the error which causes the program to crash with the exception attached in the picture</p>
<hr>
<blockquote>
... | 0 | 2,299 |
Go & Socket.io HTTP + WSS on one port with CORS? | <p>Brand new to Go.. Still obviously learning the syntax and the basics.. But I do have a specific goal in mind..</p>
<p>I'm trying to just get a simple server up on :8080 that can respond to both HTTP and socket.io (via <code>/socket.io/</code> url), specificaly with CORS.</p>
<p>My code:</p>
<pre><code>package mai... | 0 | 1,521 |
CMake to build shared object .so files in linux | <p>Task -> Run Cmake to generate dll in windows and shared object(.so files) in linux. </p>
<p>I am porting code from windows to linux . I have made the required changes in source code. I have tried changing the CMakeLists.txt files but when I tried to do make it complains of "Cannot find source files". May you guys... | 0 | 1,076 |
User Authentication with Grape and Devise | <p>I have difficulties to understand and also properly implement <strong><em>User Authentication</em></strong> in APIs. In other words, I have serious problem to understand the integration of Grape API with front-end frameworks such as Backbone.js, AngularJS or Ember.js. </p>
<p>I'm trying to pivot all different appro... | 0 | 3,140 |
Gradle doesn't run tests | <p>In my Gradle project I have a very simple JUnit test: </p>
<pre><code>import org.junit.jupiter.api.Test
import static org.junit.jupiter.api.Assertions.fail
class ApiCallerTest {
@Test
void testSetApiKey() {
fail();
}
}
</code></pre>
<p>When I run the test in IntelliJ, I get a list of tasks wi... | 0 | 1,392 |
exploiting Buffer Overflow using gets() in a simple C program | <p>I am new to Buffer Overflow exploits and I started with a simple C program.</p>
<p><em><strong>Code</strong></em></p>
<pre><code>#include <stdio.h>
#include <strings.h>
void execs(void){
printf("yay!!");
}
void return_input (void)
{
char array[30];
gets(array);
}
int main()
{
... | 0 | 2,028 |
Tensorflow on windows - ImportError: DLL load failed: The specified module could not be found | <p>I'm using Anaconda 3.1.0 on Windows 7 64 bit. I have installed tensorflow(GPU). I am getting errors while running following command.</p>
<p><code>>>> import tensorflow as tf</code></p>
<p><strong><em>The complete traceback</em></strong></p>
<pre><code> (tensorflow) C:\windows\system32>python
Python... | 0 | 2,131 |
How to test for a broken connection of TCPClient after being connected? | <p>I've been fighting with one problem for a whole 3 days I can't find any solution, please help :)<br>
I work with Visual Studio 2010 and C# language.</p>
<p>I have a device working like a server, that sends some data in a very irregular periods of time (not possible to define any read timeout).<br>
I wrote a TCP cli... | 0 | 3,776 |
How to remove elements from XML using Python | <p>I got stuck with XML and Python. The task is simple but I couldn't resolve it so far and spent on that long time. I came here for an advice how to solve it with couple of lines.</p>
<p>Thanks for any help with traversing the tree. I always ended up with too many or too few elements. Elements can be nested without l... | 0 | 1,126 |
Rolling LogBack - Failed to create parent directories for: [c:\var...] | <p>I just cloned this project, did the maven update, but I'm not able to run the log. And as I have a problem accessing the database, I need to know what's going on, but I can't create the log</p>
<p>through the log file it should automatically create, or not?</p>
<p>Apparently the system cannot find the file where t... | 0 | 2,245 |
ConstraintLayout Barrier not working properly when parent dimensions are set to wrap_content | <p>Here's a reproduction of my issue:</p>
<pre class="lang-xml prettyprint-override"><code><?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent&quo... | 0 | 1,286 |
NullPointerException: with ActionBar.setDisplayHomeAsUpEnabled(boolean)' on a null object reference | <p>I get this nullPointerException on runtime:</p>
<blockquote>
<p><em>Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.app.ActionBar.setDisplayHomeAsUpEnabled(boolean)'
on a null object reference</em></p>
</blockquote>
<p><strong>code from mainActivity:</strong></p>
<pre... | 0 | 2,999 |
Exception :com.sun.jersey.spi.inject.Errors$ErrorMessagesException | <p>I am using the Jersey API for the web services. I am sending the multipart data from client to server. I am getting exception when web services start to execute.</p>
<pre><code>@POST
@Path("uploadphoto")
@Consumes(MediaType.MULTIPART_FORM_DATA)
@Produces("text/plain")
public String uploadNotices(@FormDataParam("fil... | 0 | 2,308 |
Map a PostGIS geometry point field with Hibernate on Spring Boot | <p>In my PostgreSQL 9.3 + PostGIS 2.1.5 I have a table <code>PLACE</code> with a column <code>coordinates</code> of type <code>Geometry(Point,26910)</code>.</p>
<p>I want to map it to <code>Place</code> entity in my Spring Boot 1.1.9 web application, which uses Hibernate 4.0.0 + . <code>Place</code> is available with ... | 0 | 1,723 |
OpenGL: creating my own camera | <p>I'm trying to create a camera to move around a 3d space and am having some problems setting it up. I'm doing this is Java, and apparently using gluPerspective and gluLookAt together creates a conflict (the screen starts flickering like mad).</p>
<p>gluPerspective is set like this:</p>
<pre><code>gl.glMatrixMode(GL... | 0 | 1,406 |
NavLink exact prop not working for react-router-dom 6 | <p>I am currently using</p>
<pre><code> "react-router": "^6.0.0-beta.0",
"react-router-dom": "^6.0.0-beta.0",
</code></pre>
<p>The problem with NavLink of react-router-dom that i am facing now is that the root path "/" is always active, other paths are of no prob... | 0 | 1,071 |
command line tools for new 10.9 OSX for ruby gems? | <p>After installing OSX Mavericks 10.9 demo, Im getting this after running bundle</p>
<pre><code> Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/sandric/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
extconf.rb:17: Use RbConfig instead of obsolete and deprecated Conf... | 0 | 1,519 |
nodejs error: spawn ENOENT | <p>I am very newbie with nodejs, I am trying to run it:</p>
<p>I obtain:</p>
<pre><code>events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
</code></pre>
<p>H... | 0 | 2,536 |
How do I display the results of a JavaScript function in HTML? | <p>I am writing a program to display the grade based on the user input. However, when I press "Submit" after entering all the input correctly, nothing happens. I think my onclick function is incorrect. Additionally, how do I display what the user inputted on the HTML page as well? Thank you. EDIT: Thank you for all the... | 0 | 1,208 |
Serializing Entity Relation only to Id with JMS Serializer | <p>I'm trying to serialize a entity relation with JMS Serializer.</p>
<p>Here is the Entity:</p>
<pre><code>class Ad
{
/**
* @Type("string")
* @Groups({"manage"})
*
* @var string
*/
private $description;
/**
* @Type("Acme\SearchBundle\Entity\Country")
* @Groups({"man... | 0 | 1,380 |
Okhttp response callbacks on the main thread | <p>I have created a helper class to handle all of my http calls in my app. It is a simple singleton wrapper for okhttp that looks like this (I have omitted some unimportant parts):</p>
<pre><code>public class HttpUtil {
private OkHttpClient client;
private Request.Builder builder;
...
public void ge... | 0 | 1,330 |
Unable to start springboot app - Resource location must not be null | <p>Tried springboot for the first time but I am unable to get it to start.
I used the sample app: <a href="https://github.com/spring-guides/gs-spring-boot.git" rel="noreferrer">https://github.com/spring-guides/gs-spring-boot.git</a>
I also made modifications to use an embedded jetty instead of tomcat but still no succe... | 0 | 2,004 |
Remain in same page even after submitting jsp form | <p>I'm using a jsp to post data to a servlet, but after posting the data i want to stay back insame jsp.
Briefly:
1) I have a jsp here with 2 textboxes. i use a javascript to copy data from one to another on a button click.
2) I use the same button to post data to a database.
3) I want both the actions to be done a... | 0 | 1,072 |
AngularJS - Show and Hide multiple content | <p>In AngularJS, to simply show a field through an a tag, I would do in this way:</p>
<pre><code><div ng-show="aField">Content of aField</div>
<a ng-click="aField=true">Show aField</a>
</code></pre>
<p>until here, no problem.
I would like now to put more buttons and fields so that, whe... | 0 | 1,078 |
Show N rows per page in HTML table | <p>Hello I have an html table with a lot of rows and I use a JavaScript code to add a pagination option, works fine but when I load the document shows all the rows and I want to show only 5, 10, or whatever but not all the rows. Here is my JavaScript code and the working Fiddle:</p>
<pre><code> $(document).ready(funct... | 0 | 1,100 |
year and month only datepicker angularjs and bootstrap | <p>i have problem i want to use datepicker from date to date(check in and check out with months not days) and it should be with months ,the problem is: i have template but it show me the the day and the year and the month , what i want is just month and year </p>
<p>this what i get and i want just months and year
<a ... | 0 | 1,338 |
Parse JSON with optional field | <p>I'm trying to parse in android studio a JSON, that containts this : </p>
<pre><code>"stops":
[
{
"num": 1,
"time": "2016-04-27T06:15:00.000Z",
"title":"Flight to London",
"desc":"Barcelona BCN-London-Gatwick LGW",
"type":"0",
"subtype":0
},
{
"num... | 0 | 1,665 |
ContextLoader - Context initialization failed | <p><strong>Unable to Start the deployed war file.
I got the following error at the terminal</strong></p>
<pre><code>[ERROR] 17:23:17 ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in resource loaded fro... | 0 | 13,531 |
kubeadm init shows kubelet isn't running or healthy | <p>I am trying to run Kubernetes and trying to use <code>sudo kubeadm init</code>.
Swap is off as recommended by official doc.</p>
<p>The issue is it displays the warning:</p>
<pre><code>[kubelet-check] It seems like the kubelet isn't running or healthy.
[kubelet-check] The HTTP call equal to 'curl -sSL http://localh... | 0 | 3,367 |
JSF action from onChange | <p>I'm trying to set up a data table with JSF that has boxes for row total that will sum the row total onChange of any box in the row. the row looks like: </p>
<pre class="lang-html prettyprint-override"><code><tr id="input_row_1">
<td id="mondayInput1">
<h:inputText id="monday1" size="4" value="#{t... | 0 | 1,192 |
Apple Mach-O Linker (id) Error - undefined symbols for architecture i386 | <p>I know this type of error has been raised many times before, but I have not found solution of my error. I am using xcode 4.0. I downloaded ASIHTTPRequest zip and copied classes folder along with two files of 'Reachability". After compilation, it is giving me strange errors which I can't figure out. Below I copied te... | 0 | 1,079 |
How to make a user control draggable on screen like a window | <p>My WPF application has a <code>UserControl</code> which is supposed to look and behave like a popup window, but it isn't a window. The reason the control doesn't descend from the <code>Window</code> class is because it contains a third-party virtual on-screen keyboard, and that control has to be in the same window ... | 0 | 1,629 |
Quitting app causes error "Message from debugger: Terminated due to signal 9" | <p>I'm writing a basic music player app but having some problems when it comes to handling the app state transitions.</p>
<p>I'm using Swift 3 and MPMusicPlayerController.systemMusicPlayer()</p>
<p>The goal is this:</p>
<p>1) Keep music playing when user taps the Home button and app enters bg (works)</p>
<p>2) Stop... | 0 | 1,487 |
Alternate newline character? python | <p>I am looking for a way to represent '\n' with only one character. I am writing a program that uses dictionaries to 'encrypt' text. Because each character is represented in the dictionary, i am having a problem when my program gets to a '\n' in a string, but reads it as '\' 'n' . Is there alternate way to represent a... | 0 | 3,111 |
How to get a popup box after submitting a form? | <p><strong>[SOLVED]</strong> Thanks everyone that replied.</p>
<p>I've got a PHP script that is run after a user submited a contact form.
This script shows a message in the top left corner saying if it worked properly or if it encountered a problem.</p>
<p>Now my question is, how can I put those messages into a popup... | 0 | 1,152 |
Bootstrap 3 Togglable Tabs not working | <p>I'm writing a mobile app using phonegap and bootstrap using the main navbar to switch between my view or tab however the togglable list (example <a href="http://getbootstrap.com/2.3.2/javascript.html#tabs" rel="nofollow">here</a>) doesn't seem to work. Does anyone know how to fix this? </p>
<pre><code><!DOCT... | 0 | 2,228 |
getting start and end time in java | <p>i want to get the value of startTime and endTime from java gui to database. </p>
<p>ComputerSeats class</p>
<pre><code>import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.TimeZone;
public class SeatMonitoringDesign extends JF... | 0 | 3,922 |
Oracle Calling a job with arguments | <p>I have a stored procedure parse_data which takes 3 arguments which are all NUMBER. I have created a program with three arguments and then a job that will run the stored procedure. The code looks like this:</p>
<pre><code>BEGIN
dbms_scheduler.create_program(program_name => 'PARSE_PROGRAM',
... | 0 | 1,305 |
Is Jackson's @JsonSubTypes still necessary for polymorphic deserialization? | <p>I am able to serialize and deserialize a class hierarchy where the abstract base class is annotated with </p>
<pre><code>@JsonTypeInfo(
use = JsonTypeInfo.Id.MINIMAL_CLASS,
include = JsonTypeInfo.As.PROPERTY,
property = "@class")
</code></pre>
<p>but no <code>@JsonSubTypes</code> listing the subclasses... | 0 | 2,297 |
could not autowire field spring-boot | <p>Need some help, I am just starting to learn Spring and can't seem to figure out what us wrong:</p>
<p>Application.java - no package</p>
<pre><code>@Configuration
//@ComponentScan({"com.mapping","com.accesors","com.controllers"}) --Originaly tried this
@ComponentScan(basePackageClasses={UserDAO.class,Root.class,Use... | 0 | 1,338 |
How to import .json config to environment.ts and consume api using Angular? | <p>I want to import a Json file which is in assets folder where I have below urls:</p>
<p><strong>config.json:</strong></p>
<pre><code>{
"url1": "https://jsonplaceholder.typicode.com/posts",
"url2" : "https://reqres.in/api/users",
"url3":"http... | 0 | 1,176 |
Flexbox margin-top: auto not pushing item to bottom | <p>I have want the UL to push to the bottom of the container for each item. I have margin-top:auto set for the item but it is not working. I have another demo that works but this is the one that I need to use. Any help? </p>
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="fa... | 0 | 3,140 |
Efficient 4x4 matrix vector multiplication with SSE: horizontal add and dot product - what's the point? | <p>I am trying to find the most efficient implementation of 4x4 matrix (M) multiplication with a vector (u) using SSE. I mean Mu = v. </p>
<p>As far as I understand there are two primary ways to go about this:</p>
<pre><code> method 1) v1 = dot(row1, u), v2 = dot(row2, u), v3 = dot(row3, u), v4 = dot(row4, u)
... | 0 | 1,102 |
Cannot add two numbers correctly without using parseFloat in JavaScript | <p>I came across this problem. It adding numbers using parseFloat or parseInt.
IF textbox1 value is 4 and textbox2 value is 2 then i got output as (see script)</p>
<p>My doubt is why in <strong>addition</strong> alone </p>
<blockquote>
<p><code>parseFloat($('#txt1').val()) + parseFloat($('#txt2').val())</code></... | 0 | 1,437 |
Build an ASCII chart of the most commonly used words in a given text | <h2><strong>The challenge:</strong></h2>
<p>Build an ASCII chart of the most commonly used words in a given text.</p>
<p><strong>The rules:</strong></p>
<ul>
<li>Only accept <code>a-z</code> and <code>A-Z</code> (alphabetic characters) as part of a word. </li>
<li>Ignore casing (<code>She</code> == <code>she</code> ... | 0 | 1,998 |
Zend Framework 2 Service in View Helper | <p>I need to write a view helper that gets a service and do something with it. I successfully implemented the view helper to have access to the service locator. The problem is that the service I want to get is not being found through the service locator when the __invoke method is called.</p>
<p>The view helper code:<... | 0 | 1,034 |
Android: How to create EAP wifi configuration programmatically? | <p>I know how to create Open/WEP/PSK/PSK2 configuration programmatically.</p>
<p>ex.</p>
<pre><code>WifiConfiguration conf = new WifiConfiguration();
conf.SSID = "ssid";
conf.preSharedKey = "\"password\"";
conf.status = WifiConfiguration.Status.ENABLED;
conf.allowedAuthAlgorithms.set(WifiConfiguration.AuthAl... | 0 | 1,287 |
Stop ScrollView from setting focus on EditText | <p>Android's ScrollView (when scrolled or fling'd) likes to set the focus of an EditText when it's one of it's children. It happens when you scroll and then release. Is there anyway to stop this behavior? I've tried nearly everything I can think of and everything I've read on StackOverflow. Nothing has worked for me. B... | 0 | 1,277 |
Uncaught ReferenceError: exports is not defined | <p>I am trying to use webpack to babel and package my web-app (React + ES6). However whenever I run the webpack-dev-server and hit the page I get <code>bundle.js:1 Uncaught ReferenceError: exports is not defined</code> What am I doing wrong?</p>
<p>Here is my webpack configuration:</p>
<pre><code>var webpack = requir... | 0 | 1,602 |
Couldn't find User with id= (ActiveRecord::RecordNotFound) | <p>With my rails app I can successfully create an object (called work; think of them as blog posts) as current_user. A user has_many works. I can validate that the object is created successfully by checking the database using my postgresql browser. The table also holds the correct user_id that created the work so I kno... | 0 | 1,190 |
how do i stop multiple user login with same email and password once user already logged | <p>i need help how do i stop multiple user login with same email and password once the user already logged into the website i have website but in my website i have two kinds of membership subscription <code>free or paid</code> free users can try to login from multiple device's or pc's or browsers no problem with free u... | 0 | 2,305 |
HTTP Status 500 - java.lang.ClassNotFoundException: org.apache.jsp.index_jsp | <p>I made a JSP-Project in Eclipse (with Tomcat 7) but when I run the page, i get an ClassnotFoundExcption.</p>
<p>in my Project i work with Controllers to bind Data to the JSp with , i have a Controller, a Service and a Data-Object -> dbChanges</p>
<p>I hava already "google'd" my Question and didnt find anything.</p... | 0 | 2,836 |
How to repaint a jpanel every x seconds? | <p>i would like to know how to repaint and update the background of a JPanel every x seconds...This is my code:</p>
<pre><code>package view;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ImageIcon;
i... | 0 | 1,883 |
Scale font-size based on parent DIV's dynamic width/height (jQuery) | <p>Open to using: <strong>jQuery</strong> / <strong>Javascript</strong> / <strong>PHP</strong> / <strong>CSS3</strong> / <strong>HTML5</strong></p>
<p>What I'm trying to achieve is <strong>dynamically change the font-size of a child element based on its parent div's width & height</strong>. The parent div resizes ... | 0 | 1,492 |
Jenkins Build fails with SVNException | <p>I am trying to run a jenkins build. The below is my configuration.</p>
<p>Jenkins Version : 1.445<br>
Deployment : as a WAR<br>
Java : 1.7 (Server 64 bit)<br>
Tomcat Ver : 7.0.23</p>
<p>It gives the following error:</p>
<pre><code>Started by user jenkins-admin
Updating https://myrepo.mycompany.com/svn/repos/myrep... | 0 | 1,456 |
Builder pattern vs. config object | <p>The builder pattern is popular to create immutable objects, but there is some programming overhead to create a builder. So I wonder why not simply using a config object.</p>
<p>The usage of a builder would look like this:</p>
<pre><code>Product p = Product.Builder.name("Vodka").alcohol(0.38).size(0.7).price(17.99)... | 0 | 1,058 |
SEVERE: A message body writer for Java class java.util.ArrayList and MIME media type application/json was not found | <p>I am testing RESTful services and when I execute I am getting exceptions although I have the following jars in my class path(WEB-INF/lib), I am not using Maven and my JDK version is 1.5. Other questions regarding this issue didn't help to resolve the problem.</p>
<p>Code snippet</p>
<pre><code>@GET
@Produces("appl... | 0 | 1,739 |
Encryption and Decryption in C# using MD5CryptoServiceProvider | <p>I have a service named CryptoService which inherit the interface ICryptoService that consist of 2 method Crypto Decrypto function. </p>
<p>Encryption of a string is Working but the Decryption of hash result will return my key instead of the Decrypted string.</p>
<p>Here is my encryption code : </p>
<pre><code>pr... | 0 | 1,152 |
Streamline VBA to Change shape color on click in excel | <p>I have a ‘form’ that contains set of questions on a worksheet (note this is not a userform and I don’t want to use one).
Some answers are yes/no, others have multiple answers such as quantity (ie and the answer may be 1 or 2 or 3 or 4 etc).</p>
<p>The design of the ‘form’ on this worksheet calls for these answers ... | 0 | 1,190 |
Change Bootstrap's select border-radius | <p>I am not able to change the border-radius for the select elements in Bootstrap 3. I tried changing some other attributes like background-color or border-color, those worked for me. The only style that doesn't work is the border-radius.
I don't know what I'm doing wrong.</p>
<p>HTML:</p>
<pre><code><div class="c... | 0 | 1,092 |
How to add section separators / dividers to a ListView? | <p>I'm currently making a menu for my app, using a DrawerLayout and an ArrayAdapter subclass to achieve something looking like Facebook's drawer menu.</p>
<p>I currently have no problems creating the list, but now that it looks good, i'd like to add separators between different kind of options (i.e. user-related and a... | 0 | 1,035 |
How do I create a parent-last / child-first ClassLoader in Java, or How to override an old Xerces version that was already loaded in the parent CL? | <p>I would like to create a parent-last / child-first class loader, e.g. a class loader that will look for classes in the child class loder first, and only then delegate to it's parent ClassLoader to search for classes.</p>
<p><strong>Clarification:</strong></p>
<p>I know now that to get complete ClassLoading seperat... | 0 | 1,129 |
JPA/Hibernate detached entity passed to persist | <p>new to JPA and hibernate, so please bear with me as I try to draw up a whole pic. So I have two Java objects that have bidirectional relationship. Employee class is the owning class and Department class is the inverse side of the relationship. A department can have many employees and a employee can have only one dep... | 0 | 1,743 |
Expressjs response as JSON and Xml | <p>What i am doing:: I am trying to generate json and xml output for a dataset from database</p>
<p><strong>Express Code</strong>:: Here i am trying for JSON response </p>
<pre><code>var express = require('express')
, async = require('async')
, http = require('http')
, mysql = require('mysql');
var xml = req... | 0 | 1,918 |
Multiple row selection with checkbox in JTable | <p>I have a JTable with checkbox as one of the column. I also have a checkbox in header to check/uncheck all.
AFAIK the default behaviour of JTable is it deselects all the rows selected before if select a new row. But can we achieve CTRL click like behavior with checkbox. That retaining the previously selected row.
The... | 0 | 2,500 |
Python: Convert utf-8 string to byte string | <p>I have the following function to parse a utf-8 string from a sequence of bytes</p>
<p>Note -- 'length_size' is the number of bytes it take to represent the length of the utf-8 string</p>
<pre><code>def parse_utf8(self, bytes, length_size):
length = bytes2int(bytes[0:length_size])
value = ''.join(['%c' % b... | 0 | 1,153 |
Sun as a light source using opengl and c++ | <p>I am working on the solar system and I am trying to get the sun to be the central light source of this program but it's not working the way I thought it would.</p>
<p>Here is a picture of what I have without lighting.
<img src="https://i.stack.imgur.com/cQZTY.jpg" alt="enter image description here"></p>
<p>Here is... | 0 | 1,479 |
IPv6 raw socket programming with native C | <p>I am working on IPv6 and need to craft an IPv6 packet from scratch and put it into a buffer. Unfortunately I do not have much experience with C. From a tutorial I have successfully done the same thing with IPv4 by defining </p>
<pre><code>struct ipheader {
unsigned char iph_ihl:5, /* Little-endian */
... | 0 | 2,379 |
how to prevent GC_CONCURRENT statements in Logcat | <p>I have a requirement that I need to check the no.of lines in the File 'A' and if File 'A' exceeds my limit then I need to copy its contents into other file 'B' and then clear the contents of file 'A'.</p>
<p>The above task I have to execute all the times So , I constructed "Service" to do this task. (I want to run ... | 0 | 1,324 |
How to install Pillow on termux? | <p>I am using Termux for quite a while now and would like to install "Pillow" library on it. Whenever I try to install Pillow using "pip" it shows me the below errors.<br />
At first I thought I need to upgrade pip, but it did not help. I have also cleared caches, to no avail.</p>
<p><strong>Error</... | 0 | 6,260 |
Flutter: Java uses or overrides a deprecated API | <p>I've been trying to use the auth, firestore firebase in an Android / IOS flutter application, and have been experiencing many different issues, after testing several different versions. Now it's showing me several messages in the build log.</p>
<p>build log</p>
<blockquote>
<p>Note:
D:\Flutter\SDK\flutter.pub-... | 0 | 3,207 |
Spring Boot Error: java.lang.NoClassDefFoundError: org/springframework/util/Assert | <p>I am new to Spring Boot and following some video tutorials to get started. I created a Maven project, added a parent dependency of artifact id <code>spring-boot-starter-parent</code>, added dependency for <code>spring-boot-starter-web</code> and <code>spring-boot-starter-test</code>. This is the <code>Application.ja... | 0 | 1,213 |
Node.js express.json middleware not parsing request as expected | <p>I have a simple cURL (i think this is right) that posts a small JSON object to my express server:</p>
<pre><code>curl -d "{'test': 'this'}" localhost:3000/rest/user/authenticate
</code></pre>
<p>I have express set up as:</p>
<pre><code>// set up body parsing in express to be able to get parse JSON posts
server.... | 0 | 1,294 |
C# console application talking to Arduino via Bluetooth | <p>Not a whole lot to say here other than this doesn't work, and I have no idea why.</p>
<p>The serial output on the Arduino is nothing. The output on the C# code goes down to waiting for a response and then nothing.</p>
<p>The Bluetooth card LED on the Arduino goes green when I start the C# program so there is a con... | 0 | 1,170 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.