Author Archives: Steve - Page 2

A call for moral leadership

The brutal police violence that ended the peaceful protests at UC-Davis last week is appalling and frightening. While I can understand Chancellor Katehi’s concern about the health and safety risks of allowing students to camp overnight on their campus, she’s out of touch with the situation. Katehi sent a letter to the protestors informing them of university policy and asking them to dismantle the encampment. When that failed, she tried to solve with policy and police force a problem she should have addressed by going there herself and engaging the students in a dialog about the issues.

In an interview with AggieTV, Katehi talked and talked about the task forces they would form and the dialogs they would have (for at least a year) and the systems they would implement. She’s approaching the problem entirely the wrong way, trying to control it with bureaucracy. That is not the solution for a peaceful protest.

I’m proud of the students who stood their ground, sitting on that sidewalk with linked arms, meekly accepting police violence without retaliation. Katehi and her police cowardly tried to repress them but only brought strength to the students’ cause and dishonor to their administration.

I sincerely hope the University of California dismisses Katehi and brings in a chancellor who will exercise moral leadership, someone who will esteem the students as allies and work with them to change the world. I have the same hope for universities across the country, including my own Brigham Young University. We need strong, moral leaders to work with the rising generation to ensure this country is in good hands.

Quick start guide to mod_rewrite

The Apache mod_rewrite module turns out to be a very useful tool when you’re building PHP applications. Here’s a simple quick start guide:

First, make sure Apache has the mod_rewrite module installed. In Ubuntu, you can execute this command:

sudo a2enmod rewrite

Make sure that the AllowOverride directive is set to “All” for the folder containing your files. On Ubuntu, it’s under /etc/apache2/sites-enabled/, called 000-default or default-ssl.

Now, create an .htaccess file in your site’s root folder. Here’s an example:

RewriteEngine On
RewriteBase /~snay2/
RewriteRule ^driver-esl/(.*)/(.*)/$ driver-esl-handler.php?driver=$1&flowershop=$2 [QSA]

Some notes:

  • The bolded sections are the capturing portions of the regex and where I use them in the rewritten URL.
  • The [QSA] at the end of the line means “query string append”: anything in the query string of the original request will get appended to the new query string Apache created on the fly.
  • Change the RewriteBase to whatever the root URL of your site is. This was the biggest thing that tripped me up.
  • For some reason, I had problems getting the rewriting to work on an EC2 Ubuntu instance when the URL and the PHP file had the same name. So I called the PHP file driver-esl-handler.php instead.

I’ve set up a simple PHP script at driver-esl-handler.php like this:

<?php
  header('Content-Type: text/plain');
  print_r($_REQUEST);
?>

Now if I go to a URL like this

http://students.cs.byu.edu/~snay2/driver-esl/driver1/fs2/?_domain=rfq&_name=delivery_ready

I get the following response:

Array
(
    [driver] => driver1
    [flowershop] => fs2
    [_domain] => rfq
    [_name] => delivery_ready
)

I found a great cheat sheet for mod_rewrite here. It’s worth perusing if you’re doing anything other than elementary rewriting. You can also read the official Apache docs.

Technology and the economy

This is a “position statement” vlog for CS 404 about technology’s role in changing the world economy

The inspiration was largely drawn from Phil Windley’s “Productivity and The Distribution of Wealth.”

Webcams at BYU

UPDATE (12/9/11): The BYU iOS app now includes a “Campus Cameras” feature. The cameras listed in that feature are exactly the ones I discovered with this Google search. Looks like I was successful.

Out of curiosity, I went searching for all the webcams at BYU that I could find online. I found nine locations with a total of fourteen cameras.

Exterior webcams:

Interior webcams:

  • Bookstore The Bookstore has three functioning cameras. Two show line conditions on the text floor and one shows the courtyard outside the Wilkinson Center.
  • Testing Center Shows the line conditions at the Testing Center.
  • ID Center Shows line conditions at the ID Center and WSC information desk.
  • My friend recently helped install a new webcam in the student fitness facility in the Richards Building, but it hasn’t been published yet.

The subdomain webcam.byu.edu is operated by the university for the south campus construction cameras. The subdomain webcams.byu.edu is operated by the Bookstore. All the rest of these are hosted on department subdomains. Most of these can be found with a simple Google search: “webcam site:byu.edu“.

Those who take the present for granted

Clay Shirky writes in Here Comes Everybody about the social changes effected by the evolving tools of the Internet. Here is one particularly insightful bit from his book:

[T]he future belongs to those who take the present for granted. . . . [Y]oung people are taking better advantage of social tools, extending their capabilities in ways that violate old models not because they know more useful things than we [Generation X and older] do but because they know fewer useless things than we do. (p. 303)

The people who are revolutionizing society with technology are the people who grew up taking it for granted. Changing society on this grand a scale would have taken disruptive, unconventional vision in the corporate world of twenty years ago. Today it happens as the result of many small companies innovating in their own spheres, building on each other and creating interesting platforms and services. Generation Y lives in the perfect environment to revolutionize while requiring only the limited experience, capital, and influence they have.

Music piracy beneficial for artists

Music piracy increases an artist’s reach in his target market. Record labels publishing the music complain about lost revenues, even though most of those revenues never get paid to the artist anyway. Musicians “regard live performances as their almost exclusive source of income”. The more people with copies of a musician’s work (legitimate or otherwise), the higher the demand for live performances. By that metric, artists stand to benefit from music piracy, even while music publishers, the middle men of the industry, do not.

UPDATE: Here’s an infographic that describes the pitiful amount of money an artist earns from legally-sold digital music. Musicians can’t live on royalties alone.

Digital textbooks: Still falling short

Last year, I wrote about some of the reasons the iPad wasn’t suitable for students. One of the biggest reasons I gave at the time was unsatisfying experience of trying to study a textbook on the device.

Audrey Watters wrote today about why students aren’t using ebooks for textbooks. One reason is availability. This has proved not to be a problem for me as a computer scientist; most of the textbooks I’ve needed for the past two semesters are available for the Kindle. But Audrey mentions a few other points that are universally applicable:

  • “[I]t’s still not quite as easy to mark up a digital text as it is a printed one.”
  • Most digital textbooks cost only slightly less than the physical versions. The relative TCO of an ebook is higher since it can’t be sold back at the end of the semester.
  • Ebooks aren’t integrated with social tools that students want to use for research and homework.

The tools available for working with ebooks are ill-suited to the needs of a student. For example, when studying a textbook, my memory is often aided by linking a concept with its physical location on a page, relative to figures and other visual elements. Ebooks by nature remove these artifacts of typesetting.

The biggest problem, however, is the ebook reader paradigm: read one page, advance to the next page, repeat. A textbook must allow me to flip back and forth between chapters, look things up in the index, and mark and write notes in the margin. Some books, like two that I am using this semester (Mythical Man-Month and Peopleware), don’t require that; I can read them a page at a time and still extract sufficient value. Having the device foist sequentiality on the user is not burdensome for books that are read straight through. But for textbooks, which are used more for reference than sequential reading, that paradigm is ruinous.

Until we develop better ways of reading, marking, referencing, and sharing ebooks, the textbook market will continue to make up only a small segment of ebook sales.

Eternal value of education

One of my core beliefs is the eternal nature of the soul. When we die, we’ll take with us the knowledge gained in this life. The question, then, is what things are most important to learn in a short human life. Cecil O. Samuelson, a retired physician and current president of Brigham Young University, remarked once that he doubted there would be a need for rheumatologists in the next life. Will there be a need for computer programmers? I highly doubt it. But there will be a need for scientists of all disciplines to understand and teach principles of chemistry, biology, physics, and mathematics. While specifics of the engineering disciplines may not be necessary there, the general scientific knowledge they apply will be invaluable. Beside that, if nothing else, engineers help improve our world while we’re still here.

Technology and family history work

Malachi describes the prophet Elijah coming to “turn the heart of the fathers to the children, and the heart of the children to their fathers.” The fulfillment of that prophecy today is evident in the ever-increasing interest in family history work around the world. It is aided and intensified by ever-advancing technology. Both of these are being guided by God. When the Internet was new, it promised to have a great impact on genealogy. The evolution of projects like FamilySearch* witness that. Smartphones promise to be just as revolutionary as the Internet. Dr. Charles Knutson at BYU has caught that vision and is realizing it with his Twenty Minute Genealogist project. The future will hold much more that we haven’t even dreamed of today. It is exciting indeed to be a part of this growing field and to witness the advancing work of God.

* Compare this description of FamilySearch one year after its creation to the current vision for the project as of late last year.

Technology must not replace spirituality

A theme constantly stressed by my religious leaders is the judicious use of technology. The Internet, Twitter, Facebook, and smartphones are a great boon. They deliver information to me and help me use and disseminate it. They enable me and other members of my church to share the good news of the gospel of Christ. But they can also be distracting and detrimental to my spiritual awareness. The more intrusive those technologies become, the more careful I must be in watching their proper usage, ensuring they don’t cheapen my relationships with others or with God.