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

How to unit test a symfony/console application command?

I use only the symfony/console@7.1 library to create a small cli application. I want to unit test the command as is, yet the the unit test provides no output. This is my unit test setup: class TimrOverviewCommandTest extends TestCase { public function testTimrOverviewCommand() { $input = new ArgvInput(argv: [ "overview", "--csv", "tests/csv/day_report.csv" ]); $buffered =

Read More
C#

How to set launch target in VSCode with a makefile?

I’m new to makefiles and was trying to get it working with vscode but I’m not sure how to set the launch target? From what I understand when I press F5 vscode will start at the "all" rule in the makefile and then go to build and main which will build the main.exe? In vscode

Read More
java

Optional Data Exception false when reading object from file

I am trying to read objects from file to display them on a jpanel but I am having a hard time deserializing them. public static void saveFile(Screen screen) { JFileChooser find = new JFileChooser(); find.setCurrentDirectory(new File(System.getProperty("user.dir"))); int result = find.showSaveDialog(find); if(JFileChooser.APPROVE_OPTION == result) { File file = find.getSelectedFile(); try { FileOutputStream fo = new FileOutputStream(file);

Read More
python

Why can't a derived class in Python reference inherited attributes in its definition?

I have this snippet: class A(object): def foo(): pass class B(A): bar = foo() As written, this file will fail to run with the error NameError: name 'foo' is not defined. However, since foo is defined in A, and is inherited by B, I should be able to access them. I know I can simply

Read More
GPL

Free GPL Bookly Cart (Add-on)

Important: This plugin is an add-on that requires the Bookly PRO plugin. View Bookly page at Codecanyon. With the Bookly Cart (Add-on), you can prompt your clients to book more appointments on your website. This feature enables clients to add multiple services to their cart and book them all in a single session. This way,

Read More
javascript

Typescript: Cannot access 'createResettable' before initialization

I have a couple simple components using Zustand and NextJS. For some reason I am getting the following error: "Cannot access ‘createResettable’ before initialization". I am defining the function and importing it correctly? Not sure why I am getting this? ./quoteStore.ts import { createResettable } from "../_hooks/hooks"; // verified import is correct import { type

Read More
security

MFA with OTP security concern

I’m preparing to implement my own authorization server. I plan to add MFA support with OTP. I have a security concern regarding my way of understanding how it’s gonna work in my planned app. I plan to have 2 apps: Backend related service to handle authorization/authentication, Frontend app implemented in some framework for delivering UI

Read More
SQL

Having count(*)>1 and but ignore duplicate if same key

I used count(*) > 1 but it is showing duplicate rows as well. I want to see only unique rows Table: A id name class key 1 abc 1 ACB3 1 abc 1 ACB3 2 ccd 2 XY4 2 ccd 2 ZZ5 Result expected: id name class key 1 abc 1 ACB3 2 ccd 2

Read More
C++

Since when have the notifications registered by LdrRegisterDllNotification() started to work differently?

The Microsoft’s documentation about the function LdrRegisterDllNotification() states that DLL load notifications registered by this function: Registers for notification when a DLL is first loaded. This notification occurs before dynamic linking takes place. I wrote the following test program to test this assertion and while these notifications act according to the documentation in Windows 7

Read More
HTML

Images not displaying/deploying in Github Pages?

I just added a new section to my website on Github pages. But one specific image just isn’t displaying on the site. It displays locally but not through Github pages. Img code: <img src="./media/calculations.png" style="width: 40%;" class="center"> folder structure (media is a folder): media calculations.png index.html This is the exact same code for all my

Read More