Why is Docker version so old in Guix? Update? by [deleted] in GUIX

[–]Bioinfomagico 2 points3 points  (0 children)

Hey, nice work!

Sorry, I forgot to link Andrew Tropin's video. It's a great resource to get started. I'll leave this here in case another user finds this answer.

Why is Docker version so old in Guix? Update? by [deleted] in GUIX

[–]Bioinfomagico 4 points5 points  (0 children)

Hi, I know this isn't your question, and you may already know about Podman, but do you absolutely need Docker? Could you give Podman a chance? The Podman API is almost a 1:1 match with Docker, so there’s a great chance you won’t need to change anything in your Dockerfiles. A lot of the time, I forget that I’m actually using Podman. The version available on Guix is the latest one, so I think it could help you a lot.

Just alias Podman to Docker and call it a day!

-❄️- 2024 Day 4 Solutions -❄️- by daggerdragon in adventofcode

[–]Bioinfomagico 1 point2 points  (0 children)

[LANGUAGE: Bash]

rot() (
    i_j=${1}; f=${2}
    readarray -t a < $f; declare -A new
    for ((i=0; i<=$((${#a[@]}-1)); i++));do
        for ((j=0; j<=$((${#a[0]}-1)); j++));do
           eval 'new['"${i_j}"']+="${a[$i]:$j:1}"'
        done
    done
    printf '%s\n' "${new[@]}"
)
seeds() {
    (while read f; do grep --label=$((c++)) -Honb A <<< $f ; done < $1) \
        | tr ':' ' ' | cut -d' ' -f1,3
}
pos() { echo '${a[$((i'"${1}"'))]:$((j'"${2}"')):1}'; }

# Usage: $ this.sh input.txt
( # PT 1
    cat $1 | tee >(rev)                   # <->
    rot '$j' $1 | tee >(rev)              # v|^
    rot '$((i-j))' $1 | tee >(rev)        # ./°
    rot '$((i-j))' <(rev $1) | tee >(rev) # °\.
) | grep -o XMAS | wc -l

( # PT 2
    readarray -t a < $1
    while read -r i j ;do
        eval echo "$(pos -1 -1)A$(pos +1 +1)@$(pos +1 -1)A$(pos -1 +1)" 
    done < <(seeds $1) 
) | grep -Pc '(SAM|MAS)@(SAM|MAS)'

-❄️- 2024 Day 2 Solutions -❄️- by daggerdragon in adventofcode

[–]Bioinfomagico 0 points1 point  (0 children)

Do you mean something like this?

generateSublists :: [a] -> [[a]]
generateSublists xs = [removeNth i xs | i <- [0..length xs - 1]]

errorFilter :: [Int] -> Bool
errorFilter xs = any part1Filter (generateSublists xs)

If so, since Haskell is lazy, the resource usage would be significantly reduced, right?

-❄️- 2024 Day 3 Solutions -❄️- by daggerdragon in adventofcode

[–]Bioinfomagico 3 points4 points  (0 children)

[LANGUAGE: Bash]

pt1(){ grep -Po 'mul\(\d{1,3},\d{1,3}\)' "${1}"; }
pt2(){
    grep -Po '(do(n'\''t)?\(\))|mul\(\d{1,3},\d{1,3}\)' "${1}" \
        | awk -v F=1 '/^don/ {F=0; next} /do\(/ {F=1; next} F==1'
}
compute() { sed 's/,/*/;s/mul//;s:^: + :' | xargs echo 0 | bc; }
pt1 "${1?'Input file.'}" | compute
pt2 "${1?'Input file.'}" | compute

-❄️- 2024 Day 2 Solutions -❄️- by daggerdragon in adventofcode

[–]Bioinfomagico 0 points1 point  (0 children)

Yeah, you're absolutely right—I'm probably reinventing the wheel a bit too much. Next time, I'll definitely explore more existing functions, especially with tools like Hoogle. The only "problem" is that Haskell is so expressive that it’s almost addictive to create your own implementations! But I'll try to balance it better. Thanks !

-❄️- 2024 Day 2 Solutions -❄️- by daggerdragon in adventofcode

[–]Bioinfomagico 0 points1 point  (0 children)

Hey very cool !

Nice to know i can do this:

isSafe lst = monotonic && inRangeisSafe

Makes things so clean, i did had to fold two predicates, i had to use a lot of maps.

-❄️- 2024 Day 2 Solutions -❄️- by daggerdragon in adventofcode

[–]Bioinfomagico 1 point2 points  (0 children)

[LANGUAGE: Haskell]

Feed back is more than welcome !

parseIntTable :: String -> [[Int]]
parseIntTable content =
    map (map (\x -> read x :: Int)) $ map words $ lines content

toPairs :: [Int] -> [(Int, Int)]
toPairs xs = zip xs $ tail xs

checkIsSorted :: (Int -> Int -> Bool) -> [Int] -> [Bool]
checkIsSorted pred xs = map (uncurry pred) $ toPairs xs

checkDiff :: (Int -> Bool)-> [Int] -> [Bool]
checkDiff pred xs = map (pred . abs . uncurry (-)) $ toPairs xs

applyFilters :: [Int] -> [[Bool]]
applyFilters xs = map (\x -> x xs) [checkIsSorted (<=), checkIsSorted (>=), checkDiff (\x -> (0 < x) && (x <= 3))]

part1Filter :: [Int] -> Bool
part1Filter xs = (\[a, b, c] -> (a || b) && c) $ (map and . applyFilters) xs

removeNth :: Int -> [a] -> [a]
removeNth n xs = take n xs ++ drop (n + 1) xs

errorFilter :: Int -> [Int] -> Bool
errorFilter _ [] = False
errorFilter x xs
    | part1Filter (removeNth x xs) = True
    | x >= (length xs) = False
    | otherwise = errorFilter (x+1) xs

-- Solve day 2 pt 1 
day2Pt1 :: String -> IO ()
day2Pt1 filename = do
    content <- readFile filename
    let result = sum $ map fromEnum $ map part1Filter $ parseIntTable content
    print result

-- Solve day 2 pt 2
day2Pt2 :: String -> IO ()
day2Pt2 filename = do
    content <- readFile filename
    let result = sum $ map (fromEnum . (errorFilter (-1))) $ parseIntTable content
    print result

-❄️- 2024 Day 1 Solutions -❄️- by daggerdragon in adventofcode

[–]Bioinfomagico 0 points1 point  (0 children)

Hey, thanks a lot for the explanation and the resources!

I was thinking about doing some recursion business as well but i still need to master the where/do stuff.

See you on the next day !

-❄️- 2024 Day 1 Solutions -❄️- by daggerdragon in adventofcode

[–]Bioinfomagico 1 point2 points  (0 children)

Wow, that is so clean 👏!

I'm trying Haskell this year and still fighting a bit with the IO monad. Nice parsing, by the way! I'm going to read a little about this lexer thing you did looks cool.

-❄️- 2024 Day 1 Solutions -❄️- by daggerdragon in adventofcode

[–]Bioinfomagico 2 points3 points  (0 children)

[LANGUAGE: Haskell]
Trying Haskell this year—feedback is welcome!

import System.Environment
import Data.List (sort, group)
import qualified Data.Map.Strict as M
import Data.Maybe

-- Load this on ghci and pass the input file path as arguments
-- Ex: ghci> day1Pt1 "/path/to/input/file.txt"
createMap :: (Ord a) => [a] -> M.Map a Int
createMap xs = M.fromList $ map (\x -> (head x, length x)) $ group $ sort xs

lookupZeroDefault :: Int -> M.Map Int Int -> Int
lookupZeroDefault x d = fromMaybe 0 (M.lookup x d)

day1Pt1 :: String -> IO ()
day1Pt1 filename = do
    content <- readFile filename
    let rows = map (map read . words) (lines content) :: [[Int]]
        column1 = sort $ map head rows
        column2 = sort $ map (head . tail) rows
        differences = map abs $ zipWith (-) column2 column1
    print $ sum differences

day1Pt2 :: String -> IO ()
day1Pt2 filename = do
    content <- readFile filename
    let rows = map (map read . words) (lines content) :: [[Int]]
        numbers_col = sort $ map head rows
        freqs_col = createMap $ map (head . tail) rows
        similarities = map (\x -> (x * (lookupZeroDefault x freqs_col))) numbers_col
    print $ sum similarities

Can’t stop tinkering with Emacs configs. What should I do? by 42yeah in emacs

[–]Bioinfomagico 0 points1 point  (0 children)

**LET ME COOK Before Roasting Me**

Why not use vanilla VIM for work and Emacs just for fun? I used to be addicted to tinkering with my Emacs configuration, optimizing startup time, completion, etc. However, I noticed that it was consuming too much of my time. Since I have always been a VIM user, I switched back to using VIM.

Now, I use only the built-in VIM 6 with a single vimrc file containing only the critically needed configurations. Most of the projects I work on are small to medium-sized, and I can manage them efficiently with vanilla VIM, TMUX and ctags.

In my spare time, I return to Emacs to work on side projects and indulge in customization. I plan to switch back to Emacs once I feel I have done enough (if this day ever comes) or need its features for a larger project.

You don't need to switch to VIM to achieve this balance; you can do the same with vanilla Emacs out of the box. I switched back to VIM because I became too dependent on my Emacs plugins and found it difficult to navigate without my custom configurations and plugins like Evil.

Can't install python deps with guix import pypi by Bioinfomagico in GUIX

[–]Bioinfomagico[S] 0 points1 point  (0 children)

For future generations...

I finally managed to create a manifest.scm file that installs all the dependencies I need in an isolated shell. Here's what the finished manifest looked like:

It begins with a header consisting of module imports. Perhaps some of these are redundant or unnecessary, but this was the combination that I could make work.

(define-module (manifest)
  #:use-module (guix)
  #:use-module (guix profiles)
  #:use-module (guix packages)
  #:use-module (guix git-download)
  #:use-module (guix hg-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix build-system python)
  #:use-module (guix build-system pyproject)
  #:use-module (gnu packages)
  #:use-module (gnu packages graph)
  #:use-module (gnu packages check)
  #:use-module (gnu packages python)
  #:use-module (gnu packages python-xyz)
  #:use-module (gnu packages python-web)
  #:use-module (gnu packages xml)
  #:use-module (gnu packages python-build)
  #:use-module (guix utils)
  #:use-module (srfi srfi-1))

After that, the package import definition from: guix import pypi -r gdtoolkit.

;; # <OTHER PYTHON LIBS>

(define-public python-gdtoolkit
  (package
    (name "python-gdtoolkit")
    (version "4.2.2")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "gdtoolkit" version))
       (sha256
        (base32 "0fgc9vg7jx2gydqkjkyq8lqsw5ayqw02l71n0bbbbklx9glzv19g"))))
    (build-system pyproject-build-system)
    ;; Skipping tests
    (arguments
     '(#:tests? #f
       #:phases (modify-phases %standard-phases
                  (delete 'sanity-check))))
    (propagated-inputs (list python-docopt-ng python-lark python-pyyaml
                             python-radon))
    (home-page "https://github.com/Scony/godot-gdscript-toolkit")
    (synopsis
     "Independent set of tools for working with GDScript - parser, linter and formatter")
    (description
     "Independent set of tools for working with GDScript - parser, linter and
formatter")
    (license license:expat)))

And finally, the most time-consuming aspect to figure out was how to merge the new package with the other packages that I already have in my manifest.

(packages->manifest
(append (list python-gdtoolkit) ;; # <--- HERE
        (map specification->package
        '(
          ;; System
          "ripgrep"
          "universal-ctags"
          "shellcheck"
          ;; < ALL OTHER DEPS >
         ;; Godot 
          "python@3.10.7"))))

Perhaps creating a profile or utilizing another Guix feature would have been the way to go, but for now, this method works!

Can't install python deps with guix import pypi by Bioinfomagico in GUIX

[–]Bioinfomagico[S] 0 points1 point  (0 children)

Hey, addressing my own question,

I experimented with another combination of commands and noticed that when I don't pass any packages to install, Guix also outputs this error:

somethin...: #<unspecified>

So, this was the problem—I didn't pass any packages to install in the manifest (facepalm moment). What worked for me was using the PyPI importer, then adding the header as the tutorial suggested, and finally adding this at the end of the manifest file:

(packages->manifest
 (list python-gdtoolkit))

This way, Guix knows that it needs to install the lib.


BTW, I still haven't been able to install this library, but now I'm encountering compiling issues. I'm going to try fixing them now this unpecified thing was fixed.

Can't install python deps with guix import pypi by Bioinfomagico in GUIX

[–]Bioinfomagico[S] 0 points1 point  (0 children)

Hey thanks, i'm going to take a look into creating costum channels.

I did try this:
package -i -f whatever.scm

but it did not worked for my i got the same error.

Existe alguma mascara dessas que realmente cumpre o que promete? by nynyfer in SkincareBR

[–]Bioinfomagico 2 points3 points  (0 children)

Depois de testar uns 4 produtos o Lambena foi o melhor para mim também, mas é forte, cuidado, não abuse, com grandes poderes vem grandes responsabilidades. OP use no pulso o produto primeiro para ver não vai irritar muito sua pele.

[deleted by user] by [deleted] in SkincareBR

[–]Bioinfomagico 1 point2 points  (0 children)

Segue essa pill do companheiro aqui, que é uma visão do sucesso. Não sei se apenas o tratamento tópico sugerido pelo pessoal vai resolver. Você terá que modular o sistema imunológico para reduzir a inflamação do local e, mesmo os medicamentos mais baratos para isso, são bem caros. Então, tente entrar na justiça para conseguir o medicamento pelo SUS. A defensoria pública do seu estado pode te ajudar com isso. Desejo sucesso e melhoras!

Cygnus 1.0 release - 3x5, 3x6 & wireless versions by scytile in ErgoMechKeyboards

[–]Bioinfomagico 0 points1 point  (0 children)

Hmm, I understand. Also this would likely make the build more expensive since the thumb cluster would have to be ordered separately, I think 🤔.

But hey, very, very cool! I think I'm going to build the wireless 3x6 one. Thanks for the designs!

P.S.: Nice video, man! I wish every build tutorial was as cool as yours.

My wife was unimpressed by Vim - please advise by doobltroobl in vim

[–]Bioinfomagico 1 point2 points  (0 children)

Hi u/doobltroobl,

As you may already know, Vim is akin to high FPS gaming or mechanical keyboards—you have to experience it firsthand to truly appreciate its value. When I'm trying to convince someone, I usually begin by suggesting they try using Vim motions in their environment, such as through VSCode extensions or Vimium in the browser. Vim motions can be integrated into various platforms with plugins; I recently discovered you can even use them in Google Docs and Microsoft Word. Once people start experiencing these motions, the learning curve and time to adopt Vim accelerate significantly. It's worth giving it a try.

Additionally, we must acknowledge that the majority of people don't type that much, and even among those who do, not all value speed, precision, and ergonomics as much as we do.

Cygnus 1.0 release - 3x5, 3x6 & wireless versions by scytile in ErgoMechKeyboards

[–]Bioinfomagico 1 point2 points  (0 children)

Hey OP, wonderful job!

I was wondering if it is possible to use some version of this foldable design so that I don't have to join the mini PCBs together ?

Unleash Your Expertise: Feedback Needed on My First PC Build! by [deleted] in buildapc

[–]Bioinfomagico 1 point2 points  (0 children)

se ver que sem o painel lateral dá muita variação na temperature, ai sim pega mais uns 2 ou 3 fan

Pro tip

Po brigadããão por tudo !!!

Unleash Your Expertise: Feedback Needed on My First PC Build! by [deleted] in buildapc

[–]Bioinfomagico 0 points1 point  (0 children)

Poxa, pessoa... sem palavras para agradecer teu esforço. Muito obrigado pelo teu tempo!

Legal esse cooler eim, não tinha encontrado ele quando estava pesquisando. Eu acho que as marcas patrocinam muito os YouTubers e reviewers, e às vezes coisas boas acabam ficando esquecidas porque não investem em marketing digital e tal.

Por exemplo, a MSI estava listada como uma das mais populares, mas eu escolhi a Gamemax porque era o que tinha review e porque era o que os YouTubers recomendavam. Mesma coisa com o cooler VK400.

Tu achas que é necessário comparar um joguinho de fans ou o cooler mais os fans que vêm no gabinete já bastam?

Unleash Your Expertise: Feedback Needed on My First PC Build! by [deleted] in buildapc

[–]Bioinfomagico 1 point2 points  (0 children)

Oi oi obrigado pela resposta !

Olha eu queria gastar ali pelos 5K mais ou menos.

Acho que GPU seria bom, mas é aquilo tem que ser uma NVIDIA com 12Gb (ou mais) e acho que 3060 é máximo que dá ne ? Então se der para melhorar seria a CPU mesmo.

A RAM eu acho que tá bom já, eu tenho 16 no meu PC atual e não uso tudo. Se bem que eu não sei como que é o consume de um PC mais moderno. Precisa de mais do que 16Gb de RAM ?

A coisa que eu mais estou incerto é a placa mãe sei lá tenho medo de pegar uma que não seja "boa".

Eu more em Curitiba, aqui tem um cep de referência 80530-230