A Demo of ‘Extended’ Labs

In this post I am going to show a video of what can be done with the addition of media to labs (and that media includes parallel interfaces), but before that an overview of how these features are being put into place.

 

To begin, text files with .ijt extensions are recognized as lab files. The have a two part structure with the first part up to the single right parenthesis being the ‘lecture’, followed by text executed as if it were part of the operating environment. The results of this evaluation and the instructions are shown to the learner with one exception – the text preceded and followed by the PREPARE keyword is executed but neither they nor the results they produce are shown. This allows side effects such as having files loaded and run to adjust the environment and showcase specific concepts to be taught.


BlogLab1

In the case of the example lab, ‘J conference 2014 – Toronto’, the PREPARE section launches the frame1 display which shows the jhs environment and an interactive display of shape and type side by side. frame1 is patterned on the demo9 example in the studio menu of the JHS environment, creating an html file with frames to display the different components.  The result is  two interactive frames side by side, with the jijx window displaying the ‘lecture’ for this particular lesson, in this case hints of phrases to enter.

BlogLab2

The second lesson launches frame2 but in that case a video replaces the shape and type demo. This video is the Ratio Arithmetic promo video that I produced and originates from my account in youtube. At this point only external videos may be run by the Safari browser. By using video animations and explanations of more complicated concepts combine to make for easier learning . At least that is the potential use, whether the combination of video, text and interaction works to make things clearer is down to the skills of the creator.

 

BlogLab3The final lesson returns back to the interactive jhs environment.

This will probably be as far as I will take this experiment with the lab framework, as Eric Iverson has suggested that it may be better to use the sp framework which has more capability for the new forms of interaction. The key thing I believe is to retain the structure of the lab files so that they are backward compatible and more importantly to potentially create a tool to allow easier creation of the augmented labs and at the same time enforcing lab structure with consistent results across platforms.

J Labs and why I find them so amazing.

Why Labs are Important

One of the most unique aspects of the J environment is the lab. Imagine that, a language with instructional support built in to the interface. Even more ambitious is that the support is provided not by page after page of description such as a man file in the unix system, – but by a series of  ‘lectures’ followed by access to the entire J environment to experiment on all those new ideas – and it is all just a menu click away in the standard J user interface.

How Labs are structured

Lab files all end with the .ijt extension and can be opened in any text editor. So how are these labs structured to provide this facility? The format of the lab files is simply a specifically formatted text file which the J environment, interprets and presents as a living lab. The file starts with some identifying header information and then moves into the main structure. Each time you advance the file you get some new information in a section of the lab. Most sections have two parts: 1)  a text message to the learner that ends with a single ‘)’ on its own line and 2) a series of executable J sentences and results that will be seen by the learner. Sections are combined to form chapters. the difference between sections and chapters is that J provides a way to jump between chapters but sections must be done in the same order each time. J labs can also do some hidden creation that the user does not see using the PREPARE keyword to bracket the section that will be executed invisibly. This allows the learner to focus on the lesson instead of developing the context of the lab. As a learner grappling with a new concept, the last thing you would want would be to perform a detailed series of instructions to create the results that you are trying to observe. This is also a reason that section need to be run in order because each lesson within the section may set up different parts of the environment and a misstep could result in very odd behaviour.

In conclusion

In a nutshell that is the mechanism behind the remarkable feature of the J language called labs. In future posts I will explore in greater depth the potential of labs when combined with HTML5 in the JHS environment and what approaches can be used to make these changes more effective. Eventually it would be good to create a tool that can easily create labs. I believe that it is by making the labs easier to create that we can actually involve more people in producing them and in that way develop an even more effective learning community for the J software language.

Video Annotation for Lesson 4 of Idiosyncratic Introduction

Here is the new video annotation for the fourth lesson of the Idiosyncratic Introduction to J. The changes in approach in this video are most visible about half way through where I make some changes to accommodate the challenge of displaying matrix operations. In the end I opted to use an ‘in-place’ method using highlights to indicate the argument to the operator. I like this enough that in the end I may make some reversions to the earlier labs to make them consistent, but obviously before I do I would love wider feedback on the new video.

The new version of Lesson 3 Video Annotation

This is a new version of the Lesson 3 video annotation based on a suggestion by Raul Miller. Raul’s concern was that the previous version had too busy an animation. Why not do the operation across lists vertically by layering the lists instead of rotating from horizontal to vertical and back again. The advantages of this is that the animation is cleaner and quicker and the use of the assignment operator (=.) is not required. The challenge is that left argument mus be above the right argument for non-symmetrical operators such as Minus (-) and Divides (%) and the spacing of the columns depends on the width of the results. Let me know whether this version is an improvement. I look forward to your feedback/comments.

Cheers, bob

Video for Lesson 3 of Idiosyncratic Introduction to J

Well at least it did not take as long to get the video for Lesson 3 up and running. I took a slightly different approach here and animated the actual lines of J to show how the calculations take place. This is pretty straightforward for lists/vectors but may become more complicated when 2 dimensional arguments are used in the next lesson. I may need to draw on my experience with some of the NuVoc videos … and then again I may come up with something different again.

As always, comments and suggestions are welcome.

Cheers, bob

You ain’t heard nothing yet

Yeah, I know it has been a while and you have every right to be concerned about the pace of this project – I know I have been at times. But what you don’t get a chance to experience is the amount of behind the scenes development that has gone on.

For one thing, it turns out there is a very nice way to add sound to Keynote animations – that’s good – and it also turns out that the reliability of Keynote timing when exporting to video is suspect – frustrating. As a result, the Keynote animations need to be moved to iMovie, have the voice over added and timed out to result in a reliable video output. The result is actually more efficiently produced – more updates to follow – and allows exact timing of voice over and animation – vital.

Here is the Lesson 2 annotation to “An Idiosyncratic Introduction to J” by Roger Hui.

Video Annotation for Lesson 2 of An Idiosyncratic Introduction to J

First, an admission that these videos do take a while to produce and in the process of developing them I am still discovering the most efficient workflow and optimal tool use. So, if you think that the only productive area is the final result, remember that there is much work going on behind the scenes.

This video involves much more animation than the first one and I think it hints at the power that these annotations can have as we move forward into lessons that have more cognitive challenges.

For now, watch this one and let me know whether the process is working for you as a viewer. If it isn’t, please let me know (extra special bonus points if you can also suggest a solution, but just pointing out the issue is sufficient).

Cheers, bob

Video Annotation Script for Lesson #2 – Idiosyncratic Introduction

Video annotation of the J labs round 2. Following is the text of the lab as it is presented in ‘An Idiosyncratic Introduction to J’.

── (2 of 15) Functions ────────────────────────────────── There is a rich set of primitives. ) 2 + 3   5 2 - 3   _1 2 * 3   6    2 % 3   0.666667    2 ^ 3   8    2 ^ 0.5   1.41421   _2 ^ 0.5   0j1.41421    2 ^. 3   1.58496

Wow, I learned a ton creating the video for the first lesson. Most important was the difference between the spoken word and the written word. I will probably need to go through the same process this time, but here is a first draft for a script of the video annotation of this lesson. It involves more animation as concepts are presented visually and these are noted within brackets. The script follows in blue text.

Ah, now to explore how J notation conveys those mathematical ideas. Primitives are functions defined by the creators of the J language. Let’s take a quick look at the examples.

2 + 3, no surprise here, the answer is 5, but then 2 – 3 shows us J’s way of showing negative numbers. In standard math notation, we think of -1 as the number 1 with the – operator applied to move it to the left of the number line (animation). It’s as if we use the positive number line and the ‘-‘ function to create the full number line. In J, one unit to the left of the origin has its own name, _1. Applying the – operator to any value moves the result to the opposite side of the origin, but now we have two valid starting points –  1 and _1 and the ‘-‘ function feels more symmetrical.

The next lines show that J uses * as the multiplication operator and % as the division operator. The second choice is a little strange but it includes the recognizable division slash  and it can be shown on one line, unlike the vertical fraction representation of division(animation).

Using ^ as the exponentiation operator is also nice since superscripts and offset lines are no longer needed (animation of 23 to 2^3). 2^3 and 2*2*2 are both 8.

There are two things to keep in mind when raising bases to fractional powers. First is that decimal fractions require a leading zero, here creating an exponent of one half also known as the square root. The second has to do with the square root result. For positive numbers this is pretty straight forward, but the square root of a negative number requires complex numbers, which J expresses in two parts, separated by the letter j. The first part (the real part) can map to the x axis and the second part (the imaginary part) maps to the y axis. By definition, multiplying a number by 0j1 rotates it around the origin (animation) by 90 degrees, so multiplying by 0j1 twice moves it to the opposite side of the number line, effectively making it negative. By multiplying 2^0.5 by 0j1 we get 0j(2^0.5) and 0j(2^0.5) * 0j(2^0.5) becomes ((0j1)^2)* 2 or _2, so 0j(2^0.5) is the square root of negative 2.Using ^ as the exponentiation operator is also nice since superscripts and offset lines are no longer needed (animation of 23 to 2^3). 2^3 and 2*2*2 are both 8.

Finally we see the base function ‘^.’ ; made up of the characters ‘^’ and ‘.’ that express the log of a base. For 2 ^. 3 the answer 1.58496 means 2 ^ 1.58496 is 3. Notice that ^ and ^. are related mathematically to each other and differ by a single period called an inflection. The other inflection character that J uses is the colon, ‘:’. Inflections group similar functions together .

 

I am particularly wondering about including the complex numbers explanation with regard to the square root of negative numbers. Should it be shortened or lengthened? Right now it seems a bit lost to me. I look forward to your comments.

Preliminary Video Script for “Lesson #1 of An Idiosyncratic Introduction to J”

Video annotation of the J labs (including commentary and animation) can provide an extra dimension to the learner. If you haven’t yet used labs, you simply must open a J session, open the ‘Studio’ menu and select ‘Labs’. Using “An Idiosyncratic Introduction to J”, the lab written by Roger Hui, we’ll develop ways video can be incorporated into the JHS environment to create an effective learning tool. Let’s look at the first lesson of the lab.


───────────────────────────────────────────────────────────── Lab: An Idiosyncratic Introduction to J Author: Roger Hui To advance the lab, select menu Studio|Advance or the corresponding shortcut. ── (1 of 15) Introduction ────────────────────────────────── J is executable mathematical notation. ) 2 + 3    5   x=: 2   y=: 3   x + y 5
 

This is pretty straight forward, but like J, it is terse to the point of impeding communication. Examples of how the language works follow the one line introduction. In this lesson I think that the best use of the video annotation is to introduce the lab and then emphasize the importance of that first line. Following is a first draft for the video script.

This introductory lab was written by Roger Hui, one of the originators of the J language. His idiosyncratic approach moves from simple foundations to sophisticated concepts in just 15 lessons. This video commentary is meant to showcase the subtleties of the lab. The long button below advances lab lessons and video together; the numbered buttons allow random access of the videos (but not the lab lessons). The window to the left is a working J session and allows you to enter any J statements you wish interactively.

The first lesson begins with the statement “J is executable, mathematical notation”. This simple sentence holds great power. We can see in the examples that follow it, by typing the expression, 2 + 3 and pressing return we get the response 5, and because J is also a mathematical notation, using J to express mathematical ideas makes mathematics machine executable. Take a moment to consider the opportunity that J provides through executable, mathematical notation. A mathematical idea expressed in J notation can be executed with the press of a button; you now have the keys to a math laboratory.

So, that’s about it for now. I look forward to comments on what you’ve seen.