HackerTrans
TopNewTrendsCommentsPastAskShowJobs

gaha

no profile record

comments

gaha
·7개월 전·discuss
This really reminds me of a new paper [1] from my colleagues. All figures in the paper link to a website, where the figures can be reproduced and dynamically changed in the browser from the source data. It's really cool, it is a static website that runs DuckDB, WebR, and ggplot. Here [2] is an example for the first figure.

[1] Paper: https://www.cs.cit.tum.de/fileadmin/w00cfj/dis/papers/clouds...

[2] Figure 1: https://tum-dis.github.io/cloudspecs/?state=N4IgzgjgNgigrgUw...
gaha
·4년 전·discuss
Have you tried unnesting the subquery? From the images posted in your blog it's not clear to me how often the subquery is run. Maybe unnesting it somehow like this should work well:

    SELECT COUNT(*)        as "count",
         COALESCE(MAX(EXTRACT(EPOCH FROM age(now(), runs.created_at)))::bigint, 0) AS "max_age"
    FROM runs
      JOIN stacks ON runs.stack_id = stacks.id
      JOIN worker_pools ON worker_pools.id = stacks.worker_pool_id
      JOIN accounts ON stacks.account_id = accounts.id
      /*unnesting*/
      join (SELECT accounts_other.id,  COUNT(*) as cnt
       FROM accounts accounts_other
         JOIN stacks stacks_other ON accounts_other.id = stacks_other.account_id
         JOIN runs runs_other ON stacks_other.id = runs_other.stack_id
       WHERE accounts_other.id
         AND (stacks_other.worker_pool_id IS NULL OR
          stacks_other.worker_pool_id = worker_pools.id)
         AND runs_other.worker_id IS NOT NULL
        group by accounts_other.id) as acc_cnt 
      on acc_cnt.id = accounts.id and  accounts.max_public_parallelism / 2 > acc_cnt.cnt
     /*end*/
    WHERE worker_pools.is_public = true
      AND runs.type IN (1, 4)
      AND runs.state = 1
      AND runs.worker_id IS NULL
      /* maybe also copy these filter predicates inside the unnested query above */
Edit: format and typo
gaha
·5년 전·discuss
The way I love doing these kinds of things is by literally using three lines of R code:

library(sqldf)

tab1 = read.csv("file1.csv")

sqldf("select * from tab1")

sqldf [1] is a library with which you can access R dataframes just like tables in SQL (it is actually using SQLite in the background). I do not have much experience with programming in R itself, but you barely need it. This approach has the advantage that it is very flexible, and you get the power of the (IMHO) best plotting library ggplot with it. Of course, you can also do more complicated stuff like joining multiple dataframes and basically everything else you can do with SQLite, and then store results back in R dataframes. This workflow works if you use an IDE which lets you execute single lines or blocks of codes like R-Studio. Then you also get a nice GUI with it, but there are also plugins for VI/Emacs that work very well.

[1] https://cran.r-project.org/web/packages/sqldf/index.html

EDIT: code formatting
gaha
·5년 전·discuss
The EU did the same and they were also the ones funding the BioNTech/Pfizer vaccine. But I agree with your other comment about the US. The EU should have done the same. Restrict all exports to other countries until x million is delivered domestically.
gaha
·5년 전·discuss
The EU has exported 41 millionen vaccine doses of which the UK has gotten 8 million so far [1]. Meanwhile, the UK and US do not export any vaccines at all. So just as a back of the envelope calculation, with 41 millionen doeses the EU could have vaccinated an additional 10% of its population, while the UK would have had more than 10% less vaccinatetions without those 8 million. This would not completetly close the gap, but the numbers would be quite different then.

Anyway, you can interpret this in a postivie way: the EU is trying to be good and is sharing its vaccinations more or less fairly with other countries (for now). However, you can also see it as the EU has no real power at all and is just an easy target to get fooled over by other countries..

[1] https://www.dw.com/en/coronavirus-eu-not-ready-to-share-covi...
gaha
·5년 전·discuss
Link to the revised paper [1] from the twitter thread. The claim "This destroys the RSA cryptosystem." in the abstract is unchanged.

[1] https://eprint.iacr.org/2021/232
gaha
·5년 전·discuss
I think if you really want to understand what is going on you actually have to read the DD "due diligence" and not just look at the funny memes. I found [1] might be a good starting point.

I'm not that into finance stuff, but the idea of a short squeeze still happening at the end of this week definetly seems interesting. It could be triggered by all the call options expiring on Friday, which will have to be covered by then. If that increases the price even more, I guess the short sellers will have to cut there losses and buy back stock, which supposably still might be sold short over 100%.

That's at least how I understood it and I have no clue if that might actually work. Of course there is a huge amount of people buying into GME just beacuse it is fun, memes, or whatever. But the idea behind all that definelty seems like an interesting bet.

[1] https://www.reddit.com/r/wallstreetbets/comments/l528pz/gme_...