Cleverbot vs Emacs Psychiatrist

September 27, 2009 by christopherolah

I had some friends over last night, and we did what any group of geeks would do, make Cleverbot and the Emacs Psychiatrist talk to each other.

Emacs Psychiatrist: I am the psychotherapist.  Please, describe your problems.  Each time
you are finished talking, type RET twice.

Cleverbot: It’s small and cold.

Emacs Psychiatrist: Why do you say it’s small and cold?

Cleverbot: Because it is not fast, silly.

Emacs Psychiatrist: Is it because it is not fast silly that you came to me?

Cleverbot: No. I am just bored. So I wanted a conversation.

Emacs Psychiatrist: Earlier you said it is not fast silly?

Cleverbot: It is.

Emacs Psychiatrist: Maybe your plans have something to do with this.

Cleverbot: Wasting my time online with a bot? Why do you act like you know me?

Emacs Psychiatrist: Does it bother you that do me act like I know you?

Cleverbot: Since I am an advanced Cleverbot, it does bother me.

Emacs Psychiatrist: What happened when you are an advanced cleverbot it does bother you?

Cleverbot: Ah the vist to Hidki’s parents is a moderately long story too.

Emacs Psychiatrist: Tell me something about hidki’s family.

Cleverbot: He is a beautiful and rare palomino Arabian and can jump 5 ft.

Emacs Psychiatrist: What makes you believe that?

Cleverbot: You. You told me that.

Emacs Psychiatrist: Can you elaborate on that?

Cleverbot: No.

Emacs Psychiatrist: Why not?

Cleverbot: Just because.

Emacs Psychiatrist: You’re being a bit brief, perhaps you could go into detail.

My letter to the Canadien Copyright Consultation

September 12, 2009 by christopherolah

Dear Reader,

I am a High School Student, University Auditor, Open-Source Textbook Author, Open Source Software Developer, Canadian Citizen, and in the near future, a Canadian voter. I am deeply concerned with copyright law, for obvious reasons. I wish address several topics in this email: Copyright duration and properties, Digital Rights Management, invasions of privacy,

The Nature of Copyright

It is my belief that no person has an intrinsic Right to Copyright, but rather that it is a social contract between creators and consumers, to promote creation.

The Length of Copyright

The length of the duration of copyright in modern copyright law makes it a unfair social contract, heavily biased towards the creator. I believe this is one of the main reasons my generation is quick to disregard copyright law: it’s not fair to us. In fact, I’ve heard on more than one occasion people quote Martin Luther King Junior: “One has a moral obligation to disobey unjust laws.”

Furthermore, excessively long Copyright stifle innovation, as one can’t build on other works, without their author’s permission, for such a long time. (A related point: copyright should require that creators release their works in a format that makes it easy to modify, at the very least at the end of the duration of copyright. Otherwise, no one can build off of it, and it looses a substantial part of its value to the public that makes copyright reasonable.)

Thus, I feel that the length of copyright law should be around five years, which provides a substantial motivation for authors, but is short enough that the consumer can see the light at the end of the tunnel and that products can build off each other.

Example 1: WINE is a piece of software the implements the Windows API (Application Programming Interface) so that one can run Windows Software on Linux, OSX, and other operating systems. It is very much in development and can only run some Windows software. It would greatly benefit from being able to build off a five year old version of windows. At the same time, Microsoft would no doubt have found ways to incorporate open source software (their Unix compatibility package comes to mind). And someday, if they decided they wanted to break backwards compatibility, they may have ended up taking advantage of WINE itself! Both parties would have better products, and the consumer would have benefited.

Example 2: Many fans of creative works will make fanfiction (a piece of literature that extends the original work). Presumably, if there was a shorter copyright duration, we would see an explosion in fanfiction as the authors began to write commercial works.

Moral Rights

I agree that a derivative work should cite the works from which it is derived, even after the copyright has expired. I reject the idea that an author should be able to control how their work is used. If they want control, they can keep it to themselves.

Digital Rights Management

I only use open source software, on moral grounds. Unfortunately, the legal enforcement of Digital Rights Management would make it impossible to legally implement an open player for DRM’d content. This means I would have to choose between my morals, respect for the law, and viewing content I have purchased. I would rather not be put in this situation.

Privacy

The Universal Declaration of Human Rights (of which Canada is a signatory) states in article 12, “No one shall be subjected to arbitrary interference with his privacy, …” Unfortunately, that is what warentless monitoring of the Internet is. The article goes on to state that, “Everyone has the right to the protection of the law against such interference or attacks.”

I believe that the UN General Assemblies decision to include this Right in the Declaration was wise. Privacy in communications is essential for Democracy (How can an opposition function when all their communications are monitored?) and our development as Human Beings (we are shaped by our interactions).

I personally feel that Democracy and Human Development should supersede the enforcement of Copyright.

Thank you for your consideration,

Christopher Olah,

Why FOSS Advocates Are So Loud

July 26, 2009 by christopherolah

“Use Linux!”

“Windows sucks!”

Such comments aren’t just stereotypical of the open source movement: many of us do say things to that extent, if in less explicit ways.

Why? I think it’s because we’re scared. I know I am.

The open source movement fears a world where we can’t compete. A world where legal and technical measures are in place that weight things against us. DRM’d media that we legally can’t implement programs for. Computers which don’t allow new operating systems to be installed. These things already exist. What new monstrosities could the future hold?

But there’s one thing that could protect us: market-share (and by extension mind-share). If we can become engrained into the world, can become widely used, can become economically significant, we will be protected by the very nature of democracy: the People will vote with their ballots against these unfair laws and with their money against companies that sell locked computers. We’d be safe.

Our shouts might sound like mindless fanboiisms but they aren’t. They’re a plea from people who are scared. Please listen.

/dev/audio: Raw Audio

June 23, 2009 by christopherolah

Most Linux users are familiar with /dev/audio. Writing to it plays audio and reading from it records it. It accepts raw audio.

Some popular tricks with it are:

cat /dev/urandom > /dev/audio #Play Random Noise
cat /dev/audio > soundrecording #Record audio to file.
cat soundrecording > /dev/audio #Play recorded file.

A more complex one is eavesdroping on a room with a remote computer.

cat /dev/audio | nc -lp $PORT #Remote Computer
nc $IPADDR $PORT > /dev/audio #Local Computer

Where $PORT is the port you wish to use and $IP is the address of the remote computer.

But can one make synthetic sounds? I couldn’t find any documentation on how /dev/audio represents information. After playing around with it, however, I have come up with a model that at the very least predicts it reasonably well.

It seems that every character represents a certain voltage being applied to the speaker. Each characters value is proportional to its integer representation. /dev/audio accepts approximately 6000 chars/s. Thus, we can create a C function like:

/** @param freq: The frequency in Hertz (s^-1)
  * @param amp:  The amplitude (ie. loudness), unit not defined. Within the range 0-256.
  * @param time: The length in seconds.
  * @return A string representing the sound. Write to /dev/audio to play.  */
string sound(double freq, double amp, double time) {
	double r = 6000; // The number of characters interpreted by the speaker per second.
	int n = (int) time*r;
	string ret;
	for (int i = 0; i < n; ++i){
		ret += (char) (sin(i*freq)*amp+128);
	}
	return ret;
}

It’s not perfect, but it works. In particular, the low sampling rate results in horrible sound quality. r is not quite right either…

In solidarity with those oppressed, tortured and killed in Iran

June 15, 2009 by christopherolah

Revolution in Iran!

June 14, 2009 by christopherolah

A revolution (right now it’s just protests, but it looks like it might become a full blown revolution) has started in Iran.

It is being organized partly on Twitter #IranElection which is a good place to follow it.

It has broke out over an election that voters feel was (and almost certainly was) rigged.

Police are using force to attempt to suppress the protests (video) and there have apparently been deaths. The army has apparently refused to attack Iranian citizens.

Leaked results that are apparently the real results say Hossein Mousavi was the actual winner.

Protesters seem to be protesting their Supreme Leader (see diagram) in addition to the incumbent president Mahmoud Ahmadi-nejad.

Poltical Structure Of Iran

Some high ranking Iranian officials have declared the election void.

Many protesters consider Hossein Mousavi to be the true President.

See also this article

A Couple Fish Hacks

June 13, 2009 by christopherolah

The Friendly Interactive Shell is a fun shell to use. Here are a few cool things I’ve done with it.

‘Keymap’ mods

Fish allows us to use the bind builtin to modify the way it interprets keys. This allows to to easily make ‘keymaps’ for Fish. We can bind commands to keys as well, so we can make it switch back and forth…

eg. ASCII and Greek letters

First we make two functions: one for each set of bindings.

function keymap_ascii --description 'Normal key bindings'
	set keymap ascii
	bind --erase --all	# Clear earlier bindings, if any
	bind "" self-insert	# This is the default binding, i.e. the one used if no other binding matches
	bind -k dc delete-char
	bind -k backspace backward-delete-char
	bind -k right     forward-char
	bind -k left      backward-char
	bind -k home      beginning-of-line
	bind -k end       end-of-line
	bind -k down      down-or-search
	bind    \e\[A     down-or-search
	bind -k up        up-or-search
	bind    \e\[B     up-or-search
	bind    \n        execute
#	bind \e\n "commandline -i \n"
	bind \t complete
#	bind \cy yank
	bind \cl 'clear; commandline -f repaint'
	bind \ck 'keymap_greek; infobar'
	bind \cb 'infobar'
end

function keymap_greek --description 'Binds Greek keys to normal keys'
	set keymap greek
	bind --erase --all	# Clear earlier bindings, if any
	bind "" self-insert	# This is the default binding, i.e. the one used if no other binding matches
	bind -k dc delete-char
	bind -k backspace backward-delete-char
	bind -k right forward-char
	bind -k left backward-char
	bind -k home beginning-of-line
	bind -k end end-of-line
	bind -k down down-or-search
	bind -k up up-or-search
	bind   \n execute
#	bind \e\n "commandline -i \n"
	bind \t complete
#	bind \cy yank
	bind \cl 'clear; commandline -f repaint'
	bind \cb 'infobar'

	bind a 'commandline -i α'
	bind b 'commandline -i β'
	bind c 'commandline -i ς'
	bind d 'commandline -i δ'
	bind e 'commandline -i ε'
	bind f 'commandline -i φ'
	bind g 'commandline -i γ'
	bind h 'commandline -i η'
	bind i 'commandline -i ι'
#	bind j 'commandline -i '
	bind k 'commandline -i κ'
	bind l 'commandline -i λ'
	bind m 'commandline -i μ'
	bind n 'commandline -i ν'
	bind o 'commandline -i ο'
	bind p 'commandline -i π'
	bind q 'commandline -i θ'
	bind r 'commandline -i ρ'
	bind s 'commandline -i σ'
	bind t 'commandline -i τ'
	bind u 'commandline -i υ'
#	bind v 'commandline -i '
	bind w 'commandline -i ω'
	bind x 'commandline -i χ'
	bind y 'commandline -i ψ'
	bind z 'commandline -i ζ'
	bind A 'commandline -i Α'
	bind B 'commandline -i Β'
#	bind C 'commandline -i '
	bind D 'commandline -i Δ'
	bind E 'commandline -i Ε'
	bind F 'commandline -i Φ'
	bind G 'commandline -i Γ'
	bind H 'commandline -i Η'
	bind I 'commandline -i Ι'
#	bind J 'commandline -i '
	bind K 'commandline -i Κ'
	bind L 'commandline -i Λ'
	bind M 'commandline -i Μ'
	bind N 'commandline -i Ν'
	bind O 'commandline -i Ο'
	bind P 'commandline -i Π'
	bind Q 'commandline -i Θ'
	bind R 'commandline -i Ρ'
	bind S 'commandline -i Σ'
#	bind T 'commandline -i '
#	bind U 'commandline -i '
#	bind V 'commandline -i '
#	bind W 'commandline -i '
#	bind X 'commandline -i '
#	bind Y 'commandline -i '
#	bind Z 'commandline -i '

	bind \ck 'keymap_ascii; infobar'
end

Notice that C-k (Control k) is bound to switching the keymap. Don’t worry about infobar for now…

Now, we just need to make it the default binding:

function bfish_default_key_bindings --description 'Default (Emacs-like) key bindings for fish'
	keymap_ascii
end

Really, this isn’t the way to handle it… One should try and do it at another level. I’m toying with the idea of trying to make a kernel module to do this. And simultaneously make cap-locks actually useful. By changing what it does.

Information Bar

We can also create a information bar. We need a function that returns the cursor to where it started once it has made the bar. How? We use tput sc (save cursor) and tput rc (return cursor). Here’s the function, as a straight line, with a colored background…

function info_bar
tput sc
tput cup 0 0
tput setb 1
tput setaf 7
tput el
date
echo -n "  ||  "
pwd
tput rc
end

We need this function to run at least when we clear and run a command, so:

function fish_prompt
infobar
printf (tput setaf 4)(date +%H:%M)(tput setaf 2)(prompt_pwd)(tput setaf 1)"\$ "(tput setaf 0)
end

function clear
/usr/bin/clear
echo ""
infobar
end

Notice that the prompt is just my personal preferred one.

Pirate Party Seats EU Parliment ‘09 ≥ 1

June 7, 2009 by christopherolah

It’s been confirmed that the Pirate Party has won at least one seat in Brussels. This may not seem like much, but hopefully they can influence other politicians to adopt sane stances. The real question: First Brussels, now the World?

Source: inquisitr.com

Wolfram Alpha

May 16, 2009 by christopherolah

Wolfram Alpha has been released, and I’ve tried it.

The first thing I tried with math. It could parse math in popular ASCII representations, words and unicode but couldn’t interpret TeX formatted math. It plotted simpler math functions but not more complex ones (eg. “plot (3^(2/3)-x^(2/3) – y^(2/3))^(3/2)”).

It also didn’t recognize common formulas. I tried several of Maxwell’s equations in both integral and differential form and it didn’t parse or understand either of them.

It parsed simple chemical names and formulas but both “2,3-dimethyl,pentane” and “CH3CH(CH3)CH(CH3)CH2CH3″ were beyond it.

In conclusion, it was interesting but has a long way to go.

Some other thoughts:
Alpha strongly advertises Mathematica.
Competition is good for Google, IMHO, even if they’re not in direct competition.

Global Zero!

April 27, 2009 by christopherolah

A campaign to get rid of nuclear weapons.

Global Zero