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

Convert one date format into another in PHP

A datetime is being passed via Webhook API which I have no control over. I have a PHP Endpoint that takes in the datetime, so I want to convert it to just a date. The datetime comes over in this format: 2024-10-17 20:35:53 UTC I want to set the date in a mm/dd/yyyy format. This

Read More
C#

There are some techniques that i'm missing out in creating this ICPC more robust?

[C language]\ Hello there! I’m trying to do a simple IPC between two files ".c" but I’m facing some unexpected output. I’m compiling the server file, nothing wrong, the PID is clearly printed. I’m compiling the client with PID of the server and a string of 100 chars -> usleep(3000) -> expected output -> usleep(100)

Read More
java

Authentication is null despite @WithMockUser

I have this controller where it retrieve the user authentication data and print them out. @GetMapping("/get-role") public ResponseEntity<String> getRole(Authentication auth) { String role = auth.getAuthorities().stream().findFirst().get().toString(); return ResponseEntity.ok(role); } The problem comes when I tried to write the unit test @Test @DisplayName("Test Role") @WithMockUser (username = "user", roles = {"Admin"}) void testRole() throws Exception { URI

Read More
python

Why won't spaCy detect numpy dependencies?

I am trying to install and use spaCy to perform NLP. I created a new working directory, installed pip and set up a venv. When I am trying to run my sample code, I am getting told that Numpy is not available. Here’s the code to my script: import spacy # Load the german language

Read More
GPL

Free GPL WPBookit – Appointment Booking WordPress Plugin

Latest Release 04 October 2024 – v1.5.5 Added support for Webhook addon & Coupons addon Improved WPBookit Admin UI/UX Fixed Invoice UI issue Fixed dashboard summary pricing bug WPBookit is a comprehensive appointment booking WordPress plugin designed to streamline your booking process and enhance user experience. Perfect for businesses of all sizes, WPBookit provides a

Read More
javascript

In discord Js guildmemberupdate not emitting when avatar has changed?

For some reason the GuildMemberUpdate is not triggering when a user in the guild with the bot changes there avatar but it will trigger for everything else like username change and role remove/add, Im not really sure why its not triggering if anyone has any ideas please let me know also on the dev portal

Read More
pdf

How can i extract clean japanese text from the pdf folder in python

This is my code import os import PyPDF2 # set the directory where the PDF files are located pdf_directory = '/Users/humnerohit/Desktop/test_pdf_files' # loop through each file in the directory for filename in os.listdir(pdf_directory): if filename.endswith('.pdf'): # create a PDF file object pdf_file = open(os.path.join(pdf_directory, filename), 'rb') # create a PDF reader object pdf_reader = PyPDF2.PdfFileReader(pdf_file)

Read More
security

The Anti-Clickjacking X-Frame-Options Header Is Not Present

Is There A Way To Add an Anti-Click Jacking Header In Shopify ? If There Is I Need Help As The Site Is Being Warned For The Same Saying That There Is No Anti-Click Jacking Header File Present In Store By Default. NEED HELP !!! Internet Gives Suggestions For React Code And Our Tech Stack

Read More
SQL

Aware datetime objects output different UTC offsets in one timezone

My database is storing dates with time in UTC timezone. I have a python program that uses ORM to query database. This ORM is configured to use Europe/London timezone. When I receive python datetime objects I expect them to be in +01:00 offset, but some dates have +00:00 (UTC) offset as can be seen below

Read More
CSS

Vertical fly-out column navigation

We need a fly-out column navigation for our Drupal website, and during my research, I found the Navigation module (https://www.drupal.org/project/navigation), which offers the exact style I’m looking for. This module is already part of Core. However, it only transforms the administration menu, while I need it to apply to my custom left-sidebar navigation. Specifically, I

Read More