programming Hot

ajsadauskas, to opensource
@ajsadauskas@aus.social avatar

I'm thinking seriously about getting Google out of my life, and trying NextCloud.

Looking to get a personal account through a managed provider.

Does anyone have any experience with it?

How does it compare to ownCloud?

Any hosts I should look at or avoid?

Any apps I should get for it, or avoid?

Any issues I should be aware of before I switch?

@asklemmy

anders,

@ajsadauskas @asklemmy Nextcloud is a lot better than owncloud IMO

aodhsishaj,

Immich to an NFS share that’s exposed to the nextcloud container is very seamless to the end user and can be setup in the external sources in the nextcloud web gui.

joelanman, to programming
@joelanman@hachyderm.io avatar

missing from native Node - write a file and create any necessary folders in the path

fs.writeFileSync('a/b/c.txt','hello', {recursive:true})  

joelanman,
@joelanman@hachyderm.io avatar

@jscholes ah you're right! I was sure it threw an error but recursive: true doesnt, thanks!

joelanman,
@joelanman@hachyderm.io avatar

you can do this, thanks @jscholes

const filepath = 'a/b'  
fs.mkdirSync(filepath, { recursive: true })  
fs.writeFileSync(filepath + '/c.txt', 'hello')  
NorthBayPython, to python
@NorthBayPython@social.northbaypython.org avatar

Did you know sold out of tickets today?

Don't worry, there's still plenty of great local local regional events all around the US that you can attend.

(Northern California) is on in late June, and we have tickets on sale right now, and maybe even a program to share soon too. All the details are at https://northbaypython.org

menelion, to php
@menelion@dragonscave.space avatar

Dear community! Could someone with power please raise an RFC to make the strict parameter of the in_array() built-in function true by default? It's really annoying to remember putting true as the third parameter every time, and not doing it might potentially lead to weird bugs. Thanks!

menelion,
@menelion@dragonscave.space avatar

@Crell Then at least for version 9 maybe? BTW, I'm honored to receive a reply from you, Larry. Are there any justified uses of false there, maybe you know better than me?

Crell,
@Crell@phpc.social avatar

@menelion Even in v9, that change would break any existing in_array() call where the dev is relying on non-strict behavior. It's impossible to know how many hundreds of thousands of lines of code that is.

I'm a strict typing fan, so I have no use for false there. But IMO the answer is to move away from arrays and build a proper collection trio that is strict by default. (Sequence, Set, and Map, as separate things.)

hugovk, to python
@hugovk@mastodon.social avatar

I just kicked off PyCon 2024 with the first talk of the Language Summit (and my first talk at PyCon!): "Should Python adopt CalVer?" It was an interesting discussion, let's see!

The view of the language summit from the lectern.

tintvrtkovic,
@tintvrtkovic@mastodon.social avatar

@hugovk don't see any downsides to the proposal

hugovk,
@hugovk@mastodon.social avatar

@jarofgreen The Language Summit isn't recorded, but there'll be a blogpost, and if we go ahead there'll be a PEP and discussion thread.

blindcoder, to python
@blindcoder@toot.berlin avatar

Why exactly have I NOT been writing python scripts for the last 10 years?

bmaxv,
@bmaxv@noc.social avatar

@treyhunner @blindcoder

Having a requirements.txt is good.

version pinning is another of those debatable practices.

You should do if it is more important to you that things keep working, than being up to date.

Usually, newer versions have more features, fixes, sometimes they boost performance and if they break things, the authors usually have good reasons for breaking things.

E.g. running a business tool or website should have pinned versions.

treyhunner,
@treyhunner@mastodon.social avatar

@bmaxv @blindcoder agreed on version pinning being somewhat debatable. It also depends on the package. For Django, I know they break things between minor versions but but micro ones do I'd pin to a version range. Some packages pretty much never break things and others are a mixed bag.

brotkrueml, to php German
@brotkrueml@phpc.social avatar

München vom 13.-15. September 2024

✅ Supporter-Ticket
✅ Bahnfahrt
✅ Unterkunft

Wir sehen uns 🚀

https://www.typo3camp-muenchen.de

driscollis, to python
@driscollis@mastodon.social avatar

A common task of a programmer or engineer is to split an absolute path into the directory name and the last part of the path, which could be a file or folder.

You have two options in :

🐍 os.path.split
🐍pathlib

Here are the two approaches:

image/png

ThePSF, to python
@ThePSF@fosstodon.org avatar

📣Attn📣 @pycon US attendees: we've got a bunch of fun stuff planned for the PSF booth! Make sure to stop by starting tomorrow at the Opening Reception 🐍🎉

Look for posts over the next couple of days about everything you can do at our booth 🍪🖌️📸

pixel, to programming
@pixel@social.pixels.pizza avatar

Parsing JSON Data is a fundamental in modern SwiftUI apps. This comprehensive guide covers all the aspects of the Codable protocols in Swift.


https://matteomanferdini.com/swift-parse-json/

davidbures,
@davidbures@mstdn.social avatar

@pixel Jk on the picture, this is probably the best guide I’ve seen so far. I’ve been struggling with adopting Codable for years

lordmatt, to php
@lordmatt@mastodon.social avatar

Please don't judge me. I just added two #singletons to this project of mine.

#PHP #code

Crell,
@Crell@phpc.social avatar

@lordmatt Shame! Shame! Shame!

adamchainz, to python
@adamchainz@fosstodon.org avatar

A pattern I’ve recently enjoyed using:

  1. Change some function in a way that needs fixes to call sites.
  2. Run the whole test suite with pytest.
  3. Copy the list of failing test IDs from pytest’s summary into a scratch file.
  4. Fix up the found callers.
  5. Verify everything fixed by saving the list of tests with: pytest $(cat scratch/testids.txt)

watte,
@watte@norden.social avatar

@adamchainz like --lf but without excluding successful tests the next time? Seems nice :)

adamchainz,
@adamchainz@fosstodon.org avatar

@watte Yes, and allowing partial test runs in step four whilst fixing up certain callers.

sinbad, to cpp
@sinbad@mastodon.gamedev.place avatar

Ooh, I do like the new "Sticky Lines" feature in Rider 2024

derAnhaltiner,
@derAnhaltiner@troet.cafe avatar

@sinbad yeah. That's pretty cool. 👍🏼

nanorepublica, to django
@nanorepublica@indiehackers.social avatar

📣 Common Django Project structures - Part 3
📄 A very simple setup, useful for demos or very simple prototypes
🔗 https://softwarecrafts.co.uk/100-words/day-91
,,

ghickman,
@ghickman@mastodon.social avatar

@carlton I knew you’d say that! Soon… maybe. I have a feeling it might be contentious 😬

carlton,
@carlton@fosstodon.org avatar

@ghickman I hope so. 🍿

Python is great, but stuff like this just drives me up the wall (lemmy.world)

Explanation: Python is a programming language. Numpy is a library for python that makes it possible to run large computations much faster than in native python. In order to make that possible, it needs to keep its own set of data types that are different from python’s native datatypes, which means you now have two different...

grusp, to php Italian
@grusp@phpc.social avatar

📣 Less than 24 hours to the 21st edition of @phpday ! It is the oldest php conference in Europe!

:elephpant: Last chance to get your ticket, online or in-presence!

➡️ https://2024.phpday.it/tickets/

🇮🇹 See you tomorrow in Verona, Italy and online!

sebastian,
@sebastian@phpc.social avatar

@grusp @phpday Have fun!

pierstoval,
@pierstoval@mastodon.social avatar

@grusp @phpday Omg, that lineup! I so much wish I could be there but I can't 😭😭😭

sebsauvage, (edited ) to Java French
@sebsauvage@framapiaf.org avatar


Si vous cherchez un JRE/JDK pour une plateforme précise sans avoir à vous faire chier avec le site immensément casse-gonades d'Oracle, vous pouvez télécharger ici les OpenJDK.
Il y a également les anciennes versions de Java jusqu'à Java 8.
https://adoptium.net/fr/temurin/releases/

yac,
@yac@mamot.fr avatar

@sebsauvage https://sdkman.io/ pour pas se prendre la tête (mais pas de Java 8)

sebsauvage,
@sebsauvage@framapiaf.org avatar

@yac
Tiens ça ne je connaissais pas. Pas mal.

bbelderbos, to python
@bbelderbos@fosstodon.org avatar

tip: random.choices can be used to generate random samples with bias.

The weights parameter can be used to specify the probability of each item being chosen which is proportional to its weight relative to the sum of all weights.

Here is a simple example:

bbelderbos,
@bbelderbos@fosstodon.org avatar

Sign up for our weekly newsletter and get our ebook for free containing 250 more Pythonic code examples. 🐍 😍 💡 📈

http://pybit.es/newsletter/

danjac, to django
@danjac@masto.ai avatar

I keep writing "quertyset" instead of "queryset" when writing , like I'm just hitting the first 5 keys of my laptop each time

carlton,
@carlton@fosstodon.org avatar

@danjac you like it strongly typed? 😜

danjac,
@danjac@masto.ai avatar

@carlton 😆

igalia, to opensource
@igalia@floss.social avatar

Second day of the 2024 at our HQ. We have a mix of on-site 🪑 and remote 🌐 participants and we're always amazed at how putting people together in a room, virtually or not, can drive discussions forward! 💬🗨️ display stack FTW!

  • All
  • Subscribed
  • Moderated
  • Favorites
  • Leos
  • mdbf
  • magazineikmin
  • thenastyranch
  • Youngstown
  • osvaldo12
  • rosin
  • slotface
  • ngwrru68w68
  • InstantRegret
  • PowerRangers
  • kavyap
  • tsrsr
  • DreamBathrooms
  • tester
  • everett
  • hgfsjryuu7
  • khanakhh
  • GTA5RPClips
  • vwfavf
  • Durango
  • cubers
  • tacticalgear
  • ethstaker
  • cisconetworking
  • normalnudes
  • modclub
  • anitta
  • All magazines