HN user

sischoel

163 karma

Github: https://github.com/simonschoelly

Posts1
Comments64
View on HN

The issues with auto-translated Reddit pages unfortunately also happens with Kagi. I am not sure if this is just because Kagi uses Google's search index or if Reddit publishes the translated title as metadata.

I think at least for Google there are some browser extensions that can remove these results.

Dotted notation would not work because the keys in a dict can also contain dots. I am not terrible familiar with them but there is something called `lenses` that comes from functional programming that should allow you to access nested structures. And I am pretty sure there must be at least one python library that implements that.

Or use itemgetter:

  >>> from operator import itemgetter
  >>> dct = {'greeting': 'hello', 'thing': 'world', 'farewell': 'bye'}
  >>> thing, greeting = itemgetter("thing", "greeting")(dct)
  >>> thing
  'world'
  >>> greeting
  'hello'

I was looking a bit at the code for the shared memory implementation in https://github.com/3tilley/rust-experiments/tree/master/ipc and the dependency <https://github.com/elast0ny/raw_sync-rs.

My last systems programming class was already a few years ago and I am a bit rusty, so I got some questions:

1. Looking at the code in https://github.com/elast0ny/raw_sync-rs/blob/master/src/even...) it looks like we are using a userspace spinlock. Aren't these really bad because the mess with the process scheduler and might unnecessarily trigger the scaling governor to increase the cpu frequency? I think at least on linux one could use a semaphore to inform the consumer that new data has been produced.

2. What kind of memory guarantees do we have on modern computer architectures such as x86-64 and ARM? If the producers does two writes (I imagine first the data and then the release of the lock) - is it guaranteed that when the consumer reads the second value that also the first value has been synchronized?

A few years ago I was trying if I could port that code to Linux. I made some decent progress, but in the end I got stuck trying to convert the resources (images and audio files) to a more modern format. For example, the PICT format (https://en.wikipedia.org/wiki/PICT) is not just some pixel encoding but also contains QuickDraw commands. There are some open source converters, but they seem to support only a subset. And then I had to concentrate on finishing my degree so I abandoned that project.

Other things I remember: - Data is mapped directly from files to C structs - this provided some challenges as I had to convert big endian to little endian. - Classic MacOS handled memory allocations quite a bit different, if one wanted to access a dynamically allocated buffer, they first had to acquire a lock on that part of memory as otherwise the operating system was allowed to move the data to some other address.

My memory on these details is quite a bit fuzzy though, so I can't guarantee that what I wrote here is 100% correct.

[dead] 3 years ago

There are some very explicit images for the default prompt when one scrolls a bit around there, can't imagine that OpenAI would not filter these out.

When one talks about the average income, does that average only consider people that work? Otherwise, in countries with a high rate of unemployment, I would imagine that a single salary might have to feed the whole extended family, so that one needs to have a salary that is much higher than then average income to be sustainable.

Such graph collections are super helpful when trying to figure out if some theorem holds for a certain graph class, although only up to a certain size.

I think a lot of these graphs where generated with the genc.c program included in nauty (official website: https://pallini.di.uniroma1.it/ -- unofficial Github repository: https://github.com/lonnen/nauty). With the computing power that we have nowadays it might be easier to just to just run that program.

Genuine question, not a comment on OPs implementation: What is the reason that people so often use some external service for creating task queues (often backed by some kind of db), instead of just implementing it themselves in whatever language they are using for the rest of their application?

Is it: - They want persistence in case the system goes down, or the task queue service is restarted.

- They want to replicate their task queue service and want to be sure that the data is properly synchronized.

- The amount of tasks/time if simply too much for some standard library queues

- They think is is easier to add another dependency than implement it themselves

- something else

?

One could argue that Julia is just Lisp with a syntax that appeals more to popular taste.

There is also a secret option to get into a lisp repl in Julia "julia --lisp".

Yes, I hadn't thought about that before, but of course the difference here is that the Rust compiler cannot just produce a "good enough" result for pattern matching.

I think there is a mistake in that article: One has to fix a specific language before and then determine the Kolmogorov Complexity of an input - one is not allowed to take a separate Language for each input, unless one also encodes how that Language is calculated from an input, which will take up some space. This is a bit like saying that SAT is in O(1): One can create a separate program for each instance that answers that instance in constant time.

And the useful applications that I know of (apart from using it as a tool in proving theoretical things) come from replacing the Kolmogorov complexity with a a real compressor that just approximates the Kolmogorov complexity - this produces some empirical results.

This article is surprisingly short on actual applications.

For some interesting applications one might look at the the Wikipedia article for the normalized compression distance: https://en.wikipedia.org/wiki/Normalized_compression_distanc...

This paper here shows some interesting applications - it is not the first one, but the first non-paywalled one that I found: https://arxiv.org/pdf/cs/0312044.pdf

There is also a book by Paul Vitanyi - it has been a while since I looked at it, but if I remember correctly it also discusses some of these applications: https://www.amazon.com/Introduction-Kolmogorov-Complexity-Ap...

It might be possible that candidates are afraid that their solution is not clever enough for you, i.e they assume that you want something like a one line formula that only contains numbers and basic arithmetic operators.

The way I would solve something like that is by mentioning that it is a good approach to do time calculations with some library functions so that I won't have to deal with all the weird edge cases, then start with a loop over the months and later refine that to get rid of the loop, but it is very much possible that an interviewer might view this loop negatively.

There might also be some cultural aspects. While the Gregorian calendar is probably somehow used everywhere in the world, I think there might also be some other calendar formats being used in parallel.

If it is the first interview of the day, maybe the candidates are also just nervous? I remember when I had my on site interview at Google, the first warm up question had something to do with probability and could be easily solved with linearity of expectation. In the months before that interview I had dealt quite a lot with probability for my master thesis - but at that day I was quite nervous and I had not slept well, so I spend quite a lot of time on that question. I think I answered later questions better, although it was not enough in the end.

Do you usually see some correlation between the warm-up question and later performance?

I am not sure if that is necessary, but what might help is by starting to calculate the number of days from the start of the month and then adapt the question.