Sunday, May 19, 2013

Which one is my future: ASP Web form, MVC, HTML5, or WebAPI for Web Architect/Developer?


Why client-side techniques such as JQuery, Knockout, HTML5, etc.are becoming so popular? They all are  having one thing in common: usage of WebAPI.
Nowadays not only the simple websites, but also big enterprise level applications are using WebAPI to designs their high traffic websites. I was a part of a design and development team of a Airport site, it was designed and developed in SharePoint 2010. It was having 50% custom code and most of them were having webparts. each webpart was getting the data from Database(I will not disclose the name of DB). Data retrial and transactions all were done using the webAPI.
I have gone through a very good article by a co-founder of DNN Shaun Walker, he has explained the future of web development in microsoft technologies, like Asp.net. Please go through this blog and see what exactly changes he is planning for the DNN using this wave of change in Microsoft technology.

Microsoft Declares the Future of ASP.NET is Web API


Enjoy your green coding and try to use more code4green.com to generate more plants on this earth.
Try to use handmade bags to bring your home goods in daily life, it will really make a big change in environment.


Sunday, July 22, 2012

Important Law's of Computer or IT Industry


Parkinson’s Laws: 

1st law:
"Work expands to fill the time available"
or
"Data expands to fill the space available for storage."
 2nd law:
Expenditures rise to meet income

Wirth's law:

 "Software gets slower faster than hardware gets faster".

Moore's law

(Intel's co-founder Gordon Moore) the number of transistors on integrated circuits doubles approximately every two years. The period often quoted as "18 months" According to "2010 update to the International Technology" Roadmap for Semiconductors has growth slowing at the end of 2013, and after 2013 "time transistor counts and densities" are to double only every 3 years not 18 months


Last but not least, a very important rule for project management: You can't control what you can't measure.

Tuesday, June 26, 2012

How to Use VSS in Visual Studio 2010?

I have been asked this question many times, so I thought I can write down a blog on this topic.
Question: How can I use VSS(not TFS) in Visual studio 2010?
Solution: Please follow these steps to use VSS in Visual Studio 2010:
Step-1. Go to Tool and Option





Step-2.In Option select Source Control(see 2.1 in image). Then Select VSS from dropdown Source Control PlugIn. Click OK.




Step-3. In VS2010, open a solution. Right click on solution(3.1) and then select "Add solution to source control".(see 3.2 in image).



























Step-4. Select database for sourcesafe and it will add the solution in VSS


















I hope it will help you. Enjoy green coding at www.code4green.com

Wednesday, May 23, 2012

Enum comparison Sample

Here is the sample for using enum for comparison with numeric value. See the highlighted lines for using a enum comparison in switch case:
you can use this aspx page's code behind file to test in your aspx page, for this you have to make the following changes Inherits in aspx page:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestPage.aspx.cs" Inherits="Code4Green.FreeCodeGenerationTool.TestPage" %>


SAMPLE

 
using System;
using System.Web.UI.HtmlControls;

namespace Code4Green.FreeCodeGenerationTool
{
    public partial class TestPage : System.Web.UI.Page
    {
        public enum FilterByDoctorType
        {
            General,
            Dental,
            Orthopadic,
            ENT,
            Cancer
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                this.Controls.Add(CreateDoctorContextControls(0,111011));
                this.Controls.Add(CreateDoctorContextControls(1, 111011));
                this.Controls.Add(CreateDoctorContextControls(2, 111011));
                this.Controls.Add(CreateDoctorContextControls(3, 111011));
                this.Controls.Add(CreateDoctorContextControls(4, 111011));
            }
        }

        private HtmlGenericControl CreateDoctorContextControls(int filterByValue, int doctorId)
        {
            HtmlGenericControl htmlStudentListItemControl = new HtmlGenericControl();

            switch (filterByValue)
            {
                case ((int)FilterByDoctorType.General):
                    htmlStudentListItemControl = CreateYourWebControl(doctorId,"General Physician. "); break;
                case ((int)FilterByDoctorType.Dental):
                    htmlStudentListItemControl = CreateYourWebControl(doctorId,"Dental Surgon. "); break;
                case ((int)FilterByDoctorType.ENT):
                    htmlStudentListItemControl = CreateYourWebControl(doctorId,"ENT Specialist. "); break;
                case ((int)FilterByDoctorType.Orthopadic):
                    htmlStudentListItemControl = CreateYourWebControl(doctorId,"Orthopadic surgon. "); break;
                case ((int)FilterByDoctorType.Cancer):
                    htmlStudentListItemControl = CreateYourWebControl(doctorId,"Cancer Specialist. "); break;
                default:
                    htmlStudentListItemControl = CreateYourWebControl(doctorId,"General Physician"); break;
            }

            return htmlStudentListItemControl;
        }

        private HtmlGenericControl CreateYourWebControl(int doctorId,string yourText)
        {
            HtmlGenericControl divControl = new HtmlGenericControl("div");

            HtmlGenericControl hyperlinkControl = new HtmlGenericControl("a");
            hyperlinkControl.Attributes.Add("href", "http://www.code4green.com");
            hyperlinkControl.Attributes.Add("class", "yourCSS.Class");
            hyperlinkControl.Attributes.Add("title", "Plant a free tree by using code4green website");
            hyperlinkControl.InnerText = "goto code4green website";

            HtmlGenericControl spanControl = new HtmlGenericControl("span");
            spanControl.Attributes.Add("class", "MySpanClass");
            spanControl.InnerText =yourText;
           
            divControl.Controls.Add(spanControl);
            divControl.Controls.Add(hyperlinkControl);
           
            return divControl;
        }
   }
}


Wednesday, April 25, 2012

SkyDrive War - MS, Google, and DropBox

Are you ready for SkyDrive war? Google has launched GoogleDrive(same as MS's SkyDrive) too. Now there are three major player in the market(cloud based market). Microsoft, Google, and DropBox. The major difference is data storage. Microsoft is giving 25GB+unlimited MS office docs+unlimited photos, while Google is just giving 5 GB space(for extra space you have to pay  $2.49 per month for 25 GB).
Another big difference is declaimer. Google declaimer is saying that google will have rights on your documents, while Microsoft and Dropbox are not claiming your documents.
If you are already a member of existing SkyDrive users than go to SkyDrive website and claim your free 25 GB.
Here you can see the comparison between cloud based storage drives
Compare SkyDrive
Generate Green Code Using Code4Green.com


Thursday, April 19, 2012

How To Clean Infected site or SQL INJECTION "<script src=http://hgbyju.com/r.php>"

If your site has been hacked and your web pages are opening some website that mean your website has been hacked. There are two kind of possible injections your site may have:
  • File injection: Your web files like html pages/javascript/css may have virus, than check your pages: you will found the this type code added at the end of each page's html: "".
  • SQL Injection: If you have a content management system than your content database is hacked using sql injection. Please see your table/file where you are keeping your page's content(like product info, page info, menu info, header info, footer info). You will found that each row of your table is being and following text has been added at the end of each records:
Resolution:

  • For your web files, you have to check all your files and fix manually one by one.
  • For content database, you can run the following update SQL query to fix:
SET [ItemName] = Replace(cast([ImageName] as nvarchar(100)), '<title&&rt;<script src=http://', '')
Please modify this query and replace your table name, column name for the bold letters in query.

Other ways to fix this issues:

  • Remove query string
  • Do not use in-line sql statement in your server side script (like select * from table where id=' + request.quesrystring(id) or value from query string)
  • Check the length of id in query string, if it is more than 20 chars than it is most likely infected. Quick fix trim id to 20 characters, so it will remove that malicious string and than it will not work.

I hope this will help someone to make their day and to over come of this nightmare.

I have fixed many infected content databases using this SQL in sql server/access db. I hope it will help you too.
FYI: url(
http://hgbyju.com/r.php) in infected script may be changed in your case. so replace http://hgbyju.com/r.php to your url.

Please don't forget 22 April "Earth day", do something to protect our mother earth"
Use code4green for your code generation.

Wednesday, April 4, 2012

Window 8 - Metro Style Apps, A big market to make money

I am seating here in (Fairmont PacificRim center) for windows 8 development training (Windows App development for phone, tablets, laptops) . Here I have got a interesting numbers for Windows OS which is a great opportunity to make money with windows app market.
You can make one app which will run on desktop, laptop, Tablet, smartphone.
Here is the number of devices for windows OS:
Windows OS - 500 Million devices
Android - 232 million devices
iPhone - 152 million devices
Mac OS - 30 million devices
If you think 0.01% pie of this Windows device than you can calculate the amount you can make with $0.99/App. With 01 app of $0.99, you can make 1/2 million dollars. This is not impossible :), so go for it.

So if you make an Windows app using windows 8 OS with Visual studio 2011, it is easy to make such apps and it is also easy to submit on Windows App store using Visual studio.
The only thing you need is one time registration fees with windows app store, which is $49.00 dollar - individual, and $99.00 for Business.