Scripts

From J Wiki
Jump to: navigation, search

To contribute a script, edit this page, creating a link to a new page under Scripts and a brief description. Then visit the new page and fill it with your script along with documentation for its use. If you want the page to be Owned, which will prevent other users from modifying it, contact an administrative WikiGnome for help. Otherwise the page will be Open and can be modified by all.

You can make it easier for others to use your script if you create a downloadable attachment containing it. To do so, insert the tag

. attachment:attachment-name (example: attachment:alphabeta.ijs)

somewhere in your script's page. When you save the changes to your page, you will be prompted to supply the file, which will be saved in the Wiki as an Attachment. You can look at the attachments to a page by going through the 'More Actions' dropdown box under the tabs at the top of each page.

If you want to comment on the contents of a page, insert your comments in the page itself, or if the page is Owned, insert your remarks on this page.

Scripts can be installed anywhere in your system. A convenient place for scripts is the misc subdirectory of addons, i.e. jpath '~addons/misc'.

Contents

1D Rubik's Cube

1D Rubik's Cube Given a scrambled line, find the shortest sequence of rotations to restore the original position.

Affinity - Windows

This script shows how to set processor affinity on Win7.

Alpha-Beta Minimization

This script is a structure for solving two-player games using alpha-beta pruning. You supply the functions to evaluate positions and suggest moves.

APL SF Files

This script reads APL*PLUS sf files into J.

Big Files example

This is an example of how to work with files larger than 2 gigabytes. The application breakupBigFiles2CD.ijs allows us to break up large files into smaller pieces and to re-assemble them.

Arc 4 (CipherSaber)

This script provides a tool for encrypting and decrypting strings using the Arc 4 algorithm. Arc 4 is Compatible with the RC4 algorithm per Schneier's "Applied Cryptography, 2nd edition".

Calling J from J

This script gives examples of calling J from J. Similar routines may be written in other languages that can call DLLs or shared objects.

Cards Generator

This script generates a deck of cards as a graphical bitmap suitable for visualizing card layouts. The deck contains 52 cards, a joker, two coats and a blank.

Chess Generator

This script lays out a chess board using a graphical bitmap suitable for visualizing chess problem or puzzle layouts.

Chess Grid

This script uses J6/Grid control and Unicode to generate dynamic chess board.

Color Adjust

Color Adjust applies color adjustments to an image using brightness, contrast and gamma with a curve plot against the image histogram.

Convert to UTF8

This script converts plain text files in codepages to utf8.

DDE Client Class

This script provides a J API for a Windows DDEML client. The verbs issue DDE requests or DDE executes.

Diagram

Diagram drawing prototype.

Directories' Selection

Script to bring up an input window requesting the user to supply a "source" and "destination" directory; has explicit event-loop handler and uses the directory browsing facility.

Edit Enhancement

Edit Extension an extension to the edit verb.

Editable wdview

Editable wdview is an editable version of wdview.

Editable Grid

Edit Grid defines the editgrid verb for displaying an array in an editable Grid control and assigning the grid data to a user-definable noun on close. Useful for creating miscellaneous arrays for use in the session.

Fast File Read

A small sample of memory mapped files routines. This facility provides for fast I/O, particularly for larger file sizes. For comparison, a C implementation of the J program is also provided.

FastCGI and SCGI Server

This script implement both FastCGI and SCGI servers.

Fix Explicit Argument Names

This script does a search and replace to change use of dotted parameters x. and y. etc. to x and y in scripts and labs.

Forum Time Series

To explore trends in Jsoftware.com forum messages using statistical time series analysis, J's plot procedure and J's data analysis features are very enabling. Through a few examples we attempt herein to suggest a possible approach which is rather simple and transparent.

FFT Utils

FFT Utils provides windowing and other utility functions useful when using the FFT addon.

Games - Minesweeper

This script implements Minesweeper.

Games - Tic-tac-toe

This script implements a tic-tac-toe game.

GL Image

This script provides ad hoc image creator verb, which generates images based on gl2 script definition and size.

GPS Waypoint Utils

This script defines utilities for processing GPS waypoints from GPX, GoogleEarth KML and csv POI (Point of Interest) files.

Hex Viewer

HexView is a simple hex viewer that uses mapped files to quickly view byte contents of large files

Hive-off JWD

HiveOff offers a technique for splitting off a (j602) wd-based interface to allow its app to run in j701

HTTP Get

HTTP Get given an URL downloads the resource from the Internet.

I Ching

I Ching ideogram builder.

INI Files

This script defines covers of the Windows API functions for reading and writing INI (*.ini) files.

JfromExcel

This script gives an example of calling J from Excel on a 64 bit os.

jkernel

jkernel Jupyter (ipython) Notebook / J Integration

Julian Days to/from Dates

This script converts dates and times to and from Julian days. Included are verbs for; converting local system time to UTC/GMT time and back, and customizing the formating of dates and times.

Keyed Lists

This script deals with 2-dimensional arrays of boxes where each row is a data record and one column, usually column 0, is a key field. Verbs are provided to retrieve from and operate on such arrays.

Logger

This script provides routines for logging messages and (optionally) displaying them in a small window. See "exampleUses" at the end of the script for examples of how you might use these capabilities.

Missing Values

This script provides routines for handling missing values in calculations.

Morse

This script transforms normal text to morse code.

Nonblocking Web Server

This script implement a simple nonblocking web server.

Nonlinear Least Squares

This script provides the scripts and documentation of the Levenberg-Marquardt optimization algorithm.

OLEExcel

This script reads and writes Excel spreadsheets using Windows OLE.

OpenOffice

This script demonstrate how to open OOo calc using ole32 api.

Pan View

Pan View is a prototype of fast image panning using indexed subset of the original image in a view.

Picture Database

This script is a simple demonstration of how to store pictures in database.

Plot 3D

Plot 3D Plotting boolean 3-array, roughly equivalent to 3D version of viewmat. Also plots a list of 3-coordinates similarly.

Pretty Print

This script is a *nix shell script to format J source files.

Prolog

This script is a simplistic Prolog-like example creating and querying relations between subjects and properties.

Pump: multiPort synchronoUs Multiplexing Pump

Pump routs TCP connections and requests to particular servers through designated ports of other servers. Good to fool VPN to expose its machines to non-member connections.

qjide: Qooxdoo J IDE

qjide An experiment for another browser based J IDE.

Quadratic Explorer

This script provides a tool for exploring Quadratic Equations. This can be used for teaching at a high school maths level.

Quote Dictionary Of J

This script provides a dyadic verb, qdoj that allows you to easily quote the J Dictionary (Dictionary of J, DoJ). The utility should make it easier for J users to communicate with each other regarding the documentation, as well as providing a method to automatically build data from the documentation (for example, the mapping of 3!:0 onto human-readable names from the 3!: page).

Real-time Plot

Real-time Plot shows how to make real-time plot updated at regular intervals using the timer event.

Scheme

Scheme is a minimal Scheme interpreter.

Serialization

Serialization as hierarchical persistence for J objects in an executable and human readable format, leveraging dynamically typed and interpreted environment.

Session Utilities

Session Utilities is a collection of useful tools for J Session Manager, such as selecting global definitions, etc.

Set Game

Set Game is a GUI version of the Set card game described in the Set Game essay.

Socket System

Socket System is a set of scripts that create and manage sockets and socket events. The top layer creates sockets; the next layer performs data-transfer; the third layer does applications. Synchronous and asynchronous transfer are supported. Applications provided include SMTP email, POP3 email, and a simple file server and client.

Splitter Control

Splitter control for dynamically resizing boundary between two or more controls. Has a vertical and horizontal variety. Capable of having multiple splitters in one window.

Steganography

Steganography Hide/embed a message in a bitmap file.

Stereo Plot

Stereo Plot produces stereo view of 3D plots.

Streams

Streams enumerates Windows File Streams.

Su Doku hand solver

This script provides 3 dyadic verbs entries, removals, and tryHard that provide a non-GUI facility for manually solving Su Doku grids. The scripts a) check your entries and removals for validity given the current state of the grid you are solving, and b) display extra information about those valid possibilities in each grid cell.

Tacit to Explicit

TacitToExplicit Attempts to convert a tacit verb to explicit.

Task

Task allows to run external processes using command-line interface and input-output streams. Updated for 64-bit.

Text UI

Text UI Text User Interface prototype.

Tracer

This script steps through the process of tracing a J sentence.

Treeview

This script implements a treeview control in J.

Trig Explorer

This script provides a tool for exploring Trigonomic Equations. This can be used for teaching at a high school maths level.

Turnstile Rotary Enigma

Turnstile Rotary Enigma, puzzle consisting of two overlapping circular disks, which can be thought of 2D Rubik's Cube.

Unicode File Read

This script reads unicode text files in various formats.

UnZip Zip Archive

This script extracts a Zip archive to a specified directory.

Update Photoshop Elements Database

This script provides a example for updating a PSE4 or PSE7 Organizer databases.

Vigenère Cipher

Vigenère Cipher is method of encryption that uses a series of different Caesar ciphers based on the letters of a keyword

Viewmat Spy

Viewmat Spy Dynamically patches viewmat to show the current mouse position and corresponding color in that point.

WD Spy

WD Spy Used to trace all wd input and output to help debug your code or learn how others' works.

Weather Plot

This script plots weather data from 1973-2009.

Windows Clipboard

This script provides verbs to replace many of the wd'clip' verbs.

Windows Direct I/O

This script provides a J API for Windows Direct I/O. The verbs read sectors and return disk device information. Also, there is sample verb for copying a file with read errors.

Windows Timer

This script shows one way to use Window's timers.

WS - save variables to file

This script allows J variables to be written to and from files.

WS Files

WS Files APL workspace storage for J locale names

Zoom View

Zoom View is a prototype of fast image zooming using indexed nearest neighbor interpolation.