Better HN
topnewbestaskshowjobs
Log inSign up

sischoel

163 karma · joined Dec 27, 2013 (12y ago) · 65 submissions

Github: https://github.com/simonschoelly
Submissions

comment 11mo ago · link · parent

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.

comment 1y ago · link · parent

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.

comment 1y ago · link · parent

Or use itemgetter:

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

comment 2y ago · link · parent

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?

comment 2y ago · link · parent

The CUDA documenation tells me that there are more performant but less precise trigonometric functions: https://docs.nvidia.com/cuda/cuda-c-programming-guide/index....

Do you know if that hardware pipeline works only for these intrinsic variants?

comment 2y ago · link · parent

I am not sure if this was the very first paper talking about attention, but https://arxiv.org/abs/1409.0473 from 2014 is a famous one.

What is still missing there, is the idea of self-attention.

comment 3y ago · link · parent

Do you have any sources on that? The only thing I could find was that some parties want to ban digital billboard in the city of Zurich (not the whole canton).

comment 3y ago · link · parent

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.

comment 3y ago · link · parent

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.

comment 3y ago · link · parent

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.

comment 3y ago · link · parent

It is indeed O(N). There is also a more efficient algorithm (in case the range is small) that uses binary search to find the first index. Such an algorithm would have time complexity O(log(N) + H) where H is the number of elements in the output.

comment 4y ago · link · parent

From skimming the paper (https://arxiv.org/abs/2211.09055), the proof seems to be amazingly short and relies only on a few theorems that one encounters in introductory class on information theory. Definitely recommendable to read if one is interested in that kind of combinatorics.

comment 4y ago · link · parent

Why is that though? Wouldn't something like `mov eax 0` also work?

comment 4y ago · link · parent

Isn't that the case for most programming languages? The only exceptions I can think of are C++ and Rust.

comment 4y ago · link · parent

Do you know any sources on on how set equivalence theory is related to integer programming? Because I don't see the immediate connection and I could not find anything on the internet, but maybe I used the wrong terms.

comment 4y ago · link · parent

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.

comment 4y ago · link · parent

C and C++ do not have labeled breaks - Java indeed has.

But of course you are right, that one could just use goto for C/C++.

comment 4y ago · link · parent

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

?

comment 4y ago · link · parent

The page is from 2008 - unfortunately a lot of links to the original pictures do not work anymore.

comment 4y ago · link · parent

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".

comment 4y ago · link · parent

Indeed, there are quite a few application in cryptography, where one has to search trough a huge space. Wikipedia actually listens a few: https://en.wikipedia.org/wiki/Cycle_detection#Applications

comment 5y ago · link · parent

It looks as if this year only repos with the topic "hacktoberfest" or PR's with the the tag "hacktoberfest-accepted" participate, so this should limit the amount of spam. Source: https://hacktoberfest.digitalocean.com/faq

comment 5y ago · link · parent

What about "data engineer"? There seem to be a lot of jobs for that title nowadays.

comment 5y ago · link · parent

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.

comment 5y ago · link · parent

While this is an interesting result, isn't basically every compiler NP-hard, because of register allocation?

comment 5y ago · link · parent

Although it is possible to create branchless binary search. Here is one article: https://schani.wordpress.com/2010/04/30/linear-vs-binary-sea..., there are probably other ways to do that.

Another interesting question where one could sink a lot of time is how do to binary search on GPU's using multiple threads. There branching in multiple threads at the same time is also bad, but for slightly different reasons.

comment 5y ago · link · parent

Thanks, I had not seen that dissertation yet, it has much more information than that arxiv link - here is a a pdf of that dissertation that google gave me: https://www.illc.uva.nl/Research/Publications/Dissertations/...

Although strictly speaking the idea with the evolutionary trees is a bit older, as far as I know it is from https://arxiv.org/pdf/cs/0111054.pdf

comment 5y ago · link · parent

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.

comment 5y ago · link · parent

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...

comment 5y ago · link · parent

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.

123