July 30th, 2008 by Ventaur
I don’t like writing about something that I’m “currently working on” too often. The problem with that is sometimes other things (e.g. life) get in the way of my proposed timelines. All that aside, there are times when the standard SQL web providers are overly complicated for the rest of my database schema. I think it’s great that you can use the same tables for multiple applications. It’s also great that the primary keys for most of the entities are GUIDs, since these are much harder for an unauthorized user to guess.
Sometimes it’s all just too much!
Integration with the Rest of Your Schema
The default implementation of the ASP.NET providers are not ideal for integrating with the rest of your database schema. By that I mean, if you want to include a foreign key to a user’s ID in a table that you’ve created for your application, you’ll have to play by those default rules. Your foreign key will have to be a unique identifier (SQL Server’s GUID data type).
What if I’ve already defined my entire schema and the User ID I had in mind is an integer?
Write Your Own Providers
Something that I truly appreciate with ASP.NET since version 2 are providers. Being able to customize the implementation details of specific pieces of a well-defined machine is empowering. Unfortunately, for the membership, role and profile providers, your data for each will more than likely be interdependent. For example, you cannot use the default SqlMembershipProvider with a custom role provider that does not link to the aspnet_Users table or use a GUID for the User ID when associating roles to users. If you want to change the data type of the primary keys for some entities, you’ll have to write custom providers for all aspects you wish to use in your application.
It’s also not as simple as just changing the data type from a uniqueidentifier to an int. Ideally, the flexibility to configure the providers to use one of your own existing tables in the database would be more robust than hard-coding several table names into the code. What if the provider uses the correct database provider based on the supplied connection string? How about the option to use dynamic SQL or stored procedures?
These would all be very nice features for a set of ASP.NET providers. Of course, I have a real-world example. My host lets me create MySQL databases for my website. They have MySQL 5 installed, which has the ability to create stored procedures (after a bit of a wait). The only trick here is, stored procedures in MySQL 5 are actually stored in the “mysql” database. This can pose a problem for security in a shared hosting environment. Everyone’s stored procedures are in the same “bucket”! It would be great if I could configure my membership and role providers to use MySQL and build dynamic SQL instead of relying on stored procedures.
They’re Coming
That’s the plan. I am currently writing ASP.NET providers that offer all the benefits mentioned above. When will this project be complete? Who knows with my schedule! I can tell you that I have a couple of big websites that I’m working on that will require MySQL as the backing database. They also require membership and roles support. I guess I’ll be finishing the providers in order to complete those websites. 
Posted in Programming | No Comments »
July 13th, 2008 by Ventaur
Getting in shape and staying in shape seem to be very difficult for most of us. We have busy schedules and fitness does not seem to get its own place on our calendars. It’s an unfortunate side effect of modern life. Another side effect of this age is a sedentary lifestyle. We have physically stagnant jobs; we have remote controls; we hire people to mow our lawns.
The Plateau Effect
Hard work and effort are not even enough for satisfying results. We need to know how the body “thinks”. This is why I don’t like the word, “routine”. It’s the routine that is usually the problem. Many of you know what I mean. You get really pumped up about a workout routine that you’ve discovered or devised. You may even see some results. However, after a few weeks, you level out. That’s the Plateau Effect. The body gets used to the stress it is put under and it quickly evolves to the new pattern. Your weight loss and muscle gain level out.
Avoiding the Plateau Effect
OK, so our bodies reach a plateau after following a routine for a few weeks. If you think about it for a minute, the solution to that problem should come to you. Change it up! You need to trick your body so it doesn’t figure out what you’re doing to it. You cannot let your body adjust to a pattern. Muscle confusion is the answer. Stick with a routine for a few weeks, then switch things around. One last thing to remember; your diet is just as important as your workout. I’m not saying that you need to change your diet drastically every few weeks, but some change is very crucial. A lot of protein and hardly no carbohydrates to start does wonders. Then, you can slowly replace protein with carbohydrates every few weeks until you are eating more and more carbs. Remember, if you stop exercise with much intensity, cut back on the carbs again.
P90X and Muscle Confusion
P90X is a personal 90-day extreme workout and diet plan. Notice how I use the word “plan” instead of “routine”. Just when your body thinks it’s figured out the “routine”, things change and your muscles get too confused to adjust properly. As a result, you build muscle very fast. In case you didn’t know; muscle naturally burns fat faster than just about anything. P90X also lays out a diet plan for you that is essential to the whole process. I’m not using the word “diet” the way most people think of it. A lot of us think of a diet as a temporary change in our eating habits in order to lose weight. When I talk about your diet, I mean your eating lifestyle. It’s the food you consume every day over long periods of time. Sure, P90X changes your diet over the course of the 90-day period, but the key ingredients remain the same. The quality of food you eat is consistent. You just modify the quantity of certain categories of food (i.e. protein vs. carbs). There may be other workout plans out there that follow the golden rule of preventing the Plateau Effect and creating muscle confusion, but I am really impressed with P90X and the honesty it offers. Did I mention you do this workout at home with very little fiscal investment? Oh yeah; this is good stuff.
Getting Started
If you decide that P90X is right for you, but you’re not sure how to get started; buy the DVDs first. While they are being shipped to you, check out my post, “P90X: Getting Started“. The tips I discuss there will save you time and money. The best part is, you’ll be securing your fitness and health for decades to come.
Posted in Health, Life | No Comments »
July 13th, 2008 by Ventaur
So, you’ve decided that P90X is the workout and diet plan for you to achieve lasting fitness and health for the rest of your life. Excellent! You won’t regret making the commitment. Now that you’ve ordered the DVDs, you need to get ready for their arrival. You ordered the DVDs, right?
Equipment Needed
You will need some equipment. Don’t worry though; it’s not much and you may already have some things. Let’s start with the most important first.
Weights or Bands
You’ll need either dumbbells (free weights) or resistance bands. There are a ton of options for each, but there are some basic guidelines you should remember when choosing.
You can get simple free weights at many department stores as well as sporting good stores. I recommend getting single piece weights. You can buy them in sets, but if you get the interchangeable plate design dumbbells, it may end up slowing you down. However, there are newer options now that let you adjust the weight of each dumbbell. These are very cool, but usually cost more at this time. If you get the single piece dumbbells, make sure they are coated for a good grip (or use gloves). Look for polychloroprene (i.e. Neoprene), or any kind of rubber/vinyl, coating. Here are links to some affordable dumbbells of each type:
Resistance bands are very versatile tools for strength training also. Each band is rated at a certain resistance, but you can vary the amount of resistance depending on the distance from the handles you pull. This actually allows for a much broader range of resistance. One option that I appreciate are bands that can be interchanged with a set of detachable handles. There are several types of bands that you can purchase. I, personally, own the full set of bands sold by the creators of P90X. Once I figured out how to easily swap the higher resistance bands among the handles, I really grew to like these bands.
Pull/Chin-Up Bar
A good pull-up bar or chin-up bar is something that you will absolutely need for this program. Depending on the type of person you are, you will learn to love or hate pull-ups. That said, you want to get a bar that makes the whole process much easier on you. You can get one that stands free like a tower on your floor. These are usually adjustable in height. A cheaper alternative is a bar that installs in a doorway. Some of these require a sturdy doorway with trim that you set the bar onto. Others need brackets screwed into the studs of your doorway with the bar resting into the brackets (these usually telescope to the appropriate length). Below are links to a couple of each type.
Fitness Floor Mat
Another essential for your workout plan is a floor mat. You will be on the floor for an hour and thirty minutes of extreme yoga. You will be sweating through plyometrics (jump training) for about an hour. You will be stretching all your muscle groups for another hour. Thankfully, these exercises are on different days. However, you will need a floor mat that is thick enough for these activities.
Heart Rate Monitor
Several workouts in this plan are cardio-based: Plyometrics, Cardio X, and Kenpo X. In order to get the most out of these workouts, you should monitor your heart rate. It is important to keep your heart rate within an ideal range for burning fat. A good monitor will prompt you for your physical attributes and calculate the rest for you. After a proper setup, you can equip the monitor and it will beep when you are out of your range. This allows you to adjust your activity to get back into range.
Other Equipment
Some other equipment that you may get could improve your experience.
Most importantly, a way to monitor your fat loss is very nice to chart your progress. You can get a standard caliper or an electronic monitor. Some are built into weight scales, others are hand-held.
If you have wrist issues or want to get more range of motion out of your push-ups, you can purchase a pair of push-up stands. I have a bad wrist, and a set of push-up stands are great.
Lastly, yoga blocks are absolutely great for so many people. For me (and most guys), yoga blocks will help to perform the more advanced stretches which would otherwise not be possible. For the more flexible people out there, yoga blocks will help you stretch beyond normal means.
Supplements
I suppose it is possible to experience this workout plan without supplements. However, I really do not see how this would work. In order to meet your dietary needs, I sincerely recommend that you invest in supplements. You can get all of these items at GNC, Vitamin Shoppe, and other similar shops.
Vitamins
The foods we have available to us today are usually very short on the vitamins and minerals our bodies need. Then, if you take on any workout plan, let alone an extreme plan, you will really need the vitamins. Get a multi-vitamin for men or women. For the P90X program, consider getting a multi-vitamin that targets sports activities or athletes.
Protein
The first phase of P90X expects you to really put down the protein and lay off the carbs. It is really, really hard to eat enough protein via food. You’ll want to consider a protein powder supplement. I keep it simple. I consume a generic brand of whey protein that is chocolate-flavored. It actually tastes great mixed with just water (this has come a long way in the past 10 years). 1 scoop of this stuff is equivalent to 1 protein on the P90X diet plan. Be aware that whey protein contains eggs, so if you are a strict vegetarian, look for an alternative to whey. You can mix a protein drink as a snack in the middle of the day and get a full protein count toward your daily goal.
Recovery Drinks
After an extreme workout, you need to recover; and fast. There is an important 1-hour window, right after your workout, when you have the opportunity to help your muscles recover from the stress and strain beyond natural means. Consuming a recovery drink after such workouts, you will experience less soreness and will actually repair your muscle tears so much faster.
P90X has a recovery drink that I understand is great. However, my wife and I decided to find out the ingredients and find an alternative. The key to a recovery drink is the 4:1 ratio. That’s 4 parts carbohydrates to 1 part protein. If you want an alternative that is fairly affordable, I recommend Accelerade. You can find it at GNC and Vitamin Shoppe at a decent price. I believe GNC only has 2 of the flavors, while Vitamin Shoppe has all 6 or 7 flavors. You should take 2 scoops of Accelerade, but you may want to divide that up into 2 drinks unless you like it strong. This stuff tastes great and we always look forward to it after a workout.
Note: Accelerade (and most recovery drinks) use whey, which contains eggs. So, if you are strictly vegan, know this fact and read the labels to find something suitable for you.
Summary
It may seem overwhelming at first to get started on a high intensity workout. However, once you make a list of the things you need, it is not that bad at all. If you have to purchase everything listed here to get the most of your P90X workout plan, you can expect to spend the following amounts:
- $150-$225 start-up costs for equipment
- $35-$65 monthly costs for supplements
You will not regret commiting yourself to this workout plan. P90X definitely guides you to real results of fitness. I mean long-lasting fitness. My wife and I love the results we are getting. I expect to finish the program, take a small break, then start it all over again. Yeah, it’s that good!
Good luck!
Posted in Health, Life | 1 Comment »
June 28th, 2008 by Ventaur
We finally did it! We bought an electric mower.
Keep in mind, we did need a new mower. We are very aware of the fact that buying something “green” when you do not need to replace a product you already own does not pay off fiscally. In this case, our old gasoline mower is on its last wheel. My father-in-law has already repaired the thing several times (it’s something he really likes to do). In fact, he will be taking the old mower for parts on his next visit.
Did It Cost More than a Gasoline Mower?
Yes.
I compared the feature set of the new electric mower to the features of gasoline mowers until I found a functionally equivalent product that I would have bought were it not for the electric mower calling to me. The equivalent gasoline mower was about $400. I know that you can buy a mower for $150, but “you get what you pay for” resounds in my head. The old gasoline mower was originally purchased for $350 in 2001, so I feel confident that the $400 is an accurate price for a solid comparison. The new electric mower cost $474 (shipping was free).
Naturally, I felt compelled to calculate the return on investment (ROI) for the new mower. I sat down the other night with a spreadsheet open and began my research and calculations. The research involved finding out the tank size of the gasoline mower. I used our current mower for that and the amount of gasoline used to cut our yard. The funny thing is, you simply cannot easily find the tank size for a walk behind mower anywhere! We scoured the Internet for any reference and for any mower to no avail. I had to resort to my math background to estimate the tank size based on measurements and the shape of the tank.
Another very interesting bit of research involved finding out how much electricity is used to charge a battery. I know how to calculate kilowatt-hours from the rated wattage and amp-hours of a battery, etc., etc. However, I never thought about charging a battery…until now. I’ve been interested in getting a meter that sits between an item and a wall outlet, but we did not buy one just yet. Instead, I found an obscure post from an energy expert about how to estimate the amount used to charge a battery to capacity. He claims that you can multiply the rated watt-hours of the battery by a factor of 1.6 to arrive at the total watt-hours necessary to charge fully.
Note: When we actually purchase a meter, I’ll update my calculations and this post.
The Necessary Calculations
So, our battery’s watts * amp-hours = 360 Wh * 1.6 = 576 Wh to charge the battery to capacity. The tank volume of our gasoline mower * 0.5 (I use about 50% of the 0.80 gal tank to cut our yard) = 0.40 gal used per cut of our yard. Now, for the fun.
I have calculated the cost of gasoline and electricity on June 27, 2008. Gasoline was $3.9590/gal at the station we frequent, and electricity was about $0.1580/kWh. I also looked at my history of cutting grass here. I cut the grass once a week for about 25 weeks each year.
I am looking for the time it will take to catch up, fiscally, with the alternative purchase we could have made; a gasoline mower. The price difference of the two mowers was a flat $74. All I needed to do was to divide that difference by the difference in cost per cut of our yard.
Break-even Analysis
Here are the numbers for the break-even analysis.
|
Gasoline Mower |
Electric Mower |
| Cost per Cut (Jun 27, 2008) |
$1.5638 |
$0.0910 |
| Weeks to Break Even |
n/a |
50.24 |
| Seasons/Years to Break Even |
n/a |
2.01 |
Well, it looks like it will take about 2 years to break-even. That, of course, carries quite a few assumptions. The main unreasonable assumption is that the price of gasoline and electricity will remain the same as they are now for the next 2 years. Reasonable assumptions are as follows.
- We would have purchased a new gasoline mower for around $400 had we not been interested in an electric mower.
- The cost of maintenance on a gasoline mower is roughly equivalent to the cost of maintenance on an electric mower (e.g. replace the carburetor on the gas mower vs. replace the battery on the electric mower).
Conclusion
I am quite happy with our purchase of an electric mower instead of a gasoline mower. It is drastically lighter and easier to push. It is about 75% quieter than our old gasoline mower (I can actually listen to my iPod without having to deafen myself with the volume). I don’t inhale all those fumes that irritate my sinuses and increase my allergy symptoms.
Finally, I feel better that I am not contributing to the pollution statistics. Did you know that 5% of the nation’s pollution comes from traditional gasoline-powered mowers? In fact, they produce as much pollution in a single hour as a modern car driven 95 miles!
In future posts, I will expand upon these fiscal calculations in an attempt to achieve more accuracy.
Posted in Green | No Comments »
June 17th, 2008 by Ventaur
Some of you know me as a friend and code poet. Some know me as the crazy guy trying to get donations for his dad to get him a Wii. Some just know me as “that guy who wrote the web page security module for ASP.NET“. Others don’t know me at all; how did you end up here by the way?
Well, I am finally setting out to write the next version of the web page security module. I have quite a list of features requested by its many users. The fact is, I’ve been wanting to write the new version for nearly 2 years now. I have an idea that will make this thing so much more usable that I’m beginning to doubt its efficiency. So, before I begin putting too much effort into it, I will be running some tests, like a responsible programmer.
I suspect the new method I have in mind will be a bit more CPU-intensive. The problem is, I have no idea how much more CPU I can expect the algorithm to use. I’ll see how my tests go, beginning tonight. If the metrics show an acceptable increase in CPU (I’ll have to decide what is acceptable), I will begin coding the new version this week.
Stay tuned.
Posted in Programming | No Comments »