Most active questions
927 questions from the last 7 days
1
vote
4
answers
101
views
Returned from Postgres timstamptz always in UTC
I'm a little confused.
I have a Spring Boot application (Spring Boot version 4.0.1).
There's a simple DDL:
create table foo (
id serial not null primary key,
dt timestamptz not null
);
And an ...
2
votes
1
answer
95
views
Is there a way to get the QML engine within a registered C++ QML type object?
If I use a C++ object's property from QML like this:
class Cpp
{
...
Q_PROPERTY(... aProperty READ getAProperty
...
... getAProperty()
{
// which engine called me?..
}
};
// ...
4
votes
1
answer
120
views
Second GLFW window won't render?
I decided to try a dual screen to display the square as a wireframe vs a colored in square:
#include <GLAD/glad.h>
#include <GLFW/glfw3.h>
#include <iostream>
void ...
-3
votes
1
answer
122
views
Regex using qr/\Qstring\E/ vs. (map { qr/$_/ } ("\\Qstring\\E"))[0] [closed]
In an attempt to avoid switch /x for a complex regular expression, I tried to replace qr/string/ with the following expression:
(map { qr/$_/ } ("a more" . "complex regex"))[0]
As ...
1
vote
2
answers
96
views
ping --count option treating seemingly valid integer as error
I am working on an assignment that aims to reimplement the ping command. I need to have as a reference ping from inetutils-2.0, hence it is the one used in these examples.
While making parsing tests I ...
Advice
0
votes
7
replies
106
views
How to calculate a logarithm quickly; bit width of the answer is more important than the base
There are many Stack Overflow questions about fast logarithm calculation, but all of them presuppose that you want to calculate a logarithm using a specific base. Two, e, and 10 are popular bases.
I ...
3
votes
1
answer
92
views
How do I change column names for complex properties?
I have the following entity:
public class CPU
{
public int Id { get; set; }
public int Article { get; set; }
public int Garanty { get; set; }
public int ServiceLife { get; set; }
...
5
votes
1
answer
95
views
Api Platform DTO is not comprehensible
version
symfony
7.4
symfony/object-mapper
7.4
api-platform/symfony
4.2
php
8.4
Describe the problem
So I've been reading about the new recommandation for API Platform which is to use and map DTO ...
1
vote
1
answer
92
views
An null reference exception occurs when editing WPF styles and templates in MetroWindow
I'm just learning WPF and using the MahApps.MetroWindow library. I need to have advanced Controls settings in my app. Here's the way I found to do this: right click on the Control => Edit template =...
3
votes
2
answers
105
views
use while with multiple variables in the condition
When I add more than one variable in a while loop condition, the loop behaves unexpectedly.
cat script.sh
#!/bin/bash
string=Db6laokfKc
echo $string
klen=`echo -n "${string}" | wc -m` #10 ...
4
votes
1
answer
143
views
printf() not working on colab while running a CUDA c++ code
This is my first time working with CUDA programs. So I just wrote a simple hello world program.
#include <stdio.h>
__global__ void hello(){
printf("Hello block: %u and thread: %u\n"...
Best practices
0
votes
7
replies
94
views
Python nested comprehension: is possible return an attribute of function?
Mainly pseudocode: return function(item) if function(item) != item[index]
(I'm using Flask with session)
With this function above,
updated, (accelerated reworking following Tim Roberts suggestion):
...
3
votes
2
answers
61
views
Capture of 'objectIDNotifications' with non-Sendable type '[Notification]' in a '@Sendable' closure
I'm using Swift5 and SwiftUI making an app that based on CloudKit.
I've made the merge data from iCloud function and it looks work well. But I always get a warning like "Capture of '...
Best practices
1
vote
8
replies
144
views
How do you manage multiple if statements?
I am currently coding a project with many if statements to check certain values. I feel like all those statements seem inefficient and time-consuming in my program. How can I optimize or manage this ...
2
votes
2
answers
91
views
Make a new column based on the count of rows, in an existing column, that meet a condition
My dataframe is called detections. One column is OBSERVER. That column contains the initials of 32 different people. Some of those observers are responsible for 1000+ observations (i.e. 1000+ lines ...