Monday 31 December 2012

Create and Configure Local ASP.NET Web Sites in IIS

Using Internet Information Services (IIS) Manager, you can create a local Web site for hosting an ASP.NET Web application. This topic explains how you can create a local Web site and configure it to run ASP.NET pages. For additional details about installing and configuring IIS, or creating a Web site, see the IIS Help documentation that is included with the product or the online IIS product documentation on the Microsoft TechNet Web site.

As an alternative to creating a local site, you can also create a virtual directory. This provides a way to host the Web site on one computer, while the actual pages and content of the Web site are contained somewhere other than the root or home directory, such as on a remote computer. It is also a convenient way to set up a site for local Web development work because it does not require a unique site identity, which means that it requires fewer steps than creating a unique site. For details, see How to: Create and Configure Virtual Directories in IIS.
Starting IIS Manager

First, you need to start IIS Manager.
NoteImportant

You must be logged on as a member of the Administrators group on the local computer to perform the following procedure (or procedures), or you must have been delegated the appropriate authority.
To start IIS Manager from the Run dialog box

    On the Start menu, click Run.

    In the Open box, type inetmgr and click OK.

To start IIS Manager from the Administrative Services console

    On the Start menu, click Run. In the Run text box, type control panel, and then click OK.

    In the Control Panel window, click Administrative Tools.

    In the Administrative Tools window, click Internet Information Services.

Creating a Local Web site

Once IIS Manager is started, you can create a site. The following procedures explain how to create a site in IIS version 6.0.
NoteNote

The procedures for creating a local Web site in previous versions of IIS are similar to the following procedures, but differ in a few details. For more information about creating a Web site in other versions, see the IIS Help documentation that is included with your local copy of IIS (type http://localhost/iisHelp/ in your browser address bar and then press ENTER) or the online IIS product documentation for previous versions on the Microsoft TechNet Web site.
To create a local Web site in IIS 6.0

    In IIS Manager, expand the local computer, right-click the Web Sites folder, point to New, and click Web Site.

    In the Web Site Creation Wizard, click Next.

    In the Description box, type a descriptive label for the site (this label is not what you will type in the address bar of a browser), and then click Next.

    Type or select the IP address (the default is All Unassigned), TCP port, and host header (for example, www.microsoft.contoso.com) for your site.
    NoteImportant

    To ensure that user requests reach the correct Web site, you should distinguish each site on the server with at least one of three unique identifiers: a host header name, an IP address, or a TCP port number. Using unique host header names is the preferred way to identify multiple Web sites on a single server. To reach your site, a client must enter the name/IP address pair that is listed for the site in the DNS server, or listed in the local HOSTS file. For more information about choosing unique identifiers, see Hosting Multiple Web Sites on a Single Server in the IIS 6.0 product documentation.

    In the Path box, type or browse to the directory that contains, or will contain, the site content, and then click Next.

    Select the check boxes for the access permissions that you want to assign to your users, and then click Finish. By default, the Read and Run Scripts check boxes are selected; these permissions enable you to run ASP.NET pages for many common scenarios.

Configuring a Local Web Site

After creating a new local Web site, you can configure it to run ASP.NET pages and configure security. The following table shows the permissions settings that are available in all versions of IIS, including IIS 6.0.





Account or Group Permissions
Administrators
Full Control
System
Full Control
An account or group that you choose to give browse access to the site if you disabled anonymous authentication when you created the virtual directory.
Read & Execute
The account configured to access system resources for the ASP.NET current user context, such as the Network Service account (IIS 6.0) or the ASPNET account (IIS 5.0 and 5.1)




When you are finished configuring the site, you can then add ASP.NET Web pages to the site's directory.

To configure security and authentication for a local Web site

  1. In IIS Manager, right-click node for the site that you want to configure, and then click Properties.
  2. Click the Directory Security tab, and then in the Authentication and access control section, click Edit.
  3. Select the check box for the authentication method or methods that you want to use for your site, and then click OK. By default, the Enable anonymous access and Windows Integrated Authentication check boxes are already selected.
  4. In Windows Explorer, navigate to the folder that will contain the pages for the site. Right-click the folder and then click Sharing and Security on the shortcut menu.
  5. On the Security tab, configure the additional accounts and permissions that are minimally necessary to run your Web site, and then click OK. Some of the accounts listed, such as Administrators and System, are already configured by default.
    NoteNote
    To change permissions for an existing account, select the account in the Group or user names list, and then select the appropriate permissions check boxes. To add a new account, click Add, and then click the Locations button. Select the local computer name from the list and click OK. Then type the particular account name that you want to add into the text box. After typing in a name, click Check Names to verify the account name, and finally click OK to add the account.

Read & Execute
List Folder Contents
Read
Write









Saturday 29 December 2012

Implementing Cumulative total and Select All functionality with Events in ASP.NET GridView


    Download EventsOfGridView_V2.zip
    Download source code

Introduction

There are many scenarios in which the data can be bound in a Gridview, in which various operation other than provided by default by Gridview needs to be implemented. In this article we will try to bind such operations with some more features.
Background

This article describes various events of the Gridview and in addition some more functionalities which are needed in most scenarios but not provided by ASP.NET Gridview control by default. This article is written for beginner's i.e. We will be using a lot of looping and basic language constructs and most of the code can be optimized.
Using the code

We will be implementing the following additional functionalities with a data bound gridview.

    Getting the sum of any column in footer of gridview.
    Possibility to check few or all records in gridview for bulk operations.
    Inserting new record in database and bound in gridview.
    Validations using Regular Expression Validators.

Lets start by looking at the Database schema which we will be using in our demo implementation. We have a simple Database with a single table named tmp_table. It consists of 4 columns

In the table shown above:

    ID which is an identity field
    uname which is nvarchar(50) datatype
    totalMarks which is of float datatype and the last one is
    selectedItem with bit datatype.

First we will create a function named BindGridView() in which the details fetched in the Datatable will be bound to the Gridview.
Collapse | Copy Code

protected void BindGridView()
{
    DataTable dt = null;
    using (conn = new SqlConnection(ConfigurationManager.ConnectionStrings["tempdbConn"].ConnectionString))
    {
        using (SqlCommand cmd = conn.CreateCommand())
        {
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select row_number() OVER (ORDER BY id) " +
                "AS sno,id,uname,totalMarks,selectedItem from tmp_table";
            using (SqlDataAdapter da = new SqlDataAdapter(cmd))
            {
                dt = new DataTable();
                da.Fill(dt);
            }
        }
    }
    GridView1.DataSource = dt;
    GridView1.DataBind();
}

Now in RowDataBound event of Gridview, we will calculate the grand total of marks column and display them in the Footer of the respective column.

Follwing code snippet shows the variable named lgTots of type double which keeping the cumulative sum as the rows are getting data bound, then assigned the total to label placed in a Footer.

Collapse | Copy Code

if (e.Row.RowType == DataControlRowType.DataRow)
{
    lgTots += Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "totalMarks"));
}
if (e.Row.RowType == DataControlRowType.Footer)
{
    Label lgTotal = (Label)e.Row.FindControl("lblGrandTotal");
    lgTotal.Text = lgTots.ToString();
}

Now to look into the other functionality i.e. to Select few or All CheckBox. We will do that by having a Checkbox for Select All in Header and selecting/unselecting it will result in selecting/unselecting all the records respectively.
Collapse | Copy Code

CheckBox chkA = GridView1.HeaderRow.FindControl("chekSelectALL") as CheckBox;
foreach (GridViewRow gv in GridView1.Rows)
{
    CheckBox chkS = gv.FindControl("chekSelect") as CheckBox;
    if (chkA.Checked)
    {
        chkS.Checked = true;
    }
    else
    {
        chkS.Checked = false;
    }
}    

Now the additional functionalities which we originally planned to implement are done. For the sake of completeness, we will also implement the usual functionalities and events like PageIndexChanging, RowEditing, RowCancelingEdit, RowDeleting, RowUpdating for the Gridview.

Now when we run the application, we can see that all the usual functionalities of this Gridview are working along with the added functionalities that we have implemented.

In the next version we will see how to insert a new record into database, for this implementation lets have a TemplateField Texbox for inserting Name and Marks simultaneously in Footer. OnClick event of LinkButton lnkInsert, we will write the following code:
Collapse | Copy Code

protected void lnkInsert_Click(object sender, EventArgs e)
    {
        string nme = string.Empty;
        TextBox tb = GridView1.FooterRow.FindControl("txtName") as TextBox;

        if (tb != null)
        {
            nme = tb.Text.Trim();
        }

        string mrks = string.Empty;
        tb = null;
        tb = GridView1.FooterRow.FindControl("txtTotalMarks") as TextBox;

        if (tb != null)
        {
            mrks = tb.Text.Trim();
        }

        bool chkSele = false;
        CheckBox chk = GridView1.FooterRow.FindControl("chekSelect") as CheckBox;

        if (chk != null)
        {
            if (chk.Checked == true)
            {
                chkSele = true;
            }
            else
            {
                chkSele = false;
            }
        }
        using (conn = new SqlConnection(ConfigurationManager.ConnectionStrings["tempdbConn"].ConnectionString))
        {
            using (SqlCommand cmd = conn.CreateCommand())
            {
                cmd.CommandType = CommandType.Text;
                cmd.CommandText = "Insert into tmp_table(uname,totalMarks,selectedItem) values(@nme,@mrks,@selectItem)";
                cmd.Parameters.AddWithValue("@nme", nme);
                cmd.Parameters.AddWithValue("@mrks", mrks);
                cmd.Parameters.AddWithValue("@selectItem", chkSele);
                conn.Open();
                cmd.ExecuteNonQuery();
            }
        }  
        BindGridView();
    }

Implemented the validations
Points of Interest

In this article we tried to implement some commonly needed functionalities with a Gridview control in addition to the default functionalities provided by ASP.NET. The code can be improved in many ways but since it is written for the beginner programmers, I tried to keep the logic simple. I will implement more such functionalities and update this article.

Friday 28 December 2012

Google DataTable .Net Wrapper


This library enables the end users to create a lightweight representation of the google.visualization.DataTable object directly in Microsoft.NET and obtain the necessary JSON as needed by the Google Chart Tools Javascript library.

The approach used in this project was to create a lightweight object model that is fast and that consumes few resources.

It is perfect for server side applications hosted on ASP.NET or ASP.NET MVC or any other Microsoft.NET framework.

It is based and compiled on v .NET 3.5 in order to give pretty much a good compatibility with older kind of projects still running on this frameworks.

For further information, please check the post Using the Google DataTable .Net Wrapper or Improving the Google DataTable .Net Wrapper

NuGet Package

Please follow this link: https://nuget.org/packages/Google.DataTable.Net.Wrapper

Thursday 27 December 2012

Communication between Java Client and Java Web Services on J2EE Platform

In a Web service scenario, a client makes a request to a particular Web service, such as asking for the weather at a certain location, and the service, after processing the request, sends a response to the client to fulfill the request. When both the client and the Web service are implemented in a Java environment, the client makes the call to the service by invoking a Java method, along with setting up and passing the required parameters, and receives as the response the result of the method invocation.
Once the client knows how to access the service, the client makes a request to the service by invoking a Java method, which is passed with its parameters to the client-side JAX-RPC runtime. With the method call, the client is actually invoking an operation on the service. These operations represent the different services of interest to clients. The JAX-RPC runtime maps the Java types to standard XML types and forms a SOAP message that encapsulates the method call and parameters. The runtime then passes the SOAP message through the SOAP handlers, if there are any, and then to the server-side service port.

Java API

Java API for XML-based RPC (JAX-RPC) supports XML-based RPC for Java and J2EE platforms. It enables a traditional client-server remote procedure call (RPC) mechanism using an XML-based protocol. JAX-RPC enables Java technology developers to develop SOAP-based interoperable and portable Web services. Developers use the JAX-RPC programming model to develop SOAP-based Web service endpoints, along with their corresponding WSDL descriptions, and clients. A JAX-RPC-based Web service implementation can interact with clients that are not based on Java. Similarly, a JAX-RPC-based client can interact with a non-Java-based Web service implementation.

Wednesday 26 December 2012

ASP.NET Future Revealed


Microsoft has updated the roadmap showing the future for ASP.NET. The plans include better templates and work on OData functionality in the Web API.

The way forward for ASP.NET has been updated and the details given in a roadmap on the ASP.NET pages on CodePlex. There is a caveat, so don’t take this as proof that ASP.NET has a glowing future.

The roadmap gives details of what might be happening to ASP .NET MVC, API and Pages - no news of classic Web Forms.

One of the two main areas highlighted in the new roadmap is the Web API. This is going to be extended to provide better support for OData. A new OData URI parser will add OData query support, and the query semantics will be programmable from apps. You’ll also be able to implement OData endpoints over any data source using the new OData formatter, metadata controller, and modeling capabilities.

The runtime components for MVC will stay at the current level of functionality, and work will instead take place on the templates to create more options for building various types of web applications. Support for SignalR is being added with new templates. SignalR lets you add real-time features to web applications using WebSockets and similar transports. There will be item templates for adding SignalR connections and hubs to an ASP.NET application as well as a full project template that integrates with ASP.NET MVC and ASP.NET.

The plans include a new MVC-based template that uses Knockout.js and Web API controllers to show the best way to write a Single Page Application (SPA). The support will also include tooling updates for Visual Studio that make client side development easier with support for LESS, CoffeeScript, syntax highlighting for Knockout.js, HandleBars, Mustache, Paste and JSON as Classes.

The new SPA template is replacing the one included in the beta of Visual Studio 2012. The previous template was based on Upshot.js and a special Web API-based DataController that provided support for insert, update, and delete operations. Work has been ended on that template and Upshot.js for this version.

Other template improvements include a new project template for making Facebook applications using ASP.NET. This will handle Facebook authentication, app permissions, keep user data up to date and provide easy access to the C# Facebook SDK. The MVC Mobile templates are being improved to get over the problems with the template caching too aggressively or too weakly.

So is this good or bad?

At this stage, Microsoft clearly needs to provide more guidance in the post .NET era. Instead it seems to be inventing lots of new approaches to creating websites and branding them ASP.NET, which gives the impression that ASP (Active Server Pages is still alive and well. This isn't doing anyone any favors - even if the technologies are intrinsically good and interesting.

Tuesday 25 December 2012

Java for ARM developer preview posted online


Oracle have released a developer preview of Java for ARM to gather feedback ahead of the release of Java SE 8 next year.

Announced at JavaOne earlier this year, Java for ARM is being touted as a good platform for running rich JavaFX applications, though it is of course capable of running plain old Java too.

ARM CPUs have been in use for decades, powering lightweight devices like the Apple Newton and Nintendo Gameboy Advance thanks to their relatively low power consumption. However, recent growth in the smartphone and tablet markets, as well as recent increases in power has led to a surge of interest in ARM chips.

Even Microsoft has adopted ARM - the first version of the Surface tablet is ARM-powered, running a subset of Windows 8 called Windows RT. Supporting for its chips is likely to become even more important to developers as ARM expands into servers.

However, for many hackers the most exciting consequence of Java for ARM is that it can be run on the lightweight Raspberry Pi computer, which retails for just $35. JavaFX evangelist Stephen Chin showed off an early build of ARM-compatible Java on his European nighthacking tour, running the same JavaFX app on both his MacBook and Raspberry Pi.

Monday 24 December 2012

New Java flaw could hit 1 billion users

It's just a proof of concept for now, but a newly revealed Java vulnerability could have very widespread repercussions.

Security research company Security Explorations has issued a description of a new critical security flaw in Java SE 5 build 1.5.0_22-b03, Java SE 6 build 1.6.0_35-b10, and the latest Java SE 7 build 1.7.0_07-b10. This error is caused by a discrepancy with how the Java virtual machine handles defined data types (a type-safety error) and in doing so violates a fundamental security constraint in the Java runtime, allowing a complete bypass of the Java sandbox.

Security Explorations conducted tests on a fully patched Windows 7 machine, and was able to exploit the bug using the Java plugin in the latest versions of most popular browsers (Internet Explorer, Firefox, Chrome, Safari, and Opera). While the error was only tested on Windows 7 32-bit, being in Java means it is not limited to the Windows platform and will affect anyone with Java installed on their systems, be it Windows, Linux, Mac, or Solaris.

Adam Gowdiak, CEO of Security Explorations, said in a blog post that Oracle has been alerted to the matter and that the company needs to pay attention:

    We hope that a news about one billion users of Oracle Java SE software [3] being vulnerable to yet another security flaw is not gonna spoil the taste of Larry Ellison's [4] morning...Java.

In an interview with ComputerWorld, Gowdiak explained that this is a new flaw in Java that has persisted even after Oracle's most recent patch, and when exploited would allow an attacker to use a malicious Java applet to install programs, or read and change data on the system with the privileges of the current user.

Gowdiak also stresses that this is a zero-day flaw; however, zero-day means the flaw is used in active exploits on the same day of its findings (giving developers "zero days" to issue a patch), but there is no mention of an active exploit for this bug, and Gowdiak's descriptions of it both on the Security Explorations' blog and in ComputerWorld's interview suggest it is more of a proof-of-concept at its current state.

So far Oracle has been provided with a technical overview of the bug and example code outlining the flaw, but has not yet acted upon it. It unfortunately is not yet known when Oracle might do so. While for the most recent zero-day vulnerability Oracle broke its quarterly update schedule to address the problem, this action was the first such steps taken and it is possible the company may fall back to its quarterly schedule and issue an update in just less than a month on October 16.

While this bug is more widespread than other recently found Java exploits, so far there is no concrete evidence of it being used in any malware exploits; however, it does stress the importance of reducing the number of active runtimes (code execution environments) on your system. If you do not need Java, then you might be best off uninstalling or disabling it. If you are unsure whether or not you need Java, then you might also remove it and then only reinstall it if any of your activities prompt you for a Java runtime requirement.

Saturday 22 December 2012

New Tutorial Series and Sample Application for ASP.NET MVC 4 with Windows Azure Tables, Blobs, and Queues

A new tutorial series and accompanying sample application that shows how to work with Windows Azure Storage tables, queues, and blobs in a multi-tier application that uses ASP.NET MVC 4 and ASP.NET Web API.

The sample application is an email service that runs in a Windows Azure Cloud Service. The front-end is a web role that manages mailing lists, subscribers, and messages. The back-end is a pair of worker roles that handle scheduling and sending emails.

There are five tutorials: one provides an overview of the application, one shows how to download and run the completed application, and three show how to build the application from scratch in Visual Studio.

Here are links to the tutorials, with a sampling of what you can find in them:

    .NET Multi-Tier Application Using Storage Tables, Queues, and Blobs - 1 of 5
        Front-end overview including screen shots of web pages.
        Back-end overview including diagrams of application architecture.    
        Schemas and sample contents for Windows Azure tables used by the application.
        Explanations of how the application uses queues and blobs.
        A data diagram for the tables and queues.
        A discussion of relative merits of running the front-end as a web role in a Cloud Service vs. in a Windows Azure Web Site.
        A discussion of operating costs and options for minimizing costs.
    Configuring and Deploying the Windows Azure Email Service application - 2 of 5
        How to download, configure, and run the application.
        How to publish the application to the staging environment in your own Windows Azure account, and how to promote to production.
        How to limit access to the application in Windows Azure by specifying IP restrictions.
        How to use Azure Storage Explorer and Visual Studio to view data in Windows Azure development storage and Windows Azure Storage accounts.
        How to use either the automated or manual method to add Windows Azure Storage account credentials to the Visual Studio project.
        How to configure the application for tracing and how to view tracing data in Windows Azure Storage.
        How to scale the application by adding web or worker role instances.
        How to decrease project startup time by disabling development storage when you are using a Windows Azure Storage account.
    Building the web role for the Windows Azure Email Service application - 3 of 5
        How to create a solution that contains a Cloud Service project with a web role and a worker role.
        How to work with Windows Azure tables, blobs, and queues in MVC 4 controllers and views.
            How to handle basic CRUD operations.
            How to upload files and store them in blobs.
            How to handle changes to table data that involve changing the row key or the partition key of an entity.
            How to handle concurrency conflicts.
            How to set the retry policy to avoid subjecting the user to long wait times.
        How to use the new Storage Client Library (SCL) 2.0 API (project templates still give you the 1.7 API by default).
        How to reference an SCL 1.7 assembly in order to get diagnostic functionality that hasn’t been added to SCL 2.0 yet.
        How to handle web role instance shutdown gracefully by overriding the OnStop method.
        How to create tables, queues, and blobs in code so that you don’t have to create them manually.
        How to limit Windows Azure Storage transaction costs, increase efficiency, and implement atomic transactions by performing table operations in batches of up to 100 operations.
        How to run the web front-end in a Windows Azure Web Site instead of a Cloud Service
    Building worker role A (email scheduler) for the Windows Azure Email Service application - 4 of 5
        How to create, query, and update Windows Azure Storage tables in a worker role.
        How to add work items to a queue for processing by another worker role.
        How to set the appropriate connection limit and configure diagnostics in the OnStart method.
        How to handle worker role instance shutdown gracefully by overriding the OnStop method.
        How to make sure that no emails are missed and no duplicate emails are sent if the worker role instance shuts down unexpectedly.
        How to test a worker role that uses Windows Azure Storage tables and queues.
    Building worker role B (email sender) for the Windows Azure Email Service application - 5 of 5
        How to add a worker role to a Cloud Service project.
        How to poll a queue and process work items from the queue.
            How to make sure that only one worker role instance gets any given queue work item for processing.
            How increase efficiency and decrease transaction costs by getting up to 32 work items at a time.
            How to handle “poison messages” that cause exceptions when the worker role tries to process them.
        How to download text from blobs.
        How to send emails by using SendGrid.
        How to make sure that no emails are missed and no duplicate emails are sent if the worker role instance shuts down unexpectedly.

Feedback is welcome; you can post comments here or on the tutorials themselves.  One thing we know still needs work is the formatting of code blocks: the tutorials were written in Markdown, and we haven’t found a way to copy and paste code from Visual Studio into Markdown that preserves line spacing and indentation when the Markdown is rendered into HTML. 

Friday 21 December 2012

The 4 Most Important Skills for a Software Developer

With the vast array of technology, language and platform choices available today, it can be very difficult to figure out where to best invest time in training your skills as a software developer.

I’m often asked advice on how to be a better programmer.

Most often the question someone asks is based on whether or not they should invest their time in a particular programming language or technology versus another.

I’ve been giving this quite a bit of thought lately and I’ve come up with what I think are the most important and timeless skills that a software developer can attain which will give them the best career opportunities and make them the most effective.

Skill 1: Solving Problems

problems

I’ve talked about the need to learn how to solve problems before and I’ve even given some steps of how to learn to solve problems, because I believe this skill is critical to any software developer.

Software development is 100% about solving problems.

Without problems there wouldn’t be a need for software.

All software is designed to solve some user problem and within that general solution is a wide array of smaller problems that make it up.

It really doesn’t matter what programming language or technology you use, if you can’t solve problems, you won’t be very good at developing software.

It is amazing how bad most developers are at solving problems.

I constantly hear complaints about job interviews that are too hard because they ask the developer to solve some difficult problem.

I’ve talked about why hard interviews are good and part of the reason is because they test a developer’s ability to solve problems.

I know that many developers still disagree with me about this point and don’t see why a site like TopCoder would improve their development skills so much, but I know from personal experience that it was the practice of solving problems on TopCoder that was the turning point in my career.

Think about a carpenter.  If you want be a successful carpenter, you should probably be good at cutting wood.  You should probably have practiced doing all kinds of cuts and using many different tools to cut wood.

It doesn’t matter how many years experience in carpentry you have had or how well you can design furniture or cabinetry if every time you try to cut wood you struggle with making the cuts.

Cutting wood is a base skill of carpentry, just like problem solving is the base skill of software development.

Skill 2: Teaching Yourself

learining

There is probably no more important skill in life than learning to learn.

This skill is especially important in software development, because no field I know of changes more rapidly than software development.

You can’t know everything about everything.  You can’t even really invest the time it takes to be a master of one particular framework or technology—things are moving way too fast!

Instead you need the ability to quickly acquire the knowledge you need for the task at hand.

If you truly want to have a skill that will propel you through your software development career, learn how to teach yourself.

The only way to develop this skill is to put it into use.  Go out and learn a new programming language or technology, even if you think you’ll never use it.  You’ll be surprised how quickly you may be able to pick it up because of the foundation you will already have in what you know.

If you can quickly adapt to the rapidly changing software development market and technologies and platforms associated with it, you will have skills that will always be in demand.

Although I am a bit skeptical of some of Tim Ferris’s claims, he has an excellent book called the 4-Hour Chef which has some great techniques about how to learn things rapidly.  (I was wanting to write a book about this very subject.)


Skill 3: Naming

naming

When people ask me what I do all day, I mostly say “read things other people name and name things.”

Ok, no one really asks me that and I wouldn’t really answer it that way, but I certainly could.

Software development is all about describing the metaphysical.  Most of what we are building can’t be seen.

We have to construct in our minds an entire world with authorization managers taking authorization requests and spitting out authorization response alongside user repositories using user factories to assemble new users.

Every time you are writing code you are naming things.  When you read code that you or someone else has written, you are gaining most of your understanding about that code from the names of things in that code.

Most of the time I can accurately predict a developer’s skill level by looking at how they have named methods, variables and classes in code they have written.

A developer who lacks the ability to give good names to concepts and data in their code is like a mute translator.  It doesn’t matter if you can understand something, if you can’t adequately explain it, the moment it leaves your head it is gone.

The best way to improve this skill is to always put it into practice.  I’ll often rename things in code I am just reading to get an understanding.  As I start to understand what a method is doing, I’ll change the name to match that understanding.  I’ll do this while I am reading the code, not even making any logic changes to it.

The more you focus on giving good names to things, the better at it you will become.

This is also the most visible thing about your code.  It is hard to know if your code is correct or efficient by looking at it, but if I read it and can understand it, I am going to assume you know what you are doing.

Skill 4: Dealing with People

dealing

I list this as last, but in many cases you could say it is the first or most important skill.

Everywhere you go there are people.

Unless you work alone and develop software just for yourself, other people are going to influence your career as a software developer.

I’ve talked about why you might not want to criticize someone else before, but there is much more to dealing with people than not pissing them off.

I always go back to the famous book by Dale Carnegie, “How to Win Friends and Influence People,” because this book is so important in learning how to be a successful human being.

I’ve said it before, but if you want to develop people skills, read this book!

The basic problem is that humans are not logical creatures, we are emotional ones.  Sure, we like to pride ourselves on our ability to reason, but the reality is that most decisions we make are more influenced by emotion than reason.

What this means for you as a software developer is that unless you can effectively deal with other developers, managers, and even customers, you will constantly face trouble despite how good your ideas are or how valuable your skills are.

Being active and involved in the software development community in general can also help you immensely in your career.  It is not just about networking, but getting your name out there and building good Karma.

Doing this successfully hinges directly on your ability to deal with people.  (Want to take a big shortcut in learning how to deal with people?  It’s simple.  Be nice!)
What about practical skills?

Notice I didn’t include anything in my list about a particular technology or even as broad a skill as web development or mobile development?

It is certainly important to have a solid foundation in a couple of technology areas, but what those areas are is not nearly as important as the 4 skills I mention above.

If you can solve problems, learn things quickly, name things well and deal with people, you will have a much greater level of success in the long run than you will in specializing in any particular technology.

Java 8 on ARM: Oracle's new shot against Android?

Oracle has unveiled a developer preview release of standard Java 8 for the ARM processors that power most mobile devices, including capabilities for the JavaFX rich media platform, in what one analyst sees as a shot across the bow of Google's Android mobile platform.

Java SE (Standard Edition) 8 Developer Preview Release for ARM is intended to get ARM developers testing Java SE 8 before its scheduled release in 2013, said Oracle.com blogger Roger Brinkley.

Forrester Research analyst John Rymer suggests the move is meant to hurt Android, a consequence of Google's Android mobile platform surviving a patent-infringement lawsuit by Oracle earlier this year. "JDK [Java Development Kit] 8 and JavaFX on ARM can be seen as an attempt to create a 'Java standard' alternative to Android for ARM devices," he says.

Rymer dismisses JavaFX as worth developer attention, calling it a technology that never made it big. "JavaFX is a nonstarter because it has no adoption," he says. "JavaFX was conceived by Sun as a portable rich Internet app environment to compete with Adobe Flash/Flex, and later with Microsoft Silverlight as well. The idea was to bring function provided by browser plug-ins into the Java core. Nice idea, but it just never gained adoption. I don't see that changing."

If Oracle wants its Java to compete with Android, it could face a tough road ahead. Developers already have been using their Java skills to develop applications supporting the Dalvik virtual machine running on Android devices. And the chances of an open source implementation of Java showing up on Android via the OpenJDK project are slim.

Still, the mobile device market is only going to grow, so Oracle might as well bet on the horse -- Java -- it already has in its stable to run that race.

This story, "Java 8 on ARM: Oracle's new shot against Android?," was originally published at InfoWorld.com. Get the first word on what the important tech news really means with the InfoWorld Tech Watch blog. For the latest developments in business technology news, follow InfoWorld.com on Twitter.

Thursday 20 December 2012

ASP.NET web optimization framework with MVC 3 & ASP.NET 4.0 web form

Facing problem in integrating web optimization framework with MVC 3. So here in this post we will see how we can integrate asp.net web optimization framework with MVC 3 and ASP.NET 4.0 web form application.

Web optimization framework was introduced with MVC 4 and it is included in default MVC 4 template. But we can use it with MVC 3 and ASP.NET 4.0 web form application as well. This is because web optimization framework is built on top of framework 4.0. So here are the steps to use web optimization framework with ASP.NET 4.0 application.

    Create new ASP.NET 4.0 web form or MVC 3 application
    Add web optimization package by issuing following command in Visual studio package manager console

    Now add following code in global.asax.cs

1    using System.Web.Optimization;
2   
3    protected void Application_Start()
4    {
5        Bundle commonBundle = new ScriptBundle("~/bundle/common")
6            .Include("~/scripts/common.js");
7        BundleTable.Bundles.Add(commonBundle);
8    }

Now build and browse ~/bundle/common and we can see minified version of JavaScript. So this is how we can see default bundle in action with ASP.NET 4.0 and MVC 3 application. You can refer my following post on advanced concept in web optimization framework.

Wednesday 19 December 2012

Integrating XML News Feeds into ASP.NET Pages

Much of the talk about XML now days tends to be focused around using it for data exchange between e-business applications. While it"s true that XML is well-suited for this purpose due to its ability to describe data and maintain its structure while being transferred between distributed systems, there are many other ways it can be used to enhance applications.

This sample application demonstrates one of these ways by showing how XML can be integrated into a website to provide users with news information. The application relies on different classes found in the .NET platform that are used to retrieve an XML news document, parse it, and generate headlines that are displayed in the browser using JavaScript and DHTML. All of this functionality is included in a User Control to make adding news headlines to ASP.NET pages a snap.

Teaches     ASP.NET, C#, XML, WebRequest & WebResponse, XmlDocument, User Controls
Requirements     .NET 1.0

Example:     http://www.xmlforasp.net/CodeBank/System_Xml/XmlDocument/MoreOverNews/newsItemsTest.aspx

View Source Code: http://www.xmlforasp.net/codebank/util/srcview.aspx?path=../../codebank/System_Xml/XmlDocument/MoreOverNews/MoreOverNews.src&file=MoreOverNewsFunctions.cs&font=3

Download Code:     http://www.xmlforasp.net/codebank/download/System.Xml.XmlDocument.MoreOverNews.zip

Tuesday 18 December 2012

Find Page Rank of a Web page In Asp.net with C#

Page rank shows rank of your web pages, Page rank algorithm gives you idea about the page quality, more quality link to your page means Good Page rank, Page rank used as a reputation of a web page, high page ranks get very good reputation in the market of Internet.

You can use this code to create you own Page rank checking tool, its very easy to create a page rank checking tool, you can add it in your projects and websites.
Now I am showing you how you can Find Page Rank programmatically , its quite simple I am sharing some code with you, you can just call the function, URL as a Parameter.
I am sharing C Sharp Code with you , you can covert it in your programming language, may be you are used to with Java, or some other language so you can change the code as per your need.
All you have to do is just call the getpagerank(URL) and you will get a Integer value in Return with the value of Page rank.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Net;
using System.IO;
using System.Text;
/// <summary>
/// Summary description for PRClass
/// </summary>
public class PRClass
{
public static int GetPageRank(string url)
{
int rank = -1;
try
{
// Form complete URL
url = String.Format(“http://toolbarqueries.google.com/tbr” +
“?client=navclient-auto&features=Rank&ch={0}&q=info:{1}”,
ComputeHash(url), UrlEncode(url));
// Download page
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
StreamReader stream = new StreamReader(request.GetResponse().GetResponseStream());
string response = stream.ReadToEnd();
// Parse page rank value
string[] arr = response.Split(‘:’);
if (arr.Length == 3)
rank = int.Parse(arr[2]);
}
catch (Exception)
{
// Do nothing but return -1;
}
return rank;
}
/// <summary>
/// URL-encodes the given URL. Handy when HttpUtility is not available
/// </summary>
/// <param name=”url”>URL to encode</param>
/// <returns></returns>
private static string UrlEncode(string url)
{
StringBuilder builder = new StringBuilder();
foreach (char c in url)
{
if ((c >= ‘a’ && c <= ‘z’) || (c >= ‘A’ && c <= ‘Z’) || (c >= ’0′ && c <= ’9′))
builder.Append(c);
else if (c == ‘ ‘)
builder.Append(‘+’);
else if (“()*-_.!”.IndexOf(c) >= 0)
builder.Append(c);
else
builder.AppendFormat(“%{0:X2}”, (byte)c);
}
return builder.ToString();
}
/// <summary>
/// Computes a hash value required by Google
/// </summary>
private static string ComputeHash(string url)
{
UInt32 a, b;
UInt32 c = 0xE6359A60;
int k = 0;
int len;
// Modify URL
url = string.Format(“info:{0}”, url);
a = b = 0x9E3779B9;
len = url.Length;
while (len >= 12)
{
a += (UInt32)(url[k + 0] + (url[k + 1] << 8) + (url[k + 2] << 16) + (url[k + 3] << 24));
b += (UInt32)(url[k + 4] + (url[k + 5] << 8) + (url[k + 6] << 16) + (url[k + 7] << 24));
c += (UInt32)(url[k + 8] + (url[k + 9] << 8) + (url[k + 10] << 16) + (url[k + 11] << 24));
Mix(ref a, ref b, ref c);
k += 12;
len -= 12;
}
c += (UInt32)url.Length;
switch (len)
{
case 11:
c += (UInt32)(url[k + 10] << 24);
goto case 10;
case 10:
c += (UInt32)(url[k + 9] << 16);
goto case 9;
case 9:
c += (UInt32)(url[k + 8] << 8);
goto case 8;
case 8:
b += (UInt32)(url[k + 7] << 24);
goto case 7;
case 7:
b += (UInt32)(url[k + 6] << 16);
goto case 6;
case 6:
b += (UInt32)(url[k + 5] << 8);
goto case 5;
case 5:
b += (UInt32)(url[k + 4]);
goto case 4;
case 4:
a += (UInt32)(url[k + 3] << 24);
goto case 3;
case 3:
a += (UInt32)(url[k + 2] << 16);
goto case 2;
case 2:
a += (UInt32)(url[k + 1] << 8);
goto case 1;
case 1:
a += (UInt32)(url[k + 0]);
break;
default:
break;
}
Mix(ref a, ref b, ref c);
return string.Format(“6{0}”, c);
}
/// <summary>
/// ComputeHash() helper method
/// </summary>
private static void Mix(ref UInt32 a, ref UInt32 b, ref UInt32 c)
{
a -= b; a -= c; a ^= c >> 13;
b -= c; b -= a; b ^= a << 8;
c -= a; c -= b; c ^= b >> 13;
a -= b; a -= c; a ^= c >> 12;
b -= c; b -= a; b ^= a << 16;
c -= a; c -= b; c ^= b >> 5;
a -= b; a -= c; a ^= c >> 3;
b -= c; b -= a; b ^= a << 10;
c -= a; c -= b; c ^= b >> 15;
}
}
 

Monday 17 December 2012

SEO Friendly URL in Asp.net

When you develop a asp.net website, and if you are managing lot or users or many operation related to database then you will notice you have to pass query string to do your work, you can also do that work in other ways but genrally everyone likes to use query string in asp.net.
 
Example URL

www.example.com/viewcart.aspx?pro_Id=2034
After Rewriting URL 

www.example.com/cart/product/2034
You can see First example is very unprofessional and second is better, but many people use first type of url in their application which makes their website unprofessional and their websites are not SEO Friendly, if you rewrite the url in a SEO friendly way then you will get good Results with your website.

How to Rewrite URL in Asp.net

First you need to Download Intelligencia.UrlRewriter created by Urlrewriter.net Then add this DLL file in your Bin Folder of your application.After that you have to make some changes in your application’s web.config file.

Your Web.config Structure

<configuration>
<configSections>
<section name=rewriter requirePermission=false type=Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter/>
configSections>
<appSettings/>
<connectionStrings>
<add name=connStr connectionString=Data Source=INV-DEV-SQL2K5;Initial Catalog=WidenerPortal;Persist Security Info=True;User ID=widener;Password=widener123a providerName=System.Data.SqlClient/>
connectionStrings>
<system.web>
<httpModules>
<add name=UrlRewriter type=Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter/>
httpModules>
Read more at http://www.geekstrack.com/2012/06/seo-friendly-url-in-asp-net.html#S3swiImr6FcHMVob.99

Software Companies Adapt ASP.Net for Custom Web Application Development


Web Services Are Platform Independent

ASP.Net web development projects are employed in the turning project concepts or business ideas to reality. Web application development these days are incorporated by many software development companies to meet the project development of media, content owners, enterprise, and Telecom service providers. There are many a Net development company India, which does find a place for ASP.NET web development department. The Internet application development project usually develops a concept or idea and provides the IT solutions to the clients. All web development software companies with professional qualities alone can find success over the Internet development markets. The software company must be in a position to adapt latest technologies and meet the industry standards and build fast, secure, high performance scalable online applications. What kind of the Internet applications last for long? Online applications must be user-friendly, easily to navigate, suiting to the clients requirements. Internet services can be developed on any platform and hence it is not platform dependent, people can make use of ASP.Net, VB.Net, C# and MS SQL Server to develop advanced Internet applications and any kind of complex business logic can be solved by sorting data and transactions accordingly.

Methodology Employed in Making of Successful .Net Application 
 
For dotnet application development projects you will require a rigorous check on the execution of the project, hence it will need a systematic procedure and every development project manager will have a standard procedure, and the proven methodologies could be like this, analysing, defining, designing, developing, testing, deployment and support maintenance. 
 
Practical Applications of ASP.net Business IT Solutions 
 
ASP.net is employed distinctive in three ways online, website development, web application, and web service. Web application development can be used in many commercial applications, for instance, Payment Integration is the best sought for Internet application to make online payments. Ticket booking is another section where online ticket booking services are designed by employing the Internet applications, you can also build the Internet transaction services, and certain application such as iPhone applications, mobile applications, finance applications, online designing tools and SEO services can be created by employing web application as well. Emailing servers are the fine examples of the Internet applications where data is stored in the dedicated email server. However, there are innumerable services that can be hosted online to benefit the customers online.

Saturday 15 December 2012

ASP.NET and Web Tools 2012.2 Release


This week the ASP.NET and Visual Web Developer teams delivered the Release Candidate of the ASP.NET and Web Tools 2012.2 update (formerly ASP.NET Fall 2012 Update BUILD Prerelease). This update extends the existing ASP.NET runtime and adds new web tooling to Visual Studio 2012. Whether you use Web Forms, MVC, Web API, or any other ASP.NET technology, there is something cool in this update for you.


ASP.NET and Web Tools 2012.2 is a tooling refresh of Visual Studio 2012 that extends the existing ASP.NET runtime with new features without breaking existing applications. ASP.NET and Web Tools 2012.2 installs in minutes without altering the current ASP.NET run time components. Click the green button to download and install right now. For a complete description see the Release Notes or watch the video. This .2 update adds a number of new templates and features including:

    Enhancements to Web Publishing
    New Web API functionality
    New templates for Facebook Application and Single Page Application
    Real-time communication via ASP.NET SignalR
    Extensionless Web Forms via ASP.NET Friendly URLs
    Support for the new Windows Azure Authentication


    Includes everything to update Visual Studio 2012
    Requires Visual Studio 2012 or Visual Studio Express 2012 for Web.


Friday 14 December 2012

WordPress Releases Version 3.5


WordPress has been updated to version 3.5. The new version packs new features for users and developers alike, and has been given a complete facelift; the UI now has a minimalistic, easy to use look.


The newest version of the self-hosted blogging and CMS platform is nicknamed ‘Elvin’ in honour of the jazz drummer Elvin Jones, and has been tweaked to make it more user-friendly. The new version brings a 'completely re-imagined’ flow for the media manager to upload and arrange photos and galleries.

A new theme called Twenty Twelve has been released with WordPress 3.5. A whole new Dashboard greets users, the interface of which has been streamlined with a focus on making the most used and important features available.


Tumblr imports have been restarted with this update on WordPress, and the site will now support Instagram images, and Soundcloud and SlideShare embeds too. Goodies have been stuffed inside this new update for developers as well.


The most important change made to WordPress, is support for Retina displays. The UI is Retina-ready with impressive high resolution graphics and a new colour picker. Since Retina displays are the way to go, this move will help the WordPress site immensely.

Thursday 6 December 2012

ASP.NET Web Development

Mag Web Technologies has pioneered in web application development, years of experience and quality framework has rewarded us many customers globally.
We use latest technologies and industry standards to build fast, reliable, secured, high performance and scalable web applications. Our ultimate goal is always to develop the web applications user friendly, friendly navigation and best suited with client's business requirement, which will bring the business to our loyal customers to overcome the industry competition in their respective business verticals.
We are experienced professionals in ASP.NET, VB.NET, C# and MS SQL Server to develop advanced web applications with complex business logic dealing with large amounts of data and transactions. We are able to supply you with most desirable, innovative, trustworthy web application solutions on-time.

 ASP.NET Web Development

Our Methodology
We analyze a project and define its goals, and plan a detail roadmap along with the milestones to achieve those goals. For web application development projects we follow rigorous and proven methodologies of analyzing, defining, designing, developing, testing, deployment and maintenance.

Welcome To Mag Web Technologies Pvt.Ltd.

-->

Mag Web Technologies is a Software Development Company offers on & offshore Software Development Services. Mag Web Enterprise IT services deliver excellence to new age IT businesses. Explore new possibilities of enterprise automation.
http://www.magwebonline.com/