Monday, May 25, 2009

Inspirational Canadian Terrance Stanley "Terry" Fox

Terrance Stanley "Terry" Fox, CC (July 28, 1958 – June 28, 1981) was a Canadian humanitarian, athlete, and cancer treatment activist. He became famous for the Marathon of Hope, a cross-Canada run to raise money for cancer research, which Fox ran with one prosthetic leg. He is considered one of Canada's greatest heroes of the 20th century and is celebrated internationally every September as people participate in the Terry Fox Run, the world's largest one-day fundraiser for cancer research.


Terry Fox in Toronto during his Marathon of Hope cross-country run (July 1980).


Source: http://en.wikipedia.org/wiki/Terry_Fox

Thursday, October 23, 2008

What is Internet Marketing??

What is Internet Marketing??

Internet marketing is still a complete mystery to a large majority of Internet users. For many users, internet marketing is seen as some foreign area of the web, populated with silly get-rich-quick schemes and unsavory characters ready to rip off the innocent and uninformed consumer at the click of a mouse. Continue to read more.. SEO: 5 Most Popular Forms of Internet Marketing

Thursday, October 02, 2008

Birds, Animals and Trees Amaze you!

Here's some amazing facts about Birds, Animals and Trees amaze you!

1) SNAILS have 14175 teeth laid along 135 rows on their tongue.

2) A BUTTERFLY has 12,000 eyes.

3) DOLPHINS sleep with 1 eye open.

4) A BLUE WHALE can eat as much as 3 tonnes of food everyday, but at the same time can live without food for 6 months.

5) ELEPHANT teeth can weigh as much as 9 pounds.

6) The fierce DINOSAUR was TRYNOSAURS which has sixty long & sharp teeth, used to attack & eat other dinosaurs.

7) DIMETRODON was a mammal like REPTILE with a snail on its back. This acted as a radiator to cool the body of the animal.

8) CASSOWARY is one of the dangerous BIRD, that can kill a man or animal by tearing off with its dagger like claw.

Read more here : Cool & Amazing World Facts



Thursday, August 14, 2008

How to Create Select Drop Down list with different font and background color


Here's some useful codes to create drop down list to create dropdown list with font and background color in HTML :)

Paste code below in between your HEAD tags



Paste code below in between your BODY tags

Saturday, July 12, 2008

SQL Server Function to Determine a Leap Year

Problem
I need to write a function to determine if particular year is a leap year (i.e. February contains 29 days rather than 28 days). I know that there are various rules for calculating leap years. Is there an easy way to figure this out? Can you provide an example or two to validate various years?

Solution
Yes, there a few rules to consider when determining when a year is a leap year. For instance, contrary to popular belief not all years divisible by 4 are leap years. For instance, the year 1900 was not a leap year. However, you needn't bother yourself about leap year rules... you can let the SQL Server engine do the work for you!

The following scalar function takes in a year and returns a bit flag indicating whether the passed in year is a leap year or not.


create function dbo.fn_IsLeapYear (@year int)
returns bit
as
begin
return(select case datepart(mm, dateadd(dd, 1, cast((cast(@year as varchar(4)) + '0228') as datetime)))
when 2 then 1
else 0
end)
end
go

That's all there is to it! The function takes in the year, appends '0228' to it (for February 28th) and adds a day. If the month of the next day is a 2 (as extracted by the DATEPART function), then we're still in February so it must be a leap year! If not, it is not a leap year.

Here are a few examples:

select dbo.fn_IsLeapYear(1900) as 'IsLeapYear?'
select dbo.fn_IsLeapYear(2000) as 'IsLeapYear?'
select dbo.fn_IsLeapYear(2007) as 'IsLeapYear?'
select dbo.fn_IsLeapYear(2008) as 'IsLeapYear?'

As you can see, sometimes you can leverage the SQL Server engine to do some heavy lifting for you!

Saturday, July 05, 2008

Sony Computer Entertainment - Playstation 9

Super Cool Ads by Sony Computer Entertainment - Playstation 9 A superb cool advertisement from Sony Computer Entertainment for their Playstation 9 (PS9), which the company claims will be released in year 2078. Watch the video here see what the future holds >>

Cool Stuff: Sony Playstation 9

Friday, July 04, 2008

Weekly Quote - Freedom, Entrepreneurism & Enthusiasm


Quotes, Motivation, Personal Development,Freedom, Entrepreneurism, Enthusiasm, John Adams, Mark Victor, Mark Twain, Weekly Quote, Quotable Quote, Famous Word FREEDOM
“We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights that among these are Life, Liberty and the pursuit of Happiness.” ~The Declaration of Independence
“In order to live free and happily you must sacrifice boredom. It is not always an easy sacrifice.” ~Richard Bach
Posterity! You will never know how much it cost the present generation to preserve your freedom! I hope you will make good use of it! (letter to Abigail Adams, April 26, 1777) ~John Adams
“These are the times that try men’s souls. The summer soldier and the sunshine patriot will, in this crisis, shrink from the service of their country; but he that stands it now, deserves the love and thanks of man and woman.” ~Thomas Paine
Read more ..

Quotes of the Week - Freedom, Entrepreneurism & Enthusiasm

Thursday, July 03, 2008

DotA: WoWt DotA All-stars v6.52d Map

DotA: WOW DotA All-Stars v6.52d Map Free Download Link

World of Warcraft DotA v6.52d Map Download Link, Warcraft,   WOW,   Gaming, Download , Dota-Allstars, Spirit Bear, v6.49b ,   v6.43b,   AI Maps, 6.52c Map, Download Check out the Latest World Of Wwarcraft Dota-Allstars map is out.. here’s the change logs and download links of DotA v6.52d map at the end of the post .. Enjoy the maps download here >>

DotA: World of Warcraft DotA Allstars v6.52d Map Download Link

Tuesday, June 24, 2008

SQL Tips: Calculating Mathematical Values in SQL Server

Problem
In our application we have the need to perform mathematical calculations. Right now we are doing so in our front end application. Unfortunately we are starting to experience performance problems with large data sets and differences in calculations due to developers using different logic. We are seeking some other options to perform the calculations. Does SQL Server perform basic mathematical calculations?

Solution
Yes - SQL Server can perform basic addition, subtraction, multiplication and division. So if you need some of those basic building blocks those are available and we will walk through some examples in this tip. In addition, SQL Server can calculate SUM, COUNT, AVG, etc. For these type of calculations, check out SQL Server T-SQL Aggregate Functions. To address the multiple code issues, I would recommend researching stored procedures. This tip Getting started with SQL Server stored procedures is probably a good place to start.

In this tip, let's focus on some basic building blocks to perform your calculations with the T-SQL language. Here are the examples we will cover:

  • Calculations on Values
  • Calculations on Parameters
  • Calculations on Columns
  • Calculations in Computed Columns

Calculations on Values

As a starting point, values themselves can have mathematical operations performed on them. So in the code below we are performing addition (+), subtraction (-), multiplication (*), division (/) and a combination of operations. In these examples, both positive and negative whole numbers and decimals are used. The value calculated by the statement is below the code to serve as a point of reference. Review and copy the code into a SQL Server 2005 Management Studio window to get a feel for these calculations. Certainly this list is not comprehensive, so feel free to test some operations in your applications or from your experiences.

Calculations on Values
-- Example 1 - Addition (+)

SELECT 1 + 1
-- = 2

SELECT 1 + 2 + 3 + 4 + 99 + 704
-- = 813

SELECT 1.5 + 1.5
-- = 3.0

SELECT .25678 + .00096356
-- = 0.25774356

SELECT 1.75 + -2.25
-- = -0.50

-- Example 2 - Subtraction (-)

SELECT 1 - 1
-- = 0

SELECT 918 - 704
-- = 214

SELECT 3.2 - 1.9
-- = 1.3

SELECT 1.9 - 3.2
-- = -1.3

SELECT 9 - 3 - 3
-- = 3

SELECT .75 - .68
-- = 0.07

-- Example 3 - Multiplication (*)

SELECT 1 * 1
-- = 1

SELECT 2 * -4
-- = -8

SELECT 2 * 5 * 10
-- = 100

SELECT 1.25 * 3
-- = 3.75

SELECT .4 * .5
-- = .20

-- Example 4 - Division (/)

SELECT 1/2
-- = 0

SELECT 1.0/2.0
-- = 0.500000

SELECT 0/5
-- = 0

SELECT 100/12
-- = 8

SELECT 100.0/12.0
-- = 8.333333

SELECT -75.0/4.5
-- = -16.666666

SELECT .5/.1
-- = 5.000000

-- Example 5 - Combination

SELECT ((100 + 100) * .05)
-- = 10.00

SELECT (10 - 5)/2
-- = 2

SELECT (10.0 - 5.0)/2.0
-- = 2.500000

SELECT ((100 + 100) - (50 + 50))
-- = 100

Calculations on Parameters

Since we have covered the bulk of the calculations in the section above let's just focus on a few different operations to show how parameters with specific data types play an important role. Since this set of examples are not comprehensive, feel free to copy the code below into a SQL Server 2005 Management Studio window and test the code with some of your own logic.

Calculations on Parameters

-- Variable declaration
DECLARE
@i1 int
DECLARE
@i2 int
DECLARE
@i3 int
DECLARE
@d1 decimal(10,2)
DECLARE
@d2 decimal(10,2)
DECLARE
@d3 decimal(10,2
)

-- Initialize variables
SET
@i1 = 100
SET
@i2 = 75
SET
@i3 = 50
SET
@d1 = 1.5
SET
@d2 = 5.5
SET
@d3 =
.575

-- Example 1 - Addition (+)
SELECT
@i1 + @i2 + @i3 + @d1 + @d2 + @d3
-- = 232.58

SELECT @d2 + -@d3
-- = 4.92

-- Example 2 - Subtraction (-)
SELECT
@i2 - @i3
-- = 25

SELECT @d2 - @d3
-- = 4.92

-- Example 3 - Multiplication (*)
SELECT
@i2 * @i3
-- = 3750

SELECT @d2 * @d3
-- = 3.1900

-- Example 4 - Division (/)
SELECT
@i2 / @i3
-- = 1

SELECT @d2 / @d3
-- = 9.4827586206896

-- Example 5 - Combination
SELECT
((@i1 + @i2) * @d2)
-- = 962.50

SELECT ((@i1 + @i2) - (@d1 + @d2))
-- = 168.00

Calculations on Columns

Another option is to calculate the values based on a SELECT statement as the example below shows. If the data is in 1 or more columns, this approach eliminates the need to calculate the values based on additional parameters or logic.

Calculations on Columns

-- Sample Table
CREATE
TABLE dbo.CalculationExample(
ProductID int NOT NULL,
Cost decimal(10,2) NOT NULL)
GO

-- Populate Table
INSERT INTO dbo.CalculationExample (ProductID, Cost)
SELECT 1, 100.00
UNION
SELECT
2, 50.00
UNION
SELECT 3, 25.00
GO

-- Verify Insertion
SELECT *
FROM dbo.CalculationExample
GO

-- Declare Variables
DECLARE @MarginPercent decimal(10, 2)
DECLARE @TaxPercent decimal(10, 2)

-- Initialize Variables
SET @MarginPercent = .20
SET
@TaxPercent = .05

-- Calculate Values
SELECT
ProductID,
Cost
,
Cost
* @MarginPercent AS 'Margin',
Cost
* @TaxPercent AS 'Tax',
Cost
+ (Cost * @MarginPercent) + (Cost * @TaxPercent) AS 'FinalCost'
FROM
dbo.CalculationExample
GO

Calculations in Computed Columns

Let's take those same calculations and now move them to computed columns in the table. Here is that example:

Calculations in Computed Columns

CREATE TABLE [dbo].[CalculationExample_ComputedColumns](
[ProductID] [int]
NOT NULL,
[Cost] [decimal]
(18, 0) NOT NULL,
[Tax]
AS ([Cost]*(0.05)),
[Margin]
AS ([Cost]*(0.20)),
[FinalCost]
AS (([Cost]+[Cost]*(0.20))+[Cost]*(0.05)),
CONSTRAINT [PK_CalculationExample_ComputedColumns] PRIMARY KEY CLUSTERED
(

[ProductID]
ASC
)
WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
)
ON [PRIMARY]

-- Populate Table
INSERT INTO dbo.CalculationExample_ComputedColumns (ProductID, Cost)
SELECT 1, 100.00
UNION
SELECT
2, 50.00
UNION
SELECT 3, 25.00
GO

-- Review the values
SELECT *
FROM
dbo.
CalculationExample_ComputedColumns
GO


Saturday, June 07, 2008

BMW GINA Light Visionary Photos

amazing, autoworld, bmw, car, cool-stufff, crazy, gadget, geometry-and-functions-n-adaptations, gina, light-visionary, modern-car, photos, skin, stuff The BMW GINA (Geometry and Functions in ‘N’ Adaptations) Light Visionary concept is BMW’s future-focused design study on the possibilities offered by flexible coverings. Based on a 2-seater roadster platform, GINA’s revolutionary exterior has allowed its designers to do away with the traditional body panel approach, concentrating on visual and structural lines rather than full body pieces. Check out more photos >> Cool Stuff: BMW GINA (Geometry and Functions in ‘N’ Adaptations) Light Visionary Photos

Health Tips: How to identify FAKE fish oil before you buy it

  Identifying   fake fish oil   before buying it is crucial to ensure you’re getting a high-quality product that delivers the health benefit...