August 2005 Entries

If you are playing guitar and own a PDA that runs Windows Mobile, you searched over the net for a Chord Database application that will show you the chords when you most need it. Well your wishes are granted. I have created my little GotDotNet space and uploaded my mini ChordDb project to there, the link is http://workspaces.gotdotnet.com/ChordDb . Download and use it at your disposal. There are 900 chords initially in XML files and those files are realy easy to edit.

To preserve some database space on my .Text installation, I have deleted some of the trackbacks, links and null records. All my trackbacks are p o k e r links anyway. There were also p o k e r comments but I got rid of them with Clearscreen HIP Captcha.

My other 2 little improvement to .Text is the "Recent Posts" and "Popular Posts" modules. I was jealous about other blogging engines and their modules so I have decided to write this one. I have the version 0.95.102 code of .Text. I basically created a stored procedure first to read last 10 records for the displayed blog and then constructed a repeater with title and the permanent link of the entry. I have also created a small method to construct permanent links, I am sure there is a ready to use function somewhere in .Text to format permanent links.

Here is the stored procedure:

CREATE Proc blog_Last10Items
(
@PostType int, --later to list comments
@BlogID int
)
AS
Select Top 10 A.id, A.Title, A.DateAdded, B.Application
From blog_Content A, blog_Config B
Where posttype = @PostType
AND A.BlogID = @BlogID
AND A.BlogID = B.BlogID
Order By DateAdded ASC

I have created a class giving the name Last10Module in Dottext.Web.UI.Controls and written the code below:

namespace Dottext.Web.UI.Controls

{

    using System;

    using System.Configuration;

    using System.Collections;

    using System.ComponentModel;

    using System.Data;

    using System.Data.SqlClient;

    using System.Drawing;

    using System.Web;

    using System.Web.SessionState;

    using System.Web.UI;

    using System.Web.UI.WebControls;

    using System.Web.UI.HtmlControls;

    using Dottext.Framework.Data;

    using Dottext.Framework.Configuration;

    using Dottext.Framework.Components;

    /// <summary>

    /// Summary description for Last10Module.

    /// </summary>

    public class Last10Module : BaseControl

    {

        protected System.Web.UI.WebControls.Repeater LastEntries;

 

        protected override void OnLoad(EventArgs e)

        {

            base.OnLoad (e);

 

            string sql = "blog_Last10Items";

            string conn = Dottext.Framework.Providers.DbProvider.Instance().ConnectionString;

 

            ArrayList myLastItems = new ArrayList();

 

            int BlogID = CurrentBlog.BlogID; //current blog id is here -- finally found it

 

            //PostType = 1 is the entries

            SqlParameter[] p =

                {

                    SqlHelper.MakeInParam("@PostType",SqlDbType.Int,4,1),

                    SqlHelper.MakeInParam("@BlogID",SqlDbType.Int,4,BlogID)

                };

 

            DataTable dt = SqlHelper.ExecuteDataTable(conn,CommandType.StoredProcedure,sql,p);

 

            int count = dt.Rows.Count;

 

            for(int i = 0; i<count; i++)

            {

                DataRow dr = dt.Rows[i];

 

                string title = (string) dr["Title"];

 

                //This is also in CurrentBlog.Application

                string application = (string) dr["Application"];

                DateTime dateAdded =(DateTime) dr["DateAdded"];

                string id =  dr["id"].ToString();

 

                string myURL = URLFormat(application, dateAdded,id);

 

                myLastItems.Add(new PositionItems(title,myURL));

 

            }

 

            LastEntries.DataSource = myLastItems;

            LastEntries.DataBind();

        }

 

 

        public string URLFormat(string dbApplication, DateTime dbDateAdded, string dbEntryID)

        {

            string myURL = ConfigurationSettings.AppSettings["AggregateURL"];

 

            myURL = myURL + "/" + dbApplication + "/";

 

            string myYear =  dbDateAdded.Year.ToString();

            string myMonth = dbDateAdded.Month.ToString();

            string myDay =  dbDateAdded.Day.ToString();

 

            int Month = int.Parse(myMonth);

            int Day = int.Parse(myDay);

 

            if (Month<10)

            {

                myMonth = String.Concat("0",myMonth);

            }

            if (Day<10)

            {

                myDay = String.Concat("0",myDay);

            }

 

            myURL = myURL +"archive" + "/" + myYear + "/" +

                    myMonth + "/" + myDay + "/" + dbEntryID + ".aspx";

 

            return myURL;

        }

    }

 

    public class PositionItems

    {

 

        private string title;

        private string URL;

 

        public PositionItems(string title, string URL)

        {

            this.title = title;

            this.URL = URL;

        }

 

        public string Title

        {

            get

            {

                return title;

            }

        }

 

        public string url

        {

            get

            {

                return URL;

            }

        }

    }

}

And here is the ascx file:

<%@ Control Language="c#" AutoEventWireup="false" Inherits="Dottext.Web.UI.Controls.Last10Module" %>

<h3>Recent Posts</h3>

    <asp:Repeater id="LastEntries" runat="server">

        <ItemTemplate>

            <div class="item">

                <font size="2">

                    <a href="<%# DataBinder.Eval(Container.DataItem, "url") %>">

                        <%# DataBinder.Eval(Container.DataItem, "Title") %>

                    </a>

                </font>

            </div>

        </ItemTemplate>

    </asp:Repeater>

 

The rest is installing the ascx into skin templates. Once you copy the file into Skin/Controls folder, add the necessary entries to PageTemplate.ascx.

 

"Popular Entries" module was pretty much the same as this one except the stored procedure is different as I need to read it from the Blog_Referrals and Blog_Content tables:

 

CREATE PROCEDURE blog_GetTop10byBlogId
@BlogId int
AS
Select Top 10 Sum(A.count) tCount, A.entryid, B.title, B.dateadded
From Blog_Referrals A, Blog_Content B
Where A.BlogId = @BlogId --param
AND A.entryid = B.[id]
Group By A.entryid, B.Title, B.dateadded
Order By tCount DESC

 

May not be the best piece of code but kept me busy during the weekend given my wife working at night shift at the hotel.

 

Have fun.

Thanks to Mitch again, I have now VS2005 VPC. As soon as we settle (from nomadic to more settled life style) I will get a broadband access.

My TFS installation was also successful but I couldn't create a team project due to problems I explained here, here and here. And this guy thinks that I am lucky.

Surprisingly, I have got the same error message once when I tried to create a team project. I believe, the timeout issue is the one to be blamed. I have compared my installation with Microsoft's VPC and looks like everything is in place. My laptop has 768mb memory and I need to turn of lots of other services to conserve memory and to be able to run VPC instance of TFS. I need to wait to get more memory up to my next hardware upgrade which is due end of next 6 months

Now all I need is a "process template" editor. I have heard that some of the APIs are published. So my quest is continuing.

We have taken first class of COMP8110 (Managing Software Projects in a System Context). This class will equip me with tools and practices to manage a project. In the first class, I have seen a general overview of Project Management phases.

One question raised in the class is "Why more than one critical path would worry the project manager?" I would like to list some of my answers:

  1. There may be variables that you have limited control over them. These variables are creating more than one solution to your problems and each of them is critical path.
  2. You need to assess the risks continually till you reduce the critical paths to one. This is an ongoing process and will be re-visited once you have more constant data for the variables in item 1.
  3. Uncertainty arising from the critical paths which will destruct the trust amongst PM and project members.
  4. These critical paths will disturb the project plan and budget. This is enough to worry the PM.
  5. PM will not know if he/she has the enough resources and skills to resolve the critical paths and issues escalated from them. Because they are unclear.
  6. Even customer may not be aware of the critical paths and solutions. So PM can't get a definite answer about the Critical Paths.

While I was seeking Dr. Boughton's permission to reference to him in this entry he corrected me about my answers to multiple critical paths. He said:

"The main thing that the PM will immediately become aware of is the fact that multiple CPs usually mean one or more of the following:

  1. Inadequate resources
  2. Short schedule with a hard deadline
  3. Serious slippage with the consequence that too much work has to be achieved in the time left."

After this discussion we explored the phases of project management. These are:

  1. Planning
  2. Execution
  3. Closure

 These phases are divided into items below.

1- Planning

  • Initiation
  • Define Charter and Scope
  • Prepare a Work Breakdown Structure
  • Identify who is responsible for what
  • Estimate size, effort, resource and cost
  • Prepare a schedule
  • Resource allocation
  • Quality Plan (Review, Inspection, Testing)
  • Risk Management Plan
  • Change Control and Configuration Management
  • Communications

One of my suggestions was to include the Security under a topic or add it as a separate topic here. You need to establish some sort of security guideline both for the Intellectual Property protection and Security for the product (like encrypted communication channels, user & group rights, secure code writing etc.).

Implementing a security layer in code could increase your task timing and exceed the scheduled time. Therefore Code Security should be included under Work Breakdown Structure and budgeted accordingly. A "security testing" phase could be added into Quality Plan to test the product whether it is complying with certain security requirements.

Securing Intellectual Property is a broader subject that needs to include organisation's procedures to recruit people and the sensitivity of the project (that is if the project is handling sensitive data). In this case you may seek a certain level of security clearance from the project stakeholders. Getting a security clearance for a member of the team can be time consuming and may result in extended delivery times which will -again- disturb PM's project plan.

 2- Execution

  • Monitoring, measuring and reporting the progress
  • Controlling the progress
  • Change control and revision
  • Human Resource management
  • Communication management
  • Software Quality management
  • Resource management

 3- Closure

  • Auditing (physical, functional, trust)
  • Post-Mortem
  • Terminating

 There are also human factors that are affecting the Project Management. These are:

a- Characteristics of Project Manager

b- Ethics (Company, personal, social)

c- Conflicts and negotiation

d- Meetings

One good discussion was about an opportunity of a software project with some certain criteria. So you have been asked if you take over the project with these criteria:

  1. Immutable deadline
  2. Under budgeted
  3. Functionality is not easily reduced
  4. Serious political & reputational consequences if fails
  5. Must deliver an operational product of high integrity
  6. Project can be cancelled at any time by customer.

So did you take over a project like this? What can you do to take it? Here are some answers of mine and the people in the class:

  1. Decline the offer
  2. Manage expectations and be upfront with customer
  3. Find a Commercial Of The Shelf (GY and another guy)
  4. Setup positive relationship with the customer
  5. Send the project to overseas (outsource) (GY)
  6. Get the best team you can find
  7. Find another customer with similar requirements and share the cost (GY)
  8. Identify best platform and tools that will provide best results
  9. Search Open Source libraries for bits and pieces that you can reuse for this project (GY)
  10. Negotiate ownership and keep Intellectual Property (GY)
  11. Assume future investment
  12. Force reduction in functionality
  13. Discuss reduction in quality
  14. Develop a good understanding of requirements
  15. Establish a clear agreement of scope
  16. Confirm customer's expectations with real deadline, quality and budget
  17. Evaluate cost & risks
  18. Do a feasibility study
  19. Identify what are the criteria for cancellation

This project was a real story from Dr. Boughton's past and they (Dr. Boughton's company) took it!! I have asked him "how did he convince himself to take it"; He said they have done the items 2, 4, 6, 14, 15 and recruited some of the key people who worked in this particular area before. They also kept thinking positive about the project.

Suggested readings

There are 2 IEEE standards recommended in the class these are:

IEEE 1058 SPMP

IEEE 1490 PMBOK  

I have also found a 1996 version of PMBOK which was another suggested reading, as a pdf file by searching in Google. It is a 182 pages document explaining the phases which I have mentioned above.

So up to next week, stay in tune...

Search



About me

Hi, my name is Gurkan Yeniceri. I am a software engineer with 8 years of experience in both public and private sectors. I have been generally writing about software engineering and Microsoft technologies since March 2005 on this site.
View Gurkan Yeniceri's profile on LinkedIn

Contact

If you would like to contact with me you can use the contact page here. I will try to respond it in a timely manner (I will try my best). You can also contact with me via Microsoft Live Messenger with the address gyeniceri {AT} hotmail {DOT} com.
If you are one of my Turkish readers, you may want to visit my Turkish blog here.

If you would like to read my site with an RSS reader like RSS Bandit, you may want to use to subscribe.

RSS 2.0

Advertisement


Bookmark this site

del.icio.us digg NewsVine YahooMyWeb Reddit Spurl TailRank BlinkList Furl Shadows blogmarks
    www.flickr.com
    This is a Flickr badge showing public photos from gurkanyeniceri. Make your own badge here.
    There are 133 posts and 88 comments on this site. Other sites also linked it 7 times.

    Advertisement