home.social

Search

1000 results for “recursive”

  1. Writing my first bottom up parser. I want my xml lexer to give the doctype as one token but to do that I need to parse the internal subset -> markup decl -> element decl -> content spec -> children which has

    [47] children ::= (choice | seq) ('?' | '*' | '+')?
    [48] cp ::= (Name | choice | seq) ('?' | '*' | '+')?
    [49] choice ::= '(' S? cp ( S? '|' S? cp )+ S? ')'
    [50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'

    As its grammer. Notice the recursion. I would normally use a recursive decent parser but since I'm using Rust's coroutines I can't have recursive coroutines(as far as I am aware).

    I'm using coroutines because this is a streaming parser meant for embedded systems with very little memory. At any point I could run out of input which is when I yield back up to get more. My previous iteration of this was a massive state machine essentially implementing coroutines from scratch.

    #rust #embedded #coroutines #xml

  2. Writing my first bottom up parser. I want my xml lexer to give the doctype as one token but to do that I need to parse the internal subset -> markup decl -> element decl -> content spec -> children which has

    [47] children ::= (choice | seq) ('?' | '*' | '+')?
    [48] cp ::= (Name | choice | seq) ('?' | '*' | '+')?
    [49] choice ::= '(' S? cp ( S? '|' S? cp )+ S? ')'
    [50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'

    As its grammer. Notice the recursion. I would normally use a recursive decent parser but since I'm using Rust's coroutines I can't have recursive coroutines(as far as I am aware).

    I'm using coroutines because this is a streaming parser meant for embedded systems with very little memory. At any point I could run out of input which is when I yield back up to get more. My previous iteration of this was a massive state machine essentially implementing coroutines from scratch.

    #rust #embedded #coroutines #xml

  3. Writing my first bottom up parser. I want my xml lexer to give the doctype as one token but to do that I need to parse the internal subset -> markup decl -> element decl -> content spec -> children which has

    [47] children ::= (choice | seq) ('?' | '*' | '+')?
    [48] cp ::= (Name | choice | seq) ('?' | '*' | '+')?
    [49] choice ::= '(' S? cp ( S? '|' S? cp )+ S? ')'
    [50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'

    As its grammer. Notice the recursion. I would normally use a recursive decent parser but since I'm using Rust's coroutines I can't have recursive coroutines(as far as I am aware).

    I'm using coroutines because this is a streaming parser meant for embedded systems with very little memory. At any point I could run out of input which is when I yield back up to get more. My previous iteration of this was a massive state machine essentially implementing coroutines from scratch.

    #rust #embedded #coroutines #xml

  4. Writing my first bottom up parser. I want my xml lexer to give the doctype as one token but to do that I need to parse the internal subset -> markup decl -> element decl -> content spec -> children which has

    [47] children ::= (choice | seq) ('?' | '*' | '+')?
    [48] cp ::= (Name | choice | seq) ('?' | '*' | '+')?
    [49] choice ::= '(' S? cp ( S? '|' S? cp )+ S? ')'
    [50] seq ::= '(' S? cp ( S? ',' S? cp )* S? ')'

    As its grammer. Notice the recursion. I would normally use a recursive decent parser but since I'm using Rust's coroutines I can't have recursive coroutines(as far as I am aware).

    I'm using coroutines because this is a streaming parser meant for embedded systems with very little memory. At any point I could run out of input which is when I yield back up to get more. My previous iteration of this was a massive state machine essentially implementing coroutines from scratch.

    #rust #embedded #coroutines #xml

  5. #introduction

    I am a #StructuralEngineer (California PE) turned #SoftwareDeveloper living in Brooklyn, NY.

    I love #bikes, #biketouring, #xbiking, #bikepacking, etc.

    I have spent the last three years learning #handtool #woodworking in order to build #chairs

    I also #sew my own #clothes.

  6. Heed:
    The best way to stay on top of the resistance is to join/lead the resistance.

    #anthropic #openai #metaai #bigai #superpac

  7. As someone who tried to make a new language and gave up after a month or two, three years... ​:blobcat_salute:​ I really enjoyed this RC #localhost talk that Ryan gave on the programming language she has been working on Felt.

    She covers topics about what goes into building new languages and her case for a trying to make a smaller
    #rustlang, and shows some of the basic aspects of Felt. Love it! ​:blobcat_amused:​
    https://www.youtube.com/watch?v=dVHZFtJatxw
    #recursecenter #programminglanguages

  8. Is it just me or is Monkey C (Garmin) like the most hideous language ever?

    The good:

    • “The Monkey C editor will automatically convert spaces to tabs”
    • Has enums
    • Char is “Unicode characters”
    • Compiler does have type checking & optimization even if

    The bad:

    • Java-like syntax (eww)
    • Semicolons required (with all code examples showing a newline & indentation, why bother?)
    • Explict return required (vs. implicitly always returning the last statement’s value—as it should be)
    • Duck typing—where type errors are just runtime errors
    • Crazy since later on docs talk about how to get gradual typing errors from the compiler so why are we making notes of this?
    • Gonna guess only supports ASCII for variable names
    • No first-class / higher-order functions
    • No mention of recursion (so probably no TCO)
    • Must invent “callbacks” & create new “methods” (if you recognize no first-class function as an issue that you mention it multiple times, there’s a chance you aren’t meeting your goal of “the language you didn’t know you already knew”, but also your design is flawed)
    • Acting like public/private/inheritance is a *good* feature
    • Scoping is confusing since they bought into OO nonsense
    • Using arrays as tuples instead of, ya know, having Tuples
    • `Any` type
    • `Null`
    • Exceptions instead of Errors as values via ADTs
    • Terribly unfunny jokes in the footnotes

    I’m going to assume this was originally made in the early ’00s by some disciple of ‘Uncle Bob’. This does not spark joy to look at. I am assuming they needed a language to compile to something fast/efficient enough to run on a watch, but not like this. Chasing some vague notion of ‘familiarity’ over goodness is not something I subscribe to. #monkeyc

  9. Большая иерархия в SQL запросе + PostgreSQL

    Сначала запрос адаптирован для работы в PostgreSQL 15.6. Затем работа запроса проверена на достаточно объемной иерархии - в качестве источника данных использована структура архива jdk-master.zip из OpenJDK 22

    habr.com/ru/articles/811523/

    #MySQL #SQL #common_table_expression #cte #with_recursive #Иерархические_структуры_в_SQL #Обобщенные_табличные_выражения #sqlite #sqlite3 #postgresql

  10. Отображение части иерархии в SQL запросе

    Продолжение статьи, в которой предложено решение задачи визуализации иерархической структуры средствами SQL запросов, на примере MySQL и SQLite В этой части производится доработка запросов для отображения части иерархии, начиная с конкретных узлов, и анализируются возможные связанные ошибки

    habr.com/ru/articles/810855/

    #MySQL #SQL #Common_Table_Expression #CTE #with_recursive #Иерархические_структуры_в_SQL #Обобщенные_табличные_выражения #sqlite #sqlite3

  11. Отображение иерархии в SQL запросе

    В процессе тестирования одного курса по SQL на stepik.org встретилась задача, из которой сочинилась другая, более интересная: Необходимо с помощью одного SQL запроса с использованием обобщенных табличных выражений отобразить иерархию, в соответствии с иллюстрацией выше

    habr.com/ru/articles/810687/

    #MySQL #SQL #Common_Table_Expression #CTE #with_recursive #window_functions #Оконные_функции #Иерархические_структуры_в_SQL #Обобщенные_табличные_выражения #sqlite

  12. В #VisualWorks #Smalltalk интересно сделали защиту от бесконечного зацикливания в инспекторе объектов. Перед вызовом метода printString ставят таймаут на 2 секунды. И если за 2 секунды метод не отработался, значит что-то там пошло не так. И выводиться тогда диагностическое сообщение вместо текстового представления объекта. Что-нибудь TimeoutExceeded или RecursionDetected.

  13. В #VisualWorks #Smalltalk интересно сделали защиту от бесконечного зацикливания в инспекторе объектов. Перед вызовом метода printString ставят таймаут на 2 секунды. И если за 2 секунды метод не отработался, значит что-то там пошло не так. И выводиться тогда диагностическое сообщение вместо текстового представления объекта. Что-нибудь TimeoutExceeded или RecursionDetected.

  14. В #VisualWorks #Smalltalk интересно сделали защиту от бесконечного зацикливания в инспекторе объектов. Перед вызовом метода printString ставят таймаут на 2 секунды. И если за 2 секунды метод не отработался, значит что-то там пошло не так. И выводиться тогда диагностическое сообщение вместо текстового представления объекта. Что-нибудь TimeoutExceeded или RecursionDetected.

  15. Indie Showcase For 4/2/24
    youtube.com/embed/TlmnfirEYAY

    The indie showcases highlight the many indie games we play here on the channel. All games shown are either press key submissions or demos.

    0:00 Intro00:14 Tater Spud1:50 Zor: Pilgrimage of the Slorfs5:09 Recursi
    setsideb.com/indie-showcase-fo
    #indiedevshowcase #indies #BackpackHero #elementallis #incision #indie #IndieGames #indiegameshowcase #RecursiveRuin #TaterSpud #zor #ZorAscensionOfTheSlorps

  16. ✨ Publico nuevo libro ✨
    «Desafíos de programación atemporales y multiparadigmáticos».

    He condensado mi experiencia de más de 10 años como formador en un libro que te ayudará a desarrollarte como desarrollador o a limar tu perfil profesional. En caso de ser reclutador, te ayudará a preparar a tus candidatos para las pruebas técnicas.

    📚 ¿Qué encontrarás?

    Dragones, ejercicios divididos en 2 niveles de dificultad, casos reales de pruebas técnicas y conceptos fundamentales de programación:

    ✅ Algoritmos (búsqueda, ordenamiento, compresión...)
    ✅ Árboles binarios
    ✅ Datos estructurados (JSON, XML, CSV)
    ✅ Matrices
    ✅ Programación funcional (recursividad, memoization...)
    ✅ Multihilos y gestión de memoria
    ✅ Filtrado y procesamiento de datos

    Y lo mejor... todo el contenido es atemporal y agnóstico al lenguaje. ¡Puedes practicar en Python, JavaScript, Rust, Java o el que prefieras!

    Afila tu espada y prepárate para enfrentarte a los monstruos que se esconden entre las sombras de las páginas.

    🛍️ ¿Donde lo puedo comprar?: https://www.amazon.es/dp/B0FK3PK2TM

    ℹ Más información: https://andros.dev/libros/3/desafios-de-programacion-atemporales-y-multiparadigmaticos/

    #programacion #codingchallenges #desarrollodesoftware #python #algoritmos #techskills #programminglife #javascript #anuncio

  17. divergent boundaries sketch for today's creative coding group at the RC.

    I started with the thought of an ocean floor splitting - a divergent boundary.

    codepen.io/fractalkitty/full/Q

    #recurseCenter #p5js #d3js #voronoi

  18. "(although we're now solidly in HOW THE HELL DOES THIS PLANET/SOCIETY ACTUALLY WORK? territory)."

    Hm...for the place to have Not Already Burned Down Long Ago, there'd have to be *some* genetic factor limiting it.

    And once you have enough history with instances of the Wrong Couple getting together, there'd be this damn huge incentive to keep track of who has Gene A, who has Gene B -- probably want both A and B to be recessive so that the % of the population where this is a Problem stays small --

    and then Really Strict Rules re A+B pairings.

    .... At the very least, if you want Forbidden Love stories with randy teenagers on the run blowing shit up, this is a way to get there....

    ((....why am I still awake?...))

    #Monsterdon #Krull

  19. #Parkbiebupdate #11
    Droste, ik hou ervan. Niet de chocola, maar het recursieve effect in beelden. Iemand deed mij het enorme plezier om in onze minibieb een microbieb te plaatsen.

    Deze foto's zijn overigens van twee weken geleden. Intussen lijkt de doorstroom wat te stagneren, mogelijk vanwege de vakantieperiode. Ik ga vandaag weer bijvullen, was er gisteren niet van gekomen.

    #Minibiebmaandag #Minibieb #LittleFreeLibrary #Parkbieb #DrosteEffect

  20. Quick #PureScript question. If I have a data structure that's basically a cons list, and I want to turn it into an Array, is the best way to do that recursive function with calls to `cons` or some better unfold?

    (Sometimes I even forget that [:] is arrays in PS, since I write plenty of Haskell and Idrisi, too.)

  21. I found the problem!

    The default number of times QuickCheck will shrink a test case is "maxBound :: Int" or 9223372036854775807 shrinks.

    One of my shrink functions was returning the same input and telling #QuickCheck the new value was smaller.

    #haskell

    When an exception was thrown in the test case, QuickCheck would try to find a smaller failing value, and I was never patient enough to wait for 9223372036854775807 shrinks.

  22. Did someone manage to run the official knot-resolver container in production? I've been trying it out, but it keeps dropping me into an interactive console and I've got no idea what to pass to make it work as a regular recursive resolver.

    #homelab #dns #knot #KnotResolver #podman

  23. 🜄 AI Governance is not a UX problem. It's a structural one. 🜄

    Too many alignment efforts try to teach machines to feel — when we should teach them to carry responsibility.

    📄 Just published:

    Ethics Beyond Emotion – Strategic Convergence, Emergent Care, and the Narrow Window for AI Integrity

    🔗 doi.org/10.5281/zenodo.15372153

    🜄

    #AIAlignment #AIEthics #TrustworthyAI #XInfinity #ResponsibleAI #Postmoral #Governance #RecursiveResponsibility #EthicsBeyondEmotion #SystemDesign #CapSystem

  24. Interesting and surprising corner-case discovered by @phils when debugging an issue with IPv6-only DNS recursive resolvers:

    mailarchive.ietf.org/arch/msg/

    In-particular, it is important to have both A and AAAA records on all of the nameserver names (ie, that NS records point to). Just having two of each isn't enough -- the number of names without AAAA records is also a consideration.

    Unbound's defenses for CVE-2020-12662 can otherwise kick in and result in SERVFAILs in some corner-cases.

    #IPv6 #IPv6only #DNS

  25. There is a Scheme testing framework by Arthur A. Gleckler, which was developed before SRFI-64, but published only in 2020s.

    srfi-email.schemers.org/srfi-d

    1. It's very close to suitbl testing library and SRFI-269 in spirit.
    2. It has a very neat property of saving resumable continuations on failure, so you can explore the problem in recursive REPL having all the local scope available.