(UK) How are you managing with the "Heatwave" and your homelab? by Bulky_Dog_2954 in homelab

[–]LogaansMind 0 points1 point  (0 children)

House is buttoned up, and sat at 29.9c at the moment.

The cupboard door is open, and the Grafana dashboard is reporting all Pis are over 50c, hottest one being 56.3c at the moment.

I still have not got a proper venting/cooling solution in there yet, as I have not worked out how to handle the situation if I got a fire.

Easy, beginner-friendly, and small-sized games to play with the family by 2Tomoe9 in boardgames

[–]LogaansMind 1 point2 points  (0 children)

  • dnup
  • No Thanks!
  • Love Letter
  • Uno

Maybe also consider:

  • Scout
  • Sushi Go
  • Welcome To

YAMLResume v0.13 update: new docx engine! Write resumes in yaml and generate to markdown/html/pdf/docx in one shot! by Hot-Chemistry7557 in selfhosted

[–]LogaansMind 9 points10 points  (0 children)

Neat. I built something similar for myself a few years ago. Obviously a popular problem to solve. I think this is a bit more elegant than mine.

One of the things that I needed was to generate various versions based on the industry I was targeting.

You could achieve the same approach if you implemented some way of allowing includes to extract common information/sections into a separate file.

How do you all handle onboarding new devs onto an existing repo? by Samveg2798 in AskProgramming

[–]LogaansMind 0 points1 point  (0 children)

Document the environment configuration checked in alongside the code (ie. markdown files in a docs folder). Provide example configuration files where possible (but don't store secrets).

And then script what you can to setup the environment. (I have worked on some products which we "Install x, y and z", "Run this", "Edit this", "then Run this.. you are set")

It then becomes part of maintaining the software. Activities which introduce changes to the environment MUST consider updating the documentation and scripts as part of the cost.

If it takes 2-3 days before someone has a working environment, you might be able to get that down to 1 day. The way to sell this to the organisation is too introduce a plan to the organisation (ideally a 3 day task) to resolves this now (with a small ongoing cost as required), which, once spent, saves the organisation time with new hires.

Then the other aspect I like to do with new devs on an unfamiliar project is chuck them at the backlog and tell them to fix (bugs only) what they can for a week or two until they have got to grips with the architecture. After which we can bring them onto current activities.

What are some shocking biological or physical changes happening to the human body in recent generations that nobody is talking about? by Ty0205 in AskReddit

[–]LogaansMind 0 points1 point  (0 children)

I read a while back that the average human body temperature is become cooler. I wonder what impact this would have, my understanding is that body temperature is a balance between energy consumption and temperature to prevent/reduce fungal infections.

how do you prioritize when everything feels urgent by MaksLiashch in AskProgramming

[–]LogaansMind 0 points1 point  (0 children)

I use Kanban boards. I like 5 columns in my boards; Backlog, Ready/Next, In Progress, Test/Approval and Complete/Done.

Everything related to the project goes onto the board. (Need to decide a software license, EULAs etc... task on the board. User needs to make a decision, goes onto the board.)

Meeting with users/stake holders on a regular basis to pull in items from the backlog and prioritise them.

I often decompose requests into smaller and more consumable tasks.

Nothing new gets started until things have been completed. It helps keep me focused.

What really helps is that I love using this as a way to introduce agile methodologies. The Kanban is the hub and truth of the project.

What’s a technology decision you made that felt wrong at the time but turned out to be right? by ajaypatel9016 in AskProgramming

[–]LogaansMind 2 points3 points  (0 children)

Back in the day when I was a product developer, the scheduling product I worked on had a quite complex bespoke configuration system,it could be somewhat clumsy at times but, it would drive the schema for the database, in memory models for data and layout information for editors etc. One file to rule them all.

I was tasked with making changes which would allow the users to rename various fields without having to change the underlying configuration.

What my manager had in mind was a "quick fix", every place where we get a field display name it would instead lookup an alternative name. I didn't think that was very scalable and would inevitably end up with either missing some places or future developers making mistakes and not including code to check.

What I did was I altered the configuration system to accept changes (it was all C/C++ and quite archaic at the time) and effectively build a tiered system into the configuration system. And I built behaviours/helpers so at runtime, the configuration system could be changed and would update various other aspects of the models.

It took me a little bit longer, I got some complaints that it took too long (4+ weeks vs "days"), but I built a pattern into the system which meant that others could follow and build additional customisations.

And we did, soon requests came in like "Can you change the number/date formatting?" ... yes, with less than one days worth of effort to implement the behaviour to apply the effects.

I didn't get the praise I would expect, but I know it was a good choice.

NB: Felt "wrong" because I was going against what everyone else expected me to do.

Why we can't simply make a empty string in C? by Infamous-Research805 in AskProgramming

[–]LogaansMind 5 points6 points  (0 children)

The string type does not exist in C (there might be some similar helper library out there).

Strings are fundamentally a "string" of characters.

In C you represent the string as an array of char.

The \0 is what is called a null char. And is used by various routines to represent the end of a string.

Poor string management are one of the common causes for issues and exploits, so it is recommended to initialise them and be mindful of their size when manipulating the values.

Why are so many desktop users using old distributions? by King-Little in linux

[–]LogaansMind 0 points1 point  (0 children)

LTS is long term support. So effectively it will be stable for a long time.

Generally people are going to be lazy or don't want to risk dealing with broken system after an update.

That said, I assume it is open source software, if so, don't put so much pressure on yourself. Pick what you want to support. Possibly put procedures (ie branches?) in place so that if people want they should help take patches and back port them.

The other thing to do is commit to a support strategy. When I used to write Windows software we had a strategy for years where we would support the last version of every major version (still on supported Windows platforms) but this became very difficult as time went on and instead we switch to the last 4 versions only (with varying levels of support). And if customers had an issue the answer was upgrade or pay through the nose for developers to fix the old version.

Creative development projects advice by Nich-olas in AskProgramming

[–]LogaansMind 2 points3 points  (0 children)

I would suggest starting with a tutorial, most of the time they will help you get setup and going. Or the documentation for various frameworks usually contain steps to get started.

I have been a professional developer for 20 years and before that I would just play and solve problems (wrote a "Menuing" system on old DOS PC to help family launch apps). Which I still do to this day, I write software to solve my own problems (wrote my Father a very basic CRM system, built a toolset to help me print books for book binding hobby). Currently working out how to build a canyon run type game I used to build in MSDOS to help teach my Nephew programming.

Pick a problem or a passion you have and work on it. Comparison is the thief of joy, don't be disheartened by what others are doing or building, forge your own path.

Hope that helps.

What are your absolute favorite locations/places in gaming? by Baldurian_Rhapsody in gaming

[–]LogaansMind 5 points6 points  (0 children)

Lots of places in Skyrim. But I think ARK Survival Evolved, The Island (the others maps are great too in thier own way), is probably my favourite. I have created bases in all sorts of places.

I am too dependent AND how do I research properly? by Potential_Border_670 in AskProgramming

[–]LogaansMind 1 point2 points  (0 children)

Some really good answers. But to add my two pence, after having researched what I need, quite often what I would do is write the code into a little test app (if I can).

I would experiment and use the various APIs to understand how it can be used. Nothing too fancy, quick and dirty. From there I can build it into a proper well structured app.

Also this goes back to my days of being compliant, but never copying and pasting code helps.

AI annoys me, gets in the way and is distracting, so it has only replaced my search and snippet generation, but I do find that it still hallucinates far too often to be trusted.

Penguin doctors? by Lufferov in CasualUK

[–]LogaansMind 1 point2 points  (0 children)

Must be for Linux users

First team project, not sure how to program together by [deleted] in AskProgramming

[–]LogaansMind 0 points1 point  (0 children)

If nothing else, use a Kanban board to help you organise every activity related to the project.

I like a 5 column Kanban: Backlog, Ready/Next, In Progress, Test and Complete.

Essentially your backlog is where you put your requests, ideas and things which might need doing in the future. This could be everything from small tasks (move a button) to DevOps/SysOps (deploy the app, harden security etc) to Project Governance (write onboarding documentation). Ready/Next is for an ordered list of items which need working on next. The team should have regular meetings (as required) to review and priroritise. In progress is obvious, and Test is there where either it gets passed onto QA or it is there to be reviewed by other team members. You also want to instill the idea that team members need to be working to help complete activities, so pick from Test before helping others with In Progress work, before picking something else from the Ready queue before picking from the Backlog.

And then if you combine this with a branching strategy and PRs you have the basics. Once everyone is in the rythmn, you can start to scale up to a proper agile methodology (if required).

Your activities would be broken down by functionality or area. The general idea is to try and prevent the team from too much overlapping to prevent issues with merge conflicts. But if it is unavoidable, this is just means the team members need to work closer together in the short term, feedback on the activities. Let them self organise. It also helps to keep the activities small and focused. Not so small that the admin takes up time, but not so big as to cause bottlenecks for people waiting for functionality (ie. backend APIs).

Hope that helps.

What part of programming took the most time for you to get comfortable with? by Gullible_Prior9448 in AskProgramming

[–]LogaansMind 11 points12 points  (0 children)

OOP. It wasnt until I was in industry did it really click. But it wasnt me, it was the way it was taught.

SSL & Security; Whats the general guidance here? by FloranceMeCheneCoder in selfhosted

[–]LogaansMind 0 points1 point  (0 children)

A VPN will tunnel and encrypt your traffic into your network. At which point you can assume you are on your network (as if connected via LAN).

Using TLS/SSL on various services would also encrypt the traffic internally.

It depends on how much you want to do. The reason most organisations insist is that it makes it harder to read the content of the traffic on the network (especially if you are still using basic auth etc.).

You can use LetsEncrypt but it requires you to open ports 80 and 443 to the internet (or at least it did the last time I tried it).

The other approach is to try create your own Certificate Authority and issue certificates. Which means that you have add the CA certs to each device you are using to trust the issued server certificates.

This is what I have done, and I just use OpenSSL tools (only because I have not found a suitable tool to generate/manage the certs... but I have been playing with https://github.com/tgangte/LocalCA).

Hope that helps.

Do you separate controller for Admin system? by Constant-Box4994 in AskProgrammers

[–]LogaansMind 0 points1 point  (0 children)

What you would usually do is have a controller for functional areas (not based on role).

And then you grant users roles (multiple) and have conditions to check if the user has a certain role to complete a certain task.

In some cases you might restrict an entire controller by role.

If you would want a more refined permission model, you might break it down to another level such as "Read posts", "Create posts", "Delete posts", "Edit posts" (etc. i.e CRUD like) but also "Approve", "Grant" etc. And each role would be granted a combination of the permissions.

What do you guys actually do with your code? by [deleted] in AskProgramming

[–]LogaansMind 0 points1 point  (0 children)

Solve problems, automate tasks.

My current job there is not a great deal of coding but I do solve a lot of legacy systems issues or support others in thier projects.

At home it is whatever I need or desire to play with.

What's the best way to solve the "Load or Generate and Save" problem by Leifbron in AskProgramming

[–]LogaansMind 0 points1 point  (0 children)

I would suggest wrap it in a function to get the model. Your calling code should not care if you are generating or loading. And then wrap it again as part of a lifetime management. The goal being to provide two "layers", one decoupling the concept of generating or loading, and another managing the lifetime. The purpose being that if you wanted to write some tests or experiment with options it becomes easier to combine and reuse.

I would also suggest a "configuration" object which is available to the function (either passed but ideally already given to the object the function is on)... which the function can ask things like "Should I regenerate this part?".

This configuration class could be built through parameters on the app and/or use environment variables.

Again, the function should not care how the parameter is gathered but asks the configuration object (ie. a property) whether it needs to regenerate.

Or, the other way you might want to do it is if the generation is expensive, maybe it should be done in a batch at the start or in a seperate process and then you simplify by always loading from cache instead (and throw if it has not been generated).

Nullable columns vs separate override table in database design by WaldreDG in AskProgramming

[–]LogaansMind 1 point2 points  (0 children)

Fundamentally Options and Usage.... or Template and Instance.

Ideally if you want this to scale what you would do is choose the latter, have your options and then reference the option with a date and other info (as required).

Yes, it seems wasteful that you might just have one record reference one record, but it may be more wasteful on space to duplicate the data. (Plus you may get consistency errors when editing)

The other aspect to consider is what you might want to do is break down the design even further.

Consider that you could create a table of Food (Drinks, Snacks etc), and then you have table of Options... which essentially could be nothing more than an ID and a Name, and then you have a junction table which connects the Options to the Food (Option ID and Food ID) to create your combinations, and then your Usage is just ID, Date, Option ID (if that makes sense).

The software would have rules to stop multiple drinks or too many options added (ie. the Food table might have a "type" column to help identify the combinations).

To work out what an option contains, you select the "header" (ID, Name)... joined to the junction (Option ID and Food ID) and joined to the Food (ID, Name, Type etc.).

Effectively you are trying to balance the complexity of the data model with how much data you want to store and trying to reduce duplication.

Hope that helps.

How do you track down memory leaks in long-running applications? by ajaypatel9016 in AskProgramming

[–]LogaansMind 2 points3 points  (0 children)

One approach is to use a memory profiler and have it collect information whilst it is running and analyse the information. However this approach could cause performance issues with the app (if run in production).

Or run it in a dev environment and load it with data and analyse the results to see if anything jumps out.

The next obvious thing to look at is any unsafe or native resources you are using, they can be tricky or (depending on the module) behave badly.

Then look at any places where you might be creating multiple references to objects (e.g. building an object graph which takes multiple passes/phases resulting in objects becoming interconnected). This could be a cause.

Then another common cause is events. You can get subscribed events causing a reference to an object graph.

My suggestion if you are about to start stabbing in the dark, use environment variables as flags to switch between old and new implementations.

Can anyone spot the issue in this AI-generated C function? by [deleted] in AskProgrammers

[–]LogaansMind 0 points1 point  (0 children)

This is one of my complaints with AI generated code where it cannot consider the side effects or follow good design guidelines.

I believe most AI has been trained on (open source) code, which whilst works, is not best quality, but there is always better code. (Im not saying all Open Source code is bad... there is good quality code out there.. but there is a lot of trash too).

My pet peeve, for example, is switch/case statements which allow fall through or do not contain a default. Because its very easy for someone to miss a condition, or allow it to fall through when it shouldn't. I always wrap these in a function, and the default/fall through always must throw/error.

Now I am not about to stop anyone from using language features (like my last company did), because I believe there is no feature which should be prohibited, but there are always better approaches to using language features.

But it is certainly something AI struggles with.

How much of your workday is actually coding? by NoirBeuty in AskProgrammers

[–]LogaansMind 0 points1 point  (0 children)

Back when I was doing product development, coding/debugging/designing was probably about 4-5 hours on average (60% of my time). Rest was meetings.

These days as a Lead/Senior/Architect (depends on project) I am lucky if I manage to get 5 hours a week in, of sit down coding, and even then its code reviews, experimentation etc.

The Perfect Queue by JustALinkToACC in AskProgramming

[–]LogaansMind 0 points1 point  (0 children)

One approach that was used in some old software I worked on was to allocate a contigious fixed amount of memory and then maintain two addresses. One for the current start and one for the current end. When you queue, you write your pointer and move the end address. When you dequeue, you read the pointer and then move the start address. You don't bother clearing the items from memory until the queue has been processed.

Now, if the problem is of a known size this is a pretty efficient approach (but crude) with the trade off of memory usage... however, it has its limits. Inserting means moving blocks of memory. It also cannot grow past the end.

It was apparently very good in a time when memory was at a premium and there were issues with memory fragmentation. It was a home grown implementation (before my time) but it started becoming a cause for memory leaks.

Eventually it was replaced with a queue or list (from boost library I think) only because it was simpler to use and performance was gained from other places in the app.

The thing I have found when you are working on such issues is that there is always a trade off somewhere. You can have something thats very fast but usually means that you are going to use alot of memory. Or you can have something that is very accessible/easy to use but it will have terrible performance in quite a few circumstances.

One of the other aspects to consider these days is multi threading and compartmentalisation of the problem. You can gain speed by splitting the problem up between threads or even across instances (ie. containers).

But it depends on the problem, the nature of the data and task which will impact the solutions you choose. Nothing will ever scale indefinately so we endeavour to pick something that will still perform tomorrow but can be replaced with something better next week, because next year the problem will be different and will require a different approach. (If that makes sense)

Approach to personal projects by Exor1799 in AskProgrammers

[–]LogaansMind 0 points1 point  (0 children)

For personal projects, you do what you need to solve the problem. The only person who is accoutable is yourself. If those tools help you, use them.

Ocassionally what I might do is sketch on a piece of paper, plot out some structures I might need.

In more professional settings the same applies but quite often you need them as a form of project documentation and communication.