October 23, 2024
Chicago 12, Melborne City, USA
PHP

PHP : Date difference logically best way

I need to calculate two date’s difference in days, Where one date is fixed (i.e. first day of month ). Another date would be today’s date. I know how to calculate difference between it. But I want to know which one would be 100% effective, using DateTime::diff() or using date('d') function. Anyone help me out

Read More
C#

How to install perlbrew following c compiler error

I am new to Perl (I am using it for a new specific project), and I am trying to following the following tutorial to install Perlbrew: https://www.ensembl.info/2013/09/09/installing-perl-dbdmysql-and-ensembl-on-osx/ I am running OSX Monterey Version 12.3. When I run the following code block: perlbrew install -j 5 --as 5.14.4 \ --thread --64all -Duseshrplib perl-5.14.4 I get the

Read More
java

@Spy with @InjectMocks in Mockito

I am trying to write unit test for my ProjectsService class. the class depends on ProjectsRepository. So I annotated the repository with @Mock to avoid calling real database and annotate the projectsService with @InjectMocks to inject the required dependencies. Moreover, I want to test some methods in the projects service not all of them. I

Read More
python

Crypto.com Exchange API Create Order unauthorised

I am trying to use Crypto.com API and when I am calling private/create-order to buy an instrument I am getting 401 Http status code with 40101 code, which means Unauthorised – Not authenticated, or key/signature incorrect I tried calling private/user-balance and i can successfully get my balance so it can’t be the IP. The difference

Read More
javascript

Saving a Javascript Function on a webpage

I made a quiz, and the theme is the Harry Potter’s universe. I made a feature that allow the user to change the theme between the houses (Slytherin, Hufflepuff etc.) before starting the quiz. But I’ve got a problem. Each time you press validate, to validate your answer, and a function call another question (and

Read More
pdf

Generate Dynamic PDF documents ( React.js & pdfMake)

Using react i want to generate dynamic PDFs the content of the PDF is very dynamic, a combo of texts, tables, columns, stacks … and nested tables with stacks and so on … Before I inserting a new title like { text: "Overview", style: "header" } before inserting this text i would check first how

Read More
templates

Is it possible to insert fields from a commit in the github pull_request_template?

When I create a PR, I first created a branch and committed changes. With the commits I have fields such as: a description (comment/message) the commit UUID the date / time when the commit happened others… My main problem, at the moment, is the comment from the first commit appears BEFORE the template. I’d like

Read More
security

can't get accessToken with client-credentials grant_type with spring-authorization-server

env: java: 17 spring boot: 3.3.4 spring security: 6.3.3 spring authorization server: 1.3.2 i configured the authorization server like below with new version of spring-authorization-server library. i sent the request with postman which has correct client id and client secret parameter with the server. but can’t get the access Token. reference is few. and can’t

Read More
SQL

Query that adds horizontal and vertical

I have data in a table that consists of expense statements by year. I want to make a SQL query that gives me the sum of the amounts but for a year on a line like in the Excel table that I provided. I tried but I can’t do it. Only one line per year

Read More
CSS

CSS-only masonry layout

I am trying to achieve a dashboard grid witch has variable number of elements based on fetch result in marked elements ( red boxes on image ). I want to fit content on vieport with min height of items. if any item hits its min height then overflow grid. See image below: Group Dashboard Most

Read More