I am building a library of functions that I would like to distribute as a single JSL file. But some of my functions reference image files. In this blog post I will explain the process I use for serialising the image file so that it can be embedded directly into my JSL script.
Tag Archives: JSL
‘For-Each’ Iteration
One of the most important tasks that a computer can do it repetition of tasks. That’s why iteration is such an important element of JSL code. In version 16 of JMP, new syntax was introduced to describe the way we iterate over elements of structures such as lists and matrices.
Working with String Variables
In this post I take a look at how JSL can be used to perform string manipulation.
Transparency
Here’s a handy little function to apply a transparency effect to a solid (r,g,b) colour:
1 2 3 4 5 6 7 8 |
TransparentRGB = function({r,g,b,opacity=0.65},{default local}, red = opacity*r + (1-opacity); green = opacity*g + (1-opacity); blue = opacity*b + (1-opacity); return(RGBColor(red,green,blue)); ); |
File Handling
The JMP scripting language has a number of convenient functions for handling files external to JMP. Here’s an example:
1 2 3 4 5 6 7 8 |
// purge the temporary folder files = filesIndirectory(tmpDir); for (i=1,i<=nItems(files),i++, path = convertFilePath(files[i],base(tmpDir)); if (!isDirectory(path), deleteFile(path) ) ); |
Handling Column References
JSL is often described as a scripting language. Personally I think that doesn’t do it justice. I prefer to think of it as a programming language. The difference? For me an obvious difference is that instead of using hard-coded values I want to use variables. In particular I want to use variables to handle column references.
Segmented Regression
I’m sure there is a more technically correct term for this: I use the phrase segmented regression to describe the process whereby I select a segment of data within a curve and build a regression model for just that segment.
I have some code to aid the process. The code illustrates how to perform regression on-the-fly as well as how to utilise the MouseTrap function to handle mouse movement events.
Web Scraping TripAdvisor
Since writing this post I have placed the associated code on the
JMP File Exchange …
The problem with the internet is that it gives you too much information, or rather, it takes too long to gather the information. I often cross reference hotel booking sites with TripAdvisor, and its a laborious process. So this evening I decided to streamline my process by writing a script to gather to user reviews into a JMP table and simple report.
Real-Time Data Capture
JMP is brilliant for real-time data capture. Add to that the ability to use JSL to construct “industrial” style user-interfaces and its easy to get JMP deployed in an environment that relies on simple to use robust data capture from online measurement systems.
Get Excel Worksheets
Version 13 of JMP introduces a new function: Get Excel Worksheets.
(more…)