How to Install TypeScript on Linux

Transcript:

Alright! Hello everybody! So, I wanted to show you how to install TypeScript on Linux. Before we get started, a word of caution. Every Linux distribution is a little bit different, in theory everything I show you here should work across most distributions, but it’s possible that yours might do something a little different. For reference, I’m using Ubuntu 18.04.1 LTS release for this video.

One thing I want to point out before I get started is that most Linux distributions have some sort of package management system that you may be able to use to install TypeScript. For example, Ubuntu offers the node-typescript package, which you can install via apt.

The problem is that these package managers often contain old versions of TypeScript, and TypeScript releases quite frequently, so today I’m going to be showing you how to install TypeScript directly from the source so you can be running the latest and greatest version.

So, to get started we’re going to open up whatever your favorite browser is, or whatever browser you have installed. Here I’m going to be using Firefox.

We are going to head over to https://nodejs.org Now, you’ll see a page like this. It’ll give you a couple of different download options and you can opt for either the LTS or the current release.

Either one of those works. I’m going to say go for the LTS version. That’s because that stands for long-term support, so this is the version that’s going to keep getting security updates and things like that.

That’s probably the one you’ll want to go with. If you want to be on the bleeding edge, and have the latest and greatest feel free to go with the other one, it will work just as well.

For this video I’m going to go with 10.15.1. Very likely if you’re watching this at any point in the future these version numbers are going to be different. Node.js does a lot of releases so, it’s totally okay if you’re on a later version than I am. Everything should work just as well.

Download it.

Alright, it has finished downloading, so let’s open a Terminal and extract the files and get started.

Here I’ve opened the default Terminal that comes with Ubuntu. We’re going to do:

cd Downloads

to get to our downloads folder.

We’re then going to type:

tar xvf node-v10.15.1-linux-x64.tar.xz

Hit enter. It’ll print out the files it unzipped and then we should be able to see the new folder.

Next we need to add Node.js to our PATH. We can do this by typing:

export PATH=~/Downloads/node-v10.15.1-linux-x64/bin:$PATH

Now that Node.js is on our PATH, we can test if Node.js is installed properly by typing:

node

and hitting enter.

And this little angle bracket should appear. And we can start entering JavaScript code here.

So, two plus two is four. Let’s see, we could do a setTimeout. So in 5 seconds that should display something. There it is.

If you want to get out of here just hit CTRL+C. Twice. And then you’re back on the normal Terminal prompt.

In order to use Node.js and TypeScript in future Terminal sessions, we’ll need to put that PATH line at the end of your .bashrc or .bash_profile file, or whatever profile file your shell of choice uses if you’re not on bash. To do that I’m going to open up Ubuntu’s default text editor.

We’ll hit open, and navigate to our home directory. Note that you’ll need to ensure that hidden files are showing. I can do that here by pressing CTRL+H. I’ll open .bashrc, copy that line from before, paste it to the bottom, and then save the file. And then, hey presto, any subsequent Terminals we open will have Node.js available to us.

So, all that out of the way, let’s install TypeScript! In order to install TypeScript we’re going to use something called npm. If you’re unfamiliar with npm that stands for the node package manager and that’s how lots of different Node.js based libraries and programs are distributed, TypeScript among them.

How do we use npm to install it? Well, here in this Terminal we’re going to type:

npm install --global typescript

And hit enter.

Note that if you’ve installed Node.js and npm from your package manager, you may need to prefix the previous command with sudo to run it with root priviledges

And you’ll see here it says added one package from one contributor in 1 second.

Now it’s very likely that you’ll see a different version number here. TypeScript also like Node.js releases fairly frequently. TypeScript is really good about backwards compatibility, so you shouldn’t have to worry about anything you see in this video or any later video being incompatible.

If you wanted to be on the exact version that I am going to show you, though, what you can do is go back to the Terminal and run:

npm uninstall --global typescript

to get rid of what we just installed.

And we’ll then run a command similar to what we did before:

npm install --global typescript@3.3.3

When you add that @ sign and then the version number, it’s going to guarantee that that’s the version you’re going to install rather than whatever the latest is (which is the default).

There we go. We’ve got that working.

So now what I’m going to do is create a new folder on the desktop. We’re going to call it “test” and we’re just going to see if TypeScript is working.

Let’s open up “test”.

We’re going navigate our Terminal to this new folder as well. You can do this by typing:

cd ~/Desktop/test

Once you’ve done that we’re going to create a file named main.ts. All TypeScript files end in .ts.

You can do this by entering the comand:

touch main.ts

You’ll see the file appears in the folder.

Now let’s put something in this main.ts file for TypeScript to compile. So, we’re going to open up the default text editor that comes with Ubuntu. If you have a particular text editor that you prefer, feel free to use it.

I’m going to go to Open and find main.ts in the folder on my Desktop.

And then we’ll put in the simplest possible “Hello, World!” program and save it.

console.log("Hello, World!");

Now in order for TypeScript to compile our “Hello, World!” program it needs a configuration file.

We can create the default one by going back to our Terminal and running:

 tsc --init

When we hit enter, it’s going to create that file for us. So, you can see this tsconfig.json file has been created.

Don’t worry too much about that file I will be creating a video explaining exactly what it is, why we use it, how to use it, what the different options inside it mean for now all we need to know is that we need it there and now we have it.

And to get TypeScript to compile our main.ts file, just run:

tsc

and hit enter. It will find all the TypeScript files in this folder and compile them. You see we now have a main.js file.

We’ll run that main.js file through Node.js:

node main.js

And see we’ve got “Hello, world!”

Awesome! Exactly what we wanted.

So everything’s working. If you’re seeing the same thing, hey you’re good to go, you’ve got TypeScript installed.

There is one other thing I wanted to show you: You can have TypeScript watch for changes, rather than having to rerun it each time you change something. So, what we’re going to do is do is go back to our Terminal and enter:

tsc --watch

See it gives us a little message “starting compilation in watch mode”.

And then I’m going to go back to our file and say “Hello World! Again!” and I’m going to save it. And you see that flashed a bit. It said “file change detected”, “0 errors”.

We’re going to open up another Terminal and do the same:

cd ~/Desktop/test"

that we did before.

You can see if we run our main.js, hey! It says “Hello World! Again!” just like we wanted.

One thing that’s really nice about this is that if you make a mistake, here I’m going to forget to have the closing parenthesis and semicolon, if we save this TypeScript is going to give us an error and say “hey! I expected a closing parenthesis here!”

So we can add that back in and save it and everything’s happy again.

Very cool! That’s it! You’ve got TypeScript installed!

By the way if you’re interested in going deep into learning TypeScript I’ve got this TypeScript by Example course that I’m working on now. You can head on over to https://typescriptbyexample.com Scroll down to the bottom, and you can put in your email address to be notified when the course is released. Also, stay tuned to this YouTube channel for future updates. Thank you so much for watching!

How to Install TypeScript on macOS

Transcript:

Alright! Hello everybody!

So, I wanted to show you how to install TypeScript on macOS.

So, first things first we’re going to open up whatever your favorite browser is, or whatever browser you have installed. Here I’m going to be using Safari.

We are going to head over to https://nodejs.org

Now, you’ll see a page like this. It’ll give you a couple of different download options and you can opt for either the LTS or the current release.

Either one of those works. I’m going to say go for the LTS version. That’s because that stands for long-term support, so this is the version that’s going to keep getting security updates and things like that.

That’s probably the one you want to go with.

If you want to be on the bleeding edge, and have the latest and greatest feel free to go with the other one, it will work just as well. For this video I’m going to go with 10.15.1.

Very likely if you’re watching this at any point in the future these version numbers are going to be different. Node.js does a lot of releases so, it’s totally okay if you’re on a later version than I am. Everything should work just as well.

Download it.

Alright, it has finished downloading, so I’m going to go to my Downloads folder and open it.

We’re just going to click through here.

We’ll hit continue.

We’ll hit continue again. It’ll prompt us to agree to the license, click agree.

It’ll take 60 megabtyes of space, that’s fine by me, hit Install.

Enter your account password at the authorization prompt and hit Install Software.

Give that a few moments. Alright, and Node.js has been installed! Hit Close.

We don’t need the installer any more, so just hit “Move to Trash” here.

So, how can we verify that things are working here?

Well, let’s go to the application search in the top-right corner of the screen and look for “Terminal”.

Here we’ve got our Terminal. The way we can test if Node.js is installed properly is to type:

node

and hit enter.

And this little angle bracket should appear.

And we can start entering JavaScript code here. So, two plus two is four. Let’s see, we could do a setTimeout. So in 5 seconds that should display something. There it is.

If you want to get out of here just hit CTRL+C. Twice.

And then you’re back on the normal Terminal prompt.

So, let’s install TypeScript.

In order to install TypeScript we’re going to use something called npm. If you’re unfamiliar with npm that stands for the node package manager and that’s how lots of different Node.js based libraries and programs are distributed, TypeScript among them.

So, how do we use npm to install it? Well, here in this Terminal we’re going to type:

sudo npm install --global typescript

And hit enter.

Enter our password. Give that a few moments to do its thing.

And you’ll see here it says added one package from one contributor in 6 seconds.

Now it’s very likely that you’ll see a different version number here. TypeScript also like Node.js releases fairly frequently. TypeScript is really good about backwards compatibility, so you shouldn’t have to worry about anything you see in this video or any later video being incompatible.

If you wanted to be on the exact version that I am going to show you, though, what you can do is go back to the Terminal and run:

sudo npm uninstall --global typescript

To get rid of what we just installed. And we’ll then run a command similar to what we did before:

sudo npm install --global typescript@3.3.3

When you add that @ sign and then the version number, it’s going to guarantee that that’s the version you’re going to install rather than whatever the latest is (which is the default).

There we go. We’ve got that working.

So now what I’m going to do is create a new folder on the desktop. We’re going to call it “test” and we’re just going to see if TypeScript is working. It’s installed but is it actually working?

Let’s open up “test”. We’re going navigate our Terminal to this new folder as well. You can do this by typing:

cd Desktop/test

Once you’ve done that we’re going to create a file named main.ts. All TypeScript files end in .ts.

You can do this by entering the comand:

touch main.ts

You’ll see the file appears in the folder.

Now let’s put something in this main.ts file for TypeScript to compile.

So, we’re going to open up TextEdit. If you have a particular text editor that you prefer, feel free to use it. TextEdit is all I’ve got on this particular machine at the moment. I’m going to go to File -> Open and find main.ts in the folder on my Desktop.

And then we’ll put in the simplest possible “Hello, World!” program and save it.

Now in order for TypeScript to compile our “Hello, World!” program it needs a configuration file.

We can create the default one by going back to our Terminal and running:

tsc --init

If we hit enter, it’s going to create that file for us. So, you can see this tsconfig.json file has been created.

Don’t worry too much about that file I will be creating a video explaining exactly what it is, why we use it, how to use it, what the different options inside it mean for now all we need to know is that we need it there and now we have it.

And to get TypeScript to compile our main.ts file, just run:

tsc

It will find all the TypeScript files in this folder and compile them. You see we now have a main.js file.

We run that main.js file through Node.js, and see we’ve got “Hello, world!”

Awesome! Exactly what we wanted.

So everything’s working. If you’re seeing the same thing, hey you’re good to go, you’ve got TypeScript installed.

There is one other thing I wanted to show you: You can have TypeScript watch for changes, rather than having to rerun it each time you change something.

So, what we’re going to do is do is go back to our Terminal and enter:

tsc --watch

See it gives us a little message “starting compilation in watch mode”.

And then I’m going to go back to our file and say “Hello World! Again!” and I’m going to save it. And you see that flashed a bit. It said “file change detected”, “0 errors”.

We’re going to open up another Terminal and do the same “cd Desktop/test” that we did before.

You can see if we run our main.js, hey it says “Hello World! Again!” just like we wanted.

One thing that’s really nice about this is that if you make a mistake, here I’m going to forget to have the closing parenthesis and semicolon, if we save this TypeScript is going to give us an error and say “hey! I expected a closing parenthesis here!”

So we can add that back in and save it and everything’s happy again.

Very cool! That’s it!

You’ve got TypeScript installed!

By the way if you’re interested in going deep into learning TypeScript I’ve got this TypeScript by Example course that I’m working on now.
You can head on over to https://typescriptbyexample.com

Scroll down to the bottom, and you can put in your email address to be notified when the course is released.

Also, stay tuned to this YouTube channel for future updates. Thank you so much for watching!

How to Install TypeScript on Windows

Transcript:

Alright! Hello everybody! So, I wanted to show you how to install TypeScript. So, first things first we’re going to open up whatever your favorite browser is, or whatever browser you have installed.

We are going to head over to nodejs.org. Now, you’ll see a page like this. It’ll give you a couple of different download options and you can opt for either the LTS or the current release.

Either one of those works. I’m going to say go for the LTS version. That’s because that stands for long-term support, so this is the version that’s going to keep getting security updates and things like that. That’s probably the one you want to go with. If you want to be on the bleeding edge, and have the latest and greatest feel free to go with the other one, it will work just as well. For this video I’m going to go with 10.15.1.

Very likely if you’re watching this at any point in the future these version numbers are going to be different.

Node.js does a lot of releases so, it’s totally okay if you’re on a later version than I am. Everything should work just as we;ll.

Download it.

Antivirus just finished scanning it, and here it is it’s open.

You might need to go find it in your downloads folder and double-click on it. I just had it run when I download it.

We’re just going to click through here. We’re going to accept the license agreement. We’re going to accept the default install path.

We’re going to leave all these things on the defaults.

Install.

We get our security prompt here will say yes so that it can install.

Give that a few moments. Alright, and Node.js has been installed.

So, how can we verify that things are working here? Well, let’s go to the start menu there should be something called Node.js command prompt in there and Node.js itself in your start menu. You might have to search for it. Here it’s showing up under my recently added.

So if we go in here we have an Node.js command prompt. This looks very much like any other command prompt you may have seen. Just for comparison,

Let’s open up the other one. You can see normally for just a plain old command prompt we get the windows version information.

But here we’re actually getting the Node.js version information. So, we can tell that things are working already. The way you can test Node.js is type node and hit enter.

And this little angle bracket should appear.

And we can start entering JavaScript code here. So, two plus two is four. Let’s see, we could do a setTimeout.

So in 5 seconds that should display something.

There it is.

If you want to get out of here just hit CTRL+C.

Twice.

And then you’re back on the normal command prompt. So, let’s. install TypeScript.

So, alright so to install TypeScript we’re going to use something called npm. If you’re unfamiliar with npm that stands for the node package manager and that’s how lots of different Node.js based libraries and programs are distributed, TypeScript among them. So TypeScript is written in JavaScript and it is distributed

Via npm because it runs on Node.js. So, how do we use npm to install it? Well, here in this Node.js Command Prompt we’re going to type npm install –global typescript . Going to hit enter.

Give that a few moments to do its thing.

And you’ll see here it says added one package from one contributor in one second.

Now it’s very likely that you’ll see a different version number here. TypeScript also like Node.js releases fairly frequently. TypeScript is really good about backwards compatibility, so you shouldn’t have to worry about anything you see in this video or any later video being incompatible. If you wanted to be on the exact version that I am going to show you, though, what you can do is we’re going to do:

npm uninstall --global typescript

And similar to before we’re going to do:

npm install typescript@3.3.3

and so if you add that @ sign and then the version number, that’s going to guarantee that that’s the version you’re going to install rather than whatever the latest is which is the default.

There we go. We’ve got that working.

So now what I’m going to do is create a new folder on the desktop. We’going to call it “test” and we’re just going to see if TypeScript is working. It’s installed but is it actually working? We’re going to open up “test”.

We’re going to create a new file.

We’re going to call this main.ts. All TypeScript files end in .ts So, if you do what I did there and go to “New Text Document” it might not let you edit the file extension depending on what you’re doing, and you could end up with something that’s actually.ts.txt, which really isn’t what you want. The way you can check for this is you can go to this View tab that’s up here and make sure this “file name extensions” checkbox is checked.

You can see if I uncheck it the file extension goes away, and you can’t tell what it is. If I check it it tells me we’ve got main.ts which is what we want.

So we’re going to move our Command Prompt into this folder. How do you do that?

I’m going to click here to get the full path to this folder. Then type cd which stands for “change directory” and do a quote.

If you right click it’s going to paste what you just copied.

We’re going to do an end quote.

And here we are in that folder.

Now in order for TypeScript to compile something it needs a configuration file.

We can create the default one by running:

tsc --init

If we hit enter, it’s going to create that file for us. So, you can see this tsconfig.json file has been created. Don’t worry too much about that file I will be creating a video explaining exactly what it is.

Why we use it, how to use it, what the different options inside it mean for now all we need to know is that we need it there and now we have it.

Now before we go compiling anything with TypeScript we should probably put something in this main.ts file for TypeScript to compile. So, we’re going to open up notepad. Feel free to use any other text editor of your choice. That’s just all I’ve got on this particular machine at the moment.

And we’re going to go in, and I’m going to switch this over to “all files” so I can see my main.ts and we’re just going to write a super simple “Hello, world!” program.

There you go, there’s your “hello world”.

Hit CTRL+S to save it. Minimize that.

And then to get TypeScript to compile your files.

Just run tsc.

It will find all the TypeScript files in the folder and compile them. You see we now have a main.js file.

We run that made that main.js file through Node.js.

And see we’ve got “Hello, world!” Awesome! Exactly what we wanted.

So everything’s working. If you’re seeing the same thing, hey you’re good to go, you’ve got TypeScript installed.

One other thing I wanted to show you.

Was that you can have TypeScript, rather than having to rerun it each time you change something, you can have TypeScript watch for changes. So, what we’re going to do is do:

tsc --watch

We’re going to hit enter.

See it gives us a little message “starting compilation in watch mode”.

I’ll move this so you can see it, and then I’m going to say “Hello World! Again!” and I’m going to hit CTRL+S to save right now.

And you see that flashed a bit. It said “file change detected”, “0 errors”.

We’re going to open up another Node.js Command Prompt.

Do the same thing we did before so we can run this.

You can see if we run our main.js, hey it says hello world again just like we wanted.

One thing that’s really nice about this is that if you make a mistake, here I’m going to forget to have the closing parenthesis and semicolon, if we save this TypeScript is going to give us an error and say “hey! I expected a closing parenthesis here!”

So we can add that back in and save it and everything’s happy again.

Very cool, you’ve got TypeScript installed!

By the way if you’re interested in going deep into learning TypeScript I’ve got this TypeScript by Example course that I’m working on now. You can head on over to typescriptbyexample.com. Scroll down to the bottom, and you can put in your email address to be notified when the course is released. Also, stay tuned to this YouTube channel for future updates. Thank you so much for watching!

Programming With Ruby Episode 17, Getting Advanced

Covered In This Episode:

  • Symbols
  • eval
  • Bindings
  • Running Other Programs
  • Safe Levels

Transcript:

Hello Everybody and welcome to Programming With Ruby Episode 17,
Getting Advanced. I’m Tyler, and this video is brought to you by
manwithcode.com.

By now, you know a large amount about Ruby, so in this episode we will
be going over some advanced features that Ruby has.

More specifically I will be teaching you what Symbols are, and when to
use them. I will be showing you how to use eval, and how to use
bindings with eval. You will learn how to run other programs from
Ruby. Finally I will show you what safe levels are.

Lets get started!

Symbols

Symbols are a type of variable that are very much like strings, but
more lightweight. Symbols look like this:

:variable

Symbols can’t be manipulated like strings can, which seems like a huge
drawback, but they do have a couple benefits.

Each time you use a string, to say access a hash. Ruby creates an
instance of that string. Where if you use a symbol, it is only ever
instanced once. Meaning that the use of symbols will take up less
memory than strings will, if you are, say accessing a hash many times.

Symbols are also slightly easier to type since the colon is on the
home row on US keyboards.

eval

eval is a way of running Ruby code that is contained in a string. For
example, lets say you have a string that looks like this:

"puts 'Hello World'"

It is just a simple string, so it does nothing. But, if you use the
method eval on that string it will execute the code inside. So this
will print Hello World! on to the screen:

eval "puts 'Hello World!'"

This isn’t always useful, but you can use it if you want your users to
be able to enter Ruby code into your program.

You can also pass bindings to eval. So if we had this method

def my_method my_binding
    eval "puts x", my_binding
end

x = 5
my_method binding

This outputs:

5

Some of you may notice that the variable x isn’t defined in the method my_method. By using the binding method, we can make variable scopes portable!

Running Other Programs

There comes a time when you will want to be able to run a program from
Ruby, maybe you want to automate something, or simply get the output
from an external program.

There are a few ways of doing this.

The first is with the method exec, which runs an external programs,
and quits the Ruby script at the same time:

exec('ls') # dir on windows
# Program never gets here

There is also system, which does the same thing, but doesn’t quit the
Ruby script, and returns true or false if the program was successful:

system('ls') # dir on windows
# we do get this far

Finally we have the “back-tick” `. Which looks like a sideways single
quote. On my keyboard it is above the tab key. You surround your
command in the back-ticks, like you would for a sting. Unlike the other
two methods of running a program, this method also returns the output
of the program you run.

variable = `ls`

Safe Levels

If you are running a Ruby interpreter online or in another environment
where users can enter in and run Ruby code. They hold the ability to
wreak havoc on your system.

The way to prevent this from happening is by using safe levels. Safe
levels are a way of preventing the user from getting access to the
file system, or changing any variables that the program has.

You set safe levels by setting the $SAFE variable. By default it is
set to zero.

$SAFE = 4

Ruby “taints” objects that could be dangerous.

There are five different safe levels.
0 => The default, you can do anything
1 => Can’t use environment variable, eval, load, require, and more.
2 => Same as above and also can’t use files
3 => All objects created are tainted, can’t be untainted
4 => You can do almost nothing… Can’t modify the untainted, can’t
use exit. Basically completely safe and sand-boxed.

That brings us to the end of the episode. If you liked these videos,
please donate. It costs me in both money and time to make them.

If you have any questions, comments, or suggestions please don’t
hesitate to leave a comment on this page or email me at
tyler@manwithcode.com

Thanks for watching, goodbye!

Programming With Ruby Episode 16, Benchmarking

Covered In This Episode:

  • What is benchmarking?
  • Benchmarking
  • Profiling

Transcript:

Hello Everybody and welcome to Programming With Ruby Episode 16,
Benchmarking. I’m Tyler and this video is brought to you by
manwithcode.com.

In this episode I will tell you what benchmarking is. You will learn
how to preform benchmarking tests on some of your code. And after that
you will learn how to preform the more exhaustive benchmarking process
called profiling.

This should be a very quick and easy episode, so lets get started!

What is benchmarking?

Basically benchmarking is measuring how fast your code runs. Whether
that means your code as a whole or only parts of it. This can be
useful so you can optimize your code to run faster, in the places it
is running the slowest. Benchmarking is also commonly used to compare
two different programs in the category of speed, which can be a
selling point for many products.

Benchmarking

To get access to benchmarking make sure you put:

require 'benchmark'

in your code.

The most simple form of benchmarking is Benchmark.measure:

a = Benchmark.measure do
    1_000_000.times do |i|
        x = i
    end
end

puts a #=> 0.400000   0.140000   0.540000 (  0.537934)

The last number is the actual time it took to run the test.

There is also Benchmark.bm, which is similar, but adds headings and
allows you to do multiple tests.

Benchmark.bm do |bm|
    bm.report('Test 1:') do
        1_000_000.times do
            x = 1
        end
    end
    bm.report('Test 2:') do
        1_000.times do
            x = "Moo..."
        end
    end
end

# Example Output:
#          user     system      total        real
# Test 1:  0.430000   0.120000   0.550000 (  0.563787)
# Test 2:  0.000000   0.000000   0.000000 (  0.000775)

Then there is Benchmark.bmbm, which is exactly the same as bm, but
preforms a benchmark twice.

Example Benchmark.bmbm Output:
Rehearsal -------------------------------------------
Test 1:   0.370000   0.110000   0.480000 (  0.484865)
Test 2:   0.000000   0.000000   0.000000 (  0.000529)
---------------------------------- total: 0.480000sec

user     system      total        real
Test 1:   0.390000   0.090000   0.480000 (  0.477402)
Test 2:   0.000000   0.000000   0.000000 (  0.000529)

And that is all there is to know about simple benchmarking, on to
profiling.

Profiling

Profiling takes benchmarking to the extreme. It tells you how much time each part of your code is take, and all you have to do is put:

require 'profile'

at the top of your program!

require 'profile'

class MyMath
    # Don't worry about the math, just the profiling output
    # We repeat the code to make it use up more time
    def self.x_offset angle, distance
        1000.times { distance * Math.sin(angle * Math::PI/180) }
    end

    def self.y_offset angle, distance
        1000.times { distance * Math.cos(angle * Math::PI/180) * -1 }
    end
end

MyMath.x_offset(220, 50)
MyMath.y_offset(220, 50)

And from the profiling output, we can see what took the longest:

%   cumulative   self              self     total
time   seconds   seconds    calls  ms/call  ms/call  name
72.41     0.21      0.21        2   105.00   145.00  Integer#times
10.34     0.24      0.03     4000     0.01     0.01  Fixnum#*
6.90     0.26      0.02     1000     0.02     0.02  Math.cos
6.90     0.28      0.02     2000     0.01     0.01  Float#/
3.45     0.29      0.01     1000     0.01     0.01  Float#*
0.00     0.29      0.00        1     0.00   140.00  MyMath#y_offset
0.00     0.29      0.00        1     0.00   150.00  MyMath#x_offset
0.00     0.29      0.00        1     0.00     0.00  Class#inherited
0.00     0.29      0.00     1000     0.00     0.00  Math.sin
0.00     0.29      0.00        2     0.00     0.00  Kernel.singleton_method_added
0.00     0.29      0.00        1     0.00   290.00  #toplevel

And that is it for today’s episode!

Please do not forget to show your appreciation by donating.

If you have any thing to say about anything related to Man With Code
or these videos, please leave a comment below, or email me at
tyler@manwithcode.com

Thanks for watching, Bye!