Random snippets of all sorts of code, mixed with a selection of help and advice.
RCX in loop produces infinite loop and RBX performs correctly
22 November 2025 @ 4:04 pm
i am currently learning assmebly and was studying loops and i wrote this
section .data
msg db "looping", 0xa
len equ $ - msg
section .text
global _start
_start:
mov rcx, 10
loop_start:
mov rax, 1
mov rdi, 1
mov rsi, msg
mov rdx, len
syscall
dec rcx
jnz loop_start
mov rax, 60
mov rdi, 0
syscall
But this continues as infinite loop
in the same code if rcx is replaced with rbx it prints "looping" 10 times
Why is this so??
please help.
Using .Net 10 and SwaggerUI to handle complex data in a GET Request
22 November 2025 @ 3:57 pm
I have a simple .Net 10 Minimal Api that I'm testing with SwaggerUI as :
public class Input {
public string? StringVal { get; set; } = "";
public string[] ArrayVals { get; set; } = [];
public static bool TryParse(string? json, out Input input) {
input = new Input();
return true;
}
}
public class DummyEndpoints {
public DummyEndpoints (WebApplication app) {
app.MapGet("/getTest", this.GetTest);
}
private IResult GetTest(HttpContext context, [FromQuery] Input input) {
Console.WriteLine(input.StringVal);
Console.WriteLine(input.ArrayVals.Length);
return Results.Ok("Get Test");
}
}
I'm trying to receive more complex Input with the GET Request, SwaggerUI is correctly showing the input type :
{
"stringVal": "string",
"arrayVals": [
"string"
]
}
But testi
Calling static function from inline function in C
22 November 2025 @ 3:44 pm
In C, if I call a static function from an inline function, I typically get a compiler warning like
warning: static function <name> is used in an inline function with external linkage [-Wstatic-in-inline]
According to the C23 standard 6.7.5.3:
An inline definition of a function with external linkage shall not contain, anywhere in the tokens
making up the function definition, a definition of a modifiable object with static or thread storage
duration, and shall not contain, anywhere in the tokens making up the function definition, a reference to an identifier with internal linkage
Is it not allowed to call a static function from an inline function? If so, why? Is it because a static function can use a non-const static variable, and if the definitions are included into several translation units, the different inline definitions will access different copies of the static variable via the static function which may b
AdMob saying `Play app disabled` even though app is published
22 November 2025 @ 3:41 pm
One of our Google Play accounts was not verified for a while so yearlier this year Google. removed its apps from the Store. We verified it and last week we uploaded a new version with an AdMob integration for ads serving. 4 or 5 days ago we passed AdMob approval review but still the ads are not visible. The AdMob console's Policy center shows Restricted ad serving for this app and states Play app disabled as an issue. Additionally it says in the What to do: Some advertisers are choosing not to advertise on your app because of issues detected by Google Play. This issue won't affect your AdMob account, but may put your Google Play account at risk. To fix the issue, go to Google Play and follow the instructions. Note that it may take up to 7 days for the issue to be reviewed. The thing is that the app is published correctly in Play Store and there are no policy violations shown in the App content for the app in Play Store
Flutterwave Webhook Not Triggering in Production (Works on Development)
22 November 2025 @ 3:39 pm
I am integrating Flutterwave payments in my project(Node.js/Express).
In development, deposits work correctly:
User pays;
Flutterwave triggers the webhook;
Payment gets verified and the user balance is updated.
However, in production, the payment is successful on Flutterwave and the company receives the money, but:
The webhook does not verify the payment;
The user balance is not updated;
The webhook URL for production is set correctly on the Flutterwave dashboard, and the FLW_SECRET_HASH environment variable is also set correctly.
One strange thing I noticed is that the webhook logs appear in development but not in production (Render hosting). It seems like the webhook request is not reaching the server or the raw body is not parsed correctly.
Has anyone experienced this before with Flutterwave webhooks on production? What could cause the webhook to stop working only after deployme
Dockable panel height issue revit api - wpf
22 November 2025 @ 3:38 pm
I have an issue with setting the height of a Dockable Panel in Revit. I created a panel that should appear at the bottom of Revit with a fixed height (for example, 50 px). However, every time I start Revit, the panel loads with a larger height than what I specified.
I'm using WPF, and I've already tried setting the height in:
the XAML, the code-behind, and in App.cs, but the panel still opens with the wrong height. How can I force the Dockable Panel to always load with the correct height?
data.InitialState = new DockablePaneState
{
DockPosition = DockPosition.Bottom,
MinimumWidth = 400,
MinimumHeight = 75
};
Difference between the .bashrc .profile file in linux [closed]
22 November 2025 @ 3:35 pm
I was learning about .bashrc and .profile and i got confusing that we are having .profile in /home/user and we also have .profile /etc/profile sow what is thee difference i am getting confused about where should i add any environment variable.
Can static function be called from inline function in C?
22 November 2025 @ 3:22 pm
In C, if I call a static function from an inline function, I typically get a compiler warning like
warning: static function <name> is used in an inline function with external linkage [-Wstatic-in-inline]
According to the C23 standard 6.7.5.3:
An inline definition of a function with external linkage shall not contain, anywhere in the tokens
making up the function definition, a definition of a modifiable object with static or thread storage
duration, and shall not contain, anywhere in the tokens making up the function definition, a reference to an identifier with internal linkage
Is it not allowed to call a static function from an inline function? If so, why? Is it because a static function can contain a non-const static variable, and if the definitions are included into several translation units, the different inline definitions will access different copies of the static variable via the static function which m
Returning multiple columns and count of duplicates with GROUP BY clause
22 November 2025 @ 2:20 pm
I'm searching for duplicate values per column and need a count of them and data from some additional columns.
This returns the correct result:
SELECT
Name, email, COUNT(email)
FROM
table
GROUP BY
Name, email
HAVING
COUNT(email) > 1
ORDER BY
COUNT(email) DESC
Now, I need rows with duplicate email. I need to list BillNr which is different on each row and then count occurences of email.
This naturally gives empty recordset. (Thanks @jarlh!)
SELECT
BillNr, Name, email, COUNT(email) as
FROM
table
GROUP BY
BillNr, Name, email
HAVING
COUNT(email) > 1
ORDER BY
COUNT(email) DESC
Result should be like:
BillNr
Name
email
CountEmail
1000
Shakira
[email protected]
3
1001
Does SQLite support calling from a TRIGGER a user-defined function that uses the WITH clause?
22 November 2025 @ 1:55 pm
I have a database that implements a very simple tree structure with a table, hierarchy, which has two columns, parent and child.
CREATE TABLE hierarchy (
parent INTEGER,
child INTEGER,
PRIMARY KEY(parent, child)
);
I need to ensure that there are no cycles on the graph defined by the table's rows. For example, if hierarchy has (1, 2) and (2, 3), inserting (3, 1) or using UPDATE to change (2, 3) to (2, 1) should not be allowed. To do this, I figured the most appropiate way to do this would be defining two TRIGGERs (one for INSERT and another for UPDATE) that would check if the command would create a cycle in the database. I would also need recursion for this, so I would need the WITH clause.
However, according to section 5 of SQLite's documentation on the WITH clause, it cannot be used within a TRIGGER. Thus, I moved