HNHacker News
TopNewBestAskShowJobs

szemet

1,146 karma · joined October 20, 2015

submissionscomments
szemet··on 100 days with Rust: a series of brick walls
"getting type annotations right can be so difficult"

I had the same experience. After getting lifetimes (more or less) this became my largest headache... I wish for stronger type inference and features like this: https://downloads.haskell.org/~ghc/7.10.1/docs/html/users_gu...

I feel my productivity (and code quality) would increase a lot. For example right now I have to struggle so hard if I would like to write generic code, while in haskell that's more or less the default thing (the compiler infers it) if I just omit type annotations...

szemet··on Running Java in a Container
Yes, but some JVM implemetations have(had?) more support for this use case than others:

e.g. https://www.ibm.com/developerworks/library/j-multitenant-jav...

szemet··on The Best Books on the Philosophy of Mind
This is a known dilemma:

https://en.wikipedia.org/wiki/Hempel%27s_dilemma

szemet··on Flight Recorder becomes part of OpenJDK
Yes. Flying is just a faster way of transportation than (the traditional) running and in between we had Ruby on Rails...
szemet··on Firefox 59 released
Can't find in the release notes: Is the Android version now based on quantum as the desktop version? As it was promised a few months back:

https://www.androidpolice.com/2017/09/26/project-quantum-enh...

szemet··on Can retrocausality solve the puzzle of action at a distance?
That resolution of the problem is generically called "superdeterminism". The OP mention that multiple times...

"Thus, it is conceivable that freedom of choice has been restricted since the beginning of the universe in the Big Bang, with every future measurement predetermined by correlations established at the Big Bang"

https://en.wikipedia.org/wiki/Superdeterminism

szemet··on Nim language v0.18.0 released
I've just tried now some Rosetta code examples. Most of it had to be modified a bit to get compiled with this Nim version although. (adding types, change case of type names)

Used -d:release --opt:size, then strip, Ubuntu 16.04 64 bit. The binary sizes:

GTK2 example code: http://rosettacode.org/wiki/GUI_enabling/disabling_of_contro... - 35k

http client: http://rosettacode.org/wiki/Ordered_words#Nim - 72k

http server: http://rosettacode.org/wiki/Hello_world/Web_server#Nim - 121k

The binaries are dynamically linked only to the common standard C prog. dependencies on Linux: linux-vdso.so.1, libc.so.6, ld-linux-x86-64.so.2 (Except for the gtk2 example of course, which uses libdl to to pull in a large bunch of additional gtk dependencies too...)

szemet··on Nim language v0.18.0 released
5) Small binaries

That part is amazing. I personally do not have a real use case to exploit it [1], just find it neat from an engineering viewpoint...

I guess, it has an aggressive dead code removal process, compared to other - nowadays hot - compiled languages (Go, Haskell, Rust, D, Crystal). In those languages if you use a small part of their standard library, you usually get large chunks of it linked in statically (+ runtime if there is such)...

(Once I've tried LTO with one of my Rust project: it increased the build time tremendously but in the end it managed to shave off only 30KB from my several MB binary...)

[1] If I would try micro controller programming ever, I probably would give Nim a shot because of this...

szemet··on Stop Thinking of Exercise as a Way to Lose Weight, You May Actually Enjoy It
Excercise also changes body composition. It is usually missing from these articles - people are so much conserned about sheer body weight.

Even if one didn't lose weight may look much slimmer, just by having lower fat percentage... People with low enough body fat (especially taller people) can be rather slim even with BMI over 25...

szemet··on Zstandard – Real-time data compression algorithm
Ok then: playing PCM with PWM...
szemet··on Zstandard – Real-time data compression algorithm
Or playing PCM on the old PC speakers having only on/off beep function... It seemed like a miracle at the time :)
szemet··on Curry spice turmeric boosts memory by nearly 30%, eases depression, study finds
Ayurvedic theory (5 elements etc...) is usless compared to modern science, so much that I dare to say it is wrong...

Does it have predictive (and thus real explanatory) power? Imagine a test (other similar tests can be imagined):

give some powder to a western chemist/biologist and an ayurvedic to examine its "elements". You are not allowed to feed it to any human or animal. Decide if it is poisonous! Who will be more successful?

Ayurveda knows nothing about modern chemisrty or biology (real elements, cells,...), its theory part is rubish (from the perspective of natural science not from social science perspective (history, philosophy...) of course).

You may trust its experimental results, but that is not science in itself just a tradition...

szemet··on A prime number whose binary representation looks like a giraffe
Or you can move the image on canvases of different size until you find a position/size where it is prime.

Several other methods can work... Primes are not rare at all - average prime gaps are fairly small in that domain...

szemet··on Moonlight Sonata Visualized (2012) [video]
Offtopic, but this sonata is connected to one of the most witful naming (in my opinion) in IT industry:

The Silverlight clone was named to Moonlight (a Mono project - RIP), which on the surface seems like just a simple association, but Moonlight is a sonata in C#! :)

szemet··on The Expensive Art of Living Forever
If you wake up from deep sleep in the morning your consciousness from yesterday is resumed?

What makes it the same consciousness as the yesterday one, if not all your memories, and past experiences? If my pure consciousness wakes up tomorrow in your body, with all your memories, will it be your consciousness then?

szemet··on Consciousness: Where Are Words?
http://www.thespreadmind.com/The_Spread_Mind_S7.php

This is obviously false to me.*

If a robot vacuum recognizes a roadblock and stops, its inner representation of the roadblock is not merely an agreement (with whom anyway?).

That representation is internal and (normally) only accessible to the software of that particular robot (it may even could change over time - of course it would be a bad programming practice except for malwares - so no agreement is needed but only some kind of behavioral self consistency). And it have real causal power: it makes the robot stop and turn.

That representation is stored in memory cells wich are (usually in a normal household) not roadblocks.

*(AFAIK this viewpoint is called functionalism. It just somehow feels natural to me as a developer, but maybe it is just taste, and it is just as twisted for a philosopher as the above identity theory for me...)

szemet··on Yew: Rust framework for making React-like client web apps
In rust you can use either model.

Not really. Of course you can copy immutable data upon update, but persistent data structures (large shared state between data versions)[1] are hard to write without GC...

[1] https://en.m.wikipedia.org/wiki/Persistent_data_structure

szemet··on Going blind and learning to love audiobooks
I'm a big fan of the android tts. A bit robotic, with quite a few prosodic errors (which is simple to get used to), but so convenient. No need to hunt for audiobooks - actually in most languages the size of the audibook market is rather poor...

I can switch easily from audio to reading, e.g. listening while walking to the bus, and if I get a seat then switch to read, and then back to listening etc...

szemet··on The Art of Conducting
Actally there are some motion sensor based reseach in this domain, e.g.: http://journals.plos.org/plosone/article?id=10.1371/journal....
szemet··on The Art of Conducting
One hard thing about rehearsals is to catch and keep the musicians attention for hours.

Some of the best conductors I've met were really funny (like presenting jokes/stand up comedy at pauses), charismatic, ,energetic and engaging (for hours)... Conductors are making their main performances at rehearsals, and they are having much less (and shorter/simpler) work during the actual performances.

szemet··on Bitcoin Is a Terrible Currency, and Not for the Reason You May Think
'must have intrinsic value'

AFAIK one of the main underpinning of the Austrian school is: https://en.wikipedia.org/wiki/Subjective_theory_of_value

szemet··on Amazon's Fake Review Problem
I do not consider buying positive reviews with free items an ethical marketing strategy: it deceives people expecting unaffiliated opinions there...

Why should anyone take part in this?

If a company decides to give away free items, and gets nothing in reply that's their problem... I am happy when people do not sell their kidney for pennies: and as a single costumer you usually don't have the power to fight back large corporations: then sometimes the most convenient reaction is to keep both the free gifts and your kidney ;) And if many people do this, it may eventually get them out from business, win-win

edit: Thinking over, I partly agree with the previous comment. If they expect you to update your review, honesty may be the most ethical, so e.g. one can start it with: "They have sent me a free item after I returned mine and gave them a 2 star review..." ;)

szemet··on Why Throwing 92 Heads in a Row is not Surprising [pdf]
It is true, if you do not have memory (memoryless chanel with a memoryless observer;)

But if you do have memory, then you are free to chose to see "92 consecutive throws with a fair coin" as one event.

In that case the Kolmogorov complexity describes perfectly well why you should be suprised at low entropy outcomes - simply because those are rare events (using our new definition of 'event').

szemet··on A Generation Lost in the Bazaar (2012)
"there is a clear structure of who is responsible for what"

In a large org it is never clear, who is responsible for what... ;P And the result is sometimes even more code duplication, workarounds and bad examples of Conway's law in operation, than in free software.

https://en.m.wikipedia.org/wiki/Conway%27s_law

szemet··on A Map Showing How Much Time It Takes English-Speakers to Learn Foreign Languages
Hungarian and the other Finno-Ugric languages have diverged thousands of years ago. They share some basic words from the hunter-gatherer time (heart, water, fish etc...), but this is apparent only for linguists as the writing and pronunciation has diverged a lot.

Since then, hungarian language got a strong and more recognizable influence from turkic/slavic/germanic languages.

szemet··on What if consciousness is not what drives the human mind?
Another common objection (just to mention), is the distinction between good and bad feelings, suffering and pleasure, etc...

If ephiphenonalism is true, those categorizations should be purely learned: otherwise it is hard to explain why (evolutionary) harmful things usually cause bad experience and suffering, while useful things usually cause pleasure.

For example: I could feel intense pain and suffering eating a cake, it would not count if my unconscious decision was to eat it. So either it is pure luck that I enjoy it, or I learned to enjoy a lot of (otherwise neutral) feelings.

szemet··on Self-Replicating Functions
Just if anyone interested: There are also sequences that are labelled 'fractal', those are fun too:

https://oeis.org/A000120

'An example of a fractal sequence. That is, if you omit every other number in the sequence, you get the original sequence. And of course this can be repeated. So if you form the sequence a(0 2^n), a(1 * 2^n), a(2 * 2^n), a(3 * 2^n), ... (for any integer n > 0), you get the original sequence.'

szemet··on Linux containers in 500 lines of code (2016)
That's true.

I agree, you should iterate over all your existing capabilities and drop those that are not in the white-list. (I have implemented this functionality in one of my projects this way.)

BUT:

Maybe the reason some people do it otherwise, is that capabilities API have only a drop function for the bounding set, and people just don't think they should use it in reverse mode - Sapir-Whorf Hypothesis in operation! ;)

edit: seems like the author have a different reason though

szemet··on Linux containers in 500 lines of code (2016)
What a fine piece of literate programming!

I've just printed it out, and it literally contains 100 page of explanation and context for that 500 lines of code. Great work!

szemet··on Pearl No. 4 – Kth Smallest in the Union of Two Sorted Collections
If the data structures can be split (as it seems), then the first step should be to get the head k element of both collections, so we only have to work with a maximum of 2k elements. Then the solution is not O(2 * log(N)) but O(2 * log(min(N,2k))).
← PreviousPage 5 of 9Next →