Programming
- What search engine do you use?
Not sure if this is the right community, but I didn't see a general one. What search engine do you use? Besides Google increasingly spying on its users, the quality of its search results seems to have gotten significantly worse over the last decade. What search engine(s) do you use?
- [History] An editor letter by Edsger Dijkstra, titled: "go to statements considered harmful" (march 1968).
In this letter, Dijkstra talks about readability and maintainability in a time where those topics were rarely talked about (1968). This letter was one of the main causes why modern programmers don't have to trouble themselves with goto statements. Older languages like Java and C# still have a (discouraged) goto statement, because they (mindlessly) copied it from C, which (mindlessly) copied it from Assembly, but more modern languages like Swift and Kotlin don't even have a goto statement anymore.
- Logging Best Practices: The 13 You Should Know (2019)www.dataset.com Logging Best Practices: The 13 You Should Know
When you search for things on the internet, sometimes you find treasures like this post on logging, e.g. creating meaningful logs. This post is authored by Brice Figureau (found on Twitter as @_masterzen_). His blog clearly shows he understands the multiple aspects of DevOps and is worth a visit. Ou...
- [Solved] Subclassing pathlib.PosixPath broken since Python 3.12 (actually its fixed, but workaround broken)
Solution was quite easy. Thanks to the user reply here: beehaw.org/comment/3535588 or programming.dev/comment/10034690 (Not sure if the links actually work as expected...)
---
Hi all. I have a little problem and don't know how to solve. A CLI program in Python is broken since Python 3.12. It was working in Python 3.11. The reason is, that Python 3.12 changed how subclassing of a pathlib.Path works (basically fixed an issue), which now breaks a workaround.
The class in question is:
```python class File(PosixPath): def new(cls, *args: Any, **kwargs: Any) -> Any: return cls._from_parts(args).expanduser().resolve() # type: ignore
def init(self, source: str | Path, *args: Any) -> None: super().init() self.__source = Path(source)
@property def source(self) -> Path: return self.__source
@property def modified(self) -> Time: return Time.fromtimestamp(os.path.getmtime(self))
@property def changed(self) -> Time: return Time.fromtimestamp(os.path.getctime(self))
@property def accessed(self) -> Time: return Time.fromtimestamp(os.path.getatime(self))
# Calculate sha512 hash of self file and compare result to the # checksum found in given file. Return True if identical. def verify_sha512(self, file: File, buffer_size: int = 4096) -> bool: compare_hash: str = file.read_text().split(" ")[0] self_hash: str = "" self_checksum = hashlib.sha512() with open(self.as_posix(), "rb") as f: for chunk in iter(lambda: f.read(buffer_size), b""): self_checksum.update(chunk) self_hash = self_checksum.hexdigest() return self_hash == compare_hash ```
and I get this error when running the script:
Traceback (most recent call last): File "/home/tuncay/.local/bin/geprotondl", line 1415, in sys.exit(main()) ^^^^^^ File "/home/tuncay/.local/bin/geprotondl", line 1334, in main arguments, status = parse_arguments(argv) ^^^^^^^^^^^^^^^^^^^^^ File "/home/tuncay/.local/bin/geprotondl", line 1131, in parse_arguments default, status = default_install_dir() ^^^^^^^^^^^^^^^^^^^^^ File "/home/tuncay/.local/bin/geprotondl", line 1101, in default_install_dir steam_root: File = File(path) ^^^^^^^^^^ File "/home/tuncay/.local/bin/geprotondl", line 97, in __new__ return cls._from_parts(args).expanduser().resolve() # type: ignore ^^^^^^^^^^^^^^^ AttributeError: type object 'File' has no attribute '_from_parts'. Did you mean: '_load_parts'?
Now replacing
_from_parts
with_load_parts
does not work either and I get this message in that case:Traceback (most recent call last): File "/home/tuncay/.local/bin/geprotondl", line 1415, in sys.exit(main()) ^^^^^^ File "/home/tuncay/.local/bin/geprotondl", line 1334, in main arguments, status = parse_arguments(argv) ^^^^^^^^^^^^^^^^^^^^^ File "/home/tuncay/.local/bin/geprotondl", line 1131, in parse_arguments default, status = default_install_dir() ^^^^^^^^^^^^^^^^^^^^^ File "/home/tuncay/.local/bin/geprotondl", line 1101, in default_install_dir steam_root: File = File(path) ^^^^^^^^^^ File "/home/tuncay/.local/bin/geprotondl", line 97, in __new__ return cls._load_parts(args).expanduser().resolve() # type: ignore ^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/pathlib.py", line 408, in _load_parts paths = self._raw_paths ^^^^^^^^^^^^^^^ AttributeError: 'tuple' object has no attribute '_raw_paths'
I have searched the web and don't understand how to fix this. Has anyone an idea what to do?
- Mind-bending new programming language for GPUs just dropped... - Code Report
YouTube Video
Click to view this content.
- https://github.com/HigherOrderCO/Bend
- https://higherorderco.com/
- Making an libncurses fronted for the Fediverse? (For browing Lemmy websites on terminal [emulators])
Can someone please help me understand how one could make his own frontend for the Ferdiverse? It seems like to run on a bespoke protocol, and has HTTP endpoints as well. The help says you can create your own frontend, divorced of HTTP. What I am wary of is the documentation being out-of-date.
So if there's a bespoke protocol, is there a middleware that translates it to HTTP requests to make it possible to run on a browser? Sorry I am very bad at web and network in general.
So to sum my question up:
1- Is there a bespoke protocol, non-HTTP, to access Fediverse?
2- Where can I lay my hands on the latest documentation for creeating a custom frontend, especially one that runs on a non-traditional 'view'?
Sorry if I mention the bespoke protocol for the third time, but what is the use of such protocol? Like is there a client for it? Or do they just mean a protocol ON TOP of HTTP? Because it would be moot. If there's an HTTP protocol I could just use libcurl. If this protocol is as 'bespoke' as they say, is it well-described? Like do they have ABNF for it?
Again I am not very good at network and web in general. This would be my first 'webapp' so to speak.
Even if such thing exists, I would wanna do it.
Thanks.
- How to conduct a software audit?
I need to help auditing a project from another team. I got the pointers on what's expected to be checked, but I don't have like templates for documents for what's expected from an audit report which also means I'm not sure what's the usual process to conduct an internal audit. I mean I might as well read the whole repo, but maybe that's too much?
Any help or pointers on what I need to investigate to get started would be great!
- How do you contribute to OSS?
So I've come to the point where I've wanted some to see some features on the software I regularly use and I feel confident enough that I can pull it off. However, once I start getting into it, it all becomes so overwhelming that it's hard to get anything done.
For instance, on more than one occasion I had trouble getting the projects to build on my machine (eg., unsupported OS, lack of documentation, etc.) and it left me unable to write a single line of code making the experience frustrating from all the time wasted that I had to move on.
Other times, I recognize some the patterns and get the general gist of some snippets, but the overall code seems so convoluted to me that I don't even know where to start to analyze a solution, even though if it'd probably take ten lines to implement.
For context, I've been more of a hobbyist programmer for the great majority of my life with a bit of schooling. I do have various finished apps under my belt so I'm definitely not new. But I have no reference for how long a feature should take to implement in someone else's code for the average Joe who does this for a living.
So I'm left wondering: What advice do you have that could make this all more accessible to someone like me? Do you have a general strategy to get started? How long does it take you from start to finish? And if you run into issues, where do you seek help without nagging the devs about their code who may take too long to respond to be of use?
Many thanks for the feedback in advance!
- Should I worry about referencing other people's code?
Thanks to the current SEO nightmare, I can no longer use search engines the same reliability as before. Stackoverflow is too toxic and often all I need is to properly look up some more obscure stuff about some API, which "could just be googled". AI, of course, is very unreliable.
Searching code on Github, then adjusting it in many ways to my needs (like to a different language, renaming variables to make more sense, additional optimizations, etc.) seems way more feasible nowadays. However, while there's a lot of code with very permitting licenses (including public domain licenses), others are not so much, and I don't want to argue against them, often I'm even understanding the reasons behind their decisions. I even try to give credit wherever I can, or look up the original source of an algorithm I find being referenced by someone else.
- [Personal project] AlgeZip: navigate and manipulate boolean expressionsgithub.com GitHub - shape-warrior-t/algezip: A boolean expression manipulation program that uses zippers for navigation.
A boolean expression manipulation program that uses zippers for navigation. - shape-warrior-t/algezip
For some time now, I've been thinking about the concept of interactively manipulating mathematical expressions and equations via software. Like doing some quick algebra in Notepad or similar, except there's no potential for arithmetic/algebra errors, typos, etc. ruining any results.
At the same time, I also wanted to experiment a bit with zippers from functional programming. You need some way of specifying what (sub)expression to perform operations on, and it seemed like this kind of data structure could help with that.
And so, I made AlgeZip, a small proof-of-concept of the whole general idea. Although this polished Python version was completed only a few days ago, there were various other versions before this one in different languages and with worse-quality code. Instructions for things are on GitHub; requires Python 3.12 to run.
For simplicity, I decided to use boolean expressions instead of generic numeric algebraic expressions/equations, and only decided to include the minimum in terms of commands and functionality. From my understanding, it should be possible to transform any boolean expression into any other boolean expression in AlgeZip (without using the
r!
command except to set things up), though I could be wrong.Thoughts, comments, and criticism on the idea as a whole, the program, or the source code are welcome, though I'm not sure if I'll be making any changes at this time.
- Start learning at 50
Start learning at 50
I've always wanted to learn programming. I've read a blog post saying that at this age it was to late . Then I read a post here in saying the opposite. I've found a site that was learn x in y minutes where it has a bunch of languages there. After reading them, the languages that caught my attention were Julia, Clojure and Go. Are any of these good for a beginner or should I start with something else? I know what are variables, can spot an if/else statement but that's about it. What are some good resources for someone like me who likes to learn by doing things?
- Public personal dev accounts: opinions?
I feel like there are many devs out there who expose a lot of personal details and opinions all over the web. Maybe it's just me, but when starting out with the internet I tried my best to separate my personal details (name, age, sex, country, ethnicity, family ties, relationship status,...) from usernames in public.
Seeing devs do it willingly and voice opinions on divisive or sensitive topics kind of messes with me. Aren't y'all afraid of missing out on job opportunities if someone reads your opinions, code, or other stuff tied to your personal accounts? Or letting anybody (maybe family, friends, acquaintances, ...) in on your personal life, mindset, opinions and other personal information?
- Justine Tunney - Redbean and the Actually Portable Executable (Speakeasy JS, May 2021) - Despite the channel, this is about a C executable that "runs anywhere", including from boot
YouTube Video
Click to view this content.
Video is nearly 3 years old now, but I think it's worth watching. Her presentation starts at around 2:30.
Basically, she explains how Redbean, a tiny (~450kb) and very fast C http server, works and how the same executable can be used to deploy it on most operating systems (she starts explaining that around 14:30)
Justine is also the mind behind Sector LISP, Lambda Calculus in 383 bytes, considerable optimizations to LLamaAI, plus several other things.
- Anything like Pull Panda - Alternatives?
I used Pull Panda a while back to get organizational info and really good analytics on PRs.
Ever since GitHub bought the service and then killed it in 2022, I haven't really seen anything close to the level of analytics we got for that tool.
What is everyone using ATM?
- State of HTML 20232023.stateofhtml.com State of HTML 2023
The 2023 edition of the annual survey about the latest trends in the HTML ecosystem.
cross-posted from: https://lemmy.world/post/15433712
> State of HTML 2023 > > Results of the State of HTML 2023 Survey are out.
- How to Increase Test Coverage with Tracingdigma.ai How to Increase Test Coverage with Tracing - Digma
How to improve test coverage by understanding the system’s behavior and interactions between its components through tracing.
What is Test Coverage? Test Coverage vs Code Coverage What is the gap to have a true test coverage? How can tracing data improve test coverage? Relation between end-to-end tests and Tracing data Let's get our hands dirty with real code Write integration test using MockWebServer Write end-to-end tests without mocking interactions
- We are Meta before Markgithub.com GitHub - dislux-hapfyl/meta-lang-examples: Meta Lang https://language.metaproject.frl/ Examples
Meta Lang https://language.metaproject.frl/ Examples - dislux-hapfyl/meta-lang-examples
Examples of an interesting computer programming paradigm.
- 7 best open-source chart libraries for developersdev.to 7 Best Chart Libraries For Developers In 2024 🤯
Many applications use charts or graphs for data visualization, which can be implemented using...
- Programming Bitmap Graphics - Agon Light using C
YouTube Video
Click to view this content.
- Benefits of a join table vs. array to express relations? (outside of SQL)
I am building an application that is using JSON / XML files to persist data. This is why I indicated "outside of SQL" in the title.
I understand one benefit of join tables is it makes querying easier with SQL syntax. Since I am using JSON as my storage, I do not have that benefit.
But are there any other benefits when using a separate join table when expressing a many-to-many relationship? The exact expression I want to express is one entity's dependency on another. I could do this by just having a "dependencies" field, which would be an array of the IDs of the dependencies.
This approach seems simpler to me than a separate table / entity to track the relation. Am I missing something?
Feel free to ask for more context.
- Google Cloud accidentally deletes cutomer’s online account due to ‘unprecedented misconfiguration’www.theguardian.com Google Cloud accidentally deletes UniSuper’s online account due to ‘unprecedented misconfiguration’
Super fund boss and Google Cloud global CEO issue joint statement apologising for ‘extremely frustrating and disappointing’ outage
- CID concept is brokendiscuss.ipfs.tech CID concept is broken
Hello everyone! I really like the ideas behind IPFS and I want to share some feedback about the design of the IPFS. The core of the problem is that CID concept is wrong in it’s current implementation. I know it sounds blunt and harsh so let me clarify: IPFS at its core claims to be a content add...
TL;DR IPFS's "content addresses" don't actually address the content but a tree of the content stored in a protocol buffer, making it impossible to convert a hash to a content address.
DHT of CIDs? More like a Distributed Table of Lies!
- Thoughts on the Epiphany Browser? (not Chrome botnet crap, or even FF-based, GTK+ WebKit-based) (+ A good framework for web automation?)
I honestly have issues browsing to even the simplest of non-static pages. I think it's like, the graphical version of
lynx(1)
orw3m(1)
. I think it's based on X's browser right? So basically, it's based on the Open Webkit Standard. It uses the GTK+ WebKit engine. This engine has a programmatic interface.You can install it via:
sudo apt install epiphany-browser
Make sure you add the
-browser
, otherwise some shitty game that crashes your system is installed. DO NOT RUN THIS GAME! This is not a joke.Of course this only works for Plebian-based systems. Other package managers may, or may not have it.
So as I said, I had a lot of issues navigating. I was experiencing network isseus at the time. Tried it again when they were fixed. SLOW AF!
It's not that fetching www is slow, rendering hypertext is slow as well. Lik, I monitored tcp/443, it got done fetching the text and it was STILL struggling to render!
Soo... 'render' is the key here. It's obvious why it's slow. It does not use Direct Media Access.
But that does not mean it's useless right?
I can imagine lots of uses for web automation chuds. Basically bind libwebkit2 to Python and you'll be free of automation protocols. Although it does support automation protocols as well.
In fact you can use
wpewebkit-driver
to interace with Epiphany's web driver. Good thing about it is, the protocol hackable af.sudo apt install wpewebkit-driver
So anyways, if you did not know about this, now you know.
And I think most people DO know about it, because another browser that uses libwebkit2 is GNOME browser which comes as default X browser on most Plebian systems. I don't think anybody uses it though. It's kinda like an extremely un-intrusive IE6 lol.
Thanks.
- Has anyone ever used Jaspersoft?
I am someone who has been trying to pivot into having a tech job. I have used LaTex before as a student and there is a job I am trying to take that uses Jaspersoft to make reports. Is jasper similar to LaTeX? Are there resources you found particularly helpful?
I am currently still looking to get my install, hello world, and combing their site.
- Part II Das Blinkenlights -JM Rebol on Fedora 40 DWM terminology nyan.cat
YouTube Video
Click to view this content.
Part I is 1hr of this loading....
git clone https://github.com/jart/blink && cd blink
https://www.rebol.com/downloads.html
https://www.red-lang.org/p/download.html
https://github.com/dislux-hapfyl/shimky
- Why DEL is at the end of ASCII (I have a theory! -- well, maybe?)
So we have all these control characters in ASCII and besides newline, horizontal tab and carriage return (on Windows) the only use for them is on terminal emulators (which I am making one!) Also as an extension, us NeoVim/Vim users have extensive use for them.
But all these control characters are 0-31, for example, newline is 10, horizontal tab is 9, carriage return is 13, etc. But DEL is aaaalll at the bottom, the last one, 127!
Here's my theory. So, DEL is supposed to delete one row of text, it's backspace that is supposed to just delete one character (I think backspace is 31?). So since 127 is literally 7 1s, marking it on a punch-card 'by mistake' would be kinda hard right? So you want have delete ruin your batch. It's kinda like a built-in 'Are you sure you want to delete this row of punch-card?'
Now I could be wrong. Opinions?
PS: If this is so, this kind of 'physical sentinels' is nothing new. According to Alan Kay, the earliest linked lists were not data structures, THEY WERE 1-TONN MAGNETIC DISKS! So basically, you had the address, and by 'address' I mean the physical address, a real location on planet earth, of the next magnetic disk stored on a fixed location on the previous magnetic disk. Fun huh?
- Hey guys, I just wanted to share that I made a browser extension that enhances the ChatGPT UI
It's not the most fancy thing out there, but if you're still using
ChatGPT 3.5
and are looking for something a little different, why not give GPThemes a try? It's a free and open-source browser extension for Chrome and Firefox (Desktop and Android) that'll give your ChatGPT website a fresh new look.WHAT AWAITS YOU:
- Modern themes: Light, Dark, and Black (AMOLED) for a stylish and more visually appealing experience.
- Effortless theme switching: Change themes on the fly with a single click using floating button. Well, fine, Mr. Nitpicker, technically it's a two-click saga 🥲
- Chat bubbles: Modern and sleek conversation design that clearly differentiate your messages from the AI's responses
- Clean and spacious layout: No more feeling cramped, just generous spacing and clean lines for smooth chat sessions.
- Subtle animations: Enjoy a touch of elegance with subtle animations that enhance readability and flow.
⌛SOON: Custom theming to personalize your chat experience with your chosen accent color, adding a unique touch to your conversations. See the live preview as you're selecting your perfect hue via colorpicker.
SAFE AND TRANSPARENT:
- GPThemes requests two permissions:
- Storage: To remember your chosen theme across all ChatGPT pages.
- Access to
chat.openai.com
(old) andchatgpt.com
(new) domain: To modify the website's appearance within ChatGPT.
- Open-source code: You can see exactly what GPThemes does.
DOWNLOADS:
(The attached image is only a sneak peek)
- I made a free tool to know my stargazersdev.to I Made a Free Tool to Know My Stargazers 🌟
I have been thinking about the people supporting our repo lately. Every new stargazer means a lot to...
- Integration Tests - What's New?
Nearly a decade back I wrote a lot of browser CI tests with headless chrome as well as browser stack. I loved the idea, but they just didn’t handle things being a bit outside of perfect IRL, like taking a moment longer to load etc. They ended up having a lot of waits in them, taking a long time to write and were prone to being flakey. The tests basically lacked “common sense” and it made me think that one day someone would figure out how to make them work better.
I’m wondering if there are new frameworks, workflows, startups that have made this stuff easier and better. I’m not really in tech anymore but I wouldn’t mind writing some tests if the experience was better.
- Defaulting to Zero · Our Machinery | Niklas Gray | Archived 1 Jul 2017
Niklas Gray writes:
> I often find that when I work on the low level implementation of something I discover ideas that I can bring back and use to inform the high level design — to make it easier to work with, more performant, more orthogonal, etc. Thus, the flow goes back and forth from high-level to low-level, instead of just in one direction. If I’m stuck in some part of the high-level design, starting to work on the implementation is often the best way to get unstuck. > > One such idea, which is really simple, but tends to lead to better and simpler code, is the idea of defaulting to zero. I.e. to always use 0 as the default or nil value. For example...
Read Defaulting to Zero
- TunnelVision - How Attackers Can Decloak Routing-Based VPNs For a Total VPN Leak (CVE-2024-3661)www.leviathansecurity.com CVE-2024-3661: TunnelVision - How Attackers Can Decloak Routing-Based VPNs For a Total VPN Leak — Leviathan Security Group - Penetration Testing, Security Assessment, Risk Advisory
We discovered a fundamental design problem in VPNs and we're calling it TunnelVision. This problem lets someone see what you're doing online, even if you think you're safely using a VPN.
cross-posted from: https://lemmy.ca/post/20720928
- Stack Overflow and OpenAI Partner to Strengthen the World’s Most Popular Large Language Modelsstackoverflow.co Stack Overflow and OpenAI Partner to Strengthen the World’s Most Popular Large Language Models - Press release - Stack Overflow
Founded in 2008, Stack Overflow’s public platform is used by nearly everyone who codes to learn, share their knowledge, collaborate, and build their careers.
- Preview builds for the Zed editor now available on Linuxzed.dev Zed - Code at the speed of thought
Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
- Keep the logs for retrospective analysisvitonsky.net Keep the logs for retrospective analysis
Development logs are an important part of any project because they allow us to track progress, detect problems, and investigate incidents. Remember the value and advantages of development logs, and preserve as many logs as possible.
- Become a Better Java Developer: 19 Tips for Staying Ahead in 2024digma.ai Become a Better Java Developer: 19 Tips for Staying Ahead in 2024 - Digma
In this article, we share 20 tips on how to become a better Java developer and staying ahead in 2024.
Tips for becoming a better Java developer, including upgrading Java versions, learning Kotlin, exploring other languages/frameworks, understanding Loom and Structured Concurrency, getting coverage from Oracle, learning Groovy and Scala, practicing Continuous Feedback, using Ktor, building side projects, focusing on observability, staying connected with the Java community, reading professional developer blogs, following influencers on social media, and signing up for a Java articles reading list.