Monday, December 21, 2009

Capehart Radio Restoration: Part 1


I purchased my 1942 Capehart Panamuse at the end of August and have yet to really do anything besides break one of the expensive power amplifier tubes. I've decided to change that this week, however, and I ordered the first set of replacement components necessary to make it run.

I'm starting on the power amplifier first, which is going to require a total of 18 capacitors to replace. I'm having to construct an equivalent capacitor out of two smaller ones for a value that wasn't readily available. Unfortunately, several of the vacuum tubes have leaked vacuum (evidence of internal corrosion on parts that are supposed to be nice and shiny) so I'll most likely be replacing all of them too. It'll be around $250 to repair the amplifier, and probably about the same to repair the tuner section. I'm still on the fence between repairing the phonograph and replacing it with a retrofitted touchscreen of some kind to play Internet radio. We'll see.

Thursday, November 26, 2009

Crazy career move?

Opinions on: would it be worthwhile to get an electrical engineering degree?

I'll like IT for a while, but it's heavily age-biased against "old people" and by the time you're hitting 35 you're definitely "old" for IT. I don't want to end up forced out because I get too slow and I think I'd rather die than be actively willing to stay ahead of the changing tech curve at that age since I tried to get away from tech for a few years before already.

But it got me thinking: there does not exist a schematic for the tuner portion of my 1942 Capehart Panamuse radio cabinet that I bought from Craigslist. If something is broken in there, short of swapping out every swappable part blindly there's probably nobody who knows a better way to do it.

The schematic might be gone now, but the idea got me thinking: there's nobody who knows how to work on this stuff because it's been succeeded by better-in-every-way integrated circuits and people stopped learning how to work on it. But, it is possible to learn how: the physics are still there. They might even be better now. Just, nobody wants to.

I think that's when I decided what I might do for College: Round 2. I miss learning interesting things (how to do X in SQL Management Studio 2008, or set up mail routing between two Exchange servers, does not count.) I rather enjoy the troubleshooting aspect of working on the old radios and stuff, am decent at soldering, and will probably get better at both with practice. So I was thinking, maybe, I could go for electrical engineering.

UW has an EE program, and I'd do it super-part-time (1-2 classes a semester) and learn about how the radio stuff works. And as I get good at it, I open a business restoring radios. Through the Internet, if I'm any good at it, I could become "the guy" who does that in the country. Or, I find something else awesome and engaging and I go do that. Either way it would be a bit of an upgrade.

Wednesday, October 21, 2009

My computer let go of the balloon.

I purchased an Acer around two years ago, and it's been an "okay" computer. I originally purchased it with a 2-Year Geek Squad warranty for hardware; this came in handy around 15 months after purchase when it needed a new motherboard and graphics card due to a power surge. I originally skimped, thinking "there's no way I'd keep a computer more than two years!" thinking back to my time in high school and early college where I (who knows how) had far too much disposable income and built a relatively cutting-edge computer about every year.
I came home from work today, unlocked my Windows 7 PC, and began catching up on the day's Internet happenings. A few sentences into a Google Chat conversation, there was a "tick" and the screen on my machine went blank. I hit the reset button figuring the noise was a hard-drive retrack indicating the system had crashed but the blank screen appeared after POST, and my apartment started to smell really, really bad. Kind of like it was filling with magic smoke, the type that powers all electronics.

I quickly powered off the computer and called the Geek Squad: it turns out my warranty expired yesterday. Yeah. Your heard me.

I really have no idea what happened. The explosion and resulting fire happened around the header for my front-panel USB ports but these have not had anything plugged into them for almost a year, did not have anything plugged into them at the time of the incident, and had not been disturbed since the motherboard was replaced about 9 months ago.


I'm just glad I've been keeping my PC off lately when it isn't in use; that's a pretty serious amount of char on the board and the metal case. I'd really like to know why this all happened, it was literally out of nowhere.

The particular computer in question is an Acer Aspire M5630 desktop computer, stock with 3GB of RAM, a 500GB hard drive as two 250GB partitions, an ATI Radeon 2400HD video card, onboard gigabit Ethernet, DVD Burner, and slick front-panel media reader. I really don't know what to say about the quality control on this one, it seems an awfully odd mode of failure and kind of scary.

Tuesday, October 20, 2009

Adding Custom Field Multi-Select to Bugzilla 3.4.2


I administrate a Bugzilla installation used by the software-development arm of our company to track their progress. I never touched it before being given the task of upgrading a 2.14 installation to 3.4.2.

The previous maintainer manually added fields to the database, which were carried forward but not compatible with the new Custom Fields fuctionality in the latest version of Bugzilla. All the data was still available if you manually entered a query for it but it wasn't available to show up anywhere, and the fields themselves were hidden.

In order to correct this issue, I created a new Custom Field and called it cf_target_milestone, established the legal values for the field and migrated the old data forward:

UPDATE bugs SET cf_target_milestone = target_milestone;

This populated the new column in the table with all the old data. Now, we have the data in place, we needed to add a way to search on it. A Bugzilla newsgroup posting has some steps towards that. I added a block just below the other multiselect fields in template/en/default/search/form.html.tmpl, around line 410:

[%################################################%]
[%# Block for Custom SELECT fields #%]
[%################################################%]

[% BLOCK cf_select %]
<td align="left">
<select name="[% sel.field_obj.name %]" id="[% sel.field_obj.name %]"
multiple="multiple" size="[% sel.size %]">
[% FOREACH name = sel.field_obj.legal_values %]
<option value="[% name FILTER html %]">
[% name FILTER html %]
</option>
[% END %]
</select>
</td> [% END %]
<hr>
[%# *** Custom Drop-down Fields *** %]
<table>
<tr>
[% USE Bugzilla %]
[% cf_fields = Bugzilla.get_fields({ obsolete => 0, custom => 1, type =>constants.FIELD_TYPE_SINGLE_SELECT }) %]
[% IF cf_fields %]
[% count = 0 %]
[% FOREACH field = cf_fields %]
[% count = count + 1 %]
<td>
<table>
<tr>
<th align="left">
<label for="[% field.name FILTER html %]" accesskey="a">
[%field_descs.${field.name} %]
</label>:
</th>
</tr>
<tr valign="top">
[% PROCESS cf_select sel = { field_obj => field, size => 7 } %]
</tr>
</table>
</td>
[% "</tr><tr>" IF (count % 5) == 0 %]
[% END %]
[% END %]
</tr>
</table>
I also added this code to query.cgi around line 145, below "my @custom_select_fields"

my @cf_fields = Bugzilla::get_fields({ custom => 1, obsolete => 0 });
foreach my $field (@cf_fields) {
$default{$field->name} = [];
}

These lines automatically pick up any custom fields you have: I only have one, but it will correctly work for multiples. Now, you have multi-select boxes but need to make one further change. field_obj.legal_values returns an object, not a string: in order to get the actual text out of it, we need to change both instances of name to name.name:

[% FOREACH name = sel.field_obj.legal_values %]
[% name.name FILTER html %]
[% END %]

Now we're set! Searching in custom drop-down fields is now enabled. I used Quick Escape, a nice web utility for escaping HTML entities, while making this post so I could display the template HTML.

Is your appendix a greater threat than terrorism? Maybe not anymore.

I was doing some reading while bored this afternoon and came across one of my favorite quotes:

"In the past ten years, a period covering the largest terrorist attack on American soil, fewer people have been killed by terrorists than by their own appendix." -- Unknown

I realized I've never investigated it before. I think it's true going into it, so here's what I found out:

The Facts


Approximately 1.7% of people who get appendicitis die from it, according to literature available from the British Medical Journals. A WebMD article on acute appendicitis indicates that the incidence rate of appendicitis is 1.1 cases per 1000 people per year: for a United States population of 304 million, this amounts to 5684 deaths/year from your appendix. Ten years hence, and we're up to 56840 deaths due to appendicitis. Exclusively acute appendicitis: post-surgical complications kill another 1003 per year at 0.3% mortality for a total of additional deaths over that time period, for a grand total of 66870 people killed by their own appendix over the last decade.

According to extremely right-wing blog titled "The Religion of Peace" on their main page, there have been 14248 terrorist attacks since 9/11. We'll include 9/11, so that number raises to 14249. Over 10 years, that's 1425 attacks/year -- only one-quarter the incidence per year of an attack of appendicitis. I think it's okay to use slanted information to make the comparison. I imported the data into Excel and determined totals:

9/11 Attack: 2993
Post-9/11 to 2003: 3054
2004: 7210
2005: 7680
2006:
15269
2007: 20134
2008: 10773
2009 YTD: 5757

(*: This is only a portion of terrorist attacks that happened. I'm lazy, this was the first result. The figures are probably much higher when you include violence in SE Asia and Africa, but the lines for some of those attacks is a bit blurrier. We're understating the danger of terrorism, the same way we're maximizing the danger of appendicitis. )


Data before 9/11 also wasn't the top result for a lazy Bing query, so I'm not going to bother to include it here. But, even so, it looks impressive: a total of 72870 people have been killed by terrorists at a minimum. If we extrapolate using the base rate, 2001-2003, we have 3054 people per year for an additional 2 years bringing the total up to 78978 people killed by terrorists.

So that's 66870 people assassinated by their internal organs, and 78970 by terrorists. The incidence rate of terrorism is lower (1.75%) versus that of appendicitis (7%) per year but more people are killed by terrorists. Terrorist attacks frequently have around a 50% mortality rate, making terrorist attacks clearly more deadly if you are a victim, but much less likely. Unfortunately, the 2% mortality of appendicitis is far more than 4x the danger.

So, in conclusion, my favorite quote is wrong. But, based on the trend of the earlier figures, it's definitely possible the quote was true several years ago. I guess I'll not be quoting this one anymore. As far as what this all means....

Sunday, October 18, 2009

What's In K2, the Herbal Smoking Blend?

I was interested in learning what, exactly, is inside of the K2 herbal smoking blend that's being sold over the Internet. A lot of searching led to many posts talking about how people feel when they've smoked it, or what plants it's made from, but there was no single analysis of its actual chemical composition. I've compiled a listing of everything, with a short paragraph on its effects. Some sources are cited, some aren't. Sorry about the gaps. So, without further delay:

These are the major biologically active compounds contained in the smoking blend:

Protoanemonin, Anemonin, Caulosaponin, Caulosapogenin, Stigmasterol, Glycosides, Ceryl alcohol, Myricyldalcohol, b-siterosterol, Trimethylamine, Beheinc acid, Caffeic acid, Chlorogenic acid, Melissic acid, n-triacontane, n-nonacosane, Ginnone, Ginnol, Campestrol

Clemontanoside, Hushangoside, Hederagenin, aporphine, asimilobine, benzylisoquinoline, glucopyranoside, coclaurine, gallic acid, isoliensinine, kaempferol, liensinine, lirinidine, lotusine, methyl gallate, neferine, negferine, norcoclaurine, nuciferine, pronuciferine, quercetin, 9-beta-hydroxyvertine, R-quinolizidin-2-acetate, lythrine, dehydrocodine, lythridine, vertine, heimidine, lyfoline, epi-lyfoline, sinicuichine, nesodine, abresoline, anelisine, lythridine, cycloleonurinine, leoheterin, leonurine, leonurinine, prehispanolone, preleoheterin, stachydrine


I've broken them down by the plant they are contained in, with a short explanation about the potential effects in the body:

Beach Bean (http://en.wikipedia.org/wiki/Canavalia_rosea)

Reported to potentiate other herbs. Known to contain L-Betocine, CAS 515-25-3 http://www.rdchemicals.com/chemicals.php?mode=details&mol_id=7555 Betocine is similar to a family of anti-inflammatory compounds and may have some minor effects by altering CYP450 metabolism. http://pubchem.ncbi.nlm.nih.gov/summary/summary.cgi?sid=207822 Speculate that grapefruit could increase the potentiating effect of the substance as well. The inclusion in the formulation may be to allow the other active ingredients to become more significantly active.

Old Man's Beard http://en.wikipedia.org/wiki/Clematis_vitalba

Protoanemonin is a toxic irritant known to cause contact dermatitis (skin irritation) but is destroyed by drying, so will not be present in the final formulation. It can also be detoxified by enzymes present in the body (although since there won't be any present, there's no need in this case: http://jb.asm.org/cgi/content/full/180/2/400)

When Buttercup plants are handled, naturally occurring ranunculin is broken down to form protoanemonin which is known to cause contact dermatitis in humans and care should therefore be exercised in excessive handling of the plants. The toxins are degraded by drying, so hay containing dried buttercups is safe. http://en.wikipedia.org/wiki/Ranunculus_acris

Anemonin is an anti-inflammatory compound which may regulate tyrosinase enzyme activity, and may have some activity in reducing intestinal inflammation and irritation. It also interferes with pigment synthesis (melanin). http://www.rt-pcr.com/showabstract.php?pmid=17766092&redirect=yes&terms=Anemonin This ingredient might contribute to the general "high" of the formulation.

Caulosaponin is a cardiotoxic vasoconstrictor glycoside and may have similar effects to nicotine in some cases. The vasoconstrictive effects may raise blood pressure. http://www.camline.ca/professionalreview/pr_print.php?NHPID=24

Caulosapogenin (CAS 465-99-6 http://www.chromadex.com/chemicals/Caulosapogeninshseehederagenin_SH.html ) is a complex molecule which may have properties in regulating certain hormones, as well as ligand-gated neural receptor activity. http://pubchem.ncbi.nlm.nih.gov/summary/summary.cgi?cid=6708708#Subinfo It has weak oxytocic effects, and as a result may increase a general sense of well being. (Oxytocin is a hormone relating to social cognition, trust, bonding, and involved in processes related to the contraction of smooth muscle in the uterus for giving birth.)

Stigmasterol is a phytosterol (plant-derived cholesterol-like substance) also known as Wulzen anti-stiffness factor, may be metabolized into progesterone and have regulatory activities that promote tissue-rebuilding and may prevent or reduce the risk of certain cancers, in addition to inhibiting the absorption of cholesterol by the body. (All positive effects.) http://en.wikipedia.org/wiki/Stigmasterol

Ceryl alcohol (1-hexacosanol), a fatty alcohol, may have a variety of positive health properties.

The smaller molecules are used in cosmetics and food, and as industrial solvents. Some of the larger molecules are simply seen as biofuels, but little research had been done until 2006 regarding many of these, and they have been shown to be have anticancer, antiviral, antifungal, anti-HIV properties, for potential use in medicine and health supplements.

Myricyl alcohol is another fatty alcohol with similar properties.

Beta-Sitosterol is another phytosterol which can reduce concentration and absorption of cholesterol, as well as potentially having positive effects on male hair loss. It is also used in Europe to treat benign enlargement of the prostate. http://en.wikipedia.org/wiki/Beta-Sitosterol

Trimethylamine is a small organic molecule that smells like fish. It is inactive and may be scrapped by various amine-recovery enzymes in the body as raw materials, but more likely it is excreted directly by the kidneys without incident. It is produced naturally in the body after eating certain foods. http://en.wikipedia.org/wiki/Trimethylamine

Behenic acid is a long-chain fatty acid with low bioavailability. It is inactive, although may slightly raise cholesterol concentrations in the blood. Basically an inert compound.

Caffeic acid, unrelated to caffeine, has powerful antioxidant and anti-cancer properties as well as anti-inflammatory action. http://en.wikipedia.org/wiki/Caffeic_acid

Chlorogenic acid is also an anti-cancer, anti-inflammatory, anti-oxidant compound which inhibits the absorption and coversion of glucose into glycogen -- which means it has minor "anti-fat" effects. http://en.wikipedia.org/wiki/Chlorogenic_acid

Melissic acid likely has similar effects as above.

n-tricontane is a long chain alkane which would almost certainly be destroyed completely when burned.

n-nonacosane is another long-chain alkane which almost certainly is destroyed when burned. Neither has any real effects.

Ginnone and Ginnol are long-chain ketones and central alcohols, respectively. Both are almost certainly completely destroyed when burned, and would not have any appreciable effects.

Campesterol is another phyto-sterol with effects similar to the other phyto-sterols mentioned and is not of significant interest beyond that.

Lotus Flower http://en.wikipedia.org/wiki/Nelumbo_nucifera

Aporphine: a dopamine receptor blocking alkaloid, and used to treat Parkinson's, ED and Sexual Arousal Disorder. May contribute to a "high" by inducing euphoric effects based on its activity profile and similarity to other compounds. http://en.wikipedia.org/wiki/Aporphine

Asimilobine: An aporphine isoquinoline alkaloid, blocks new dopamine synthesis while potentiating the effects of already-existing dopamine. May contribute to a "high" followed by a bit of a "low" when the effects wear off, as dopamine is now depleted but production lags consumption in the brain. http://www.ingentaconnect.com/content/tandf/ganp/2008/00000010/00000008/art00008

Benzylisoquinoline: This chemical is the structural backbone of a variety of molecules including codeine, morphine, apomorphine, and other similar. It is broken down into component amino acids dopamine and tyramine. This chemical is present in the formulation because it is a precursor to other molecules which will be found in the plants. http://en.wikipedia.org/wiki/Benzylisoquinoline

Glucopyranose: A sugar.

Coclaurine: Involved in a biochemical cycle that regulates oxidative damage in a variety of systems, and may have activity fighting depression, liver disease and fighting the pain of ousteoarthritis. It may provide a small boost in the "high" as a result, while exhibiting positive activity.

Gallic acid: A part of tannins or found free, it has anti-fungal, anti-viral and anti-oxidant properties.

Isoliensinine: A low-grade muscle relaxant.

Kaempferol: also found in tea, grapefruit and other plants, it protects against lung and pancreatic cancers as well as exhibiting anti-depressant properties.

Lirinidine: a serotonin receptor agonist, it produces stronger serotonergic effects and as such exhibits some antidepressive properties. It may also exhibit anxiolyric activity. Calming, certainly, and possibly producing some of a "high".

Lotusine: An antihypertensive chemical which may have act on lowering heart rate and blood pressure (which is calming.)

Methyl gallate: Another antioxidant similar to gallic acid.

Neferine: A relaxant.

Norcocalurine: A precursor molecule present as a result of other chemical reactions going on which produce coclaurine.

Nuciferine: A muscle and general relaxant, that also slow response time. Protects against amphetamine toxicity as well.

Pronuciferine: A precursor to the above.

Quercetin: Increases energy expendature and exhibits some anti-inflammatory, anti-cancer, anti-oxidant, anti-tumor, and anti-hypertensive activities. Exhibits Cytochrome P450 enzymes CYP3A4 and CYP2C9 which break down most drugs in the body. As such, quercetin's presence in this formulation will potentiate all of the other alkaloids present.

North American Lousewart http://en.wikipedia.org/wiki/Pedicularis_groenlandica

Contains a variety of chemicals similar to digitalis, which reduce blood pressure and heart rate. Also contains a variety of iridoid alkaloids:

Isolated and purified, iridoids exhibit a wide range of bioactivities including cardiovascular, antipheptotoxic, chlorectic, hypoglycemic, anti-inflammatory, antispasmodic, antitumor, antiviral, immunomodulator and purgative activities.

Heimia http://en.wikipedia.org/wiki/Sinicuichi


Many chemicals may be broken down by CYP450 enzymes in the liver, making their metabolite byproducts "bad" for the liver and may be hepatotoxic if potentiated with other hepatically active drugs or alcohol.

9-beta-Hydroxyvertine: A compound similar to various opiates, may produce a high along with antihypertensive effects.

Quinolizidine Alkaloids: Most present probably have little to no biological effect, as they are probably intermediates of biosynthesis of other compounds in the plant. Similar to a core chain of some opiates.

Lythrine: A diuretic.

Dehydrocodine: An opiate painkiller, itself active, with several active metabolites including isoforms of morphine.

Vertine: A sedative and a tranquilizer, along with anti-inflammatory and anti-cholinergic (dissociative) effects.

Heimidine: Exhibits anticholinergic (mildly dissociative effects, along with anti-aggressive effects) as well as anti-inflammatory properties.

Lyfoline, epi-Lyfoline: block and depleat chatecholamines (monoamine neurotransmitters) which may produce a tired, drained feeling and reduce performance on complex tasks. These active ingredients may be responsible for some of the stronger psychoactivity as well, with some cases of auditory hallucinations taking place. Blocking and depletion of serotonergic systems is responsible for the hallucinations present with other serotonergic drugs such as LSD, etc. as well.

Sinicuichine: A tranquilizer. Definitely contributes to the "high".

Nesodine: anti-inflammatory effects. Not well studied.

Abresoline: Not well studied.

Lythridine: Not well studied.

Hops http://en.wikipedia.org/wiki/Humulus

Known to contain morphine and isomers and suspected to contain other alkaloids since 1905, little research has been done since with the advent of better tools. Definitely contributes to the high in this case, though.

Morphine and related compounds would be quite readily broken down by yeast metabolism in fermentation, and would be completely eliminated by the beer-making process; thus why beer does not contain morphine.

Lavender http://en.wikipedia.org/wiki/Lavender

Anti-inflammatory akaloids; also contains terpenes which may be irritating and increase photosensitivity.

Leonurus sibiricus http://en.wikipedia.org/wiki/Leonurus_sibiricus

Cycloleonurine, Leonurine, Leonurine, Leonurinine: Antibiotic activity against staphlococci, streptococci, E. coli, and other less common bacteria.

Leoheterin, Preleoheterin: responsible for "mild cannabis-like effects"

Prehispanolone: Anti-inflammatory effects.

Wild Rosmary (Rohodendron) http://en.wikipedia.org/wiki/Rhododendron_tomentosum

Ledol: a poisonous substance that can interfere with muscle function causing cramps or in cases of extreme overdose, paralysis.