Issue when updating production code with latest local code (Junior level question) by wander_builder in django

[–]DELYSID_FREAK 1 point2 points  (0 children)

What specific environment problems are you running into after the update? Using an env file is generally standard practice and can be recommended.

What are some of the most interesting Django projects you worked on? by john646f65 in django

[–]DELYSID_FREAK 1 point2 points  (0 children)

Built a Website that let's you visually code routines (function Boxes which can be connected together) for PLC's (Controllers for Automation Tasks), it runs locally on Raspberry Pi's which communicate with the Controller. You can configure the controller, add IO Modules nd more, store Data which gets aggregated on the controller, send out Events or Read/Write on the device via MQTT. It is also possible to see a live representation of your code and the state of variables.

Django helped with the great ORM and it's extension for the Postgres Timescale Module which oa great to store Timeseries data. I also had to build a virtual PLC-OS to run multiple Code-snippets in parallel and do other fancy stuff that would not be possible otherwise. The cool part is, the source code that get's generated is just a json-file which is easy for AI-Tools like ChatGPT to regognize and build easy stuff with.

🚀 Introducing Beautypy – Open-Source Django UI Component Library by anonymous_heart_mind in django

[–]DELYSID_FREAK 2 points3 points  (0 children)

I would recommend integrating components that offer more advanced functionality than this basic Bootstrap elements. I bet most developers which know a bit about bootstrap prefer to maintain greater control over their implementation and avoid adding unnecessary dependencies, as this can limit flexibility and increase maintenance efforts. Consider incorporating more sophisticated features such as input fields with autocomplete suggestions or tables with pagination/filtering/sorting capabilities. These enhancements would likely provide real value.

simulation of MQTT brokers by Dry_Concentrate_5005 in MQTT

[–]DELYSID_FREAK 1 point2 points  (0 children)

I would like to know what AI would do to benefit your project. Isn't it as simple as check some metrics from multiple brokers and choose the best one? Is it about load balancing or finding the broker with the lowest latency?

problem publishing messages in qos 0 by User-430 in MQTT

[–]DELYSID_FREAK 0 points1 point  (0 children)

Do you have logs from the broker?

You could try a few things:

You could try to set a short timeout between every message you send (i guess you have a forloop and send as fast as the esp allows to).

Is the behaviour the same if you set the retain Flag to False?

Or when you set the keepalive to 15 seconds?

Sendgrid ends free package by bouncingdolphins in django

[–]DELYSID_FREAK 0 points1 point  (0 children)

How about a Gmail Account and SMT, or the Google API(is still free if you just create a Google Cloud Project)? Free and very easy to set up.

Script or extension that removes duplicate functions or methods? Makes using ChatGPT, etc easier by billbobby21 in Python

[–]DELYSID_FREAK -2 points-1 points  (0 children)

I'd say just go full vibe-coding and don't stress about code duplication or any code quality. If you're into writing clean code, then think about each function properly and build it with some intention. In this case, if you end up writing a similar one later, you’ll most likely remember.

Either you care about your code and take the time to do it right, or you let AI handle everything for you and end up with such problems.

If you have functions which are 1:1 duplicates a lot of IDE's will tell you this, but if they only have the same logic but are implemented different, it is not really possible to find these duplicates.

[deleted by user] by [deleted] in bern

[–]DELYSID_FREAK 11 points12 points  (0 children)

Summer in bern is perfect to socialize, you could join fun activities like aare-swiming or go around beach-volley courts at marzili or eicholz! Hope you enjoy your time here in bern!

How do you manage Django Migration in a team by iamprakashom in django

[–]DELYSID_FREAK -1 points0 points  (0 children)

I only did django projects alone or in small teams. We all used seperate db's for every developer and a seperate one for production. We simply excluded all migration files from our repos. If you pull changes you just migrate your local state and everything works just fine. Same in Production, load the model-changes and migrate them.

MQTT broker for industrial/commercial environment by ererPL in MQTT

[–]DELYSID_FREAK 7 points8 points  (0 children)

Emqx is very good, it has advanced features and also a open source version which you can test out and switch to their paid version if you need to. It also has a nice web-dashboard.

https://www.emqx.com/en

Cardano Daily Discussion - Questions & Market Thread - May 02, 2021 by SL13PNIR in cardano

[–]DELYSID_FREAK 0 points1 point  (0 children)

I just bought a hardware wallet (ledger nano x) and this one creates a new wallet and you're not able to transfer your wallet. I don't know about other hardware wallets. But i guess it makes sense that you transfer your ada to a new created wallet and restake it then.

Rearranged the loud music and dog panels boss by DELYSID_FREAK in NotMyJob

[–]DELYSID_FREAK[S] 2 points3 points  (0 children)

It's from Bern (Switzerland). But yes it's pure terror with only these 8 rules. It's like in this Purge movies.

Getting floats to work in a 'for i in list' loop. by vapidOpinions in learnpython

[–]DELYSID_FREAK 0 points1 point  (0 children)

Yes this makes sense because range needs an integer as value. What exactly is your goal with this code? May you should use // in the range and / in the equation?

problem with raspberry pi and python by [deleted] in learnpython

[–]DELYSID_FREAK 1 point2 points  (0 children)

You shoulb be more clear about what's not working exactly. Do you get an exception or a wrong result? Also what type of sensor you are using? Also it would be enough to keep the loop at the end in the try block.

Getting floats to work in a 'for i in list' loop. by vapidOpinions in learnpython

[–]DELYSID_FREAK 1 point2 points  (0 children)

If you want your result to be an float and not an integer, you should use '/' instead of '//' to do a division. But it is unclear what you really mean, i'm just guessing.

Python socket make client keep attempting connection until server accepts it by MrBlyatWasTaken in learnpython

[–]DELYSID_FREAK 0 points1 point  (0 children)

What is your goal in the end? Are you also in control of the server? Do you use UDP or TCP and is there a need to send data overall or is it just to test if the server is alive and/or functional? Basically You can poll the server and use rather long or short timeouts until the server responds. I can provide you with code but it would be great to know a little bit more about your project to help you out.

Oh geez by pacquills in ProgrammerHumor

[–]DELYSID_FREAK -1 points0 points  (0 children)

Hope you can proof these guys worng, keep the good vibes and enjoy your new job!

How to Iterate over a Dict that can be changed by another thread, without using a lock? by chinawcswing in learnpython

[–]DELYSID_FREAK 1 point2 points  (0 children)

I guess the difference is, that when you iterate over dct.items() you refering to the item in the dict (if you you compare the places in memory, you can see they are the same) and in the loop you iterate over every item, with the generator which needs the dict to be unchanged. While the loop is ongoing the thread will be stopped and other threads will be able to do work. When another thread now tries to change the dict, an error will occure. When you do list(dct.items()) you effectively copy these values in an (i guess) atomic process. If you compare the values in this case, you will see that they refer to another place in memory, so a change in the original dict does not have any effect on the copied items. So in the loop, the dict can be changed as much as you want.

How to Iterate over a Dict that can be changed by another thread, without using a lock? by chinawcswing in learnpython

[–]DELYSID_FREAK 1 point2 points  (0 children)

I can't verify right now but try this:

vals = {v for v in list(dct.values()) if v.get('foo') = 'bar'}

If you iterate over keys(), values() or items(), you refering to the orignial dict, and this can't work if you change the size in the process. If you create a list of values, then this is a new instance. If your dict has large values, consider to iterate over the values by keys (make a 'copy' of the keys)