02.21.10
Posted in Java, Programming at 4:32 pm by bryan
From, Data Structures and Other Objects Using Java, Chapter 8, Project #9, page 440:
Examine this pattern of asterisks and blanks and write a recursive method that can generate exactly this pattern:
*
* *
*
* * * *
*
* *
*
* * * * * * * *
*
* *
*
* * * *
*
* *
*
With recursive thinking, the method needs only seven or eight lines of ode (including two recursive calls). How is this pattern a fractal? Your method should also be capable of producing larger or smaller patterns of the same variety. Hint: Have two parameters. One parameter indicates the indentation of the leftmost line in the pattern; the other parameter indicates the number of stars in the longest line.
WARNING: Cheating is bad, mmmmkay children? Don’t cheat.
Permalink
Posted in Java, Programming at 4:23 pm by bryan
From, Data Structures and Other Objects Using Java, Chapter 7, Project #8, page 396:
Make improvements to the car was simulation program from Section 7.2.
Note: Portions of code taken from Michael Main’s version.
WARNING: Cheating is bad, mmmmkay children? Don’t cheat.
Permalink
Posted in Java, Programming at 4:15 pm by bryan
From Data Structures and Other Objects Using Java, Chapter 6, Project #10, Page #347:
Suppose that you have n queens from a chess game, and that you also have an n-by-n chess board. Is it possible to place all n queens on the board so that no two queens are in the same row, no two queens are in the same column, and no two queens are on the same diagonal?
WARNING: Cheating is bad, mmmmkay children? Don’t cheat.
n Queens source code:
Permalink
01.20.10
Posted in Java, Programming at 6:51 pm by bryan
Assignment number 1 in CS211 (Java) programming class. (No stealing! I want full point on my grade!)
PseudoRandomDemo.java
PseudoRandom.java (Class)
Permalink
12.21.09
Posted in Foo at 5:47 pm by bryan
I just read
this article from the New York Times about getting rid of the words “geek” and “nerd” because they’re pejorative.
What a
nerd. A
geek would know the difference.
There’s a reason why the saying goes “The GEEKS shall inherit the Earth,” and that is because we geeks are cool enough to make it into somebody’s
will.
Permalink
11.15.09
Posted in Programming, School, c++ at 9:35 pm by bryan
Finally! I did it! Assignment #4 is complete, and I can manipulate dates pretty effing easily now.
No doubt there is already some vastly superior date manipulation library already out there… stupid school.
Just kidding. I learned a LOT with this assignment.
Permalink
11.05.09
Posted in c++ at 7:15 pm by bryan
This was my version of a C++ assignment to count votes from a text file. It’s not super useful outside the classroom, but I’m posting it anyway.
Permalink
10.19.09
Posted in Music, Music Monday at 2:47 pm by bryan
I don’t have much in the way of content for this post, so I’ll just share today’s song. The only thing I don’t like about this song is this part (solo?) in the middle that just goes on WAY too long, and is way too repetitive. I discovered this song through iTunes when I saw a whole album of covers. Some good stuff.
Update:
Including a link to the album, “Covering 20 Years of Extremes“. I want to test my new auto affiliate link plugin.
Permalink
10.13.09
Posted in Self Improvement at 1:22 am by bryan
I just stumbled across this article about luck. As counter intuitive as it may be (to you at least
), it seems luck actually a well-honed skill. That’s right! If you want to be lucky, all it takes is a healthy dose of optimism, and positive thinking.
I’m all for optimism anyway– I just think it feels better. But this guy is not simply telling us to change our attitude if we want to feel happier. He’s talking about the real, tangible results of a paradigm shift1. (1 See The 7 Habits of Highly Effective People
“).
Here’s a quote:
I asked a group of lucky and unlucky volunteers to spend a month carrying out exercises designed to help them think and behave like a lucky person. These exercises helped them spot chance opportunities, listen to their intuition, expect to be lucky, and be more resilient to bad luck.
One month later, the volunteers returned and described what had happened. The results were dramatic: 80 per cent of people were now happier, more satisfied with their lives and, perhaps most important of all, luckier.
I swear I’m a case study of this principle! In the last two years my outlook, and in turn my life, have changed so dramatically for the better that I’m considering listing “luck” on my resume as a skill.
This is exactly the sort of thing that The Secret
talks about, although it attributes success to “the universe,” which sounds much more mystical. Either way they both contain universal truth that is worth heeding.
So if you don’t feel lucky, then look on the bright side.
UPDATE: Apparently this guy has a book called Luck Factor
. (Yes, it’s an affiliate link. I’m feeling lucky.
)
Permalink
10.12.09
Posted in Music, Music Monday at 9:30 am by bryan
I finally found a solution to the
iMeem issue. It’s a
handy plugin for Wordpress that generates either an HTML5 audio player or degrades to Flash if the browser is incompatible.
Incidentally, it’s much more powerful than stupid
Coffeecup’s Web Jukebox. Before you try and take away any of my geek cred, I bought their “Big Cup” package a long time ago. I figured it was worth trying to salvage some of that investment. Besides, I’ve used their photo album software, and it gets the job done in a pinch.
But anyway, here’s the song.
Permalink
« Previous entries Next Page » Next Page »