Programming

13385 readers
1 users here now

All things programming and coding related. Subcommunity of Technology.


This community's icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

founded 2 years ago
MODERATORS
201
26
submitted 1 year ago by small44 to c/programming
202
 
 

I’ve been learning C# with .NET Core and would like to start hosting my projects online, everything I’ve done is locally so far.

I don’t THINK I need a Windows Server host, they seem to be expensive, I think .NET runs ok on a Linux server? But when searching for a .NET hosting provider I see windows everywhere.

I’m hoping to find as low a cost option as possible. It will be mostly for hosting projects to show potential employers / clients etc.

where do you generally host your .NET projects? I’ve seen AWS / Azure / Linode recommended, but I think costs can spiral quickly?

203
 
 

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

Have you ever used git bisect? If so, how did you use it? Did it help you find a problem which would otherwise be difficult to find? Story time, I guess?

204
 
 

Hello friends, the title is mostly self explanatory. I would like to start programming but I also feel like I am not very smart, so I would like a programming language that is easier to grasp than others. That considered I don't hope to be able to learn something "powerful" but it would be nice to still be able to do some useful things. Something I would love to do is make games, I know those are usually made in C, which is a very difficult one, but maybe some simpler games can be made with other languages.

205
 
 

Hey everyone. I would like to specify that I want to use GPLv2 only without including support for GPLv3 in a repository I want to create. Anyone know how I can do that through github's create a new repository interface?

Much appreciated

206
12
A Kbin userscript (self.programming)
submitted 1 year ago* (last edited 1 year ago) by brie to c/programming
 
 

Not a Lemmy script, but I thought it might still be useful for those of you who use Kbin.

The userscript has the following features:

  • Downvotes are hidden;
  • Heavily downvoted posts fade out;
  • The title text of the date also shows in local time;
  • Links to the parent, previous, and next comment in comments;
  • Some of the sidebar items are removed; and
  • Hovering over usernames is disabled.

I tried to make the sections cleanly delineated, so that unwanted features can be easily edited out.

// ==UserScript==
// @name        Kbin script
// @namespace   https://beehaw.org/u/brie
// @match       https://kbin.social/*
// @grant       none
// @version     1.1
// @author      @brie@beehaw.org
// @description Changes some aspects of comment display
// @run-at      document-start
// @license     AGPL-3.0-only
// ==/UserScript==

// Custom style
document.head.appendChild(document.createElement('style')).textContent = `\
/* Some color tweaks */
.theme--dark {
  --kbin-success-color: #38fa9f;
}


/* Hide sidebar sections */
.related-magazines,
.active-users,
.posts.section,
.entries.section {
  display: none;
}

/* Hide downvotes */
.comment span[data-subject-target="downvoteCounter"] {
  display: none;
}
`;

window.addEventListener("DOMContentLoaded", () => {
  // Rewrite community links to magazine links
  for (const link of document.querySelectorAll(`a[href^="/c/"]`)) link.setAttribute("href", `/m/${link.getAttribute("href").slice(3)}`);

  const siblings = new Map();
  for (const comment of document.querySelectorAll(`.comment`)) {
    // Fade out heavily downvoted posts (inspired by Hacker-News).
    const upvotes = comment.querySelector(`span[data-subject-target="favCounter"]`)?.textContent | 0;
    const downvotes = comment.querySelector(`span[data-subject-target="downvoteCounter"]`)?.textContent | 0;
    const boosts = comment.querySelector(`span[data-subject-target="upvoteCounter"]`)?.textContent | 0;

    const score =  (upvotes + 3) / (downvotes + 1);
    if (score < 1) {
      comment.style.setProperty("color", `color-mix(in srgb, var(--kbin-section-text-color) ${score*100}%, transparent)`);
      comment.style.setProperty("background", `color-mix(in srgb, var(--kbin-section-bg) ${score*100}%, var(--kbin-bg))`);
    }

    // Show downvotes in the title text
    comment.querySelector(`.vote__down > button`)?.setAttribute("title", `Reduce (${downvotes})`);

    // Show local date
    const timeago = comment.querySelector(`.timeago`);
    if (timeago) {
      const datetime = timeago.getAttribute("datetime");
      if (datetime) timeago.setAttribute("title", `\
${new Date(datetime)}
${datetime}`);
    }

    // HN-style navigation
    const header = comment.querySelector(`:scope > header`);
    const parent = comment.getAttribute("data-subject-parent-value");
    if (parent) {
      const toParent = document.createElement("a");
      toParent.href = `#entry-comment-${parent}`;
      toParent.textContent = "parent"
      header?.appendChild(toParent);
    }
    const sibling = siblings.get(parent);
    siblings.set(parent, comment);

    if (sibling) {
      const prev = document.createElement("a");
      prev.href = `#${sibling.getAttribute("id")}`;
      prev.textContent = "prev";

      if (parent) header?.appendChild(document.createTextNode(" "));
      header?.appendChild(prev);

      const next = document.createElement("a");
      next.href = `#${comment.getAttribute("id")}`;
      next.textContent = "next";
      const siblingHeader = sibling.querySelector(`:scope > header`)
      if (siblingHeader) {
        siblingHeader.appendChild(document.createTextNode(" "));
        siblingHeader.appendChild(next);
      }
    }
  }

  // Neuter the hover actions
  for (const el of document.querySelectorAll(`[data-action="mouseover->kbin#mention"]`)) {
    el.removeAttribute("data-action");
  }
});
207
 
 

Hello! I'm trying to understand how a color has been obtained by merging two other colors, for instance:

--color1: #02c390;
--color2: #31363B;

--result: #24544C;

I would like to create --result by merging the two other colors, but I don't know the percentage. I tried using color-mix but I didn't get any close results. how can I get the percentage of the two colors needed to obtain the result?

thanks in advance!

208
9
submitted 1 year ago* (last edited 1 year ago) by canpolat@programming.dev to c/programming
 
 

In this conference talk, Evans explains some of the most important concepts related to Domain-Driven Design while taking a critical look at how we traditionally think about models. Suggests asking “which model would be more useful to solve this problem” instead of relying on our understanding of objects “in real world”. He also emphasizes the importance of communication with domain experts an use of ubiquitous language.

209
210
 
 

Hey everyone, so I wrote this post a short time ago, and now I have another question regarding the same repository. I would like to remove the themes that I haven't touched as I don't want to have to deal with maintaining them every time there is a Lemmy update. Is that something I am allowed to do? Is it considered a crappy thing to do to the other dev?

Thanks in advance for all your help!

Edit: Of course I am clearly giving credit to the original dev both on here on lemmy, as well as within my code

211
 
 

Recently I've experienced a significant increase in merge conflicts at the company I'm currently working at (we hired a couple of junior data scientists and some are not that familiar with git)

Even though those merge conflicts can be a little tedious to resolve, I realized that I personally started to enjoy it - especially using fugitive. Haven't had many conflicts in a while, so almost forgot about Gdiffsplit and how awesome that plugin is...

Now I'm wondering, how often do you have to resolve (more or less complex) merge conflicts?

212
 
 

Copilot is great, but a hundred bucks for what is basically a smart autocomplete seems a bit much - mostly, I hate the fact that the code is constantly transmitted to github (my repos are mostly local) - are there any reasonably convenient options for doing this without github looking over my shoulder all the time? I'm using VSCode but not wedded to it.

213
214
 
 

I'm working on an macOS client app and was curious what was needed to authorize/login a user to get a token for the auth header?

The lemmy documentation for login doesn't seem to work (sends 400 response back) and it also doesn't seem to work with oauth?

I got oauth working for mastodon but those same endpoint calls don't seem to work for lemmy.

215
 
 

I know profilers and debuggers are a boon for productivity, but anecdotally I've found they're seldom used. How often do you use debuggers/profilers in your work? What's preventing you? conversely, what enables you to use them?

216
 
 

Overall, a release more for engineering than language. Even the new API's are mainly optimizations, but a large improvement.

217
 
 

Head to https://brilliant.org/CodeBullet/ to start your free 30-day trial, and the first 200 people get 20% off an annual premium subscription.check out my s...

218
 
 

The course i'm following says primitive types belong to the execution context in the call stack, but are they part of the context variable environment?

I guess variable declarations would surely be part of the variable environment, but what about the other primitive types, like null or undefined? Do they need to be attached to a declaration or are they stored in as well?

219
 
 

220
 
 

Feel free to tell about what your day looks like. I'm exploring different positions so it'd be very valuable to me. I've already done a few courses in C# and Python, they seem to be quite common. My goal here is to get to know this role better, for now I have limited information about it. Is it rather repetitive, or is there always something new to do? What part of it do you enjoy the most and the least? Is it true that many desktop apps are really webapps?

221
 
 

Hey does anybody know if there's a description of ActivityPub available that isn't just the spec? I realized I don't actually know how the protocol works, and I'd be interested in learning more. May have to just bite the bullet and dive into the spec – it doesn't actually look too bad based on a quick glance – but a summary would be cool

222
 
 

Hi hi, I know I posted about this yesterday-ish, but Slemmy is now deployed! Head to https://slemmy.libdb.so to give it a try! Simply make a profile with your favorite instance and continue!

If you haven't seen yesterday-ish's post, here are some screenshots of Slemmy: https://imgur.com/a/KJqKuiF

Unfortunately, there's no signing in yet, so you can't do much besides reading posts. I'm actively working on this, though!

The project's source code is at https://github.com/diamondburned/slemmy. Its README contains the current features and what is planned for now. I started on this project not even a week ago, so it's likely unstable and not ready for heavy use yet. Please open an issue if you encounter any bugs, I would really appreciate it!

223
3
submitted 1 year ago* (last edited 1 year ago) by imxset21 to c/programming
 
 

We use RocksDB at work in a distributed form but I was curious how people deal with problems using it in open source distributed systems (eg how people handle replication and sharing of data)

224
 
 

I've been working on honing my architectural skills and came across this interesting article that put some things in perspective for me. Maybe it will help you too!

225
 
 

I ask because I like console, but at the same time have difficulties remembering all the commands. I'd like to try a GUI that is comfortable to use with only a keyboard.
[edit]
My inbox got fediversized, fantastic feeling.

view more: ‹ prev next ›