Blog Considerations, Study List Updated

Updated 6/29/2009 : 09:15pm

I’ve been thinking for some time about the possibility of starting another website. This blog is certainly where I post general goings-on with me and my programming, but I think it would be cool to create a website dedicated to teaching up-and-coming programmers things, categorized in an easy to navigate way. This is partially inspired by StackOverflow.com, but would be targeted at a much lower skill level. My thought is that it wouldn’t necessarily be so basic as to teach things like loops and if statements, but more so at a level where things like algorithms and language constructs would be relevant. The reasoning behind creating a site like this is partially self serving:

“Teaching is the highest form of understanding”. –Aristotle

I feel that by teaching what I know, might help me to even further my understanding of the subjects. The other reason for creating such a site is out of a dissatisfaction for the available knowledge on simpler programming subjects. Sites like stackoverflow are really good, but asking questions on there can be a tricky business if the question is simple, because there is a certain unspoken expectation that you are an above average knowledgeable programmer by using the site. This isn’t a blanket statement, and I don’t wish to be misunderstood when I talk about stackoverflow – I love stackoverflow and I’m an active participant. I just think it would be beneficial to have a website that caters to those who are just getting their feet wet in our industry, to get them excited about furthering their study beyond what they might be getting in a classroom environment. I’ve always felt that individual study time was critical for anyone in our field, but that if someone isn’t all that excited about the field to begin with, they probably aren’t going to go out of their way to learn more about it on their own. The proposed site would give newcomers a taste.

I haven’t purchased a domain for this site, nor have I come up with design or content. It’s an idea that will probably float around in my head for a while before materializing fully.

I spent some time with my previously mentioned study list and determined that I could probably remove some things and add others. Below is the new list, with my current progress.

  • Algorithm to reverse a string
  • Linked List from scratch
  • Quick Sort from scratch
  • Insertion Sort from scratch
  • Selection Sort from scratch
  • Bubble Sort from scratch
  • Singleton pattern
  • Factory pattern
  • Maze solver
  • Composite pattern
  • Decorator pattern
  • Greedy algorithm
  • Backtracking algorithm
  • Memoization
  • Hash table from scratch
  • Binary tree class + search from scratch
  • Graph traversal algorithms
  • Heap from scratch
  • Preventing integer overflow
  • Web services in: Java, C#
  • Java command line compilation flags
  • GCC command line flags
  • Ant, Make
  • Eclipse project/build configurations

Interviews

I knew that when I started the job search, I would ultimately end up doing a lot of algorithm development in my interviews, so I made an investment in a good dry-erase whiteboard to practice on. I explained to Susanna that, as a programmer, a whiteboard is just as important as the computer or code itself, as a consequence of Miller’s thoughts on human memory channel capacity. We as programmers simply can’t juggle all the necessary things that we need to know in active memory – we need to write it down, plan it out. If you are a programmer, you need a whiteboard.

So for my interviews, I’ve been studying data structures, time complexity, design patterns, etc.. I spent some time writing a list of things I ought to study up on. Here’s my list, and my progress for studying.

  • Algorithm to reverse a string
  • Linked List from scratch
  • Quick Sort from scratch
  • Insertion Sort from scratch
  • Selection Sort from scratch
  • Bubble Sort from scratch
  • Singleton pattern
  • Factory pattern
  • Composite pattern
  • Greedy algorithm
  • Backtracking algorithm
  • Memoization
  • Hash table from scratch
  • Binary tree class + search from scratch
  • Heap from scratch
  • Preventing integer overflow
  • Web services in: Java, C#
  • Java command line compilation + flags
  • GCC command line flags
  • Ant, Make
  • Eclipse project/build configurations

The ones I haven’t studied up on I still feel confident that I could write if asked in an interview, but I’d still like to study up on them ahead of time. I also took the time to take all of my study/learning java code and organize it into a package hierarchy for easy access, and discovered a pretty easy way in java to pull resources in.

The job market is extremely rough right now. Originally I had intended to focus just on the Seattle area and the general metro surrounding, but it’s getting down to the wire and I’m having to expand my search to include other cities as well. At this point, all my waking efforts are essentially related to the job search (with breaks of entertainment in between to hold my sanity). I think I’ll be alright though, and I’ll certainly post as soon as I land something.

Chapter 7

Throughout my life there have been distinguishable time periods, which for my purposes here I will refer to as ‘chapters’.

  • Chapter 1: The dark hard-to-remember time before elementary school.
  • Chapter 2: K.O.G., or ‘The Gifted Program’ in elementary school.
  • Chapter 3: Middle School.
  • Chapter 4: High School and questionable lifestyle choices.
  • Chapter 5: Community college, first job, moved out.
  • Chapter 6: Susanna, University, web development.

This brings us to now. I’d like to introduce the new chapter

  • Chapter 7: Bachelors degree achieved, moving on to real life, locating employment as Software Engineer.

I’ll let you know how this chapter pans out.

Maze Solver

In my spare time this weekend, I wrote a maze solving algorithm, which is reminiscent of a program I wrote as homework over a year ago, but slightly better. Its still wasteful in terms of efficient moves, but the improvements can come later. Here’s a snippet of some methods from it, for the curious:

    private Point findStart()
    {
 
        for(int y = 0; y < m_mazeNodes.length; y++)
        {
            for(int x = 0; x < m_mazeNodes[y].length; x++)
            {
                if(m_mazeNodes[y][x].getState() == MazeNode.SlotValue.start)
                    return new Point(x, y);
 
            }
        }
 
        return null;
    }
 
    public void solve()
    {
        Point start = findStart();
        solveRecursive(start.x, start.y);
    }
 
    private void solveRecursive(int currentX, int currentY)
    {
        if(m_solved == true)
            return;
 
        if(isValidLocation(currentX, currentY) == false)
            return;
 
        if(m_mazeNodes[currentY][currentX].getState() == MazeNode.SlotValue.end)
        {
            m_solved = true;
            return;
        }
 
        if(m_mazeNodes[currentY][currentX].getState() == MazeNode.SlotValue.visited)
            return;
 
        if(m_mazeNodes[currentY][currentX].getState() == MazeNode.SlotValue.wall)
            return;
 
 
        if (m_mazeNodes[currentY][currentX].getState() != MazeNode.SlotValue.start) 
            m_mazeNodes[currentY][currentX].setState(MazeNode.SlotValue.visited);
 
        solveRecursive(currentX+1, currentY);
        solveRecursive(currentX, currentY+1);
        solveRecursive(currentX-1, currentY);
        solveRecursive(currentX, currentY-1);
 
    }
 
    private boolean isValidLocation(int x, int y)
    {
        if(x < 0)
            return false;
        if(y < 0)
            return false;
        if(y > m_mazeNodes.length-1)
            return false;
        if(x > m_mazeNodes[y].length-1)
            return false;
 
        return true;
    }

Irans Twitterings

“U.S. officials say the internet, and specifically social networking sites like Twitter and Facebook, are providing the United States with critical information in the face of Iranian authorities banning western journalists from covering political rallies.”

“senior officials say the State Department asked Twitter to refrain for going down for periodic scheduled maintenance at this critical time to ensure the site continues to operate.”

Wow.

EasyEclipse

I found this today, which some may find useful. It provides prepackaged Eclipse distributions for certain tasks, all ready to go.

http://www.easyeclipse.org/site/distributions/index.html

Here

Well, the world didn’t end, as alluded to in my previous entry. This is good.

Somewhat late to make a substantive post right now, but I’ll post some stuff soon. Poking my head in to say that I’m still alive. I have some code stuff that I can share, and some other miscellaneous goings-on. Several weeks left and I’ll have my degree….

Back soon.

Scary Place

World is a scary place right now. Something’s got to give.

http://www.reuters.com/article/GCA-Economy/idUSTRE5283P320090309
http://www.cnn.com/2009/POLITICS/03/09/us.navy.china/index.html
http://www.cnn.com/2009/WORLD/asiapcf/03/08/nkorea.launch/index.html

Important Article

This article may be the most important one you ever read, if you’re a programmer, or in any way related to the software industry.

Anagrams

The code below is from an interesting problem I was solving as part of practice for an upcoming programming competition. It’s purpose is to read in a series of strings from an input file (the number of which is defined on the first line of that file), and discover the various permutations of the letters in the given string. This code is not intended to be elegant; It’s only an algorithm test drive. The code here is in Java.

import java.io.*;
import java.util.*;
 
public class Anagrams
{
 
    public static void main(String[] args) throws Exception
    {
        ArrayList answers = null;
 
        Scanner fin = new Scanner(new File("src/input.txt"));
 
        int numberOfWords = fin.nextInt();
        fin.nextLine();
 
        for(int i = 0; i &lt; numberOfWords; i++)
        {
 
            String toPass = fin.nextLine();
            answers = findAnagrams(toPass);
        }
 
        for(int p = 0; p &lt; answers.size(); p++)
            System.out.println(answers.get(p));
 
    }
 
    public static ArrayList findAnagrams(String inputString)
    {
        ArrayList answers = new ArrayList();
 
        char[] inputStringCharArray = inputString.toCharArray();
        int len = inputStringCharArray.length;
 
        for(int shift = 0; shift &lt; inputString.length(); shift++)
        {
            answers.add(new String(inputStringCharArray));
            for(int swapPos = 1; swapPos &lt; inputString.length(); swapPos++)
            {
                String potentialAnswer = stringFromSwap(inputStringCharArray, len-swapPos, len-swapPos-1);
                if(answers.contains(potentialAnswer) == false)
                    answers.add(potentialAnswer);
            }
 
            //shift inputStringCharArray around left by 1 char
            char startChar = inputStringCharArray[0];
            for(int curPos = 0; curPos &lt; len-1; curPos++)
            {
                inputStringCharArray[curPos] = inputStringCharArray[curPos+1];
            }
            inputStringCharArray[len-1] = startChar;
 
        }
        return answers;
    }
 
    public static String stringFromSwap(char[] inputStringCharArray, int lSpot, int rSpot)
    {
        char[] passedByValue = inputStringCharArray.clone();
 
        char temp = passedByValue[rSpot];
        passedByValue[rSpot] = passedByValue[lSpot];
        passedByValue[lSpot] = temp;
 
        String toReturn = new String(passedByValue);
        return toReturn;
 
    }
}