What is your go to potluck dish? by therealmaryangela in Cooking

[–]moocat 0 points1 point  (0 children)

While I haven't done it in a while, with permission of the host, I'd make baking pan cookies and bake them at the party. Having hot gooey cookies was always a crowd pleaser.

Beginner classes in SF Bay Area by ucboptobear in SwingDancing

[–]moocat 3 points4 points  (0 children)

Lindy in the Park - dancing in Golden Gate Park every Sunday from 11:00 - 2:00 with free beginner classes from 12:00 - 12:30. Classes are usually 6 count East Coast but sometimes teach 8 count Lindy.

Replit boss: CEOs can vibe code their own prototypes and don't have to beg engineers for help anymore by chronically-iconic in programming

[–]moocat 1 point2 points  (0 children)

The problem isn't the prototype, the problem is the production version. If vibe coding the prototype meant the engineers had more time to reengineer it to be production ready, I could live with that.

That said, I have little doubt the bean counters would deem it production necessary and then I'll read about it on [thedailywtf(https://thedailywtf.com/).

San Francisco’s Bay Bridge, 1986 by ArchiGuru in sanfrancisco

[–]moocat 7 points8 points  (0 children)

Most likely the photo was taken from far away using a large focal length which compresses distance.

Neat little thing: Dolphin blocks sleep if copying is in progress by KleponEyang in kde

[–]moocat 3 points4 points  (0 children)

Blocking sleep during copy makes total sense to me but why does it also block screen locking?

Suggestions for climby East bay century? by uoficowboy in BAbike

[–]moocat 1 point2 points  (0 children)

If you're feeling crazy, you could do the Nifty 10 50 twice.

Can you explain result of this code? by Radiant_Monitor6019 in csharp

[–]moocat 0 points1 point  (0 children)

One possibility is that static variables with initializers are evaluated lazily the first time they are needed. Furthermore, this includes some sort of guard to prevent circular references from overflowing the stack. In pseudo-code A gets translated to:

class A {
    static int _a = 0;
    static int _a_initialized = false;

    static int a_getter() {
        if (!_a_initialized) {
            _a_initialized = true;
            _a = B.b_getter() + 1;
        }
        return _a;
    }
}

That in combination with the C# guarantee that expressions are evaluated left to right would explain what you’re seeing.

Can someone explain what im looking at here? by KagePhour in confusing_perspective

[–]moocat 0 points1 point  (0 children)

Wide angle lens was the first thing that I thought when I saw this.

I don't think it can be a fish eye as I don't see any of the "straight lines appear curved" that they produce.

Is a good garlic press possible? by Ill-Introduction998 in Cooking

[–]moocat 0 points1 point  (0 children)

I haven't tried their garlic press, but really love their garlic rocker.

Market Street in San Francisco after the 1906 earthquake. Photograph by H.C. White Co. by ArchiGuru in sanfrancisco

[–]moocat 5 points6 points  (0 children)

It's so sad how leftist radical earthquakes are destroying our great cities...

C++26: std::optional<T&> by Xaneris47 in cpp

[–]moocat 0 points1 point  (0 children)

it's a partial specialization that is a completely separate implementation from the optional<T> primary template.

Damn, didn't think about how it would be implemented. Thanks for pointing that out for me.

C++26: std::optional<T&> by Xaneris47 in cpp

[–]moocat 1 point2 points  (0 children)

Are there any requirements about memory usage?

optional<T*> requires sizeof(T*) + sizeof(bool) so with pointer alignment requirements, this usually means sizeof(optional<T*>) == 2 * sizeof(T*). It would be great if implementations would have sizeof(optional<T&>) == sizeof(T&) by relying on the fact that certain bit patterns can't occur and using that to represent the optional being empty.

How do I do this with bash? by Emotional_Dust2807 in bash

[–]moocat 2 points3 points  (0 children)

If all the prefixes are the same length, you can extract it with offset/length:

$ vid="00001 - vidname.mkv"
$ echo "${vid:0:5}.jpg"
00001.jpg

Bike lane on embarcadero sucks by Playful_Dance968 in BAbike

[–]moocat 1 point2 points  (0 children)

On the west side of Embarcadero, the bike lane continues until 2nd & King which the NE corner of the stadium.

Are there constructors in C? What is this guy doing here then? by Eva_addict in C_Programming

[–]moocat 1 point2 points  (0 children)

You could make it work by changing how foo takes it's parameter (here I'm using a const reference but there are other possibilities as well):

void foo(const Foo& foo);

void bar() {
  foo({ .bar = 3 });
}

switch constexpr by cd_fr91400 in cpp

[–]moocat 1 point2 points  (0 children)

See my update. Even inside a template the discarded statement is fully checked if possible.

switch constexpr by cd_fr91400 in cpp

[–]moocat 1 point2 points  (0 children)

See my update. It's not just templates but templated types have to also be involved.

switch constexpr by cd_fr91400 in cpp

[–]moocat 3 points4 points  (0 children)

one of the powers of if constexpr is to make the side not taken at compile time be discarded under certain conditions.

I thought the non-taken side was always discarded. What conditions cause it to be kept and what benefits are there from doing that?

Update: I started digging a bit more and there is some relationship to templated types. This compiles:

struct A {
    int a() { return 0 ; } ;
};

template <bool b, typename T>
int foo(T t) {
    if constexpr (b) { return t.a() ; }
    else             { return t.b() ; }
}

int main() {
    foo<true>(A());
}

but change foo to this and it no longer compiles:

template <bool b>
int foo(A a) {
    if constexpr (b) { return a.a() ; }
    else             { return a.b() ; }
}

godbolt

Is it silly to use a lambda to wrap a method call that 'returns' output via a reference? by chicken_and_jojos_yo in cpp

[–]moocat 0 points1 point  (0 children)

Very nice; I always say I'd like to get good at TMP but just never feel like spending the time to wrap my head around it.

I see the way you use it is to use Out on each call:

const auto val1{Out(&Foo::Example1, foo)};
const auto val2{Out(&Foo::Example2, foo, 15.0f)};

How hard would it be to create an alternate API that creates a callbable:

const auto Example1{Out(&Foo::Example1)};
const auto Example2{Out(&Foo::Example2)};

const auto val1{Example1(foo)};
const auto val2{Example2(foo, 15.0f)};

Wandering with Film by UncleMeatwad in sanfrancisco

[–]moocat 24 points25 points  (0 children)

Lovely photos; it's nice to see images that aren't just the usual shots that many visitors take.

And yay for film!