HackerTrans
TopNewTrendsCommentsPastAskShowJobs

twanvl

no profile record

comments

twanvl
·قبل 3 سنوات·discuss
This tile forces a pattern that does not repeat. If you use the simpler shape you can tile a wall such that it never repeats, but you can also make a repeating pattern.
twanvl
·قبل 4 سنوات·discuss
Money is fungible, personal data is not.
twanvl
·قبل 4 سنوات·discuss
Other advantages of zero based indexing, beyond being 'closer to the machine':

It works better with the modulo operator: `array[i%length]` vs `array[(i+length-1)%length+1]`. Or you would have to define a modulo-like operator that maps ℕ to [1..n].

It works better if you have a multi-dimensional index, for example the pixels in an image. With 0 based indexing, pixel `(x,y)` is at `array[x+widthy]`. With 1 based indexing it is at `array[x+width(y-1)]`. You might argue that programming languages should support multi-dimensional arrays, but you still need operations like resizing, views, etc.
twanvl
·قبل 4 سنوات·discuss
The ergonomics of this are really bad without some kind of implicit parameters and trait resolution. Without trait methods, ad-hoc overloading becomes impossible. You would have to explicitly specify what + operator and what == operator you use everywhere. After all, there could be multiple different additions or comparisons defined for a type, so which one do you mean by `+`?

Another problem is that a data structure's invariant can depend on the trait implementation. For example a tree is balanced with a comparison. This means that the comparison has to be stored in the struct, with the corresponding runtime overhead. With traits you know that there is only a single implementation for any particular type, so if the trait v-table is an argument to every method call there is no risk of different implementations being used at different times.
twanvl
·قبل 5 سنوات·discuss
It matters if people figure out how to make your model output inappropriate things and start sharing screenshots on twitter. What if you use a GPT model as part of a chat bot? Then you definitely don't want to risk any sexual or discriminatory output for example. If that was a person talking, they would be fired.
twanvl
·قبل 5 سنوات·discuss
Depending on the type of puzzle, it might be possible to work backwards. For example here, if you can compute reverse-transitions you could run one or two steps of that, and put all states from which the goal can be reached in two moves into a HashMap. Then you run the forward search and stop as soon as you hit anything in that HashMap. In theory, you can reduce the runtime to find an n-move solution from O(bf^n) to O(bf^{n/2}), at the cost of more memory use. This can also be combined with A*.

Low-level optimization can be worth it:

* You can try to pack the game state into integers and use bitwise operations. An 8×8 board can be stored as a 64 bit vector, so a `u64`. If you know the edges of the board are never occupied, then moving around can be as simple as a bit shift (probably not for this game).

* A smaller state representation also means that HashMap lookups will be faster.

* Instead of using a pair of integers to represent a position, use a single integer and save a multiplication for every lookup into a grid.

* Add a ring of impassible cells around the board, instead of checking for the edges of the board each time.
twanvl
·قبل 5 سنوات·discuss
An important input to this (and similar) algorithms is multiple sequence alignment, which tells the algorithm which parts of proteins are preserved between species and variants, and which amino-acids mutate together. So already it is relying on natural selection to do some of the work. And the algorithm will probably not work very well if you input a random sequence not found in nature and ask it to find the folding.
twanvl
·قبل 5 سنوات·discuss
I don't expect building a fusion power plant to become cheaper than a gas power plant. Both need steam turbines, cooling pipes, a big building, etc.. So that would be a lower bound on the construction cost.

If solar+batteries can outcompete fossil fuel plants (while ignoring fuel costs), then fusion likely wouldn't be viable commercially. And if you look at [the data](https://en.wikipedia.org/wiki/Cost_of_electricity_by_source#...), we are already close to this point.
twanvl
·قبل 5 سنوات·discuss
A legitimate interest is a use of personal information that is needed to fulfill a service. This would be something like a session cookie for storing the contents of a shopping cart, a site's preferences, or login information. Using a cookie is the only way to provide that, and the user is basically implicitly asking for something to be stored. It would be silly to have a consent checkboxes like "before you can shop with us we need your permission to register what you want to buy" or "you give us permission to share your address details with the delivery company so they can actually deliver stuff to you".
twanvl
·قبل 5 سنوات·discuss
> I'd be interested to see what a sufficiently strong QuickCheck specification of this problem would look like.

I would write something like this in haskell:

    spec :: [Integer] -> Property
    spec xs =
       length xs <= 2  ==>  fun (intercalate "," (map show xs)) == sum xs
This captures the three requirements, but not the implicit fourth requirement that the function throws an exception for other inputs.