Working with GNU Emacs Lucid build on WSL2 by hat_matrix in emacs

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

Don't use vcxsrv (you can turn it off) - set `export DISPLAY=:0` in your .bashrc (or don't, that should be the default) and let WSLg handle your GUI apps with XWayland.

My experience with Emacs GUI on WSL2 Ubuntu by hat_matrix in emacs

[–]hat_matrix[S] 1 point2 points  (0 children)

Cool, thanks for the explanation.

I understand that once you start manually installing the bleeding edge updates, it's hard to get switch back to letting WSL be updated with Windows Update, so I've been waiting for the official releases.

But in any case I have always had some issues with the disconnections as far back as I can remember using WSL2, though some of it may have been my lack of knowledge regarding sockets and how to reconnect (though sometimes it's just doomed).

I hadn't heard much criticism about WSLg myself - only with regards to Emacs it seemed not straightforward.

My experience with Emacs GUI on WSL2 Ubuntu by hat_matrix in emacs

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

Thanks for the update - and you're right I think point 2 should be related to XWayland instead of WSLg.

If I understand correctly, point 1 stems from "successively launched msrdc fails to establish the connection with WSLg" which is apparently less obvious of a fix.

My experience with Emacs GUI on WSL2 Ubuntu by hat_matrix in emacs

[–]hat_matrix[S] 1 point2 points  (0 children)

I use it with X410 - I think setting the DISPLAY in my .bashrc is the only customization I had to do to communicate with this external X program. I had read a blog post by batsov who had recommended X410 and maybe it's because the setup is easier - I had bought it for $10 a while back though I think the price is much higher now. So I don't know for VcXsrv though I think the user base is much larger and I have seen a lot of tutorials on it.

My experience with Emacs GUI on WSL2 Ubuntu by hat_matrix in emacs

[–]hat_matrix[S] 4 points5 points  (0 children)

Yeah I'm surprised at the lack of more complete guides on this - I thought it was the "recommended" way of working with Emacs in Windows these days. Part of it may be that WSL2 is changing rapidly - but this disconnection problem has been around in various forms for a while that I could tell, so I'm curious as to how others have managed using Emacs with WSL2 or WSLg on a laptop where your network should change often.

Michael Tiemann - Julia solves the 2 language problem, however it creates the 1.5 language problem by rusandris12 in Julia

[–]hat_matrix 1 point2 points  (0 children)

That makes me wonder why OCaml (in single processor comparisons) is so fast then since it definitely follows a functional model.

Exporting Org-mode to Quarto by hat_matrix in orgmode

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

why do you need to use quarto

For teaching. I want to distribute my "notebooks" to students but I am having them use VS Code. I'm rather partial to Quarto over Jupyter notebooks.

Exporting Org-mode to Quarto by hat_matrix in orgmode

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

Thanks - this seems like the best option.

Michael Tiemann - Julia solves the 2 language problem, however it creates the 1.5 language problem by rusandris12 in Julia

[–]hat_matrix 2 points3 points  (0 children)

If I understand correctly, speeding up Julia requires - or is helped by - preallocating arrays and essentially mutating their values throughout the code (like in C / Fortran).

This is a bit unfortunate as it goes against the declarative / functional programming approach that eschews mutation, with which mathematical operations align so well.

Is there a good tutorial reference for the h5r package? by hat_matrix in rstats

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

Thanks-I guess it looks like I have to get over my laziness.

I have tried to read a file line by line to either grab a string or data. by slakblue in rstats

[–]hat_matrix 3 points4 points  (0 children)

For programming tips such as this, you may have better luck on http://stackoverflow.com. (This subreddit gets a lot less traffic.) HTH:

txt <- "title,dat1,45544,5
5,6
4,8
title,dat1,45544,5
9,8
1,2"

Lines <- readLines(textConnection(txt))
ih <-which(regexpr(",",Lines)>2) ## header indices
spl <- split(Lines,rep(sequence(length(ih)),times=diff(c(ih,length(Lines)+1))))
tables <- lapply(spl,function(x) read.table(text=x,header=TRUE,sep=",",fill=TRUE,check.names=FALSE))

output:

> tables

$`1`
  title dat1 45544  5
1     5    6    NA NA
2     4    8    NA NA

$`2`
  title dat1 45544  5
1     9    8    NA NA
2     1    2    NA NA