Saturday, 13 February 2010

House progress

I had intended to begin documenting the progress on the house months ago but it has seemed sufficiently slow that there seemed little point. Now after months of permits, adjusting plans to approximate the budget, and waiting, things are moving forward. Friends are asking so I've gotten to work.

The house is a Royal Barry Wills Cape build in 1947. We are renovating according to plans produced by Tim Cronin architect. As contractor we chose Andrzej Bolalek.

The latest development has been the putting the windows into the second floor (pictures).

Posted by james at 6:36 PM in House rennovation

Friday, 18 December 2009

The Delian Problem

One of the great geometry problems of antiquity is doubling of the cube (using ruler and compass). This is equivalent to extracting the cube root of two. While doing so is not possible I noticed the following (non ruler and compass construction). If one has an L shaped junction of two hallways, one 1 meter wide and the other W meters wide, then the longest board (red) that passes the bend involves extracting a cube root:

L = W / sinϑ + 1 / cosϑ
so that the derivative
L' = -W cosϑ / (sinϑ)2 + sinϑ/ (cosϑ)2 = ( -W (cosϑ)3 + (cosϑ)3)/ (sinϑ cosϑ)2
which, noting that for 0 < ϑ < Π has 0 < sin ϑ , cos ϑ < 1, is zero when
W1/3 = tanϑ = opposite /adjacent
at the point where the board touches the two walls and the corner.
Posted by james at 10:15 PM in Uncategorised

Sunday, 8 November 2009

Quantum Factoring Algorithm

I was just reading about the LCH. It seems to me that the following experiment might be of use: choose a large random number, if it is a factor of a large composite of interest stop, otherwise start the LHC.
Posted by james at 9:34 PM in Tools and Programming

Monday, 12 October 2009

Gentoo versus Ubuntu

At some point, I decided to give Ubuntu Linux a try after several years of using Gentoo. After four months, I ended switching back because I missed the handling of daemons (rc-status), java (java-config), and virtual services. The point of this post is to Ubuntu folks: steal these capabilities from gentoo.
Posted by james at 10:36 PM in Tools and Programming

Monday, 14 September 2009

Drop versus reject

Contemplating the firewall configuration of my home machine, it occurs to me that rejecting packets is likely more secure than dropping them (as to render more difficult IP spoofing).
Posted by james at 10:22 PM in Tools and Programming

Sunday, 23 August 2009

The house building process

After hitting our first house renovation delay due to the fact that the existing foundation is three inches too close the the neighbor, I went hunting for a house renovation dependency or Gantt chart... nothing that would have helped me save the time lost.

Here is what I have learned thus far:

(Click image to enlarge)

Posted by james at 12:02 PM in House rennovation

Thursday, 20 August 2009

Boolean Parser Combinator in Scala

The title says it all (sort of).
package net.unsyntax.learning.parsercombinator;

import scala.util.parsing.combinator.lexical.StdLexical
import scala.util.parsing.combinator.syntactical.StdTokenParsers

class BooleanParserCombinator(f:String => Boolean) extends StdTokenParsers {
  type Tokens = StdLexical;
  
  val lexical = new StdLexical();
  lexical.delimiters ++= List("(", ")", "&", "|", "!");
  lazy val expr:Parser[Boolean] = flag*("|" ^^^ {(x: Boolean, y: Boolean) => x || y} |
    "&" ^^^ {(x: Boolean, y: Boolean) => x && y}); 
  lazy val flag:Parser[Boolean] = ("(" ~> expr <~ ")" | ident ^^ (f(_)) |
    "!" ~> ident ^^ (!f(_)) | "!" ~> expr ^^ {(x:Boolean) => !x});
  
  def apply(in:String):Boolean = {
    return expr(new lexical.Scanner(in)).get;
  }
}
The test program:

package net.unsyntax.learning.parsercombinator

import scala.collection.immutable.ListSet;

object BooleanParserCombinatorTest {
	val tests = List("true", "false", "!true", "!false",
          "true&false", "true|false", "true|(true&false)",
          "true&(true|false)", "false|!false");

	val eval = new BooleanParserCombinator(_.toBoolean).apply(_);
	def main(args: Array[String]) {
	  
	  for (test <- tests) {
	    println (test +"="+eval(test));
	  }
   	}
}
yields
$ java net.unsyntax.learning.parsercombinator.BooleanParserCombinatorTest
true=true
false=false
!true=false
!false=true
true&false=false
true|false=true
true|(true&false)=true
true&(true|false)=true
false|!false=true
$ 
Posted by james at 10:09 PM in Tools and Programming

Monday, 17 August 2009

The Swiss Menace

Having actually used both health care systems, I have to agree with Krugman.
Posted by james at 10:09 PM in Commentary and Observations

Playing with scala

$ scala
Welcome to Scala version 2.7.3final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_14).
Type in expressions to have them evaluated.
Type :help for more information.

scala> def factorial (x:Double):Double = if (x == 0) 1 else x*factorial(x-1);
factorial: (Double)Double

scala> def exp(y:Double):Double = (0.0 /: 1.to(20).map (x => Math.pow(x,y)/factorial(x)))(_+_)
exp: (Double)Double

scala> exp(1);
res0: Double = 2.7182818284590455

scala>
Posted by james at 9:24 PM in Tools and Programming

Saturday, 15 August 2009

And we're back....

The server made is successfully across the ocean and seemed to deal with the power change without difficulty. I gave up on my Ubuntu experiment and switched back to Gentoo. Now I just have to figure out how to recover my photo tags, which were somehow lost during the distribution swap, and all will be well.
Posted by james at 8:18 PM in Uncategorised

Tuesday, 12 May 2009

Troubling Banner Ads

I keep getting banner ads about IQ. Is anybody else troubled by the following sequence:
Posted by james at 1:35 PM in Commentary and Observations

Tuesday, 17 February 2009

Delicious Login

For some reason, perhaps security, the fine folks at delicious set the autocomplete attribute for the login page to "off" thus disabling the firefox password manager. It drives me loopy. Grease Monkey to the rescue!


// ==UserScript==
// @name           Delicious Login
// @namespace      http://unsyntax.net/
// @description    Enable autologin with delicious
// @include        https://secure.delicious.com/login*
// ==/UserScript==

(function () {
    var inputs=document.getElementsByTagName("input");    
    for (var i=0; i < inputs.length; i++) {
	if (inputs.item(i).getAttribute("autocomplete")) {
	    inputs.item(i).removeAttribute("autocomplete");
	}
    }    
})()
Posted by james at 7:15 PM in Tools and Programming

Thursday, 20 November 2008

IPv6 Yikes

I Just noticed my local internet provider has started giving me an IPv6 address, along with an IPv4 address, over DHCP. Unfortunately, iptables on my Linux machine does not address filtering of IPv6, only of v4. To filter v6 one needs ip6tables (and to start and configure it correctly). Whoops.

I wonder if this could be combinded with DHCP spoofing as a means to bypass firewalls.

Posted by james at 8:38 PM in Tools and Programming

Wednesday, 19 November 2008

Semantic Digital Signatures

A shameless plug for issues that have occupied my (and my coauthors) thoughts as of late.

We discuss the need of addressing, in a uniform way, digital signatures with rich semantics, for enabling increased automation of signature processing. We present a scheme for combining digital signatures with the formal and extensible semantics of the Semantic Web, as a standard layer in applications using digital signatures. We introduce several constructions and processes towards realizing this end, a new class of attack against semantically enabled applications, and measures of avoiding this attack class. Finally, we simplify a few existing processes that use digital signatures by expressing them in terms of semantic signatures.
By: Daniela Bourges-Waldegg, Christian Hoertnagl, James Riordan

Comments especially welcome.

Posted by james at 9:47 PM in Tools and Programming

Thursday, 30 October 2008

An open letter to the Swiss concerning driving on ice and snow

First, let me thank you for allowing me to live in your country; I am happy here. My gratitude makes me want to contribute to the society. One of the areas that I feel I can most usefully is in the matter of driving and road safety. I am not a particularly skilled driver. This lack of skill places me in the same category as most drivers on the road. Realizing that I suffer a lack of skill, and trying to adjust for it, seems to be sadly unusual. I thought maybe I could share some observations about being a safe driver (in the snow) despite a lack of basic driving skill.

The first principle of driving on ice or snow is merely realizing that you are driving on ice or snow. You are not going to be able to stop or steer as responsively as you would be able to otherwise; allow for it. Specifically, drive a bit more slowly, especially before turns, and cut down on the insanely aggressive tail gating. Please.

The next principle follows directly from basic physics:

  1. An object at rest, such as a tree, tends to stay at rest.
  2. An object in motion, such as a moving car, tends to stay in motion.
  3. An object in motion being driven by a person with oatmeal in place of a brain, such as a Porsche Cayenne, tends to run into other objects in motion or objects at rest.

As such, even if you allow for problems when driving, keep in mind most of the people do not. You have to allow not only for your own problems but for those of all the oatmeal brained clowns in your vicinity. Twelve years of driving here suggests this is a rather large group. It seem correlated, but not restricted, to license plates beginning with "AG". I am not sure why.

Next, it is far easier to avoid a problem than to get out of one. This one is deceptively succinct yet important so I will add it again: it is far easier to avoid a problem than to get out of one. Really.

With these three principles in mind, everything else is a detail. Here are a few of them:

  • Temperature decreases with altitude. This makes going up and down hills doubly dangerous.
  • Bridges do not have the heat capacity of the ground. Even if the road is not icy, be careful when crossing a bridge.
  • If you have to get out of your car, keep in mind that although you may have the right of way as a pedestrian it doesn't really matter if you end up in a hospital defending it.

Here are two other links: one and two.

Posted by james at 11:49 PM in Commentary and Observations