Sunday, November 30, 2008

My Chinese Thai Noodle Recipe

16 oz of noodles (Spaghetti or whatever)
16 oz Frozen mixed vegetables
2 Eggs
1-2 lb Chicken or pork cut into strips or chunks
3 Tbsp Sugar
5 Tbsp Cooking oil
4 Tbsp Water
3 Tbsp Sherry Wine
.5-1 tsp Hot chili sauce
5 Tbsp Soy sauce
4 Tbsp Stir Fry Sauce
.5 tsp Ginger
.5 tsp Garlic Powder

Boil the noodles according to the directions. Drain and put back into pan.
Add 1 Tbsp of soy sauce
Add 2 Tbsp cooking oil
Add 16 oz Frozen Vegetables
Fry Meat till cooked
Stir in
3 Tbsp Oil
4 Tbsp Soy Sauce
4 Tbsp Stir Fry Sauce
.5 tsp Ginger
.5 tsp Garlic Powder
3 Tbsp Sugar
4 Tbsp Water
3 Tbsp Sherry Wine
.5-1 tsp Hot chili sauce

Cook for 6 minutes
Pour Meat and sauce over Noodles
Scramble the 2 Eggs in the meat pan
Pour into the Noodles
Mix and Continue on low heat until the Vegetables are soft about 10 minutes

Serve. Should make about 8 servings.

Thursday, November 20, 2008

Ramen Noodle Recipe

After getting 5 teeth pulled in 2 weeks I have become a fan of Ramen noodles. However they are a little bland on taste. So I spice them up a little bit.

Beef Noodle Delight :)

1pkg Beef Ramen noodles
1 tablespoon Worcestershire sauce
Half teaspoon hot sauce(Red Hot,Tobasco,Chili pepper sauce)
1 tablespoon sugar

Boil 2 cups of water
Add sauces,sugar and flaovr packet from noodle and noodles.
Stir.

Enjoy.

Tuesday, November 18, 2008

Creating Watermarks on Textboxes using Javascript

Anymore watermarks are becoming more and more popular on websites. WaterMarks help to save space and can give a user more guidance than just the label does. I use watermarks to save space and give the proper format. For instance I may label a textbox "Phone" and place the watermark within the text box as "#-###-###-####" When the user click or tabs into the box it removes the watermark. If the users clicks or tabs out of the text box I check for a blank and then replace the watermark otherwise I leave the text alone.

The code I use is only javascript and I add a attribute named "WaterMark" to the textbox. An example would be

<input value="" id="myTextBox" WaterMark="#-###-###-####" type="text">



Below is the Javascript functions. Add them to your page within <script> tags or to your .js file.

function SetWaterMarks() {
var inputs = document.getElementsByTagName('input');

for (var f = 0; f < inputs.length; f++) {
var input = inputs[f]
if (input.type != 'text') continue;
if (input.getAttribute('WaterMark') != null) {
input.onfocus = function() { WaterMarkOff(this); }
input.onblur = function() { WaterMarkOn(this); }
if (input.value == '') {
WaterMarkOn(input);
}
}
else {
input.style.backgroundColor = '';
}
}
}
function WaterMarkOn(obj) {
if (obj.value == '') {
obj.style.color = 'silver';
obj.value = obj.getAttribute("WaterMark");
}
}
function WaterMarkOff(obj) {

if (obj.value == obj.getAttribute("WaterMark")) {
obj.style.color = '';
obj.value = '';

}
}
function ClearWaterMarks() {
var inputs = document.getElementsByTagName('input');
for (var f = 0; f < inputs.length; f++) {
var input = inputs[f]
if (input.type != 'text') continue;
if (input.getAttribute('WaterMark') != null) {
if (input.value == input.getAttribute('WaterMark')) {
input.value = '';
}
}
}
//return true;
}
SetWaterMarks();




When the page loads it will search the page for "text" boxes and look for a WaterMark attribute. If it finds th watermark attribute it will apply the water mark. The only thing left to do is to clear the watermarks prior to postback. The ClearWaterMarks() function will do that for you but you must place it on the form submit function or on the onclick event of the button that is expected to be used.

To Add or Create a watermark on a textbox could not be easier.
Hope this helps someone, it is much lighter than other versions I have seen.

Tuesday, November 4, 2008

Single Server as a Cluster

If you only have access to 1 server for your website you may have some issues that could be solved by adding additional servers and creating a cluster. But maybe you only have a single server. Most servers these days hae at least 2 processors and 2-8 gigs of RAM.

The windows process only allows 1.3 gig per process of RAM. A simple solution is to use the web gardens of IIS 6+ however if you have a session management requirement then the web gardens will likely drop your sessions.

Another solution is to create multiple websites using host headers and redirect initial incoming traffic to another website on the single server. Simply create 3 subdomains on your DNS host. Say www1.yoursite.com, www2.yoursite.com and www3.yoursite.com. When the initial request comes in you can check for the load balancing and redirect them to the cleanest subdomain each which will use a different process and allow it to use more processors.

Please Comment.