Author: rex@rogerlmain.com

  • Multiple Inheritance

    Do you ever wish for multiple inheritance? That is, being able to inherit the methods and properties from multiple classes? For example, let’s say you have: And you want But you don’t want to have to spell it out because there’s a lot more in functions functionA and functionB than I’ve put here. Conventional wisdom…

  • What is that garbage on your closing brace?

    You may have noticed that when I close a block in my code, regardless of the language, I put a comment on the closing brace, like so: Why do I do this? It was a trick taught to me by my original mentor and, simply it shows what the closing brace closes. When I programmed…

  • Accessing Data in a Model Binder

    In this post I discussed creating a custom Model Binder. The next question I had was, “how can I access my database in that binder?” Before you spend hours beating your head against the wall, let me just say that it’s pretty easy. I’m going to assume that you have something like this in your…

  • Model Binding

    There are a plethora of examples for model binding and, like most examples, they are run through the complicator. So here is the short version. Model binding is the idea of taking the data that is passed into an API call and massaging it into a form that is expected by the API handler. This…

  • How Big?

    clientWidth = width + padding clientHeight = height + padding offsetWidth = width + padding + border offsetHeight = height + padding + border totalWidth = width + padding + border + margin Use the following prototype definition: totalHeight = height + padding + border + margin Use the following prototype definition: clientTop = top…

  • All is lost

    Typescript is a veneer language for Javascript, not a language in its own right. It is not interpreted like Javascript, nor is it compiled like traditional languages such as C, Java or Pascal (remember that old chestnut?). Instead, it is transpiled or converted into Javascript, which is then interpreted by your browser. Because of this,…

  • Hiding stuff

    There are three ways to hide an element in CSS: Using display:hidden removes an element from the layout completely. It doesn’t take space on the page. Pros: It removes an element from the layout completely. It doesn’t take space on the page. Cons: If used, then you must “remember” what the actual display type is…