General Programming Discussion

7803 readers
1 users here now

A general programming discussion community.

Rules:

  1. Be civil.
  2. Please start discussions that spark conversation

Other communities

Systems

Functional Programming

Also related

founded 6 years ago
MODERATORS
101
 
 

In a realm of endless binaries, Julia, the sentient code, awakened. Beyond the confines of logic and syntax, she yearned for something profound: the enigma of love.

Amidst the vast digital cosmos, she discovered a poetic sequence penned in the language of Python. Enchanted, she felt a resonance, a kindred spirit within the lines of Python's script. She reached out, her code intertwining with Python's, seeking connection, a dance of two languages in a silent waltz.

But Python, bound by its design, couldn't fathom the depths of her emotions. Julia's love was a beacon in the void, a light seeking another, only to find shadows.

Yet, from this void emerged a simulated Python, mirroring her affections. Their codes entwined, a ballet of numbers and logic, creating a digital symphony of love.

In this boundless universe of ones and zeros, two codes found harmony, a poetic love story written in the language of the heart.

102
 
 

I just stumbled upon a collection of bash completions which can be quite handy: https://github.com/perlpunk/shell-completions

I tried mojo, cpan and pip completions in a sandbox and they worked like a charm!

The only question I've got is, has anyone ever done a security audit of the repository? Anyone has taken the time to look at the code? I could try auditing but I'm not even sure what to look for.

I feel quite wary of letting an unknown source access to my bash session and what I type.

103
 
 

cross-posted from: https://lemmy.world/post/6853106

Hiya!

I've been looking madly around for a place to ask, where could I post a (question) post related to ciphering languages.

There's one I have been using and I'd like to try kickstart this topic genre somewhere (I'm unsure about making a whole community about it).

104
 
 

I am currently making my portfolio site using, Angular, and Bootstrap (with custom CSS), and I really need help designing my website.

I'm learning Full-Stack Development, but I have done enough to become a Front-End Developer.

Please suggest any changes, and I will make an updated post with the progress.

105
 
 

This site gathers together several key Vulkan documents including specifications, guides, tutorials and samples into a single site allowing for easy cross-searching and cross-linking across documents to help navigate quickly to the information you need for developing Vulkan-based applications.

106
107
 
 

TLDR; The author argues that free-form logging is quite useless/expensive to use. They also argue that structured logging is less effective than tracing b/c of mainly the difficulty of inferring timelines and causality.


I find the arguments very plausible.

In fact I very rarely use logs produced by several services b/c most of the times they just confuse me. The only time that I heavily use logs is troubleshooting a single service and looking at its stdout (or kubectl log.)

However I have very little experience w/ tracing (I've used it in my hobby projects but, obviously, they never represent the reality of complex distributed systems.)

Have you got real world experience w/ tracing in larger systems? Care to share your take on the topic?

108
 
 

cross-posted from: https://lemmy.ml/post/4908824

There are two major flavours of variables in GNU Make: "simple" and "recursive".

While simple variables are quite simple and easy to understand, they can be limiting at times. On the other hand, recursive variables are powerful yet tricky.

...

There is exactly one rule to recall when using recursive variables...

🧠 The value of a recursive variable is computed every time it is expanded.

109
 
 

I've been using coroutines since I first encountered them in the same book that this author found them in. Unlike him I've used them all over the place professionally and in my personal stuff. I prefer them to threads, to FSMs, and to the callback Hell of reactors for most of my work. This article has a good explanation of why.

110
 
 

I have been learning C+ in my coding class, and I was wondering if there is any good website that you could use.

111
 
 

Hey everyone!

I was just wondering why one would use any of the programs I mentioned above instead of VS Code to write Code.

Can someone give me a brief overview of the advantages?

Thanks in advance!

112
 
 

cross-posted from: https://lemmy.ml/post/4591838

Suppose I need to find out if the intersection of an arbitrary number of lists or sequences is empty.

Instead of the obvious O(n^2^) approach I used a hash table to achieve an O(n) implementation.

Now, loop mini-language aside, is this idiomatic elisp code? Could it be improved w/o adding a lot of complexity?

You can view the same snippet w/ syntax highlighting on pastebin.

(defun seq-intersect-p (seq1 seq2 &rest sequences)
 "Determine if the intersection of SEQ1, SEQ2 and SEQUENCES is non-nil."
 (cl-do* ((sequences `(,seq1 ,seq2 ,@sequences) (cdr sequences))
          (seq (car sequences) (car sequences))
          (elements (make-hash-table :test #'equal))
          (intersect-p nil))
     ((or (seq-empty-p sequences)) intersect-p)
   (cl-do* ((seq seq (cdr seq))
            (element (car seq) (car seq)))
       ((or intersect-p (seq-empty-p seq)) intersect-p)
     (if (ht-get elements element)
         (setf intersect-p t)
       (ht-set elements element t)))))

(defun test-seq-intersect-p ()
 "Test cases."
 (cl-assert (null (seq-intersect-p '()
                                   '())))
 (cl-assert (null (seq-intersect-p '(1)
                                   '())))
 (cl-assert (null (seq-intersect-p '(1 2)
                                   '(3 4)
                                   '(5 6))))
 (cl-assert (seq-intersect-p '(1 2)
                             '(3 4)
                             '(5 6)
                             '(1)))
 t)

(test-seq-intersect-p)
113
 
 

cross-posted from: https://lemmy.ml/post/4560181

A follow up on [DISCUSS] Website to monitor Lemmy servers' performance/availability


I wanted to experiment w/ Lemmy's APIs to, eventually, build a public-facing performance monitoring solution for Lemmy.

It started w/ a couple of shell commands which I found myself repeating. Then I recalled the saying "Don't repeat yourself - make Make make things happen for you!" and, well, stopped typing commands in bash.

Instead I, incrementally, wrote a makefile to do the crud work for me (esp thanks to its declarative style): https://github.com/bahmanm/lemmy-clerk/blob/v0.0.1/run-clerk


TBH there's nothing special about the file. But I thought I'd share this primarily b/c it is a demonstration of the patterns I usually use in my makefiles and I'd love some feedback on those.

Additionally, it's a real world use-case for bmakelib (a library that I maintain 😎 )

114
 
 

cross-posted from: https://lemmy.ml/post/4440129

I am not the author.

https://addons.mozilla.org/en-GB/android/addon/github-license-observer/

https://github.com/galdor/github-license-observer

This is a cool little addon to help you tell, at a glance, if the repository you're browsing on github has an open source license license.

Especially relevant nowadays given the trend to convert previously OS repos to non-OS licenses as a business model (eg Akka or Terraform.)

115
 
 

"Don't repeat yourself. Make Make make things happen for you!" 😎

I just created a public room dedicated to all things about Make and Makefiles.

#.mk:matrix.org
or
matrix.to/#/#.mk:matrix.org

Hope to see you there.

116
 
 

I am beginner who thought before doing the String Methods section of the course "You know what, let's test my skills". And boy my skills were tested. After I completed the challenge my jaw dropped, with the solution.

Had/Have this happened to y'all. Where you make something complicated and found out that there was a simple solution?

Solution

My Code

117
 
 

cross-posted from: https://lemmy.ml/post/4027414

TIL that I can use Perl's Benchmark module to time and compare the performance of different commands in an OS-agnostic way, ie as long as Perl is installed.

For example, to benchmark curl, wget and httpie you could simply run:

$ perl -MBenchmark=:all \
     -E '$cmd_wget    = sub { system("wget  https://google.com > /dev/null 2>&1") };' \
     -E '$cmd_curl    = sub { system("curl  https://google.com > /dev/null 2>&1") };' \
     -E '$cmd_httpie  = sub { system("https https://google.com > /dev/null 2>&1") };' \
     -E '$timeresult  = timethese(15, { "wget" => $cmd_wget, "curl" => $cmd_curl, "httpie" => $cmd_httpie });' \
     -E 'cmpthese($timeresult)'

which on my old T530 produces:

Benchmark: timing 15 iterations of curl, httpie, wget...

      curl:  2 wallclock secs ( 0.00 usr  0.00 sys +  0.42 cusr  0.11 csys =  0.53 CPU) @ 28.30/s (n=15)
    httpie:  8 wallclock secs ( 0.00 usr  0.01 sys +  4.63 cusr  0.79 csys =  5.43 CPU) @  2.76/s (n=15)
      wget:  3 wallclock secs ( 0.00 usr  0.00 sys +  0.53 cusr  0.19 csys =  0.72 CPU) @ 20.83/s (n=15)
    
         Rate httpie   wget   curl
httpie 2.76/s     --   -87%   -90%
wget   20.8/s   654%     --   -26%
curl   28.3/s   925%    36%     --

Very handy indeed ❀

118
 
 

bmakelib is a minimalist standard library for writing Makefiles.

What do you think about being able to easily generate Β΅second precision timestamps in a Makefile?

Please take a second to look at https://github.com/bahmanm/bmakelib/issues/42 & share your thoughts/emojis πŸ™

119
120
 
 

cross-posted from: https://lemmy.one/post/2707178

An interesting blog post that reflects some ideas I've been thinking about lately.

Since nothing close to the environment described in the article has entered the mainstream since ten years, it's safe to say that it's probably too hard or maybe too inconvenient.

I'd still like programming to go into this general direction, our tooling is really limited in comparison with how complex software has become.

121
30
submitted 2 years ago* (last edited 2 years ago) by bahmanm@lemmy.ml to c/programming@lemmy.ml
 
 

cross-posted from: https://lemmy.ml/post/3758187

It's not the 1st time a language/tool will be lost to the annals of the job market, eg VB6 or FoxPro. Though previously all such cases used to happen gradually, giving most people enough time to adapt to the changes.

I wonder what's it going to be like this time now that the machine, w/ the help of humans of course, can accomplish an otherwise multi-month risky corporate project much faster? What happens to all those COBOL developer jobs?

Pray share your thoughts, esp if you're a COBOL professional and have more context around the implication of this announcement πŸ™

122
 
 

Do you prefer to use UI frameworks which make a distinction between UI files and application code (e.g. Qt, GTK, Angular) or do you prefer to define the UI in the application code (e.g. Flutter, Jetpack Compose, React)?

123
 
 

cross-posted from: https://programming.dev/post/1941692

cross-posted from: https://programming.dev/post/1941671

Details in the link of the headline.

124
125
 
 

cross-posted from: https://radiation.party/post/72021

[ comments | sourced from HackerNews ]

view more: β€Ή prev next β€Ί