The Yorick Programming Language
Yorick has a compact and sophisticated mechanism for describing array indexing and operations, which are used to precisely specify the desired operation to the interpreter. Applying an operation to an array causes the operation to be applied to each element of the array. For example:
> a = [1,2,3,4,5] > sqrt(a) [1,1.41421,1.73205,2,2.23607]
What about multiplying two vectors? The default is to perform an element by element multiplication.
> b = [2,4,6,8,10] > a*b [2,8,18,32,50]Those of you who remember physics or linear algebra will recall inner and outer products. The inner product is defined as the sum of the pairwise products:
> a(+)*b(+) 110The outer product creates a matrix out of each possible multiplication:
> a(-,)*b(,-) [[2,4,6,8,10], [4,8,12,16,20], [6,12,18,24,30], [8,16,24,32,40], [10,20,30,40,50]]The + and - symbols, used where an index would be placed, are called special subscripts and provide precise control over how array operations are executed. The + is the matrix multiplication pseudo-index, which indicates to Yorick along which dimension the addition part of a matrix multiply should be performed. The - is a pseudo-index, creating an index where one did not exist before.
The rank-reducing operators sum, min, max and avg can be used in place of indices.
> a(max) 5 > b(avg) 6
One might wonder why this is necessary, when the equivalent function operators (i.e., min() or avg()) exist? The reason is that for matrices of rank 2 or greater, the rank-reducing index operators allow you to specify exactly how to perform the operation. For example, given a 3x3 array, do you want to average across rows, columns or the entire array?
> c = [[1,2,3],[4,5,6],[7,8,9]] > dimsof(c) [2,3,3] > avg(c) 5 > c(avg,avg) 5 > c(avg,) [2,5,8] > c(,avg) [4,5,6]Here we have also introduced the dimsof() function operator, which reports the dimensions of the argument. In this case, the result tells us that c is an array of rank 2 with three elements in each direction.
Under Linux, Yorick is linked with the GIST graphics subsystem, allowing immediate display of plots and diagrams. Plots are interactive, allowing the user to zoom in and out, stretch axes, and crop the displays using the mouse. Yorick is capable of displaying sequences of plots over time as in a movie, and because of this, the command to prepare for a new image is fma or frame advance.
To plot the value of a function at evenly spaced points, we must first create the x values:
> x = span(0,10,256) > dimsof(x) [1,256]
x is now a 256-element array with values that range from 0 to 10.
The plg function, given vectors for the x and y values, plots x-y graphs.
plg, sin(x^2), x
The results of this command are shown in Figure 1. Note that the arguments are supplied y,x (not x,y). This allows Yorick to supply a default x vector (ranging from 1 to the number of y points), if desired.
Parametric plots are also supported. Consider the following commands which produced the spiral in Figure 2:
> window, style="vgbox.gs" > a = span(0,20,256) > x = a * sin(a) > y = a * cos(a) > plg, y, x
Surface plots are also available, either as a wire frame as in Figure 3:
> #include "plwf.i" > orient3 > x = span(-pi,pi,32)(,-:1:32) > y = transpose(x) > fma > plwf, sin(x)*cos(y)
Or a shaded surface rendition as in Figure 4:
> fma > plwf, sin(x)*cos(y), shade=1, edges=0
A host of advanced graphics options are used in the demonstration programs distributed with Yorick, and the latest copy of the documentation has an extensive description of graphics options. In addition, libraries to read, write, and display PNM-format images are provided.
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Sponsored by AMD
Built-in forensics, incident response, and security with Red Hat Enterprise Linux 6
Every security policy provides guidance and requirements for ensuring adequate protection of information and data, as well as high-level technical and administrative security requirements for a system in a given environment. Traditionally, providing security for a system focuses on the confidentiality of the information on it. However, protecting the data integrity and system and data availability is just as important. For example, when processing United States intelligence information, there are three attributes that require protection: confidentiality, integrity, and availability.
Learn more about catching the bad guy in this free white paper.
Sponsored by DLT Solutions
| Designing Electronics with Linux | May 22, 2013 |
| Dynamic DNS—an Object Lesson in Problem Solving | May 21, 2013 |
| Using Salt Stack and Vagrant for Drupal Development | May 20, 2013 |
| Making Linux and Android Get Along (It's Not as Hard as It Sounds) | May 16, 2013 |
| Drupal Is a Framework: Why Everyone Needs to Understand This | May 15, 2013 |
| Home, My Backup Data Center | May 13, 2013 |
- New Products
- Linux Systems Administrator
- Senior Perl Developer
- Technical Support Rep
- UX Designer
- Web & UI Developer (JavaScript & j Query)
- Designing Electronics with Linux
- Dynamic DNS—an Object Lesson in Problem Solving
- Making Linux and Android Get Along (It's Not as Hard as It Sounds)
- Using Salt Stack and Vagrant for Drupal Development
Enter to Win an Adafruit Pi Cobbler Breakout Kit for Raspberry Pi

It's Raspberry Pi month at Linux Journal. Each week in May, Adafruit will be giving away a Pi-related prize to a lucky, randomly drawn LJ reader. Winners will be announced weekly.
Fill out the fields below to enter to win this week's prize-- a Pi Cobbler Breakout Kit for Raspberry Pi.
Congratulations to our winners so far:
- 5-8-13, Pi Starter Pack: Jack Davis
- 5-15-13, Pi Model B 512MB RAM: Patrick Dunn
- 5-21-13, Prototyping Pi Plate Kit: Philip Kirby
- Next winner announced on 5-27-13!
Featured Jobs
| Linux Systems Administrator | Houston and Austin, Texas | Host Gator |
| Senior Perl Developer | Austin, Texas | Host Gator |
| Technical Support Rep | Houston and Austin, Texas | Host Gator |
| UX Designer | Austin, Texas | Host Gator |
| Web & UI Developer (JavaScript & j Query) | Austin, Texas | Host Gator |
Free Webinar: Hadoop
How to Build an Optimal Hadoop Cluster to Store and Maintain Unlimited Amounts of Data Using Microservers
Realizing the promise of Apache® Hadoop® requires the effective deployment of compute, memory, storage and networking to achieve optimal results. With its flexibility and multitude of options, it is easy to over or under provision the server infrastructure, resulting in poor performance and high TCO. Join us for an in depth, technical discussion with industry experts from leading Hadoop and server companies who will provide insights into the key considerations for designing and deploying an optimal Hadoop cluster.
Some of key questions to be discussed are:
- What is the “typical” Hadoop cluster and what should be installed on the different machine types?
- Why should you consider the typical workload patterns when making your hardware decisions?
- Are all microservers created equal for Hadoop deployments?
- How do I plan for expansion if I require more compute, memory, storage or networking?








2 hours 12 min ago
12 hours 53 min ago
18 hours 39 min ago
18 hours 56 min ago
20 hours 49 min ago
22 hours 43 min ago
1 day 5 hours ago
1 day 5 hours ago
1 day 7 hours ago
1 day 13 hours ago