Programming

13384 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
101
 
 

Hello! I'm writing my application in QML, and inside a TextArea formatted with RichText I want to display this:

a header

(an empty line)

another header

my first thought was to go with a <br> tag, but it has a problem: it creates 2 empty lines, don't know why. so doing this

<h1>hello</h1>
<br>
<h2>world</h2>

produces

hello

(an empty line)
(an empty line)

world

I tried using the <pre> tag:

<pre>
</pre>

but no empty lines were displayed

the only working workaround was to use a non breaking space &nbsp;, but being it a TextArea, the user is able to edit the text, and so there would be a "rogue" space instead of an empty line. How can I display just a single line break between two headers (or even paragraphs, but in my case the header is needed)?

102
 
 

Hi lemmy, You all probably kniw about https://adventofcode.com/

I would love to do that with some students of mine. Only thing is, I'm not very good at it, so I can't always figure out what the underlyong principles are.

Is there a place where someone (website, blog, github, erc), much better than I, explains each puzzle, how it's solved, which algorithm is used, what underlying principles you can learn from this?

103
104
 
 

Hey all,

I am a software developer at a small company where I'm one of two developers. The other dev is primarily back-end and has been working off some basic cloud infra set up by an external company before I joined, so I'm essentially running solo on the frontend, some of the backend, cloud architecture, project management, etc. (really, everything except database management some of the existing api endpoints).

So, what are the best ways to improve in this scenario? How do you prevent a limited learning environment from limiting your growth? Has anyone been in a similar situation and learned some tips for making the best of it? Any ideas?

(Also, I know it's frequent advice to just say "move companies" but this job is a really unique opportunity, and I absolutely love the company, so I am not interested in doing that.)

Thanks :)

105
 
 

Was looking through some code today, and found something that highlights my biggest struggles in programming, it's compound words and casing. Had identifiers such as...

strikeThroughOffset
whitespaceWidth
lineSpacing
underlineOffset
outlineThickness

I can keep in mind "strike through off set", but then I struggle to remember, is it strikethrough or strikeThrough? What about Offset or OffSet? Why are offset, underline, and outline, all one word, but strikeThrough isn't? I think of it as one compound word, many people apparently do, but I guess someone who wrote this code doesn't.

Or... is this just a me problem? Does anyone else struggle with this sort of thing? Am I missing something or should I "just get good"? My best solution so far is just keep everything always lowercase, personally I find that more readable and memorable, but that's a lot to ask of literally every other programmer in the world...

106
7
submitted 1 year ago by small44 to c/programming
 
 

I would like to contribute to lemmy but I have issue with the docker image. I got this error when trying to execute docker-compose up : "ERROR: Service 'lemmy' failed to build: the --mount option requires BuildKit. Refer to https://docs.docker.com/go/buildkit/ to learn how to build images with BuildKit enabled"

I executed the commands that was in the link in the error message and I still have the same issue.

107
16
submitted 1 year ago* (last edited 1 year ago) by Kissaki@feddit.de to c/programming
 
 

They explore a great retrospective and assessment of the broader context of Lazygit: Git and version control systems in general, their interface, and text-based UIs.

108
109
 
 

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

Hi, what is the most primitive programming language (esolangs included) that you can think of or make up that could still be reasonably well^1^ supported by a language server (or similar piece of software)?

1 We have to draw a line somewhere, so I'd figure capabilities

  • highlight semantic errors
  • renaming stuff safely, that is:
    • without confirmation
    • without evaluating parts of the code
  • proper completion (not just best guess)
  • go to definition/show use

I appreciate your answers!

110
111
37
Nim v2.0 released (nim-lang.org)
submitted 1 year ago by brie to c/programming
 
 

I've played around with Nim before, and thought some of the features such as default values were quite helpful, so it's quite nice that 2.0 is now officially released!

112
113
10
A Type System for Scripting ECS (ceesstuff.github.io)
submitted 1 year ago* (last edited 1 year ago) by TheCee@programming.dev to c/programming
 
 

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

This time on my arbitrary blog: Entity component systems.

Also, highlight.js should degrade more gracefully without JS activated than last time. Note that I can't process syntax highlighting in my build step, because I don't have a build step.

EDIT: improved phrasing

114
 
 

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

This month we look at debuggers in Python and how to choose your own debugger instead of relying on the built-in pdb.

115
9
Fundamentals of HTML (domesticatedbrain.com)
submitted 1 year ago by ShehanPerera@lemmy.zip to c/programming
 
 

This article explains the fundamentals of HTML including the HTML document structure.

116
 
 

Hi! I'm learning code: I've been doing a bit of JavaScript, and now i'm switching to TypeScript before going through frameworks.

One thing i'm quite missing is the possibility to have a personal documentation environment: something that let me write documentation on what i'm learning WHILE writing code and following my courses, using something like typedoc or javadoc.

I have been using Obsidian, that is good for markdown content, and i can generate docs with typedoc-markdown-plugin that i can then open on obsidian. However i would like to have both my code and my docs all togheter, not for a single project but for all the courses and little projects i'm doing, having it all togheter stored in one place, and possibly being able to share it as a portfolio in the future.

I don't specifically need to show the code in this environment, i just need the docs to be visible and to be pointing to the specific sections of the environment holding my code (wich can be github links like the ones that typedoc automatically add). I would like to have one directory for each project containing both my code and my docs.

Something like a programming digital garden! But integrated with tools that generate documentation from my code.

I've tried the typedoc-hugo-plugin to host a static docs website with Hugo, but it's not quite mantained and came with a lot of bugs, like broken links.

I'm trying to use Docusaurus and docusaurus-plugin-typedoc; it looks quite good, however i understood it is designed more to hold documentation for a single big project than for a series of small (learning oriented) projects. You need to configure each extra (more than one) docs folder to get it work properly, which is something i would avoid, if possible.

I love all the TSdoc standard thing, but i don't really know how to put everything togheter.

117
 
 

Was digging through a project at work today where some guy in 2014 made 100+ commits in a single day and the only one that had a comment said "upgrading to v4.0".

118
119
 
 

I used to be a lurker of r/C_programming where people would ask questions and get answers. It mostly consisted of students wanting to get a human answer to their problem.

I liked chiming in there and answering from time to time. Although you always had that one student who ordered to do the homework for them, there were some nice and helpful interactions in that subreddit.

Would people be interested in a community focused around helping each others in programming? Or would this very community do the job already?

120
121
 
 

I lately saw the following Software Development jobs requirements:

Experience with Generative AI - Advantage

What the hack does it means? I know how to use ChatGPT or Bard, but how much experience can one have to be experienced with it?

And I'm not talking about AI/ML or Algorithmist jobs

122
 
 

When running docker dev environment with Linux and Windows (with WSL2), it's already in the same container context so the performance is decent. However, on Mac there's no WSL2 equivalent so bind mounts are painfully slow due to the overhead of translation between the Mac's and container filesystem.
Is there any way to run the code in docker VM like WSL2 allows?

123
 
 

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

Let's test if crossposting works this time...

In this poorly written essay I list programming language design features that make dynamically typed languages less dynamic. Stuff I collected over the last few years when people asked about it.

Also, don't worry, next post will be more concise.

124
 
 

Hey! Curious if anyone tried to communicate between GovCloud and Commercial AWS? I am aware they are separated by design. I have a task to try to have a ECS make an api call a private api gateway on GovCloud. Right now the idea is to use private API gateway on GovCloud and a VPC Endpoint on the Commercial side. I don’t think this will work..

I’m certain that this cannot be done without a VPN or having the GovCloud api be public facing, but as I’m not by any means an expert in AWS networking I am curious if anyone has any thoughts?

125
 
 

This seem quite counter intuitive and to be bloating the project: i'm trying to install tsdoc linter, but npm adds like other 50 packages alongside with it, is this the expected behaviour? Why is it so?

A project that could easily be 5MB ends up being like 60MB

view more: ‹ prev next ›