Better HN
topnewbestaskshowjobs
Log inSign up

mristin

45 karma · joined Sep 29, 2019 (7y ago) · 23 submissions

Submissions

1.

Manifesto of the Dinamika Games - for a world of cooperative, moving games(github.com ↗)

1 points · by mristin · 1d ago · discuss

comment 4d ago · link · parent

Thanks for your comment -- I get the relaxation point, but that's exactly the problem. There is nothing that pushes you away from the addictive behavior. Maybe it's not a big problem for the adults with fully developed frontal cortex, but it's a huge problem for the kids.

3.

Ask HN: Why aren't there more games where you use your body as a controller?

2 points · by mristin · 4d ago · 3 comments

comment 3w ago · link · parent

I have heard a couple of times -- Uber, but for prostitution.

comment 8mo ago · link · parent

Have a look at Asset Administration Shells (AAS) -- it is a data exchange format built on top of JSON and XML (and RDF, and OPC UA and Protobuf, etc.).

https://industrialdigitaltwin.org/

(Disclaimer: I work on AAS SDKs https://github.com/aas-core-works.)

6.

Show HN: Learn English with pictograms, speech and body pose(github.com ↗)

1 points · by mristin · 2y ago · discuss

comment 3y ago · link · parent

Just let the kids play games in foreign languages. That's educational enough for me.

comment 3y ago · link · parent

XBox doesn't work outside & in the class room. Now, I wouldn't advocate for playing computer games outside -- but this might be a nice gimmick for children's birthdays when celebrated in the garden.

A friend of mine uses these games in the classroom as a primary school teacher. Kids here all have a laptop, so when they get nervous, it's a neat way for them to make a break & move a bit. Apparently, this works well for kids with hyperactive tendencies. Kinect would be too complicated in that setting as you need to purchase & maintain 20+ Kinects.

comment 3y ago · link · parent

I'll try to package it for Linux this morning. So far nobody asked for it.

comment 5y ago · link · parent

Sorry, I did not express myself clearly. For certain functions you can express all the properties in contracts and have them automatically tested.

For other functions, you write some obvious contracts (so that those are also tested in integration tests or end-to-end tests), but since writing all the contracts would be too tedious or unmaintainable, you test these functions additionally using, say, table-driven tests where you specifically test with data points for which you could not write the preconditions or you check the post-conditions manually given the input data. For example, sometimes is easier to generate the input, manually inspect the results and write the expected results in the test table.

> [...] turn contracts into tests [...]

icontract-hypothesis allows you to ghostwrite Hypothesis strategies which you can further refine yourself.

comment 5y ago · link · parent

P.S. I think the important bit is not to be religious about contracts and tests. Sometimes it's easy to write the contracts and have the function automatically tested, sometimes unit tests are clearer.

I tend to limit myself to simple contracts and do table tests for the complex cases to reap the benefits of the both approaches.

comment 5y ago · link · parent

In my anecdotal experience, it takes very little time for juniors to pick up adding contracts to their code. You need to grasp implication, equivalence, exclusive or, and get used to declarative code, but then it's easy. (I often compare it to SQL.)

I find contracts personally super useful as I can express a lot of relationships in the code trivially and have them automatically verified. For example, when this input is None, then that output needs to be positive. Or if you dele the item it should not exist in this and that registry, and some related other items should also not exist any more.

My email is in the commits of the repository, feel free to contact me and we can have a chat if you are interested in a larger picture and more details.

comment 5y ago · link · parent

Just in case you are looking for an alternative approach: if you write contracts in your code, you might also consider crosshair [1] or icontract-hypothesis [2]. If your function/method does not need any pre-conditions then the the type annotations can be directly used.

(I'm one of the authors of icontract-hypothesis.)

[1] https://github.com/pschanely/CrossHair

[2] https://github.com/mristin/icontract-hypothesis

comment 5y ago · link · parent

You can already do that with a family of predicates if you write preconditions in your Python code (see my previous comment [1]). There is an ongoing discussion how to bring this in into Hypothesis (see the issue [2]).

[1]: https://news.ycombinator.com/item?id=26018386

[2]: https://github.com/HypothesisWorks/hypothesis/issues/2701

edit: newlines

comment 5y ago · link · parent

If you use Python and want to infer test strategies from contracts, you might want to check out this library of mine: [1].

There are also plugins for IDEs (Pycharm, VS Code and vim), which can be quite helpful during the development.

[1]: http://github.com/mristin/icontract-hypothesis

comment 5y ago · link · parent

Use contracts and propery-based testing. See Hypothesis library in Python (and other laguages). I wrote a library for contracts in Python (http://github.com/Parquery/icontract, see its readme for further references to other libraries).

comment 6y ago · link · parent

I find the combination between unit tests, component tests and contracts the best. Contracts allow you to test with tons of data you wouldn't have ever generated manually when enabled in component and e2e tests.

The contracts obliviate often the need to write extensive unit tests. As they are part of the interface, we can avoid thus to re-write many unit tests when the interfaces change during a refactoring.

comment 6y ago · link · parent

Switzerland faced similar warfare, terror, murder and bloodshed -- it's only in 1848 that Switzerland came to peace.

comment 6y ago · link · parent

I always wondered where this multiplicative factor of "several times" comes from. In my experience, writing correct software was marginally slower than writing sloppy software as long as most thinking is done with a pen & paper. Would you mind to elaborate a bit more?

comment 6y ago · link · parent

You can use PEX for Python.

At my previous job, we used a python script to rsync files -- very, very simple. I think it would have been much more difficult and error-prone with Dockers.

comment 7y ago · link · parent

See also Mapry [0], a code generator we particularly made for JSON.

[0] https://github.com/Parquery/mapry