undu's recent activity

  1. Comment on The laptop market is in an atrocious state in ~tech

    undu
    Link
    I'm really happy with the dell latitute I got from work 4 years ago, I would expect them to still be better in repairability than the XPS and never had any problems with them regarding hardware,...

    I'm really happy with the dell latitute I got from work 4 years ago, I would expect them to still be better in repairability than the XPS and never had any problems with them regarding hardware, although I don't think coreboot can be installed.

    4 votes
  2. Comment on Warcraft III: Reforged - Developer update, including plans for upcoming changes and some concerns that will not be addressed in ~games

    undu
    Link
    Such a tragic way to kill the community around Warcraft 3. Instead of the "we cannot support" shtick and declare ownership of any and all community content they could have released the server-side...

    Such a tragic way to kill the community around Warcraft 3.

    Instead of the "we cannot support" shtick and declare ownership of any and all community content they could have released the server-side for the community to host and continue the online side.

    I guess execs are simply to greedy to give anything to the community.

    2 votes
  3. Comment on What git commands do you use frequently that you think more people should use? in ~comp

    undu
    (edited )
    Link
    I consider git unusable without aliases. They are configured using the file ~/.config/git/config. I really prefer aliases to have memorable names for common operations in my git workflow. For...

    I consider git unusable without aliases. They are configured using the file ~/.config/git/config.
    I really prefer aliases to have memorable names for common operations in my git workflow.

    For example for your first command I use:

    [alias]
    # git patch -> stage a file by pieces
      patch = "add --patch"
    

    I also have a series of aliases to print lists about git objects, such as branches, remotes, etc:

    # git contributors -> list contributors of a file
      contributors = "shortlog -s -n"
    
    # git branches -> show branches
      branches = "branch -vv"
    
    # git remotes -> show remote repos
      remotes = "remote -v"
    
    # git tags -> show tags
      tags = "log --oneline --decorate --tags --no-walk"
    
    # git stashes -> show stashes
      stashes = "stash list"
    
    # git changes -> show unstaged changes
      changes = "diff --diff-algorithm=minimal -w"
    

    As a handy way to print the aliases that I have configured in the sistem I have

    # git commands -> show list of the aliases in this file
      commands = "!git config -l|grep alias|cut -c 7-"
    

    All the aliases I use can be found in https://gitlab.com/unduthegun/dotfiles/blob/master/git/.config/git/config#L74

    5 votes
  4. Comment on Warcraft III: Reforged—the re-creation of Warcraft III: Reign of Chaos and Warcraft III: The Frozen Throne—is now available worldwide in ~games

    undu
    Link Parent
    It's not, it's a complete and utter disaster. The original Warcraft 3 has been replaced with Reforged while removing features that people have complained about their games since Starcraft 2. And...

    It looks like they did an impressive job with remastering the game

    It's not, it's a complete and utter disaster. The original Warcraft 3 has been replaced with Reforged while removing features that people have complained about their games since Starcraft 2. And that's just the beginning of how it's being mishandled, read https://tildes.net/~games/lch/warcraft_iii_reforged_the_re_creation_of_warcraft_iii_reign_of_chaos_and_warcraft_iii_the_frozen#comment-4imv for more information

    9 votes
  5. Comment on FreeBSD is an amazing operating system in ~comp

    undu
    Link Parent
    I'm not arguing that it's not possible, I'm saying it's not without effort, like you're saying.

    It's absolutely possible to install relatively modern GNOME on it.

    I'm not arguing that it's not possible, I'm saying it's not without effort, like you're saying.

    1 vote
  6. Comment on FreeBSD is an amazing operating system in ~comp

    undu
    Link
    Can't agree with quite a bit of what he's saying, especially with the "no third-party code and can never be broken because of those" when he talks about using FreeBSD on a desktop computer. The...

    Can't agree with quite a bit of what he's saying, especially with the "no third-party code and can never be broken because of those" when he talks about using FreeBSD on a desktop computer.

    The use-case ecessitates a DE like GNOME, which has historically been adopting exclusively systemd interfaces, which the *BSDs do not support, potentially making it unusable as a desktop computer.

    2 votes
  7. Comment on What gaming trend or trope needs to die in 2020? in ~games

    undu
    Link Parent
    It's not once you take into account how they get ahold of the copies they review, who advertises on their page, or who gives them game goodies. (It's the gaming industry, and it's why I haven't...

    Seems like a pretty big oversight on the part of the authors to not mention even one of the many predatory practices that have become common in the gaming industry

    It's not once you take into account how they get ahold of the copies they review, who advertises on their page, or who gives them game goodies.

    (It's the gaming industry, and it's why I haven't trusted this kind of publications for years)

    3 votes
  8. Comment on Epic Games Store holiday sale has started - sales, one free game per day, and $10 off on everything $14.99+ in ~games

    undu
    Link Parent
    Why? It's not difficult to understand how exclusives are not good for anybody in the long term, or how poor is the Epic Game Store compared to any other shop. Even the xbox application added...

    I really am baffled by people who don't like the epic game store.

    Why? It's not difficult to understand how exclusives are not good for anybody in the long term, or how poor is the Epic Game Store compared to any other shop. Even the xbox application added achievements. Epic's PR post about what they have accomplished in the last year is piss poor, even more when taking into account about all the promises they made on the trello board: https://www.epicgames.com/store/en-US/news/egs-end-of-year-dev-update

    Personally, epic does not support Linux at all, so any exclusive game there is another inaccessible game for me.

    16 votes
  9. Comment on Day 9: Sensor Boost in ~comp

    undu
    Link
    Used today to clean up the intcode VM and convert it to using the result monad instead of exceptions inside the VM. Now that the step function, that calculates state according to the previous one...

    Used today to clean up the intcode VM and convert it to using the result monad instead of exceptions inside the VM. Now that the step function, that calculates state according to the previous one is stateless, it should be quite simple to go for day 7 part 2.

    Intcode module
    type reason = Halt | Input | UnknownOpCode of int | UnknownMode of char
    
    type registers = { pc : int; base : int }
    
    module IntMap = Map.Make (Int)
    
    type t = {
        memory : int IntMap.t
      ; registers : registers
      ; input : int list
      ; output : int list
    }
    
    let memory_of_list (mem : int list) =
      mem |> List.mapi (fun i x -> (i, x)) |> List.to_seq |> IntMap.of_seq
    
    let get_cell memory position =
      match IntMap.find_opt position memory with Some value -> value | None -> 0
    
    let value_read state value = function
      | '0' -> Ok (get_cell state.memory value) (* absolute *)
      | '1' -> Ok value (* immediate *)
      | '2' ->
          Ok (get_cell state.memory (state.registers.base + value)) (* relative *)
      | mode -> Error (UnknownMode mode)
    
    let value_write state value = function
      | '0' -> Ok value (* immediate *)
      | '2' -> Ok (state.registers.base + value) (* relative *)
      | mode -> Error (UnknownMode mode)
    
    let update (memory : int IntMap.t) address value =
      IntMap.add address value memory
    
    let step (state : t) =
      let ( >>= ) = Result.bind in
      let pc, base = (state.registers.pc, state.registers.base) in
      let pc_value = get_cell state.memory pc in
      let op = pc_value mod 100 in
      let mode = pc_value / 100 |> Printf.sprintf "%03u" |> Utils.string_rev in
      let cell_read value mode = value_read state value mode in
      let cell_write value mode = value_write state value mode in
    
      let arithmetic (func : int -> int -> int) =
        let op_left = get_cell state.memory (pc + 1) in
        let mode_left = mode.[0] in
        let op_right = get_cell state.memory (pc + 2) in
        let mode_right = mode.[1] in
        let op_target = get_cell state.memory (pc + 3) in
        let mode_target = mode.[2] in
        cell_read op_left mode_left >>= fun left ->
        cell_read op_right mode_right >>= fun right ->
        cell_write op_target mode_target >>= fun target ->
        let memory = update state.memory target (func left right) in
        Ok { state with memory; registers = { pc = pc + 4; base } }
      in
      let jump comp =
        let pc, base = (state.registers.pc, state.registers.base) in
        let op_left = get_cell state.memory (pc + 1) in
        let mode_left = mode.[0] in
        let op_right = get_cell state.memory (pc + 2) in
        let mode_right = mode.[1] in
        cell_read op_left mode_left >>= fun left ->
        cell_read op_right mode_right >>= fun right ->
        let next = if comp left then right else pc + 3 in
        Ok { state with registers = { pc = next; base } }
      in
      let boolean comp = arithmetic (fun a b -> Utils.int_of_bool @@ comp a b) in
    
      match op with
      | 99 -> Error Halt
      | 1 -> arithmetic ( + )
      | 2 -> arithmetic ( * )
      | 3 -> (
          match state.input with
          | [] -> Error Input
          | in_value :: input ->
              let op_value = get_cell state.memory (pc + 1) in
              let mode = mode.[0] in
              let registers = { pc = pc + 2; base } in
              cell_write op_value mode >>= fun position ->
              let memory = update state.memory position in_value in
              Ok { state with memory; registers; input } )
      | 4 ->
          let op_value = get_cell state.memory (pc + 1) in
          let mode = mode.[0] in
          let registers = { pc = pc + 2; base } in
          cell_read op_value mode >>= fun out_value ->
          let output = out_value :: state.output in
          Ok { state with registers; output }
      | 5 -> jump (( <> ) 0)
      | 6 -> jump (( = ) 0)
      | 7 -> boolean ( < )
      | 8 -> boolean ( = )
      | 9 ->
          let op_value = get_cell state.memory (pc + 1) in
          let mode = mode.[0] in
          cell_read op_value mode >>= fun base_offset ->
          let registers = { pc = pc + 2; base = base + base_offset } in
          Ok { state with registers }
      | op -> Error (UnknownOpCode op)
    
    let run_until_halt ~memory ~input =
      let rec loop state =
        Result.fold (step state) ~ok:loop ~error:(function
          | Halt -> state
          | Input -> raise (Failure "Expected more input items")
          | UnknownOpCode op ->
              raise
                (Invalid_argument (Printf.sprintf "Processed unknown opcode: %i" op))
          | UnknownMode mo ->
              raise
                (Invalid_argument (Printf.sprintf "Processed unknown opcode: %c" mo)))
      in
      loop
        {
          memory = memory_of_list memory
        ; registers = { pc = 0; base = 0 }
        ; input
        ; output = []
        }
    
    The exercise itself was pretty mundane, however:
    Part 1 and 2
    let input =
      Utils.read_lines ~path:"input"
      |> List.hd
      |> String.split_on_char ','
      |> List.map int_of_string
    
    let () =
      let memory = input in
      let out_1 = (Intcode.run_until_halt ~memory ~input:[ 1 ]).output in
      let out_2 = (Intcode.run_until_halt ~memory ~input:[ 2 ]).output in
    
      Printf.printf "Part 1: %u\n" (List.hd out_1);
      Printf.printf "Part 2: %u\n" (List.hd out_2)
    
    2 votes
  10. Comment on Day 6: Universal Orbit Map in ~comp

    undu
    Link
    I enjoyed this one, unlike some others, many people are using graphs when they are not needed at all. A dictionary (map) and two sets is all that's needed to solve this one. Part 1 and 2, OCaml...

    I enjoyed this one, unlike some others, many people are using graphs when they are not needed at all.
    A dictionary (map) and two sets is all that's needed to solve this one.

    Part 1 and 2, OCaml
    let input =
      Utils.read_lines ~path:"input"
      |> List.map (fun line ->
             Scanf.sscanf line "%s@)%s" (fun pre post -> (post, pre)))
    
    module StringMap = Map.Make (String)
    module StringSet = Set.Make (String)
    
    let rec count_orbits acc orbit_map = function
      | "COM" -> acc
      | corpus -> count_orbits (1 + acc) orbit_map (StringMap.find corpus orbit_map)
    
    let rec full_path acc orbit_map = function
      | "COM" -> acc
      | corpus ->
          full_path (StringSet.add corpus acc) orbit_map
            (StringMap.find corpus orbit_map)
    
    let path_to corpus orbits =
      full_path StringSet.empty orbits (StringMap.find corpus orbits)
    
    let () =
      let orbits_around = input |> List.to_seq |> StringMap.of_seq in
    
      let orbits_length =
        StringMap.map (count_orbits 1 orbits_around) orbits_around
      in
    
      let n_orbits = StringMap.fold (fun _ acc k -> acc + k) orbits_length 0 in
    
      let path_to_you = path_to "YOU" orbits_around in
      let path_to_san = path_to "SAN" orbits_around in
    
      let n_transfers =
        StringSet.cardinal (StringSet.diff path_to_you path_to_san)
        + StringSet.cardinal (StringSet.diff path_to_san path_to_you)
      in
    
      Printf.printf "Part 1: %u\n" n_orbits;
      Printf.printf "Part 2: %u\n" n_transfers
    

    The Utils function used can be seen in https://gitlab.com/unduthegun/adventofcode2019/blob/master/00/utils.ml

    2 votes
  11. Comment on Advent of Code 2019 in ~comp

    undu
    Link Parent
    Yep, they do. First day was easy, third is not obvious at all

    Yep, they do. First day was easy, third is not obvious at all

    3 votes
  12. Comment on Why Spelunky is the most important game of the decade in ~games

    undu
    Link
    Very low quality writing, unfortunately. It doesn't even explain what parts of its design make it so pivotal. The article never mentions the genre in question: roguelike

    Very low quality writing, unfortunately. It doesn't even explain what parts of its design make it so pivotal.

    This refined Spelunky revived an underappreciated genre

    The article never mentions the genre in question: roguelike

    21 votes
  13. Comment on Diablo IV announced at Blizzcon 2019 in ~games

    undu
    Link Parent
    It's still very early, the influence of Diablo 3 weights heavily on the actual gameplay of the demo. I do not think it's better the current arpgs (grim dawn, path of exile) but it has potential...

    It's still very early, the influence of Diablo 3 weights heavily on the actual gameplay of the demo. I do not think it's better the current arpgs (grim dawn, path of exile) but it has potential nevertheless.

    I wish the spells had more creative ways of being cast (mobas have innovated on that with vector targetting, for example), but it feels like everything has to be able to fit into a gamepad.

    The open worls seems heavily targeted to have an always-online game. I don't think it's something that fits these kind of games, at least the core aspects of it. (They talk about horror aspects of the game, being alone was a core part of that in the first 2 games)

    7 votes
  14. Comment on Model-View-Catharsis: MVC was a mistake in ~comp

    undu
    Link Parent
    For the tree representing the state of the UI, and working on it incrementally here's a video explaining it: https://www.youtube.com/watch?v=R3xX37RGJKE

    For the tree representing the state of the UI, and working on it incrementally here's a video explaining it: https://www.youtube.com/watch?v=R3xX37RGJKE

    1 vote
  15. Comment on What editor/IDE do you use? in ~comp

    undu
    Link
    I use neovim with several plugins for searching, autocompletion and linting: https://gitlab.com/unduthegun/dotfiles/tree/master/nvim/.config/nvim I use it for editing OCaml, C and Python, as well...

    I use neovim with several plugins for searching, autocompletion and linting: https://gitlab.com/unduthegun/dotfiles/tree/master/nvim/.config/nvim

    I use it for editing OCaml, C and Python, as well as viewing logs and manpages.

    Right now I'm waiting on the tree-sitter integration which will hopefully make syntax highlighting better. But it's more than enough for editing projects with hundreds of thousands of lines and I'm happy with it.

    6 votes
  16. Comment on An Illustrated Guide to Useful Command Line Tools in ~comp

    undu
    Link Parent
    I use quite a few of them at work. They are not just what you say. They are also easier to use than the tools they replace. It saves me from remembering recipes and concoctions to do determinate...

    I am disappointed that most of these are just “X with syntax highlighting”.

    I use quite a few of them at work. They are not just what you say. They are also easier to use than the tools they replace. It saves me from remembering recipes and concoctions to do determinate actions with the tools, avoiding many usages of man and in general they save time.

    7 votes
  17. Comment on Website Reader Friendly Fonts? in ~design

    undu
    Link
    I'm quite fond of Palatino for reading articles onscreen. There quite a few clones freely available, like TeX Gyre Pagella or P052.

    I'm quite fond of Palatino for reading articles onscreen. There quite a few clones freely available, like TeX Gyre Pagella or P052.

    4 votes
  18. Comment on Reinventing Home Directories in ~tech

    undu
    Link Parent
    This system is incompatible with many usecases of SSH, it's pretty clear on the Q&A session

    I don't think that's planned. Where did you see that?

    This system is incompatible with many usecases of SSH, it's pretty clear on the Q&A session

    3 votes
  19. Comment on Sunsetting Mercurial support in Bitbucket in ~comp

    undu
    Link Parent
    It's not easy to see what VCS is a repo stored in unfortunately. There's also no automated way to migrate repositories. Seems like Atlassian has already put mercurial in bug-only maintenance mode...

    It's not easy to see what VCS is a repo stored in unfortunately. There's also no automated way to migrate repositories.

    Seems like Atlassian has already put mercurial in bug-only maintenance mode and is eager to pull the plug off.

    8 votes
  20. Comment on I386 architecture will be dropped starting with Ubuntu 19.10 in ~tech

    undu
    Link Parent
    For anyone curious as to why that is not encouraging: The solution requires an additional, dedicated GPU to have good performance. It's simply an unacceptable solution and shows they do not care...

    For anyone curious as to why that is not encouraging: The solution requires an additional, dedicated GPU to have good performance.

    It's simply an unacceptable solution and shows they do not care in the slightest for gaming on Linux, which is very shirtsighted, IMO.

    7 votes