HNHacker News
TopNewBestAskShowJobs

algorithmsRcool

1,521 karma · joined May 25, 2012

https://github.com/AlgorithmsAreCool
submissionscomments
algorithmsRcool··on Avoiding Test-Case Permutation Blowout
This is where I fall back to Property Based Testing[0] and let the engine probe the high dimensional test space for me.

The test then becomes something like

  Check.Sample(
    Gen.Bool, Gen.Bool, Gen.Bool 
    (loggedIn, hasGreenHair, likesBananas) => { 
      var anyTrue = loggedIn | hasGreenHair | likesBananas;//the property to test
      var messagePrinted = formatMessage(loggedIn, hasGreenHair, likesBananas);

      Assert.Equal(anyTrue, messagePrinted);
    }
  );
This is obviously overkill for a test space of cardinality 8. But for complex cases this can provide better coverage of unexpected interactions than just stabbing a few positive and negative results.

Another approach for this test would be to use a metamorphic property (also possible with CsCheck). You basically come up with a rule that says something like, "if a user is logged in, then it should not matter if they have green hair or if they are like bananas". Then just let the framework search for falsifiable cases.

A real-world example of this was when I designed a scheduling system that would compile a set of abstract rules down to concrete events. I used metamorphic testing to look for cases where "If I add a new rule to a calendar, the total observable complexity of the calendar should be greater than or equal to before" (the equal case is if the new rule was equivalent to an existing rule. This allowed me to ensure that the internal complexity wasn't dropping observable details.

[0] https://github.com/AnthonyLloyd/CsCheck

algorithmsRcool··on Intel confirms oxidation and excessive voltage in 13th and 14th Gen CPUs [video]
`Get-CimInstance Win32_Processor` on Powershell Core
algorithmsRcool··on The sad state of property-based testing libraries
I'm going to note also after digesting the article further that CsCheck has support for "stateful"/"model-based" testing in addition to property-based testing. It also supports the linearizable/parallel testing that is described in the article.

See: - https://github.com/AnthonyLloyd/CsCheck?tab=readme-ov-file#m... - https://github.com/AnthonyLloyd/CsCheck?tab=readme-ov-file#c...

algorithmsRcool··on The sad state of property-based testing libraries
For my C#/.NET testing I've been using CsCheck[0] and I've enjoyed it quite a bit. It was a lot more approachable compared to Hedgehog and FsCheck and is also quite fast.

[0] https://github.com/AnthonyLloyd/CsCheck

algorithmsRcool··on Verified Rust for low-level systems code
I've found the DX of Dafny to be very approachable. The VSCode extension is pretty great, and you get feedback as you type. Also, its ability to give you counter examples in the IDE is really nice.
algorithmsRcool··on Verified Rust for low-level systems code
Always cool to see Dafny mentioned!

Shameless plug: I just wrote a beginner's introduction to Dafny a few days ago.

https://www.linkedin.com/pulse/getting-started-dafny-your-fi...

algorithmsRcool··on Excel Never Dies
> Putting more than 1M rows of data into Excel is not possible, and once you get into the low 100K's, it becomes almost unbearable.

I dispute this. Yes, the normal spreadsheet view of excel will buckle under 1M rows, but excel has another feature called "Power Pivot" that is backed by an embedded database and scales into the high millions at least.

I've personally used excel on a dataset of 18M rows and PowerPivot handled it just fine.

[0] https://support.office.com/client/Data-Model-specification-a...

[1] https://support.office.com/client/power-pivot-powerful-data-...

algorithmsRcool··on Excel may have caused loss of 16,000 Covid tests in England
Since it looks like they hit the spreadsheet row limit, this is a friendly reminder that the "Data Model" or "Power Pivot" mode [1] of excel scales far beyond [2] the spreadsheet mode.

[1] https://support.office.com/client/power-pivot-powerful-data-...

[2] https://support.office.com/client/Data-Model-specification-a...

algorithmsRcool··on An Introduction to Data Oriented Design with Rust
Part of the Trill[0] processing engine in C# does this. It uses reflection to vectorize normal objects into a columnar format internally.

[0] : https://github.com/microsoft/Trill

algorithmsRcool··on GitHub CLI 1.0
I don't understand this mentality. Git itself doesn't provide a way to interact with PRs or issues on GitHub.

This utility does.

If you are uncomfortable with using GH to manage issues and PRs you shouldn't probably shouldn't be using GH.

algorithmsRcool··on GitHub CLI 1.0
GitHub is killing it with these features. I wonder how long Azure Repos will survive on it's own.
algorithmsRcool··on Ask HN: Recommendations for Good TUI Libraries (Text User Interface)?
It is ok, but I would not recommend it. It got off to a great start but I ran into problems/limitations with some fairly basic stuff.

I can't recall exactly what my issue was with it however, it has been a few months.

algorithmsRcool··on Ask HN: Recommendations for Good TUI Libraries (Text User Interface)?
I tried to use Gui.cs and wasn't able to. It has a lot of rough edges and I had to move on because it wasn't well fleshed out.

Other/better .NET libraries include:

https://github.com/spectresystems/spectre.console

https://github.com/TomaszRewak/C-sharp-console-gui-framework

https://github.com/elw00d/consoleframework

algorithmsRcool··on Embrace, extend, and finally extinguish – Microsoft plays their hand
Fair point, I've strayed from the topic at hand.
algorithmsRcool··on Embrace, extend, and finally extinguish – Microsoft plays their hand
> I think a lot of people wrongly assume that GitHub is so "easy" that you don't actually have to spend any time to learn how to use it.

For a lot of people, probably the large majority of people, GitHub's (or GitLab's) UI is simpler to work with than a terminal. The overwhelming success and popularity of GitHub has demonstrated the value of it's UI. I just don't see how you could convince the Atom/VSCode generation of developers to go back to mailing lists.

> so, when you work for any company that's not just a startup, you likely have to learn yet another set of tools. And again if you switch the company.

As far as I am concerned, the email workflow is just "another set of tools" too. Except no company I've worked with or worked for has used it.

algorithmsRcool··on Embrace, extend, and finally extinguish – Microsoft plays their hand
For what it is worth, I watched the video.

I'm sorry, I just disagree. I think there are plenty of devs that agree with you, but I don't.

Some points:

- Working with the UI of GitHub is pretty painless to me.

- On the other hand, I hate dealing with email and prefer tools like slack or even teams to checking and responding to emails. The thought of emailing patch diffs sounds crummy to me after being spoiled on the interactive UI flows of GH pull requests.

- I think the big bifurcation is on the concept of staying in the terminal at all times. I don't develop that way. I also don't send emails from the terminal at all. I primarily work in C# and F# on Windows with VSCode and VS as my daily drivers for editing code. I use the IDE UI to switch branches, merge, rebase and commit most of the time. Perhaps I'm not your target audience.

- I find Git's commands to be rather fiddly most of the time. And why bother remembering complex syntax when I can click familiar buttons. I prefer the ergonomics of the UI even if incurs a mental context switch. But really, that context switch doesn't hurt much compared to the cognitive load of my normal work.

- The last point I'll make is discoverability. Just last week a friend of mine made her first contribution on GitHub in less than 10 minutes. Without needing to look up docs or google workflows. The GitHub UI made a complex concept such as Git branching and merging very simple for her. That alone is worth alot.

algorithmsRcool··on Amazon launches Halo: tracks activity, body fat, emotions
I wouldn't trust Amazon or any other tech giant with data about my emotions, that information is more personal to me than the contents of my day to day conversations or any other biometrics they might be scraping. What an unimaginable panopticon we are entering into.

But in a dream world, I would love a device that could help me map out my emotional state over time. My emotional health is a huge component to my well being. I currently manually keep an offline journal of my mood daily and use it to better understand myself, offloading that to a passive monitor would be great.

algorithmsRcool··on Live View of Hurricane Laura
I've always liked https://earth.nullschool.net/

If you click the button in the bottom left, it has a lot of features for viewing things like Wind speed, Wave Height, Atmospheric particulates and even Aroura activity.

algorithmsRcool··on Embrace, extend, and finally extinguish – Microsoft plays their hand
I have a hard time taking this seriously. Email is a pain to use compared to a dedicate feature UI.

I think the real problem is the need for a standardized pull request protocol that people can wrap. Then let people use email, a website, an API or whatever they want.

algorithmsRcool··on One Year of Nushell
Think powershell, but built in rust, posix first and better at processing data(xml, csv, json, ...)
algorithmsRcool··on Journal 2.0: Mental Space for What Matters
Thank you for following up. I like the product. The UX is very nice and the workflow adds alot of value for me.

Definitely going to test it out.

2 things

1. On windows, your app is getting caught by SmartScreen. I imagine this will fix itself, but fyi.

2. How do I report bugs?

algorithmsRcool··on Journal 2.0: Mental Space for What Matters
I understand the emphasis on getting users to sign up, but I wanted to read more to see where this might fit into my workflow.

- Does it support markdown?

- Can I export my notes?

- Are there any to-do list features?

algorithmsRcool··on Game Programming Patterns: Event Queue (2014)
I couldn't count the number of hours I spent playing that game with friends. Never played anything else like it!
algorithmsRcool··on Game Programming Patterns: Event Queue (2014)
I recall that Supreme Commander used the same technique, a fully deterministic sim run in lockstep by all multiplayer peers. For it's era, it had very very high scale for an RTS game. (thousands of units and enormous game maps (the biggest of which took 15+ mins to send naval units across)

If I recall correctly, there was another benefit. You could save a multiplayer game by just having all peers dump the current game state to disk and resume it later. Since a big SupCom game could take HOURS this was a great feature.

However, there were 2 issues with SupCom's implementation.

1. It wasn't perfect and sometime hours deep into a big game, you would get a "desync" error and it was unrecoverable.

2. Everyone needed to be able to run the sim at the same speed. So the game could only progress at the speed of the slowest player's computer. And SupCom was VERY compute intensive.

algorithmsRcool··on The life-changing love of Paul Dirac (2015)
> After returning from a visit with her in Budapest, Dirac wrote, “I felt very sad leaving you and still feel that I miss you very much. I do not understand why this should be, as I do not usually miss people when I leave them.”

This line is like something out of a movie.

algorithmsRcool··on It’s strange what people put up with in C#
C# is pretty great, I use it everyday. But if you've even spent significant time in F#, you return to C# land asking some of the same questions Don does.

A great example is C# 8's Nullable Reference Types feature, touted as (partial) solution to the Null object references. But it isn't air tight, or even water tight. Even if you annotate everything correctly, you can still slip null refs past the compiler.

But F#'s solution to the Null ref issue is much simpler, don't allow nulls at all. Force the developer to use Option<T> to express the absence of value. F# did it correctly the first time and has benefitted ever since.

algorithmsRcool··on It’s strange what people put up with in C#
No it does not, unless the discarded value is a Task in an async method. (or sometimes an IDisposable depending on what analyzers you have running)
algorithmsRcool··on It’s strange what people put up with in C#
> This guy is the designer of F# complaining that C# is not more like F#.

History, by way of the C# design team, has validated his opinions. Don Syme has had a massive influence on C# even when one degree removed from it's design. His complaints should be considered carefully.

Mark Seemann has a good write up about his contributions: https://blog.ploeh.dk/2015/04/15/c-will-eventually-get-all-f...

algorithmsRcool··on Using 'this' incorrectly in C#
It is entirely about taste except for his mention of correctness between 'base' and 'this'.
algorithmsRcool··on Apple just kicked Fortnite off the App Store
Epic might not be the little guy, but Apple is worth almost $2 Trillion. That is a pretty big brother.
← PreviousPage 3 of 9Next →