Ategon

joined 1 year ago
MODERATOR OF
[–] [email protected] 3 points 10 months ago (2 children)

The issue with that and reason why AoC doesnt use that for the leaderboard is they dont have access to the code people write, just the final result

Adding that as an option would mean having something that takes into account differences in base runtimes of code for different languages (e.g. scripting languages taking longer) so that its feasible to code it in anything, and having the ability to execute many different kinds of code which can be a pain to set up (and would mean youre then running arbitrary code unless you sandbox it)

I used that as the way to rank people in [email protected] when I was running that and its been on hiatus for awhile due to the effort needed to run it since I havent had time due to building up things in the instance such as [email protected]

It could work if self reported but then its easy to cheat

[–] [email protected] 2 points 10 months ago* (last edited 10 months ago) (1 children)

Small warning, the change to change how lemmy as a whole calculates active users just got pushed so instances may mess up the stats as they upgrade to 0.19 when thats stable (and instances using it rn when they upgrade to a more recent release client) (Makes how programming.dev and lemmynsfw calculate community stats the default)

[–] [email protected] 2 points 10 months ago

It doesn't, still spams low upvote posts, just slightly tweaked ordering

[–] [email protected] 2 points 10 months ago* (last edited 10 months ago) (1 children)

btw if you put the url to nim as /c/[email protected] I dont think the url bot will trigger since it does the same thing the ! format does

[Nim](/c/[email protected])

Nim

Edit: yeah looks like it didnt reply to me so this format works

[–] [email protected] 13 points 10 months ago (1 children)

Looks like a camelCase variable to me so its likely just a temporary word they replace with the actual bot name but something went wrong and it didn't replace it properly leading to the temporary text showing instead

There could be some other reasons but the actual cause cant really be determined without looking at the source code

[–] [email protected] 8 points 10 months ago (1 children)

Congrats on the alpha 🎉

[–] [email protected] 18 points 10 months ago (2 children)

Advent of code is an coding advent calendar where a new puzzle is released every day for people to solve

The numbers there (apart from the timer) in the site that was linked can be clicked to bring you to specific puzzles (1 aka Day 1 for the puzzle on the 1st of december, 2 aka Day 2 for the 2nd of december, etc.)

[–] [email protected] 2 points 10 months ago (1 children)

Weve got a go community in the site that you might get some answers from rather than the general community here [email protected]

[–] [email protected] 2 points 10 months ago* (last edited 10 months ago) (1 children)

This is more a community for the development side being activitypub instead of fediverse

Theres communities like [email protected] though

I haven't touched friendica much so dont know the answer to that

[–] [email protected] 1 points 10 months ago* (last edited 10 months ago)

JavaScript

Ended up misreading the instructions due to trying to go fast. Built up a system to compare hand values like its poker before I realized its not poker

Likely last day im going to be able to write code for due to exams coming up

Code Link

Code Block

// Part 1
// ======

function part1(input) {
  const lines = input.replaceAll("\r", "").split("\n");
  const hands = lines.map((line) => line.split(" "));

  const sortedHands = hands.sort((a, b) => {
    const handA = calculateHandValue(a[0]);
    const handB = calculateHandValue(b[0]);

    if (handA > handB) {
      return -1;
    } else if (handA < handB) {
      return 1;
    } else {
      for (let i = 0; i < 5; i++) {
        const handACard = convertToNumber(a[0].split("")[i]);
        const handBCard = convertToNumber(b[0].split("")[i]);
        if (handACard > handBCard) {
          return 1;
        } else if (handACard < handBCard) {
          return -1;
        }
      }
    }
  });

  return sortedHands
    .filter((hand) => hand[0] != "")
    .reduce((acc, hand, i) => {
      return acc + hand[1] * (i + 1);
    }, 0);
}

function convertToNumber(card) {
  switch (card) {
    case "A":
      return 14;
    case "K":
      return 13;
    case "Q":
      return 12;
    case "J":
      return 11;
    case "T":
      return 10;
    default:
      return parseInt(card);
  }
}

function calculateHandValue(hand) {
  const dict = {};

  hand.split("").forEach((card) => {
    if (dict[card]) {
      dict[card] += 1;
    } else {
      dict[card] = 1;
    }
  });

  // 5
  if (Object.keys(dict).length === 1) {
    return 1;
  }

  // 4
  if (Object.keys(dict).filter((key) => dict[key] === 4).length === 1) {
    return 2;
  }

  // 3 + 2
  if (
    Object.keys(dict).filter((key) => dict[key] === 3).length === 1 &&
    Object.keys(dict).filter((key) => dict[key] === 2).length === 1
  ) {
    return 3;
  }

  // 3
  if (Object.keys(dict).filter((key) => dict[key] === 3).length === 1) {
    return 4;
  }

  // 2 + 2
  if (Object.keys(dict).filter((key) => dict[key] === 2).length === 2) {
    return 5;
  }

  // 2
  if (Object.keys(dict).filter((key) => dict[key] === 2).length === 1) {
    return 6;
  }

  return 7;
}

// Part 2
// ======

function part2(input) {
  const lines = input.replaceAll("\r", "").split("\n");
  const hands = lines.map((line) => line.split(" "));

  const sortedHands = hands.sort((a, b) => {
    const handA = calculateHandValuePart2(a[0]);
    const handB = calculateHandValuePart2(b[0]);

    if (handA > handB) {
      return -1;
    } else if (handA < handB) {
      return 1;
    } else {
      for (let i = 0; i < 5; i++) {
        const handACard = convertToNumberPart2(a[0].split("")[i]);
        const handBCard = convertToNumberPart2(b[0].split("")[i]);
        if (handACard > handBCard) {
          return 1;
        } else if (handACard < handBCard) {
          return -1;
        }
      }
    }
  });

  return sortedHands
    .filter((hand) => hand[0] != "")
    .reduce((acc, hand, i) => {
      console.log(acc, hand, i + 1);
      return acc + hand[1] * (i + 1);
    }, 0);
}

function convertToNumberPart2(card) {
  switch (card) {
    case "A":
      return 14;
    case "K":
      return 13;
    case "Q":
      return 12;
    case "J":
      return 1;
    case "T":
      return 10;
    default:
      return parseInt(card);
  }
}

function calculateHandValuePart2(hand) {
  const dict = {};

  let jokers = 0;

  hand.split("").forEach((card) => {
    if (card === "J") {
      jokers += 1;
      return;
    }
    if (dict[card]) {
      dict[card] += 1;
    } else {
      dict[card] = 1;
    }
  });

  // 5
  if (jokers === 5 || Object.keys(dict).length === 1) {
    return 1;
  }

  // 4
  if (
    jokers === 4 ||
    (jokers === 3 &&
      Object.keys(dict).filter((key) => dict[key] === 1).length >= 1) ||
    (jokers === 2 &&
      Object.keys(dict).filter((key) => dict[key] === 2).length === 1) ||
    (jokers === 1 &&
      Object.keys(dict).filter((key) => dict[key] === 3).length === 1) ||
    Object.keys(dict).filter((key) => dict[key] === 4).length === 1
  ) {
    return 2;
  }

  // 3 + 2
  if (
    (Object.keys(dict).filter((key) => dict[key] === 3).length === 1 &&
      Object.keys(dict).filter((key) => dict[key] === 2).length === 1) ||
    (Object.keys(dict).filter((key) => dict[key] === 2).length === 2 &&
      jokers === 1)
  ) {
    return 3;
  }

  // 3
  if (
    Object.keys(dict).filter((key) => dict[key] === 3).length === 1 ||
    (Object.keys(dict).filter((key) => dict[key] === 2).length === 1 &&
      jokers === 1) ||
    (Object.keys(dict).filter((key) => dict[key] === 1).length >= 1 &&
      jokers === 2) ||
    jokers === 3
  ) {
    return 4;
  }

  // 2 + 2
  if (
    Object.keys(dict).filter((key) => dict[key] === 2).length === 2 ||
    (Object.keys(dict).filter((key) => dict[key] === 2).length === 1 &&
      jokers === 1)
  ) {
    return 5;
  }

  // 2
  if (
    Object.keys(dict).filter((key) => dict[key] === 2).length === 1 ||
    jokers
  ) {
    return 6;
  }

  return 7;
}

export default { part1, part2 };

[–] [email protected] 2 points 10 months ago* (last edited 10 months ago)

top left of the site in the navbar, and for sites who collect all of the different instances such as join-lemmy and lemmyverse. Also shows up in things like error pages in the new frontend

Smaller in the navbar but in the cases of join-lemmy and the things like error pages its larger (you can see the size by going to https://join-lemmy.org/instances?topic=all_topics&language=all&scroll=true)

[–] [email protected] 2 points 10 months ago

Uses typescript but can be used for both js and ts, I make bots in Javascript using it

 

Crown Gambit, The Isolated Town, Time Handlers, The Last Root, The Mirror, Rixas, Fair and Square, Out For Delivery, Dreaming Diorama, Planetary Life

 

Hey everyone. The instance has recently updated to 0.18.1 which changed the default shape of icons for users and communities. As circles won the poll before when I polled for what shape people want things to be ill be working on reverting those back to circles as soon as possible. Ill aim to eventually have a setting you can set in your user settings to swap to whatever you want (square, circle, hexagon, etc.)

Will take a bit as im in the middle of the gmtk game jam but just wanted to get a post out just for transparency on why they changed

27
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

Hey everyone, the content vote ended and here are the results of what people voted for

Reminder that voting was single transferable vote. If two options were tied the one with a worse average placement in all votes was eliminated

(if someone didnt give a second choice then no other options get their vote)

Crosspost community was eliminated first with no first place votes, then main community (second place votes represented in dark blue), then general community (second place votes represented in light blue)

The overall most voted option was Option 2: People catching community. This means that for the community all content relating to the instance is allowed but people will be directed towards more specific communities relevant to their post in the replies. This should then let people be able to post here with no friction and then get filtered down into the proper communities to help make them more active

As there was significantly less votes than the amount of subscribers in the community I will be running a follow up poll in a week to see if people like how the community is being run or if we need to do another poll to change the instance content again.

Linker Bot

Ive been making a bot for the instance called Linker that posts links to communities in the replies when someone posts a non relative instance link. That feature got implemented into lemmy itself in v18 (it will give autocomplete options when you start typing !insertcommunitynamehere on web) so ill be adapting the bot to fit this community to help with the people catching. The bot api is a bit broken right now so it unfortunately wont be able to work for a bit but until then it would be a huge help if you guys do links to mentioned communities in the comments (it only has to be done once so it doesnt spam the replies)

The format im using for bot messages is something similar to

Hey! Here are some possibly relevant communities in the instance based on what was mentioned

- Link to community 1
- etc for any other communities

I am a bot and this message was created automatically

Feel free to adapt that or make your own

Community Request

Just wanted to do a quick advertisement for the community request community here in the instance at [email protected] . The community is always open to suggest communities to be added to the instance and make sure to upvote ideas there you want added to show the interest in them. Since the discussion community option didnt win if you feel the discussion posts are getting buried by the other content you can suggest a new community for that (or for whatever topic the discussion is about if its general enough)

Mods

If anyone is interested in helping mod the community feel free to reach out to me. Ideally want at least one other person to moderate this community so I can stop moderating and focus on some more admin tasks around the instance including developing some new features for it

 

Welcome to the weekly discussion! This is place where you can chat about anything that may not deserve its own post

Hopefully last one I make manually before I get my bots back up

 

Hey everyone! Figured I would do an AMA to kick off some activity in the IAmA community over here. Feel free to throw down some questions below and ill answer them

I'm currently a student in university and have been doing both web development and game development recently (web for internships, game on my own). Out of the four admins ive been the one mainly handling community creation and managing in the instance to make sure everythings running smoothly

Some other misc topics that I can answer about: I compose music & make pixel art, and my favorite games are minecraft, SCP:SL, everhood, battlerite, and metal slug 3

If anyone else wants to do an AMA feel free to start one up in the community (assuming it fits the instance). Any activity helps get the ball rolling for getting it active

45
submitted 1 year ago* (last edited 1 year ago) by [email protected] to c/[email protected]
 

Hey everyone

Theres been some discussion recently about the content allowed in this community so I wanted to make a quick poll to gauge what is wanted in terms of what people see here

The current description of the community is a bit ambiguous so this will determine whether everything is allowed here or if only more general programming topics are

You can just dm me with options ranked based on your preference (its ranked voting) to vote and ill share the results in a day of the overall vote tallies


1: Allow all posts relevant to the instance (main community)

This will let pretty much any post be able to be posted in here whether that be a help question, discussion, news, etc.

Allowed:

  • What is your favorite music to listen to while programming?
  • Has anyone else seen this interesting “challenge site” when googling a programming topic?
  • Intellij and docker on vm memory issues
  • [HELP][Python] How to use Selenium correctly
  • Announcing TypeScript 5.2 Beta
  • Discussion ES6 Classes. Good or Evil?

Disallowed

  • Things not relevant to the instance

2: Allow any posts and direct people in the comments to more specific communities for their future posts (people catching community)

This will also let any post be able to be posted in here like the previous option but will guide people towards the more specific communities in the future to make them then post the content in those

Allowed:

  • What is your favorite music to listen to while programming?
  • Has anyone else seen this interesting “challenge site” when googling a programming topic?
  • Intellij and docker on vm memory issues
  • [HELP][Python] How to use Selenium correctly
  • Announcing TypeScript 5.2 Beta
  • Discussion ES6 Classes. Good or Evil?

Disallowed

  • Things not relevant to the instance

3: Only allow topics that arent limited to one language, library, etc. (general topic community)

This will let posts such as: what is your favorite music to listen to while coding? or Here is some details about functional programming be able to be posted while something like a library for python will instead be posted in the python community

Allowed:

  • What is your favorite music to listen to while programming?
  • Has anyone else seen this interesting “challenge site” when googling a programming topic?

Disallowed

  • Things not relevant to the instance
  • Intellij and docker on vm memory issues
  • [HELP][Python] How to use Selenium correctly
  • Announcing TypeScript 5.2 Beta
  • Discussion ES6 Classes. Good or Evil?

4: Dont allow questions of how to do X in X language but allow actual discussions or news about the language in addition to general topics (general & discussion community)

Like above but also allows conversations about specific languages in the community as long as its not a question on how to do X in the language

Allowed:

  • What is your favorite music to listen to while programming?
  • Has anyone else seen this interesting “challenge site” when googling a programming topic?
  • Announcing TypeScript 5.2 Beta
  • Discussion ES6 Classes. Good or Evil?

Disallowed

  • Things not relevant to the instance
  • Intellij and docker on vm memory issues
  • [HELP][Python] How to use Selenium correctly

5: Only allow crossposts into the community with things like news being posted in the specific community first (crosspost community)

This will ONLY let crossposts be made. All other options also allow crossposts but this makes it so that the post will fill up the specific community while c/programming is a main post feed for people who want to see many different topics from the specific communities

Allowed

  • anything as long as its crossposted

Disallowed

  • anything not crossposted
  • things not relevant to the instance

You can find some past discussion here https://programming.dev/post/388375 to see some points for the different options

Based on whats voted some other communities may be created or adapted to fit the new niche of people

(ill reply to your dm when your vote is counted, if I havent responded in awhile I may not have gotten it or im asleep)

 

Server is going to go down for an upgrade to increase capacity at 6 UTC. This could take up to 30 minutes

 

cross-posted from: https://programming.dev/post/371748

If you're familiar with the topic of awesome lists on GitHub, then you should know that there is a community driven list just for Lemmy, including a convenient aggregation of links to instances, alternative front-ends, mobile apps, libraries, tools, guides, etc.

 

Welcome to Showcase Sunday!

Are you making anything in Godot? Feel free to discuss it below or show off your progress!

 

Welcome to Screenshot Saturday! This is a day where you can show off your game in this thread with things like gifs or images of it!

view more: ‹ prev next ›