• ARM assembler in Raspberry Pi – Chapter 21

    We already know that ARM is a 32-bit architecture: general purpose registers are 32-bit wide and addresses in memory are 32-bit numbers. The natural integer size for an architecture is usually called a word and in ARM is obviously 32-bit integers. Sometimes, though, we need to deal with subword data: integers of size smaller than 32 bits.

    Read on →

  • ARM assembler in Raspberry Pi – Chapter 20

    Today we will see how to make indirect calls.

    Read on →

  • TinyMCE checkbox toggler for jQuery

    Here’s a small jQuery code snippet that you can use to have an easy to use checkbox toggler to enable or disable a TinyMCE editor with ease (tested on TinyMCE version 4 and jQuery version 2.1.1).

    It’s really easy to use. You just need to create a checkbox element with the class tiny_mce_toggler and a data attribute with the key editor and the text area id used as a TinyMCE editor as a value. The snippet can be easily extracted if you want to use it differently.

    Here is the javascript snippet:

    $(function() {
      var TinyMceToggler = function(_checkbox){
        var checkbox = $(_checkbox);
        var editor = checkbox.data('editor');
    
        checkbox.click(function(){
          if (this.checked) {
          console.log("Add");
            tinyMCE.execCommand( 'mceAddEditor', false, editor );
          }
          else {
          console.log("Remove");
            tinyMCE.execCommand( 'mceRemoveEditor', false, editor );
          }
        });
      };
    
      $("input.tiny_mce_toggler").each(function(){
        new TinyMceToggler(this);
      });
    });

    And here you can see how to integrate it on a page with a TinyMCE editor:

    <!DOCTYPE html>
    <html>
    <head>
      <meta charset="utf-8" />
      <title>TinyMCE - Toggler</title>
      <link type="text/css" rel="stylesheet" href="http://moxiecode.cachefly.net/tinymce/v8/css/all.min.css?v=8" />
      <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
      <script type="text/javascript" src="javascript/tinymce/tinymce.min.js"></script>
      <script type="text/javascript">
      $(function() {
        tinymce.init({
            selector: "textarea"
        });
    
        var TinyMceToggler = function(_checkbox){
          var checkbox = $(_checkbox);
          var editor = checkbox.data('editor');
    
          checkbox.click(function(){
            if (this.checked) {
            console.log("Add");
              tinyMCE.execCommand( 'mceAddEditor', false, editor );
            }
            else {
            console.log("Remove");
              tinyMCE.execCommand( 'mceRemoveEditor', false, editor );
            }
          });
        };
    
        $("input.tiny_mce_toggler").each(function(){
          new TinyMceToggler(this);
        });
      });
      </script>
    </head>
    <body>
    <form method="post" action="#">
        <input type="checkbox" data-editor="tiny" checked="checked" class="tiny_mce_toggler" style="display: block;" />
        <textarea id="tiny"></textarea>
    </form>
    </body>
    </html>

    You can run the example on this fiddle: http://fiddle.tinymce.com/7jeaab

  • ARM assembler in Raspberry Pi – Chapter 19

    So far our small assembler programs have output messages using printf and some of them have read input using scanf. These two functions are implemented in the C library, so they are more or less supported in any environment supporting the C language. But how does a program actually communicate with the world?

    Read on →

  • ARM assembler in Raspberry Pi – Chapter 18

    In this chapter we will delve a bit more into the stack.

    Read on →