on-internet

How to implement dropdown menu in React JS using Material UI?

I have a dropdown which has a nested menu as shown below. The dropdown upon expanding shows two options: The problem is upon clicking any of the items the children options under Tenant Name or Dealer ID display for a second and disappear. How to solve this problem and next is how to store values which the user selects? My code is as follows: export default class DropDownMenuSimpleExample extends React.Component { constructor(props) { super(props); this.state = { dropDownData: [ { value: '', tenantName: '', dealerId: '', }, ], }; } handleChange = (event, index, value) => { this.setState({ value

Join the discussion →

How can I allow angle "<>" brackets when including a Bazel header?

My project is transitioning to Bazel from CMake and I am including a snapshot of Abseil by checking it into a third_party/ top-level directory within our repository. I need to support both build systems during the transition, so I created CMakeLists.txt files and noticed that quite a lot of warnings need to be disabled for the Abseil headers to compile. For CMake, this okay because I can include the headers where I use them by using the #include <absl/strings/str_cat.h> syntax. This tells my compiler that it's a system header and to ignore the warnings so I don't have to disable them globally.

Join the discussion →

sass not updating changes on save

I'm using sass on windows and applied sass --watch through cmd. it is giving css output initially, but not detecting and updating any changes that I'm making in .scss file. This is what I'm doing. I've style.scss in which I'm making changes and each time I've to apply sass --watch style.scss:style.css to convert it into style.css. sass version : 'sass 3.5.1 (bleeding edge)' ruby version : 'ruby 2.4.2p198' where I'm making mistake?

Join the discussion →

How to reduce dimensions of an image feature vector (560 dimensions) for Elasticsearch

I am working on an image search engine. I use an algorithm to extract features from images and get a 560 dimensions float vector. This dimension is too high for Elasticsearch to index, Elasticsearch will be very slow. So I want to reduce dimensions of the feature vector. One approach I am thinking is to hashcode a series numbers, for example, hash 20 numbers in a row as one hash value, so dimensions is 28, which is reasonable to Elasticsearch. The problem is that I do not find any theory to support my solution. Is there a proved solution to solve this problem?

Join the discussion →

how to reduce dimension of image feature vector(560 dimensions) for elasticsearch

I am working on an image search engine. I use an algorithm to extract features from images and get a 560 dimensions float vector. This dimension is too high for elasticsearch to index, es will be very slow. So I want to reduce dimensions of feature vector. One approach I am thinking is to hashcode a series numbers, for example, hash 20 numbers in a row as one hash value, so dimensions is 28, which is reasonable to ES. The problem is that I do not find any theory to support my solution. Is there any proved solution to solve this problem? Thanks in advance.

Join the discussion →

Custom Strikethrough CSS

I want to change the behaviour of the "del" HTML tag, such that it overlays a diagonal slash on each character. This could be done with a bitmap graphic, a colour gradient, placing a "/" character over each previous character, or something else, but hopefully not using javascript. Is this possible?

Join the discussion →

Steps to restore one table from impdp in oracle 10g

I need to import only one table from a full backup (expdp) to a newly create table on the same database. So can i import the table directly with a new name? or i have to create a new table first with the same parameters then import? impdp hr DIRECTORY=dpump_dir1 DUMPFILE=expschema.dmp TABLES=hr.employees REMAP_TABLE=hr.employees:emps Another question will remap_table effect my already exist employees table? or it will only create a new table called emps and import the data of employees from the dump to it? ...................... Update ...................... I found that there is no remap_tabl

Join the discussion →

cannot implicitly convert type 'system.net.http.httpresponsemessage' to 'system.web.httpresponse'

I am creating a web service in visual studio 2015 using MySQL databases. I want implement only a GET method using HTTP. Now when I am doing it I cam accross and error. Which is cannot implicitly convert type 'system.net.http.httpresponsemessage' to 'system.web.httpresponse' The point where it comes is below public HttpResponse Get() { try { return Request.CreateResponse(HttpStatusCode.Found, mEntities.meters_info_dev.ToList()); } catch (Exception) { return Request.CreateErrorResponse(HttpStatusCode.NotFound, "No Data found"); } } Below is the image I couldn't find the solution for it. Any help

Join the discussion →

json path in mariadb

currently using mysql 5.7 I can execute the following query accessing a json field in the database: select myData->'$[0].dataflow' from flowtable limit 1; If I try the same query on MariaDB it does not work, is there any solution to this problem? I thought MariaDB was fully compatible with mysql and what would it be the correspondent MariaDB syntax? cheers

Join the discussion →

deploy jar file using Jenkins

How to deploy a jar file using Jenkins deployment jobs? Is there any specific plugin available for jar deployments. For War or EAR, we can go to Jenkins_deployment Jobs >> Post-build Actions >> Deploy war/ear to a container - and provide the below info. WAR/EAR files, Context path, Containers Can anyone please help in this?

Join the discussion →

How to HTML post with authorization token and JSON arguments in VB.NET

I'm creating a VB.NET program that I'd like to interface with dropbox. I'm starting with the "list_folder" command which will return the contents on a specified path. Here is the URL where you can play with the command: https://dropbox.github.io/dropbox-api-v2-explorer/#files_list_folder The HTTP request syntax provided is as follows: POST /2/files/list_folder Host: https://api.dropboxapi.com User-Agent: api-explorer-client Authorization: Bearer HBNBvdIls8AA12AAFTvyzhNJrdwwpQcswxpRVjmwRIJANPIea7Jc1Ke Content-Type: application/json { "path": "/Backups" } What I'm trying to do is the equivalent

Join the discussion →

Building a 3 column vector results in a 157 column vector instead?

In my for loop I am trying to build a vector from local variables. But something weird is happening. When I build my vector I expect it to contain 3 doubles (1x3). But instead it contains hundreds doubles (1x1XX). What the heck is going wrong? Am I misunderstanding m's scope or vector building? for i=0:ncols for j=0:nrows ... roi = imcrop(img, [cx, cy, cw, ch]); %Extract 3 channels red = roi(:,:,1); green = roi(:,:,2); blue = roi(:,:,3); %Get most frequent colour [freqR, f, c] = mode(red); [freqG, f, c] = mode(green); [freqB, f, c] = mode(blue); freqR = double(freqR) / 255; freqG = double(freq

Join the discussion →

Secure flag not set to Cookies in .Net application

I have included below lines of code in my Web.Config and Global.asax.cs file. Still when I use developer tools in browser I could see secure flag not set to the below Cookies. Also Configured SSLSettings in my IIS(Selected checkbox requireSSL). I would like to set Secure attribute to all Cookies not only to received but also to Sent cookies. Any suggestion please. In Web.config: <httpCookies requireSSL="true"/> In Global.asax.cs: protected void Application_EndRequest(object sender, EventArgs e) { if (Request.IsSecureConnection == true && HttpContext.Current.Request.Url.Scheme == "https") { Req

Join the discussion →

Selenium execution stops when screen is locked

I can execute my Selenium scripts without any issues if the screen is not locked. As per our organization policy, our system will be locked automatically after 3 minutes of inactivity (but system will never sleep or hibernate). The problem is that the test execution stops because of NoSuchElementException sometimes after the screen is locked. This exception occurs randomly on different elements after the screen is locked. So I cannot run my tests unattended I guess. Selenium test should run without any problem regardless the screen is locked. I run the tests on Google Chrome on Windows machine

Join the discussion →

Netbeans 8.2 won't run the project

i'm new at java language. I try to make my first program that refer from Youtube. but when i click "run" button, it won't work. I don't know why but all the build or the code is successful. Maybe i have some little some mistake there..(?) Can anyone help? enter image description here

Join the discussion →

Open file(Video) from external storage in local html (WebView) from assets folder? (Android)

I'm using web project with VR functionality implemented via A-frame and three.js to display VR/360 content with some additional functionality, the whole web project is located in assets folder, and successfully displays 360 images/videos from project directory (HTML is "source src="./default.mp4" type='video/mp4; codecs="avc1.42E01E, mp4a.40.2"'). Target is to replace video source with URI from device external memory (downloads directory for example). I've tried to use URI's in following formats : Android standard : file:///storage/emulated/0/Download/Trafalgar_Square_360.mp4 URI formats found

Join the discussion →

Supervisor FATAl Exited too quickly (process log may have details(About inet_http_server and unix_http_server)

I wrote a Django project and I use supervisor with gunicorn /etc/supervisor/conf.d/weather.conf [group:weather_station] programs=site [program:site] directory=$PROJECT command=/home/nhcc/.local/bin/gunicorn -c /$PROJECT/weather_station/gunicorn.conf.py -p gunicorn.pod weather_station.wsgi autostart=true autorestart=true stdout_logfile=/var/log/supervisor.log environment=my-environment-variable ~ sudo supervisorctl reread sudo supervisorctl reload sudo supervisorctl status It showed up the error weather_station:site FATAL Exited too quickly (process log may have details) So I checked out the lo

Join the discussion →

User ID in Cognito

I use AWS API Gateway + AWS Cognito (Federated Identity + User Pool). I'm creating REST API in API Gateway. There are methods for getting users list and for getting user by id. What should I use as user ID? Response should contain te following user data: ID, username, first name, last name etc. Username, first name, last name are stored in User Pool attributes. I see in examples that they use cognitoIdentityId as User ID. If I will use cognitoIdentityId as ID, then how should I get user data by this ID? Please give me an example or link to API reference how to get user data by cognitoIdentityI

Join the discussion →

Find and plot peaks/maxima

How can I plot the 'peak' (local maxima) in Matlab/Octave? My below code loads in an image, extracts the red channel and attempts to find and plot the local maxima but it fails with the error: error: findpeaks: DATA must be a vector of at least 3 elements Here is my simple code: pkg load image; pkg load signal; i = imread('foo.jpg'); % Get red channel red = i(:,:,1); % Attempt to find and plot peaks findpeaks(red); % Error on the above line: error: findpeaks: DATA must be a vector of at least 3 elements

Join the discussion →

Java Read/Write Excel - Error : The constructor XSSFWorkbook(FileInputStream) is undefined

I am trying to read data from an excel file, i am using the following code : File src = new File("T:\\SeleniuminputFiles\\input.xlsx"); FileInputStream fis = new FileInputStream(src); XSSFWorkbook wb = new XSSFWorkbook(fis); XSSFSheet sheet1 = wb.getSheetAt(0); but i am getting the compilation error as The constructor XSSFWorkbook(FileInputStream) is undefined. I have downloaded External Jar files from The latest stable release Apache POI 3.16 http://poi.apache.org/download.html#POI-3.16 Your help would be highly appreciated.

Join the discussion →

Using between in QueryDSL for date parameters

I am using QueryDSL with jpa and i want to find records between date range somethig like this query.from(timeSheet) .where(timeSheet.date.between(fromDate, toDate)).fetch(); but between only supports boolean and String expressions

Join the discussion →

Adding certificate for a custom (private) Maven repository in IntelliJ IDEA

I recently set up an Artifactory repository and secured it with an SSL certificate. It's not self-signed but while most operating systems come with it pre-installed, the JRE doesn't. The problem is that the record containing my server in the Maven Repositories Preferences window (IntelliJ Preferences > Build, Execution, Deployment > Build Tools > Maven > Repositories) gives an error when pressing the Update button. Here's the abstract from idea.log: Caused by: java.lang.RuntimeException: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requ

Join the discussion →

How to send data to spring boot method using FETCH API

I am exploring fetch api and want to send some for date to a spring boot method, but it is throwing 400 error JS code let fetchConfig = { method : params.method || 'GET', body : params.body }; return fetch(_url,fetchConfig).then(function (response) { if (!response.ok) { throw Error(response.statusText); } else { return response.json(); } }).then(function (data) { return data; }).catch(function (error) { return error; }) Spring boot method @RequestMapping(value = "/validate",method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE) public @ResponseBody ValidateUserModel validateU

Join the discussion →

scrollTo() function does nothing

I wanted to scroll to the bottom of the page using vanilla JS, but I encountered a problem. The code below is supposed to scroll to the bottom of the page: window.scrollTo(0,document.body.scrollHeight); Whereas all it does is logs "undefined" in the console. Inputting document.body.scrollHeight returns an integer 736. Other than that, it doesn't matter what I input into the function's parameters, nothing happens. What more, it only happens on one website. What may matter (not sure) is that the website hides its vertical scrolling bar, even thought it has a really long list of content.

Join the discussion →

Failed to construct kafka producer

I'm using Kafka version 0.11.0.0 and trying to create an input stream by loading data from avro file.But it fails in instantiating the Producer with the exception: [main] INFO org.apache.kafka.clients.producer.KafkaProducer - Closing the Kafka producer with timeoutMillis = 0 ms. Exception in thread "main" org.apache.kafka.common.KafkaException: Failed to construct kafka producer at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:415) at org.apache.kafka.clients.producer.KafkaProducer.<init>(KafkaProducer.java:287) at wordcount.PayloadProducer.produceInputs(PayloadProd

Join the discussion →

How to find all the IP addresses a application uses?

Our company computers have very limited access to Internet, when a application needs connection to internet we usually allow the IP addresses that application needs to connect through firewall. Now I am trying to connect this particular application to their cloud service and added three IPs which I know it uses to pass through firewall, but the application still having issues to connect to the cloud. With unrestricted internet it connects without any issues. Is there any way of finding the list of IPs this particular application uses through Microsoft network monitor or any other monitoring ap

Join the discussion →

Ignore or handle an error when running a query in SQL Server

When I execute the batch of insert queries via SQL Server Mgmt Studio, it produces the following error but completes the insertion process of other queries. Msg 18054, Level 16, State 1, Procedure X, Line 14 Error 50001, severity -1, state 1 was raised, but no message with that error number was found in sys.messages. If error is larger than 50000, make sure the user-defined message is added using sp_addmessage. Msg 18054, Level 16, State 1, Procedure Y, Line 14 Error 50001, severity -1, state 1 was raised, but no message with that error number was found in sys.messages. If error is larger than

Join the discussion →

Subversion checkout not working in terminal over HTTPS Ubuntu 16.04

I am facing an issue while trying to checkout a project on the server using "svn co" command. Checking out and updating with softwares like TortoiseSVN or PHPStorm work properly over HTTPS, only the terminal wont work. I have set up previously similar servers but never with https support. I am using a Positive SSL that i have set up over ISPConfig 3.1 for the domain in question. While trying to check out the project with the following command: svn co --username myusername https://example.com/svn/project /var/www/project I get the following error: svn: E170013: Unable to connect to a repository

Join the discussion →
Older stories