[-] oessessnex@programming.dev 5 points 2 weeks ago* (last edited 2 weeks ago)

I would just pick the value from the root of each underlaying balanced binary tree, easy.

[-] oessessnex@programming.dev 5 points 3 weeks ago* (last edited 3 weeks ago)

If you create accounts on various sites with an email address on your new domain keep a list of those. If decide to let the domain expire you need to close the accounts beforehand, otherwise someone else can get access if they purchase the domain.

Also you will likely be playing for the domain forever, so just register/renew it for 10 years, maybe you'll also get a discount.

[-] oessessnex@programming.dev 5 points 1 month ago

It's easier to write that much if you are just making stuff up...

[-] oessessnex@programming.dev 21 points 1 month ago

I don't have 2 mil, how do I get out of this? File for bankruptcy?

[-] oessessnex@programming.dev 10 points 2 months ago

Remove the wall plug, straighten the paper clip and insert it into the cable in between the wires, reinstall the wall plug.

[-] oessessnex@programming.dev 6 points 2 months ago

You don't even need soil, you can just put them on the ground and cover them with hay, and they grow just fine.

[-] oessessnex@programming.dev 5 points 2 months ago

The sum and product types follow pretty much the same algebraic laws as natural numbers if you take isomorphism as equality.

Also class inheritance allows adding behaviour to existing classes, so it's essentially a solution to the expression problem.

[-] oessessnex@programming.dev 5 points 10 months ago

The implementations mostly don't matter. The only thing that you need to get right are the interfaces.

[-] oessessnex@programming.dev 4 points 10 months ago

Well, most people installing Arch for the first time have no idea what a typical Linux install does under the hood. That makes it a worthwhile learning experience. The same commands you use during the setup you can later use to fix or change things. It basically forces you to become a somewhat proficient Linux user.

[-] oessessnex@programming.dev 11 points 10 months ago* (last edited 10 months ago)

Nope. Monads enable you to redefine how statements work.

Let's say you have a program and use an Error[T] data type which can either be Ok {Value: T} or Error:

var a = new Ok {Value = 1};
var b = foo();
return new Ok {Value = (a + b)};

Each statement has the following form:

var a = expr;
rest

You first evaluate the "expr" part and bind/store the result in variable a, and evaluate the "rest" of the program.

You could represent the same thing using an anonymous function you evaluate right away:

(a => rest)(expr);

In a normal statement you just pass the result of "expr" to the function directly. The monad allows you to redefine that part.

You instead write:

bind((a => rest), expr);

Here "bind" redefines how the result of expr is passed to the anonymous function.

If you implement bind as:

B bind(Func[A, B] f, A result_expr) {
   return f(result_expr);
}

Then you get normal statements.

If you implement bind as:

Error[B] bind(Func[A, Error[B]] f, Error[A] result_expr) {
   switch (result_expr) {
       case Ok { Value: var a}:
           return f(a);
       case Error:
           return Error;
   }
}

You get statements with error handling.

So in an above example if the result of foo() is Error, the result of the statement is Error and the rest of the program is not evaluated. Otherwise, if the result of foo() is Ok {Value = 3}, you pass 3 to the rest of the program and you get a final result Ok {Value = 4}.

So the whole idea is that you hide the if Error part by redefining how the statements are interpreted.

[-] oessessnex@programming.dev 14 points 1 year ago* (last edited 1 year ago)

I usually kill them with my phone with the screen turned on (the background needs to be blueish and the room needs to be completely dark). For some reason they don't see it, they just sit there until they get squashed.

This doesn't work for tiger mosquitoes.

view more: next ›

oessessnex

joined 1 year ago