Speech-To-Text

POS tagging has many facets. I need to look closer into POS systems and figure out what’s the best call. It’s not always easy to say that a sentence requires a noun/verb structure. What about other languages that don’t have the same Western approach?

 

Programming paradigms forgotten

Two paradigms in the programming world that I’m currently studying at Hofstra in my OS class lately are the monitor and semaphore.

The semaphore can be applied to the producer/consumer problem, or the the bounded buffer problem where you don’t consume or produce at the same time. Semaphores have a waiting list queue and a counter associated with them. With a producer/consumer problem, in general, semaphores provided are full, empty, and a mutex; respectively initialized as 0, N, 1.

The monitor, on the other hand, is used for problems that the semaphore is not well-suited to handle, such as the dining-philosophers problem where 5 philosophers sit at a table and each philosopher needs two chopsticks to eat. However, there are only 5 chopsticks. Monitors handle this by allowing states and conditional variables. A philosopher can be either thinking, hungry, or eating. In the eating state, a philosopher will have waited for two chopsticks. And, after eating, he signals to others that they can try to eat.

 

Microsoft Azure Architecture

Azure Architecture

Azure is a complex architecture that currently uses the PAAS paradigm. There is talk about the new IAS paradigm also. Currently, I will be focusing on the PAAS architecture and how putting an app on the cloud with Azure works. To better understand how we can monitor, program, and create cloud service, we should first explore the architecture.

Windows Azure basically has a Management Portal schema that serves as a connection for the various services that it provides. Azure offers an SDK to connect to the portal that will allow you to perform various tasks on the platform. It is important to note that the SDK is necessary and that there isn’t a way of escaping the installation of an SDK for management (although an extra software option from MS is described below). To get a better understanding of the architecture, the image below is presented:

Windows Azure Platform Architecture

The Azure cloud platform and services depend on the fact that there are three main roles to be considered: Worker Role, Web Role, and VMRole. These roles play a key part in determining what actions can be done.

The Web Role is a role that is defined on the Azure platform to be where web apps may be deployed in server containers such as IIS. As the image below depicts, it is easy to find that we will need to manage applications on all three realms; and therefore, will need to understand the roles thoroughly. A more detailed description of roles is explained below.

The Azure Elements

The Azure Elements

Below we clearly state the definitions of the roles that a service would use.

Web Role – A service component that is customized for web application programming as supported by Internet Information Services (IIS) 7 and ASP.NET. The web role is intended to serve as the front-end to your hosted service.

Worker Role – A service component that is useful for generalized development, and may perform background processing for a web role. A worker role is frequently used for long-running tasks that are non-interactive, but you can host any type of workload. Worker Roles are used for:
- Long running tasks that are asynchronous that user does not have to wait for.
- To host application services that do not require a user interface.
- Background services listening to a queue.
- Running TCP based services.
- Compute intensive jobs.

VM Role – A special type of service component that offers the ability to fully control the operating system image of the virtual machine. The advantage of using a VM role is the ability to easily update the operating system image and to directly install applications.

With the three roles in place. We should focus now on what’s needed to deploy an app within the Azure architecture. The basic building block of every application, the service configuration, is part of the five main inputs that are needed to create an app. Here is the list explicitly:

Credentials

The Credentials are part of the input from Visual Studio where the Azure SDK is installed that allow the user/service maker the ability to log on to the Azure platform and deploy an app.

Environment

The environment is an admin-defined area that has been designed to deploy apps. This will be created by an administrator or developer.

Account

The actual account used for storage purposes. This storage container is what holds the information for how much the account user will be charged. Basically, the amount of data that is used/transferred on the account determines the final cost.

Service Configuration

From a maintainers standpoint of view, this is the most important part of deploying an application and where the administrator that is deploying an application can specify specifics about the log environment.
Build Configuration

The integrative piece that the developer/admin would have to choose for the specific build that has the parameters defined.

To better understand how the five inputs to create an app are entered. Please have a look at this image:

The Five Inputs

The Five Inputs

To find out more about how to deploy apps on the Azure platform, please follow the link below:

http://msdn.microsoft.com/en-us/library/windowsazure/ff683672.aspx

For the most part, the architecture of azure contains a place for running applications, a database available for various purposes, and a Blob/Queue service. Applications can be ran on demand and will normally fit into one of the roles described above. Many times certain applications will have to be placed into a VM role that will later be defined.

PAAS model

The Azure Service Model

The cost of Azure is very similar to Amazon and instances are based on how much RAM may anticipate on consuming. The instances range from 768MB of memory up to 14GB. The general table of the instance size and cost can be seen below:

VM Size CPU Cores Memory Disk Space for Local Storage Resources Allocated Bandwidth (Peak Mbps)
ExtraSmall Shared 768 MB 20 GB 5
Small 1 1.75 GB 225 GB (165 GB for VM role) 100
Medium 2 3.5 GB 490 GB (340 GB for VM role) 200
Large 4 7 GB 1000 GB (850 GB for VM role) 400
ExtraLarge 8 14 GB 2040 GB (1890 GB for VM role) 800

Authenticating Applications on Azure

In order to correctly manage Azure, you will need to connect to the Management portal.  The Management Portal will allow you will to set up authenticate with the platform. This is a normal strategy used by any other Cloud platform and should not be considered difficult.

In order for an external application like Sharepoint or Facebook to access the Azure platform, credentials are set up using the access control service (ACS). The ACS will provide you with all of the means to get your external apps authenticated on Azure.

This article explains how to connect a Sharepoint instance to Azure:

http://www.wictorwilen.se/Post/Visual-guide-to-Azure-Access-Controls-Services-authentication-with-SharePoint-2010-part-1.aspx

On the other hand, some of the caveats that the ACS has solved and experienced are better summed up in the link below. Services such as Web Services tend to be hard to control from an authentication point of view on any cloud platform.

http://www.readwriteweb.com/cloud/2011/09/build-2011-windows-azure-tackl.php

Restful API Service and Blobs

One of the nice features that I have seen from Azure is that it offers a Restful API service that can be used to access the following services:

Blob service, Queue service, Table service

Storage services may be accessed from within a service running in Windows Azure, or directly over the Internet from any application that can send an HTTP/HTTPS request and receive an HTTP/HTTPS response.

To learn more about how the Restful API service can be used, follow the link below:

http://msdn.microsoft.com/en-us/library/windowsazure/dd179355.aspx

To see code and how a blob is stored to the SQL Azure datbase please go to this link:

http://code.msdn.microsoft.com/windowsazure/Backup-SQL-Azure-To-3b566585/sourcecode?fileId=22839&pathId=341210472

Tools Needed to Run An App

Tools to create an Azure application are available on-line here:

http://www.windowsazure.com/en-us/develop/downloads/

The tools will allow an application developer to develop an application ready for the cloud using Java, Php, Node.js, and .NET. The Java and PHP tools are created for Eclipse and can be integrated into the IDE as plugins and a series of .jar files. Nonetheless, it is important to know that an Azure-ready application should be created on Windows 7 or Windows Server 2008. Read more about the necessary system requirements here:

http://msdn.microsoft.com/en-us/library/windowsazure/hh690953%28vs.103%29.aspx

To run an application as a hosted service in Windows Azure, you must package the application files into a .cspkg file and then upload the package file and the service configuration file to Windows Azure. You have to package the application and get it ready for Azure. To do this there are various tools. The one that seems most suppported is the azure tools that integrate in with visual studio. Read more about the tools and applications

http://msdn.microsoft.com/en-us/library/windowsazure/gg433108.aspx

Services can be called via http like:

http://<account-name>.blob.core.windows.net/?restype=service&comp=properties

restype=service&comp=properties Required. The combination of both query strings is required to get the storage service properties.timeout

Optional. The timeout parameter is expressed in seconds. For example, the following value sets a timeout of 30 seconds for the request: timeout=30

Making Azure work with PHP

While the tools and platform are naturally designed for and work better on the Windows .Net tools, Php application support is also offered. In order to deploy an app on Azure using Php, the developer would use the Azure SDK for PHP. The easiest way to do this is using the Eclipse IDE tools provided. Here’s a quick explanation of how it’s done.

http://www.sitepoint.com/windows-azure-php/

Services

The Platform As A Service (PAAS) design on Azure is maximized for application deployment and monitoring. In order to create a hosted service, Azure has defined a service model that should be followed. A description from the MSN site follows.

A service requires two configuration files, which are XML files.The service definition file (ServiceDefinition.csdef) describes the service model. It defines the roles included with the service and their endpoints, and declares configuration settings for each role.The service configuration file (ServiceConfiguration.cscfg) specifies the number of instances to deploy for each role and provides values for any configuration settings declared in the service definition file.

In these two links you will see how the service files are defined and their purpose:

http://msdn.microsoft.com/en-us/library/windowsazure/gg432967.aspx

http://msdn.microsoft.com/en-us/library/windowsazure/hh124110.aspx#bk_Define

The service model basically guarantees that the roles defined will react accordingly. Therefore, when a service is defined, one of the roles has to also be defined. The three main roles are: web role, worker role, VM role.

Although, in theory a service can have up to five roles. The roles and configuration details can all be seen at this link:

http://msdn.microsoft.com/en-us/library/windowsazure/gg433030.aspx

Azure Scales

Azure has been designed to scale automatically. The SQL Azure, described below, is based on services and the management of the services and database leaving the scaling of the database up to the platform. Therefore, in most cases applications and data are set up for an initial scaling degree and then handled by the service. Nonetheless, Azure provides a more complex way of providing high performance by using queues, parallel computing, and a Service Oriented Architecture. The tools used to manage scalability on granular level is called Windows Azure HPC Scheduler SDK. To lear more about the scheduler, read this link:

http://msdn.microsoft.com/en-us/library/windowsazure/hh545593.aspx

Architecture Information

There is a wealth of information on Microsoft’s sight about the Azure architecture. The link below describes more in detail the costs, the platform, and overall architecture of Azure.

http://msdn.microsoft.com/en-us/library/windowsazure/dd163896.aspx

SQL Azure

Microsoft SQL Azure Database is a cloud-based relational database service that is built on SQL Server technologies and runs in Microsoft data centers on hardware that is owned, hosted, and maintained by Microsoft. This topic provides an overview of SQL Azure Database and describes some ways in which it is different from SQL Server.

The SQL aspect of Azure is a key part of the PAAS as a whole and it plays an integral role of the different access options and layers that may be contained and manipulated from an application. The end relation database that a user sees in SQL Azure is somewhat similar to its SQL Server counter parts. Nonetheless, the actual layers involved in the overall architecture to present the database as a relational database are more complex. SQL Azure consists of four major layers:

Client layer,  Services layer, Platform layer, and the Infrastructure layer

The image below will help better understand the complexities of the four layers. Click on the image to read more detailed information about each layer.

SQL Azure Layers

SQL Azure Layers

One of the features that Microsoft claims to be a “key advantage” is that the SQL Azure database automatically scales. Of course, we all know that when something is automatic that means trouble because following its growth and logging will probably be more difficult.

Federations and Scaling

SQL Azure Federations is a technology for building scale-out database solutions. Federations are objects in SQL Azure databases just like other objects such as tables and stored procedures but provide system managed databases to allow applications to scale out parts or all of their data.

A federation is a collection of database partitions that are defined by a federation distribution scheme, known as the federation scheme. The federation scheme defines a federation distribution key, which determines the distribution of data to partitions within the federation. The federation distribution key must be an INT, BIGINT, UNIQUEIDENTIFIER, or VARBINARY (up to 900 bytes) and specifies a range value. There can only be one federation scheme and one federation distribution key for a federation.

SQL Azure doesn’t support join operations across databases, your application must implement the logic for joining data from multiple federation members
Federations use horizontal partitioning

http://msdn.microsoft.com/en-us/library/windowsazure/hh778416.aspx

http://msdn.microsoft.com/en-us/library/windowsazure/hh597452.aspx

SQL Federations for Scaling

SQL Federations for Scaling

Microsofts says that you will choose to partition your data and the Azure Service will basically scale by itself as the data gets bigger. This model is called the pay-as-you-grow pricing model. The protocol used to transfer data between the pay-as-you-grow service and other applications is the TDS protocol, similar to what SQL Server uses. To find out more about how the scaling works, please review this link:

http://msdn.microsoft.com/en-us/library/windowsazure/ee336230.aspx

Microsoft administers the physical hardware such as hard drives, servers, and storage
You continue to administer databases, logins, users, and roles SQL Azure Database automatically replicates all data to provide high availably. SQL Azure Database also manages load balancing and, in case of a server failure, transparent fail-over.
To provide this level of physical administration, you cannot control the physical resources of SQL Azure Database. For example, you cannot specify the physical hard drive or file group where a database or index will reside. Because the computer file system is not accessible and all data is automatically replicated, SQL Server backup and restore commands are not applicable to SQL Azure Database.

The above information is explained in this link:

http://msdn.microsoft.com/en-us/library/windowsazure/ee336241.aspx

Logins and Users on SQL Azure

In order to create a new user or administrate the SQL Azure database, you connect to the database using the Management Portal for SQL Azure or using the more traditional method which is to connect using SQL Server’s Management Studio. You will find that in order to manage the firewall for SQL Azure, it is much simpler to use the management portal. However, for seasoned database administrators the users, logins, and other materials can be found to be much simpler through SQL Server Management Studio.

SQL Azure database basically runs on the same principals as SQL Server. There is a sa user and a master database where most of the important information about the server is kept. If you want to learn more about how to manage the database, here’s the link for managing the database and users:

http://msdn.microsoft.com/en-us/library/windowsazure/ee336235.aspx

Installation and Provision of SQL Azure

As stated before, SQL Azure can be managed completely from the Windows Azure Platform Management Portal or the SQL Azure Database Management REST API. With a Windows Azure platform account you are allowed to access all of the services that you prefer, in particular, SQL Azure. One account can be used to provision and create multiple instances of the SQL Azure service needed.You can provision multiple SQL Azure servers in the same or different data centers around the world and all of your servers can be bound to a single subscription

Here is a very important notice taken from the Azure website:

By default, SQL Azure supports up to 6 servers per subscription and 150 databases in each SQL Azure server, including the master database.

An azure server can contain multiple databases. So, in general, for most of the applications on the platform, there will be a database clearly provided and data exclusion should be easy to achieve. It is also worthy to note that SQL Azure storage allows you to allocate databases up to 150 GB in size.

Transferring Data via SQL Azure

Another important facet of the SQL Azure platform should be considering the data that is to be transferred from outside of the Azure platform and across the web. Azure makes sure that the data is secure and can be easily passed through the web via sockets that use tabular data stream (TDS) over a secure sockets layer (SSL). Transactions are done much like any other SQL Server Instance would be done in a T-SQL manner. Here’s an image from the Microsoft website that explains two ways to access data over the web. In both cases the data is secure.

Acessing Data Across the Web

Acessing Data Across the Web

If you want to learn more about passing data over the web, visit this link:

http://msdn.microsoft.com/en-us/library/windowsazure/ee336239.aspx

Administration and Monitoring of an SQL Azure Instance

The administration and monitoring aspects of an SQL Azure instance are similar to those of a normal SQL Server instance. SQL Azure provides a window into the database connections, queries, and other important features by using Dynamic Management Views. The MS site says that there are three Dynamic Views available:

  • Database-related dynamic management views.
  • Execution-related dynamic management views.
  • Transaction-related dynamic management views

All of the views and their details are conveniently located here:

http://msdn.microsoft.com/en-us/library/windowsazure/ee336238.aspx

Here’s an example of a simple query that can be executed on the instance itself to monitor the connections:

SELECT
e.connection_id,
s.session_id,
s.login_name,
s.last_request_end_time,
s.cpu_time
FROM
sys.dm_exec_sessions s
INNER JOIN sys.dm_exec_connections e
ON s.session_id = e.session_id
GO

In order to connect to an SQL Azure instance and actually run these commands, it is important to note that there is a firewall.  The firewall grants access based on the originating IP address of each request. Firewall rules are also setup and managed on the Management Portal.

All other functionality would be done by a database administrator that know how to issue commands for backing up the database, migrating the database, and in general administering the database. If you are interested about DB Management of an SQL Azure instance, read more from the two links below:

http://msdn.microsoft.com/en-us/library/windowsazure/ff394103.aspx

http://msdn.microsoft.com/en-us/library/windowsazure/ff394116.aspx

The SQL Azure database is meant to make application integration on the cloud a simpler process than having to manually install databases and control their scaling via the command line or management studio. The Management Portal allows the user to manipulate the most intricate parts of the Azure Platform, one of those being the most important pieces of the SQL Azure database as a service.

For more information on SQL Azure and the intricacies and details of the product, please review this link:

http://msdn.microsoft.com/en-us/library/windowsazure/ee336241.aspx

Azure’s CDN Capability

One of the key features that can be considered important is Azure’s CDN (Content Delivery Network) capability. This will allow users to access specific attributes in a quick way by caching urls fand items or faster lookups. If content is accessed often, it should be put  on the CDN that Azure provides.The prices are listed on the azure website here:

http://www.windowsazure.com/en-us/home/features/cdn/

The CDN is most probably used for Blob delivery and can be allocated via Azure’s Management Portal. Typical urls look like this:

  • Windows Azure blob storage URL: http://youraccount.blob.core.windows.net/images/
  • Windows Azure CDN URL: http://<identifier>.vo.msecnd.net/images/

To learn more about the CDN and how it works, please visit this link:

http://msdn.microsoft.com/en-us/gg405416

Monitoring and Logging on Azure

Azure has taken a big step in logging and made sure that throughout the platform both logging for monitoring and logging and monitoring for applications is available through the APIs and SDK provided for Azure users. Services and servers can be monitored in various ways and there are also some other tools available that do a better job at monitoring and logging. For now, we will focus on the default logging and monitoring frameworks that Azure provides.

Application Logging on the PAAS

Logging and tracing in general is done through the System.Diagnostics namespace in Windows Azure. These diagnostics serve as a logging framework and are what should be used in order to successfully trace and log events on the platform. The framework is called Event Tracing for Windows (ETW).

Metrics are gotten on the PAAS side by

The types of logs that can be collected through the Windows Azure diagnostics can be found at this link:

http://msdn.microsoft.com/en-us/library/gg433009.aspx

The platform basically gives you a way to view events, errors, and other logs. The most important log is the Windows Azure log that requires that a trace listener is applied to the web.config or application configuration file. The trace listener available via the web and worker roles described before and should be done using the Windows Azure SDK provide. It is important to note that a Windows installation of the tools is necesary.

Using the SDK you should change any parameters as usual. Most importantly, you will want to add the log configurations described in this article.

http://consultingblogs.emc.com/gracemollison/archive/2010/08/31/monitoring-applications-deployed-on-paas-windows-azure-business-as-usual.aspx

Adding to the ServiceConfiguration.csfg file gives a way for you to configure what service you want to use and where you want your application to be stored. The logging parameters should be entered inside of the application itself in the corresponding web.config or app.config file.
Please review the following link for a very concise application method of logging:

http://msdn.microsoft.com/en-us/magazine/ff714589.aspx

Azure Diagnostics for Logging

Azure Diagnostics for Logging

API for Monitoring

Microsoft has a public REST API to monitor Windows Azure. The information is at the following link:

http://msdn.microsoft.com/en-us/library/windowsazure/ff800682.aspx

The API basically works by sending a GET request with some header variables that receives an XML response which contain information about the deployed platform elements. The XML returned can is a display of information contained in this class mentioned by Microsoft:

Microsoft.WindowsAzure.Diagnostics.Management: Classes in this namespace enable you to collect logs and diagnostic information remotely.

Here’s an example of a API reference to list all storage accounts:

https://management.core.windows.net/<subscription-id>/services/storageservices

All of the different operations that can be performed on the API are located here:

http://msdn.microsoft.com/en-us/library/windowsazure/ee460799.aspx

It should also be noted that, apart from using the API, MS offers a .net library that can perform all of these operations already and that there is a logging tool that is explained below that can be purchased to not only view performance and logging, but also do some other important tasks that would be otherwise more difficult.

The job of preparing the application for logging can be described as a combination of steps that include tracing, setting up a persistent data store, and implementing a role (web or worker). To better understand how an application should be prepared for monitoring on the Azure platform, review this url:

http://channel9.msdn.com/learn/courses/Azure/Deployment/DeployingApplicationsinWindowsAzure/Exercise-3-Monitoring-Applications-in-Windows-Azure

Once the application has been set up in one of the manners described above, it can then be monitored by the Azure Management Pack decribed below.
Monitoring applications on the Azure Platform

In order to monitor effectively from a standpoint of view of an operations team, the Azure Management Pack should be installed.

The link to download the pack can be found here:

http://www.microsoft.com/download/en/details.aspx?id=11324

However, I recommend that you read the link here on installing the pack.

http://blogs.msdn.com/b/walterm/archive/2011/02/14/adding-azure-application-monitoring-to-scom-2007-r2.aspx

Once installed, the environment should show you deployed applications and the logging materials needed. Here’s an example photo taken from the link above:

Application Management Pack

Application Management Pack

The basic idea is that the monitoring service will monitor any of the applications that have been setup as described before for logging. Once an application has the appropriate listener and is designated to be in the web or worker role, it can be monitored using the tool here. The Diagnostic service must be available for the application and the role. This links below reiterate what was described before about getting your application ready for the platform and monitoring:

http://msdn.microsoft.com/en-us/library/windowsazure/hh411552.aspx

http://msdn.microsoft.com/en-us/library/windowsazure/gg433052.aspx

Monitoring and the System Center

Monitoring on the Azure system should be done, as iterated before, using the proper tools. The most widely used tool and what Microsoft has offered for log and monitoring Management is the System Center:

http://www.microsoft.com/en-us/server-cloud/system-center/default.aspx

System Center offers the typical graphs and monitoring capabilities that a system operation team would expect. Here’s a typical view of some Cloud Instances that one would see while using System Center.

Typical Monitoring Using System Center

Typical Monitoring Using System Center

System Center's Deployed App Monitoring

System Center's Deployed App Monitoring

System Center allows an operations team to deploy and monitor applications with ease. Here’s a link for more information:

http://blogs.technet.com/b/server-cloud/archive/2011/12/01/managing-and-monitoring-windows-azure-applications-with-system-center-2012.aspx

Logging and Monitoring Summary

Logging for Windows Azure in the cloud is turned on by default and is part of the Azure SDK. The logs are available by various means. The application must be set up for logging by setting the proper tracers and loggers in its configuration files. Once an application has been set up for logging, a monitor such as the SystemCenter can be used to review a deployed applications logs.

In order to set up the application for logging, the application developer must be aware of his/her responsibilities and how the framework works. It is not entirely up to Azure to decide the logging framework, other loggers can be used. Here’s an example of a logger called log4net that logs to the PAAS in Azure.

http://www.kongsli.net/nblog/tag/paas/

By using the web or worker roles, an application developer can prepare his/her application by adding the appropriate listener to the application’s configuration file. Here’s a link that shows the various options:

http://msdn.microsoft.com/en-us/library/gg433009.aspx

For example, if a developer or administrator want to initialize the diagnostic monitor on a service such as an IIS tracer or crash, a .NET application would be configure to do the monitoring using the configuration file settings below by initializing a diagnostic monitor:

<tracing>
<traceFailedRequests>
<add path=”*”>
<traceAreas>
<add provider=”ASP” verbosity=”Verbose” />
<add provider=”ASPNET” areas=”Infrastructure,Module,Page,AppServices” verbosity=”Verbose” />
<add provider=”ISAPI Extension” verbosity=”Verbose” />
<add provider=”WWW Server”
areas=”Authentication,
Security,
Filter,
StaticFile,
CGI,
Compression,
Cache,
RequestNotifications,
Module”
verbosity=”Verbose” />
</traceAreas>
<failureDefinitions statusCodes=”400-599″ />
</add>
</traceFailedRequests>
</tracing>

More information on how a diagnostic service is initialized can be found here:

http://msdn.microsoft.com/en-us/library/gg433052.aspx

We should keep in mind that in order to collect data about specific Diagnostics on a service that is not viewable via SystemCenter or some other pre-installed application, we would have to create an application that would collect the data. Here’s a quick example of data collection done using C Sharp. The entire article can be found here:

http://msdn.microsoft.com/en-us/library/gg433124.aspx

In order to start the Diagnostic Monitor you would add a line to the source file like this:

DiagnosticMonitor.Start(“Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString”, config);

If the administrator or developer want to see Crash Dumps for example, a line would be added to the source like this:

Microsoft.WindowsAzure.Diagnostics.CrashDumps.EnableCollection(true);

Once the diagnostic monitor has been initialized, an application can easily created to do specific monitoring tasks such as checking if IIS failed. Here’s a link that shows how to do that:

http://msdn.microsoft.com/en-us/library/gg433083.aspx

In order to actually perform the above, you would have to add a link to the service file. The service file is a part of the service definition. Services can be defined on the Azure platform as described before. Apart from the link above, the service file would have to be modified in order to define the roles for the service. Here’s a link on how that is done:

http://msdn.microsoft.com/en-us/library/windowsazure/ee758711.aspx

Last, here’s a typical link on how a service shema could be defined for a simple service

http://msdn.microsoft.com/en-us/library/windowsazure/ee758710.aspx

It should be noted that when you create a new service in Windows Azure using Visual Studio, it’s already enabled to do basic logging.

More Information on Logging

Read more about how an application can be monitored here:

http://blogs.technet.com/b/corydelamarter/archive/2011/08/19/monitoring-azure-applications-part-1.aspx

Java Regular Expressions

Spent a bit trying to understand Regular Expressions in Java and how to make an email validator that validates the “at” symbol such as john at website.com. This is not an easy task and I don’t like dealing with Regex. But, I know it has to be done.

I will have to read this tutorial:

http://docs.oracle.com/javase/tutorial/essential/regex/

to get a better outset of it. For now, I will just validate on the mail. Stanford’s class requires this in the spamlord solution.

MySQL Replicas

Been working lately on getting up a replica in mysql and locking down a server in Debian 5. So, the truth of it all is that with Debian it’s pretty simple as far as the installation is concerned you just use a simple command. The harder part is really getting all of the users up and going.

I created a group and user called mysql for the box itself. I also gave root a really tough password and limited it to local connections only. Lastly, I made a user with the normal properties, except for drop, that could connect remotely. That I did by using the mysql command GRANT.

After that, I poked a hole in the firewall with an IPtables command and saved the poke with iptable-save. That worked out well. I did have to play around with both the IP and hostname on mysql and the other.

The Master/Slave part was not so bad either.

Everything else was pretty standard procedure of typical mysql dumps.

 

Natural Language Probability

This is my first article about natural language processing. And, actually I’m going to keep it short.

Bilingual speakers can attest that translation is not always easy. Most mono-lingual speakers assume that bilingual speakers can easily translate texts from one language to another without having to think about it.

I recall in Spain being asked in Spanish “Como se dice…. en ingles?”. And, to be honest, although I know the translation literally and knew the phrase in Spanish, I did not know how to exactly translate the phrase to English because the literal translation did not sound correct. One of the typical Spanish phrases in Spain can be literally translate to “his touching his nose”. That phrase obviously has no semantic meaning in English. But, in Spanish it means to sit around and do nothing all day.

These types of subtleties began to intrigue me years ago. And, recently I have decided to take on the task of translations by employing various known parsing techniques of computational linguistics and NLP.

My latest research kind of supports the idea that semantic meaning cannot be extracted by pure, literal text translation as most linguists will probably concur.

ls or find command to find files that do not match a

find -not -name “*_*” -print

This is a bit too broad, actually,
because I presume that you don’t want to match directories if you can help it.
This is done by adding the primary -type f. If you’d like to further constrain your
search results to just those files in the current directory (remember, find likes to
traverse entire file trees, not just the current directory) you can add -maxdepth 1.
Change the “1″ to a “2″ and you’ll get only the current directory and matches one level deeper.

Put it all together and even toss in a second filename conditional to screen out
files with dashes in their names and here’s what you end up with:

find . -not -name “*_*” -and -not -name “*-*” \  -maxdepth 1 -type f -print

SQL SERVER reindexing

Taken from the microsoft site:

DBCC DBREINDEX
Rebuilds one or more indexes for a table in the specified database.

Syntax
DBCC DBREINDEX
(  [ 'database.owner.table_name'
[ , index_name
[ , fillfactor ]
]
]
)  [ WITH NO_INFOMSGS ]

Arguments
‘database.owner.table_name’

Is the name of the table for which to rebuild the specified index(es). Database, owner, and table names must conform to the rules for identifiers. For more information, see Using Identifiers. The entire database.owner.table_name must be enclosed in single quotation marks (‘) if either the database or owner parts are supplied. The single quotation marks are not necessary if only table_name is specified.

index_name

Is the name of the index to rebuild. Index names must conform to the rules for identifiers. If index_name is not specified or is specified as ‘ ‘, all indexes for the table are rebuilt.

fillfactor

Is the percentage of space on each index page to be used for storing data when the index is created. fillfactor replaces the original fillfactor as the new default for the index and for any other nonclustered indexes rebuilt because a clustered index is rebuilt. When fillfactor is 0, DBCC DBREINDEX uses the original fillfactor specified when the index was created.

WITH NO_INFOMSGS

Suppresses all informational messages (with severity levels from 0 through 10).

Remarks
DBCC DBREINDEX rebuilds an index for a table or all indexes defined for a table. By allowing an index to be rebuilt dynamically, indexes enforcing either PRIMARY KEY or UNIQUE constraints can be rebuilt without having to drop and re-create those constraints. This means an index can be rebuilt without knowing the table’s structure or constraints, which could occur after a bulk copy of data into the table.

If either index_name or fillfactor is specified, all preceding parameters must also be specified.

DBCC DBREINDEX can rebuild all of the indexes for a table in one statement, which is easier than coding multiple DROP INDEX and CREATE INDEX statements. Because the work is done by one statement, DBCC DBREINDEX is automatically atomic, while individual DROP INDEX and CREATE INDEX statements would have to be put in a transaction to be atomic. Also, DBCC DBREINDEX can take advantage of more optimizations with DBCC DBREINDEX than it can with individual DROP INDEX and CREATE INDEX statements.

DBCC DBREINDEX is not supported for use on system tables.

Result Sets
Whether or not any of the options (except NO_INFOMSGS) are specified (the table name must be specified), DBCC DBREINDEX returns this result set; this example uses the authors table of the pubs database (values will vary):

Index (ID = 1) is being rebuilt.
Index (ID = 2) is being rebuilt.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.

DBCC DBREINDEX returns this result set (message) if the NO_INFOMSGS option is specified:

DBCC execution completed. If DBCC printed error messages, contact your system administrator.

Permissions
DBCC DBREINDEX permissions default to members of the sysadmin fixed server role, the db_owner and db_ddladmin fixed database roles, and the table owner, and are not transferable.

Examples
A. Rebuild an index
This example rebuilds the au_nmind clustered index with a fillfactor of 80 on the authors table in the pubs database.

DBCC DBREINDEX (‘pubs.dbo.authors’, UPKCL_auidind, 80)

B. Rebuild all indexes
This example rebuilds all indexes on the authors table using a fillfactor value
of 70.

DBCC DBREINDEX (authors, ”, 70)

File Upload Problem PHP

Go to Internet Explorer -> Tools -> Internet Options

1) Click on the Security Tab
A)The Internet Globe should be highlighted
B)Click on Custom Level
C)Every Item should be set to enable
D)The Microsoft VM/Java Option should be set to low safety
E)Click OK

2) Click on the Advanced Tab
A) Scroll down to the Browsing Section
1) Uncheck if checked show friendly HTTP Error Messages
2) Uncheck if checked show friendly URLS
B) Scroll down to the Security Section
1) Uncheck if checked the ‘Check for publisher’s certificate revocation’ option
2) Uncheck if checed the ‘Check for Server certificate revocation’ option
3) Uncheck if checked the ‘Warn about invalide site certificates’ option
4) Uncheck if checked the ‘Warn if changing between secure and non-secure mode’ option
5) Check if unchecked the ‘Allow Active Content to run in files’ option
C) Click on Apply
3) Click on the Privacy Tab
A) The pop blocker should be desactivated
C) The Privacy Level should be adjusted to medium or less

4) Click on Apply then Accept