on-internet

org.apache.http.conn.HttpHostConnectException: Connect to localhost:8080 [localhost/127.0.0.1] failed: Connection refused: connect

I'm new to spring-boot and I'm testing spring-boot application using http API, but I got connection error. GET http://localhost:8080/api/helloworld org.apache.http.conn.HttpHostConnectException: Connect to localhost:8080 [localhost/127.0.0.1] failed: Connection refused: connect // HelloWorldController.java import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController; @RestController public class HelloWorldController { @GetMap

Join the discussion →

How to turn off strict mode in PostgreSQL

I have problem with postgres, it's so different than mysql (type data string_numeric and numeric). I have a query for a type column of type varchar. Simple example Table A id(int) | kode(string) | name(string) --------+--------------+------------- 1 | 2 | yuan In mysql we can get data with select * from A where kode = 2; but in Postgres that is wrong SQL because type of data column kode is string, so must add ' to build query like select * from A where kode = '2'; How to set Postgres to use the SQL like mysql does (turn off strict mode)?

Join the discussion →

Snowflake - Task not running

I have created a simple task with the below script and for some reason it never ran. CREATE OR REPLACE TASK dbo.tab_update WAREHOUSE = COMPUTE_WH SCHEDULE = 'USING CRON * * * * * UTC' AS CALL dbo.my_procedure(); I am using a snowflake trail enterprise version.

Join the discussion →

How do I create a kick command for a discord bot?

I need help creating a kick command for my discord bot. I am using discord.js and node.js . I do have the starting things like const Discord = require('discord.js'); const Client = new Discord.Client(); I don't really understand what else to do. I've tried looking for help on YouTube, but every time I try it seems to not work anymore. Can someone please guide me?

Join the discussion →

Android NFS Client

I have found a good library to implement an Android NFS Client 'nfs-client-java', I'm creating an Nfs3 Client and I can access files and create new files... on the server. But the problem is that I can't mount the whole shared directory from the server. On Linux NFS Client, I can specify the mount point with mount -t nfs -o nolock,rw,vers=3 192.168.1.10:/media/user/ /mnt/media_rw/remote where /mnt/media_rw/remote is where the shared directory will be mounted. My question is: How can I achieve the same result on Android App ?

Join the discussion →

Encode video from C++ using libavcodec and VAAPI

I am trying to encode a video in H.264 with libavcodec (version 3.4.6). It works when I use the software encoder "libx264", however it does not when I try to use the hardware encoder of my Intel cpu with VAAPI. Hardware encoding with ffmpeg via VAAPI works from the command line (using commands from here). Apparently, there is no example or tutorial how to encode with VAAPI and libav*. I read through those of ffmpeg's examples that cover a related use case (hardware decoding, software encoding, muxing) and tried to adapt them accordingly. When I setup the VAAPI encoder, avcodec_open2() returns

Join the discussion →

Error starting Tomcat context after adding spring-boot-starter-data-redis in spring boot application

2020-01-09 14:20:15.213 ERROR 7694 --- [ main] o.s.b.web.embedded.tomcat.TomcatStarter : Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.s

Join the discussion →

How to use torch.utils.tensorboard's SummaryWriter add_graph with dictionary outputs?

I have a PyTorch model that inherits from nn.Module and that has a forward method which returns a dictionary containing multiple tensors (stored as values). When I try to log this model to TensorBoard using torch.utils.tensorboard's SummaryWriter.add_graph() method I receive the following error: RuntimeError("Tracer cannot infer type of <output dictionary> How can I use add_graph() when the model's forward() method returns a dictionary? Edit 1: Complete stack trace up to error: WARNING:root:This caffe2 python run does not have GPU support. Will run in CPU only mode. Only tensors or tuples of t

Join the discussion →

Protobuf RuntimeWarning: Unexpected end-group tag Not all data was converted

I have this utf-8 encoded file from which I need to collect the hexadecimal dump which is protobuf viable and then feed it to the protobuf. The .proto file works as expected and life is almost perfect. message_content = message_content.replace(" ","") message_content = binascii.unhexlify(message_content) I convert the string to raw bytes and then feed it to the protobuf: msg.ParseFromString(message_content) which results in the following error: RuntimeWarning: Unexpected end-group tag: Not all data was converted msg.ParseFromString(message_content) I can't tell if I'm collecting the hex part p

Join the discussion →

How to use material table with async pipe and change detection? (Not working properly)

I've spent about 3 whole days trying to figure this out. Behavior expected: Material Table always renders with most current data from backend. When a new item is added to table from a separate component, a router redirect to the page shows updated data. Actual behavior: Upon first navigation to page, table is empty. Table is rendered, column headers rendered, but no rows populated. Navigating away then back populates the table properly. When adding a new item to the table, a service sends the item to the backend and then makes a call for all items. The service then updates the store (another s

Join the discussion →

Failed to execute 'readAsText' on 'FileReader': parameter 1 is not of type 'Blob'

I am trying to read a user uploaded xml file in angular. Below is my code: Component.ts: convertFileToString(event){ this.uploadXML=event.target.files[0]; let fileReader = new FileReader(); fileReader.onload = (event) =>{this.finalUploadedXML=fileReader.result as String} fileReader.readAsText(this.uploadXML); console.log("The contents are:") console.log(this.finalUploadedXML); } index.html <input type="file" id="uploadInput" (change)="convertFileToString($event)" hidden> But when i run this code, it gives me the following error: Failed to execute 'readAsText' on 'FileReader': parameter 1 is no

Join the discussion →

How to enable the functionality to paste table in quill editor

We are trying to enable the functionality to paste the table in quill editor, but it's not working. var quill = new Quill('#editor-container', { modules: { table: true, toolbar: [ [{ header: [1, 2, false] }], ['bold', 'italic', 'underline'], ['image', 'code-block'] ] }, placeholder: 'Compose an epic...', theme: 'snow' // or 'bubble' });

Join the discussion →

how to change jdk version in weblogic12c

i have configured weblogic server in eclipse but when ever it starts its taking jdk older version like Starting WLS with line: D:\dev\Java\jdk1.8.0_172\bin\java -server i have to change it to higher version.

Join the discussion →

Does erase() delete heap memory used by elements of an stl::unordered_set?

I have an std::unordered_set<N> into which values are inserted by reference (your insert below is by copy, but I left "by reference" since it's your original message). I want to erase some elements from the set and reduce the malloc() memory used, but I can't see a reduction in memory. Is it possible to reduce malloc() memory using erase()? Will rehash() help after erase()? typedef typename std::unordered_set<N> ChangeObjSet; ChangeObjSet _changeObjSet; template <class N> void MdmNameCacheImplMIWithStripEscape<N>::insertChangedStatus(const N &obj) { _changeObjSet.insert(obj); } typename Change

Join the discussion →

How to manually calculate the nth root of a number in C#

I am trying to write an algorithm that will calculate the Nth root of a number that is provided to the algorithm (practically) as a string, in C#. What I have right now calculates the square root, but not other roots, and I want to modify the part of the algorithm that is square root specific in order to generalize it to Nth roots. I have been using two WikiHow articles (URLs in code comments, below) on calculating square and Nth roots manually, and I believe that the only part of what I have that is specific to the square root approach is isolated in my local function, (long, long) GetDigit(

Join the discussion →

getting a "prepared statement error" in asyncpg

I am trying work with some data from a PostgreSQL server,by using Connection Pools. There's a caveat mentioning this issue and it's apparently due to using the 'pgbouncer' tool However, I am using the createpool() function to get the connection object: self.pg_con=await asyncpg.create_pool(dsn=dsn,database=db,user=user,password=_db_pass) Traceback (most recent call last): File "C:\Users\User\Desktop\Py-Workspace\env\lib\site-packages\discord\client.py", line 270, in _run_event await coro(*args, **kwargs) File "C:\Users\User\Desktop\Py-Workspace\cogs\levels_3.py", line 40, in on_message user=aw

Join the discussion →

How to use Resource.RC file in Visual Studio

For context, I have been trying to include 2 PNG files with my C++ code, but I have not been able to figure out how to do so in Visual Studio 2019. I have searched through the docs and have not found anything helpful. How could I accomplish the three items listed below? Correctly include files in a Resource.RC file (and correctly create a Resource.RC file) Access these files in a filesystem-independent manner in C++ (no absolute paths) Include these files when distributing an executable My solution is laid out in the default manner: a References folder, External Dependencies folder, Header Fil

Join the discussion →

Default webpack configuration

https://webpack.js.org/configuration/ Out of the box, webpack won't require you to use a configuration file. However, it will assume the entry point of your project is src/index and will output the result in dist/main.js minified and optimized for production. What loaders webpack include by default if no config is provided? What's the default configuration then? The docs say that I don't need to use configuration but how can I know if default configuration will suffice?

Join the discussion →

apex_web_service.make_rest_request POST has bad json or returns ORA-06502 numeric or value error

I cannot get successful POST /authentication/login with E-verify/DHS using PLSQL using apex_web_service.make_rest_request(). I tried in Apex first but got numeric/value error and swtiched to PLSQL to debug. It uses json. Apex version is 4.2. I can get a GET to work, but that does not use headers or parms. If specify p_parm_name using string_to_table() or using p_parm_name by specifying each array value separately, then I get {"status":400,"error":"There was a problem in the JSON you submitted: ActionDispatch::Http::Parameters::ParseError"} If I specify p_body then i get an ORA-06502: PL/SQL: n

Join the discussion →

Error on opening any Kettle Transformation file in Pentaho Data Integration

I have been working with PDI since a long time and while opening the same file which used to work perfectly before is now showing the below error immediately after opening: java.lang.NullPointerException at org.pentaho.di.ui.spoon.TransFileListener.open(TransFileListener.java:112) at org.pentaho.di.ui.spoon.Spoon.openFile(Spoon.java:4623) at org.pentaho.di.ui.spoon.Spoon$2.drop(Spoon.java:976) at org.eclipse.swt.dnd.DNDListener.handleEvent(Unknown Source) at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Display.sendEvent(Unknown Source) at org.eclipse.

Join the discussion →

JavaScript - Canvas snowing animation

I want to create a snowing animation effect in JavaScript. My knowledge is really poor in this coding language. However, I managed to do that with one snowflake, with a loop as well. I now want to generate more than one snowflake. Can someone help me to figure out how to generate more snowflakes? let canvas = document.getElementById("wip"); let ctx = canvas.getContext("2d"); canvas.width = window.innerWidth-30; canvas.height = window.innerHeight-30; let xloc = Math.floor(Math.random() * canvas.width); let yloc = 0; ctx.strokeStyle="#"+((1<<24)*Math.random()|0).toString(16); function drawflake(

Join the discussion →

DocumentRoot is not a directory, or is not readable

I'm trying to Install Apache PHP MySQL phpMyAdmin on Windows 10, so I started with Apache so I downloaded it and I installed it as a service with : >httpd.exe -k install and then I typed httpd.exe -k start and this problem shows up when I open httpd.config file and change it from : to : and run httpd.exe -k start the error's not there anymore but when I head up to my browser and type http://localhost I'm supposed to get a page saying : it works but instead I got this : I read this Apache restart causes DocumentRoot must be a directory, even though it is a directory and there seem to be no priv

Join the discussion →

What is the best way for custom spacing between rows in material-ui grid?

what is the best way to have a spacing between certain rows within a grid in material-ui? For example, given the following grid with spacing={0}. GridContainer row1 GridItem GridItem row2 GridItem GridItem row3 GridItem GridItem row4 GridItem GridItem The goal is to have the same grid with spacing of 0, but with custom spacing between rows 2 and 3 GridContainer row1 GridItem GridItem row2 GridItem GridItem row3 GridItem GridItem row4 GridItem GridItem I tried to put mt={2) to GridItems in the 3rd row but it did not work. I achieved the behaviour with a custom class passed via the className att

Join the discussion →

Extracting data from tables without any grid lines and border from scanned image of document

Extracting table data from digital PDFs have been simple using camelot and tabula. However, the solution doesn't work with scanned images of the document pages specifically when the table doesn't have borders and inner grids. I have been trying to generate vertical and horizontal lines using OpenCV. However, since the scanned images will have slight rotation angles, it is difficult to proceed with the approach. How can we utilize OpenCV to generate grids (horizontal and vertical lines) and borders for the scanned document page which contains table data (along with paragraphs of text)? If this

Join the discussion →

Can't start pnpm script - ERROR : Command failed with exit code 1

I'm using pnpm to start my gulp script but it's been the second time I've this error & I don't know how to fix it. I've tried : Uninstall then reinstall node Same with pnpm, gulp-cli & gulp Deleting node_modules folder, then pnpm install Reinstall webpack, @babel/core, @babel/register Adding type: module to my package.json Here's the error message: ➜ sabir git:(master) ✗ pnpm start > [email protected] start /Users/vianneybernet/Library/Mobile Documents/com~apple~CloudDocs/Sites/sabir > gulp [18:14:01] Requiring external module @babel/register /Users/vianneybernet/Library/Mobile Documents/com~apple~C

Join the discussion →

Is there a way to convert JSON Data to avro schema in C#?

I'm trying to convert the input json data to avro schema. Converting a Json schema to Avro schema is possible with confluents avro serialization. But what about JSON data to Avro Schema? Input { "name": "first Name", "age": "25", } The expected output would be an Avro schema.

Join the discussion →

How to avoid passing too many parameters to a function? [closed]

I have a function that has too many parameters, and I feel such a function is not easy to read and use. My function is used to get values like name, age, etc., to search a database. I have viewed the resolving approach in PHP that passes a class object into the function instead of many parameters. Is there a similar approaches with Perl?

Join the discussion →

Angular material table footer totals

I am using angular material table 8.2.3. I have a lot of tables that are generated from a definition in the typescript. Most of the tables have to do with numbers so I have to show totals on the footer. Problem is that the material table examples in the material page have only one column and it does not show how to deal with multiple columns. I am looking for a way to dynamic calculate the sum of a column. I have the following code but it does not execute: <table mat-table [dataSource]="dataSource" matSort matSortActive="Date" matSortDisableClear="true"> <ng-container *ngFor="let column of col

Join the discussion →

What is pointer stability?

The second paragraph in this link on Abseil containers says: For example, the Abseil containers often do not guarantee pointer stability after insertions or deletions. What does pointer stability mean in this context?

Join the discussion →
Older stories