juan_gandhi: (Default)
2023-03-10 10:28 am
Entry tags:

жизнь собачия

 Карен нашла там у меня смешной дефект в коде, что я послал на ревью. Спасибо ей; дефект поправил.

Теперь что. Добавил тесткейс.

Упс. Компилятор кирдык. scalac. Зацикливается.

Окей. Закомментировал пока большую часть того кейса.

Упс. Другие тесты не идут. А чо? А-а--а-а-а! Вставил запятую.

Вот что это вообще.

Настанет, наверно, момент, что я завяжу со скалой. Там какие-то ебанаты. Сейчас пошел очередной скандал, там какая-то дура, "заведующая скальной комьюнити", образование у нее - политология, из белградского университета, решила Джона де Гоуза не допускать в качестве спикера (или вообще?) на конференции. (Ну, к Джону главная претензия - что он лысый и мускулистый: не иначе расист.) Другого Джона (Прити) вообще выпинали отовсюду, потому что гелфренда одного левого экстремиста из Берлина нажаловалась публично, что ранее Джон Прити с ней трахался (а жениться не захотел).

Какая хуйня, прости господи. Надо вернуться на Форт, там дедушки мирные, все улыбаются (и я их почти что в лицо знаю, а уж по сорс-коду так точно, читал как стихи когда-то). Тоже маразм, конечно.

 

juan_gandhi: (Default)
2019-04-07 10:25 pm

the kind of programming

Reminds me what we did in Forth, with Leo, present here:

      applyTo | "a" | "b"  | "c" | "d"  | "e" |
      at("a") | "a" | "ab" | ""  | ""   | ""  |
      at("b") | ""  | "b"  | ""  | ""   | ""  |
      at("c") | ""  | "cb" | "c" | "cd" | ""  |
      at("d") | ""  | ""   | ""  | "d"  | ""  |
      at("e") | ""  | ""   | ""  | "ed" | "e" 


This is a test case. Rather, 25 test cases.
We scan through at("a") to at("e"), where at(x) is a representable diagram (presheaf, functor, whatever) for object x:
      val at = (obj: topos.site.Obj) => topos.representable(obj)


and then, in each row, apply this representable to objects "a",..., "e", and check that the result is a set (hom(x, y)) consisting of the values in the cells of the table. The values in the table are split by comma and converted to sets - because we deal with Grothendieck toposes.

But toposes are not essential here. I just decided to be lazy, and write code as tables, as Leo suggested eons ago, probably in 1989. It's not even my idea.

Implementation:
      val at = (obj: topos.site.Obj) => topos.representable(obj)
      
      case class table(data: List[String] = Nil) {
        def |(x: String): table = table(x::data)
        def |(d: Diagrams.Diagram) = check(d, data, data)
      }

      case class check(d: Diagram, data: List[String], fullList: List[String]) {
        def |(x: String): check = {
            d(data.head) === x.split(",").toSet
            check(d, data.tail, fullList)
        }
        def |(d: Diagram): check = check(d, fullList, fullList)
      }

      val applyTo = new table
juan_gandhi: (VP)
2014-10-18 06:32 pm
Entry tags:

funny stuff worth reading

http://dreamsongs.com/Files/worse-is-worse.pdf

Those were the days when I was debugging into the microcode of a stupid machine from Severodonetsk, which was losing interrupt stack trace from time to time, and so we were out of luck: I did lose some significant money on trying to fix this, but figure it was theoretically impossible.

Anyway, the source of inspiration is this: http://pchiusano.github.io/2014-10-13/worseisworse