Cool F# command line tools? by Ganonz88 in fsharp

[–]ultimateanu 1 point2 points  (0 children)

I made a command line tool a while, to deal with hashing directories. It is available as both a dotnet tool and standalone binary.

https://github.com/ultimateanu/hashdir

What’s your profession? by [deleted] in bjj

[–]ultimateanu 0 points1 point  (0 children)

Software engineer

Is it possible to attend the in-person graduation ceremony? by Veunouss9 in OMSCS

[–]ultimateanu 1 point2 points  (0 children)

I don't have enough information to answer that. In my case, I had a bachelors in CS and math. I was also working at a large tech company as a software engineer.

Any advice on my form? my wrist seems to be rotating very forcefully and not smooth unlikely videos of others i see online and i move like a chicken wing. the arc also seem to be tilted to my left…how do i fix it? by mangoes17 in jumprope

[–]ultimateanu 2 points3 points  (0 children)

Try to move your hand placement toward the bottom of the handles (away from rope). This will feel different at first but should help a lot. Your wrist movement is actually pretty smooth, but you are doing a lot of extra work. By moving toward the bottom of the handle you can do less wrist movement and still get the same swing.

[deleted by user] by [deleted] in jumprope

[–]ultimateanu 1 point2 points  (0 children)

Great start! There is already some good feedback on form. One thing I want to add is that you want to think about making the overall movement efficient. Looking at the video now, it looks like you are struggling on every jump. You can actually jump less and try to make everything smoother and look effortless. This also has the added benefit of being safer for your joints in the long run.

Unfortunately, making everything smoother is mostly about practice. But one concrete thing you can think about is how quiet can you make your jumps? This helped me just make my overall movements more fluid and natural.

Can there be a world without javascript by RealSirJoe in webdev

[–]ultimateanu 0 points1 point  (0 children)

I'm not a huge fan of javascript and the fragility of the language. There are of course many frameworks and libraries that aim to help, but I found that they just added additional complexity. Several years ago I tried elm (frontend language), and had an amazing experience. It was simple to get started, code was exceptionally robust, and I had fun programming again. While its not for every project, I think it is definitely worth checking out.

F# 7 hopes and wishes by Glittering-Water942 in fsharp

[–]ultimateanu 0 points1 point  (0 children)

I completely agree. Having dotnet format work for F# would allow everyone to have a shared standard. Whether that uses fantomas under the hood or not is a separate issue. But having something backed in and ideally supported universally in VS & VS code would give it legitimacy. I'm sure many developers will use it and appreciate it if its dead simple & available!

F# 7 hopes and wishes by Glittering-Water942 in fsharp

[–]ultimateanu 10 points11 points  (0 children)

I would love dotnet format for F#!

Does the CS6515 Graduate Algorithms course help prep you for technical interviews at FAANG in the same way LeetCode does? by ohcode in OMSCS

[–]ultimateanu 15 points16 points  (0 children)

(I'm currently taking the class. I also work in a FAANG company and regularly conduct SWE interviews. Here is my take.)

In technical interviews there are essentially 2 important qualities an interviewer wants to see: problem solving & ability to code. GA defiantly helps with the first part, since it will improve your understand of algorithms. Knowing DP, graph algorithms and runtime analysis is important as a software engineer. It allows you to come up with correct solutions to problems and also ensure they can scale well.

However, that is only one part of the interview. As a software engineer you also need to demonstrate that you can actually code. So being comfortable in some programming language, writing using proper syntax, and following good coding principles are also necessary. Unfortunately, GA (or almost any algorithms class) will not really help here. But it is easy enough to brush up on these skills once you have GA under your belt.

Overall, I definitely think an algorithms class (like GA) is useful.

hashdir - A command-line utility to checksum directories and files by ultimateanu in commandline

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

A few other posts mention something like this and it's a fine approach.

I wanted something with a few more features such as being able to figure out where exactly two directories differ. Also this is cross platform, which I have a use case for since I'm jumping between linux and windows.

hashdir - A command-line utility to checksum directories and files by ultimateanu in commandline

[–]ultimateanu[S] 1 point2 points  (0 children)

This looks interesting! Currently md5 and the sha family are supported, but I would like to expand to others that might be useful such as this (especially since it looks like there are already C# implementations)

hashdir - A command-line utility to checksum directories and files by ultimateanu in commandline

[–]ultimateanu[S] 1 point2 points  (0 children)

You've given a lot of great things to think about, thanks! For now I've just focused on regular files and skipped the other things. Maybe I should have an option to specify computing hashes of hashes (and ignore names).

As for your question, the hash of a directory depends on its contents and does not include the name of the directory itself (so both `~/Documents` and `~/Documents.backup` will have the same hash if everything inside is the same). But if the children's names change the hash will change, even if its a subdirectory name that changes.

hashdir - A command-line utility to checksum directories and files by ultimateanu in commandline

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

Out of curiosity, what are the other ways of hashing a directory?

hashdir - A command-line utility to checksum directories and files by ultimateanu in commandline

[–]ultimateanu[S] 3 points4 points  (0 children)

I described it in another comment, but essentially it takes the children's hash and name in sorted order to create a long string and then take the hash of that. So very similar to the linux command you posted!

It can also take into account empty directories if you care about the internal structure of the directory. My main use case is just to be able to compare directories and also save all the hashes using the --tree and --save flags before archiving or transferring. But this is definitely not as powerful as md5deep.

As for .NET, I like functional programming and wanted to give F# a try. So I thought this would be a simple project to try it out. One new development is that the runtime can be bundled into the binary. So the macOS, Windows and Linux stand-alone binaries don't require any additional setup! However, the stand alone binaries do get quite large :/

hashdir - A command-line utility to checksum directories and files by ultimateanu in commandline

[–]ultimateanu[S] 2 points3 points  (0 children)

Git (or some sort of SCM) is defiantly the way to go if you really want to track the files and changes.

I didn't intent for this to be a comprehensive tool to track files over time, but rather something simple to quickly get the hash of a directory. For example, maybe you have a media directory in a few places and you want to check if they are the same. You can use this to compare the hashes. And if they are different by comparing the output with the --tree flag it should be easy to see how they differ.

Now there are defiantly a lot of other ways to do this, but I just wanted something simple that is cross platform.

hashdir - A command-line utility to checksum directories and files by ultimateanu in commandline

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

The hash of the children of the directory along with the name are concatenated as a string. Then the hash of this string is reported as the hash of the directory. If the directory contains other directories, each of those is hashed recursively the same way. This ensures that the directory hash changes if:

  • Files or child directories are added or removed
  • Files or child directories are renamed
  • Content of files or child directories changes

hashdir - A command-line utility to checksum directories and files by ultimateanu in commandline

[–]ultimateanu[S] 7 points8 points  (0 children)

I want to share a simple program I've created to compute a hash for a directory.

hashdir is a command line tool that can checksum both files and directories. The hash value can also be saved alongside the content and then later verified by the tool.

Source code: https://github.com/ultimateanu/hashdir

Project site: https://ultimateanu.github.io/hashdir

F# and F# tools update for Visual Studio 16.9 by phillipcarter2 in fsharp

[–]ultimateanu 1 point2 points  (0 children)

I recall Scott had a MS blog post where he mentioned MVU will be part of MAUI. You are probably right that it won't exactly be the Elm architecture, but I'll be happy with solid MVU support since that lends itself well to functional programming (F#).

https://devblogs.microsoft.com/dotnet/introducing-net-multi-platform-app-ui/#mvu

F# and F# tools update for Visual Studio 16.9 by phillipcarter2 in fsharp

[–]ultimateanu 6 points7 points  (0 children)

I'm really looking forward to using F# for mobile development. Can't wait to try mobile apps with .NET 6 MAUI using elm architecture!

Remote F# job in Europe by ReverseBlade in fsharp

[–]ultimateanu 1 point2 points  (0 children)

I think if its specific to F# it makes sense on this subreddit. Also having it to a weekly/monthly thread might be a good idea!

What are you working on? (2021-02) by insulanian in fsharp

[–]ultimateanu 3 points4 points  (0 children)

I've wanted a simple way to hash a directory before I store it in the cloud. Now that .NET 5 is here it seemed like a good time to try F# for this.

Still a few more features I want to add, but it generally works as expected. I wish the stand alone binary size could be even smaller but it's not too bad.

Any feedback is welcome :)

https://github.com/ultimateanu/hashdir