on-internet

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 →

How do I avoid KeyError when working with dictionaries?

Right now I'm trying to code an assembler but I keep getting this error: Traceback (most recent call last): File "/Users/Douglas/Documents/NeWS.py", line 44, in <module> if item in registerTable[item]: KeyError: 'LD' I currently have this code: functionTable = { "ADD": "00", "SUB": "01", "LD": "10"} registerTable = { "R0": "00", "R1": "00", "R2": "00", "R3": "00"} source = "LD R3 15" newS = source.split(" ") for item in newS: if item in functionTable[item]: functionField = functionTable[item] else: functionField = "00" if item in registerTable[item]: registerField = registerTable[item] else: r

Join the discussion →

vertext failled Error and Mapper initialized failed - Hive

I'm using Hortonworks data platform in our server with 2 nodes. I'm running query successfully in hive. Suddenly I'm facing mapping with source table to add column to my new table, By this below query; while running this query in hive view. How do I resolve this issue? create table New_table As select distinct ab.id, ab.first_name, ab.middle_name, ab.last_name, b.Address, b.City_Name, b.State_Name from Temp_table ab join Source_table b on (ab.id=b.id); I got vertext failled error. Please find my log × java.sql.SQLException: Error while processing statement: FAILED: Execution Error, return code

Join the discussion →

imshow() in OpenCV doesn't work for cv::Mat type CV_32F? [duplicate]

I have a float array float* data; // stores pixel gray color cv::Mat img(h,w,CV_32F,data); cv::namedWindow("Display window"); cv::imshow( "Display window", img ); Then what I get is : I searched for many resources but couldnt find out. I doubt it's the problem of the type but I compared with the definition and I think it's ok. Can anyone tell me the reason?

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 →

Video Call Using WebRtc

I want to develop video calling app using webrtc without any third party SDK. I integrated this demo https://github.com/pchab/AndroidRTC But I don't find any demo that gives me Peer To Peer Connection between two mobile.

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 →

Lua Script : adding a repeating code for a mouse movement

I'm currently looking over some Lua coding for a Logitech keyboard. I can get the code to work on a single push, I have placed a repeat and sleep timer and was hoping for this to continue to loop until I pushed the mouse button which is not woring. This is what I have so far: function OnEvent(event, arg) if event == "G_PRESSED" and arg == 1 then PressMouseButton(3) repeat MoveMouseRelative(-20,0) Sleep(50) until not PressMouseButton(1) end end Please note this is my first time looking over this type of coding as any help is greatly appreciated.

Join the discussion →

Android Studio - Input Method Manager

Android studio version :2.3.3 The code below is not working and it should hide the keyboard but its not.Please help. InputMethodManager imm = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE); public void setImm(InputMethodManager imm) { this.imm = imm; } public InputMethodManager getImm() { imm.hideSoftInputFromWindow(urledit.getWindowToken(),0); return imm; }

Join the discussion →

Creating table to specify compression option

I am using this hard-to-understood syntax (sorry I am new to Sql server :)) CREATE TABLE [ database_name . [ schema_name ] . | schema_name . ] table_name [ AS FileTable ] ( { <column_definition> | <computed_column_definition> | <column_set_definition> | [ <table_constraint> ] | [ <table_index> ] } [ ,...n ] [ PERIOD FOR SYSTEM_TIME ( system_start_time_column_name , system_end_time_column_name ) ] ) [ ON { partition_scheme_name ( partition_column_name ) | filegroup | "default" } ] [ TEXTIMAGE_ON { filegroup | "default" } ] [ FILESTREAM_ON { partition_scheme_name | filegroup | "default" } ] [ WI

Join the discussion →

Unable to connect to Hive through Java Application

I am trying to connect to Hive2 through a Java application but I am getting the following error - Exception in thread "main" java.sql.SQLException: [Simba][HiveJDBCDriver](500310) Invalid operation: Peer indicated failure: Unsupported mechanism type PLAIN; at com.cloudera.hive.hivecommon.api.HiveServer2ClientFactory.createTransport(HiveServer2ClientFactory.java:224) at com.cloudera.hive.hive.api.ExtendedHS2Factory.createClient(ExtendedHS2Factory.java:38) at com.cloudera.hive.hivecommon.core.HiveJDBCConnection.connect(HiveJDBCConnection.java:597) at com.cloudera.hive.jdbc.common.BaseConnectionF

Join the discussion →

No plugin found for prefix 'spring-boot'

I am getting below error [DEBUG] Writing tracking file /root/.m2/repository/org/codehaus/mojo/resolver-status.properties [DEBUG] Could not find metadata org.apache.maven.plugins/maven-metadata.xml in local (/root/.m2/repository) [DEBUG] Could not find metadata org.codehaus.mojo/maven-metadata.xml in local (/root/.m2/repository) [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 26.391 s [INFO] Finished at: 2017-08-21T04:57:47+00:00 [INFO] Final Me

Join the discussion →

Disable video download on VideoJS script

I'm working a script which need to restrict video download for users, they only allow to watch online, I'm currently use "video.js" script for the player, I already restricted right click function, jQuery('.video-js').bind('contextmenu',function() { return false; }); also added dynamically load videos like https://exmaplle.com/loadvid.php?video=fire.mp4&seskey=1a2asasd125asdasdasdasdas but when i check using some FireFox extensions. those give ability to download the video file. Is there anyway to prevent download videos using browser extensions, or are there have another players which support

Join the discussion →

How can I transform tabular data into equal-width columns?

I want to print an 'echo' command output which has fields that is separated by '|' into columns with a fixed same width for all column. Number of columns may vary hence, the width should be a global setting applicable for all columns. Sample input 1234|sdan:active:running|sdax:active:running|sdbh:active:running|sdcv:active:running|sddf:active:running|sddp:active:running|Total paths 6 : OK 1235|sdc:active:running|sdm:active:running|sdw:active:running|sdbk:active:running|sdbu:active:running|sdce:active:running|Total paths 6 : OK 1236|sdam:active:running|sdaw:active:running|sdbg:active:running|sd

Join the discussion →

Placing image at the top left of the screen in html

please refer to the image below, I wish to add an image to the extreme left and top of the screen such that the word process appears to the right of it. <div class="row"> <!--img src="C:/D DRIVE DATA/databit/ymlsite/images/generic/Logo.png", height = 50 width = 50/--> </div>

Join the discussion →

How to use exporting parameter with type ANY

I have a incoming deep structure in my recursive method which contains structures and tables, so I'm working with RTTI to check type, loop over it and do my operation, in case I found a specific component. If the current component is a structure or table, then method calls itself. Problem: I import the structure with type any. So far so good. And i want to export it as type any also. And here I struggle. How can I assign my edited deep structure to my export parameter ? METHOD process_input. DATA: lo_type_descr TYPE REF TO cl_abap_typedescr, lo_struct_descr TYPE REF TO cl_abap_structdescr, lv_

Join the discussion →

Convert der certificate to p12

I am trying to upload my adobe air app to Google Play. I have opted in for Google Play App Signing and cannot opt out now. They provide me with .der certificate which I wish to convert to p12 in order to use it in my adobe AIR app. I know this can be done through openSSL but I did not get any perfect tutorial to do so. Can anyone point me to the right steps to make this conversion?

Join the discussion →

How to set specific timezone in datepicker using jquery only?

I have a field and apply datepicker on it using jQuery. it is currently getting time from system/browser. I want it to get time from a specific time zone e.g. America/new_york. The endDate param is the key to setting the calendar, which means the user should not be able to select the date from the future. Currently, it is looking like this The code snippet is : jQuery('#convo_start_date').datepicker({ format: 'dd M yyyy', endDate: '+0d', autoclose: true, showButtonPanel: true, todayBtn: 'linked' }).on('change', function () { jQuery('.datepicker').hide(); jQuery('#convo_end_date').attr('value',

Join the discussion →

C# Image to base64

I have a base64 image and i have to convert it into Image. I am doing this using this code: public static Image ConvertBase64StringToImage(string imageBase64String) { var imageBytes = Convert.FromBase64String(imageBase64String); var imageStream = new MemoryStream(imageBytes, 0, imageBytes.Length); imageStream.Write(imageBytes, 0, imageBytes.Length); var image = Image.FromStream(imageStream, true); return image; } Then i have to convert this Image into base64 again. Im using this code: public static string ConvertImageToBase64String(Image image) { var imageStream = new MemoryStream(); image.Sav

Join the discussion →

Putty Commands for editing XML file

I need to edit a xml file in a server. How can I navigate to the path where the file is present in the server and edit it using putty commands. I am new to unix so if anyone could help me out.

Join the discussion →

Least-square fitting for points in two dimensions doesn't pass through symmetrical axis

I'm trying to draw the best fitting line for given (x, y) data points. Here shows data points (red pixels) and estimated line (green), I obtained using the following library. import numpy as np m, c = np.linalg.lstsq(A, y)[0] Documentation for the used library module. We can see data points are roughly symmetrically distributed. The problem is why is this line not having the gradient similar to the long symmetric axis through the data points? Can you please explain can this result is correct? Then, how does it give a minimum error? (The line is drawn correctly using gradient returned by the ls

Join the discussion →

Can I reduce the crime rate by penalizing criminals' children socially?

This is a social engineering method. The government takes background checks very seriously. A person's moral standing is not only determined by the actions of the person themselves, but also by his/her relatives (parents, grandparents, siblings, aunts/uncles, etc.) If one family member screws up, others are negatively affected in the eye of the government and society. Background checks (for criminal activity) usually go from sibling to parent. It would go to further generations depending on the situation and the results of such a check for someone are publicly available upon request. Here is a

Join the discussion →

Jmeter - POST API not working

I am new to Jmeter and have been struggling to get it working to test my POST API. It works fine for a GET API call where I pass the parameters through the Parameters tab. Details here: server name: localhost port: 8080 path /registerMobileUsingCode In the request body, I am sending the following: { "clientName": "DemoOrg", "code": "9880007615", "languageId": "1" } My Jmeter setup looks like this: And my HTTP Request Header looks like this: The API is in production and works fine with postman. I am just unable to get it working through JMeter. It is obvious that I am doing something wrong but

Join the discussion →

Loading a needed file, relative vs absolute paths

We have a program people can compile on their machines. It has an HTTP interface but can also be invoked by command line. In order to provide some nice-looking error pages for HTTP clients, we want to provide error pages. We are using a very simple solution with go's html/template package. So in order for the program to find the templates, we currently do: func init() { prefStr := "path/to/http/tmpl" pathPrefix,err := filepath.Abs(prefStr) if err != nil { log.Warn("Template path %s is not available!", prefStr) } pathPrefix + "/err.html" } Now when debugging the app, this usually works well - w

Join the discussion →

Hex value in generate for loop

I have this code in SystemVerilog where I have to use hex numbers in a for loop. I am trying this syntax: genvar i, j; localparam int i_d = 1; localparam int j_d = 134; generate for (i = 8'h01; i <= MAX1; i = i + INCR) begin add_bit[i_d] = (creg_add == i); i_d = i_d + 1; end for (j = 8'h86; j <= MAX2; j = j + INCR) begin add_bit[j_d] = (creg_add == j); j_d = j_d + 1; end endgenerate But, I am facing this error: Error-[SE] Syntax error Following verilog source has syntax error : "creg.vs", 715: token is '[' add_bit[i_d] = (creg_add == i); ^ How do I fix the error?

Join the discussion →
Older stories