Search
Items tagged with: python
Anybody want to do a small, paid open source development job? (feel free to boost) I am not offering huge amounts of money (maybe $200 or so?) but it's also a small job. Feel free to tell me this is not reasonable.
The job:
I use HetrixTools to monitor some servers. They offer an open-source shell script that, if you run it, connects to their API and sends detailed information, not just "we can ping your server."
That shell script supports #Linux only and relies on Linuxisms (like reading /proc
a lot). It does not support #FreeBSD. My goal is to get detailed server monitoring on FreeBSD via the HetrixTools API.
I've started rewriting it in #Python and there's a code repo where I've already done a bunch of work. I'm looking for someone to pick it up and take it over the line.
Scope
Scope of the job would be to finish the work so that, when run interactively at a command line, it runs in the foreground in an infinite loop, collecting data, reporting it up through the HetrixTools API, and then sleeping.
I'll take on the work of packaging, making it a daemon, a FreeBSD service, and such. I'm just trying to outsource the final bits of python coding, and testing against the HetrixTools API.
Code will be released open source. I'm currently using BSD 3-Clause, but I am willing to adjust to GPL or whatever.
If you're interested, DM me. I can negotiate price a bit, but not a ton.
GitHub - hetrixtools/agent: HetrixTools Server Monitoring Agent (Linux)
HetrixTools Server Monitoring Agent (Linux). Contribute to hetrixtools/agent development by creating an account on GitHub.GitHub
The most recent #Django releases, 5.0.5 and 4.2.12 are broken. Most likely they were done on #Windows, and that obviously is sufficient to break stuff.
So far, we've noticed the following issues:
1. The directory is named lowercase `django-X.Y.Z` instead of capital-case `Django-X.Y.Z` (the filename remains capital-case).
2. All files have CRLF line endings instead of LF.
3. All files that should have the executable bit, have lost it.
As a result, the releases don't pass their own tests.
I hope to report this upstream, but their Trac is down now. So you can't even download the releases right now.
In #Python, this is a useful and common idiom:
if __name__ == "__main__":
...
But it silently fails if __main__ is misspelled and it's extremely non-obvious to new developers. I'd prefer for this common functionality to be baked into the language:
if running_as_script():
...
Now, it's completely transparent what it does and if you misspell the function, it doesn't silently fail. It kinda feels wrong to have a weird special case in the language, but it's so ubiquitous.
๐ง #Tor Project Seeks Network Health Engineer ๐งโ๐ป
The person in this position will work directly with helping us maintain existing systems, and design new systems for gathering and analyzing Tor network data.
The bulk of our code is currently written in #java, smaller portions are written in R, #Python, PostgreSQL, and JavaScript. We are transitioning to a new pipeline mainly in #Rust and Python.
This is a full-time remote position.
#job #FediHire #fossjobs #foss
https://www.torproject.org/about/jobs/network-health/
The Tor Project | Privacy & Freedom Online
Defend yourself against tracking and surveillance. Circumvent censorship.www.torproject.org
#BASIC, 6502 #assembly, #Pascal, #Delphi, #Perl, #Bash, #Javascript, finally #ABAP.
I've looked at #Java and #Python several times but can't get on with Java at all.
My job is 50% ABAP and 50% trying to understand what the client needs and not what they say.
Loved BASIC on my old C64, and have a soft spot for TuboBASIC and TuboPascal. Did a lot of Perl and found it good for what I wanted, but not used it much of late.
I started programming in 1982. Though I'm known as a #Perl developer, I tried to remember every other language I've programmed in.
#BASIC, #C, 6809 Assembler, #Javascript, VBScript (and its many variants), #Java, #Prolog, #RakuLang, #Python, #Kotlin, #COBOL, Easytrieve, and probably a few others.
I wish I had gotten a job in Prolog, primarily because I loved what I could create with it. I don't love programming; I love creating.
What are your languages?
Very thoughtful post.
As for #Perl, it hardly โstopped at version 5.โ (See @shiarโs summary of changes from Y2Kโs 5.6 to last yearโs 5.38: https://sheet.shiar.nl/perl.) There simply hasnโt been major breaking changes, unlike, say, #Python.
The community also lacks consensus on the marketing value of a new major version. Some software releases just merrily keep incrementing that number to draw attention and create FOMO, semantic meaning be damned.
A few thoughts on Programming languages
Just a few thoughts on programming languages that have been rattling around in my head this week, but which donโt each merit a full blog post. The main theme is that the culture behind each programming language leads to some interesting choices, as is the case with spoken languages.
This week I started learning how to program in Rust. Even though Iโm using the project-based Command-Line Rust to learn, the author still went with the traditional โHello, world!โ project for the first intro to the language. I was also working on a Go project last week and so it immediately stood out to me that (at least as taught by this author) Rust has the print! macro that allows you to succinctly print to the command line. By contrast, Go requires importing fmt before you can print. This was the first topic that was swirling around in my head this week. What makes language designers choose whether printing output (one of the most basic things a program can do) is built-in or requires an import. I even remember back when I was learning Java in undergrad (I think it was Java 1.8, but I donโt remember) we had to use the savitch library just to get program input (another very basic computer program concept). As I thought about it, I wondered if it has to do with thoughts around compilation and whether the language designers think youโre mostly making user-interactive programs or libraries? It makes sense to me that scripting languages like Python, Ruby, and Perl would have print built-in since you always have to have the interpreter along with you, so all the basics should be there. (The original Batteries Included Python promise, for example) But perhaps the Go developers thought you wouldnโt always be printing to the command line so a more efficient binary could be compiled by forcing you to import the functionality? Iโm not entirely sure.
The next thing I started thinking about, again due to learning Rust, was the mutability of variables. In most languages Iโve come across (I think all, except Haskell) all variables are mutable by default. It almost seems pointless to have a non-mutable variable. I understand why many languages have the concept of a โcontanstโ modifier/keyword. Unlike normal variables, THIS ONE does not change. But the opposite seems so weird since most of what we often do in programming involves changing the value in a variable. Perhaps as I learn more about Rust, Iโll understand their reasoning, but this seems completely backwards to me.
Both Rust and Golang use structs to organize variables where Ruby, Python, and Java use objects. But when both Go and Rust allow you to โattachโ methods/functions to structs โ is there a true distinction between object-oriented programming and struct-based programming? It seems like itโs just semantics (in the generic sense of the word) โ at least at the level at which I program. The only difference I can see is that structs donโt have inheritance, although Goโs โtypesโ solve some of the same problems.
Todayโs (the day Iโm writing this, not the day itโs going to be posted) shower thought was about programming language versions. On one end you have Java (I think now on version 22) and C# (now at version 12). On the other you have Python and Ruby (both at version 3). Perl essentially stopped at 5 with Perl 6 evolving into Raku. I donโt know what Java is up to. But I think C# is actually using the versions correctly โ Iโve heard that each version introduces completely different ways of doing things and that the way you program C# depends strongly on when you jumped in. This is why Python is probably never moving to v4 unless they need to make some kind of huge change. Rust is an outlier with year-based versions. I guess thatโs fine, but doesnโt tell you anything like a proper semantic versioning could.
Finally, I know that Rust is the newest of all the programming languages Iโve learned, but I really love how new projects are started. Python isnโt horrible, but itโs currently suffering from a lots of ideas, none of which has complete market share. You could do a simple virtual environment or you could do a more complex virtual environment/lock file situation with Poetry. (And there are about another half dozen variations on these two themes) But Rustโฆ.Rust deserves a chefโs kiss. When you start a new project with โcargo new project-nameโ, not only does it set up your directory structure, but it does a whole bunch of great setup tasks. It creates your Cargo.toml file (with Python, which only really started supporting toml files at the project level a few years ago, you need to look at documentation to figure out what goes in there) so that you have all the basics in there already. But it doesnโt stop there! It also, in a nod to modern programming, creates a git repository AND a gitignore file. Itโs a thing of beauty. I would absolutely love for Python to move in this direction officially (not through a random user choice) for their defaults. Even โgo mod initโ could benefit from setting up a git repo and a git ignore (since the toml is not how Go works โ I think they would probably best set up a README.md since Goโs default packaging is through git repos).
#Go #Golang #perl #python #Ruby #rust
A few thoughts on Programming languages
Just a few thoughts on programming languages that have been rattling around in my head this week, but which donโt each merit a full blog post. The main theme is that the culture behind each programโฆIt's A Binary World 2.0
An experiment with creating files with invalid UTF-8 names & trying to read in #Python ...
Invalid-UTF8 vs the #fileSystem, 20230914,
by Kristian K,
https://blog.koehntopp.info/2023/09/14/invalid-utf8-vs-the-filesystem.html
How is it ridiculous? Out of these three languages, #Perl has several decades of backwards compatibility, and a huge stable ecosystem.
Despite #Python's claims to having one way to do any one thing, it is very inconsistent and has how many ways to format a string now? Last I checked, the performance was also several leagues behind Perl, despite getting a lot more funding these days, and a lot more attention publicly.
#Javascript is a massive issue with accessibility wherever its introduced, and having it enabled is a sure-fire way to support the online malware industry. And there's NPM of course, the least consistent, reliable package ecosystem known to the field of programmer's. They can just yank a package which is required for comparing if a value is even or odd, because something like that is a very difficult concept in programming languages apparently, and break half the projects in the world.
Perl too has it flaws, of course, but it is still actively developed, and having used all these three languages professionally, I can say with confidence its the least "annoying" out of all of them. Any package I pull from CPAN is small and focuses on doing its one job well, and I don't even need to create a special environment for every single project that has dependencies. The language writes in a natural fashion which is a very enjoyable experience, one which most developers skip because it is simply not popular, and people like you laughing in the face of anyone who even dares suggest it is not as bad a language as is advertised by the masses.
I wonder, have you ever written Perl in a professional capacity, or at all, even?
One would assume youโre trying to be โedgyโ by making such silly commentsโฆ
One who is inexperienced and unwilling to learn, maybe. Anyone else would be interested in why I recommend an increasingly unpopular language.
Essentially, distro developers are firefighters, putting out fires made by careless upstreams.
What I've wasted time on, today:
- making the non-standalone test suite of #Hatchling (sigh) work without #UV again, so that a critical build dependency of a growing number of #Python packages could be tested everywhere
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cc6e54e1df5e0802198c793f39107a9028b8698f
https://bugs.gentoo.org/930662
- fixing effectively dead (but with a promise of revival) #PassLib not to break random stuff via printing warnings when using newer #BCrypt versions
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c1e015b65b74283a51893672739c5e4784b95273
https://bugs.gentoo.org/925289
- hacking the test suite of #ImageIO work using an offline copy of test data, rather than cloning its git repository at the beginning of tests
https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=77ff4bc09d68067f2c635d43d446f308990e0873
I really wish people would consider donating to distro developers more often, rather than to projects that create this thankless work for us.
repo/gentoo.git - Official Gentoo ebuild repository
Browse the Gentoo Git repositoriesgitweb.gentoo.org
Someone on Reddit was asking if there is any way of detecting something in an exoplanet atmosphere which would have no other explanation than life. I'm pretty happy with my answer.
You might be surprised that it even includes #Python code.
#AstroBiology #Science #Astronomy #Life #Software #NASA #SpaceX
Whatever happened to Perl? Back in the day it was wildly popular and was used all over the place. Then there was supposed to be a big rewrite for Perl 6 and that's the last I've ever heard of it. No news, no releases, nothing. For me Python came in and ate Perl's lunch, so I don't miss it at all. Python is better in every way for me. Honestly Perl was a horrible language, but still interesting to see it die so suddenly.
I really despise that Pythonโs timezone aware times are the same type as its timezone naive times.
You can follow @theweeklychallenge.org, which I just set up to post the #RSS feed from https://TheWeeklyChallenge.org
Itโs a successful site run for the last five years by #Perl and #RakuLang developer @manwar thatโs also had thousands of entries with other #programming languages like #Python, #Ruby, #Haskell, #RustLang, #Lua, #Clang, #CPlusPlus, #JavaScript, and #GoLang
Lessons learned: A) Performance freaks to stop using #rstat 's runif for random generation. The Hoshiro random number generator https://arxiv.org/abs/1805.01407 is 10x faster. Implementations in #perl 's #PDL, #rstats (dqrng) and #python #numpy are within 20% of each other B) But does it make a difference in applications? To get to the bottom of this, I coded a truncated random variate generator in #rstats and #perl using #pdl (as well as standard u/perl) using the #GSL packages https://metacpan.org/pod/PDL::GSL::CDF & https://metacpan.org/pod/Math::GSL for accessing the CDF & quantile functions. In this context, it's the calculation of the #CDF that is the computationally intensive part, not the drawing of the random number itself. C) I should probably blog about these experiments at some point. Note that #pdl (but not base #perl) are rather competitive choices for large array processing with numerical operations. I mostly stay away of #python , but would not surprise me that for compute intensive stuff (where the heavy duty work is done in C/C++), it does not matter (much) which high level language one uses to build data applications submitted by /u/ReplacementSlight413 |
mstdn.science
http://mstdn.science is a place for people our field (microbiology), scientists in general, and science enthusiasts to discuss research and topics surrounding our work.Mastodon hosted on mstdn.science
If you're managing HA Core in a FreeBSD jail, I've made some notes about a way to manage the Python virtual environments and upgrade to new releases of HA.
https://blog.brendans-bits.com/posts/2024/upgradable-home-assistant-in-a-freebsd-jail/
#homeassistant #bastillebsd #freebsd #python
FreeBSD Jails: Making Home Assistant and Python upgradable
Making it easier to install new versions of Home Assistant and Python in a FreeBSD jailblog.brendans-bits.com
It's a small patch to Apple's #OpenSource MLX machine learning framework to fix a minor nit that annoyed me, but I was happy to have my first PR accepted against a Python project. (https://github.com/ml-explore/mlx-examples/pull/458#event-11856417623).
Still happily doing #Perl, but #AI is #Python all the way.
Make it easier to know in which file we have bad JSON data by Ovid ยท Pull Request #458 ยท ml-explore/mlx-examples
I was using lora.py to train Mistral and accidentally used corrupted JSONL files. My traceback looked like this: Traceback (most recent call last): File "/Users/ovid/projects/llms/mlx-examples/l...GitHub
That's certainly true.
The flip side is, how easy is it to write good code, especially for less experienced devs?
For example #perl programmers seem more likely to misuse regexes than #python programmers. Should we blame the language for that? Probably not. But the culture around it (tutorials, popular libraries, etc.)? I'd say so.
Tritium on #python IRC channel ...
ใjson files are valid python that wont raise an exception if you execute it as pythonใ
About half a year ago I wrote myself a little #python script to automate #wikipedia #translation via #deepl.
Tried to use it on my second ๐ป today, to no avail and much grinding of teeth.
I'm not setting up any more #venv . I'm fed up. I'm bloody rewriting everything, even libraries in #perl so it works proper on #unix damn it. And maybe throw a look at some #zig porting while at it.
The Kookaburra is out of the bag.
Checkout Toolong, a terminal app for viewing / tailing / searching log files (and .JSONL).
https://github.com/textualize/toolong
GitHub - Textualize/toolong: A terminal application to view, tail, merge, and search log files (plus JSONL).
A terminal application to view, tail, merge, and search log files (plus JSONL). - GitHub - Textualize/toolong: A terminal application to view, tail, merge, and search log files (plus JSONL).GitHub
@AFresh1 Yes, because you care about distributing code that others *donโt* need a separate virtual #Perl environment to run.
Nearly every set of end-user installation instructions for #Python-based applications begins with steps to give the app its own virtual environment with separate interpreter and dependencies.
/cc @ology @profoundlynerdy @bololacertus @overeducatedredneck @fuzzix
Direct (non-LinkedIn-shortened) link: https://catonmat.net/ftp/perl1line.txt
Iโm also pleased that its author ranked Perl as one of his top 5 best #programming languages: https://catonmat.net/5-best-programming-languages
1. #C / #Clang
2. #PHP
3. #Perl
4. #GoLang
5. #JavaScript (but only version 1 circa 1995 plus #jQuery)
His 5 worst? https://catonmat.net/5-worst-programming-languages
1. #Haskell
2. #Rust / #RustLang
3. #CPlusPlus
4. #Python
5. modern #JavaScript
โMy only metric... is time to get things done and ship to customers.โ
Top 5 Best Programming Languages
This is the reverse post of my highly popular Top 5 Worst Programming Languages post. My only metric for a good programming language is time to get things done and ship to customers. I don't care about anything else.catonmat.net
For any #Python devs working with Qt who've stumbled on the "Megasolid Idiom" text editor example (https://www.pythonguis.com/examples/python-rich-text-editor/), you might be disappointed that it's written in PyQt5, when PyQt6 is available.
I've ported it to #PyQt 6 for you: https://github.com/Ovid/pyqt6-rich-text-editor
It's still a bit of a hack since I just did a straight port with some minor cleanup. It needs tests. It also needs bars for adjust margins, but despite my searching, I can't figure out how to do that.
Writing a Rich Text Editor in PyQt5
Simple WYSIWYG editor in Python. Megasolid Idiom is a rich text word processor implemented in Python and Qt.Martin Fitzpatrick (Python GUIs)
For anyone working with generative #AI to write software, you might find this bug and subsequent comments on the VS Code Copilot integration interesting.
https://github.com/microsoft/vscode-copilot-release/issues/800
After writing small programs with AI, I decided to see if I could write a large, professional application. It's in a problem domain I know very well, using technologies I don't know (the #python PyQt6 library).
The short verdict: not ready for prime time, but the technology is getting there.
workspace suddenly stopped working ยท Issue #800 ยท microsoft/vscode-copilot-release
I've been using @workspace heavily for a Python project. Suddenly, it now longer works and cannot figure out what workspace information to collect. I have tried restarting VS Code a few times, but ...GitHub
How Programming Languages Got Their Names
#haskell #java #kotlin #python #ruby #rust
How Programming Languages Got Their Names - Kyle Higginson - Medium
Have you ever wondered how the likes of Python or Java got their names? Letโs take a look at some programming languages and the story behind how they were named. Before we start โ If youโre curiousโฆKyle Higginson (Medium)
@bololacertus @overeducatedredneck @profoundlynerdy Put another way, `checkbashisms` exists because the only way to get #shell scripters to stick to strict #POSIX syntax and userland programs is to automatically reject deviations with extreme prejudice.
And please donโt get me started on #Python portability. Yโall canโt even settle on how to manage the virtual environments that every individual Python-based tool requires.
@KC1PYT โRecentโ is in the eye of the beholder. I havenโt personally used #WebPerl, but it appears to be based on a slight fork of #Perl v5.30 from 2019: https://github.com/Perl/perl5/compare/maint-5.30...haukex:emperl5:emperl_v5.30.0
As with anything, it needs someone with an itch to scratch and enough skills and tuits. The primary author is employed doing #Python now, so it's a fine time to pick it up unimpeded.
Comparing Perl:maint-5.30...haukex:emperl_v5.30.0 ยท Perl/perl5
๐ช The Perl programming language. Contribute to Perl/perl5 development by creating an account on GitHub.GitHub
Any #Python fans familiar with #PyQt6 ?
I'm stumped. I'm sure I missed something obvious, but I can't tell what it is.
https://stackoverflow.com/questions/77885605/toggling-character-format-with-pyqt6
The other main reason was the availability at the time of MS-SQL DBD driver in #Perl (well it is a Sybase one, but it is perfectly the same).
People who use all that code base today still thank gosh.
Hey, #python devs. I want to be able to enforce that methods overriding existing methods raise an error if they don't have an @override decorator. Likewise, if they have that decorator and don't override a method, it should also throw an exception.
Didn't see anything which does this, so I threw this together. https://gist.github.com/Ovid/1a1d7869b29816cc4c82d00ad42aa2fc
Am I missing something obvious?
Force validation of overridden methods in Python
Force validation of overridden methods in Python. GitHub Gist: instantly share code, notes, and snippets.Gist
@MonkeyPanic I haven't had a chance to try it yet. I've been busy writing an immutable ORM for #Python to better learn the language.
Probably not the easiest project I could try, but I've done it in #Perl ๐