« first day (4509 days earlier)      last day (335 days later) » 

1:26 AM
> Found candidate GCC installation: /usr/bin/../lib/gcc/arm-linux-gnueabihf/10
ಠ_ಠ
 
1:48 AM
0
A: "Hello, World!"

noodle manShasta v0.0.5, 24 bytes (print["Hello, World!"]) Shasta is a new programming language I've been developing for the past couple of days, and I've finally got it to a state where I can start to answer some challenges on the site here. It is inspired by Lisp and Python, and transpiles to JavaScript...

 
@Hello,World! this is the language i've been working on for the past week :)
it's still in very early development though. lots of stuff i still have to implement
 
I have discovered something cursed about node
$ node.exe -e 'require("fs").writeFileSync(1, "ü", "utf8"); console.log("ü")'
├╝ü
On Windows, writeFileSync to a TTY uses CP-437, but writeFileSync to disk and console.log both use UTF-8
 
2:04 AM
that's interesting. on my mac i get "üü"
 
Yeah, CP-437 is a DOS thing that some Windows programs are left to deal with
 
2:24 AM
i guess the weird part is that the two output methods don't work the same
 
2:41 AM
@Bbrk24 ooh that's the joys of Unicode in powershell
Scala does that too
Well, sbt
Unicode mangling sure is fun
Especially when you're working on an esolang where at least 100 commands are Unicode
Interestingly, it doesn't happen when using WSL
Oh and it also auto-normalises some characters too
There is nothing that turns that subscript into a literal 8
in Vyxal, Nov 13, 2022 at 3:26, by lyxal
sbt:root> vyxalJVM/run --code "3 3 ×"                                                                                                  [info] running vyxal.Main --code "3 3 ×"                                                                                               Group(List(Number(3), Number(3), Command(×)))                                                                                          9
That should be 3 3 × but powershell turns it into ├ù upon pasting
It's weird that some programs do it, and some don't
 
2:58 AM
imagine using windows 😎
i just learned how to use those arrow brackets in the shell. i am hackerman
 
3:30 AM
@lyxal This is bash in mintty
 
looks awfully similar to powershell
 
I use the solarized dark theme :P
@noodleman What sucks is I don’t have a modern unixlike desktop OS so I can’t actually know whether some things work elsewhere
 
@Bbrk24 powershell mangles ü the exact same way in some applications
 
I am aware
 
 
2 hours later…
5:40 AM
Can anyone confirm if badge ids are consistent across the network?
 
 
1 hour later…
6:41 AM
@mousetail They're not. Fanatic is #23 on CGCC and #83 on SO
I'm pretty sure it's just in order of first awarded
So #1 is the first awarded badge, etc.
 
Oof that's annoying
 
7:18 AM
@lyxal is that vyxalJVM the unmistakable sign of sbt-crossproject?
@lyxal s.replaceAll(raw"\\", raw"\\\\")
 
@RubenVerg it sure is
Jvm, native and js
Triplatform compilation!
@RubenVerg yeah that was suggested in code review
 
@lyxal nice
 
@RubenVerg there's also Mill support
Because mill is pretty neat
 
stuq has api, std and cli subprojects each with js, jvm & native
idea goes mad every time I open the project
 
Yikes 3 different subprojects. That's gotta cause some sort of version difference headaches :p
Managing things like regex disparity between jvm and native is bad enough on one subproject yet alone 3 of them lol
I was lucky enough to have (and, well, continue to have) @user to help navigate through the finer details of cross platform
 
7:32 AM
I haven't used any regex yet
where do you use it?
 
The lexer, and just other things that require splitting on regex
Problems range from "oh dang convenient regex feature isn't supported by native oh well that's okay" to "why the actual hell does splitting a string on an empty regex append an empty string to the result in native but not in jvm"
If you want some inspiration for how to do 3 platform stuff, github.com/Vyxal/Vyxal/tree/v3-momentum-branch-1 is where it's all at
Oh yeah and file reading
That's a fun thing to manage when doing 3 target work
Especially given that js doesn't have a concept of being able to read files from arbitrary paths and all the good file reading classes are jvm specific
To quote myself:
in Vyxal, Mar 14 at 1:07, by lyxal
If it was just jvm and js, that'd probably be okay. If it was just jvm and native, that'd also probably be okay. But the three altogether? You're pandering to a really weird intersection of limitations
in Vyxal, Mar 14 at 1:08, by lyxal
With documentation that isn't as nice as you'd want it to be
It's doable but can be a nuisance sometimes :p
 
7:47 AM
@lyxal that's why the cli and std are separate modules from the api (api here stands for the actual interpreter)
 
Yeah that's what we ended up doing too
 
iirc I have zero platform-specific code in the api
std has an entrypoint for platforms to mix their platform specific stuff into the standard library
and obviously the cli is full of platform specific code
 
@RubenVerg We don't either, but sometimes there'll be something you want to write and it'll be easy to do with jvm but putting it in the shared stuff will cause problems
 
I know that feeling :)
 
Too true :p
 
7:53 AM
why github.com/Vyxal/Vyxal/blob/v3-momentum-branch-1/shared/src/… when you can do like while current.isWhitespace do skip() or something?
 
Oh that's to tell the parser library what to ignore
We use combinator parsers
 
aa
nice
hadn't read enough of the code :)
 
And we would have used it for the parser too, but it turns out the grammar is a teeny bit complex for combinators
 
does raw""" """ do anything different than just """ """ or raw" "?
 
I would assume not
 
 
1 hour later…
9:02 AM
Quiz: which is better?

`if password==“password”:…`
or
`if sha512(password)==“b109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706a8bb980b1d7785e5976ec049b46df5f1326af5a2ea6d103fd07c95385ffab0cacbc86”:…`
 
 
2 hours later…
10:57 AM
@PlaceReporter99 The second one but both are bad
You shouldn't hard code password hashes in your source code
 
11:11 AM
@mousetail but hash functions are (usually) irreversible.
 
Passwords are guessable though
If they have the hash they get unlimited guesses
 
@mousetail it's gonna take years*
 
Nope
Tools like Jack the Ripper can crack most passwords in minutes
If unsalted
 
*assuming you don't use a very common password.
Ideally, use a random one
 
You'd need a very long truely random password that nobody has used before
 
11:14 AM
@mousetail i assume that is illegal to use
 
Nope
It's on github
it tries common passwords but also things like dictionary words and common substitutions and variations of those. If your password is somewhat similar to a word or a combination of words it will be cracked quite fast
 
@mousetail But if your password was asajgrowihty5u849qiuta9piou49aoigruj[0oruya09oyu6340a[yu90iy934uya349uy[934u9[yuw0aruapi9ruy[-'4isfoit[awptia;4iyia0ytiaruy9aeitre9auy90eruy9euy09eury09euryaeuy0aeriou9e0yay9u09auur900iyaero,;k.,[[u.<><.</.,><.,.,.,.[,.''j[.,>ll,hhlclxl\,gls;glds;
 
That's not very random
 
@mousetail i was mashing my keyboard
 
Pretty sure that's just 4 common passowrds pasted together
Mashing your keybord is not a good way to create a random password
the patterns are obvious
It will probably take a bit to crash just because of how long it is though
 
11:17 AM
@mousetail *John
 
@lyxal you are correct
 
Well yes because I have the repo opened in one tab and a news article explaining it opened in another :p
@mousetail that's right - it's like how you can usually tell whether a series of say 20 coin flips is truly random or made up
Because humans are horrible at doing random
 
For coin flips it's usually a suspicious lack of patterns. If there isn't any 3 in a row then it's probably made up
 
That's what I mean
We have the wrong idea of random
In "randomly" mashing, we think we're creating something random when it's easy to tell it isn't
 
11:33 AM
@mousetail how about 53,<)8nH$E,n~~C!QQ£igI$TgpRh^£|a¬7\\/Z5;!y(£{~c"HDm1TdF8i/tBpM-JDvz|~RpKg"y*wu*^KSoACEM749wrJa)zf7EM/ (not made by mashing keyboard)
 
Will probably take a while but why not just put it in your .env?
Avoid the risk
 
@mousetail what's a .env?
you mean like github secrets?
 
Yea like that
 
@mousetail what if you double hash (like sha512(sha512("hello!")))
 
Generally not recomended
 
11:37 AM
@mousetail why not?
 
Actually you shouldn't use sha at all, there are special password hashing algorithms
934
Q: How to securely hash passwords?

AviDIf I hash passwords before storing them in my database, is that sufficient to prevent them being recovered by anyone? I should point out that this relates only to retrieval directly from the database, and not any other type of attack, such as bruteforcing the login page of the application, keylo...

 
@mousetail but would it still be "not recommended" if i replaced sha512 with special-password-hashing-algorithm?
 
Yea
Those algorithms already have optimized the best settings
Though you can configure the number of iterations of you want to
They internally use sha many times but in a more complex way
 
Even better random password: `ëq-¿3·y6kì¯=£h¯=´~”ò£}KK¼â»öcF
åp‘Îjzo;Š^ÊSsëÂî/‡º™þû{lَÃx9j3¦7ʁx9õ— Ž64­­²FˆÁ}ˆ˜+¶'÷\QI|øëÇUpN§›ø$܁ë
‘Æ°è8槄ðIÒ÷œC=:¾|ÍÖbîÃfÆ@z”g“éäg'F°GP%à1ô˜?­ý(«™ŽUbú†–ç«eŠ-c8 èô¹“ÇÒð`!Eù["øôüµ&Ž@4ÑÖeÞW¶#¯$~èuk^¬n¾áƒZ¹ #6ŽRÅZ¼à.x ¯÷ˆ¦¸ô
\ÿÄËïsRÜܵس¿ ª¡‰‹¥ÙÊðn©U !.“½„ R·».ÍðñC›Di=Ö"w žNE¾údeíÔ={u¿gu¯²ïIœ*rûÇëq÷Ýé×jVøûÑ»>›ÿÞ?£(«”‰;1[­Â+T¦nC_3.¿n9L¤„1ÎÎÄBä‘2·/cëª/Š69¼Ð'Ó»ëMUÖÄ ¤ÿ´cþ½ÌjnÛù¤KL Ŭ۔ 2ZW›9¾Ç®®YŽÀ£©ÑZR|à‘·
I must remember the chinese password: 丞糲撸蹴椴頨絫靍烚錁
 
 
2 hours later…
1:42 PM
Apparently pronounced “Chéng lì lū cù duàn yǔ lěi hè xiá guǒ”
 
@PlaceReporter99 both are bad
why are you even hardcoding passwords
 
2:33 PM
is anyone here familiar with TypeScript? I'd like to use it for STDW but I have no clue how to do it
to clarify, I don't mean "how do I write TypeScript code"; I mean "how do I install TypeScript and use its tooling"
actually I think I've figured it out, nvm
> this.element = (<HTMLElement>(<HTMLTemplateElement>document.getElementById("device-template")!).content.cloneNode(true)).querySelector("div")!
this is going pretty much as I thought it would
 
2:49 PM
@Ginger You shouldn't have to do all that casting
 
probably not
but I come from the land down under of Kotlin and Python
 
Doesn't document.getElementById return an any or something?
 
it returns an HTMLElement
 
Oh
 
but I need an HTMLTemplateElement
 
2:59 PM
@Ginger if you do document.querySelector("template") it should infer the type
 
hmmm
 
i think it would be HTMLTemplateElement | null, so you can use the ! assertion
 
@noodleman I've only got one template, so this would work, but it feels kinda hacky to me
 
@Ginger ewww bracket casts
 
please don't kill me I'm new to this
 
3:02 PM
they're kinda outdated
use value as type instead
 
@Ginger ok how's this: (document.getElementById("device-template") as HTMLTemplateElement).content.cloneNode(true).querySelector("div")
 
@noodleman that's just different syntax :p
 
no i got rid of the unnecessary casts
 
I would do document.querySelector<HTMLTemplateElement>('#device-template').content.cloneNode(true).querySelector('div')
using q/s in the first one allows you to use generics
 
that's what I just changed it to do lol
 
3:04 PM
ah yes i forgot about that. to be fair i haven't used typescript with vanilla html in quite a while
 
hmm, I'm not actually sure if what cloneNode gives me can be safely casted to an HTMLElement
 
@RubenVerg And apparently conflict with JSX syntax (in case Ginger needs more motivation to use as)
 
it ostensibly returns a Node
 
@user oh right JSX for vanilla is really fun
just write your own factory
 
and I've had weird issues with template.cloneNode returning document fragments and such
 
3:06 PM
(
  document
    .querySelector<HTMLTemplateElement>("#device-template")!
    .content.cloneNode(true) as DocumentFragment
).querySelector("div");
 
what's JSX? what's a "factory"? all I wanted to do was have JS but with typechecking and now I feel like I've opened a portal to a realm filled with horrors beyond my understanding
@noodleman this works, thanks
 
JSX is javascript with html syntax added, ReactJS invented it and has stuck withi the ecosystem ever since
 
AAAAAAAAA
 
actially this documentation is awful
 
3:07 PM
I think I'm going to ignore that and stick with what I have now
clearly web development has changed in the last few years
 
jsx is just a thing to write html-like code inside your typescript
 
i think they're redoing the JSX types in the next ts version but ye
 
the factory is just the function that TypeScript compiles it to
so like <hi>hello</hi> compiles to factory('hi', 'hello', {}) or whatever I can't remember now
 
why would you want that
what is the purpose of it
 
well it's nicer than writing 91 createElements
I use tsx often in like custom html elements
compare:
   const el = document.createElement('div');
   const sp = document.createElement('span');
   el.appendChild(sp);
   sp.textContent = 'hello world';
   sp.classList.add('red');
const el = <div><span class='red'>hello world</span></div>
 
3:11 PM
@lyxal We don't actually have entirely separate projects for the CLI and interpreter (I assume by modules, RubenVerg meant different sbt projects). We just have separate JS, JVM, and Native projects but the CLI's in the shared project since it doesn't do any platform-specific stuff (yet), I think
 
there is also what i call the scalatags approach obviously, const el = div(span(['class', 'red'], 'hello, world')) or whatever
 
I love how in the Java world, modules mean what others refer to as packages, and packages mean what others refer to as modules
 
@user yes I have three subprojects so like lazy val std = crossProject(...).in(file("std")) etc and then an aggregate root
 
@RubenVerg As much as I would prefer that over the verbosity of HTML, it's nice to be able to just copy HTML from somewhere into your JSX project
I tried Scalatags for a Scala.js project and it was hell, had to go back to HTML and a bit of JS
Actually, Scalatags mainly sucked for me because I was trying to port a big HTML file (and lots of JS) to Scala. Maybe writing it from scratch would've been more fun
 
@Ginger if it's too much you can always revert to JSDoc comments with // @ts-check pragma at the top of your file
 
3:24 PM
no, that'd be even worse
 
i'm not a huge fan of JSDoc but some people prefer it over TS
eh too each their own
 
@user modules are actually almost never used
 
@user I think Scala + ScalaTags is great, but the closest JS equivalents look so bad that it is not worth the hassle
I've never had any issues with porting html to scalatags, 90% of the time a find & replace is enough
@user oh fun in my cli source roots for jvm, js & native I have 3 implementations of a debugger, each with a command-line interface (most of it is in the shared root) and a respectively swing, svelte & gtk gui
must be nice to not constantly break native compilation because ffi is fiddly as hell
 
3:59 PM
aaaAAAAAAAA
ok I need help, but this time with CSS
currently, when the device list is too long it makes the whole page taller:
I want it to scroll instead of doing that
but I don't know how, because I am square brain
 
I struggled with this same thing with the trilangle online interpreter
 
welcome to htmhell
 
on narrower screens, it’s a 1-column layout where the whole thing scrolls; on wider screens, it’s a 2-column layout where each individual panel scrolls
I did get that to work though!
 
that is what I want
 
Feel free to look at my code then
 
4:02 PM
link plz
 
github.com/bbrk24/Trilangle/tree/master/wasm I am typing this from memory on my phone so it might not be quite right
nope that worked
Check out index.html and in.scss specifically
 
the real question is will I be able to make it work with Bootstrap
 
oh bootstrap. ¯\_(ツ)_/¯
 
yeaaah
 
@Ginger put overflow-y: scroll; on the container you want to scroll
 
4:05 PM
@noodleman already did it
 
did it not work?
 
I'm no rube :p
@noodleman it did not
 
throw a height on there
try height: 80vh, it's not perfect but just try it
 
I already did, and that does fix it... kinda
if the height value is small enough it shrinks down to be the correct size
what I want it to do is keep it from being greedy and sucking up the maximum available space
 
if you use display:grid on the parent layout it should be pretty easy
 
4:07 PM
like, if I set height: 1px it'll work
 
I did it and it did not work
@noodleman silence, heathen
I will use whatever framework I wish
 
try tailwindcss, infinitely better
 
I am not going to rewrite my whole UI just to maybe fix this stupidly simple bug
 
im not suggesting that lol
 
4:10 PM
oh, whoops
 
I haven’t touched that UI code in months so don’t expect me to remember anything about it
 
@noodleman bootstrap is so nice for prototyping
 
well, I did it... kinda
 
@noodleman tailwind is the one with objectively bad class names, right?
 
by applying height: 100% to pretty much everything
 
4:14 PM
@RubenVerg [status:didisayihavegoodopinions?]
 
@RubenVerg it makes your HTML look terrible but it makes writing CSS about 100x faster
reasonable tradeoff imo
 
hmm
 
4:28 PM
I hate CSS so much sometimes
the pain is real
 
5:26 PM
@noodleman My main reason for using Tailwind last time I tried making my own website was that I could copy other people's CSS for common elements from tailwindcomponents.com :P
I do hate how so many sites have auto-generated HTML class names so it's impossible to make uBlock rules to block annoying elements
@Seggan I guess they haven't caught on yet but I feel like that's partially because so many Java devs are stuck on Java 8
@RubenVerg oof
Can you use ScalaFX instead of Swing? I thought Swing was super outdated (or at least, that's what a teacher in high school told us, before proceeding to teach us...Swing)
@RubenVerg I mainly had issues with porting buttons and JS that modified elements. There were also some HTML tags that Scalatags didn't support out of the box, so I had to make them myself (that's a minor problem though)
Should've thought of find-and-replace lol
 
@user I kinda dislike both Swing and Scala-/JavaFX so I just went with the one I know the most
though I'm tempted to drop both the jvm and native guis and just ship an electron app or something
@user yeah ok interactivity is somewhat more annoying with scalatags
also anybody know how I can hide some directories/projects in idea?
I especially dislike those js-jvm & js-native & jvm-native target-only roots
 
6:09 PM
@RubenVerg Mark it orange by right-clicking, then I think there's an option in the project view to not show orange directories
 
good enough thanks
 
Hello
I am planning to move my question today if I do not receive more feedback
 
6:54 PM
are gaussian integers an euclidean domain?
 
riley@riley-VirtualBox ~
$ /usr/bin/clang --version
clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

riley@riley-VirtualBox ~
$ clang --version
clang version 13.0.0 (github.com/apple/llvm-project.git f0fb631dd1a3a2988b23ba5057cd9106713cd0b4)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/riley/Documents/swift-5.8-RELEASE-ubuntu18.04/usr/bin
I've barely used this VM how did I mess it up like this already
and why is /usr/bin/clang v6?
 
@Bbrk24 why would you install swift in your documents folder
 
I don't remember
Probably because I just happened to be in ~/Documents when I gunzipped it
 
yeah okay but when you put it in path did you not go "oh I should move this somewhere sensible"
 
Anyone want to guess what my $PATH looks like?
$ echo $PATH
/home/riley/.local/bin:/home/riley/Documents/swift-5.8-RELEASE-ubuntu18.04/usr/bin:/home/riley/.local/bin:/home/riley/.nvm/versions/node/v16.20.0/bin:/home/riley/.local/bin:/home/riley/Documents/swift-5.8-RELEASE-ubuntu18.04/usr/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
 
7:01 PM
weirdly ordered as well
 
This $PATH was brought to you by the Department of Redundancy Department.
 
7:53 PM
@RubenVerg imagine not installing everything in your documents folder
mine is 48 gigabytes
actually it's probably bigger by now
 
8:31 PM
Visual Studio puts new projects in ~/source/repos by default
 
lol my Documents folder is 20.8 MB
And most of that is old college application stuff that my mom insisted I keep on my laptop
 
8:53 PM
wow
 
9:11 PM
0
Q: Can Bitshift Variations in C Minor be compressed down to less than 185 characters?

brubsbyBitshift Variations in C Minor by Robert Miles is a Code Golf music piece written in C (with some additional bash commands). It was originally presented in a 2016 Computerphile video Code Golf & the Bitshift Variations. You can listen to clean renderings of it here (by Lucia Ceionia). The origina...

 
9:50 PM
I wonder if you could use a tool like gzip to compress it meaningfully
since this requires bash glue code anyways
 
gzip with no flags shaves a whopping 1 byte. Not even worth the invocation
gzip -9 is no better
what other cli compression tools do I have lying around
I don't have compress but tar has it built-in...
$ tar -cZ <<<'i;n;g(m,t,o){return("GTj?TG?5"[7&t]+!(n&12|t&2)*9)*i>>o&m&24;}main(s){for(;;)putchar(g(8,n=++i>>14,8)+g(n,n^(s=i>>10)/8,6)+g(n/3,n+s/2%3,6)+g(n/5,n-s%3,5));}' | wc
tar: Cowardly refusing to create an empty archive
Try 'tar --help' or 'tar --usage' for more information.
      0       0       0
that didn't work
xz -9e manages to be longer than the original
 
nice
i wonder if less golfed versions of the code might compress better
 
bzip2 -9 is also longer
 
10:03 PM
I don't have lzip, lzma, lzop, or zstd, even though my tar claims to support them
 
 
1 hour later…
11:13 PM
My current esolang project uses 6 bit per instruction, which would be fantastic for golfing if it weren't otherwise verbose as heck.
 
11:29 PM
᛫ᛋᛚᚷ᛫ᛋᛥᚷ᛬᛫ᛋᚷ᛫ᛚᚷᚩᚩ᛫ᛋᛚᚳ᛫ᛋᛥᚳ᛬ is a super convenient 20 byte method that: Multiplies by 2
 
incredible
i'm surprised how well the runes render in the chat font
 
that seems perfect, I've always hated how overcomplicated most languages make multiplying things by 2
 
It works by looping over the ᛫ᛋᛚᚷ᛫ᛋᛥᚷ᛬ method as many times as possible (Each time spending 1 mana to do so), and each loop increases both ᛋᛚ and ᛋᛥ by one. After which, it converts both of those manas back into mana.
I've got way more runes to assign yet, but I think it's already managed to be Turing Complete
 
Can you do unbounded loops with it?
 
Sure can, ᛋᚷᚩ calls itself endlessly.
 
11:37 PM
@ATaco stán isn't a real rune
stán and cweorð both, but I don't see the latter here
 
I'm 100% just doing it for the aesthetic
Taking inspiration from the runes, rather than authenticity
 
fair enough
 

« first day (4509 days earlier)      last day (335 days later) »