HackerTrans
トップ新着トレンドコメント過去質問紹介求人

w23j

no profile record

投稿

Social Media Recalibrates How the Brain Values Mental Effort

neurosciencenews.com
3 ポイント·投稿者 w23j·8 日前·0 コメント

コメント

w23j
·2 か月前·議論
CTF stands for Capture the Flag. So with that definition you have exactly zero more information about the article then without it. So I assume next you want a short description of what it actually means, like "CTF (Capture the Flag) are security competitions where the objective is to break...", which is completely ridiculous to include in an article aimed specifically at the CTF crowd.
w23j
·2 か月前·議論
For people who are confused by this comment: lol = laughing out loud!
w23j
·7 か月前·議論
That's the main reason, why I hope Google does not win this AI war.
w23j
·8 か月前·議論
I mean the inner select uses "limit 1", right? So it will usually (but not always as I said in another comment) only delete and return a single task.
w23j
·8 か月前·議論
We use a similar approach.

Fun fact: A query like this will, once in a blue moon, return more than limit (here 1) row, since the inner query is executed multiple times and returns different ids, which is surprising for a lot of people. If your code does not expect that, it may cause problems. (The article seems to, since it uses a list and iteration to handle the result.)

  delete from task
  where task_id in
  ( select task_id
    from task
    order by random() -- use tablesample for better performance
    for update
    skip locked
    limit 1
  )
  returning task_id, task_type, params::jsonb as params 
You can avoid that by using a materialized Common Table Expression. https://stackoverflow.com/questions/73966670/select-for-upda...

Also, if your tasks take a long time, it will create long-running transactions, which may cause dead tuple problems. If you need to avoid that, you can mark the task as "running" in a short-lived transaction and delete it in another. It becomes more complicated then, since you need to handle the case that your application dies while it has taken a task.
w23j
·8 か月前·議論
This file from chapter 1 cannot be opened: arch/x86/kernel/entry_64.S ("Failed to load file").

It's also not visible in the directory tree on the left.

(Oddly enough another comment mentioned this already and is voted dead. Why?)