on-internet

nginx ssl_trusted_certificate directive not working

When I try to start the nginx server with this configuration I get an error nginx: [emerg] no ssl_client_certificate for ssl_client_verify My Configuration looks like # HTTPS server server { listen 4443; server_name localhost; ssl on; ssl_certificate /home/user/conf/ssl/server.pem; ssl_certificate_key /home/user/conf/ssl/server.pem; ssl_protocols TLSv1.2; ssl_verify_client optional; ssl_trusted_certificate /home/user/ssl/certs/certificate_bundle.pem; include conf.d/api_proxy.conf; } As per the error, I should use ssl_client_certificate directive but as per the documentation if I don't want to

Join the discussion →

org.h2.jdbc.JdbcSQLException: Connection is broken: "java.net.ConnectException: Connection refused: connect: localhost" [90067-193]

Can AnyOne tell me What wrong with my code HibernateConfig package com.app.EcommerceBackend.config; import java.util.Properties; import javax.sql.DataSource; import org.apache.commons.dbcp2.BasicDataSource; import org.hibernate.SessionFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; import org.springframework.orm.hibernate5.HibernateTransactionManager; import org.springframework.orm.hibernate5.LocalSessionFactoryBuilder; import org.springframework.transaction.an

Join the discussion →

From PyPi to Conda-Forge

I used cookiecutter to create a simple python package that I pushed to Pypi. Next I want to get the package into the Conda ecosystem and found the conda-forge channel really powerful. My only problem is that publishing to conda-forge requires a couple of manual steps including rewriting part of a meta.yaml file. Is there a better way to do this? My current approach: Create Conda Recipe (meta.yaml) using Conda Skeleton Fork Conda Forge Staged Recipes Manually edit some lines in the meta.yaml since conda skeleton recipe is slightly different than what is accepted by conda-forge. Create a Pull Re

Join the discussion →

How import and export components (functions) in ReactJS?

I'm trying to export and import components in my project, but i don't getting. My code of the my main App: import React, { Component } from 'react'; import './App.css'; import Search from './Search'; export default class App extends Component { constructor() { super(); const peoples =[{id:0, name:"Jean"}, {id:1, name:"Jaquinha"}, {id:2, name:"Ricardo"}, {id:3, name:"JaCA"}, {id:4, name:"Letiiicia"}, {id:5, name:"Dai"}, {id:6, name:"Da iIIane"}, {id:7, name:"Tamy"}, {id:8, name:"Tamyresss"}, {id:9, name:"Tamyres"}, {id:10, name:"Abeu"}, {id:11, name:"Abellll"}]; this.state = { elementsPerPage:3

Join the discussion →

echo php value into javascript onchange()

I have this html select form, I am using the onchange method to send and xmlhttp request. <select class="form-control form-control-sm" id="sizeselector<?php echo $row["id"]?>" name="sizes" onchange="showColors(<?php echo $row["id"];?>, item, size)"> <?php while($row1 = $result1->fetch_assoc()){?> <option value="<?php echo $row1["size"]?>"><?php echo $row1["size"]?></option> <?php}?></select> <div id="colorselector<?php echo $row["id"]?>"> <p>Text</p> </div> The above code works, but when I change it to get the actual values from the rows... onchange="showColors(<?php echo $row["id"];?>, <?php

Join the discussion →

How to fix concurrent modification exception in Kotlin

This is my code, in which I am adding data to a list: fun bindProcess(listOfDocId: MutableList<String>, isActvityLogEnabled: Boolean): Observable<MutableList<SearchResultModel>> { return Observable.create<MutableList<SearchResultModel>> { var filteredList =CopyOnWriteArrayList<SearchResultModel>()// mutableListOf<SearchResultModel>() val headerItem: SearchResultModel = SearchResultModel() headerItem.type = 0 headerItem.title = context.getString(R.string.top_matches_label) filteredList.add(headerItem) for (row in ContSyncApplication.getContacts()) { if (listOfDocId.contains(row.docId)) { val my

Join the discussion →

com.amazonaws.SdkClientException: Unable to execute HTTP request: Connect to dynamodb.ap-southeast-2.amazonaws.com:443

I am going through strange error, i am running spring boot locally and connecting to AWS Dynamodb, it returns below exception: EVENT>{"@timestamp":"2018-04-03T17:57:33.173+10:00","@Version":1,"message":"Error while creating connection with DynamoDB","logger_name":"com.DynamoDBRepository","thread_name":"http-nio-8080-exec-1","level":"ERROR","level_value":40000,"name":"xyz","apiVersion":"1","application":"xyz","version":"1.6.37","type":"ERROR"} com.amazonaws.SdkClientException: Unable to execute HTTP request: Connect to dynamodb.ap-southeast-2.amazonaws.com:443 [dynamodb.ap-southeast-2.amazonaws

Join the discussion →

How to shuffle an array of objects in javascript?

The code below works for a normal array but not with an array with object does anybody knows how to do this? const array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; function shuffle(array) { for (let i = array.length - 1; i > 0; i--) { let j = Math.floor(Math.random() * (i + 1)); let temp = array[i]; array[i] = array[j]; array[j] = temp; } return array; } const result = shuffle(array); console.log(JSON.stringify(result));

Join the discussion →

Mixed Content: The page was loaded over HTTPS, but requested an insecure image

I have a domain (let's call it Domain1 or https://img.{domain_name_1}.com) where I stored images for serving a wordpress staging website, which is currently hosted on a different server. For the latter I have only an IP public address (so not a real FQDN at the moment), let's call it Domain2 or https://99.999.999.999. On this server I installed a self-signed SSL certificate, just to encrypt the credential I use for phpMyAdmin and wordpress admin area. Meanwhile, Domain1 is SSL secured by Let's encrypt. I can access Domain1 by http or https indifferently, because I have a redirection from http

Join the discussion →

Resolve matrix differential equation with sparse matrix and ojAlgo

I am developping a java evolution tool with ojAlgo, and I try to resolve the following equation : where A is a sparse matrix (for now the dimension of the matrix is 2000 x 2000, it will be scaled later on), A is not symmetric and use only real values. I made some researchs and I tried to find the way to resolve this equation (using SparseStore) on github wiki/javadoc but I didn't find a way to do it. Can you help me find methods/class I should use ? Thank you

Join the discussion →

How to install a program from GitHub?

I am very new to GitHub. Recently I downloaded a program for printing in Sublime Text from GitHub. Here is the link: https://github.com/svenax/SublimePrint But after I downloaded the program called SublimePrint-master.zip, I don't know how to install it in windows. It doesn't look like there is a setup file or installation file after I unzipped SublimePrint-master.zip. Would anyone give me a hint how to install a program from GitHub? Many thanks.

Join the discussion →

Text adventure RPG in batch. General questions

So I decided to learn Batch and I'm trying to program a small RPG/adventure game that is narrative driven for the RPG snuffs at the office. So I'm having a few problems and have a few questions. @echo off color F0 title The Kingdom of Kovalor type Titlescreen.txt pause >nul goto MainMenu :MainMenu cls type mainmenu.txt echo. echo Type in option and press Enter. Set /p menu= if "%menu%" equ "new game" goto NewGame if %menu% equ credits goto Credits if "%menu%" equ "load game" goto LGame echo Try again. if %menu% neq new game goto MainMenu if %menu% neq credits goto MainMenu if %menu% neq load g

Join the discussion →

Gradle Sync Issue Kotlin after Android 3.1 Stable Update

Hey after updating Android Studio to 3.1 Stable version i am getting following error to all my projects. Any help will be appreciated. Could not download kotlin-reflect.jar (org.jetbrains.kotlin:kotlin-reflect:1.1.3-2): No cached version available for offline mode

Join the discussion →

Controlling swipe inputs in unity

I am practicing in Unity; I want to move an object to the right and left according to how I swipe. I have gotten the script so far but the problem occurs when I am playing it. It is setting the objects location to the center; swipe actions are working just fine. However, I don't want it to set the object to the center. Script: public class swipeTest : MonoBehaviour { public SwipeManager swipeControls; public Transform Player; private Vector3 desiredPosition; private void Update() { if (swipeControls.SwipeLeft) desiredPosition += Vector3.left; if (swipeControls.SwipeRight) desiredPosition += Ve

Join the discussion →

HTML & CSS Centering Text and Image Together

I'm getting into the field of web design, and for practice purposes, I'm trying to create responsive HTML and CSS websites modeled after real websites so I only worry about the development, not the design. As of now, I'm redesigning apple.com. My problem is that in the apple.com navigation bar, the Apple logo is consistently around an inch away from the links to other parts of the site. As you resize the browser, it stays around an inch away. The problem is that on my (unfinished) version of the site, the apple logo stays fixed in one position as you resize the browser. Here's my code: html {

Join the discussion →

Getting error E/MediaPlayer: error (1, -19) when trying to stop and play sound again

I have muliple buttons and on clicking them I want a sound. My code goes like this button.setOnClickListener(new Button.OnClickListener() { @Override public void onClick(View view) { if(mSound != null && mSound.isPlaying()){ mSound.stop(); mSound.reset(); mSound.release(); mSound = null; } mSound = new MediaPlayer(); mSound = MediaPlayer.create(getApplicationContext(), R.raw.button); mSound.start(); } }); In OnCreate, I have intitalized mSound like this, mSound = new MediaPlayer(); mSound = MediaPlayer.create(this, R.raw.button); I am getting error (1,-19) as well as (0,38). Note: This is not

Join the discussion →

PCA dimension reducion for classification

I am using principal component analysis on the features extracted from different layers of CNN. I have downloaded the toolbox of dimension reduction from here. I have a total of 11,232 training images and feature for each image is 6,532. So the feature matrix is like that 11232x6532. If I want top 90% features I can easily do that and training accuracy using SVM of reduced data is 81.73% which is fair. However, when I try the testing data which have 2408 images and features of each image is 6,532. So the feature matrix for testing data is 2408x6532. In that case, the output for top 90% feature

Join the discussion →

how to validate email using ruby on rails?

i want to validate email but i couldn't. is there method to validate? param[0] is email. if param[0] =~ Devise.email_regexp is not work. if param[0] =~ Devise.email_regexp {email: param[0], reason: I18n.t("user.error.invalid_email")}

Join the discussion →

videojs with hls plugin: how to limit retries

I use videojs and videojs-contrib-hls to play video in my website. When a video's m3u8 file is loaded successfully and the broswer failed to get one of the ts file, videojs will retry over and over again, with log like this: GET https://[my ts file url] 404(Not Found) VIDEOJS: WARN: Problem encountered with the current HLS playlist. Trying again since it is the final playlist. I want to listen to the error event and limit the retry. Which event(on the player or .tech().hls) should I listen to?

Join the discussion →

opencv_createsamples doesn't work correctly

I'm using opencv-3.3.1 on windows. I have a 'pos' file containing my positive images and a file called 'info.txt' which contains the address, number and the coordinates of object in positive images. In order to make a .vec file I use this command: opencv_createsamples -info info.txt -num 1000 -w 100 -h 100 -vec car.vec To test the vec file I use this command: opencv_createsamples -w 100 -h 100 -vec car.vec But the output of the command is not correct it's look like that the coordinates in vec file isn't correct. I have checked the info file several times and it is accurate.(but I have tried it

Join the discussion →

Python - Pyplot x-axis not showing on graph

pyplot is not showing the x-axis on the graph: import pandas as pd import matplotlib.pyplot as plt df = pd.read_csv('sitka_weather_2014.csv') df['AKST'] = pd.to_datetime(df.AKST) df['Dates'] = df['AKST'].dt.strftime('%b %d, %Y') df.set_index("Dates", inplace= True) # Plot Data fig = plt.figure(dpi=256, figsize=(14, 7)) plt.title("Daily high and low temperature - 2014") df['Max TemperatureF'].plot(linewidth=1, c='blue', label="Max Temperature °F") df['Min TemperatureF'].plot(linewidth=1, c='red', label="Min Temperature °F") plt.grid(True) plt.rc('grid', linestyle=":", linewidth=1, color='gray')

Join the discussion →

Renting a cab from Manali to Ladakh

I want to rent a cab from Manali to Ladakh this summer but I cannot find anything online where I can book a cab. Can anyone advise what the best way to reserve a cab is? Can hotels in Manali easily arrange it for us or is it easy to book on the spot in Manali?

Join the discussion →

How to format invalid xml in Notepad++?

I've got Notepad++ and XML Tools plugin. I want to know how can I format invalid code like this: aaa<a><z/></a> It should be formatted like this: aaa <a> <z/> </a> When I tried to use XML Tools plugin with this example obviously I receive this error: "Errors detected in content...". I saw it is possible, but I don't know how. What is the solution for this?

Join the discussion →

"failed to open stream: operation failed" when using FTP URL wrapper with file_get_contents [duplicate]

I want to echo a XML file from a FTP server. I have the following code: $contents = file_get_contents('ftp://'. urlencode('*myusername*') . ':'. urlencode('*mypassword*') . '@www.ms5awhosting.de/20180306_0000035.xml'); echo $contents; But I get the following warning: Warning: file_get_contents(ftp://[email protected]/20180306_0000035.xml): failed to open stream: operation failed in ... Has anyone got an idea what I'm doing wrong?

Join the discussion →

React Select with very large options lists

I have a select component that will need to handle around 7,000 options in it. I am running into two problems. 1) when typing into the search parameter things are loading too slowly. 2) I need to filter though all of the options and disable options that have previously been selected (from values I load from the database) or have just been selected on this page load. For problem number 1 I have tried to leverage https://github.com/bvaughn/react-select-fast-filter-options and it works on first page load. I run into issues whenever I try to modify the options in any way, as you will see I origina

Join the discussion →

How to Unpack-Pack MTK NVRAM.bin?

I am developing a MTK IMEI repair program in Android. In order to be successful I must edit MP0B_001 file located in NVRAM.bin Or NVRAM.img and then pack it again. This image showing NVRAM.bin contents (I don't know how they pack/unpack it) I searched a lot in Stack Overflow and XDA Developer and GitHub, but I found programs to unpack boot.img + logo.img + system.bin+Kernel+Recovery Images not NVRAM.bin I tested all this tools: I uploaded Lenovo-A319_nvram.bin for you to test: Download NVRAM

Join the discussion →

SQL Server Stored Procedure - Hotel Management System

I wanted to ask a question about how to use stored procedure instead of normal selecting stuff (e.g. select * from ... where ...), include the use of cursor. And also, I have created a type (servicePackage) to specify the name of each services (many service provided by the hotel). After that, I have to go through with the stored procedure part which is the code can be seen below: CREATE TYPE servicePackage AS TABLE (SERVICE_NAME CHAR(20)); CREATE PROCEDURE usp_createPackage -- INPUT PARAMETERS @ADVERTISEMENT_ID INT, @ADV_DESC VARCHAR(100), @START_DATE DATETIME, @END_DATE DATETIME, @PRICE DECIM

Join the discussion →
Older stories