Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

The key elements in human thinking are not numbers but labels of fuzzy sets. -- L. Zadeh


devel / comp.lang.javascript / Re: Monkey gibberish

SubjectAuthor
* Monkey gibberishJonas Thörnvall
+* Re: Monkey gibberishluserdroog
|`* Re: Monkey gibberishJon Ribbens
| `* Re: Monkey gibberishJonas Thörnvall
|  `* Re: Monkey gibberishJonas Thörnvall
|   `* Re: Monkey gibberishJonas Thörnvall
|    `- Re: Monkey gibberishThe Natural Philosopher
`* Re: Monkey gibberishArno Welzel
 +* Re: Monkey gibberishThe Natural Philosopher
 |`* Re: Monkey gibberishArno Welzel
 | `- Re: Monkey gibberishThe Natural Philosopher
 `* Re: Monkey gibberishJonas Thörnvall
  +* Re: Monkey gibberishJonas Thörnvall
  |`* Re: Monkey gibberishJonas Thörnvall
  | `* Re: Monkey gibberishJonas Thörnvall
  |  +- Re: Monkey gibberishJonas Thörnvall
  |  `* Re: Monkey gibberishJonas Thörnvall
  |   `* Re: Monkey gibberishJonas Thörnvall
  |    `- Re: Monkey gibberishArno Welzel
  `* Re: Monkey gibberishArno Welzel
   `* Re: Monkey gibberishJonas Thörnvall
    `* Re: Monkey gibberishJonas Thörnvall
     +- Re: Monkey gibberishArno Welzel
     `* Re: Monkey gibberishJohn Harris
      `* Re: Monkey gibberishJonas Thörnvall
       `- Re: Monkey gibberishArno Welzel

Pages:12
Re: Monkey gibberish

<sq1p8p$ho0$2@dont-email.me>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17594&group=comp.lang.javascript#17594

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: tnp@invalid.invalid (The Natural Philosopher)
Newsgroups: comp.lang.javascript
Subject: Re: Monkey gibberish
Date: Thu, 23 Dec 2021 12:15:21 +0000
Organization: A little, after lunch
Lines: 81
Message-ID: <sq1p8p$ho0$2@dont-email.me>
References: <ad3675d5-4a9e-4208-83f4-1e31161f8c0bn@googlegroups.com>
<e7883088-5cdb-4612-8440-9f326920c7b5n@googlegroups.com>
<slrnss24oc.4j7.jon+usenet@raven.unequivocal.eu>
<1b308090-25ac-4f8d-9f2b-efc88b80b407n@googlegroups.com>
<f1b5dbea-94db-430d-8aa2-f7d26fadd0b7n@googlegroups.com>
<d6b7e850-8ed0-4820-8ff9-23e0c667fcb8n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 23 Dec 2021 12:15:21 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="6cf2058acdf094992f5c9f4fddf64f28";
logging-data="18176"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+jE3zbnOnTy9VzRe9T9zQz2r+/o4VxRLg="
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101
Thunderbird/78.14.0
Cancel-Lock: sha1:FZmVeZQhk2piu+vdGvfeX9FbDcw=
In-Reply-To: <d6b7e850-8ed0-4820-8ff9-23e0c667fcb8n@googlegroups.com>
Content-Language: en-GB
 by: The Natural Philosop - Thu, 23 Dec 2021 12:15 UTC

On 22/12/2021 20:53, Jonas Thörnvall wrote:
> onsdag 22 december 2021 kl. 21:33:03 UTC+1 skrev Jonas Thörnvall:
>> onsdag 22 december 2021 kl. 21:26:47 UTC+1 skrev Jonas Thörnvall:
>>> tisdag 21 december 2021 kl. 00:34:44 UTC+1 skrev Jon Ribbens:
>>>> On 2021-12-20, luserdroog <luser...@gmail.com> wrote:
>>>>> On Monday, December 20, 2021 at 3:19:41 PM UTC-6, jonas.t...@gmail.com wrote:
>>>>>> I have a bit hard to read monkey gibberish, is there a way to explain
>>>>>> this to someone who is not fullfledged retarded?
>>>>>>
>>>>>> .then(res => res.arrayBuffer())
>>>>>> .then(ArrayBuffer => ctx.decodeAudioData(ArrayBuffer));
>>>>>>
>>>>>> Specifically
>>>>>> .then =>
>>>>>> Is there another way to write it that may not be gibberish?
>>>>>
>>>>> I think this is the new fad called "monadic sequencing". If I'm right,
>>>>> the above can be translated into:
>>>>>
>>>>> var x = res.arrayBuffer(); //only it won't be called "res", but the name of the previous result
>>>>> var y = ctx.decodeAudioData(x);
>>>>>
>>>>> Or even:
>>>>>
>>>>> ctx.decodeAudioData( res.arrayBuffer() ); //again, "res" isn't the correct name here
>>>>>
>>>>> It's just a sequence of functions "arg=> expression" where the result
>>>>> of one is passed as the argument to the next. You can do the same
>>>>> thing with a series of temporary variables or by composing all the
>>>>> expressions into one massive expression.
>>>> The important bit you didn't mention is that it's dealing with Promises.
>>>> So you can't do either of the things you suggest above. If you're in an
>>>> async function you could do this however:
>>>>
>>>> const audioData = await ctx.decodeAudioData(await res.arrayBuffer())
>>> Why can't i do this.
>>> const audiostream = new AudioContext();
>>>
>>> async function audioPlay(url){
>>> const audioBuffer = await fetch(url)
>>> .then(res => res.arrayBuffer())
>>> .then(ArrayBuffer => audiostream.decodeAudioData(ArrayBuffer));
>>> const playwav = audiostream.createBufferSource();
>>> var gainNode = audiostream.createGain();
>>> gainNode.gain.value = -0.1;
>>> playwav.buffer = audioBuffer;
>>> playwav.connect(audiostream.destination);
>>> playwav.start();
>>> };
>>>
>>> or this to set volume
>>>
>>> const audiostream = new AudioContext();
>>> var gainNode = audiostream.createGain();
>>> gainNode.gain.value = -0.1;
>>>
>>> async function audioPlay(url){
>>> const audioBuffer = await fetch(url)
>>> .then(res => res.arrayBuffer())
>>> .then(ArrayBuffer => audiostream.decodeAudioData(ArrayBuffer));
>>> const playwav = audiostream.createBufferSource();
>>> playwav.buffer = audioBuffer;
>>> playwav.connect(audiostream.destination);
>>> playwav.start();
>>> };
>> I mean using .start() with an volume parameter, is what any none anal person would do.
> How many models do a programming language need, if you can write the code in a dousins of ways, it will be hard to read without a manual.
> Why did they not just do something like
> playwav.setVolume(-0.5);
>
> Why invent a hierarchy of idioties to write to set the volume?
>
Because Object Orientation Is Kewl and plebs like you dont understand it
so they get your job.

--
"In our post-modern world, climate science is not powerful because it is
true: it is true because it is powerful."

Lucas Bergkamp


devel / comp.lang.javascript / Re: Monkey gibberish

Pages:12
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor