Recently I've been doing financial analyses using a Microsoft Access 2007 database. I've long been using expressions in queries, but now I had some complex expressions that I wanted to simplify by creating custom functions. It took me a bit of digging to figure out how to do it. The basic steps to create a custom function are simple.
Create a Module.
Select the Create tab.
Select Module in the drop down list under Macro.
Define the function in the Module.
Below the Option statement create a Function.
Generic Function
Public Function {Function Name}({Input Variable Name} as {Input Variable Type}) {Function Name} = {Output expression} End Function
Code Example - Get a date bounded by a colon and a space or the end of the string from within a string
Public Function GetDate(value As String) As Date
Dim datestart As Integer datestart = InStr(1, value, ":") + 1
Dim dateend As Integer dateend = InStr(datestart, value, " ")
Dim datestring As String If dateend = 0 Then datestring = Right(value, Len(value) - datestart + 1) Else datestring = Mid(value, datestart, dateend - datestart) End If
GetDate = CDate(datestring)
End Function
Save the Module.
To use the function in the Expression Builder, navigate to Functions>{Database Name} below Functions>Built-In Functions. The Modules associated with the database appear in the second column. Select the Module. The names of functions associated with the selected Module appear in the third column. You can then use the custom user-defined function as you would built-in functions.
Almost everyone trying to lose weight, or just trying to feel better, is looking for the perfect food. For me it's my morning smoothies, but others are trying or are forced into other unusual choices. Here are several crazy diets I read about yesterday.
The Beef Jerky Diet
Steve of Best Beef Jerky Beef Jerky Reviews and Beef Jerky Diet Blog is trying to save money and lose weight by following his diet of consuming primarily the free beef jerky that manufacturers send him, V8 juice and water. As he points out, the diet is low fat and high protein, but it's also high in sodium and preservative and low in fiber. Steve claims that the beef jerky diet is also low carbohydrate, but most manufacturers add sugar for curing and flavor. With 20-30 grams of carbohydrates, almost none of which are fiber, in a 4 oz serving, I wouldn't count his diet as low carbohydrate. Recently, Steve has reported that he's been getting groggy and blacking out when he stands up. I applaud him for scheduling a visit with his doctor. Steve's been successful in losing weight because the protein in the jerky spaced out through the day keeps him feeling full enough to significantly cut back his calories. I don't think the beef jerky diet is going to continue much longer. Although he's managed to lose about 30 pounds, I hope that he hasn't permanently injured himself following this diet.
The Prison Diet
Any diet that is low enough in calories compared to your metabolism will cause you to lose weight. According to The Associated Press, Broderick Lloyd Laswell has filed a federal court suit because he has lost 105 of his 415 pounds over eight months while subsisting on three cold meals per day providing 3000 calories per day in Benton County Jail. Laswell has been experiencing persistent hunger, blurry vision and feeling like he was going to pass out. It's not surprising that Laswell is losing weight as he would need more than 4000 calories per day to maintain his weight. The reported average 1/2 pound of weight loss per day is not surprising, although it should taper off as he loses more weight. I would be surprised if Laswell lost his suit. Transgendered inmates must be maintained at the hormone levels at which they enter prison. The courts may eventually find that prisons must provide enough calories to maintain inmates at the weight at which they enter prison if desired. Starvation is torture and Laswell is being involuntarily starved given his caloric requirements. The imposed level of hunger that Laswell is probably experiencing cruel and unusual punishment, even though 3000 calories is plenty for most and I see no reason that jails or prisons should be required to provide hot meals, especially considering potential safety issues around preparing and serving hot food.
Ali Vincent lost 112 pounds, almost 48 percent of her original weight, as the winner of The Biggest Loser. She generated her weight loss by eating about 1200 calories and exercising 8 to 10 hours per day. For every 3500 calorie deficit, you will lose 1 pound. The amount of calories burned during exercise depends on the intensity of the exercise and how much you weigh. In the middle of her weight loss, when she was about 180 pounds, Ali would have been burning bout 10 to 17 calories per minute, or 600 to 1020 calories per hour, or 4800 to 10200 calories per day, assuming high intensity exercise. It's clear how her regimen caused her to drop the weight so quickly, however, most people would not have the time, determination or health to maintain such a rigorous workout schedule with such limited caloric intake. I'm curious what her maintenance regimen will look like in the long run.
My Plan
My weight loss plan is not a crazy diet. I'm doing Weight Watchers and have lost 14 pounds in 3 months in addition to the 10 pounds I lost during IVF treatments. I currently get over 30 points, about 1500 calories per day, and I have been doing 30 minutes of intense exercise 2 to 3 times per week. I don't want to exercise extremely and risk aggravating previous serious injuries. I'm not in a hurry and prefer to give my body time to adjust as I lose the weight. I'm very happy with my progress and plan to continue for many months.
The weekend before last I went to the salon to get my hair colored and cut. My hair is always difficult to manage because its thick and curly, very prone to frizz in both the humidity where I grew up in New York and here in the dry climate of Arizona. In the past I was able to control it by using salon conditioners, but recently it's gotten particularly bad. My hair was getting dry and wiry. So, when I was offered a conditioning treatment after coloring at the salon I accepted. I could immediately tell that the texture of my hair was vastly improved and it has continued to be better even after shampooing and conditioning at home several times. Luckily I asked what the product was and they said it was "Oleo." It took me a little while to track it down, but I figure out that it's Kerastase Oleo Fusion Treatment. The Kerastase Oleo website has excellent information on their products and how to use them. In the salon I paid $25 for a single conditioning treatment, but I've found it for significantly less online. Too bad is doesn't come with the great scalp massage I got at Dolce.
I was very excited to find Fit Fruit & Vegetable Wash at the grocery store yesterday. My friend and I were talking about how much we loved this product and were sorry that it had gone off the market. She had stocked up on the clearance sales, but eventually ran out. I remember telling my Mom about it when it first came out. Fit is a fruit and vegetable wash the removes pesticides and waxes, then rinses cleanly away. You can spray it on directly or make a solution for soaking. It leaves fruits and vegetables tasting fresh and clean. I especially like using Fit on grapes, which tend to have a lot of pesticides on them. I'm very happy that Fit is back on the market.
BBC News reported this morning that IndyMac Bank failed today due to a liquidity crisis after depositors withdrew more than $1.3 billion over the last 11 days. Although IndyMac is the second largest institution in US history to fail, I hadn't heard of IndyMac before we got our new mortgage on the sixth try. This news explains why IndyMac was trying so hard to get us to refinance over the last two weeks. We were practically deluged by emails, mail and phone calls until we explained to a loan officer why we were in the right loan for us. Apparently, they were trying to liquidate some of their mortgage assets to head off the crisis, but failed. From our perspective it won't make any difference who buys the institution from the Federal Deposit Insurance Corporation, I just expect to have a different mortgage servicer, eventually, which we've been through several times with our old mortgage with no problem.
This week I got a new cooking toy, a Kuhn Rikon pressure cooker. Of course, a pressure cooker isn't a toy, but it is easy to use and a lot of fun. I picked this particular one because it was recommended by Miss Vickie. So far, I've made two dishes, Osso Buco and beef roast. Last time I tried to cook beef shanks they were still very tough even after 2 hours of roasting in the oven. With the pressure cooker it turned out delicious.
Pressure cooking is also a very economical way of cooking. I can take a cheap, tough cut of meat and make it fork tender and delicious in an hour of pressure cooking on low heat. After heating for a couple of minutes on high to get the pressure up in the pot, I turn the gas to its lowest setting for the rest of the cooking time. I can use inexpensive cuts of meat and cook them with very little energy.
Pressure cooking is also very nutritious because you can cook with very little water and maintain the vitamins and minerals in the food. I'm looking forward to steaming vegetables and canning fruits. I still remember the brandied peaches that my mom made once that we savored for years. It'll be fun to try to recreate them.
I've gotten back to Microsoft .Net web application programming. I figured out how to make a Dropdownlist with text based on multiple columns. The basic solution is to create a custom SELECT statement that includes the two text columns you want to use as the item text and the value column. For example, I have departments and groups within departments and I want to select groups with the text in the item equivalent to "department group" and I want the item value to be the group id. The data is in two tables, the Departments table and the Groups table, related by a foreign key constraint. The statement looks like
SELECT (Departments.Name + ' ' + Groups.Name) AS DepartmentGroup, Groups.GroupID FROM Departments INNER JOIN Groups ON Departments.DepartmentID = Groups.DepartmentID ORDER BY DepartmentGroup
The quickest way to implement this is to create a Data Source, i.e., sdsDepartmentGroup. Use "Configure Data Source..." from the Dropdownlist control, then select "Specify a custom SQL statement or stored procedure," and enter the SELECT statement manually or use the Query Builder to create it. Then add the Data Source to the Dropdownlist, or other list control.
DataSourceID = Data Source ID, i.e., sdsDepartmentGroup
DataTextField = Combined text column, i.e., DepartmentGroup
DataValueField = Value column, i.e., GroupID
Voilá, a Dropdownlist that combines multiple columns in its items' text! This can be used for other list controls also.
Save 25% off Measure Up Microsoft Practice Tests through July 31, 2008 with coupon code MUP0708 or get a CertPak and save 20% off a test and get a test voucher. Measure Up is a Microsoft Certified Practice Test Provider. I get my info from their newsletter and web site.
Today I went to Dolce for a cut and color. I got rid of my pyramid head and went to a violet red that matches my eyes well. Overall, I'm very happy with my new grown up Shirley Temple look.
A couple of weeks ago I tried Weight Watchers vanilla smoothies. I found that they made an easy, quick breakfast that provided most of my milk and nutritional needs for the day. However, they have a lot of artificial ingredients and they are expensive. So, now, I'm creating my own smoothies. I use instant nonfat milk powder, soy protein isolate or egg white powder, and psyllium husk powder for my smoothie base, then I add fresh or dehydrated fruit for flavor and nutrition and artificial sweetener, if I'm in the mood for a sweeter flavor. This morning I had a Jackfruit Sesame Goji Berry Coconut Smoothie. Yummy, great nutrition, only 5 Weight Watchers points, and it keeps me satisfied until lunch! Here's another great smoothie recipe:
Put all of the dry ingredients in the blender. Measure milk. Add vanilla extract to the milk. Pour milk and vanilla into blender. Blend well. I use a Magic Bullet, which is very easy to set up, clean and store.
I first encountered Hunza bread last week when I was looking for bulk spices on BulkFoods.com. I ordered a pound of their Hunza Bread Mix to try it out. It was very easy to make. I cut their recipe in half. I only had to add water and oil to the bread mix, stir and bake according to the recipe provided on the package label. The bread turned out tasty and filling. However, I'd recommend Hunza bread more for its taste and laxative properties than as a diet aid. Each 2 inch square has 119 calories and counts as 2 Weight Watchers points, which is a lot for the volume. I generated a nutrition label for a serving, one two inch square of bread, at NutritionData.com available below. I'd rather get my fiber in ways that aren't tied to so much carbohydrates, like adding psyllium husk powder to my breakfast smoothies and sauce recipes.
In the finale of A Shot at Love II with Tila Tequila, Tila gets her heart broken again. It was more like watching a car wreck than watching a mystery unfold. Kristy clearly told Tila that she wasn't ready for a relationship with a woman on their last date, but Tila turned away Beau, a handsome, well-mannered young man who literally fought for her heart, to offer Kristy the key to her heart any way. The ending was obvious during the show as Kristy was shown having an anxiety attack about meeting with Tila for the key ceremony that Kristy would not accept the key. I believe Tila truly wants to find love. Unfortunately, the question of why this keeps happening is easy to answer.
In both seasons of A Shot at Love Tila chose the least mature person each time. Although her first choice, Bobby, a cute, inexperienced young man, accepted the key the first time, I predicted that the relationship would not work out and sure enough, we arrived at season two. This season Tila again chose someone who was immature and not ready to settle down with anyone, much less in a lesbian relationship. Highlights from the upcoming reunion show show Tila still questioning Kristy, but who Tila really needs to question is herself. Assuming she is as sincere as she appears to be in her shows that she wants a long term relationship, I hope that Tila Tequila gets herself therapy to discover why she keeps picking the same kind of people and, as much as I enjoy watching her and her cohorts cavorting, that she stops looking for a long term relationship on a reality television show.