Friday, January 31, 2014

Responsive Design with CSS

We made our first responsive design using only CSS today [sic] in class! Pretty cool. Check it out:

Michael's Diner

It's based on this great, simple, clean template from Nick La.

Wednesday, January 29, 2014

Breakout2

I worked on Breakout2 for maybe 6 hours yesterday and today. I'm fairly pleased how it turned out, but I worry it could have been tighter. It works!

Arrays

We did a lot of work on arrays today. We also got in to loops like for and foreach. I liked that. Arrays are so useful, and it's cool that there are different ways to make them.

Saturday, January 25, 2014

Foundry Interactive

This week I did homework in the office of a local web dev company called Foundry Interactive. Started the quiz for ITC 240. I also downloaded some great coding apps for the iPad so that I can work better remotely.

Wednesday, January 22, 2014

PHP Include

Today in class we practiced chopping off headers and footers (footer always first) then including them back in with PHP. It really streamlined the main code you want to deal with regularly.

Monday, January 20, 2014

Breakout Blocks

I spent about 3 hours on Saturday working on a Java program to set up a breakout game. The programming went really smoothly. I'm really liking Java. I'm especially proud of this little bit of code inside nested for loops, though I'm not sure that it's good code:

//Decide fill color based on position
brick.setFillColor(Color.RED); //We know the first two rows should be this color, so no need to check which row right away. Also, this makes it default back to red if more rows are added later or something goes wrong.


if(rows == 2 || rows == 3) brick.setFillColor(Color.ORANGE);
if(rows == 4 || rows == 5) brick.setFillColor(Color.YELLOW);
if(rows == 6 || rows == 7) brick.setFillColor(Color.GREEN);
if(rows == 8 || rows == 9) brick.setFillColor(Color.CYAN);

On the one hand, there's no reason to check if rows is between 0 and 1 because that's where it starts so we can just assign it. On the other hand, it means for everything else it gets assigned twice. Which is cheaper, if statements like this or assignment?

Lynda Videos

Yesterday, I watched a bunch of Lynda videos. I spent about 1.5 hours on videos and questions for WEB110 where I learned all about CSS and HTML. I knew a lot of the HTML tags already, but it was good review. I'm really excited to use CSS. From the videos I learned a new font word: leading, meaning the space between lines of text.

I also spent about 1.5 hours on videos and questions for ITC240. We're really getting into the good stuff for PHP, and the code syntax is starting to blur with my Java class. I'm pleasantly surprised how powerful it seems.

Thursday, January 16, 2014

Guinan's Galactic Bar & Grill

Coming soon to a webpage near you dynamically displaying the daily stellar special using php. I worked on this for about 2 hours today. I'm excited.

Update: The page is up! Check it out. Source code below:

<?php
//guinansgalactic.php

/*
A fictional webpage for Guinan's Galactic Bar & Grill
that dynamically displays the daily special including
name, image, price, and brief description.

Specials are:
Sunday
Gahg
$3
Served very fresh.

Monday
Romulan Ale
$4
The blue, banned moonshine of Romulus in a glass.

Tuesday
Kanar
$3
A Cardi favorite, served neat.

Wednesday
Prune Juice
$2
A warrior's drink.

Thursday
Rokeg Blood Pie
$4
Just like mom use to make on Kronos.

Friday
Samarian Sunset
$3
Made in the traditional style. I hope you enjoy it. I hope you enjoy it.

Saturday
Root Beer
$3
Bubbly and happy, just like the Federation.
*/

$dayOfWeekNum = date('w');

if($dayOfWeekNum == 0)
{
   $special = "Gahg";
   $price = "3";
   $notes = "Served very fresh.";
   $image = "gagh.jpg";
}
if($dayOfWeekNum == 1)
{
   $special = "Romulan Ale";
   $price = "4";
   $notes = "The blue, banned moonshine of Romulus in a glass.";
   $image = "romulanale.jpg";
}
if($dayOfWeekNum == 2)
{
   $special = "Kanar";
   $price = "3";
   $notes = "A Cardi favorite, served neat.";
   $image = "kanar.jpg";
}
if($dayOfWeekNum == 3)
{
   $special = "Prune Juice";
   $price = "2";
   $notes = "A warrior's drink.";
   $image = "prunejuice.jpg";
}
if($dayOfWeekNum == 4)
{
   $special = "Rokeg Blood Pie";
   $price = "4";
   $notes = "Just like mom use to make on Kronos.";
   $image = "bloodpie.jpg";
}
if($dayOfWeekNum == 5)
{
   $special = "Samarian Sunset";
   $price = "3";
   $notes = "Made in the traditional style. I hope you enjoy it. I hope you enjoy it.";
   $image = "samariansunset.jpg";
}
if($dayOfWeekNum == 6)
{
   $special = "Root Beer";
   $price = "3";
   $notes = "Bubbly and happy, just like the Federation.";
   $image = "rootbeer.jpg";
}

?>

<html>
<head>
<style>
body{background-color:#9944dd;}
</style>
</head>

<body>
<h1>Guinan's Galactic Bar & Grill</h1>
<img src="images/guinan.jpg" />
<h2><?=date('l')?>'s Special</h2>
<p><b><?=$special?></b><p>
<p>Only $<?=$price?></p>
<img src="images/<?=$image?>" />
<p><?=$notes?></p>

</body>

</html>

Tuesday, January 14, 2014

Reading about escape

Today I spent 2 hours doing more of the readings on PHP. I learned about the escape operator, the \. I just read for my HTML class about the escape codes for special characters like &copy, so it was confusing/interesting to compare these two methods for dealing with similar problems.

I also spent 5 minutes making sure I had updated my profile on Canvas. I spent another 15 minutes finishing the form for time tracking. I'm not sure how to use the form yet, but I'm sure we will go over that in class.

Sunday, January 12, 2014

Created Blog and Took Quiz

Today I took the syllabus quiz and created this blog. Together those took one hour. I missed one question on the quiz because I misinterpreted it. The question was:

[T or F] When a site moves to a server side language like PHP, we'll likely leave the .HTM or .HTML extensions for that site behind forever.

I took that to mean that we'd leave the real .html files on the server forever. I answered false because I knew we would change file names to .php whether they had PHP code in them or not, so we would have to delete old HTML files. What the question meant was, will we stop using .HTML extensions forever? That is true. *facepalm* Oh well. 85 out of 90 isn't so bad.

Introduction

I will be posting my progress as a web developer here while I attend classes at Seattle Central Community College. I will label each post with the class it pertains to for easy reference by teachers. This will be a boring blog for anyone but my teachers. Sorry about that.

Here I will:
  • Make daily updates of my progress and time spent on assignments & tasks
  • Document problems encountered and what I have learned
  • Document next steps in my project, and courses of action I am considering