Archive for the ‘BYU’ Category

GeoTemporal Slideshow

Monday, September 15th, 2008

This seems like a good way to describe a mashup involving Google Maps, Simile Timeline, and JW SWF Player.  Its also a great way, in my opinion, to view a slideshow, for a number of reasons.  First, because it gives viewers a more interactive medium – the timeline and video can be used to jump to any point in the slideshow.  Where there is a lot of traveling, this gives viewers a sense of how much distance was traveled and in how short a period.   Second, because it just looks more interesting – its plain cool!

To see my proof of concept implementation, go here.

GeoTemporal Slideshow

 

priority_queue Visual Studio 2005

Monday, October 1st, 2007

Weirdest error I have experienced of late, compliments (of course) to Visual Studio 2005. The error given is:

error C2143: syntax error : missing ‘;’ before ‘<’

This error is generated because of a perfectly good typedef:

typedef priority_queue<NodePtr, NodePtrList, less_NodePtr> PriorityQueue;

Alone, in a separate project, this line compiles as it should. So, what could it be? It smells like something project-specific.

And following your nose, you would be right: the project included a “Queue.h” header in another part of the source. Nowhere is the contents of this file referenced. So I removed it and…well, all is well.

Vision Basics

Friday, September 28th, 2007

“How do you pick out an object from a scene?” If this has been a burning question for you, as it has for me, I have a few answers. The basic question I had is “what identifies the object”? Well, it seems so obvious. If its a log, then look for something “log-like” – longer than it is wide at least. And pick the biggest one in the image.

Everything is easy until you try to do it. So, sitting down writing a program to pick out a log is much harder than just saying “do it!” Do you look for a brown thing? What happens when lighting changes – even by a small amount? What if there are other brown things. And anywise, even if you find brown, what does that mean – one brown pixel is not enough. You must connect them.

Turns out, in some cases, it can be as simple as follows:

  1. Background subtraction – just take a picture before and after the object is in view. This is “fair” in many cases, as in when the camera is fixed and the object in view is not.
  2. Thresholding – whether you have an image or not, you can use an auto-thresholding algorithm to separate the background from the foreground. Now you can say what “is” and “is not” the object.
  3. Connected-component labeling – actually, you may have thresholded several potential objects. Labeling each one separately, we can now perform calcuations on things such as elongation, center of mass, etc.

This is all very basic, and as my teacher would warn “there is no one way to do computer vision.” These ideas are just a starting point. For an example of what I have described, here is my writeup of an assignment. Writeup

BYU Housing Fiasco

Friday, September 21st, 2007

This is a hot topic for anyone who is or will be attending BYU. The BYU Housing fiasco. My introduction to this topic started a week before school started. I decided to start looking for a house since, after all, it was about time to start school. Sure, I had procrastinated, but I reasoned that there might be a housing glut just as there is in Idaho. To my horror, it turned out that every single one of the two dozen or so complexes I called was full. How could this be?

Before I continue, rest assure I did find an awesome place. No worries.

The situation is this: BYU, as all church schools, provides a list of approved housing. To be on this list, a housing complex must meet certain quality requirements. Additionally, it must ensure that its tenants are enrolled in institute, or something equivalent. In the end, this is good as it places a check on both the land owners to keep their places up, for fear of losing approval; this in turn means loss of tenants, as BYU students, at least, must live in BYU approved housing. Further, it ensures that bad apples are less common.

One of the requirements BYU makes is also that the housing unit must be within a certain distance of the school. E.G., you cannot open a housing complex in Alabama, no matter how much you want, and get it BYU approved. This radius in the past extended into Orem, only a couple miles north, until recently. The radius is now just two miles from campus. This means more people in a smaller area. More demand. Less supply. Economics = very bad.

Then today, while looking for research papers, I broke into a discussion with a few grad students who have had to deal with this issue for some time. Turns out the Provo council has been urged to impose new limits on housing density in certain areas around campus. Instead of unlimited number of tenants per house, it is now limited in some areas to two non-related persons. Note that this would effectively eliminate the appeal of an owner to rent out the house – two tenants are way too few to make renting profitable. But this is exactly the intended response the council hoped for. In addition, the city wants to start a zany new policy that would require everyone to have tags in order to park their cars in certain neighborhoods. Worse, they are trying to push everyone into high density housing in one part of town with the hope that single students will stay out of the rest of town. The most sinister part of this plan is that the high density housing is going to be built without parking. This forces students to simply not have cars – an stated goal of the city council’s plan. Scary.

Worsening this problem, BYU just demolished housing for hundreds if not thousands of students who used to live in the DI towers.

I mention this, not because I want to raise a raucous, but because this is an issue that will affect BYU undergrad students for years to come. The sad part is that the city council can take advantage of the transient nature of students. Even if a student stayed here continuously during his or her undergraduate work, they would be gone in about three or four years – during which time, likely, they would not even care about things a few years down the road. When the time for change did come, students would protest in vain, as the changes would already be well underway. This is a continuity problem. City council members don’t have to cater to the students, because students aren’t there long enough, and are way to busy, to make an issue of petty things like parking or housing zones.

Anywise, just a heads up. If everyone united on this issue, we could probably get the city council to take the appropriate action: cancel their weirdo plan to force the provo area around BYU into an overpriced housing fiasco wherein students can’t own cars. (sounds like a communist micro-city).

Matlab Vector Fields

Thursday, September 20th, 2007

I made up some nifty code to generate a tangential potential field using vectors in Matlab. It was especially fun figuring out that you can flatten portions of the vector matrix using conditional matrix selection!

Code is posted below with a sample.

x=[-50:1:50]
y=[-50:1:50]
[X,Y]=meshgrid(x,y)
U=(sqrt(X.*X+Y.*Y) > 5) .*max(1-( sqrt(Y.*Y+X.*X) – 5)/38, 0) .* cos(atan2(Y,X) + 3.1415/2.0)
V=(sqrt(X.*X+Y.*Y) > 5) .*max(1-( sqrt(Y.*Y+X.*X) – 5)/38, 0) .* sin(atan2(Y,X) + 3.1415/2.0)
quiver(X,Y,U,V)

Tangential Potential Field

Tank Passed

Wednesday, September 19th, 2007

After one of the most intense coding sessions I have ever done, I finished coding ten minutes before it was time to pass off the tank code which steers a tank through obstacles to a flag, then returns the flag to base. Hmmph. Not so cool sounding. Well, since that’s the typical reaction to most computer science stuff, I’ll just move on to lessons learned:

  1. BzTank does weird stuff with bounds. It also has some quarks that can make it look like you’re algorithms broken. In my case, I tried using, essentially, square potential fields (to fit around my square obstacles!) instead of round ones. The BzFlags bounds weirdness made that an expensive choice. One hour before due time, I switched and…well, see the title of this article. Lesson: Always spend more time verifying that your assumptions are correct than tweaking parameters in the hope that it’ll all work out magically.
  2. It takes a long time to do things well if you have never done them before. I think this lab could honestly have taken 20 minutes if I’d had some familiarity with any of the “new” things, including: 1) bztank, 2) the whole notion of steering towards objects in code, or 3) the lab bztank environment. Lesson: Start these things two weeks before the due date. Finish them a week early. Then start on the next one.
  3. As it relates to testing your assumptions, I did learn a valuable technique, which is to use yourself as a bot before worrying about using the real bots. This lets you poke around the world and see what happens under certain conditions as you determine. This is what finally helped me after days and days of observing the real bots fail. Lesson: Get things under your control as soon as possible.

Seven Years Later…

Wednesday, September 19th, 2007

Just today I finished reading the last words of the Old Testament. I think I started some time near the start of my mission in 2001. We are very near to 2008 now, so I have spent roughly seven years plodding through every single word of that “book.” No short-cuts or chapter heading skimming; no, I read every detail on the construction of the tabernacle, every list of begatting, and every single curse and blessing on Israel. I did skip the Song of Solomon, which has been called Scriptural Trash by some General Authorities. But other than that, I read it. It was good.

Translations of Faust

Monday, September 17th, 2007

I stumbled across a small room in our great library (3rd in the nation!) that contains only copies of literary classics. Upon inspection, I found what I consider to be classics – Faust, Moby Dick, Origin of the Species, etc. But these, like icing on the cake, were all on the top shelves. The three shelves below these classics were stuffed with sci-fi and fantasy books. Since I don’t read sci-fi or fantasy, I can’t attest to these books classicity.

But, I did find Faust and so began to read it. I’ve heard this book used in speeches but never been impressed with its content until this time. I’ve concluded that part of the problem with my prior reading may be related to translation. The translation I found was apparently just very well done. I was impressed with one line of it and wanted to copy it down. I searched the Internet for online versions of Faust; but, all the translations I found didn’t say it quite like the version in the library. Here’s the original (IE, the one I like, making it the baseline):

“Who deems himself complete is hard to please,
A maturing soul is grateful evermore.”

This translation was done by Alice Raphael. Its more better, in my book. Yea, even the bestest.

Here are the inferior ones:

“Your finish’d gentlemen you ne’er can please;
A growing mind alone will grateful prove.”
[1]

Hmmm….to a non-english major, I struggle to find what “finish’d gentlemen” means.

“What’s finished you can never alter after:
Minds still in growth will be grateful though.”
[2]

Still, not quite as good as what I read…Yet another:

“A mind once formed finds naught made right thereafter;
A growing mind will thank you evermore.”
[3]

The other versions just don’t make as much sense to me.

Fluid Simulation

Thursday, September 13th, 2007

When the pirates of the caribbean movie first came out several years ago, I with millions of others went to see it in the theaters. It was not only visually impressive but it also had an entertaining story line. In addition, it reminded me of the actual ride in Disneyland – so there was an element of nostalgia. Then pirates two cameout, which was little more than a teaser for pirates three, which was better than two, but still “a bit out there.” Some would even replace “a bit out there” with “a druggies day dream.”

Anywise, I think for my graphics class, which demands we write a game, that I want to do a simulation of the black pearl. I envision the black perl in 3D, with the torn sails flapping in the wind, and water leaping across the bow. Things are usually harder than they seem, however, and I may have to reduce my vision (and as a result, I may end up with a solid square for a sail and a plane of stationary blue “water”, none of which lappeth on the bow). Either way, some people have supported me in my idea. They referred me to a fluid simulation paper that breaks down the navier-stokes equation into something the common man can read. The paper is titled “Fluid Flow for the Rest of Us” and is found here.

What I’m shooting for: Black Pearl Game
What I’ll have time for: What I’ll have time for

Graduate School Dinner (x3)

Thursday, September 13th, 2007

In the first two weeks of graduate school, here at BYU, as a Computer Science major, one can count on minimal food expenses the first two weeks. I had two dinners yesterday, and one tonight. Remarks were delivered by a Dr. Webb, who basically gave us the following “what I know that I wish’d I’d knew” (that really was the title):

  • Learn to love to learn
  • Develop friends
  • Develop Balance
  • Learn to write well

Good enough. Now that it is written down, I don’t have to remember it. Me while there: At the dinner