01.20.10
PseudoRandom Number Generation in Java
Assignment number 1 in CS211 (Java) programming class. (No stealing! I want full point on my grade!)PseudoRandomDemo.java
PseudoRandom.java (Class)
Trust Door AI
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.
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.
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.
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.
)
One of these days I’ll actually know how to program c++ pretty well, and when that happens, I plan to write some kickass software. But when that happens, I figured it would be pretty amusing to look back at my very first c++ program (besides the mandatory “Hello World!” app).
This was our first assignment in Computer Science 210, page 98, #15 in Problem Solving, Abstraction & Design Using C++ (5th Edition). To quote:
Write a program that dispenses change. The program should read the amount of the purchase and the amount paid and then display the number of dollars, quarters, dimes, nickels, and pennies given in change.
Actually if you keep reading, they tell you the wrong way to do it, as a “hint”. Jerks.
But notwithstanding, this is what I wrote:
I promise, there was lots more whitespace in the actual program. Wordpress is just being stupid. Here's the file for download: ChangeDispenser.cpp.
Warning: Don't cheat off me.
UPDATE 10-19-09: Fixed a bug in how pennies were calculated.
UPDATE 11-01-09: Fixed formatting / lack of whitespace.