Andy

joined 2 years ago
MODERATOR OF
 
[–] Andy@programming.dev 19 points 1 year ago (3 children)

I'll just second the suggestion that KDE Plasma is worth a try, as it's very adaptable once you know what you want. You don't need to install any addons for the functionality you describe, just open the Shortcuts settings, KWin category, and have at it.

[–] Andy@programming.dev 1 points 1 year ago

Luhn, again

USING: combinators.short-circuit.smart kernel math math.parser rosetta-code.luhn-test sequences sets unicode ;

: ex-luhn? ( str -- ? )
  " " without
  dup {
    [ length 2 < ]
    [ [ digit? ] all? not ]
  } || [ drop f ] [
    string>number luhn?
  ] if
;

Luhn, a third time

USING: combinators.short-circuit.smart kernel math sequences sets unicode validators ;

: ex-luhn? ( str -- ? )
  " " without
  dup {
    [ length 2 < ]
    [ [ digit? ] all? not ]
  } || [ drop f ] [ luhn? ] if
;

[–] Andy@programming.dev 1 points 1 year ago

Raindrops, again

USING: assocs kernel math.functions math.parser sequences sequences.extras ;

: raindrops ( n -- sound )
  { 3 5 7 } [ dupd divisor? ] find-all keys
  { "Pling" "Plang" "Plong" } nths concat
  [ number>string ] [ nip ] if-empty ;

[–] Andy@programming.dev 1 points 1 year ago (1 children)

Luhn

USING: combinators.short-circuit.smart kernel math math.functions math.parser sequences sequences.extras sets unicode ;

: luhn? ( str -- ? )
  " " without
  dup { [ length 2 < ] [ [ digit? ] all? not ] } || [ drop f ] [
    string>digits
    reverse [ <evens> sum ] [ <odds> ] bi
    [ 2 * dup 9 > [ 9 - ] when ] map-sum +
    10 divisor?
  ] if
;

[–] Andy@programming.dev 7 points 1 year ago (1 children)

Ooh I haven't seen this one. Anyone have a comment on this vs the KleverNotes project? I think that's the name.

[–] Andy@programming.dev 9 points 1 year ago (1 children)

The Power and Battery widget now responds to middle-clicks and scrolls: middle-click will block or re-enable automatic sleep and screen locking, and scrolling will change the active power profile

Scrolling on the battery applet is how I adjust my brightness. Is that no longer a thing?

[–] Andy@programming.dev 2 points 1 year ago (1 children)

Here are a bunch in Factor, taking the easy way when the solution is already in the standard library:

Leap

USING: calendar ;

ALIAS: leap? leap-year?

Reverse String

USING: sequences ;

ALIAS: reverse-string reverse

Raindrops

USING: kernel math.functions math.parser sequences ;

: raindrops ( n -- sound )
  { 3 5 7 } [ dupd divisor? ] map
  [ { "Pling" "Plang" "Plong" } nth "" ? ] map-index
  concat
  [ number>string ] [ nip ] if-empty
;

Roman Numerals

USING: roman ;

ALIAS: roman-numerals >ROMAN

Protein Translation

USING: combinators grouping kernel sequences sequences.extras sets ;

: RNA>proteins ( RNA -- proteins )
  3 group
  [ { "UAA" "UAG" "UGA" } in? ] cut-when drop
  [
    {
      { [ dup "AUG" =                         ] [ "Methionine"    ] }
      { [ dup "UGG" =                         ] [ "Tryptophan"    ] }
      { [ dup { "UUU" "UUC"             } in? ] [ "Phenylalanine" ] }
      { [ dup { "UUA" "UUG"             } in? ] [ "Leucine"       ] }
      { [ dup { "UAU" "UAC"             } in? ] [ "Tyrosine"      ] }
      { [ dup { "UGU" "UGC"             } in? ] [ "Cysteine"      ] }
      { [ dup { "UCU" "UCC" "UCA" "UCG" } in? ] [ "Serine"        ] }
    } cond nip
  ] map
;

Acronym

USING: sequences sequences.extras splitting unicode ;

: >TLA ( phrase -- TLA )
  " -" split
  [ [ Letter? ] filter ] map-harvest
  [ 1 head >upper ] map-concat
;

Allergies

USING: kernel math sequences sets ;

CONSTANT: scores
  { "eggs" "peanuts" "shellfish" "strawberries" "tomatoes" "chocolate" "pollen" "cats" }

: (allergy-test) ( allergens remainder -- allergens' remainder' )
  dup log2
  [ scores ?nth '[ _ suffix! ] dip ]
  [ 2^ - ] bi
;

: allergy-test ( allergen total -- allergic? allergens )
  V{ } clone swap
  [ (allergy-test) ] until-zero sift
  dup [ in? ] dip
;

[–] Andy@programming.dev 3 points 1 year ago (1 children)

Have you checked the system settings page that includes compositor stuff?

[–] Andy@programming.dev 3 points 1 year ago (1 children)

I just grabbed it. The dash cam features might possibly be useful on a bike (?). But I tried and tried and couldn't find the magic zoom level for it to show me the name of the street I'm on, got frustrated, and uninstalled.

[–] Andy@programming.dev 2 points 1 year ago (2 children)

This link doesn't work for me. Do you have an alternative/original? I'd like to read some context and explanation.

[–] Andy@programming.dev 8 points 1 year ago (3 children)

I'm not off Google Maps either, but the closest to replacing it for me is Organic Maps, FWIW.

view more: ‹ prev next ›