StackOverflow.com

VN:F [1.9.22_1171]
Rating: 8.5/10 (13 votes cast)

Random snippets of all sorts of code, mixed with a selection of help and advice.

Can a SK_SKB program use data and data_end?

14 March 2026 @ 9:42 pm

Can SK_SKB programs (parser or verdict) use the fields data and data_end from its context struct __sk_buff? I ask that because the following code prints the length correctly for skb->len, while data_end - data prints 0. SEC("sk_skb/stream_parser") int bpf_prog_parser(struct __sk_buff *skb) { void *data = (void *)(long)skb->data; void *data_end = (void *)(long)skb->data_end; bpf_printk("PARSER, len: %d %d", skb->len, data_end - data); return skb->len; } The official documentation of SK_SKB says that data , and data_end should be readable. And I'm aware that bpf_skb_load_bytes can be used to read from the skb context, but I wonder if data and data_end could be

How can i allow the user to use class specific methods in generic class T?

14 March 2026 @ 9:11 pm

I am making a custom LinkedList<T> in java, as a way to learn more about data structures, and i am trying to make a search method, that filters items based on the input, but i ran into an issue, Classes other than primitive types require the use of their own dedicated methods to compare them, such as a .getGrade() on a Student, how could i accommodate for such in my code? Attached is current search method that does not compare content inside classes: public CustomLinkedList<CustomNode<T>> search(T data){ CustomLinkedList<CustomNode<T>> result = new CustomLinkedList<>(); CustomNode<T> currentNode = headNode; if(currentNode.value() == data) result.insert(currentNode); while(currentNode.next() != null){ currentNode = currentNode.next(); if(currentNode.value() == data) result.insert(currentNode); } return result; }

SQL Server Truncate and Select operations

14 March 2026 @ 9:11 pm

I've just started learning SQL and there's something I don't understand. Since SQL commands are processed one by one, why isn't the data in the table deleted when I run a TRUNCATE operation after a SELECT statement? All records are deleted correctly when I run only the TRUNCATE command, but not when both SELECT and TRUNCATE are executed together. Can someone explain the logic behind this?

ASP.NET Core Web API keeps exiting with exit code 0 (0x0) when debugging

14 March 2026 @ 9:08 pm

I'm currently working on an ASP.NET Core Web API project solution that has the following three sub-project directories: - API/ - Core/ - Persistence/ For my project, I want the Core to handle the service and lifecycle of the Persistence. Ideally, I want the API to be nothing but a simple gateway into the Core project - it shouldn't know anything about the Persistence or other sub-projects. To handle this, I have created a runtime class in Core: namespace Kumi.Core; public class KumiRuntime(IServiceProvider services) : IHostedService { public async Task StartAsync(CancellationToken cancellationToken) { using var scope = services.CreateScope(); var db = scope.ServiceProvider.GetRequiredService<KumiDbContext>(); await db.Database.MigrateAsync(cancellationToken); } public Task StopAsync(CancellationToken cance

What online tools do developers use for quick tasks (JSON, Base64, UUID, etc.)?

14 March 2026 @ 8:58 pm

What online tools do developers commonly use for quick tasks during development? For example, sometimes I need small utilities like JSON formatting, Base64 encoding/decoding, UUID generation, timestamp conversion, or simple text processing. There are many websites that provide these kinds of tools. Recently I came across https://free-online.dev, which provides a collection of small client-side utilities that run directly in the browser. Since everything runs locally, it feels fast and privacy-friendly. I'm curious what other websites developers here commonly use for similar quick tasks. Are there any tool sites you frequently rely on during development?

Run a mysql command from a bat file without prompting for a password

14 March 2026 @ 8:54 pm

I am trying to issue a mysql command from a windows bat file without prompting for a password. I can get the command to work if I provide the password in the command string, but for security reasons, I cannot. I have added the following to client section of the my.ini file in the C:\ProgramData\MySQL\MySQL Server 8.0 folder. [client] user="user" password="xxxxx" but I when I run the bat file it still fails with : ERROR 1045 (28000): Access denied for user 'user'@'localhost' (using password: NO) I'm sure that I'm missing something - any help would be greatly appreciated! Thank you!

"Duplicate keys" tag error when deploying - how to fix?

14 March 2026 @ 8:47 pm

ERROR: ValidationError: Tags contain duplicate keys; tag keys must be unique status code: 400, request id: f64033fd-a227-4149-81e2-61d940964033 We are suddenly getting this error when attempting to deploy an application. I have torn down the entire rack and reinstalled it, and still getting the above. Hugely frustrating. Could this be related to the app tag in Amazon Elastic Container Service? @Convox it'd be great if you could provide some better error messages from the CLI if you aren't willing to provide basic support.

Azure App Insights with Container Apps (Cloud Native BuildPacks)

14 March 2026 @ 8:17 pm

Azure App Insights with Container Apps (Cloud Native BuildPacks) is not working. I get "Not available: couldn't connect to your application" when I go to live metrics. This is a Spring Boot App I have added this env var to my container: APPLICATIONINSIGHTS_CONNECTION_STRING Also this one: BP_JAVA_APP_INSIGHTS_ENABLED This query in the App Insights logs requests | sort by timestamp desc | take 10 shows 0 results I have added the spring-boot-starter-actuator too even though I know it's not mandatory. Nothing seems to work. How can I make it work? I do get some logs like; Picked up JAVA_TOOL_OPTIONS, Loading the Java Booster OpenTelemetry, [K8SE/azure-javabooster-agent] It seems like my app is sending data but azure is not reading them somehow. Full Logs: 2026-03-14T21:2

How does CSS Flexbox handle alignment and spacing between items in a responsive layout?

14 March 2026 @ 7:59 pm

1)how does flexbox work ? 2)What property makes an element a flex container? 3)Flexbox is mainly used for which type of layout? 4)What does flex-wrap: wrap do? 5)Which property controls how much a flex item grows relative to others?

Why does Python have `hash(-1) == hash(-2) == -2`?

14 March 2026 @ 7:29 pm

I'm not sure how to really motivate this question, but in playing around with integer hashes in Python (3.14.3, but I imagine this has been the case for many versions), I noticed that for almost any int z, we have hash(z) == z (ignoring numbers larger than machine ints). This makes a ton of sense as hash(val) returns an int, and if val is an int to begin with, why make it more complicated? However, the lone exception I found is hash(-1) == -2. I'm certain there must be a reason for this implementation choice, but I've been unable to find one in my searches.