StackOverflow.com

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

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

Middleware not redirecting server function invocations

15 July 2025 @ 9:14 am

I stumbled situation which makes middleware somewhat problematic for use for authentication in Nextjs App router. I have middleware which inside has following code: // If user is on protected route and has no session redirect to login page. if (isProtectedRoute && !session) { return NextResponse.redirect(new URL("/login", req.nextUrl)); } This normally works ok for example when navigating from browser/URL. Now, when I arrive at the above middleware when a server function is invoked, the redirect does not happen (although it enters inside if) and also the server function which triggered this middleware call is not invoked returning undefined. See below: startTransition(async () => { // Invoke the server function, this triggers middleware too - and inside middleware redirect is called // but redirect does

Collaborative Presentation on TYPO3 vs. Drupal at Drupal Camp Essen

15 July 2025 @ 9:13 am

I am an experienced Drupal CMS developer and actively involved in the Drupal community. TYPO3 serves a similar purpose to Drupal. I would like to give a presentation at the Drupal Camp on September 12th or 13th, 2025, at the Unperfekthaus in Essen, where the approaches of Drupal and TYPO3 will be compared in depth. This way, we could develop a valuable presentation. See more at Drupal Camp Ruhr: https://drupalcamp.ruhr Is there anyone among you with experience in TYPO3 development who would be interested in collaborating on a joint on-site presentation? Together, we could delve into and compare the approaches of TYPO3 and Drupal. I believe this would be exciting for all participants and provide a great opportunity for exchange. Please do not hesitate to send me a PM. I look forward to your responses!

Piecewise curve segment lengths from Pytorch

15 July 2025 @ 9:11 am

Most examples of pdist (or cdist) seems to be between two tensors. If I have a piecewise curve defined as follows: line=torch.tensor([(-104.6400,0.0000),(-104.6400,0.1500),(-103.5500,0.5140),(-98.1000,1.0775),(-92.6500,1.4553)]) what I have coded to get the segment lenghts is i=0 for point in line: if i>0: print(f"{i}: {pdist(previous_point,point)}") previous_point = point i += 1 Is this the best way or is there a more pytorchic way of doing it?

Building a complete binary tree using C# [closed]

15 July 2025 @ 9:05 am

build a complete binary tree, which will be stored in an array of the minimum required size, in the form (root, left element, right element, left descendant of the left element, right descendant of the left element, left descendant of the right element, right descendant of the right element, left descendant of the left descendant of the left element... etc.) You also need to create a method that provides recursive counting of the number of tree elements.

Why do bit manipulation intrinsics like _bextr_u64 often perform worse than simple shift and mask operations?

15 July 2025 @ 9:01 am

I'm working on performance-critical code and experimenting with different ways to extract bit fields from 64-bit integers. I expected that using intrinsics like _bextr_u64 (Bit Field Extract) would be faster or at least as fast as using manual bit manipulation with shifts and masks, like: uint64_t value = (x >> start) & ((1ULL << len) - 1); However, benchmarking shows that the manual version is often faster than using _bextr_u64. This seems counterintuitive since the intrinsic maps directly to a single x86 instruction (BEXTR), while the manual version requires multiple instructions. Why does this happen?

crypto order on interactive brokers - not being accepted see error message

15 July 2025 @ 9:00 am

Can anybody tell me what needs to be done to place a stock crypto order? I am replicating the code in the TestCppClient.cpp The order should be accepted and confirmed by interactive brokers "broker" as its in test environment and funds are there. My order is created thus; void TestCppClient::placeNewOrder(TradingMode mode, const std::string& action, const std::string& orderType, double quantity, double limitPrice) { std::cout << "[ORDERS] placing new Order " << std::endl; m_pClient->placeOrder(m_orderId++, ContractSamples::CryptoContract(), OrderSamples::LimitOrder("BUY", DecimalFunctions::stringToDecimal("0.12345678"), 3700)); return; } Note that the ContractSamples::CryptoContract() function is from stock demo Contract ContractSamples::CryptoContract() { //! [crypto_contract]

Access IIF statement to choose values from multiple tables

15 July 2025 @ 7:45 am

I have 3 Access 2010 tables cont, cond and prop. All tables have 3 fields: table cont the key ID_cont and the fields cond_ID and prop_ID that are related to the keys ID_cond and ID_prop of cond and prop respectively. Table cond and prop have alse nome and cognome fields. For each cont record only one field between cond_ID and prop_ID has a usable value and the other is -1. Table cont is: |ID_cont|prop_ID|cond_ID| | 55 | 1 | -1 | | 12 | -1 | 3 | | 37 | -1 | 1 | | 7 | 2 | -1 | Tables cond and prop are: |ID_cond| nome |cognome| | 1 |Giulio |Rossi | | 2 |Sergio |Bianchi| | 3 |Roberto|Mancini| |ID_prop| nome |cognome| | 1 |Anna |Verdi | | 2 |Luigi |Sacchi | | 3 |Antonio|Merli | I need a query that once I selected an ID_cont it returns only nome and cognome choosing the table cond or prop that has no -1 value in prop_ID and cond_ID. For example for ID_c

Digital Ocean space issue [closed]

15 July 2025 @ 7:44 am

Deprecated: Using ${var} in strings is deprecated, use {$var} instead in /var/www//public/wp-content/plugins/ilab-media-tools/classes/Tools/Storage/Driver/S3/DigitalOceanStorage.php on line 103 this is the error which I got when I change the S3 bucket to DigitalOcean Space, has anyone had idea how can i solve this issue? I asked this issue from ChatGPT and it said you can change it manually in the file.

Responsive sidebar inside a floating / full-screen chat widget – HTML, CSS, JS

15 July 2025 @ 7:37 am

I’m building a floating chat widget that can be Minimized (small) size: 400 × 600 px (bottom-right corner) sidebar is collapsed (≈ 30 px) and can be toggled open to 100% when the user closes / re-opens the widget, the sidebar must start collapsed again regardless of its previous state. Maximized (fullscreen) sidebar is always fully open 250 px and cannot be collapsed when the user restores the widget back to the small floating mode, the sidebar must reset to the collapsed 30 px state. Current problems After entering full-screen and then restoring to the small mode, the sidebar retains whatever width it had (open or closed) instead of resetting to 30 px. On desktop widths, the 30 ↔ 250 px toggle works, but the state is not reset when the widget is minimized / re-opened. The same classes (expanded, fullwidth, etc.) are reused for both modes, so the CSS

Unexpected compiler warning - printf format specifiers

15 July 2025 @ 7:16 am

I have the following warning generated by a printf(): warning: format '%llu' expects argument of type 'long long unsigned int', but argument 7 has type 'uint64_t' {aka 'long unsigned int'} [-Wformat=] Although I want to create a warning-free code, I think that the compiler is way too over-zealous. Because: long unsigned is unsigned and has 64 bits (it is there, in the text of the message) long long unsigned is also unsigned, and cannot be shorter than 64 bits (C standard, in comparison to unsigned long), and also cannot have more than 64 bits (hardware limitation, not enough bits in the processor registers). So for any practical purpose, long unsigned and long long unsigned are actually the same thing, right? Even more, while long unsigned can have 32bits on some platforms (e.g., Widows), long long unsign

odysee.com

VN:F [1.9.22_1171]
Rating: 9.0/10 (3 votes cast)

Less censorship more entertainment. Alternative YouTube.

mewe.com

VN:F [1.9.22_1171]
Rating: 9.0/10 (2 votes cast)

Social networks without the ads and invasion of privacy, alternative to Facebook.

Hopefully it will stay this way.

who-called.co.uk

VN:F [1.9.22_1171]
Rating: 9.0/10 (2 votes cast)

Who called me, check with others to see if you have a scam caller.

freedomcells.org

VN:F [1.9.22_1171]
Rating: 9.0/10 (1 vote cast)

Freedom Cells are peer to peer groups organising themselves in a decentralised manner with the collective goal of asserting the sovereignty of group members through peaceful resistance and the creation of alternative institutions.

rumble.com

VN:F [1.9.22_1171]
Rating: 8.7/10 (3 votes cast)

Another alternative to the censorship of YouTube.

en.whotwi.com

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

Graphical twitter user statistics

Flickr.com

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

Almost certainly the best online photo management and sharing application in the world

Blue Flower - Spring Floral Dress

4 March 2025 @ 7:29 am

So What Do I say?

13 February 2025 @ 3:18 am

Snacking on Hot Chips in Dubai

14 January 2025 @ 12:13 pm

465 (260)a.. austria cart

14 January 2025 @ 9:33 am

2025 -3

1 January 2025 @ 3:54 pm

Wife - 10468

22 September 2024 @ 8:45 am

Couleurs - Colors

6 September 2024 @ 2:26 pm

Sass Rigais - Dolomites Italian Alps

25 August 2024 @ 6:23 am

halfbakery.com

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

Half baked ideas going way back.

bitchute.com

VN:F [1.9.22_1171]
Rating: 8.0/10 (4 votes cast)

Video sharing that may not be allowed (censored) on youtube.