Cora Emilia Lives!

My Old Violin

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 post setting would be a job for someone with lots of patience. I’m not totally pleased with it because it was really tough to get it to fit perfectly. It’s close but not perfect. The violin sure does sound good though.

This is what she looked like when I got her.

I’m going to play it this week and hopefully she will begin to sound even better as the wood changes some from the new vibrations. I’m not sure about the history of this violin but I do know that it looked like they took it to the local gas station for repairs. I hope that I’ve set it on a path of better care now for the future.

Posted in General | 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 General | 1 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 General | 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 General | 1 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 | 4 Comments

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 | 2 Comments

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

I thought it tasted funny

I keep a toothbrush, an archaic one, in a small container on my side of the vanity for special purposes. Say for example I am running late and don’t have time to wait for the four beeps from my ultra-modern post-wagon-dentist ultrasonic teeth cleaning “system” device and I just need to get out of the house quickly. Well, the past week I’ve been working about an hour and a half east of where I normally work with outside vendors and I was running behind a couple of days. I used the prehistoric implement to brush my teeth quickly and something told me it didn’t taste quite right. Something was off.

I know the bristles are all worn out and I always notice that. Did Patty use it to clean between the stove-top and the counter? Maybe Aaron cleaned his keyboard with it again. It really weighs less than my ultrasonic. Something was different. I felt different because I was rushed. Did it taste like cat breath?

This morning I slept in because I stayed up really late working on a government contract I have and Patty went to Lake Gaston with our daughter Brittany to visit the caterer for her wedding. I like beef, chicken, or seafood so my man-thoughts aren’t as important as momma’s attention today. Anyhow, I’m sitting in Patty’s chair at the vanity taking my daily skittles (most call medicine) and Sprout, one of our cats, is gnawing on my toothbrush. He’s using it like a baby would use a teething ring. The first question hits me, “how long has he been doing that?”

Posted in General | Leave a comment

Job hunting or job hiding

I think my least favorite thing to do is hunt for a job. In my profession, it’s almost impossible to find a corporate job without going through a recruiter. And, I have to say that I am not fond of recruiters. Let me paint a little scenario for you here. We’ll make believe that this individual is very talented and he’s worked for a very large corporation, called IGM, for the last 15 years.

Bill’s now decided that he’s in the market for a new and exciting “opportunity” only because another company Aricle has announced that it’s going buy IGM. Bill has a job until the sale goes through but he knows that his time is short. Other developers have come and gone at IGM and Bill knows they all frequent Jacks.com and Freakster.com for job opportunities.

Bill finishes his supper the first night of the buyout news and starts to work on his resume’. He’s amazed at the experience he’s gathered and he didn’t realize that his skillset is quite marketable. Once he gets the resume’ completed he asks his wife to give her opinion. She has some comments and he agrees, revises the document, and now he’s off first to Freakster to register his “desire” for a job.

He registers and uploads his resume’ to Freakster and Jacks. He specifically checks the little box that he’s not willing to travel and he’s not open to relocation positions. We jump to the next morning and his cell rings before he even gets to work. “Ha-low Mr. Bill, my name is Humma-da-humma-da Keh-da-beh Phlegm Hechkkkkkk from Humma-de-diddle-doh Technologeeeeze. Mr. Bill, I have Java opportunity for you.” Bill replies, “You are who? And, you work for who? I didn’t understand a word that you just said.” Bill hangs up. He notices that the number is 609-237-9999. He looks up the area code on Google and it’s Trenton NJ. Bill will come to learn that Trenton has the highest per capita of foreign technical recruiters in the world today.

By the end of the week, Bill’s so sick of answering calls from recruiters that can’t speak English that he’s ready to scream. My experience is and always has been that when you upload your resume’ to Dice or Monster or you change an acronym or keyword, be prepared for the calls. Also, once you find that dream job, remove your curriculum vitae from Dice and Monster. Make like a secret agent and remove all traces of land-lines, cell phones, pagers, etc. from the internet.

Bill finally found another good job and he still used a recruiting firm to get that job. The key to finding the best local position is to use a local reputable recruiting firm. And, a recruiting firm that speaks English. You need to communicate your intentions clearly to the recruiter so that they match you to the employer with the best position that suits your needs.

My best advice; find a good job and hide from the recruiters for a while.

Posted in Career | Comments Off