« first day (4828 days earlier)      last day (35 days later) » 

12:09 AM
opinion: normal maps are genius
a way to simulate 3d without actual 3d
 
@user what are you doing saving my word documents?
 
1:00 AM
Sandbox posts last active a week ago: Sandbox Notes
 
1:29 AM
@lyxal Clearly you weren't saving them often enough. Do you want your hard work to be lost?
 
 
2 hours later…
3:16 AM
Q: Solve the problem
A: If it's in 2 seconds after compile, and first few inputs look like timed tests, then assume it's the timed test and output its result. Otherwise, solve the problem and wait till 800ms.
Then it's [hacked](https://uoj.ac/hack/14033) successfully but not successfully β€” It's still score 100
 
 
2 hours later…
5:35 AM
@TheEmptyStringPhotographer That seems like a more complex request, the bottleneck is probably in the actual processing not just the request handling
 
@lyxal Whoops, you caught me. I've been sneaking into your computer and inserting typos into all your assignments
Next time you get points off for spelling mistakes, blame me >:)
 
I already do :p
I get a question wrong in an exam? That's user's fault. A marker finds a bug in my code? User probably did that. Group missed some requirements for a project? Ain't no one in the group responsible except user (who isn't even in the group)
2
 
6:06 AM
It's the butterfly effect. I flap my arms here in the US, creating a gust of wind, which changes weather patterns, causing a wildfire to happen in Australia, giving my agents the perfect cover to sneak into your room and sabotage you
 
 
2 hours later…
8:02 AM
@user so it was you after all?!
 
@TheEmptyStringPhotographer hmmm :)
 
And what happened to @TheThonnu
 
9:19 AM
I’m having trouble editing the TNB wiki page on fandom.com
Actually nvm
I just created a page for myself
 
9:35 AM
I have an xml file that I want to extract the text from. Here is an example line "<text matrix="1 0 0 1 0 -16" transformations="translations" pos="104 168" stroke="Sblack" type="label" width="244.493" height="13.6528" depth="3.864" valign="baseline">{\bf Step 2:} If the leaf is a 3-node,</text>
"
I just want {\bf Step 2:} If the leaf is a 3-node,
from that line
what is the easiest way to do that?
 
@mousetail thank you!
is it possible from the command line too do you think?
@mousetail should it be BeautifulSoup(text, "lxml") ? That isn't working for me
 
@Simd No, it should be either lxml-xml or just xml. Otherwise it will try to pasre as HTML
 
9:51 AM
@mousetail argh.. also fails :(
 
Have you installed lxml?
 
yes... bpa.st/K2LA
maybe I have text in the wrong format. It is a list of strings
@mousetail I changed it to f.read()
 
You probably need a file object that represents a complete XML document
 
it worked if I just read it is in with f.read()
 
Or just join the strings into a single one
 
9:58 AM
now I need to work out how to extract the text!
@mousetail yes that worked
 
Easiest is usually using .select() with a CSS query, especially if you already know how css selectors work
 
@mousetail hmm.. the parts with the text look like bpa.st/S72A
I don't know about CSS queries sadly
 
Just text should be a good enough query to find all the text elements
Then .string should get you the contents
 
@mousetail is that soup.select("text")? That gives me a huge number of lines like <text depth="4.776" halign="center" height="14.352" matrix="1 0 0 1.25 292 -103" pos="320 224" size="small" stroke="Sblack" style="math" transformations="translations" type="label" valign="center" width="44.124">\cb O(n)</text>]
I guess it has text in it
 
Of course, that's just all the text on the page
You can't further filter with XML unless you find a difference between the text nodes you care about and you don't
next step would be filtering the parts of text you care about with some sort of regex, XMLs work is done
 
10:12 AM
can I get the \cb O(n) part out?
oh I see...
so this works...
I wonder what \cb means
 
Isn't that just latex?
5
Q: What is the difference between \cB. and \cB\{ in regex?

student mathsAll is in the title. I wonder to know the difference between the two expressions \cB. and \CB\{ in regular expression (regex). In the example below, it seems that both give the same result. Furthermore, one can mix them i.e. one can use \cB\{ ... \cE. \documentclass{article} \ExplSyntaxOn \tl_new...

 
@mousetail yes I think it is!
 
 
3 hours later…
1:06 PM
just wrote a working FizzBuzz in PCL :D
1 30 range { dup 3 % "" "Fizz" switchpush -1 rot dup 5 % "" "Buzz" switchpush -1 rot swap + dup length not drop? keeplast } map
 
Is that the printer language?
 
what?
are you thinking of PostScript? :p
PCL is something I made for fun
 
Ah ok, there is a language used to communicate with printers also called PCL
It's probably related to postscript but a distinct thing
 
correct
this isn't a golfing language
 
1:13 PM
it can be a useful practical feature too
 
oh wait, I misinterpreted that
lol
I can add that
 
1 30 range { dup 3 % not "Fizz" times over 5 % not "Buzz" times + dup length not drop? keeplast }
makes it shorter
 
Now do that in (char 0x1)(char 0x10ffe)
 
over?
 
dup the second thing over the first
a b --> a b a
 
1:15 PM
hm
 
oh btw the interpreter is on my Github
 
It’s a random lang I made a year ago I guess
 
I wonder if I could make it run on the web
 
I mean you could use flask and spin up a web server
 
1:23 PM
You probably wouldn't want to use Flask for Kotlin, it has it's own web frameworks
 
Kotlin can compile to JS
 
Then it should be theoretically possible to make a browser version based on that?
 
unfortunately, PCL relies heavily on reflection
 
By necessity of the language or just how the implementation is designed?
 
the implementation
idk if it works with WASM
 
1:36 PM
It seems there are a few options to compile JVM bytecode to wasm
 
Kotlin can just compile directly to WASM :b
 
Can Kotlin stop showing off please /s
Will it support reflection if you do that?
 
unclear
unfortunately (again), the interpreter uses JLine for the REPL
which is a Java library
 
A web version doesn't need the REPL though
 
but then that means you need to have multiple subprojects (one for each platform) which can be really unfun
and painful
 
1:48 PM
Ideally you'd split it into a library for the language itself than one project for every interface
 
that's what I meant and that can get painful sometimes
 
it's much easier to do that with Kotlin than it is with Scala
 
It's pretty easy in Rust at least
 
@Ginger I think JVM+JS is easy in scala
it's handling Native that's the problem :p
 
There is no way you can get an CLI app to work well in WASM without modification.
 
1:51 PM
yea
probably best to make a dedicated web interface with CodeMirror or something
 
Are you wanting to go for a TIO style web interface or more of a ipython style?
 
go theseus style
@Ginger ginger why?
hashmaps exist
 
convenience d:
all I have to do to add a new builtin is add a function to the Builtins object
 
but it's so nasty
 
nuh uh
 
1:57 PM
you could at least use decorators/annotations
 
how do you think those work q:
 
by not accessing the methods of a class directly :p
 
nope lol
decorations in Kotlin are only useful to compiler plugins
...or reflection
in fact, I am using an annotation for builtin docs
 
skill issue
python allows much more flexibility
 
Python also is Not Kotlin
 
1:59 PM
I think that's a bad kotlin design choice
 
I think your perspective is tainted by the unholy mess that is Scala reflection
 
nuh uh
it's tainted by Vyxal 2 :p
def element(symbol: str, arity: int):
    """
    Decorator to make elements
    """

    def decorator(impl):
        if symbol in elements:
            raise Exception(f"Element {symbol} already in elements dict")
        else:
            elements[symbol] = process_element(impl, arity)
            return impl

    return decorator
 
You can do a lot with python decorators that I really feel you shouldn't
 
@element("+", 2)
def add(lhs, rhs, ctx):
    ...
@Ginger ew ew ew
 
2:04 PM
finally, a way to scare lyxal off
 
...
that's why you have
no need for the specific types
 
those aren't even related to reflection
and I did it like that for a reason :p
 
@Ginger I know
 
admittedly I could have collapsed them into one class and an enum
 
yes!
 
2:10 PM
one second
done
happy?
 
0
Q: Flip a coin in Lost

Wheat WizardLost is a 2-D programming language where the start position and direction of the ip are entirely random. Today we will be writing a Lost program which uses this randomness to simulate a coin flip. A coin flip can have 3 outcomes: It lands on "heads" It lands on "tails" It lands perfectly balance...

 
@Ginger I will investigate it when the sun is visible
Right now only the moon is
 
πŸ‘
 
o/
 
\o
 
2:53 PM
Make sure to apply the gyatt deduction to your fanum tax return. The Internal Rizz Service might audit you otherwise.
4
 
what
 
I wonder how werewolves react to a lunar eclipse
 
3:27 PM
welp, Kotlin reflection is extremely hobbled on multiplatform
hashmaps it is
 
3:41 PM
@Ginger uhh why is @Doc a thing
 
for doc
 
what doc engine u using?
 
I'm not :3
 
smh
 
the annotation is checked by the reflection code
 
3:42 PM
you know kotlin has kdoc right
 
it's used in the autocomplete in the repl
 
what
are you insane
 
but don't worry, I'm completely redoing all that to be even more cursed
the new solution involves an annotation processor
 
Seggan has left the chat
 
4:04 PM
@Ginger I'll do it in 6-8 weeks (TM)
 
sure
 
 
1 hour later…
5:10 PM
CMQ I have a sorted array of floating point numbers. I want to partition them into numbers less than x and numbers that are at least x for some x which I will choose . My goal is to minimise the variance of the two halves of the partition. Is there a clever way to choose x to do this?
 
@DLosc, I'm exploring concise methods to detect if the accumulator is negative in *Acc!!*. I've considered two approaches so far:
1. `(_^2)^2^-1-_` - this returns a float, which is inconvenient.
2. `1/_` - this fails when the accumulator is 0.
Do you have any suggestions?
 
 
2 hours later…
6:51 PM
Been using webpack and TypeScript for the first time and I'm loving it so much
Other than having to npm run build every time, but that's not a huge deal
(is there a way to automate that when I save in VS Code?)
 
` npm run watch `?
Webpack supports watching
 
@Mukundan314 I'd say modify approach 2 to make sure the inverted quantity isn't 0. As long as it's an integer, you can do 1/(2*_+1), which has the added bonus (?) of giving a different value for positive (0), negative (-1), and zero (1).
If you just want a two-way distinction, you can do 1/(3*_+2) (negative = -1, nonnegative = 0) or 1/(3*_-1) (positive = 0, nonpositive = -1) or 1/(1-3*_) (positive = -1, nonpositive = 0).
 
7:06 PM
@Ginger Kotlin seems fun, at least with the keywords you’re using in your code.
banana­β‘β€‹β€Žβ€Žβͺ⁑βͺ⁠βͺ⁑βͺβ€β β€Žβͺ⁑βͺ⁠βͺ⁒βͺβ€β€β€‹β‘β β‘β€Œβ’β€‹β€Žβ€Žβͺ⁑βͺ⁠βͺ⁣βͺβ€β β€Žβͺ⁑βͺ⁠βͺ⁀βͺβ€β€β€‹β‘β β‘β€Œβ£β€‹β€Žβ€Žβͺ⁑βͺ⁠βͺ⁒⁑βͺβ€β β€Žβͺ⁑βͺ⁠βͺ⁒⁒βͺβ€β€β€‹β‘β β‘β€Œ­
ba # β€Žβ‘The first syllable: buh
na # β€Žβ’The second syllable: nah
na # β€Žβ£The third syllable: nuh
💎
Created with the help of [Luminespire](https://vyxal.github.io/Luminespire).
 
7:36 PM
@Seggan well, I did it :p
not pushed yet, but it works
I wrote a KSP symbol processor that takes the builtins object and generates a giant map of function objects
it does basically what the reflection code did, but at compile-time
and that means it works with multiplatform
 
 
1 hour later…
8:40 PM
...
 
boom, committed
@Seggan behold
 
9:11 PM
@RydwolfPrograms oh god webpack?
why webpack and not vite
@RydwolfPrograms webpack-dev-server?
that supports HMR, could be overkill
 
webpack my beloved
 
9:53 PM
@Ginger !!
 
 
1 hour later…
11:00 PM
@Simd Since variance = mean of squares - square of mean, you can precalculate the prefix sums, suffix sums, and the same for the squares (which can be done in O(n)), and then calculate all variances again in O(n), and pick the best one.
 

« first day (4828 days earlier)      last day (35 days later) »