home.social

Search

1000 results for “recursive”

  1. Recursively subdividing/tessellating a hexagon with Catmull-Clark (made with unreleased thi.ng/geom-mesh pkg, anim is from March 2017)...

    #TilingTuesday #Geometry #Subdivision #Mesh #ThingUmbrella

  2. Recursive Augmented Dickey-Fuller Test Use radf (exuber) With (In) R Software
    dik.si/_radf
    Calculate unit root tests for explosive behaviour Use radf With STATA 19
    ln.run/_radf
    #rstudio #rsoftware #softwarer #stata #stata19 #olahdatasemarang #programming

  3. Recursive inclusion is possible in C, and more surprisingly it even makes sense in some cases. In fact it provides an easy way to do code unrolling of small code snippets:

    #if !defined(DO_I) || (DO_I < DO_BOUND)# include "do-incr.c"DO_BODY# include __FILE__#endif#undef DO_I

    Here this uses two macros that have to be defined beforehand, DO_BOUND and DO_BODY, and one macro DO_I for a hexadecimal loop counter that is maintained by the include file "do-incr.c". If we hold the above recursive code in some file "doit.c" (plus some extras, see below) we can use this as simply as in

    #define DO_BODY [DO_I] = DO_I,#define DO_BOUND 0x17unsigned array[] = {# include "doit.c"};#undef DO_BODY#undef DO_BOUND

    do generate the intialization of an array,

    unsigned array[] = {[0x0000] = 0x0000,[0x0001] = 0x0001,...[0x0016] = 0x0016,[0x0017] = 0x0017,};

    or with an additional macro DO_NAME (DO_I without a hex prefix) as

    #define ENAME_(X) enum_ ## X#define ENAME(X) ENAME_(X)#define DO_BODY ENAME(DO_NAME) = DO_I,#define DO_BOUND 197enum {# include "doit.c"};#undef DO_BODY#undef DO_BOUND

    for the declaration of an enumeration type

    enum fun {enum_0000 = 0x0000,enum_0001 = 0x0001,...enum_00C4 = 0x00C4,enum_00C5 = 0x00C5,};

    Here the given limit of 197 is in fact a limit that is imposed by gcc for which I was testing this. They restrict the depth of inclusion to 200, unless you raise that limit with the command line option -fmax-include-depth.

    Note also, that the recursive line #include __FILE__ uses a macro to specify the file name because #include lines are indeed evaluated by the preprocessor if necessary.

    Recursion is only reasonable if we have a stop condition, so to handle this the include file "do-incr.c" is crucial. Since in standard C we have no way to evaluate the line of a #define while processing it, we have to ensure that we can change the value of DO_I. That file looks something like

    #ifndef DO_I# undef  DO_I0# define DO_I0 0# undef  DO_I1# define DO_I1 0# undef  DO_I2# define DO_I2 0# undef  DO_I3# define DO_I3 0# define DO_I DO_HEX(DO_NAME)#elif DO_HEX(DO_I0) == 0# undef DO_I0# define DO_I0 1#elif DO_HEX(DO_I0) == 1# undef DO_I0# define DO_I0 2...#elif DO_HEX(DO_I0) == 0xF# undef DO_I0# define DO_I0 0# include "do-incr1.c"#endif

    As you may have guessed, this uses macros DO_I0, DO_I1, DO_I2, and DO_I3 as hexdigits of a 16 bit number, and includes another file "do-incr1.c" if the digit DO_I0 overflows.

    I hope that if you are interested in this technique, you will be able to join the dots in the above code. To be complete, here are the macros that join the digits to make a hexnumber (DO_HEX) and to make a name component (DO_NAME):

    #ifndef DO_HEX# define DO_HEX_(X) 0x ## X# define DO_HEX(X) DO_HEX_(X)# define DO_NAME_(A, B, C, D) A ## B ## C ## D# define DO_NAME_IIII(A, B, C, D) DO_NAME_(D, C, B, A)# define DO_NAME DO_NAME_IIII(DO_I0, DO_I1, DO_I2, DO_I3)#endif

    https://gustedt.wordpress.com/2024/05/30/include-__file__/

    #define #elif #endif #undef

  4. Recursive polygon subdivision, part 2

    Here the seed polygon (40-gon) is recursively cut using sweeping perpendicular lines and the resulting number of polygons varies greatly depending on the position of these cuts (combined with a configured minimum poly target area). The area of each polygon is mapped to a color from a predefined gradient.

    Live demo (slowed down to better observe the algorithm):
    demo.thi.ng/umbrella/poly-subd

    Commented source code:
    github.com/thi-ng/umbrella/blo

    2/2

    #TextureTuesday #ThinSection #Geometry #Polygon #Subdivision #Recursion #AlgorithmicArt #ThingUmbrella #TypeScript

  5. Recursive polygon subdivision, part 2

    Here the seed polygon (40-gon) is recursively cut using sweeping perpendicular lines and the resulting number of polygons varies greatly depending on the position of these cuts (combined with a configured minimum poly target area). The area of each polygon is mapped to a color from a predefined gradient.

    Live demo (slowed down to better observe the algorithm):
    demo.thi.ng/umbrella/poly-subd

    Commented source code:
    github.com/thi-ng/umbrella/blo

    2/2

    #TextureTuesday #ThinSection #Geometry #Polygon #Subdivision #Recursion #AlgorithmicArt #ThingUmbrella #TypeScript

  6. Recursive polygon subdivision, part 2

    Here the seed polygon (40-gon) is recursively cut using sweeping perpendicular lines and the resulting number of polygons varies greatly depending on the position of these cuts (combined with a configured minimum poly target area). The area of each polygon is mapped to a color from a predefined gradient.

    Live demo (slowed down to better observe the algorithm):
    demo.thi.ng/umbrella/poly-subd

    Commented source code:
    github.com/thi-ng/umbrella/blo

    2/2

    #TextureTuesday #ThinSection #Geometry #Polygon #Subdivision #Recursion #AlgorithmicArt #ThingUmbrella #TypeScript

  7. Recursive polygon subdivision, part 2

    Here the seed polygon (40-gon) is recursively cut using sweeping perpendicular lines and the resulting number of polygons varies greatly depending on the position of these cuts (combined with a configured minimum poly target area). The area of each polygon is mapped to a color from a predefined gradient.

    Live demo (slowed down to better observe the algorithm):
    demo.thi.ng/umbrella/poly-subd

    Commented source code:
    github.com/thi-ng/umbrella/blo

    2/2

    #TextureTuesday #ThinSection #Geometry #Polygon #Subdivision #Recursion #AlgorithmicArt #ThingUmbrella #TypeScript

  8. Recursive polygon subdivision inspired by thin-section mineralogy...

    (The area of each polygon is mapped to a color from a gradient. Made with thi.ng/geom, see next message for example & source code...)

    1/2

    #TextureTuesday #ThinSection #Geometry #Polygon #Subdivision #AlgorithmicArt #ThingUmbrella #TypeScript

  9. Recursive polygon subdivision inspired by thin-section mineralogy...

    (The area of each polygon is mapped to a color from a gradient. Made with thi.ng/geom, see next message for example & source code...)

    1/2

    #TextureTuesday #ThinSection #Geometry #Polygon #Subdivision #AlgorithmicArt #ThingUmbrella #TypeScript

  10. Recursive polygon subdivision inspired by thin-section mineralogy...

    (The area of each polygon is mapped to a color from a gradient. Made with thi.ng/geom, see next message for example & source code...)

    1/2

    #TextureTuesday #ThinSection #Geometry #Polygon #Subdivision #AlgorithmicArt #ThingUmbrella #TypeScript

  11. Recursive polygon subdivision inspired by thin-section mineralogy...

    (The area of each polygon is mapped to a color from a gradient. Made with thi.ng/geom, see next message for example & source code...)

    1/2

    #TextureTuesday #ThinSection #Geometry #Polygon #Subdivision #AlgorithmicArt #ThingUmbrella #TypeScript

  12. 'Recursive Estimation of Conditional Kernel Mean Embeddings', by Ambrus Tamás, Balázs Csanád Csáji.

    jmlr.org/papers/v25/23-0168.ht

    #embeddings #supervised #estimation

  13. Recursive Augmented Dickey-Fuller Test Use radf (exuber) With (In) R Software
    dik.si/_radf
    Calculate unit root tests for explosive behaviour Use radf With STATA 19
    ln.run/_radf
    #rstudio #rsoftware #softwarer #stata #stata19 #olahdatasemarang #programming

  14. Recursive Augmented Dickey-Fuller Test Use radf (exuber) With (In) R Software
    dik.si/_radf
    Calculate unit root tests for explosive behaviour Use radf With STATA 19
    ln.run/_radf
    #rstudio #rsoftware #softwarer #stata #stata19 #olahdatasemarang #programming

  15. Recursive Augmented Dickey-Fuller Test Use radf (exuber) With (In) R Software
    dik.si/_radf
    Calculate unit root tests for explosive behaviour Use radf With STATA 19
    ln.run/_radf
    #rstudio #rsoftware #softwarer #stata #stata19 #olahdatasemarang #programming

  16. Recursive Augmented Dickey-Fuller Test Use radf (exuber) With (In) R Software
    dik.si/_radf
    Calculate unit root tests for explosive behaviour Use radf With STATA 19
    ln.run/_radf
    #rstudio #rsoftware #softwarer #stata #stata19 #olahdatasemarang #programming

  17. A friend and colleague recently shared their alarm over "AI" being able to change its own programming. I explained that self-modifying code, that is code that changes itself while it is running, has been a thing for decades. They thought I wasn't alarmed therefore, but oh, I am. Just because something, or at least aspects of something, are well understood does not make them less alarming. In this case, my understanding makes it more alarming!

    #recursive #power #LLM #LLMs

  18. @RecursiveNeuron Well, I'm using and but this is effectively the same as printf: writing information to the console (on the test environment only). Makes the console tell a story, so you can see where, when, and how your specific logic came off the rails. Using the IDE debugger feels more like taking a magnifying glass to a single grain of sand, but having no idea how it fits into the rest of the beach.

  19. @RecursiveElegance
    We did wonder that ourselves when we looked at it.

    Indeed a lot can change in 5 years in this field of censorship and surveillance. We hope people continue to help the I2P network, we would like to see it replace the #legacyInternet — as far-fetched as that might sound.

  20. @GossiTheDog this toot about a chefs kiss perfection is the chefs kiss of perfection of a Meta-level story about meta-level stuff going on with Meta

  21. @GossiTheDog this toot about a chefs kiss perfection is the chefs kiss of perfection of a Meta-level story about meta-level stuff going on with Meta

    #recursive #lifeisrecursive #fractalreality #fractalrecursion

    #Meta #SoMeta #Perfect