on-internet

Memory issues with Next.js

i am using Next.js version 8.0.4. the problem i'm facing is that when i first build the app and start it is taking almost 150 Mb memory on server but it grows gradually over time and it becomes very big in just 3 or 4 days depending on how many users are visiting my website. i have searched a lot about memory leaks and i don't think that i have done anything in my code that can cause a memory leak. i also have noticed that this growth in using memory is happening whenever i refresh the page or when i load it for the first time, in fact when the page is rendering on the server side. with every

Join the discussion →

react-leaflet GeoJSON with typescript

I am pretty new using typescript with reactjs. Currently, the project I am working on is using a react-leaflet/leaflet specifically their GeoJSON component. I am running into a typescript error when I pass my data to the props. I have been doing some research on this, even installed the geojson package and followed their examples, https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/geojson/geojson-tests.ts, tried everything that I know but no luck. If I try to pass data as const GeoJsonData: geojson.Feature<geojson.Polygon, geojson.GeoJsonProperties> = { geometry: { coordinate

Join the discussion →

CORS problems with Springboot and Angular Websocket

I have two services to build a Spring Boot application. But I always get CORS problems like this: Access to XMLHttpRequest at '.../websocket-cr/info?t=1581585481804' from origin'http://localhost:8080' has been blocked by CORS policy: The value of the 'Access-Control-Allow-Origin' header in the response must not be the wildcard '*' when the request's credentials mode is 'include'. The credentials mode of requests initiated by the XMLHttpRequest is controlled by the withCredentials. Springboot service on 8082 public void registerStompEndpoints(StompEndpointRegistry registry) { registry.addEndpoi

Join the discussion →

SharePoint 2016 Error : NotTimeValid: A required certificate is not within its validity period

I am stumped on this error and need some insight/assistance in solving it. I had a wildcard SSL cert issued by GoDaddy that expired and I removed and replaced the renewed cert on all SharePoint servers - * in IIS; * in Cert:\LocalMachine\Sharepoint; * in SharePoint SPTrustedRootAuthority * STS ... but I still get the following error: Server Error in '/' Application. NotTimeValid: A required certificate is not within its validity period when verifying against the current system clock or the timestamp in the signed file. Description: An unhandled exception occurred during the execution of the cu

Join the discussion →

How to filter by a column generated in the same query?

The below is a very simple query where my_data consists only of 1 row, and it's there only to help me explain my issue better. WITH my_data AS( SELECT TIMESTAMP("2020-02-11 13:15:00 UTC") AS my_timestamp ,50 AS my_customers) SELECT DATE(my_timestamp) AS my_date ,my_customers FROM my_data WHERE my_date = "2020-02-11" This won't run in Google Big Query's standard SQL, although I recall running something similar in the past. The reason it won't run is that it doesn't know what my_date is, and my guess is because it's getting created in the same query. My question is: Can I filter by a new generat

Join the discussion →

Speed up SVD in PyTorch

I am doing some classification task for CIFAR10 with Pytorch and for each iteration I have to do some preprocessing on each batch before I would be able to feed forward to the model. Below is the code for the preprocessing part on each batch: S = torch.zeros((batch_size, C, H, W)) for i in range(batch_size): img = batch[i, :, :, :] for c in range(C): U, _, V = torch.svd(img[c]) S[i, c] = U[:, 0].view(-1, 1).matmul(V[:, 0].view(1, -1)) However, this calculation is very slow. Is there any way that I could speed up this code?

Join the discussion →

Mongo::Error::NoServerAvailable: No primary server is available in cluster

I am getting the following error when deploying to production environment (via gitlab): Mongo::Error::NoServerAvailable: No primary server is available in cluster: #<Cluster topology= ReplicaSetNoPrimary[url1:27017,url2:27017,url3:27017,url4:27017,url5:27017,name=mobile01] servers=[ #<Server address=url1:27017 UNKNOWN>, #<Server address=url2:27017 UNKNOWN>, #<Server address=url3:27017 UNKNOWN>, #<Server address=url4:27017 UNKNOWN>, #<Server address=url5:27017 UNKNOWN>]> with timeout=30, LT=0.015 I have been trying to reproduce the error locally in a rails console, here is the configuration I h

Join the discussion →

Missed comma between flow collection entries, how to fix?

I have this yaml definition and it gives the following error: missed comma between flow collection entries This is how my yaml looks like: create_bucket_lifecycle_policy: action: aws_boto3.boto3action input: params: Bucket: <% $.bucket_full_name %> LifecycleConfiguration: { Rules: <-- this is where error coming - {'Expiration': {'Date': <%= format(Sys.time(), "%d %B, %Y") %>}} } on-success: - create_inline_policy on-error: - fail can someone please help me?

Join the discussion →

Invalid request parameters

Good afternoon, I have been doing a small development in C #, for the request in HTTP POST. I have the following problem, when trying in c # the following have not worked for me using RestSharp; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using System.Net; using System.IO; using Newtonsoft.Json.Linq; namespace App_Llamadas_API { public partial class Form1 : Form { public Form1() { InitializeComponent(); } [Obsolete] private vo

Join the discussion →

Should we apply for Tourist eVisa if we already have Business eVisa

Me and my husband (Both Indonesian citizen) would like to visit India in March for Holiday. I don't have visa yet so I will be applying Tourist eVisa, but my husband already have a Business eVisa (multiple entry in 1 year - issued 3 months ago). Should my husband apply for a Tourist eVisa (So he will have 2 visa), or it should be good to use the Business eVisa for holiday? Thanks.

Join the discussion →

How can I calculate principal component analysis to plot a graph, showing PC1 vs PC2, using my data set?

How would I go about making a principal component analysis with the gene data set I have? I have a table containing 15 columns. The first one is disease group, where 0 is control, 1 is Ulcerative Colitis and 2 stands for Crohn’s. The remaining 14 columns correspond to 14 different genes. I would like to plot a PC1 vs PC2 following PCA (via prcomp), to show whether any clustering or separation between the three groups occurs based on gene expression data ( with each axis showing the proportion of variance). However, I am struggling to know where to start, as I cannot convert my column 1 to row

Join the discussion →

zipkin error Error creating bean with name 'webMvcMetricsFilter' defined in class path resource

When I tried to integrate zipkin. It threw this error Error Msg:Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'webMvcMetricsFilter' defined in class path resource [org/springframework/boot/actuate/autoconfigure/metrics/web/servlet/WebMvcMetricsAutoConfiguration.class]: Unsatisfied dependency expressed through method 'webMvcMetricsFilter' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'prometheusMeterRegistry' defined in cl

Join the discussion →

class-validator in nestjs has unexpected behavior for phone numbers in body or route

I am using class-validator and nestjs to preform validation on my Http requests. I am running into an interesting edge case that I am not sure if it is a bug or my implementation is faulty. I have two endpoints: 1) to create data with a valid phone number and 2) to retrieve data by a phone number in the route param. It seems like the route param has more strict validation. I am using the 'US' intl code because my app doesn't support international numbers yet. Here is my implementation: Creating Data with Phone Number /* contact.dto.ts */ export class ContactDto { @IsPhoneNumber('US') public ph

Join the discussion →

How can I find the log 2 base of a double variable?

I'm trying to calculate the log 2 base of some double type numbers, but it seems that there isn't a standard method from a library for this. I tried the following approach, however it produces errors. double entropy=0; for(int i=0; i<26;i++){ entropy+=-possibilityCounter[i]*log2(possibilityCounter[i]); } Note: The possibilityCounter table contains double types, e.g 0.00133536. Any suggestions?

Join the discussion →

Linking Issues when running 'make check' GLIBC

I'm currently trying to compile glibc-2.30 on a linux 3.10.0-1062.9.1.el7.x86_64 system as it is currently running 2.17. The compile environment consists of the following which have been loaded via spack: -binutils-2.33.1%[email protected] [email protected] +piclibs binutils=binutils-2.33 [email protected] -libcap-2.25 -linux-headers-4.9.10 (dir referenced below as $kern_headers) -libgd-2.2.4 All required dependencies for the above were also loaded and installed with spack. I have cloned glibc to $HOME/lib/glibc and checked out glibc-2.30 repo. From $HOME/lib/glibc_build, I run the following configure to ensure prope

Join the discussion →

Scikit-learn: Utilizing ElasticNet with GridSearchCV

I am novice when it comes to Machine Learning, but I am very interested on this topic. I have a few questions so bear with me. This is a time-series analysis. I am using ElasticNet with GridSearchCV to figure out the best Hyperparameters for my model. I went through the steps with feature selection to reduce my features (I am using an f_regression at the basic <0.05 sig level). I am not using any test to figure out Multicollinearity, because I assume that elastic net would use the L1 ratio = 1 (Or close to it) to get around this issue. The parameter grids are listed below: l1_space = np.linspa

Join the discussion →

The transaction log for database is full due to 'log_backup' / (Log)LDF file 4 times bigger than (Data)MDF

Of course I found many posts to the problem of "log_backup". But my question is now: what is the right / correct / professional way to handle this kind of problem? My database file is approx 20GB, the transaction log-file is 100 GB (4 times bigger). I'm sure that I do not need all this backup transactions. So what's the right way to shrink the log file to approx 20GB? Have I just to follow these answers and set recovery mode to simple, shrink and then to do a full backup? Or would you suggest another solution, like backup the log file and start a new one? (I'm not sure, if this is possible?!)

Join the discussion →

Powershell : Move-ADObject : The operation could not be performed because the object's parent is either uninstantiated or deleted

I have a problem with a script in Powershell. I want to transfer users from an OU (parent OU : "IT" for exemple) to a "child OU" => "Users". ("IT">"Users"). Here is the error: $name = "CN=Michael Allen,OU=IT,DC=Adatum,DC=com" Move-ADObject "CN=Michael Allen,OU=IT,DC=Adatum,DC=com" -TargetPath "OU=IT,OU=Users,DC=Adatum,DC=com" Move-ADObject : The operation could not be performed because the object's parent is either uninstantiated or deleted At line:5 char:1 + Move-ADObject "CN=Michael Allen,OU=IT,DC=Adatum,DC=com" -TargetPath "OU=IT,OU=Us ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Join the discussion →

Change value of a single cell in Power BI

I am trying to change the value of a single cell in power bi. When I go into the "data" view then right click and then go to "edit query" I have the option for "replace values". This works like a find and replace, the issue I am having is that if there are multiple cells with the same values they will all get changed. How can I just edit a single cell??

Join the discussion →

How to get Public IP address of Android device programmatically?

I want to retrieve publick IP Address, the address that we get for example from whatismyipaddress.com and I don't want to use any third party servcie https://www.ipify.org. Is there any way to fetch this IP address from inbuilt classes or library in Android. If not possible to get the required data from Android libraries, please suggest any logic to get the same in server level instead of fetching in client level. Note: Loadbalancer is present before routing to actual web-application

Join the discussion →

When/why can INDEX replace ARRAYFORMULA?

I found that INDEX() can replace ARRAYFORMULA() in some situations. I wonder this is a supported function of INDEX or just a bug since I cannot find any documentation of INDEX function working this way. For example, these two formulae give the same result. =INDEX(ArrayFormula(SPLIT (I2:I75," ")),,1) =INDEX(SPLIT (I2:I75," "),,1) However, without INDEX, SPLIT(I2:I75," ") gives only one result, not an array. In the same way, INDEX can be used instead of ARRAYFORMULA with VLOOKUP. The [G1] cell is calculated with a normal ARRAYFORMULA.

Join the discussion →

How to convert Node.js to python

Hello everyone i want to convert this snippet of node.js code to python and i am not too particularly strong in python. For a little backstory I am performing a api get request to pull data, I specifically want to pull everything(fields and value ) that is in one table. so far from the node.js snippet I understand that I am reading a txt file using a for loop to iterate through all the fields that is in one table in an index but I do not know how to implement this in my python code. Any recommendations that may help? here is a tables.txt file {"Tables": [ { "Name": "Event", "EventType": "CSumm

Join the discussion →

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 →

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 →
Older stories