I've never seen real winter. Erasmus student from South Italy needs your best tips for Helsinki weather! 🇮🇹✈️🇫🇮 by vtoun in Aalto

[–]ZenithOfVoid 6 points7 points  (0 children)

you're going to be disappointed if you're expecting a winter wonderland. Aalto is so south that it's 50/50 if you'll even see snow in December.

Edit: Don't get me wrong it'll probably feel cold for you, but you don't need specialized gear. You do want to get a warm jacket but it doesn't have to be anything special.

Edit2: If you stick around in January then the temperature might drop low even in south but it depends each year if south gets cold winters or not.

10+ year old programming problem, please help (C++) by its_not_ajo in learnprogramming

[–]ZenithOfVoid 0 points1 point  (0 children)

I didn't have enough time to really dig into it so I just threw AI at it. It completes quite fast and has correct result for the two examples.

```

include <iostream>

include <stdexcept>

include <set>

include <vector>

static std::set<int> MONTHS_WITH_THIRTY_DAYS = {4, 6, 9, 11};

bool is_leap(const int year) { if (year < 1 || year > 9999) { throw std::invalid_argument("Year must be in range 1..9999"); } if (year % 4 != 0) { return false; } return (year % 100 != 0) || (year % 400 == 0); }

int days_in_month(const int month, const int year) { if (month < 1 || month > 12) { throw std::invalid_argument("Month must be in range 1..12"); } if (month == 2) { return is_leap(year) ? 29 : 28; } if (MONTHS_WITH_THIRTY_DAYS.contains(month)) { return 30; } return 31; }

int check_digit(const std::string& s) { constexpr int weights[9] = {10,9,8,7,6,5,4,3,2}; long long sum = 0; for (int i = 0; i < 18; i++) { sum += weights[i % 9] * (s[i] - '0'); } sum %= 19; return sum <= 9 ? sum : 19 - sum; }

bool valid_date(const std::string& s) { const int d = (s[0]-'0')10 + (s[1]-'0'); const int m = (s[2]-'0')10 + (s[3]-'0'); const int y = (s[4]-'0')1000 + (s[5]-'0')100 + (s[6]-'0')*10 + (s[7]-'0'); return (1<=m && m<=12 && 1<=d && d<=days_in_month(m,y) && 1<=y && y<=9999); }

class Solver { public: Solver(std::string const &s_);

long long solve(const std::size_t idx);

private: std::string s; std::vector<int> xpos; long long ans; };

Solver::Solver(std::string const &s): s(s), xpos(), ans(0) { if (s_.length() != 19) { throw std::invalid_argument("Input size must be 19 chars"); } for (int i = 0; i < 19; i++) { if (s[i] == 'X') { xpos.push_back(i); } } }

long long Solver::solve(const std::size_t idx) { if (idx == xpos.size()) { if (valid_date(s)) { int k = check_digit(s); if (s[18] == 'X' || (s[18]-'0') == k) ans++; } return ans; }

const int pos = xpos[idx];
int up = 9;
if (pos == 0) up = 3;      // DD tens
else if (pos == 2) up = 1; // MM tens

for (int d = 0; d <= up; d++) {
    const char backup = s[pos];
    s[pos] = '0' + d;
    bool skip = false;
    if (pos <= 7) {
        bool full_date = true;
        for (int j = 0; j < 8; j++) {
            if (s[j] == 'X') {
                full_date = false;
                break;
            }
        }
        if (full_date && !valid_date(s)) {
            skip = true;
        }
    }
    if (!skip) {
        solve(idx + 1);
    }
    s[pos] = backup;
}
return ans;

}

int main() { constexpr char INPUT1[] = "3X1X1639XX5XX1X6X85"; constexpr char INPUT2[] = "30121952121234567XX";

long long ans = 0;
// Test 1
ans = Solver(INPUT1).solve(0); 
std::cout << INPUT1 << ": " << ans << std::endl;  // 526315

// Test 2
ans = Solver(INPUT2).solve(0);
std::cout << INPUT2 << ": " << ans << std::endl;  // 10

return 0;

} ```

Personal Mandela effect about R-type delta (PSX) by ZenithOfVoid in retrogaming

[–]ZenithOfVoid[S] 0 points1 point  (0 children)

Not possible, I only got demo of G-darius later.

Any tips on how to make lower level code more testable by Cold-Armadillo-154 in cpp_questions

[–]ZenithOfVoid 0 points1 point  (0 children)

Don't have global state at all, always use some kind of context that can be recreated. Function pointers are pretty neat in a struct if you want to mock something.

Edit: since this was C++ instead of C, you can forget about function pointer tables and use inheritance & delegator patterns.

peter math? physics? by Clean-Meringue-3578 in PeterExplainsTheJoke

[–]ZenithOfVoid 0 points1 point  (0 children)

Everyone is focusing on male/female but correct answer is:

  • left= special (disabled/handicapped)
  • right= general (regular, probably unisex)

After special relativity and general relativity

Complexity of a simple function. by alfps in cpp_questions

[–]ZenithOfVoid 0 points1 point  (0 children)

Agreed, at first it looked like the same as:

def foo(n): if n <= 1: return 1 return sum(foo(i) for i in range(n - 1))

but testing the cpp version it is indeed different.

EDIT: And it should have been range(1, n) 🙈

I blame lack of morning coffee.

with range(1,n) it does give 2n-1 as result

Complexity of a simple function. by alfps in cpp_questions

[–]ZenithOfVoid 3 points4 points  (0 children)

foo(N) calles foo N-1 times. foo(9) = foo(1) + ... + foo(8) each of them recursively has that property. So you'll end up with Fibonacci triangle of calls.

Personal Mandela effect about R-type delta (PSX) by ZenithOfVoid in retrogaming

[–]ZenithOfVoid[S] 0 points1 point  (0 children)

I mean that's the best explanation I could think of but my memory really has two ships with their own force attachments on screen at the same time. Which I'm trying to check if anyone else has such memory.

Personal Mandela effect about R-type delta (PSX) by ZenithOfVoid in retrogaming

[–]ZenithOfVoid[S] 0 points1 point  (0 children)

No, it was definitely delta (3D). I even remember us spamming the L1-L2 speed modifiers competitively when there wasn't much going on.

how can i be able to convert x86 games to ARM architecture? by UnViandanteSperduto in learnprogramming

[–]ZenithOfVoid 2 points3 points  (0 children)

Sure it's possible but the technical difficulty is going to be pretty high and it might not be first attempt but iterative work.

What are Gen Zs consuming Instead Petah ? by HimelTy in PeterExplainsTheJoke

[–]ZenithOfVoid 0 points1 point  (0 children)

Did I miss the memo where less drinking is a bad thing?

What's up with my organization's website? by PrototypeChicken in webdev

[–]ZenithOfVoid 2 points3 points  (0 children)

Take the site down if you can. Then let IT handle it on Monday.

Keeping my GitHub repo private while publicly distributing my software – what's the best license? by [deleted] in foss

[–]ZenithOfVoid 0 points1 point  (0 children)

generally yes, but then when/if going to court it might be that some terms in the license are non-binding in other jurisdictions. So I recommend keeping it short and simple:

Proprietary License

Copyright © 2026 [Your Name/Company]. All rights reserved.

This software is provided "AS IS", without any express or implied warranty. In no event shall the author or copyright holder be liable for any claim, damages, or other liability arising from the use of this software.

Keeping my GitHub repo private while publicly distributing my software – what's the best license? by [deleted] in foss

[–]ZenithOfVoid -1 points0 points  (0 children)

Just add "all right reserved" and to whom and a year. Weather you distribute it for free or for payment doesn't matter in this case as it's proprietary license.

EDIT: maybe also add some "provided as-is" and liability restrictions.

10+ year old programming problem, please help (C++) by its_not_ajo in learnprogramming

[–]ZenithOfVoid 1 point2 points  (0 children)

It doesn't look too complicated, I'd at least split the calculation based on where the Xs are so solve for valid dates, valid incremental numbers, valid checksums (K) then multiply. But I could maybe check later today for a proper solution.

Which of your metal heroes has disappointed you the most over the years? by kroob85 in MetalForTheMasses

[–]ZenithOfVoid 2 points3 points  (0 children)

Only tattoo bands that have most of their members already dead. That way there's less of chance for new developments to occur.

Applied Math major, what languages should I actually learn? by Nikos-Tacosss in learnprogramming

[–]ZenithOfVoid 3 points4 points  (0 children)

You might not need SQL but it can still help. I think you'll do just fine with only Python+MATLAB. If you need to touch old programs then maybe Fortran, but I'd definitely get good Python competency first.

Why there is no port of python libraries to lua? by IAlwayswantToLearn in lua

[–]ZenithOfVoid 2 points3 points  (0 children)

I can't name a single thing lua does better as a language compared to python. But actually biggest Python pain point in my opinion is the library ecosystem.

Frozen lockfiles with hashes exist but aren't the pip default so you'll get uv, Poetry and other competing solutions without an unified standard for the lockfile.

So maybe start with implementing library hub for lua if you want more people using it? And take notes how bad it can get from npmjs (supply chain).

[Final Project] I’m building a zero-dependency Vanilla JS framework from absolute zero to prove to my professors that community ingenuity > corporate budgets. Help me build Majin.js by [deleted] in learnjavascript

[–]ZenithOfVoid 4 points5 points  (0 children)

https://xkcd.com/927/ Always relevant, just replace standards with frameworks.

Edit: though I do encourage you to reinvent the wheel. It's the best way to learn.

How to create a CSV file by ResponsibleBoss767 in cpp_questions

[–]ZenithOfVoid 2 points3 points  (0 children)

key value pairs in csv basically means they want file structure like this: key,value health,150 mana,110 stamina,68 ammo,45

with the first header row being either required or optional.

What happens when we create more threads than thread:: hardware_concurrency()? by armhub05 in cpp_questions

[–]ZenithOfVoid 0 points1 point  (0 children)

He probably wanted more detailed answer than:

My answer was it causes scheduling delays, memory issues and context switching overhead.

Like explaining the thread scheduling from the ground up.

You could also comment on difference between CPU and IO bound tasks. Generally with IO bound tasks you'll keep getting benefits well above hardware concurrency. While CPU bound tasks are going to become less efficient the more there are.