October 22, 2024
Chicago 12, Melborne City, USA
C#

Are multiple identical prototypes legal?

The following code does not emit any warnings when compiled with both gcc and clang on Linux x64: #include <stdio.h> #include <stdlib.h> void foo(void); void foo(void); void foo(void); int main(void) { return 0; } IMO, it’s legal according to the following snippets from C99: All declarations that refer to the same object or function shall

Read More
java

Why Open Telemetry Java Agent Extension doesn't work

I’m trying to create an extension to the Otel Java Agent that will open a span for each method the flow goes through. My Test Main: package org.example; import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.trace.Span; import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.context.Scope; import io.opentelemetry.exporter.otlp.trace.OtlpGrpcSpanExporter; import io.opentelemetry.sdk.OpenTelemetrySdk; import io.opentelemetry.sdk.trace.SdkTracerProvider; import io.opentelemetry.sdk.trace.export.BatchSpanProcessor; import io.opentelemetry.sdk.trace.export.SpanExporter; import java.time.Duration; /** * @author David Dvash */ public

Read More
python

Modify API gateway response

How can I send custom error message using API gateway Presently, the DENY responses are returned with "User is not authorized to access this resource with an explicit deny" I want to change the message to "Not allowed" You need to sign in to view this answers

Read More
GPL

Free GPL WordPress eCards

NEW! Version 5.4.3 is out, and it brings more speed and more block editor compatibility! Create your personalized email templates and use tags and shortcodes to include custom details and content. Read more here. No more external CSS, everything is now inlined for Critical CSS benefits! Faster page load and 100% compatibility with the block

Read More
javascript

Reveal.js does not load in a dynamic SPA view loader

I am trying to dynamic load Reveal.js inside a basic SPA router in vanilla JS, but I simply can’t get Reveal.js running. I get the background, so it is recognized and the files are loaded. It just doesn’t give me the slides correctly. I simply can’t find the solution neither with Google, LLM’s or anything

Read More
templates

C++ template: access members from source template struct

I want to create following class template: Holds a list of objects of different classes, at compile time. Being alled to do some computation on all members from a function. Has a member to access each object of the list individually. List and members can be created at compilation, no need for dinamic lists. User

Read More
SQL

COUNT with WHERE condition doesn't return all rows

I’m writing a solution for a DataLemur SQL question and I almost had it right but there is one row missing. I have written this query myself: WITH CTE AS ( SELECT user_id, transaction_date, DENSE_RANK() OVER (PARTITION BY user_id order by transaction_date) as ranked_transact FROM user_transactions ) SELECT transaction_date, user_id, COUNT(user_id) as purchase_count FROM CTE

Read More
CSS

How can I achieve absolute positioning on a flex element?

I created following component <!-- AppBar.vue --> <template> <v-row> <v-spacer></v-spacer> <v-btn text="Our plans"></v-btn> </v-row> </template> and when used it looks like this But when I change its position to be absolute like this <div style="background-color: burlywood" class="h-screen" > <v-container class="fill-height position-relative"> <AppBar class="position-absolute top-0" /> </v-container> </div> it is rendered like this What am I

Read More
C++

Create instance of a imported python class with C API

I want to create an instance of a Python class with the C API. My specific use case is the PySerial Object. My Python code would be: import serial test = serial.Serial() I couldn’t find any clue or Tutorial for doing so. The only thing I think to know is to declare it as a

Read More
HTML

Horizontal scroll: sticky element starts moving when scrolling to a certain point

Scenario: There are many rows… each row has a sticky element on the left, a larger content div on the right. It should be possible to horizontally scroll all rows together and the sticky elements should stay on their initial position. The issue: When scrolling further than the width of the scrollable container (minus the

Read More