Welcome to my intro to programming class! I am teaching today through GirlDevelopIt and in the future will be teaching through Skillshare. If you are unable to make it today, please join me in April! The Skillshare classes will have a smaller class size, more time to Play with Alice, and a focused learning environment.

We will be using Alice 3.1 to teach fundamental programming concepts. It is a nice tool because it helps you learn the fundamentals in a visual way without the headache of programming syntax (the way you write the lines of code so that a computer can read them).

Course Materials

Java

Although we didn’t do “real” programming on Saturday, Alice is a very powerful tool for learning programming concepts and programmatic thinking. This is much more important than learning a particular programming language. Once you have mastered these topics, you are ready to tackle any language! Luckily, Alice provides a nice pathway into Java once you feel comfortable manipulating objects, handling user input, and constructing your stories. I would encourage you to keep tinkering!

Using the NetBeans IDE, you can import an Alice world and extend your creations using Java! Written instructions and video instructions are both available.

I used this tool to generate my Java classes from my introduction movie (get them on github). The AdultPerson.java file has our introduceMyself function and Scene.java has myFirstMethod with questions. Scene.java also has the world set up and Program.java kicks off the scene.

You will find two of my example worlds in the movies folder.

Resources

There is no end to education. It is not that you read a book, pass an examination, and finish with education. The whole of life, from the moment you are born to the moment you die, is a process of learning.
-Jiddu Krishnamurti

Your TA, Dana Bauer, dug up some great links to help you explore the world of programming!

0 comments

I often heard the clichéd refrain that I was my father’s daughter. We spent hours cooking and planning meals, delighting in nature’s wonders, or listening to music together. We even shared a quick tempter and disdain for other drivers. These surface similarities gave us a way to connect, but the depth of his influence was much deeper.

I’ve always loved the poem The Road Not Taken by Robert Frost. The concluding words are:

Two roads diverged in a wood, and I -
I took the one less traveled by,
And that has made all the difference.

I have no idea if my father was a fan of this poem, but it always struck a chord with me. I realize now that there’s a parallel between our lives that didn’t have a name. We shared a flair for the non-traditional and stubbornness in our convictions. We forged our own path fearlessly with a dedication to our vision of what could be. It could have been a lonely road, but we are blessed with the ability to win hearts along the way.

He forwent a career to raise his two girls, though it was hardly a popular option at the time. He was gentle under his gruff exterior and imparted a ferocity in our bellies and a kindness in our hearts. He encouraged my love for math and science, which lead to my passion for computing. I have the confidence, despite difficulties of succeeding in this male-dominated field, to persevere because he believed in me and taught me to believe in myself. Frankly, he’s the reason I’m a badass.

I would not be the woman I am today without him in my life and couldn’t have asked for a better father. I am thankful for the time we spent together, but as this Hebrew proverb states, “Say not in grief: ‘He is no more’, 
but live in thankfulness that he was.”

My father & I at the photo booth

2 comments

If you’re in town a bit early for Strange Loop, join us tomorrow for a relaxed photo tour downtown.

Here’s my general plan:

Twitter will be the best way to track our progress if you wanted to join on the fly.

0 comments

Finished Product

Since it’s such a beautiful day, I want to take the bike and get some shots. I unsuccessfully searched the house this morning for a small notebook, so I deicded to make my own. I’m not the best at hand-drawn art, so I searched Google Images to find this image of a Nikon Camera. I created a Pages document because it’s easier than Word for laying out multiple copies of something on the same sheet. My Template is generic enough for any type of journal with a few quick updates.

Construction Time: 15-30 minutes

Materials

  • Printer & pattern
  • Thick paper for cover
  • Thinner paper for journal pages
  • Papper cutter or scissors
  • Thick/upholstery thread
  • Sharp needle & thimble

Instructions

  1. Print cover. Cut cover and filler sheets in half with scissors or paper cutter.
  2. Sew pages into book. I just jumped in and didn’t use an official stitch, but here are some great suggestions. I used something similar to page 3, “Half-back.”
Stitches

0 comments

Ingredients

  • 4-6 medium tomatoes
  • 3 small onions/shallots
  • 1 cucumber
  • 3 TBSP lemon juice
  • 3 TBSP honey
  • 2 TBSP olive oil
  • Salt & pepper

Directions

Throw everything into a blender or smash with a mortar and pestle. Served chilled.

This started out as a cucumber, honey, and lemon salad but the mixture didn’t quite taste right (far too lemony). I searched the fridge for other items to include in the dish and decided on a gazpacho (which I’ve never made before). I started throwing stuff in and the proportions listed are a guess.

It turned out yummy!

0 comments

Our CSA was running a special on Romas – $1 a pound in 25 pound increments … and my husband decided to buy 2!

Luckily we have fantastic friends who will work for tomato products.

Juggling Tomatoes

We washed all tomatoes and sorted them into questionable and beautiful.

Washing Tomatoes

We started with the sun-dried(ish) tomatoes and sliced enough tomatoes to fill up both cookie sheets and all 6 dehydrator trays.

Dehydrating Tomatoes

Next we chopped the rest of the tomatoes. We started a slow cooker full of red sauce and set to making the marinara sauce.

Chopping Tomates

We followed Food in Jars’ recipe and used 9 pounds for each round of sauce (yields 4 pints per round).

Marinara Recipe

We used the food mill to process the sauce before simmering for a while. The flesh that didn’t make it through we ground into a paste with the immersion blender and froze. We  had left over tomatoes and made patatas bravas and sauce.

Marinara & Patatas Bravas

Yield

Canned

  • 8 pints marinara sauce
  • 4 pints dehydrated tomatoes in oil
  • 4 ½ pint oven dried tomatoes in oil
  • 1 gallon chopped fresh tomatoes

Frozen

  • 2 quarts tomato paste
  • 2 quarts marinara
  • 2 quarts basic red sauce
  • 1 quart bravas sauce (we ate the other quart!)
 On top of all those products, we still had a gallon bag full!
Final Yield

0 comments

Instead of focusing on styling in yesterday’s class, we focused on the Java code to make the calculator work. We’ve moved the styling lab and material to today’s class. If you were having trouble with the calculator portion of the class – do not dispair! Download the latest code from the classroom example so you can follow along with the styling lab today.

If you haven’t finished last week’s homework, don’t be discouraged! Join us at project night! Also, I will be posting my finished application so you can see how I implemented the project.

 Course Material

Homework Exercises

Tonight will engage your artistic side and make your calculator feel like a real application.

  • Create a style for operator keys. Add dimensions and colors to support the style.
  • Create a drawable for the operator key states.
  • Create a style for the equals key. Add dimensions and colors to support the style.
  • Create a drawable for the equal key states.
  • Create a style for the clear key. Add dimensions and colors to support the style.
  • Create a drawable for the clear key states.
If you get stuck, check out the completed calculator.

What’s Next?

We’ve only scratched the surface of the wonderful world of Android. My goal was to get you excited about this platform and wanting to learn more. Luckily, there are a lot of great resources that can help you on your way, including local meet ups.

0 comments

The first half of the class will be a hands on lab focusing on last week’s homework assignment. Then we’ll discuss how to style the application.

Course Material

Homework Exercises

If you haven’t finished last week’s homework, don’t be discouraged! You’ll have more time to work on it tomorrow.

Tonight will engage your artistic side and make your calculator feel like a real application.

  • Create a style for operator keys. Add dimensions and colors to support the style.
  • Create a drawable for the operator key states.
  • Create a style for the equals key. Add dimensions and colors to support the style.
  • Create a drawable for the equal key states.
  • Create a style for the clear key. Add dimensions and colors to support the style.
  • Create a drawable for the clear key states.

0 comments

Although I love the idea of highlighting geeky leaders and businesses that make a difference in this city, I’m disappointed that the mobile community has been underserved for two years running.

Last year there was a category to recognize the best iOS app of the year. I found out about the event rather late and mounted an unsuccessful campaign to get an Android category on the roster. Although defeated, I was encouraged about the future, because the organizers promised to have a category the following year to highlight all platforms.

Fast forward to this year. I was super excited when I saw that the category list contained Mobile Developer of the Year. I ran out and bought tickets immediately for the event. Apparently submissions were low for this particular category and without warning the category was cut. I found out on the day that the nominations were announced and immediately emailed organizers to find out what had happened. They were unmoveable about giving even a short of period of time to reach out to the community to garner more nominations to reinstate the category. I spent several months debating my next move, but eventually gave up and sold my tickets for lack of enthusiasm about the event.

Last year the awards favored iOS over Android and this year both were left out in the cold. The argument has been made that it’s the community’s fault for not stepping up. However, I think the marketing message didn’t reach these communities effectively. For example, I wrote an email to the women in tech scene here to encourage them to submit nominations for various categories (a population that may have completely overlooked this award ceremony in the past). Reaching out to this community had a strong mobilizing affect – you can see this reflected in the number of women nominated for awards.

For whatever reason, I didn’t send the same email to my community – the Android Alliance. They had no idea that the event was happening or how to submit nominations. Several later expressed disappointment that they missed their chance to participate. If the organizers had mentioned that submissions were low, I would have gone out of my way to garner more. I never had an inkling that there was trouble brewing for this category.

In short, I’m very disappointed that mobile is not being highlighted at all this year. I wish organizers had reached out the mobile communities – either when selecting a category or when submissions were low. This could have been avoided if we worked together.

Full disclosure: I nominated myself for this award (as did a few others). Would I like to have been recognized, sure. But that’s not my motivation for writing this blog. My motivation is to have the Android, iOS, and Windows mobile communities recognized for its role in this city’s economy and technological innovation. I don’t want the mobile community to be overlooked a third time.

1 comment

It’s time to make our first Android application!

Course Material

Office Hours

If you have any questions, please feel free to reach out to the Facebook group. This forum gives you access to your fellow classmates, the TAs, and myself. In addition, I will hold Skype office hours on Thursday, August 16 from 7-8 PM to answer any questions that will help you get started. I will hold office hours again on Saturday from 4-6 PM to answer questions you may have when deeper in the coding assignment.

Homework Exercises

If you haven’t finished last night’s homework, please start there to get more familiar with the foundations of Java.

Now that we’ve laid the ground work for the calculator app, let’s make it work! Here’s what the calculator should do:

  1. Consecutive numbers should be appended to the current number (Example: 1 2 3 4 5 should display 12345).
  2. Create an enum that represents operation types that a calculator can perform (see below for more details).
  3. When an operation is performed, store the type.
  4. When an operation is performed, store the number displayed.
    • NOTE: We’re displaying as a String, but should store a number type.
    • int number = Integer.parseInt(“12345″)   // Gives the integer 12345
  5. When equal is pressed, calculate the result using the operation type and stored number.
  6. Division and modulus should perform integer calculations (Example: 7 / 3 = 2 and 7 % 3 = 1).
  7. When equal is pressed, update the display with the result.
  8. Pressing equal after a calculation is complete should show the last result (Example: 2 + 3 = 5 ==== 5, pressing equal repeatedly after the initial calculation will show as result of 5).
  9. The clear button should reset the calculator state.
  10. Users should be able to change their minds about what calculation to perform (Example: 2 * + / * 4 = 8, should calculate 2 * 4 because the last operation entered was multiplication).
  11. Calculations can “chain” or use the last calculated number in the new equation (Example: 2 + 3 = 5 + 2 = 7).

Extra Credit (End of Class Goals)

Users don’t always do what you expect them too! Handle the following unexpected user actions or exceptional states:

  • Detect division and modulus by 0. When this occurs, place the application in an error mode and display the string “NaN”. Only pressing the clear button or a number key clears this state.
  • User presses equals after starting the application.
  • User presses an operation before a number is entered.
  • User enters a number, presses an operation, then presses enter.
  • Prevent and detect integer overflow. To prevent, limit the number of digits a user can enter. When a calculation exceeds the maximum integer amount, place the calculator in an error mode and display the string “Error”. Only pressing the clear button or a number key clears this state.

Switches & Enums

Using switches and enums together can simplify the coding assignment. An enum is a handy data type that allows you to basically specify a name for an integer. Consider this example:

public enum Season { WINTER, SPRING, SUMMER, FALL }

You’d define this enum in Season.java or in your current class. Then, you create a field in your activity that stores a particular season.

Season season = Season.SUMMER;

This technique is especially useful when you want to do different things for different seasons. You could do this with normal if/else/else if blocks, but a switch statement is much cleaner:

switch (season)
{
    case SPRING:
        System.out.println("I love spring!");
        break;

    case SUMMER:
        System.out.println("I love summer!");
        break;

    case FALL:
        System.out.println("I love fall!");
        break;

    case WINTER:
        System.out.println("I love winter!");
        break;

    default:
        System.out.println("Not sure what season we're in!");
}

 

2 comments