2201
24

I understand Rust being type safe, but Im seeing syntax that Ive never seen in my life in Go which looks too messy

var test int < bruh what?

:=

func(u User) hi () { ... } Where is the return type and why calling this fct doesnt require passing the u parameter but rather u.hi().

map := map[string] int {} < wtf

2202
28

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

In order to learn programming holograms I'd like to gather some sources in this post.

The linked paper describes already optimised way of rendering holograms. I'd like to find a naive implementation of a hologram i.e. in ShaderToy using interferometric processing of stored inteference patterns like it works in a physical hologram(I guess). I also want this to be a resource to learn how laser holograms work in real life.

To create an introduction project to holographic rendering these steps will be required.

  1. Store a sphere or a cube interference patterns in a texture. This should be a model of our physically correct hologram. Note: If this step requires saving thousands of textures we should limit the available viewing angles(if that's what helps)
  2. Load the rendered patterns as a texture or an array of textures into a WebGL program
  3. Create a shader that will do the interferometric magic to render the sphere/cube from the hologram model

The performance of the solution is irrelevant. Even if takes and hour to generate the data and a minute to render one frame in low resolution that's fine.

Note: The goal is not about creating anything that visually looks like a cool hologram or rendering 3D objects with a volume like with SDFs or volume rendering. It's all about creating a basic physical simulation of viewing a real hologram.

2203
39

So I'm a hobbyist game developer for years whose day job is writing reports/troubleshooting database issues with MSSQL.

I'm a bit over half way through a CS bachelors degree!

I'm aware of three ways to get experience to help me find a job once I graduate, and wondering if one is superior to the others, or if there is another way!

  1. Personal projects. There is a very large programming project I've been working on off and on for 2ish years and I feel like after my recent programming classes I can probably start it off right and trash all my previous prototypes.

  2. Work on open source projects. This one is a bit scarier at this point, as I'd have to find one I like, one that is active, one that my skills fit with, one I can get accepted with, etc.

  3. Find entry level freelance things. I'm aware I could maybe do cheap tasks on Fiverr, or sign up for things like Data annotation, to earn a bit of money and have "something" directly related to programming on my resume.

3.5 Could do coding challenges, but most of the ones I've seen don't seem super relevant to making large programs, but solving convoluted puzzles. But would love to hear if there is a site that has more real world challenges.

My personal experience for previous projects (and favorite programming class so far) has been python (shocking I know). Hoping I'll fall in love with C# programming once I get into the advanced classes with it, as I know that pairs much nicer with my MSSQL experience. Oh my game dev has also been in Game Maker, which uses GML, so not superrr helpful experience.

So any thoughts/opinions?

2204
9

Since its debut last year, SwiftData has become a focal framework that has garnered significant attention from developers. With the arrival of WWDC 2024, there is widespread anticipation for breakthroughs in functionality, performance, and stability in SwiftData. This article will review the performance of the latest version of SwiftData and share the complex emotions I experienced during my first encounter with the new version: shock, joy, disheartened, and perplexed.

2205
40
Lost in translation (lemmy.world)
submitted 2 years ago* (last edited 2 years ago) by Quicky@lemmy.world to c/programming@programming.dev

Just had some requirements through for a query that a customer has specified.

“Set the value to 1 if the Outcome is not Complete or Cancelled or NULL”

This could be variously interpreted as: 

“if the Outcome is NOT Complete and NOT Cancelled and NOT NULL”

Or “if the Outcome is NOT Complete, and NOT Cancelled, or IS NULL”

Or perhaps even “if the Outcome is NOT ‘Complete or Cancelled’ or IS NULL”

Obviously I’ll go back to them for clarity, but it’s a wonder why so often “bugs” arise based on interpretation of specifications.

2206
16
2207
52
2208
130
submitted 2 years ago* (last edited 2 years ago) by MrOzwaldMan@lemmy.ml to c/programming@programming.dev

Title before edit: I hate programming, why did i choose this field

TL;DR: Stupid mistake, made by hours waste.

Basically, I was extracting date from the SQL db, and it was not displaying. I tried everything, heck I even went to chatgpt, and copilot. Two and half hours of trying every single thing under the sun, you know what was the issue?

SELECT task, status, id FROM mainWorkSpace WHERE user_id = @user_id

I FUCKING FORGOT TO ADD 'date' TO THE DAMN QUERY. TWO AND HALF HOURS. I was like, "Ain't no way." as I scrolled up to the query and there it was, a slap in the face, and you know what was the fix?

SELECT task, status, date, id FROM mainWorkSpace WHERE user_id = @user_id

Moral of the story, don't become a programmer, become a professional cat herder instead.

2209
336
submitted 2 years ago by neme@lemm.ee to c/programming@programming.dev
2210
44

The video posted is part of my friend's art exhibition last Friday. It's avaialble at https://gallery.font.skin server "ARK"

The other server "Fontland" is a gallery of effects built in Font.Skin where you walk around with a girl(which is bald - my Daz 3D importer is not perfect) and discover different real-time-rendered text effects. The effects are in form of screens which are also textured rect area lights giving cool reflections.

The effects can be built using WebGL in https://font.skin The best way to start is to paste a simple ShaderToy shader into "Frag shader" tab and replace some variables with "textEdgeDist" and "auraEdgeDist"

2211
236
2212
2

In Squid config, is there any variable - %VAR - that contains the current unique request id or anything similar?

I'll need to pass that into an external script, for instance:

# squi.conf
auth_param basic program %REQUEST_ID(???) /etc/squid/my_auth.py

This may not be an authentication script, this is just an example.

I've searched but haven't found anything about it.

2213
21
2214
24

Hello everyone !

I have a quite complicated question/setup. I have my software on a Gitlab repo, and I'm publishing the software on flathub. everytime I do a release on Gitlab, I need to also update the flathub repo with the commit and the release tag, and I'm thinking this could be automated with Gitlab CI/CD.

Exemple repo :

When modifying the Flathub repo, I need to create a PR with my modifications and wait for the build process to complete. Then, I can merge the request.

Do you have any idea how can I automate the flathub part everytime I create a new release on Gitlab ?

My explaination might be a bit blurry, if that's the case, please feel free to ask for clarification.

Thank you for your time and answers!

2215
35
submitted 2 years ago* (last edited 2 years ago) by diy@sh.itjust.works to c/programming@programming.dev

I'm looking for a programming language that can help me build a desktop application for Windows, macOS, and Linux that's not big but not small either. Additionally, I'd like to be able to build a website with the same language. I've been considering Ruby, Python, Golang and JavaScript. Python seems to be mainly used for scripting and ai, so I'm not sure if it's the best fit. JavaScript has a lot of negative opinions surrounding it, while Ruby sounds interesting. Can anyone recommend a language that meets my requirements?

2216
15

I have a JSON object with a huge array of nested objects. Let us assume it consists of records of license plates for vehicles. It would contain necessary fields like licenseID, issuingState, dateOfIssue, driverID etc.

What I am having problem with is how I should store data that is only used for exceptional cases, like a field for representing if the license plate is for foreign embassies (isEmbassyOwned) or if it is owned by a government entity (isGovernmentOwned) or if it is a learner license (isLearner) etc alongside fields with data types other than Boolean which would be empty or 0 and likewise when there is no information on that field. Let it be known that these exceptional scenarios would occur in less than 10% of total object instances.

I am facing confusion as to what format would be best for storing such type of data keeping balance between minimizing storage consumption and being human readable. Should I declare the fields for all objects regardless or only include them when they are not empty? Should I store them in a dedicated array instead, or maybe just introduce some code value to be used by a switch case operator in the interpreter? Or is there some other implementation I am not aware of?

2217
17

Why is crypto.subtle.digest designed to return a promise?

Every other system I've ever worked with has the signature hash(bytes) => bytes, yet whatever committee designed the Subtle Crypto API decided that the browser version should return a promise. Why? I've looked around but I've never found any discussion on the motivation behind that.

2218
414
2219
96
2220
84
submitted 2 years ago* (last edited 2 years ago) by manicdave@feddit.uk to c/programming@programming.dev

This is a question that comes to mind every time I spend a few days focusing on the fediverse. Normally I'm on the microblogging side, but now I have a Lemmy account it might start a proper discussion.

So, to the point, pretty much every fedi platform has similar problems with small servers taking a beating whenever a post goes viral. This ends up costing the server owner a bunch of money trying to keep their server alive while thousands of instances attempt to pull large static files from the original host's post. This recently instigated this call to action on this forum.

I've never seen the question of torrents answered and it feels like a lot of effort and a bit self entitled to get the ear of fedi software devs to implement torrents as a solution, so I'm putting this here.

If media files were made into torrents when a post was being created, an extra object could be added to post objects like

'torrentcdn': {
  'https://imagePathAsKey.jpg': {
    'infohash': 'ba618eab...',
    'torrentLocation': 'https://directlinkto.torrent',
    'webseed': 'https://imagePathAsKey.jpg',
    ...
  }
}

This would not break compatibility as it would just be ignored by anything not looking for a 'torrentcdn' object, yet up to date instances could use this instead of directly pulling the static files.

This would benefit instances as when a post goes viral, the load would be distributed amongst all instances attempting to download the file.

This could also benefit clients and instances as larger files like short videos could be distributed using webtorrent, massively reducing the load on server when many people are watching the same video.

Thoughts?

2221
-22
submitted 2 years ago* (last edited 2 years ago) by Melatonin@lemmy.dbzer0.com to c/programming@programming.dev

I know I know. I wanted to import data from a web page - title and publishing dates from Stephen King books. I wanted to update my caliber library with the correct metadata from the online source.

I tried three different AI's. Claude. Pi. And ChatGPT. I've spent all day copying and pasting error messages copying pasting new scripts running scripts copying and pasting error messages etc etc etc.

I could have gone line by line through my caliber library manually in much less time than I have spent doing this.

There's no question the AI knows how to program in Python better than I do. What hope do I have of ever reducing my workload significantly using Python?

2222
19

Mapping C# array types to PostgreSQL array columns or other DBMS/DB JSON columns.

2223
20
2224
-25
Mojo vs Julia (sh.itjust.works)

Discuss.

2225
15
Need Some Advice (lemmy.world)

I was asked to help out with someone's git project. They said if I could learn handlebars that would help a lot. What is the best way to learn this? What other languages do I need to use it? Any recommendations for videos or sites to learn from?

view more: ‹ prev next ›

Programming

28322 readers
767 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 !webdev@programming.dev



founded 3 years ago
MODERATORS