<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7256759796693696120</id><updated>2011-04-21T14:45:11.537-07:00</updated><title type='text'>tutortan training computer</title><subtitle type='html'>tutortan training computer all about hardware , software and programming language and information technology</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>77</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-98886905738261291</id><published>2007-07-18T09:25:00.000-07:00</published><updated>2007-07-18T09:29:18.741-07:00</updated><title type='text'>5 Tips to Effective SEO Keyword Research Analysis</title><content type='html'>Keyword research and analysis can be a daunting task, when done correctly, and expert keyword research is the foundation to a successful SEO campaign. Many new website owners think the keyword research analysis process is easy. They think free tools, such as the Overture Search Term Suggestion Tool is the profít pill that will bring them ínstant results.&lt;br /&gt;Unfortunately, the frëe tools will only give you a rough guide and a quick indication whether a hunch is worth further research. These frëe keyword research tools are limited to basic information. When performed correctly, expert keyword research exposes so much more - all the gems that are tucked away deep.&lt;br /&gt;Real keyword research requires research AND analysis. There are so many aspects to the process that cannot be left to chance. Attempting to do the keyword research on your own is like going to a veterinarian to fix your car. My advise to all clients I do SEO consulting services for is to simply leave this task to the experts who have the correct keyword research tools and expertise.&lt;br /&gt;Following are 5 tips for effective keyword research analysis:&lt;br /&gt;1. Latent Semantic Indexing (LSI) - Use multi-word phrases&lt;br /&gt;Latent Semantic Indexing (LSI) is a vital element in Search Engine Optimization (SEO) for better keyword rankings in search results. LSI is based on the relationship, the "clustering" or positioning, the variations of terms and the iterations of your keyword phrases.&lt;br /&gt;Expertly knowing LSI and how it can be most useful and beneficial for your SEO and the importance it has with the algorithm updates to search engines like Google, MSN and Yahoo which will benefit your keyword research for best practice SEO.&lt;br /&gt;LSI is NOT new. Those doing keyword research over the years have always known to use synonyms and "long tail" keyword terms which is a simpler "explanation" to LSI. More often than not, these long tail, less generic terms bring more traffíc to your site than the main keyword phrases. The real bottom line is that Latent Semantic Indexing is currently a MUST in keyword research and SEO.&lt;br /&gt;2. Page Specific Keyword Research - Target your niche keyword phrases for each site page&lt;br /&gt;Probably the most common mistake in keyword research is using a plethora of keywords and pasting the same meta keyword tag on every web site page. This is SO not effective! Your keyword research needs to be page specific and only focusing on 2 to 5 keywords per page. It's more work, but combined with best practice SEO, gives each site page a chance for higher ranking on its own.&lt;br /&gt;3. Country Specific Keyword Research and Search Engine Reference&lt;br /&gt;Keep in mind that keyword search terms can be country specific. Even though a country is English speaking, there are different keyword terms you must research - and then reference that country's search engine when doing your initial keyword research. For instance, UK and Australia may have different expressions, terminology and spellings (i.e. colour, personalised). Referencing the terms in the corresponding search engine is an important element to keyword research that is often forgotten. So for example, be sure to chëck the search terms on &lt;a onclick="return top.js.OpenExtLink(window,event,this)" href="http://google.co.uk/" target="_blank"&gt;google.co.uk&lt;/a&gt; or &lt;a onclick="return top.js.OpenExtLink(window,event,this)" href="http://au.yahoo.com/" target="_blank"&gt;au.yahoo.com&lt;/a&gt;. And, of course, if you have 3 to 4 really comprehensive research tools in your arsenal, you will be able to search for historical, global and country specific search terms easily and effectively.&lt;br /&gt;4. Keyword Analysis - Cross referencing in the search engines&lt;br /&gt;Once the majority of the keyword research has been done for a site page, it's time to plug those terms into the search engines to determine:&lt;br /&gt;If it is really the desired niche keyword for that page&lt;br /&gt;To assess the competitiveness of your keywords. Along with checking the competitiveness of your keywords you should look at the strength of the competition.&lt;br /&gt;Are the other sites listed for your keywords truly your competitors?&lt;br /&gt;Are the sites listed for your keyword even related to your industry, products or services?&lt;br /&gt;These critical analyses of keyword phrases are often forgotten. Since the keyword research and analysis is the foundation of a successful SEO campaign, you certainly don't want to build your on-page optimization on the wrong niche keywords!&lt;br /&gt;5. Ongoing Keyword Research - Repeat your keyword research on a consistent basis&lt;br /&gt;While you may think that you have completed your keyword research analysis and laid a solid foundation for your SEO, you need to keep monitoring your keywords and tweak as necessary. Keywords can change from month to month as keyword search terms change, genres change and/or if your niche is within social portal networking sites - to name just a few. Maintaining ongoing keyword research is essential for best practice SEO.&lt;br /&gt;Most Successful Strategy to Streamline Your Keyword Research Efforts:&lt;br /&gt;Yes, many website owners will opt to do the keyword research and analysis themselves with only a marginal effect on an SEO campaign. It's not the most successful strategy to use for the most effective results.&lt;br /&gt;To be certain of your keyword data, accurate keyword analysis should be performed - and cross referenced - across multiple expert keyword tools.&lt;br /&gt;Effective keyword research lays the ground work for effective SEO results and can help you kick-start the ranking process - perhaps even giving you a step up on your competitors.&lt;br /&gt;The most successful strategy to streamline your keyword research efforts is to hire an expert. Focus your business efforts on your strengths and expertise and allow the SEO experts to effectively perform the keyword research analysis correctly.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-98886905738261291?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/98886905738261291/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=98886905738261291&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/98886905738261291'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/98886905738261291'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/07/5-tips-to-effective-seo-keyword.html' title='5 Tips to Effective SEO Keyword Research Analysis'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-5311022071963694355</id><published>2007-06-29T22:07:00.000-07:00</published><updated>2007-06-29T22:10:28.438-07:00</updated><title type='text'>21 Essential SEO Tips &amp; Techniques</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_W2DVHM5FSi0/RoXls1BruVI/AAAAAAAAA3k/Aj6dAJvqyLE/s1600-h/smallisbeautiful100.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5081720312868616530" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_W2DVHM5FSi0/RoXls1BruVI/AAAAAAAAA3k/Aj6dAJvqyLE/s320/smallisbeautiful100.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;Small businesses are growing more aware of the need to understand and implement at least the basics of search engine optimization. But if you read a variety of small businesses blogs and Web sites, you'll quickly see that there's a lot of uncertainty over what makes up "the basics." Without access to high-level consulting and without a lot of experience knowing what SEO resources can be trusted, there's also a lot of misinformation about SEO strategies and tactics.&lt;br /&gt;This article is the second in a two-part SEO checklist specifically for small business owners and webmasters. Last week, I &lt;a href="http://searchengineland.com/070621-150354.php"&gt;shared 20 "don'ts."&lt;/a&gt; Naturally, this week addresses the "Do's"—things to make sure you include whether you're hiring an SEO company or doing it yourself.&lt;br /&gt;Small Business SEO Checklist: The Do's&lt;br /&gt;1. Commit yourself to the process. SEO isn't a one-time event. Search engine algorithms change regularly, so the tactics that worked last year may not work this year. SEO requires a long-term outlook and commitment.&lt;br /&gt;2. Be patient. SEO isn't about instant gratification. Results often take months to see, and this is especially true the smaller you are, and the newer you are to doing business online.&lt;br /&gt;3. Ask a lot of questions when hiring an SEO company. It's your job to know what kind of tactics the company uses. Ask for specifics. Ask if there are any risks involved. Then get online yourself and do your own research—about the company, about the tactics they discussed, and so forth.&lt;br /&gt;4. Become a student of SEO. If you're taking the do-it-yourself route, you'll have to become a student of SEO and learn as much as you can. Luckily for you, there are plenty of great Web resources (like &lt;a href="http://searchengineland.com/"&gt;Search Engine Land&lt;/a&gt;) and several terrific books you can read. Aaron Wall's &lt;a href="http://www.seobook.com/"&gt;SEO Book&lt;/a&gt;, Jennifer Laycock's &lt;a href="http://www.searchengineguide.com/smallbizsembook.html"&gt;Small Business Guide to Search Engine Marketing&lt;/a&gt;, and &lt;a href="http://www.yourseoplan.com/"&gt;Search Engine Optimization: An Hour a Day&lt;/a&gt; by Jennifer Grappone and Gradiva Couzin are three I've read and recommend.&lt;br /&gt;5. Have web analytics in place at the start. You should have clearly defined goals for your SEO efforts, and you'll need web analytics software in place so you can track what's working and what's not.&lt;br /&gt;6. Build a great web site. I'm sure you want to show up on the first page of results. Ask yourself, "Is my site really one of the 10 best sites in the world on this topic?" Be honest. If it's not, make it better.&lt;br /&gt;7. Include a site map page. Spiders can't index pages that can't be crawled. A site map will help spiders find all the important pages on your site, and help the spider understand your site's hierarchy. This is especially helpful if your site has a hard-to-crawl navigation menu. If your site is large, make several site map pages. Keep each one to less than 100 links. I tell clients 75 is the max to be safe.&lt;br /&gt;8. Make SEO-friendly URLs. Use keywords in your URLs and file names, such as yourdomain.com/red-widgets.html. Don't overdo it, though. A file with 3+ hyphens tends to look spammy and users may be hesitant to click on it. Related bonus tip: Use hyphens in URLs and file names, not underscores. Hyphens are treated as a "space," while underscores are not.&lt;br /&gt;9. Do keyword research at the start of the project. If you're on a tight budget, use the free versions of &lt;a href="http://www.keyworddiscovery.com/search.html"&gt;Keyword Discovery&lt;/a&gt; or &lt;a href="http://freekeywords.wordtracker.com/"&gt;WordTracker&lt;/a&gt;, both of which also have more powerful paid versions. Ignore the numbers these tools show; what's important is the relative volume of one keyword to another. Another good free tool is Google's &lt;a href="https://adwords.google.com/select/KeywordToolExternal"&gt;AdWords Keyword Tool&lt;/a&gt;, which doesn't show exact numbers.&lt;br /&gt;10. Open up a PPC account. Whether it's Google's AdWords or Yahoo's Search Marketing or something else, this is a great way to get actual search volume for your keywords. Yes, it costs money, but if you have the budget it's worth the investment. It's also the solution if you didn't like the "Be patient" suggestion above and are looking for instant visibility.&lt;br /&gt;11. Use a unique and relevant title and meta description on every page. The page title is the single most important on-page SEO factor. It's rare to rank highly for a primary term (2-3 words) without that term being part of the page title. The meta description tag won't help you rank, but it will often appear as the text snippet below your listing, so it should include the relevant keyword(s) and be written so as to encourage searchers to click on your listing. Related bonus tip: You can ignore the Keywords meta altogether if you'd like; it's close to inconsequential. If you use it, put misspellings in there, and any related keywords that don't appear on the page.&lt;br /&gt;12. Write for users first. Google, Yahoo, etc., have pretty powerful bots crawling the web, but to my knowledge these bots have never bought anything online, signed up for a newsletter, or picked up the phone to call about your services. Humans do those things, so write your page copy with humans in mind. Yes, you need keywords in the text, but don't stuff each page like a Thanksgiving turkey. Keep it readable.&lt;br /&gt;13. Create great, unique content. This is important for everyone, but it's a particular challenge for online retailers. If you're selling the same widget that 50 other retailers are selling, and everyone is using the boilerplate descriptions from the manufacturer, this is a great opportunity. Write your own product descriptions, using the keyword research you did earlier (see #9 above) to target actual words searchers use, and make product pages that blow the competition away. Plus, retailer or not, great content is a great way to get inbound links.&lt;br /&gt;14. Use your keywords as anchor text when linking internally. Anchor text helps tells spiders what the linked-to page is about. Links that say "click here" do nothing for your search engine visibility.&lt;br /&gt;15. Build links intelligently. Submit your site to quality, trusted directories such as &lt;a href="http://dir.yahoo.com/"&gt;Yahoo&lt;/a&gt;, &lt;a href="http://www.dmoz.org/"&gt;DMOZ&lt;/a&gt;, &lt;a href="http://www.business.com/"&gt;Business.com&lt;/a&gt;, &lt;a href="http://www.avivadirectory.com/"&gt;Aviva&lt;/a&gt;, and &lt;a href="http://www.botw.org/"&gt;Best of the web&lt;/a&gt;. Seek links from authority sites in your industry. If local search matters to you (more on that coming up), seek links from trusted sites in your geographic area—the Chamber of Commerce, etc. Analyze the inbound links to your competitors to find links you can acquire, too.&lt;br /&gt;16. Use press releases wisely. Developing a relationship with media covering your industry or your local region can be a great source of exposure, including getting links from trusted media web sites. Distributing releases online can be an effective link building tactic, and opens the door for exposure in news search sites. Related bonus tip: Only issue a release when you have something newsworthy to report. Don't waste journalists' time.&lt;br /&gt;17. Start a blog and participate with other related blogs. Search engines, Google especially, love blogs for the fresh content and highly-structured data. Beyond that, there's no better way to join the conversations that are already taking place about your industry and/or company. Reading and commenting on other blogs can also increase your exposure and help you acquire new links. Related bonus tip: Put your blog at yourdomain.com/blog so your main domain gets the benefit of any links to your blog posts. If that's not possible, use blog.yourdomain.com.&lt;br /&gt;18. Use social media marketing wisely. If your small business has a visual element, join the appropriate communities on &lt;a href="http://www.flickr.com/"&gt;Flickr&lt;/a&gt; and post high-quality photos there. If you're a service-oriented business, use &lt;a href="http://answers.yahoo.com/"&gt;Yahoo Answers&lt;/a&gt; to position yourself as an expert in your industry. With any social media site you use, the first rule is don't spam! Be an active, contributing member of the site. The idea is to interact with potential customers, not annoy them.&lt;br /&gt;19. Take advantage of local search opportunities. Online research for offline buying is a growing trend. Optimize your site to catch local traffic by showing your address and local phone number prominently. Write a detailed Directions/Location page using neighborhoods and landmarks in the page text. Submit your site to the free local listings services that the major search engines offer. Make sure your site is listed in local/social directories such as CitySearch, Yelp, Local.com, etc., and encourage customers to leave reviews of your business on these sites, too.&lt;br /&gt;20. Take advantage of the tools the search engines give you. Sign up for Google's &lt;a href="http://www.google.com/webmasters/"&gt;webmaster Central&lt;/a&gt; and Yahoo's &lt;a href="https://siteexplorer.search.yahoo.com/"&gt;Site Explorer&lt;/a&gt; to learn more about how the search engines see your site, including how many inbound links they're aware of.&lt;br /&gt;21. Diversify your traffic sources. Google may bring you 70% of your traffic today, but what if the next big algorithm update hits you hard? What if your Google visibility goes away tomorrow? Newsletters and other subscriber-based content can help you hold on to traffic/customers no matter what the search engines do. In fact, many of the DOs on this list—creating great content, starting a blog, using social media and local search, etc.—will help you grow an audience of loyal prospects and customers that may help you survive the whims of search engines.&lt;br /&gt;Just like last week, this list could continue well beyond these 21 "DOs." Your additions are welcome in the comments.&lt;br /&gt;With this checklist and last week's list of "Don'ts," you should be able to develop a good plan of attack for your SEO efforts for your small business.&lt;br /&gt;Matt McGee is the SEO Manager for &lt;a href="http://www.marchex.com/"&gt;Marchex, Inc.&lt;/a&gt;, a search and media company offering &lt;a href="http://www.trafficleader.com/"&gt;search marketing services&lt;/a&gt; through its TrafficLeader subsidiary. The &lt;a href="http://searchengineland.com/lands/small_is_beautiful.php"&gt;Small Is Beautiful&lt;/a&gt; column appears on Thursdays at &lt;a href="http://searchengineland.com/"&gt;Search Engine Land&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-5311022071963694355?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/5311022071963694355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=5311022071963694355&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/5311022071963694355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/5311022071963694355'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/06/21-essential-seo-tips-techniques.html' title='21 Essential SEO Tips &amp; Techniques'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_W2DVHM5FSi0/RoXls1BruVI/AAAAAAAAA3k/Aj6dAJvqyLE/s72-c/smallisbeautiful100.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-5404688806850776624</id><published>2007-06-17T09:53:00.000-07:00</published><updated>2007-06-17T09:57:18.369-07:00</updated><title type='text'>Determining the Size of a Class Object</title><content type='html'>There are many factors that decide the size of an object of a class in C++. These factors are:&lt;br /&gt;Size of all non-static data members&lt;br /&gt;Order of data members&lt;br /&gt;Byte alignment or byte padding&lt;br /&gt;Size of its immediate base class&lt;br /&gt;The existence of virtual function(s) (Dynamic polymorphism using virtual functions).&lt;br /&gt;Compiler being used&lt;br /&gt;Mode of inheritance (virtual inheritance)&lt;br /&gt;Size of all non-static data membersOnly non-static data members will be counted for calculating sizeof class/object. class A {&lt;br /&gt;private:&lt;br /&gt;float iMem1;&lt;br /&gt;const int iMem2;&lt;br /&gt;static int iMem3;&lt;br /&gt;char iMem4;&lt;br /&gt;};&lt;br /&gt;For an object of class A, the size will be the size of float iMem1 + size of int iMem2 + size of char iMem3. Static members are really not part of the class object. They won't be included in object's layout. &lt;2&gt;Order of data members&lt;br /&gt;The order in which one specifies data members also alters the size of the class. class C {&lt;br /&gt;char c;&lt;br /&gt;int int1;&lt;br /&gt;int int2;&lt;br /&gt;int i;&lt;br /&gt;long l;&lt;br /&gt;short s;&lt;br /&gt;};&lt;br /&gt;The size of this class is 24 bytes. Even though char c will consume only 1 byte, 4 bytes will be allocated for it, and the remaining 3 bytes will be wasted (holes). This is because the next member is an int, which takes 4 bytes. If we don't go to the next (4th) byte for storing this integer member, the memory access/modify cycle for this integer will be 2 read cycles. So the compiler will do this for us, unless we specify some byte padding/packing. If I re-write the above class in different order, keeping all my data members like below: class C {&lt;br /&gt;int int1;&lt;br /&gt;int int2;&lt;br /&gt;int i;&lt;br /&gt;long l;&lt;br /&gt;short s;&lt;br /&gt;char c;&lt;br /&gt;};&lt;br /&gt;Now the size of this class is 20 bytes. In this case, it is storing c, the char, in one of the slots in the hole in the extra four bytes.&lt;br /&gt;Byte alignment or byte paddingAs mentioned above, if we specify 1 byte alignment, the size of the class above (class C) will be 19 in both cases.&lt;br /&gt;Size of its immediate base classThe size of a class also includes size of its immediate base class. Lets take an example: Class B {&lt;br /&gt;...&lt;br /&gt;int iMem1;&lt;br /&gt;int iMem2;&lt;br /&gt;}&lt;br /&gt;Class D: public B {&lt;br /&gt;...&lt;br /&gt;int iMem;&lt;br /&gt;}&lt;br /&gt;In this case, sizeof(D) is will also include the size of B. So it will be 12 bytes.&lt;br /&gt;The existence of virtual function(s)Existence of virtual function(s) will add 4 bytes of virtual table pointer in the class, which will be added to size of class. Again, in this case, if the base class of the class already has virtual function(s) either directly or through its base class, then this additional virtual function won't add anything to the size of the class. Virtual table pointer will be common across the class hierarchy. That is class Base {&lt;br /&gt;public:&lt;br /&gt;...&lt;br /&gt;virtual void SomeFunction(...);&lt;br /&gt;private:&lt;br /&gt;int iAMem&lt;br /&gt;};&lt;br /&gt;class Derived : public Base {&lt;br /&gt;...&lt;br /&gt;virtual void SomeOtherFunction(...);&lt;br /&gt;private:&lt;br /&gt;int iBMem&lt;br /&gt;};&lt;br /&gt;In the example above, sizeof(Base) will be 8 bytes--that is sizeof(int iAMem) + sizeof(vptr). sizeof(Derived) will be 12 bytes, that is sizeof(int iBMem) + sizeof(Derived). Notice that the existence of virtual functions in class Derived won't add anything more. Now Derived will set the vptr to its own virtual function table.&lt;br /&gt;Compiler being usedIn some scenarios, the size of a class object can be compiler specific. Lets take one example: class BaseClass {&lt;br /&gt;int a;&lt;br /&gt;char c;&lt;br /&gt;};&lt;br /&gt;class DerivedClass : public BaseClass {&lt;br /&gt;char d;&lt;br /&gt;int i;&lt;br /&gt;};&lt;br /&gt;If compiled with the Microsoft C++ compiler, the size of DerivedClass is 16 bytes. If compiled with gcc (either c++ or g++), size of DerivedClass is 12 bytes. The reason for sizeof(DerivedClass) being 16 bytes in MC++ is that it starts each class with a 4 byte aligned address so that accessing the member of that class will be easy (again, the memory read/write cycle).&lt;br /&gt;Mode of inheritance (virtual inheritance)In C++, sometimes we have to use virtual inheritance for some reasons. (One classic example is the implementation of final class in C++.) When we use virtual inheritance, there will be the overhead of 4 bytes for a virtual base class pointer in that class. class ABase{&lt;br /&gt;int iMem;&lt;br /&gt;};&lt;br /&gt;class BBase : public virtual ABase {&lt;br /&gt;int iMem;&lt;br /&gt;};&lt;br /&gt;class CBase : public virtual ABase {&lt;br /&gt;int iMem;&lt;br /&gt;};&lt;br /&gt;class ABCDerived : public BBase, public CBase {&lt;br /&gt;int iMem;&lt;br /&gt;};&lt;br /&gt;And if you check the size of these classes, it will be:&lt;br /&gt;Size of ABase : 4&lt;br /&gt;Size of BBase : 12&lt;br /&gt;Size of CBase : 12&lt;br /&gt;Size of ABCDerived : 24 Because BBase and CBase are dervied from ABase virtually, they will also have an virtual base pointer. So, 4 bytes will be added to the size of the class (BBase and CBase). That is sizeof ABase + size of int + sizeof Virtual Base pointer.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-5404688806850776624?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/5404688806850776624/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=5404688806850776624&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/5404688806850776624'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/5404688806850776624'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/06/determining-size-of-class-object.html' title='Determining the Size of a Class Object'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-1592876451542291243</id><published>2007-06-04T10:16:00.000-07:00</published><updated>2007-06-04T10:17:33.622-07:00</updated><title type='text'>Class Design in C++ Understanding Interfaces</title><content type='html'>When you're designing a class in C++, the first thing you should decide is the public interface for the class. The public interface determines how your class will be used by other programmers (or you), and once designed and implemented it should generally stay pretty constant. You may decide to add to the interface, but once you've started using the class, it will be hard to remove functions from the public interface (unless they aren't used and weren't necessary in the first place). But that doesn't mean that you should include more functionality in your class than necessary just so that you can later decide what to remove from the interface. If you do this, you'll just make the class harder to use. People will ask questions like, "why are there four ways of doing this? Which one is better? How can I choose between them?" It's usually easier to keep things simple and provide one way of doing each thing unless there's a compelling reason why your class should offer multiple methods with the same basic functionality. At the same time, just because adding methods to the public interface (probably) won't break anything that doesn't mean that you should start off with a tiny interface. First of all, if anybody decides to inherit from your class and you then choose a function with the same name, you're in for a boatload of confusion. First, if you don't declare the function virtual, then an object of the subclass will have the function chosen depending on the static type of the pointer. This can be messy. Moreover, if you do declare it virtual, then you have the issue that it might provide a different type of functionality than was intended by the original implementation of that function. Finally, you just can't add a pure virtual function to a class that's already in use because nobody who has inherited from it will have implemented that function. The public interface, then, should remain as constant as possible. In fact, a good approach to designing classes is to write the interface before the implementation because it's what determines how your class interacts with the rest of the world (which is more important for the program as a whole than how the class is actually implemented). Moreover, if you write the interface first, you can get a feel for how the class will work with other classes before you actually dive into the implementation details.&lt;br /&gt;Inheritance and Class DesignThe second issue of your class design is what should be available to programmers who wish to create subclasses. This interface is primarily determined by virtual functions, but you can also include protected methods that are designed for use by the class or its subclasses (remember that protected methods are visible to subclasses while private methods are not). A key consideration is whether it makes sense for a function to be virtual. A function should be virtual when the implementation is likely to differ from subclass to subclass. Vice-versa, whenever a function should not change, then it should be made non-virtual. The key idea is to think about whether to make a function virtual by asking if the function should always be the same for every class. For example, if you have a class is designed to allow users to monitor network traffic and you want to allow subclasses that implement different ways of analyzing the traffic, you might use the following interface: class TrafficWatch&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;// Packet is some class that implements information about network&lt;br /&gt;// packets&lt;br /&gt;void addPacket (const Packet&amp; network_packet);&lt;br /&gt;int getAveragePacketSize ();&lt;br /&gt;int getMaxPacket ();&lt;br /&gt;virtual bool isOverloaded ();&lt;br /&gt;};&lt;br /&gt;In this class, some methods will not change from implementation to implementation; adding a packet should always be handled the same way, and the average packet size isn't going to change either. On the other hand, someone might have a very different idea of what it means to have an overloaded network. This will change from situation to situation and we don't want to prevent someone from changing how this is computed--for some, anything over 10 Mbits/sec of traffic might be an overloaded network, and for others, it would require 100 Mbits/sec on some specific network cables. Finally, when publicly inheriting from any class or designing for inheritance, remember that you should strive for it to be clear that inheritance models is-a. At heart, the is-a relationship means that the subclass should be able to appear anywhere the parent class could appear. From the standpoint of the user of the class, it should not matter whether a class is the parent class or a subclass. To design an is-a relationship, make sure that it makes sense for the class to include certain functions to be sure that it doesn't include that subclasses might not actually need. One example of having an extra function is that of a Bird class that implements a fly function. The problem is that not all birds can fly--penguins and emus, for instance. This suggests that a more prudent design choice might be to have two subclasses of birds, one for birds that can fly and one for flightless birds. Of course, it might be overkill to have two subclasses of bird depending on how complex your class hierarchy will be. If you know that nobody would ever expect use your class for a flightless bird, then it's not so bad. Of course, you won't always know what someone will use your class for and it's much easier to think carefully before you start to implement an entire class hierachy than it will be to go back and change it once people are using it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-1592876451542291243?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/1592876451542291243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=1592876451542291243&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/1592876451542291243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/1592876451542291243'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/06/class-design-in-c-understanding.html' title='Class Design in C++ Understanding Interfaces'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-8393566213797418509</id><published>2007-05-23T10:03:00.000-07:00</published><updated>2007-05-23T10:05:11.468-07:00</updated><title type='text'>Introduction to SEO</title><content type='html'>A search engine is through which most of your potential visitors will discover your site. But for that to happen you first need the search engines in turn to discover your site.&lt;br /&gt;It is only when the search engines 'understand' that your site is one of the best online places to find the kind of quality content that your site provides, is when they 'recommend' your site to people interested in similar content.&lt;br /&gt;If all that sounds a bit abstract, allow me to elaborate.&lt;br /&gt;Search Engines like &lt;a href="http://www.google.com/" target="_blank"&gt;Google&lt;/a&gt;, &lt;a href="http://www.yahoo.com/" target="_blank"&gt;Yahoo&lt;/a&gt; and &lt;a href="http://www.msn.com/" target="_blank"&gt;MSN&lt;/a&gt; routinely search the web for content and try to relate content to some keywords which they consider the focus of your content. So for example this tutorial on SEO is related to the term SEO. A web surfer looking for articles on SEO will query these search engines for the term 'SEO' and will get results based upon what search engines think are good sites for content related to the term 'SEO'.&lt;br /&gt;In fact, a search on Google for SEO yields about 17,600,000 results at the time of the writing of this tutorial. Our web surfer looking for SEO related content would definitely not look beyond 15 or at most 20 initial links. The question then is how does the search engine decide which links to place before the other ones on such a search result.&lt;br /&gt;Search Engines rank the pages for the specific search term and then show the pages in the order of those rankings. Google associates what is called a PageRank for each site. PageRank measures from 1 to 10, with a PageRank of 10 specifying a highly relevant site, and the relevancy decreasing in the order of the PageRank. Other search engines like Yahoo and MSN have similar ranking strategies. SERP (Search Engine Result Page) rankings in Google depend on the PageRank and also on how well the web site relates to your searched words. Given two web sites which relate equally well to your search term, the web site with a higher PageRank will be ranked higher in the SERP's.&lt;br /&gt;Search Engine Optimization or SEO refers to how you can optimize your site such that your site is more aligned to the criteria that search engines use to rank web sites.&lt;br /&gt;There is a lot of content online which will tell you a lot of stuff that you can do for SEO. Unfortunately most of these articles will tell you stuff that will waste a lot of your time and will not yield any desirable results. Worse, quite a few will tell you stuff that is outright wrong and are considered search engine spamming by major search engines. Using such techniques can result in your site being black-listed from their SERP's. Fortunately, there are still a lot of right things that you can do so that search engines rank your site favorably on your targeted search term.&lt;br /&gt;The best part is, right here on this tutorial we tell you everything you should be doing and everything you shouldn't be doing for SEO.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-8393566213797418509?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/8393566213797418509/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=8393566213797418509&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/8393566213797418509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/8393566213797418509'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/05/introduction-to-seo.html' title='Introduction to SEO'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-4842905738577755835</id><published>2007-05-16T08:10:00.000-07:00</published><updated>2007-05-16T08:12:54.831-07:00</updated><title type='text'>Is Google Killing SEO?</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_W2DVHM5FSi0/RksfZI4NN2I/AAAAAAAAAtU/IBt8wwxZ2X4/s1600-h/hs_prescott_jason_100x100.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5065176722648676194" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_W2DVHM5FSi0/RksfZI4NN2I/AAAAAAAAAtU/IBt8wwxZ2X4/s320/hs_prescott_jason_100x100.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;Paid search listings could become more relevant than organic listings because of the emphasis on inbound links in search algorithms.&lt;br /&gt;It just occurred to me that Google is killing organic SEO. Google's paid search algorithm is allowing the user to be the ultimate SEO. Based on user search behavior -- the type of links clicked on and the amount of time spent on a landing page after leaving Google -- your paid search ads become more relevant, undermining traditional SEO efforts to bring client sites to the top of the SERPs.&lt;br /&gt;Google's paid search algorithm acts almost like a rating system. Google will discover the most popular sites based on user preferences, allowing it to serve highly relevant results based on paid search landing pages. As a result, search engines will likely start serving more sponsored links, and the organic links will start to fade away.&lt;br /&gt;GoogleBot likes info The object of B2B and ecommerce commercial websites is to sell products and services online. These sites have an increasingly difficult time ranking well on Google because the GoogleBot eats up information and spits out products and services. Therefore, organic links are becoming less relevant and have low quality.&lt;br /&gt;The antidote to low-quality organic links is pay-per-click advertising and strategic ad placements such as links on great information sites. These promotions are very effective, especially when displayed on vertical search engines (VSEs). In fact, this could become the ultimate way to do SEO in the future.&lt;br /&gt;Saga of the broken algosI'm not the only guy who sees a weakness in the Google search algorithm. In his article, "&lt;a href="http://publications.mediapost.com/index.cfm?fuseaction=Articles.showArticle&amp;amp;art_aid=54910" target="new"&gt;Are User-Generated Websites Breaking The Search Engines' Algorithms?&lt;/a&gt;" Tim Daly suggested that paid search listings could become more relevant than organic listings because of the emphasis on inbound links in search algorithms.&lt;br /&gt;Google rewards sites with links coming from important, authoritative sites. The company's reasoning is that a site with numerous quality inbound links must be popular, ergo it is a quality site. Sites with higher PageRank scores are given higher rankings than those with a lower PageRank. Once Google gained popularity based on PageRank, all the other search engines followed suit, so this ranking system dominates. Perhaps at the time, it was an excellent ranking variable, but it's becoming outdated today.&lt;br /&gt;As Daly shows with his example of Wikipedia's dominance in the SERPs, an abundance of quality links does not necessarily an authoritative site make. This is a subjective take, based on the weight given to inbound links by Google's PageRank. As demonstrated by the questionable accuracy of some Wikipedia content, it takes more than links alone to prove authority.&lt;br /&gt;Bridge over troubled watersResearch shows that general search engines are losing ground to vertical search engines (VSEs). Outsell reported a 31.9 percent search failure rate among business users on major search engines. This means that roughly one-third of user queries yield unsatisfactory results.&lt;br /&gt;Convera went further by saying general search does not meet the needs of today's business and professional users. General search queries result in time inefficiencies and unmet needs as critical information becomes increasingly difficult to find quickly on the web.&lt;br /&gt;In contrast to general search engines, vertical search engines have built-in preference mechanisms and are constantly rolling out improved features. In my opinion, bidding is the best qualifier. VSE users naturally weed out faulty search engine algorithms. Clients bidding high on irrelevant keywords for the sake of attracting traffic would have their budgets zapped, resulting in a dreadful ROI, and business users wouldn't stand for this.&lt;br /&gt;VSEs also have built-in merchant rating systems similar to those of a power seller on eBay. This further refines the search relevance.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-4842905738577755835?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/4842905738577755835/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=4842905738577755835&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/4842905738577755835'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/4842905738577755835'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/05/is-google-killing-seo.html' title='Is Google Killing SEO?'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_W2DVHM5FSi0/RksfZI4NN2I/AAAAAAAAAtU/IBt8wwxZ2X4/s72-c/hs_prescott_jason_100x100.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-6859345710649204582</id><published>2007-05-15T04:51:00.000-07:00</published><updated>2007-05-15T04:53:40.588-07:00</updated><title type='text'>Some Things To Consider When Evaluating Your Website</title><content type='html'>You have either put a lot of effort into your website or you have paid someone else a lot of money to put the effort in for you. Either way, whatever the purpose of the website, you want to get the most out of it. The question now becomes, how you can tell if your website is likely to succeed.&lt;br /&gt;Why?&lt;br /&gt;The first thing to do is to ask yourself why you have set up the website. Are you trying to sell a product or provide information or something else? What do you want to happen when a visitor lands on your pages? "For a man without a destination no wind is favourable" (An old saying attributed to many). If you do not know exactly what you want to happen, how can you expect the visitors to your website to know and do it? You are the one who ought to have the site set up to direct people to their destination. If you don't know what that is, then all is lost.&lt;br /&gt;&lt;br /&gt;Your visitors probably know why they visited your site. You too must know why they came and help them do what they came to do. If your website does not provide what they need they will move on to another one. Just because you are getting all the traffic you could hope for does not mean that your site will succeed.&lt;br /&gt;Your Website's Conversion Rate&lt;br /&gt;You will need to measure your success rate. There are a number of ways to do this. One is the Conversion rate. Simply put, the conversion rate is the rate at which you convert visitors into buyers. Or if you are not selling it is the rate at which you convince people to do whatever it is you need them to do. It could be to sign up for your newsletter of subscribe to something else, etc. If you have one hundred visitors to your website per day and you convert two, your conversion rate is two percent.&lt;br /&gt;It is a reasonably good measure of the quality of your website. If your site is not converting, you will know that you need to make changes to the site. However, it could also mean that you marketing or advertising campaign is sending untargeted traffic to your site. In other words sending visitors who are not in the least bit interested in what you have to offer.&lt;br /&gt;SEO &amp;amp; Traffic Generation&lt;br /&gt;The whole point of Search Engine Optimisation (SEO) is traffic generation. The idea is that you optimise or fine tune your website so that it gets to the top of the search results when people enter a search term that is contained in your website. You do this to get traffic. If your site is not properly optimised people are unlikely to find it. Unless of course you have found some narrow niche that nobody else has heard of, which will not bring a lot of visitors. SEO involves using the correct keywords in the correct way and arranging the contents and menus in the right way and most important of all is link building.&lt;br /&gt;To rank highly, at the time of writing, the single most important thing to do to rank highly in the search engines is to increase the number of links to your site from quality websites which have content related to the subject of your site.&lt;br /&gt;Content&lt;br /&gt;It may sound obvious to most people but, the content of your website should be based on the subject of your product. For example if your website is set up to sell computers then it should contain articles about computers and computing etc. not gardening articles. If you have articles on unrelated subjects they will only serve to confuse your visitors and undermine your website's and your own credibility as a sourct of products and information about computers or whatever your website is promoting.&lt;br /&gt;The content should be keyword rich but not saturated or you may show up on spam radar. The content should be broken up into manageable paragraphs and properly laid out with headers for each section, making it easier to read and navigate.&lt;br /&gt;Navigation&lt;br /&gt;Getting the visitors to your website is only half og th battle. You then must give them what they want. What do they want? Well, the first thing they want is to find their way around your website without pulling their hair out in frustration. These days there is far too much competition on the internet for that to happen. They will move to another website at the first sign of difficulty.&lt;br /&gt;Arrange all the links and buttons in a way that is easy to read and understand. Do not over fill each page. If there is too much choice people do not make a choice they just get confused and... you guessed it. They move to another website.&lt;br /&gt;The first page they land on, usually the index page should be interesting. It should be obvious to them that they have landed on a page with the content they came for and the way to navigate to that content should be very clear. Do not try to give them everything on the front page.&lt;br /&gt;How easy is it for your visitors to accomplish what they came to do? Do they need to fill out pages of information or can the do their business in a few clicks? If people have to figure out the puzzle that your website is they will move on unless you have something so attractive and necessary that they will stay at all costs. If you have a product like that then you can not charge enough for it.&lt;br /&gt;It is always a good idea to have a professional web designer look over the site and point out any obvious flaws. I say obvious flaws because not all corrections are obvious and are often discovered through trial and error. You should keep tweaking the website in a continuous attempt to improve it. There is always room for improvement. Though it is also said that you should not fix something that works. I think that the best thing is to make gradual changes and if they are not a major improvement, at least they will not be a major disaster.&lt;br /&gt;If you are not confident enough to do the coding and graphics etc. for your own site, there are many professional web designers out there who live for it. So don't let it stop you from getting you name, product or information out there.&lt;br /&gt;&lt;br /&gt;About the Author: Steven Collins is a web designer at &lt;a href="http://desktopwebdesign.com/" target="_blank" rel="nofollow"&gt;Desktop Web Design&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-6859345710649204582?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/6859345710649204582/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=6859345710649204582&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/6859345710649204582'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/6859345710649204582'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/05/some-things-to-consider-when-evaluating.html' title='Some Things To Consider When Evaluating Your Website'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-5427658965019944913</id><published>2007-05-11T11:04:00.000-07:00</published><updated>2007-05-11T11:07:13.002-07:00</updated><title type='text'>How to Make your URLs SEO Friendly</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_W2DVHM5FSi0/RkSwvVtJb3I/AAAAAAAAArw/cueaw_GOpAc/s1600-h/untitled.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5063366208398126962" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_W2DVHM5FSi0/RkSwvVtJb3I/AAAAAAAAArw/cueaw_GOpAc/s320/untitled.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;Without search engine optimization many websites stand the chance of not being fully indexed by search spiders therefore risking not being ranked high enough (if at all) in the search engine results pages (SERPs). The resulting poor conversion rate makes the website a dead weight, demoralizes your staff and could threaten your business.&lt;br /&gt;URL Rewriting&lt;br /&gt;This situation is quite easy to avoid by performing some cosmetic operations to the site. One of these operations, URL rewriting, is considered by some rather difficult and a bit time-consuming but can be extremely effective and rewarding in the long run.&lt;br /&gt;Why It Is Nice to Have Clean URL'sThere are two very strong reasons for you to rewrite your URLs, the first of which is related to Search Engine Optimization. Search engines are much more at ease with URLs that don't contain long query strings.A URL like http://www.example.com/4/basic.html can be indexed very easily whereas its dynamic form, http://www.example.com/cgi-bin/gen.pl?id=4&amp;view=basic, can potentially confuse search engines and cause them to miss important information contained in the URL and you to miss those anticipated high rankings.With clean URLs, the search engines can distinguish folder names and can establish real links to keywords. Query string parameters continue to be an impediment in many search engine's attempts to fully index sites. Several SEO professionals agree that dynamic (or, dirty) URLs are not very appealing to web spiders, while static URLs have greater visibility in their electronic eyes.&lt;br /&gt;The second strong reason for URL rewriting would be the increased usability for web users and "maintainability" for webmasters. Clean URLs are much easier to remember. A regular web surfer will not remember a URL full of parameters, and would obviously be discouraged by the idea of typing the entire URL. This is less prone to happen with clean URLs. Easily remembered URLs help you create a more intuitive Web site and make it easier for your visitors to anticipate where they can find information they need.Webmasters tend to find that maintaining static URLs is a much easier task than working with dynamic ones. Static URLs are more abstract, and thus more difficult to hack. The dynamic URLs are more transparent, allowing possible hackers to see the technology used to build them and thus facilitating attacks.Also, given the length of dynamic URLs, it is very possible for webmasters to make mistakes during maintenance sessions, resulting in broken links. Also, when static URLs are used, the links to the site's pages will still remain valid should it be necessary to migrate a site from one programming language to another (e.g. from Perl to Java).&lt;br /&gt;Dashes vs. UnderscoresWebsites that still use underscores for their URLs are becoming scarcer and scarcer. Some say that people who still use underscores are "old school" while dashes seem be used far more often these days.A usability related reason for using dashes rather than underscores is the elimination of the confusion created between a space and an underscore when the URL is viewed as a link, or when printing such a URL.More to the point, the chances that a combination of keywords contained in your Web site is included in the SERPs increase exponentially when using dashes.For exemple: a URL that contains "seo_techniques" will be shown by the search engine only if the user searches for seo_techniques (this kind of search is rarely performed); whereas searches for "seo", "techniques", or "seo techniques" gives your URL containing "seo-techniques" a better chance of being displayed on the SERPs. The dash will help you more than you can imagine, by greatly improving your visibility on the Web.&lt;br /&gt;How to Rewrite URLs&lt;br /&gt;The principle of URL rewriting is actually setting a "system" on the host server that will allow it (the server) to know how to interpret the new URL format. What actually happens when one decides to rewrite the URLs of a website is called masking the dynamic URLs with static ones. This means that the URLs that previously contained query strings with elements such as "?", "+", "&amp;", "$", "=", or "%" will contain the more search engine friendly "/" (slash) element, presenting themselves in a simplified form.To help you with cleaning your URLs here are some rewriting tools and engines, some free of charge, others fee based.&lt;br /&gt;Online / Open Source Tools&lt;br /&gt;&lt;a href="http://www.seochat.com/seo-tools/url-rewriting/" target="_blank"&gt;free online URL rewriting&lt;/a&gt;&lt;br /&gt;&lt;a href="http://urlrewriter.net/" target="_blank"&gt;open Source URL Rewriter for .NET / IIS / ASP.NET&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.urlrewriting.net/en/FAQ.aspx" target="_blank"&gt;open Source rewrite-module tuned for ASP.NET 2.0&lt;/a&gt;&lt;br /&gt;&lt;a href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html" target="_blank"&gt;mod_rewrite&lt;/a&gt; This is the most common non-fee-based rewriting engine. It is a module from the Apache HTTP Server that allows the easy manipulation of URLs. The use of this module requires the enabling of the RewriteEngine on your Apache server. Then, rewrite rules must be defined, (you can even set conditions for each rule), thus allowing the rewrite requests as they come in.In terms of SEO, mod_rewrite can be helpful if you have complex URLs that contain more than 2 parameters. In other words, if one of your dynamic URLs is accessed, the mechanism behind mod_rewrite will "translate" it into a shorter, friendlier, static-looking URL.&lt;br /&gt;Fee-Based Tools&lt;br /&gt;&lt;a href="http://www.isapirewrite.com/" target="_blank"&gt;ISAPI_Rewrite&lt;/a&gt;The Internet Server Application Program Interface (ISAPI) is another URL manipulation engine that functions in a similar way to Apache's mod_rewrite, the difference being it is designed specifically for Microsoft's IIS (Internet Information Server).&lt;br /&gt;&lt;a href="http://www.qwerksoft.com/products/iisrewrite/" target="_blank"&gt;IISRewrite&lt;/a&gt;IISRewrite is a stripped down implementation of Apache's mod_rewrite modules for IIS. It is a rule-based rewriting engine that allows a Webmaster to manipulate URLs on the fly in IIS.&lt;br /&gt;URL ExamplesHere are some examples of how URLs can look before and after rewriting:Example 1:&lt;br /&gt;Dynamic URL: http://www.companyname.com/products/items.php?id=x&amp;amp;model=y&amp;variety=z (before rewriting)&lt;br /&gt;Static URL: http://www.companyname.com/x/y/z.html (after rewriting) Example 2:&lt;br /&gt;Dynamic URL: http://www.example.com/cgi-bin/gen.pl?id=4&amp;amp;view=basic (before writing)&lt;br /&gt;Static URL: http://www.example.com/4/basic.html (after writing)&lt;br /&gt;ConclusionsURL rewriting can put you on the right track in the race for high organic rankings when combined with other SEO techniques. Be aware that rewritten (and, presumably, better looking and more effective in terms of search engine ranking) URLs cannot substitute or make up for a poorly designed Web site.Don't expect miracles. Nevertheless, when you decide that your site needs a makeover and start rewriting your URLs, make sure that:&lt;br /&gt;You keep them as short as possible (to increase usability),&lt;br /&gt;You use dashes rather than underscores (to give your site a better chance of ranking as high as possible in the SERPs),&lt;br /&gt;You use lowercase letters rather than uppercase ones (to avoid those case sensitive situations),&lt;br /&gt;The technology you have used cannot be detected in any of your URLs (to prevent possible hacker attacks). &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-5427658965019944913?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/5427658965019944913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=5427658965019944913&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/5427658965019944913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/5427658965019944913'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/05/how-to-make-your-urls-seo-friendly.html' title='How to Make your URLs SEO Friendly'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_W2DVHM5FSi0/RkSwvVtJb3I/AAAAAAAAArw/cueaw_GOpAc/s72-c/untitled.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-5874573432756664451</id><published>2007-05-08T08:46:00.000-07:00</published><updated>2007-05-08T08:50:08.495-07:00</updated><title type='text'>What is a text editor?</title><content type='html'>A text editor is used to edit plain text files.  Text editors differ from word processors, such as Microsoft Word or WordPerfect, in that they do not add additional formatting information to documents.  You might write a paper in Word, because it contains tools to change fonts, margins, and layout, but Word by default puts that formatting and layout information directly into the file, which will confuse the compiler.  If you open a .doc file in a text editor, you will notice that most of the file is formatting codes.  Text editors, however, do not add formatting codes, which makes it easier to compile your code.&lt;br /&gt;Why should I use a text editor?&lt;br /&gt;Text editors have a feature set different from that of a traditional word processing program.  For example, most won't let you include pictures, or include tables, or double-space your writing.  The features of text editors vary from implementation to implementation, but there are several kinds of features that most editors have.  Below are listed some of the most common and useful features.&lt;br /&gt;&lt;br /&gt;Syntax highlighting&lt;br /&gt;&lt;br /&gt;Syntax highlighting is a very useful feature.  It means that the editor will highlight certain words or types or syntax specific to a language.  For example, if you have C++ highlighting turned on, the editor might make all C++ control flow keywords appear green.  This makes it much easier to follow the flow of your program.  As another example, the editor might have all quoted text show up as light blue.  This way, if you forget to include an opening or closing quotation mark, you will quickly realize it because of the color of the text on your screen.  A text editor might also indicate mismatched parentheses or brackets by turning them red; if you have a closing brace with no corresponding opening one, the color will tell you that you made a syntax error somewhere.//Here is an example of what text might look like in your editor.&lt;br /&gt;//This text is colored because it is a comment.&lt;br /&gt;if (x &gt; 5)&lt;br /&gt;{&lt;br /&gt;//The closing parenthesis is red because it is unmatched.&lt;br /&gt;x = 5 - ((3 + y) * (8 + (z / 24))));&lt;br /&gt;}&lt;br /&gt;Versatility&lt;br /&gt;How does the editor know which words to highlight?  Good question.  The editor knows what language you are programming in.  It does this by either having you tell it, or, like Vim, detecting the suffix of the file.  If you are working on a file named code.cc, it will see the .cc and know to use C++ rules, but if you are working on one called code.html, it will apply HTML rules instead.  Some editors know hundreds of languages, ranging from the commonplace (C, Java, Perl) to the truly obscure (TADS, ABAQUS).  This means that you can use the same editor to program in practically any language you can think of and still enjoy the same feature and command set that you've become accustomed to.&lt;br /&gt;&lt;br /&gt;automatic indenting&lt;br /&gt;&lt;br /&gt;automatic indenting is probably the most useful feature of a text editor. would you rather deal with code that looks like this (taken from a fifteen-puzzle):int get_col (int tile_id)&lt;br /&gt;{&lt;br /&gt;/*Cycle through...*/&lt;br /&gt;int i = 0, j = 0;&lt;br /&gt;while (i &lt; Dim)&lt;br /&gt;{&lt;br /&gt;if (board[i][j] == tile_id)&lt;br /&gt;{&lt;br /&gt;return i;&lt;br /&gt;}&lt;br /&gt;/*If you've hit the end of the row, move to the beginning of the&lt;br /&gt;* next.*/&lt;br /&gt;if (i == Dim-1)&lt;br /&gt;{&lt;br /&gt;j++;&lt;br /&gt;i = 0;&lt;br /&gt;/*Otherwise move to the next space in the row.*/&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;i++;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;/*This is only to get rid of the warning.*/&lt;br /&gt;return i;&lt;br /&gt;}&lt;br /&gt;or code that looks like this?:&lt;br /&gt;&lt;br /&gt;int get_col ( int tile_id)&lt;br /&gt;{&lt;br /&gt;/*Cycle through...*/&lt;br /&gt;int i = 0, j = 0;&lt;br /&gt;while (i &lt; Dim) {&lt;br /&gt;if (board[i][j] == tile_id) {&lt;br /&gt;return i;&lt;br /&gt;}&lt;br /&gt;/*If you've hit the end of the row, move to the beginning of the next*/&lt;br /&gt;if (i == Dim-1) {&lt;br /&gt;j++;&lt;br /&gt;i = 0;&lt;br /&gt;/*Otherwise move to the next space in the row.*/} else {&lt;br /&gt;i++;&lt;br /&gt;/*This is only to get rid of the warning.*/&lt;br /&gt;return i;&lt;br /&gt;&lt;br /&gt;I thought so.  A text editor will spare you the trouble of having to put in all the tabs yourself by adding them automatically.  This has the benefit of letting you follow the control flow through indentation, so that you can make sure you are in the right block of code as you write.&lt;br /&gt;&lt;br /&gt;Quick navigation features&lt;br /&gt;&lt;br /&gt;If your program is anything above trivial, you'll want to be able to move through it quickly to find certain functions, instances of certain variables, or particular lines.  Text editors typically have more sophisticated movement capability than word processors.  For example, say you're compiling a program and find that you have a syntax error on line 312.  In Vim, all you have to do is type 312G, and the cursor will move to line 312.  (How does Vim know you don't want to type the characters 312G into the document?  More on that in the links at the end of the article.) &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Which text editor should I use?  What's the difference between them?  How do I get one?  How much do they cost?&lt;br /&gt;&lt;br /&gt;There are many, many different editors available, with &lt;a href="http://www.vim.org/"&gt;Vim&lt;/a&gt; and &lt;a href="http://www.gnu.org/software/emacs/emacs.html"&gt;Emacs&lt;/a&gt; being two of the most popular, portable, and powerful.  Most editors (Vim and Emacs included) are free, but some are shareware.  I use Vim, but each editor has its adherents.  For a good listing of some of the best editors available for your platform, &lt;a href="http://fmwww.bc.edu/repec/bocode/t/textEditors.html"&gt;check out this FAQ on text editors&lt;/a&gt;. (It's aimed at STATA users, but all the editors listed are just fine for writing C++ code.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-5874573432756664451?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/5874573432756664451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=5874573432756664451&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/5874573432756664451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/5874573432756664451'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/05/what-is-text-editor.html' title='What is a text editor?'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-2182700869699362768</id><published>2007-05-05T07:55:00.000-07:00</published><updated>2007-05-05T07:59:13.258-07:00</updated><title type='text'>What is a compiler?</title><content type='html'>A compiler is necessary to make your source code (..c, .cpp, or .cc files) into a running program. If you're just starting out, you'll need to make sure that you have one before you &lt;a href="http://www.cprogramming.com/tutorial/lesson1.html"&gt;start programming&lt;/a&gt;. There are many compilers available on the internet and sold commercially in stores or &lt;a href="http://www.amazon.com/exec/obidos/external-search?search-type=ss&amp;tag=lynnallain&amp;amp;keyword=c++%20compiler&amp;amp;mode=software"&gt;online&lt;/a&gt;. If you have Mac OS X, Linux, or other *nix variant (such as Unix or FreeBSD), you likely have a compiler such as &lt;a href="http://www.cprogramming.com/gcc.html"&gt;gcc&lt;/a&gt; or &lt;a href="http://www.cprogramming.com/g++.html"&gt;g++&lt;/a&gt; installed already.&lt;br /&gt;Compiler terminology&lt;br /&gt;Compile Colloquially, to convert a source code file into an executable, but strictly speaking, compilation is an intermediate step&lt;br /&gt;Link The act of taking compiled code and turning it into an executable&lt;br /&gt;Build A build refers to the process of creating the end executable (what is often colloquially refered to as compilation). Tools exits to help reduce the complexity of the build process--&lt;a href="http://cprogramming.com/tutorial/makefiles.html"&gt;makefiles&lt;/a&gt;, for instance.&lt;br /&gt;Compiler Generally, compiler refers to both a compiler and a "linker"&lt;br /&gt;Linker The program that generates the executable by linking&lt;br /&gt;IDE Integrated Development Environment, a combination of a &lt;a href="http://www.cprogramming.com/texteditors.html"&gt;text editor&lt;/a&gt; and a compiler, such that you can compile and run your programs directly within the IDE. IDEs usually have facilities to help you quickly jump to compiler errors.&lt;br /&gt;Understanding the Compilation Process&lt;br /&gt;&lt;a href="http://www.cprogramming.com/compilingandlinking.html"&gt;The compilation and linking process&lt;/a&gt; A brief description of exactly what happens when you compile a program, covering the above terms in more detail&lt;br /&gt;&lt;a href="http://www.cprogramming.com/tutorial/compiler_linker_errors.html"&gt;Dealing with Compilation Errors&lt;/a&gt; Some suggestions for hunting down compiler and linker errors in your code&lt;br /&gt;&lt;a href="http://www.cprogramming.com/tutorial/compiler_warnings.html"&gt;Understanding Compiler Warnings&lt;/a&gt; Learn what compiler warnings mean and the hows and whys of fixing them&lt;br /&gt;What compilers are available?&lt;br /&gt;Windows/DOS&lt;br /&gt;&lt;a href="http://www.cprogramming.com/borland.html"&gt;Borland&lt;/a&gt; Find out how to download and set up Borland's free command-line compiler&lt;br /&gt;&lt;a href="http://www.cprogramming.com/djgpp.html"&gt;DJGPP&lt;/a&gt; Read about DJGPP, a DOS-based compiler&lt;br /&gt;&lt;a href="http://www.cprogramming.com/other.html"&gt;Dev-C++ and Digital Mars&lt;/a&gt; Read about Dev-C++, a good windows based compiler, and Digital Mars&lt;br /&gt;Windows Only&lt;br /&gt;&lt;a href="http://www.cprogramming.com/visual.html"&gt;Microsoft Visual C++&lt;/a&gt; Read about Visual C++&lt;br /&gt;*nix&lt;br /&gt;&lt;a href="http://www.cprogramming.com/g++.html"&gt;g++&lt;/a&gt; is a C++ compiler that comes with most *nix distributions.&lt;br /&gt;&lt;a href="http://www.cprogramming.com/gcc.html"&gt;gcc&lt;/a&gt; is a C compiler that comes with most *nix distributions.&lt;br /&gt;Macintosh&lt;br /&gt;&lt;a href="http://developer.apple.com/tools/mpw-tools/"&gt;Apple's own Macintosh Programmer's Workshop&lt;/a&gt; is a compiler I've never used, but it is direct from apple and free.&lt;br /&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/B00003IELF/lynnallain"&gt;Codewarrior &lt;/a&gt;My experiences with Codewarrior are limited to Java programming, though it's gotten good reviews in the past. It's a full IDE rather than just a compiler, meaning that it has a text editor and debugger integrated with the compiler so you can do all your work from one place.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-2182700869699362768?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/2182700869699362768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=2182700869699362768&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/2182700869699362768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/2182700869699362768'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/05/what-is-compiler.html' title='What is a compiler?'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-8860013923734243431</id><published>2007-05-02T21:27:00.000-07:00</published><updated>2007-05-02T21:28:27.863-07:00</updated><title type='text'>Affiliate Program Management</title><content type='html'>Affiliate marketing programs provide a powerful and popular way for many companies to generate significant revenue from the Internet, but not every company is properly positioned for a successful program. At 10x Marketing we believe that each company ought to be accurately evaluated before engaging in an affiliate program. Our assessment service is designed to help companies know whether or not an affiliate marketing program is right for them. At the end of this assessment you'll have a good understanding of your chances of success and the risks involved with this type of Internet marketing.What is an Affiliate Program?Affiliate programs are a type of eCommerce program which generate traffic to a company’s website by convincing affiliate sites to link to them. The parent company pays each affiliate company a percentage of the sale for every online customer it gets as a result of a direct link from the affiliate’s website to its own. The affiliate company is essentially paid a commission for generating traffic, leads, or sales to the parent company’s website.&lt;br /&gt;For example, a company that sells fitness gear would provide a link to the site of a fitness club that offers related (but not competing) products and services. The fitness gear company would then receive a commission of the sales gained from any buyers they direct to the fitness club. Since the fitness club gets more revenue from the new customers, both companies benefit.How Can 10x Marketing Help Me Run an Affiliate Program?10x Marketing employs an experienced Affiliate Marketing Team that excels in designing and implementing &lt;a href="http://www.10xmarketing.com/Success/Affiliate-Marketing/FranklinCovey.html"&gt;successful affiliate programs&lt;/a&gt;, one of several &lt;a href="http://www.10xmarketing.com/Services-Solutions/Affiliate-Programs/Services/Internet-Marketing-Research/Traffic-Generation-Services.html"&gt;traffic generation services&lt;/a&gt;. Our team provides the following benefits and advantages to your company:&lt;br /&gt;Set up, manage, and monitor your entire affiliate program.&lt;br /&gt;Design professional ads to attract potential customers on a regular basis.&lt;br /&gt;Recruit new affiliates to your program that continually drive business to you.&lt;br /&gt;Help you to design your site specifically to convert those visitors into buyers of your products and services.&lt;br /&gt;Keep you up-to-date by monitoring, maintaining, and reporting the success of your program on a regular basis.&lt;br /&gt;In short, 10x Marketing has the experience, tools, and expertise to help you with all of your affiliate marketing needs. We also welcome new affiliates to our current programs. Give us a call. We'll be happy to answer any questions you may have.&lt;br /&gt;How Do I Start?&lt;a href="http://www.10xmarketing.com/mosforms/get-more-information.html"&gt;Contact us&lt;/a&gt; to see if Internet marketing is right for your company. There's no obligation and no better time to start generating more revenue from the Internet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-8860013923734243431?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/8860013923734243431/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=8860013923734243431&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/8860013923734243431'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/8860013923734243431'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/05/affiliate-program-management.html' title='Affiliate Program Management'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-4737254331919949670</id><published>2007-05-02T21:25:00.000-07:00</published><updated>2007-05-02T21:26:45.455-07:00</updated><title type='text'>10x Marketing eBLAST Services</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_W2DVHM5FSi0/Rjlkd1tJa0I/AAAAAAAAAjY/4MkMA9Ugs4A/s1600-h/roi-online-advertising.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5060186120122886978" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_W2DVHM5FSi0/Rjlkd1tJa0I/AAAAAAAAAjY/4MkMA9Ugs4A/s320/roi-online-advertising.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;10x Marketing offers eBLAST (E-mail Business Leads and Sales Tool), which combines both e-mail marketing and newsletter services to provide small to large businesses with the following:&lt;br /&gt;Wider client audiences&lt;br /&gt;Better client relationships&lt;br /&gt;Industry expert status&lt;br /&gt;The opportunity to obtain and retain mind share&lt;br /&gt;The chance to educate and inform clients and associates in regards to products/services&lt;br /&gt;Why E-mail Marketing?The chart below compares the ROI percentages obtained via various online advertising methods. Observe that opt-in-e-mail, or &lt;a href="http://www.10xmarketing.com/Learning-Center/Glossary/Internet-Marketing-Glossary.html#5"&gt;e-mail marketing&lt;/a&gt;, comes second only to &lt;a href="http://www.10xmarketing.com/Services/Marketing-Services/PPC-Management.html"&gt;pay-per-click marketing (PPC)&lt;/a&gt;, which is also a valuable marketing option for any business.E-mail marketing is five times more effective than direct mailing and 25 times more effective than banner ads. E-mail marketing generates immediate results, which are easily tracked and measured. Best of all, e-mail marketing is generally preferred—by both senders and recipients—to direct mail, telemarketing, radio, or TV (Source: ConstantContact.com).&lt;br /&gt;10x Marketing's eBLAST newsletter services include:&lt;br /&gt;&lt;a href="http://www.10xmarketing.com/services-solutions/marketing-services/eBLAST-newsletter-Services.html#1"&gt;eBLAST Core Services&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.10xmarketing.com/services-solutions/marketing-services/eBLAST-newsletter-Services.html#2"&gt;eBLAST Stats Services&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.10xmarketing.com/services-solutions/marketing-services/eBLAST-newsletter-Services.html#3"&gt;eBLAST Plus Services&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.10xmarketing.com/services-solutions/marketing-services/eBLAST-newsletter-Services.html#4"&gt;Additional Services&lt;/a&gt;&lt;br /&gt;&lt;a name="1"&gt;eBLAST Core Services&lt;/a&gt;The initial eBLAST core services work like this: 10x Marketing receives your client list, removes all duplicate entries, and validates all e-mail addresses. This list is inserted into a database. Then, you choose the HTML template of your choice, on which 10x will also provide links that will allow your clients and associates to subscribe to, forward, or unsubscribe to your newsletter. You then create a short e-mail text and 10x performs a series of test runs to make sure that every eBLAST will be sent according to plan. After the eBLAST trial-runs, editorial adjustments will be made as needed and 10x will begin to send regularly scheduled eBLASTS. All eBLAST statistics will be monitored and reports regarding these statistics will be sent to you for business related analysis.&lt;br /&gt;&lt;a name="2"&gt;eBLAST Stat Services&lt;/a&gt;The eBLAST stats services include all of the eBLAST core services, plus a statistics sub-account, which provides you with a login that allows you to view your eBLAST statistics at any time. The eBLAST stats services also include a private label opt-out footer complete with your company’s logo, 5,000 credits (or e-mails) per month and an e-mail capture form on your website. The option to buy additional discounted credits is also an eBLAST stats option.&lt;br /&gt;&lt;a name="3"&gt;eBLAST Plus Services&lt;/a&gt;The eBLAST plus services include the eBLAST core services plus a full access sub-account which includes a login to view real-time statistics, a login to send your own blasts (this is optional), a private label opt-out footer with your logo, 5,000 credits per month, up to 2 hours consulting and/or technical support, up to 2 hours custom design work, up to 5 hours of writing services (or 1 feature article), and an e-mail capture form on your company’s website. The option to buy additional discounted credits is also available with the eBLAST plus services package.&lt;br /&gt;&lt;a name="4"&gt;Additional Services&lt;/a&gt;Additional eBLAST newsletter services include:&lt;br /&gt;A custom designed e-mail template&lt;br /&gt;E-mail personalization up to 25 fields&lt;br /&gt;Private label opt-out footer with client’s logo&lt;br /&gt;E-mail capture form on client’s website&lt;br /&gt;Writing or Editing E-mail Templates&lt;br /&gt;Copy Writing&lt;br /&gt;Initial Story Planning&lt;br /&gt;Research&lt;br /&gt;Interviewing&lt;br /&gt;Writing&lt;br /&gt;Archiving&lt;br /&gt;PDF Version&lt;br /&gt;HTML Version&lt;br /&gt;PDF and HTML Version&lt;br /&gt;Add archives to client’s website&lt;br /&gt;Questions?For more information, please &lt;a href="http://www.10xmarketing.com/mosforms/talk-sales.html"&gt;contact a 10x Marketing representative&lt;/a&gt;.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-4737254331919949670?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/4737254331919949670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=4737254331919949670&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/4737254331919949670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/4737254331919949670'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/05/10x-marketing-eblast-services.html' title='10x Marketing eBLAST Services'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_W2DVHM5FSi0/Rjlkd1tJa0I/AAAAAAAAAjY/4MkMA9Ugs4A/s72-c/roi-online-advertising.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-266152902555092509</id><published>2007-05-02T21:23:00.000-07:00</published><updated>2007-05-02T21:24:03.072-07:00</updated><title type='text'>Search Engine Marketing</title><content type='html'>While email remains the most popular activity on the Internet with about 95% of all Internet users engaging in email activities, it is important to understand that using search engines is the second most popular activity among all Internet users worldwide. About 88% of all Internet users use search engines to find what they're looking for on the Internet. There is little doubt that potential customers are currently using search engines to search for the products and services your company sells. The real question then is, "What are you doing to help them find you, instead of your competitors?"&lt;br /&gt;"My media director would say that if you aren't putting money into search engines you are letting business walk out the door."&lt;br /&gt;Bruce Carlisle, CEOSFInteractive&lt;br /&gt;Imagine if everybody who visited your website was actively searching for the exact things you sell. What would that be worth to you? This is precisely what search engine marketing does for your business.&lt;br /&gt;There are basically two ways to use search engines to your advantage. The first is to obtain &lt;a href="http://www.10xmarketing.com/Services/Search-Engines/Natural-Search-Results.html"&gt;free traffic&lt;/a&gt; or &lt;a href="http://www.10xmarketing.com/Services/Search-Engines/Natural-Search-Results.html"&gt;natural search results&lt;/a&gt; by getting your website listed among the top 10 results of specific searches. The second way to use search engines to your advantage is to buy your way to the front page of specific searches. This strategy is called &lt;a href="http://www.10xmarketing.com/Services/Marketing-Services/PPC-Management.html"&gt;pay-per-click&lt;/a&gt; or sometimes &lt;a href="http://www.10xmarketing.com/Learning-Center/Glossary/Internet-Marketing-Glossary.html#CPC"&gt;cost-per-click&lt;/a&gt;.&lt;br /&gt;If you know how to use search engines to your advantage, you can get your website listed on the first page of a given search and redirect pre-qualified visitors to your website on a regular basis.&lt;br /&gt;The result of this effort, if done properly, will be more visitors, more buyers, and more revenue for your company from the Internet. Contact 10x Marketing today and begin taking advantage of this highly profitable way to improve your bottom line.&lt;br /&gt;How Do I Start?&lt;a href="http://www.10xmarketing.com/mosforms/get-more-information.html"&gt;Contact us&lt;/a&gt; to see if Internet marketing is right for your company. There's no obligation and no better time to start generating more revenue from the Internet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-266152902555092509?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/266152902555092509/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=266152902555092509&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/266152902555092509'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/266152902555092509'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/05/search-engine-marketing.html' title='Search Engine Marketing'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-2745955130692956953</id><published>2007-05-01T07:56:00.000-07:00</published><updated>2007-05-01T07:59:06.595-07:00</updated><title type='text'>Solving Cool Problems with Genetic Algorithms</title><content type='html'>representable as strings (hence the name Genetic Algorithm - the programming model is based on DNA). In terms of practical value, genetic algorithms are useful for solving problems in which the solutions are difficult to find by following a specific algorithm designed to solve the problem (using genetic algorithms in place of predesigned algorithms such as Djikstra's algorithm for path finding just wouldn't make sense). It functions as a sort of systematized brute force approach. Problems genetic algorithms are valuable for solving include scheduling problems, constraint satisfaction problems, and other problems that require searching a large number of possibilities. Genetic algorithms can be applied to protein folding or even &lt;a href="http://kerneltrap.org/node/4493"&gt;tuning Linux kernel performance&lt;/a&gt;.&lt;br /&gt;A simpler example just to get the point across is finding a five digit number that acts as the best solution to an expression; for example, if you wish to find the number that makes the expression x^2+2x-11 equal to 0, you could of course use brute force to solve the equation, but a genetic algorithm can also be used, and if you have a very complex expression, it may be of great value to use a genetic algorithm, especially when one considers the time saved over brute force. In a sense, all genetic algorithm problems boil down to solving complex expressions or sets of expressions, as all problems are representable in that fashion. Genetic algorithms work from the same basis as evolutionary theory. A genetic algorithm has several components: a pool of solutions, a method of evaluating the effectiveness of each solution, a breeding function that combines the best solutions into new solutions, and a mutation function. The pool of solutions do not compete for resources; rather, each solution is tested by an evaluation function (called the "fitness" function), which then gives it a ranking based on its effectiveness at solving the problem compared to the other solutions. The best solution strings are the ones that are ranked highest (that are the most "fit"); the breeding function takes two of the better performing solutions and combines them together into a new solution. The breeding function should repeat the process of randomly selecting two solutions and breeding them; the better performing functions should be given the higher percentage chance of being selected. The breeding function generally works by taking slices of each solution and splicing them together into a new one. Solutions are often represented as strings, so generally, a breeding function will take fragments of random lengths from each string and concatenate them together to form a new string. Each fragment should be placed into the location in the new string that corresponds to its location in the old string. For example, if a string fragment is from positions 5 to 8 in the first string being bred, it should be placed into positions 5 through 8 in the new child solution. After the strings have been bred, and the set of potential solutions has been refilled, it is important to have the mutation function. The mutation function is important because it introduces an element of randomness that allows variation in the solution sets, which otherwise would stagnate and have no advantage over a hand-crafted solution. Mutations may diminish the strength of some solutions, but in general it will increase the overall value of the solution set; by including a very small mutation rate, you introduce new traits that might never have otherwise existed within the pool. This allows you to explore a larger group of possibilities and avoid stagnation. In fact, many other AI techniques forgo the idea of breeding solutions and work simply by making small "mutations" or changes to a potential solution to a problem. Genetic algorithms can do some amazing things and solve very complex problems. Nevertheless, this techniques will require having way of evaluating possible solutions -- this is one of the most difficult problems with genetic algorithms. The second challenge is finding a good way to represent solutions to the problem as strings. Once these are sorted out, a genetic algorithm may be a good approach to your problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-2745955130692956953?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/2745955130692956953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=2745955130692956953&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/2745955130692956953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/2745955130692956953'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/05/solving-cool-problems-with-genetic.html' title='Solving Cool Problems with Genetic Algorithms'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-2061875719830118141</id><published>2007-04-30T09:30:00.000-07:00</published><updated>2007-04-30T09:32:08.017-07:00</updated><title type='text'>Binary Trees: Part 1</title><content type='html'>The binary tree is a fundamental data structure used in computer science. The binary tree is a useful data structure for rapidly storing sorted data and rapidly retrieving stored data. A binary tree is composed of parent nodes, or leaves, each of which stores data and also links to up to two other child nodes (leaves) which can be visualized spatially as below the first node with one placed to the left and with one placed to the right. It is the relationship between the leaves linked to and the linking leaf, also known as the parent node, which makes the binary tree such an efficient data structure. It is the leaf on the left which has a lesser key value (ie, the value used to search for a leaf in the tree), and it is the leaf on the right which has an equal or greater key value. As a result, the leaves on the farthest left of the tree have the lowest values, whereas the leaves on the right of the tree have the greatest values. More importantly, as each leaf connects to two other leaves, it is the beginning of a new, smaller, binary tree. Due to this nature, it is possible to easily access and insert data in a binary tree using search and insert functions recursively called on successive leaves.&lt;br /&gt;The typical graphical representation of a binary tree is essentially that of an upside down tree. It begins with a root node, which contains the original key value. The root node has two child nodes; each child node might have its own child nodes. Ideally, the tree would be structured so that it is a perfectly balanced tree, with each node having the same number of child nodes to its left and to its right. A perfectly balanced tree allows for the fastest average insertion of data or retrieval of data. The worst case scenario is a tree in which each node only has one child node, so it becomes as if it were a linked list in terms of speed. The typical representation of a binary tree looks like the following:&lt;br /&gt;10&lt;br /&gt;/ \&lt;br /&gt;6 14&lt;br /&gt;/ \ / \&lt;br /&gt;5 8 11 18The node storing the 10, represented here merely as 10, is the root node, linking to the left and right child nodes, with the left node storing a lower value than the parent node, and the node on the right storing a greater value than the parent node. Notice that if one removed the root node and the right child nodes, that the node storing the value 6 would be the equivalent a new, smaller, binary tree.The structure of a binary tree makes the insertion and search functions simple to implement using recursion. In fact, the two insertion and search functions are also both very similar. To insert data into a binary tree involves a function searching for an unused node in the proper position in the tree in which to insert the key value. The insert function is generally a recursive function that continues moving down the levels of a binary tree until there is an unused leaf in a position which follows the rules of placing nodes. The rules are that a lower value should be to the left of the node, and a greater or equal value should be to the right. Following the rules, an insert function should check each node to see if it is empty, if so, it would insert the data to be stored along with the key value (in most implementations, an empty node will simply be a NULL pointer from a parent node, so the function would also have to create the node). If the node is filled already, the insert function should check to see if the key value to be inserted is less than the key value of the current node, and if so, the insert function should be recursively called on the left child node, or if the key value to be inserted is greater than or equal to the key value of the current node the insert function should be recursively called on the right child node. The search function works along a similar fashion. It should check to see if the key value of the current node is the value to be searched. If not, it should check to see if the value to be searched for is less than the value of the node, in which case it should be recursively called on the left child node, or if it is greater than the value of the node, it should be recursively called on the right child node. Of course, it is also necessary to check to ensure that the left or right child node actually exists before calling the function on the node.Because binary trees have log (base 2) n layers, the average search time for a binary tree is log (base 2) n. To fill an entire binary tree, sorted, takes roughly log (base 2) n * n. Lets take a look at the necessary code for a simple implementation of a binary tree. First, it is necessary to have a struct, or class, defined as a node.struct node&lt;br /&gt;{&lt;br /&gt;int key_value;&lt;br /&gt;struct node *left;&lt;br /&gt;struct node *right;&lt;br /&gt;};&lt;br /&gt;The struct has the ability to store the key_value and contains the two child nodes which define the node as part of a tree. In fact, the node itself is very similar to the node in a linked list. A basic knowledge of the code for a linked list will be very helpful in understanding the techniques of binary trees. Essentially, pointers are necessary to allow the arbitrary creation of new nodes in the tree.There are several important operations on binary trees, including inserting elmeents, searching for elements, removing elements, and deleting the tree. We'll look at three of those four operations in this tutorial, leaving removing elements for later. We'll also need to keep track of the root node of the binary tree, which will give us access to the rest of the data: struct node *root = 0;&lt;br /&gt;It is necessary to initialize root to 0 for the other functions to be able to recognize that the tree does not yet exist. The destroy_tree shown below which will actually free all of the nodes of in the tree stored under the node leaf: tree. void destroy_tree(struct node *leaf)&lt;br /&gt;{&lt;br /&gt;if( leaf != 0 )&lt;br /&gt;{&lt;br /&gt;destroy_tree(leaf-&gt;left);&lt;br /&gt;destroy_tree(leaf-&gt;right);&lt;br /&gt;free( leaf );&lt;br /&gt;}&lt;br /&gt;}The function destroy_tree goes to the bottom of each part of the tree, that is, searching while there is a non-null node, deletes that leaf, and then it works its way back up. The function deletes the leftmost node, then the right child node from the leftmost node's parent node, then it deletes the parent node, then works its way back to deleting the other child node of the parent of the node it just deleted, and it continues this deletion working its way up to the node of the tree upon which delete_tree was originally called. In the example tree above, the order of deletion of nodes would be 5 8 6 11 18 14 10. Note that it is necessary to delete all the child nodes to avoid wasting memory. The following insert function will create a new tree if necessary; it relies on pointers to pointers in order to handle the case of a non-existent tree (the root pointing to NULL). In particular, by taking a pointer to a pointer, it is possible to allocate memory if the root pointer is NULL. insert(int key, struct node **leaf)&lt;br /&gt;{&lt;br /&gt;if( *leaf == 0 )&lt;br /&gt;{&lt;br /&gt;*leaf = malloc( sizeof( struct node ) );&lt;br /&gt;leaf-&gt;left-&gt;key_value = key;&lt;br /&gt;/* initialize the children to null */&lt;br /&gt;leaf-&gt;left-&gt;left = 0;&lt;br /&gt;leaf-&gt;left-&gt;right = 0;&lt;br /&gt;}&lt;br /&gt;else if(key &lt; (*leaf)-&gt;key_value)&lt;br /&gt;{&lt;br /&gt;insert( key, (*leaf)-&gt;left );&lt;br /&gt;}&lt;br /&gt;else if(key &gt; (*leaf)-&gt;key_value)&lt;br /&gt;{&lt;br /&gt;insert( key, (*leaf)-&gt;left );&lt;br /&gt;}&lt;br /&gt;}The insert function searches, moving down the tree of children nodes, following the prescribed rules, left for a lower value to be inserted and right for a greater value, until it reaches a NULL node--an empty node--which it allocates memory for and initializes with the key value while setting the new node's child node pointers to NULL. After creating the new node, the insert function will no longer call itself. Note, also, that if the element is already in the tree, it will not be added twice. struct node *search(int key, struct node *leaf)&lt;br /&gt;{&lt;br /&gt;if( leaf != 0 )&lt;br /&gt;{&lt;br /&gt;if(key==leaf-&gt;key_value)&lt;br /&gt;{&lt;br /&gt;return leaf;&lt;br /&gt;}&lt;br /&gt;else if(key&lt;leaf-&gt;key_value)&lt;br /&gt;{&lt;br /&gt;return search(key, leaf-&gt;left);&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;return search(key, leaf-&gt;right);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;else return 0;&lt;br /&gt;}The search function shown above recursively moves down the tree until it either reaches a node with a key value equal to the value for which the function is searching or until the function reaches an uninitialized node, meaning that the value being searched for is not stored in the binary tree. It returns a pointer to the node to the previous instance of the function which called it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-2061875719830118141?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/2061875719830118141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=2061875719830118141&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/2061875719830118141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/2061875719830118141'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/binary-trees-part-1.html' title='Binary Trees: Part 1'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-6982164442140546528</id><published>2007-04-29T06:59:00.000-07:00</published><updated>2007-04-29T07:00:39.733-07:00</updated><title type='text'>Debugging Strategies, Tips, and Gotchas</title><content type='html'>Debugging can be tedious and painful if you don't set up your programs to help you debug them. In the spirit of "an apple a day keeps the doctor away", this article suggests approaches to writing code that's more debuggable, how to catch problems before they start, and gives you some time-wasting gotchas to watch out for and gives you some gotchas to watch out for.&lt;br /&gt;Use the Right ToolsIt should go without saying that you should always be using the best tools available; if you're hunting a &lt;a href="http://www.cprogramming.com/debugging/segfaults.html"&gt;segmentation fault&lt;/a&gt;, you want use a &lt;a href="http://www.cprogramming.com/debuggers.html"&gt;debugger&lt;/a&gt;. Anything less than that is unnecessary pain. If you're dealing with bizarre memory issues (or hard-to-diagnose segfaults), use &lt;a href="http://www.cprogramming.com/debugging/valgrind.html"&gt;Valgrind&lt;/a&gt; on Linux or &lt;a href="http://www-306.ibm.com/software/awdtools/purifyplus/"&gt;Purify&lt;/a&gt; for Windows.&lt;br /&gt;Debug the ProblemMy first instinct when debugging is to ask, "is my code too complicated?" Sometimes we'll all come up with a solution to a problem only to realize that the solution is really hard to get working. So hard, in fact, that it might be easier to solve the original problem in another way. When I see someone struggling to debug a complex mass of code, my first thought is to ask whether there's a cleaner solution. Often, once you've written bad code, you have a much better idea of what the good code should look like. Remember that just because you've written it doesn't mean you should keep it! The trick is always to decide if you're trying to solve the original problem or to solve a particular choice of solution. If it's the solution, then it's possible that your problems don't stem from the problem at all--maybe you're over-thinking the problem or trying a wrong-headed approach. For instance, I recently needed to parse a file and import some of the data into an access database to prototype an analysis tool. My first instinct was to write a Ruby script that interfaced directly with Access and inserted all of the data into the database using SQL queries. As I looked at the support for doing this in Ruby, I quickly realized that my "solution" to the problem was going to take a lot longer than the problem should have taken. I reversed course, wrote a script that just output a comma-separated value file, and had my data fully imported in about an hour.&lt;br /&gt;An Aside on Bad CodePeople are often reluctant to throw out bad code that they've written and re-write it. One reason is that code that's written feels like completed work, and throwing it out feels like going backward. But when you're debugging, rewriting the code can seem more appealing because you're probably saving yourself time spent debugging by spending a bit more time coding. The trick is to avoid throwing out the baby with the bath water--remove the bad code, don't start the whole program over again (unless it's rotten to the core). Rewrite only the parts that really need it. Your second draft will probably be both cleaner and less buggy than the first, and you may avoid issues like having to go back later and rewrite the code just so that you can figure out how it was supposed to work. On the other hand, when you're absolutely sure that code that looks horrible is the right code to use, you'll want to explain your rationale in a &lt;a href="http://www.cprogramming.com/tutorial/comments.html"&gt;comment&lt;/a&gt; so someone (or you) doesn't come back later and hack it apart.&lt;br /&gt;Minimize Potential Problems by Avoiding Copy-Paste SyndromeNothing is more frustrating than to realize that you're debugging the same problem multiple times. Whenever you copy and paste large chunks of code, you leave yourself open to the unknown demons inhabiting that code. If you haven't debugged it yet, odds are that you're going to have to. And if you forgot that you copied that code somewhere else, you're probably going to be debugging the same code more than once. (There are other reasons to avoid copy-paste syndrome; even worse than debugging the same code twice is finding the bug in only one piece of copy-pasted code.) The best way to avoid copy-paste syndrome is to use functions to encapsulate as much of your repeat code as possible. Some things can't easily be avoided in C++; you're going to write a lot of for loops no matter what you're doing, so you can't abstract away the whole looping process. But if you have the same loop body in multiple places, that might be a sign that it should be pulled into a separate function. As a bonus, this makes other future changes to your code easier and allows you to reuse the function without having to find a chunk of code to copy.&lt;br /&gt;When to Copy CodeAlthough copying code is usually dangerous, there are times when it may be the best choice. For instance, if you need to make small, irregular tweaks to a chunk of code, but the bulk of it needs to remain the same, then copying, pasting, and careful editing might make sense. By copying the code, you avoid the chance that you introduce new bugs by mistyping the code. It should go without saying that you should have carefully debugged the code you plan to copy before you do so! (But I said it, and I'm not even paid by the word.) The second reason to copy code is when you have long variable names and a bad text editor. The best solution is generally to get a better &lt;a href="http://www.cprogramming.com/texteditors.html"&gt;text editor&lt;/a&gt; with keyword completion.&lt;br /&gt;Make Big Problems Found Late Small Problems Found Early&lt;br /&gt;Testing EarlyOne advantage of pulling out code and putting it into functions is that you can then separately test those functions. This means that you can sometimes avoid debugging big problems caused by simple bugs in the original functions. Nothing is more frustrating than writing perfectly correct code given how you thought a function (or a class) worked, only to find out that it doesn't work that way. This kind of unit testing requires some discipline and a good sense of what can go wrong with your code. Another advantage of early testing--especially if you write some or all of your tests up-front, before the code--is that you'll pay more attention to the specific interface to your class. If you can't test error handling because you're using an assert instead of an exception or error code, that might be an indication that you should be using some form of error reporting rather than asserts. (Of course, this won't always be the case--there are times when you just want to verify that your asserts work correctly.) Beyond error-reporting, writing tests is the first time you can test your code's &lt;a href="http://www.cprogramming.com/tutorial/class_design.html"&gt;interface&lt;/a&gt;, which is often as valuable as testing that the code works. If the interface to your class is clunky, or your functions have impossible-to-understand, let alone remember, argument lists, it might be time to rethink what you're doing before you write the underlying code.&lt;br /&gt;Compiler WarningsMany potential bugs can be caught by your compiler. Some such errors include using uninitialized variables, accidentally replacing a check for equality with an assignment in a conditional, or, in C++, errors related to mixing types such as pointers and ints. Since this has been covered before, I suggest checking out the article &lt;a href="http://www.cprogramming.com/tutorial/compiler_warnings.html"&gt;why you should pay attention to compiler warnings&lt;/a&gt;.&lt;br /&gt;Printf LiesBecause I/O is usually buffered by the operating system, using printfs in your debugging process is risky. When possible, use a debugger to figure out what lines of code are the problem rather than narrowing in on the issue with code littered by printfs and cout. (And beware the stray printf that slips in during debugging and, ahem, slips into the final version.)&lt;br /&gt;Flush OutputNevertheless, there are times when you actually need to keep track of some state in a log file--perhaps you simply have too much data that you need to collect, and you need the data from program start-up to the moment the bug occurs. To ensure you collect all of the data, be sure to flush it: you can use fflush in C, or output an endl in C++. fflush takes the FILE pointer you are writing into; for instance, to flush stderr, you would write fflush( stderr);&lt;br /&gt;Check Your Helper FunctionsThis should be obvious, but it's easy to forget in the heat of the moment: always verify that your helper functions work, especially when seemingly simple code is failing. When possible, isolate each helper function and test it individually, then test each of its helper functions. There's nothing more frustrating than realizing that your original logic was right, but your assumption about a helper function was wrong.&lt;br /&gt;When Cause Doesn't Immediately Lead to EffectEven if a helper function doesn't seem to be the immediate source of a problem, its side effects may cause latent problems. For instance, if you have a helper function that can return NULL and you pass its output into a library function dealing with C-strings, you may see the immediate cause as dereferencing a NULL pointer in strcat, but the real cause was the buggy function you wrote earlier (or the fact that you didn't check for NULL after calling it).&lt;br /&gt;Remember That Code May Be Used in More Than One PlaceAnother problem that can come up when debugging is that you discover the problem appears to be the result of a particular function call, set a break point inside that function, and then discover that there are hundreds of calls to the same function throughout the code. Or worse, you don't notice this until wasting hours of time trying to figure out what's going on or thinking that the reason for the problem is that the function is being called incorrectly. (When, in fact, it's being called correctly but with different arguments than the point at which the bug occurred.) The most obvious solution is to check the call stack after hitting a break point or to set the breakpoint right before the call that is actually the problem. Unfortunately, this doesn't always help if the same call works thousands of times but fails on the 1001st call. Potential solutions include counting the number of calls to a function and then stepping through that many breakpoints set inside the function, or using a &lt;a href="http://www.cprogramming.com/tutorial/statickeyword.html"&gt;static variable as a counter&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-6982164442140546528?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/6982164442140546528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=6982164442140546528&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/6982164442140546528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/6982164442140546528'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/debugging-strategies-tips-and-gotchas_29.html' title='Debugging Strategies, Tips, and Gotchas'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-2150130131110311611</id><published>2007-04-28T09:30:00.000-07:00</published><updated>2007-04-28T09:32:13.396-07:00</updated><title type='text'>Makefiles</title><content type='html'>Makefiles are something of an arcane topic--one joke goes that there is only one makefile in the world and that all other makefiles are merely extensions of it. I assure you, however, that this is not true; I have written my own makefiles from time to time. In this article, I'll explain exactly how you can do it too!&lt;br /&gt;Understanding Make -- BackgroundIf you've used make before, you can safely skip this section, which contains a bit of background on using make. A makefile is simply a way of associating short names, called targets, with a series of commands to execute when the action is requested. For instance, a common makefile target is "clean," which generally performs actions that clean up after the compiler--removing object files and the resulting executable. Make, when invoked from the command line, reads a makefile for its configuration. If not specified by the user, make will default to reading the file "Makefile" in the current directory. Generally, make is either invoked alone, which results in the default target, or with an explicit target. (In all of the below examples, % will be used to indicate the prompt.) To execute the default target: % make&lt;br /&gt;to execute a particular target, such as clean: % make clean&lt;br /&gt;Besides giving you short build commands, make can check the timestamps on files and determine which ones need to be recompiled; we'll look at this in more detail in the section on targets and dependencies. Just be aware that by using make, you can considerably reduce the number of times you recompile.&lt;br /&gt;Elements of a MakefileMost makefiles have at least two basic components: macros and target definitions. Macros are useful in the same way constants are: they allow you to quickly change major facets of your program that appear in multiple places. For instance, you can create a macro to substitute the name of your compiler. Then if you move from using gcc to another compiler, you can quickly change your builds with only a one-line change.&lt;br /&gt;CommentsNote that it's possible to include comments in makefiles: simply preface a comment with a pound sign, #, and the rest of the line will be ignored.&lt;br /&gt;MacrosMacros are written in a simple x=y form. For instance, to set your C compiler to gcc, you might write: CC=gcc&lt;br /&gt;To actually convert a macro into its value in a target, you simply enclose it within $(): for instance, to convert CC into the name of the compiler: $(CC) a_source_file.c&lt;br /&gt;might expand to gcc a_source_file.c&lt;br /&gt;It is possible to specify one macro in terms of another; for instance, you could have a macro for the compiler options, OPT, and the compiler, CC, combined into a compile-command, COMP: COMP = $(CC) $(OPT)&lt;br /&gt;There are some macros that are specified by default; you can list them by typing % make -p&lt;br /&gt;For instance, CC defaults to the cc compiler. Note that any environment variables that you have set will be imported as macros into your makefile (and will override the defaults).&lt;br /&gt;TargetsTargets are the heart of what a makefile does: they convert a command-line input into a series of actions. For instance, the "make clean" command tells make to execute the code that follows the "clean" target. Targets have three components: the name of the target, the dependencies of the target, and finally the actions associated with the target: target: [dependencies]&lt;br /&gt;&lt;command&gt;&lt;br /&gt;&lt;command&gt;&lt;br /&gt;...&lt;br /&gt;Note that each command must be proceeded by a tab (yes, a tab, not four, or eight, spaces). Be sure to prevent your text editor from expanding the tabs! The dependencies associated with a target are either other targets or files themselves. If they're files, then the target commands will only be executed if any of the dependent files have changed since the last time the command was executed. If the dependency is another target, then that target's commands will be evaluated in the same way. A simple command might have no dependencies if you want it to execute all the time. For example, "clean" might look like this: clean:&lt;br /&gt;rm -f *.o core&lt;br /&gt;On the other hand, if you have a command to compile a program, you probably want to make the compilation depend on the source files to compile. This might result in a makefile that looks like this: CC = gcc&lt;br /&gt;FILES = in_one.c in_two.c&lt;br /&gt;OUT_EXE = out_executable&lt;br /&gt;build: $(FILES)&lt;br /&gt;$(CC) -o $(OUT_EXE) $(FILES)&lt;br /&gt;Now when you type "make build" if the dependencies in_one.c and in_two.c are older than the object files created, then make will reply that there is "nothing to be done." Note that this can be problematic if you leave out a dependency! If this were an issue, one option would be to include a target to force a rebuild. This would depend on both the "clean" target and the build target (in that order). The above sample file could be amended to include this: CC = gcc&lt;br /&gt;FILES = in_one.c in_two.c&lt;br /&gt;OUT_EXE = out_executable&lt;br /&gt;build: $(FILES)&lt;br /&gt;$(CC) -o $(OUT_EXE) $(FILES)&lt;br /&gt;clean:&lt;br /&gt;rm -f *.o core&lt;br /&gt;rebuild: clean build&lt;br /&gt;Now when rebuild is the target, make will first execute the commands associated with clean and then those associated with build.&lt;br /&gt;When Targets FailWhen a target is executed, it returns a status based on whether or not it was successful--if a target fails, then make will not execute any targets that depend on it. For instance, in the above example, if "clean" fails, then rebuild will not execute the "build" target. Unfortunately, this might happen if there is no core file to remove. Fortunately, this problem can be solved easily enough by including a minus sign in front of the command whose status should be ignored: clean:&lt;br /&gt;-rm -f *.o core&lt;br /&gt;The Default TargetTyping "make" alone should generally result in some kind of reasonable behavior. When you type "make" without specifying a target in the corresponding makefile, it will simply execute the first target in the makefile. Note that in the above example, the "build" target was placed above the "clean" target--this is more reasonable (and intuitive) behavior than removing the results of a build when the user types "make"!&lt;br /&gt;Reading Someone Else's MakefileI hope that this document is enough to get you started using simple makefiles that help to automate chores or maintain someone else's work. The trick to understanding makefiles is simply to understand all of your compiler's flags--much (though not all) of the crypticness associated with makefiles is simply that they use macros that strip some of the context from an otherwise comprehensible compiler command. Your compiler's documentation can help enormously here. The second thing to remember is that when you invoke make, it will expand all of the macros for you--just by running make, it's very easy to see exactly what it will be doing. This can be tremendously helpful in figuring out a cryptic command.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-2150130131110311611?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/2150130131110311611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=2150130131110311611&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/2150130131110311611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/2150130131110311611'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/makefiles.html' title='Makefiles'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-8522826713088056388</id><published>2007-04-26T10:31:00.000-07:00</published><updated>2007-04-26T10:32:10.812-07:00</updated><title type='text'>21 Ways To Promote Your Website - Part Three   by Neil Stafford</title><content type='html'>In this last installment of the series, we'll take a look at the remaining seven ways you can promote your website.&lt;br /&gt;Please note that the 21 ways we've looked at are by no means exhaustive and should be used to help you decide which way(s) you prefer and are comfortable using.&lt;br /&gt;With that thought, let's move on to the final seven.&lt;br /&gt;15) Reciprocal Links&lt;br /&gt;This involves the swapping of links with other websites usually within your niche market; however, I've seen many reciprocal links on sites that aren't related.&lt;br /&gt;Reciprocal link exchanges were originally used to build up your link popularity rating with the search engines, although over the last few years this has become less effective as Search Engine technology advances.&lt;br /&gt;However, don't discount reciprocal links just yet.&lt;br /&gt;On several of our sites, we still seek out high ranking and high traffic websites where we can both benefit from a reciprocal link exchange.&lt;br /&gt;In this case, I'm not doing it for the benefit of search engine ranking but for the pure reason of traffic generation.&lt;br /&gt;A link in a prominent place on a high traffic site will, by its very nature, generate traffic for you. And if you have your site set up correctly you should be able to capture the visitors name and email address.&lt;br /&gt;16) Search Engine Listings or SEO&lt;br /&gt;Let's get one thing straight - I am not a search engine expert by any stretch of the imagination. In fact I heard the best definition of SEO earlier last year when it was called...&lt;br /&gt;"Search Engine Optimist"&lt;br /&gt;However, I do understand the principles and do put in place strategies to take advantage of the natural search listings.&lt;br /&gt;The easiest way is to add content to your website and link this from an index page or site map on your website.&lt;br /&gt;I run many websites that are single sales letter types sites and many of them have a page rank of 3, 4 or 5.&lt;br /&gt;However, behind these pages are several dozen content pages that are linked via an index page. By checking my site statistics I can see which pages are driving traffic and in many cases new sales.&lt;br /&gt;When setting up a new sales letter site, I'll use PPC traffic to gauge how well it will perform and for the ones that do really well I'll spend the time adding content pages to sit behind the main site.&lt;br /&gt;17) Classified Adverts&lt;br /&gt;I'm not talking about classified adverts online but simple adverts in your niche market's magazines and publications.&lt;br /&gt;This simple strategy has made us thousands in various niche markets and has even had the magazine editorial team contact us to see if we would like to contribute to the magazine itself.&lt;br /&gt;In specialist magazines you can often place a classified ad for only a few pounds or dollars and know that it will be reaching your target audience.&lt;br /&gt;The idea of these adverts is not to sell your product off the page but to drive the readers to your website and preferably a name capture page.&lt;br /&gt;To do this, your advert must contain a benefit to the reader to put down the magazine, go online and type in your web address.&lt;br /&gt;18) Your Own Business Stationary&lt;br /&gt;If you operate in many different niche markets and are only selling digital products then this may not be ideal for you, however, if you have a small number of markets then at a minimum I'd have business cards printed with your web address on them.&lt;br /&gt;In our main niche markets, we have business cards that have an offer and call to action on the back to encourage people to visit our sites.&lt;br /&gt;We also have letterheads, and if we send out a physical product, we enclose an insert with the branding and an offer or another call to action for the customer to take.&lt;br /&gt;19) Email Campaigns&lt;br /&gt;If people are already on your email list this shouldn't be the end of your traffic driving process. By making sub lists of your main list you can then send targeted messages to drive your customer and prospects to new sales pages and offers.&lt;br /&gt;20) Forums&lt;br /&gt;You may already know my view of forums within the Internet Marketing arena.&lt;br /&gt;However, forums in niche markets are still an ideal way to drive traffic to your website. However, PLEASE don't go and blatantly promote your site on the forums...there are rules to follow.&lt;br /&gt;First of all, find the forums in your niche and spend a bit of time 'lurking' reading the posts and watching how they are answered.&lt;br /&gt;After a short time, you'll get the feel of the board and if they allow any promotion of websites or if you can use a signature file at the bottom of your post.&lt;br /&gt;Once you understand the rules start answering some of the questions on the board, and leave your URL and/or signature. file at the end.&lt;br /&gt;My own view with non marketing forums is not to try and answer all the questions; answer only a few and answer them completely with very good advice or suggestions.&lt;br /&gt;This will get you noticed more and build up credibility with the other people on the board.&lt;br /&gt;21) Conference Calls&lt;br /&gt;Conference calls are an ideal way to build up an email list quickly and are an excellent relationship-building tool as well.&lt;br /&gt;You can either have a free to join call or have attendees pay a fee to join you. Either way I'd approach other 'players' within your market and ask them would they promote your call for you. With a paid call you can offer an affiliate deal.&lt;br /&gt;The call should be on a specific topic and during the call you can make reference to several pages on your site or make a specific sales offer for attendees.&lt;br /&gt;With a free call you can make the MP3 recording available afterwards encouraging your attendees to tell others about it. This will create a viral effect as the call gets passed around and in turn drive traffic back to your website.&lt;br /&gt;I have an mp3 that I recorded more than 3 years ago that still drives traffic to one of my sites each and every week!&lt;br /&gt;Summary&lt;br /&gt;So there you have it, the conclusion of '21 Ways To Promote Your Website'. Which ones will you implement into your business?&lt;br /&gt;Running a successful web business is simple, but not easy. If it was easy everyone would be doing it.&lt;br /&gt;However, it is simple...&lt;br /&gt;What could be simpler than having a product that people are actively looking for and letting them know where they can get it from?&lt;br /&gt;About the Author&lt;br /&gt;Neil Stafford is Editor and Publisher of the Internet Marketing Review the UK's longest running PRINTED Internet Marketing Newsletter. 'Test drive' the Newsletter for FREE - Visit this special web page for more information: &lt;a href="http://www.internetmarketingreview.com/sya"&gt;http://www.InternetMarketingReview.com/sya&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-8522826713088056388?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/8522826713088056388/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=8522826713088056388&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/8522826713088056388'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/8522826713088056388'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/21-ways-to-promote-your-website-part.html' title='21 Ways To Promote Your Website - Part Three   by Neil Stafford'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-1465110665175048931</id><published>2007-04-25T10:51:00.000-07:00</published><updated>2007-04-25T10:52:38.867-07:00</updated><title type='text'>Advanced Makefile Tricks</title><content type='html'>Special MacrosThere are some special macros that you can use when you want fine-grained control over behavior. These are macros whose values are set based on specifics of the target and its dependencies. All special macros begin with a dolllar sign and do not need to be surrounded by parentheses:&lt;br /&gt;$@$@ is the name of the target. This allows you to easily write a generic action that can be used for multiple different targets that produce different output files. For example, the following two targets produce output files named client and server respectively. client: client.c&lt;br /&gt;$(CC) client.c -o $@&lt;br /&gt;server: server.c&lt;br /&gt;$(CC) server.c -o $@&lt;br /&gt;$?The $? macro stores the list of dependents more recent than the target (i.e., those that have changed since the last time make was invoked for the given target). We can use this to make the build commands from the above example even more general: client: client.c&lt;br /&gt;$(CC) $? -o $@&lt;br /&gt;server: server.c&lt;br /&gt;$(CC) $? -o $@&lt;br /&gt;$^$^ gives you all dependencies, regardless of whether they are more recent than the target. Duplicate names, however, will be removed. This might be useful if you produce transient output (such as displaying a result to the screen rather than saving it a a file). # print the source to the screen&lt;br /&gt;viewsource: client.c server.c&lt;br /&gt;less $^&lt;br /&gt;$+$+ is like $^, but it keeps duplicates and gives you the entire list of dependencies in the order they appear. # print the source to the screen&lt;br /&gt;viewsource: client.c server.c&lt;br /&gt;less $+&lt;br /&gt;$&gt;If you only need the first dependency, then $&gt; is for you. Using $&gt; can be safer than relying on $^ when you have only a single dependency that needs to appear in the commands executed by the target. If you start by using $^ when you have a single dependency, if you then add a second, it may be problematic, whereas if you had used $&gt; from the beginning, it will continue to work. (Of course, you may want to have all dependencies should up. Consider your needs carefully.)&lt;br /&gt;Wildcard Matching in TargetsThe percent sign, %, can be used to perform wildcard matching to write more general targets; when a % appears in the dependencies list, it replaces the same string of text throughout the command in makefile target. If you wish to use the matched text in the target itself, use the special variable $*. For instance, the following example will let you type make &lt;name&gt; to build an executable file with the given name: %.c:&lt;br /&gt;gcc -o $* $*.c&lt;br /&gt;For this particular type of example, there is actually an even simpler way of writing this target using implicit targets--read on!&lt;br /&gt;Implicit TargetsThere are some actions that are nearly ubiqutious: for instance, you might have a collection of .c files that you may wish to execute the same command for. Ideally, the name of the file would be the target; using the implicit target ".c" you can specify a command to execute for any target that corresponds to the name of a .c file (minus the .c extension). .c:&lt;br /&gt;$(CC) -o $@ $@.c&lt;br /&gt;This rule says that for any target that corresponds to a .c file, make should compile it using the name of the implicit target as the output, and the name plus the .c extension as the file to compile. For example, % make test_executable&lt;br /&gt;would run gcc -o test_executable test_executable.c&lt;br /&gt;if test_executable did not have an explicit target associated with it.&lt;br /&gt;Macro ModificationSince the point of using macros is to eliminate redundant text, it should come as no surprise that it is possible to transform macros from one type into another using various macro modifications.&lt;br /&gt;Replacing TextIt is possible to create a new macro based on replacing part of an old macro. For instance, given a list of source files, called SRC, you might wish to generate the corresponding object files, stored in a macro called OBJ. To do so, you can specify that OBJ is equivalent to SRC, except with the .c extension replaced with a .o extension: OBJ = $(SRC:.c=.o)&lt;br /&gt;Note that this is effectively saying that in the macro SRC, .c should be replaced with .o.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-1465110665175048931?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/1465110665175048931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=1465110665175048931&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/1465110665175048931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/1465110665175048931'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/advanced-makefile-tricks.html' title='Advanced Makefile Tricks'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-1494594268599939881</id><published>2007-04-25T06:24:00.000-07:00</published><updated>2007-04-25T06:27:26.725-07:00</updated><title type='text'>What is spyware?</title><content type='html'>&lt;div align="left"&gt;&lt;a href="http://3.bp.blogspot.com/_W2DVHM5FSi0/Ri9XGFtJZ4I/AAAAAAAAAb8/xvk_S6G_he8/s1600-h/71892_145x90_spywarewhat_F.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5057356668682725250" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_W2DVHM5FSi0/Ri9XGFtJZ4I/AAAAAAAAAb8/xvk_S6G_he8/s320/71892_145x90_spywarewhat_F.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="left"&gt;Spyware is a general term used to describe software that performs certain behaviors such as advertising, collecting personal information, or changing the configuration of your computer, generally without appropriately obtaining your consent first.&lt;br /&gt;Spyware is often associated with software that displays advertisements (called adware) or software that tracks personal or sensitive information.&lt;br /&gt;That does not mean all software that provides ads or tracks your online activities is bad. For example, you might sign up for a free music service, but you "pay" for the service by agreeing to receive targeted ads. If you understand the terms and agree to them, you may have decided that it is a fair tradeoff. You might also agree to let the company track your online activities to determine which ads to show you.&lt;br /&gt;Other kinds of spyware make changes to your computer that can be annoying and can cause your computer slow down or crash.&lt;br /&gt;These programs can change your Web browser's home page or search page, or add additional components to your browser you don't need or want. These programs also make it very difficult for you to change your settings back to the way you originally had them.&lt;br /&gt;The key in all cases is whether or not you (or someone who uses your computer) understand what the software will do and have agreed to install the software on your computer.&lt;br /&gt;There are a number of ways spyware or other unwanted software can get on your computer. A common trick is to covertly install the software during the installation of other software you want such as a music or video file sharing program.&lt;br /&gt;Whenever you install something on your computer, make sure you carefully read all disclosures, including the license agreement and privacy statement. Sometimes the inclusion of unwanted software in a given software installation is documented, but it might appear at the end of a license agreement or privacy statement. &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-1494594268599939881?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/1494594268599939881/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=1494594268599939881&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/1494594268599939881'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/1494594268599939881'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/what-is-spyware.html' title='What is spyware?'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_W2DVHM5FSi0/Ri9XGFtJZ4I/AAAAAAAAAb8/xvk_S6G_he8/s72-c/71892_145x90_spywarewhat_F.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-6217065773173623802</id><published>2007-04-24T20:17:00.000-07:00</published><updated>2007-04-24T20:20:50.198-07:00</updated><title type='text'>Determining the Size of a Class Object</title><content type='html'>By Girish ShettyThere are many factors that decide the size of an object of a class in C++. These factors are:&lt;br /&gt;-Size of all non-static data members&lt;br /&gt;-Order of data members&lt;br /&gt;-Byte alignment or byte padding&lt;br /&gt;-Size of its immediate base class&lt;br /&gt;-The existence of virtual function(s) (Dynamic polymorphism using virtual functions).&lt;br /&gt;Compiler being used&lt;br /&gt;-Mode of inheritance (virtual inheritance)&lt;br /&gt;Size of all non-static data membersOnly non-static data members will be counted for calculating sizeof class/object. class A {&lt;br /&gt;private:&lt;br /&gt;float iMem1;&lt;br /&gt;const int iMem2;&lt;br /&gt;static int iMem3;&lt;br /&gt;char iMem4;&lt;br /&gt;};&lt;br /&gt;For an object of class A, the size will be the size of float iMem1 + size of int iMem2 + size of char iMem3. Static members are really not part of the class object. They won't be included in object's layout. &lt;2&gt;Order of data members&lt;br /&gt;The order in which one specifies data members also alters the size of the class. class C {&lt;br /&gt;char c;&lt;br /&gt;int int1;&lt;br /&gt;int int2;&lt;br /&gt;int i;&lt;br /&gt;long l;&lt;br /&gt;short s;&lt;br /&gt;};&lt;br /&gt;The size of this class is 24 bytes. Even though char c will consume only 1 byte, 4 bytes will be allocated for it, and the remaining 3 bytes will be wasted (holes). This is because the next member is an int, which takes 4 bytes. If we don't go to the next (4th) byte for storing this integer member, the memory access/modify cycle for this integer will be 2 read cycles. So the compiler will do this for us, unless we specify some byte padding/packing. If I re-write the above class in different order, keeping all my data members like below: class C {&lt;br /&gt;int int1;&lt;br /&gt;int int2;&lt;br /&gt;int i;&lt;br /&gt;long l;&lt;br /&gt;short s;&lt;br /&gt;char c;&lt;br /&gt;};&lt;br /&gt;Now the size of this class is 20 bytes. In this case, it is storing c, the char, in one of the slots in the hole in the extra four bytes.&lt;br /&gt;Byte alignment or byte paddingAs mentioned above, if we specify 1 byte alignment, the size of the class above (class C) will be 19 in both cases.&lt;br /&gt;Size of its immediate base classThe size of a class also includes size of its immediate base class. Lets take an example: Class B {&lt;br /&gt;...&lt;br /&gt;int iMem1;&lt;br /&gt;int iMem2;&lt;br /&gt;}&lt;br /&gt;Class D: public B {&lt;br /&gt;...&lt;br /&gt;int iMem;&lt;br /&gt;}&lt;br /&gt;In this case, sizeof(D) is will also include the size of B. So it will be 12 bytes.&lt;br /&gt;The existence of virtual function(s)Existence of virtual function(s) will add 4 bytes of virtual table pointer in the class, which will be added to size of class. Again, in this case, if the base class of the class already has virtual function(s) either directly or through its base class, then this additional virtual function won't add anything to the size of the class. Virtual table pointer will be common across the class hierarchy. That is class Base {&lt;br /&gt;public:&lt;br /&gt;...&lt;br /&gt;virtual void SomeFunction(...);&lt;br /&gt;private:&lt;br /&gt;int iAMem&lt;br /&gt;};&lt;br /&gt;class Derived : public Base {&lt;br /&gt;...&lt;br /&gt;virtual void SomeOtherFunction(...);&lt;br /&gt;private:&lt;br /&gt;int iBMem&lt;br /&gt;};&lt;br /&gt;In the example above, sizeof(Base) will be 8 bytes--that is sizeof(int iAMem) + sizeof(vptr). sizeof(Derived) will be 12 bytes, that is sizeof(int iBMem) + sizeof(Derived). Notice that the existence of virtual functions in class Derived won't add anything more. Now Derived will set the vptr to its own virtual function table.&lt;br /&gt;Compiler being usedIn some scenarios, the size of a class object can be compiler specific. Lets take one example: class BaseClass {&lt;br /&gt;int a;&lt;br /&gt;char c;&lt;br /&gt;};&lt;br /&gt;class DerivedClass : public BaseClass {&lt;br /&gt;char d;&lt;br /&gt;int i;&lt;br /&gt;};&lt;br /&gt;If compiled with the Microsoft C++ compiler, the size of DerivedClass is 16 bytes. If compiled with gcc (either c++ or g++), size of DerivedClass is 12 bytes. The reason for sizeof(DerivedClass) being 16 bytes in MC++ is that it starts each class with a 4 byte aligned address so that accessing the member of that class will be easy (again, the memory read/write cycle).&lt;br /&gt;Mode of inheritance (virtual inheritance)In C++, sometimes we have to use virtual inheritance for some reasons. (One classic example is the implementation of final class in C++.) When we use virtual inheritance, there will be the overhead of 4 bytes for a virtual base class pointer in that class. class ABase{&lt;br /&gt;int iMem;&lt;br /&gt;};&lt;br /&gt;class BBase : public virtual ABase {&lt;br /&gt;int iMem;&lt;br /&gt;};&lt;br /&gt;class CBase : public virtual ABase {&lt;br /&gt;int iMem;&lt;br /&gt;};&lt;br /&gt;class ABCDerived : public BBase, public CBase {&lt;br /&gt;int iMem;&lt;br /&gt;};&lt;br /&gt;And if you check the size of these classes, it will be:&lt;br /&gt;Size of ABase : 4&lt;br /&gt;Size of BBase : 12&lt;br /&gt;Size of CBase : 12&lt;br /&gt;Size of ABCDerived : 24 Because BBase and CBase are dervied from ABase virtually, they will also have an virtual base pointer. So, 4 bytes will be added to the size of the class (BBase and CBase). That is sizeof ABase + size of int + sizeof Virtual Base pointer. Size of ABCDerived will be 24 (not 28 = sizeof (BBase + CBase + int member)) because it will maintain only one Virtual Base pointer (Same way of maintaining virtual table pointer).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-6217065773173623802?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/6217065773173623802/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=6217065773173623802&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/6217065773173623802'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/6217065773173623802'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/determining-size-of-class-object.html' title='Determining the Size of a Class Object'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-1892888520337588793</id><published>2007-04-23T20:10:00.000-07:00</published><updated>2007-04-23T20:11:23.905-07:00</updated><title type='text'>Programming Style, Naming Conventions</title><content type='html'>Good naming can make a huge difference in program readability. Names like proc1, proc2, and proc3 mean next-to-nothing, but even apparently decent names can be ambiguous. For instance, to name a function that takes two ranges and computes the amount of the first that lies within the second, names like computeRangeWithinRange might sound reasonable. Unfortunately, this name gives no information about the order of arguments to the function. Sometimes this won't be a problem because an intelligent IDE should help you determine the names of the arguments to the function, but it can be confusing when the code is printed, or when you try to quickly read through the code. A better name might be computeRangeWithinFirstRange, which at least gives a sense of the order of the arguments to the function.&lt;br /&gt;General Naming ConventionsIt's usually best to choose a consistent set of naming convnetions for use throughout your code. Naming conventions usually govern things such as how you capitalize your variables, classes, and functions, whether you include a prefix for pointers, static data, or global data, and how you indicate that something is a private field of a class. There are a lot of common naming conventions for classes, functions and objects. Usually these are broken into several broad categories: c-style naming, camelCase, and CamelCase. C-style naming separates words in a name using underscores: this_is_an_identifer. There are two forms of camelCase: one that begins with a lowercase letter and then capitalizes the first letter of every ensuing word, and one that capitalizes the first letter of every single word. One popular convention is that leading capital letter CamelCase is used for the names of structs and classes, while normal camelCase is used for the names of functions and variables (although sometimes variables are written in c-style to make the visual separation between functions and variables more clear). It can be useful to use prefixes for certain types of data to remind you what they are: for instance, if you have a pointer, prefixing it with "p_" tells you that it's a pointer. If you see an assignment between a variable starting with "p_" and one that doesn't begin with "p_", then you immediately know that something fishy is going on. It can also be useful to use a prefix for global or static variables because each of these has a different behavior than a normal local variable. In the case of global variables, it is especially useful to use a prefix in order to prevent naming collisions with local variables (which can lead to confusion). Finally, a common convention is to prefix the private fields and methods of a class with an underscore: e.g., _private_data. This can make it easier to find out where to look in the body of a class for the declaration of a method, and it also helps keep straight what you should and should not do with a variable. For instance, a common rule is to avoid returning &lt;a href="http://www.cprogramming.com/tutorial/const_correctness.html"&gt;non-const&lt;/a&gt; references to fields of a class from functions that are more public than the field. For instance, if _age is a private field, then the public getAge function probably shouldn't return a non-const reference since doing so effectively grants write access to the field!&lt;br /&gt;Hungarian NotationHungarian notation has commonly been associated with prefixing variables with information about their type--for instance, whether a variable is an integer or a double. This is usually not a useful thing to do because your IDE will tell you the type of a variable, and it can lead to bizarre and complicated looking names. The original idea behind Hungarian notation, however, was more general and useful: to create more abstract "types" that describe how the variable is used rather than how the variable is represented. This can be useful for keeping pointers and integers from intermixing, but it can also be a powerful technique for helping to separate concepts that are often used together, but that should not be mixed.&lt;br /&gt;AbbrevationsAbbreviations are dangerous--vowels are useful and can speed up code reading. Resorting to abbreviations can be useful when the name itself is extremely long because names that are too long can be as hard to read as names that are too short. When possible, be consistent about using particular abbreviations, and restrict yourself to using only a small number of them. Common abbreviations include "itr" for "iterator" or "ptr" for pointer. Even names like i, j, and k are perfectly fine for loop counter variables (primarily because they are so common). Bad abbreviations include things like cmptRngFrmRng, which at the savings of only a few letters eliminates a great deal of readability. If you don't like typing long names, look into the auto-complete facilities of your text editor. You should rarely need to type out a full identifier. (In fact, you rarely want to do this: typos can be incredibly hard to spot.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-1892888520337588793?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/1892888520337588793/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=1892888520337588793&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/1892888520337588793'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/1892888520337588793'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/programming-style-naming-conventions.html' title='Programming Style, Naming Conventions'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-7647005062507670562</id><published>2007-04-22T20:10:00.000-07:00</published><updated>2007-04-22T20:12:03.320-07:00</updated><title type='text'>Writing for Readability</title><content type='html'>There are a lot of ways to solve the same problem in C or C++। This is both good and bad; it is good because you have flexibility. It's also bad because you have flexibility--the flexibility to choose different solutions to the same problem when it shows up in different places. This is confusing because it obscures the underlying similarity between the problems.&lt;br /&gt;Using FunctionsUnlike prose, where repeating the same word or phrase may seem redundant, in programming, it's perfectly fine to use the same construction over and over again. Of course, you may want to turn a repeated chunk of code into a function: this is even more readable because it gives the block of code a descriptive name. (At least you ought to make it descriptive!) You can also increase readability by using standard functions and data structures (such as the &lt;a href="http://www.cprogramming.com/tutorial/stl/stlintro.html"&gt;STL&lt;/a&gt;). Doing so avoids the confusion of someone who might ask, "why did you create a new function when you had a perfectly good one already available?" The problem is that people may assume that there's a reason for the new function and that it somehow differs from the standard version. Moreover, by using standard functions you help your reader understand the names of the arguments to the function. There's much less need to look at the function prototype to see what the arguments mean, or their order, or whether some arguments have default values.&lt;br /&gt;Use Appropriate Language FeaturesThere are some obvious things to avoid: don't use a loop as though it were an if statement. Choose the right data type for your data: if you never need decimal places in a number, use an integer. If you mean for a value to be unsigned, used an unsigned number. When you want to indicate that a value should never change, use &lt;a href="http://www.cprogramming.com/tutorial/const_correctness.html"&gt;const&lt;/a&gt; to make it so. Try to avoid uncommon constructions unless you have good reason to use them; put another way, don't use a feature just because the feature exists. One rule of thumb is to avoid do-while loops unless you absolutely need one. People aren't generally as used to seeing them and, in theory, won't process them as well. I've never run into this problem myself, but think carefully about whether you actually need a do-while loop. Similarly, although the ternary operator is a great way of expressing some ideas, it can also be confusing for programmers who don't use it very often. A good rule of thumb is to use it only when necessary (for instance, in the initialization list of a constructor) and stick with the more standard if-else construction for everything else. Sure, it'll make your program four lines longer, but it'll make it that much easier for most people to read. There are some less obvious ways of using standard features. When you are looping, choose carefully between while, do-while, and for. For loops are best when you can fill in each part (initialization, conditional, and increment) with a fairly short expression. While loops are good for watching a sentinel variable whose value can be set in multiple places or whose value depends on some external event such as a network event. While loops are also better when the update step isn't really a direct "update" to the control variable--for instance, when reading lines from a text file, it might more sense to use a while loop than a for loop because the control depends on the result of the method call, not the value of the variable of interest: while (fgets(buf, sizeof(buf), fp) != NULL)&lt;br /&gt;{&lt;br /&gt;/* do stuff with buf */&lt;br /&gt;}&lt;br /&gt;It wouldn't make sense to write this sort of thing as a for loop. (Try it!)&lt;br /&gt;Unpack Complex ExpressionsThere's no reason to put everything on a single line. If you have a complex calculation with multiple steps and levels of parentheses, it can be extremely helpful to go from a one-line calculation to one that uses temporary variables. This gives you two advantages; first, it makes it easier to follow the expression. Second, you can give a distinct name to each intermediate step, which can help the reader follow what is happening. Often, you'll want to reuse those intermediate calcuations anyway. In addition to mathematical calculations, this principle also applies to nested function calls. The fewer events that take place on a single line of code, the easier it is to follow exactly what's happening. Another advantage to unpacking an expression is that you can put more &lt;a href="http://www.cprogramming.com/tutorial/comments.html"&gt;comments&lt;/a&gt; in-line to explain what's going on and why.&lt;br /&gt;Avoid Magic NumbersMagic numbers are numbers that appear directly in the code without an obvious reason. For instance, what does the number 80 in the following expression mean? for( int i = 0; i &lt; 80; ++i )&lt;br /&gt;{&lt;br /&gt;printf( "-" );&lt;br /&gt;}&lt;br /&gt;It might be the width of the screen, but it might also be the width of a map whose wall is being drawn. You just don't know. The best solution is to use &lt;a href="http://www.cprogramming.com/tutorial/cpreprocessor.html"&gt;macros&lt;/a&gt;, in C, or &lt;a href="http://www.cprogramming.com/tutorial/const_correctness.html"&gt;constants&lt;/a&gt; in C++. This gives you the chance to descriptively name your numbers. Doing so also makes it easier to spot the use of a particular number and differentiate between numbers with the same value that mean different things. Moreover, if you decide you need to change a value, you have a single point where you can make the change, rather than having to sift through your code.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-7647005062507670562?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/7647005062507670562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=7647005062507670562&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/7647005062507670562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/7647005062507670562'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/writing-for-readability.html' title='Writing for Readability'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-523550927740777350</id><published>2007-04-21T19:10:00.000-07:00</published><updated>2007-04-21T19:16:26.316-07:00</updated><title type='text'>Unicode: What You Can Do About It Today</title><content type='html'>by Jeff BezansonIf you write an email in Russian and send it to somebody in Russia, it is depressingly unlikely that he or she will be able to read it. If you write software, the burden of this sad state of affairs rests on your shoulders.&lt;br /&gt;Given modern hardware resources, it is unacceptable that we can't yet routinely communicate text in different scripts or containing technical symbols. Fortunately, we are getting there.&lt;br /&gt;After reading a lot on the subject and incorporating Unicode compatibility into some of my software, I decided to prepare this quick and highly pragmatic guide to digital text in the 21st century (for C programmers, of course). I don't mind adding my voice to the numerous articles that already exist on this subject, since the world needs as many programmers as possible to pick up these skills as soon as possible.&lt;br /&gt;I. Encoding textGiven the variety of human languages on this planet, text is a complex subject. Many are scared away from dealing with world scripts, because they think of the numerous related software problems in the area instead of focusing on what they can actually do with their code to help.&lt;br /&gt;The first thing to know is that you do not have to worry about most problems with digital text. The most difficult work is handled below the application layer, in OSes, UI libraries, and the C library. To give you an idea of what goes on though, here is a summary of software problems surrounding text:&lt;br /&gt;EncodingMapping characters to numbers. Many such mappings exist; once you know the encoding of a piece of text, you know what character is meant by a particular number. Unicode is one such mapping, and a popular one since it incorporates more characters than any other at this time.&lt;br /&gt;DisplayOnce you know what character is meant, you have to find a font that has the character and render it. This task is much complicated by the need to display both left-to-right and right-to-left text, the existence of combining characters that modify previous characters and have zero width, the fact that some languages require wider character cells than others, and context-sensitive letterforms.&lt;br /&gt;InputAn input method is a way to map keystrokes (most likely several keystrokes on a typical keyboard) to characters. Input is also complicated by bidirectional text.&lt;br /&gt;Internationalization (i18n)This refers to the practice of translating a program into multiple languages, effectively by translating all of the program's strings.&lt;br /&gt;LexicographyCode that processes text as more than just binary data might have to become a lot smarter. The problems of searching, sorting, and modifying letter case (upper/lower) vary per-language. If your application doesn't need to perform such tasks, consider yourself lucky. If you do need these operations, you can probably find a UI toolkit or i18n library that already implements them. If you are savvy with just the first issue (encoding), then OS-vendor-supplied input methods and display routines should magically work with your program. Whether you want to or are able to translate your software is another matter, and compared to proper handling of character encodings it is almost optional (corrupting data is worse than having an unintelligible UI).&lt;br /&gt;The encoding I'll talk about is called Unicode. Unicode officially encodes 1,114,112 characters, from 0x000000 to 0x10FFFF. (The idea that Unicode is a 16-bit encoding is completely wrong.) For maximum compatibility, individual Unicode values are usually passed around as 32-bit integers (4 bytes per character), even though this is more than necessary. For convenience, the first 128 Unicode characters are the same as those in the familiar ASCII encoding.&lt;br /&gt;The consensus is that storing four bytes per character is wasteful, so a variety of representations have sprung up for Unicode characters. The most interesting one for C programmers is called UTF-8. UTF-8 is a "multi-byte" encoding scheme, meaning that it requires a variable number of bytes to represent a single Unicode value. Given a so-called "UTF-8 sequence", you can convert it to a Unicode value that refers to a character.&lt;br /&gt;UTF-8 has the property that all existing 7-bit ASCII strings are still valid. UTF-8 only affects the meaning of bytes greater than 127, which it uses to represent higher Unicode characters. A character might require 1, 2, 3, or 4 bytes of storage depending on its value; more bytes are needed as values get larger. To store the full range of possible 32-bit characters, UTF-8 would require a whopping 6 bytes. But again, Unicode only defines characters up to 0x10FFFF, so this should never happen in practice.&lt;br /&gt;UTF-8 is a specific scheme for mapping a sequence of 1-4 bytes to a number from 0x000000 to 0x10FFFF: 00000000 -- 0000007F: 0xxxxxxx&lt;br /&gt;00000080 -- 000007FF: 110xxxxx 10xxxxxx&lt;br /&gt;00000800 -- 0000FFFF: 1110xxxx 10xxxxxx 10xxxxxx&lt;br /&gt;00010000 -- 001FFFFF: 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx&lt;br /&gt;The x's are bits to be extracted from the sequence and glued together to form the final number.&lt;br /&gt;It is fair to say that UTF-8 is taking over the world. It is already used for filenames in Linux and is supported by all mainstream web browsers. This is not surprising considering its many nice properties:&lt;br /&gt;It can represent all 1,114,112 Unicode characters.&lt;br /&gt;Most C code that deals with strings on a byte-by-byte basis still works, since UTF-8 is fully compatible with 7-bit ASCII.&lt;br /&gt;Characters usually require fewer than four bytes.&lt;br /&gt;String sort order is preserved. In other words, sorting UTF-8 strings per-byte yields the same order as sorting them per-character by logical Unicode value.&lt;br /&gt;A missing or corrupt byte in transmission can only affect a single character—you can always find the start of the sequence for the next character just by scanning a couple bytes.&lt;br /&gt;There are no byte-order/endianness issues, since UTF-8 data is a byte stream. The only price to pay for all this is that there is no longer a one-to-one correspondence between bytes and characters in a string. Finding the nth character of a string requires iterating over the string from the beginning.&lt;br /&gt;See &lt;a href="http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8"&gt;What is UTF-8?&lt;/a&gt; for more information about UTF-8.&lt;br /&gt;Side note: Some consider UTF-8 to be discriminatory, since it allows English text to be stored efficiently at one byte per character while other world scripts require two bytes or more. This is a troublesome point, but it should not get in the way of Unicode adoption. First of all, UTF-8 was not really designed to preferentially encode English text. It was designed to preserve compatibility with the large body of existing code that scans for special characters such as line breaks, spaces, NUL terminators, and so on. Furthermore, the encoding used internally by a program has little impact on the user as long as it is able to represent their data without loss. UTF-8 is a great boon, especially for C programming. Think of it this way: if it allows you to internationalize an application that would have been difficult to convert otherwise, it is much less discriminatory than the alternative.&lt;br /&gt;II. The C libraryAll recent implementations of the standard C library have lots of functions for manipulating international strings. Before reading up on them, it helps to know some vocabulary:&lt;br /&gt;"Multibyte character" or "multibyte string" refers to text in one of the many (possibly language-specific) encodings that exist throughout the world. A multibyte character does not necessarily require more than one byte to store; the term is merely intended to be broad enough to encompass encodings where this is the case. UTF-8 is in fact only one such encoding; the actual encoding of user input is determined by the user's current locale setting (selected as an option in a system dialog or stored as an environment variable in UNIX). Strings you get from the user will be in this encoding, and strings you pass to printf() are supposed to be as well. Strings within your program can of course be in any encoding you want, but you might have to convert them for proper display.&lt;br /&gt;"Wide character" or "wide character string" refers to text where each character is the same size (usually a 32-bit integer) and simply represents a Unicode character value ("code point"). This format is a known common currency that allows you to get at character values if you want to. The wprintf() family is able to work with wide character format strings, and the "%ls" format specifier for normal printf() will print wide character strings (converting them to the correct locale-specific multibyte encoding on the way out).&lt;br /&gt;The C library also provides functions like towupper() that can convert a wide character from any language to uppercase (if applicable). strftime() can format a date and time string appropriately for the current locale, and strcoll() can do international sorting. These and other functions that depend on locale must be initialized at the beginning of your program using #include &lt;locale.h&gt;&lt;br /&gt;main()&lt;br /&gt;{&lt;br /&gt;char *locale;&lt;br /&gt;locale = setlocale(LC_ALL, "");&lt;br /&gt;...&lt;br /&gt;}&lt;br /&gt;You don't have to do anything with the locale string returned by setlocale(), but you can use it to query your user's locale settings (more on this later).&lt;br /&gt;The C library pretty much assumes you will be using multibyte strings throughout your program (since that's what you get as input). Since multibyte strings are opaque, a lot of functions beginning with "mb" are provided to deal with them. Personally, I don't like not knowing what encoding my strings use. One concrete problem with the multibyte thing is file I/O— a given file could be in any encoding, independent of locale. When you write a file or send data over a network, keeping the multibyte encoding might be a bad idea. (Even if all software uses only the proper locale-independent C library functions, and all platforms support all encodings internally, there is still no single standard for communicating the encoding of a piece of text; email messages and HTML tags do it in various ways.) You also might be able to do more efficient processing, or avoid rewriting code, if you knew the encoding your strings used.&lt;br /&gt;Your encoding options&lt;br /&gt;You are free to choose a string encoding for internal use in your program. The choice pretty much boils down to either UTF-8, wide (4-byte) characters, or multibyte. Each has its advantages and disadvantages:&lt;br /&gt;UTF-8&lt;br /&gt;Pro: compatible with all existing strings and most existing code&lt;br /&gt;Pro: takes less space&lt;br /&gt;Pro: widely used as an interchange format (e.g. in XML)&lt;br /&gt;Con: more complex processing, O(n) string indexing Wide characters&lt;br /&gt;Pro: easy to process&lt;br /&gt;Con: wastes space&lt;br /&gt;Pro/Con: although you can use the syntax L"Hello, world."to easily include wide-character strings in C programs, the size of wide characters is not consistent across platforms (some incorrectly use 2-byte wide characters)&lt;br /&gt;Con: should not be used for output, since spurious zero bytes and other low-ASCII characters with common meanings (such as '/' and '\n') will likely be sprinkled throughout the data. Multibyte&lt;br /&gt;Pro: no conversions ever needed on input and output&lt;br /&gt;Pro: built-in C library support&lt;br /&gt;Pro: provides the widest possible internationalization, since in rare cases conversion between local encodings and Unicode does not work well&lt;br /&gt;Con: strings are opaque&lt;br /&gt;Con: perpetuates incompatibilities. For example, there are three major encodings for Russian. If one Russian sends data to another through your program, the recipient will not be able to read the message if his or her computer is configured for a different Russian encoding. But if your program always converts to UTF-8, the text is effectively normalized so that it will be widely legible (especially in the future) no matter what encoding it started in.&lt;br /&gt;In this article I will advocate and give explicit instruction on using UTF-8 as an internal string encoding. Many Linux users already set their environment to a UTF-8 locale, in which case you won't even have to do any conversions. Otherwise you will have to convert multibyte to wide to UTF-8 on input, and back to multibyte on output. Nevertheless, UTF-8 has its advantages.&lt;br /&gt;III. What to do right nowBelow I'll outline concrete steps any C programmer could take to bring his or her code up to date with respect to text encoding. I'll also be presenting a simple C library that provides the routines you need to manipulate UTF-8.&lt;br /&gt;Here's your to-do list:&lt;br /&gt;"char" no longer means characterI hereby recommend referring to character codes in C programs using a 32-bit unsigned integer type. Many platforms provide a "wchar_t" (wide character) type, but unfortunately it is to be avoided since some compilers allot it only 16 bits—not enough to represent Unicode. Wherever you need to pass around an individual character, change "char" to "unsigned int" or similar. The only remaining use for the "char" type is to mean "byte".&lt;br /&gt;Get UTF-8-cleanTo take advantage of UTF-8, you'll have to treat bytes higher than 127 as perfectly ordinary characters. For example, say you have a routine that recognizes valid identifier names for a programming language. Your existing standard might be that identifiers begin with a letter: int valid_identifier_start(char ch)&lt;br /&gt;{&lt;br /&gt;return ((ch &gt;= 'A' &amp;&amp;amp; ch &lt;= 'Z')  (ch &gt;= 'a' &amp;&amp;amp; ch &lt;= 'z'));&lt;br /&gt;}&lt;br /&gt;If you use UTF-8, you can extend this to allow letters from other languages as follows: int valid_identifier_start(char ch)&lt;br /&gt;{&lt;br /&gt;return ((ch &gt;= 'A' &amp;&amp;amp; ch &lt;= 'Z')  (ch &gt;= 'a' &amp;&amp;amp; ch &lt;= 'z')&lt;br /&gt;((unsigned char)ch &gt;= 0xC0));&lt;br /&gt;}&lt;br /&gt;A UTF-8 sequence can only start with values 0xC0 or greater, so that's what I used for checking the start of an identifier. Within an identifier, you would also want to allow characters &gt;= 0x80, which is the range of UTF-8 continuation bytes.&lt;br /&gt;Most C string library routines still work with UTF-8, since they only scan for for terminating NUL characters. A notable exception is strchr(), which in this context is more aptly named "strbyte()". Since you will be passing character codes around as 32-bit integers, you need to replace this with a routine such as my u8_strchr() that can scan UTF-8 for a given character. The traditional strchr() returns a pointer to the location of the found character, and u8_strchr() follows suit. However, you might want to know the index of the found character, and since u8_strchr() has to scan through the string anyway, it keeps a count and returns a character index as well.&lt;br /&gt;With the old strchr(), you could use pointer arithmetic to determine the character index. Now, any use of pointer arithmetic on strings is likely to be broken since characters are no longer bytes. You'll have to find and fix any code that assumes "(char*)b - (char*)a" is the number of characters between a and b (though it is still of course the number of bytes between a and b).&lt;br /&gt;Interface with your environmentUsing UTF-8 as an internal encoding is now widespread among C programmers. However, the environment your program runs in will not necessarily be nice enough to feed you UTF-8, or expect UTF-8 output.&lt;br /&gt;The functions mbstowcs() and wcstombs() convert from and to locale-specific encodings, respectively. "mbs" means multibyte string (i.e. the locale-specific string), and "wcs" means wide character string (universal 4-byte characters). Clearly, if you use wide characters internally, you are in luck here. If you use UTF-8, there is a chance that the user's locale will be set to UTF-8 and you won't have to do any conversion at all. To take advantage of that situation, you will have to specifically detect it (I'll provide a function for it). Otherwise, you will have to convert from multibyte to wide to UTF-8.&lt;br /&gt;Version 1.6 (1.5.x while in development) of the &lt;a href="http://www.fox-toolkit.org/"&gt;FOX toolkit&lt;/a&gt; uses UTF-8 internally, giving your program a nice all-UTF-8-all-the-time environment. GTK2 and Qt also support UTF-8.&lt;br /&gt;Modify APIs to discourage O(n^2) string processingThe idea of non-constant-time string indexing may worry you. But when you think about it, you rarely need to specifically access the nth character of a string. Algorithms almost never need to make requests like "Quick! Get me the 6th character of this piece of text!" Typically, if you're accessing characters you're iterating over the whole string or most of it. UTF-8 is simple enough to process that iterating over characters takes essentially the same time as iterating over bytes.&lt;br /&gt;In your own code, you can use my u8_inc() and u8_dec() to move through strings. If you develop libraries or languages, be sure to expose some kind of inc() and dec() API so nobody has to move through a string by repeatedly requesting the nth character.&lt;br /&gt;IV. Some UTF-8 routinesVarious libraries are available for internationalization and converting between different text encodings. However, I couldn't find a straightforward set of C routines providing the minimal support needed for using UTF-8 as an internal encoding (although this functionality is often embedded in large UI toolkits and such). I decided to create a small library that could be used to bring UTF-8 to arbitrary C programs.&lt;br /&gt;This library is quite incomplete; you might want to look at &lt;a href="http://directory.fsf.org/localization/"&gt;related FSF offerings&lt;/a&gt; and &lt;a href="http://www.haible.de/bruno/packages-libutf8.html"&gt;libutf8&lt;/a&gt;. libutf8 provides the multibyte and wide character C library routines mentioned above, in case your C library doesn't have them.&lt;br /&gt;Since performance is sometimes a concern with UTF-8, I made my routines as fast and lightweight as possible. They perform minimal error checking— in particular, they do not bother to determine whether a sequence is valid UTF-8, which can actually be a security problem. I justify this decision by reiterating that the intention of the library is to manipulate an internal encoding; you can enforce that all strings you store in memory be valid UTF-8, enabling the library to make that assumption. Routines for validating and converting from/to UTF-8 are &lt;a href="http://www.unicode.org/Public/PROGRAMS/CVTUTF/"&gt;available free from Unicode, Inc.&lt;/a&gt;&lt;br /&gt;Note that my routines do not need to support the many encodings of the world—the C library can handle that. If the current locale is not UTF-8, you call mbstowcs() on user input to convert any encoding (whatever it is) to a wide character string, then use my u8_toutf8() to convert it to the UTF-8 your program is comfortable with. Here's an example input routine wrapping readline(): char *get_utf8_input()&lt;br /&gt;{&lt;br /&gt;char *line, *u8s;&lt;br /&gt;unsigned int *wcs;&lt;br /&gt;int len;&lt;br /&gt;line = readline("");&lt;br /&gt;if (locale_is_utf8) {&lt;br /&gt;return line;&lt;br /&gt;}&lt;br /&gt;else {&lt;br /&gt;len = mbstowcs(NULL, line, 0)+1;&lt;br /&gt;wcs = malloc(len * sizeof(int));&lt;br /&gt;mbstowcs(wcs, line, len);&lt;br /&gt;u8s = malloc(len * sizeof(int));&lt;br /&gt;u8_toutf8(u8s, len*sizeof(int), wcs, len);&lt;br /&gt;free(line);&lt;br /&gt;free(wcs);&lt;br /&gt;return u8s;&lt;br /&gt;}&lt;br /&gt;The first call to mbstowcs() uses the special parameter value NULL to find the number of characters in the opaque multibyte string.&lt;br /&gt;Anyway, on with the routines. They are divided into four groups:&lt;br /&gt;Group 1: conversions /* is c the start of a utf8 sequence? */&lt;br /&gt;#define isutf(c) (((c)&amp;0xC0)!=0x80)&lt;br /&gt;/* convert UTF-8 to UCS-4 (4-byte wide characters)&lt;br /&gt;srcsz = source size in bytes, or -1 if 0-terminated&lt;br /&gt;sz = dest size in # of wide characters&lt;br /&gt;returns # characters converted */&lt;br /&gt;int u8_toucs(unsigned int *dest, int sz, char *src, int srcsz);&lt;br /&gt;/* convert UCS-4 to UTF-8&lt;br /&gt;srcsz = number of source characters, or -1 if 0-terminated&lt;br /&gt;sz = size of dest buffer in bytes&lt;br /&gt;returns # characters converted */&lt;br /&gt;int u8_toutf8(char *dest, int sz, unsigned int *src, int srcsz);&lt;br /&gt;/* single character to UTF-8 */&lt;br /&gt;int u8_wc_toutf8(char *dest, wchar_t ch);&lt;br /&gt;Note that the library uses "unsigned int" as its wide character type.You can convert a known number of bytes, or a NUL-terminated string. The length of a UTF-8 string is often communicated as a byte count, since that's what really matters. Recall that you can usually treat a UTF-8 string like a normal C-string with N characters (where N is the number of bytes in the UTF-8 sequence), with the possibility that some characters are &gt;127.&lt;br /&gt;Group 2: moving through UTF-8 strings /* character number to byte offset */&lt;br /&gt;int u8_offset(char *str, int charnum);&lt;br /&gt;/* byte offset to character number */&lt;br /&gt;int u8_charnum(char *s, int offset);&lt;br /&gt;/* return next character, updating a byte-index variable */&lt;br /&gt;unsigned int u8_nextchar(char *s, int *i);&lt;br /&gt;/* move to next character */&lt;br /&gt;void u8_inc(char *s, int *i);&lt;br /&gt;/* move to previous character */&lt;br /&gt;void u8_dec(char *s, int *i);&lt;br /&gt;Group 3: unicode escape sequencesIn the absence of unicode input methods, unicode characters are often notated using special escape sequences beginning with \u or \U. \u expects up to four hexadecimal digits, and \U expects up to eight. With these routines your program can accept input and give output using such sequences if necessary. /* assuming src points to the character after a backslash, read an&lt;br /&gt;escape sequence, storing the result in dest and returning the number of&lt;br /&gt;input characters processed */&lt;br /&gt;int u8_read_escape_sequence(char *src, unsigned int *dest);&lt;br /&gt;/* given a wide character, convert it to an ASCII escape sequence stored in&lt;br /&gt;buf, where buf is "sz" bytes. returns the number of characters output. */&lt;br /&gt;int u8_escape_wchar(char *buf, int sz, unsigned int ch);&lt;br /&gt;/* convert a string "src" containing escape sequences to UTF-8 */&lt;br /&gt;int u8_unescape(char *buf, int sz, char *src);&lt;br /&gt;/* convert UTF-8 "src" to ASCII with escape sequences.&lt;br /&gt;if escape_quotes is nonzero, quote characters will be preceded by&lt;br /&gt;backslashes as well. */&lt;br /&gt;int u8_escape(char *buf, int sz, char *src, int escape_quotes);&lt;br /&gt;/* utility predicates used by the above */&lt;br /&gt;int octal_digit(char c);&lt;br /&gt;int hex_digit(char c);&lt;br /&gt;Group 4: replacements for standard functions /* return a pointer to the first occurrence of ch in s, or NULL if not&lt;br /&gt;found. character index of found character returned in *charn. */&lt;br /&gt;char *u8_strchr(char *s, unsigned int ch, int *charn);&lt;br /&gt;/* same as the above, but searches a buffer of a given size instead of&lt;br /&gt;a NUL-terminated string. */&lt;br /&gt;char *u8_memchr(char *s, unsigned int ch, size_t sz, int *charn);&lt;br /&gt;/* count the number of characters in a UTF-8 string */&lt;br /&gt;int u8_strlen(char *s);&lt;br /&gt;/* given the string returned by setlocale(), determine whether the current&lt;br /&gt;locale speaks UTF-8 */&lt;br /&gt;int u8_is_locale_utf8(char *locale);&lt;br /&gt;/* these functions can print from UTF-8 strings. they make no assumptions&lt;br /&gt;about locale; you can circumvent them if is_locale_utf8 */&lt;br /&gt;int u8_vprintf(char *fmt, va_list ap);&lt;br /&gt;int u8_printf(char *fmt, ...);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-523550927740777350?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/523550927740777350/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=523550927740777350&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/523550927740777350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/523550927740777350'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/unicode-what-you-can-do-about-it-today.html' title='Unicode: What You Can Do About It Today'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-4647455097525318709</id><published>2007-04-20T10:19:00.000-07:00</published><updated>2007-04-20T10:21:26.996-07:00</updated><title type='text'>So you want to write a game?</title><content type='html'>By Alex Hoffer What exactly do you need to know to write a game? Well you, have to know what makes a game fun, of course, but from a technical perspective, what is there to it?&lt;br /&gt;The best way to learn how to write games is, alas, to get a solid grounding in the basics of computer science.&lt;br /&gt;GraphicsThere is perhaps no single area of gaming in which players standards have risen more than in the field of graphics. While players in the 70s and 80s were accustomed to screens of text or 16-bit black-and-white graphics, the users of today demand Riven-quality, 3D graphics, complete with lighting effects, textures, and scale. Unfortunately, graphics are hard to do. They require math, at least on the level of multivariable calculus, and a great deal of time. But if you aren't quite a math wizard yet, don't despair; for more casual games, most people are willing to accept simple 2D sprites. Anyone who's ever been addicted to Tetris knows that while simple graphics may not cut it on the shelves any more, they're no barrier to a satisfying gaming experience. For more info on graphics programming, check out &lt;a href="http://www.cprogramming.com/tutorial/opengl_introduction.html"&gt;our tutorial on creating graphics with OpenGL&lt;/a&gt; and the 3D rotations series at the &lt;a href="http://www.cprogramming.com/advtutorial.html"&gt;advanced tutorial section&lt;/a&gt; of the site.&lt;br /&gt;SpeedIf youre writing a game--particularly an arcade-style game--speed is all-important. Hardware advances have to some extent made optimization less relevant, but for every advance in hardware, an advance in graphics is sure to come along to take up the slack. And even a more simple game can run less than lightning-fast if it's written in an interpreted language like Java. Learning how to speed things up requires a familiarity with data structures and algorithms. Choosing the right data structure to store your game data in can mean the difference between a pokey game and one that zips along. For information on efficient game programming, see &lt;a href="http://www.cprogramming.com/tutorial/AI/chessboardrep.html"&gt;AI Horizon's article on efficient chessboard representation&lt;/a&gt; or &lt;a href="http://www.cprogramming.com/tutorial/computersciencetheory/algorithmicefficiency1.html"&gt;algorithmic efficiency and big-o notation&lt;/a&gt;.&lt;br /&gt;StructureNo matter what kind of program you're writing, from an implementation of Space Invaders to a filing system for grandma's recipes, clear programming structure is vital when it comes to understanding your code when you come back to work on it after a break, or, even moreso, if you plan on working with a buddy who has to be able to understand what you wrote or use your functions. Good commenting and readable style are a must. Games are also well-suited to object-oriented programming, since the elements of your game world are often, well, objects, like a spaceship, a bullet, or an evil alien vessel. Choosing classes appropriately is key, and inheritance can often come in handy (for example, if your game has several different light sources, or monsters, or doors, that all share some basic properties.) For more tips on style, see &lt;a href="http://www.cprogramming.com/tutorial/comments.html"&gt;how and why to comment&lt;/a&gt;, &lt;a href="http://www.cprogramming.com/tutorial/thinking.html"&gt;thinking about programming&lt;/a&gt;, and this series on &lt;a href="http://cprogramming.com/tutorial/style.html"&gt;programming style&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-4647455097525318709?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/4647455097525318709/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=4647455097525318709&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/4647455097525318709'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/4647455097525318709'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/so-you-want-to-write-game.html' title='So you want to write a game?'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-7875648661231684489</id><published>2007-04-17T03:04:00.000-07:00</published><updated>2007-04-17T03:06:59.815-07:00</updated><title type='text'>10 Tips To Effective Search Engine Optimization, Submission And Promotion</title><content type='html'>-Make sure your website is tested for good load time, dead links and cross-browser compatibility. Netmechanic.com is a good website to do this.&lt;br /&gt;-Optimize you web site pages by making sure your top keywords appear in your title, meta tags and content.&lt;br /&gt;-Make sure you provide quality content that have something unique to offer and that have keywords or key phrases people might search to find your site.&lt;br /&gt;-If you sell products, give something away free (The word "free" is one of the top most searched words on the internet).&lt;br /&gt;-Build quality links to your site pages from other well ranked sites on your target search engine.&lt;br /&gt;Make a list of your top keywords and key-phrases and track your listings/ranking in the top 10 search engines and analyze it periodically.&lt;br /&gt;-&lt;a href="http://www.smartwebby.com/website_promotion/directory_submission.asp"&gt;Submit to top directories&lt;/a&gt; there are many directories out there that list websites in their related categories - Just find the top ranked ones and submit your pages under related sections.&lt;br /&gt;-Make sure your web site looks attractive and easy to use with clear navigation and easy to read layout and fonts. This is especially useful for directories as manual approval is required for them.&lt;br /&gt;-Keep up to date with the latest in SEO by reading through articles, forums and related guides - remember SEO requires a lot of time and patience. You have to keep working on it.&lt;br /&gt;-Keep your website focussed to cater to your visitors needs - don't throw in a free-for-all links program or forum to just attract traffic - in the long run this will pay-off as you website will be recognized for what it is.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-7875648661231684489?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/7875648661231684489/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=7875648661231684489&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/7875648661231684489'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/7875648661231684489'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/10-tips-to-effective-search-engine.html' title='10 Tips To Effective Search Engine Optimization, Submission And Promotion'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-7058794218862428618</id><published>2007-04-17T03:02:00.000-07:00</published><updated>2007-04-17T03:03:53.381-07:00</updated><title type='text'>Convert Excel files to simple Wikimedia and HTML tables</title><content type='html'>I recently installed a Wiki at work, but our users aren't exactly computer experts, and Wiki experts even less so. So I wanted to make a tool to allow them to upload an Excel file and have it spit out Wiki code for a table. I started in ASP, but just uploading a file and reading other form values at the same time was enough to make me tear my hair out. (Yes, I looked at the ASP upload posts here, but most of it was far too complicated for what I was doing)Since Wikimedia is in PHP anyway, I figured I'd see if someone had created an Excel reader in PHP, and lo &amp; behold, I found the aptly-named &lt;a href="http://sourceforge.net/projects/phpexcelreader/" target="_blank"&gt;PHP-ExcelReader&lt;/a&gt; on Sourceforge.net. It works quite well, most of the bugs have been fixed, and it's pretty easy to use.The first page has a simple form and instructions. It allows the user to select their file, the rows that contain a title, header rows, and the first data row. I also added some optional style selections, such as positioning (none/center/float left/float right), font/bg colors, cell padding, cell spacing, and border width. After clicking "Next," the Wikimedia table code is displayed, along with a rendition of the table itself (in HTML, of course). Note: if you decide to modify this to create HTML code and strip out the Wiki part, the positioning/floating is not included (for my purposes, the HTML table is only to allow the user to see roughly what it will look like by itself).So far, it handles vertically or horizontally merged cells; however if a cell is merged over multiple rows and columns, data starts disappearing. That is a problem I couldn't figure out within the time I alotted myself (I have plenty of REAL work to do ). I had some trouble displaying dates correctly, but I'm not sure if the problem was with PHP-ExcelReader, my server, or something in my code (don't think so). Also, if a column is used and later all cells emptied, it seems to think it's still a used cell, despite the lack of any data.It does NOT, however, use any style or formatting from the Excel file: just data. No bold/italics, no font size changes, no charts or images (of course), and it does not know how wide the columns are.So it is very simple and not feature-rich, but I thought others might find it somewhat useful, even if just as an example of how to use PHP-ExcelReader. I'd be interested to know if anyone finds it useful or notices any obvious bugs.The attached ZIP file contains three PHP files: index.php contains my code, while reader.php and oleread.inc are the files from PHP-ExcelReader (unmodified). In index.php there are two fields that may need to be edited for your use. $thisfile can be changed if you don't want your file called indes.php, and $dropdir needs to be writeable by your web server.The file I uploaded disappeared. &lt;a href="http://www.programmersresource.com/forum/attachment.php?attachmentid=118" target="_blank"&gt;Here is a link to the file from another post&lt;/a&gt;&lt;br /&gt;__________________&lt;a href="http://www.rhymezilla.com/" target="_blank"&gt;www.Rhymezilla.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-7058794218862428618?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/7058794218862428618/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=7058794218862428618&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/7058794218862428618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/7058794218862428618'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/convert-excel-files-to-simple-wikimedia.html' title='Convert Excel files to simple Wikimedia and HTML tables'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-8477245112814277186</id><published>2007-04-16T20:22:00.000-07:00</published><updated>2007-04-16T20:23:25.464-07:00</updated><title type='text'>C++ and Java Syntax Differences Cheat Sheet</title><content type='html'>main function&lt;br /&gt;C++// free-floating function&lt;br /&gt;int main( int argc, char* argv[])&lt;br /&gt;{&lt;br /&gt;printf( "Hello, world" );&lt;br /&gt;}&lt;br /&gt;Java// every function must be part of a class; the main function for a particular&lt;br /&gt;// class file is invoked when java &lt;class&gt; is run (so you can have one&lt;br /&gt;// main function per class--useful for writing unit tests for a class)&lt;br /&gt;class HelloWorld&lt;br /&gt;{&lt;br /&gt;public static void main(String args[])&lt;br /&gt;{&lt;br /&gt;System.out.println( "Hello, World" );&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;Compiling&lt;br /&gt;C++ // compile as&lt;br /&gt;g++ foo.cc -o outfile&lt;br /&gt;// run with&lt;br /&gt;./outfile&lt;br /&gt;&lt;br /&gt;Java // compile classes in foo.java to &lt;classname&gt;.class&lt;br /&gt;javac foo.java&lt;br /&gt;// run by invoking static main method in &lt;classname&gt;&lt;br /&gt;java &lt;classname&gt;&lt;br /&gt;&lt;br /&gt;CommentsSame in both languages (// and /* */ both work)&lt;br /&gt;Class declarationsAlmost the same, but Java does not require a semicolon&lt;br /&gt;C++ class Bar {};&lt;br /&gt;&lt;br /&gt;Java class Bar {}&lt;br /&gt;&lt;br /&gt;Method declarationsSame, except that in Java, must always be part of a class, and may prefix with public/private/protected&lt;br /&gt;Constructors and destructorsConstructor has same syntax in both (name of the class), Java has no exact equivalent of the destructor&lt;br /&gt;Static member functions and variablesSame as method declarations, but Java provides static initialization blocks to initialize static variables (instead of putting a definition in a source code file): class Foo&lt;br /&gt;{&lt;br /&gt;static private int x;&lt;br /&gt;// static initialization block&lt;br /&gt;{ x = 5; }&lt;br /&gt;}&lt;br /&gt;Object declarations&lt;br /&gt;C++ // on the stack&lt;br /&gt;myClass x;&lt;br /&gt;// or on the heap&lt;br /&gt;myClass *x = new myClass;&lt;br /&gt;&lt;br /&gt;Java // always allocated on the heap (also, always need parens for constructor)&lt;br /&gt;myClass x = new myClass();&lt;br /&gt;&lt;br /&gt;References vs. pointers&lt;br /&gt;C++ // references are immutable, use pointers for more flexibility&lt;br /&gt;int bar = 7, qux = 6;&lt;br /&gt;int&amp; foo = bar;&lt;br /&gt;&lt;br /&gt;Java // references are mutuable and store addresses only to objects; there are&lt;br /&gt;// no raw pointers&lt;br /&gt;myClass x;&lt;br /&gt;x.foo(); // error, x is a null ``pointer''&lt;br /&gt;// note that you always use . to access a field&lt;br /&gt;&lt;br /&gt;Inheritance&lt;br /&gt;C++ class Foo : public Bar&lt;br /&gt;{ ... };&lt;br /&gt;&lt;br /&gt;Java class Foo extends Bar&lt;br /&gt;{ ... }&lt;br /&gt;&lt;br /&gt;Protection levels (abstraction barriers)&lt;br /&gt;C++ public:&lt;br /&gt;void foo();&lt;br /&gt;void bar();&lt;br /&gt;&lt;br /&gt;Java public void foo();&lt;br /&gt;public void bar();&lt;br /&gt;&lt;br /&gt;Virtual functions&lt;br /&gt;C++ virtual int foo(); // or, non-virtually as simply int foo();&lt;br /&gt;&lt;br /&gt;Java // functions are virtual by default; use final to prevent overriding&lt;br /&gt;int foo(); // or, final int foo();&lt;br /&gt;&lt;br /&gt;Abstract classes&lt;br /&gt;C++ // just need to include a pure virtual function&lt;br /&gt;class Bar { public: virtual void foo() = 0; };&lt;br /&gt;&lt;br /&gt;Java // syntax allows you to be explicit!&lt;br /&gt;abstract class Bar { public abstract void foo(); }&lt;br /&gt;// or you might even want to specify an interface&lt;br /&gt;interface Bar { public void foo(); }&lt;br /&gt;// and later, have a class implement the interface:&lt;br /&gt;class Chocolate implements Bar&lt;br /&gt;{&lt;br /&gt;public void foo() { /* do something */ }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Memory managementRoughly the same--new allocates, but no delete in Java since it has garbage collection.&lt;br /&gt;NULL vs. null&lt;br /&gt;C++ // initialize pointer to NULL&lt;br /&gt;int *x = NULL;&lt;br /&gt;&lt;br /&gt;Java // the compiler will catch the use of uninitialized references, but if you&lt;br /&gt;// need to initialize a reference so it's known to be invalid, assign null&lt;br /&gt;myClass x = null;&lt;br /&gt;&lt;br /&gt;BooleansJava is a bit more verbose: you must write boolean instead of merely bool.&lt;br /&gt;C++bool foo;&lt;br /&gt;Javaboolean foo;&lt;br /&gt;Const-ness&lt;br /&gt;C++ const int x = 7;&lt;br /&gt;&lt;br /&gt;Java final int x = 7;&lt;br /&gt;&lt;br /&gt;Throw SpecFirst, Java enforce throw specs at compile time--you must document if your method can throw an exception&lt;br /&gt;C++int foo() throw (IOException)&lt;br /&gt;Javaint foo() throws IOException&lt;br /&gt;Arrays&lt;br /&gt;C++ int x[10];&lt;br /&gt;// or&lt;br /&gt;int *x = new x[10];&lt;br /&gt;// use x, then reclaim memory&lt;br /&gt;delete[] x;&lt;br /&gt;&lt;br /&gt;Java int[] x = new int[10];&lt;br /&gt;// use x, memory reclaimed by the garbage collector or returned to the&lt;br /&gt;// system at the end of the program's lifetime&lt;br /&gt;&lt;br /&gt;Collections and Iteration&lt;br /&gt;C++Iterators are members of classes. The start of a range is &lt;container&gt;.begin(), and the end is &lt;container&gt;.end(). Advance using ++ operator, and access using *. vector myVec;&lt;br /&gt;for ( vector&lt;int&gt;::iterator itr = myVec.begin();&lt;br /&gt;itr != myVec.end();&lt;br /&gt;++itr )&lt;br /&gt;{&lt;br /&gt;cout &lt;&lt; *itr;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;JavaIterator is just an interface. The start of the range is &lt;collection&gt;.iterator, and you check to see if you're at the end with itr.hasNext(). You get the next element using itr.next() (a combination of using ++ and * in C++). ArrayList myArrayList = new ArrayList();&lt;br /&gt;Iterator itr = myArrayList.iterator();&lt;br /&gt;while ( itr.hasNext() )&lt;br /&gt;{&lt;br /&gt;System.out.println( itr.next() );&lt;br /&gt;}&lt;br /&gt;// or, in Java 5&lt;br /&gt;ArrayList myArrayList = new ArrayList();&lt;br /&gt;for( Object o : myArrayList ) {&lt;br /&gt;System.out.println( o );&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;TemplatesThis is still being to be added. See &lt;a href="http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf"&gt;http://java.sun.com/j2se/1.5/pdf/generics-tutorial.pdf&lt;/a&gt; for a good introduction.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-8477245112814277186?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/8477245112814277186/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=8477245112814277186&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/8477245112814277186'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/8477245112814277186'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/c-and-java-syntax-differences-cheat.html' title='C++ and Java Syntax Differences Cheat Sheet'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-4956396476423273339</id><published>2007-04-16T01:10:00.000-07:00</published><updated>2007-04-16T01:11:26.572-07:00</updated><title type='text'>Understanding the Start of an Object's Lifetime</title><content type='html'>In C++, whenever an object of a class is created, its constructor is called. But that's not all--its parent class constructor is called, as are the constructors for all objects that belong to the class. By default, the constructors invoked are the default ("no-argument") constructors. Moreover, all of these constructors are called before the class's own constructor is called.&lt;br /&gt;For instance, take the following code: include&lt;br /&gt;class Foo&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Foo() { std::cout &lt;&lt; "Foo's constructor" &lt;&lt; std::endl; }&lt;br /&gt;};&lt;br /&gt;class Bar : public Foo&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Bar() { std::cout &lt;&lt; "Bar's constructor" &lt;&lt; std::endl; }&lt;br /&gt;};&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;// a lovely elephant ;)&lt;br /&gt;Bar bar;&lt;br /&gt;}&lt;br /&gt;The object bar is constructed in two stages: first, the Foo constructor is invoked and then the Bar constructor is invoked. The output of the above program will be to indicate that Foo's constructor is called first, followed by Bar's constructor. Why do this? There are a few reasons. First, each class should need to initialize things that belong to it, not things that belong to other classes. So a child class should hand off the work of constructing the portion of it that belongs to the parent class. Second, the child class may depend on these fields when initializing its own fields; therefore, the constructor needs to be called before the child class's constructor runs. In addition, all of the objects that belong to the class should be initialized so that the constructor can use them if it needs to. But what if you have a parent class that needs to take arguments to its constructor? This is where initialization lists come into play. An initialization list immediately follows the constructor's signature, separated by a colon: class Foo : public parent_class&lt;br /&gt;{&lt;br /&gt;Foo() : parent_class( "arg" ) // sample initialization list&lt;br /&gt;{&lt;br /&gt;// you must include a body, even if it's merely empty&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;Note that to call a particular parent class constructor, you just need to use the name of the class (it's as though you're making a function call to the constructor). For instance, in our above example, if Foo's constructor took an integer as an argument, we could do this: include&lt;br /&gt;class Foo&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Foo( int x )&lt;br /&gt;{&lt;br /&gt;std::cout &lt;&lt; "Foo's constructor "&lt;br /&gt;&lt;&lt; called with "&lt;br /&gt;&lt;&lt; x&lt;br /&gt;&lt;&lt; std::endl;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;class Bar&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Bar() : Foo( 10 ) // construct the Foo part of Bar&lt;br /&gt;{&lt;br /&gt;std::cout &lt;&lt; "Bar's constructor" &lt;&lt; std::endl;&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;Bar stool;&lt;br /&gt;}&lt;br /&gt;Using Initialization Lists to Initialize FieldsIn addition to letting you pick which constructor of the parent class gets called, the initialization list also lets you specify which constructor gets called for the objects that are fields of the class. For instance, if you have a string inside your class: class Qux&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Qux() : _foo( "initialize foo to this!" ) { }&lt;br /&gt;// This is nearly equivalent to&lt;br /&gt;// Qux() { _foo = "initialize foo to this!"; }&lt;br /&gt;// but without the extra call to construct an empty string&lt;br /&gt;private:&lt;br /&gt;std::string _foo;&lt;br /&gt;};&lt;br /&gt;Here, the constructor is invoked by giving the name of the object to be constructed rather than the name of the class (as in the case of using initialization lists to call the parent class's constructor). If you have multiple fields of a class, then the names of the objects being initialized should appear in the order they are declared in the class (and after any parent class constructor call): class Baz&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Baz() : _foo( "initialize foo first" ), _bar( "then bar" ) { }&lt;br /&gt;private:&lt;br /&gt;std::string _foo;&lt;br /&gt;std::string _bar;&lt;br /&gt;};&lt;br /&gt;Initialization Lists and Scope IssuesIf you have a field of your class that is the same name as the argument to your constructor, then the initialization list "does the right thing." For instance, class Baz&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Bar( std::string foo ) : foo( foo ) { }&lt;br /&gt;private:&lt;br /&gt;std::string foo;&lt;br /&gt;};&lt;br /&gt;is roughly equivalent to class Baz&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Bar( std::string foo )&lt;br /&gt;{&lt;br /&gt;this-&gt;foo = foo;&lt;br /&gt;}&lt;br /&gt;private:&lt;br /&gt;std::string foo;&lt;br /&gt;};&lt;br /&gt;That is, the compiler knows which foo belongs to the object, and which foo belongs to the function.&lt;br /&gt;Initialization Lists and Primitive TypesIt turns out that initialization lists work to initialize both user-defined types (objects of classes) and primitive types (e.g., int). When the field is a primitive type, giving it an argument is equivalent to assignment. For instance, class Quux&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;Quux() : _my_int( 5 ) // sets _my_int to 5&lt;br /&gt;{ }&lt;br /&gt;private:&lt;br /&gt;int _my_int;&lt;br /&gt;};&lt;br /&gt;This behavior allows you to specify templates where the templated type can be either a class or a primitive type (otherwise, you would have to have different ways of handling initializing fields of the templated type for the case of classes and objects). template&lt;br /&gt;class my_template&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;// works as long as T has a copy constructor&lt;br /&gt;my_template( T bar ) : _bar( bar ) { }&lt;br /&gt;private:&lt;br /&gt;T _bar;&lt;br /&gt;};&lt;br /&gt;Initialization Lists and Const FieldsUsing initialization lists to initialize fields is not always necessary (although it is probably more convenient than other approaches). But it is necessary for &lt;a href="http://www.cprogramming.com/tutorial/const_correctness.html"&gt;const&lt;/a&gt; fields. If you have a const field, then it can be initialized only once, so it must be initialized in the initialization list. class const_field&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;const_field() : _constant( 1 ) { }&lt;br /&gt;// this is an error: const_field() { _constant = 1; }&lt;br /&gt;private:&lt;br /&gt;const int _constant;&lt;br /&gt;};&lt;br /&gt;When Else do you Need Initialization Lists?&lt;br /&gt;No Default ConstructorIf you have a field that has no default constructor (or a parent class with no default constructor), you must specify which constructor you wish to use.&lt;br /&gt;ReferencesIf you have a field that is a reference, you also must initialize it in the initialization list; since references are immutable they can be initialized only once.&lt;br /&gt;Initialization Lists and ExceptionsSince constructors can throw exceptions, it's possible that you might want to be able to handle exceptions that are thrown by constructors invoked as part of the initialization list. First, you should know that even if you catch the exception, it will get rethrown because it cannot be guaranteed that your object is in a valid state because one of its fields (or parts of its parent class) couldn't be initialized. That said, one reason you'd want to catch an exception here is that there's some kind of translation of error messages that needs to be done. The syntax for catching an exception in an initialization list is somewhat awkward: the 'try' goes right before the colon, and the catch goes after the body of the function: class Foo&lt;br /&gt;{&lt;br /&gt;Foo() try : _str( "text of string" )&lt;br /&gt;{&lt;br /&gt;}&lt;br /&gt;catch ( ... )&lt;br /&gt;{&lt;br /&gt;std::cerr &lt;&lt; "Couldn't create _str";&lt;br /&gt;// now, the exception is rethrown as if we'd written&lt;br /&gt;// "throw;" here&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;Initialization Lists: SummaryBefore the body of the constructor is run, all of the constructors for its parent class and then for its fields are invoked. By default, the no-argument constructors are invoked. Initialization lists allow you to choose which constructor is called and what arguments that constructor receives. If you have a reference or a const field, or if one of the classes used does not have a default constructor, you must use an initialization list.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-4956396476423273339?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/4956396476423273339/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=4956396476423273339&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/4956396476423273339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/4956396476423273339'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/understanding-start-of-objects-lifetime.html' title='Understanding the Start of an Object&apos;s Lifetime'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-6101953453447055415</id><published>2007-04-11T19:54:00.000-07:00</published><updated>2007-04-11T20:06:09.431-07:00</updated><title type='text'>Gotchas for a C programmer using C++</title><content type='html'>Implicit Assignment from void*You cannot implicitly assign from a void* to any other type. For instance, the following is perfectly valid in C (in fact, it's arguably the &lt;a href="http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?id=1043284351&amp;answer=1047673478"&gt;preferable way of doing&lt;/a&gt; it in C) int *x = malloc(sizeof(int) * 10);&lt;br /&gt;but it won't compile in C++. (Try it yourself!) The explanation from Bjarne Stroustrup himself is that this isn't type safe. What this means is that you can have a void* that points to anything at all, and if you then assign the address stored in that void* to another pointer of a different type, there isn't any warning at all about it. Consider the following: int an_int;&lt;br /&gt;void *void_pointer = &amp;an_int;&lt;br /&gt;double *double_ptr = void_pointer;&lt;br /&gt;*double_ptr = 5;&lt;br /&gt;When you assign *double_ptr the value 5, it's writing 8 bytes of memory, but the integer variable an_int is only 4 bytes. Forcing a cast from a void pointer makes the programmer pay attention to these things.&lt;br /&gt;Freeing arrays: new[] and delete[]In C, there's only one major memory allocation function: malloc. You use it to allocate both single elements and arrays: int *x = malloc( sizeof(int) );&lt;br /&gt;int *x_array = malloc( sizeof(int) * 10 );&lt;br /&gt;and you always release the memory in the same way: free( x );&lt;br /&gt;free( x_array );&lt;br /&gt;In C++, however, memory allocation for arrays is somewhat different than for single objects; you use the new[] operator, and you must match calls to new[] with calls to delete[] (rather than to delete). int *x = new int;&lt;br /&gt;int *x_array = new int[10];&lt;br /&gt;delete x;&lt;br /&gt;delete[] x;&lt;br /&gt;The short explanation is that when you have arrays of objects, delete[] with properly call the destructor for each element of the array, whereas delete will not.&lt;br /&gt;You must declare functions before useAlthough most good C code will follow this convention, in C++ it is strictly enforced that all functions must be declared before they are used. This code is valid C, but it is not valid C++: #include &lt;stdio.h&gt;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;foo();&lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt;int foo()&lt;br /&gt;{&lt;br /&gt;printf( "Hello world" );&lt;br /&gt;}&lt;br /&gt;Gotcha for a C++ programmer using C&lt;br /&gt;Structs and EnumsYou have to include the struct keyword before the name of the struct type to declare a struct: In C++, you could do this struct a_struct&lt;br /&gt;{&lt;br /&gt;int x;&lt;br /&gt;};&lt;br /&gt;a_struct struct_instance;&lt;br /&gt;and have a new instance of a_struct called struct_instance. In C, however, we have to include the struct keyword when declaring struct_instance: struct a_struct struct_instance;&lt;br /&gt;In fact, a similar situation also holds for declaring enums: in C, you must include the keyword enum; in C++, you don't have to. As a side note, most C programmers get around this issue by using typedefs: typedef struct struct_name&lt;br /&gt;{&lt;br /&gt;/* variables */&lt;br /&gt;} struct_name_t;&lt;br /&gt;Now you can declare a struct with struct_name_t struct_name_t_instance;&lt;br /&gt;But there is another gotcha for C++ programmers: you must still use the "struct struct_name" syntax to declare a struct member that is a a pointer to the struct. typedef struct struct_name&lt;br /&gt;{&lt;br /&gt;struct struct_name instance;&lt;br /&gt;struct_name_t instance2; /* invalid! The typedef isn't defined yet */&lt;br /&gt;} struct_name_t;&lt;br /&gt;C++ has a much larger libraryC++ has a much larger library than C, and some things may be automatically linked in by C++ when they are not with C. For instance, if you're used to using &lt;a href="http://www.cprogramming.com/g++.html"&gt;g++&lt;/a&gt; for math-heavy computations, then it may come as a shock that when you are using &lt;a href="http://www.cprogramming.com/gcc.html"&gt;gcc&lt;/a&gt; to compile C, you need to explicitly include the math library for things like sin or even sqrt: % g++ foo.cc&lt;br /&gt;or&lt;br /&gt;% gcc foo.c -lm&lt;br /&gt;No Boolean TypeC does not provide a native boolean type. You can simulate it using an enum, though: typedef enum {FALSE, TRUE} bool;&lt;br /&gt;main Doesn't Provide return 0 AutomaticallyIn C++, you are free to leave off the statement 'return 0;' at the end of main; it will be provided automatically: int main()&lt;br /&gt;{&lt;br /&gt;print( "Hello, World" );&lt;br /&gt;}&lt;br /&gt;but in C, you must manually add it: int main()&lt;br /&gt;{&lt;br /&gt;print( "Hello, World" );&lt;br /&gt;return 0;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-6101953453447055415?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/6101953453447055415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=6101953453447055415&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/6101953453447055415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/6101953453447055415'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/gotchas-for-c-programmer-using-c.html' title='Gotchas for a C programmer using C++'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-5050175246379820124</id><published>2007-04-10T21:10:00.000-07:00</published><updated>2007-04-10T21:11:43.917-07:00</updated><title type='text'>Function Pointers</title><content type='html'>Example Uses of Function Pointers&lt;br /&gt;Functions as Arguments to Other FunctionsIf you were to write a &lt;a href="http://www.cprogramming.com/tutorial/computersciencetheory/sortcomp.html"&gt;sort routine&lt;/a&gt;, you might want to allow the function's caller to choose the order in which the data is sorted; some programmers might need to sort the data in ascending order, others might prefer descending order while still others may want something similar to but not quite like one of those choices. One way to let your user specify what to do is to provide a flag as an argument to the function, but this is inflexible; the sort function allows only a fixed set of comparison types (e.g., ascending and descending). A much nicer way of allowing the user to choose how to sort the data is simply to let the user pass in a function to the sort function. This function might take two pieces of data and perform a comparison on them. We'll look at the syntax for this in a bit.&lt;br /&gt;Callback FunctionsAnother use for function pointers is setting up "listener" or "callback" functions that are invoked when a particular event happens. The function is called, and this notifies your code that something of interest has taken place. Why would you ever write code with callback functions? You often see it when writing code using someone's library. One example is when you're writing code for a a graphical user interface (GUI). Most of the time, the user will interact with a loop that allows the mouse pointer to move and that redraws the interface. Sometimes, however, the user will click on a button or enter text into a field. These operations are "events" that may require a response that your program needs to handle. How can your code know what's happening? Using Callback functions! The user's click should cause the interface to call a function that you wrote to handle the event. To get a sense for when you might do this, consider what might happen if you were using a GUI library that had a "create_button" function. It might take the location where a button should appear on the screen, the text of the button, and a function to call when the button is clicked. Assuming for the moment that C (and C++) had a generic "function pointer" type called function, this might look like this: void create_button( int x, int y, const char *text, function callback_func );&lt;br /&gt;Whenever the button is clicked, callback_func will be invoked. Exactly what callback_func does depends on the button; this is why allowing the create_button function to take a function pointer is useful.&lt;br /&gt;Function Pointer SyntaxThe syntax for declaring a function pointer might seem messy at first, but in most cases it's really quite straight-forward once you understand what's going on. Let's look at a simple example: void (*foo)(int);&lt;br /&gt;In this example, foo is a pointer to a function taking one argument, an integer, and that returns void. It's as if you're declaring a function called "*foo", which takes an int and returns void; now, if *foo is a function, then foo must be a pointer to a function. (Similarly, a declaration like int *x can be read as *x is an int, so x must be a pointer to an int.) The key to writing the declaration for a function pointer is that you're just writing out the declaration of a function but with (*func_name) where you'd normally just put func_name.&lt;br /&gt;Reading Function Pointer DeclarationsSometimes people get confused when more stars are thrown in: void *(*foo)(int *);&lt;br /&gt;Here, the key is to read inside-out; notice that the innermost element of the expression is *foo, and that otherwise it looks like a normal function declaration. *foo should refer to a function that returns a void * and takes an int *. Consequently, foo is a pointer to just such a function.&lt;br /&gt;Initializing Function PointersTo initialize a function pointer, you must give it the address of a function in your program. The syntax is like any other variable: #include &lt;stdio.h&gt;&lt;br /&gt;void my_int_func(int x)&lt;br /&gt;{&lt;br /&gt;printf( "%d\n", x );&lt;br /&gt;}&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;void (*foo)(int);&lt;br /&gt;/* the ampersand is actually optional */&lt;br /&gt;foo = &amp;my_int_func;&lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt;(Note: all examples are written to be compatible with both C and C++.)&lt;br /&gt;Using a Function PointerTo call the function pointed to by a function pointer, you treat the function pointer as though it were the name of the function you wish to call. The act of calling it performs the dereference; there's no need to do it yourself: #include &lt;stdio.h&gt;&lt;br /&gt;void my_int_func(int x)&lt;br /&gt;{&lt;br /&gt;printf( "%d\n", x );&lt;br /&gt;}&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;void (*foo)(int);&lt;br /&gt;foo = &amp;my_int_func;&lt;br /&gt;/* call my_int_func (note that you do not need to write (*foo)(2) ) */&lt;br /&gt;foo( 2 );&lt;br /&gt;/* but if you want to, you may */&lt;br /&gt;(*foo)( 2 );&lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt;Note that function pointer syntax is flexible; it can either look like most other uses of pointers, with &amp; and *, or you may omit that part of syntax. This is similar to how arrays are treated, where a bare array decays to a pointer, but you may also prefix the array with &amp;amp; to request its address.&lt;br /&gt;Function Pointers in the WildLet's go back to the sorting example where I suggested using a function pointer to write a generic sorting routine where the exact order could be specified by the programmer calling the sorting function. It turns out that the C function qsort does just that. From the Linux man pages, we have the following declaration for qsort (from stdlib.h): void qsort(void *base, size_t nmemb, size_t size,&lt;br /&gt;int(*compar)(const void *, const void *));&lt;br /&gt;Note the use of void*s to allow qsort to operate on any kind of data (in C++, you'd normally use &lt;a href="http://www.cprogramming.com/tutorial/templates.html"&gt;templates&lt;/a&gt; for this task, but C++ also allows the use of void* pointers) because void* pointers can point to anything. Because we don't know the size of the individual elements in a void* array, we must give qsort the number of elements, nmemb, of the array to be sorted, base, in addition to the standard requirement of giving the length, size, of the input. But what we're really interested in is the compar argument to qsort: it's a function pointer that takes two void *s and returns an int. This allows anyone to specify how to sort the elements of the array base without having to write a specialized sorting algorithm. Note, also, that compar returns an int; the function pointed to should return -1 if the first argument is less than the second, 0 if they are equal, or 1 if the second is less than the first. For instance, to sort an array of numbers in ascending order, we could write code like this: #include &lt;stdlib.h&gt;&lt;br /&gt;int int_sorter( const void *first_arg, const void *second_arg )&lt;br /&gt;{&lt;br /&gt;int first = *(int*)first_arg;&lt;br /&gt;int second = *(int*)second_arg;&lt;br /&gt;if ( first &lt; second )&lt;br /&gt;{&lt;br /&gt;return -1;&lt;br /&gt;}&lt;br /&gt;else if ( first == second )&lt;br /&gt;{&lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;return 1;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;int array[10];&lt;br /&gt;int i;&lt;br /&gt;/* fill array */&lt;br /&gt;for ( i = 0; i &lt; 10; ++i )&lt;br /&gt;{&lt;br /&gt;array[ i ] = 10 - i;&lt;br /&gt;}&lt;br /&gt;qsort( array, 10 , sizeof( int ), int_sorter );&lt;br /&gt;for ( i = 0; i &lt; 10; ++i )&lt;br /&gt;{&lt;br /&gt;printf ( "%d\n" ,array[ i ] );&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;Often, typedefs&lt;/a&gt;&lt;br /&gt;are used to make code using function pointers somewhat more readable.&lt;br /&gt;--&gt;&lt;br /&gt;Using Polymorphism and Virtual Functions Instead of Function Pointers (C++)You can often avoid the need for explicit function pointers by using virtual functions. For instance, you could write a sorting routine that takes a pointer to a class that provides a virtual function called compare: class Sorter&lt;br /&gt;{&lt;br /&gt;public:&lt;br /&gt;virtual int compare (const void *first, const void *second);&lt;br /&gt;};&lt;br /&gt;// cpp_qsort, a qsort using C++ features like virtual functions&lt;br /&gt;void cpp_qsort(void *base, size_t nmemb, size_t size, Sorter *compar);&lt;br /&gt;inside cpp_qsort, whenever a comparison is needed, compar-&gt;compare should be called. For classes that override this virtual function, the sort routine will get the new behavior of that function. For instance: class AscendSorter : public Sorter&lt;br /&gt;{&lt;br /&gt;virtual int compare (const void*, const void*)&lt;br /&gt;{&lt;br /&gt;int first = *(int*)first_arg;&lt;br /&gt;int second = *(int*)second_arg;&lt;br /&gt;if ( first &lt; second )&lt;br /&gt;{&lt;br /&gt;return -1;&lt;br /&gt;}&lt;br /&gt;else if ( first == second )&lt;br /&gt;{&lt;br /&gt;return 0;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;return 1;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;};&lt;br /&gt;and then you could pass in a pointer to an instance of the AscendSorter to cpp_qsort to sort integers in ascending order.&lt;br /&gt;But Are You Really Not Using Function Pointers?Virtual functions are implemented behind the scenes using function pointers, so you really are using function pointers--it just happens that the compiler makes the work easier for you. Using polymorphism can be an appropriate strategy (for instance, it's used by Java), but it does lead to the overhead of having to create an object rather than simply pass in a function pointer.&lt;br /&gt;Function Pointers Summary&lt;br /&gt;Syntax&lt;br /&gt;DeclaringDeclare a function pointer as though you were declaring a function, except with a name like *foo instead of just foo: void (*foo)(int);&lt;br /&gt;InitializingYou can get the address of a function simply by naming it: void foo();&lt;br /&gt;func_pointer = foo;&lt;br /&gt;or by prefixing the name of the function with an ampersand: void foo();&lt;br /&gt;func_pointer = &amp;foo;&lt;br /&gt;InvokingInvoke the function pointed to just as if you were calling a function. func_pointer( arg1, arg2 );&lt;br /&gt;or you may optionally dereference the function pointer before calling the function it points to: (*func_pointer)( arg1, arg2 );&lt;br /&gt;Benefits of Function Pointers&lt;br /&gt;Function pointers provide a way of passing around instructions for how to do something&lt;br /&gt;You can write flexible functions and libraries that allow the programmer to choose behavior by passing function pointers as arguments&lt;br /&gt;This flexibility can also be achieved by using classes with virtual functions I am grateful to Alex Hoffer and Thomas Carriero for their comments on a draft of this article.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-5050175246379820124?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/5050175246379820124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=5050175246379820124&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/5050175246379820124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/5050175246379820124'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/function-pointers.html' title='Function Pointers'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-1823656617441699109</id><published>2007-04-09T19:21:00.000-07:00</published><updated>2007-04-09T19:22:21.967-07:00</updated><title type='text'>Safer, Cheaper, Smarter Software Buying</title><content type='html'>As a buyer (and coder), I always want to save money, which is what drew me to Rent A Coder (RAC) in the first place.  There’s a terrific opportunity to get top quality work here at rock bottom prices, something I find to be quite refreshing in today’s high cost technology market. Along with the deep discounts I’ve found here, by taking advantage of RAC’s “Safe Project Escrow” TM a prospective buyer just can’t lose! However, there are some potential mistakes that can be made by both first-time as well as veteran buyers that could come back to haunt you – I’d like to review these with you and offer some suggestions. Probably the most important concept to understand is that RAC does not ever charge a fee to buyers for their use of the service.  Why is this so important? Mainly, to avoid misunderstandings with coders about who pays RAC’s project fee and the final project cost.  When a coder signs on with RAC, they contractually agree to pay a percentage (10% - 15% or  $3.00, whichever is higher) of the total project cost to RAC as a “Finder’s Fee”.  Obviously this fee supports RAC’s ongoing operational and administrative costs and is based on the type of project that was posted.  As far as I have been able to determine, this fee has never increased since RAC went into operation, which is by the way, a great deal for the coders. In other words, there are no set fees for any particular project – it’s entirely based on the bid amount you accept, and paid for by the coder who won the bid in exchange for them using RAC to find work, maintain profiles, manage an escrow account for them, etc.  Unlike other freelancing sites where coders pay a monthly fee as well as a commission for bidding on projects, RAC only charges them a fee when they win a bid and complete the project! More importantly, since this is a blind bidding system, there is no way for the coder to mark up his or her bid to pass the “Finder’s Fee” back to you as the buyer. Any coder bidding on a given project has absolutely no way of knowing of what the “other guy” bid on your project so every coder has an incentive to keep their bid as low as possible. Given that, if a coder should ever indicate to you that he or she has to charge you “extra” for RAC projects, you should realize that this is something the coder is doing entirely on their own and that perhaps it’s time to look for a different coder to work with. Your First Project and Auction Types Whether you’re a first time or even a veteran RAC buyer, your first project is typically posted as either an Open Auction (where any coder can bid) or a Private Auction (where only those you invited can bid).  At this point, let’s assume that it’s your first project and you’ve never worked with any RAC coder. After posting your project, you’ll receive bids from all over the world (and I’m certain they’ll be as diverse as the coders posting them.)  Many coders will offer a variety of incentives for you to choose their bid over any other but you have to step cautiously here.   To a coder bidding on Open or Private Auctions this means that they will be paying a 15% “Finder’s Fee” to RAC when the project has been completed.  Because of this, a coder might occasionally suggest having you repost your project for him or her only as a One on One Project/Enhancement Auction (12.5% “Finder’s Fee”) or as a Bonus/Other Direct Payment (10% “Finder’s Fee”) – you should never do this because if caught, the coder is subject to strict penalties up to and possibly including being banned from Rent A Coder and all Exhedra sites.  Why would that happen?  RAC (quite legitimately) views this behavior as the coder attempting to “cheat” RAC out of it’s rightfully earned “Finder’s Fee” of 15%.  Once a project has been posted as a particular auction type, you can’t repost it without first obtaining permission from an RAC Facilitator (facilitator@rentacoder.com).   Among other things, this might mean you have to go back and find another coder to finish your project – all because you tried to help the coder save a few dollars!  If you’re at all like me, your time and effort are probably worth a lot more than that.  You’re much better off waiting until the project is completed and then paying the coder a bonus to make up the difference if they did an outstanding job for you. Even more importantly, if you send the coder a Bonus/Other Direct Payment before they have completed any work for you at all, you risk losing your entire project cost because this type of auction bypasses escrow and the coder’s account is credited immediately. Technically, the coder doesn’t have to deliver anything to you at all, which leaves little recourse for you if the coder disappears or reneges on the project. Lastly, always remember that coders are expressly forbidden from requiring advance payments from buyers for any reason.  Coders are allowed to request “phased” payments, i.e.; 25% upon delivery of beta, etc., but only after delivering a commensurate portion of the work they bid on.  Working with Coders Directly on Other Projects Now let’s assume that your first project went well (which is usually the case) and you’re thinking about your next one.  You may be considering using the same coder, which can work out exceptionally well for both of you because by now you’re familiar with each other and probably have a pretty good working relationship.   This is the time to go back to RAC and post your project as a One on One Project/Enhancement type of auction for your coder.  This saves the coder 2.5% off the “Finder’s Fee” and is a discount to the coder for bringing repeat business back to RAC. You might be inclined to work directly with the coder at this point and bypass RAC altogether (sometimes at the coder’s suggestion), but in all honestly, I can’t emphasize enough just how bad of an idea I think this is!   Aside from the fact that this is a clear violation of both the Custom Software Buyer and Seller Agreements and, since using RAC costs you as a buyer nothing, there’s simply no better reason to continue to use them given the buyer protection they have to offer you.   The only person who really stands to benefit from bypassing RAC is the coder and the benefit is usually so small that you should ask yourself if it’s worth risking your time, money and effort on. For example, let’s say you have a project in the $100 range (let’s keep the math simple).  If you posted a One on One Project/Enhancement for your coder, this means that they will pay a “Finder’s Fee” of $12.50 to RAC.  But it also means that you can set a project deadline, have the cost of your project placed in escrow until you indicate it’s satisfactorily completed, and have someone to turn to (facilitator@rentacoder.com) in the event something goes wrong on the project.  Additionally, your coder is also aware that you will most likely be rating his or her performance so they have plenty of incentive to do a great job. Using the same project described above, if you bypassed RAC and worked directly with the coder you’d have no recourse through RAC on this new project! If the coder does not deliver, then you’ve completely wasted your time.  If you paid the coder for all or even a portion of the project cost up front and they don’t deliver, you’ve just lost your money as well, all because you wanted to save the coder $12.50!   Is it worth it?  Not to me – I’d rather send the coder a $15.00 bonus when the project is finished and at least know that RAC was there with me every step of the way through the project, protecting my investment.   The best possible advice I can offer you is for you to put the onus on the coder to deliver a top-notch project, on time and the way you want it, and then use the Bonus/Direct Payment Auction type to make up for any difference.  Always remember though that you are never obligated to pay anything more than the amount of the bid you selected. Lastly, as a very productive coder at RAC, I can say that I emphatically support the “Finder’s Fee” concept.  Without it, I would not have had the pleasure of meeting and working with over one hundred clients on my RAC projects! More importantly, I’ve had well over a year’s experience watching RAC evolve into the comprehensive and premiere freelance site it is today and I can plainly see that every “Finder’s Fee” I’ve paid has been put to excellent use benefiting both buyers and coders alike! Good luck to all of you on your projects and thank you for choosing Rent a Coder!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-1823656617441699109?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/1823656617441699109/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=1823656617441699109&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/1823656617441699109'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/1823656617441699109'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/safer-cheaper-smarter-software-buying.html' title='Safer, Cheaper, Smarter Software Buying'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-7954413734688413224</id><published>2007-04-09T01:28:00.000-07:00</published><updated>2007-04-09T01:34:28.225-07:00</updated><title type='text'>PHP 101 (part 2): Calling All Operators</title><content type='html'>Not What You Expected&lt;br /&gt;In &lt;a href="http://devzone.zend.com/node/view/id/php101-1.php"&gt;Part One&lt;/a&gt; of this series, I gave you a brief introduction to PHP, and how it fits into your Web application development environment. I also taught you the basics of PHP variables, and showed you how to add, multiply and concatenate them together.&lt;br /&gt;Now that you know the basics, it's time to focus in on one of PHP's nicer features - its ability to automatically receive user input from a Web form and convert it into PHP variables. If you're used to writing Perl code to retrieve form values in your CGI scripts, PHP's simpler approach is going to make you weep with joy. So get that handkerchief out, and scroll on down. &lt;a name="Heading2"&gt;&lt;/a&gt;&lt;br /&gt;Form...&lt;br /&gt;Forms have always been one of quickest and easiest ways to add interactivity to your Web site. A form allows you to ask customers if they like your products, casual visitors for comments on your site, and pretty girls for their phone numbers. And PHP can simplify the task of processing the data generated from a Web-based form substantially, as this first example demonstrates. This example contains two scripts, one containing an HTML form (named form.htm) and the other containing the form processing logic (message.php). Here's form.htm:&lt;br /&gt;&lt;form action="message.php" method="post"&gt;Enter your message: &lt;input size="30" name="msg"&gt; &lt;input type="submit" value="Send"&gt; &lt;/form&gt;&lt;br /&gt;The critical line in this page is the &lt;form&gt;tag&lt;br /&gt;&lt;form method="post" action="message.php"&gt;...&lt;/form&gt;&lt;br /&gt;As you probably already know, the "action" attribute of the &lt;form&gt;tag specifies the name of the server-side script (message.php in this case) that will process the information entered into the form. The "method" attribute specifies how the information will be passed. &lt;a name="Heading3"&gt;&lt;/a&gt;&lt;br /&gt;...And Function&lt;br /&gt;Now for the other half of the puzzle: the message.php script. This script reads the data submitted by the user and "does something with it". Here is message.php:&lt;br /&gt;&lt;?php // retrieve form data $input = $_POST['msg']; // use it echo "You said: &lt;i&gt;$input&lt;/i&gt;"; ?&gt;&lt;br /&gt;When you enter some data into form.htm (let's say "Boo"), and submit it, the form processor message.php will read it and display it to you ("You said: Boo"). Thus, whenever a form is submitted to a PHP script, all variable-value pairs within that form automatically become available for use within the script, through a special PHP container variable: $_POST. You can then access the value of the form variable by using its "name" inside the $_POST container, as I did in the script above.&lt;br /&gt;Obviously, PHP also supports the GET method of form submission. All you need to do is change the "method" attribute to "get", and retrieve values from $_GET instead of $_POST. The $_GET and $_POST variables are actually a special type of PHP animal called an array, which I'll be teaching you about shortly. Don't worry too much about it at the moment, just make sure you're comfortable with retrieving simple values from a form with PHP, and then scroll on down to learn about some more operators that are useful in this context. &lt;a name="Heading4"&gt;&lt;/a&gt;&lt;br /&gt;Operating With Extreme Caution&lt;br /&gt;Thus far, the scripts we've discussed have been pretty dumb. All they've done is add numbers and strings, and read back to you the data you typed in yourself - not exactly overwhelming. In order to add some intelligence to your scripts, you need to know how to construct what geeks call a "conditional statement" - a statement which lets your script perform one of a series of possible actions based on the result of a comparison test. And since the basis of a conditional statement is comparison, you first need to know how to compare two variables and determine whether they're identical or different.&lt;br /&gt;You've already seen some of PHP's arithmetic and string operators. However, the language also comes with operators designed specifically to compare two values: the so-called "comparison operators". Here's an example that demonstrates them in action:&lt;br /&gt;&lt;?php /* define some variables */$mean = 9; $median = 10; $mode = 9; // less-than operator // returns true if left side is less than right // returns true here $result = ($mean &lt; $median); print "result is $result&lt;br /&gt;"; // greater-than operator // returns true if left side is greater than right // returns false here $result = ($mean &gt;$median); print "result is $result&lt;br /&gt;"; // less-than-or-equal-to operator // returns true if left side is less than or equal to right // returns false here $result = ($median &lt;= $mode); print "result is $result&lt;br /&gt;"; // greater-than-or-equal-to operator // returns true if left side is greater than or equal to right // returns true here $result = ($median &gt;= $mode); print "result is $result&lt;br /&gt;"; // equality operator // returns true if left side is equal to right // returns true here $result = ($mean == $mode); print "result is $result&lt;br /&gt;"; // not-equal-to operator // returns true if left side is not equal to right // returns false here $result = ($mean != $mode); print "result is $result&lt;br /&gt;"; // inequality operator // returns true if left side is not equal to right // returns false here $result = ($mean &lt;&gt; $mode); print "result is $result"; ?&gt;&lt;br /&gt;The result of a comparison test is always Boolean: either true (1) or false (0 - which doesn't print anything). This makes comparison operators an indispensable part of your toolkit, as you can use them in combination with a conditional statement to send a script down any of its multiple action paths.&lt;br /&gt;PHP 4.0 also introduced a new comparison operator, which allows you to test both for equality and type: the === operator. The following example demonstrates it:&lt;br /&gt;&lt;?php /* define two variables */$str = '10'; $int = 10; /* returns true, since both variables contain the same value */ $result = ($str == $int); print "result is $result&lt;br /&gt;"; /* returns false, since the variables are not of the same type even though they have the same value */ $result = ($str === $int); print "result is $result&lt;br /&gt;"; /* returns true, since the variables are the same type and value */ $anotherInt = 10; $result = ($anotherInt === $int); print "result is $result"; ?&gt;&lt;br /&gt;Read more about PHP's comparison operators at &lt;a href="http://www.php.net/manual/en/language.operators.comparison.php" target="blank"&gt;http://www.php.net/manual/en/language.operators.comparison.php&lt;/a&gt;. &lt;a name="Heading5"&gt;&lt;/a&gt;&lt;br /&gt;A Question of Logic&lt;br /&gt;In addition to the comparison operators I used so liberally above, PHP also provides four logical operators, which are designed to group conditional expressions together. These four operators - logical AND, logical OR, logical XOR and logical NOT - are illustrated in the following example:&lt;br /&gt;&lt;?php /* define some variables */$auth = 1; $status = 1; $role = 4; /* logical AND returns true if all conditions are true */ // returns true $result = (($auth == 1) &amp;&amp; ($status != 0)); print "result is $result&lt;br /&gt;"; /* logical OR returns true if any condition is true */ // returns true $result = (($status == 1)  ($role &lt;= 2)); print "result is $result&lt;br /&gt;"; /* logical NOT returns true if the condition is false and vice-versa */ // returns false $result = !($status == 1); print "result is $result&lt;br /&gt;"; /* logical XOR returns true if either of two conditions are true, or returns false if both conditions are true */ // returns false $result = (($status == 1) xor ($auth == 1)); print "result is $result&lt;br /&gt;"; ?&gt;&lt;br /&gt;Logical operators play an important role in building conditional statements, as they can be used to link together related conditions simply and elegantly. View more examples of how they can be used at &lt;a href="http://www.php.net/manual/en/language.operators.logical.php" target="blank"&gt;http://www.php.net/manual/en/language.operators.logical.php&lt;/a&gt;. &lt;a name="Heading6"&gt;&lt;/a&gt;&lt;br /&gt;Older But Not Wiser&lt;br /&gt;Now that you've learnt all about comparison and logical operators, I can teach you about conditional statements. As noted earlier, a conditional statement allows you to test whether a specific condition is true or false, and perform different actions on the basis of the result. In PHP, the simplest form of conditional statement is the if() statement, which looks something like this:&lt;br /&gt;if (condition) { do this! }&lt;br /&gt;The argument to if()is a conditional expression, which evaluates to either true or false. If the statement evaluates to true, all PHP code within the curly braces is executed; if it does not, the code within the curly braces is skipped and the lines following the if() construct are executed.&lt;br /&gt;Let me show you how the if() statement works by combining it with a form. In this example, the user is asked to enter his or her age.&lt;br /&gt;&lt;form method="post" action="ageist.php"&gt;Enter your age: &lt;input size="2" name="age"&gt; &lt;/form&gt;&lt;br /&gt;Depending on whether the entered age is above or below 21, a different message is displayed by the ageist.php script:&lt;br /&gt;= 21) { echo 'Come on in, we have alcohol and music awaiting you!'; } if ($age &lt;&gt; &lt;a name="Heading7"&gt;&lt;/a&gt;&lt;br /&gt;If Not This, Then What?&lt;br /&gt;In addition to the if() statement, PHP also offers the if-else construct, used to define a block of code that gets executed when the conditional expression in the if() statement evaluates as false.&lt;br /&gt;The if-else construct looks like this:&lt;br /&gt;if (condition) { do this! } else { do this! }&lt;br /&gt;This construct can be used to great effect in the last example: we can combine the two separate if()statements into a single if-else statement.&lt;br /&gt;= 21) { echo 'Come on in, we have alcohol and music awaiting you!'; } else { echo "You're too young for this club, come back when you're a little older"; } ?&gt; &lt;a name="Heading8"&gt;&lt;/a&gt;&lt;br /&gt;Spreading Confusion&lt;br /&gt;If the thought of confusing people who read your code makes you feel warm and tingly, you're going to love the ternary operator, represented by a question mark (?). This operator, which lets you make your conditional statements almost unintelligible, provides shortcut syntax for creating a single-statement if-else block. So, while you could do this:&lt;br /&gt;10) { $msg = 'Blocking your account...'; } else { $msg = 'Welcome!'; } ?&gt;&lt;br /&gt;You could also do this, which is equivalent (and a lot more fun):&lt;br /&gt;10 ? 'Blocking your account...' : 'Welcome!'; ?&gt;&lt;br /&gt;PHP also lets you "nest" conditional statements inside each other. For example, this is perfectly valid PHP code:&lt;br /&gt;&lt;br /&gt;Another, more elegant way to write the above is with a series of logical operators:&lt;br /&gt;&lt;a name="Heading9"&gt;&lt;/a&gt;&lt;br /&gt;The Daily Special&lt;br /&gt;PHP also provides you with a way of handling multiple possibilities: the if-elseif-else construct. A typical if-elseif-else statement block would look like this:&lt;br /&gt;if (first condition is true) { do this! } elseif (second condition is true) { do this! } elseif (third condition is true) { do this! } ... and so on ... else { do this! }&lt;br /&gt;And here's an example that demonstrates how to use it:&lt;br /&gt;&lt;h2&gt;Today's Special&lt;/h2&gt;&lt;p&gt;&lt;form action="cooking.php" method="get"&gt;&lt;select name="day"&gt; &lt;option value="1"&gt;Monday/Wednesday&lt;option value="2"&gt;Tuesday/Thursday&lt;option value="3"&gt;Friday/Sunday&lt;option value="4"&gt;Saturday&lt;/option&gt;&lt;/select&gt; &lt;input type="submit" value="Send"&gt; &lt;/form&gt;&lt;br /&gt;As you can see, this is simply a form which allows you to pick a day of the week. The real work is done by the PHP script cooking.php:&lt;br /&gt;&lt;?php // get form selection $day = $_GET['day']; // check value and select appropriate item if ($day == 1) {     $special = 'Chicken in oyster sauce';     } elseif ($day == 2) {     $special = 'French onion soup';     } elseif ($day == 3) {     $special = 'Pork chops with mashed potatoes and green salad';     } else {     $special = 'Fish and chips'; } ?&gt;&lt;h2&gt;Today's special is:&lt;/h2&gt;&lt;br /&gt;In this case, I've used the if-elseif-else control structure to assign a different menu special to each combination of days. Note that as soon as one of the if() branches within the block is found to be true, PHP will execute the corresponding code, skip the remaining if() statements in the block, and jump immediately to the lines following the entire if-elseif-else block.&lt;br /&gt;And that's it for now. To view more examples of conditional statements in action, visit &lt;a href="http://www.php.net/manual/en/language.control-structures.php" target="blank"&gt;http://www.php.net/manual/en/language.control-structures.php&lt;/a&gt;. In &lt;a href="http://devzone.zend.com/node/view/id/628"&gt;Part Three&lt;/a&gt;, I'll be bringing you more control structures, more operators and more strange and wacky scripts - so make sure you don't miss it!&lt;br /&gt;Copyright Melonfire, 2004 (&lt;a href="http://www.melonfire.com/" target="_blank"&gt;http://www.melonfire.com/&lt;/a&gt;). All rights reserved.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-7954413734688413224?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/7954413734688413224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=7954413734688413224&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/7954413734688413224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/7954413734688413224'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/php-101-part-2-calling-all-operators.html' title='PHP 101 (part 2): Calling All Operators'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-5566170948641424180</id><published>2007-04-09T01:22:00.000-07:00</published><updated>2007-04-09T01:27:17.407-07:00</updated><title type='text'>PHP 101 (part 1): Down the Rabbit Hole</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_W2DVHM5FSi0/Rhn4TIyptsI/AAAAAAAAARY/YlmIwUr_m8I/s1600-h/vikram1.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5051341464733857474" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://1.bp.blogspot.com/_W2DVHM5FSi0/Rhn4TIyptsI/AAAAAAAAARY/YlmIwUr_m8I/s320/vikram1.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;The Only Acronym You'll Ever Need&lt;br /&gt;If you're new to Web development, you could be forgiven for thinking that it consists of no more than a mass of acronyms, each one more indecipherable than the last. ASP, CGI, SOAP, XML, HTTP - the list seems never-ending, and the sheer volume of information on each of these can discourage the most avid programmer. But before you put on your running shoes and flee, there's a little secret you should know. To put together a cutting-edge Web site, chock full of all the latest bells and whistles, there's only one acronym you really need to know:&lt;br /&gt;PHP&lt;br /&gt;Now, while you have almost certainly heard of PHP, you may not be aware of just how powerful the language is, and how much it can do for you. Today, PHP has the enviable position of being the only open-source server-side scripting language that's both fun and easy to learn. This is not just advertising: recent surveys show that more than 16,000,000 Web sites use PHP as a server side scripting language, and the language also tops the list of most popular Apache modules.&lt;br /&gt;Why, you ask? The short answer: it's powerful, it's easy to use, and it's free. Extremely robust and scalable, PHP can be used for the most demanding of applications, and delivers excellent performance even at high loads. Built-in database support means that you can begin creating data-driven applications immediately, XML support makes it suitable for the new generation of XML-enabled applications, and the extensible architecture makes it easy for developers to use it as a framework to build their own custom modules. Toss in a great manual, a knowledgeable developer community and a really low price (can you spell f-r-e-e?) and you've got the makings of a winner!&lt;br /&gt;My goal in this series of tutorials is very simple: I'll be teaching you the basics of using PHP, and showing you why I think it's the best possible tool for Web application development today. I'll be making no assumptions about your level of knowledge, other than that you can understand basic HTML and have a sense of humor. And before you ask... Yes, this series covers both PHP 4 and PHP 5, with new PHP 5 features flagged for easy reference.&lt;br /&gt;Let's get going! &lt;a name="Heading3"&gt;&lt;/a&gt;&lt;br /&gt;The Right Environment&lt;br /&gt;PHP is typically used in combination with a Web server like Apache. Requests for PHP scripts are received by the Web server, and are handled by the PHP interpreter. The results obtained after execution are returned to the Web server, which takes care of transmitting them to the client browser. Within the PHP script itself, the sky's the limit - your script can perform calculations, process user input, interact with a database, read and write files... Basically, anything you can do with a regular programming language, you can do inside your PHP scripts.&lt;br /&gt;From the above, it is clear that in order to begin using PHP, you need to have a proper development environment set up.&lt;br /&gt;This series will focus on using PHP with the Apache Web server on Linux, but you can just as easily use PHP with Apache on Windows, UNIX and Mac OS. Detailed instructions on how to set up this development environment on each platform are available in the online manual, at &lt;a href="http://www.php.net/manual/en/installation.php" target="blank"&gt;http://www.php.net/manual/en/installation.php&lt;/a&gt; - or you can just download a copy of PHP 5 from &lt;a href="http://www.php.net/" target="blank"&gt;http://www.php.net/&lt;/a&gt; and read the installation instructions.&lt;br /&gt;Go do that now, and come back when you've successfully installed and tested PHP. &lt;a name="Heading4"&gt;&lt;/a&gt;&lt;br /&gt;Start Me Up&lt;br /&gt;There's one essential concept that you need to get your mind around before we proceed further. Unlike CGI scripts, which require you to write code to output HTML, PHP lets you embed PHP code in regular HTML pages, and execute the embedded PHP code when the page is requested.&lt;br /&gt;These embedded PHP commands are enclosed within special start and end tags, like this:&lt;br /&gt;&lt;?php ... PHP code ... ?&gt;&lt;br /&gt;Here's a simple example that demonstrates how PHP and HTML can be combined:&lt;br /&gt;Agent: So who do you think you are, anyhow?&lt;br /&gt;&lt;?php // print output echo 'Neo: I am Neo, but my people call me The One.'; ?&gt;&lt;br /&gt;Not quite your traditional "Hello, World" program... but then again, I always thought tradition was over-rated.&lt;br /&gt;Save the above script to a location under your Web server document root, with a ।php extension, and browse to it. You'll see something like this: Look at the HTML source:&lt;br /&gt;Agent: So who do you think you are, anyhow?&lt;br /&gt;Neo: I am Neo, but my people call me The One.&lt;br /&gt;What just happened? When you requested the script above, Apache intercepted your request and handed it off to PHP. PHP then parsed the script, executing the code between the &lt;?php...?&gt;marks and replacing it with the output of the code run. The result was then handed back to the server and transmitted to the client. Since the output contained valid HTML, the browser was able to render it for display to the user.&lt;br /&gt;A close look at the script will reveal the basic syntactical rules of PHP. Every PHP statement ends in a semi-colon. This convention is identical to that used in Perl, and omitting the semi-colon is one of the most common mistakes newbies make. That said, it is interesting to note that a semi-colon is not needed to terminate the last line of a PHP block. The PHP closing tag includes a semi-colon, therefore the following is perfectly valid PHP code:&lt;br /&gt;&lt;?php // print output echo 'Neo: I am Neo, but my people call me The One.' ?&gt;&lt;br /&gt;It's also possible to add comments to your PHP code, as I've done in the example above. PHP supports both single-line and multi-line comment blocks:&lt;br /&gt;&lt;?php // this is a single-line comment /* and this is a multi-line comment */ ?&gt;&lt;br /&gt;Blank lines within the PHP tags are ignored by the parser. Everything outside the tags is also ignored by the parser, and returned as-is. Only the code between the tags is read and executed. &lt;a name="Heading5"&gt;&lt;/a&gt;&lt;br /&gt;A Case of Identity&lt;br /&gt;Variables are the bread and butter of every programming language... and PHP has them too. A variable can be thought of as a programming construct used to store both numeric and non-numeric data; the contents of a variable can be altered during program execution. Finally, variables can be compared with each other, and you - the programmer - can write code that performs specific actions on the basis of this comparison.&lt;br /&gt;PHP supports a number of different variable types: integers, floating point numbers, strings and arrays. In many languages, it's essential to specify the variable type before using it: for example, a variable may need to be specified as type integer or type array. Give PHP credit for a little intelligence, though: it automagically determines variable type by the context in which it is being used!&lt;br /&gt;Every variable has a name. In PHP, a variable name is preceded by a dollar ($) symbol and must begin with a letter or underscore, optionally followed by more letters, numbers and/or underscores. For example, $popeye, $one and $INCOME are all valid PHP variable names, while $123 and $48hrs are invalid.&lt;br /&gt;Note that variable names in PHP are case sensitive, so $me is different from $Me or $ME.&lt;br /&gt;Here's a simple example that demonstrates PHP's variables:&lt;br /&gt;Agent: So who do you think you are, anyhow?&lt;br /&gt;&lt;?php // define variables $name = 'Neo'; $rank = 'Anomaly'; $serialNumber = 1; // print output echo "Neo: I am &lt;b&gt;$name&lt;/b&gt;, the &lt;b&gt;$rank&lt;/b&gt;. You can call me by my serial number, &lt;b&gt;$serialNumber&lt;/b&gt;."; ?&gt;&lt;br /&gt;Here, the variables $name, $rank and $serialNumber are first defined with string and numeric values, and then substituted in the echo() function call. The echo() function, along with the print() function, is commonly used to print data to the standard output device (here, the browser). Notice that I've included HTML tags within the call to echo(), and those have been rendered by the browser in its output. You can do this too. Really. &lt;a name="Heading6"&gt;&lt;/a&gt;&lt;br /&gt;An Equal Music&lt;br /&gt;To assign a value to a variable, you use the assignment operator: the = symbol. This is used to assign a value (the right side of the equation) to a variable (the left side). The value being assigned need not always be fixed; it could also be another variable, an expression, or even an expression involving other variables, as below:&lt;br /&gt;&lt;?php $age = $dob + 15; ?&gt;&lt;br /&gt;Interestingly, you can also perform more than one assignment at a time. Consider the following example, which assigns three variables the same value simultaneously:&lt;br /&gt;&lt;?php $angle1 = $angle2 = $angle3 = 60; ?&gt;&lt;a name="Heading7"&gt;&lt;/a&gt;&lt;br /&gt;Not My Type&lt;br /&gt;Every language has different types of variable - and PHP is no exception. The language supports a wide variety of data types, including simple numeric, character, string and Boolean types, and more complex arrays and objects. Here's a quick list of the basic ones, with examples:&lt;br /&gt;Boolean: The simplest variable type in PHP, a Boolean variable, simply specifies a true or false value.&lt;br /&gt;&lt;?php $auth = true; ?&gt;&lt;br /&gt;Integer: An integer is a plain-vanilla whole number like 75, -95, 2000 or 1.&lt;br /&gt;&lt;?php $age = 99; ?&gt;&lt;br /&gt;Floating-point: A floating-point number is typically a fractional number such as 12.5 or 3.141592653589. Floating point numbers may be specified using either decimal or scientific notation.&lt;br /&gt;&lt;?php $temperature = 56.89; ?&gt;&lt;br /&gt;String: A string is a sequence of characters, like "hello" or "abracadabra". String values may be enclosed in either double quotes ("") or single quotes(''). (Quotation marks within the string itself can be "escaped" with a backslash (\) character.) String values enclosed in double quotes are automatically parsed for special characters and variable names; if these are found, they are replaced with the appropriate value. Here's an example:&lt;br /&gt;&lt;?php $identity = 'James Bond'; $car = 'BMW'; // this would contain the string "James Bond drives a BMW" $sentence = "$identity drives a $car"; echo $sentence; ?&gt;&lt;br /&gt;To learn more about PHP's data types, visit &lt;a href="http://www.php.net/manual/en/language.types.php" target="blank"&gt;http://www.php.net/manual/en/language.types.php&lt;/a&gt;. &lt;a name="Heading8"&gt;&lt;/a&gt;&lt;br /&gt;Market Value&lt;br /&gt;If variables are the building blocks of a programming language, operators are the glue that let you build something useful with them. You've already seen one example of an operator - the assignment operator -, which lets you assign a value to a variable. Since PHP believes in spoiling you, it also comes with operators for arithmetic, string, comparison and logical operations.&lt;br /&gt;A good way to get familiar with operators is to use them to perform arithmetic operations on variables, as in the following example:&lt;br /&gt;&lt;?php // set quantity $quantity = 1000; // set original and current unit price $origPrice = 100; $currPrice = 25; // calculate difference in price $diffPrice = $currPrice - $origPrice; // calculate percentage change in price $diffPricePercent = (($currPrice - $origPrice) * 100)/$origPrice ?&gt;&lt;table cellspacing="0" cellpadding="5" border="1"&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td&gt;Quantity&lt;/td&gt;&lt;td&gt;Cost price&lt;/td&gt;&lt;td&gt;Current price&lt;/td&gt;&lt;td&gt;Absolute change in price&lt;/td&gt;&lt;td&gt;Percent change in price&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;&lt;?php echo $quantity ?&gt;&lt;/td&gt;&lt;td&gt;&lt;?php echo $origPrice ?&gt;&lt;/td&gt;&lt;td&gt;&lt;?php echo $currPrice ?&gt;&lt;/td&gt;&lt;td&gt;&lt;?php echo $diffPrice ?&gt;&lt;/td&gt;&lt;td&gt;&lt;?php echo $diffPricePercent ?&gt;%&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Looks complex? Don't be afraid - it's actually pretty simple. The meat of the script is at the top, where I've set up variables for the unit cost and the quantity. Next, I've performed a bunch of calculations using PHP's various mathematical operators, and stored the results of those calculations in different variables. The rest of the script is related to the display of the resulting calculations in a neat table.&lt;br /&gt;If you'd like, you can even perform an arithmetic operation simultaneously with an assignment, by using the two operators together. The two code snippets below are equivalent:&lt;br /&gt;&lt;?php // this... $a = 5; $a = $a + 10; // ... is the same as this $a = 5; $a += 10; ?&gt;&lt;br /&gt;If you don't believe me, try echoing them both. &lt;a name="Heading9"&gt;&lt;/a&gt;&lt;br /&gt;Stringing Things Along&lt;br /&gt;Why stop with numbers? PHP also allows you to add strings with the string concatenation operator, represented by a period (.). Take a look:&lt;br /&gt;&lt;?php // set up some string variables $a = 'the'; $b = 'games'; $c = 'begin'; $d = 'now'; // combine them using the concatenation operator // this returns 'the games begin now&lt;br /&gt;' $statement = $a.' '.$b.' '.$c.' '.$d.'&lt;br /&gt;'; print $statement; // and this returns 'begin the games now!' $command = $c.' '.$a.' '.$b.' '.$d.'!'; print $command; ?&gt;&lt;br /&gt;As before, you can concatenate and assign simultaneously, as below:&lt;br /&gt;&lt;?php // define string $str = 'the'; // add and assign $str .= 'n'; // str now contains "then" echo $str; ?&gt;&lt;br /&gt;To learn more about PHP's arithmetic and string operators, visit &lt;a href="http://www.php.net/manual/en/language.operators.arithmetic.php" target="blank"&gt;http://www.php.net/manual/en/language.operators.arithmetic.php&lt;/a&gt; and &lt;a href="http://www.php.net/manual/en/language.operators.string.php" target="blank"&gt;http://www.php.net/manual/en/language.operators.string.php&lt;/a&gt;.&lt;br /&gt;That's about it for this tutorial. You now know all about the basic building blocks and glue of PHP - its variables and operators. In &lt;a href="http://devzone.zend.com/node/view/id/626"&gt;Part Two&lt;/a&gt; of this series, I'll be using these fundamental concepts to demonstrate PHP's powerful form processing capabilities.&lt;br /&gt;Copyright Melonfire, 2004 (&lt;a href="http://www.melonfire.com/" target="blank"&gt;http://www.melonfire.com/&lt;/a&gt;). All rights reserved. &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-5566170948641424180?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/5566170948641424180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=5566170948641424180&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/5566170948641424180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/5566170948641424180'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/php-101-part-1-down-rabbit-hole.html' title='PHP 101 (part 1): Down the Rabbit Hole'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_W2DVHM5FSi0/Rhn4TIyptsI/AAAAAAAAARY/YlmIwUr_m8I/s72-c/vikram1.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-2117872486001799024</id><published>2007-04-08T01:19:00.000-07:00</published><updated>2007-04-08T01:23:06.776-07:00</updated><title type='text'>Introducing Windows Forms</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_W2DVHM5FSi0/RhimSvD569I/AAAAAAAAAQY/r92YfEi5bWU/s1600-h/image013.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5050969822896712658" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_W2DVHM5FSi0/RhimSvD569I/AAAAAAAAAQY/r92YfEi5bWU/s320/image013.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;Designing Windows Application is simpler and less time consuming with Visual Basic 2005. A number of new facilities and enhancements have been made to assist the developer complete the project in time and with lesser number of errors. Windows Form is the cynosure of the Windows Application. Visual studio 2005 packs more features to the already enriched area of Windows Forms, both at design and run time. Among the several features that have been added some standout as prominent. The management of layout of the form is made easier by providing the snap lines that make it easy to align controls with other controls as the layout is formed. A new deployment technology called ClickOnce for forms is added.&lt;br /&gt;Creating a Windows Application&lt;br /&gt;Understanding Classes, Inheritance, and Namespaces&lt;br /&gt;Using The System.Windows.Forms.Form class&lt;br /&gt;Designing a Form using Windows Forms Designer&lt;br /&gt;Exploring the Forms Designer generated code&lt;br /&gt;Using the Application class&lt;br /&gt;Using the MessageBox class&lt;br /&gt;Setting and Adding Properties to a Windows Form&lt;br /&gt;Using the Visual Designer to set Windows Form Properties&lt;br /&gt;Setting Windows Forms Properties programatically&lt;br /&gt;Adding new Property to a Windows Form&lt;br /&gt;Using Visual Inheritance&lt;br /&gt;Event Handling&lt;br /&gt;Handling Events by attaching a delegate&lt;br /&gt;Handling Events by overriding protected method of base class.&lt;br /&gt;Building graphical interface elements&lt;br /&gt;Understanding The Graphics Object&lt;br /&gt;Understanding The Windows Forms Coordinate System&lt;br /&gt;Drawing Text on a Form&lt;br /&gt;Drawing Shapes&lt;br /&gt;Working with images Building graphical interface elements by using the System.Drawing namespace&lt;br /&gt;In this tutorial we will learn about Graphics Object, The Windows Forms Coordinate System, Drawing Text on a Form, Drawing Shapes and Working with इमागेस&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Understanding The Graphics Object&lt;br /&gt;Graphics handling in Visual Basic .NET is based on GDI+ (Graphics Device Interface). A graphics device interface allows you to display graphics on a screen or a printer without having to handle the details of a specific display device. All that you need to do is to make calls to methods supported by the GDI+ classes and those methods make the corresponding calls to individual device drivers as needed to handle the screen or printer.&lt;br /&gt;To create a graphics object&lt;br /&gt;Receive a reference to a graphics object as part of the System.Windows.Forms.PaintEventArgs in the System.Windows.Forms.Control.Paint event of a form or control. This is usually how you obtain a reference to a graphics object when creating painting code for a control.&lt;br /&gt;-or- Call the System.Windows.Forms.Control.CreateGraphics method of a control or form to obtain a reference to a System.Drawing.Graphics object that represents the drawing surface of that control or form. Use this method if you want to draw on a form or control that already exists.&lt;br /&gt;-or- Create a System.Drawing.Graphics object from any object that inherits from System.Drawing.Image. This approach is useful when you want to alter an already existing image.&lt;br /&gt;Let quickly see an example:&lt;br /&gt;&lt;a href="http://www.exforsys.com/images/vbnet/t2_files/SampleCode_2e_1.htm" target="_blank"&gt;Click here for the Sample Code&lt;/a&gt;&lt;br /&gt;You can manage the state of the Graphic Object easily as can be seen in the following code fragment&lt;br /&gt;&lt;a href="http://www.exforsys.com/images/vbnet/t2_files/SampleCode_2e_2.htm" target="_blank"&gt;Click here for the Sample Code&lt;/a&gt;&lt;br /&gt;The above code generates the output as shown below: &lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-2117872486001799024?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/2117872486001799024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=2117872486001799024&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/2117872486001799024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/2117872486001799024'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/introducing-windows-forms.html' title='Introducing Windows Forms'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_W2DVHM5FSi0/RhimSvD569I/AAAAAAAAAQY/r92YfEi5bWU/s72-c/image013.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-717987073685966343</id><published>2007-04-07T09:09:00.000-07:00</published><updated>2007-04-07T09:17:11.868-07:00</updated><title type='text'>Dynamic Pages</title><content type='html'>So what about the dynamic pages? First of all, you start with a HTML page as your first template. If you are satisfied with the layout, just rename the file to .php instead of .html. You are now able to add PHP tags to the page. To keep your project clean and easy to maintain, you can collect all the things you need into one file and put it into functions. You can name this file for example "dynamic.inc.php"&lt;br /&gt;include "dynamic.inc.php";&lt;br /&gt;This will enable you to use the functions that you have defined in "dynamic.inc.php" within your HTML template file. The filename has two extensions, which is common in the Unix and Linux world. The "inc" stands for a file that should be included into another file and therefore will not run on its own. The "php" stands for the PHP script language. It will prevent that the code in the file will be displayed, when anybody accidentally enters this file name into the browser URL. This will protect your intellectual property because the code from a php file is never shown in the browser.&lt;br /&gt;In the dynamic file, we define the following functions:&lt;br /&gt;show_title() will show the header for the HTML File&lt;br /&gt;show_content() will show the main content&lt;br /&gt;show_navigation() will show the navigation&lt;br /&gt;Each function can be called anywhere in the template file by using the PHP tags:&lt;br /&gt;&lt;script language="php"&gt; show_content(); &lt;/script&gt;&lt;br /&gt;Each of these three lines is a valid PHP tag. The first one is commonly used but not supported by all providers. If not supported, you can use the second variation. The third one is something that is very similar to the JavaScript syntax and can be used as well. Because the first method is the shortest, it is very popular and will normally not cause any problems.&lt;br /&gt;Your web pages would not be very dynamic, if you do not have more than one page. Therefore, we will provide the function calls with a parameter. A parameter is something you pass along to the function that you call. It is like telling the function more details on what it should do for you.&lt;br /&gt;Parameters can also be passed with web pages. If you add a question mark after the URL, you can set one or more parameters here. We will use both types of parameters here to navigate between the pages.&lt;br /&gt;Example:&lt;br /&gt;You provide a set of news pages for every month. To call the news for April 2001 you can name the index page like this: "http://www.mydomain.com/index.php?id=april+2001". This will show up the page "index.php" in the browser and it will also pass a parameter "id" with the value "april+2001". The plus sign is a placeholder for a blank because using blanks in a URL can cause some confusion within the script. For that reason, blanks and other special characters are encoded in the URL with special chars like the plus sign. If the plus sign itself is being used in a URL, it is encoded as "%2B".&lt;br /&gt;If your user does not know anything about parameters, he/she will call the page just by using "index.php". For that reason, you may need to set a default for the parameter. In PHP, each URL parameter will be translated into a PHP variable. So your "id" parameter will be available as "$id" within PHP. The function empty($id) will check if this parameter is still empty. If this is the case, the parameter has not been passed in the URL and a default will be set to $id. This default should be the home page and is therefore set to "Home".&lt;br /&gt;And this is your complete template with the PHP tags:&lt;br /&gt;Now you want to know how the functions would work? Okay, let's start with the show_title() function:&lt;br /&gt;function show_title($id)&lt;br /&gt;{&lt;br /&gt;$fp = fopen(get_filename($id), "r");&lt;br /&gt;if (!$fp) return;&lt;br /&gt;$line = trim(fgets($fp, 255));&lt;br /&gt;fclose($fp);&lt;br /&gt;echo $line;&lt;br /&gt;}&lt;br /&gt;The very first line is the function definition of show_title(). It contains the name of the function and the name of the passed parameter. In this case, the name is identical with the name we used to call the function "$id", but this is not necessary when you call a function. You can name the parameters as you like, you only have to make sure that they are placed at the correct position, if a function needs more than one parameter.&lt;br /&gt;The function is then using curly brackets to enclose the function code. Everything between the opening and closing bracket belongs to that function.&lt;br /&gt;The first line in the function is a call to the fopen() function that is defined within PHP. This function will open a file that is to be read or written it on the web server. The first parameter for fopen() is the name of the file. Now we only know the ID-Parameter and we have to build a filename from that. This is done by another function get_filename() that will be explained later. A second parameter will tell fopen() if the file should be opened for reading or writing. We are using the character "r" which tells the function to read the file only.&lt;br /&gt;The function fopen() will return a value (which is called "return value") that is just an ID-number of the opened file. The second line in our function will check if the returned ID-number is a valid file handle. If this is not the case (the exclamation mark indicates the logical operator "not") the function will return without doing anything else.&lt;br /&gt;The next statement will get a line from the opened file with the PHP function fgets(). This function reads a single line from a text file up to a specified length. In this case, we limited the length to 255 characters, because we do not expect a header to be longer than that. The return value from fgets() is not assigned to a variable, it is passed to another function trim() instead. This will strip all leading and trailing white spaces including carriage return characters.&lt;br /&gt;Next, the file will be closed to tell PHP that we don't need the file handle any longer within this function. This is not really necessary if you just want to read from a file but it will save resources on the server. If you forget to close the file, it will remain open until the script ends.&lt;br /&gt;The echo command will then display the line from the file. For the header we only read the first line from the file because we want to put the header line as a separate line in each text file.&lt;br /&gt;To get a valid file name from the ID variable, we use this function:&lt;br /&gt;function get_filename($id)&lt;br /&gt;{&lt;br /&gt;$name = "file_$id.txt";&lt;br /&gt;if (file_exists($name))&lt;br /&gt;{&lt;br /&gt;return $name;&lt;br /&gt;} else {&lt;br /&gt;return "error.txt";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;This will compose a filename from the elements "file_" the ID and ".txt". Please note that the variable "$id" can be included in the string that is provided in double quotation marks. If you use single quotation marks, the expression "$id" would show up as it is and you would get a "file_$id.txt" as result. With double quotation marks the content of $id will be evaluated and put into the string. So if the content of $id is "Home" you will get "file_Home.txt" (please note: uppercase letters are relevant in filenames on webserves).&lt;br /&gt;Then, the function will check if the file exists on the server. The PHP function file_exists() returns true if the file can be found otherwise the result is false. If the file exists, the function returns the composed filename, otherwise it will return "error.txt" which should be the default error text like this:&lt;br /&gt;File not found&lt;br /&gt;&lt;p&gt;The selected file was not found&lt;/p&gt;&lt;br /&gt;If the specified ID is not assigned to a valid file, it will just display this text instead of the normal content. To build your dynamic content, you just need to create several text files with the name "file_{topic}.txt" were {topic} can be anything that is valid for a filename. In this example, the ID will also be displayed in the navigation link, so you may want to use something descriptive.&lt;br /&gt;For example: You want to provide news for April 2001 and you name your ID "april 2001", then you need to have a file with the name "file_april 2001.txt". It is okay to have blanks in the filename as long as the operating system on the web server allows that. As you have learned before, blanks will be replaced by the URL encoding with a plus sign. The content of this file "file_april 2001.txt" could look like this:&lt;br /&gt;News in April 2001&lt;br /&gt;These are the latest news for april 2001&lt;br /&gt;please read on to check these news ...&lt;br /&gt;The first line is used as the header, all other lines are shown in the content of your page. You can use all HTML tags within this text, it will be included as it is stored in the text file.&lt;br /&gt;What about the navigation? You do not want to build your navigation links by hand, do you? So we have a function here to build it from the available files:&lt;br /&gt;function show_navigation($id)&lt;br /&gt;{&lt;br /&gt;global $PHP_SELF, $SCRIPT_NAME;&lt;br /&gt;if (trim($PHP_SELF) == "") $PHP_SELF = $SCRIPT_NAME;&lt;br /&gt;&lt;br /&gt;$dir = opendir('.');&lt;br /&gt;if (!$dir) return;&lt;br /&gt;while ($file = readdir($dir))&lt;br /&gt;{&lt;br /&gt;if ( (ereg("^file_.*\.txt$", $file)) and (is_file($file)) )&lt;br /&gt;{&lt;br /&gt;$item = ereg_replace("^file_(.*)\.txt$", "\\1", $file);&lt;br /&gt;echo '&lt;a id=".urlencode($item)." href="http://www2.blogger.com/"&gt;'.$item."&lt;/a&gt;\n";&lt;br /&gt;if ($id == $item)&lt;br /&gt;{&lt;br /&gt;echo "&lt;=="; } echo " \n"; } } } This function will browse the current directory and display all files that fit the pattern "file_*.txt". The pattern is tested with the PHP function ereg() where you can use a regular expression to test it against the given filename. Explaining regular expressions would be outside the scope of this article, just let me say that "^file_(.*)\.txt$" checks if the name starts with the string "file_" and ends with ".txt". If this is the case, another PHP function ereg_replace() removes everything from the filename except the ID that will be shown in the navigation link. For each filename, a link will be generated to call the script itself ($PHP_SELF contains the name of the actual script) and passes the ID as a parameter. So if you click on one of these links, it will call up the appropriate content. The last function to explain is this: function show_content($id) { $fp = fopen(get_filename($id), "r"); if (!$fp) return; $first = true; while (!feof($fp)) { if ($fp) { $line = fgets($fp, 1024); if ($first) { $first = false; } else { echo $line; } } } fclose($fp); } It is pretty much similar to show_header(), but it reads the whole file line by line until the end. To avoid showing the first line (that contains the header only) there is a variable $first, defined to check if a line has already been read from the file. If this is not the case, this line will not be displayed and $first will be set to false. Conclusion: As you can see, building dynamic web pages is not so difficult with PHP. If you don't understand each detail here, just try it out and learn as you go. Scripting languages like PHP are excellent to start programming because you will get results even with a one-liner. Recommended Books&lt;a href="http://www.amazon.com/exec/obidos/ASIN/1861002963/marianspagesonef" target="_blank"&gt;Professional PHP Programming&lt;/a&gt; - This Book describes all the necessary facts about PHP programming including hands-on examples like a little shop application.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-717987073685966343?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/717987073685966343/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=717987073685966343&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/717987073685966343'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/717987073685966343'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/dynamic-pages.html' title='Dynamic Pages'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-9211578752251060024</id><published>2007-04-07T09:06:00.000-07:00</published><updated>2007-04-07T09:08:25.596-07:00</updated><title type='text'>Building Dynamic Web Pages With PHP</title><content type='html'>By Marian Heddesheimer of &lt;a href="http://www.rent-a-tutor.com/" target="_blank"&gt;Rent A Tutor&lt;/a&gt; Site&lt;br /&gt;This article will explain how to build dynamic web pages with PHP. PHP is a very popular and easy to learn script language. Regardless if you are starting to build your website, or if you are already a pro, just read on to learn more about dynamic web pages and PHP.&lt;br /&gt;Why dynamic web pages?&lt;br /&gt;If you have ever created a web site, you already know that maintaining very many pages is really a lot of work. Even if you never need to change the layout of the pages, you want to present the most current information on it. Sometimes the links will change, or the web pages you have linked to will disappear on the Internet. Then you need to load your page again and make all the necessary changes.&lt;br /&gt;These changes are easy to do if your whole website is very small. With 5-10 pages to maintain, you can do it by hand and page by page. With more than ten pages, it will be more difficult. If you want to have a date on each page, you must check if it is the correct one. Moreover, if you ever want to change something in the layout, you have to do this for all the pages.&lt;br /&gt;So this is the big advantage of dynamic web pages: You just need a single template to start with your layout. All content within that template will be filled in dynamically from a script. If the layout has to be modified, there is no need to change every single page, you just modify the initial template and all pages will look alike.&lt;br /&gt;Why PHP?&lt;br /&gt;To build dynamic web pages, you can use other available techniques: Most providers offer server side includes (SSI) for your pages. This will enable you to build one template and fill in parts of the page from include files. The disadvantage with SSI is: If it comes to more complicated stuff, you want to have more power to decide what will be included in your page and what will not. For example, if you want to show a specific content only after a special date and time has passed, you will need some kind of script. With a script you can decide, that the new content will display only if the system date on the web server is set past Jan. 1st 2002 at midnight.&lt;br /&gt;With scripts, you can almost do everything you like. Some kinds of scripts that are offered by the providers are available on the Internet. You can use CGI/Perl for your scripting. Almost every provider supports Perl on the web server. On the other hand, Perl is not so easy to learn and the scripts are not so easy to install. Nonetheless, there are many Perl scripts available for free or a minimal charge that you can use for your own website without knowing the language.&lt;br /&gt;Another script language is ASP, but it is usually only provided on Windows web servers. In the meantime, there is also an implementation of ASP for Linux servers, but it is not yet very popular. Windows web servers are also not very popular, because they are prone to virus attacks so that even Gartner Group has recommended not to use the Internet Server from Microsoft.&lt;br /&gt;A third language is Cold Fusion, but this is not very common and is not often offered by the providers.&lt;br /&gt;So finally, there is PHP: A free script language, what means that it is available free of charges and free of license fees. It runs perfectly on free operating Systems like Linux and works fine with free web server software like Apache. This is one of the reasons, why most providers offer PHP as script language free with the web space.&lt;br /&gt;PHP works fine with HTML: You just put some extra tags in your web page to indicate that it is not a standard HTML, but a PHP code. To tell the web server that the page may contain these special tags, you have to rename your page from "index.html" to "index.php" for example. The file extension .php indicates a PHP script that can also contain standard HTML code. Therefore, it is very easy to mix your existing HTML template with the new PHP script code.&lt;br /&gt;What is PHP?&lt;br /&gt;PHP was developed by Rasmus Lerdorf in 1994 (see details at &lt;a href="http://www.phpbuilder.com/manual/intro-history.php" target="_blank"&gt;http://www.phpbuilder.com/manual/intro-history.php&lt;/a&gt;). It originally was an interpreter that read one line by another and tried to interpret the written code line by line. Since PHP4, it was improved by the Zend Engine from www.zend.com so that the code is now precompiled. The main advantage is that PHP scripts will now run much faster and the programming is more convenient. Now it is possible to define your functions after using them, which was not doable in PHP3.&lt;br /&gt;PHP was meant as Personal HomePage tool, and this is where the name came from. Later it was renamed to "PHP: Hypertext Preprocessor" which is a reflective acronym because the acronym word "PHP" is contained in the long name. It is meant to be a script language that is easy to use and easy to mix with existing HTML code. Unlike using CGI/perl, there is no need to supply a special directory on the web server like cgi-bin. In most cases, there is no need to change access rights on the files that contain PHP code. The only necessary change to the HTML file is to modify the file extension from .html to .php. Some providers offer the old version PHP3 along with the new PHP4 so you have to use sometimes .php4 or .php3 for your filenames. Nonetheless, the official extension is .php, so you may have to ask your provider if there is something special on your web space.&lt;br /&gt;As mentioned before, PHP is completely free and open source. This means that even the source code for PHP itself is available on the Internet. It is written in C and can be modified when necessary. Many developers are still working on the code, releasing new versions from time to time.&lt;br /&gt;How to Start?&lt;br /&gt;Got excited about PHP yet? So you want to know where to start? The initial start is quite easy: You should first check out if PHP is available with your web space and which version it is. It is really easy to do this. Just create a simple text file that contains theses commands:&lt;br /&gt;&lt;? phpinfo(); ?&gt;&lt;br /&gt;Save this file as "info.php" and upload it to your web space. Then call it in your favorite browser by entering the appropriate URL like "www.mydomain.com/info.php".&lt;br /&gt;You will get a page with lots of information or you will just see your command in the browser. If you just see the single line, either your provider does not support PHP or they are using other file extensions. Then try to rename your file to "info.php4", "info.php3" or "info.phtml". These are the most common extensions used instead of the official .php extension.&lt;br /&gt;If you got the whole PHP information page, you will see the version of PHP, all the settings and server variables that are available for PHP and within your own scripts. It is a good idea to print this information for later reference.&lt;br /&gt;Before you can build dynamic web pages, you should acquire a basic understanding about the language. If you already know any programming language like C, C++, VisualBasic or Java, you may find it very easy to switch to PHP. The language is pretty much like C++ and Java so that you can migrate from these languages. But even if you just have some knowledge in VisualBasic, you know what a variable and a function is, so it is not difficult to learn PHP. If you don't know anything about programming, PHP is a great tool in order to learn your first programming language for web programming.&lt;br /&gt;To build your first program, you can use a simple text editor, even if it is not very comfortable. If you write more than ten lines of code, you might want a more convenient tool that can show you the correct spelling of the keywords. This feature is also known as "syntax highlighting" and there are some tools available for free. A list of these editors is available at: &lt;a href="http://www.itworks.demon.co.uk/phpeditors.htm" target="_blank"&gt;http://www.itworks.demon.co.uk/phpeditors.htm&lt;/a&gt;.&lt;br /&gt;Another list with editors for PHP can be found at: &lt;a href="http://php.weblogs.com/editors" target="_blank"&gt;http://php.weblogs.com/editors&lt;/a&gt;.&lt;br /&gt;The next step will be to learn the specific language and create a first project. A good reference is the official php web site at &lt;a href="http://www.php.net/" target="_blank"&gt;http://www.php.net&lt;/a&gt;. Another good source for information is &lt;a href="http://www.phpbuilder.com/" target="_blank"&gt;http://www.phpbuilder.com&lt;/a&gt;, where you can find articles on common PHP solutions and a forum with solutions to various questions on PHP. You will also find a variety of tutorials on PHP and there are several newsgroups related to PHP programming. At least, there are some online classes available for PHP like the one that I offer at &lt;a href="http://www.rent-a-tutor.com/courses/index.php" target="_blank"&gt;http://www.rent-a-tutor.com/courses/index.php&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-9211578752251060024?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/9211578752251060024/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=9211578752251060024&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/9211578752251060024'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/9211578752251060024'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/building-dynamic-web-pages-with-php.html' title='Building Dynamic Web Pages With PHP'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-2470912377046562106</id><published>2007-04-07T05:53:00.000-07:00</published><updated>2007-04-07T05:56:34.877-07:00</updated><title type='text'>VB.NET 2005 Training : The .NET Framework Architecture Part 1</title><content type='html'>This is the first tutorial as part of the Visual Basic .NET 2005 Training.  In this tutorials we will be learning about the basics of The .NET Framework Architecture,  The .NET vision, Common Language Runtime (CLR), .NET Framework Class Library and Microsoft Intermediate Language (MSIL).  It's very important to learn the basics before we actually start with the Programming.&lt;br /&gt;The .NET Vision&lt;br /&gt;&lt;br /&gt;The .NET framework is a software technology that is directed towards connecting information, people, systems and devices seamlessly. The high level of software integration that has been attempted through use of XML web services enables the creation of small, discrete, building block types of applications. These applications are connected to other applications over the Internet.&lt;br /&gt;Central to the .NET framework architecture is the effort to provide support to for the next generation solutions. The direction of change is to ensure that software deployment and versioning conflicts are avoided or minimized in the .NET Framework. User defined codes are released from the confines of the local storage systems and can be stored anywhere on a network and executed from any point in the network. Performance problems associated with scripted and interpreted environments are removed. Codes can be safely executed and the developer experience is consistent across widely varying types of applications, such as Windows based applications and web based applications. The thrust of design is towards creating a standard communication facility that is standardized so that .NET codes can be integrated with other codes easily and seamlessly.&lt;br /&gt;At the core of the .NET infrastructure is the Common Language Runtime (CLR) and the .NET Framework class library.&lt;br /&gt;The runtime functions, like an agent, managing code at execution time. It provides core services such as memory management, thread management and ‘remoting’. It enforces strict type safety and ensures code accuracy. This makes for security and robustness and provides a platform for running managed code.&lt;br /&gt;The .NET Framework provides several runtime hosts. It also supports the development of third-party runtime hosts. For example, ASP.NET hosts the runtime to provide a scalable, server-side environment for managed code. ASP.NET works directly with the runtime to enable ASP.NET applications and XML Web services.&lt;br /&gt;The .NET Framework can be hosted by unmanaged components such as the Internet Explorer. These load the common language runtime into their processes and initiate the execution of managed code. This creates a software environment that can exploit both managed and unmanaged features. This makes for mobility of the code.&lt;br /&gt;Common Language Runtime (CLR)&lt;br /&gt;The common language runtime (CLR) is the foundation upon which developers construct various kinds of applications. The benefits of the CLR are many. It makes for a vastly simplified development. It enables a seamless integration of code written in different languages. It provides evidence-based security with code identity. The assembly based deployment eliminates the problems of DLL. The versioning of reusable components makes for ease of usage. The implementation inheritance feature enables the reuse of code. The automatic object lifetime management makes the application- development comfortable. The self descriptive nature of objects makes for ease of programming and debugging.&lt;br /&gt;&lt;br /&gt;CLR includes both private and shared components. It provides for incremental download of code and caching; native platform interoperability and seamless integration with COM. It offers dynamic inspection capabilities, administration and configuration options. The developer is not required to know all the runtime supported infrastructure. The tools and frameworks are designed to expose a subset of the functionality in accordance with the kind of application being built.&lt;br /&gt;The common language runtime is a virtual execution system that provides important services such as memory management, security and also has a Just-in-Time compiler (JIT) which converts the intermediate language (IL) into native code that can be executed by the physical machine. The infrastructure provides a machine independent environment for application execution.&lt;br /&gt;VB.NET 2005 Free Training : The .NET Framework Architecture Part 2.  In this tutorial of The .NET Framework Architecture Part 2 we will learn about Just-In-Time (JIT) compilation, Assemblies, native assemblies, Global Assembly Cache (GAC) and Comparison of VB.NET, C#, and J#.&lt;br /&gt;Just-In-Time (JIT) compilation&lt;br /&gt;As stated above, the Just in time compiler is a facility that is invoked by the CLR to convert the IL into machine code. The .NET framework assemblies (*.dll or *.exe) files cannot be executed by the target processor unless it is converted into native code. When the Assembly is loaded the method calls are invoked for compilation into native code. Since this is done just when the method needs to execute, it is called Just in time compilation. When the JIT is invoked for the first time there is an overhead or performance penalty, since the assembly is converted into its Native code or image using the Native Image Generator (Ngen.exe). All subsequent calls will load faster as the Native image alone is invoked thereafter from the Native image cache.&lt;br /&gt;Significantly, the IL can coexist with the machine code in the application. This feature also enables the developer modify the code or add to the code even when the application is actively deployed. This functionality provided by JIT makes the .NET framework an efficient, agile and powerful means of application development.&lt;br /&gt;Assemblies, native assemblies, and the Global Assembly Cache (GAC)&lt;br /&gt;The primary unit of deployment is the assembly. The assembly is used by the .NET CLR as the smallest unit of deployment; version control; security; type grouping and code reuse. An assembly will consist of a manifest and one or more modules or files. It can be defined as a logical DLL that contains a manifest, type metadata, MSIL and resources. Assemblies can be application private or shared. Private assemblies are restricted to use in a single application whereas shared assemblies can be used across applications. Private applications also reside within the application folder while shared assemblies reside in the common area-- GAC(Global Assembly Cache). They must have a globally unique name.&lt;br /&gt;The existence of the manifest within the assembly makes it self descriptive. It can be viewed by the IL Disassembler (Ildasm.exe) which is part of the .NET framework SDK.&lt;br /&gt;The assembly is identified by the manifest. It defines security requirements, lists other interdependent assemblies and all the types and resources exposed by the assembly. Localized resources exposed by assemblies and targeted by the application contain a default culture (language, currency, date/time format etc).&lt;br /&gt;The manifest contains several sections. Identity, Referenced Assemblies, file list and Custom Attributes are some of the important sections of the manifest. The Identity section as the name suggests, identifies the assembly. It contains a .assembly directive. The version directive specifies the version of the assembly, so that the CLR identifies the different versions of an application. The Identity section contains a strong name for shared assemblies and a public/private encryption key is used to distinguish between assemblies of the same name. The Identity section also optionally contains the Culture which defines the country and language of the assembly target. The .locale directive is used for this purpose and the Culture-Neutral assemblies can be used by any assembly. The Referenced Assemblies section of the manifest provides a reference to all the assemblies used in an application.&lt;br /&gt;Comparison of VB.NET, C#, and J#&lt;br /&gt;&lt;br /&gt;The .NET framework architecture has made the language of coding immaterial to the final output. All languages also have equal access to all development capabilities and revolve around the .NET classes. The language syntax, operations etc look similar in all the languages of this group. Moreover, code can be shared by all .NET languages and so a class made in C# or J# can be used in VB.NET and vice versa.&lt;br /&gt;In this context choice of language is no longer significant. Finally, all languages are transformed by the compiler into Microsoft Intermediate language. It is the programmer’s familiarity with the language that makes it material whether he is coding in VB.NET or C# or J#. However, the option settings in the compiler will have to be set to the language of coding before the compiler is used.&lt;br /&gt;The speed of performance of the compiler will also vary with the language being compiled. For instance C# compiles faster than VB.NET. Subject to the above observation, the features of the languages will be dicussed in the next tutorial.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-2470912377046562106?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/2470912377046562106/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=2470912377046562106&amp;isPopup=true' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/2470912377046562106'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/2470912377046562106'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/vbnet-2005-training-net-framework.html' title='VB.NET 2005 Training : The .NET Framework Architecture Part 1'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-4560483712551487465</id><published>2007-04-06T22:10:00.000-07:00</published><updated>2007-04-06T22:11:41.961-07:00</updated><title type='text'>How To Make Money Online With Top Paying Keywords</title><content type='html'>Author: Uche Okoroha&lt;br /&gt;The majority of people making successful income on the internet make a large part of it with Google Adsense. By learning the secrets to adsense and how to make up to $100 per click, you too can establish comfortable revenue through the internet.&lt;br /&gt;Many have scoured the internet for fast and easy ways to make money online. Most of the time this search leads to one company – Google. There are immense amounts of money to be made through Google Adsense using top paying keywords. What are top paying keywords, you ask? Top paying keywords are those that will return anywhere from a couple of dollars to one hundred dollars PER CLICK! Using these keywords on your Adsense site will allow you to maximize your profits online. In the following, I will outline from beginning to end how to make money online with top paying keywords.Firstly, you are going to want a website. If you don't have a website, or don't have to money to purchase one – don't worry, you can still make money with top paying keywords by going to a blog site and registering for a free blog. My two favorite blog sites are wordpress.com and blogspot.com. These blog sites will help you make money online with top paying keywords by allowing you to post your content on their website for free. They will even give you your own unique web address on their server. For example – my wordpress username is 'onlinemarketingteam'. This means that the location of my blog would be onlinemarketingteam.wordpress.com – this is the url that others can use to visit your website.Once you have your blog, think of what you want the focus of the blog to be. Sticking with what you know and love will make it easier to make money with top paying keywords. You want to make sure you know plenty about the subject you are writing your blog about. When you know what your blog is going to be about, try to think of a couple of different topics of articles you can write that will help others out. At this stage you might want to do a little research online or at your local library to gather more information on your topic.Now, take the first topic you want to write your article about and think of what keywords you want to use. It is important that you always do a full keyword analysis to make sure that you optimize your articles with top paying keywords. Try to think of what words YOU would type into a search engine to find your own blog. Once you have this list, you can run it through software that will help you find top paying keywords for your topic.My favorite top paying keywords software is Keyword Elite. This software will recognize your topic, and give you the most profitable keywords to use on your website. Once you have these top paying keywords, pick one or two and use them in the articles you write. For example – if the topic of my blog was airplanes. I would type 'airplanes' into the software, and it would tell me that advertisers pay a lot of money for the term 'private jets' . I would then write an article using the top paying keywords to put on my blog.When I put Adsense ads on the blog it will go through and gain the general idea of the content. It will then display ads from advertisers paying for the term 'private jets'. Each time a visitor clicks on one of these ads, I would get payed several dollars. To increase your income you could do research on additional categories and find top paying keywords for those subjects. Then, repeat the process by writing a different blog on that subject and optimizing your content with those top paying keywords.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-4560483712551487465?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/4560483712551487465/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=4560483712551487465&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/4560483712551487465'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/4560483712551487465'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/how-to-make-money-online-with-top.html' title='How To Make Money Online With Top Paying Keywords'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-908331478794804745</id><published>2007-04-05T09:47:00.000-07:00</published><updated>2007-04-05T09:49:33.508-07:00</updated><title type='text'>Microsoft Visual Studio</title><content type='html'>&lt;a href="http://2.bp.blogspot.com/_W2DVHM5FSi0/RhUoafD56nI/AAAAAAAAANo/bmsbbpBiAEY/s1600-h/250px-Vs2005_screenshot.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5049986992645466738" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://2.bp.blogspot.com/_W2DVHM5FSi0/RhUoafD56nI/AAAAAAAAANo/bmsbbpBiAEY/s320/250px-Vs2005_screenshot.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;Microsoft Visual Studio is &lt;a title="Microsoft" href="http://en.wikipedia.org/wiki/Microsoft"&gt;Microsoft&lt;/a&gt;'s flagship software development product for computer programmers. It centers on an &lt;a title="Integrated development environment" href="http://en.wikipedia.org/wiki/Integrated_development_environment"&gt;integrated development environment&lt;/a&gt; which lets programmers create &lt;a title="Computer programs" href="http://en.wikipedia.org/wiki/Computer_programs"&gt;standalone applications&lt;/a&gt;, &lt;a title="Web site" href="http://en.wikipedia.org/wiki/Web_site"&gt;web sites&lt;/a&gt;, &lt;a title="Web application" href="http://en.wikipedia.org/wiki/Web_application"&gt;web applications&lt;/a&gt;, and &lt;a title="Web service" href="http://en.wikipedia.org/wiki/Web_service"&gt;web services&lt;/a&gt; that run on any &lt;a title="Platform (computing)" href="http://en.wikipedia.org/wiki/Platform_%28computing%29"&gt;platforms&lt;/a&gt; supported by Microsoft's &lt;a title=".NET Framework" href="http://en.wikipedia.org/wiki/.NET_Framework"&gt;.NET Framework&lt;/a&gt; (for all versions after 6). Supported platforms include &lt;a title="Microsoft Windows" href="http://en.wikipedia.org/wiki/Microsoft_Windows"&gt;Microsoft Windows&lt;/a&gt; &lt;a title="Servers" href="http://en.wikipedia.org/wiki/Servers"&gt;servers&lt;/a&gt; and &lt;a title="Workstations" href="http://en.wikipedia.org/wiki/Workstations"&gt;workstations&lt;/a&gt;, &lt;a title="PocketPC" href="http://en.wikipedia.org/wiki/PocketPC"&gt;PocketPC&lt;/a&gt;, &lt;a title="Smartphone" href="http://en.wikipedia.org/wiki/Smartphone"&gt;Smartphones&lt;/a&gt;, and &lt;a title="World Wide Web" href="http://en.wikipedia.org/wiki/World_Wide_Web"&gt;World Wide Web&lt;/a&gt; &lt;a title="Web browsers" href="http://en.wikipedia.org/wiki/Web_browsers"&gt;browsers&lt;/a&gt;.&lt;br /&gt;Visual Studio includes the following:&lt;br /&gt;&lt;a title="Visual Basic .NET" href="http://en.wikipedia.org/wiki/Visual_Basic_.NET"&gt;Visual Basic&lt;/a&gt;&lt;br /&gt;&lt;a title="Visual C++" href="http://en.wikipedia.org/wiki/Visual_C%2B%2B"&gt;Visual C++&lt;/a&gt;&lt;br /&gt;&lt;a title="Microsoft Visual C Sharp" href="http://en.wikipedia.org/wiki/Microsoft_Visual_C_Sharp"&gt;Visual C#&lt;/a&gt;&lt;br /&gt;&lt;a title="J Sharp" href="http://en.wikipedia.org/wiki/J_Sharp"&gt;Visual J#&lt;/a&gt;&lt;br /&gt;&lt;a title="ASP.net" href="http://en.wikipedia.org/wiki/ASP.net"&gt;Visual Web Developer&lt;/a&gt;&lt;br /&gt;Some versions include a developer edition of &lt;a title="Microsoft SQL Server" href="http://en.wikipedia.org/wiki/Microsoft_SQL_Server"&gt;Microsoft SQL Server&lt;/a&gt;.&lt;br /&gt;In the past, the following products were included:&lt;br /&gt;&lt;a title="Visual InterDev" href="http://en.wikipedia.org/wiki/Visual_InterDev"&gt;Visual InterDev&lt;/a&gt;, a web page development application used for modifying &lt;a title="Active Server Pages" href="http://en.wikipedia.org/wiki/Active_Server_Pages"&gt;Active Server Pages&lt;/a&gt; as well as HTML and other web scripting files.&lt;br /&gt;&lt;a title="J Plus Plus" href="http://en.wikipedia.org/wiki/J_Plus_Plus"&gt;Visual J++&lt;/a&gt;, a &lt;a title="Java (programming language)" href="http://en.wikipedia.org/wiki/Java_%28programming_language%29"&gt;Java&lt;/a&gt; development tool.&lt;br /&gt;&lt;a title="Visual FoxPro" href="http://en.wikipedia.org/wiki/Visual_FoxPro"&gt;Visual FoxPro&lt;/a&gt;, an &lt;a title="XBase" href="http://en.wikipedia.org/wiki/XBase"&gt;xBase&lt;/a&gt; programming language now allied to but independent from the Visual Studio platform.&lt;br /&gt;Contents[&lt;a class="internal" id="togglelink" href="javascript:toggleToc()"&gt;hide&lt;/a&gt;]&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#History"&gt;1 History&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Visual_Studio_97"&gt;1.1 Visual Studio 97&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Visual_Studio_6.0"&gt;1.2 Visual Studio 6.0&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Visual_Studio_.NET_.282002.29"&gt;1.3 Visual Studio .NET (2002)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Visual_Studio_.NET_2003"&gt;1.4 Visual Studio .NET 2003&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Visual_Studio_2005"&gt;1.5 Visual Studio 2005&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Visual_Studio_Tools_for_Applications"&gt;2 Visual Studio Tools for Applications&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Future_development"&gt;3 Future development&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Extensibility"&gt;4 Extensibility&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#Deployment"&gt;5 Deployment&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#See_also"&gt;6 See also&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#References"&gt;7 References&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio#External_links"&gt;8 External links&lt;/a&gt;&lt;br /&gt;//&lt;br /&gt;&lt;a id="History" name="History"&gt;&lt;/a&gt;&lt;br /&gt;[&lt;a title="Edit section: History" href="http://en.wikipedia.org/w/index.php?title=Microsoft_Visual_Studio&amp;action=edit&amp;amp;section=1"&gt;edit&lt;/a&gt;] History&lt;br /&gt;&lt;a id="Visual_Studio_97" name="Visual_Studio_97"&gt;&lt;/a&gt;&lt;br /&gt;[&lt;a title="Edit section: Visual Studio 97" href="http://en.wikipedia.org/w/index.php?title=Microsoft_Visual_Studio&amp;action=edit&amp;amp;section=2"&gt;edit&lt;/a&gt;] Visual Studio 97&lt;br /&gt;Microsoft first released Visual Studio in 1997, bundling together many of its programming tools for the first time. Visual Studio 97 was released in two editions, Professional and Enterprise. It included Visual Basic 5.0 and Visual C++ 5.0, primarily for Windows programming; Visual J++ 1.1 for Java and Windows programming; and Visual FoxPro 5.0 for xBase programming. It introduced Visual InterDev for creating dynamically generated web sites using Active Server Pages. A snapshot of the &lt;a title="Microsoft Developer Network" href="http://en.wikipedia.org/wiki/Microsoft_Developer_Network"&gt;Microsoft Developer Network&lt;/a&gt; library was also included.&lt;br /&gt;Visual Studio 97 was Microsoft's first attempt at using the same development environment for multiple languages. Visual C++, Visual J++, InterDev, and the MSDN Library all used one environment, called Developer Studio. Visual Basic and Visual FoxPro used separate environments.&lt;br /&gt;&lt;a id="Visual_Studio_6.0" name="Visual_Studio_6.0"&gt;&lt;/a&gt;&lt;br /&gt;[&lt;a title="Edit section: Visual Studio 6.0" href="http://en.wikipedia.org/w/index.php?title=Microsoft_Visual_Studio&amp;action=edit&amp;amp;section=3"&gt;edit&lt;/a&gt;] Visual Studio 6.0&lt;br /&gt;The next version, version 6.0, was released in 1998. The version numbers of all of its constituent parts also moved to 6.0, including Visual J++ which jumped from 1.1, and Visual InterDev which was at 1.0. This version was the basis of Microsoft's development system for the next four years, as Microsoft transitioned their development focus to the &lt;a title=".NET Framework" href="http://en.wikipedia.org/wiki/.NET_Framework"&gt;.NET Framework&lt;/a&gt;.&lt;br /&gt;Visual Studio 6.0 was the last version to include Visual Basic as most of its programmers knew it; subsequent versions would include a quite different version of the language based on .NET. It was also the last version to include Visual J++, which included deeper ties to Windows and proprietary extensions to the Java language that were incompatible with Sun's version. This caused Sun to sue Microsoft. As part of the settlement, Microsoft would no longer sell programming tools that targeted the Java Virtual Machine.&lt;br /&gt;Although Microsoft's long-term goal was to unify its tools under one environment, this version actually had one more environment than VS 97. Visual J++ and Visual InterDev broke away from the Visual C++ environment, while Visual Basic and Visual FoxPro maintained their separate tools.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-908331478794804745?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/908331478794804745/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=908331478794804745&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/908331478794804745'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/908331478794804745'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/microsoft-visual-studio.html' title='Microsoft Visual Studio'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_W2DVHM5FSi0/RhUoafD56nI/AAAAAAAAANo/bmsbbpBiAEY/s72-c/250px-Vs2005_screenshot.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-7135144867248236968</id><published>2007-04-05T09:32:00.000-07:00</published><updated>2007-04-05T09:43:15.649-07:00</updated><title type='text'>Visual Basic .NET</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_W2DVHM5FSi0/RhUlwvD56mI/AAAAAAAAANg/ZwfpUssl3LI/s1600-h/200px-Vb_dot_net.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5049984076362672738" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://3.bp.blogspot.com/_W2DVHM5FSi0/RhUlwvD56mI/AAAAAAAAANg/ZwfpUssl3LI/s320/200px-Vb_dot_net.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;Visual Basic .NET (VB.NET) is an &lt;a title="Object-oriented programming" href="http://en.wikipedia.org/wiki/Object-oriented_programming"&gt;object-oriented&lt;/a&gt; &lt;a title="Computer language" href="http://en.wikipedia.org/wiki/Computer_language"&gt;computer language&lt;/a&gt; that can be viewed as an evolution of &lt;a title="Microsoft" href="http://en.wikipedia.org/wiki/Microsoft"&gt;Microsoft's&lt;/a&gt; &lt;a title="Visual Basic" href="http://en.wikipedia.org/wiki/Visual_Basic"&gt;Visual Basic&lt;/a&gt; (VB) implemented on the &lt;a title=".NET Framework" href="http://en.wikipedia.org/wiki/.NET_Framework"&gt;Microsoft .NET framework&lt;/a&gt;. Its introduction has been controversial, as significant changes were made that broke &lt;a title="Backward compatibility" href="http://en.wikipedia.org/wiki/Backward_compatibility"&gt;backward compatibility&lt;/a&gt; with VB and caused a rift within the developer community.&lt;br /&gt;The great majority of VB.NET developers use &lt;a title="Microsoft Visual Studio" href="http://en.wikipedia.org/wiki/Microsoft_Visual_Studio"&gt;Visual Studio .NET&lt;/a&gt; as their &lt;a title="Integrated development environment" href="http://en.wikipedia.org/wiki/Integrated_development_environment"&gt;integrated development environment&lt;/a&gt; (IDE). &lt;a title="SharpDevelop" href="http://en.wikipedia.org/wiki/SharpDevelop"&gt;SharpDevelop&lt;/a&gt; provides an &lt;a title="Open source" href="http://en.wikipedia.org/wiki/Open_source"&gt;open-source&lt;/a&gt; alternative IDE.&lt;br /&gt;Like all .NET languages, programs written in VB.NET require the .NET framework to execute.&lt;br /&gt;Contents[&lt;a class="internal" id="togglelink" href="javascript:toggleToc()"&gt;hide&lt;/a&gt;]&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#Versions_of_Visual_Basic_.NET"&gt;1 Versions of Visual Basic .NET&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#Visual_Basic_.NET"&gt;1.1 Visual Basic .NET&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#Visual_Basic_.NET_2003"&gt;1.2 Visual Basic .NET 2003&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#Visual_Basic_2005"&gt;1.3 Visual Basic 2005&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#IsNot_Patent"&gt;1.3.1 IsNot Patent&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#Visual_Basic_2005_Express"&gt;1.3.2 Visual Basic 2005 Express&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#Relation_to_Visual_Basic"&gt;2 Relation to Visual Basic&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#Comparative_samples"&gt;2.1 Comparative samples&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#Controversy"&gt;2.2 Controversy&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#Cross-platform_and_open-source_development"&gt;3 Cross-platform and open-source development&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#Hello_World_Example"&gt;4 Hello World Example&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#See_also"&gt;5 See also&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#Notes"&gt;6 Notes&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#External_links"&gt;7 External links&lt;/a&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#Tutorials"&gt;7.1 Tutorials&lt;/a&gt;&lt;br /&gt;//&lt;br /&gt;&lt;a id="Versions_of_Visual_Basic_.NET" name="Versions_of_Visual_Basic_.NET"&gt;&lt;/a&gt;&lt;br /&gt;[&lt;a title="Edit section: Versions of Visual Basic .NET" href="http://en.wikipedia.org/w/index.php?title=Visual_Basic_.NET&amp;action=edit&amp;amp;section=1"&gt;edit&lt;/a&gt;] Versions of Visual Basic .NET&lt;br /&gt;As of November 2006 there are three versions of Visual Basic .NET.&lt;br /&gt;&lt;a id="Visual_Basic_.NET" name="Visual_Basic_.NET"&gt;&lt;/a&gt;&lt;br /&gt;[&lt;a title="Edit section: Visual Basic .NET" href="http://en.wikipedia.org/w/index.php?title=Visual_Basic_.NET&amp;action=edit&amp;amp;section=2"&gt;edit&lt;/a&gt;] Visual Basic .NET&lt;br /&gt;The original Visual Basic .NET was released alongside &lt;a title="C sharp" href="http://en.wikipedia.org/wiki/C_sharp"&gt;Visual C#&lt;/a&gt; and &lt;a title="ASP.NET" href="http://en.wikipedia.org/wiki/ASP.NET"&gt;ASP.NET&lt;/a&gt; in 2002. &lt;a title="C sharp" href="http://en.wikipedia.org/wiki/C_sharp"&gt;C#&lt;/a&gt; — widely touted as Microsoft's answer to &lt;a title="Java platform" href="http://en.wikipedia.org/wiki/Java_platform"&gt;Java&lt;/a&gt; — received the lion's share of media attention, while VB.NET (sometimes known as VB7) was not widely covered. As a result, few outside the Visual Basic community paid much attention to it.&lt;a title="Wikipedia:Citing sources" href="http://en.wikipedia.org/wiki/Wikipedia:Citing_sources"&gt;[citation needed]&lt;/a&gt;&lt;br /&gt;Those who did try the first version found a powerful but very different language under the hood, with disadvantages in some areas, including a runtime that was ten times as large to package as the VB6 runtime and an increased memory footprint.&lt;a title="Wikipedia:Citing sources" href="http://en.wikipedia.org/wiki/Wikipedia:Citing_sources"&gt;[citation needed]&lt;/a&gt;&lt;br /&gt;&lt;a id="Visual_Basic_.NET_2003" name="Visual_Basic_.NET_2003"&gt;&lt;/a&gt;&lt;br /&gt;[&lt;a title="Edit section: Visual Basic .NET 2003" href="http://en.wikipedia.org/w/index.php?title=Visual_Basic_.NET&amp;action=edit&amp;amp;section=3"&gt;edit&lt;/a&gt;] Visual Basic .NET 2003&lt;br /&gt;Visual Basic .NET 2003 was released with version 1.1 of the .NET Framework. &lt;a class="external text" title="http://msdn.microsoft.com/vstudio/productinfo/overview/whatsnew.aspx" href="http://msdn.microsoft.com/vstudio/productinfo/overview/whatsnew.aspx" rel="nofollow"&gt;New features&lt;/a&gt; included support for the &lt;a title=".NET Compact Framework" href="http://en.wikipedia.org/wiki/.NET_Compact_Framework"&gt;.NET Compact Framework&lt;/a&gt; and a better VB upgrade &lt;a title="Wizard (software)" href="http://en.wikipedia.org/wiki/Wizard_%28software%29"&gt;wizard&lt;/a&gt;. Improvements were also made to the performance and reliability of the .NET IDE (particularly the &lt;a class="external text" title="http://msdn.microsoft.com/msdnmag/issues/05/06/AdvancedBasics/default.aspx" href="http://msdn.microsoft.com/msdnmag/issues/05/06/AdvancedBasics/default.aspx" rel="nofollow"&gt;background compiler&lt;/a&gt;) and runtime.&lt;br /&gt;In addition, Visual Basic .NET 2003 was also available in the Visual Studio .NET 2003 Academic Edition (VS03AE). VS03AE is distributed to a certain number of scholars from each country for free.&lt;br /&gt;&lt;a id="Visual_Basic_2005" name="Visual_Basic_2005"&gt;&lt;/a&gt;&lt;br /&gt;[&lt;a title="Edit section: Visual Basic 2005" href="http://en.wikipedia.org/w/index.php?title=Visual_Basic_.NET&amp;action=edit&amp;amp;section=4"&gt;edit&lt;/a&gt;] Visual Basic 2005&lt;br /&gt;Visual Basic 2005 is the next iteration of Visual Basic .NET, Microsoft having decided to drop the .NET portion of the title.&lt;br /&gt;For this release, Microsoft added many features, including:&lt;br /&gt;Edit and Continue - probably the biggest "missing feature" from Visual Basic, allowing the modification of code and immediate resumption of execution&lt;br /&gt;Design-time expression evaluation&lt;br /&gt;The My pseudo-&lt;a title="Namespace (computer science)" href="http://en.wikipedia.org/wiki/Namespace_%28computer_science%29"&gt;namespace&lt;/a&gt; (&lt;a class="external text" title="http://msdn.microsoft.com/vbasic/default.aspx?pull=" href="http://msdn.microsoft.com/vbasic/default.aspx?pull=msdnmag/issues/06/00/VisualBasic2005/default.aspx" rel="nofollow"&gt;overview&lt;/a&gt;, &lt;a class="external text" title="http://msdn.microsoft.com/vbasic/default.aspx?pull=" href="http://msdn.microsoft.com/vbasic/default.aspx?pull=library/en-us/dnvs05/html/vbmy.asp" rel="nofollow"&gt;details&lt;/a&gt;), which provides:&lt;br /&gt;easy access to certain areas of the .NET Framework that otherwise require significant code to access&lt;br /&gt;dynamically-generated classes (notably My.Forms)&lt;br /&gt;Improvements to the VB-to-VB.NET converter &lt;a title="" href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#_note-1"&gt;[2]&lt;/a&gt;&lt;br /&gt;The Using keyword, simplifying the use of objects that require the Dispose &lt;a title="Design pattern (computer science)" href="http://en.wikipedia.org/wiki/Design_pattern_%28computer_science%29"&gt;pattern&lt;/a&gt; to free resources&lt;br /&gt;Just My Code, which hides boilerplate code written by the Visual Studio .NET IDE&lt;br /&gt;Data Source binding, easing &lt;a title="Database" href="http://en.wikipedia.org/wiki/Database"&gt;database&lt;/a&gt; client/server development&lt;br /&gt;The above functions (particularly My) are intended to reinforce Visual Basic .NET's focus as a &lt;a title="Rapid application development" href="http://en.wikipedia.org/wiki/Rapid_application_development"&gt;rapid application development&lt;/a&gt; platform and further differentiate it from &lt;a title="C sharp" href="http://en.wikipedia.org/wiki/C_sharp"&gt;C#&lt;/a&gt;.&lt;br /&gt;Visual Basic 2005 introduced features meant to fill in the gaps between itself and other "more powerful" .NET languages, adding:&lt;br /&gt;&lt;a class="external text" title="http://msdn.microsoft.com/vbasic/default.aspx?pull=" href="http://msdn.microsoft.com/vbasic/default.aspx?pull=library/en-us/dnvs05/html/LanguageEnhancements.asp" rel="nofollow"&gt;.NET 2.0 languages features&lt;/a&gt; such as:&lt;br /&gt;&lt;a title="Generic programming" href="http://en.wikipedia.org/wiki/Generic_programming"&gt;generics&lt;/a&gt; &lt;a title="" href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#_note-2"&gt;[3]&lt;/a&gt;&lt;br /&gt;Partial classes, a method of defining some parts of a class in one file and then adding more definitions later; particularly useful for integrating user code with auto-generated code&lt;br /&gt;&lt;a title="Nullable Types" href="http://en.wikipedia.org/wiki/Nullable_Types"&gt;Nullable Types&lt;/a&gt;&lt;br /&gt;&lt;a title="XML" href="http://en.wikipedia.org/wiki/XML"&gt;XML&lt;/a&gt; comments that can be processed by tools like &lt;a title="NDoc" href="http://en.wikipedia.org/wiki/NDoc"&gt;NDoc&lt;/a&gt; to produce "automatic" documentation&lt;br /&gt;&lt;a title="Operator overloading" href="http://en.wikipedia.org/wiki/Operator_overloading"&gt;operator overloading&lt;/a&gt; &lt;a title="" href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#_note-3"&gt;[4]&lt;/a&gt;&lt;br /&gt;Support for &lt;a title="Integer (computer science)" href="http://en.wikipedia.org/wiki/Integer_%28computer_science%29"&gt;unsigned integer&lt;/a&gt; data types commonly used in other languages&lt;br /&gt;&lt;a id="IsNot_Patent" name="IsNot_Patent"&gt;&lt;/a&gt;&lt;br /&gt;[&lt;a title="Edit section: IsNot Patent" href="http://en.wikipedia.org/w/index.php?title=Visual_Basic_.NET&amp;action=edit&amp;amp;section=5"&gt;edit&lt;/a&gt;] IsNot Patent&lt;br /&gt;One other feature of Visual Basic 2005 is the conversion of If Not X Is Y to If X IsNot Y which gained notoriety &lt;a title="" href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#_note-4"&gt;[5]&lt;/a&gt; when it was found to be the subject of a Microsoft patent application &lt;a title="" href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#_note-5"&gt;[6]&lt;/a&gt;।&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;Relation to Visual Basic&lt;br /&gt;Whether Visual Basic .NET should be considered as just another version of Visual Basic or a completely different language is a topic of debate. This is not obvious, as once the methods that have been moved around and which can be automatically converted are accounted for, the basic &lt;a title="Syntax" href="http://en.wikipedia.org/wiki/Syntax"&gt;syntax&lt;/a&gt; of the language has not seen many "breaking" changes, just additions to support new features like &lt;a title="Exception handling" href="http://en.wikipedia.org/wiki/Exception_handling"&gt;structured exception handling&lt;/a&gt; and short circuited expressions. One simple change that can be confusing to previous users is that of Integer and Long &lt;a title="Data type" href="http://en.wikipedia.org/wiki/Data_type"&gt;data types&lt;/a&gt;, which have each doubled in length; a 16-bit integer is known as a Short in VB.NET, while Integer and Long are 32 and 64 bits respectively. Similarly, the &lt;a title="Windows Forms" href="http://en.wikipedia.org/wiki/Windows_Forms"&gt;Windows Forms&lt;/a&gt; &lt;a title="GUI" href="http://en.wikipedia.org/wiki/GUI"&gt;GUI&lt;/a&gt; editor is very similar in style and function to the Visual Basic form editor.&lt;br /&gt;The things that have changed significantly are the semantics — from those of an object based programming language running on a &lt;a title="Deterministic" href="http://en.wikipedia.org/wiki/Deterministic"&gt;deterministic&lt;/a&gt;, &lt;a title="Reference counting" href="http://en.wikipedia.org/wiki/Reference_counting"&gt;reference-counted&lt;/a&gt; engine based on &lt;a title="Component Object Model" href="http://en.wikipedia.org/wiki/Component_Object_Model"&gt;COM&lt;/a&gt; to a fully &lt;a title="Object-oriented" href="http://en.wikipedia.org/wiki/Object-oriented"&gt;object-oriented&lt;/a&gt; language backed by the &lt;a title=".NET Framework" href="http://en.wikipedia.org/wiki/.NET_Framework"&gt;.NET Framework&lt;/a&gt;, which consists of a combination of the &lt;a title="Common Language Runtime" href="http://en.wikipedia.org/wiki/Common_Language_Runtime"&gt;Common Language Runtime&lt;/a&gt; (a &lt;a title="Virtual machine" href="http://en.wikipedia.org/wiki/Virtual_machine"&gt;virtual machine&lt;/a&gt; using &lt;a title="Garbage collection (computer science)" href="http://en.wikipedia.org/wiki/Garbage_collection_%28computer_science%29#Generational_GC_.28aka_Ephemeral_GC.29"&gt;generational garbage collection&lt;/a&gt; and a &lt;a title="Just-in-time compilation" href="http://en.wikipedia.org/wiki/Just-in-time_compilation"&gt;just-in-time&lt;/a&gt; compilation engine) and a far larger &lt;a title="Class library" href="http://en.wikipedia.org/wiki/Class_library"&gt;class library&lt;/a&gt;. The increased breadth of the latter is also a problem that VB developers have to deal with when coming to the language, although this is somewhat addressed by the My feature in Visual Studio 2005.&lt;br /&gt;The changes have altered many underlying assumptions about the "right" thing to do with respect to performance and maintainability. Some functions and libraries no longer exist; others are available, but not as efficient as the "native" .NET alternatives. Even if they compile, most converted VB6 applications will require some level of &lt;a title="Refactoring" href="http://en.wikipedia.org/wiki/Refactoring"&gt;refactoring&lt;/a&gt; to &lt;a class="external text" title="http://msdn.microsoft.com/library/default.asp?url=" href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchperfopt.asp" rel="nofollow"&gt;take full advantage&lt;/a&gt; of the new language. &lt;a class="external text" title="http://msdn.microsoft.com/vbrun/staythepath/clientpath/default.aspx" href="http://msdn.microsoft.com/vbrun/staythepath/clientpath/default.aspx" rel="nofollow"&gt;Extensive documentation&lt;/a&gt; is available to cover changes in the syntax, debugging applications, deployment and terminology.&lt;br /&gt;&lt;a id="Comparative_samples" name="Comparative_samples"&gt;&lt;/a&gt;&lt;br /&gt;[&lt;a title="Edit section: Comparative samples" href="http://en.wikipedia.org/w/index.php?title=Visual_Basic_.NET&amp;action=edit&amp;amp;section=8"&gt;edit&lt;/a&gt;] Comparative samples&lt;br /&gt;The following simple example demonstrates similarity in syntax between VB and VB.NET. Both examples pops a message box saying "Hello, World" with an OK button.&lt;br /&gt;Classic VB example:Private Sub Command1_Click()&lt;br /&gt;MsgBox "Hello, World"&lt;br /&gt;End Sub&lt;br /&gt;A VB.NET example:Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click&lt;br /&gt;MessageBox.Show("Hello, World")&lt;br /&gt;End Sub&lt;br /&gt;Note that all procedure calls must be made with parentheses in VB.NET, whereas these were only required for function calls (however in VB6 they could be used in procedure calls as well by using the Call keyword)&lt;br /&gt;Also note that the names Command1 and Button1 are not obligatory. However, these are default names for a command button in VB6 and VB.NET respectively.&lt;br /&gt;Actually, there is a function called MsgBox in the Microsoft.VisualBasic namespace, but the System.Windows.Forms.MessageBox class is a preferred way of displaying message boxes since it has more features and is less language-specific.&lt;br /&gt;The following example demonstrates a difference between VB6 and VB.NET. Both examples unload the active window.&lt;br /&gt;Classic VB Example:Private Sub cmdClose_Click()&lt;br /&gt;Unload Me&lt;br /&gt;End Sub&lt;br /&gt;A VB.NET example:Private Sub btnClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnClose.Click&lt;br /&gt;Me.Close()&lt;br /&gt;End Sub&lt;br /&gt;Note the 'cmd' prefix being replaced with the 'btn' prefix, conforming to the new convention previously mentioned.&lt;br /&gt;Visual Basic 6 did not provide common operator shortcuts. The following are equivalent: VB6 Example:Private Sub Timer1_Timer()&lt;br /&gt;Form1.Height = Form1.Height - 1&lt;br /&gt;End Sub&lt;br /&gt;VB.NET example:Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick&lt;br /&gt;Me.Height -= 1&lt;br /&gt;End Sub&lt;br /&gt;&lt;a id="Controversy" name="Controversy"&gt;&lt;/a&gt;&lt;br /&gt;[&lt;a title="Edit section: Controversy" href="http://en.wikipedia.org/w/index.php?title=Visual_Basic_.NET&amp;action=edit&amp;amp;section=9"&gt;edit&lt;/a&gt;] Controversy&lt;br /&gt;Many long-time Visual Basic programmers have complained &lt;a title="" href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#_note-7"&gt;[8]&lt;/a&gt; about Visual Basic .NET, because initial versions dropped a large number of language constructs and user interface features &lt;a title="" href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#_note-8"&gt;[9]&lt;/a&gt; that were available in VB6 (which is now no longer sold), and changed the semantics of those that remained; for example, in VB.NET parameters are (by default) passed by value, not by reference. Detractors refer pejoratively to VB.NET as Visual Fred or DOTNOT.&lt;a title="" href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#_note-9"&gt;[10]&lt;/a&gt; On &lt;a title="March 8" href="http://en.wikipedia.org/wiki/March_8"&gt;March 8&lt;/a&gt;, &lt;a title="2005" href="http://en.wikipedia.org/wiki/2005"&gt;2005&lt;/a&gt;, a petition &lt;a title="" href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#_note-10"&gt;[11]&lt;/a&gt; was set up in response to Microsoft's refusal to extend its mainstream support &lt;a title="" href="http://en.wikipedia.org/wiki/Visual_Basic_.NET#_note-11"&gt;[12]&lt;/a&gt; for VB6 at the end of that month.&lt;br /&gt;VB.NET's supporters state that the new language is in most respects more powerful than the original, incorporating modern object oriented programming paradigms in a more natural, coherent and complete manner than was possible with earlier versions. Opponents tend not to disagree with this, instead taking the position that although VB6 has flaws in its object model, the cost in terms of redevelopment effort is too high for any benefits that might be gained by converting to VB.NET. Independent developers producing software for Internet distribution have also taken issue with the size of the runtime.&lt;a title="Wikipedia:Citing sources" href="http://en.wikipedia.org/wiki/Wikipedia:Citing_sources"&gt;[citation needed]&lt;/a&gt;&lt;br /&gt;It is simpler to &lt;a title="Decompiler" href="http://en.wikipedia.org/wiki/Decompiler"&gt;decompile&lt;/a&gt; languages that target &lt;a title="Microsoft Intermediate Language" href="http://en.wikipedia.org/wiki/Microsoft_Intermediate_Language"&gt;Microsoft Intermediate Language&lt;/a&gt;, including VB.NET, compared to languages that compile to &lt;a title="Machine code" href="http://en.wikipedia.org/wiki/Machine_code"&gt;machine code&lt;/a&gt;. Tools like &lt;a title=".NET Reflector" href="http://en.wikipedia.org/wiki/.NET_Reflector"&gt;.NET Reflector&lt;/a&gt; can provide a close approximation to the original code due to the large amount of &lt;a title="Metadata" href="http://en.wikipedia.org/wiki/Metadata"&gt;metadata&lt;/a&gt; provided in MSIL.&lt;br /&gt;Microsoft supplies an automated VB6-to-VB.NET converter with Visual Studio .NET, which has improved over time, but it cannot convert all code, and almost all non-trivial programs will need some manual effort to compile. Most will need a significant level of &lt;a title="Refactoring" href="http://en.wikipedia.org/wiki/Refactoring"&gt;refactoring&lt;/a&gt; to work optimally. Visual Basic programs that are mainly algorithmic in nature can be migrated with few difficulties; those that rely heavily on such features as database support, graphics, unmanaged operations or on implementation details are more troublesome.&lt;br /&gt;However in 2005 ArtinSoft, the company that developed the VB6-to-VB.NET converter for Microsoft that comes with Visual Studio .NET, developed a migration tool called the ArtinSoft Visual Basic Upgrade Companion. This tool expands upon the migration wizard included in Visual Studio .NET by providing some automated code refactoring, such as type inference for late-bound variables—producing explicitly typed variables—and conversion to structured error handling, among many other tweaks that improve code quality.&lt;br /&gt;Using artificial intelligence algorithms, it is possible for this new tool to recognize certain code patterns that can be reorganized into more structured versions, yielding a higher quality .NET code. For example, the tool is able to automatically recognize commonly used patterns of “On Error GoTo”, analyze them, and convert them to code blocks that use “Try Catch” instead of the legacy error handling model—in many cases with no human intervention.&lt;br /&gt;In addition, the required &lt;a title="Runtime" href="http://en.wikipedia.org/wiki/Runtime"&gt;runtime&lt;/a&gt; libraries for VB6 programs are provided with &lt;a title="Windows 98 SE" href="http://en.wikipedia.org/wiki/Windows_98_SE"&gt;Windows 98 SE&lt;/a&gt; and above, while VB.NET programs require the installation of the significantly larger &lt;a title=".NET Framework" href="http://en.wikipedia.org/wiki/.NET_Framework"&gt;.NET Framework&lt;/a&gt;. The framework is included with &lt;a title="Windows Vista" href="http://en.wikipedia.org/wiki/Windows_Vista"&gt;Windows Vista&lt;/a&gt;, &lt;a title="Windows XP Media Center Edition" href="http://en.wikipedia.org/wiki/Windows_XP_Media_Center_Edition"&gt;Windows XP Media Center Edition&lt;/a&gt;, &lt;a title="Windows XP Tablet PC Edition" href="http://en.wikipedia.org/wiki/Windows_XP_Tablet_PC_Edition"&gt;Windows XP Tablet PC Edition&lt;/a&gt; and &lt;a title="Windows Server 2003" href="http://en.wikipedia.org/wiki/Windows_Server_2003"&gt;Windows Server 2003&lt;/a&gt;. For other supported operating systems such as &lt;a title="Windows 2000" href="http://en.wikipedia.org/wiki/Windows_2000"&gt;Windows 2000&lt;/a&gt; or &lt;a title="Windows XP" href="http://en.wikipedia.org/wiki/Windows_XP"&gt;Windows XP (Home or Professional Editions)&lt;/a&gt;, it must be separately installed.&lt;br /&gt;Microsoft's response to developer dissatisfaction has focused around making it easier to move new development and shift existing codebases from VB6 to VB.NET. Their latest offering is the &lt;a class="external text" title="http://msdn.microsoft.com/VBRun/" href="http://msdn.microsoft.com/VBRun/" rel="nofollow"&gt;VBRun website&lt;/a&gt;, which offers code samples and articles for:&lt;br /&gt;completing common tasks in VB6, like creating a print preview&lt;br /&gt;integrating VB6 and VB.NET solutions (dubbed VB Fusion)&lt;br /&gt;converting VB6 code to VB.NET&lt;br /&gt;&lt;a id="Cross-platform_and_open-source_development" name="Cross-platform_and_open-source_development"&gt;&lt;/a&gt;&lt;br /&gt;[&lt;a title="Edit section: Cross-platform and open-source development" href="http://en.wikipedia.org/w/index.php?title=Visual_Basic_.NET&amp;action=edit&amp;amp;section=10"&gt;edit&lt;/a&gt;] Cross-platform and open-source development&lt;br /&gt;The creation of open-source tools for VB.NET development have been slow compared to &lt;a title="C Sharp" href="http://en.wikipedia.org/wiki/C_Sharp"&gt;C#&lt;/a&gt;, although the &lt;a title="Mono (software)" href="http://en.wikipedia.org/wiki/Mono_%28software%29"&gt;Mono&lt;/a&gt; development platform provides an implementation of VB.NET-specific libraries and is working on a &lt;a title="Compiler" href="http://en.wikipedia.org/wiki/Compiler"&gt;compiler&lt;/a&gt;, as well as the &lt;a title="Windows Forms" href="http://en.wikipedia.org/wiki/Windows_Forms"&gt;Windows Forms&lt;/a&gt; GUI library.&lt;a title="Wikipedia:Citing sources" href="http://en.wikipedia.org/wiki/Wikipedia:Citing_sources"&gt;[citation needed]&lt;/a&gt;&lt;br /&gt;&lt;a id="Hello_World_Example" name="Hello_World_Example"&gt;&lt;/a&gt;&lt;br /&gt;[&lt;a title="Edit section: Hello World Example" href="http://en.wikipedia.org/w/index.php?title=Visual_Basic_.NET&amp;action=edit&amp;amp;section=11"&gt;edit&lt;/a&gt;] Hello World Example&lt;br /&gt;The following is a very simple VB.Net program, a version of the classic "&lt;a title="Hello world" href="http://en.wikipedia.org/wiki/Hello_world"&gt;Hello world&lt;/a&gt;" example:Public Class ExampleClass&lt;br /&gt;&lt;br /&gt;Public Shared Sub Main()&lt;br /&gt;System.Console.WriteLine("Hello, world!")&lt;br /&gt;End Sub&lt;br /&gt;End Class&lt;br /&gt;The effect is to write the text Hello, world! to the output console. Each line serves a specific purpose, as follows:Public Class ExampleClass&lt;br /&gt;This is a class definition. It is public, meaning objects in other projects can freely use this class. All the information between this and the following End Class describes this class.Public Shared Sub Main()&lt;br /&gt;This is the entry point where the program begins execution. It could be called from other code using the syntax ExampleClass.Main(). (The Public Shared portion is a subject for a slightly more advanced discussion.)System.Console.WriteLine("Hello, world!")&lt;br /&gt;This line performs the actual task of writing the output. Console is a system object, representing a command-line console where a program can input and output text. The program calls the Console method WriteLine, which causes the string passed to it to be displayed on the console.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-7135144867248236968?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/7135144867248236968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=7135144867248236968&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/7135144867248236968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/7135144867248236968'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/visual-basic-net.html' title='Visual Basic .NET'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_W2DVHM5FSi0/RhUlwvD56mI/AAAAAAAAANg/ZwfpUssl3LI/s72-c/200px-Vb_dot_net.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-5985252738702610575</id><published>2007-04-05T02:26:00.000-07:00</published><updated>2007-04-05T02:28:32.463-07:00</updated><title type='text'>How to Build a Pinhole Camera?</title><content type='html'>Author: Monty Lee&lt;br /&gt;This article provides information about building your own pinhole camera. If you wan to find out more about pinhole camera and how to make them, then take a look at this article now.&lt;br /&gt;&lt;br /&gt;Do You Want to Build Your Own Pinhole Camera? Read On…As you probably know, these days, there are all kinds of cameras designed for different purposes. From digital and photo cameras to hidden or tiny &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink0" onmouseover="adlinkMouseOver(event,this,0);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,0);" onmouseout="adlinkMouseOut(event,this,0);" href="http://www.1888articles.com/how-to-build-a-pinhole-camera-072k2b37jt.html#" target="_new"&gt;spy cameras&lt;/a&gt;. There’s one more type of cameras that has gained popularity over the long years. It is called – a pinhole camera.What is a Pinhole Camera?A pinhole cam is a simple camera without lens. It’s a small box or can with a tiny (usually 0.5mm or smaller) hole inside one end and a piece of photographic paper in the other. The image is build by light passing through the hole. Although in the early days, pinhole cams did not have very clear image quality, these days there are pinhole cameras come with micro lens and provide very good image quality.The first pinhole camera was built in the 19th century. It gained some popularity and that time. Although &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink1" onmouseover="adlinkMouseOver(event,this,1);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,1);" onmouseout="adlinkMouseOut(event,this,1);" href="http://www.1888articles.com/how-to-build-a-pinhole-camera-072k2b37jt.html#" target="_new"&gt;cameras&lt;/a&gt; have advanced in size and quality, the principles still remain the same.Therefore, nowadays there are many enthusiasts who still prefer to build a pinhole camera themselves. This might be fun for amateurish purposes, however, for more serious tasks such as secret surveillance, an already built pinhole cam is much better choice.How to Build a Pinhole Camera?If you still prefer to build a camera yourself, then here are the basic steps you should look at. First, you’ll need a cardboard with a tape hinge , which can be used as a shutter. Second, you’ll need to make a pinhole. Simply take a needle (small in diameter, about 0.5mm) and punch through a piece of tinfoil. Then tape that piece to the inside of the box through a larger hole.If you’d like to change the angle of the view, you might want to create a moving box. You can simply take a sliding film holder so that the distance between the film and the pinhole can be changed.If you’ll move a film closer to the pinhole, you’ll get a wider angle of view, but shorter exposure time. Moving a film further from the pinhole will result in longer exposure time, but the angle of view will be narrow.More Serious Use of Pinhole CamerasActually, &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink2" onmouseover="adlinkMouseOver(event,this,2);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,2);" onmouseout="adlinkMouseOut(event,this,2);" href="http://www.1888articles.com/how-to-build-a-pinhole-camera-072k2b37jt.html#" target="_new"&gt;pinhole cameras&lt;/a&gt; may be used not only for taking photographs. They may be used for video recording too. However, making such pinhole video camera yourself would be very difficult if you don’t know the technical side involved.However, you may order small pinhole cameras for surveillance at very reasonable prices these days. You may order it online for less that $100 as a matter of fact.Such pinhole cameras can be used to track nannies or your spouse for instance. You never know, what these people are doing in your house. If you trust them, then you (probably) have nothing to worry about. But if you’re suspicious, then there’s nothing better than buying a &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink3" onmouseover="adlinkMouseOver(event,this,3);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,3);" onmouseout="adlinkMouseOut(event,this,3);" href="http://www.1888articles.com/how-to-build-a-pinhole-camera-072k2b37jt.html#" target="_new"&gt;wireless pinhole camera&lt;/a&gt; and putting it inside some fluffy bunny or behind some books on a book shelve.&lt;br /&gt;About Author&lt;br /&gt;Dan Crane specializes in spy camera industry and provides information and guides to consumers about spy cameras and surveillance equipment. If you'd like to learn more about &lt;a href="http://www.vedosoft.com/best-price-bullet.html" hgxpn="0" swe3b="0"&gt;http://www.vedosoft.com/best-price-bullet.html&lt;/a&gt; color bullet cameras or &lt;a href="http://www.vedosoft.com/pinhole-wireless.html" hgxpn="0" swe3b="0"&gt;http://www.vedosoft.com/pinhole-wireless.html&lt;/a&gt; wireless pinhole cameras, then browse Vedosoft website for more information at: www.vedosoft.com&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-5985252738702610575?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/5985252738702610575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=5985252738702610575&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/5985252738702610575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/5985252738702610575'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/how-to-build-pinhole-camera.html' title='How to Build a Pinhole Camera?'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-8884646706202285398</id><published>2007-04-05T02:24:00.000-07:00</published><updated>2007-04-05T02:29:04.379-07:00</updated><title type='text'>Safe Surfing</title><content type='html'>Author: Edward Olsen&lt;br /&gt;Keep your PC protected from online threats&lt;br /&gt;&lt;br /&gt;If you’re going to connect to the internet, you need to protect your computer, otherwise it’s like leaving your front door wide open with a big ‘Robbers Welcome’ doormat on your front step. You’ve probably heard all the terms – such as virus, hacker, firewall, spyware and a million more – but perhaps think that the anti-virus programme that came with the computer, or that your PC-savvy mate downloaded for you is enough to keep you safe, right? Wrong … First of all, you need a firewall. This is your first line of defence, making it extremely difficult for any hacker or malicious programme to get through. Nothing is 100% impenetrable, however, and an anti-virus programme that will always be on the lookout for anything nasty that manages to find its way in is essential. But there are things that manage to get onto your pc in the most unlikely of ways: it can be inadvertently added by you as you download music, &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink0" onmouseover="adlinkMouseOver(event,this,0);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,0);" onmouseout="adlinkMouseOut(event,this,0);" href="http://www.1888articles.com/safe-surfing-08u126fc9k.html#" target="_new"&gt;screensavers&lt;/a&gt; or games onto your PC, or it can even be added by someone you know and trust, such as a suspicious spouse or your employer. This is Spyware and is a frightening breach of privacy which allows people or programmes to see what you’re doing, what sites you look at and even log your keystrokes so that they can reproduce everything you type, such as passwords and credit card details. The only way to truly guard against spyware is to have a dedicated programme that detects and removes it. So, you have your firewall and your anti-virus programme in place; surely an anti-spyware programme is just money down the drain? Unfortunately not: this will fill the cracks left by your other &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink1" onmouseover="adlinkMouseOver(event,this,1);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,1);" onmouseout="adlinkMouseOut(event,this,1);" href="http://www.1888articles.com/safe-surfing-08u126fc9k.html#" target="_new"&gt;security&lt;/a&gt; programmes, and although it will not make your computer completely impenetrable (unfortunately the people writing these programmes are extremely good at what they do) it will be the equivalent of locking all your doors and windows and having an alarm system armed before you leave your house – someone could still get in if they really wanted to, but they’d probably rather go next door, where they’ve rather invitingly left a downstairs window open. People are now using their computers for a range of personal and business applications, the loss or infiltration of which could do them serious emotional and financial damage. Taking preventative measures to ensure your online security should be as natural as closing the door behind you when you go out, and there are affordable and easy to use programmes out there to help you do just that. For a full range of products to keep your &lt;a class="kLink" oncontextmenu="return false;" id="KonaLink2" onmouseover="adlinkMouseOver(event,this,2);" style="POSITION: static; TEXT-DECORATION: underline! important" onclick="adlinkMouseClick(event,this,2);" onmouseout="adlinkMouseOut(event,this,2);" href="http://www.1888articles.com/safe-surfing-08u126fc9k.html#" target="_new"&gt;computer safe&lt;/a&gt;, visit http://www.vaultlock.com Otherwise you might as well order that ‘Robbers Welcome’ mat now!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-8884646706202285398?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/8884646706202285398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=8884646706202285398&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/8884646706202285398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/8884646706202285398'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/safe-surfing.html' title='Safe Surfing'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-91539171744675845</id><published>2007-04-04T02:58:00.000-07:00</published><updated>2007-04-04T03:02:36.230-07:00</updated><title type='text'>Programming to Enjoy: The Difficulty of Getting It Right</title><content type='html'>I had just the right example: binary search. Seems simple enough, doesn't it? The basic algorithm for a binary search requires a sorted array for which random accesses are constant time (otherwise it doesn't make any sense not to perform a linear search). Given that the array is of size k, split the array in half -- test the middle element, originally k/2; if it's the value you're searching for, return the current index. Otherwise, if you have only one element in your subarray, return a sentinel indicating that you can't find the value. If that's not the case, if your search key is less than the middle element, perform the same operation on the elements from the start to k/2 - 1; if the middle element is less than your search key, perform the search on the subarray of k/2 + 1 to k. Every time you do this, you cut the size of the array to search in half -- so it takes O(log(k)) time, and about 10-15 lines of code. How many bugs can you possibly have? Back to the story. I'll call my friend Joe to protect his pride. "Joe, let's make a bet. If you can write a perfect binary search function in the next hour -- and include a working main function for easy testing -- I'll buy you lunch tomorrow. Otherwise, you by me lunch. The only stipulation is that you can't test your code. Of course, you can compile it to make sure there aren't any compiler bugs." Joe: "I won't need to compile it. I'll send you my untested, uncompiled code by 12:30." With that, we shook hands and I left him to work. 42 minutes later, I received his 50 line program, reproduced below (with a few minor modifications). &lt;br /&gt;#include &lt;iostream&gt;&lt;br /&gt;int bin_search(int* array, int size, int value)&lt;br /&gt;{&lt;br /&gt;return bin_search(array, 0, size-1, value);&lt;br /&gt;}&lt;br /&gt;int bin_search(int* array, int start, int end, int value)&lt;br /&gt;{&lt;br /&gt;if (start==end)&lt;br /&gt;{&lt;br /&gt;if (array[start]==value) return start;&lt;br /&gt;else return -1;&lt;br /&gt;}&lt;br /&gt;else if (start==end-1)&lt;br /&gt;{&lt;br /&gt;if (array[start]==value) return start;&lt;br /&gt;else if (array[end]==value) return end;&lt;br /&gt;else return -1;&lt;br /&gt;}&lt;br /&gt;// We know there is at least 1 element between start and end&lt;br /&gt;int midInd=(start+end)/2;&lt;br /&gt;int midVal=array[midInd];&lt;br /&gt;if (midVal==value) return midInd;&lt;br /&gt;else if (midVal&gt;value) return bin_search(array,start,midVal-1,value);&lt;br /&gt;else return bin_search(array,midVal+1,end,value);&lt;br /&gt;}&lt;br /&gt;using namespace std;&lt;br /&gt;int main()&lt;br /&gt;{&lt;br /&gt;int size;&lt;br /&gt;cin&gt;&gt;size;&lt;br /&gt;int* array=new int[size];&lt;br /&gt;for (int i=0; i&lt;size; i++)&lt;br /&gt;{&lt;br /&gt;cin&gt;&gt;array[i];&lt;br /&gt;}&lt;br /&gt;int value, result;&lt;br /&gt;cin&gt;&gt;value;&lt;br /&gt;result=bin_search(array,size,value);&lt;br /&gt;if (result==-1) cout&lt;&lt;"Sorry, not found\n";&lt;br /&gt;else cout&lt;&lt;"This is element #"&lt;&lt;result+1&lt;&lt;endl;&lt;br /&gt;}&lt;br /&gt;Before reading the rest of this article, look through the code and figure out whether or not it works; if it doesn't work, see how many bugs you can find. &lt;a href="http://www.cprogramming.com/tutorial/binarysearchbugs.html"&gt;Next: Who Won the Bet, and Why&lt;/a&gt;&lt;br /&gt;Related articles &lt;a href="http://cprogramming.com/discussionarticles/sorting_and_searching.html"&gt;Learn more about search techniques&lt;/a&gt; &lt;a href="http://www.cprogramming.com/tutorial/computersciencetheory/sortcomp.html"&gt;Learn more about the various sorting algorithms&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-91539171744675845?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/91539171744675845/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=91539171744675845&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/91539171744675845'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/91539171744675845'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/programming-to-enjoy-difficulty-of.html' title='Programming to Enjoy: The Difficulty of Getting It Right'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-7718184308362985888</id><published>2007-04-02T19:29:00.000-07:00</published><updated>2007-04-02T19:41:31.250-07:00</updated><title type='text'>Debugging in Visual Studio: Avoid Stepping Into Common Functions</title><content type='html'>If you do a lot of debugging (and who doesn't?), you've probably encountered many function calls that you'd really like to step into. Sometimes this is easy: you just hit F11 and waltz right in to the function you care about. Sometimes, however, this is not so easy. In particular, if the code makes function calls to produce arguments for the function: call_of_interest( new blah( "a", 1 ), my_vector.begin(), my_vector.end() );&lt;br /&gt;Suddenly, stepping into the function is a huge hassle; first, you're going to need to step through all of the function calls that produce its arguments। How inconvenient; especially when you are absolutely certain that you don't need to--after all, how likely is it that calling my_vector.begin() or your specialized operator new have anything to do with how the function of interest works? Probably not a lot--and if they do, you'll almost certainly be able to tell that they're causing problems by looking at the arguments passed in the function once you've stepped into it.&lt;br /&gt;&lt;br /&gt;Sure, you could just set a break point inside the function you're interested in and then hit F5 to continue. But doing that is tedious, especially if you're only interested in one invocation of that function or if you want to step into a lot of functions. In those cases, it's much nicer to simply avoid many of the common functions, such as library functions, that are often invoked to produce inputs for functions. Various versions of Visual C++ allow you different amounts of control over how you can skip stepping into certain functions, and none of the implementations of this feature are documented or offically supported by Microsoft. Please note that I cannot guarantee that this functionality will work for you any more than Microsoft will provide that guarantee. Some of the examples require editing the registry; make sure to keep a &lt;a href="http://support.microsoft.com/kb/322756/"&gt;backup&lt;/a&gt; before proceeding!&lt;br /&gt;Visual Studio 6In Visual Studio 6.0, you can edit the file autoexp.dat (which has several other useful features in different versions of Visual Studio), located in "%ProgramFiles%\Microsoft Visual Studio\Common\MSDev98\Bin". In autoexp.dat, different directives appear under different sections named with "[secname]". To avoid stepping into certain functions, simply add a section, [ExecutionControl], and place under it directives that match either a function name ("myMethod"), a class followed by a method name ("class::method"), or a class followed by a * to skip stepping into all methods of that class ("class::*"). You may need to qualify your classes with their namespaces. Here is an example demonstrating how to avoid stepping into operators; add to autoexp.dat and restart Visual Studio to reload the file: [ExecutionControl]&lt;br /&gt;operator new=NoStepInto&lt;br /&gt;or MyClass::operator==NoStepInto&lt;br /&gt;Visual Studio 7The debuggers for Visual Studio 7.0 and later read their NoStepInto configuration information from within the registry. You should &lt;a href="http://www.cprogramming.com/debugging/href=http://support.microsoft.com/kb/322756/"&gt;backup&lt;/a&gt; your registry before playing with it. To edit your registry, you'll need to use regedit (just click on Start, go to the run menu, and type in "regedit" and hit enter). The registry key you'll want to change is HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\7.0\NativeDE\StepOver&lt;br /&gt;or HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\7.1\NativeDE\StepOver&lt;br /&gt;if you're using Visual Studio 2003. You may need to create the keys Native DE its child StepOver. You can do so in RegEdit by navigating to the "VisualStudio\7.0" key and right-clicking and selecting "New-&gt;Key". Inside the StepOver key, you can create new string values that contain regular expressions to match against function names; you can also include a number for the priority of each expression. Using priority, you can set multiple expressions so that you step into a specific function for a class, but skip stepping into all others. For instance, you might have a string with the name and value 10 string\:\:append.*=StepInto&lt;br /&gt;20 string\:\:.*=NoStepInto&lt;br /&gt;In regular expression parlance, ".*" simply means "match any number of characters". For instance, the second expression matches any function in the string class. (Note that 10 is the name, and everything following it is the value to enter for that name.) Notice that you need to escape the colons because they have special meaning in Visual Studio regular expressions. Similarly, if you wish to match against templates, you need to escape the open and close brackets: 10 .*\&lt;.*\&gt;=StepInto&lt;br /&gt;Which should always step into any template function.&lt;br /&gt;Visual Studio 8Visual Studio 8 has the same basic functionality as Visual Studio 7 with a few improvements. In addition, you should be aware that the key you must modify is now: HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\NativeDE\StepOver&lt;br /&gt;You'll need an account with Admin privileges to set this up. In addition to the ability to match regular expressions provided in Visual Studio 7, a few new escape sequences have been added to the regular expressions you can use, including "\funct" to match the name of a function, "\scope" to match a scope (e.g., std::my_namespace::etc::so::forth), and "\oper", which matches any operator. Note that when you use these escape sequences, you must indicate the end of the escape sequence with a colon. So you might write "\scope:" followed by the rest of the expression to match. For instance, you could avoid stepping into any overloaded operators by using the expression \scope:operator\oper:=NoStepInto&lt;br /&gt;which might be useful if you are using a lot of classes with simple operators whose behaviors you can trust to be correct.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-7718184308362985888?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/7718184308362985888/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=7718184308362985888&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/7718184308362985888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/7718184308362985888'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/debugging-in-visual-studio-avoid.html' title='Debugging in Visual Studio: Avoid Stepping Into Common Functions'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-296848196909576092</id><published>2007-04-01T21:41:00.001-07:00</published><updated>2007-04-01T21:41:54.908-07:00</updated><title type='text'>Application Development</title><content type='html'>Our application development services cover the concept-to-market needs of the product and include product conceptualization, design, development, testing, and support. Our offshore product development center can serve as an offshore extension of your product engineering setup in a seamless and low-risk manner.&lt;br /&gt;This division works on the concept of Lab-on-Hire (LoH), where a team of engineers is dedicated to your project depending on its requirements. This team works with you through the Product Life Cycle to make application enhancements, do testing, and issue releases for each version of the product.&lt;br /&gt;Benefits for this kind of a setup include:&lt;br /&gt;Reduced time to market&lt;br /&gt;Global engineering workforce to ensure 24x7 product development cycle&lt;br /&gt;Full implementation of digital technologies in the product development phase&lt;br /&gt;Increased profitability by reduced product development cost As part of the Product Development and Support we provide the following services to our clients:&lt;br /&gt;Product Design and Conceptualization&lt;br /&gt;Development&lt;br /&gt;Testing&lt;br /&gt;Release&lt;br /&gt;Support Services&lt;br /&gt;During each of these phases your lab at Website Toolbox will act like a virtual extension of your onsite development team. Both of the teams will work in close coordination for each version release.&lt;br /&gt;Application development services can be provided for virtually any programming language on any operating system.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-296848196909576092?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/296848196909576092/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=296848196909576092&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/296848196909576092'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/296848196909576092'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/application-development.html' title='Application Development'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-3811890065723379124</id><published>2007-04-01T01:30:00.000-07:00</published><updated>2007-04-01T01:31:31.486-07:00</updated><title type='text'>Solving Cool Problems with Genetic Algorithms</title><content type='html'>Genetic algorithms are useful for solving problems having solutions representable as strings (hence the name Genetic Algorithm - the programming model is based on DNA). In terms of practical value, genetic algorithms are useful for solving problems in which the solutions are difficult to find by following a specific algorithm designed to solve the problem (using genetic algorithms in place of predesigned algorithms such as Djikstra's algorithm for path finding just wouldn't make sense). It functions as a sort of systematized brute force approach. Problems genetic algorithms are valuable for solving include scheduling problems, constraint satisfaction problems, and other problems that require searching a large number of possibilities. Genetic algorithms can be applied to protein folding or even &lt;a href="http://kerneltrap.org/node/4493"&gt;tuning Linux kernel performance&lt;/a&gt;।&lt;br /&gt;A simpler example just to get the point across is finding a five digit number that acts as the best solution to an expression; for example, if you wish to find the number that makes the expression x^2+2x-11 equal to 0, you could of course use brute force to solve the equation, but a genetic algorithm can also be used, and if you have a very complex expression, it may be of great value to use a genetic algorithm, especially when one considers the time saved over brute force. In a sense, all genetic algorithm problems boil down to solving complex expressions or sets of expressions, as all problems are representable in that fashion. Genetic algorithms work from the same basis as evolutionary theory. A genetic algorithm has several components: a pool of solutions, a method of evaluating the effectiveness of each solution, a breeding function that combines the best solutions into new solutions, and a mutation function. The pool of solutions do not compete for resources; rather, each solution is tested by an evaluation function (called the "fitness" function), which then gives it a ranking based on its effectiveness at solving the problem compared to the other solutions. The best solution strings are the ones that are ranked highest (that are the most "fit"); the breeding function takes two of the better performing solutions and combines them together into a new solution. The breeding function should repeat the process of randomly selecting two solutions and breeding them; the better performing functions should be given the higher percentage chance of being selected. The breeding function generally works by taking slices of each solution and splicing them together into a new one. Solutions are often represented as strings, so generally, a breeding function will take fragments of random lengths from each string and concatenate them together to form a new string. Each fragment should be placed into the location in the new string that corresponds to its location in the old string. For example, if a string fragment is from positions 5 to 8 in the first string being bred, it should be placed into positions 5 through 8 in the new child solution. After the strings have been bred, and the set of potential solutions has been refilled, it is important to have the mutation function. The mutation function is important because it introduces an element of randomness that allows variation in the solution sets, which otherwise would stagnate and have no advantage over a hand-crafted solution. Mutations may diminish the strength of some solutions, but in general it will increase the overall value of the solution set; by including a very small mutation rate, you introduce new traits that might never have otherwise existed within the pool. This allows you to explore a larger group of possibilities and avoid stagnation. In fact, many other AI techniques forgo the idea of breeding solutions and work simply by making small "mutations" or changes to a potential solution to a problem. Genetic algorithms can do some amazing things and solve very complex problems. Nevertheless, this techniques will require having way of evaluating possible solutions -- this is one of the most difficult problems with genetic algorithms. The second challenge is finding a good way to represent solutions to the problem as strings. Once these are sorted out, a genetic algorithm may be a good approach to your problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-3811890065723379124?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/3811890065723379124/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=3811890065723379124&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/3811890065723379124'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/3811890065723379124'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/solving-cool-problems-with-genetic.html' title='Solving Cool Problems with Genetic Algorithms'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-4499543053113144919</id><published>2007-04-01T01:07:00.000-07:00</published><updated>2007-04-01T01:10:37.268-07:00</updated><title type='text'>Debugging Strategies, Tips, and Gotchas</title><content type='html'>Use the Right ToolsIt should go without saying that you should always be using the best tools available; if you're hunting a &lt;a href="http://www.cprogramming.com/debugging/segfaults.html"&gt;segmentation fault&lt;/a&gt;, you want use a &lt;a href="http://www.cprogramming.com/debuggers.html"&gt;debugger&lt;/a&gt;. Anything less than that is unnecessary pain. If you're dealing with bizarre memory issues (or hard-to-diagnose segfaults), use &lt;a href="http://www.cprogramming.com/debugging/valgrind.html"&gt;Valgrind&lt;/a&gt; on Linux or &lt;a href="http://www-306.ibm.com/software/awdtools/purifyplus/"&gt;Purify&lt;/a&gt; for Windows.&lt;br /&gt;Debug the ProblemMy first instinct when debugging is to ask, "is my code too complicated?" Sometimes we'll all come up with a solution to a problem only to realize that the solution is really hard to get working. So hard, in fact, that it might be easier to solve the original problem in another way. When I see someone struggling to debug a complex mass of code, my first thought is to ask whether there's a cleaner solution. Often, once you've written bad code, you have a much better idea of what the good code should look like. Remember that just because you've written it doesn't mean you should keep it! The trick is always to decide if you're trying to solve the original problem or to solve a particular choice of solution. If it's the solution, then it's possible that your problems don't stem from the problem at all--maybe you're over-thinking the problem or trying a wrong-headed approach. For instance, I recently needed to parse a file and import some of the data into an access database to prototype an analysis tool. My first instinct was to write a Ruby script that interfaced directly with Access and inserted all of the data into the database using SQL queries. As I looked at the support for doing this in Ruby, I quickly realized that my "solution" to the problem was going to take a lot longer than the problem should have taken. I reversed course, wrote a script that just output a comma-separated value file, and had my data fully imported in about an hour.&lt;br /&gt;An Aside on Bad CodePeople are often reluctant to throw out bad code that they've written and re-write it. One reason is that code that's written feels like completed work, and throwing it out feels like going backward. But when you're debugging, rewriting the code can seem more appealing because you're probably saving yourself time spent debugging by spending a bit more time coding. The trick is to avoid throwing out the baby with the bath water--remove the bad code, don't start the whole program over again (unless it's rotten to the core). Rewrite only the parts that really need it. Your second draft will probably be both cleaner and less buggy than the first, and you may avoid issues like having to go back later and rewrite the code just so that you can figure out how it was supposed to work. On the other hand, when you're absolutely sure that code that looks horrible is the right code to use, you'll want to explain your rationale in a &lt;a href="http://www.cprogramming.com/tutorial/comments.html"&gt;comment&lt;/a&gt; so someone (or you) doesn't come back later and hack it apart.&lt;br /&gt;Minimize Potential Problems by Avoiding Copy-Paste SyndromeNothing is more frustrating than to realize that you're debugging the same problem multiple times. Whenever you copy and paste large chunks of code, you leave yourself open to the unknown demons inhabiting that code. If you haven't debugged it yet, odds are that you're going to have to. And if you forgot that you copied that code somewhere else, you're probably going to be debugging the same code more than once. (There are other reasons to avoid copy-paste syndrome; even worse than debugging the same code twice is finding the bug in only one piece of copy-pasted code.) The best way to avoid copy-paste syndrome is to use functions to encapsulate as much of your repeat code as possible. Some things can't easily be avoided in C++; you're going to write a lot of for loops no matter what you're doing, so you can't abstract away the whole looping process. But if you have the same loop body in multiple places, that might be a sign that it should be pulled into a separate function. As a bonus, this makes other future changes to your code easier and allows you to reuse the function without having to find a chunk of code to copy.&lt;br /&gt;When to Copy CodeAlthough copying code is usually dangerous, there are times when it may be the best choice. For instance, if you need to make small, irregular tweaks to a chunk of code, but the bulk of it needs to remain the same, then copying, pasting, and careful editing might make sense. By copying the code, you avoid the chance that you introduce new bugs by mistyping the code. It should go without saying that you should have carefully debugged the code you plan to copy before you do so! (But I said it, and I'm not even paid by the word.) The second reason to copy code is when you have long variable names and a bad text editor. The best solution is generally to get a better &lt;a href="http://www.cprogramming.com/texteditors.html"&gt;text editor&lt;/a&gt; with keyword completion.&lt;br /&gt;Make Big Problems Found Late Small Problems Found Early&lt;br /&gt;Testing EarlyOne advantage of pulling out code and putting it into functions is that you can then separately test those functions. This means that you can sometimes avoid debugging big problems caused by simple bugs in the original functions. Nothing is more frustrating than writing perfectly correct code given how you thought a function (or a class) worked, only to find out that it doesn't work that way. This kind of unit testing requires some discipline and a good sense of what can go wrong with your code. Another advantage of early testing--especially if you write some or all of your tests up-front, before the code--is that you'll pay more attention to the specific interface to your class. If you can't test error handling because you're using an assert instead of an exception or error code, that might be an indication that you should be using some form of error reporting rather than asserts. (Of course, this won't always be the case--there are times when you just want to verify that your asserts work correctly.) Beyond error-reporting, writing tests is the first time you can test your code's &lt;a href="http://www.cprogramming.com/tutorial/class_design.html"&gt;interface&lt;/a&gt;, which is often as valuable as testing that the code works. If the interface to your class is clunky, or your functions have impossible-to-understand, let alone remember, argument lists, it might be time to rethink what you're doing before you write the underlying code.&lt;br /&gt;Compiler WarningsMany potential bugs can be caught by your compiler. Some such errors include using uninitialized variables, accidentally replacing a check for equality with an assignment in a conditional, or, in C++, errors related to mixing types such as pointers and ints. Since this has been covered before, I suggest checking out the article &lt;a href="http://www.cprogramming.com/tutorial/compiler_warnings.html"&gt;why you should pay attention to compiler warnings&lt;/a&gt;.&lt;br /&gt;Printf LiesBecause I/O is usually buffered by the operating system, using printfs in your debugging process is risky. When possible, use a debugger to figure out what lines of code are the problem rather than narrowing in on the issue with code littered by printfs and cout. (And beware the stray printf that slips in during debugging and, ahem, slips into the final version.)&lt;br /&gt;Flush OutputNevertheless, there are times when you actually need to keep track of some state in a log file--perhaps you simply have too much data that you need to collect, and you need the data from program start-up to the moment the bug occurs. To ensure you collect all of the data, be sure to flush it: you can use fflush in C, or output an endl in C++. fflush takes the FILE pointer you are writing into; for instance, to flush stderr, you would write fflush( stderr);&lt;br /&gt;Check Your Helper FunctionsThis should be obvious, but it's easy to forget in the heat of the moment: always verify that your helper functions work, especially when seemingly simple code is failing. When possible, isolate each helper function and test it individually, then test each of its helper functions. There's nothing more frustrating than realizing that your original logic was right, but your assumption about a helper function was wrong.&lt;br /&gt;When Cause Doesn't Immediately Lead to EffectEven if a helper function doesn't seem to be the immediate source of a problem, its side effects may cause latent problems. For instance, if you have a helper function that can return NULL and you pass its output into a library function dealing with C-strings, you may see the immediate cause as dereferencing a NULL pointer in strcat, but the real cause was the buggy function you wrote earlier (or the fact that you didn't check for NULL after calling it).&lt;br /&gt;Remember That Code May Be Used in More Than One PlaceAnother problem that can come up when debugging is that you discover the problem appears to be the result of a particular function call, set a break point inside that function, and then discover that there are hundreds of calls to the same function throughout the code. Or worse, you don't notice this until wasting hours of time trying to figure out what's going on or thinking that the reason for the problem is that the function is being called incorrectly. (When, in fact, it's being called correctly but with different arguments than the point at which the bug occurred.) The most obvious solution is to check the call stack after hitting a break point or to set the breakpoint right before the call that is actually the problem. Unfortunately, this doesn't always help if the same call works thousands of times but fails on the 1001st call. Potential solutions include counting the number of calls to a function and then stepping through that many breakpoints set inside the function, or using a &lt;a href="http://www.cprogramming.com/tutorial/statickeyword.html"&gt;static variable as a counter&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-4499543053113144919?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/4499543053113144919/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=4499543053113144919&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/4499543053113144919'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/4499543053113144919'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/04/debugging-strategies-tips-and-gotchas.html' title='Debugging Strategies, Tips, and Gotchas'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-1685821771412666355</id><published>2007-03-30T10:39:00.000-07:00</published><updated>2007-03-30T10:47:44.956-07:00</updated><title type='text'>Answers.com Releases Free AnswerTips Tool for Websites and Blogs</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_W2DVHM5FSi0/Rg1M-bwnx9I/AAAAAAAAAEU/ixnJsM5ZGT0/s1600-h/5.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5047775392839485394" style="FLOAT: left; MARGIN: 0px 10px 10px 0px; CURSOR: hand" alt="" src="http://4.bp.blogspot.com/_W2DVHM5FSi0/Rg1M-bwnx9I/AAAAAAAAAEU/ixnJsM5ZGT0/s320/5.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;HTMLPrimer.comThursday, February 22, 2007; 07:32 AM&lt;br /&gt;Answers Corporation, creator of Answers.com, began offering its latest webmaster tool, AnswerTips, to websites and blogs. AnswerTips allow sites to provide visitors with instant access to Answers.com's comprehensive information on four million topics, without having them leave the site or blog.&lt;br /&gt;AnswerTips are a unique site feature and provide instant background information when a site's visitor double-clicks a word on an "AnswerTips-enabled" site. Activate an AnswerTip, and without leaving the page, a small information bubble opens, providing definitions, explanations, biographies, historical background and countless other types of relevant information. Unlike other offerings, the AnswerTip provides content on the spot, rather than a number of related search links to follow.&lt;br /&gt;The free content in an AnswerTip comes from Answers.com's extensive database of information consisting of four million topics that are licensed from over 120 authoritative reference publications and other resources.&lt;br /&gt;"It's about immediate gratification for anyone reading your blog," said Gil Reich, Vice President of Product Management for Answers Corporation. "Readers get the information they want while remaining engaged in reading your content. Fewer distractions create a better experience on a website, and they save the writer time providing background information on subjects and terminology that his or her audience might be unfamiliar with."&lt;br /&gt;The technology behind AnswerTips yields a more productive user experience than a simple dictionary site or program. The tool has the ability to crack acronyms, quote stock prices and retrieve biographical information on everyone from rock musicians to political figures. Using patented technology, AnswerTips scans the text surrounding a word to retrieve the most appropriate information. For instance, it can differentiate between 'Paris Hilton' and 'plaster of Paris' when only the word "Paris" is double-clicked.&lt;br /&gt;Currently, AnswerTips technology has been implemented on Answers.com, WikiAnswers (wiki.answers.com) and CBSNews.com, and was beta tested on a few select blogs and websites, including:&lt;br /&gt;A VC (http://avc.blogs.com/a_vc/2007/02/this_blog_is_an.html) CleverClogs (http://www.cleverclogs.org/2006/12/instant_onsite_.html)&lt;br /&gt;California Polytechnic State University Library ( http://www.library.calpoly.edu)&lt;br /&gt;Write Technology (http://www.writetech.net/2007/02/answer_tips.html)&lt;br /&gt;In addition to being available directly from Answers.com at: (http://www.answers.com/main/answertip_landing.jsp)&lt;br /&gt;AnswerTips are also available within the widget gallery of TypePad at: http://www.sixapart.com/typepad/widgets/publishing-tools/answertips.html.&lt;br /&gt;Other free tools from Answers.com include 1-Click AnswersTM (Windows, Mac OS X), which enables AnswerTips within all of your desktop applications, and the Firefox extension (Windows, Mac OS X and Linux). For more about Answers.com webmaster tools, visit http://www.answers.com/main/webmasters.jsp.&lt;br /&gt;About Answers Corporation&lt;br /&gt;Answers Corporation (NASDAQ: ANSW) operates the award-winning Answers.com(TM) information portal, delivering comprehensive content on four million topics spanning health, finance, entertainment, business and more. Content includes over 120 licensed titles from leading publishers such as Houghton Mifflin Riverdeep Group PLC, Barron's, Encyclopedia Britannica, All Media Guide and others; original articles written by Answers.com's editorial team; community-contributed articles from Wikipedia; and user-generated questions &amp;amp; answers from Answers.com's industry-leading WikiAnswersTM (wiki.answers.com). Founded in 1999 by CEO Bob Rosenschein, Answers.com can be launched directly from within Internet Explorer 7, Firefox and Opera browsers, and its service is integrated into sites like Amazon.com's A9.com, The New York Public Libraries' homeworkNYC.org, The New York Times, CBSNews.com and others. Answers.com is also available for mobile devices at mobile.answers.com. For investment information, visit ir.answers.com.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-1685821771412666355?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/1685821771412666355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=1685821771412666355&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/1685821771412666355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/1685821771412666355'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/03/answerscom-releases-free-answertips.html' title='Answers.com Releases Free AnswerTips Tool for Websites and Blogs'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_W2DVHM5FSi0/Rg1M-bwnx9I/AAAAAAAAAEU/ixnJsM5ZGT0/s72-c/5.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-1714027658483356364</id><published>2007-03-29T06:03:00.001-07:00</published><updated>2007-03-29T06:03:51.791-07:00</updated><title type='text'>Big Business Web Design Disasters</title><content type='html'>When you think of the world's most successful businesses, what names come to mind? Most likely, consumer-oriented giants such as Coca-Cola, McDonald's, Sheraton, Disney, IBM, and General Electric. Not only have they spent billions on advertising to buy their way into your head. They offer convenient products and services that have made them a part of your life.But when you think of the most successful web sites, what names come to mind? Names like Google, Yahoo! Amazon, AOL, Kazaa (for better or worse), and Hotmail.The late-1990s mantra about the web being a disruptive technology that would destroy traditional companies may have been overstated. But a decade and a half into the web's existence, it is clear that the world's leading corporations have been sidelined on the web.The biggest shopping site is not walmart.com but amazon.com. The biggest map site is not randmcnally.com but mapquest.com.Established companies have usually only been able to buy their way into this market through acquisitions (as with Microsoft's purchase of Hotmail, which it used as a base for creating MSN).Why, with few exceptions, were the world's most successful web sites not launched by the world's most successful corporations?Many Big Name Companies' Web Sites a Vast Waste of Time for VisitorsThe McDonald's web site talks about food, but has no real menu. The Coca-Cola USA web site has no clear ingredients list or nutritional information, no recipes for floats or mixed drinks, no company history, and nothing else useful to people who like Coke. All that information has been inexplicably located on the "company" page, which on every other web site is used for investor relations. The Johnson and Johnson web site has useful information if you can access it—when the author attempted to open it, it crashed two different web browsers (Internet Explorer and Mozilla) before finally yielding (to the Opera browser).Many big-name companies' web sites offer lessons in what not to do in web design. The biggest lesson by far is not to sacrifice usability in an attempt to look cool, and never forget why your users came to your site in the first place. McDonald's may be the world's largest restaurant chain, but it didn't get that way because of its web site.Why Big-Budget Websites Are More Often Bombs than BlockbustersThe web sites of many successful corporations (both B2C and B2B) are like big-budget Hollywood movies that spend millions on stars and special effects, and a quarter of a percent of the budget on the script. Worse, the special effects of blockbuster web sites are far more annoying than impressive.Special Effect that Bombs Number 1: Flash!When web sites don't offer any content—any useful information to read—what do they put up there instead? Spinning Coke bottles. Chicken McNuggets and French fries that zoom out toward you when you position your cursor over them. Changing pictures of generic-looking office buildings and men in suits (on the web site of real estate giant CB Richard Ellis—but that essentially describes the generic look of many corporate web sites).Of course, Flash can be used as a way to present content—words, both printed and recorded, and pictures that actually illustrate something. But more often, it is used to impress. And most often, it ends up annoying. Who wants to spend the better part of a minute waiting for a rotation of generic pictures of smiling models?Special Effect that Bombs Number 2: Splash ScreensYou type in duracell.com expecting information on batteries—which you will find, if you have the patience not to hit the “back” button while the site shows a picture of a battery revolving painfully slowly.On http://www.mcdonalds.com you're met with pictures of happy children playing with Ronald McDonald and a menu to select what country you're from.Johnson's and Johnson's web site shows a logo before automatically redirecting you to the main page—that is if it doesn't crash your browser first (which happened when the author tried to access the page on May 2, 2004 ).Another way big consumer corporations' web sites from Schick to Mercedes-Benz to Thomas Cooke waste your time with splash pages is by making you choose what country you're visiting from. This could have been detected automatically, or at least, useful worldwide content could have been placed on the homepage, with an option to choose a country prominently displayed.Splash pages are the internet equivalent of making patrons wait in line out front before letting them inside. Unless a site belongs to a night club or a professional services firm with too much business, keeping people outside can't be a good idea.Special Effect that Bombs Number 3: Overbuilt or Badly Built “Dynamic” FunctionalityEvery web surfer has a story about a shopping cart that malfunctioned just when they were about to click “purchase” on something they really wanted. Or a detailed form that lost all the information after the “submit” button was pressed.Sometimes, malfunctioning dynamic content can distort the way an entire site presents itself. If the dynamic content is so complex that it presents problems for many users, it is unlikely the dynamic content is worth it. When I visited disney.com in May 2004, my first greeting was a message that your computer is sufficiently up-to-date (or not) to handle the site.In short, you may want your small or medium-sized business to get as big as Coca Cola or Disney, but you'll never get there if your website looks like theirs do.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-1714027658483356364?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/1714027658483356364/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=1714027658483356364&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/1714027658483356364'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/1714027658483356364'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/03/big-business-web-design-disasters.html' title='Big Business Web Design Disasters'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-2948087782813899238</id><published>2007-03-29T06:01:00.000-07:00</published><updated>2007-03-29T06:02:38.389-07:00</updated><title type='text'>The Power OF HTML Email Advertising And When To Use Text Email</title><content type='html'>The issue of HTML email versus text email usually raises heated debate amongst those involved in email advertising. For some people, feelings about HTML-formatted email have changed over time. However there are a number of issues that one should take into consideration before making a decision either for or against sending HTML email in their advertising campaign.&lt;br /&gt;It may show to be successful way of advertising, but then on the other hand it could be a pain to the ones on the receiving end. To start with, not everybody has the ability to receive HTML Email, which is a very important factor for anybody involved in email advertising to take note of. It is estimated that over 30 per cent of email users are not able to receive HTML Email. HTML may show up unreadable or in non-standard fonts, clashing colours, badly formatted images and sometimes there is no quick or easy way to adjust appearance to be read.&lt;br /&gt;However it is also a fact that this figure is reducing by the day. Still there is no denying the fact that HTML email will always get twice the response rate that text email would usually get, according to Email Marketing research. It is easy to see why this is so. With HTML email, full color graphics and even moving images and graphics can easily be created. These are usually much more attractive and can be powerful in drawing attention to a message.&lt;br /&gt;Also, according to research, it’s mentioned that text just can't do some of the things that HTML email marketing can, such as the ability to embed links into the email form itself. Yet despite this powerful statistic in support of HTML email, it is also true to say that most times, email users expect most of the HTML email messages they have received to be spam. Many notorious spammers have actually perfected the art of creating flashy HTML graphics to sell whatever it is they are trying to sell in their intrusive and illegal way. There are plenty of other reasons to favor plain text over HTML, such as band width waste and security exploits, but what it really comes down to is that like all other forms of information junk, there is more effort put into the font styling, rather than the actual email content.&lt;br /&gt;Choosing the right Marketing Company is often one of the biggest reasons a campaign fails or succeeds. It is also significant to note that there are some very successful marketers who use nothing else but text email in all their campaigns. They place all their focus on powerful words and directing people to their web sites and blog sites, where color and full HTML can be fully utilized to elaborate further on their advertising messages. The obvious advantage they enjoy is the fact that they do not need to worry about some recipients having turned off all HTML in incoming email messages, which many people often do to deal with the rising volumes of spam.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-2948087782813899238?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/2948087782813899238/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=2948087782813899238&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/2948087782813899238'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/2948087782813899238'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/03/power-of-html-email-advertising-and.html' title='The Power OF HTML Email Advertising And When To Use Text Email'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-3423846272325195412</id><published>2007-03-28T19:05:00.000-07:00</published><updated>2007-03-28T19:08:10.844-07:00</updated><title type='text'>Complete Website Solutions: Tips For Choosing A Web Solutions Provider</title><content type='html'>by &lt;a href="http://www.htmlprimer.com/articles/alphabetical/c/authors/Cogniter_Technologies.html"&gt;Cogniter Technologies&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Your website is intrinsic to your business, whether you're running an online store looking to attract local customers through the web or any business in between. Your web solutions provider should be a good partner and a strong source of support for your online needs. Check out these tips for businessman who are either looking for their first provider or are looking to switch to a provider that better suits their business. Who you choose will have a big impact on your and your customer's web experience.1. You shouldn't have to be a technology virtuoso to get your business's website up and running. Look for a web solutions provider that offers a variety of template option to help get your site online. Templates should be easy to use and customizable. A wizard interface that walks you through the template is a great way for users who are new to building websites to get comfortable and get a professional-looking website up quickly. A provider that has experience with small businesses will understand your needs and be able to guide you through the process. 2. It's not just about having a place to park your website. Look beyond the basics to see what extras a provider offers. Your website solution provider must provide you basic web services like application development, web marketing, design great business logos &amp; business portals or we can say B2B sites. Search Engine Optimization is another helpful feature to look for. Finally, look for a web solutions provider that can give you statistics tools. Those can help you monitor your website's performance and find out information like where your visitors are coming from and at what times your site is busiest. 3. Your business is growing, and your web solutions provider needs to be able to grow with you. Your website might start out as a basic informational site, but you could decide you want to sell your products online or want to offer more advanced services to your customers. Check out what packages and services a provider offers. You should be able to move up to more sophisticated packages as your business needs increase. Look for e-commerce services and more advanced e-mail services that can handle your customer and employee growth as needed. 4. Make sure you find a web solutions provider that knows how important reliability is when it comes to dealing with your customers. Uptime, the amount of time your website is up and running and viewable online, is a great measure of reliability. Don't settle for anything less than 99.9 percent uptime. Also, ask what your potential provider does to protect your website data. Regular data backups are an absolute necessity. 5. In an online world of bits and bytes, its still people who make things happen. Customer service should be a top priority for a web solutions provider. Whether you're just looking for more information on product offerings or have a question about your site, find a provider that has actual people there to help. Cogniter Technologies goes beyond e-mail support to offer free 24/7 phone support that connects its customers to a real, live and understanding customer service consultant. Having over 4 years of experience in providing internet services and solutions and having completed hundreds of projects in different domains Cogniter Technologies has built a large database of knowledge that enables us to deliver the “right” solutions that address the needs of clients. Businessman can't afford to wait hours on hold or days for an e-mail response. When it comes to your business, you need to be able to handle your web solutions on your own schedule.You are just one step beyond to see your online business growth, go to www.cogniter.com &amp;amp; see your business in growing shape. Sponsored by Cogniter Technologies Inc, Chandigarh, India&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-3423846272325195412?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/3423846272325195412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=3423846272325195412&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/3423846272325195412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/3423846272325195412'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/03/complete-website-solutions-tips-for.html' title='Complete Website Solutions: Tips For Choosing A Web Solutions Provider'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-6438669452442192377</id><published>2007-03-28T18:57:00.000-07:00</published><updated>2007-03-28T18:59:11.518-07:00</updated><title type='text'>Advantages of using tableless CSS | XHTML Web Design Techniques</title><content type='html'>by &lt;a href="http://www.htmlprimer.com/articles/alphabetical/t/authors/Tim_Warren.html"&gt;Tim Warren&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Tables used to be the “in” thing when it came to designing web sites. As with many other things though, new techniques and methods standards are bound to emerge with time. When once tables were seen in most web pages, some experts now suggest that tables should be thrown out of the window.&lt;br /&gt;In simple words, tableless web design is basically a method whereby page layout control is achieved without the use of HTML tables. Instead, text and other elements on a page are arranged using CSS (Cascading Style Sheets). This language is the brainchild of the W3C (World Wide Web Consortium). It was designed in such a way as to improve web accessibility as well as to make use of HTML for semantic purposes rather than presentational purposes.&lt;br /&gt;One thing that has been making the headlines in the past year or so is the term SEO (Search Engine Optimization) techniques. With search engines such as Google and Yahoo making big waves in the information sector, web designers are scrambling to get on their good side. The one main goal of a web designer is to get his site on the top pages for search results. How is this achieved? By making one’s site search engine friendly.&lt;br /&gt;Search engines make use of various techniques to index all existing web sites. Based on these various techniques, they assign a page rank to the web site. The higher the page rank, the more chances it will be high up in the search engine results. The higher up the site is in ranking, the more chances that people will visit the site. That means good news for the web site. That is where semantics and HTML come in.&lt;br /&gt;So how about tables? Web designers who favor tables assert that they make the design process easier and less time consuming. More so, they assert that tables are more compatible with various web browsers. On the other hand, proponents of tableless formats assert that tables do not adhere to web standards and web accessibility.&lt;br /&gt;Over the years, people have been trying to come up with web standards that are based on logic and that would make it easier for everyone involved to access web sites. Text readers, bots, mobile devices, and other elements were all taken into consideration. As such, the tableless format has come into popular use.&lt;br /&gt;Why should you follow this standard? Here are a few reasons as to why you should go tableless:&lt;br /&gt;• The current W3C standards dictate the use of tableless design. • Practically all browsers in use today support CSS for controlling layouts. As such, your site will be compatible with most any browser. • It is easier to make global changes to the layout with the use of CSS. That is, if the coding is properly done, of course. • Web site accessibility for people with special needs is done more easily with the proper implementation of content into XHTML documents. In this case, CSS is used only for the layout and style. • Unnecessary code is eliminated with the use of XHTML and CSS, making for a sleeker and more manageable code. • Tableless formats make it easier for search engines to index a web site.&lt;br /&gt;Though tableless formats are being widely used for page layout control, it does not necessarily mean that tables are not being used anymore. They are merely not optimal for presentation purposes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-6438669452442192377?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/6438669452442192377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=6438669452442192377&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/6438669452442192377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/6438669452442192377'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/03/advantages-of-using-tableless-css-xhtml.html' title='Advantages of using tableless CSS | XHTML Web Design Techniques'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-4702528374591990675</id><published>2007-03-28T00:39:00.000-07:00</published><updated>2007-03-28T00:42:46.231-07:00</updated><title type='text'>Security Enhancements and Fixes in PHP 5.2.1 and PHP 4.4.5:</title><content type='html'>Fixed possible safe_mode &amp; open_basedir bypasses inside the session extension.&lt;br /&gt;Fixed unserialize() abuse on 64 bit systems with certain input strings.&lt;br /&gt;Fixed possible overflows and stack corruptions in the session extension.&lt;br /&gt;Fixed an underflow inside the internal sapi_header_op() function.&lt;br /&gt;Fixed non-validated resource destruction inside the shmop extension.&lt;br /&gt;Fixed a possible overflow in the str_replace() function.&lt;br /&gt;Fixed possible clobbering of super-globals in several code paths.&lt;br /&gt;Fixed a possible information disclosure inside the wddx extension.&lt;br /&gt;Fixed a possible string format vulnerability in *print() functions on 64 bit systems.&lt;br /&gt;Fixed a possible buffer overflow inside ibase_{delete,add,modify}_user() functions.&lt;br /&gt;Fixed a string format vulnerability inside the odbc_result_all() function.&lt;br /&gt;Security Enhancements and Fixes in PHP 5.2.1 only:&lt;br /&gt;Prevent search engines from indexing the phpinfo() page.&lt;br /&gt;Fixed a number of input processing bugs inside the filter extension.&lt;br /&gt;Fixed allocation bugs caused by attempts to allocate negative values in some code paths.&lt;br /&gt;Fixed possible stack/buffer overflows inside zip, imap &amp;amp; sqlite extensions.&lt;br /&gt;Fixed several possible buffer overflows inside the stream filters.&lt;br /&gt;Memory limit is now enabled by default.&lt;br /&gt;Added internal heap protection.&lt;br /&gt;Extended filter extension support for $_SERVER in CGI and apache2 SAPIs.&lt;br /&gt;Security Enhancements and Fixes in PHP 4.4.5 only:&lt;br /&gt;Fixed possible overflows inside zip &amp; imap extensions.&lt;br /&gt;Fixed a possible buffer overflow inside mail() function on Windows.&lt;br /&gt;Unbundled the ovrimos extension.&lt;br /&gt;The majority of the security vulnerabilities discovered and resolved can in most cases be only abused by local users and cannot be triggered remotely. However, some of the above issues can be triggered remotely in certain situations, or exploited by malicious local users on shared hosting setups utilizing PHP as an Apache module. Therefore, we strongly advise all users of PHP, regardless of the version to upgrade to the 5.2.1 or 4.4.5 releases as soon as possible.&lt;br /&gt;For users upgrading to PHP 5.2 from PHP 5.0 and PHP 5.1, an upgrade guide is available &lt;a href="http://www.php.net/migration52"&gt;here&lt;/a&gt;, detailing the changes between those releases and PHP 5.2.1.&lt;br /&gt;Update: Feb 14th; Added release information for PHP 4.4.5.&lt;br /&gt;Update: Feb 12th; The Windows install package had problems with upgrading from previous PHP versions. That has now been fixed and new file posted in the &lt;a href="http://www.php.net/downloads.php"&gt;download section&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-4702528374591990675?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/4702528374591990675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=4702528374591990675&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/4702528374591990675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/4702528374591990675'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/03/security-enhancements-and-fixes-in-php.html' title='Security Enhancements and Fixes in PHP 5.2.1 and PHP 4.4.5:'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-2418800550518624379</id><published>2007-03-27T10:38:00.000-07:00</published><updated>2007-03-27T10:39:00.964-07:00</updated><title type='text'>Open Source Organizations and Affiliations</title><content type='html'>Google is proud to take part in the following technical and advocacy organizations:&lt;br /&gt;&lt;a href="http://www.eclipse.org/"&gt;The Eclipse Foundation&lt;/a&gt;&lt;br /&gt;Eclipse is an open source community whose projects are focused on providing a vendor-neutral open development platform and application frameworks for building software. The Eclipse Foundation is a not-for-profit corporation formed to advance the creation, evolution, promotion, and support of the Eclipse Platform and to cultivate both an open source community and an ecosystem of complementary products, capabilities, and services.&lt;br /&gt;&lt;a href="http://www.fsf.org/"&gt;The Free Software Foundation&lt;/a&gt;&lt;br /&gt;The Free Software Foundation (FSF), established in 1985, is dedicated to promoting computer users' rights to use, study, copy, modify, and redistribute computer programs. The FSF promotes the development and use of Free Software, particularly the GNU operating system, used widely in its GNU/Linux variant. The FSF also helps to spread awareness of the ethical and political issues surrounding freedom in the use of software.&lt;br /&gt;&lt;a href="http://www.jcp.org/en/home/index"&gt;The Java Community Process&lt;/a&gt;&lt;br /&gt;Since its introduction in 1998 as the open, participative process to develop and revise the Java technology specifications, reference implementations, and test suites, the Java Community Process (JCP) program has fostered the evolution of the Java platform in cooperation with the international Java developer community.&lt;br /&gt;&lt;a href="http://www.mozilla.org/foundation/"&gt;The Mozilla Foundation&lt;/a&gt;&lt;br /&gt;Established in July, 2003, with start-up funds from the Netscape division of AOL, the Mozilla Foundation exists to provide organizational, legal, and financial support for the Mozilla open-source software project. The Foundation has been incorporated as a California not-for-profit corporation to ensure that the Mozilla project continues to exist beyond the participation of individual volunteers, to enable contributions of intellectual property and funds and to provide a vehicle for limiting legal exposure while participating in open-source software projects.&lt;br /&gt;&lt;a href="http://oasis-open.org/"&gt;OASIS&lt;/a&gt;&lt;br /&gt;OASIS (Organization for the Advancement of Structured Information Standards) is a not-for-profit, international consortium that drives the development, convergence, and adoption of e-business standards. The consortium produces more Web services standards than any other organization, along with standards for security, e-business, and standardization efforts in the public sector and for application-specific markets.&lt;br /&gt;&lt;a href="http://www.odfalliance.org/"&gt;ODF Alliance&lt;/a&gt;&lt;br /&gt;The ODF alliance works globally to educate policymakers, IT administrators, and the public on the benefits and opportunities of the OpenDocument Format, to help ensure that government information, records, and documents are fully and natively accessible across platforms and applications, even as technologies change.&lt;br /&gt;&lt;a href="http://www.osdl.org/"&gt;OSDL&lt;/a&gt;&lt;br /&gt;OSDL - home to Linus Torvalds, the creator of Linux - is dedicated to accelerating the growth and adoption of Linux in the enterprise. Founded in 2000 and supported by a global consortium of IT industry leaders, OSDL is a non-profit organization that provides state-of the-art computing and test facilities in the United States and Japan available to developers around the world. OSDL's founding members were IBM, HP, CA, Intel, and NEC.&lt;br /&gt;&lt;a href="http://www.python.org/psf/"&gt;Python Software Foundation&lt;/a&gt;&lt;br /&gt;The Python Software Foundation (PSF) is a non-profit membership organization devoted to advancing open source technology related to the Python programming language. It qualifies under the US Internal Revenue Code as a tax-exempt 501(c)(3) scientific and educational public charity, and conducts its business according to the rules for such organizations.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-2418800550518624379?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/2418800550518624379/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=2418800550518624379&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/2418800550518624379'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/2418800550518624379'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/03/open-source-organizations-and.html' title='Open Source Organizations and Affiliations'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-5221255315401489844</id><published>2007-03-26T19:51:00.000-07:00</published><updated>2007-03-26T19:54:16.674-07:00</updated><title type='text'>3. Criterios de Selección</title><content type='html'>En el capítulo anterior se vio la forma de recuperar los registros de las tablas, las formas empleadas devolvían todos los registros de la mencionada tabla. A lo largo de este capítulo se estudiarán las posibilidades de filtrar los registros con el fin de recuperar solamente aquellos que cumplan una condiciones preestablecidas.&lt;br /&gt;Antes de comenzar el desarrollo de este capítulo hay que recalcar tres detalles de vital importancia. El primero de ellos es que cada vez que se desee establecer una condición referida a un campo de texto la condición de búsqueda debe ir encerrada entre comillas simples; la segunda es que no se posible establecer condiciones de búsqueda en los campos memo y; la tercera y última hace referencia a las fechas. Las fechas se deben escribir siempre en formato mm-dd-aa en donde mm representa el mes, dd el día y aa el año, hay que prestar atención a los separadores -no sirve la separación habitual de la barra (/), hay que utilizar el guión (-) y además la fecha debe ir encerrada entre almohadillas (#). Por ejemplo si deseamos referirnos al día 3 de Septiembre de 1995 deberemos hacerlo de la siguente forma; #09-03-95# ó #9-3-95#.&lt;br /&gt;3.1 &lt;a name="3.1"&gt;&lt;/a&gt;Operadores Lógicos&lt;br /&gt;Los operadores lógicos soportados por SQL son: AND, OR, XOR, Eqv, Imp, Is y Not. A excepción de los dos últimos todos poseen la siguiente sintaxis:&lt;br /&gt;    &lt;expresión1&gt;    operador    &lt;expresión2&gt;&lt;br /&gt;En donde expresión1 y expresión2 son las condiciones a evaluar, el resultado de la operación varía en función del operador lógico. La tabla adjunta muestra los diferentes posibles resultados:    &lt;br /&gt;&lt;expresión1&gt;&lt;br /&gt;Operador&lt;br /&gt;&lt;expresión2&gt;&lt;br /&gt;Resultado&lt;br /&gt;Verdad&lt;br /&gt;AND&lt;br /&gt;Falso&lt;br /&gt;Falso&lt;br /&gt;Verdad&lt;br /&gt;AND&lt;br /&gt;Verdad&lt;br /&gt;Verdad&lt;br /&gt;Falso&lt;br /&gt;AND&lt;br /&gt;Verdad&lt;br /&gt;Falso&lt;br /&gt;Falso&lt;br /&gt;AND&lt;br /&gt;Falso&lt;br /&gt;Falso&lt;br /&gt;Verdad&lt;br /&gt;OR&lt;br /&gt;Falso&lt;br /&gt;Verdad&lt;br /&gt;Verdad&lt;br /&gt;OR&lt;br /&gt;Verdad&lt;br /&gt;Verdad&lt;br /&gt;Falso&lt;br /&gt;OR&lt;br /&gt;Verdad&lt;br /&gt;Verdad&lt;br /&gt;Falso&lt;br /&gt;OR&lt;br /&gt;Falso&lt;br /&gt;Falso&lt;br /&gt;Verdad&lt;br /&gt;XOR&lt;br /&gt;Verdad&lt;br /&gt;Falso&lt;br /&gt;Verdad&lt;br /&gt;XOR&lt;br /&gt;Falso&lt;br /&gt;Verdad&lt;br /&gt;Falso&lt;br /&gt;XOR&lt;br /&gt;Verdad&lt;br /&gt;Verdad&lt;br /&gt;Falso&lt;br /&gt;XOR&lt;br /&gt;Falso&lt;br /&gt;Falso&lt;br /&gt;Verdad&lt;br /&gt;Eqv&lt;br /&gt;Verdad&lt;br /&gt;Verdad&lt;br /&gt;Verdad&lt;br /&gt;Eqv&lt;br /&gt;Falso&lt;br /&gt;Falso&lt;br /&gt;Falso&lt;br /&gt;Eqv&lt;br /&gt;Verdad&lt;br /&gt;Falso&lt;br /&gt;Falso&lt;br /&gt;Eqv&lt;br /&gt;Falso&lt;br /&gt;Verdad&lt;br /&gt;Verdad&lt;br /&gt;Imp&lt;br /&gt;Verdad&lt;br /&gt;Verdad&lt;br /&gt;Verdad&lt;br /&gt;Imp&lt;br /&gt;Falso&lt;br /&gt;Falso&lt;br /&gt;Verdad&lt;br /&gt;Imp&lt;br /&gt;Null&lt;br /&gt;Null&lt;br /&gt;Falso&lt;br /&gt;Imp&lt;br /&gt;Verdad&lt;br /&gt;Verdad&lt;br /&gt;Falso&lt;br /&gt;Imp&lt;br /&gt;Falso&lt;br /&gt;Verdad&lt;br /&gt;Falso&lt;br /&gt;Imp&lt;br /&gt;Null&lt;br /&gt;Verdad&lt;br /&gt;Null&lt;br /&gt;Imp&lt;br /&gt;Verdad&lt;br /&gt;Verdad&lt;br /&gt;Null&lt;br /&gt;Imp&lt;br /&gt;Falso&lt;br /&gt;Null&lt;br /&gt;Null&lt;br /&gt;Imp&lt;br /&gt;Null&lt;br /&gt;Null&lt;br /&gt;Si a cualquiera de las anteriores condiciones le anteponemos el operador NOT el resultado de la operación será el contrario al devuelto sin el operador NOT.&lt;br /&gt;El último operador denominado Is se emplea para comparar dos variables de tipo objeto &lt;objeto1&gt; Is &lt;objeto2&gt;. este operador devuelve verdad si los dos objetos son iguales&lt;br /&gt;    SELECT * FROM Empleados WHERE Edad &gt; 25 AND Edad &lt;&gt; 25 AND Edad &lt; sueldo =" 100;" estado =" 'Soltero';"&gt; 100 AND Sueldo &lt; 500) OR     (Provincia = 'Madrid' AND Estado = 'Casado');&lt;br /&gt;3.2 &lt;a name="3.2"&gt;&lt;/a&gt;Intervalos de Valores&lt;br /&gt;Para indicar que deseamos recuperar los registros según el intervalo de valores de un campo emplearemos el operador Between cuya sintaxis es:&lt;br /&gt;    campo [Not] Between valor1 And valor2 (la condición Not es opcional)&lt;br /&gt;En este caso la consulta devolvería los registros que contengan en "campo" un valor incluido en el intervalo valor1, valor2 (ambos inclusive). Si anteponemos la condición Not devolverá aquellos valores no incluidos en el intervalo.&lt;br /&gt;    SELECT * FROM Pedidos WHERE CodPostal Between 28000 And 28999;     (Devuelve los pedidos realizados en la provincia de Madrid)&lt;br /&gt;    SELECT IIf(CodPostal Between 28000 And 28999, 'Provincial', 'Nacional')     FROM Editores;     (Devuelve el valor 'Provincial' si el código postal se encuentra en el intervalo,     'Nacional' en caso contrario)&lt;br /&gt;3.3 &lt;a name="3.3"&gt;&lt;/a&gt;El Operador Like&lt;br /&gt;Se utiliza para comparar una expresión de cadena con un modelo en una expresión SQL. Su sintaxis es:&lt;br /&gt;    expresión Like modelo&lt;br /&gt;En donde expresión es una cadena modelo o campo contra el que se compara expresión. Se puede utilizar el operador Like para encontrar valores en los campos que coincidan con el modelo especificado. Por modelo puede especificar un valor completo (Ana María), o se pueden utilizar caracteres comodín como los reconocidos por el sistema operativo para encontrar un rango de valores (Like An*).&lt;br /&gt;El operador Like se puede utilizar en una expresión para comparar un valor de un campo con una expresión de cadena. Por ejemplo, si introduce Like C* en una consulta SQL, la consulta devuelve todos los valores de campo que comiencen por la letra C. En una consulta con parámetros, puede hacer que el usuario escriba el modelo que se va a utilizar.&lt;br /&gt;El ejemplo siguiente devuelve los datos que comienzan con la letra P seguido de cualquier letra entre A y F y de tres dígitos:&lt;br /&gt;    Like 'P[A-F]###'&lt;br /&gt;Este ejemplo devuelve los campos cuyo contenido empiece con una letra de la A a la D seguidas de cualquier cadena.&lt;br /&gt;    Like '[A-D]*'&lt;br /&gt;En la tabla siguiente se muestra cómo utilizar el operador Like para comprobar expresiones con diferentes modelos.    &lt;br /&gt;Tipo de coincidencia&lt;br /&gt;Modelo Planteado&lt;br /&gt;Coincide&lt;br /&gt;No coincide&lt;br /&gt;Varios caracteres&lt;br /&gt;'a*a'&lt;br /&gt;'aa', 'aBa', 'aBBBa'&lt;br /&gt;'aBC'&lt;br /&gt;Carácter especial&lt;br /&gt; 'a[*]a'&lt;br /&gt;'a*a'&lt;br /&gt;'aaa'&lt;br /&gt;Varios caracteres&lt;br /&gt;'ab*'&lt;br /&gt;'abcdefg', 'abc'&lt;br /&gt;'cab', 'aab'&lt;br /&gt;Un solo carácter&lt;br /&gt;'a?a'&lt;br /&gt;'aaa', 'a3a', 'aBa'&lt;br /&gt;'aBBBa'&lt;br /&gt;Un solo dígito&lt;br /&gt;'a#a'&lt;br /&gt;'a0a', 'a1a', 'a2a'&lt;br /&gt;'aaa', 'a10a'&lt;br /&gt;Rango de caracteres&lt;br /&gt;'[a-z]'&lt;br /&gt;'f', 'p', 'j'&lt;br /&gt;'2', '&amp;'&lt;br /&gt;Fuera de un rango&lt;br /&gt;'[!a-z]'&lt;br /&gt;'9', '&amp;amp;', '%'&lt;br /&gt;'b', 'a'&lt;br /&gt;Distinto de un dígito&lt;br /&gt;'[!0-9]'&lt;br /&gt;'A', 'a', '&amp;', '~'&lt;br /&gt;'0', '1', '9'&lt;br /&gt;Combinada&lt;br /&gt;'a[!b-m]#'&lt;br /&gt;'An9', 'az0', 'a99'&lt;br /&gt;'abc', 'aj0'&lt;br /&gt; &lt;br /&gt;3.4 &lt;a name="3.4"&gt;&lt;/a&gt;El Operador In&lt;br /&gt;Este operador devuelve aquellos registros cuyo campo indicado coincide con alguno de los en una lista. Su sintaxis es:&lt;br /&gt;    expresión [Not] In(valor1, valor2, . . .)&lt;br /&gt;    SELECT * FROM Pedidos WHERE Provincia In ('Madrid', 'Barcelona', 'Sevilla');  &lt;br /&gt;3.5 &lt;a name="3.5"&gt;&lt;/a&gt;La cláusula WHERE   La cláusula WHERE puede usarse para determinar qué registros de las tablas enumeradas en la cláusula FROM aparecerán en los resultados de la instrucción SELECT. Depués de escribir esta cláusula se deben especificar las condiciones expuestas en los partados 3.1 y 3.2. Si no se emplea esta cláusula, la consulta devolverá todas las filas de la tabla. WHERE es opcional, pero cuando aparece debe ir a continuación de FROM.&lt;br /&gt;    SELECT Apellidos, Salario FROM Empleados WHERE Salario &gt; 21000;&lt;br /&gt;    SELECT Id_Producto, Existencias FROM Productos     WHERE Existencias &lt;= Nuevo_Pedido;&lt;br /&gt;    SELECT * FROM Pedidos WHERE Fecha_Envio = #5/10/94#;&lt;br /&gt;    SELECT Apellidos, Nombre FROM Empleados WHERE Apellidos = 'King';&lt;br /&gt;    SELECT Apellidos, Nombre FROM Empleados WHERE Apellidos Like 'S*';&lt;br /&gt;    SELECT Apellidos, Salario FROM Empleados WHERE Salario Between 200 And 300;&lt;br /&gt;    SELECT Apellidos, Salario FROM Empl WHERE Apellidos Between 'Lon' And 'Tol';&lt;br /&gt;    SELECT Id_Pedido, Fecha_Pedido FROM Pedidos WHERE Fecha_Pedido     Between #1-1-94# And  #30-6-94#;&lt;br /&gt;    SELECT Apellidos, Nombre, Ciudad FROM Empleados WHERE Ciudad     In ('Sevilla', 'Los Angeles', 'Barcelona');&lt;br /&gt; &lt;br /&gt;4.    &lt;a name="4"&gt;&lt;/a&gt;Agrupamiento de Registros&lt;br /&gt;4.1    &lt;a name="4.1"&gt;&lt;/a&gt;GROUP BY&lt;br /&gt;Combina los registros con valores idénticos, en la lista de campos especificados, en un único registro. Para cada registro se crea un valor sumario si se incluye una función SQL agregada, como por ejemplo Sum o Count, en la instrucción SELECT. Su sintaxis es:&lt;br /&gt;    SELECT campos FROM tabla WHERE criterio GROUP BY campos del grupo&lt;br /&gt;GROUP BY es opcional.  Los valores de resumen se omiten si no existe una función SQL agregada en la instrucción SELECT. Los valores Null en los campos GROUP BY se agrupan y no se omiten. No obstante, los valores Null no se evalúan en ninguna de las funciones SQL agregadas.&lt;br /&gt;Se utiliza la cláusula WHERE para excluir aquellas filas que no desea agrupar, y la cláusula HAVING para filtrar los registros una vez agrupados.&lt;br /&gt;A menos que contenga un dato Memo u Objeto OLE , un campo de la lista de campos GROUP BY puede referirse a cualquier campo de las tablas que aparecen en la cláusula FROM, incluso si el campo no esta incluido en la instrucción SELECT, siempre y cuando la instrucción SELECT incluya al menos una función SQL agregada.&lt;br /&gt;Todos los campos de la lista de campos de SELECT deben o bien incluirse en la cláusula GROUP BY o como argumentos de una función SQL agregada.&lt;br /&gt;    SELECT Id_Familia, Sum(Stock) FROM Productos GROUP BY Id_Familia;&lt;br /&gt;Una vez que GROUP BY ha combinado los registros, HAVING muestra cualquier registro agrupado por la cláusula GROUP BY que satisfaga las condiciones de la cláusula HAVING.&lt;br /&gt;HAVING es similar a WHERE, determina qué registros se seleccionan. Una vez que los registros se han agrupado utilizando GROUP BY, HAVING determina cuales de ellos se van a mostrar.&lt;br /&gt;    SELECT Id_Familia Sum(Stock) FROM Productos GROUP BY Id_Familia     HAVING Sum(Stock) &gt; 100 AND NombreProducto Like BOS*;&lt;br /&gt;4.2    &lt;a name="4.2"&gt;&lt;/a&gt;AVG&lt;br /&gt;Calcula la media aritmética de un conjunto de valores contenidos en un campo especificado de una consulta. Su sintaxis es la siguiente&lt;br /&gt;    Avg(expr)&lt;br /&gt;En donde expr representa  el campo que contiene los datos numéricos para los que se desea calcular la media o una expresión que realiza un cálculo utilizando los datos de dicho campo. La media calculada por Avg es la media aritmética (la suma de los valores dividido por el número de valores). La función Avg no incluye ningún campo Null en el cálculo.&lt;br /&gt;    SELECT Avg(Gastos) AS Promedio FROM Pedidos WHERE Gastos &gt; 100;&lt;br /&gt;4.3    &lt;a name="4.3"&gt;&lt;/a&gt;Count&lt;br /&gt;Calcula el número de registros devueltos por una consulta. Su sintaxis es la siguiente&lt;br /&gt;    Count(expr)&lt;br /&gt;En donde expr contiene el nombre del campo que desea contar. Los operandos de expr pueden incluir el nombre de un campo de una tabla, una constante o una función (la cual puede ser intrínseca o definida por el usuario pero no otras de las funciones agregadas de SQL). Puede contar cualquier tipo de datos incluso texto.&lt;br /&gt;Aunque expr puede realizar un cálculo sobre un campo, Count simplemente cuenta el número de registros sin tener en cuenta qué valores se almacenan en los registros. La función Count no cuenta los registros que tienen campos null a menos que expr sea el carácter comodín asterisco (*). Si utiliza un asterisco, Count calcula el número total de registros, incluyendo aquellos que contienen campos null. Count(*) es considerablemente más rápida que Count(Campo). No se debe poner el asterisco entre dobles comillas ('*').&lt;br /&gt;    SELECT Count(*) AS Total  FROM Pedidos;&lt;br /&gt;Si expr identifica a múltiples campos, la función Count cuenta un registro sólo si al menos uno de los campos no es Null. Si todos los campos especificados son Null, no se cuenta el registro. Hay que separar los nombres de los campos con ampersand (&amp;).&lt;br /&gt;    SELECT Count(FechaEnvío &amp; Transporte) AS Total FROM Pedidos;&lt;br /&gt;4.4    &lt;a name="4.4"&gt;&lt;/a&gt;Max, Min&lt;br /&gt;Devuelven el mínimo o el máximo de un conjunto de valores contenidos en un campo especifico de una consulta. Su sintaxis es:&lt;br /&gt;    Min(expr)     Max(expr)&lt;br /&gt;En donde expr es el campo sobre el que se desea realizar el cálculo. Expr pueden incluir el nombre de un campo de una tabla, una constante o una función (la cual puede ser intrínseca o definida por el usuario pero no otras de las funciones agregadas de SQL).&lt;br /&gt;    SELECT Min(Gastos) AS ElMin FROM Pedidos WHERE Pais = 'España';     SELECT Max(Gastos) AS ElMax FROM Pedidos WHERE Pais  = 'España';&lt;br /&gt;4.5    &lt;a name="4.5"&gt;&lt;/a&gt;StDev, StDevP&lt;br /&gt;Devuelve estimaciones de la desviación estándar para la población (el total de los registros de la tabla) o una muestra de la población representada (muestra aleatoria) . Su sintaxis es:&lt;br /&gt;    StDev(expr)     StDevP(expr)&lt;br /&gt;En donde expr representa el nombre del campo que contiene los datos que desean evaluarse o una expresión que realiza un cálculo utilizando los datos de dichos campos. Los operandos de expr pueden incluir el nombre de un campo de una tabla, una constante o una función (la cual puede ser intrínseca o definida por el usuario pero no otras de las funciones agregadas de SQL)&lt;br /&gt;StDevP evalúa una población, y StDev evalúa una muestra de la población. Si la consulta contiene menos de dos registros (o ningún registro para StDevP), estas funciones devuelven un valor Null (el cual indica que la desviación estándar no puede calcularse).&lt;br /&gt;    SELECT StDev(Gastos) AS Desviacion FROM Pedidos WHERE Pais = 'España';     SELECT StDevP(Gastos) AS Desviacion FROM Pedidos WHERE Pais= 'España';&lt;br /&gt;4.6    &lt;a name="4.6"&gt;&lt;/a&gt;Sum&lt;br /&gt;Devuelve la suma del conjunto de valores contenido en un campo especifico de una consulta. Su sintaxis es:&lt;br /&gt;    Sum(expr)&lt;br /&gt;En donde expr respresenta el nombre del campo que contiene los datos que desean sumarse o una expresión que realiza un cálculo utilizando los datos de dichos campos. Los operandos de expr pueden incluir el nombre de un campo de una tabla, una constante o una función (la cual puede ser intrínseca o definida por el usuario pero no otras de las funciones agregadas de SQL).&lt;br /&gt;    SELECT Sum(PrecioUnidad * Cantidad) AS Total FROM DetallePedido;&lt;br /&gt;4.7    &lt;a name="4.7"&gt;&lt;/a&gt;Var, VarP   Devuelve una estimación de la varianza de una población (sobre el total de los registros) o una muestra de la población (muestra aleatoria de registros) sobre los valores de un campo. Su sintaxis es:&lt;br /&gt;    Var(expr)     VarP(expr)&lt;br /&gt;VarP evalúa una población, y Var evalúa una muestra de la población. Expr el nombre del campo que contiene los datos que desean evaluarse o una expresión que realiza un cálculo utilizando los datos de dichos campos. Los operandos de expr pueden incluir el nombre de un campo de una tabla, una constante o una función (la cual puede ser intrínseca o definida por el usuario pero no otras de las funciones agregadas de SQL)&lt;br /&gt;Si la consulta contiene menos de dos registros, Var y VarP devuelven Null (esto indica que la varianza no puede calcularse). Puede utilizar Var y VarP en una expresión de consulta o en una Instrucción SQL.&lt;br /&gt;    SELECT Var(Gastos) AS Varianza FROM Pedidos WHERE Pais = 'España';     SELECT VarP(Gastos) AS Varianza FROM Pedidos WHERE Pais = 'España';&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-5221255315401489844?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/5221255315401489844/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=5221255315401489844&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/5221255315401489844'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/5221255315401489844'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/03/3-criterios-de-seleccin.html' title='3. Criterios de Selección'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-5842041175104406229</id><published>2007-03-26T19:47:00.000-07:00</published><updated>2007-03-26T19:49:20.737-07:00</updated><title type='text'>Tutorial de SQL</title><content type='html'>1.- &lt;a name="1"&gt;&lt;/a&gt;INTRODUCCION&lt;br /&gt;El lenguaje de consulta estructurado (SQL) es un lenguaje de base de datos normalizado, utilizado por el motor de base de datos de Microsoft Jet. SQL se utiliza para crear objetos QueryDef, como el argumento de origen del método OpenRecordSet y como la propiedad RecordSource del control de datos. También se puede utilizar con el método Execute para crear y manipular directamente las bases de datos Jet y crear consultas SQL de paso a través para manipular bases de datos remotas cliente - servidor.&lt;br /&gt;1.1. &lt;a name="1.1"&gt;&lt;/a&gt;Componentes del SQL&lt;br /&gt;El lenguaje SQL está compuesto por comandos, cláusulas, operadores y funciones de agregado. Estos elementos se combinan en las instrucciones para crear, actualizar y manipular las bases de datos.&lt;br /&gt;1.2 &lt;a name="1.2"&gt;&lt;/a&gt;Comandos&lt;br /&gt;Existen dos tipos de comandos SQL:  &lt;br /&gt;los DLL que permiten crear y definir nuevas bases de datos, campos e índices.&lt;br /&gt;los DML que permiten generar consultas para ordenar, filtrar y extraer datos de la base de datos.&lt;br /&gt; &lt;br /&gt;Comandos DLL&lt;br /&gt;Comando&lt;br /&gt;Descripción&lt;br /&gt;CREATE&lt;br /&gt;Utilizado para crear nuevas tablas, campos e índices&lt;br /&gt;DROP&lt;br /&gt;Empleado para eliminar tablas e índices&lt;br /&gt;ALTER&lt;br /&gt;Utilizado para modificar las tablas agregando campos o cambiando la definición de los campos.&lt;br /&gt;   &lt;br /&gt;Comandos DML&lt;br /&gt;Comando&lt;br /&gt;Descripción&lt;br /&gt;SELECT&lt;br /&gt;Utilizado para consultar registros de la base de datos que satisfagan un criterio determinado&lt;br /&gt;INSERT&lt;br /&gt;Utilizado para cargar lotes de datos en la base de datos en una única operación.&lt;br /&gt;UPDATE&lt;br /&gt;Utilizado para modificar los valores de los campos y registros especificados&lt;br /&gt;DELETE&lt;br /&gt;Utilizado para eliminar registros de una tabla de una base de datos&lt;br /&gt;1.3 &lt;a name="1.3"&gt;&lt;/a&gt;Cláusulas&lt;br /&gt;Las cláusulas son condiciones de modificación utilizadas para definir los datos que desea seleccionar o manipular.  &lt;br /&gt;Cláusula&lt;br /&gt;Descripción&lt;br /&gt;FROM&lt;br /&gt;Utilizada para especificar la tabla de la cual se van a seleccionar los registros&lt;br /&gt;WHERE&lt;br /&gt;Utilizada para especificar las condiciones que deben reunir los registros que se van a seleccionar&lt;br /&gt;GROUP BY&lt;br /&gt;Utilizada para separar los registros seleccionados en grupos específicos&lt;br /&gt;HAVING&lt;br /&gt;Utilizada para expresar la condición que debe satisfacer cada grupo&lt;br /&gt;ORDER BY&lt;br /&gt;Utilizada para ordenar los registros seleccionados de acuerdo con un orden específico&lt;br /&gt;1.4 &lt;a name="1.4"&gt;&lt;/a&gt;Operadores Lógicos  &lt;br /&gt;Operador&lt;br /&gt;Uso&lt;br /&gt;AND&lt;br /&gt;Es el "y" lógico. Evalua dos condiciones y devuelve un valor de verdad sólo si ambas son ciertas.&lt;br /&gt;OR&lt;br /&gt;Es el "o" lógico. Evalúa dos condiciones y devuelve un valor de verdar si alguna de las dos es cierta.&lt;br /&gt;NOT&lt;br /&gt;Negación lógica. Devuelve el valor contrario de la expresión.&lt;br /&gt;1.5 &lt;a name="1.5"&gt;&lt;/a&gt;Operadores de Comparación  &lt;br /&gt;Operador&lt;br /&gt;Uso&lt;br /&gt;&lt;&lt;br /&gt;Menor que&lt;br /&gt;&gt;&lt;br /&gt;Mayor que&lt;br /&gt;&lt;&gt;&lt;br /&gt;Distinto de&lt;br /&gt;&lt;=&lt;br /&gt;Menor ó Igual que&lt;br /&gt;&gt;=&lt;br /&gt;Mayor ó Igual que&lt;br /&gt;=&lt;br /&gt;Igual que&lt;br /&gt;BETWEEN&lt;br /&gt;Utilizado para especificar un intervalo de valores.&lt;br /&gt;LIKE&lt;br /&gt;Utilizado en la comparación de un modelo&lt;br /&gt;In&lt;br /&gt;Utilizado para especificar registros de una base de datos  &lt;br /&gt;1.6 &lt;a name="1.6"&gt;&lt;/a&gt;Funciones de Agregado&lt;br /&gt;Las funciones de agregado se usan dentro de una cláusula SELECT en grupos de registros para devolver un único valor que se aplica a un grupo de registros.    &lt;br /&gt;Función&lt;br /&gt;Descripción&lt;br /&gt;AVG&lt;br /&gt;Utilizada para calcular el promedio de los valores de un campo determinado&lt;br /&gt;COUNT&lt;br /&gt;Utilizada para devolver el número de registros de la selección&lt;br /&gt;SUM&lt;br /&gt;Utilizada para devolver la suma de todos los valores de un campo determinado&lt;br /&gt;MAX&lt;br /&gt;Utilizada para devolver el valor más alto de un campo especificado&lt;br /&gt;MIN&lt;br /&gt;Utilizada para devolver el valor más bajo de un campo especificado&lt;br /&gt; &lt;br /&gt;2. &lt;a name="2"&gt;&lt;/a&gt;Consultas de Selección&lt;br /&gt;Las consultas de selección se utilizan para indicar al motor de datos que devuelva información de las bases de datos, esta información es devuelta en forma de conjunto de registros que se pueden almacenar en un objeto recordset. Este conjunto de registros es modificable.&lt;br /&gt;2.1 &lt;a name="2.1"&gt;&lt;/a&gt;Consultas básicas&lt;br /&gt;La sintaxis básica de una consulta de selección es la siguiente:&lt;br /&gt;        SELECT Campos FROM Tabla;&lt;br /&gt;En donde campos es la lista de campos que se deseen recuperar y tabla es el origen de los mismos, por ejemplo:&lt;br /&gt;        SELECT Nombre, Telefono FROM Clientes;&lt;br /&gt;Esta consulta devuelve un recordset con el campo nombre y teléfono de la tabla clientes.&lt;br /&gt;2.2 &lt;a name="2.2"&gt;&lt;/a&gt;Ordenar los registros&lt;br /&gt;Adicionalmente se puede especificar el orden en que se desean recuperar los registros de las tablas mediante la claúsula ORDER BY Lista de Campos. En donde Lista de campos representa los campos a ordenar. Ejemplo:&lt;br /&gt;        SELECT CodigoPostal, Nombre, Telefono FROM Clientes ORDER BY Nombre;&lt;br /&gt;Esta consulta devuelve los campos CodigoPostal, Nombre, Telefono de la tabla Clientes ordenados por el campo Nombre.&lt;br /&gt;Se pueden ordenar los registros por mas de un campo, como por ejemplo:&lt;br /&gt;        SELECT CodigoPostal, Nombre, Telefono FROM Clientes ORDER BY         CodigoPostal, Nombre;&lt;br /&gt;Incluso se puede especificar el orden de los registros: ascendente mediante la claúsula (ASC -se toma este valor por defecto) ó descendente (DESC)&lt;br /&gt;        SELECT CodigoPostal, Nombre, Telefono FROM Clientes ORDER BY         CodigoPostal DESC , Nombre ASC;&lt;br /&gt;2.3 &lt;a name="2.3"&gt;&lt;/a&gt;Consultas con Predicado&lt;br /&gt;El predicado se incluye entre la claúsula y el primer nombre del campo a recuperar, los posibles predicados son:    &lt;br /&gt;Predicado&lt;br /&gt;Descripción&lt;br /&gt;ALL&lt;br /&gt;Devuelve todos los campos de la tabla&lt;br /&gt;TOP&lt;br /&gt;Devuelve un determinado número de registros de la tabla&lt;br /&gt;DISTINCT&lt;br /&gt;Omite los registros cuyos campos seleccionados coincidan totalmente&lt;br /&gt;DISTINCTROW&lt;br /&gt;Omite los registros duplicados basandose en la totalidad del registro y no sólo en los campos seleccionados.&lt;br /&gt;ALL&lt;br /&gt;Si no se incluye ninguno de los predicados se asume ALL. El Motor de base de datos  selecciona todos los registros que cumplen las condiciones de la instrucción SQL. No se conveniente abusar de este predicado ya que obligamos al motor de la base de datos a analizar la estructura de la tabla para averiguar los campos que contiene, es mucho más rápido indicar el listado de campos deseados.&lt;br /&gt;    SELECT ALL FROM Empleados;     SELECT * FROM Empleados;   TOP&lt;br /&gt;Devuelve un cierto número de registros que entran entre al principio o al final de un rango especificado por una cláusula ORDER BY. Supongamos que queremos recuperar los nombres de los 25 primeros estudiantes del curso 1994:&lt;br /&gt;    SELECT TOP 25 Nombre, Apellido FROM Estudiantes     ORDER BY Nota DESC;&lt;br /&gt;Si no se incluye la cláusula ORDER BY, la consulta devolverá un conjunto arbitrario de 25 registros de la tabla Estudiantes .El predicado TOP no elige entre valores iguales. En el ejemplo anterior, si la nota media número 25 y la 26 son iguales, la consulta devolverá 26 registros. Se puede utilizar la palabra reservada PERCENT para devolver un cierto porcentaje de registros que caen al principio o al final de un rango especificado por la cláusula ORDER BY. Supongamos que en lugar de los 25 primeros estudiantes deseamos el 10 por ciento del curso:&lt;br /&gt;    SELECT TOP 10 PERCENT Nombre, Apellido FROM Estudiantes     ORDER BY Nota DESC;&lt;br /&gt;El valor que va a continuación de TOP debe ser un Integer sin signo.TOP no afecta a la posible actualización de la consulta.&lt;br /&gt;DISTINCT&lt;br /&gt;Omite los registros que contienen datos duplicados en los campos seleccionados. Para que los valores de cada campo listado en la instrucción SELECT se incluyan en la consulta deben ser únicos.&lt;br /&gt;Por ejemplo, varios empleados listados en la tabla Empleados pueden tener el mismo apellido. Si dos registros contienen López en el campo Apellido, la siguiente instrucción SQL devuelve un único registro:&lt;br /&gt;    SELECT DISTINCT Apellido FROM Empleados;&lt;br /&gt;Con otras palabras el predicado DISTINCT devuelve aquellos registros cuyos campos indicados en la cláusula SELECT posean un contenido diferente. El resultado de una consulta que utiliza DISTINCT no es actualizable y no refleja los cambios subsiguientes realizados por otros usuarios.&lt;br /&gt;DISTINCTROW&lt;br /&gt;Devuelve los registros diferentes de una tabla; a diferencia del predicado anterior que sólo se fijaba en el contenido de los campos seleccionados, éste lo hace en el contenido del registro completo independientemente de los campo indicados en la cláusula SELECT.  &lt;br /&gt;    SELECT DISTINCTROW Apellido FROM Empleados;&lt;br /&gt;Si la tabla empleados contiene dos registros: Antonio López y Marta López el ejemplo del predicado DISTINCT devuleve un único registro con el valor López en el campo Apellido ya que busca no duplicados en dicho campo. Este último ejemplo devuelve dos registros con el valor López en el apellido ya que se buscan no duplicados en el registro completo.   2.4 &lt;a name="2.4"&gt;&lt;/a&gt;Alias&lt;br /&gt;En determinadas circunstancias es necesario asignar un nombre a alguna columna determinada de un conjunto devuelto, otras veces por simple capricho o por otras circunstancias. Para resolver todas ellas tenemos la palabra reservada AS que se encarga de asignar el nombre que deseamos a la columna deseada. Tomado como referencia el ejemplo anterior podemos hacer que la columna devuelta por la consulta, en lugar de llamarse apellido (igual que el campo devuelto) se llame Empleado. En este caso procederíamos de la siguiente forma:&lt;br /&gt;    SELECT DISTINCTROW Apellido AS Empleado FROM Empleados;&lt;br /&gt;2.5 &lt;a name="2.5"&gt;&lt;/a&gt;Recuperar Información de una base de Datos Externa&lt;br /&gt;Para concluir este capítulo se debe hacer referencia a la recuperación de registros de bases de datos externa. Es ocasiones es necesario la recuperación de información que se encuentra contenida en una tabla que no se encuentra en la base de datos que ejecutará la consulta o que en ese momento no se encuentra abierta, esta situación la podemos salvar con la palabra reservada IN de la siguiente forma:&lt;br /&gt;    SELECT DISTINCTROW Apellido AS Empleado FROM Empleados     IN 'c:\databases\gestion.mdb';&lt;br /&gt;En donde c:\databases\gestion.mdb es la base de datos que contiene la tabla Empleados.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-5842041175104406229?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/5842041175104406229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=5842041175104406229&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/5842041175104406229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/5842041175104406229'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/03/tutorial-de-sql.html' title='Tutorial de SQL'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-8784297444926464705</id><published>2007-03-26T19:31:00.000-07:00</published><updated>2007-03-26T19:39:32.629-07:00</updated><title type='text'>Tutorial ASP Secuencias de comandos asp</title><content type='html'>Agregar secuencias de comandos&lt;br /&gt;Como vimos anteriormente, una pagina ASP mezcla en el mismo archivo secuencias de comandos con código HTML standard. Las secuencias de comandos asp se distinguen del resto del texto del archivo mediante delimitadores (un delimitador es un carácter o secuencia de caracteres que marca el principio o final de una unidad).&lt;br /&gt;En el caso de HTML , dichos delimitadores son los símbolos "&lt;" y "&gt;" que enmarcan las etiquetas Html. ASP utiliza los delimitadores&lt;br /&gt;""&lt;br /&gt;para enmarcar las secuencias de comandos.&lt;br /&gt;Veamos esto con un ejemplo sencillo:&lt;a name="ej1"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Hola, bienvenido a mi página, estamos a :&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.asptutor.com/asp/ejemplos/ejemplo1.asp"&gt;&lt;/a&gt;&lt;br /&gt;La función NOW() de VBScript devuelve la fecha y hora actuales.Cuando el servidor Web procese la pagina nos devolverá el siguiente resultado al explorador:&lt;br /&gt;&lt;br /&gt;Hola, bienvenido a mi página, estamos a : 4/1/2000 14:25:55 PM&lt;br /&gt;&lt;br /&gt;Como vemos, el cliente, no recibe el código asp, recibe el resultado de la ejecución de dicho código.&lt;br /&gt;Dentro de los delimitadores ASP se puede incluir cualquier instrucción, expresión, procedimiento u operador válido para el lenguaje de programación que estemos usando. Un ejemplo de esto seria una página que nos mostraría:&lt;br /&gt;Buenos días&lt;br /&gt;si la ejecutamos antes de las 12:00 o:&lt;br /&gt;Buenas Tardes&lt;br /&gt;si la ejecutamos después de esta hora, el código seria el siguiente:&lt;a name="ej2"&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Buenos días&lt;br /&gt;&lt;br /&gt;Buenas Tardes&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.asptutor.com/asp/ejemplos/ejemplo2.asp"&gt;&lt;/a&gt;&lt;br /&gt;Establecer el lenguaje de la aplicación&lt;br /&gt;ASP viene de forma nativa con dos motores de secuencia de comandos Microsoft Visual Basic Scriptig Edition (VBScript) y Microsoft JScript. Puede instalar y utilizar motores de otros lenguajes como REXX y Perl.&lt;br /&gt;Para establecer el lenguaje principal de secuencia de comandos en todas las páginas de una aplicación, establezca la propiedad Lenguaje ASP predeterminado en la ficha Opciones de la Aplicación en el Administrador de Servicios Internet.&lt;br /&gt;Para establecer el lenguaje principal de secuencia de comandos en una única página, hay que agregar la directiva al principio del archivo .asp. La sintaxis de esta directiva es la siguiente:&lt;br /&gt;&lt;br /&gt;donde Lenguaje_secuencia_comandos es el lenguaje principal de secuencia de comandos que va a establecer en esa página concreta. El valor de la página invalida el valor global de todas las páginas de la aplicación.&lt;br /&gt;Todos los ejemplos de estas páginas están escritos en VBScript&lt;br /&gt;&lt;br /&gt;Comentarios en VBScript&lt;br /&gt;VBScript acepta comentarios marcados con apóstrofes. Estos comentarios se eliminan al procesarse la secuencia de comandos y no se envían al explorador.&lt;br /&gt;'Esta linea y las siguientes son comentarios.&lt;br /&gt;'La función ImprimirTabla imprime los elementos de una matriz.&lt;br /&gt;Call ImprimirTabla (mimatriz( ))&lt;br /&gt;No puede incluir comentarios en expresiones de resultados. Por ejemplo, la primera línea que sigue funciona, pero la segunda no, porque empieza con&lt;br /&gt;&lt;br /&gt;Distinguir entre mayúsculas y minúsculas&lt;br /&gt;VBScript no distingue entre mayúsculas y minúsculas।&lt;br /&gt;Tipos de datos en VBScript&lt;br /&gt;Vbscript solo tiene un tipo de datos llamado Variant.&lt;br /&gt;El tipo Variant es una clase especial de datos que puede contener diferentes tipos de información, se comporta como un número cuando se utiliza en un contexto numérico, y como una cadena de caracteres cuando se usa en un contexto de cadena, no obstante podemos forzar a que los números se comporten como cadenas poniéndolos entre comillas (" ").&lt;br /&gt;Aunque solo existe un tipo de datos, podemos hacer distinciones mas precisas acerca de la naturaleza de la información a través de los Subtipos incluidos en el tipo Variant, además vbscript pone a nuestra disposición &lt;a href="http://www.asptutor.com/asp/vart.asp?id=44#funciones"&gt;funciones&lt;/a&gt; para convertir los datos de un tipo a otro.&lt;br /&gt;&lt;a name="tabla1"&gt;&lt;/a&gt;Subtipo&lt;br /&gt;Descripción&lt;br /&gt;Valor de Vartype&lt;br /&gt;Empty&lt;br /&gt;Variable sin inicializar&lt;br /&gt;0&lt;br /&gt;Null&lt;br /&gt;Variable intencionadamente vacia&lt;br /&gt;1&lt;br /&gt;Boolean&lt;br /&gt;Dos valores posibles True o False&lt;br /&gt;11&lt;br /&gt;Byte&lt;br /&gt;Entero entre 0 y 255&lt;br /&gt;17&lt;br /&gt;Integer&lt;br /&gt;Entero entre -32.768 y 32.768&lt;br /&gt;2&lt;br /&gt;Currency&lt;br /&gt;Numero entre -922.337.203.685.477,5808 y 922.337.203.685.477,5807&lt;br /&gt;6&lt;br /&gt;Long&lt;br /&gt;Numero entre -2.147.483.648 y 2.147.483.647&lt;br /&gt;3&lt;br /&gt;Single&lt;br /&gt;Numero de precisión simple&lt;br /&gt;4&lt;br /&gt;Double&lt;br /&gt;Numero de doble precisión&lt;br /&gt;5&lt;br /&gt;Date&lt;br /&gt;Fecha entre 1-1-100 y 31-12-9999&lt;br /&gt;7&lt;br /&gt;String&lt;br /&gt;Cadena de longitud variable hasta 2.000.000.000 de caracteres.&lt;br /&gt;8&lt;br /&gt;Object&lt;br /&gt;Contiene un Objeto&lt;br /&gt;9&lt;br /&gt;Error&lt;br /&gt;Contiene un numero de error&lt;br /&gt;10&lt;br /&gt;&lt;a name="funciones"&gt;&lt;/a&gt;Conversión de Tipos&lt;br /&gt;Todas la funciones de conversión de tipos tienen la misma sintaxis:&lt;br /&gt;Funcion(expresión), siendo expresión el dato que se desea convertir.&lt;br /&gt;Cbool&lt;br /&gt;Convierte una expresión a tipo Boolean&lt;br /&gt;Cbyte&lt;br /&gt;Convierte una expresión a tipo Byte&lt;br /&gt;Clnt&lt;br /&gt;Convierte una expresión a tipo Integer&lt;br /&gt;Clng&lt;br /&gt;Convierte una expresión a tipo Long&lt;br /&gt;Csng&lt;br /&gt;Convierte una expresión a tipo Single&lt;br /&gt;Cdbl&lt;br /&gt;Convierte una expresión a tipo Double&lt;br /&gt;Ccur&lt;br /&gt;Convierte una expresión a tipo Curency&lt;br /&gt;Cdate&lt;br /&gt;Convierte una expresión a tipo Date&lt;br /&gt;Cstr&lt;br /&gt;Convierte una expresión a tipo String&lt;br /&gt;&lt;br /&gt;Tambien podemos podemos conocer el subtipo de una variable mediante la función Vartype(variable) que nos devuelve el valor referenciado en la tercera columna de la &lt;a href="http://www.asptutor.com/asp/vart.asp?id=44#tabla1"&gt;tabla 1&lt;/a&gt;&lt;br /&gt;Variables en VBScript&lt;br /&gt;Vbscript no necesita la declaración explicita de variables, pero es conveniente su declaración para evitar errores (se puede forzar la declaración de variables incluyendo la sentencia al principio de la pagina .asp).&lt;br /&gt;Para declarar una variable se utiliza la instrucción DIM. PUBLIC o PRIVATE. Por ejemplo:&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-8784297444926464705?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/8784297444926464705/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=8784297444926464705&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/8784297444926464705'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/8784297444926464705'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/03/tutorial-asp-secuencias-de-comandos-asp.html' title='Tutorial ASP Secuencias de comandos asp'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-2102643483659196250</id><published>2007-03-26T19:21:00.000-07:00</published><updated>2007-03-26T19:28:59.771-07:00</updated><title type='text'>Tutorial ASP</title><content type='html'>Páginas Active Server&lt;br /&gt;Páginas Active Server (ASP, Active Server Pages) es un entorno para crear y ejecutar aplicaciones dinámicas e interactivas en la Web.Se puede combinar páginas HTML, secuencias de comandos y componentes ActiveX para crear paginas y aplicaciones Web interactivas.&lt;br /&gt;El modelo de Páginas ASP&lt;br /&gt;Las páginas ASP comienzan a ejecutarse cuando un usuario solicita un archivo .asp al servidor Web a través del explorador. El servidor web llama a ASP, que lee el archivo solicitado, ejecuta las secuencias de comandos que encuentre y envía los resultados al explorador del cliente.&lt;br /&gt;Puesto que las secuencias de comandos se ejecutan en el servidor, y NO en el cliente, es el servidor el que hace todo  el trabajo necesario para generar las paginas que se envían al explorador. Las secuencias de comandos quedan ocultas a los usuarios, estos solo reciben el resultado de la ejecución en formato HTML.&lt;br /&gt;Desaparece por tanto el problema de si el cliente puede o no ejecutar sentencias de comandos, el servidor Web solo envía el resultado en código HTML standard interpretable por cualquier explorador.&lt;br /&gt;Crear Páginas ASP&lt;br /&gt;Los archivos .asp son archivos de texto normales, no es necesario ningún editor especial para crearlos, puede usarse cualquier editor que genere código ascii.Un archivo .asp puede contener texto, código HTML, código ASP o cualquier combinación de estos. Si no contiene código ASP se comporta como un archivo .html normal.&lt;br /&gt;(Nota: todos los archivos .asp requieren una parte de proceso por el servidor, por lo cual no es conveniente convertir a  .asp los archivos que no contengan código)&lt;br /&gt;Internet Information Server&lt;br /&gt;&lt;a href="http://www.asptutor.com/asp/vart.asp?id=42#introduccion"&gt;Introducción&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.asptutor.com/asp/vart.asp?id=42#tcpip"&gt;Instalación de protocolo TCP/IP&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.asptutor.com/asp/vart.asp?id=42#seguridad"&gt;Seguridad del sitio Web&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a name="introduccion"&gt;&lt;/a&gt;1.-Introducción&lt;br /&gt;IIS es el software estándar que soporta comunicaciones Internet en Windows NT .&lt;br /&gt;No es el único, ni proporciona todos los servicios posibles; sin embargo su importancia es enorme al haberse convertido en uno de los más extendidos; haciendo fuerte competencia a los servidores basados en plataformas UNIX.&lt;br /&gt;El auge viene de la mano de la fuerte penetración de Windows NT, complementándose muy adecuadamente con este desde le punto de vista comercial y técnico.&lt;br /&gt;Proporciona unas buenas prestaciones en equipos con muy diferentes prestaciones de hardware.&lt;br /&gt;Es especialmente ventajoso en su utilización en redes Intranet debido a la compatibilidad y posibilidades de uso conjunto con los productos de la familia Microsoft (Word, access, odbc, etc.)&lt;br /&gt;Todo indica que el conjunto NT-IIS-Explorer será utilizado de forma creciente para la publicación de datos en Intranet/Internet.&lt;br /&gt;Los servicios básicos que nos proporciona IIS4 son WWW, FTP, Correo y NEWS.&lt;br /&gt;La instalación de IIS es sobre NT Server 4.0, aunque se puede instalar sobre Workstation o Windows 95-98 la versión PWS 4 con la consiguiente perdida de prestaciones.&lt;br /&gt;Workstation puede servir muy adecuadamente como banco de pruebas y aprendizaje.&lt;br /&gt;Una de las principales ventajas de IIS4 es el soporte nativo de páginas ASP (también se soportan en IIS3 mediante la actualización pertinente).&lt;br /&gt;Para publicar en Intranet necesitamos:&lt;br /&gt;Tarjeta adaptadora de red&lt;br /&gt;Un servidor DNS o WINS si deseamos usar nombres en vez de direcciones IP numéricas.&lt;br /&gt;Para publicar en Internet necesitamos:&lt;br /&gt;Una tarjeta de comunicaciones&lt;br /&gt;Una conexión a Internet&lt;br /&gt;Una dirección IP registrada en un DNS&lt;br /&gt;Todo esto nos lo proporciona los Proveedores de Servicios Internet (ISP), junto con la dirección IP de gateway de su servidor, a través del cual se realizaran los encaminamientos de la información.&lt;br /&gt;&lt;br /&gt;&lt;a name="tcpip"&gt;&lt;/a&gt;2.-Instalación del protocolo TCP/IP&lt;br /&gt;Se configura a través de la ventana Red en el Panel de Control de Windows, en esta ventana configuramos los servicios, protocolos, adaptadores y enlaces.&lt;br /&gt;En la pestaña Protocolos seleccionamos TCP/IP, si no aparece, lo añadiremos con el botón Agregar.&lt;br /&gt;Una vez escogido pulsamos Propiedades para configurarlo.&lt;br /&gt;Pestaña Dirección IP:&lt;br /&gt;Configuramos por cada tarjeta:&lt;br /&gt;Adaptador (Tipo de tarjeta)&lt;br /&gt;Dirección IP&lt;br /&gt;Mascara de subred&lt;br /&gt;Gateway&lt;br /&gt;Pestaña Dirección DNS:&lt;br /&gt;Nombre de Host + Dominio (identificación de la maquina que estamos configurando)&lt;br /&gt;Orden de búsqueda del servicio Dns&lt;br /&gt;Orden de búsqueda de sufijo de dominio (opcional)&lt;br /&gt;Todos estos parámetros nos los proporciona nuestro proveedor ISP.&lt;br /&gt;&lt;br /&gt;&lt;a name="seguridad"&gt;&lt;/a&gt;3.-Mecanismos de seguridad&lt;br /&gt;La seguridad de un sitio Web es especialmente importante, debido a la necesidad de garantizar su utilización por usuarios remotos.&lt;br /&gt;IIS 4.o utiliza la seguridad de Windows NT y en algunos casos la amplia.&lt;br /&gt;Se recomienda el uso del sistema de archivos NTFS de NT por su mayor seguridad.&lt;br /&gt;Windows NT basa su seguridad en el sistema de usuarios y contraseñas, el uso adecuado de estas contribuye a mantener el equipo seguro.&lt;br /&gt;La mayor parte de las peticiones de paginas Web son realizadas por clientes anónimos, en este caso, el servidor web se encarga de suplantar al usuario real mediante el uso de la cuenta del usuario anónimo.&lt;br /&gt;Mecanismo de seguridad en una petición:&lt;br /&gt;Comprobación de la dirección IP del cliente por IIS.&lt;br /&gt;Comprobación de usuario y contraseña.&lt;br /&gt;Comprobación de los permisos de acceso a archivos establecidos en el sistema NTFS.&lt;br /&gt;Si cualquiera de estas comprobaciones es errónea, la petición no tendrá éxito.&lt;br /&gt;Administración de la cuenta de usuario anónimo.&lt;br /&gt;Cuando se instala IIS se crea automáticamente en NT el usuario anónimo con el nombre IUSR_Nombre del equipo y con la misma contraseña aleatoria que en IIS y el derecho de Inicio de Sesión en Local.&lt;br /&gt;Conviene revisar los derechos de los grupos que tienen los grupos Todos e Invitados a los que pertenece el usuario anónimo.&lt;br /&gt;Para que el usuario anónimo funcione correctamente debemos activar Permitir Anónimos en las propiedades del servicio Web.&lt;br /&gt;Autenticación&lt;br /&gt;Si se desea, se puede restringir la utilización de los servicios Web de tal forma que únicamente los clientes que proporcionan un nombre de usuario y una contraseña válidos puedan acceder a las paginas solicitadas.&lt;br /&gt;En IIS existen 2 formas de autenticación:&lt;br /&gt;Autenticación Básica: El usuario y la clave se transmiten sin cifrar&lt;br /&gt;Autentificación Desafío/Respuesta de Windows NT: El usuario y la clave se transmiten cifrados; el usuario debe de estar dado de alta en el dominio de la maquina que ejecuta IIS y tener derechos de Acceso al equipo desde la red. Es muy adecuado en redes Intranet; precisa un cliente Internet Explorer en versión 2 como mínimo.&lt;br /&gt;Generalmente se permiten simultáneamente Anónimos y mecanismos de autenticación, en este caso en primer lugar se usa el usuario Anónimo y si se produce un error por falta de permisos de acceso a un recurso, el cliente recibe una ventana de dialogo solicitándole las credenciales.&lt;br /&gt;&lt;br /&gt;Establecimiento de permisos en los directorios y ficheros de un sitio Web (aspectos Básicos)&lt;br /&gt;De forma genérica un sitio Web reside en&lt;br /&gt;Un directorio particular&lt;br /&gt;Los subdirectorios que parten del particular&lt;br /&gt;Los directorios virtuales&lt;br /&gt;Cada uno de los elementos anteriores, en caso de existir, deberá poseer los suficientes permisos para que el sitio Web funcione correctamente, pero con las restricciones adecuadas para que el equipo este seguro.&lt;br /&gt;Una buena metodología consiste en agrupar los ficheros según su naturaleza y de forma jerárquica; de manera que tengamos separadas distintas aplicaciones en distintos directorios, con sus documentos en subdirectorios.&lt;br /&gt;La asignación general de permisos sigue la siguiente estructura:&lt;br /&gt;Programas CGI, ISAPI, etc&lt;br /&gt;Permiso de Ejecución&lt;br /&gt;Páginas ASP&lt;br /&gt;Permisos de Lectura y Ejecución&lt;br /&gt;Documentos estáticos HTML, Imágenes, etc&lt;br /&gt;Permiso de Lectura&lt;br /&gt;Bases de datos, ficheros auxiliares, etc.&lt;br /&gt;Permisos de Lectura y Escritura.&lt;br /&gt;Se debe tener en cuenta que desde IIS se pueden establecer permisos de Lectura y Ejecución, y desde NT cualquier permiso implementado en NTFS. En caso de discrepancia se toma la opción más restrictiva.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-2102643483659196250?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/2102643483659196250/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=2102643483659196250&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/2102643483659196250'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/2102643483659196250'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/03/tutorial-asp.html' title='Tutorial ASP'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-142965416897469913</id><published>2007-03-26T00:27:00.000-07:00</published><updated>2007-03-26T00:29:11.658-07:00</updated><title type='text'>The .NET Framework Architecture Part 2</title><content type='html'>Just-In-Time (JIT) compilation&lt;br /&gt;As stated above, the Just in time compiler is a facility that is invoked by the CLR to convert the IL into machine code. The .NET framework assemblies (*.dll or *.exe) files cannot be executed by the target processor unless it is converted into native code. When the Assembly is loaded the method calls are invoked for compilation into native code. Since this is done just when the method needs to execute, it is called Just in time compilation. When the JIT is invoked for the first time there is an overhead or performance penalty, since the assembly is converted into its Native code or image using the Native Image Generator (Ngen.exe). All subsequent calls will load faster as the Native image alone is invoked thereafter from the Native image cache.&lt;br /&gt;Significantly, the IL can coexist with the machine code in the application. This feature also enables the developer modify the code or add to the code even when the application is actively deployed. This functionality provided by JIT makes the .NET framework an efficient, agile and powerful means of application development.&lt;br /&gt;Assemblies, native assemblies, and the Global Assembly Cache (GAC)&lt;br /&gt;The primary unit of deployment is the assembly. The assembly is used by the .NET CLR as the smallest unit of deployment; version control; security; type grouping and code reuse. An assembly will consist of a manifest and one or more modules or files. It can be defined as a logical DLL that contains a manifest, type metadata, MSIL and resources. Assemblies can be application private or shared. Private assemblies are restricted to use in a single application whereas shared assemblies can be used across applications. Private applications also reside within the application folder while shared assemblies reside in the common area-- GAC(Global Assembly Cache). They must have a globally unique name.&lt;br /&gt;The existence of the manifest within the assembly makes it self descriptive. It can be viewed by the IL Disassembler (Ildasm.exe) which is part of the .NET framework SDK.&lt;br /&gt;The assembly is identified by the manifest. It defines security requirements, lists other interdependent assemblies and all the types and resources exposed by the assembly. Localized resources exposed by assemblies and targeted by the application contain a default culture (language, currency, date/time format etc).&lt;br /&gt;The manifest contains several sections. Identity, Referenced Assemblies, file list and Custom Attributes are some of the important sections of the manifest. The Identity section as the name suggests, identifies the assembly. It contains a .assembly directive. The version directive specifies the version of the assembly, so that the CLR identifies the different versions of an application. The Identity section contains a strong name for shared assemblies and a public/private encryption key is used to distinguish between assemblies of the same name. The Identity section also optionally contains the Culture which defines the country and language of the assembly target. The .locale directive is used for this purpose and the Culture-Neutral assemblies can be used by any assembly. The Referenced Assemblies section of the manifest provides a reference to all the assemblies used in an application.&lt;br /&gt;Comparison of VB.NET, C#, and J#&lt;br /&gt;&lt;br /&gt;The .NET framework architecture has made the language of coding immaterial to the final output. All languages also have equal access to all development capabilities and revolve around the .NET classes. The language syntax, operations etc look similar in all the languages of this group. Moreover, code can be shared by all .NET languages and so a class made in C# or J# can be used in VB.NET and vice versa.&lt;br /&gt;In this context choice of language is no longer significant. Finally, all languages are transformed by the compiler into Microsoft Intermediate language. It is the programmer’s familiarity with the language that makes it material whether he is coding in VB.NET or C# or J#. However, the option settings in the compiler will have to be set to the language of coding before the compiler is used.&lt;br /&gt;The speed of performance of the compiler will also vary with the language being compiled. For instance C# compiles faster than VB.NET. Subject to the above observation, the features of the languages will be dicussed in the next tutorial.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7256759796693696120-142965416897469913?l=tutortan.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://tutortan.blogspot.com/feeds/142965416897469913/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7256759796693696120&amp;postID=142965416897469913&amp;isPopup=true' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/142965416897469913'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7256759796693696120/posts/default/142965416897469913'/><link rel='alternate' type='text/html' href='http://tutortan.blogspot.com/2007/03/net-framework-architecture-part-2.html' title='The .NET Framework Architecture Part 2'/><author><name>tutortan</name><uri>http://www.blogger.com/profile/12292548686607303897</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7256759796693696120.post-4152554124183039656</id><published>2007-03-26T00:19:00.000-07:00</published><updated>2007-03-26T00:23:42.980-07:00</updated><title type='text'>The .NET Framework Architecture Part 1</title><content type='html'>The .NET framework is a software technology that is directed towards connecting information, people, systems and devices seamlessly. The high level of software integration that has been attempted through use of XML web services enables the creation of small, discrete, building block types of applications. These applications are connected to other applications over the Internet.&lt;br /&gt;Central to the .NET framework architecture is the effort to provide support to for the next generation solutions. The direction of change is to ensure that software deployment and versioning conflicts are avoided or minimized in the .NET Framework. User defined codes are released from the confines of the local storage systems and can be stored anywhere on a network and executed from any point in the network. Performance problems associated with scripted and interpreted environments are removed. Codes can be safely executed and the developer experience is consistent across widely varying types of applications, such as Windows based applications and web based applications. The thrust of design is towards creating a standard communication facility that is standardized so that .NET codes can be integrated with other codes easily and seamlessly.&lt;br /&gt;At the core of the .NET infrastructure is the Common Language Runtime (CLR) and the .NET Framework class library.&lt;br /&gt;The runtime functions, like an agent, managing code at execution time. It provides core services such as memory management, thread management and ‘remoting’. It enforces strict type safety and ensures code accuracy. This makes for security and robustness and provides a platform for running managed code.&lt;br /&gt;The .NET Framework provides several runtime hosts. It also supports the development of third-party runtime hosts. For example, ASP.NET hosts the runtime to provide a scalable, server-side environment for managed code. ASP.NET works directly with the runtime to enable ASP.NET applications and XML Web services.&lt;br /&gt;The .NET Framework can be hosted by unmanaged components such as the Internet Explorer. These load the common language runtime into their processes and initiate the execution of managed code. This creates a software environment that can exploit both managed and unmanaged features. This makes for mobility of the code.&lt;br /&gt;Common Language Runtime (CLR)&lt;br /&gt;The common language runtime (CLR) is the foundation upon which developers construct various kinds of applications. The benefits of the CLR are many. It makes for a vastly simplified development. It enables a seamless integration of code written in different languages. It provides evidence-based security with code identity. The assembly based deployment eliminates the problems of DLL. The versioning of reusable components makes for ease of usage. The implementation inheritance feature enables the reuse of code. The automatic object lifetime management makes the application- development comfortable. The self descriptive nature of objects makes for ease of programming and debugging.&lt;br /&gt;&lt;br /&gt;CLR includes both private and shared components. It provides for incremental download of code and caching; native platform interoperability and seamless integration with COM. It offers dynamic inspection capabilities, administration and configuration options. The developer is not required to know all the runtime supported infrastructure. The tools and frameworks are designed to expose a subset of the functionality in accordance with the kind of application being built.&lt;br /&gt;The common language runtime is a virtual execution system that provides important services such as memory management, security and also has a Just-in-Time compiler (JIT) which converts the intermediate language (IL) into native code that can be executed by the physical machine। The infrastructure provides a machine independent environment for application execution.&lt;br /&gt;Tight security is maintained in implementing common language runtime. Managed components are awarded varying degrees of trust. Access rights are determined by factors such as origin of the component (Internet, enterprise network, or local computer). On the flip side this restricts access to file and registry operations, even if the file being operated upon is on within the same active application.&lt;br /&gt;The managed environment of the runtime eliminates many common software issues. For example, the runtime automatically handles object layout and manages references to objects, releasing them when they are no longer being used. This automatic memory management resolves the two most common application errors--memory leaks and invalid memory references.&lt;br /&gt;The futuristic design of the infrastructure is takes into consideration the need to integrate with the legacy applications that are still in operation.&lt;br /&gt;Interoperability between managed and unmanaged code enables developers to continue to use necessary COM components and DLLs.&lt;br /&gt;The use of ‘Common type’ system implements the features of the .NET infrastructure. The common data types shared by multiple languages such as VB.NET, C#, ASP.NET eases the import of a class created in one language into another. A common error handling facility makes for tighter integration between languages and allows developers the freedom of working in the language of their choice.&lt;br /&gt;.NET Framework Class Library&lt;br /&gt;The .NET framework class library, as the name suggests, is a library of classes, interfaces and value types. The applications, components and controls for applications are built on this framework and it provides the developer the access to the system functionality. In other words, the classes and structures can be leveraged as base building blocks for application development. These classes are often described as an API and form a boundary interface between the application and the operating system. Though the concept is not new to Visual basic Developers who have been using the ADO library, the Win 32 API and COM + services, it forms a massive code base on which the application can be built. The .NET Framework class Library is organized into namespaces. The namespace is a container for functionality. Similar classes and constructs are grouped together in a namespace to define parent-child relationships. Namespaces can be nested into namespaces.&lt;br /&gt;All namespaces stem from the root namespace called System Namespace. It contains all data types including the Object data type. Though all namespaces are subordinated to the System namespace, User defined libraries can also coexist with the System namespace. They can have their own root namespace which can be language focused namespaces such as Microsoft.Csharp, Microsoft.VisualBasic.&lt;br /&gt;The most significant feature of the .NET framework is the class Library collection of reusable types can be integrated with CLR. The programmer can accomplish a range of common programming tasks, such as string management; data collection; data base connectivity and file access using the .NET framework class library. The developer can create console applications, Windows GUI applications, ASP.NET applications, XML Web services or Windows services.&lt;br /&gt;Microsoft Intermediate Language (MSIL)&lt;br /&gt;MSIL are simple binary structures that are similar to the instruction sets of the CPU. Like the instruction set, it encodes a wide spectrum of operations such as loading, storing, arithmetic and logical operations and control flow. The similarity to the machine code enables the code to be compiled quickly in the Just in time compiler. The type verification also becomes simpler because the DotNet binary contains tables of metadata. The metadata defines each type and its signatures and also the other data that the runtime locates and extracts from the file at the time of execution.
