GNU social JP
  • FAQ
  • Login
GNU social JPは日本のGNU socialサーバーです。
Usage/ToS/admin/test/Pleroma FE
  • Public

    • Public
    • Network
    • Groups
    • Featured
    • Popular
    • People

Conversation

Notices

  1. Embed this notice
    nyanide :nyancat_rainbow::nyancat_body::nyancat_face: (nyanide@lab.nyanide.com)'s status on Monday, 12-May-2025 12:22:39 JST nyanide :nyancat_rainbow::nyancat_body::nyancat_face: nyanide :nyancat_rainbow::nyancat_body::nyancat_face:
    I don't think I ever learned how to properly walk a linked list.
    In conversation about 21 days ago from lab.nyanide.com permalink
    • Embed this notice
      nyanide :nyancat_rainbow::nyancat_body::nyancat_face: (nyanide@lab.nyanide.com)'s status on Monday, 12-May-2025 12:26:36 JST nyanide :nyancat_rainbow::nyancat_body::nyancat_face: nyanide :nyancat_rainbow::nyancat_body::nyancat_face:
      in reply to
      Alright genuine plea of help, because I am retarded:

      What's your way of destroying a linked list? Let's say it looks something like this:

      struct list {
      struct *list next;
      char *junk; // allocated on heap
      }

      I don't know why I'm having a panic attack over this, I'm trying to do this in a way that doesn't mean I have repeat code I've already written inside a function designed to destroy the list.
      In conversation about 21 days ago permalink
    • Embed this notice
      T man :sex: :puffgiga: :puffpowerroll: (theorytoe@ak.kyaruc.moe)'s status on Monday, 12-May-2025 12:27:37 JST T man :sex: :puffgiga: :puffpowerroll: T man :sex: :puffgiga: :puffpowerroll:
      in reply to
      @nyanide
      completelynukeanddestroywithbricksandhammers(list);
      In conversation about 21 days ago permalink
    • Embed this notice
      nyanide :nyancat_rainbow::nyancat_body::nyancat_face: (nyanide@lab.nyanide.com)'s status on Monday, 12-May-2025 12:29:34 JST nyanide :nyancat_rainbow::nyancat_body::nyancat_face: nyanide :nyancat_rainbow::nyancat_body::nyancat_face:
      in reply to
      I could just constantly get the end of the list and free that element. It doesn't sound all that efficient but I'm like, trying to go ahead and free the elements as I walk the list. I don't know if that's how people do it.
      In conversation about 21 days ago permalink
    • Embed this notice
      T man :sex: :puffgiga: :puffpowerroll: (theorytoe@ak.kyaruc.moe)'s status on Monday, 12-May-2025 12:34:00 JST T man :sex: :puffgiga: :puffpowerroll: T man :sex: :puffgiga: :puffpowerroll:
      in reply to
      • T man :sex: :puffgiga: :puffpowerroll:
      @nyanide but real talk
      maybe just have a temp pointer to the next item in the list, set it to the next in current, free current, then set current to next

      rinse and repeat?
      In conversation about 21 days ago permalink
      nyanide :nyancat_rainbow::nyancat_body::nyancat_face: likes this.
    • Embed this notice
      Ariel Mirage (mirari@fedi.absturztau.be)'s status on Monday, 12-May-2025 12:34:03 JST Ariel Mirage Ariel Mirage
      in reply to

      @nyanide that’s how i always see it done. Easier if you don’t use a linked list, they are not very efficient, but there are some cases where they can be worth it.

      In conversation about 21 days ago permalink
      nyanide :nyancat_rainbow::nyancat_body::nyancat_face: likes this.
    • Embed this notice
      pwm (pwm@darkdork.dev)'s status on Monday, 12-May-2025 12:35:13 JST pwm pwm
      in reply to
      @nyanide next = current.next
      In conversation about 21 days ago permalink
      nyanide :nyancat_rainbow::nyancat_body::nyancat_face: likes this.
    • Embed this notice
      nyanide :nyancat_rainbow::nyancat_body::nyancat_face: (nyanide@lab.nyanide.com)'s status on Monday, 12-May-2025 12:35:59 JST nyanide :nyancat_rainbow::nyancat_body::nyancat_face: nyanide :nyancat_rainbow::nyancat_body::nyancat_face:
      in reply to
      • binkle
      @binkle List is terminated with NULL
      In conversation about 21 days ago permalink
      pwm repeated this.
    • Embed this notice
      binkle (binkle@clubcyberia.co)'s status on Monday, 12-May-2025 12:36:00 JST binkle binkle
      in reply to
      @nyanide do you have to worry about cycles or are you guaranteed a cycle-free list
      In conversation about 21 days ago permalink
      nyanide :nyancat_rainbow::nyancat_body::nyancat_face: likes this.
    • Embed this notice
      nyanide :nyancat_rainbow::nyancat_body::nyancat_face: (nyanide@lab.nyanide.com)'s status on Monday, 12-May-2025 12:38:13 JST nyanide :nyancat_rainbow::nyancat_body::nyancat_face: nyanide :nyancat_rainbow::nyancat_body::nyancat_face:
      in reply to
      • T man :sex: :puffgiga: :puffpowerroll:
      @theorytoe That makes sense, my frame of mind is totally fucked up right now, no idea how that didn't come up.
      In conversation about 21 days ago permalink
    • Embed this notice
      nyanide :nyancat_rainbow::nyancat_body::nyancat_face: (nyanide@lab.nyanide.com)'s status on Monday, 12-May-2025 12:39:29 JST nyanide :nyancat_rainbow::nyancat_body::nyancat_face: nyanide :nyancat_rainbow::nyancat_body::nyancat_face:
      in reply to
      • pwm
      @pwm Just crashing out because I was thinking up a fucked up way to destroy a list
      In conversation about 21 days ago permalink
    • Embed this notice
      pwm (pwm@darkdork.dev)'s status on Monday, 12-May-2025 12:40:09 JST pwm pwm
      in reply to
      @nyanide oh yeah just walk head to tail and destroy the prev item starting at the second. quit when .next is NULL
      In conversation about 21 days ago permalink
      nyanide :nyancat_rainbow::nyancat_body::nyancat_face: likes this.
    • Embed this notice
      pwm (pwm@darkdork.dev)'s status on Monday, 12-May-2025 12:41:16 JST pwm pwm
      in reply to
      • pwm
      @nyanide if you store metadata like number of items in the list, use that for bounds checking e.g.
      In conversation about 21 days ago permalink
      nyanide :nyancat_rainbow::nyancat_body::nyancat_face: likes this.
    • Embed this notice
      nyanide :nyancat_rainbow::nyancat_body::nyancat_face: (nyanide@lab.nyanide.com)'s status on Monday, 12-May-2025 12:46:23 JST nyanide :nyancat_rainbow::nyancat_body::nyancat_face: nyanide :nyancat_rainbow::nyancat_body::nyancat_face:
      in reply to
      • Lyx
      • pwm
      @Lyx @pwm nope
      In conversation about 21 days ago permalink
    • Embed this notice
      Lyx (lyx@cum.salon)'s status on Monday, 12-May-2025 12:46:24 JST Lyx Lyx
      in reply to
      • pwm
      @nyanide @pwm i have a serious question for u, do u know anything about six sigma or lean¿
      In conversation about 21 days ago permalink
    • Embed this notice
      Lyx (lyx@cum.salon)'s status on Monday, 12-May-2025 13:02:24 JST Lyx Lyx
      in reply to
      • þernia
      • pwm
      @nyanide @pwm you seem to worry alot about heavy coding concepts and the such includong in your business life. Im retty good at these things becauseof my manufacturing experience. Ushouldlook into it its a way of.reinventing the same process but more efficiwntly. U should listen to this in the background if u dont have time to watch it
      https://m.youtube.com/watch?v=GmEARqTY8TY&pp=ygUJc2l4IHNpZ21h
      U can do inSANE shit with it ask @boyperpia he legit knows
      In conversation about 21 days ago permalink

      Attachments

      1. What is Six Sigma? ...and DMAIC
        from Online PM Courses - Mike Clayton
        Learn all the basics of Project Management, in a structured program: https://geni.us/PM_CoreCoursesMotorola introduced the idea of Six Sigma to reduce defect...
      nyanide :nyancat_rainbow::nyancat_body::nyancat_face: likes this.
    • Embed this notice
      binkle (binkle@clubcyberia.co)'s status on Monday, 12-May-2025 13:10:57 JST binkle binkle
      in reply to
      @nyanide oh easy then. You can either walk the list iteratively and keep a temp pointer so that you keep track of the next available node, or you can do it recursively and depth-first destroy. The iterative version is more space efficient but the recursive version gets your dick really hard so its basically neck and neck
      In conversation about 21 days ago permalink
      nyanide :nyancat_rainbow::nyancat_body::nyancat_face: and pwm like this.
    • Embed this notice
      binkle (binkle@clubcyberia.co)'s status on Monday, 12-May-2025 13:11:59 JST binkle binkle
      in reply to
      @nyanide oh easy then. You can either walk the list iteratively and keep a temp pointer so that you keep track of the next available node, or you can do it recursively and depth-first destroy. The iterative version is more space efficient but the recursive version gets your dick really hard so its basically neck and neck (unless tail call recursion is implemented (it is (in which case they are equivalent)))
      In conversation about 21 days ago permalink
      nyanide :nyancat_rainbow::nyancat_body::nyancat_face: and pwm like this.

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • TOS
  • Privacy
  • Source
  • Version
  • Contact

GNU social JP is a social network, courtesy of GNU social JP管理人. It runs on GNU social, version 2.0.2-dev, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All GNU social JP content and data are available under the Creative Commons Attribution 3.0 license.