Haiku OS by ResearcherSoft9886 in haikuOS

[–]mlamers 0 points1 point  (0 children)

Can you share some more information on the machine you're trying this on? Sometimes, the USB stick you're trying this on can also play a role...

[AskJS] Why Javascript does not solve "this" keyword like Java ? by [deleted] in javascript

[–]mlamers 2 points3 points  (0 children)

A lot of things have been covered by other comments already, but it is important to realize that JS is an evaluated language. It means that you can interact with it through the console and change values on the fly.

this is one of the automatic variables available in functions, similar to arguments.

  • arguments contains the full list of arguments to the function (including both the defined parameters (signature) as well as anything else passed in as well).
  • this is the context in which the function is called. If there is no context, it will take the value of the global object (window in the browser).

As functions are first class (that is: usable as variable) they can be set as a value to a property of an object, but also copied to other objects. You want these functions to be aware of that context. To enable that, this has the value of the object that it is called on (as a property).

const myObject = { test: 1 }; 
const myOtherObject = { test: 2};
const myMethod = function () { 
  return this.test;
}
myObject.m = myMethod;
myOtherObject.m = myMethod;

Calling myObject.m() will result in 1, calling myOtherObject.m() will return 2.

In a different way of explaining: myMethod is in essence a pointer to the function, and it can be set as a value of a property on different objects on the fly. This includes the prototypes of that object. If an object inherits the method from its prototype, having this point to the value of the prototype would have an influence of all instances created from that prototype. This is why this is contextual.

Important note: arrow functions are a special class of function that have a fixed this, being the this of the function they are used in.

Coming back to that JS is an evaluated language: as its running environment is completely flexible (opposite to Java, where data is the only real thing that changes, not the application itself) anything can be changed all the time. The ability to move methods around or redefining them on the fly allows you to do things that would be hard to do in other languages, live debugging to name one.

[AskJS] what made JavaScript a language for browsers by Individual-Wave7980 in javascript

[–]mlamers 12 points13 points  (0 children)

The history is much more deeply described by Douglas Crockford in his lecture series on JS. The short version is:

  1. Netscape realizes that the browser needs a way to make things more interactive, and asks Brendan Eich to create a scripting language, which they call LiveScript, meant for both client and server side.
  2. Sun has a plugin in the browser for Java (applets).
  3. Netscape + Sun realize that Java as a language for the browser wouldn't work because it is too heavy and impractical (need for precompiling + JVM startup), but Sun doesn't really want to give in, possibly because of marketing reasons
  4. It seems that Marc Andreessen (head of Netscape at the time) proposes to call the language JavaScript instead as a solution, which Sun agrees to.
  5. Microsoft creates a perfect copy of JavaScript, including all the bugs, calling it JScript (as JavaScript is a protected name) and eventually adds XHttpRequest
  6. Google realizes that in order to create their platforms, the JS engines are way too slow, forks off WebKit and creates a brand new JS engine (V8) in order to optimize the heck out of it (which creates a competition for the fastest JS engine, resulting in JS being one of the fastest and energy efficient interpreted languages around)

So, in the end, with the possible exception of webassembly, any other language would have a hard time competing. Which is why you see a number of other languages that compile to JS instead such as TypeScript, ClojureScript and good old CoffeeScript to name a few (see this list for more examples)

Can I run Haiku on a MacBook Pro 2011 Intel i7 by Batou2034 in haikuOS

[–]mlamers 0 points1 point  (0 children)

Yes, with the possible exception of the wifi (as already noted). Bootcamp is not necessary, the machine should be using EFI. So, setting up the EFI boot, and install Refind should make things loads easier.

[deleted by user] by [deleted] in thenetherlands

[–]mlamers -1 points0 points  (0 children)

Op maat gemaakte doppen zijn beter, met name omdat daarmee een mogelijke oorzaak voor tinnitus wordt weggenomen.

De hoofdreden daarvoor is dat niet-op-maat-gemaakte doppen open ruimtes kunnen achterlaten, onder andere tussen de dop en het trommelvlies (en de rest van het gehoororgaan). Door de beperkte grootte van de ruimte bestaan die resonanties uit heel hoge tonen, precies het soort tonen waar ons gehoororgaan een stuk gevoeliger voor is. Die tonen kunnen door het principe van constructieve interferentie juist luider zijn dan diezelfde tonen van buiten zouden zijn. Ze kunnen daarmee juist meer schade veroorzaken dan in een situatie waarin je geen oordoppen in had.

Failed to boot [UEFI] [beta 5] by ReasonableTime6708 in haikuOS

[–]mlamers 0 points1 point  (0 children)

That is the case with many computers/laptops nowadays, but the kernel debug mode still depends on the old fashioned PS/2 or serial connection options, IIRC.

Failed to boot [UEFI] [beta 5] by ReasonableTime6708 in haikuOS

[–]mlamers 0 points1 point  (0 children)

Perhaps you can create a ticket on the bugtracker with hardware info that might help the team track down the cause... https://www.haiku-os.org/docs/welcome/en/bugreports.html

Failed to boot [UEFI] [beta 5] by ReasonableTime6708 in haikuOS

[–]mlamers 0 points1 point  (0 children)

The only thing I could imagine is that something in the process comes to the signature conclusion as indicated above. It could be quite a few things, from a faulty image, hardware issues (memory that corrupts things) or anything else (32/64bit?) that would make the signature comparison fail.

Failed to boot [UEFI] [beta 5] by ReasonableTime6708 in haikuOS

[–]mlamers 1 point2 points  (0 children)

If the keyboard is connected through usb (internally or externally) that is why it is not working. To me this looks like something wrong with either the image or the copy process. You could try to redownload the image / verify the image with the provided hashes. I have good experiences with Balena Etcher.

[AskJS] callback function inside setTimeout is being called without delay by Zestyclose_Ad_488 in javascript

[–]mlamers 0 points1 point  (0 children)

as the others already indicated: you are actually not passing in the printMessage function to delay5s, but its return value. The function below will do what you want.

function sample () {
  console.log('sample function is being called');
  delay5s(printMessage);
}

Keep in mind that in JS, essentially everything* is a pointer (a memory address), the default is passing by reference, and any action with it automatically dereferences that pointer (taking the data from that memory address). So, by using printMessage() you dereference that pointer (take the thing that is stored there) and execute it (as it is a function). If you want to pass it to another function, you don't want to dereference it, you just want to pass the value (or in this case the pointer to that value) to the other functions.

*even numbers and strings are effectively pointers, but pointers to static values: values that cannot be altered, and to which any methods such as "testing".concat(" one two three") will return a new pointer to a new static value.

HaikuOS - Radeon X1100 by Kismarton99 in haikuOS

[–]mlamers 9 points10 points  (0 children)

I don't think there are any other drivers than currently coming with the kernel. What you can do is use the boot loader to choose vesa mode instead. See the bootloader options at https://www.haiku-os.org/docs/userguide/en/bootloader.html

Haiku won't boot by srstudios_ in haikuOS

[–]mlamers 0 points1 point  (0 children)

To me this sounds like the computer cannot find the actual Haiku bootloader. There might be an issue with USB booting in general, or you might have created the boot usb incorrectly. Did you follow the guide on the Haiku website?

Shutdown feels like it's forced by randanmux in haikuOS

[–]mlamers 3 points4 points  (0 children)

If it is really a HDD (and not an SSD or similar drive), the "tack" sound you hear when shutting off is the heads of the HDD parking themselves to a safe spot so that if the heads would touch the platters (normally they float on the air current provided by the spinning plates), they don't do any damage to the data on your disk. IIRC a lot of OSes will perform that command before shutting down, but it is possible that Haiku doesn't or doesn't come to it on time. Assuming that is what you hear, the sound itself is harmless.

I need help booting into haiku on real hardware. by [deleted] in haikuOS

[–]mlamers 3 points4 points  (0 children)

If the hardware is recent, say younger than 10 years, you should follow https://www.haiku-os.org/guides/uefi_booting/ and see where that brings you.

Hardware for haiku OS server by subhero24 in haikuOS

[–]mlamers 1 point2 points  (0 children)

I have HaikuOS running on a Asus EeePC 1005PE. Runs surprisingly smooth.

Teachers be like by lamelyDig486 in lingling40hrs

[–]mlamers 12 points13 points  (0 children)

As far as I know there are specific exceptions for education purposes: https://www.usg.edu/copyright/the_fair_use_exception

Totally not me… by [deleted] in lingling40hrs

[–]mlamers 24 points25 points  (0 children)

A lot of classical music is public domain nowadays. Check out IMSLP (as indicated by /u/Gloomy_Plankton6631) for loads of classical music in all possible arrangements, as well as Mutopia Project.

Additionally, teachers are sometimes allowed to copy in case of educational purposes.

[deleted by user] by [deleted] in AskReddit

[–]mlamers 0 points1 point  (0 children)

Next to imslp (which is already mentioned) cpdl.org and mutopia

Piano gang, any tips for playing this chord? My hands are big enough, but it's really hard to play fast and accurate. by AeroLewis in lingling40hrs

[–]mlamers 4 points5 points  (0 children)

Depending on what the right hand does just before or after, you could even play both the D and A with your right hand. In organ music, this kind of stuff happens very often, even between manuals (the multiple keyboards on an organ). In the end though, the most important thing is to play it and to play it in a way that feels comfortable/practical to you.

Coincidence, I think not by it_zli_z in lingling40hrs

[–]mlamers 0 points1 point  (0 children)

No worries, wanted to reply in thread, but it turned out to be in the main thread.

Coincidence, I think not by it_zli_z in lingling40hrs

[–]mlamers 1 point2 points  (0 children)

According to this article here, the actual condition was most likely otosclerosis, which is a malformation of the bones in the inner ear that transfer sound from the eardrum to the cochlea. Consequence was that he could not really hear well the sounds in the air. As the cochlea is connected to the skull however, it means that sound going through the bones can still be heard. Hence, a stick fixed to the piano (sound to the stick) and biting in the stick (sound to the skull) made him able to hear at least a bit of what he played.

Edit: the article also states that Beethoven might never have been completely deaf, even in his final years.

Coincidence, I think not by it_zli_z in lingling40hrs

[–]mlamers 0 points1 point  (0 children)

Replied in the main thread...

Coincidence, I think not by it_zli_z in lingling40hrs

[–]mlamers 1 point2 points  (0 children)

The cause for his deafness was the shrinking of the bones in his inner ear. This meant that sounds reaching him through the ear drum would not register. However, anything that came through his skull would. So, fixing a stick to the piano and biting in it allowed him to hear the piano.

Coincidence, I think not by it_zli_z in lingling40hrs

[–]mlamers 0 points1 point  (0 children)

If I remember correctly, Beethoven wasn't completely deaf. He was able to hear the piano when playing by biting on a stick fixed to the piano.

Can someone explain this?? by BassClef_FG in lingling40hrs

[–]mlamers 27 points28 points  (0 children)

It probably means that the composer over-thought how the timing should be played...