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
151
 
 

Im making an android app with flutter as a little side project. I am not really a great designer and I struggle to come up with designs for the user interface.

Im wondering if there are any (free or open-source) resources / templates that could help with this and maybe give me some inspiration. I have only used the design tool Penpot a little bit to make concepts for my interface.

Any advice would be appreciated. Thank for reading!

152
 
 

I’m a dev. I’ve been for a while. My boss does a lot technology watch. He brings in a lot of cool ideas and information. He’s down to earth. Cool guy. I like him, but he’s now convinced that AI LLMs are about to swallow the world and the pressure to inject this stuff everywhere in our org is driving me nuts.

I enjoy every part of making software, from discussing with the clients and the future users to coding to deployment. I am NOT excited at the prospect of transitioning from designing an architecture and coding it to ChatGPT prompting. This sort of black box magic irks me to no end. Nobody understands it! I don’t want to read yet another article about how an AI enthusiast is baffled at how good an LLM is at coding. Why are they baffled? They have "AI" twelves times in their bio! If they don’t understand it who does?!

I’ve based twenty years of career on being attentive, inquisitive, creative and thorough. By now, in-depth understanding of my tools and more importantly of my work is basically an urge.

Maybe I’m just feeling threatened, or turning into "old man yells at cloud". If you ask me I’m mostly worried about my field becoming uninteresting. Anyways, that was the rant. TGIF, tomorrow I touch grass.

153
 
 

Hello fellow programmers,

I'm a newcomer to the world of IT, specifically focusing on frontend development. I recently embarked on this journey in my 30s, and I find myself contemplating the importance of having a mentor to guide me through this exciting yet challenging field. I would love to hear your thoughts and experiences on whether having a mentor is crucial when entering IT as a self-taught developer.

While I understand the benefits of self-learning and online resources, I believe having a mentor could provide invaluable guidance, industry insights, and personal support. A mentor's guidance can help navigate the vast landscape of frontend development, from learning best practices, mastering frameworks, to gaining a deeper understanding of the industry's expectations.

Additionally, I have aspirations to work in the EU or US region in the future. If having a mentor is indeed beneficial, I would appreciate advice on where to find one, particularly someone experienced in the European or American job markets. Are there specific mentorship programs, online communities, or platforms where I can connect with potential mentors?

Any personal success stories are highly welcome

154
57
submitted 1 year ago* (last edited 1 year ago) by Rhs519@lemmy.ca to c/programming
 
 

Hello Everyone,

I’ve got a 10 year old daughter who loves making games in scratch, but she’s starting to run into that boundary where it stops working for you, and starts working against you.

She wants to make an adventure game in the vein of a trimmed down “legend of Zelda: link to the past”

I’ve looked at snap and gamefroot as potential next steps. Would consider a “true” language like JavaScript or python, but I’m worried she would be daunted if the ramp is too steep (maybe with the correct libraries/frameworks?) The immediate feedback and low ramp scratch offers are still important.

Anyone have any wisdom to share? Or point me to something I’ve missed?

Thanks

—- Update:

After some good discussion with my daughter, we’re going to try gamefroot (a proprietary, enhanced scratch) first.

She really wants to check out Gadot too.

Thanks everyone for the thoughtful comments and the help.

155
 
 

In many projects, you might have custom DNS entries, for example for your development environment, or because something is prototype without a real DNS entry yet, or simply for convenience to not remember weird IP addresses.

Currently, these special domains might be used in the configuration of a project (say, the DB server is db1.acme.local), and that's version controlled and everything, but creating the actual DNS entry (in the hosts file for example) is still manual and therefore error prone.

Has anyone figured out a nice solution to this? Or do you all have super quick IT departments that'll give you real domains instantly?^^

156
 
 

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

I'm skeptical on this being a good resource for learning to program. But It's the first time I've seen Odin being used in an introductory resource. Would you recommend this to someone looking to learn programming?

157
 
 

I have looked at Google Cloud Run, Microsoft Azure and Kamatera so far. These are free trials, and I deleted and removed all projects after playing with them.

I am working on a chatting application for my portfolio. I'm using MERN to create the app and I can run it locally and connect to the local server with any device on the network. Before I got into this I didn't realize setting up a cloud server was going to be so confusing, and that's after trying to watch tutorials on youtube and going through documentation.

On google, people have talked about VM Instances, (Bare Metal Solution?) Servers, networks, VPC's, VPC Networks, serverless VPC, etc. and I have explored all of these things and I just don't understand why it's so hard to get a node.js file running somewhere remote.

Microsoft Azure and Kamatera were pretty much the same experience.

I'm not the smartest or faster person, I've got cognitive issues, but if anyone can kind of give me some simple steps or explanations to get me started in the right direction, I'd really appreciate it.

I don't need a complete write-up or guide, just a push in the right direction for my specific project, which is just getting my node.js code somewhere so the client can connect to through it. I think?

158
15
submitted 1 year ago* (last edited 1 year ago) by kat@feddit.de to c/programming
 
 

How far did you proceed and what language did you use?

I think the challenges a great way to learn a new programming language. Though I have to admit I never finished the set myself.

159
11
Let else statement in Rust (doc.rust-lang.org)
submitted 1 year ago by gbin@lemmy.ca to c/programming
 
 

I just discovered this one right after discovering the if-let, this is amazing to be able to do positive and negative pattern matching without using a full blown match statement!

People are complaining that Rust is adding too many features to the language but I have to admit those recent additions are very good... What do you think?

160
3
submitted 1 year ago* (last edited 1 year ago) by ShaggyDemiurge@lemmy.blahaj.zone to c/programming
 
 

Hi! So, I have a serious problem with tab hoarding. And now I want to write a browser extension - a bookmark manager. I've already attempted it once, and even got to MVP, but then didn't really use resulting program, was a bit too clunky, and also I realized that this is not the solution to the problem.

Now, few months later, after reevaluating my approach and also finding an imperfect solution that actually works (using Toby as my bookmark manager and closing about 400 chrome tabs), I now have an itch to try again. In a nutshell, it's a bookmark manager (i.e. having good categorization, unlike read-it-later apps like Pocket) oriented on read-it-later functionality (i.e. having a separate read-it-later list, quick saving and quick deletion of tabs from either main library or read-it-later list, unlike most bookmark managers)

For context, I am senior android developer with 7 years of experience, specializing on Kotlin (so that's why I'm searching for kotlin-based solutions, like Kotlin/JS and ktor), but my webdev experience is limited by last time I attempted this, and a half-year class in my uni almost ten years ago. And now I have ideas of doing this as a self-hosted app, to avoid limitations of both IndexedDB, and Kotlin/JS, and also to allow sharing bookmarks between browsers (and, if hosted online, between computers). But I haven't done stuff like this before (had no need), and only approximately understand things like Docker and stuff. But I'm a quick learner.

So, after some (pretty shallow) research, I got an approximate idea how it would work:

  1. Extension written in Kotlin/JS, using Compose for Web + Kobweb Silk (adds containers like Row/Column and Modifier) - That's the part I'm familiar with, I've already learned from zero how it works last time
  2. Ktor server that handles business logic - Never needed ktor in android development yet, so a new area for me
  3. Parse-platform server - Never worked with it either, but looks useful

Not quite sure if I really need three layers, or if I should just use a database and access it with sql queries. Or maybe the other way round, to move business logic to extension, and access parse server from it

So, I'd like some feedback on how dumb am I, if this even a good idea, how should I fix flaws with my plan, or is it fractally dumb, and I should quit programming altogether for coming up with ideas like that without even doing proper research?

161
 
 

I've found this interview question at GeeksForGeeks and decided to actually code it in C++. The program currently prints the "value" of the horses (which is inaccessible by the coder so they can't just look up who is number 1) and then proceeds to sort them and find the position of numbers 1,2 and 3 in a 5x5 matrix with the solution being a minimum of 7 races.

Here's the Github repo: https://github.com/Shroomerian/HorseRacing

162
1
submitted 1 year ago* (last edited 1 year ago) by BBloggsbott to c/programming
 
 

I have multiple tables with the same schema. The only difference is the table name. Table names are in the format table_name_<tenant_id>, for example, table_name_1, table_name_24, table_name_15 etc.,

I want to use a single Entity and JPA repository to perform operations on this table. I get the tenant_id from the Request. I want to execute queries on the corresponding tables.

How do I dynamically set the table name to be used for querying?

We have only 5 such tables since the data for each tenant is very high

Not adding a MWE since I couldn't find any place to start trying approaches.

Edit: Replace user_id with tenant_id and add number of tables present

163
164
 
 

With ever the constant updates to popular and important apps and websites, how do the developers ensure the update preserves the user and site's original database, considering the possibility that the updates might contain data-corruptive bugs or exploits for users?

This question is not addressing the frequent database leaks, since they only involve release of read only data and exploits only exist in the form of accessing user accounts and data, not altering the site's database at large itself.

Even if there is a backup for the database, undoing changes that affect millions or people negatively would create a ton of uproar, especially if the site is based on real time interactions, like stock broker apps, social media apps and instant messengers. However I have personally never heard of such incidents.

Do companies at such large scales have extreme QA in place, depend on user feedback and reporting, or just have been lucky they haven't been exploited yet? Or am I completely wrong and these incidents do occur?

Keep in mind that I am an amateur in this domain. I have worked with MySQL databases for educational purposes and personal projects but I found the state of databases very fragile, like the ability to nuke the entire database with just 2-3 words. This fact made me come up with this question.

165
 
 

In a comment on my "right to be forgotten" proposal I mentioned causality tracking (so eg. figuring out whether event A happened before or after event B) in distributed networks as an example of a hard problem, and I figured I'd share a blog post (not mine) on one of the more modern techniques that's still very much underutilized. This class of algorithms is called logical clocks, and the first of them was the Lamport timestamp by Leslie Lamport. Note that many of these algorithms can be used for tracking version changes and not just logical time, often with some changes like in the case of interval tree clocks.

In many cases just plopping a timestamp on a message and using that to establish causality isn't good enough. If you rely on clients to attach that timestamp, you have to trust that their clocks are correct, or that they don't simply lie about the time for whatever reason (although of course that's a problem with logical clocks too.) Also, you might not want to base your causality on when a message was sent but on when it was received; even if message A is sent before message B, there's no telling whether A actually makes it to your system before B does. These are just a few common reasons for needing logical clocks, and they're necessary in a surprising amount of cases when you deal with distributed systems.

The advantage of interval tree clocks compared to eg. vector clocks is that they're designed to work well in networks where participants are constantly leaving and coming back online and where you can't know the number of nodes in the network beforehand. These are cases most other algorithms don't deal with too well. Of course this means more complexity in the algorithm, but this is a case of "them's the breaks" as the problem is definitely not a simple one to solve.

166
 
 

I saw a post today from beehaw's admin talking about the new UI? Why are we limited to the UI being as it is? Why aren't there alternative hostable Lemmy frontends?

167
 
 

As the title said. I have participated in several hackathons over the last decade (10 hackathons).

And a thing I have noticed is that, in the last hackathons I went, winners were selected based on the inclusivity of their idea and not on their ability to build such idea.

To clarify, this were blockchain hackathons (I don't know if this can be relevant)

Examples

So I don't just sound like someone complaining, let me give examples.

In one big blockchain hackathon organized by Eth Global (a very big group) one of the 10 winners was a project for helping women and people of color. They presented only a presentation.

In another smaller hackathon, one of the winners was a great idea on how to fight censorship to help LGBTQ+ access the information they need in current times (and this idea was very well thought, I really like it). Again, they only presented slides, but didn't have any code at all.

My problem with it

It may be something new, or maybe I'm outdated but when I go to a hackathon, I expect people to actually build a proof of concept and present it.

I always thought that was the idea, get together and see what you can build in 24/48 hours. And at the end, the winners are selected by a mix of how original their idea was + their ability to actually build it.

When I see a team winning by presenting a project without having actually built enough to show it, I feel cheated. It feels like I'm watching Shark Tank or any show where participants try to sell the idea to VCs, instead of a programming tournament.

The fact that hundreds of people spend one or two all nighters planning a project that they can actually do in that time, fighting bugs, designing the site, testing their functionality and struggling with all the process of software engineering just to see that the winner didn't actually do anything of that and proposed an idea that maybe it can not even be done in a hackathon, is frustrating.

I want to clarify, my problem is not that I didn't win, my problem is that I always look up to the winners, I want to see their project, how it works, how amazing it is, how they were able to build it in such a short notice, and when I see that they didn't actually build anything, I have the problem.

When I participated in GameJams, having a submission was always a requirement, and I could play hundreds of amazing games, original or not. And the winner usually was someone that make a game from which I can learn a lot.

So, coming again to my question:

Have hackathons became too political? Is it only a blockchain hackathon thing?

I really enjoy going to hackathons, but this have been a bit frustrating between the last ones.

168
45
submitted 1 year ago* (last edited 1 year ago) by interolivary to c/programming
 
 

Hey fellow nerds, I have an idea that I'd like to discuss with you. All feedback – positive or negative – is welcome. Consider this a baby RFC (Request for Comments).

So. I've been having a think on how to implement the right to be forgotten (one of the cornerstones of eg. the GDPR) in the context of federated services. Currently, it's not possible to remove your comments, posts, etc., from the Fediverse and not just your "home instance" without manually contacting every node in the network. in my opinion, this is a fairly pressing problem, and there would already be a GDPR case here if someone were to bring the "eye of Sauron" (ie. a national data protection authority) upon us.

Please note that this is very much a draft and it does have some issues and downsides, some of which I've outlined towards the end.

The problem

In a nutshell, the problem I'm trying to solve is how to guarantee that "well-behaved" instances, which support this proposal, will delete user content even in the most common exceptional cases, such as changes in network topology, network errors, and server downtime. These are situations where you'd typically expect messages about content or user deletion to be lost. It's important to note that I've specifically approached this from the "right to be forgotten" perspective, so the current version of the proposal solely deals with "mass deletion" when user accounts are deleted. It doesn't currently integrate or work with the normal content deletion flow (I'll further discuss this below).

While I understand that in a federated or decentralized network it's impossible to guarantee that your content will be deleted (and the Wayback Machine exists), but we can't let "perfect be the enemy of good enough". Making a concerted effort to ensure that in most cases user content is deleted (initially this could even just be a Lemmy thing and not a wider Fediverse thing) from systems under our control when the user so wishes would already be a big step in the right direction.

I haven't yet looked into "prior art" except some very cursory searches and I had banged the outline of this proposal out before I even went looking, but I now know that eg. Mastodon has the ability to set TTLs on posts. This proposal is sort of adjacent and could be massaged a bit to support this on Lemmy (or whatever else service) too.

1. The proposal: TTLs on user content

  1. Every comment, post etc. (content) must by default have an associated TTL (eg. a live_until timestamp). This TTL can be long, on the order of weeks or even a couple of months. Users can also opt out (see below)
  2. well before the content's TTL runs out (eg. even halfway through the TTL, with some random jitter to prevent "thundering herds"), an instance asks the "home instance" of the user who created the content whether the user account is still live. If it is, great, update the TTL and go on with life
    1. in cases where the "home instance" of a content creator can't be reached due to eg. network problems, this "liveness check" must be repeated at random long-ish intervals (eg. every 20 – 30h) until an answer is gotten or the TTL runs out
    2. information about user liveness should be cached, but with a much shorter TTL than content
    3. liveness check requests to other instances should be batched, with some sensible time limit on how long to wait for the batch to fill up, and an upper limit for the batch size
    4. in cases where the user's home instance isn't in an instance's linked instance list or is in their blocked instance list, this liveness check may be skipped
  3. when a user liveness check hasn't succeeded and a content's TTL runs out, or when a user liveness check specifically comes back as negative, the content must be deleted
    1. when a liveness check comes back as negative and the user has been removed, instances must delete the rest of that user's content and not just the one whose TTL ran out
    2. when a liveness check fails (eg. the user's home instance doesn't respond), instances may delete the rest of that user's content. Or maybe should? My reason for handling this differently from an explicit negative liveness check is to prevent the spurious deletion of all of a user's content in cases where their home instance experiences a long outage, but I'm not sure if this distinction really matters. Needs more thinkifying
  4. user accounts must have a TTL, on the order of several years
    1. when a user performs any activity on the instance, this TTL must be updated
    2. when this TTL runs out, the account must be deleted. The user's content must be deleted if the user hasn't opted out of the content deletion (see below)
    3. instances may eg. ping users via email to remind them about their account expiring before the TTL runs out
  5. users may opt out of the content deletion mechanism, both on a per-user basis or on a per-content basis
    1. if a user has opted out of the mechanism completely, their content must not be marked with a TTL. However, this does present a problem if they later change their mind

2. Advantages of this proposal

  1. guarantees that user content is deleted from "well behaved" instances, even in the face of changing network topologies when instances defederate or disappear, hiccups in message delivery, server uptime and so on
  2. would allow supporting Mastodon-like general content TTLs with a little modification, hence why it has TTLs per content and not just per user. Maybe something like a refresh_liveness boolean field on content that says whether an instance should do user liveness checks and refresh the content's TTL based on it or not?
  3. with some modification this probably could (and should) be made to work with and support the regular content deletion flow. Something for draft v0.2 in case this gets any traction?

3. Disadvantages of this proposal

  1. more network traffic, DB activity, and CPU usage, even during "normal" operation and not just when something gets deleted. Not a huge amount but the impact should probably be estimated so we'd have at least an idea of what it'd mean
    1. however, considering the nature of the problem, some extra work is to be expected
  2. as noted, the current form of this proposal does not support or work with the regular deletion flow for individual comments or posts, and only addresses the more drastic scenario when a user account is deleted or disappears
  3. spurious deletions of content are theoretically possible, although with long TTLs and persistent liveness check retries they shouldn't happen except in rare cases. Whether this is actually a problem requires more thinkifying
  4. requires buy-in from the rest of the Fediverse as long as it's not a protocol-level feature (and there's more protocols than just ActivityPub). This same disadvantage would naturally apply to all proposals that aren't protocol-level. The end goal would definitely be to have this feature be a protocol thing and not just a Lemmy thing, but one step at a time
  5. need to deal with the case where a user opts out of having their content deleted when they delete their account (whether they did this for all of their content or specific posts/comments) and then alter changes their mind. Will have limitations, such as not having any effect on instances that are no longer federated with their home instance

3.1 "It's a feature, not a bug"

  1. when an instance defederates or otherwise leaves the network, content from users on that instance will eventually disappear from instances no longer connected to its network. This is a feature: when you lose contact with an instance for a long time, you have to assume that it's been "lost at sea" to make sure that the users' right to forgotten is respected. As a side note, this would also help prune content from long gone instances
  2. content can't be assumed to be forever. This is by design: in my opinon Lemmy shouldn't try to be a permanent archive of all content, like the Wayback Machine
  3. content can be copied to eg. the Wayback Machine (as noted above), so you can't actually guarantee deletion of all of a user's content from the whole Internet. As noted in the problem statement this is absolutely true, but what I'm looking for here is best effort to make sure content is deleted from compliant instances. Just because it's impossible to guarantee total deletion of content from everywhere does not mean no effort at all should be made to delete it from places that are under our control
  4. this solution is more complex than simply actually deleting content when the user so wishes, instead of just hiding it from view like it's done now in Lemmy. While "true deletion" definitely needs to also be implemented, it's not enough to guarantee eventual content deletion in cases like defederation, or network and server errors leading to an instance not getting the message about content or a user being deleted
169
11
Python Project (self.programming)
submitted 1 year ago by Foidi to c/programming
 
 

Hi fellow bees! Soon Ill start working on a project with my group at uni. It will be long and hard journey and I will have to relearn python, as I havent used it much. But I am looking forward to it. The project itself is about signal analysis form EEG scanner to try and decode information hidden in and use it as a mean of prostethics control. I hope so much that we will get something usefull done with it! :3

170
171
 
 

So ive been trying to code for a few mouths now but its kind ahard with life, depression, autism, and dylexia i just feel like this might be an impossible task. i really want to make a game and im not sure why, i even got rpg maker 2003 but idk how to use it do i learn myself or are there videos for it?

Im not sure if im doing thing wrong but how shoudl one start/do if they want to make video games on a low-endish computer? also i cant run things like unity or unreal, dang... feel free to share tips aswell and please be kind, ive been suggested coding/game dev alot for some reason and im not sure if its for me but idk what else to do.

172
 
 

I had a bunch of personal scripts to manage my music database. Maybe 10-sh scripts, max a few hundred lines long, nothing too big. A little while ago, I wrapped them into a big emacs org file for literate programming, and to tangle them, so I could easily edit them in one place. Backed them up to at least three servers, both locally and in another building. I also have Cronopete running, (a Linux implementation of MacOS Time Machine), so everything is safe, right? Right?!. I didn't need the scripts for 3 months or so, but today I wanted to use them but couldn't find them anywhere. Not on any backup server, not on the Cronopete drive. The only thing I can think of is that I must have saved that org file on the backup server and then backed up over it (and it never got pulled by Cronopete because it does of course not look at the backup server). I will have to start rewriting those scripts from scratch. FML.

173
 
 

Im considering spending some serious time learning one of the above. Two principle engineers I work with exclusively use them, and watching them work is incredible, the speed they move and get things done is pure wizadry. Can anyone learn this skill? For what it's worth, the alternative is learning VScode. I’ve exclusive used Android Studio in my career.

174
 
 

I really love computer science, coding and mostly all the amazing things you can do with this knowledge, i feel i finally landed in my world.

I'm doing a Javascript course now and while it is really engaging to learn about how a language like that works and how to build with it, i'm getting quite tired and frustrated..

Now, i'd say i am quite meticulous when studying and i use some studying techniques to really integrate what i'm learning, but that means that 1h or even less lesson can take me all the time i have to study in a day to be understood, noted down and then repeated over the following days..

There are a lot of quite complicated concepts to understand and memorize, and, as i'm also working, sometimes it gets quite tiring.

I feel like there's this huge amount of never ending work and concepts before i can actually start do something cool with the knowledge i have, and i really want to start doing something cool.

I re-started to study after many years so i'd say it's also because of that if i'm not really used to it and i can't process much informations at the time.

How can you get better into gaining knowledge? how can you prevent getting fatigued?

175
 
 
view more: ‹ prev next ›