The power of persuasion

Nothing shakes me. I’ve solved life threatening problems, third order derivatives, moral choice dilemmas, painful embarrassing moments, all sorts of things that rattle mankind. I was tired and normally I always help out in the kitchen. Patty and I enjoy working together in the kitchen as a team. This night I was out of it. I’ve gotten a cold and it’s zapped me good this time. Anyhow, Patty asked if I wanted to cook the steaks on the grill or do the side dishes. I opted for the side dishes. I didn’t want to stand outside, I just wasn’t up to it. And, last time I did the steaks I burnt them. So I found some asparagus and a single family box of 5-minute Uncle Ben’s Wild Rice Mix.

I didn’t start on my task right away and Patty kind of prompted my start with, “You need to do the rice now.” I guess I could have done the steaks because it was probably 75 outside. She had gone to lunch with her girlfriends and she had dressed nice. She usually wears black dress pants and some well-fitting knit top. She must have come in at some point and changed her top because she was hot. I had started the pan with water and was reading the box of seasoned rice. I looked up at her and she had on a really ratty-looking tank top thing that exposed her shoulders and was too big. I could see her black lacy dress bra straps and a good portion of her breasts in the arms of this Wal-Mart summer top. It must have caught me off guard because at that very moment I dumped Uncle Ben in about a 50 sq. foot chaotic dispersion. Needless to say, I think boobs have some calculable and constant force that can ruin a man’s willpower. Some function like the product of two breasts divided by some viewable distance and multiplied by a constant factor of love.

We did have another box of rice in the pantry.

Posted in General, Uncategorized | Comments Off

George Antheil – Early 20th Century Composer

I’ve always been interested in music and recently I’ve been studying early twentieth century composers that employed music based on the 12-tone technique (chromatic) best described by Arnold Schoenberg. Most of these composers are labeled “avant garde”. Their music sounds weird to my ear but I enjoy just listening to it. One of my favorite composers that I’ve recently found is George Antheil. I am a member of violinist.com and Mark Fewer (violinist) had made a note about an album that he did with John Novacek (pianist) where they played George Antheil violin sonatas. Here’s a link describing the album.

Since I now have the album, I’ve read a little more about George and then realized that he wrote a grand symphonic piece called “Ballet Mecanique” that was performed at Carnegie Hall in 1927. This music uses 6 pianos, bells, whistles, sirens, airplane propellers, in addition to the normal orchestra set of instruments. This piece was produced by Paul Lehrman, midi expert in the late 1990′s because the full symphonic production (scores) were never realized until now. This music makes you want to listen. It’s not pretty. In fact it’s brutal sometimes. This music is intense but enjoyable. You can listen to clips and learn more about George Antheil here.

Posted in Music | Leave a comment

Cora Emilia Lives!

This gallery contains 2 photos.

I am so excited to hear my violin Cora Emilia sing again. I finished her tonight and played her some. I will have to say it was touch and go tonight fitting the bridge and setting the sound post. Sound … Continue reading

More Galleries | Leave a comment

Finishing and Touchup

Cora Emilia is now being finished. I got a MicroMesh finishing system and I love this stuff. It’s like wet or dry paper but it’s cloth and you can wash it out when finished. I’m finishing the violin with the 1800 MicroMesh and then applying the varnish with a rag. Here are some shots of Cora Emilia on my table. I’ll polish the high gloss to more of a satin finish using the very fine cloth after my last rub of varnish. I’ve done some touch up work with some color and I’ll talk to that after the pics.

The violin neck has been repaired in the past and I think they used epoxy. They actually replaced some of the spruce on the top near the neck using the epoxy. I left the glue on the top and in the spruce because I fear that I would seriously damage the top trying to dig out the epoxy. I’ll leave that for a true professional maybe in the future. For now I did remove some of the glue on the neck and sides. Here’s a picture where you can see that I’m having to build up varnish with color (burnt sienna) after I took most of the old varnish off scraping the glue. I used amber shellac on the bare wood. I didn’t want any color or stain to penetrate the wood. This area is NOT finished.

Posted in Luthier | Leave a comment

Hide Glue and Spool Clamps

I found the greatest store today. I was able to get granulated hide glue for my violin today. Also, I found an article online on how to make my own spool clamps. As soon as I removed the back of my old violin, everything is falling apart at the “hide-glue” seams. So, I’ve been gluing everything back in place. Here’s some pics. Also, notice the homegrown glue pot I made from a measuring cup and some various pliers. I’ll show the spool clamps first. I used my wife’s miter box to cut a 1-1/4″ dowel rod into 24 – 3/4″ pieces. Each piece gets a sticky cork surface to protect the violin. 24 -1/4-20 bolts and wing nuts are also needed. The holes are offset so that you have more area on the violin.

The glue was somewhat difficult to use, but once I got the hang of it, I really like it. It’s really sticky, tacks fast, and also shrinks as it cures. That makes for nice tight joints. Here’s my homemade glue pot I made from a metal measuring cup. My wife has more so she hesitated but then gave in. I was able to destroy it in the process of making my glue reservoir. I really like the glue. 1 teaspoon of granules and 2 oz. of water to start.

Posted in Luthier | Leave a comment

Violine prope Oenipontum 1794

Cora Emilia came yesterday. She is a perfect violin that was born 1794 in Innsbruck Austria to a loving family that trained and finished her to be part of a cultured and well educated society. She’s been resting peacefully after a death due to negligence, sordid use, and lack of care. I can’t be sure how long she’s been dead but her passing was surely due to mistreatment and abuse. She’s travelled the world at some time and today she resides with me here in Raleigh, North Carolina on the east coast of these United States.

She will enjoy a ressurection in the coming year. Her voice will be heard again 2012. She will sing a Cantabile by the hand of Paganini. A rush of music will fill her old pores and she’ll tingle with delight. This is my dream for her to sing to an audience of classical-loving music patrons here in Raleigh. She may be old, but they will love Cora Emilia again.

Posted in Luthier | Leave a comment

Scala Unit Testing

For Java there’s JUnit and for Scala there’s Scalatest. As soon as I started learning Scala, I had to find a testing framework for unit testing. Unit testing should be easy and Scalatest is easy to set up and start using in Eclipse. It will use JUnit4 to actually run the tests using Scalatest as a wrapper.

To use Scalatest you need to add the scalatest JAR and also the JUnit4 library as shown here:
You can get the scalatest JAR from the Scalatest site. The JUnit4 library is part of your Eclipse installation now. Once you’ve made these available on your CLASSPATH, you’re ready to start testing.

What’s really nice about Scalatest is the language and the semantics of how your tests are called or verified. First, let me show you two Scala modules, one is a Scala object for Currency (the token of exchange) and the other a class to represent a particular sum of Money in a particular currency. Those listings are shown here:

Currency.scala

/**
 * Copyright 2011 Cape Henry Technologies Inc.
 *
 * Licensed under the Apache License, Version 2.0
 * (the "License"); You may not use this file except
 * in compliance with the License. You may obtain a
 * copy of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the
 * License.
 *
 */

package com.cht.model.financial

object Currency {

	var currencyCode = "USD"

	val codes = List("AED","AFN","ALL","AMD","AOA","ARS","AUD","AWG","AZN",
						"BAM","BBD","BDT","BGN","BHD","BIF","BMD","BND","BOB",
						"BOV","BRL","BSD","BTN","BWP","BYR","BZD","CAD","CDF",
						"CHE","CHF","CHW","CLF","CLP","CNY","COP","COU","CRC",
						"CUC","CUP","CVE","CZK","DJF","DKK","DOP","DZD","EGP",
						"ERN","ETB","EUR","FJD","FKP","GBP","GEL","GHS","GIP",
						"GMD","GNF","GTQ","GYD","HKD","HNL","HRK","HTG","HUF",
						"IDR","ILS","INR","ISK","JMD","JOD","JPY","KES","KGS",
						"KHR","KMF","KRW","KWD","KYD","KZT","LAK","LBP","LKR",
						"LRD","LSL","LTL","LVL","LYD","MAD","MDL","MDA","MDL",
						"MGA","MKD","MMK","MNT","MOP","MRO","MUR","MVR","MWK",
						"MXN","MXV","MYR","MZN","NAD","NGN","NIO","NOK","NPR",
						"NZD","OMR","PAB","PEN","PGK","PHP","PKR","PLN","PYG",
						"QAR","RON","RSD","RUB","RWF","SAR","SBD","SCR","SDG",
						"SEK","SGD","SHP","SLL","SOS","SRD","SSP","STD","SYP",
						"SZL","THB","TJS","TMT","TND","TOP","TRY","TTD","TWD",
						"TZS","UAH","UGX","USD","USN","USS","UYI","UYU","UZS",
						"VEF","VND","VUV","WST","XAF","XAG","XAU","XBA","XBB",
						"XBC","XBD","XCD","XDR","XFU","XOF","XPD","XPF","XPT",
						"XTS","XXX","YER","ZAR","ZMK","ZWL")

	def validateCurrencyCode(isoCode:String):Boolean = {
		val iter = codes.toIterator
		var retVal = false
		for (code <- iter)
		  if (code == isoCode)
		    retVal = true
		return retVal
	}
}

Money.scala

/**
 * Copyright 2011 Cape Henry Technologies Inc.
 *
 * Licensed under the Apache License, Version 2.0
 * (the "License"); You may not use this file except
 * in compliance with the License. You may obtain a
 * copy of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
 * either express or implied. See the License for the specific
 * language governing permissions and limitations under the
 * License.
 *
 */

package com.cht.model.financial
import com.cht.constant.FinancialConstants

/**
 * Scala class representation of Money. Currency of exchange is validated and set.
 * Transactions between Monies of different currencies are NOT allowed.
 */
class Money (repr:String, format:Int, dp:Int, currCode: String) {

  var currencyCode:String = currCode // default
  var allNumericAmount:String = "" // e.g. "234525" = $2,345.25
  var decimalAmount:String = "" // e.g. "2345.25"
  var wholeNumberPortion:Int = 0 // e.g. 2345 (taxes maybe? round up?)
  var decimalPortion:Int = 0 // e.g. 25 however if 2 would be represented by String as "02"
  var displayAmount:String = "" // e.g. $2,345.25 or ($345.75) negative
  var digitPrecision:Int = 2 // default, but could be 5 e.g. for interest rate calculations
  var sign:String = "+" // default

  if (!Currency.validateCurrencyCode(currCode))
    throw new IllegalArgumentException("Currency code is not one of the ISO-4217 accepted values.")

  if (dp != 2)
    digitPrecision = dp // override or change digitPrecision if needed

  var lessDp = 0 

  if (format == FinancialConstants.NUMERIC_ONLY) {
    allNumericAmount = repr
    lessDp = repr.length - dp
    decimalPortion = repr.substring(lessDp, lessDp + dp).toInt
  }

  if (format == FinancialConstants.NUMERIC_DEC) {
    decimalAmount = repr
    lessDp = repr.length - dp - 1
    decimalPortion = repr.substring(lessDp + 1, lessDp + dp + 1).toInt
  }

  wholeNumberPortion = repr.substring(0,lessDp).toInt

  displayAmount = "$" + wholeNumberPortion + "." + decimalPortion // fix comma on thousands later
}

Now for the fun stuff, the testing. The test module is not complete but it will show you some of the really cool features of Scalatest. I've highlighted a few lines with the nice test language semantics. Notice that the "if" method arguments are Strings that you create. These Strings will show in JUnit for your tests. Here's some test code.

package com.cht.model.financial

import org.scalatest.junit.JUnitRunner
import org.junit.runner.RunWith
import org.scalatest.matchers.ShouldMatchers
import org.scalatest.Spec
import com.cht.constant._

@RunWith(classOf[JUnitRunner])
class PackageTests extends Spec with ShouldMatchers {
  describe("Money:") {
    it("should create and display $2345.56 from 234556 input") {
        val money = new Money("234556", FinancialConstants.NUMERIC_ONLY, 2, "USD")
        money.displayAmount should be ("$2345.56")

    }
  }
  describe("Money:") {
    it("should create and display $350.75 from 350.75 input") {
        val money = new Money ("350.75", FinancialConstants.NUMERIC_DEC, 2, "USD")
        money.displayAmount should be ("$350.75")

    }
  }

  describe("Money:") {
    it("should validate ZZZ as an unacceptable ISO-4217 currency code, throw IllegalArgumentException") {
    	val thrown = intercept[java.lang.IllegalArgumentException] {
    		val money = new Money ("350.75", FinancialConstants.NUMERIC_DEC, 2, "ZZZ")
    	}
    	assert(thrown.getMessage === "Currency code is not one of the ISO-4217 accepted values.")
    }
  }

  describe("Currency:") {
    it("should validate EUR as an acceptable ISO-4217 currency code") {
    	Currency.validateCurrencyCode("EUR") should be (true)
    }
  }

  describe("Currency:") {
    it("should validate ZWL as an acceptable ISO-4217 currency code") {
    	Currency.validateCurrencyCode("ZWL") should be (true)
    }
  }

  describe("Currency:") {
    it("should validate LBP as an acceptable ISO-4217 currency code") {
    	Currency.validateCurrencyCode("LBP") should be (true)
    }
  }

  describe("Currency:") {
    it("should validate ABC as an unacceptable ISO-4217 currency code") {
    	val thrown = intercept[org.scalatest.TestFailedException] {
    		Currency.validateCurrencyCode("ABC") should be (true)
    	}
    	assert(thrown.getMessage === "false was not true")
    }
  }

}
Posted in Scala | Leave a comment

Scala Domain Library

I’ve been learning Scala and I really like it. I coded in C for a long time and when I moved to Java, I loved Java because of the Javadoc and also because of early binding and how that was used in the different IDE’s. I used Borland’s JBuilder 10 for quite a while until I switched to Eclipse early on. Scala works with my Eclipse IDE and I’m also able to use Textmate and the Scala interpreter in a terminal. Scala is clean and concise. It requires less formality and less code overall. It’s object oriented but it’s also great for functional programming. I’ve thoroughly enjoyed Scala and I’m working now on an accounting program for my business and I intend to use Scala for my domain library.

The following code module is a Scala class for a Person.

							/**
							 * Copyright 2011 Cape Henry Technologies Inc.
							 *
							 * Licensed under the Apache License, Version 2.0
							 * (the "License"); You may not use this file except
							 * in compliance with the License. You may obtain a
							 * copy of the License at http://www.apache.org/licenses/LICENSE-2.0
							 *
							 * Unless required by applicable law or agreed to in writing,
							 * software distributed under the License is distributed on an
							 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
							 * either express or implied. See the License for the specific
							 * language governing permissions and limitations under the
							 * License.
							 *
							 */

							package com.cht.model.common

							/**
							 * Scala class to represent any person
							 */
							class Person (pre:String, first:String, middle:List[String],last:String,
							    suff:String,accred:List[String]) {

							    /**
							     * name prefix e.g. Mr. Mrs. Ms.
							     */
								val prefix = pre

								/**
								 * first name
								 */
								val firstName = first

								/**
								 * List of middle names
								 */
								val middleName = middle

								/**
								 * last name
								 */
								val lastName = last

								/**
								 * name suffix e.g. III, Jr.
								 */
								val suffix = suff

								/**
								 * List of accreditations e.g. DDS, DR, PHD
								 */
								val accreditation = accred

								/**
								 * overridden toString method
								 */
								override def toString:String = {
								  var retVal = ""

								  if (prefix != null && prefix.length > 1)
								    retVal = retVal + prefix
								  if (firstName != null && firstName.length > 1)
								    if (!retVal.equals(""))
								    	retVal = retVal + " " + firstName
								    	else
								    	  retVal = retVal + firstName
								  if (middleName != null) {
								    val i = middleName.toIterator
								    for (name <- i)
								      retVal = retVal + " " + name
								  }
								  if (lastName != null && lastName.length > 1)
								    retVal = retVal + " " + lastName
								  if (suffix != null & suffix.length > 1 )
								    retVal = retVal + " " + suffix
								  if (accreditation != null) {
								    val j = accreditation.toIterator
								    var first = 0
								    for (cred <- j) {
								      if (first == 0)
								      retVal = retVal + " " + cred
								      else
								        retVal = retVal + "," + cred
								    first = first + 1
								    }
								  }
								    return retVal
								} 

							}
						
Posted in Scala | Leave a comment

The Hunger Games, by Suzanne Collins

Hunger Games coverWow! What a book! I was hesitant about a new book trilogy that was put out by Scholastic. The company at http://www.scholastic.com is a publisher for young students. I kind of thought the book would be a little childish. Well, I’m pleasantly surprised. I’m at chapter 16 in the first book now and I can’t put it down. My wife Patty just went through surgery today and it’s 10:45 PM, I’ve been reading in the waiting room for hours, and now I’m on the macbook writing about it. I love the story because it makes you think. I don’t want to give away any details so I’ll stop here. I do recommend the book for anyone that’s looking for a new book to read and wants something with action, deep thought, and strong imagery. This book is my favorite this year. Well, the Girl with the Dragon Tattoo got my attention … We’ll see when I’ve finished the third Hunger Games book.

Posted in General | Leave a comment

You can teach a cat to brush his teeth

We have two cats but Sprout is the smaller of the two brothers and he’s kind of my buddy where Patty favors Waffles. Anyhow, Sprout always gets on the counter when I’m getting ready in the morning to go to work. This morning he’s looking at me funny when I start up the ultra-sonic toothbrush, so what do I do? I got the one he has been chewing on. So here I am brushing my teeth and I’m holding the plain toothbrush and he’s gnawing on it again. It’s so funny because I think he thinks that he’s brushing his teeth too.

Posted in General | Leave a comment