« first day (1919 days earlier)      last day (2910 days later) » 

12:02 AM
@EᴀsᴛᴇʀʟʏIʀᴋ Ish. Just like with any SE site, there are restrictions around it.
Anyway, I never said that HW questions should be off-topic. Just that "gimme teh codez" should be, And the two go hand-in-hand.
 
@EᴀsᴛᴇʀʟʏIʀᴋ
 
monring
 
monking to you
so weird being exhausted at 17:10 and you being at 10:10....
 
12:12 AM
huh?
 
It is late afternoon here.
Not morning or monring.
:P
 
Huh, just found column80.com/api.v2.php?a=codegolf , may be useful somehow
 
@EᴀsᴛᴇʀʟʏIʀᴋ Ah, the beauty of timezones
 
@HelkaHomba ??
 
^
seems like a q/a fetcher api?
 
12:15 AM
Yeah. People around here like plain text
 
@HelkaHomba There's a report scrapers/api unlawfulusers thing on meta if you want to report it
 
Oh
well, column80.com is intended for the Lynx browser
 
238
Q: Column 80 - Plain Text optimised Stack Exchange

Mark Henderson Screenshot / Code Snippet About Browsing the existing Stack Exchange family of websites was OK in a text-based browser, but when you're stuck in a Linux shell with no way out and no other computers around and you just know you saw the answer on Server Fault last week, this is how you can fi...

 
@miles Are you here?
Could you show me how you generated your testcase? I got 24236980 instead of 1c5ea513 for the first testcase
 
12:24 AM
@Quill wat
 
...
python hates me now
 
Python loves no one.
 
but i think it is because I dared to use js
...
I modified the FOG source and tried to start a REPL, and it gives me a mocking message that I put it a while ago.
...
yeah, you too you little idiot
 
at least it doesn't say "You messed up. Nice"
 
... it may have in a previous test.
i say nothing
 
12:34 AM
@EᴀsᴛᴇʀʟʏIʀᴋ You want a REPL?
 
I have a FOG REPL set up now. :D
 
Where?
 
just trying to get a not-repl set up, and take input from DOM textarea not prompt()
@MarsUltor rikerw.github.io
 
If you use an execute function for the REPL
just use that
otherwise refactor
 
I have a repl function for the REPL.
I also have a execute func, just implementing is hardish
ohai @VTCAKAVSMoACE
 
12:37 AM
Somebody edited in a bee on a dubstepper. :D
 
lol
okai it works now! :D
but the problem is getting input from DOM object.
 
onclick
 
?
with skulpt?
 
use addEventListener
 
how can I use that brb googling
 
12:49 AM
<object>.addEventListener("eventName", function)
 
He's using Brython though.
 
no, skulpt now
apparently brython borked their files
and nothing works anymore
but I got a basic interpreter working, now just getting better input code than a prompt
 
?
did I bork somehting?
@CᴏɴᴏʀO'Bʀɪᴇɴ
 
12:53 AM
what's going on XD
 
um
stuf
Then hit run, type code in prompt.
hit enter
 
I just learned that delegates in US voting use STV
 
watch code run
@NathanMerrill yeah, though they should use "pick somebody who isn't trump then use STV for the rest".
 
ohh, the FOG code blank doens't do anything @CᴏɴᴏʀO'Bʀɪᴇɴ
is WIP
 
12:55 AM
o-O
 
> Is WIP
wait for a bit
just press run to get it , ignore the blank
Q_Q
 
Water instead, please
 
wat
 
12:57 AM
@EᴀsᴛᴇʀʟʏIʀᴋ it's a .min file
 
idc
still very saddening
okai fine
@Quill try this instead: skulpt.org/static/skulpt-stdlib.js
not a .min
 
1 min ago, by Quill
wat
 
2 mins ago, by Eᴀsᴛᴇʀʟʏ Iʀᴋ
ikr
 
That's also been minimized
Makes sense since it's the stdlib which is the biggest part
 
1:00 AM
I thought it looked like crap because it was part of a JSON thing
 
Right but it's strings of minimized Python code
 
On the other hand, I'm creating a library for JS for DOM manipulation
 
@quartata Then it needs a .min extension.
 
1:01 AM
@EᴀsᴛᴇʀʟʏIʀᴋ it's a convention, not a rule
 
@CᴏɴᴏʀO'Bʀɪᴇɴ have you tried xpath
 
@quartata what's that?
 
basically the greatest thing for dom traversal ever created
 
DOM manipulation not traversal
 
1:03 AM
^
good idea though
 
Dunno if JS as it. Java has an implemenration of it
 
thanks
@quartata js has it iirc
I just looked it up and saw something about it
 
JS has it
 
document.evaluate( "//div[contains(@class, 'js-gps-related-tags')]/div/a",
            rTag, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
 
1:05 AM
Yeh so you use xpath to find the nodes then modify them like normal objects
 
that was in some code I reviewed a while ago | codereview.stackexchange.com/a/125193/62429
 
@Quill oh god what the fuck did they do to beautiful xpath
 
@quartata I don't need xpath to do a few simple wrappers ^_^
 
js ruins all clearly
 
the CSS selector system in querySelector/All is pretty flexible, you shouldn't really need to use XPath
 
1:07 AM
@CᴏɴᴏʀO'Bʀɪᴇɴ oh OK. Just letting you know about it. Much more flexible than regular DOM API
 
@quartata thanks!
 
CSS selectors works with Attributes, Classes, IDs, children; what more would XPath have?
 
I use XPath because it works on any XML
 
xpath can move up the tree
and has better sibling selectors
 
also that ^
 
1:11 AM
@isaacg I think .a can be removed because it is equivalent to a0.
 
but less golfy
unless if you used a period and that a0. is actually a0
 
what do you mean?
 
Is .a equivalent to a0., or a0?
 
.a has the same byte count as a0
 
He means a0. A period by itself is meaningless in Pyth
 
1:14 AM
oh
 
it's a period lol
 
#fail on my part
 
. is kinda like a space in Jolf
 
which I'm fixing
Making a new interpreter page with slightly different commandset
 
1:15 AM
It's for extended commands
 
oic
Jolf has tons of those XD
Jolf : Pyth :: Mathematica :: Python, in a sense of potentially useless builtins
once I start typing a lot, I know I'm beginning to be tired
 
@Doorknob Any opinions on what my alphabet/letter categories/syllable structure should be? I kinda want to go for quirky but not alien
 
I would definitely prefer something simple
 
@HelkaHomba whoa
 
1:19 AM
hues sorted left to right, saturation sorted top to bottom
 
whoa. what does that mean?
"sorted"
 
@quartata uh, quirky but not alien?
 
@HelkaHomba noice
 
do doorknobs
 
1:21 AM
@CᴏɴᴏʀO'Bʀɪᴇɴ the hues on the left are 0 deg, the ones on the right 360 deg
 
pls send teh codez
 
@EᴀsᴛᴇʀʟʏIʀᴋ Wait till I make it into a challenge
 
@Doorknob Yeah.. I really don't know what I want. I am leaning towards 3 and 5 letter words
 
1:22 AM
@quartata One syllable per word?
 
As far as writing system goes, you've basically got a regular alphabet, an abjad/abugida, a syllabary, or an logography to choose from (at least those are the ones I can remember).
 
I haven't even considered pronunciation yet. But yeah I guess?
@Doorknob I want to keep it ASCII.
 
So alphabet it is.
 
You should only use APL characters in your language
 
1:24 AM
^
no, jelly
 
use only letters with diacritics and katakana
 
ASCII as in lowercase/uppercase letters only?
 
extended hebrew ascii
 
Just the lowercase alphabet with - and &
 
Ampersand?
 
1:26 AM
Yes, it's for conjunctions.
 
@miles You used an algorithm like this:
function crc32 (str) {
  // kevin.vanzonneveld.net
  // +   original by: Webtoolkit.info (webtoolkit.info)
  // +   improved by: T0bsn
  // -    depends on: utf8_encode
  // *     example 1: crc32('Kevin van Zonneveld');
  // *     returns 1: 1249991249
  str = this.utf8_encode(str);
  var table = "00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63
 
If you want something exotic with only lowercase Latin alphabet letters, you should probably go with lots of q and x, and maybe even swapping roles of some vowels and nonvowels.
@Doorknob ... you know there's a word for "nonvowels," right? /facepalm
 
ELEVEN/10 for the split personality
 
(!vowels)
 
Does anyone know how I can obtain all properties of an HTML element that can be described in inline html?
 
1:29 AM
google
 
@CᴏɴᴏʀO'Bʀɪᴇɴ so you want the ones that are there when the HTML is loaded, but not after the JS has executed and potentially changed them?
 
@Quill No, just the ones that are present of an html element.
I'm working on "HTML stringification"
 
var button = document.querySelector('#sayit-button');
button.attributes
> NamedNodeMap {0: class, 1: id, length: 2}
 
whoa
var div = document.createElement("div");
div.className = "this is";
div.id = "fortyTwo";
div.onclick = function(){alert("click");};
div.properties is empty.
 
1:33 AM
div.keys()?
 
@quartata TypeError: div.keys is not a function
 
It's an es6 thing
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Because they're not properties, they're attributes
 
@quartata I'm on an ES6 browser.
@Quill so where are the attribues?
 
div.attributes; div.attributes.id.nodeValue;
 
1:34 AM
I'm an idiot
kinda
 
that might be true
 
there's still no onclick function there
 
don't accept anything important or dangerous
 
because onclick is an event listener, not an attribute IIRC
 
gtg for dinner, bai!
 
1:38 AM
@Quill oh okay
 
BAI
remember: DRINK BAI!
 
stringifying a html element is a bit weird
 
0
Q: Compute CRC32 Hash

Kenny LauCredits This challenge originated from @miles. Create a function that computes the CRC32 hash of an input string. The input will be an ASCII string of any length. The output will be the CRC32 hash of that input string. Explanation The algorithm of CRC32 and other CRC are essentially the sam...

 
@Quill Yeah, but you never know when it could be useful.
 
1:39 AM
you can just do a loop over attributes and do like `${key}:${attributes[key].nodeValue}`
and then do onclick.toString() as well
 
Oh, I know. I'm making a lib, remember?
 
No, I don't remember that :p
 
oops
40 mins ago, by Cᴏɴᴏʀ O'Bʀɪᴇɴ
On the other hand, I'm creating a library for JS for DOM manipulation
 
OK here is what I'm thinking. W = fqwxsz T = aeu V = yioue C = everything but letters in W union V and either CVW or CVWWT
plugging into word gen let's see what we get
 
@quartata the class W doesn't seem right to me
in the filter I gave you, I classified stops and sonorants
stops = bdgptk
 
1:44 AM
@quartata which word gen?
 
@KennyLau I'm thinking less about pronunciation and more about how the words look. I will probably drop f and s though
 
I see
 
T are tenses by the way. a is past e is present and u is future. I might change e to i though
 
oh, so you are creating a new language
any further spoiler? :p
 
@KennyLau I used the builtin for Java, their CRC32 class, to compute the values, then printf("%08x")
 
1:48 AM
@miles well...
can't find the source code
 
@KennyLau create I language-new
 
so adjective after noun and VSO sentence order
btw, in Esperanto, e is present a is past o is future
 
Ye. - also binds adverbs to verbs and can do compound nouns.
@KennyLau oh interesting
 
any github link lol
 
Nope. Just thinking in my head.
 
1:51 AM
cool
 
I think I'll have a modifier for perfect/imperfect. Maybe ~ in front of the verb
 
like Ancient Greek
 
It's all greek to me :P
 
== Declension == === The article === === Nouns === ==== First declension ==== ===== Examples ending with -ας or -ης ===== ===== Examples ending with -ᾱ and -ᾰ (gen. -ᾱς) ===== ===== Examples ending with -ᾰ or -η (gen. -ης) ===== ==== Second declension ==== ===== suffixes (normal) ===== ===== Contracted nouns ===== ===== Attic second declension ===== ==== Third declension ==== ===== Suffixes of the nouns of the third declension ===== ===== Vowel stem in -ως (gen. -ωος) ===== ===== Vowel stem in -υς (gen. -υος) ===== ===== Double vowel stem ===== ===== Vowel s...
 
obai coming in maybe 5 min, maybe less
 
Imperfect is the difference between I go and I am going
 
I made a language once. It's English, except without tenses
Tenses are indicated at the beginning of the sentence.
 
1:58 AM
@El'endiaStarman's language is cool.
spoken one, not minkolang
obai
 
@miles
looks like it does use that polynomial
but I don't get it
the code is this:
        crc  = 0xFFFFFFFF;       // initial contents of LFBSR
        int poly = 0xEDB88320;   // reverse polynomial

        for (byte b : bytes) {
            int temp = (crc ^ b) & 0xff;

            // read 8 bits one at a time
            for (int i = 0; i < 8; i++) {
                if ((temp & 1) == 1) temp = (temp >>> 1) ^ poly;
                else                 temp = (temp >>> 1);
            }
            crc = (crc >>> 8) ^ temp;
        }

        // flip bits
        crc = crc ^ 0xffffffff;
the algorithm is different
it does not find the largest bit, but read 8 bit at a time
 
var stringifyHTMLElement = function(elem){
    let escape = (string => string.replace(/"/g, '\\"'));
    let stringifiedAttributes = [];
    Array.from(div.attributes).forEach(elem =>
        stringifiedAttributes.push(`${elem.nodeName}="${escape(elem.value)}"`)
    );
    return `<${elem.tagName.toLowerCase()} ${stringifiedAttributes.join(" ")}${!elem.onclick?'':` onclick="${escape(elem.onclick.toString())}}`}></${elem.tagName.toLowerCase()}>`;
}
 
2:04 AM
I think I'll use the three letter ones for pronouns and very common nouns.
 
@CᴏɴᴏʀO'Bʀɪᴇɴ I threw together a rough idea of what would go into something like that, you'd probably have to go into the string escaping and eventlisteners more, though, I suppose
 
perks of an inbox, lets you see stuff later
 
@CᴏɴᴏʀO'Bʀɪᴇɴ Pirofi
 
I think I might automate the vocabulary gen in some way.
 
2:10 AM
I installed Windows 95 on my Apple Watch https://medium.com/tendigi-insights/i-installed-windows-95-on-my-apple-watch-589fda5e36d
 
@quartata That's the main reason I stopped working on Pirofi. I wanted to build a word web using a program and use that to assign meanings and such.
> it takes about an hour to boot.
Wow.
 
In an awful parallel universe somewhere, Tim Cook is announcing the new Apple Watch runs the best version of Windows 95 they’ve ever made.
 
@Quill just why
stick with Mac, people
 
... I think you are missing the point of the article
 
no, just ignoring it
rofl
 
2:25 AM
He did a Mac OS version anyway
 
> Will It Blend?
@Quill yeah
but i guess win95 is cooler to install on a apple watch
 
2:58 AM
@EᴀsᴛᴇʀʟʏIʀᴋ an *
 
3:10 AM
0
Q: Decompose a number!

Kenny LauYour task is to decompose a number using the format below. This is similar to base conversion, except that instead of listing the digits in the base, you list the values, such that the list adds up to the input. If the given base is n, then each number in the list must be in the form of k*(n**m...

 
3:27 AM
0
Q: Build a word generator!

Kenny LauYour task is to create a program/function to replicate this word generator. Details Your program/function take two input. One input is the categories. The other input is the syllable types. Categories categories will consist of classes of letters. For example, V=aeiou means that the letters ...

 
@Dennis :D :) :| :/ ಠ_ಠ
 
@AlexA. would you eat it? :P
 
Sure, it's cauliflower. Amazingly I'm able to tell the difference. :P
 
also, @KennyLau you really seem to want to raise our q/day to 10
 
more q = better
Step 1. more questions
Step 2. more answers
Step 3. ??????
Step 4. PROFIT
 
3:29 AM
haha, not complaining, just curious
 
Russian has a crazy grammar
Turkish has crazy sounds
Vietnamese has crazy tones.
All three of them should have vocabularies very far from English, unlike French or Spanish.
 
@Doorknob you mean you're giving up lojban? ;P
 
>:U
 
@Doorknob Tatar
It's somewhat similar to Turkish, being a Turkic language
But not mutually intelligible
 
3:39 AM
@AlexA. Duolingo doesn't have Tatar. :P
 
I know :(
 
@Doorknob urdu, so you can understand my family when we do discord again
 
I'd like to submit Indonesian to the poll, if only because I like it, ~200 million people speak it (mostly my country's population but not all of them) and it's relatively simple except for vocabulary and a little bit of the grammar
 
@Maltysen That was hilarious
 
@Sherlock9 Indonesian is "hatching" in Duolingo which I assume is similar to the A51 process here
I've seen you talking about it in here and it looks really interesting though
 
3:41 AM
@AlexA. I honestly kinda just forgot about them
 
Your family?
 
yeah
 
You forgot about your family? >_>
 
@AlexA. well I mean, like forgot that they were talking and that they would be heard by you guys
 
The following code is used by Quake III Arena to calculate 1/square_root(x):
(including the original comment)
 
3:43 AM
fastinvsqrt
 
float Q_rsqrt( float number )
{
	long i;
	float x2, y;
	const float threehalfs = 1.5F;

	x2 = number * 0.5F;
	y  = number;
	i  = * ( long * ) &y;                       // evil floating point bit level hacking
	i  = 0x5f3759df - ( i >> 1 );               // what the fuck?
	y  = * ( float * ) &i;
	y  = y * ( threehalfs - ( x2 * y * y ) );   // 1st iteration
//	y  = y * ( threehalfs - ( x2 * y * y ) );   // 2nd iteration, this can be removed

	return y;
}
@Doorknob ninja'd
 
@Doorknob Yay to Duolingo and yay to Indonesian being interesting :D
I've read stuff on Wikipedia and Quora about fastinvsqrt before and I still don't really get it
 
@Sherlock9
The algorithm computes 1/√x by performing the following steps:

    Alias the argument x to an integer, as a way to compute an approximation of log2(x)
    Use this approximation to compute an approximation of log2(1/√x)
    Alias back to a float, as a way to compute an approximation of the base-2 exponential
    Refine the approximation using a single iteration of the Newton's method.
Do you have any knowledge on how floating point is stored?
 
@KennyLau look up IEEE
 
The algorithm computes 1/√x by performing the following steps:
    Dark, dark magic.
 
3:45 AM
@Maltysen I'm talking to Sherlock9 lol
 
Only some. The number 53 floats to mind :D
 
@KennyLau lel
 
@KennyLau lel
 
@Sherlock9 Well, it is a way to store a decimal.
each number costs 32 bits (4 bytes)
 
Laughing et loud?
 
3:46 AM
The first bit is the sign (positive or negative)
 
@Sherlock9 "lol" + "kek"
 
Then the following 8 bits store the exponent
Then the following 23 bits store the decimal part in binary
For example, consider 0.15625 = 0.00101_2.
 
If a picture is worth a thousand words, this gif is worth like a million https://t.co/NrtP8A0roY
 
0.15625 = + (2**-3) *(1 + 2**-2)
 
@Quill that's not a gif its a video
 
3:49 AM
That part I know, but that doesn't even begin to explain that dark magic
 
@Sherlock9 See this
Fast inverse square root (sometimes referred to as Fast InvSqrt() or by the hexadecimal constant 0x5f3759df) is a method of calculating x−½, the reciprocal (or multiplicative inverse) of a square root for a 32-bit floating point number in IEEE 754 floating point format. The algorithm was probably developed at Silicon Graphics in the early 1990s, and an implementation appeared in 1999 in the Quake III Arena source code, but the method did not appear on public forums such as Usenet until 2002 or 2003. (There is a discussion on the Chinese developer forum CSDN back in 2000.) At the time, the primary...
Basically, in floating point, a number is expressed as (2**a)(1+b) where 0<=b<1
x = (2**a)*(1+b)
log x = a + log(1+b)
since 1+b is between 1 and 2, log(1+b) can be approximated as b+c where c is a parameter
 
4:21 AM
Keyboard layout indicator in my status bar works!
 
here
1
A: Compute CRC32 Hash

Kevin Lau - not KennyRuby, 142 bytes Anonymous function; takes a string as input, returns an integer. ->s{z=8*i=s.size;r=0;h=4374732215<<z l=->n{j=0;j+=1 while 0<n/=2;j} s.bytes.map{|e|r+=e*256**(i-=1)};r<<=32 z.times{h/=2;r^=l[h]==l[r]?h:0} r}

look at the comments
 
@Dennis HAHAHA
 
4:55 AM
Um
What builtins should there be for a semi-golfing language?
(Or what builtins would be useful/used often?)
 

« first day (1919 days earlier)      last day (2910 days later) »