October 22, 2024
Chicago 12, Melborne City, USA
security

Windows Property Pages: Domain Path Not Shown on Security Tab

When I want to set security permissions on a file or some other object, I need to open its property dialog end select the security tab. In order to add a domain user to set her permissions on the object, I can only select users or groups from the machine but not from the domain

Read More
SQL

Counting Active Transactions in SQL: Issues with Status Logic in Time Series Data

I am trying to create a SQL query to count active transactions month by month from a transaction_status table. Each transaction_id can have multiple statuses, with two key statuses: ENDORSEMENT_SUCCESS (when the transaction is active) and ENDORSEMENT_CLOSED_SUCCESS (when the transaction is closed). Problem: The challenge I’m facing is ensuring that: A transaction should only be

Read More
CSS

Context Menu positioning within scrollable element (angular)

I’m using cdk-virtual-scroll-viewport to display a large list of elements like below <cdk-virtual-scroll-viewport itemSize="115px" class="scrollable-card"> <div *cdkVirtualFor="let project projects"> <app-project-card [project]="project"></app-project-card> </div> </cdk-virtual-scroll-viewport> I have a contextmenu defined in app-project-card component like below <mat-card class="project-card" (contextmenu)="onRightClick($event)"> //other elements inside which are irrelavant </mat-card> <div style="visibility: hidden; position: fixed;" [style.left]="menuTopLeftPosition.x" [style.top]="menuTopLeftPosition.y" [matMenuTriggerFor]="menu"></div> <mat-menu #menu="matMenu"> <button mat-menu-item

Read More
C++

Arrays 2D – Maximum element in each column

In a family, the people are arranged in rows and columns. Male persons in the families are arranged in a row and females are arranged in a column. Find the eldest woman in each column. Write a program to find the maximum element in each column of the matrix. Input Format The input consists of

Read More
PHP

Stored Procedures, MySQL and PHP

I’ve been doing what I’m about to explain using ASP classic and ASP.Net with MSSQL Server for all that time and it works beautifully! Here below is the simplest example, one of MANY, and connection methods I have tried that utterly fails, just like all the rest. The SP works in MariaDb when Executed, but

Read More
C#

How to use unions in C for pseudo-polymorphism

Consider a data structure to describe blocks of a matrix in C: // Matrix block typedef struct { union { int i; double d; } *a; // pointer to first element in matrix block int k; // block index int p; // no. of block rows int q; // no. of block columns int m;

Read More
java

Databricks JDBC Insert into Array field

I am trying to insert some data into a databricks table which has Array fields (field1 & field2). I am using JDBC for the connection and my POJO class looks like this public class A{ private Long id; private String[] field1; private String[] field2; } I am using jdbcTemplate.batchUpdate(String sql, final List<Object[]> batchArgs, final int[]

Read More
templates

Attempting to use a template function with a single non-type template parameter

I tried a version of the prorgam that avoids recursion: #include <iostream> template <int N> constexpr int factorial() { int value = 1; // 0! = 1 for (int i = 1; i <= N; i++) { value *= i; } return value; } int main(int argc, const char * argv[]) { std::cout << factorial<5>()

Read More
HTML

jQuery selector for content without specific classname

This is my html markup: <ul class="list-unstyled mb-2"> <li class="mr-2 d-inline-block"> <p class="m-0"><i class="fas fa-birthday-cake mr-2" aria-hidden="true"></i>Age 26-34</p> </li> <li class="mr-2"> <p class="text-truncate m-0"><i class="fas fa-map-marker-alt mr-2"></i>City</p> </li> <li class="mr-2"> <p class="text-truncate m-0"><i class="fas fa-calendar-alt mr-2"></i>29.10.2024 - 29.10.2024</p> </li> <li class="mr-2"> <p class="m-0"><i class="fas fa-money-bill-alt mr-2"></i>50 USD</p> </li> </ul> Problem is that I dont know

Read More
Android

Why is the Paging3 PagingState not saving items?

I’m doing a pokedex example app in compose but the pagination works only if i close and reopen the application. override suspend fun load( loadType: LoadType, state: PagingState<Int, PokemonEntity> ): MediatorResult { val page = when(loadType) { LoadType.REFRESH -> 0 LoadType.PREPEND -> return MediatorResult.Success( endOfPaginationReached = true ) LoadType.APPEND -> { val lastItem = state.lastItemOrNull()

Read More