Showing posts with label computing. Show all posts
Showing posts with label computing. Show all posts

Tuesday, February 17, 2015

Passwords

I was reading Windows 10 will let you say goodbye to passwords forever and was thinking "what a bad idea (and not just because it's MicroSoft).
Microsoft is adding support for the Fast Identity Online (Fido) standard to Windows 10 to enable password-free sign-on for a number of applications. 
The Fido standards aim to create a "universal framework" for secure but password-free authentication. Fido supports biometrics such as face, voice, iris, and fingerprint or dongles, and members of the group include Samsung, Visa, PayPal, RSA, MasterCard, Google, Lenovo, ARM, and Bank of America as well as Microsoft.

OK, so when my password is compromised (or I forget it) I request a new one and I'm good to go in a few (annoying) minutes. But what do I do when my biometrics are compromised? It's pretty easy to find a picture of just about anyone, so facial recognition is pretty much dead. Likewise voice. And other biometrics can be hacked.

The big problem is, once they are hacked, they are gone. I can't change my fingerprints if my account it compromised.

Biometrics are only as secure as the method used to obtain the data, and that's obviously not physically secure.

No thanks, Fido.

Tuesday, January 7, 2014

Soul of a New Machine

...or why I love computer science and religion. And it's not often that I get to write about both in the same blog post.

One of the big epiphanies in my life was in high school, when I really grokked numbers. I was learning about computers, and number bases, and it hit me - numbers are like, well, like God. Immaterial, unchanging, eternal. Realizing that numbers, like "3", were not squiggles on a piece of paper, or even a group of apples, but a concept, an idea blew my mind. I knew then that I was going to be a math major and go into mathematics as deeply as I could.

As it turns out I wound up in computer science. But I had the same sort of epiphany when I took theory of computation classes in grad school. It turns out a computer program isn't characters on a printout, or even bits in memory. It is an idea, like the number "3," but better. Because, unlike the number "3" the program actually did something. And what's more mind boggling is that, unlike the number "3," before someone thinks of the program, it doesn't exist. Oh one could argue that it existed somehow as a possibility until it was "discovered" but that doesn't really fit the way we think about a program, and there's no evidence of it (unlike mathematics, which can be shown to exist throughout time and space).

This may sound trite or perhaps grandiose, but trust me, if you learn enough computer science (not just programming) and think about it, you get there.

I recently read an article about a man who was in a vegetative state for 23 years and is now able to communicate and tell his story. He says he was conscious the whole time, but unable to communicate. Wesley J. Smith says in the article:
"We hear constantly that people diagnosed as being persistently unconscious should be dehydrated to death because they are not ‘persons,’ or are actually ‘dead’ — and so should be available for organ harvesting," he said.
Smith says "there are abundant reasons to treat people with profound cognitive disabilities as fully human beings."
"First and foremost, because they are us. Second, because we don’t know enough about how the brain works to know that there won’t be some regeneration to permit eventual restoration of some function. But also, because there is always hope," he said.
"Houben is here today only because he wasn’t dehydrated to death," Smith concludes.
In the case of Houben, either he was misdiagnosed, or he was conscious without a functioning brain. That may not be as far fetched as you think. There are numerous studies of patients who have been clinically brain dead and yet claimed to be conscious. Evidence of this is their ability to describe things that happened while they had no brain function. One of the most interesting facts is that most blind people who have these experiences could see while they were brain dead.

Scientist today make the assumption that the brain "generates" consciousness somehow, but there is no evidence of this (and believe me, they've tried hard to find it). Certainly brain damage can affect a person's ability to think and reason, and can cause personality changes, but correlation does not imply causality. What if the body is like the computer hardware and the consciousness (or soul, if you will) is the program?

There is a joke that goes something like this:  There once was a scientist who studied frogs. One day, the scientist put the frog on the ground and told it to jump. The frog jumped four feet. So the scientist wrote in his notebook, "Frog with four feet, jumps four feet." So the scientist cut off one of one of the frogs legs. The scientist told the frog to jump. Frog jumped three feet. So the scientist wrote in his note book, "Frog with three feet, jumps three feet." So the scientist cut of another leg. He told the frog to jump. The frog jumped two feet. So the scientist wrote in his notebook "Frog with two feet, jumps two feet." The scientist cut off one more leg. He told the frog to jump. Frog jumped one foot. So the scientist wrote in his notebook, "Frog with one foot, jumps one foot." So the scientist cut off his last leg. "He said, "Frog jump. Frog jump. FROG JUMP!" So the scientist wrote in his notebook, "Frog with no feet, goes deaf."

Breaking a key in your keyboard or having a faulty memory chip will certainly cause your computer to misbehave, but the program is fine. The computer hardware is not the cause of the program, it is just the way in which the program interacts with the physical world, and if the hardware is broken it is cause the program to interact improperly. The program itself exists whether or not it is running on a computer, it just requires thought. Why can't the soul and body work that way? And if it does work that way, how does the soul come into existence? That implies a consciousness who thinks it into existence. [Spoiler - His name starts with "G" and ends with "d".]

Today this might be considered a wild theory by many scientists, but it's been the way the human person has been considered for thousands of years, and (as I mentioned) there is no scientific evidence to the contrary. Certainly there are corresponding examples of the old displacing the new in science. Take the scientists' insistence in the nineteenth and twentieth centuries that the universe had no beginning or end. Along comes Georges Lemaître and suddenly the universe has a beginning and an end, just as those poor ignorant Christians and Jews believed for thousands of years. The question is, could one devise and experiment to prove or disprove the theory that the brain doesn't generate consciousness? Oh wait, we already have, in the cases I mentioned above where brain dead patients are conscious.

Don't get me wrong now. I'm not saying we are robots, programmed by God. What I am saying is that computer science provides us with an existence proof that things like the soul can be real. And in some small way, computer and information theory is just another look into the amazing complexity of how God has created the universe, giving us a tiny window into the world of metaphysics, just as Newtonian mechanics gave us a tiny window into the world of physics.

Monday, June 25, 2012

Alan Turing

Last Saturday was the 100th birthday of Alan Turing. Who, you ask? Thomas McDonald has a good overview of his life and contributions. Wikipedia has a more in depth biography. Any student of Computer Science will learn about Turing at some point. He defined what came to be known as the Turing Machine, which is not a physical machine at all, but a thought experiment to determine what is the simplest thing a machine can do that, if given enough time, can allow it to do anything that any machine that could ever be built can do. His contributions are the basis of computability theory that are still taught and used today.

But I'd like to talk about his brilliant paper Computing Machinery and Intelligence. In it he proposes what has come to be known as the Turing test. The basic idea is this. Three people are conversing via some mechanism that does not give away any information about who the person really is (such as chat). Call them "Alex", "Brooke" and "Chris." One of the other two (Alex or Brooke) is really a machine. Chris asks questions, and by the answers given, tries to tell which is the machine, and which is the human.

The claim is that if there is no discernible difference between the human and the machine, the machine exhibits intelligence. Whether or not the machine is intelligent is a deeper question, and one which Turing sort of glosses over. But his point is valid. If there is no way to determine that the machine is different from something we know is intelligent, then it becomes hard to claim that the machine does not possess intelligence.

Note that Turing makes no assumptions about the size, shape or construction of the machine. It could be a smart phone or a room full of gears. It can look up answers in a book or roll dice. The only thing we can examine is the output on the screen. This sort of reminds me of "The Turk", which was a fake chess playing "machine" built in the late 18th century. In that case though, it was a human masquerading as a machine (which is an easier problem).

In each case, the claim is that the "implementation" is equivalent as long as the "observations" are equivalent. In general that may be so, but it is not the case when we talk about specifics. If I am chatting with my son, for instance, it makes a huge difference whether it is really my son on the other end, regardless of how clever the imitator may be.

I bring this up because I see the Turing test as an analogy to the Eucharist. In distinguishing intelligence from all of the external signs, Turing inadvertently distinguishes the accidents (observations) from the substance (implementation), a la St. Thomas Aquinas. Through all the "observations" we can make, we can only detect bread and wine. Some might claim that's all the reality there is, or that it doesn't matter what is really going on because all we can observe is bread and wine. However, to those who have a love of the person of Jesus, it matters deeply whether the "implementation" is bread and wine or the body blood soul and divinity of Christ.

Thursday, February 17, 2011

Watson, come quickly I need you!

I watched the Jeopardy IBM Challenge this week and was quite impressed. For those who missed it, IBM's AI (artificial Intelligence) computer "Watson" played Jeopardy against two of the show's all time winners. Watson is a natural language processing system, which means it "understands" and "uses" English sentences for input and output.

I put the terms in quotes because we don't have a clear idea what it means to understand things or to use language. Certainly Watson did a good job of parsing the sentences fed to it (electronically - it does not do speech to text) and a good job speaking (although some of its pronunciation left a lot to be desired). From the sentence fed to it, it would determine what it was supposed to figure out much of the time and come up with a correct answer form its database of knowledge (no, it was not allowed to use the Internet).

It cleaned the clocks of the other contestants, but it won like the machine beat John Henry - by mechanical means. What I mean by that is that it could push the button faster than they could. Throughout the tournament you could see the contestants furiously trying to beat it to the button push and losing, and being frustrated by not being able to answer a question they knew the answer to.

Watson, on the other hand, routinely pushed the button first, unless it didn't know the answer. And the answers it didn't know were telling. Things dealing with "book learning" it knew very well, but it had "no common sense" as my kids put it. One interesting thing that had Alex Trebek and others puzzled were the unusual amounts it bet in the daily doubles and final Jeopardy. Generally a human will pick a number that will give him or her a "round" number or will pass another opponent. It seemed as though Watson took the maximum amount times some predicted probability of winning ignoring the scores of its opponents. Which makes sense, because I'm not sure if Watson knew the scores of its opponents. It did not know what their answers were, which became clear in the first game when it repeated a wrong answer its opponent had already given.

That's not to demean the incredible achievement of a machine that can play Jeopardy at all, and the hard work and talent that went into such an effort. On the contrary, as a computer scientist I find the project fascinating. I just thought the victory was cheapened by the buzzer speed. Had it been more "human" the contest would have been more about intellect and less about mechanisms.

Tuesday, November 30, 2010

Catholic Intellectual Property Rights

With the recent flap about the Feds seizing domains I've been thinking about intellectual property rights (IPR). As one acquaintance put it "when the Feds make a law that turns 90% of the world into criminals there is something wrong with the law." Now, I doubt that 90% of the population shares files illegally, but I do agree the law in this matter is ridiculous.

I discussed this before, in the post "Your Digital Rights". While there is a legitimate case for a content producer to be paid for his labor, I believe goods (including intellectual goods) should be priced in a way that respects the consumer, not gouges him. How many people would bother to illegally copy a movie if you could buy it for a dollar, and retain the right to watch it? Or perhaps rent it for $0.50? IP law is stifling innovation and economy rather than promoting it.

So I started to consider what the Church might have to say. I don't really have time to give this all the research it deserves, but I didn't want to let the topic go by. In "Ethics in Internet" the Pontifical Council for Social Communications writes:
It is imperative “that the gap between the beneficiaries of the new means of information and expression and those who do not have access to them...not become another intractable source of inequity and discrimination”. Ways need to be found to make the Internet accessible to less advantaged groups, either directly or at least by linking it with lower-cost traditional media. Cyberspace ought to be a resource of comprehensive information and services available without charge to all, and in a wide range of languages. Public institutions have a particular responsibility to establish and maintain sites of this kind.
As the new global economy takes shape, the Church is concerned “that the winner in this process will be humanity as a whole” and not just “a wealthy elite that controls science, technology and the planet's resources”; this is to say that the Church desires “a globalization which will be at the service of the whole person and of all people”.
At the 48th series of meetings of WIPO the Vatican issued the following declaration (apologies for the poor automated translation):
The ration d'être  of the system of intellectual property protection is the promotion of literary, scientific or artistic work and, in general, the creative for the "common good". Therefore, the protection provides a statutory right of the author or inventor's recognition of ownership of his work and to a certain degree of economic return. At the same time, it serves the material and cultural progress of society as a whole. According to Article 27 of the Universal Declaration of Human Rights "Everyone has the right to protection of moral and material interests resulting from any scientific, literary or artistic production of which he is the author." Ultimately, the protection of intellectual property recognizes the dignity of man and his work, which becomes an expression of the growth of individual personality and the common good and contributes to it.
Pope Benedict XVI writes, in his encyclical Caritas in Veritate:
On the part of rich countries there is excessive zeal for protecting knowledge through an unduly rigid assertion of the right to intellectual property, especially in the field of health care.
Some may say that with all the problems of the economy we shouldn't make IPR a central issue. Yet it can be argued that at least some of our economic woes (if not many) are due to inequities arising from the application of improper or unjust intellectual property rights.

For more information check out Elèutheros, a Catholic Approach to Computer Science. Their manifesto declares:
On the basis of official Church documents like Encyclicals [Free Software's surprising sympathy with Catholic doctrine] and CEI directorates [Software Libero, Comunicazione e Missione], we are convinced that there are strong ideal affinities between Christianity, the philosophy of Free Software [The Free Software Definition] and the adoption of Open Formats and Protocols [The Frequently Asked Questions of the Eleutheros Project]. We believe it is evident that the usage of such instruments is much more in line with Catholic Doctrine than fully closed, non Free solutions.

Elèutheros is an association of Catholics whose mission is to serve the Catholic Church through promotion and development of an always increasing harmony between the doctrinal principles mentioned above and the concrete choices made in the Information Technology field at all levels in the ecclesiastical world: from Parishes to Dioceses, from School to Congregations, up to Bishop Conferences and the Vatican itself.
Pretty cool!

Friday, February 5, 2010

Toyota Gas Pedals and Radiation Death

When I went to college I quickly learned some "tricks". One trick was that if I joined the Association for Computing Machinery (ACM) I could use their new UNIX computer in the school's computer lab. That was important, because using UNIX I could do all my assignments without having to wait in line to use a keypunch machine and then wait to get my printout from the school's massive IBM 370 computer.

Aside from getting my homework done easier, and meeting a great bunch of people, I learned some things about computer science. First off, I learned that the ACM had a code of ethics. Up to that point I had never considered that a code of ethics would be part of a particular discipline, rather than just a life code. I figured if you're a Christian, that's your code of ethics. But that's really a subject for another post.

One of the other things that happened was I started receiving Communications of the ACM, which is their member publication. It's full of papers and abstract stuff, but one column fascinated me - Inside Risks by Peter Neumann. Go ahead and click the link and read an article or two. Good stuff. Don't forget to come back here when you're done.

OK, welcome back. One of the things which I found interesting was the sheer number of different types risks associated with computing. We can all understand the risks of losing data, or being hacked, or banking errors, but there are "real world" dangers involved as well. Toyota is finding this out with their sticky gas pedal recall. The flaw is a mechanical one, but since the gas pedal is really just an input device to a computer that controls the car's acceleration, Toyota is (rightly) being called to task for not having safeties in the software. For instance, brake pedal pressure is also monitored by computer (for antilock brake operation). Why not cut out the accelerator when the brake pedal is being frantically pushed?

It seems like an obvious thing in hindsight but should Toyota have had the foresight to do it? As a software architect, and a reader of "Inside Risks" I have to say that they should. The "state of the art" in software today has been "dumbed down" due to short sighted management and low customer expectations. Developers, especially those who work on systems that control "real world" devices, need to consider failure modes in the design of their software.

Of course, although the Toyota blunder is making big headlines, it is not that serious a problem. Far more serious is the death of Scott Jerome-Parks, as described in this NY Times article. Mr. Jerome-Parks died in 2007 at the age of 43 from a radiation overdose for cancer treatment.

His treatments were performed using a new state of the art linear accelerator. The device works by accelerating a beam of electrons and focusing them onto a tungsten target. That converts the energy of the electrons into X-rays, which then pass through a "multileaf collimator". The collimator is essentially a set of metal "windows" that can open or close by varying amounts to control the size and shape of the X-rays that pass through them. Everything, from the strength of the electron beam to the shape of the collimator is controlled by software.

According to the article:
The investigation into what happened to Mr. Jerome-Parks quickly turned to the Varian software that powered the linear accelerator.
The software required that three essential programming instructions be saved in sequence: first, the quantity or dose of radiation in the beam; then a digital image of the treatment area; and finally, instructions that guide the multileaf collimator.
When the computer kept crashing, Ms. Kalach, the medical physicist, did not realize that her instructions for the collimator had not been saved, state records show. She proceeded as though the problem had been fixed.
“We were just stunned that a company could make technology that could administer that amount of radiation — that extreme amount of radiation — without some fail-safe mechanism,” said Ms. Weir-Bryan, Ms. Jerome-Parks’s friend from Toronto. “It’s always something we keep harkening back to: How could this happen? What accountability do these companies have to create something safe?”
It seems that the machine ignored the fact that the instructions for the collimator were missing, and left the collimator wide open, exposing Mr. Jerome-Parks to the highest possible dose of radiation. I don't mean to say that people should avoid radiation therapy, which does save many lives, or to demonize that particular machine, which no doubt has also saved lives. Also, since then, Varian has released an update to add fail safes to the system.

However it came too late to save Mr. Jerome-Parks. Nor is his case unique. According to the Times article errors in radiation therapy are more common than realized, and some of them are due to software errors. Not mentioned in the Times article are issues that Peter Neumann wrote about in "Inside Risks in Medical Electronics" in 1990 about the Therac-25 software problems. When a particular set of commands was entered, the device malfunctioned, emitting high doses of radiation into the patient, resulting in at least 4 deaths between 1985 and 1987.

As we make machines more and more complex, we tend to rely on software more, without realizing that while software simplifies the need for specialized mechanisms, it does not of itself simplify the control problems it intends to solve. With poorly architected, designed, and implemented software accepted as the norm in our homes and offices, it is no wonder that failures happen in critical equipment.

If we look at the Toyota problem, it is actually blown way out of proportion. I don't mean that the people who died or were injured are not important, I mean that we are focusing a lot of attention on this issue, while overlooking similar types of problems that cause even more deaths and injuries. I hope that when the Toyota problem is fixed we won't forget that other people are dying from shoddy software.

Thursday, December 10, 2009

Functions and Objects - Computer Science Week


You may have heard of object oriented programming, in phrases like "java is an object oriented language". Fewer people have heard of functional programming. But what do these terms mean? They represent two extremes in the way we look at computing.

In general we think of computing as data and things you do to data to change it. Like in English we have nouns and verbs. You can think of object oriented programming as a language with only nouns, and functional programming as a language without nouns. You'd think neither system was workable, but in practice, they are two (radically) different ways of thinking about the same thing (data, and ways to change it).

Object oriented programming makes data the king, in the form of an "object". Objects know how to change their state, and you simply send them messages about what to do. For instance, in an object oriented programming language, "1" is not data, it's an object. "1 + 2" sends the object "1" a message to add "2" to itself (of course giving "3" as the resulting object). Object oriented programming's strength is that objects are self contained, so it is easier to write a program without having to consider what every part of it does. You can trust that the objects know what they're doing (if they are written correctly).

In functional programming we do away with the notion of data completely. Everything's a function, just like in math class. "1" is not data again, it's a function (that always returns "1"). The big strength of functional programming is that there are no "side effects". In other words, without data, a function always returns the same result with the same inputs. That makes it possible to reason about a program and mathematically prove whether it is correct or not.

Tuesday, December 8, 2009

Recursion - Computer Science Week


Another concept in computer science is that of recursion. Recursion is defined as "repeated application of a rule", but that's not quite accurate. Recursion is the ultimate in "divide and conquer".

A recursive algorithm consists of two parts. The "divide" part turns a problem into two (or more) simpler problems, and the "conquer" part solves the most basic case for the problem. They are an alternative to "iterative" algorithms, which solve a problem by performing the same simple steps over and over. An example of a recursive algorithm is the "merge sort". To sort a list of names in alphabetical order we can do the following:

If the list has one item in it, it is sorted. we are done.
Otherwise, split the list in 2 parts, sort each part and merge the two sorted lists.

Recursive algorithms generally require more memory and computing resources than iterative ones, but they are great for today's supercomputers which have many CPUs, because each one of the "simple" problems can be computed in parallel on a separate CPU. So even though more resources are involved, the problem can be solved faster.

When the last step in the recursive algorithm is the "go do the simpler problem" part, the algorithm is called "tail recursive". Tail recursive algorithms can be transformed (often automatically by today's tools) into iterative algorithms, which makes them more suited to single CPU computers, where resources are limited and running in parallel isn't an option anyway.

Indirection and Parameters - Computer Science Week


This is the second post for Computer Science Week, on random topics in computer science. There is an old saying attributed to David Wheeler "All problems in computer science can be solved by another level of indirection". Kevlin Henney's corollary to this is, "...except for the problem of too many layers of indirection."

Indirection is simply something pointing to something else. It is often used to mean pointers or references in computer programming, but in a more general sense of computer science, a "handle" or a "parameter" is a mechanism for indirection. For instance, if I were writing a program to control robot, I would not want to make code to move the arm forward one inch, more code to make it move two inches. Instead, I would write code to move the arm and parameterize it to specify how many inches to move.

As long as we're doing that, why not parameterize the direction to move? Or which arm to move? Or whether to move an arm of a leg? Ultimately, indirection lets us factor out common attributes at the expense of potential complexity in a subcomponent, when the parameter is accessed and the data is "dereferenced."

Monday, December 7, 2009

Boolean Algebra - Computer Science Week


Ok, a brief respite from my usual blog topics for National Computer Science Education Week. Each day this week I'm going to blog about some topic in computer science. My goal is to make these topics introductory enough so that anyone can read them and learn something, and perhaps get an interest in learning more.

Today's topic is Boolean Algebra. I know the work "algebra" scares people off. Months of sitting in school trying to fathom what "x" was has left a bad taste in the mouths and minds of millions. But the word actually comes from the title of a book, עilm al-jabr wa'l-muḳābala ‘the science of restoring what is missing and equating like with like,’ by the mathematician al- K wārizmī. So let's restore what is missing in algebra - fun (well, maybe not, but we'll try).

You're familiar with arithmetic operators, + - x and /. George Bool came up with a system of operators on the values TRUE and FALSE. There are three basic operators (which can actually be reduced to 2), that describe all the things you can do. They are AND, OR and NOT, and they are pretty simple to understand.

"I'll eat chicken OR beef." Means I will eat chicken. I will eat beef. I will eat both. The only way this is FALSE is if I will eat neither chicken nor beef.

"I had bacon AND eggs for breakfast." Means I had both, I could not say this if I didn't have bacon or if I didn't have eggs.

"I did NOT eat the peas." This of course, would be false if I did eat the peas.

Pretty simple, and yet George made it complicated by adding formal equations and parentheses and varous properties. The nice thing that falls out of it are some general principles that let us simplify logic. For instance, the sentence:

"If it is NOT Tuesday OR it is NOT raining I will NOT have duck for dinner."

can be shown to be logically the same as

"If it is Tuesday AND it is raining I will have duck for dinner."

Of course, that sounds obvious, but just like numerical algebra, you can use boolean algebra to take some complicated logic problems and find a simpler form that is equivalent. For more information see Ones and Zeroes: Understanding Boolean Algebra, Digital Circuits and the Logic of Sets.

Wednesday, October 21, 2009

Your Digital Rights


Once upon a time in a land far far away, there was a company that made buggy whips. Every day, the owners would pray that someday they would find a technology that would improve the buggy whip to the point where it cost them nearly nothing to produce, and then they could flood the market with cheap buggy whips and make a fortune. The people would have their cheap buggy whips, and the owners would be rich. What a win-win situation for all! One day their top buggy whip research scientist came from the buggy whip research lab shouting “Eureka!” He had invented the horseless carriage!

Each new horseless carriage was, of course, made with a buggy whip holder. To make it go, the driver simply inserted his buggy whip. Now the buggy whips could be made of cheap cardboard, since they didn't actually have to be used. At last the buggy whip company had their fondest desire!

They immediately set out on a huge marketing campaign to sell the horseless carriage with the new “improved” buggy whip. At first, people were reluctant to replace their buggies with horseless carriages, but after a while they discovered that the horseless carriages gave better rides. After all, the people didn't really care about the buggy or buggy whip, but wanted to get where they were going.

The first problem was that people discovered they could make their own buggy whips out of cardboard. That obviously had to be stopped, so the company started making it so that each buggy whip was a unique shape and only that shape would fit a particular horseless carriage. People started modifying horseless carriages so they would run with any buggy whip in response. Eventually, the buggy whip company did the only thing it could do. It lobbied the government to make laws to protect its buggy whip interests. Legislation like the DMBWA (Digital Millennium Buggy Whip Act) made it illegal to circumvent the buggy whip shape-unique features of your horseless carriage.

But people persisted. They started groups to trade buggy whips and techniques for cutting out buggy whip cardboard shapes. Eventually the BWIAA (Buggy Whip Industry Association of America) was forced to institute a series of lawsuits against individual buggy whip owners.

Of course, this story bears no resemblance to any real world events, but there is a lesson to be learned. A friend once said to me that any law that makes more than half of the American public into criminals has got to be wrong. Of course, in a world of moral relativism he would be absolutely right, but we don't live in that world. Yet, he has a point.

The problem is that we are in a world where the economy can't handle what it has produced. Like the buggy whip company, we got our wish, but didn't consider the consequences. I'm told that the inventor of the microchip worked for Fairchild. When he presented his idea to management, they asked him how someone could repair a circuit so tiny. He replied that you wouldn't repair it, you'd throw it out! They reject his idea, as they couldn't accept that someone would throw out an entire electronic circuit when one device failed. He left and went on to found Intel with his idea.

When the “digital age” came about, content publishers were keen to jump on because it would mean they could produce content that was almost free to distribute. Of course, that means everyone has the capability to (re)distribute that content, which was something they hadn't (but should have) anticipated When a CD was something that took huge machines and large capital investment in factories to produce you could see paying $15 for. When I can burn the same CD for under $0.10 (even after paying a “tax” to support the recording industry) I have to question whether they're being greedy by the 15,000% markup.

Of course, the artist deserves to be paid for his work (more on that later) but how much did the artist get for that $15 CD? I'm told 10-18% ($1.50 - $2.70). Let's be generous and call it $2.50. Now, if the CD costs $0.10 to produce and the artist is paid $2.50, then the cost is $2.60. Allow the record company a 40% markup and we have a $3.64 CD. About this time someone's probably shouting “distribution costs!”, but of course, that $0.10 blank CD had to be distributed as well, so I don't buy it. Note also that if CDs were so cheap there would be a lot more sold, so the price could be reduced further while still maintaining a decent profit.

And the situation is worse. We have the ultimate in cheap distribution – download it yourself! When Apple iTunes promised us $0.99 songs people danced in the streets. And yet, when we can listen to (or watch, or read) our entertainment anywhere on portable devices, we get hit with DRM (Digital Rights Management) that restricts us to one manufacturer or some subset of devices. Now you can pay extra to get DRM-free music, which is technically a step in the right direction, but better yet would be to charge less for it.

My point is simply this. If the recording industry charged what the product is worth (as in cost + reasonable markup) instead of what they can get for it, we'd all be better off. There are 2 ways to make more money on a product – charge more for it or sell more of it. If albums were $1 (and songs were $0.10) for instance, would there be a need to restrict copying? Music pirates wouldn't exist because they couldn't make a profit. People would much rather spend $0.10 for something from a manufacturer that was of known good quality, and that supported their favorite artists than turn to a pirated copy of unknown provenance.

But instead the industry continues to overcharge and then spend the money to prosecute their own customers. The same is true of e-books and in fact most forms of “intellectual property”. Ironically, in the information age, information is the medium of exchange, and yet it's not worth the paper it's printed on. Let's look at copyrights. Today's works will remain under copyright protection 70 years after the death of author. If a work of corporate authorship, 95 years from publication or 120 years from creation, whichever expires first.

What's the “common good” of this law? A patent, which might be on some life saving drug or invention to further the good of the human race, only runs for 17 to 20 years. Is entertainment so much more important than invention that we have to reward those who produce it six times as much? Does it take so much longer for the entertainment industry to “develop” the work and make a profit off of it? (Hint, the answer to both of these is “no”)

Yes, the artist deserves to be rewarded for his creative effort. But in the case of Disney film, for example, the artists are salaried employees, and were compensated as much as they're going to be while they actually worked. Even in the case of a band, what's wrong with paying them for actually performing? The brick layer doesn't get paid for 120 years for having laid bricks. The carpenter doesn't get paid for 120 years for having built a house. They stop getting paid when they stop performing their job, and they have to do it again to get paid again.

Instead we live in a society where we cater to the corporation over the individual, and more and more base our economy on what we can get away with rather than what's a fair profit for an honest day's work. We need to adjust to the paradigm, not try to shoehorn reality into our legal framework.

What do you think?

Monday, July 6, 2009

Searching Plurks

How often do you find code in a blog post? I became a plurk fan a while back, but the one feature I missed (and apparently couldn't live without) was a way to "grep" my time line. For non-UNIX geeks, "grep" is a command on UNIX for finding patterns in files. It stands for:

g/re/p

which in the original UNIX editor, "ed" meant globally search for a regular expression and print lines that match.

Here's a sample of how it works:


$ perl plurkgrep.pl young
fetching http://www.plurk.com/m
fetching http://www.plurk.com/m/p/178i6r
fetching http://www.plurk.com/m/p/178g4g
found young in
JeffYoung says On my way to pick up window unit from friend. A/C people won't be able to come until tomorrow at the earliest.
on 2009-07-07 at 00:34

Responses:
kxxn is glad you have that option!
JeffYoung says Me too!

http://www.plurk.com/m/p/178g4g



So, how can I get this goodness? First off, you have to be familiar with a command line.

Save the code below in a file, "plurkgrep.pl" or some such. On a UNIX or Mac you will have to be geeky enough to make it executable and put a header line on it with the locaiton of your Perl binary, or call it as "perl plurkgrep.pl". You may also need to install "Term::ReadKey" from CPAN.

The first time you run it you will have to use the "-u user" option, and it will prompt you for a password. It will store the cookie from plurk.com in a file, plurk.cookie, so you won't have to login every time.

If there's enough interest I could make this into a web page, but it would require users to enter their plurk password and trust me not to misuse it. Let me know what you think!


use LWP;
use Term::ReadKey;
use HTTP::Cookies;

my $sleep = 0;
my $quiet = 0;
my $word = 0;
my $user = '';
my $now = time;
my $then = $now - 14 * 24 * 3600;

my $cookie_jar = HTTP::Cookies->new(file => "$ENV{'HOME'}/plurk.cookies", autosave => 1);
my $browser = LWP::UserAgent->new;
$browser->cookie_jar($cookie_jar);
$browser->agent('Gecko/2009060214 Firefox/3.0.11'); # Pretend to be firefox

# Parse args
while (scalar(@ARGV) > 1) {
if ($ARGV[0] eq '-u') {
shift;
$user = shift;
}
elsif ($ARGV[0] eq '-d') {
shift;
my $days = shift;
$then = $now - 24 * 3600 * $days;
}
elsif ($ARGV[0] eq '-w') {
shift;
$word = 1;
}
elsif ($ARGV[0] eq '-q') {
shift;
$quiet = 1;
}
elsif ($ARGV[0] eq '-h') {
usage();
}
}
usage() if (!scalar(@ARGV));

my $term = join(' ', @ARGV);
$term = '\b' . $term . '\b' if ($word);
my $host = 'http://www.plurk.com';
my $url = "$host/m";
my $login_url = "$host/m/login";

$html = fetch($url);
while ($html =~ m!<form action="/m/login" method="post">!) {
# We need to login
# read password
print('Password: ');
ReadMode('noecho');
$password = ReadLine(0);
ReadMode('restore');
chomp($password);
my $req = HTTP::Request->new(POST => $login_url);
$req->content_type('application/x-www-form-urlencoded');
$req->content('username=' . $user . '&password=' . $password);
my $res = $browser->request($req);

# Check the outcome of the response
if (!$res->is_success) {
die("POST $login_url failed with " . $res->status_line . "\n");
}
$html = $res->content;
}

# We now have first (current) page of plurks
my $next_url = '';
my $time = $now;
while ($time >= $then) {
my @plurk_html = split(/<div class="plurk">/, $html);
for my $plurk (@plurk_html) {
if ($plurk =~ m!<span class="meta">.*<a [^>]* href="([^"]*)">\d*\s*responses?</a>!m) {
doGrep($1);
}
}
# get next page
if ($html =~ m!<div\s+class="pagination">\s*[^*]*<a\s+href="(\?offset=(\d+)[^"]*)">next!m) {
$next_url = $1;
$time = $2;
}
else {
die("Can't find next page\n");
}
$html = timeline("?offset=$time");
}

# We now have all the plurks - fetch each one and do the grep
sub doGrep
{
my $plurk = shift;
my $html = fetch("$host$plurk");
$html =~ s!<h3>Respond:</h3>.*!!m;
$html =~ s!<h3><a href="#top">back to top</a>[\s\S]*!!m;
$html =~ s!^[\s\S]*<div class="bigplurk">!!m;
# clean up formatting
$txt = $html;
$txt =~ s!\s+<span class="qualifier [^"]*">([^\<]+)</span>\s+! $1 !gm;
# remove HTML tags
$txt =~ s/\<[^\<]+\>//g;
(my $grep = $txt) =~ s/\s+/ /mg;
if ($grep =~ m/$term/i) {
print("found $term in\n$txt\n$host$plurk\n");
exit(0);
}
}

sub timeline
{
my $time = shift;
return fetch("$url$time");
}

sub fetch
{
my $url = shift;
warn("fetching $url\n") unless ($quiet);
sleep $sleep;
$sleep = 1;
my $req = HTTP::Request->new(GET => $url);
my $res = $browser->request($req);
if (!$res->is_success) {
die("GET $login_url failed with " . $res->status_line . "\n");
}
return $res->content;
}

sub usage
{
die <<_;
usage: $0 [-u user] [-d days] [-w] term(s)
-u user supplies the user name (if you have to login)
-d days tells how many days back to search (default is 14)
-w searches for a whole word (so a search for "friend" would not
match "friendly")
-q search quietly (see below)
term(s) a word or phrase to match. Keep in mind you have the full
power of Perl's regular expressions in searching.

$0 will print out the text of each matching plurk (including replies),
and will also print out the URL of the matching plurk. Because plurk.com has
restrictions on how fast pages can be accessed, $0 pulls down 1
plurk/second. Because of this, it can appear to be stuck, so it prints out
each URL it fetches as it works, so you know it's working. If you don't like
that behavior, -q searches quietly, only printing the result.
_
}

Friday, June 19, 2009

Science E-books Suck

Here's the much await next instalment of my comments on an article "6 Lessons One Campus Learned About E-Textbooks" by Jeff Young.

First off, let's briefly go over the 6 lessons again:


1. E-book readers suck.
2. E-book readers are hard to use.
3. Professors wanted to be "on the bandwagon".
4. Batteries die.
5. Some subjects' E-books are worse than others.
6. E-books save trees.

On to #5 "SOm subjects' E-books are worse than others". There are 3 big problems here:


  • E-books are not "rich" enough.

  • Number of pixels

  • E-book formats are (mostly) proprietary



E-book's are for reading, not drawing. So the data they contain is text and images. There are things you can do with text, but images are basically static. There's nothing you can do with them. Likewise, you can annotate (some) E-books with bookmarks and/or text, but you can't draw on them. This is not so much an issue with some subjects, like literature, but for something like biology or math the format and placement of information is part of the information, and not being able to draw arrows and circles and line, and put one thing over or inside another is a serious problem.

The small number of pixels available also means that either images are too low resolution to accurately display some information, or they are too big to fit on the screen of the reader. Of course, reading the E-book on a laptop with a large screen helps somewhat, but there's no getting around the fact that a textbook printed on paper has an effective resolution of (conservatively) 600 dpi, so if the book is 7x9" the number of "pixels" is 4200x5400, which is big. Things like anti aliasing and good font design fool us into thinking displays are better than they are.

We could conceivably get around some of these drawbacks if there were a standard format that was extensible enough to support the kinds of things (image manipulation, equation editing, drawing on the pages) that are needed by a textbook, but the market isn't big enough, and the vendors try to hold market share by using proprietary formats/technologies that none of them has the capital to build into what's needed.

Wednesday, June 10, 2009

Wave to ME!


Every once in a while a product comes out that makes me say "Dang! I wish I had thought of that!" This is the story of one such product. I was alerted by a friend who works for google to watch the wave developer preview. Sadly, I have a job and it's an hour and a half. So far I have been through about 1/2 of it and I am impressed. I should probably wait until I've seen the whole thing but who knows how long that will take?

The presentation goes on about wave's uses, things like instant updates to text, media, and searches, inline responses, editing simultaneously, privacy options, embedding on a web page. Here's a great highlight page about the features.

While all these features are cool, none of them is radically different from things that have been done before. Updating a chat session character by character just requires more bandwidth. editing simultaneously is handled by any number of version control/merge products, etc.

However, the fact that they can do all these things in one document is exciting, because to me it points to new ways of handling the data. Note I said document, not chat session. A "wave" really is a document editing system, that's also usable for chat. In fact, a wave is really a databse, when it comes down to it.

The content is mixed media, but it is organized and indexed in many ways simultaneously. First off, there is the presentation structure, which is a tree of media. The media itself is cool. During the demo they freely mix images and text (no mention so far of video or sound, but that's gotta be in the works). Even cooler is the mixture of languages, including non right-left languages.

So each "leaf" has a location in the tree that represents the document. The tree structure is self generating from the way the content is created, which is kind of cool. However, the leaves are also organized linearly as a history by creation/modification time. That allows the "playback" features, and also allows the simultaneous editing and merging.

But wait, there's more. The tree has hierarchical access security. I'm not sure how that works. Typically you can give a document security by encryption or by physical access. I presume the wave uses physical access restrictions, which means the master wave lives on a server. Either way, cool.

But wait, there's more. The search feature also works instantly - if one party searches for a term, results are added and removed as another user types the word or deletes it. Again very cool. I presume this leverages off of the fact that a small number of leaves is being modified at any given time, and the leaves are indexed by modification time already, in order to support playback and merging.

So to me, the coolest part is not what they did (which is impressive looking) but how they wrote things in a way that makes it all possible, in one package, in real time. It's very interesting, very clever, very dynamic, and I think is truly the basis for a possible paradigm shift in collaborative software.

Monday, May 18, 2009

One More Into the Breach

Since everyone is analyzing the president's speech at ND, I figured I might as well. I have an advantage over other bloggers of having access to a symbolic logic analyzer.

It was developed over the past years, using an algorithm developed by Muller Holk of the Division of Logic of the Encyclopedia Foundation on Terminus. It is capable of digesting a speech and producing a summary of its actual symbolic content. I started with the original transcript of the speech given here, and after a few milliseconds of computing time I got the following (cross references to conflicting material are marked with [] by the parser):

I am smarter than you.

The most important issues are the economy, the ecology and harmony. Every other issue should take a back burner to these.

The following things are evil: prejudice, self-interest, materialism, taking advantage of the weak, power and privilege in the face of injustice, violence.

The following things are good: stem cell research and "choice" [so we can keep our prejudice against the weak, our self-interest in our bodies and convenience, our material goods (instead of spending them on children), and keep our power and privilege of life in the face of injustice, and our violence against the weak]

I once wrote what I believed on my web site and someone said they wouldn't vote for me because of my bigotry, so I held on to my bigotry, but changed my words to hide it so I would get his vote, because I am cleverer than you, and everyone knows getting votes is more important than being honest about intentions.

Let us work together to reduce the number of abortions, unintended pregnancies and increase adoptions, support mothers, support conscience, and make sure policies are grounded in ethics. Those are things we can do.

[For my part in this I will make abortions more available and less expensive, suppress religious efforts to reduce unintended pregnancies support adoptions and help mothers, remove conscience clauses and make sure we remove funding from ethical stem cell research and put those funds to work on ethically problematic research.]

The abortion debate is irreconcilable, so keep talking - but only talking - while I make policies Because talking but not doing is fair [to me].

When I was young I helped people in Chicago. I looked up the name of the archbishop so you would applaud because I am smarter than you.

I am an African American. 55 years ago people did a good thing to help stop discrimination against the disenfranchised who were denied basic human rights, and Notre Dame had a big part in it. Now look at Notre Dame.

Remember, faith is doubt, love is hate, war is peace.

Remember that each of us is endowed with the dignity possessed by all children of God [except the unborn].