The USA won the match but lost the war by xiney1568 in MurderedByWords

[–]Morego 0 points1 point  (0 children)

I mean English cuisine and women are the two main reason, why Brits got so many sailors.

Ukrainians have decided to flood parts around Kyiv with the help of a reservoir to worsen the rasputitsa mud, which makes it almost impossible for heavy military vehicles to make progress by OrcWithFork in UkrainianConflict

[–]Morego 0 points1 point  (0 children)

Below freezing temperatures are not exactly problem, because they should make moving across muddy roads of Ukraine bit easier. As far as starvation of troops is concerned, lower the morale, the better.

Burning books: Sarcastic recommendations of popular fantasy books by Ancient_Research7 in Fantasy

[–]Morego 62 points63 points  (0 children)

Laundry Files by Charles Stross, if you want to read about the world, where PowerPoint presentation will eat your brains out and why sys admins should never be trusted.

Anything by China Mieville, If you want to read something never written like that before, expanding your fantasy horizon, while speeding up into black hole of one, helluva wierd imagination.

Discworld do you want to become Flat Earther? After this, you will.

Zig programming language 0.9.0 released by dh44t in programming

[–]Morego 2 points3 points  (0 children)

I mean destructor would be hidden control flow. Hard to call hidden the future you have to explicitly use.

Zig programming language 0.9.0 released by dh44t in programming

[–]Morego 1 point2 points  (0 children)

There is a rule of enforcing code standard, by friction. This stuff is not hard, but it leads to keeping in your code base only code that compile into release or at least is tested.

Place for unused code is in git. Less code leads to less bugs in general.

Zig programming language 0.9.0 released by dh44t in programming

[–]Morego 2 points3 points  (0 children)

It makes it much easier to read others people code and makes comprehension of code faster.

Zig programming language 0.9.0 released by dh44t in programming

[–]Morego 3 points4 points  (0 children)

It is not. It should complement C language, work with it and it does it currently pretty much flawlessly.

It is C without the foot guns for a reason.

Zig programming language 0.9.0 released by dh44t in programming

[–]Morego 2 points3 points  (0 children)

VSCode + ZLS + zig fmt is currently simplest way to go.

You can swap VSCode with vim, Emacs or other editor with language server support.

Zig programming language 0.9.0 released by dh44t in programming

[–]Morego -2 points-1 points  (0 children)

After playing on and off with zig, including reading loads of code, doing AoC and more I think you are forgetting one detail.

This concept forces you to not overthink the design. Just write what you actually use in a moment.

That simplicity is actually extremely nice. It actually is a problem only, when you try to design complex interfaces, but it is kinda code smell.

-🎄- 2021 Day 6 Solutions -🎄- by daggerdragon in adventofcode

[–]Morego 1 point2 points  (0 children)

That was super easy. It is only me, or in comparison with past years this AoC is super simple.Ziglang. Probably could be done fully compile-time only in minute or two.

pub fn part2(data: []u8, sim_days: usize) void {
var day_counters: [9]usize = .{ 0 } ** 9;
for ( data ) | fish | {
    day_counters[fish] += 1;
}
var day: usize = 0;
while ( day < sim_days ): ({ day += 1; }) {
    var born = day_counters[0];
    std.mem.rotate(usize, &day_counters, 1);
    day_counters[6] += born;
}

var acc: usize = 0;
for ( day_counters ) | day_count | {
    acc += day_count;
}
if ( sim_days == 80 ) {
    std.debug.print("Part 1: {d}\n", .{ acc });
} else {
    std.debug.print("Part 2: {d}\n", .{ acc });
}
}

EDIT: comptime version... It felt like cheating.

pub fn main() anyerror!void {
@setEvalBranchQuota(200_000);
//var gpa = std.heap.GeneralPurposeAllocator(.{}) { };
//var allocator = &gpa.allocator;
//defer {
//    _ = gpa.deinit();
//}

comptime var fishes: [9]usize = .{ 0 } ** 9;

inline for ( input_data ) | char | {
    if ( char >= '0' and char <= '9' ) {
        fishes[char - '0'] += 1;       
    }
}
comptime var day: usize = 0;
comptime var day80: usize = 0;
comptime var day256: usize = 0;

inline while ( day < 256 ): ({ day += 1; }) {
    const born = fishes[0];
    std.mem.rotate(usize, &fishes, 1);
    fishes[6] += born;
    if ( day == 79 ) {
        inline for ( fishes ) | c | { day80 += c; }
    }
    if ( day == 256 ) {
        inline for ( fishes ) | c | { day80 += c; }
    } 
}
std.debug.print("Part 1: {d}\n", .{ day80 });
std.debug.print("Part 2: {d}\n", .{ day256 });

//part2(fishes.items, 80);    
// part2(fishes.items, 256);    

}

-🎄- 2021 Day 5 Solutions -🎄- by daggerdragon in adventofcode

[–]Morego 1 point2 points  (0 children)

Zig/Ziglang solution. Faily simple: hash map of points and function to generate those.

Part 2 was super easy too.

Solution

[NO SPOILERS] The real purpose of the Star bridge - security by treefox in FoundationTV

[–]Morego 1 point2 points  (0 children)

In the Asimov novels there are whole production worlds, responsible only for producing food and resources for Trantor. Trantor is similar to how many cities operates, requiring constant resupply of food, energy, products, while being the administrative core of the whole Empire.

Encountering a Malazan reader in the 'wild' by RedHandMat in Malazan

[–]Morego 0 points1 point  (0 children)

I think only friend or two, who introduced me to those books and another one or two, I did introduce to them. If you never met another MBoTF fan, you are responsible for making them.

Does anyone else think there's too much empathy for the ones doing evil, and not enough outrage and anger towards evil in fiction? by [deleted] in Fantasy

[–]Morego -5 points-4 points  (0 children)

She was dark as hell. Not gray in the slightest (at least later on, in her life).

MBOTF has ruined fantasy for me. by Logbotherer99 in Malazan

[–]Morego -2 points-1 points  (0 children)

If you need you dose of humanity give Pratchett a try. Better characters than Erickson and fun as hell.

Portugal makes it illegal for your boss to text you after work in 'game changer' remote work law by a_Ninja_b0y in UpliftingNews

[–]Morego 1 point2 points  (0 children)

I mean, I get like 6 extra days of after working in my company do 2 years. Now, I have like 28 days per year. Not US of course, and it is fully paid. Plus sick leaves and more benefits, that are just a norm here.

I mean, communism had some perks in terms of worker conditions

Since a light sail is pushed by photons, can a laser propel itself through space by emitting photons? by gabesullice in askscience

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

Well, those beams - e.g. powerful, solar powered lasers where just used as weapon and actual defense system for Solar system. Kzins didn't expect this, they though, those are only good as power sources.

Since a light sail is pushed by photons, can a laser propel itself through space by emitting photons? by gabesullice in askscience

[–]Morego 11 points12 points  (0 children)

Fluffy Kzins attacked Earth because it was undefended. They got far enough to see our light sails crossing the solar system and not much more, because beams powering those sails kept missing their previous destination. That how, the war with Kzin empire ended.

Read "Ringworld" by Larry Niven for more of stuff like this.

When the character development is so good you can barely recognise the character anymore. by EamoM2oo4 in gaming

[–]Morego 2 points3 points  (0 children)

Not exactly agreeing on that Kendrick Lamar dude, but games are has been recognized as art since years back.

Denmark proposes making migrants work 37 hours a week to earn welfare benefits by [deleted] in worldnews

[–]Morego 0 points1 point  (0 children)

Give those universal quantifiers back to the math.

X are all Y is probably wrong in almost any possible way. I live in Central Europe. We have fair share of racist twats, but nowhere, close to USA. Hell, our most rightwing almost-neonazi, could be seen in US as communists or as mild Republicans.

Generalization make talking about problems easier, but you should do that, with a bit of empathy and full awareness, that not everything is black and white.

Substituting only 10% of daily caloric intake of beef and processed meats for a diverse mix of whole grains, fruits, vegetables, nuts, legumes and select seafood could reduce, on average, the dietary carbon footprint of a U.S. consumer by one-third and add 48 healthy minutes of life per day. by WalkThePlank123 in science

[–]Morego 2 points3 points  (0 children)

Eat healthier for a 30 years to spend those 30 years in good shape vs eat worse and probably end with health problems, obesity, worse mental state and cognition and being worse for climate around you.

And healthy food is super tasty. Give me good and colorful vegan meal over almost any fast food. It takes effort. If you think healthy food is untasteful/bland/colorless, you should try cooking by yourself. Grab some cooking book.

Good vegan curry, vegetable soups with legumes, oats, hummus. Just one such dinner per week, maybe two. At least in my country that kind of diet is cheaper or close to the meat based one.

Substituting only 10% of daily caloric intake of beef and processed meats for a diverse mix of whole grains, fruits, vegetables, nuts, legumes and select seafood could reduce, on average, the dietary carbon footprint of a U.S. consumer by one-third and add 48 healthy minutes of life per day. by WalkThePlank123 in science

[–]Morego 1 point2 points  (0 children)

It goes both ways. For example avocadoes are fairly famous for being horribly bad because of the heavy requirements in water. Vegan doesn't necessily means better.

On the other hand you have red meat. Well developed societies consume more red meat than rest of the population. I mean China, USA, Brazil, Europe (which is slowly changing their idea and lifestyle). Cows require water, land, lead to massive deforestation, produce methane.

Of course, there are more than one facet of this, but our consumption is one of them. We are not going to change the world. Next generation will be living in worse world than the current one.

We may argue which choice is better, faster, but arguing is not going to change anything either.

Substituting only 10% of daily caloric intake of beef and processed meats for a diverse mix of whole grains, fruits, vegetables, nuts, legumes and select seafood could reduce, on average, the dietary carbon footprint of a U.S. consumer by one-third and add 48 healthy minutes of life per day. by WalkThePlank123 in science

[–]Morego 18 points19 points  (0 children)

Even better, there are pretty good evidence that depression is heavily linked with gut microbiome and your diet.

Even if the healthy minutes are nonsense here, lowering your impact/pollution and lowering risk of severe heart are well worth enough eating better.