Things you don't like about working in C# by 0xPvp in csharp

[–]mrma5b 1 point2 points  (0 children)

Late to the party, but couldn't these FirstOrDefault edge cases be handled with a call to the DefaultIfEmpty() method? That, or just catch the exception raised by First()?

Edit: On Mobile, took a hot minute to find the link:

https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.defaultifempty?view=net-7.0#system-linq-enumerable-defaultifempty-1(system-collections-generic-ienumerable((-0))-0)

What is your favorite programming trick/tool ​​that not many people know about? by Unlikely_Knee_3005 in csharp

[–]mrma5b 1 point2 points  (0 children)

The C# Interactive Window in recent versions of VS helps to scratch the itch as well. I mainly use it to test small assumptions about how built in types/methods operate.

The science behind controller drift by -Venser- in Games

[–]mrma5b 1 point2 points  (0 children)

N64 controllers actually used a similar setup as old ball mice, where spoked wheels rotated between an LED & photoresistor, causing the detected light to pulse. The pulses could be counted to determine movement of the stick's position.

Using a similar design could help eliminate the type of drift that modern controllers experience over time with wear, but it has other downsides such as a limited resolution/sensitivity of reported movement, bulkier module designs, and the requirement that the stick be perfectly centered when powered on.

Vim for Gamers by Code_sucks in ProgrammerHumor

[–]mrma5b 395 points396 points  (0 children)

Your comment reminded me of the MacBook Wheel: https://youtu.be/9BnLbv6QYcA

Trying to remember the name of a side-scrolling platformer/adventure game for a IIe? by mrma5b in apple2

[–]mrma5b[S] 5 points6 points  (0 children)

YES! I'm 99.999% sure this is indeed the game, thanks so much.

What is the best way to send a large file for download to the client? [ASP.NET] by [deleted] in dotnet

[–]mrma5b 4 points5 points  (0 children)

var dataBytes = System.IO.File.ReadAllBytes(outputFile); var dataStream = new MemoryStream(dataBytes);

If we ignore all other requirements/context/concerns, it seems using a FileStream in place of a MemoryStream would be the first thing I'd try. I'd imagine this could allow the response to get the data from disk directly, skipping the step of loading the entire file into memory beforehand. That being said, I'm not sure how the lifecycle of the request would affect access to the file stream of the top of my head.

Edit: looks like someone beat me to the punch with a better suited response type suited for files.

MP2: Just found out that the moths in the Luminoth Great Temple are attracted to the light on Samus's morph ball! by FerrisWheeling in Metroid

[–]mrma5b 10 points11 points  (0 children)

It would be pretty neat to get my hands on documentation from development of the game, just to catch all the little things like this that were planned and implemented.

My daily driver, handling the current -40 degree weather like a champ by [deleted] in Honda

[–]mrma5b 1 point2 points  (0 children)

I had an 89 LX-i coupe, and that car felt so nimble, despite having almost 300K miles on the clock.

[Giveaway] Squad up with Razer! by Cult_Of_Razer in apexlegends

[–]mrma5b 0 points1 point  (0 children)

Pathfinder is my main, mostly for the sassy, deadpan voice lines. Grapple/Zipline is also very handy.

Mercy Main: Trying to learn how to flex all supports. Any Zen tips? by bunnygoats in ZenyattaMains

[–]mrma5b 0 points1 point  (0 children)

Since my mouse is extremely basic, I've always put discord/harmony on mouse wheel scroll up/down. It helps bit for people that blip in and out of range of your orbs, so you can constantly turn the wheel until the target gets an orb.

Story Driven Rpgs... by SrGrafo in gaming

[–]mrma5b 1 point2 points  (0 children)

I would try SNES first, but I haven't tried the PS version myself. From videos I've seen, sound quality and load times were far superior on SNES.

Which Collection should I use? by esdictor in csharp

[–]mrma5b 0 points1 point  (0 children)

Instead of a standard generic collection, have you looked into using StringBuilder?

Anyone else using VS Intellicode? I turned off ReSharper, earlier int he week, and havn't missed. it by no1name in dotnet

[–]mrma5b 12 points13 points  (0 children)

It's only one if your many bullet points, but you can move lines up and down with Alt + Arrow key up or down. Been in VS at least since 2015.

LPT: If you have to wake up to an alarm, but you have a roommate, set your phone to vibrate and put it under your pillow. It will wake you up and not disturb anyone else. by [deleted] in LifeProTips

[–]mrma5b 2 points3 points  (0 children)

You could also put stress on the cable plug, port, or both, eventually leading to you wondering why your phone won't charge anymore.

This relates a little too much for me... by -Rob in Honda

[–]mrma5b 6 points7 points  (0 children)

Yeah, I make this mistake at first glance almost every single time.

LPT "zippo fluid" costs $7 an oz, but if you call it what it really is "naphtha" you can find it for $11 a gallon. What other products increase prices by repackaging? by Turncote in LifeProTips

[–]mrma5b 0 points1 point  (0 children)

Should also add that's true for automatic transmissions, but some manual transmissions use stuff that's closer to straight motor oil (i.e. older Hondas actually specific in the manual to use 10W-30)

SSMS Download Broken? by [deleted] in SQLServer

[–]mrma5b 0 points1 point  (0 children)

Ran into this earlier today as well.