on-internet

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 →

angular flex layout grid system

I want to make the screen like the attached image, but getting some issues. My code is working fine for Small devices and Large devices, but for Medium devices, it's not working fine. So can anyone look into my code and help me to solve this issue? Actually, I am a little confused with the Flex layout grid system. It's very easy to achieve this in Bootstrap, but I want the same in Flex Layout. <div fxLayout="row" fxLayout.sm="column" fxLayout.xs="column" fxLayoutAlign.lg="start center" fxLayoutAlign.xs="center center" fxLayoutAlign.sm="center center"> <div fxFlex="25%" fxFlex.md="50%" fxFlex.s

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 →

Error sending emails with Mailgun using Laravel

I am trying to send an invitation email to my Laravel Web App, in which some parameters also have to be passed. Im not able to send an email and guess the problem is not with my configuration. Can someone help me on this? This is my form to send the invitation to an email: {!! Form::open(['method'=>'post', 'action'=>'AdminUserController@store']) !!} <input type="hidden" name="is_active" value="0"> <input type="hidden" name="house_id" value="{{Auth::user()->house->id}}"> <input type="hidden" name="role_id" value="2"> <div class="form-group' has-error' : '' }}"> <div class="col-md-6"> {!! Form::

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 →

Getting "Exception UnexpectedAlertPresentException: Alert Text: None" and then "Exception NoAlertPresent" when I try to handle that alert

We're doing automation scripts using the following: behave==1.2.5 splinter==0.7.7 firefox headless browser When navigating to a specific page, we're executing the following code: browser = context.browser selector_button_checkout = "//*[@id='cart']//div[contains(@class, 'button button-3 localizejs') and text()='CHECKOUT']" with browser.get_iframe(0) as iframe: assert iframe.is_element_present_by_xpath(selector_button_checkout, wait_time=30) We're getting this error: packages/selenium/webdriver/remote/errorhandler.py", line 237, in check_response raise exception_class(message, screen, stacktrac

Join the discussion →

Phaser texture atlas wrong dimensions

I was using spritesheets in my game, but I had come to a problem, that I wanted my character to duck (to dodge bullets). I found out that I can use texture atlas. Based on what I have read, I thought, that this approach will resize the sprite, based on its current animation. So when I would duck, the sprite would change its height, because the frame for ducking is less high that the frame for standing. I load the atlas like: game.load.atlasJSONHash('player', '../assets/images/player/player.png', '../assets/images/player/player.json'); I can see that the dimensions in the json are right, that t

Join the discussion →

ElasticSearch Multi Match with Multiple Query Parameters

We have the following multi match query in Elastic Search { "query": { "bool": { "must": { "multi_match": { "query": "90803", "type": "cross_fields", "fields": [ "POSTAL_CODE^5", "ADDRESS", "CITY" ], "operator": "and" } } } }} How can we pass multiple query parameters. For e.g. we want to pass multiple ID in the query to match against the field Postal Code.

Join the discussion →

Mapster mapping issue. Mapping a list of objects to a list of strings

I am trying to map a service model to a view model using Mapster. My service model contains a list of strings. My View Model contains a list of type RolesViewModel. RolesViewModel has a string property named RoleName. Below are my models public class UserViewModel { [Display(Name = "Email address")] [Required(ErrorMessage = "The email address is required")] [EmailAddress(ErrorMessage = "Invalid Email Address")] public string Email { get; set; } public List<RolesViewModel> Roles { get; set; } = new List<RolesViewModel>(); } public class RolesViewModel { public RolesViewModel(string roleName) {

Join the discussion →

How to import jQuery in a React component?

My JS file containing jQuery (apiCalls.js): function getBlogInfo() { $.ajax({ url: "http://api.tumblr.com/v2/blog/myblog.tumblr.com/info?api_key=my-api-key", dataType: 'jsonp', success: function(info){ console.log(info); console.log(info.response.blog.likes); } } )} export { getBlogInfo }; My React component: import React, { Component } from 'react'; import $ from 'jquery'; import { getBlogInfo } from './scripts/apiCalls'; class Homepage extends Component { componentDidMount(){ getBlogInfo(); } render() { return ( <div className="homepage"> </div> ); } } export default Homepage; If I replace t

Join the discussion →

How do I connect to DB2 via ibm_db python package

I'm trying to connect with an on-prem DB2 database via python but have been unsuccessful over the past few days. I am hoping the community can help me decipher error messages and offer help from their experience. My goal is to install the Python ibm_db library on my Windows 7 laptop and connect to our DB2 instance I cannot get the ibm_db.connect() method to recognize system DSN or user DSN that are known good (I use them to connect to DB2 via Sql Server Management Studio (SSMS)) I get the below errors from various connection combinations (shown below) but I have not found any reference that sa

Join the discussion →

Accessing a decoded JSON data structure

I am trying to extract a specific entry from this JSON using Perl { "sentences": [ { "index": 0, "tokens": [ { "index": 1, "word": "盧旺達", "originalText": "盧旺達", "lemma": "盧旺達", "characterOffsetBegin": 0, "characterOffsetEnd": 3, "pos": "NN", "ner": "PERSON" }, { "index": 2, "word": "援助", "originalText": "援助", "lemma": "援助", "characterOffsetBegin": 3, "characterOffsetEnd": 5, "pos": "NN", "ner": "O" } ] } ] } I would like access to tokens and then to ner, I have been trying to use this code but it doesn`t return anything $json = decode_json $json_string; my $tokens = $json->{"sentences"}->{"tok

Join the discussion →

How to avoid the "Windows Defender SmartScreen prevented an unrecognized app from starting warning"

My company distributes an installer to customers via our website. Recently when I download via the website and try to run the installer I get the warning message: Windows protected your PC Windows Defender SmartScreen prevented an unrecognized app from starting. Running this app might put your PC at risk. If I right-click on the installer and choose Properties I note the following: Our installer is signed. How do I find the reason for the Windows Defender SmartScreen warning? I have not managed to find any log file for Windows Defender nor found anything in the Event Viewer.

Join the discussion →

how to align a slider (input type range) with the text to its right for its value?

What would be the simplest way to align a slider with the value of the slider which is on its right? Without using external library. Just using HTML5? Do I need to use CSS for this? How? updateTextInput('0'); function updateTextInput(val) { document.getElementById('amount').value = val; //update current slider value // do other action here } <input type="range" id="rangeInput" name="rangeInput" min="0" max="100" value="0" step="1" oninput="updateTextInput(this.value);"> <output name="amount" id="amount" for="rangeInput">0</output> When running the above, the output (on Chrome on windows looks

Join the discussion →

gradient boosting- features contribution

Is there a way in python by which I can get contribution of each feature in probability predicted by my gradient boosting classification model for each test observation. Can anyone give actual mathematics behind probability prediction in gradient boosting classification model and how can it be implemented in Python.

Join the discussion →

Making dark themed inputs for Bootstrap 4

TL;DR - how can I nest validation states using a SASS mixin? Long version - I'm having a few difficulties using Bootstrap 4's SASS to generate a dark theme. Some variable replacements are obvious, but others are causing issues. The one I am currently stuck on is form inputs. Bootstrap's SASS will spit out white-background inputs by default. I override this background with a variable I have collected, and set the border to be 50% of the body's text colour (it will have contrast still, but not be stark). At the time of compile (which is a dynamic process handed over to the back end), the compile

Join the discussion →

Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.4.0.RELEASE:repackage failed: Unable to rename

I am trying to build a JAR file out of a spring project. When I try to do a maven install, it throws me the following error Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.4.0.RELEASE:repackage (default) on project ABC: Execution default of goal org.springframework.boot:spring-boot-maven-plugin:1.4.0.RELEASE:repackage failed: Unable to rename 'ABC-0.0.1-SNAPSHOT.jar' to 'ABC-0.0.1-SNAPSHOT.jar.original' -> The 'pom' file is as shown below <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http:

Join the discussion →

use pagination with react-bootstrap table

I am building a basic react app using create-react-app and react-bootstrap. I am using a table to show information using from react-bootstrap https://react-bootstrap.github.io/components/table/. I am trying to get pagination working for the table and I am not sure how to get around it to work with table. Following is a code snippet of my component, I have added the pagination code-piece from react-bootstrap which just displays the pagination footer at the bottom but doesn't actually paginate the results. App.js import React, { Component } from 'react'; import Table from 'react-bootstrap/lib/Ta

Join the discussion →

Swagger requesting credentials non of them is accepted

I am receiving this pop up, http://localhost:8080/swagger-ui.html. First i thought it is a password for my database or to my GIT. However non of the above is accepted. package com.gabor.usermanagment.configs; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import springfox.documentation.builders.RequestHandlerSelectors; import springfox.documentation.service.ApiInfo; import springfox.documentation.service.Contact; import springfox.documentation.spi.DocumentationType; import springfox.documentation.spring.web.plugins.Docket; impor

Join the discussion →

Laravel Auth::attempt 302 Found

I am a new to Laravel. I'm trying to write a login example but it shows "302 Found" error. web.php ( Route file ) : Route::post('login', array( 'uses' => 'UserController@doLogin' )); Route::get('logout', array('uses' => 'UserController@doLogout')); Route::group(['middleware' => 'AuthMiddleWare'], function () { Route::get('/form', function () { return view('form'); }); Route::get('/createUser', function () { return view('users'); }); Route::get('logout', array( 'uses' => 'UserController@doLogout' )); }); "doLogin" function codes which located in UserController: public function doLogin() { $rule

Join the discussion →

Adding index to points in ggplot

I have a basic plot, with a small number of points on. I would like to label the points with a numeric index, and then have the full description of the point in the legend. These is commonly seen on maps, as shown in the following example: However, there seems to be no built-in function within ggplot to add an index. Here is a MWE of the basic concept: df <- data.frame(x = 6:10, y = 6:10, id = 1:5) df$label <- paste0("Label", df$id) library(ggplot) # Basic plot ggplot(df, aes(x, y)) + geom_point() + geom_label(aes(label = id), nudge_x = 0.2) What I have tried so far is to map the index label t

Join the discussion →

Get the size of the output zip file using NodeJs

I'm using NodeJs (expressJs) and archiver module to stream zip file to the client, so the final ZIP file do not existe in server storage (streaming zip serving), but the probleme is that i can't get the size of the output file because the zip process happen in real time. Code : var archiver = require('archiver'); var files = ["file1","file2"]; var zipper = archiver('zip'); zipper.on('error', function(err) { res.status(500).send({ error: err.message }); }); res.attachment('output.zip'); res.setHeader('Content-Type', 'application/zip'); zipper.pipe(res); files.forEach(f => { zipper.file(f, { nam

Join the discussion →

Why Chrome can't inspect nodejs code in Docker container?

I try to start simple nodejs server inside Docker container and debug it with chrome://inspect or WebStorm. Debugging port 9229 is binded but inspection not works. On the other hand when I run same code without docker i can inspect it in chrome://inspect and in WebStorm both well. Can anybody explain me why Chrome can't inspect nodejs code in Docker container??? Dockerfile FROM node:8.2.1-alpine WORKDIR /code COPY package.json /code/package.json RUN npm install && npm ls RUN mv /code/node_modules /node_modules COPY . /code EXPOSE 8000 EXPOSE 9229 CMD ["npm", "run", "start"] alexey@home:~/app$

Join the discussion →

Enviar JavaScript por email

Eu tenho um código em C# que manda emails com HTML, até aí ok, o problema é que eu não consigo mandar scripts(JS). Sim, entendo porque,deve ser motivos de segurança. Mas não tem como burlar ou fazer de outra forma? -- Sem nenhuma intenção maliciosa. Meu código: using (MailMessage mail = new MailMessage()) { mail.From = new MailAddress("[email protected]"); mail.To.Add("[email protected]"); mail.Subject = "xxx"; mail.Body = @"<script>SCRIPT aqui.</script>"; mail.IsBodyHtml = true; using (SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587)) { smtp.Credentials = new NetworkCredential("[email protected]",

Join the discussion →
Older stories