Friday, March 30, 2012

Screen

Today I learned how to use screen:

First we opened the terminal.
We got into the sever amazon.elkner.net and got Matt to set SUID permission there.
As complicated as it looked Matt guided us through it.
We had to type screen -S username
Then set up the multiuser on. Which is enabled by pressing the keyboards CTRL-a then shift :
Then type multiuser on and acladd useryouwanttoadd
Now the user who wants to join the session needs to type:
screen -x hisusername/hissession name

This should connect you.

Monday, March 26, 2012

Login page

Managed to create a madlib, but wanted to take it to the next level. I was bored and decided to see if I could created a login page. All I need to learn now is about storing peoples data, and I'm set.

Madlib

I started working the madlib page. When I was done I wanted the python file to be small, and not have all the html codes in there.
Well I learned that the open('nameofthefile.tpl', 'r').read() can be used to open the story you have in a different file, this made everything much easier for me and for everyone in class. We can now style the pages to your own liking.

It does not necessarily have to end in .tpl it can be anything suck as .html but I find it more helpful to save it as that.

Monday, March 5, 2012

Project 5

This week I created a Brazilian flag. Click here to see example.
I created a rectangle that covers the whole canvas.
I learned this new code globalCompositeOperation and here you can assign it: source-over which puts the newer shapes on top the canvas and so on.

In this case I'm using source-over this will make the new shapes be on top of the old ones.

I created two triangles and moved them around, the first one was tricky, but for the second one you can use the same, just change the coordinates of the x, y.

Friday, February 24, 2012

Senior Project!

After switching my senior project for 3 times, I have decided to stick with film making. My friend Mario is our actor. If you want to check some of our stuff out, click here.

Wednesday, February 22, 2012

Project 4

Canvas haa neat property called save(); and restore(); which allows you to be able to store certain codes and be able to call them. Learning this technique can save you time.

To view and example click here.

The source code:
function draw(){
var ctx = document.getElementById('canvas').getContext('2d');

ctx.fillStyle = '#0000FF'
ctx.fillRect(0, 0, 15, 15);
ctx.save();

ctx.fillStyle = '#FFA500'
ctx.fillRect(5,5,120,120);
ctx.save();

ctx.fillStyle = '#C34A2C'
ctx.globalAlpha = 1.5;
ctx.fillRect(3,3,90,90);

ctx.restore();
ctx.fillRect(4,4,60,60);

ctx.restore();
ctx.fillRect(6,6,30,30);
}

Project 3

This week we started working around with colors.
I had a hard time understanding how it works.
I created a basic color picture. Seen it here.

The source code:
function draw(){
var ctx = document.getElementById('canvas').getContext('2d');
ctx.fillStyle = '#736F6E';
ctx.fillRect(0, 0, 75, 75);
ctx.fillStyle = '#617C58';
ctx.fillRect(75, 0, 75, 75);
ctx.fillStyle = '#D4A017';
ctx.fillRect(0, 75, 75, 75);
ctx.fillStyle = '#6698FF';
ctx.fillRect(75, 75, 75, 75);
ctx.fillStyle = '#C12283';

for (var i = 0; i < 7; i++){
ctx.beginPath();
ctx.arc(75, 75, 10+10 * i, 0, Math.PI * 2, true);
ctx.fill();
}
}
The math equation creates the circle thats in the middle of the canvas.
Changing the number in i < 7 will either increase or decrease the size of the circle.