Programming

18570 readers
403 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 2 years ago
MODERATORS
1
 
 

Hi all, I'm relatively new to this instance but reading through the instance docs I found:

Donations are currently made using snowe’s github sponsors page. If you get another place to donate that is not this it is fake and should be reported to us.

Going to the sponsor page we see the following goal:

@snowe2010's goal is to earn $200 per month

pay for our 📫 SendGrid Account: $20 a month 💻 Vultr VPS for prod and beta sites: Prod is $115-130 a month, beta is $6-10 a month 👩🏼 Paying our admins and devops any amount ◀️ Upgrade tailscale membership: $6-? dollars a month (depends on number of users) Add in better server infrastructure including paid account for Pulsetic and Graphana. Add in better server backups, and be able to expand the team so that it's not so small.

Currently only 30% of the goal to break-even is being met. Please consider setting up a sponsorship, even if it just $1. Decentralized platforms are great but they still have real costs behind the scenes.

Note: I'm not affiliated with the admin team, just sharing something I noticed.

2
35
Git without a forge (www.chiark.greenend.org.uk)
submitted 17 hours ago by [email protected] to c/programming
3
 
 

I can’t believe nobody has done this list yet. I mean, there is one about names, one about time and many others on other topics, but not one about languages yet (except one honorable mention that comes close). So, here’s my attempt to list all the misconceptions and prejudices I’ve come across in the course of my long and illustrious career in software localisation and language technology. Enjoy – and send me your own ones!

4
5
42
Why fastDOOM is fast (fabiensanglard.net)
submitted 1 day ago by maxint to c/programming
6
7
8
 
 

Normally I skim the README, but this one was worth taking some more time to read. This would be a cool project to look at in undergraduate hardware/OS/CPU design courses

9
 
 

I'm curious what kind of project you are working on? I'm working on a procedural terrain generation open world game! Now it's your turn to tell me!

10
 
 

I may be a old man yelling at the clouds, but I still think programming skills are going nowhere. He seems to bet his future on his 'predictions'

11
 
 

I've recently (finally) taken the leap into self-hosting my RSS reader, and I'm wondering what feeds everyone's subscribed to

I've currently got some basics like Github releases for software I use, the great selfh.st blog for self-hosted news, hackaday, some essentials like xkcd, and an attempt at following new music releases from artists I like, but I'm sure there are other great feeds out there that I should also be aware of

12
 
 

I have some familiarity with C++, and concepts like compiling and linking static and dynamic libraries, which is what I understand as collections of code that simplify doing certain things.

But then I get confused in certain cases, for example, why is OpenGL considered an API? Why is it necessary to use other libraries like GLAD, freeGLUT or GLFW to interface with OpenGL?

And then other languages have this thing called package managers, like pip, node, cargo, and vcpkg for c/c++, where you install these packages that get used like libraries? What's the difference?

Finally the ones I understand the least of are frameworks. I keep hearing the concept of frameworks like Angular for js and a lot of stuff that's too alien for me because I'm still unfamiliar with web development.

So for example, I'm using the raylib library for a small game project I have. I link the .lib or .dll file to my executable file so I know I'm unambiguously using a library. How come there's also Cocos2dx which is a framework? What's the distinction?

13
 
 

First off, I've been loving vanilla-extract for the past 10 months. 😊

The only thing I really missed was the ability to sort CSS properties. Since there wasn't an ESLint plugin for that, I decided to create my own.

@antebudimir/eslint-plugin-vanilla-extract offers CSS property ordering (alphabetical, concentric, and custom), auto-fix capabilities, and supports multiple Vanilla Extract APIs.

If anyone wants to give it a shot, you can find more details in the readme. Looking forward to hearing your feedback.

14
 
 

note: i did NOT create the ASCII art. I'm not good enough to do that. I found on various ascii art archives as well as those image to ascii art converters for the continents I couldn't find.

countryguess was a project I made recently because I wanted to make a quiz that could be customised as you see fit. Also, I had no clue how to make GUIs with Python and ASCII art is cool so I decided to roll with it. It turned out pretty cool!

I made the maps by printing the ASCII art map, and then all the spaces that make up each country would be an array. These arrays would fill up the spaces like morocco[0], morocco[1], etc.

Then, when the country is guessed, the country (or an alternate name/abbrviation, such as uk for the united kingdom or ivory coast for cote d'ivoire) is matched with its index in the list of countries in that continent.

A second list contains all the countries that show up on the map (excluding citystates, islands, etc. that aren't big enough to be shown on the map) and has all the countries as either 0 (false) or 1 (true). Whenever the country is guessed, its respective list item turns into 1.

The map printing function checks each list item for whether it is true or false. If it is true, then the list of spaces for that country would be replaced with a list of equal length and equal number of characters but with hashes "#" instead of spaces " ". This means that, when the county is printed, hashes are printed instead of spaces and the country fills up

I've got africa, europe, north america, and oceania completed. I haven't yet made the map for asia because it's HUGE, and south america I haven't done yet as well. Also, central/eastern europe is VERY out of proportion and will be fixed...eventually. (i.e. long romanian panhandle)

other fun features I added include the ability to enable/disable disputed territories (Western Sahara, Kosovo, and Somaliland bc why not) and the U.N. observer states (the Vatican and Kosovo) as well as score saving to a "scores.txt" that shows the date, time, and name of quiz that you complete along with your score.

once I finished all the continents, I'll work on making a world quiz with ALL the countries. other things like capital quizzes and flag quizzes could be added on later, but that's likely very far into the future.

here are some more screenshots:

europe europe

oceania oceania

north america north america

the github link if you want to look at the code or just have a go at the quiz: https://github.com/swarbler/countryguess

15
 
 

(https://just-the-docs.com/docs/customization/#define-a-custom-scheme for reference)

I am using just the docs (jekyll theme) + github pages to create a webpage and trying to have two separate colour schemes: a normal and high contrast option.

I am using a custom style with "_sass/custom/custom.scss" to set all the colours, layout configurations, etc. because there are some options that are not available using "_sass/color_schemes/foo.scss" such as more control over the colours of different elements.

However, I cannot find in the docs how to make it possible to easily switch with a custom.scss. One option is to create two github pages sites, one with high contrast and the other with normal colours, but that's really janky. just-the-docs seems to only allow you to create switchable colour schemes if you use "color_schemes/foo.scss" rather than "custom/custom.scss".

Am I forced to create a second github pages site for high contrast, or is there a way to switch between two different custom.scss?

16
17
 
 

I would love any comments/criticism as this is the first project I've written where I actually felt comfortable with what I was doing

Thanks!

18
263
SQL Noir (www.sqlnoir.com)
submitted 1 week ago by [email protected] to c/programming
 
 

Solve mysteries through SQL.

19
20
21
submitted 6 days ago* (last edited 6 days ago) by [email protected] to c/programming
 
 
 # Ask user to enter an expression and display output
def main():
    expression = input("Expression: ")

    print(calculate(splitter(expression)))


# Split expression into components and assign to variables as float values
def splitter(expression):
    x, y, z = expression.split()

    return x, y, z

# Calculate expression result
def calculate(x, y, z):
    x, z = float(x), float(z)

    if y == "+":
        return str(round((x + z), 1))
    elif y == "-":
        return str(round((x - z), 1))
    elif y == "*":
        return str(round((x * z), 1))
    else:
        return str(round((x / z), 1))



main()

I am getting traceback errors for any expression (1 + 1) I enter.

21
22
 
 

Hi, I made FuncSug to make GUI programming in the browser easier. It's a new language that aims to enable a clearer and easier code structure.

Can you tell me what you think about it?

23
21
CPU performance (curiouscoding.nl)
submitted 1 week ago by learnbyexample to c/programming
24
25
43
submitted 1 week ago* (last edited 1 week ago) by 0101100101 to c/programming
 
 

Not sure if off-topic, but what's the best way to go about finding coding gigs at the moment? Need some urgent funds so need to reach out to people somehow.

I think of linkedin as a facebook for businesses leading you open to being spammed by agencies, which I don't really want.

Though I have years of experience of coding across many languages and fields (audio, computer vision, e-commerce backends, etc), and github accounts over the years with some pushes to the core of a few major projects, I haven't really kept the accounts, and past projects have nearly always been back-ends for clients so can't exactly add them to a portfolio.

Languages I'm currently using would be python / php (including symfony and laravel), though happy to switch to javascript/html coding, some c/c++ etc, so I'm not tied to one area I guess.

Is there a decent place to advertise or, is there a better way lately? Thanks

view more: next ›