Skip to main content

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.


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.

#Gentoo #Python


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.

#Programming


๐Ÿง… #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/


#Fortran #COBOL #PL1 #APL #Snobol #algol60 #lisp #basic #jovial #pascal #python #java #c #cpp #plsql #perl #forth #ada #tcl

I worked with #prolog and could do maintenance on the code, but couldnโ€™t really create from scratch.

I started in the 70โ€™s, IBM 1620 assembler.


#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.


#Basic, #COBOL, #Fortran, #Algol (+68), #Lisp, whatever the assembly language for the #PDP11 was called, #360Assembler, #Perl, #Python


I also started in the early 1980s, #BASIC, #COBOL, #FORTRAN, #C, VBScript, #python mostly


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?

#programming #software #OpenSource


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

https://wp.me/p5cs3g-4HT


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

#XFS #ZFS #APFS


You can use a programming language like #PHP, or maybe #Perl if you're feeling a bit more adventurous! No #Python though, and no #Javascript either. Those are the devil's languages.


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.

#Gentoo


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.

https://www.reddit.com/r/Astrobiology/comments/1caudbn/can_telescopes_actually_find_biosignatures/l0vzq3e/

#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.

#perl #python #ate #lunch


I really despise that Pythonโ€™s timezone aware times are the same type as its timezone naive times.

#python


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

#WeeklyChallenge #PerlWeeklyChallenge


Some basic stat computations with Perl , Python and RLessons 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.
Well even in these case, the choice of the generator did matter. Note that the fully vectorized #PDL #perl versions were faster than #rstats

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

https://preview.redd.it/qn00sx78gbuc1.png?width=1538&format=png&auto=webp&s=1874b9e710c239e9acea36fb54d957167a69b270

https://preview.redd.it/4by4jbh9gbuc1.png?width=1538&format=png&auto=webp&s=dc9944347983445126e4ab57b43c76202ca719d6

submitted by /u/ReplacementSlight413
[link] [comments]


Anyone know if a (space) indent width could be specified for #Python code formatters like Black (or Blue or anything similar not in Rust|Go)?

If nothing would come up, then might just hack up Black.

I have tried #YAPF but it has ... some other issues.


@dch On a related note: I can't tell you how many times I've typed the following:

pythong path/to/program

I have NO idea why I do that. It's not like I ever type "thong," but my fingers are hallucinating programming languages.

#Python


Computer Science professor Bob Fulkerson joins the show to discuss his BBS days including his stewardship of the Endless Forest BBS in Omaha. Bob also discusses facets of teaching Computer Science and his love for the Perl programming language.
#bbsing #perl #python

https://sites.libsyn.com/481983/bob-fulkerson-discusses-the-endless-forest-bbs-and-computer-science-academia


I *really* wish #Perl had the magic methods from #Python. This would make so many problems in Perl much easier to solve.


I want one make my work portable so that I can work on any OS, such as #fedora #linux, Mac or Windows. I work a lot with #Python and #Postgres. What is the best way to set up a portable workflow?


@homeassistant

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


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.


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.


But invalid json files may execute arbitrary python code.

๐Ÿ˜›

#python


Tritium on #python IRC channel ...

ใ€Žjson files are valid python that wont raise an exception if you execute it as pythonใ€


Is it too late for #ILoveFreeSoftwareDay? Just want to give a shout out to all the #FreeSoftware out there that enables #FreeSoftware: all the compilers (such as #gcc, #llvm, #rust) and assemblers (such as #nasm), the version control (#git) and interpreters (such as #Python and #Perl) and all the build systems. Thanks for enriching my life!


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).

#Textual #Python

https://github.com/textualize/toolong


#Python : Batteries included

#Perl : Flint and tinder included

#Java : PHB included

#PHP : Notepad included

#C : Screw you

#Rust : Arcane eldritch data guardian forbidding memory blasphemy included.


@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.โ€


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.


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.

#LLM #Copilot #ChatGPT


How Programming Languages Got Their Names

#haskell #java #kotlin #python #ruby #rust

https://kylehigginson.medium.com/how-programming-languages-got-their-names-df85277de4c3?utm_medium=erik.in&utm_source=mastodon


@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.


@mjgardner Here is the problem: need to deduplicate a massive dataset that cannot fit in memory. #Perl script (on an AMD RYZEN server) about 3.7 sec for 2M rows (1/1000th of the dataset), #Python 3.4 sec, #clang (using the glib hash) about 2.8 sec. Perl actually faster than Python at 1M rows, but the larger the chunk the faster some downstream tasks will run (and the 2M is about the optimal size for this project). The 40% improvement (if verified) kills both C and Python


There is a meltdown in the bioinformatics community about #python now for the same reasons. The stuff I wrote 20+ years ago for my PhD in #Perl & #swig still work (after installing a modern version of PerlMagick)


@jack @nobodyinperson @SReyCoyrehourcq This is the main reason I avoided using #Python for a production code almost 20 years ago.
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?


@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 ๐Ÿ˜€


Soโ€ฆ fashion and received wisdom traced back to the turn-of-the-century boom in shitty #Perl, supported by the belief that they're protected from building a shitty melange of #shell, #sed, #awk, #Python, and #Rstats?

โ‡ง