Dynamically Changing $PATH for different Node projects

When I started working with Node, I did a lot of the work locally. I was working on several local projects and was having trouble keeping my $PATH up to date. I’ve recently found a solution that dynamically sets your $PATH to include node_packages/.bin in whatever directory you’re working.

Add the following to the bottom of your .bashrc or .bash_profile.

This takes advantage of the PROMPT_COMMAND environment variable, which runs an assigned function before your BASH terminal displays a prompt. Large functions may slow down the shell, but I haven’t noticed a performance issue at all using it.

1C03 – Printing in the lab

Preparation


Before you enter the lab, you must have previously prepared everything you need. Here is a checklist you can follow to make sure you’re prepared.

  I have designed all my gears using the Design Accelerator and created a hole in their centres.
  I have created files that contain several gears, all constrained to a single plane. Spur gears are in separate files from all other gears.
  I have all exported all my gears in the .STL format.
  I have all the files I need on a USB drive.
  I have also backed up my files to Dropbox, Google Drive, my email, or another reliable webservice.
  I have made a valid booking online.

Printing

When you arrive on the day of your booking, you will have half an hour at the computers, and half an hour at the printers. It is imperative that you use this time wisely, as you will be cut off from the printers at exactly one hour.

If you are late for a session, it will be given to someone on the waiting list. If you fail to attend a session, there may be a penalty to your final grade.

Scaling Your Files

Before printing, we must ensure our files are scaled correctly. You can follow these instructions to ensure your files are ready to print. Remember, it is your responsibility to ensure that the measurements are correct before printing.


Step 1

Open Netfabb Basic from the Desktop. When prompted, select “I accept the terms of usage”, and click “Later” when it becomes enabled after 10 seconds.

s1


Step 2

Open (one of) your .STL file(s) in Netfabb Basic.

s2
 
s3


Step 3

Take note of the measurements of the part. Is it the correct size? Inventor often exports .STL files ten times too small. If this is the case, we will have to scale it up 10x. If it is not that small, we do not have to scale it.

Right click part > Scale part

After scaling by 10 times, we also must scale our entire design by 1.5 times (150%). This gives us a total scaling factor of 15 (if we had to scale up by 10 times first). For spur gears only, we are not going to scale the z axis by 1.5, but instead leave it (assuming our face-width is reasonable and does not require scaling). This is because we can scale the face-width differently than the rest of the gear without impacting the gear’s performance. This is not the case for all other gears, which must be scaled uniformly.

At the end of this step, your designs should simply be 1.5 times larger than they were initially designed to be, with the exception of spur gears, which should be 1.5 times wider in the x and y directions.

s5

Step 4

When we’re happy with our scaling, we can export the .STL file for printing.

s6

Printing Your Files

Step 1

We will be printing our files on SeeMeCNC Orion Delta printers. The software we’re using is called Repetier. Open it from the Desktop or Start menu. If you’re doing this at home, please use MatterControl and follow the instructions I’ve provided on the Avenue FAQ.

s7

Step 2

Add the file that was previously scaled in Netfabb Basic to the Repetier queue.

s8

Step 3

Navigate to the Slicer tab and click “Slice with Slic3r”. This will slice the .STL into many layers, and write directions that the printer needs to print them.

s9

Step 4

Connect to the printer and Start the print. The Connect and Start buttons are located at the top-left of the interface.

s10
 
s11

Step 5

The printer will begin heating, and will start as soon as it is ready. It is the responsibility of the student to watch the printer during operation and alert a TA or IAI of any problems. The screen contains lots of data about the current status of the print. When the print is done, allow time for it to cool before removing. Only remove the part if a TA or IAI has indicated it is safe to do so.

s12

EPIC Game Challenge

Looking to expand your Python skills? Want to put everything you’ve learned in 1D04 into something you can play and share with friends? Join the EPIC Game Challenge! The Game challenge runs twice a year and gives students the opportunity to create a Python based game to submit for competition. Your IAI’s, TA’s, and other students will attempt to complete these submissions at the end of the term.

Getting Started

Be ready to get creative and get your game on! Making a game in Python can seem intimidating at first but with the skills you already have and some extra research you too can make a fun and interactive game!

A great resource to start off on is PyGame, a library with extensive documentation that makes Python game making easier by laying down a foundation for you to work off. Check out the PyGame website to download the library and learn more!

Note:
PyGame offers a lot of graphic capability which can be intimidating but do not feel like you need to make a game that has complex graphics for it to be good. A text-based game can be just as fun and innovative, and often can be equally or more complex in terms of how the user experiences the game!

Submitting a Game and Deadline

Think you have the next best game? Want to share your game and compete with other students to win the challenge? Submit your entries via email with the subject “Epic Game Challenge” to the EPIC IAI at jamiecounsell@me.com.

Submission deadline is December 1, 2014.
Those from last semester can still submit! If any students are looking for assistance on where to start, you can contact me to arrange a short tutorial.

The EPIC Lab

Hey folks,

Since 1D04 is weighted higher than your other courses, it is important to achieve a good grade. Some students are struggling with the major lab content, and all students could use a little extra help and bonus marks.

The McMaster Epic Lab provides opportunities for students to work hands-on with some pretty sweet technology, learning about Python and seeing their work come to life in a variety of projects. For every lab you complete, you also get a 1% bonus on your final grade. Students that do all four Epic labs can get up to 4%. That’s almost a full grade point!

 

Makeup Lab Sessions

Makeup labs are available for students whose timetable conflicts with the normal EPIC time slots. There will be one makeup lab session for each of the EPIC labs (starting with Android Tablets). Please note that only required courses for engineering 1 will be considered a valid conflict, and all students attending a makeup lab session must have previously contacted Jamie for approval. Any students attending or registering for the lab without previously contacting Jamie will not be permitted to participate in the makeup lab session. Additionally, the makeup labs are scheduled on a first come, first served basis; so please consider all conflicts in advance.

 

How to Sign-Up for a time slot

  • Follow one of the links below to a project you’d like to do.
  • You will be asked to log in, or create a login name if this is your first visit.
  • To create an account you will require a valid McMaster email. (students will be required to confirm this through a link sent to their email address)
  • You will then be presented with a detailed schedule view
  • A confirmation e-mail will be sent for any bookings you make.
  • If you can’t make a lab that you have scheduled, please delete your booking or contact me.

 
NOTE:

  • Each student can only have one booking per project (This means you can only sign up once for the three weeks this project runs!)
  • You cannot change or delete your appointment less than 12 hours before the scheduled lab time
  • You cannot add a booking more than three weeks in advance
  • There is space for 24 students per time slot, and you will be working in groups of three. If you wish to work with your friends, please ensure you all sign up for the same time slot.

 

The Projects

Android Tablets   [Sept 11th – Oct 1st]

android-sidepic

In this project, you will be using Python to write two apps for Android tablets. Programming is done directly on the tablet. You will:

  • Learn about webservices
  • Utilize an API

Sign up here!


Scribbler Robots   [Oct 2nd – Oct 22nd]

scribbler-sidepic

In this project, you will be programming a small robot to complete several tasks, such as:

  • Drawing shapes
  • Exploring the environment
  • Processing images from a camera
  • Detect Objects

Sign up here!

Fischertechnik Kits   [Oct 23rd – Nov 14th]

fischer-sidepic

In this project, you’ll be programming an industrial automation robot. You will:

  • Detect color
  • Sort blocks based on color
  • Sign up here!