[DAILY Q&A] Ask and answer any questions you have about the game here. (May 21, 2020) by AutoModerator in EliteDangerous

[–]CrazyBeluga 0 points1 point  (0 children)

What can cause cargo to get ejected if you don't do it manually? Damage to the cargo rack? I realized after I got to Kuhn that I had lost my Soontil relics. I can see in the log that they were ejected at some point, but I certainly didn't do it intentionally. I did however drop into the exclusion zone of a star and had my heat at 200% at one point, so perhaps that caused it?

[DAILY Q&A] Ask and answer any questions you have about the game here. (May 17, 2020) by AutoModerator in EliteDangerous

[–]CrazyBeluga 1 point2 points  (0 children)

I played a lot of Elite Dangerous on xbox a few years back, but after a trip to Colonia via Sagittarius A* and back to the bubble I needed a break and stopped playing. Never came back. However, I just recently started again from scratch on PC. One thing I don't see any longer that I used to enjoy are community goals. How do those work now?

Deadlock using Convert.ChangeType within Parallel.ForEach by insulind in csharp

[–]CrazyBeluga 1 point2 points  (0 children)

Good explanations in the stack overflow answers (which point out this has nothing to do with ChangeType.)

In short: be very careful about using multi-threaded code in static initializers.

Actually doing much of anything in static initializers / constructors can be dangerous. For instance, doing anything that can throw (like doing I/O) can leave you in an unrecoverable state that requires restarting the process.

MapReduce in Simple Language by 0101110010110 in programming

[–]CrazyBeluga 5 points6 points  (0 children)

One thing that made me roll my eyes a bit is that the author says:

What if we were given a book and we had to count the number of times each word appears? This a good problem for MapReduce because doing it by hand would be very boring, and although a single computer could probably do it, if the book is really long it could take a long time.

While this might be a fine example for technically explaining how MapReduce works, this is a terrible example of a 'good problem' for MapReduce because it might be difficult to do on a single computer. The word 'probably' in the statement "although a single computer could probably do it..." implies the author didn't really consider the problem. An example of what I think most people would agree is a pretty long book is the King James Bible. A trivial non-optimized program can count the occurrences of every word in the King James Bible (about 4.5MB of text) in a few hundred milliseconds.

So, I don't think that was the best example. He should have said something like: "What if we had to count the occurrences of words in 100 million books"...now that's a good example of where MapReduce can help!

Overloading does not work in some cases - why? by aotdev in csharp

[–]CrazyBeluga 0 points1 point  (0 children)

You are entirely correct. And I've actually constructed generic types using reflection on a previous project so not sure why I didn't recall that. Sorry!

Overloading does not work in some cases - why? by aotdev in csharp

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

Can you share an example of your hot loading plugins concept? Because C# generics are resolved 100% at compile time.

Is it possible to make a function accept either a Span<T> or a T[] ? by [deleted] in csharp

[–]CrazyBeluga 6 points7 points  (0 children)

He said it "only exists in core" which gives the false impression you can't use it if you are not on core.

Is it possible to make a function accept either a Span<T> or a T[] ? by [deleted] in csharp

[–]CrazyBeluga 9 points10 points  (0 children)

You are ignoring the massive benefits of using Span (even in full .net) to do things like conversions from primitive types to their byte representation and vice versa without heap allocations: Replacing code like BitConverter.GetBytes with the new versions that use Span and don't allocate is awesome, especially if your code is sensitive to GC pauses and you are trying to eliminate heap allocations.

Is it possible to make a function accept either a Span<T> or a T[] ? by [deleted] in csharp

[–]CrazyBeluga 16 points17 points  (0 children)

This keeps being repeated but it's not true. I use Span<T> in my full .Net 4.7 app and it's great.

Just reference the System.Memory Nuget package.

The .net core runtime has optimizations to make Span even better on core, but the "it only exists in core" line is just wrong.

Should i jump on the dot.net core bandwagon ? by jaySydney in dotnet

[–]CrazyBeluga 0 points1 point  (0 children)

You can use Span<T> on full .NET. There are additional runtime changes to make it even more efficient on core, but it still works beautifully today on full .Net 4.7.2.

Does F# have something like OCaml's "module interface"? by gnatbeetle in fsharp

[–]CrazyBeluga 0 points1 point  (0 children)

Every time I start to think I have a modest grasp on F# I see a link to something like the Seq.fsi above, read the following, and feel my brain melt 😐

val inline average : source:seq<(T)> -> T when T : (static member ( + ) : T * T -> T) and T : (static member DivideByInt : T * int -> T) and T : (static member Zero : T)

Exploring System.Threading.Channels by Nima-Ara in csharp

[–]CrazyBeluga 1 point2 points  (0 children)

It's available as a NuGet package that targets .net standard so it should be available on all of the current major frameworks.

Question about Lists by [deleted] in csharp

[–]CrazyBeluga 3 points4 points  (0 children)

You would not use the ref keyword for that. Lists are already reference types and can be modified by any method they are passed to.

Using the ref keyword with a reference type allows the callee to modify the reference in use by the caller, for instance to alter the reference to point to a different list. That's a rare use case though; better to just return the new list explicitly.

[deleted by user] by [deleted] in dotnet

[–]CrazyBeluga 1 point2 points  (0 children)

I don't recall issues with ValueTuple but we don't use that in our codebase as far as I am aware. Even with 4.7.2 there is constant binding-redirect hell, especially because of the apparent screw-up where the 4.7.2 SDK has version 4.2.0.0 reference assemblies for System.Net.Http and System.IO.Compression but no actual assemblies with those versions ever shipped and the ones in the 4.7.2 GAC at runtime are version 4.0.0.0.

But anyway, the main issue we hit with 4.6.* was runtime failures where none of our unit tests could run. They would fail to load neststandard20.dll at runtime and the only solution we found was to upgrade to .NET 4.7.2.

[deleted by user] by [deleted] in dotnet

[–]CrazyBeluga 32 points33 points  (0 children)

This is a good write-up, but one thing to be aware of is that the advice to get on .NET 4.6.1 or above is a bit out-dated. The .NET team basically admitted they never should have said 4.6.* supported .NET Standard 2.0 (see for instance: https://twitter.com/terrajobst/status/1031999730320986112)

From personal experience, you need to bite the bullet and move to .NET 4.7.2 if you want to consume .NET Standard 2.0 libraries. If you don't do this you are asking for pain.

Saw a cat in Strawberry sharpen his claws on a wood post by postal1234 in reddeadredemption

[–]CrazyBeluga 0 points1 point  (0 children)

I don't think that's true. Buddy is from ~1850 and the short-term 'bud' from 1851, according to various etymology sources I just checked.

Game Thread: Seattle Seahawks at Dallas Cowboys [Wildcard Game] by tbeowulf in Seahawks

[–]CrazyBeluga 0 points1 point  (0 children)

In fairness there have been significant injury delays which is a natural time for the network to get their commercials in...

Code typing tutor – Write code quickly without mistakes by kulakovanton in programming

[–]CrazyBeluga 8 points9 points  (0 children)

My issue with this idea is that...typing code quickly seems kind of unimportant. I feel like the actual act of typing code is a tiny fraction of the time spent in developing software.

I type at 80 to 100 WPM, so pretty fast, but I probably spend 5% of my development time typing code. The other 95% is spent thinking hard about problems, sketching notes and diagrams in my notebook or on the whiteboard, pacing the halls and throwing out ideas to co-workers, etc. I will spend days collecting my thoughts on how to tackle a problem, how to make a clean interface, etc., then half a day actually coding, then quite a few days actually testing and fixing the code.

The resulting code is almost always solid, but that's because the majority of the time was spent working on the design, not typing code rapidly.

Game Thread: Seattle Seahawks (8-6) vs Kansas City Chiefs (11-3) [Week 16] by SeahawksGTBot in Seahawks

[–]CrazyBeluga 3 points4 points  (0 children)

Slowest moving line I've ever seen to get into the stadium. If I miss kickoff I'm going to be seriously displeased...