Fall 2015

Updates on hardware, software, on-line learning, and quick tips.

This time... get to know your Mac mini icons, learn about our Linux servers, use Remote Apps, and learn some Matlab tricks for beginners!

Icons on your Mac mini desktop

files.math - direct access to your files on the network fileserver.
Linux.math - access to the research region's collection of Linux servers (see "Linux Servers" article below for machines' descriptions).
windows.math - opens MS Remote Desktop to access applications on a Windows server.

Safely storing files on a Mac mini

Files stored only on your Mac's hard drive are at risk of being lost if that hard drive fails.
To keep your files safe and to make sure they are backed up, move your files to the files.math icon, which maps to the network drive on the server!

Remote Apps

Do you ever stay on campus for ages so you can keep running applications that you don't have on your personal devices? Not anymore! Now you can run your applications remotely from any device, disconnect, and your session will continue to run on the app server. Later, you can reconnect to your session with any device to view your progress.
You can run applications such as Matlab, Maple, R, MS Word and Excel, and many others.
Once you've installed MS Remote Desktop, you can either use Math's remote apps website or launch Remote Desktop, click on Remote Resources and add the URL: remoteapp.math.uwaterloo.ca

Linux Servers

Linux.math is a collection of several Linux servers to be used depending on your needs. Simply ssh to one of the following:

biglinux.math 
- largest amount of memory, greatest number of CPUs
- used for very large multi-threaded jobs

fastlinux.math
- fastest CPUs for shorter, smaller jobs
new! a third machine has been added to this group

Linux Rocks clusternew!
- multiple Linux servers intended for parallel jobs or arrays of jobs

Machine specifications can be found on our website.


SHELL TIPS:
sed – stream editor, a find and replace function
sed 's/a/b/' input.file where s is search, a is find, b is replace
sed 's/a/b/g' input.file adding the g (global) will replace all instances of a word

grep – search function 
grep searchfor input.file
grep –Rn searches a given directory and directories below the top one,  R is recursive, n shows the corresponding line number
grep –Rn searchfor /directory/


If you don't know what a command does, try typing the command and then " --help" to see concise command options. 
For even more information, navigate to the Mac man page (which outlines all ways of using the selected command) in Terminal by highlighting the command, right clicking, and selecting Open man Page.

Matlab for Beginners 

Because Matlab is an interpreted language, loops and if statements can be very slow. Vectorizing decision structures is easy with a bit of practice and saves a lot of time in code execution. Here is a code snippet to get you started:

% Matlab's basic data structure is an array with the mathematical
% properties of a vector or matrix
% finding all values bigger than a half in a long vector
myrowvec2=rand(50000,1);
% time how long it takes
tic
myind=zeros(size(myrowvec2));
for ii=1:50000
    if myrowvec2(ii)>0.5
        myind(ii)=1;
    end
end
time1=toc
% But Matlab is a vectorized language so for large vectors a much faster
% way to do this is to use the logical operations
tic
myind2=(myrowvec2>0.5);
time2=toc
% and it would be easy to have multiple ifs, say finding values between
% 0.5 and 0.75
tic
myind3=((myrowvec2>0.5)&(myrowvec2<0.75));
time3=toc
% The savings from vectorization become evident for large matrices
% There is another related command that is sometimes useful
myind=find(myrowvec2<0.5); % finds the indices of the entries in myrowvec2 that are less than a half.

Tips & Tricks

If you're looking to brush up your on your skills, check out Lynda.com - an online learning resource that UW pays for you to have access to! 


Use the "Organization Login" and authenticate with your WatIAM credentials.

Do you know a way we could make math computing better? Is there something you'd like to hear about in these newsletters, or want to write an article?
Email MFCF or fill out a Request. We'd love to hear what you have to say!

Do you use Dropbox?

If you use Dropbox to back up or share your crucial files, you must read UW "Policy 8", since you are responsible for the content of any files that you share.

Please use the web interface rather than the Dropbox App, as duplicate or improper use of the App on MacOS X 10.9 or earlier causes unnecessary work for files.math. 

Improper use of the Dropbox App has caused a few individuals to repeatedly use more resources on files.math than all other users combined.

Past Presentations

Oct 2014 - Grad Orientation If you read this newsletter, email MFCF by July 3rd to be entered to win a prize! Copyright © 2015 MFCF Help Centre, All rights reserved.

Our mailing address is:

MFCF Help Centre
MC 3017
200 University Avenue
WaterlooOn  N2L 3G1
Canada


 MFCF Webpage Help Desk