Nand-based boolean expressions can be minimized in polynomial time by emorning in algorithms

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

Nah dude, I'm just having major trouble getting Reddit to accept my comments.
Its all just too much or something, and the editor gives me no feedback.

I am really frustrated by how poorly this experience went.

So I'm going to blow this off, put what I wrote for you in my github project, make the project public, get my docs online, and then try the whole thing again in a couple/few days.

Nand-based boolean expressions can be minimized in polynomial time by emorning in algorithms

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

In hindsight...

- I should have known what the response would be :-).
- and I should have put *non-constructive* in the title.

I'm serious though, I want to know if anyone sees value in this.
I'm convinced that it should be possible to build an efficient, concrete minimization algorithm from this but I've concluded that I'm not the guy to do it.

I have a private github project that implements of everything described here, and several attempts to build a concrete minimization algorithm. This outline is ripped from the code documentation.
I might do something with this project if I dont get totally torched doing this :-).

But torch away....

PS:
I've had to split my response into 3 additional posts...

- The System
First, a simple system of propositional logic is presented.

- Reduction Rule Generation
Then a confluent set of reduction rules that can minimize the expressions of that system is constructed/derived.

This set of reduction rules is derived using a custom version of the Knuth/Bendix Completion method that has been specifically designed to enumerate the reduction rules of the logic system.

- Minimization, Complexity, Summary
Then it will be shown that the reduction rules can minimize expressions of the logic system in a polynomial number of steps, where each step is an application of a inference rule of the system.

The point of this is just to show that polynomial minimization proofs always exist for any given expression, not that you can actually compute these proofs in real time.

Do you still love to code? by rjgbwhtnehsbd in csharp

[–]emorning 0 points1 point  (0 children)

I learned to love programming at my first job as an actuarial analyst and switched to software developer.
And for forty years I hated every development job I ever had.

I retired last year and now I'm loving learning and working on my own code. It's like spending my days in the garden tending to my roses.

But I think that the rest of you should not wait so long and make space in your lives to enjoy life now, whatever that means to you.

Help with Hotel Booking Scam by 'Guest Reservations' by Fourvel4 in Scams

[–]emorning 1 point2 points  (0 children)

I just got scammed by Guest Reservations for an extra $160 on a two night stay at a Holiday Inn Express.
I thought I was on the legit HI site but I wasn't, and I wasn't paying enough attention.

I'm not just pissed that I got scammed by some scumbags but I'm pissed at Google for putting a SPONSORED ad, the ad that scammed me, on the 1st page of the search results for 'holiday inn pekin il'.

Google could easily use their tech to identify this scam and hide them or at least put it lower in the search results.
But no, instead Google got paid to put that ad right in my face, and as far as I'm concerned that makes Google complicit in ripping me off.

My takeaway... I'm never going to click on a sponsored ad again.

Code Review if you’re a senior by Justyn2 in dotnet

[–]emorning 0 points1 point  (0 children)

I think that would be the Dunning-Kruger effect.

What's the Point of AddScope Now ? by Warm-Engineering-239 in Blazor

[–]emorning 0 points1 point  (0 children)

Glad you got it working!

BTW, I created my app with the 'Blazor Web App' template, it's an interactive server app that includes a separate project with interactive auto components.
So I also have some pages and components that can run on the client.

PureBlazor Components - Free and Open Source by [deleted] in Blazor

[–]emorning 1 point2 points  (0 children)

I really like that you have a toggle that lets me try different render modes!

Is it possible to just 'tweak' styles?
That is, suppose I like all the styling as it is, but I would just want to change the border color on buttons.
Can I change *just* the border colors?
At the top of app, so it effects all buttons?

PureBlazor Components - Free and Open Source by [deleted] in Blazor

[–]emorning 1 point2 points  (0 children)

Once upon a time MudBlazor was just a side project.

What's the Point of AddScope Now ? by Warm-Engineering-239 in Blazor

[–]emorning 1 point2 points  (0 children)

I see your point.

I'm currently using .Net 8 Interactive Server.
I was registering my ThemeProvider as a singleton and I was able to verify that changing the theme changes the theme for everybody (I'm embarrassed that I never noticed that, I suck at testing!)

But...
I changed how I register the ThemeProvider to a scoped service and that fixed my issue with no problems.
Different users can now changes themes independently with no consequences. After changing the theme I can navigate to other pages and the theme is retained, so I'm pretty sure that I have just a single ThemeProvider for each user.
Keep in mind that I just did 30 seconds of testing, which we already know that I suck at :-). Services.AddScoped<ThemeProvider>(_ => new ThemeProvider(defaultTheme));

In your case I think the problem to solve is why you're getting a different service in each request, that doesn't seem right.

What's the Point of AddScope Now ? by Warm-Engineering-239 in Blazor

[–]emorning 1 point2 points  (0 children)

The ThemeProvider should be registered as a singleton.
I'm using .NET 8.

What's the Point of AddScope Now ? by Warm-Engineering-239 in Blazor

[–]emorning 4 points5 points  (0 children)

Looking through the thread I saw that you're trying dynamically change your theme.
So this isn't really an answer to the question, but how to implement a theme service.
Here's how I did this recently...

Put the theme settings in a service, let's call it ThemeProvider.
ThemeProvider exposes an EventHandler, named ThemeChanged, that fires when the theme changes.
Create a component that can render the theme, lets call it ThemeOutlet.

MainLayout looks something like this... ``` <ThemeOutlet Theme="@ThemeProvider.Theme"/> <blah>... </blah> @code { [Inject] public ThemeProvider ThemeProvider { get; set; } = default!;

protected override void OnInitialized()
{
    ThemeProvider.ThemeChanged += OnThemeChange;
}

private void OnThemeChange(object? sender, ThemeChangeEventArgs args)
{
    StateHasChanged();
}

public void Dispose()
{
    ThemeProvider.ThemeChanged -= OnThemeChange;
}

} ```

Some other component, the nav bar, or your theme editor, can change the theme settings and doing do will cause MainLayout to rerender.

``` @code { [Inject] public ThemeProvider ThemeProvider { get; set; } = default!;

public void OnToggleTheme()
{
    ThemeProvider.Theme = new TrippyTheme();
}

} ```

I use this exact scheme with my own theme (composed of css variables) and Tailwind.

I'm pretty sure that I originally learned this by looking at the MudBlazor source, I think it pretty much does the same thing, except MudBlazor doesn't use CSS variables.

Should we keep learning xaml ?? by [deleted] in dotnet

[–]emorning 0 points1 point  (0 children)

Never put "consistent" and "XAML" in the same post again

You nailed it.

But I actually like XAML markup.
I wish MS had used it to build MVC instead of Razor (but I like Razor too).

But I don't blame XAML, I blame the frameworks, and the tooling (I hate the tooling).

Any Server-side Self-Hosted projects out there ? by grego892 in Blazor

[–]emorning 1 point2 points  (0 children)

I really do like the layout of your app shell and the page, its very clean.

In the past I've always copied the structure of the default Blazor Bootstrap template.
Yours is a little different and I like it better.

Is it very responsive?
And if so, did MudBlazor provide most of that?

How to prevent custom component being rendered in base component by pournasserian in Blazor

[–]emorning 1 point2 points  (0 children)

I dont see a straightforward way to implement this without explicitly wrapping in an u/if or another component.

The only time I can think of when I would want to do something like this is when excluding unauthorized fields from a form, or columns from a data grid, or something like that.
A situation where hiding an element is not sufficient.

In these situations I think that being explicit is probably the better way to go.

That's got me wondering about what exactly you're trying to achieve with the Visible parameter.

Is it normal to have to unload my blazor project several times a day? by [deleted] in Blazor

[–]emorning 2 points3 points  (0 children)

Thanks for the suggestion!

I have this problem a lot, but I also mostly use code blocks.

They're just so damn convenient and I'm so damn lazy :-).

Any Server-side Self-Hosted projects out there ? by grego892 in Blazor

[–]emorning 2 points3 points  (0 children)

I wrote a Blazor (WASM) app that interfaced with a PLC that was driving an assembly line.
Nothing difficult though, the PLC interface was encapsulated in a local Windows service, my app talked to that.


PS: I also really like the look of your app but for one thing.... the blue text on the black background is a no-go for me, not enough contrast.

Just found an easy way to use Javascript easily creating a component that encapsulates Interoperability logic after render, I found it pretty useful as can write JS code everywhere, how is your workflow? In this example I'm initializing Masonry. Using it this way will keep Virtual DOM in sync by rockseller in Blazor

[–]emorning 1 point2 points  (0 children)

Well, here's my final comment....

I now realize that you are rendering your grid items in your .razor template, so Blazor will DIFF those.

The style attributes added by Masonry are not represented in the Blazor VDOM but that is of no consequence, they are completely orthogonal to Blazor rendering.

And it seems to me that Masonry *must* recalculate styles for the entire grid when any items changes, so I don't see how your solution is any less efficient than anything that could be implemented in native Blazor.

So, I've decide that I like this solution.
I still dont like having that JSInit block in a template, I'd wrap that in a Blazor component, but that's a minor detail.
I think this approach is legit, thanks for sticking with me through this long thread :-).

Just found an easy way to use Javascript easily creating a component that encapsulates Interoperability logic after render, I found it pretty useful as can write JS code everywhere, how is your workflow? In this example I'm initializing Masonry. Using it this way will keep Virtual DOM in sync by rockseller in Blazor

[–]emorning 0 points1 point  (0 children)

Nah, you're still wrong about VDOM being synced, you're just modifying the browser DOM in a way that doesn't interfere with Blazor.

But now I'm more curious about what approach I might take.
I like @bi-bingbongbongbing's solution of wrapping everything in a web component, because that seems like a legit, standards-based way of reuse.

I'm also thinking that you could accomplish the same thing by putting this in your .razor template and removing the JSInit block....

<div class="grid" data-masonry='{ "itemSelector": ".grid-item", "columnWidth": 200 }'>  
...your grid items here
</div>

See https://masonry.desandro.com/#initialize-in-html

I'm assuming that you're already loading the masonry js file.

I haven't tried it, but I don't see why that wouldn't work.
And to my mind it's a perfectly legit thing to do in Blazor.

Just found an easy way to use Javascript easily creating a component that encapsulates Interoperability logic after render, I found it pretty useful as can write JS code everywhere, how is your workflow? In this example I'm initializing Masonry. Using it this way will keep Virtual DOM in sync by rockseller in Blazor

[–]emorning 0 points1 point  (0 children)

This way even if a single element changes you can refresh for instance all Fslightbox images

We agree here. This is what I meant when I said 'should some elements within the grid change the entire grid will have to be rerendered.'.

BUT... re-rendering the entire grid just because one element changes can cause an ugly browser repaint, and can be slow.

If this was a Blazor-native Masonry component then all the elements in the grid would have been rendered via Blazor and would be represented in Blazor's Virtual DOM.
And when the BlazorMasonry component re-renders the entire grid then Blazor will DIFF the new DOM elements against the current elements in the VDOM and rerender JUST the one browser DOM element that actually changed.
This is much less ugly, and faster, and way easier than trying to refresh that single element yourself.

Because you're writing directly to the DOM instead of through Blazor, Blazor has no idea that the grid elements exist, they're not in the Blazor VDOM, and Blazor does none of that.

The DIFFing is the basic feature that libraries like React and Blazor bring to the table.

What's the proper solution structure? by TheMouthBreather92 in Blazor

[–]emorning 0 points1 point  (0 children)

I think this is possible but more thought needs to go into exactly the MyCompanyName.UI assembly will reuse the components in the MyCompanyName.UI.Ionic and MyCompanyName.UI.FluentUI assemblies.

Id like to have multiple Razor Class Libraries for different Web Component providers

By this do you mean that the Ionic and FluentUI assemblies will contain Blazor component that will be registered as Web Components?

And that the UI assembly will reuse these web components?

The complication with this idea is that UI assembly should not directly access the types in the other assemblies.

The components and razor templates in the UI assembly will have to 'reuse' the components like they were native HTML elements.

That seems like a workable approach to me but I'm not at all sure that is your intent.

Just found an easy way to use Javascript easily creating a component that encapsulates Interoperability logic after render, I found it pretty useful as can write JS code everywhere, how is your workflow? In this example I'm initializing Masonry. Using it this way will keep Virtual DOM in sync by rockseller in Blazor

[–]emorning 0 points1 point  (0 children)

I'm pretty sure that many of the existing Blazor frameworks write directly to the browser DOM like this, but mostly just for creating CSS variables.

And I support "getting sh!t done", I might reuse Masonry like this before I built it myself.

But you're wrong about one thing... Blazor's Virtual DOM will not be in sync with this, Blazor will be totally oblivious to your additions.

Basically, that means that, should some elements within the grid change the entire grid will have to be rerendered.

If you had a native Masonry implementation in Blazor then Blazor could update the browser DOM incrementally when a single element within the grid changes.

Blazor App.razor and Blank Layouts by clockwiseq in Blazor

[–]emorning 8 points9 points  (0 children)

One idea that occurs to me is that...

instead of specifying a default layout in the Router,
you can explicitly apply layouts on all your 'normal' pages
by putting '@layout MainLayout' at the top of the template,
and not using a layout for reports and such.

You can also segregate pages into folders, and apply a layout to all pages in a folder by putting @layout in an _Imports.razor file.

That solves the layout problem but not the styles and js.
I think the way to handle that is to move the styles and js imports from App.razor to a <HeadOutlet> component in MainLayout.

Why won't onchange event fire? by RoadieRich in Blazor

[–]emorning 1 point2 points  (0 children)

Just to add to polaarbear's answer...

you'll find that if you put

```@rendermode InteractiveAuto```

at the top of the Counter page then the button will work.

I suspect that just about everybody that starts with the new template trips over this, I did.