Posts

My first iOS app!

Image
WWDC When I went to WWDC for the first time a couple months ago, I was inspired by all the cool demos, people, labs, and apps (shoutout to Shadowmatic!) to start developing for iOS. I had already started to teach myself Swift through the Stanford course on iTunes U, but during WWDC, I decided to just dive in and build a game.  One of my favorite games is Dots and Boxes: I played it obsessively with friends on the whiteboard everyday in middle school, and even created an AI to play the game in high school. Naturally, I wanted to make a Dots and Boxes app. After half an hour of StackOverflow and Ray Wenderlich, I  got two dots on the screen and a line connecting them appeared when I tapped. It was exciting! By the end of WWDC, I had cobbled together a basic game called Tessature that was a variation on Dots and Boxes.  My 0th app, Tessature  After WWDC, I continued to work on Tessature. I hit a lot of obstacles: t he overall structure of the project was disorga...

Last day of my internship!

It was hard to leave the University of Washington Networks Lab, where I've been working this summer. (That being said, I might come back winter break.) Thank you to Bonnie, Ray, Will, Tom, Danyang, Donny, and Yuchen for an unforgettable ten weeks! Ray, Will, and their team have been developing Radiatus and freedom.js, a new programming model for designing web apps. Radiatus relies on message passing and isolated user containers, unlike frameworks such as Express or Django, which have centralized servers. Using Radiatus and freedom.js means more flexibility and privacy, but as of now there are also some pain points: Long message chains.  An extra "social provider" layer in addition to the traditional frontend, backend, and database. When we send data from one user to another, we have to pass the message through the first user's frontend, backend, and social provider, and then through the second user's social provider, backend, and frontend.  Error propagati...

Graphics Programming

I've been getting a few questions about Java graphics: "Do you know of any good graphics tutorials for java? I am working with one that might work, but any suggestions you have would be great." Below are some links that I found useful:   http://docs.oracle.com/javase/tutorial/2d/index.html http://www.corewebprogramming.com/PDF/ch10.pdf http://www.deitel.com/articles/java_tutorials/20050923/IntroductionToJava2D.html   Java has an advanced graphics 2D API . It is quite sophisticated and might be daunting for beginners who just want do something fun. I found that for casual programming, Processing is more approachable and you can write a fairly complex program with it. Also, one of the most popular Java client side graphics libraries is Android (of course, it's not really Java at runtime on the device).  

Young Coders: Week 4 Problems

The Final Challenges! 1) Create a method called between. Its parameter is an int array. It will return the maximum distance between any two equal values.  For example: between(new int[] {1,0,4,2,5,0,0,5}) should return 6, because the leftmost 0 and the rightmost 0 are 6 elements apart (including themselves). 

Young Coders: Week 4 Notes

Image
Sorting and Searching Bubble Sort, Insertion Sort, Selection Sort Linear Search, Binary Search How to swap two elements We first looked at how to swap two elements. Let's say we have  int a = 2; int b = 3; and we want to switch their values, so that a = 3 and b = 2.  Remember, we can't just say: a = b; b = a; As we saw on the whiteboard yesterday, this will make both a and b equal to 3, instead of switching their values: 

Young Coders: Week 3 Problem

EDIT: Just one extra Candy Challenge problem this week!  The full Candy Challenge = the following problem + two Candy Challenges from previous classes.  For those of you who have finished all the previous Candy Challenges, pick two problems from Week 2's 3,4, and 5, and try to solve them iteratively (with loops),  instead of recursively.  Write a toString() method for our Queue class that prints out its elements.  For example,  public static void main(String[] args) {    Queue animals = new Queue();           animals.enq("Tiger");     animals.enq("Pig");     animals.enq("Zebra");          System.out.println(animals);  } will give us {"Tiger", "Pig", "Zebra"} , not the hashCode() we have now (something like Queue@56ee20fe).  (An example: Look at the outline of a toString() method we wrote in the Pet class.) 

Young Coders: Week 3 Notes

Image
Yesterday, we learned about classes and some data structures.  Classes A “specification” or “blueprint” that says how to construct an object. Here is the Pet class we made:  public class Pet {  //fields  public String name;   public String color;  public int legs;   public int speed;   private int pinNum;   //constructor  public Pet (String name, String color, int legs, int speed) {    this.name = name;    this.color = color;    this.legs = legs;    this.speed = speed;     pinNum = 1111;   }  //methods  public int getPin() {   return pinNum;    }  public void setColor(String color) {    this.color = color;   }  public void exercise(int increase) {    speed += increase;      color = "red";   }  public void sleep() { ...