Friday, March 30, 2007

Answers.com Releases Free AnswerTips Tool for Websites and Blogs


HTMLPrimer.comThursday, February 22, 2007; 07:32 AM
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.
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.
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.
"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."
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.
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:
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)
California Polytechnic State University Library ( http://www.library.calpoly.edu)
Write Technology (http://www.writetech.net/2007/02/answer_tips.html)
In addition to being available directly from Answers.com at: (http://www.answers.com/main/answertip_landing.jsp)
AnswerTips are also available within the widget gallery of TypePad at: http://www.sixapart.com/typepad/widgets/publishing-tools/answertips.html.
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.
About Answers Corporation
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 & 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.

Thursday, March 29, 2007

Big Business Web Design Disasters

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.

The Power OF HTML Email Advertising And When To Use Text Email

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.
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.
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.
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.
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.

Wednesday, March 28, 2007

Complete Website Solutions: Tips For Choosing A Web Solutions Provider

by Cogniter Technologies

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 & 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 & see your business in growing shape. Sponsored by Cogniter Technologies Inc, Chandigarh, India

Advantages of using tableless CSS | XHTML Web Design Techniques

by Tim Warren

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.
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.
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.
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.
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.
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.
Why should you follow this standard? Here are a few reasons as to why you should go tableless:
• 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.
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.

Security Enhancements and Fixes in PHP 5.2.1 and PHP 4.4.5:

Fixed possible safe_mode & open_basedir bypasses inside the session extension.
Fixed unserialize() abuse on 64 bit systems with certain input strings.
Fixed possible overflows and stack corruptions in the session extension.
Fixed an underflow inside the internal sapi_header_op() function.
Fixed non-validated resource destruction inside the shmop extension.
Fixed a possible overflow in the str_replace() function.
Fixed possible clobbering of super-globals in several code paths.
Fixed a possible information disclosure inside the wddx extension.
Fixed a possible string format vulnerability in *print() functions on 64 bit systems.
Fixed a possible buffer overflow inside ibase_{delete,add,modify}_user() functions.
Fixed a string format vulnerability inside the odbc_result_all() function.
Security Enhancements and Fixes in PHP 5.2.1 only:
Prevent search engines from indexing the phpinfo() page.
Fixed a number of input processing bugs inside the filter extension.
Fixed allocation bugs caused by attempts to allocate negative values in some code paths.
Fixed possible stack/buffer overflows inside zip, imap & sqlite extensions.
Fixed several possible buffer overflows inside the stream filters.
Memory limit is now enabled by default.
Added internal heap protection.
Extended filter extension support for $_SERVER in CGI and apache2 SAPIs.
Security Enhancements and Fixes in PHP 4.4.5 only:
Fixed possible overflows inside zip & imap extensions.
Fixed a possible buffer overflow inside mail() function on Windows.
Unbundled the ovrimos extension.
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.
For users upgrading to PHP 5.2 from PHP 5.0 and PHP 5.1, an upgrade guide is available here, detailing the changes between those releases and PHP 5.2.1.
Update: Feb 14th; Added release information for PHP 4.4.5.
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 download section.

Tuesday, March 27, 2007

Open Source Organizations and Affiliations

Google is proud to take part in the following technical and advocacy organizations:
The Eclipse Foundation
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.
The Free Software Foundation
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.
The Java Community Process
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.
The Mozilla Foundation
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.
OASIS
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.
ODF Alliance
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.
OSDL
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.
Python Software Foundation
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.

Monday, March 26, 2007

3. Criterios de Selección

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.
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#.
3.1 Operadores Lógicos
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:
operador
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:

Operador

Resultado
Verdad
AND
Falso
Falso
Verdad
AND
Verdad
Verdad
Falso
AND
Verdad
Falso
Falso
AND
Falso
Falso
Verdad
OR
Falso
Verdad
Verdad
OR
Verdad
Verdad
Falso
OR
Verdad
Verdad
Falso
OR
Falso
Falso
Verdad
XOR
Verdad
Falso
Verdad
XOR
Falso
Verdad
Falso
XOR
Verdad
Verdad
Falso
XOR
Falso
Falso
Verdad
Eqv
Verdad
Verdad
Verdad
Eqv
Falso
Falso
Falso
Eqv
Verdad
Falso
Falso
Eqv
Falso
Verdad
Verdad
Imp
Verdad
Verdad
Verdad
Imp
Falso
Falso
Verdad
Imp
Null
Null
Falso
Imp
Verdad
Verdad
Falso
Imp
Falso
Verdad
Falso
Imp
Null
Verdad
Null
Imp
Verdad
Verdad
Null
Imp
Falso
Null
Null
Imp
Null
Null
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.
El último operador denominado Is se emplea para comparar dos variables de tipo objeto Is . este operador devuelve verdad si los dos objetos son iguales
SELECT * FROM Empleados WHERE Edad > 25 AND Edad <> 25 AND Edad < sueldo =" 100;" estado =" 'Soltero';"> 100 AND Sueldo < 500) OR (Provincia = 'Madrid' AND Estado = 'Casado');
3.2 Intervalos de Valores
Para indicar que deseamos recuperar los registros según el intervalo de valores de un campo emplearemos el operador Between cuya sintaxis es:
campo [Not] Between valor1 And valor2 (la condición Not es opcional)
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.
SELECT * FROM Pedidos WHERE CodPostal Between 28000 And 28999; (Devuelve los pedidos realizados en la provincia de Madrid)
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)
3.3 El Operador Like
Se utiliza para comparar una expresión de cadena con un modelo en una expresión SQL. Su sintaxis es:
expresión Like modelo
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*).
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.
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:
Like 'P[A-F]###'
Este ejemplo devuelve los campos cuyo contenido empiece con una letra de la A a la D seguidas de cualquier cadena.
Like '[A-D]*'
En la tabla siguiente se muestra cómo utilizar el operador Like para comprobar expresiones con diferentes modelos.
Tipo de coincidencia
Modelo Planteado
Coincide
No coincide
Varios caracteres
'a*a'
'aa', 'aBa', 'aBBBa'
'aBC'
Carácter especial
'a[*]a'
'a*a'
'aaa'
Varios caracteres
'ab*'
'abcdefg', 'abc'
'cab', 'aab'
Un solo carácter
'a?a'
'aaa', 'a3a', 'aBa'
'aBBBa'
Un solo dígito
'a#a'
'a0a', 'a1a', 'a2a'
'aaa', 'a10a'
Rango de caracteres
'[a-z]'
'f', 'p', 'j'
'2', '&'
Fuera de un rango
'[!a-z]'
'9', '&', '%'
'b', 'a'
Distinto de un dígito
'[!0-9]'
'A', 'a', '&', '~'
'0', '1', '9'
Combinada
'a[!b-m]#'
'An9', 'az0', 'a99'
'abc', 'aj0'

3.4 El Operador In
Este operador devuelve aquellos registros cuyo campo indicado coincide con alguno de los en una lista. Su sintaxis es:
expresión [Not] In(valor1, valor2, . . .)
SELECT * FROM Pedidos WHERE Provincia In ('Madrid', 'Barcelona', 'Sevilla');
3.5 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.
SELECT Apellidos, Salario FROM Empleados WHERE Salario > 21000;
SELECT Id_Producto, Existencias FROM Productos WHERE Existencias <= Nuevo_Pedido;
SELECT * FROM Pedidos WHERE Fecha_Envio = #5/10/94#;
SELECT Apellidos, Nombre FROM Empleados WHERE Apellidos = 'King';
SELECT Apellidos, Nombre FROM Empleados WHERE Apellidos Like 'S*';
SELECT Apellidos, Salario FROM Empleados WHERE Salario Between 200 And 300;
SELECT Apellidos, Salario FROM Empl WHERE Apellidos Between 'Lon' And 'Tol';
SELECT Id_Pedido, Fecha_Pedido FROM Pedidos WHERE Fecha_Pedido Between #1-1-94# And #30-6-94#;
SELECT Apellidos, Nombre, Ciudad FROM Empleados WHERE Ciudad In ('Sevilla', 'Los Angeles', 'Barcelona');

4. Agrupamiento de Registros
4.1 GROUP BY
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:
SELECT campos FROM tabla WHERE criterio GROUP BY campos del grupo
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.
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.
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.
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.
SELECT Id_Familia, Sum(Stock) FROM Productos GROUP BY Id_Familia;
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.
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.
SELECT Id_Familia Sum(Stock) FROM Productos GROUP BY Id_Familia HAVING Sum(Stock) > 100 AND NombreProducto Like BOS*;
4.2 AVG
Calcula la media aritmética de un conjunto de valores contenidos en un campo especificado de una consulta. Su sintaxis es la siguiente
Avg(expr)
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.
SELECT Avg(Gastos) AS Promedio FROM Pedidos WHERE Gastos > 100;
4.3 Count
Calcula el número de registros devueltos por una consulta. Su sintaxis es la siguiente
Count(expr)
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.
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 ('*').
SELECT Count(*) AS Total FROM Pedidos;
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 (&).
SELECT Count(FechaEnvío & Transporte) AS Total FROM Pedidos;
4.4 Max, Min
Devuelven el mínimo o el máximo de un conjunto de valores contenidos en un campo especifico de una consulta. Su sintaxis es:
Min(expr) Max(expr)
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).
SELECT Min(Gastos) AS ElMin FROM Pedidos WHERE Pais = 'España'; SELECT Max(Gastos) AS ElMax FROM Pedidos WHERE Pais = 'España';
4.5 StDev, StDevP
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:
StDev(expr) StDevP(expr)
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)
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).
SELECT StDev(Gastos) AS Desviacion FROM Pedidos WHERE Pais = 'España'; SELECT StDevP(Gastos) AS Desviacion FROM Pedidos WHERE Pais= 'España';
4.6 Sum
Devuelve la suma del conjunto de valores contenido en un campo especifico de una consulta. Su sintaxis es:
Sum(expr)
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).
SELECT Sum(PrecioUnidad * Cantidad) AS Total FROM DetallePedido;
4.7 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:
Var(expr) VarP(expr)
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)
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.
SELECT Var(Gastos) AS Varianza FROM Pedidos WHERE Pais = 'España'; SELECT VarP(Gastos) AS Varianza FROM Pedidos WHERE Pais = 'España';

Tutorial de SQL

1.- INTRODUCCION
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.
1.1. Componentes del SQL
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.
1.2 Comandos
Existen dos tipos de comandos SQL:
los DLL que permiten crear y definir nuevas bases de datos, campos e índices.
los DML que permiten generar consultas para ordenar, filtrar y extraer datos de la base de datos.

Comandos DLL
Comando
Descripción
CREATE
Utilizado para crear nuevas tablas, campos e índices
DROP
Empleado para eliminar tablas e índices
ALTER
Utilizado para modificar las tablas agregando campos o cambiando la definición de los campos.

Comandos DML
Comando
Descripción
SELECT
Utilizado para consultar registros de la base de datos que satisfagan un criterio determinado
INSERT
Utilizado para cargar lotes de datos en la base de datos en una única operación.
UPDATE
Utilizado para modificar los valores de los campos y registros especificados
DELETE
Utilizado para eliminar registros de una tabla de una base de datos
1.3 Cláusulas
Las cláusulas son condiciones de modificación utilizadas para definir los datos que desea seleccionar o manipular.
Cláusula
Descripción
FROM
Utilizada para especificar la tabla de la cual se van a seleccionar los registros
WHERE
Utilizada para especificar las condiciones que deben reunir los registros que se van a seleccionar
GROUP BY
Utilizada para separar los registros seleccionados en grupos específicos
HAVING
Utilizada para expresar la condición que debe satisfacer cada grupo
ORDER BY
Utilizada para ordenar los registros seleccionados de acuerdo con un orden específico
1.4 Operadores Lógicos
Operador
Uso
AND
Es el "y" lógico. Evalua dos condiciones y devuelve un valor de verdad sólo si ambas son ciertas.
OR
Es el "o" lógico. Evalúa dos condiciones y devuelve un valor de verdar si alguna de las dos es cierta.
NOT
Negación lógica. Devuelve el valor contrario de la expresión.
1.5 Operadores de Comparación
Operador
Uso
<
Menor que
>
Mayor que
<>
Distinto de
<=
Menor ó Igual que
>=
Mayor ó Igual que
=
Igual que
BETWEEN
Utilizado para especificar un intervalo de valores.
LIKE
Utilizado en la comparación de un modelo
In
Utilizado para especificar registros de una base de datos
1.6 Funciones de Agregado
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.
Función
Descripción
AVG
Utilizada para calcular el promedio de los valores de un campo determinado
COUNT
Utilizada para devolver el número de registros de la selección
SUM
Utilizada para devolver la suma de todos los valores de un campo determinado
MAX
Utilizada para devolver el valor más alto de un campo especificado
MIN
Utilizada para devolver el valor más bajo de un campo especificado

2. Consultas de Selección
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.
2.1 Consultas básicas
La sintaxis básica de una consulta de selección es la siguiente:
SELECT Campos FROM Tabla;
En donde campos es la lista de campos que se deseen recuperar y tabla es el origen de los mismos, por ejemplo:
SELECT Nombre, Telefono FROM Clientes;
Esta consulta devuelve un recordset con el campo nombre y teléfono de la tabla clientes.
2.2 Ordenar los registros
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:
SELECT CodigoPostal, Nombre, Telefono FROM Clientes ORDER BY Nombre;
Esta consulta devuelve los campos CodigoPostal, Nombre, Telefono de la tabla Clientes ordenados por el campo Nombre.
Se pueden ordenar los registros por mas de un campo, como por ejemplo:
SELECT CodigoPostal, Nombre, Telefono FROM Clientes ORDER BY CodigoPostal, Nombre;
Incluso se puede especificar el orden de los registros: ascendente mediante la claúsula (ASC -se toma este valor por defecto) ó descendente (DESC)
SELECT CodigoPostal, Nombre, Telefono FROM Clientes ORDER BY CodigoPostal DESC , Nombre ASC;
2.3 Consultas con Predicado
El predicado se incluye entre la claúsula y el primer nombre del campo a recuperar, los posibles predicados son:
Predicado
Descripción
ALL
Devuelve todos los campos de la tabla
TOP
Devuelve un determinado número de registros de la tabla
DISTINCT
Omite los registros cuyos campos seleccionados coincidan totalmente
DISTINCTROW
Omite los registros duplicados basandose en la totalidad del registro y no sólo en los campos seleccionados.
ALL
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.
SELECT ALL FROM Empleados; SELECT * FROM Empleados; TOP
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:
SELECT TOP 25 Nombre, Apellido FROM Estudiantes ORDER BY Nota DESC;
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:
SELECT TOP 10 PERCENT Nombre, Apellido FROM Estudiantes ORDER BY Nota DESC;
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.
DISTINCT
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.
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:
SELECT DISTINCT Apellido FROM Empleados;
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.
DISTINCTROW
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.
SELECT DISTINCTROW Apellido FROM Empleados;
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 Alias
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:
SELECT DISTINCTROW Apellido AS Empleado FROM Empleados;
2.5 Recuperar Información de una base de Datos Externa
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:
SELECT DISTINCTROW Apellido AS Empleado FROM Empleados IN 'c:\databases\gestion.mdb';
En donde c:\databases\gestion.mdb es la base de datos que contiene la tabla Empleados.

Tutorial ASP Secuencias de comandos asp

Agregar secuencias de comandos
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).
En el caso de HTML , dichos delimitadores son los símbolos "<" y ">" que enmarcan las etiquetas Html. ASP utiliza los delimitadores
""
para enmarcar las secuencias de comandos.
Veamos esto con un ejemplo sencillo:


Hola, bienvenido a mi página, estamos a :



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:

Hola, bienvenido a mi página, estamos a : 4/1/2000 14:25:55 PM

Como vemos, el cliente, no recibe el código asp, recibe el resultado de la ejecución de dicho código.
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:
Buenos días
si la ejecutamos antes de las 12:00 o:
Buenas Tardes
si la ejecutamos después de esta hora, el código seria el siguiente:



Buenos días

Buenas Tardes




Establecer el lenguaje de la aplicación
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.
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.
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:

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.
Todos los ejemplos de estas páginas están escritos en VBScript

Comentarios en VBScript
VBScript acepta comentarios marcados con apóstrofes. Estos comentarios se eliminan al procesarse la secuencia de comandos y no se envían al explorador.
'Esta linea y las siguientes son comentarios.
'La función ImprimirTabla imprime los elementos de una matriz.
Call ImprimirTabla (mimatriz( ))
No puede incluir comentarios en expresiones de resultados. Por ejemplo, la primera línea que sigue funciona, pero la segunda no, porque empieza con

Distinguir entre mayúsculas y minúsculas
VBScript no distingue entre mayúsculas y minúsculas।
Tipos de datos en VBScript
Vbscript solo tiene un tipo de datos llamado Variant.
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 (" ").
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 funciones para convertir los datos de un tipo a otro.
Subtipo
Descripción
Valor de Vartype
Empty
Variable sin inicializar
0
Null
Variable intencionadamente vacia
1
Boolean
Dos valores posibles True o False
11
Byte
Entero entre 0 y 255
17
Integer
Entero entre -32.768 y 32.768
2
Currency
Numero entre -922.337.203.685.477,5808 y 922.337.203.685.477,5807
6
Long
Numero entre -2.147.483.648 y 2.147.483.647
3
Single
Numero de precisión simple
4
Double
Numero de doble precisión
5
Date
Fecha entre 1-1-100 y 31-12-9999
7
String
Cadena de longitud variable hasta 2.000.000.000 de caracteres.
8
Object
Contiene un Objeto
9
Error
Contiene un numero de error
10
Conversión de Tipos
Todas la funciones de conversión de tipos tienen la misma sintaxis:
Funcion(expresión), siendo expresión el dato que se desea convertir.
Cbool
Convierte una expresión a tipo Boolean
Cbyte
Convierte una expresión a tipo Byte
Clnt
Convierte una expresión a tipo Integer
Clng
Convierte una expresión a tipo Long
Csng
Convierte una expresión a tipo Single
Cdbl
Convierte una expresión a tipo Double
Ccur
Convierte una expresión a tipo Curency
Cdate
Convierte una expresión a tipo Date
Cstr
Convierte una expresión a tipo String

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 tabla 1
Variables en VBScript
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).
Para declarar una variable se utiliza la instrucción DIM. PUBLIC o PRIVATE. Por ejemplo:

Tutorial ASP

Páginas Active Server
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.
El modelo de Páginas ASP
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.
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.
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.
Crear Páginas ASP
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.
(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)
Internet Information Server
Introducción
Instalación de protocolo TCP/IP
Seguridad del sitio Web

1.-Introducción
IIS es el software estándar que soporta comunicaciones Internet en Windows NT .
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.
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.
Proporciona unas buenas prestaciones en equipos con muy diferentes prestaciones de hardware.
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.)
Todo indica que el conjunto NT-IIS-Explorer será utilizado de forma creciente para la publicación de datos en Intranet/Internet.
Los servicios básicos que nos proporciona IIS4 son WWW, FTP, Correo y NEWS.
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.
Workstation puede servir muy adecuadamente como banco de pruebas y aprendizaje.
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).
Para publicar en Intranet necesitamos:
Tarjeta adaptadora de red
Un servidor DNS o WINS si deseamos usar nombres en vez de direcciones IP numéricas.
Para publicar en Internet necesitamos:
Una tarjeta de comunicaciones
Una conexión a Internet
Una dirección IP registrada en un DNS
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.

2.-Instalación del protocolo TCP/IP
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.
En la pestaña Protocolos seleccionamos TCP/IP, si no aparece, lo añadiremos con el botón Agregar.
Una vez escogido pulsamos Propiedades para configurarlo.
Pestaña Dirección IP:
Configuramos por cada tarjeta:
Adaptador (Tipo de tarjeta)
Dirección IP
Mascara de subred
Gateway
Pestaña Dirección DNS:
Nombre de Host + Dominio (identificación de la maquina que estamos configurando)
Orden de búsqueda del servicio Dns
Orden de búsqueda de sufijo de dominio (opcional)
Todos estos parámetros nos los proporciona nuestro proveedor ISP.

3.-Mecanismos de seguridad
La seguridad de un sitio Web es especialmente importante, debido a la necesidad de garantizar su utilización por usuarios remotos.
IIS 4.o utiliza la seguridad de Windows NT y en algunos casos la amplia.
Se recomienda el uso del sistema de archivos NTFS de NT por su mayor seguridad.
Windows NT basa su seguridad en el sistema de usuarios y contraseñas, el uso adecuado de estas contribuye a mantener el equipo seguro.
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.
Mecanismo de seguridad en una petición:
Comprobación de la dirección IP del cliente por IIS.
Comprobación de usuario y contraseña.
Comprobación de los permisos de acceso a archivos establecidos en el sistema NTFS.
Si cualquiera de estas comprobaciones es errónea, la petición no tendrá éxito.
Administración de la cuenta de usuario anónimo.
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.
Conviene revisar los derechos de los grupos que tienen los grupos Todos e Invitados a los que pertenece el usuario anónimo.
Para que el usuario anónimo funcione correctamente debemos activar Permitir Anónimos en las propiedades del servicio Web.
Autenticación
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.
En IIS existen 2 formas de autenticación:
Autenticación Básica: El usuario y la clave se transmiten sin cifrar
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.
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.

Establecimiento de permisos en los directorios y ficheros de un sitio Web (aspectos Básicos)
De forma genérica un sitio Web reside en
Un directorio particular
Los subdirectorios que parten del particular
Los directorios virtuales
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.
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.
La asignación general de permisos sigue la siguiente estructura:
Programas CGI, ISAPI, etc
Permiso de Ejecución
Páginas ASP
Permisos de Lectura y Ejecución
Documentos estáticos HTML, Imágenes, etc
Permiso de Lectura
Bases de datos, ficheros auxiliares, etc.
Permisos de Lectura y Escritura.
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.

The .NET Framework Architecture Part 2

Just-In-Time (JIT) compilation
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.
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.
Assemblies, native assemblies, and the Global Assembly Cache (GAC)
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.
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.
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).
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.
Comparison of VB.NET, C#, and J#

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.
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.
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.

The .NET Framework Architecture Part 1

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.
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.
At the core of the .NET infrastructure is the Common Language Runtime (CLR) and the .NET Framework class library.
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.
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.
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.
Common Language Runtime (CLR)
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.

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.
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.
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.
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.
The futuristic design of the infrastructure is takes into consideration the need to integrate with the legacy applications that are still in operation.
Interoperability between managed and unmanaged code enables developers to continue to use necessary COM components and DLLs.
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.
.NET Framework Class Library
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.
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.
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.
Microsoft Intermediate Language (MSIL)
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. The presence of the metadata makes the module self descriptive and eliminates the need for IDL files and header files. However, unlike the CPU instruction set, MSIL expresses object oriented concepts such as object creation, method invocation, property access and exception handling.

It is the Microsoft Intermediate Language (MSIL) which makes applications language independent. Applications may be created by programmers in any language of their choice—ASP.NET or VB.NET—in a machine on which the .NET framework has been installed. The compiler then, gives an output in the Microsoft Intermediate language. This language can be defined as a kind of assembly language at a higher level of abstraction. The language is designed in a manner that makes it possible to convert it into any kind of native machine code with ease. The CLR detects the Intermediate language and invokes the Just-in-time compiler to convert the language into machine code.

Sunday, March 25, 2007

If statements

Without a conditional statement such as the if statement, programs would run almost the exact same way every time. If statements allow the flow of the program to be changed, and so they allow algorithms and more interesting code. Before discussing the actual structure of the if statement, let us examine the meaning of TRUE and FALSE in computer terminology. A true statement is one that evaluates to a nonzero number. A false statement evaluates to zero. When you perform comparison with the relational operators, the operator will return 1 if the comparison is true, or 0 if the comparison is false. For example, the check 0 == 2 evaluates to 0. The check 2 == 2 evaluates to a 1. If this confuses you, try to use a cout statement to output the result of those various comparisons (for example cout<< ( 2 == 1 );) When programming, the aim of the program will often require the checking of one value stored by a variable against another value to determine whether one is larger, smaller, or equal to the other. There are a number of operators that allow these checks. Here are the relational operators, as they are known, along with examples:
> greater than 5 > 4 is TRUE
< less than 4 < 5 is TRUE
>= greater than or equal 4 >= 4 is TRUE
<= less than or equal 3 <= 4 is TRUE
== equal to 5 == 5 is TRUE
!= not equal to 5 != 4 is TRUE
It is highly probable that you have seen these before, probably with slightly different symbols. They should not present any hindrance to understanding. Now that you understand TRUE and FALSE in computer terminology as well as the comparison operators, let us look at the actual structure of if statements. The structure of an if statement is as follows:
if ( TRUE )
Execute the next statement
To have more than one statement execute after an if statement that evaluates to true, use braces, like we did with the body of a function. Anything inside braces is called a compound statement, or a block. For example:
if ( TRUE ) {
Execute all statements inside the braces
}
There is also the else statement. The code after it (whether a single line or code between brackets) is executed if the if statement is FALSE. It can look like this:
if ( TRUE ) {
// Execute these statements if TRUE
}
else {
// Execute these statements if FALSE
}
One use for else is if there are two conditional statements that may both evaluate to true, yet you wish only one of the two to have the code block following it to be executed. You can use an else if after the if statement; that way, if the first statement is true, the else if will be ignored, but if the if statement is false, it will then check the condition for the else if statement. If the if statement was true the else statement will not be checked. It is possible to use numerous else if statements. Let's look at a simple program for you to try out on your own.
#include
using namespace std;

int main() // Most important part of the program!
{
int age; // Need a variable...

cout<<"Please input your age: "; // Asks for age
cin>> age; // The input is put in age
cin.ignore(); // Throw away enter
if ( age < 100 ) { // If the age is less than 100
cout<<"You are pretty young!\n"; // Just to show you it works...
}
else if ( age == 100 ) { // I use else just to show an example
cout<<"You are old\n"; // Just to show you it works...
}
else {
cout<<"You are really old\n"; // Executed if no other statement is
}
cin.get();
}
Boolean operators allow you to create more complex conditional statements. For example, if you wish to check if a variable is both greater than five and less than ten, you could use the boolean AND to ensure both var > 5 and var < 10 are true. In the following discussion of boolean operators, I will capitalize the boolean operators in order to distinguish them from normal english. The actual C++ operators of equivalent function will be described further into the tutorial - the C++ symbols are not: OR, AND, NOT, although they are of equivalent function. When using if statements, you will often wish to check multiple different conditions. You must understand the Boolean operators OR, NOT, and AND. The boolean operators function in a similar way to the comparison operators: each returns 0 if evaluates to FALSE or 1 if it evaluates to TRUE. NOT: The NOT operator accepts one input. If that input is TRUE, it returns FALSE, and if that input is FALSE, it returns TRUE. For example, NOT (1) evalutes to 0, and NOT (0) evalutes to 1. NOT (any number but zero) evaluates to 0. In C and C++ NOT is written as !. NOT is evaluated prior to both AND and OR. AND: This is another important command. AND returns TRUE if both inputs are TRUE (if 'this' AND 'that' are true). (1) AND (0) would evaluate to zero because one of the inputs is false (both must be TRUE for it to evaluate to TRUE). (1) AND (1) evaluates to 1. (any number but 0) AND (0) evaluates to 0. The AND operator is written && in C++. Do not be confused by thinking it checks equality between numbers: it does not. Keep in mind that the AND operator is evaluated before the OR operator. OR: Very useful is the OR statement! If either (or both) of the two values it checks are TRUE then it returns TRUE. For example, (1) OR (0) evaluates to 1. (0) OR (0) evaluates to 0. The OR is written as in C++. Those are the pipe characters. On your keyboard, they may look like a stretched colon. On my computer the pipe shares its key with \. Keep in mind that OR will be evaluated after AND. It is possible to combine several boolean operators in a single statement; often you will find doing so to be of great value when creating complex expressions for if statements. What is !(1 && 0)? Of course, it would be TRUE. It is true is because 1 && 0 evaluates to 0 and !0 evaluates to TRUE (ie, 1). Try some of these - they're not too hard. If you have questions about them, feel free to stop by our forums.
A. !( 1 0 ) ANSWER: 0
B. !( 1 1 && 0 ) ANSWER: 0 (AND is evaluated before OR)
C. !( ( 1 0 ) && 0 ) ANSWER: 1 (Parenthesis are useful)
If you find you enjoyed this section, then you might want to look more at Boolean Algebra.

Getting Started with C++

What is C++?Released in 1985, C++ is an object-oriented programming language created by Bjarne Stroustrup. C++ maintains almost all aspects of the C language, while simplifying memory management and adding several features - including a new datatype known as a class (you will learn more about these later) - to allow object-oriented programming. C++ maintains the features of C which allowed for low-level memory access but also gives the programmer new tools to simplify memory management.
What is C++ used for?C++ is a powerful general-purpose programming language. It can be used to create small programs or large applications. It can be used to make CGI scripts or console-only DOS programs. C++ allows you to create programs to do almost anything you need to do. The creator of C++, Bjarne Stroustrup, has put together a partial list of applications written in C++.
What is Object-Oriented Programming?Object oriented programming is essentially building a program around self-contained collections of data and code to modify that data; this programming model is in contrast to a model that uses function that act on data scattered throughout a program. Object-oriented programming (or coding, as programming is commonly referred to) is an organizational style, but it helps programmers create reusable code because the code to do a specific thing is entirely contained within a single section of code, and to use the code to perform tasks - for instance, creating a menu - involves using only a small number of functions to access the internals of the class. Think of it as a black box that can be easily carried from place to place, and that performs complex actions simply at the press of a button: for instance, a microwave lets you heat food for a specified time limit - say, two minutes - by typing in the time and pressing the heat button. You do not need to know how the microwave operates or why the physics works. In the same way that self-contained appliances simplify life for the consumer, object-oriented programming simplifies the transfer of source code from one program to another program by encapsulating it - putting it all in one place.
What do you need to program in C or C++?In order to make usable programs in C or C++, you will need a compiler. A compiler converts source code - the actual instructions typed by the programmer - into an executable file. Numerous compilers are available for C and C++. Listed on the sidebar are several pages with information on specific compilers. For beginners, Bloodshed Dev, which uses a Windows interface, is a free and easy-to-use compiler.
How do you learn C++?No special knowledge is needed to learn C++, and if you are an independent learner, you can probably learn C++ from online tutorials or from books. There are plenty of free tutorials online, including the one on this site - one which requires no prior programming experience. You can also pick out programming books from our recommendations. While reading a tutorial or a book, it is often helpful to type - not copy and paste (even if you can!) - the code into the compiler and run it. Typing it yourself will help you to get used to the typical typing errors that cause problems and it will force you to pay attention to the details of programming syntax. Typing your program will also familiarize you with the general structure of programs and with the use of common commands. After running an example program - and after making certain that you understand how it works - you should experiment with it: play with the program and test your own ideas. By seeing which modifications cause problems and which sections of the code are most important to the function of the program, you should learn quite a bit about programming. New! Try our C++ Beginner to C++ Expert recommended book series, a six-book set designed to get you maximal information and help take you from beginner to C++ master.
Do I need to know C to learn C++?No. C++ is a superset of C; (almost) anything you can do in C, you can do in C++. If you already know C, you will easily adapt to the object-oriented features of C++. If you don't know C, you will have to learn the syntax of C-style languages while learning C++, but you shouldn't have any conceptual difficulties.
What's the point of learning to program? What can I get out of it?Ah, a skeptic! You can get a lot of things out of programming. For one thing, it's just plain fun. You can read my opinion on the matter here: Why Learn to Program?
I want to make games in C++, what should I do?It may be a challenging road, but it is doable. This article has more information: so you want to be a game programmer?
What does it take to learn to be a programmer?Great question! Here's an article about what it takes to be a programmer!
Help me use my compilerGo here to learn how to use a compiler.
How should I think about Program Design?Try Thinking about Programming - A Beginner's Guide
Help, my program doesn't work!Take a look at a list of common programming mistakes, send us an email or, if you're really stuck, join our message board or ask an expert!
Where can I learn more about the history of computer science?Try this article on computer science.

Holiday Action Saves a Sour Shopping Season by Beka Ruse

Holiday Action Saves a Sour Shopping Season [By: Beka Ruse]
Usually, U.S. retailers earn 20-80% of their entire yearly gross during the holiday season. But this year, things are different. The sluggish US economy has prompted Deloitte Research's Carl Steidtmann to fear "the worst Christmas ever" in the retail sector.
Short of going door to door in a Santa suit, how can businesses increase profits and prevent a blue Christmas? Despite economic gloom, industry leaders have found that an e-mail follow up strategy can increase sales by a cheery 35%! To weather the ailing economy, use a follow up autoresponder during your holiday campaigns.
What Does It Do? Follow up autoresponders follow up with your leads for you. You create a series of messages, and decide when they should be sent, (daily, weekly, etc.). Your autoresponder will send the messages to each new lead automatically. With no further intervention from you, your leads will remember you throughout the winter chill. And this regular reminding will mean more sales during the all-important holiday shopping season.
Give yourself the gift of a higher conversion rate! Follow up automatically using these simple steps:
* Offer Useful Information * Personalize Your Messages * Track Your Leads * Broadcast Tailor-Made Offers
Offer Useful Information Write your follow up messages for your leads - not for yourself. You want to talk about your great service, but your leads just want to know what they'll get out of it!
At some point, you must have purchased something like your product. What were you looking for then? Was it information about pricing, styles, or holiday gift wrapping? Maybe just a clearer explanation of the product? Figure that out, and put the answer in your follow up messages. That's what your leads want to know.
Personalize Your Messages You don't open postal mail addressed to "Current Resident", and your leads aren't going to read e-mail addressed to "Dear Internet Friend." People are simply more likely to read messages that address them by name.
Autoresponders let you use variables to personalize your messages. This way, you write just one message, but Lenny Lead reads "Happy Holidays, Lenny!" while Kate Customer reads "Happy Holidays, Kate!"
Names are only the beginning of the personalization features available, though. In addition to full, first, and last names, some autoresponders let you add e-mail addresses, dates, or an ad category. The best even correct the capitalization in your leads' names, giving your messages a much more professional look.
Track Your Leads Get even better results from your snowballing list of leads by experimenting with follow up content and timing. Your experimentation will be much more successful if you have access to proper statistics.
Only use a follow up autoresponder that offers detailed lead statistics. Look for live, graphical stats that show your incoming leads broken down by day / week / month, all of your active leads, and leads who have requested removal from your list.
Broadcast Tailor-Made Offers To get more bang for your holiday buck, look for an autoresponder that also lets you broadcast extra e-mails to all of your leads. Some even allow you to send tailor-made offers only to leads who meet certain criteria.
For instance, send everyone who's been on your list for a month a special discount. Or, notify all leads interested in a certain product when a new shipment comes in.
Follow up messages keep leads warm. Use periodic broadcasts to convert them to sales!
Prevent a Crummy Christmas Businesses of all sizes have seen their sales grow by leaps and bounds because of automated follow up. Implement your follow up strategy now to make the best use of holiday leads! Then, enjoy the season - your autoresponder is following up for you!
Beka Ruse fights spam as the Business Development Manager at AWeber Communications. Ad tracking, live stats, and a strict anti-spam policy.http://www.aweber.com/?220140

Saturday, March 24, 2007

Navigate The .NET Framework And Your Projects With The My Namespace


Iset out to write this article about Visual Basic® 2005, but that left too many things to choose from. I could wander through the entire feature list, giving you a bit of information on cool IDE features like Edit and Continue, IntelliSense® Code Snippets, or the Exception Assistant; skim over the advanced language enhancements like generics, partial classes, and unsigned types; and barely touch on all the cool Microsoft® .NET Framework enhancements around Windows® Forms, data binding, ClickOnce deployment, and more. While these are all interesting features, I'm going to dig into one of the coolest features of Visual Basic 2005, the namespace called My.
Why My?
One of the biggest issues that programmers run into is the sheer breadth of .NET, which makes finding the best class for a particular task quite daunting. I have read many newsgroup postings from developers working very hard to call a Win32® API function from their Visual Basic .NET or C# code, when that exact function already exists in .NET. Why are they trying to call the API? They didn't find, notice, or perhaps understand how they could use existing parts of the Framework. The My namespaces provides an intuitive navigation hierarchy that exposes existing .NET functionality through easily understood root objects, targeting the practical tasks and concepts that you grapple with on a regular basis.
Wow, that sounds great, but what does it mean? To quickly illustrate the benefit of My, consider a very common question from the forums on GotDotNet: "How do I read the entire contents of a text file into a string?" The answer for the .NET Framework 1.1 is this: Dim sr As New IO.StreamReader("c:\mytextfile.txt")
contents = sr.ReadToEnd
sr.Close()
It doesn't require a lot of code, but it certainly isn't intuitive. For many people, the path to StreamReader would have led them through the Stream class, the FileStream class, and more before ending up with that code snippet. That exact same code will work just fine in Visual Basic 2005, but by using My I can get to the same information much more quickly by writing this: contents = My.Computer.FileSystem.ReadAllText("c:\mytextfile.txt")
The My.Computer.FileSystem class is just one of many classes included in the My language extensions, so the first thing to do is get familiar with what is available.
My is best described as a speed-dial for the .NET Framework. This type of simplification—making it easier to find and execute the right operation—is a common practice in programming. When I run into a multistep process that will be used repeatedly by me or by my development team, I generally create a helper function. The helper function is usually just a simple call that takes in the parameters that matter for the most common usage and then performs the multistep process under the covers, smoothing the development process. Most software development shops build such helper functions, and it is quite a common practice to combine groups of them into some set of code snippets or form of shared library such as MyCompany.Utilities or Duncan.NetworkUtilities.
There is a lot of duplication of effort going on in the creation of these libraries though, as many functions would be useful to almost any development group. The My namespace takes this idea of helper functions to a whole new level because these functions include so much functionality and because they are being shipped with Visual Basic. Just think of it as a library full of productivity-enhancing code that you don't have to write.
Exploring My
My exposes several distinct classes which organize a variety of functions into one of seven general areas: My.Application, My.Computer, My.Forms, My.Resources, My.Settings, My.User, and My.WebServices.
In general, the classes within My provide easy access to information in one of two categories, either the underlying .NET Framework or elements of the current project. My.Application, My.Computer, and My.User are all focused on Framework functionality, while My.Forms, My.Resources, My.Settings, and My.WebServices all deal with the contents of your current project. As I walk through each of these classes, starting with those that are focused on the underlying Framework, I will provide quick samples along with information on the properties and classes they contain.
As I mentioned earlier, it can sometimes be difficult to find the exact functionality that you need when you're working with the .NET Framework, but finding it isn't the only issue you need to be aware of. In some particular circumstances, even after you have found the class you need, the specific steps and constructor parameters needed to get it ready can take several lines of code and can be difficult to understand. The My classes focused on the Framework (My.Application, My.Computer, and My.User) are designed to help you navigate directly to the class you need, and to set it up so that you are ready to do your work.
My.Application
My.Application provides developers with an intuitive grouping of application information and services. Individual nodes under My.Application include Info (the application's copyright, title, description, and so on), OpenForms (a collection of all Forms currently open in the project), Log (a feature-rich, highly configurable logging facility that is integrated with the System.Diagnostics classes), and more.
Using the My.Application.Log class, logging exceptions is easier than it probably should be. How are developers supposed to feel like true code warriors when they can write code like this: Dim winINIFile As String
Try
winINIFile = My.Computer.FileSystem.ReadAllText("c:\windows\wind.ini")
Catch ex As IO.FileNotFoundException
My.Application.Log.WriteException(ex, TraceEventType.Error,
"Error Accessing INI File")
End Try
One of the more common feature requests that have come out of discussions with users of Visual Basic 6.0 and earlier verions has been answered with the addition of the OpenForms collection. This feature, which was available through the keyword Forms in Visual Basic 6.0, provides you with an easy way to loop through all of the currently open forms in your application, without the hassle of maintaining your own global list, as shown here: For Each f As Form In My.Application.OpenForms
Debug.WriteLine(f.Text)
f.WindowState = FormWindowState.Minimized
Next
My.Computer and My.User
My.Computer allows you to navigate to services and data related to the host computer. The functionality in this class alone deserves its own article, but I'll discuss a few of the highlights.
The FileSystem classes provide a very simple API for working with and inquiring about files; this should banish any lingering yearning for the FileSystemObject library. The following code uses the FileSystem class to copy all of the pictures from the current user's My Pictures folder to a new folder (C:\Desktop Wallpaper), displaying a progress bar if the file copy takes more than a few moments to complete: Dim myPics As String = _
My.Computer.FileSystem.SpecialDirectories.MyPictures
My.Computer.FileSystem.CopyDirectory( _
myPics, "C:\Desktop Wallpaper", _
FileIO.UIOption.AllDialogs, _
FileIO.UICancelOption.DoNothing)
MessageBox.Show(My.Computer.FileSystem.GetFiles( _
myPics, FileIO.SearchOption.SearchAllSubDirectories, _
"*.jpg", "*.bmp").Count)
Accomplishing the same file copy in the .NET Framework 1.1 would require quite a bit more code (see Figure 1), and that is without including the ability to show a progress dialog, which you would have to create yourself.
My.Computer.Ports turns reading and writing to a serial port into a simple process. This is one of the most common and difficult tasks to perform using the current version of the .NET Framework. The snippet shown here previously took an entire article to build! (See Serial Comm: Use P/Invoke to Develop a .NET Base Class Library for Serial Device Communications.) Dim comport As IO.Ports.SerialPort
comport = My.Computer.Ports.OpenSerialPort("COM1")
AddHandler comport.ReceivedEvent, AddressOf DataReceived
The My.Computer.Audio class allows you to play user-defined or system sounds, putting an end to the practice of P/Invoking the PlaySound API, as shown in the following code: Dim musicFile As String
musicFile = My.Computer.FileSystem. _
GetFiles("C:\WINDOWS\Media", _
FileIO.SearchOption.SearchAllSubDirectories, _
"*.wav")(0)
My.Computer.Audio.Play(musicFile)
My.Computer.Network makes a wide variety of networking calls easy to use, including receiving and sending Pings from and to a remote machine, uploading or downloading a file, determining if you are currently connected, and quite a bit more: If My.Computer.Network.IsAvailable Then
If My.Computer.Network.Ping("www.duncanmackenzie.net") Then
Debug.WriteLine("Site Available")
My.Computer.Network.DownloadFile( _
"http://www.duncanmackenzie.net/Articles/", _
System.IO.Path.Combine( _
My.Computer.FileSystem.SpecialDirectories.MyDocuments, _
"articles.html"))
End If
End If
There are quite a few more classes that I am not going to even start describing, including My.Computer.Keyboard, My.Computer.Registry, and My.Computer.Screen. I encourage you to explore these on your own.
My.User is one of the simplest classes in My, but don't let its simplicity fool you; it provides access to quite a few useful bits of information about the current user of the app. This includes methods for querying role membership, and status functions like IsAuthenticated: If My.User.IsAuthenticated Then
If My.User.IsInRole("BUILTIN\Administrators") Then
MsgBox("tsk, tsk... running as Admin are we?")
End If
End If
Note that the My.User properties and methods use Windows authentication by default, but will work seamlessly with custom security infrastructures as well, keeping the coding model the same regardless of the type of authentication you use.
Exposing Settings, Resources, and More From Your Project
The project-focused classes in My include Settings, Resources, WebServices, and Forms. The first two deal with your project's associated data while the clearly named Forms and WebServices classes provide direct access to forms and Web services that you have added to your project.
Working through the IDE of Visual Studio® 2005, you can set up a variety of resource elements and a strongly typed group of user or application-level settings for your application (through the designer interface shown in Figure 2).
Figure 2 Settings Designer
In both cases, you have to configure the settings or resources before the corresponding classes will become available through My, but once they have been added to your project, the My.Settings and My.Resources classes (respectively) make it easy for you to interact with either type of information. The following routine retrieves and modifies the value of a stored user setting, then uses the My.Resources class to retrieve a localized string (created using the IDE tools shown in Figure 3) for use in a message box: Dim lastRun As Date My.Settings.LastRun
My.Settings.LastRun = Now()
Dim myMessage As String = _
String.Format(My.Resources.LastRunMessage, _
lastRun.ToShortDateString)
MsgBox(myMessage)
Figure 3 Resource Editing
In addition to the two areas just described, all of the forms in your project are available through My.Forms and any Web services you have referenced in your project are exposed through the My.WebServices class. For Web services, this means you have the option of referencing them directly without manually creating an instance. So, after adding a reference to the WeatherForecast service from webservicex.net, you can retrieve the current temperature using the following code: Dim tempService As New net.webservicex.www.WeatherForecast()
Dim wf As net.webservicex.www.WeatherForecasts
wf = tempService.GetWeatherByZipCode("98052")
MsgBox(wf.ToString())
This can be expressed more simply as: MsgBox(My.WebServices.WeatherForecast.GetWeatherByZipCode("98052").ToString())
My.Forms is different from the My.Application.OpenForms collection that I discussed earlier because My.Forms exposes a default instance of each of your Form classes, not the currently open instances of those classes. If you have a background in programming in Visual Basic 6.0 or earlier, then these default instances will be extremely useful to you as they enable you to show, hide, or otherwise access your forms using the Form's class name directly: Private Sub showForm2_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles showForm2.Click
My.Forms.Form2.Show()
End Sub
Private Sub updateForm2_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles updateForm2.Click
My.Forms.Form2.Text = "Updated..."
End Sub
This was standard behavior in Visual Basic before the release of the .NET Framework, and it will be a welcome restoration to developers who became familiar with that style of programming in Visual Basic 6.0.
Conclusion
The My namespace in Visual Basic 2005 provides a quick and easy method for accessing some of the deeper areas of functionality in the .NET Framework without preventing you from using the Framework directly in any way you choose. In addition to exposing Framework functionality, some areas of My, such as the Forms collection, bring back familiar and convenient programming concepts from earlier versions of Visual Basic. Try it out in Visual Studio 2005 and Visual Basic 2005 Express, and I'm confident that you will find it useful.