HNHacker News
TopNewBestAskShowJobs

Wolfspirit

43 karma · joined February 8, 2018

submissionscomments
Wolfspirit··on Run a C# file directly using dotnet run app.cs
I have to agree with others that it's strange this has not been in line with .net interactive and the usage of "#r" there. I think "#r" should at least be an option.

You say that importing other files is not how c# works, but I think that's not entirely true. If you now treat a file as a project then an import is pretty much a project reference just to a .cs file instead of a .csproj file.

So I'd love to see something like that working: #:reference ./Tools.cs

Which should be the same as a ProjectReference in csproj or for a "real" project something like this: #:reference ./Tools/Tools.csproj

That would also enable things like this in a csproj file: <ProjectReference Include="..\Tools\Helpers.cs" />

Wolfspirit··on Understanding how Facebook disappeared from the internet
Even google isn't quite sure about the summer time. Not sure if that is just a Google German thing...

A few weeks ago I tried to find out what the current time in CET is. Asking google for "CET" gave me: "23:27 CET". Asking google for "CET time" (I know that "time" is twice in this case) gave me "00:27 CET".

The last one is wrong and should be CEST or even more correct would be just the same result for CET as I asked for

Wolfspirit··on Understanding how Facebook disappeared from the internet
Timezones are the most annoying thing... right after encoding
Wolfspirit··on Understanding how Facebook disappeared from the internet
Seems like they're back online
Wolfspirit··on Understanding how Facebook disappeared from the internet
I think that it is possible to restore the previous state but the question is, if it makes sense. When do you decide that it was a failure? Facebook explicitly (even so automatically) told all others that they shouldn't use that routes anymore.

When it comes to Facebooks side I guess they do have backups of their BGP config. Applying them (probably remotely) however seems to be harder then expected when the whole infrastructure is down.

Wolfspirit··on Understanding how Facebook disappeared from the internet
I'm not sure if that is true (and I hope it is not cause that would be fatal) but I read somewhere that with facebook being down also means all internal infrastructure of facebook isn't available at the moment (chats, communication) including remote control tools for the BGP Routers. Therefor they require people to get physical access to the router while many people are working from home cause of the pandemic.
Wolfspirit··on Understanding how Facebook disappeared from the internet
Even if they wanted to write one they have no way to host it :D
Wolfspirit··on Docker for Windows won't run if Razer Synapse driver management tool is running
This has been fixed in 2018!!! Why is this here? https://github.com/docker/for-win/issues/1723
Wolfspirit··on A todo list for new ASP.NET Core projects
I'm not quite sure what you mean. There is no ConfigurationManager used in Asp.NET Core. Are you talking about IConfiguration?

The reason why you want to have it injected as IOption<> is cause you might want to change configuration on the fly. If you do it right, there is no need for the app to restart if you change the appsettings.json at all. Also it makes things much more flexible and loosely coupled, for example third party middlewares can bring their own Settings and you can define which part of the whole appsettings.json is meant to be for that Middleware.

There is also no need to pass it to the constructor and manage it yourself via a field inside your class, at least in your controllers. You can just use the [FromServices] attribute before an action argument to inject it into just that method (and that works for properties deeper down the "callstack" aswell).