« first day (4602 days earlier)      last day (538 days later) » 

00:44
@lyxαl :o
@lyxαl wait wdym Java only allows one process?
more specifically, the java runtime environment
it allows only one process, but multiple threads
iirc Java has a ProcessBuilder class and everything
So when I run java foo and java bar in two separate terminals, both of them run as separate threads in the same JVM?
That doesn't sound right
> Most implementations of the Java virtual machine run as a single process. A Java application can create additional processes using a ProcessBuilder object.
Huh
I wanna interpret that to mean that each instance of the JVM only takes up one process but you can make multiple instances
I would be disturbed by this but I'm too sleepy to care so o/
 
1 hour later…
02:25
0
Q: Order by Earliest Lower Digit

thejonymysterGiven two strings of digits, determine which string, if any, has the earliest digit which is lower than the other string's digit at the same index. Do note that this differs from alphabetization, as shown in the following examples: Examples Given inputs 12345000 and 1233999999, the second string ...

02:35
@NewPosts is this comment on this question reasonable? like i completely get where its coming from, but is that in the spirit of like, code golf?
i like the concept, but i dont want to open up a million different special cases :P
looks reasonable as an extension of output
I guess this would work: 1) the standard output method of three-way comparison of your language of choice (if exists) or 2) three distinct and fixed values for three possible outputs
ok works for me :) thank youuuu
also because i never have a chance to bring it up: i keep thinking your icon is an orange frog but then i look again and its not that
oh lol
@hyper-neutrino But if all that Tim is is Tim, is that really an identity at all?
timisistimis sounds like some weird disorder
02:43
tih-mississ-tim-iss
Yeah kinda does
03:09
@thejonymyster actually, it's an among us reference
As you can see, the amongus is quite hidden but still there
I dunno lyxal, that's a little bit sussy. Have you considered any alternatives?
sussy?
you're the sus one
I see. A better world isn't possible after all.
 
5 hours later…
08:05
0
Q: Sum of consecutive nth powers

MTNRelated. Given a positive integer \$n\$, output all integers \$b\$ (such that \$1<b<n-1\$) where \$n\$ can be written as the sum of any number of consecutive powers of \$b\$. Example: Let's say \$n=39\$. \$3^1+3^2+3^3\$ \$= 3 + 9 + 27\$ \$= 39\$ This does not work for any other \$b\$, so our ou...

08:21
Given interact lib {i=(i+1)mod n, i=(i+n-1)mod n, A[i]=c, query A[i]}, get n. Fewest call to these wins.
Inspired by someone else
09:13
@thejonymyster I keep thinking it’s a heron.
CMC: Given a number, print a list containing an empty list as the first item, and a singleton list containing the input number as the second.
Inspired by randomly mashing the Vyxal keyboard.
@lyxαl what about me?
Ah wait you’re gonna put monkey in a suit, aren’t you?
 
1 hour later…
10:37
@TheEmptyStringPhotographer among
Oh dear, I appear to have an amongfoot infection…
 
2 hours later…
12:15
@Ginger
[half-byte] sponge
certified salesman moment
@lyxαl mogus ⁉️
@Ginger sus!
💥
jermerj moment
12:32
time to move this to TST
12:56
Is putting e ??= window.event at the top of my event listeners really necessary or is w3schools doing some nonsense
@Bbrk24 Not in modern browsers, might be needed for very old IE
I'm not going to pretend to support older IE anyways
Also, if all the code lives in a single JS file, there's no practical difference between onevent = ... vs addEventListener('event', ...) is there?
there's a difference at all???
I prefer addEventListener since things like browser extensions etc. can also add events that you don't want to overwrite
JS continues to astound me
13:01
@Ginger The latter lets you add multiple functions, while doing the former multiple times overwrites the listener
bruh
relevant if you're in a library
of course that's how it works
not if one file controls all the code
Using addEventListner is just good practice, can't break anything else. Same file or not
13:03
@mousetail Mm, fair point. I'll see how difficult it is to refactor (some places I use = null instead of removeEventListener and I'm not sure how difficult that would be)
You need to keep track of the ID of the event listener you add in order to be able to remove it which can be a bit annoying
yeah so I might not be able to easily change all of them
@Bbrk24 what would I need to be listening for in a library? I thought the whole point of a library is that you don't talk and only read books. There wouldn't be anything to hear.
Also did you see what I did with the debugger play/pause feature? Should be better than spam-clicking “step”
Some libraries are intended to be triggered by certain HTML elements, not scripts
They are mostly used to people who can't code
13:11
next thing I need to figure out is breakpoints
how the heck do I make breakpoints work for a 2D esolang?
like UI-wise, what would that look like?
Do breakpoints only work in a specific direction? Or for a cell regardless of direction
@TheEmptyStringPhotographer Ruby, 11 bytes: ->x{[[],x]}
That’s a good question, actually.
Could you make a 2d language that instead of hexagons or squares used a penrose tiling
oh no
How would that work? There’s so many things I wouldn’t know what to do
13:19
i can't imagine that being a 2d language but you could make a language that has a penrose tiling shaped area
@Bbrk24 make them directional?
but it wouldn't make sense in 2d because ascii-art isn't gonna do well with that kinda shape
and have the UI be red lines pointing in the direction of the breakpoint from the center
@Ginger How would the UI indicate that a breakpoint has been set? Especially if it’s direction-sensitive, how do you set/unset a breakpoint?
and how would direction-sensitivity work for mirrors and branches?
As you can see all the shapes are quardelaterals
13:21
@Bbrk24 red background color
So they have a well-defined opposide side
and branching and mirrors should work the same as in a square language
except that paralel lines diverge
my brain hurts thinking about that
please nobody implement it
i kinda want to but i still don't know how you would represent that in ascii art
@noodleman I already use background color to indicate where the IP is, with color-coded threads
@noodleman that's the best part: you don't :p
13:22
Yea that's the hard part. Probably as a kind of spiral from the center
@Bbrk24 okay maybe a red border?
^
a breakpoint in the top-left could have a red arrow shape in its top-left border?
ooh smart
alternately, just set breakpoints in the assembly view
Breakpoints could have a dashed or dotted background, to distinguish it from the solid background of the IP
13:25
These are all ideas, yes. Would I have to wrap each individual source character in a <span>/<a>/<button> with an onclick listener then?
That or use math to figure out what character is closest to the mouse from a central event listener
depends on how you're doing the rendering
if each character is an element then that'd probably be the easiest option
You may want to make each character a absolutely positioned div anyways, aligning things when relying only on character size is unreliable when you go outside ASCII
mm true
13:42
Going back to the addEventListener thing, I also have things like:
play = ->
  elements.playPause.onclick = pause
  # ...

pause = ->
  elements.playPause.onclick = play
  # ...
are you using coffeescript?
in 2023?
yes
:p
@Bbrk24 i would do it as playPause.addEventListener("click", () => if(isPaused){}else{})
but i see the appeal of your method, it's clean
mm maybe. I have like three different things that do this
There's also:
  document.ontouchend = document.ontouchcancel = ->
    @ontouchmove = null
    @ontouchcancel = null
    @ontouchend = null
what're those @s
13:47
@thing in CoffeeScript compiles to this.thing in JS
The use of @ comes from Ruby
no yeah that makes sense
its just weird seeing this in arrow functions
Well no
but that's just sugar for a regular function
=> is an ES6 arrow, -> is a function
13:48
Actually CoffeeScript had => long before ES6
i just use typescript
CoffeeScript is clean but it feels...too clean
especially since what you're building is probably very dirty
Idiomatic CoffeeScript is about as small as minified JS
i.e. a webpage
:P
I'm still quite proud of my elements Proxy
i love and hate proxies
13:50
# This is a clever little hack: elements.fooBar is the element with id="foo-bar". It uses document.getElementById on
# first access, but then saves it for fast access later.
elements = new Proxy {}, get: (target, p) ->
  if typeof p is 'string' and not (p of target)
    target[p] = document.getElementById p.replace /[A-Z]/g, (s) -> '-' + s.toLowerCase()
  target[p]
i thought that if statement was a comment
On one hand, this is really useful. On the other hand, it makes TS completely infeasible
@Bbrk24 I just do this with a for loop at the start of the program
what's not (p of target)?
And populate an object
querySelectorAll("*[id]")
13:51
@noodleman CoffeeScript of = JS in and vice-versa
@Bbrk24 you could use do Proxy{} as {someEle: Element}
Yeah but Element doesn't have value/checked/etc
@Bbrk24 that's not at all confusing :p
@Bbrk24 then use HTMLTagNameElementMap["input"]
or better, HTMLInputElement
@noodleman It makes loops easier but key checks slightly weirder. However, CoffeeScript changes if foo in bar to if ([].indexOf.call(bar, foo) !== -1) or something like that
13:55
@Bbrk24 That's so cursed. Guessing that was added before of was meaningful in vanilla JS?
Correct
const e = new Proxy<ElementMap>({} as ElementMap, {
  get: (_, prop: keyof HTMLElementTagNameMap) => E(prop),
})
e.div({ class: "bg-black" })`
  ${e.p({ class: "font-small" })`Lorem ipsum...`}
  Bla di bla di bla
  ${e.p({})`${async rerender => {
    resp = await aPromise
    rerender(resp)
  }}`}
`
i have my fair share of cursed proxies too
@Bbrk24 why not define the types before each property?
const elements = {
  /** @type HTMLInputElement */
  input: document.getElementById(...)
I don't quite remember, but in any case that's far in the past
14:05
sorry for the nit lol
 
1 hour later…
15:15
@noodleman nit == lint
 
2 hours later…
17:19
Not for the first time, I really wish MSSQL had regex support
All I want to do is replace 'corporation' with 'incorporation'. But I don't want existing instances of 'incorporation' to become 'inincorporation'... And I can't replace ' corporation' because some instances are at the beginning of the string.
just check if the length of the word to be replaced is 11 :b
I think the way to go for this specific situation is going to be CASE
case when NoteText like 'corporation%' then 'In' + LOWER(NoteText) else NoteText end takes care of the instances at the start, and then I can use REPLACE for the ones that come after a space
@DLosc Is there a string you know canMt appear in the data?
You could always replace incorporation with that string then revert it after translating corporation
Oh, interesting. Yeah, that's possible (although the casing is gonna get complicated too, since the db's collation is case-insensitive).
@DLosc Afterwards, replace inincorporation with incorporation, ez :P
17:32
@DLosc Also this didn't quite work because it lowercases the whole note, so now I've got case when NoteText like 'corporation%' then 'Incorporation' + RIGHT(NoteText, len(NoteText) - 11) else NoteText end
@user True, that'd work too. Maybe a bit less readable.
@user That's actually...pretty smart lol
Well it doesn't work if there exist other words that end with corporation (it might work here but it won't work in the general case)
Wait would it even work on existing instances of inincorporation? I think it would
Yup
Which is pretty neat
17:35
But if there's words like discorporation or something, that won't work
Looking at the data again, I think I'm only going to replace instances at the start of the note, which means the CASE is all I need.
Thanks for the inputs, everyone!
(This is an instance where I'm trying to convert most of the notes automatically, but the ones that can't be converted automatically will be looked at manually. So I'm just aiming for 80-90% coverage, not 100%.)
 
4 hours later…
21:42
Can anyone think of a clever formula to check if a bracket is the closing version of a given opening bracket
Too bad ( and ) are adjacent while [/{/]/} are spaces by two, otherwise subtracting two from the char code would work
make your own encoding where they're all spaced by two
i like to think of that as a genuine oversight in ascii
can you provide the ascii numbers for convenience also
i could do it buuut you have probably been looking at them and im like at wooork and like welll itd be easier if youuu did it aaand
Actually since I already know there one of the three closing brackets I can just subtract the char codes and check if the difference is more than two
Boring solution but it works :p
nice
idk thats pretty clever to me
22:37
@RydwolfPrograms (opening bracket) + (opening bracket) % 2 + 1 = (closing bracket)
23:07
(opening bracket) + ((opening bracket) % 2) right

« first day (4602 days earlier)      last day (538 days later) »