There is now an MC Standard for bytecount.
With the 1.10 update, they introduced a block called the "structure block", which creates a .nbt file representing a structure in its entirety that can be measured in bytes. As this is a Minecraft standard for converting builds into bytes, this should b...
@WheatWizard I just love to hate on any language. You could write a language with C's speed, Rust's memory safety, Java's portability, Python's learnability, prettier and more expressive syntax than any language I've ever seen, and I'd still try to find its worst, darkest secret and remoreselessly and unrelentingly mock it :p
I personally find JS to be...not that bad, a mid-tier language, but from they way I'd talking about it you'd think it was humanity's worst sin. PHP is what allowed me to do some interesting projects early on, and taught me a lot, but I'll mock it all day. Python has a partiuclar set of goals and accomplishes them pretty well, but I'll gladly make fun of everything it doesn't do (and often doesn't want to do in the first place). No language is safe :p
Idea: A language whose printable ASCII is an ordinary praclang with clean syntax, but it actually uses an SBCS and the other 160 characters are golfing language operators
i think the first i heard of lua was when i was playing tech modpacks in minecraft a bunch and some of them happened to include a mod that adds a computer block that just lets you manipulate a terminal and some robot entities with lua scripts
@PyGamer0 in that case you might want to be careful with an optional nilad argument to your compose(s), since they might eat something you wanted to use with a dyad
I saw that, but I thought an 8-year-old post about a 6-year-old "uneasy consensus" wasn't very conclusive, and given I don't think post #84 on the whole site is likely to hit HNQ any time soon, I didn't bother to revert the edit
this has lead to occasional reoccuring damage at Wikipedia where someone convinces an admin that something destructive has been made impossible, the admin tests, and it turns out that they were lying
when deleting the Main Page actually was made impossible, the developers were very clear to say that the prevention was at the start of the process, before you filled out the reason, to try to discourage the same thing happening in the future
I think the word got banned from HNQ at some point
that probably reduces the importance of banning it from titles altogether
there were a few HNQ bans due to similar incidents (i.e. a question is obviously ontopic and harmless in context, but out of context can offend people or look unsuitable)
@lyxal I don't know who you are. I don't know what you want. But I have a very particular set of skills. Skills I have acquired over a very long career. I will look for you, I will find you, and I will outgolf you.
the same sort of thing happens on Reddit too occasionally – the post normally takes off, with everyone upvoting it to try to get it to the top of /r/all
for me the problem comes when writing programs which need to name the language – do we put uncensored profanity into the program itself? when talking to people I typically know who I'm talking and can abbreviate or not as appropriate, but a program (especially if it's meant seriously) can end up being read and used in other contexts in the future, and I have no real control over that
I can somewhat more see how that would happen though
it's a slightly more complicated task to implement on the backend than on the frontend, since you'd need to keep track of the current user's sort order, possible separately across multiple tabs
@ais523 It looks like what is happening is that the parameter answertab works to set the order, but the links to other pages change the parameter name to tab, which doesn't work.
Determine Uilta Pitch Accent
Uilta is a minority tungusic language spoken in the far east of Russia.
A neat thing about Uilta is that it has pitch accent which can be predicted by a computer program. In this challenge we are going to take Uilta a word and determine where the accent peak is.
Let ...
@PyGamer0 JavaScript generally makes sites worse, all sorts of things popping up and fading in and out and the like – most functionality that's actually useful can be implemented without it
Uilta is a minority tungusic language spoken in the far east of Russia.
A neat thing about Uilta is that it has pitch accent which can be predicted by a computer program. In this challenge we are going to take Uilta a word and determine where the accent peak is.
Let me explain how this can be do...
@ais523 Partially agreed - also, there are many things that can/should be done with builtin HTML instead of JS. For example, everyone tries to homebrew their own version of <details>.
OTOH, one of JS's main advantages is its ability to dynamically generate content. A server can do that too, but JS is often simpler to use. For example, the History Of Vyxal website linked in the starboard is a huge kludge of inline CSS and absolute positioning. I could rewrite it with JS and make the code a lot smaller, more readable, and more extendable. I haven't yet because I'm lazy
@emanresuA isn't that the sort of thing that would ideally use a static site generator (i.e. a program that generates an HTML file as output, but that you only run once)?
@ATaco ¯\_(ツ)_/¯ At this point, many languages are multitargeted and can be used for websites. I don't think JS is that bad unless you go looking for the weird bits, and you're going to have to use it anyway as a wrapper for whatever you've compiled.
the first version of JavaScript was, IIRC, the result of giving a skilled and talented language designer an impossibly short deadline and forcing them to make a language
this explains things like function scope for variables (proper lexical scope is obviously better, but would have taken longer to implement)
it isn't common nowadays to use <script> as an element in the document body, but it used to be very common in the early days of JavaScript
and I was doing the tests by literally writing data:text/html,<html><body><script> into a web browser URL bar
(followed by the desired script)
this has some weird side-effects, like "the browser can't parse the rest of the page beyond the <script> tag until the script has finished running, in case it writes unbalanced tags to the page"
(this was once used in a code-golf answer to intentionally hang the browser's parser)
I think I understand the reason: all GUI toolkits are terrible, and attempting to use HTML+JS+CSS as a GUI toolkit is actually less terrible than the alternatives (whilst still being terrible)
and one major part of the terribleness is often "things break a few years later and you have to learn an entire new toolkit", and most people don't trust anything cross-platform other than HTML+CSS+JS to be here to stay
@mathcat working only on a small subset of OSes is an inherent problem for libraries – it limits where you'll be able to port your application in future, and means that you're stuck if the OS ever becomes inappropriate (which can happen for reasons outside your control sometimes)
when I was younger I frequently used nonportable programming languages, but my code ended up breaking a few years later far too often
at one point I even used Excel to create GUIs (I didn't have many programming languages available at the time and was familiar with Excel…); you'd expect me to regret that when I moved to a compute without it, but instead I discovered that my programs broke in a later version of Excel – versions of Excel that could run them are very rare nowadays
maybe this is why I ended up getting into esolangs – I learned programming with an absolutely terrible set of languages to learn it on
@graffe I'm not sure whether that problem (choosing prefixes with a given total length from a given set of lists, maximising the sum) has a name, but it's NP-complete, because you can encode the subset sum problem in it (encode a number n as n-1 zeroes followed by n), so there isn't an efficient algorithm unless P=NP
I frequently get confused with NP-complete problems that use numbers
because it's unclear what function of the input we're measuring the complexity with respect to
or, hmm, I guess I'll just look it up
OK, best known subset sum is algorithm is exponential in the total number of bits of the numbers in the set, meaning that subset sum is polynomial in terms of the size of the actual numbers
this makes it very likely that the problem can be solved in polynomial time using dynamic programming
and some further research implies that there's a distinction between "weakly NP-complete" (can be solved polynomially in the value, rather than size, of the inputs), and "strongly NP-complete" (unless P=NP, can't be solved polynomially even in the value of the inputs)
Given a set of N words, starting word and ending word, the words can be changed to obtain any one of the words in the given list of words by altering exactly one character and the target is to obtain the ending word with the minimum number of alterations starting with the starting word. Print the...
dynamic programming is basically a recursive brute-force algorithm combined with very heavy memoization
you could probably do something like working out, for each n from 1 to 100, the optimal score using n coins in the first half, and separately in the second half
and recursing
actually, isn't that just a linear-time algorithm? for each aligned power-of-2-sized subset, work out the optimal score for each n, starting from the smallest and working towards the largest
@thejonymyster Since it's used in Roblox, some other games, some tools for programmers, etc., probably a lot of people. I wouldn't expect it to overlap very well with the people who know JS/Python though, since it's not really used as a general-purpose language as far as I know.
@ais523 Lua has the advantage of being first-to-market (I wrote this before you mentioned Tcl and Guile, so I'm not sure if it's actually true) and thus benefits from the network effect