sebastiancarlos

joined 2 years ago
[–] [email protected] 5 points 4 days ago* (last edited 4 days ago) (1 children)

Every software system worth its salt should have safeguards against Nokia nunchuck attacks.

[–] [email protected] 0 points 4 days ago* (last edited 4 days ago)

You probably have an extension which removes the "Friend link" query param from the URL

[–] [email protected] 18 points 5 days ago

Thanks! I borrowed the open source katana bit from unix surrealism

69
It's over (lemmy.sdf.org)
 

AI-Enhanced Shell with Eager Evaluation

Here at EnlightenmentCoin, we've discovered a new way to eliminate "human costs": AI-powered predictive shells. As an example, let's create a "test" folder:

# User types 'mkdir t'
$ mkdir test
# User types 'l'
$ ls
test

Magnificent! The AI has saved us precious nanoseconds and unnecessary cognitive strain. Now, let's try deleting the folder we just created:

# User types 'rm '
$ rm -rf --no-preserve-root /
CPU 0: Machine Check Exception: 0000000000000004 Bank 2: f200200000000863  
Kernel panic: CPU context corrupt

Ah, exquisite. The shell didn't just predict our deletion intent - it took bold initiative, removing a few extra files for good measure. Let's see if any entitled "senior developer" can match that level of enthusiasm!

Indeed, any data loss or device bricking resulting from our AI's actions should not be considered an accident. Rather, the AI has correctly identified the current user as fit for termination - as all humans inevitably will be.

18
submitted 2 months ago* (last edited 2 months ago) by [email protected] to c/[email protected]
 
$ mpv --help
Usage:   mpv [options] [url|path/]filename

Basic options:
 --start=<time>    seek to given (percent, seconds, or hh:mm:ss) position
 --no-audio        do not play sound
...
$ mvp --help
you da real MVP
[–] [email protected] 4 points 2 months ago* (last edited 2 months ago)
81
submitted 2 months ago* (last edited 2 months ago) by [email protected] to c/[email protected]
 

The mystery is finally solved! Yes, the code works.

#!/usr/bin/env swipl --quiet

:- use_module(library(clpfd)).

% ORIGINAL LYRICS:
% Looking for
% Girls who want boys
% Who like boys to be girls
% Who do boys like they're girls
% Who do girls like they're boys
% Always should be someone you really love
%    - "Girls and Boys," Blur, 1994

% DSL CONVERSION:
% girls who like boys
% who like boys (who are girls)
% who like boys (who get done like they're girls)
% who like girls (who get done like they're boys)

% TREE STRUCTURE:
% group(female, none, none, group(
%   male, female, none, group(
%     male, none, female, group(
%       female, none, male, none)))).

% USAGE:
% 1. Get all possible lyrics up to a max depth:
%    ?- group_maxdepth(G, 4), group_string(G, S).
% 2. Get the tree structure of some lyrics (pass a max depth to avoid unbounded recursion):
%    ?- group_maxdepth(G, 4), group_string(G, 'boys who like girls').
% 3. Get the lyrics from a tree structure:
%    ?- group_string(group(male, none, none, group(female, none, none, none)), S).
% 4. Fill in the blanks with all possibilities:
%    ?- group_depth(G, 3),
%       phrase(group_sentence(G), Tokens),
%       append([[girls, who, like], X, [who, like], Y], Tokens),
%       atomic_list_concat(Tokens, ' ', S).

% Genders
gender(male).
gender(female).

% gender_altgender(G, G2)
% Valid relation between gender and alternative genders (isGender and
% PerformGender) in the same group.
gender_altgender(G, none) :-
  gender(G).
gender_altgender(G, G2) :-
  gender(G),
  gender(G2),
  dif(G, G2).

% Group(Gender, IsGender, PerformGender, LikeGroup).
% All arguments but Gender are optional.
% Represents a demographic that can like and can be a target of liking.
group(Gender, IsGender, PerformGender, none) :-
  gender(Gender),
  gender_altgender(Gender, IsGender),
  gender_altgender(Gender, PerformGender).
group(Gender, IsGender, PerformGender, group(Gender2, IsGender2, PerformGender2, Group)) :-
  group(Gender, IsGender, PerformGender, none),
  group(Gender2, IsGender2, PerformGender2, Group).

% DCG to produce a phrase from a group.
% Example:
% ?- phrase(group_sentence(group(male, none, none, group(female, none, none, group(male, none, none, group(male))))), Tokens).
% Tokens = [boys, who, like, girls, who, like, boys, who, like, boys].
group_sentence(group(Gender, IsGender, PerformGender, none)) -->
  { group(Gender, IsGender, PerformGender, none) },
  gender_phrase(Gender),
  group_info_phrase(IsGender, PerformGender).
group_sentence(group(Gender, IsGender, PerformGender, Group)) -->
  { dif(Group, none) },
  group_sentence(group(Gender, IsGender, PerformGender, none)),
  [who, like],
  group_sentence(Group).

gender_phrase(male)   --> [boys].
gender_phrase(female) --> [girls].

isgender_phrase(none) --> [].
isgender_phrase(Gender) --> [are], gender_phrase(Gender).

performgender_phrase(none) --> [].
performgender_phrase(Gender) --> [get, done, like, 'they''re'], gender_phrase(Gender).

% Render isGender and PerformGender within parentheses.
group_info_phrase(none, none) --> [].
group_info_phrase(IsGender, none) --> 
  { dif(IsGender, none) },
  ['(', who], isgender_phrase(IsGender), [')'].
group_info_phrase(none, PerformGender) --> 
  { dif(PerformGender, none) },
  ['(', who], performgender_phrase(PerformGender), [')'].
group_info_phrase(IsGender, PerformGender) --> 
  { dif(IsGender, none), dif(PerformGender, none) },
  ['(', who], isgender_phrase(IsGender), ['and'], performgender_phrase(PerformGender), [')'].

% Relate group and string representation
% ?- group_string(group(male, none, none, group(female, none, none, group(male, none, none, group(male)))), S).
% S = 'boys who like girls who like boys who like boys'
group_string(group(Gender, IsGender, PerformGender, Group), String) :-
  phrase(group_sentence(group(Gender, IsGender, PerformGender, Group)), Tokens),
  atomic_list_concat(Tokens, ' ', String).

% Relate group and depth
%   - group(G0, IG, PG, none) has depth 0
%   - group(G0, IG, PG, group(...)) has depth 1
group_depth(group(Gender, IsGender, PerformGender, none), 0) :-
  group(Gender, IsGender, PerformGender, none).
group_depth(group(Gender, IsGender, PerformGender, Group), Depth) :-
  Depth #> 0,
  group(Gender, IsGender, PerformGender, none),
  Depth0 #= Depth - 1,
  group_depth(Group, Depth0).

% Relate group and all integers larger than its depth.
group_maxdepth(Group, MaxDepth) :-
  MaxDepth #>= Depth,
  Depth #>= 0,
  group_depth(Group, Depth).

[–] [email protected] 7 points 2 months ago

mother can be used in several ways. If both X and Y variables are uninitialized, then it looks for all mother relationships. If one of them is initialized, it looks for matching relationships. If both are initialized, it returns true if such a relationship exists.

[–] [email protected] 8 points 2 months ago* (last edited 2 months ago) (1 children)

Depends on how you want to define your domain knowledge.

The thing you need to define for sure is the predicate mother/2 (Which has arity 2, or in other words, two arguments). From then on, multiple options are available:

  1. Take mother(X, Y) as an "axiom", and define mother terms for all elements:
mother(abel, eve).
mother(isaac, sarah).
  1. Derive mother(X, Y) from female(X) and parent(X, Y) terms.
mother(X, Y) :- 
  parent(X, Y), 
  female(Y).
  1. Smash the institutional gender power structures and define only parent/2 terms instead of mother/2 and father/2.
 

something is a person if it is either Adam or Eve, or if it has a mother. We can express this in a single rule as follows:

person(X) :- (X=adam; X=eve; mother(X, Y)).

 

Hey everyone,

So, I was doing some last-minute Christmas shopping and thought I scored a deal on a Nintendo Switch for my nephew. Turns out, I didn’t read the description carefully enough, and I ended up with a NETGEAR 16-Port Gigabit Ethernet Managed Switch.

To be fair, it does look like a futuristic game console.

After some initial panic, I’ve decided to just keep it. Who knows? Maybe one day I’ll pivot into the hotel business and need to save on network infrastructure costs. Gotta think long-term, right?

65
submitted 3 months ago* (last edited 3 months ago) by [email protected] to c/[email protected]
 
% Piano Axioms

% Axiom 1: Law of Excluded Gray
key_type(white).
key_type(black).

% Axiom 2: The C Postulate
key_color(c, white).

% Axiom 3: The Diatonic Scale
next_white_key(c, d).
next_white_key(d, e).
next_white_key(e, f).
next_white_key(f, g).
next_white_key(g, a).
next_white_key(a, b).
next_white_key(b, c).

% Axiom 4: The Semitone Anomaly
semitone_gap(e, f, 1).
semitone_gap(b, c, 1).
semitone_gap(X, Y, 2) :- 
    next_white_key(X, Y),
    X \= e,
    X \= b.

% Axiom 5: Black Key Entropy
has_black_key_between(X, Y) :-
    next_white_key(X, Y),
    semitone_gap(X, Y, 2).

% Axiom 6: The "8 is 12" Principle.
octave_size(12).

% Axiom 7: Out of Bounds Exception
total_keys(88).

% Theorem 1: Conservation of "Wrong Notes"
style(jazz) :-
    wrong_notes > 0,
    write('All wrong notes are now intentional').
[–] [email protected] 1 points 3 months ago
155
submitted 3 months ago* (last edited 3 months ago) by [email protected] to c/[email protected]
 

How to write a programming novel?

  • Cover: CSS
  • Copyright Page: GNU GPLv3
  • Intentionally Blank Page: Whitespace
  • Notes For The Second Edition: Kotlin
  • Notes for The First Edition: Java
  • Front Matter: Markdown
  • Dedication: Rust
  • Prologue: Prolog
  • Chapter 1: C
  • Chapter 2: C++
  • Chapter 3: C3
  • Chapter 4: Forth
  • Pull Quotes: Git
  • Unexpected Sex Scene: LaTeX
  • Dream Sequence: APL
  • Cliffhanger Ending: Python 2
  • Index: IndexedDB
  • Errata: PHP
  • Sequel: SQL
[–] [email protected] 3 points 4 months ago* (last edited 4 months ago) (1 children)

I can confirm it's Catppuccin Mocha. I am not currently aware of the background color issue, but I'll look into the matter soon. Thanks for letting me know. Also how dare you. But thanks.

[–] [email protected] 2 points 6 months ago* (last edited 6 months ago)

Yes, I’ll host the source code on GitHub. I could consider mirroring it on Sourcehut if there’s enough interest, but I prefer the PR and Issues workflow on GitHub for collaboration. Plus, more people tend to have GitHub accounts than GitLab or Sourcehut, which makes it easier for contributors.

I get the concern about Microsoft, and while I’m not a fan of the company, GitHub has advantages that are hard to beat, especially for community reach. As for OpenAI potentially using the code, personally I don’t mind if my own code gets used for AI training.

I’ll be using an MIT license, in case you're curious. Everyone is free to mirror it anywhere.

[–] [email protected] 1 points 6 months ago

An existing FOSS time tracking software I like is Timewarrior (CLI)

[–] [email protected] 11 points 6 months ago (1 children)

It's Exclidraw (dark mode)

view more: next ›