16 December 2007

Web Hosting

Web Hosting

* The Web is a network of computers all over the world.
* All the computers in the Web can communicate with each other.
* All the computers use a communication standard called HTTP.
* Web information is stored in documents called web pages.
* Web pages are files stored on computers called web servers.
* Computers reading the web pages are called web clients.
* Web clients view the pages with a program called a web browser.
* Popular browsers are Internet Explorer and Mozilla Firefox.
* A browser fetches a page from a web server by a request.
* A request is a standard HTTP request containing a page address.
* An address may look like this: http://www.someone.com/page.htm.
* All web pages contain instructions for display
* The browser displays the page by reading these instructions.
* The most common display instructions are called HTML tags.
* HTML tags look like this

This is a Paragraph

.
* The collection of all your web pages is called your web site.
* To let others view your work, you must publish your web site.
* To publish your work, you must copy your site to a web server.
* Your own PC can act as a web server if it is connected to a network.
* Most common is to use an Internet Service Provider (ISP).
* ISP stands for Internet Service Provider.
* An ISP provides Internet services.
* A common Internet service is web hosting.
* Web hosting means storing your web site on a public server.
* Web hosting normally includes email services.
* Web hosting often includes domain name registration.

If you want other people to view your web site, you must copy your site to a public server. Even
if you can use your own PC as a web server, it is more common to let an Internet Service
Provider (ISP) host your site.

Included in a Web hosting solution you can expect to find domain name registration and
standard email services.

Internet Service Providers are specialists on web hosting. Expect their servers to have more
than 99% up time, the latest software patches, and the best virus protection.

Things to Consider

24-hour support
Daily Backup
Traffic Volume
Bandwidth or Content Restrictions
Email Capabilities
Front Page Extensions
Database Access

What is a Domain Name?

A domain name is a unique name for a web site, like microsoft.com and w3schools.com.
Domain names must be registered. When domain names are registered they are added to a
large domain name register, and information about your site
- including your internet IP address
- is stored on a DNS server.

DNS stands for Domain Name System. A DNS server is responsible for informing all other
computers on the Internet about your domain name and your site address.

Common Hosting Technologies
Windows Hosting
Unix Hosting
Linux Hosting
CGI
ASP - Active Server Pages
Chili!Soft ASP
JSP
FrontPage
PHP
Cold Fusion
Secure Server

Database-driven web sites
Web Databases
Using the SQL Language
SQL Server
Oracle
Access
MySQL

Hosting can be FREE, SHARED or DEDICATED

Your Checklist
Before you choose your web host, make sure that:
* The hosting type suits your current needs
* The hosting type is cost effective
* Upgrading to a better server is a possible solution
* If needed, upgrading to a dedicated server is possible

Web Hosting E-Commerce

Your Checklist

* How does it handle customers?
* How does it handle product catalogs?
* How does it handle orders?
* How does it handle inventory?
* How does it handle back orders?
* How does it handle shipment?
* How does it handle accounts?
* How does it handle billing?
* How does it handle payment?
* How does it handle foreign currency?
* How does it handle credit cards?
* How does it handle taxes?
* How does it handle security?
* How does it handle integrity (encryption)?

Also check if the most time-consuming tasks are automated. Look for automated billing, invoice handling, accounting, and report generation.

Before you sign up a contract with any hosting provider, surf some other e-commerce sites on their servers. Find out how it works. Actually try some shopping and see if you get a good feeling. Also compare the other sites against yours, to see if it looks like you have the same needs. Contacting some of the other customers is also a valuable option.

15 December 2007

Eye Care Tips

Helpful Tips on Eye Care

With so many of us spending lots of time in front of the computer every day it comes to
no surprise that research is showing a rise in visual problems. What can one do?
First, it's important to find out how you can protect your eyes through eye health
exams and by making a few minor changes in your computer viewing habits.



Here are some helpful Eye Care Tips -

Positioning is everything

Correct positioning of your computer, keyboard and typing copy is essential. Your screen should be positioned about an arm's length from your eyes and 20 degrees below eye level. Consider foot and wrist rests for added comfort.

Lighting can make all the difference

Room lighting should be diffuse, not direct, to reduce glare and reflections from your screen. Look into an internal or external glare screen and be sure to set your colour, contrast and brightness levels to suit you.

A little extra help for your glasses

Anti-reflective coatings on the lenses of your glasses can be applied by your optometrist to reduce discomfort and to ease reduced vision from bright and/or flickering light sources such as VDTs and fluorescent lights. And don't forget, your doctor of optometry can talk to you about eyeglasses designed specifically for people who use computers a lot.



Take time out, our 20-20-20 rule


Step I :-
After every 20 minutes of looking into the computer screen, turn your
head and try to look at any object placed at least 20 feet away. This
changes the focal length of your eyes, a must-do for the tired eyes.


Step II :-
Try and blink your eyes for 20 times in succession, to moisten them.


Step III :-
Time permitting of course, one should walk 20 paces after every 20 minutes
of sitting in one particular posture. Helps blood circulation for the entire body.

It's all in the blinking

Did you know that on average we blink 12 times per minute? But wait, did you know that when we're on the computer we only blink 5 times per minute? That can add up to dry eyes. Relieve the discomfort by using artificial tear drops or gels and remember to blink!


Palming

Sit straight at your workstation and rub your palms against each other till you feel them warm. The warmth of your palms helps soothe and relax tired eyes. Then, lightly cup your eyes with your palms and relax for 60 seconds. Count the seconds in your mind. Repeat this exercise two to three times whenever your eyes feel tired, or as often as you want. While palming, you can either rest your elbows on your desk or keep away from the desk and cup your eyes. Both ways are fine.

Splash water on your face

During breaks, splash water on your face while closing your eyes. This has an overall relaxing effect and helps you feel refreshed.

Use tea bags

Keep two used tea bags in the refrigerator before you leave for work. Once you are home, place the tea bags on your eyes for a few minutes as you relax. This not only soothes tired eyes, but also reduces puffiness.



Eat healthy

Incorporate Vitamins A, C, and E on a daily basis; eat citrus fruits, green leafy veggies, tomatoes, spinach, poultry and dairy products. Pack a box of chopped carrots, cucumber and fresh fruits and munch in-between meals at the office.

14 December 2007

PHP Session Timeout

ini_set('session.gc_maxlifetime', 20);
ini_set('session.gc_divisor', 1);

session_start();

if(isset($value))
{
$value++;
}
else
{
session_register('value');
$value = 1;
}

Print "You have been here $value times.
";

print 'Refresh';

?>

11 December 2007

Drag and Drop Example

http://www.webreference.com/programming/javascript/mk/column2/3.html

http://www.dhtmlgoodies.com/scripts/dragable-boxes/dragable-boxes.html

http://www.ajaxpath.com/drag-and-drop/

26 October 2007

Free Resources

http://www.namepros.com/free-resources/

Read and listen books online: http://www.openlibrary.org/

http://www.copyscape.com/

27 September 2007

Function Vs Alias in PHP


Some useful information in PHP. It will help you to choose right function and increase the speed of your php page by a bit.
1. ini_alter And ini_set

Lets look at modifying the environment. I actually cheated here and just set the max execution time to 60 seconds a million times. I think the result is still valid though

ini_alter and ini_set
ini_alter: 103.332370043 seconds
ini_set: 86.2883789539 seconds
Time saved: 17.0439910889 seconds; 19.7523598143%
2. doubleval And floatval

Both these functions allow you to quickly pick a float, or double, out of a string.

doubleval and floatval
doubleval: 4.56571412086 seconds
floatval: 4.35375285149 seconds
Time saved: 0.211961269379 seconds; 4.8684727087%

4% or 211 nanoseconds is next to nothing. I would want to use floatval but I wouldn't exactly be kicking myself if I slipped a doubleval into my code instead.
3) sizeof and count
Count = counts elements of an array.
sizeof - is an alias of count.
They can both be used to count the number of items in an array but does one do it better?
The count function was over 12% faster in this test. Both functions are fast though taking 3-4 microseconds to count an array with 100,000 items.
4. is_int and is_integer
is_int is faster than is_integer so again the shorter function name wins
5. fwrite and fputs

So far all the functions have been running fast anyway so the difference haven't been that significant but things are starting to get interesting with the run time jumping to 20-24 microseconds to write a short string to a file.

fwrite and fputs
fwrite: 24.9826359749 seconds
fputs: 20.1990799904 seconds
Time saved: 4.7835559845 seconds; 23.6820488199%

With a difference of over 4 microseconds you could run both fputs and floatval in the time it takes to run fwrite. The difference is over 23% which clearly makes fputs the better function. It's shorter as well.
6. chop and rtrim

chop and rtrim
chop: 4.73731994629 seconds
rtrim: 4.41647195816 seconds
Time saved: 0.320847988129 seconds; 7.26480301852%

rtrim is a little faster and these functions take longer at a little over 4 microseconds.

7. implode and join

Both these functions allow you to convert an array into a string. implode is the opposite of explode and join allows you to join the items in an array with a 'glue' string. In this case the array had 100 items.

implode and join
implode: 47.2712550163 seconds
join: 50.1287050247 seconds
Time saved: 2.85745000839 seconds; 5.70022705949%

5% doesn't seem like all that much but 2 microseconds shouldn't be ignored.


As might be expected these functions are expensive when it comes to execution time. That 17 microsecond saving is massive as well making ini_set the superior choice.
In general, using a non-alias function if faster than using an alias

20 August 2007

PHP Assertion function for testers

PHP actually has an assertion tester built-in:

assert

(PHP 4, PHP 5)

assert — Checks if assertion is FALSE

Description

bool assert ( mixed $assertion )

assert() will check the given assertion and take appropriate action if its result is FALSE.

If the assertion is given as a string it will be evaluated as PHP code by assert(). The advantages of a string assertion are less overhead when assertion checking is off and messages containing the assertion expression when an assertion fails. This means that if you pass a boolean condition as assertion this condition will not show up as parameter to the assertion function which you may have defined with the assert_options() function, the condition is converted to a string before calling that handler function, and the boolean FALSE is converted as the empty string.

Assertions should be used as a debugging feature only. You may use them for sanity-checks that test for conditions that should always be TRUE and that indicate some programming errors if not or to check for the presence of certain features like extension functions or certain system limits and features.

Assertions should not be used for normal runtime operations like input parameter checks. As a rule of thumb your code should always be able to work correctly if assertion checking is not activated.

The behavior of assert() may be configured by assert_options() or by .ini-settings described in that functions manual page.

The assert_options() function and/or ASSERT_CALLBACK configuration directive allow a callback function to be set to handle failed assertions.

assert() callbacks are particularly useful for building automated test suites because they allow you to easily capture the code passed to the assertion, along with information on where the assertion was made. While this information can be captured via other methods, using assertions makes it much faster and easier!

The callback function should accept three arguments. The first argument will contain the file the assertion failed in. The second argument will contain the line the assertion failed on and the third argument will contain the expression that failed (if any - literal values such as 1 or "two" will not be passed via this argument)

Parameters

assertion

The assertion.

Return Values

FALSE if the assertion is false, TRUE otherwise.

Examples

Example 1805. Handle a failed assertion with a custom handler

// Active assert and make it quiet
assert_options(ASSERT_ACTIVE, 1
);
assert_options(ASSERT_WARNING, 0
);
assert_options(ASSERT_QUIET_EVAL, 1
);

// Create a handler function
function my_assert_handler($file, $line, $code
)
{
echo
"
Assertion Failed:
File '$file'

Line '$line'

Code '$code'

"
;
}

// Set up the callback
assert_options(ASSERT_CALLBACK, 'my_assert_handler'
);

// Make an assertion that should fail
assert('mysql_query("")'
);
?>

09 July 2007

PHP Sending mails with HTML formats

$mheaders = "MIME-Version: 1.0\r\n";
$mheaders .= "Content-type: text/html; charset=iso-8859-1\r\n";
$mheaders .= "From: info@site.com\r\n";
$mheaders .= "Bcc: info@site.com\r\n";
mail($to, $subject, $handle, $mheaders);

02 July 2007

How to password protect a virtual directory in IIS?

Create a virtual directory in IIS
Create a user in the system. Right click on “My Computer” > Manage > Create a user

Go to IIS

Right click on your virtual directory that you want to protect with password.

Go to “Directory Security” tab > Edit Anonymous access and authentication control
Ø Deselect “Anonymous Access” check box
Ø Select basic authentication password checkbox
Ø Set “Yes” for prompted message box.
Ø No need to go in its “Edit” button.

18 June 2007

Website Development Life Cycle

1. Analysis:

Input: Interviews with the clients, Mails and supporting docs by the client, Discussions Notes, Online chat, recorded telephone conversations,Model sites/applications etc.,

Output: 1. Work plan, 2. Cost involved, 3. Team requirements, 4. Hardware-software requirements, 5. Supporting documents and 6. the approval

2. Specification Building:

By covering up each and every element of the requirement.
For example if the product is a web site then the modules of the site including general layout, site navigation and dynamic parts of the site should be included in the spec.
After reviewing and approving the preliminary document, a written proposal is prepared, outlining the scope of the project including responsibilities, timelines and costs.

Output: Complete requirement specifications to the individuals and the customer/customer's representative

3. Design and development:

Work on the web site is scheduled upon receipt of the signed proposal, a deposit, and any written content materials and graphics you wish to include.

Show two or three design with all images and navigation.

The team should develop test plans and procedures for quality assurance.

In parallel the Database team will sit and understand the requirements and develop the database with all the data structures and sample data will also be prepared.

Output: Site design with templates, Images and prototype

4. Content writing:

Output: Site with formatted content

5. Coding:

Input: The site with required forms and the requirement specification

Output: Database driven functions with the site, Coding documents

6. Testing:

Input: The site, Requirement specifications, supporting documents, technical specifications and technical documents. Consider client's all the given requirement and evaluate the site based on it.

Output: Completed application/site, testing reports, error logs, frequent interaction with the developers and designers

7. Promotion:

Input: Site with content, Client mails mentioning the competitors

Output: Site submission with necessary meta tag preparation

8. Maintenance and Updating:

13 June 2007

Domain tool

In order to get best and all the possible information about web site statistics, use given below url:

http://whois.domaintools.com/websiteurl.com

12 June 2007

ASP CDO Mails

Set myMail=CreateObject("CDO.Message")
myMail.Subject=subject
myMail.From=strfromemail
myMail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing 'Name or IP of remote
SMTP server
myMail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver") _ ="smtp.com" 'Server port

myMail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") _ =25

myMail.To=strtoname
myMail.HTMLBody=body
myMail.Configuration.Fields.Update
myMail.Send

11 June 2007

Standard format for requirement document

Page 1:
Company name / project’s title as header
Page no / total page as footer

Project tile highlighted
Document history

Page 2:
Table of content

Page 3:
Scope (of work)

Page 4:
Site map ideally columns should be top, level1, level2, level3 and name of the code file.

for ex.,
Home > Login (login.aspx)
> Campaign details > Add campaign (add.php)
> View Campaign(listcampaign.php) > Delete campaign(delete.php)
> Modify campaign (edit.php>

Page 5:
Screen detail.
For ex., Screen: Index (home page), Brief description, inputs, process, output, tables_referred

Page 6:
Database structure

Web 2.0

Web 2.0
- coined by oreilly media in 2003 and popularized in first web 2.0 conference in 2004
- refers to a second generation fo web based communities and hosted services

Web 2.0 is like a business revolution in computer industry with the internet as a platform


Characteristics
- rich, interactive and user friendly interface baseon AJAX
- some social networking aspects

Technology overview
- rich internet application technique based on ajax
- css
- valid xhtml
-syndication and agreegation of RSS
- clean and meaningful url

Given the lack of set of standards to what "Web 2.0" means, implies and requires, the term has different meaning to different peoples.

09 June 2007

Find a control on a page

TextBox b = Page.FindControl("TextBox1") as TextBox;
if(b != null)
{
Response.Write("Found TextBox1 on Button1_Click
");
}

07 June 2007

Gradient like Background color

style="filter:progid:DXImageTransform.Microsoft.Gradient(endColorstr='#8F7E7E', startColorstr='#372D2E', gradientType='0');"

01 June 2007

Some time management Skills

How can you take control of your time and your life? Be more efficient and maximize the time in your day by making the commitment to make time for what matters.


1. Don't know where to start? Make a "Master To Do" list. Make a list of all the things you do every day, of current projects, and of future projects. Categorize these items into work, family, and personal time. Keep several copies of your Master To Do list - in your planner, in your desk drawer, and in your purse or briefcase- so that you can refer to it as necessary and to serve as a reminder of how important your time is to you.

2. Plan your day using your Master To Do list. Prioritize. What must be done? What can be rescheduled, delegated, or deleted? Eliminate or delegate trivial tasks.

3. Review your plan. Is it realistic? Are you trying to do too much?

4. At the end of each day, plan the next day. This helps you feel more organized and in control.

5. Follow your own organizational style. Does the thought of a To Do list make you sweat? Use color and pictures, piles, or boxes to organize your life in a way that makes sense to you. Day Planners, To Do lists, and other time management tools won't do you any good if you aren't using them.

6. For those of you who like calendars, planning books, and the like make sure you are using them to their maximum advantage. For example, use abbreviations, write down anniversaries and birthdays, keep track of your goals, record notes and ideas, upcoming appointments, meetings, school events, vacations, business trips, etc.

7. Set goals that are specific, measurable, realistic, and achievable- they give you purpose and direction. What do you want to accomplish? When?

8. Be flexible. Allow time for interruptions and distractions. When you expect to be interrupted, plan routine tasks. Save larger blocks of time for your priorities.

9. Use your body's prime time to your advantage. Which time of day are you at your best? Are you a "morning person," a "late afternoon whiz," or a "night owl?" Plan to use this time of day (if possible) for your priorities and be more effective.

10. Identify what the right thing to do is, and then focus on doing it right. This goes a long way towards improving your personal efficiency.

11. Assign deadlines to important priorities to keep them from becoming last-minute emergencies.

12. Avoid perfectionism- as this can be a form of procrastination- sometimes good enough is good enough.

13. To avoid procrastination, break a task into smaller tasks and work on one task for 15 minutes. The logic behind this method is that if you do a little at a time, eventually you'll reach the point where you'll want to finish.

14. Learn to say "No" by focusing on the importance of your goals. If necessary, schedule personal time for priorities such as friends, family, and you. 15. Reward yourself for achieving your goals. Balance your life with fun.



31 May 2007

Generate Great Ideas at Work

Success at work is often a result of combining knowledge, skills and the ability to inject your work environment with fresh and breakthrough ideas.

Exercise your mind

Your mind, like your body, needs exercise and can get it through challenges and problem-solving. A good way to feed your mind is to read a lot and study the success stories of other businesses and entrepreneurs.

Read case studies related to your industry or biographies of successful people.

This will not only stimulate your grey cells but also provide you a dose of inspiration. Learn how other successful people generate breakthrough ideas.

Capture your thoughts

When the brilliant spells do come, make sure you capture them. Don't rely on mental notes, you'll surely forget them. Have a notepad, PDA or voice recorder ready at all times, even next to your bed at night (who knows, you may suddenly strike gold at 2 am). Once you've recorded your idea, use it as soon as you can. I read an advertisement for IT company Accenture, which said: "An idea is like a cup of coffee, it's not going to stay hot forever." So remember that ideas are best when they're fresh.

Change your setting

Your mind reacts to its surroundings and has an uncanny ability to generate new ideas when the physical setting changes. You may be thinking in a very linear and academic way while you are at your workstation, so take your laptop/PDA and sit by in your office garden/park or cafeteria and you may see some fresh perspectives. Take a walk or hit the gym. The mind is agile when the body is indulging in a disciplined and rhythmic physical activity like a jog or workout. For all you know, a change of setting may bring you the inspiration you need.

Go out of your way to help others

Step out of your job description once in a while and help others with their tasks. Do this without having to be asked. Saying, "Need a hand there?" has a two-fold effect. First, you encourage others to give of themselves, creating a more positive workplace.

Second, you buy yourself a future favour, since kindness always comes back. The people you have helped will become soundboards for your ideas and will be able to give you new ideas and suggestions that may get you thinking on a new track.

Know your organisation's and customers' needs

You must know if what you have to offer is in high demand at work. Find out the direction in which your company is headed and the areas in which it needs maximum improvement. This will ensure that you ideas have a business impact and act as a catalyst in your growth within the organisation. Tailor your ideas to meet the organisational objectives and you will be in a position to add maximum benefit to your organisation.

Understand your work environment
In today's teamwork-oriented work environments, no man is an island. You are always a part of the bigger picture that the organisation has in mind. Expose yourself to different realities.

Google.com founders Larry Page and Sergey Brin were batchmates at Stanford when the thought of empowering people by creating an easy search mechanism hit them. The Naukri.com advertisement depicting Hari Sadu as the monster boss is a good example of out-of-the-box thinking, because it mixes humour with a message.

So keep your eyes and ears open and indulge in some idea generation activities.

29 May 2007

TEAM Works

There are few jobs that don't require us to interact with colleagues in a team. For the most part, we need to work cohesively with others at our workplaces to achieve the organisational goals.

Participate

Whether it is meetings, brainstorming sessions, conference calls or any other activities, it is important that you participate wholeheartedly. If someone puts forward an idea, ask questions without restraint.

Speak your mind freely but, of course, remember to be inoffensive.

Keep the common goal in mind

The formal definition of teamwork is 'cooperative effort' by the members of a group or team to achieve a common goal.

Be open-minded

Often, you may put forth ideas that will be mulled over by the team as a whole and may eventually be rejected. Be broad-minded and confident enough to accept this. Use this opportunity to get feedback on your ideas such that it helps improve your thinking process for the future.

Be clear about your role

Help your teammates and your leader

If your peer is stuck with a problem he or she can't resolve alone, assist him in solving the issue by all means. Of course, this doesn't mean you do all his work for him or even that you neglect your own duties completely.

One of the best ways to help your supervisor is to keep him or her updated at all times about the percentage completion of your work. It may be a short daily e-mail, or even a daily status meeting by which you can do this.

Don't be the dominating one

If one person takes up the floor and tries to steamroll others with his ideas, it can only have a negative effect. The team member who does this is usually the most annoying person, who tries to force his ideas and opinions on everyone.


Don't forget to have fun!

A team should always take the opportunity to meet in a relaxing unofficial environment where there is no talk of a project or its problems, even if it means just going to the office canteen for a cup of coffee.

Always remember the other popular expansion of TEAM: Together Everyone Achieves More.

28 May 2007

Never overlook a customer complaint!!!

An Interesting Story

Never underestimate your Clients' Complaint, no matter how funny it might seem!

This is a real story that happened between the customer of General Motors and its Customer-Care Executive. Pls read on.....

A complaint was received by the Pontiac Division of General Motors:

'This is the second time I have written to you, and I don't blame you for not answering me, because I sounded crazy, but it is a fact that we have a tradition in our family of Ice-Cream for dessert after dinner each night, but the kind of ice cream varies so, every night, after we've eaten, the whole family votes on which kind of ice cream we should have and I drive down to th e store to get it. It's also a fact that I recently purchased a new Pontiac and since then my trips to the store have created a problem.....

You see, every time I buy a vanilla ice-cream, when I start back from the store my car won't start. If I get any other kind of ice cream, the car starts just fine. I want you to know I'm serious about this question, no matter how silly it sounds "What is there about a Pontiac that makes it not start when I get vanilla ice cream, and easy to start whenever I get any other kind?" The Pontiac President was understandably skeptical about the letter, but sent an Engineer to check it out anyway.

The latter was surprised to be greeted by a successful, obviously well educated man in a fine neighborhood. He had arranged to meet the man just after dinner time, so the two hopped into the car and drove to the ice cream store. It was vanilla ice cream that night and, sure enough, after they came back to the car, it wouldn't start.

The Engineer returned for three more nights. The first night, they got chocolate. The car started. The second night, he got strawberry. The car started. The third night he ordered vanilla. The car failed to start.

Now the engineer, being a logical man, refused to believe that this man's car was allergic to vanilla ice cream. He arranged, therefore, to continue his visits for as long as it took to solve the problem. And toward this end he began to take notes: He jotted down all sorts of data: time of day, type of gas uses, time to drive back and forth etc.

In a short time, he had a clue: the man took less time to buy vanilla than any other flavor. Why? The answer was in the layout of the store. Vanilla, being the most popular flavor, was in a separate case at the front of the store for quick pickup. All the other flavors were kept in the back of the store at a different counter where it took considerably longer to check out the flavor.

Now, the question for the Engineer was why the car wouldn't start when it took less time. Eureka - Time was now the problem - not the vanilla ice cream!!!! The engineer quickly came up with the answer: "vapor lock".

It was happening every night; but the extra time taken to get the other flavors allowed the engine to cool down sufficiently to start. When the man got vanilla, the engine was still too hot for the vapor lock to dissipate.

Even crazy looking problems are sometimes real and all problems s4eem to be simple only when we find the solution, with cool thinking.

What really matters is your attitude and your perception.

25 May 2007

Datagrid Event Property

Use datagrid's event property tab in order to add edit event.

ACE Personal Interview

The key to acing personal interviews lies in doing an objective analysis of what you have done in the past, what you are doing presently and finally what you intend to do in the future. Visualise yourself doing well, practise a lot and success will be yours.

Well, here's some food for thought.

Extra-curriculars/ Hobbies
Extra-curricular activities can be broadly defined as activities that are pursued formally, apart from your academic or curricular activity. For example, you could have participated in debates, dramatics or some sports along with your formal education.

Hobbies, on the other hand, are activities you are really passionate about and will do anything to follow. In a nutshell, the difference between an extracurricular activity and a hobby is the level of passion involved.

Do some serious introspection over your extracurricular activities and/ or hobbies. Try and formulate answers to the following questions:
- What have I learnt from this activity?
- Is there any synergy between this activity and my chosen profession? If so, how?
- How will I continue with this activity after I start work, when I am faced with time constraints?
- What does this activity/ hobby say about me as a person?

If hobbies are 'things you are really passionate about', it is expected you will brush up your knowledge about them.

General awareness
This area may or may not be touched upon, but if it is, the purpose is to check how alive and sensitive the candidate is to his socio-political and economic ecology. The purpose may also be to check the candidate's maturity and reasoning ability.

At this stage, you should know the difference between General Knowledge and General Awareness.

Knowing the name of the island in which Tokyo is based is general knowledge. Understanding the difference between Fundamental Rights and Directive Principles of state policy is general awareness. To cite another example, knowing the name of the wind blowing across the Alps is GK, while understanding the problems caused by terrorism is GA.

Career goals
-What you need to do is to spend some time thinking:
-What made you choose your undergraduate stream?
-Why (if at all) are you moving away from pursuing higher studies/ career in that field?
-Why are you interested in management as a career?
-When and how did you first become interested in management?
-What specialisation within management would interest you (given your knowledge and inclinations at present)?
-What are your plans after an MBA?
-Where do you see yourself five years down the line?
-Where do you see yourself 10 years down the line?

Personality
Personality is an outward manifestation of your character. Personality can be developed or groomed; character is more internal. Thinking on these lines will help you handle questions like:

-What are you like as a person?
-What are your strengths and weaknesses?
-Why do you think they are strengths and weaknesses?
-When have you demonstrated these strengths and weaknesses?
-What are you doing about your weaknesses? (When mentioning a weakness in the interview, always mention the action you are taking to get rid that weakness)
-How do you visualise success? What role does it play in your life?
-Has success changed you in any way? How?
-What are your priorities in life, and why?
-List down the three most important events in your life in chronological order. Please state your reasons for choosing these.
-What is your dream in life?
-Describe a personal or familial crisis that you had to go through in your life? How did you handle the crisis? What special qualities do you think you possess that helped you deal with the crisis?
-Who is your role model? Why?

24 May 2007

Stored procedure to send Mails in SQL

--All leave application should be answered within 48 hours at the maximum.
--Unanswered leave applications will go to Vishal/kanika straight away after 48 hours.
--Later you can use it in SQL Job as well

CREATE Procedure sn_SMTPMail
AS
SET nocount on

declare @oMail int --Object reference
declare @resultcode int

--EXEC @resultcode = sp_OACreate 'CDONTS.NewMail', @oMail OUT

if @resultcode = 0

BEGIN

DECLARE @t int
DECLARE @str varchar(200)
DECLARE cur CURSOR FOR Select id from tablename
OPEN cur FETCH NEXT FROM cur INTO @t WHILE @@FETCH_STATUS = 0 BEGIN SET @str = 'Leave id: ' + cast(@t as varchar(20)) + ' is due more than 48 hours. Please Take Appropriate Action. ' EXEC @resultcode = sp_OACreate 'CDONTS.NewMail', @oMail OUT EXEC @resultcode = sp_OASetProperty @oMail, 'From', 'janki_shah@yahoo.com'
EXEC @resultcode = sp_OASetProperty @oMail, 'To', 'jankit_shah@yahoo.com'
--EXEC @resultcode = sp_OASetProperty @oMail, 'HTMLBody', 0
EXEC @resultcode = sp_OASetProperty @oMail, 'Subject', 'Reminder'
EXEC @resultcode = sp_OASetProperty @oMail, 'Body', @str
EXEC @resultcode = sp_OAMethod @oMail, 'Send', NULL
EXEC sp_OADestroy @oMail

FETCH NEXT FROM cur INTO @t
END
CLOSE cur
DEALLOCATE cur

END
SET nocount off

GO

Remove Cache From ASPX page

Response.Cache.SetCacheability(HttpCacheability.NoCache)

23 May 2007

10 most important security issues and solutions in PHP (though I was able to get only 8)

Best way to prevent and handle all type of security issues is ‘not to trust user’s input data’ and handle it smartly.

a. Register Globals
1. With register_globals enabled, this page can be requested with ?authorized=1 in the query string to bypass the intended access controls. Without it, ordinary global variables (such as $authorized in the example) are not affected by data submitted by the client.

2. With register_globals enabled, this page can be requested with virtual address of a page and if allow_url_fopen is enabled (which it is by default) then this will include the output as a common local file, user can save the file on his / her desktop.A best practice is to initialize all variables and to develop with error_reporting set to E_ALL, so that the use of an uninitialized variable won't be overlooked during development.

b. Data Filtering
This is independent of programming language or platform. It involves the mechanism by which you determine the validity of data that is entering and exiting the application, and a good software design can help developers to:Options to ensure that data filtering can not be bypassed vary but one general approaches are given here.1. The Dispatch MethodTo have a single PHP script available directly from the web. Based on the information received, one can make conditional use of include file.for ex., if query string has a variable named about us then include aboutus.php and if it has value contactus then use contactus. Another ex., Each form that is submitted is expected to have a form variable named form that uniquely identifies it, and security.inc has a separate case to handle the data filtering for that particular formThis type of conditional include is not possible in ASP.

c. Session ID Protection
Session ID hijacking can be a problem with PHP Websites. The PHP session tracking component uses a unique ID for each user's session, but if this ID is known to another user, that person can hijack the user's session and see information that should be confidential. Session ID hijacking cannot completely be prevented; you should know the risks so you can mitigate them.A user who creates a new session by logging in should be assigned a fresh session ID using the session_regenerate_id function. A hijacking user will try to set his session ID prior to login; this can be prevented if you regenerate the ID at login.

d. Better inbuilt encryption functions
To encrypt any info is some times a crucial necessity in web page. PHP had MD5 as one of the standard encryption function. The benefit of this function is, it’s encrypted value can not easily be decrypted to original text. So chances for any hijacking of encryption’s originals text is very low.

e. Cross Site Scripting (XSS) Flaws
Cross site scripting, or XSS, flaws are a subset of user validation where a malicious user embeds scripting commands -- usually JavaScript -- in data that is displayed and therefore executed by another user.This can be prevented by using htmlspecialchars.

f. SQL Injection Vulnerabilities
SQL injection vulnerabilities are yet another class of input validation flaws.SELECT * FROM users WHERE name='$username' AND pass='$password';

However, if the user who's logging in is devious, he may enter the following as his password:

' OR '1'='1

This results in the query being sent to the database as:

SELECT * FROM users WHERE name='known_user' AND pass='' OR '1'='1';

This will return the username without validating the password -- the malicious user has gained entry to your application as a user of his choice. To alleviate this problem, you need to escape dangerous characters from the user-submitted values, most particularly the single quotes ('). The simplest way to do this is to use PHP's addslashes() function.If you're developing software that may be installed on shared servers where you might not be able to change the php.ini file, use code to check that status of magic_quotes_gpc and, if it is turned on, pass all input values through PHP's stripslashes() function. You can then apply addslashes() to any values destined for use in database queries as you would normally.

if (get_magic_quotes_gpc()){
$_GET = array_map('stripslashes', $_GET);
$_POST = array_map('stripslashes', $_POST);
$_COOKIE = array_map('stripslashes', $_COOKIE);
}The best habit is to make a reusable type of function for each input variable which can addslashes (if magic quotes are disabled) and also check max length and truncate all the characters after that length.

g. safe_mode
The safe mode setting can be very useful to prevent unauthorized access to local system files. It works by only allowing the reading of files that are owned by the user account that owns the executing PHP script. If your application opens local files often, consider enabling this setting.

h. disable_functions
This setting can only be set in your php.ini file, not at runtime. It can be set to a list of functions that you would like disabled in your PHP installation. It can help prevent the possible execution of harmful PHP code. Some functions that are useful to disable if you do not use them are system and exec, which allow the execution of external programs.

10 Advantages of PHP over ASP

Both ASP and PHP are languages used to build Dynamic Web sites that can interact with Databases and exchange information

a. PHP (Hypertext Pre-Processor) is an object oriented language. ASP is not really a language in itself, it's an acronym for Active Server Pages, the actual language used to programme ASP is Visual Basic Script or Jscript.

b. Online support is available for PHP while ms had dropped its support for ASP.

c. The PHP development team has an outstanding reputation for fixing bugs, and in order to streamline the process they even have an online system through which new bug reports can be submitted. Most bugs are resolved within 24 hours,

d. are a huge number of outstanding bugs in ASP which will probably never be fixed like ASP engine finishes its job of processing the code and then send the codes to users browser. From this point on words till again the page request comes back to server, there is no control of ASP on the page. So we should not expect ASP to perform some tasks which are likely to happen at the client browser end

e. PHP is both cross platform and open source, available for every major operating system and works with most web servers, while ASP works major on MS server.

f. You could make the point that PHP is a more mature language than ASP. ASP has only been around since 1996; PHP has been around since 1994, and has a huge base of developers working on it every waking minute of every day; bugs are usually fixed within minutes of being reported and new features are being integrated daily.

g. It is easily extendable by anyone capable of coding in C, and comes pre-bundled with more functionality than ASP could ever offer

h. Simple capabilities, such as FTP, data compression, file uploads, XML, MD5, encryption and email are not included in ASP and require expensive, third-party packages to be installed. All of this functionality and more are built right into PHP.

i. Complex functions such as dynamic images, IMAP, SNMP, dynamic flash, PDF, native access (non ODBC) to Oracle, Ovrimos, Postgre, Sybase, mSql, MSSQL, Ingres, Interbase and Informix databases, LDAP, and sockets, just to name a few, are available for free to any installation of PHP, but are not (and probably never will be) available with ASP.

j. ASP natively supports only Access and MSSQL, whereas PHP natively supports a huge number of databases.

k. MySQL is a database that PHP closely integrates with; it is a very powerful database that rivals Oracle in speed.

l. PHP, MySQL is free, and blows most other databases out of the water. Another hidden cost with ASP is the database angle; Microsoft expects you to develop using Access and when your webpage outgrows it, to switch to MSSQL, an extremely expensive option. What most people don't realize is how quickly you can outgrow Access.

m. While working with Access, you're technically limited to around 30 simultaneous connections, realistically it's closer to 5. Not many websites can survive such limitations. Most moderately sized websites require over 1000 simultaneous database connections. In addition, Access is SLOW. And you forego a lot of cool database functionality such as stability, transactions, replication, stored procedures, triggers, and so on. There are so many reasons not to use Access.

n. And finally, cost. PHP is free. ASP isn't free. If you want to use ASP, you have to use IIS, and if you want to use IIS, you have to buy Windows. Traditionally, the cost of Windows has been high. Microsoft has been aggressively trying to reduce this factor but they're hardly going to give Windows away for free. The cost of running an ASP-based website implies a full Windows server platform; development costs are higher, software licenses are expensive and speed, security and flexability are all sacrificed. but there are a couple of projects that allow ASP to run on other platforms and servers but guess what, most of them cost money.

o. PHP can be accessed by command prompt.

p. Perfomance and execution speed of a PHP script can be increased by Zend Optimizer whilest for ASP no such tools are available.

22 May 2007

Disadvantages of PHP

The most common and most severe security vulnerabilities in PHP scripts, and indeed in any Web application, are due to poorly validated user input

1) Calling External Programs
Call like system($userinput) or is insecure because it allows the user to execute arbitrary commands on the host.

2) Database Interactions
mysql_db_query
($DB, "SELECT something
FROM table WHERE name=$username");

In this example, the user can use a semicolon in the input to end the current query and supply arbitrary commands to the database. The input ";drop db database" will expand to the query string "SELECT something FROM table WHERE name=;drop db database", which will result in an error (because the first part of the query is now invalid) followed by a successful drop of the entire database.

3) URL Includes and Opens
include ("http://some.site.com/some_script.php");
It will know to fetch the file from the location and include it in your script. You can also open remote files for reading the same way. This can be potentially dangerous, since there is a possibility that the remote site is compromised or the network connection is spoofed. In either case, you are injecting unknown and possibly hostile code directly into your script with an include() like that

4) Unvalidated Input Errors
$month = $_GET['month'];

Here there is no such method to identify or handle this input variable. It can return in error.
The application works perfectly, as long as the specified month is a number between 1 and 12

However, a malicious user might append ";ls -la" to the year value and thereby see a listing of your Website's html directory. An extremely malicious user could append ";rm -rf *" to the year value and delete your entire Website!

Do not use Javascript validation for this; such validation methods are easily worked around by an exploiter who creates their own form or disables javascript. User preg_match or some regular expression for the same.

5) Include Files
Sometimes it happens that a PHP script needs to include other files as part of itself. A lot of programmers have a tendency to name those include files with a .inc extension. The problem here is that if the server is not aware that those files are actually parts of PHP scripts, it will just show the code to whoever requested it. This gives attackers the opportunity to study the code for security holes all they want and to see any hard-coded data that may be secret.

There are several ways to prevent this. One way is to name all include files with a .php extension (or .php3, or whatever the server associates with PHP) so that the server will interpret them instead of showing them.

Another possible solution is to associate .inc files with PHP. Yet another solution would be to prevent all .inc files from being displayed. In Apache, the last can be achieved by something like this a section in the httpd.conf file.

10 Advantages of PHP over ASP

Both ASP and PHP are languages used to build Dynamic Web sites that can interact with Databases and exchange information.

a. PHP (Hypertext Pre-Processor) is an object oriented language. ASP is not really a language in itself, it's an acronym for Active Server Pages, the actual language used to programme ASP is Visual Basic Script or Jscript.

b. Online support is available for PHP while ms had dropped its support for ASP.

c. The PHP development team has an outstanding reputation for fixing bugs, and in order to streamline the process they even have an online system through which new bug reports can be submitted. Most bugs are resolved within 24 hours,

d. are a huge number of outstanding bugs in ASP which will probably never be fixed like ASP engine finishes its job of processing the code and then send the codes to users browser. From this point on words till again the page request comes back to server, there is no control of ASP on the page. So we should not expect ASP to perform some tasks which are likely to happen at the client browser end

e. PHP is both cross platform and open source, available for every major operating system and works with most web servers, while ASP works major on MS server.

f. You could make the point that PHP is a more mature language than ASP. ASP has only been around since 1996; PHP has been around since 1994, and has a huge base of developers working on it every waking minute of every day; bugs are usually fixed within minutes of being reported and new features are being integrated daily.

g. It is easily extendable by anyone capable of coding in C, and comes pre-bundled with more functionality than ASP could ever offer

h. Simple capabilities, such as FTP, data compression, file uploads, XML, MD5, encryption and email are not included in ASP and require expensive, third-party packages to be installed. All of this functionality and more are built right into PHP.

i. Complex functions such as dynamic images, IMAP, SNMP, dynamic flash, PDF, native access (non ODBC) to Oracle, Ovrimos, Postgre, Sybase, mSql, MSSQL, Ingres, Interbase and Informix databases, LDAP, and sockets, just to name a few, are available for free to any installation of PHP, but are not (and probably never will be) available with ASP.

j. ASP natively supports only Access and MSSQL, whereas PHP natively supports a huge number of databases.

k. MySQL is a database that PHP closely integrates with; it is a very powerful database that rivals Oracle in speed.

l. PHP, MySQL is free, and blows most other databases out of the water. Another hidden cost with ASP is the database angle; Microsoft expects you to develop using Access and when your webpage outgrows it, to switch to MSSQL, an extremely expensive option. What most people don't realize is how quickly you can outgrow Access.

m. While working with Access, you're technically limited to around 30 simultaneous connections, realistically it's closer to 5. Not many websites can survive such limitations. Most moderately sized websites require over 1000 simultaneous database connections. In addition, Access is SLOW. And you forego a lot of cool database functionality such as stability, transactions, replication, stored procedures, triggers, and so on. There are so many reasons not to use Access.

n. And finally, cost. PHP is free. ASP isn't free. If you want to use ASP, you have to use IIS, and if you want to use IIS, you have to buy Windows. Traditionally, the cost of Windows has been high. Microsoft has been aggressively trying to reduce this factor but they're hardly going to give Windows away for free. The cost of running an ASP-based website implies a full Windows server platform; development costs are higher, software licenses are expensive and speed, security and flexability are all sacrificed. but there are a couple of projects that allow ASP to run on other platforms and servers but guess what, most of them cost money.

o. PHP can be accessed by command peompt.

Sending mails in .NET & C#

My ideal method to send standard html mails through an application is by reading an html file and replacing its content with final data and send it.

I was very much familiar and proficient in ASP and PHP, now i tried the same with ASP.NET C# and the details of the same are given below:


string path = Request.MapPath("leave_mail_tpl.html");
//Session["eid"]
//opening a file
//FileStream file = new FileStream("leave_mail_tpl.html");
//reading a file
StreamReader sr = new StreamReader(path);
string mailbody = sr.ReadToEnd().ToString();
sr.Close();


mailbody = mailbody.Replace("empname", empname);
and so on for all the replacable elements.


MailMessage msg = new MailMessage();
//System.Text.StringBuilder str = new System.Text.StringBuilder();
msg.To=toemail;
msg.Cc = ccemail;
msg.From =fromemail;
msg.Subject = "A Leave Request from " + empname;
msg.BodyFormat = MailFormat.Html;
msg.Body = mailbody.ToString();
try
{
SmtpMail.SmtpServer= "ip adress";
SmtpMail.Send(msg);
}
catch(Exception ex)
{
// show success message
}

21 May 2007

SQL DO's and DONT's

DO know your tools.

Spend a weekend at MSDN and browse through all T-SQL commands

DON'T use cursors

They should be your preferred way of killing the performance of an entire system. Did you know that every FETCH being executed has about the same performance of executing a SELECT? This means that if your cursor has 10,000 records, it will execute about 10,000 SELECTs! If you can do this in a couple of SELECT, UPDATE or DELETE, it will be much faster.

I have never seen cursors being well used, except for DBA work. And good DBAs, most of the time, know what they are doing. But, if you are reading this, you are not a DBA, right?

DO normalize your tables

There are two common excuses for not normalizing databases: performance and pure laziness.
Often I see programmers de-normalizing databases because "this will be slow". And, more frequent than the inverse, the resulting design is slower. DBMSs were designed to be used with normalized databases, so design with normalization in mind.

DON'T SELECT *

try to specify only the columns you'll need. This will:
- Reduce memory consumption and network bandwidth
- Ease security design
- Gives the query optimizer a chance to read all the needed columns from the indexes

DON'T create an index on the "Sex" column

How indexes speed up table access?

You can see indexes as a way of quickly partitioning a table based on a criteria.

If you create an index with a column like "Sex", you'll have only two partitions:
Male and Female.

What optimization will you have on a table with 1,000,000 rows? Remember, mantaining an index is slow. Always design your indexes with the most sparse columns first and the least sparse columns last, e.g, Name + Province + Sex.

DO use transactions

Specially on long-running queries. This will save you when things get wrong.

DON'T open large recordsets

A common request on programming forums is: "How can I quickly fill this combo with 100,00 items?". Well, this is an error. You can't and you shouldn't. First, your user will hate browsing through 100,000 records to find the right one. A better UI is needed here, because you should ideally show no more that 100 or 200 records to your users.

DON'T do SELECT max(ID) from Master when inserting in a Detail table.

This is another common mistake, and will fail when two users are inserting data at the same time. Use one of SCOPE_IDENTITY, IDENT_CURRENT, and @@IDENTITY. Avoid @@IDENTITY if possible because it can introduce some nasty bugs with triggers.

DON'T use the TEXT datatype

Unless you are using it for really large data. The TEXT datatype is not flexible to query, is slow and wastes a lot of space if used incorrectly. Sometimes a VARCHAR will handle your data better.

DO use referential integrity

This can be a great time saver. Define all your keys, unique constraints and foreign keys. Every validation you create on the server will save you time in the future.

19 May 2007

Planning a Project

The success of a project will depend critically upon the effort, care and skill you apply in its initial planning. This article looks at the creative aspects of this planning.

THE SPECIFICATIONA specification is the definition of your project: a statement of the problem, not the solution.

The outcome of this deliberation should be a written definition of what is required, by when; and this must be agreed by all involved. There are no short-cuts to this; if you fail to spend the time initially, it will cost you far more later on.

The agreement upon a written specification has several benefits:

- the clarity will reveal misunderstandings

Specification includes:
- Global context
- Interfaces
- Time scales
- External Dependencies
- Resources
- Specification may change

Providing Structure
What you and your team actually needs to do and how to do it.

Work Breakdown Strucutre
Dividing a task into small achievable and manageable units.

Task Allocation

Establishing Controls
Like a 'doing' phase (work in progress)
- Make mile stones

Communication is your everything, to monitor progress, to receive early warnings of danger, to promote co-operation, to motivate through team involvement.

Who knows the best?
Ask your team, they too must be having some best ideas.

This does not mean that your project should be planned by your committee - rather that you as manager. Plan the project based upon all the available experience & creative ideas.

So communicate as per the work breakdown structure to team and then ask for their comments.

Testing & Quality
- How long will the testing take
- How do we know we have done it right.

Fighting for time
As a manager you have to regulate the work pressure & work load which is imposed upon your team. Protect them from the un-reasonable demands of rest of the company.

Open meetings with all

Install cURL and liburl on windows PC (other than 9x)

Copy and paste php447.Configure IIS to execute PHP files from php447/php,exe


Now copy and paste php_curl from php447/extensions to php447/, winnt/system, winnt/system32, winnt/


Now follow instructions from http://curl.netmirror.org/libcurl/php/iis.html.


It has detail information on:

- The extensions directory has not been set correctly in the php.ini file to fix it

- make sure there is the following line in your php.ini file extension_dir="c:\php\extensions\" (or the relevant directory string) (I put the \ on the end because php automagically puts in a / if its not there. I'm not sure if it has any effect tho. but it did change the warning messages I was getting.)

- Make sure the php_curl.dll file is in that directory. Note: the php_curl.dll is the PHP/CURL binding DLL and is included in the binary PHP download package for Windows.

- Also make sure that the files necessary for curl to run are in the system[32] directory [32] for non 9x machines. libeay32.dll ssleay32.dll make sure that the version of php_curl.dll, php.exe & php4ts.dll is the same (I found this out by running the installer. and then copying the php_curl.dll file from the zip package) to fix this replace all the files in the php install directory with those from the zip package. (theres only 3 or so)

18 May 2007

17 May 2007

View State

Introduction
-------------

The web is a state less medium - state is not maintained between client requests by default. ASP.NET is providing a facility to maintain this.
Page level state is information maintaned when an element on the web form page causes a subsequent request to the server for the same page - referred to as "postback".
The control.viewstate property is associated with each server control in your web form and provides a dictionary object for retaining values between such multiple requests for same page. This is the method that the page uses to preserve page and control property information in the page.
When a page is re-loaded two methods pertaining to viewstate are called: LoadViewState and SaveViewState.

Post back controls like text box and non post back controls like label controls.

ViewState is not limited to the storage of simple values, you can use viewstate to store any object as long as it is serializable.

Session State or ViewState?

There are certain cases where holding a state value in ViewState is not the best option. The most commonly used alternative is Session state, which is generally better suited for:

Large amounts of data.As ViewState increases the size of both the HTML page sent to the browser and the size of form posted back, it's a poor choice for storing large amounts of data.

Sensitive data that is not already displayed in the UI.While the ViewState data is encoded and may optionally be encrypted, your data is most secure if it is never sent to the client. So, Session state is a more secure option.

Objects not readily serialized into ViewState, for example, DataSet.As already discussed the ViewState serializer is optimized for a small set of common object types. Other types that are serializable may be persisted in ViewState, but are slower and can generate a very large ViewState.

16 May 2007

Split in C$

private string splitString = "1,2,3,4,5,6";
private char[] sep = {','};

Array a = stringToSplit.Split(sep);
forint i = 0 | i less than a.Length | i plusplus
opening curly braces
Console.WriteLine(a.GetValue(i).ToString());
closing curly braces

Page.PostBack in C#

!Page.Postback prevents re-loading of data on my page's server control

14 May 2007

Show a file uploading progress bar





























“script language="JavaScript"
delay = 100;
imgNumber = 0;
totalimgNumber = 5;
anim = new Array();

for (i = 0; i < src =" '../images/upload'" src =" anim[imgNumber].src;">= totalimgNumber) imgNumber = 0;
}

function animate() {
Switch();
setTimeout("animate()", delay);
}
/script”

Use onClick="animate()" on a submit button in order to post data and initiate progress bar.

Images are also attached here.


















11 May 2007

360 degree virtual tour

Use javasclass (some PTViewer) for this purpose.
An upload 360 degree panoramic image from user and assign its to this javaclass.

09 May 2007

Make Money Online

1) Google Adsense :

Google Adsense is the leader in web-based content-sensitive marketing.Webmasters place Google AdSense JavaScript code on their web pages and Google AdSense serves advertisements based upon the content of the web page.There should be a Google AdSense skyscraper displayed on the right side of this web page right now.Some webmasters are either not accepted into the Google AdSense program, or do not wish to do business with Google.

2) Clicksor:

Clicksor will pay you up to 60% of the advertising clicks revenues generated from your website. Contextual Advertising Technology by Clicksor allows your visitors to enjoy the content of your website and bring generous earnings to you at the same time.As an affiliate, Clicksor passes its profits along to you by paying up to 60% of the advertising clicks revenues generated from your website. Clicksor provides online real time stats and a fortnightly payment schedule. In any pay period in which your earnings exceed $50.00, payments are made either by check or instantly through PayPal. Revenue totalling less that $50 will rolled into the following period.Clicksor offers webmasters the opportunity to earn additional income by simply underlining a selection of clickable text or dislaying targeted contextual banner on their websites.

3) Target Point:

Targetpoint’s services are particularly publisher-oriented: You’ll have absolute control over the appearance of your ads, supervision over ad content, up-to-date statistics on your site’s performance and, most importantly, better bottom-line revenue. Targetpoint offers Publisher services, which generate more money using our new, patent pending content recognition and matching technology: Adpoint generates content-relevant, revenue-evaluated ads. Exitpoint helps utilizing the full capacity web exit traffic. Searchpoint (beta) features enhanced search capabilities, which enhance your users’ experience and generate additional profit. Registration is free and quick. You are guaranteed to get 60% of the total on-click revenue. Payment options include Bank checks, Paypal and Wire transfers (if eligible).

4) Bidvertiser:

Place text ads on your site and get paid for every click Are you sure you are getting the most out of your advertising space?-Join BidVertiser now and we will turn your advertising space into cash! Simply display the BidVertiser text ads on your website and let advertisers bid against each other! We will always display the highest bidders to maximize your revenue! Get paid for every click -You get paid for every visitor that clicks on an ad. Our goal is to enable you to make as much as possible from your advertising space, by letting advertisers bid on your ad space. We pay by monthly checks, with a minimum of only US $25. Always have the highest bidders displayed on your website -BidVertiser will always display the highest bidders on your site, assuring the maximum revenue possible at any given time. Have your bidding steadily improved over time -You will see a constant improvement in your bidding over time, as both your visitors and our advertisers will be exposed to the opportunity of bidding against each other on your ad space.

5) Revenue Pilot:

RevenuePilot provides you with the most innovative, efficient and effective way to monetize your traffic. The Pay For Performance (PFP) and the Pay Per Click (PPC) markets have created ample opportunity for the web publishing community to turn its traffic into pure profits. RevenuePilot offers its affiliates seamless entrance into this highly profitable arena through its Premiere Pay Per Click Network.

6) Searchfeed:

By partnering with Searchfeed.com, Webmasters enhance site content while earning additional revenue from existing Web traffic. Through the integration of paid keyword content, visitors gain access to more relevant information about an area of interest, increasing usability and overall 'stickiness' of a partner's site. Searchfeed.com's ad technology is deployed through both search and content channel integration, helping to monetize Internet traffic more effectively while maintaining the existing look and feel of a partner's site.

7) Fastclick:

Generating revenue, superior technology, a trusting partnership and customer support are the driving force of our Publisher network. Earn up to an industry-high 65-percent monthly payout on all advertising revenue your website generates! Fastclick pays by the 25th of the month for the previous month by check or PayPal. And now you can improve your ad revenue with Text Ads! Text Ads are a new, text-based ad format customizable by the publisher to integrate with your site and complement your current display advertising. Join us to see the possibilities. 8) ClixGalore: Start earning large amounts of commission now by joining one of the many Affiliate programs listed in the clixGalore affiliate network.Using the 'Instant Website Builder' tool, located in your clixGalore Member Home area, you can easily and instanly generate promotional web pages containing our Merchant's products. You may use these pages to promote and earn commission for product sales generated for our Merchants.clixGalore is one of the larger affiliate networks with over 4500+ Affiliate programs for you to join. Affiliate networks and affiliate programs are increasingly used by merchants for affiliate marketing and product / website promotion. These merchants seek affiliates to promote their products / services and in return will pay you high commissions.

04 May 2007

Streaming video files with FLV | On the fly converting video to flv files


I have to convert the video files into flv files using asp / PHP script. For this we are using ffmpeg.exe tool. This is a command line tool It will execute in comman prompt and will convert the video files into .flash files. For this we are using Dynu component in asp to call the exe file. We have to use "FFmpeg -i GLOBE.AVI -r 25 -acodec mp3 -ar 22050 -s 320x240 -y GLOBE_21.flv"this line in command line tool so that it will convert into .flv files.

php error_reporting(E_ALL);$obj = new COM("Dynu.Exec");echo "

";echo $obj->execute("C:\Inetpub\wwwroot\php_streaming\Video\ffmpeg\batch.bat");echo "
";//Response.Write(oExec.execute("C:\Inetpub\wwwroot\php_streaming\Video\ffmpeg\batch.bat"))

In ASP you can use it like:
Set oExec = Server.Createobject("Dynu.Exec")Response.Write("

")REM Execute the command "ipconfig" and display its result.Response.Write(oExec.execute("ipconfig"))REM Execute the command "nslookup -type=mx microsoft.com" and display its result.Response.Write(oExec.execute("C:\Inetpub\wwwroot\new\enginetest\ffmpeg.exe"))REM Execute the batch file and display its result.' Response.Write(oExec.execute("C:\Inetpub\wwwroot\new\test.bat"))'oExec.parameters("-i GLOBE.AVI -r 25 -acodec mp3 -ar 22050 -s 320x240 -y GLOBE_21.flv")Response.Write("

")Set oExec = nothing

if you have avi file and want to convert it to flv then use:

$command = "CALL C:\Inetpub\wwwroot\streaming\ffmpeg.exe -y -i ".$dir." -acodec mp3 -ar 22050 -f flv ".$flvpath;

where dir is the file path of avi file.

Enjoy Programming

- Jankit

03 May 2007

Invest in PPF and be crorepati

In Plan 1 mentioned below, I have taken an investment of Rs 3,000 per month or Rs 36,000 per year. According to Plan 1 you can be a crorepati in the next 40 years. You can decrease the number of years by investing more per month or by increasing your investments gradually.
Assumptions

~ PPF will give a consistent return of 8 per cent per annum.
~ Withdrawal will not attract capital gain tax, that is, the tax structure would maintain its status quo.

Advantage
~ Extremely low risk, since the government manages PPF.

Disadvantages
~ Longer tenure.
~ Yielding 8 per cent interest consistently seems to be very unlikely. Low risk investors need to adjust their investment based on the interest rates.

30 April 2007

Always look for simple solutions

The Difference between FOCUSSING on PROBLEMS Vis-a-Vis FOCUSSING on SOLUTIONS

Case 1 :

When NASA began the launch of astronauts into space, they found out that the pens wouldn't work at zero gravity (ink won't flow down to the writing surface). To solve this problem, it took them one decade and $12 million.

They developed a pen that worked at zero gravity, upside down, underwater, in practically any surface including crystal and in a temperature range from below freezing to over 300 degrees C.

And what did the Russians do...?? They used a pencil.

Case 2 :

One of the most memorable case studies on Japanese management was the case of the empty soapbox, which happened in one of Japan's biggest cosmetics companies. The company received a complaint that a consumer had bought a soapbox that was empty.

Immediately the authorities isolated the problem to the assembly! line, which transported all the packaged boxes of soap to the delivery department. For some reason, one soapbox went through the assembly line empty.

Management asked its engineers to solve the problem.

Post-haste, the engineers worked hard to devise an X-ray machine with high-resolution monitors manned by two people to watch all the soapboxes that passed through the line to make sure they were not empty. No doubt, they worked hard and they worked fast but they spent a whoopee amount to do so.

But when a rank-and-file employee in a small company was posed with the same problem, he did not get into complications of X-rays, etc., but instead came out with another solution.

He bought a strong industrial electric fan and pointed it at the assembly line. He switched the fan on, and as each soapbox passed the fan, it simply blew the empty boxes out of the line.

Moral

Always look for simple solutions.

Devise the simplest possible solution that solves the problems.

Always Focus on solutions & not on problems.

26 April 2007

Web based messenger

http://wwwm.meebo.com/index-en.html

About CAPTCHA

Complete name: "Completely Automated Public Turing test to tell Computers and Humans Apart"

It is similar to Image-recognition or a different way to implement AI.

With reference to develop this with PHP, it required to have support for creating images on the fly with required content on it like GD Library.

PHP Sample Code:

Header("Content-type: image/png");
$string = $_GET['code'];
$im = imagecreatefromgif("images/imageback.gif"); //background image
$orange = ImageColorAllocate($im, 0, 150, 225);
$px = (imagesx($im)-9*strlen($string))/2;
// $font = imageloadfont("04b.gdf");
imagestring($im,6,$px,3,$string,$orange);
imagepng($im);
//ImageDestroy($im);
?>

About AJAX

Asynchroneous (means you can make a request to server with HTTP and can process another data while waiting for servers' response) Javascript And XmlEx., Google mail

Not compulsory XML required, like text file too will work. But it must send and receive data from server.

Different brwoser has different support: like XMLHttpRequest or object like MSXML2.XML

HTTPAjax really is DHTML with the xmlhttprequest object thrown in

It is amazing to think how one object can change the whole playing fieldAjax isn't a technology as such but rather is a technique that combines well with other technologies and techniques. For example, xml, dhtml, css, xhtml

Drawback:As page is not refreshing so back button will not work as effectively.Speed. It all depends on the AJAX's requirement. Some (First) time you may find it slower than any other web application.

Some practical uses of AJAX:- Login attempts- Country and state drop down- Search results- Voting, Yes/No boxes, Ratings submissions.