Importance of Tracking Daily Activities – A Personal Perspective

When the cat is away the mice will play.

This famous saying suggests that when a person in authority is not present, the people under his rule will enjoy their freedom. However; this should not be the case. The employee should be relied upon to get work done that was assigned as well as conduct themselves professionally and with dignity. “Farting Around”, should not occur. There is always something to be done in every organization. Push a broom, re-index a database, setup a new help desk system, sort papers, refill the toner in a printer. Even researching a new technology or idea can be beneficial.

We as paid workers with self worth, should be keeping a log when the boss is away of our daily activities. This log should include all interruptions, lunch, breaks, and tasks. Do not spend a lot of time, but spend enough time to make yourself look productive. The activity log could be in the form of a blog or a text file and should be easily printed in a readable format.

There is two main reasons for the log. It keeps you as the employee focused on activities that require your focus and it keeps the bosses informed.

If done on a daily basis it can show the boss weakness and strengths in the team that he/she is responsible for. It can help allocate tasks to those who are best suited for the task. It can also point out where time is being spent, which can be either allocated to someone else or reviewed closer. It is mostly about following trends in the logs in which we can extrapolate productivity value.

For the employee, it should be considered a review of one’s self worth within the organization. Even if the boss never sees it; review it yourself and see what you have done. I would bet you have been doing more than you had thought. Often it can be used to improve your resume, your feeling about the work you can do. I know myself I sometimes think I should have gotten things done faster, but in review of my day, it makes sense why I did not.

I believe every employee should want to do this at least on a part time bases, and every boss should want to have the ability to review the work logs weekly of their employees.

Creating a Collection of Top-Level Class From Base Level Class

When you have a class inherit another class, sometimes you want the base level class to create a collection of the top-level class.  In this blog I will demonstrate some basic inheritance and a little reflection trick.  Note the examples are in C#, but could easily be done in VB.NET

Why you may want to do this?  You may want to create a base class to handle all of your basic database functions from which your data layer classes will inherit to limit duplicate code.  In the base class you may create a “SELECT” function to return multiple rows of data.  The rows of data being returned are represented by the top-level class, for which you need a collection of the base level class.

You need two components or classes.  The first is to create your base class from which you will inherit later on.  In the base class you will create a method to generate a collection of the top-level class.  The example being used is passing in the size of collection to be returned, but you could have it being auto generated based on number of database rows.



public class BaseClass
{
public String FirstName { get; set; }

public BaseClass()
{
}

public ArrayList getCollection(String className, int limit)
{
ArrayList collection = new ArrayList();

Type t = Type.GetType(className); 
for ( int icount=0; icount < limit; icount++ )
{
object clss = Activator.CreateInstance(t);
((BaseClass)clss).FirstName = "Bob"; 
collection.Add(clss);
}

return collection;
}
}

The next part is to create a class that inherits the base class.  From this new class we are going to make a public function that will return the requested collection.  Remember; you could be returning class collection of data rows or another single purpose that could be represented by a class.


public class ClassInherit : BaseClass
{
public ClassInherit()
{
}

public ArrayList BuildCollection()
{
return getCollection("ClassInherit", 4);
}
}

If you have questions regarding this blog or the purpose of this blog, please feel free to contact me at www.unlatched.com or www.andrewpallant.com.

Posting Data From HTML to ASPX

Recently I had a need to have a web site post credentials to another web site.   The first site was standard HTML and the second site was DotNet (ASP.NET).

In this example, we will be passing a user name and password to another site.

Sending Web Site
In your sending website, you will need a log in  panel similar to the one below.

    






Receiving Web Site
In the form load of your DotNet (ASP.NET) site, you will need the following code to get the values from the request object and then pass to your log in routine.

                NameValueCollection nvc = Request.Form;
string userName = "";
string password = "";
if (!string.IsNullOrEmpty(nvc["txtUserName"]))
{
userName = nvc["txtUserName"];
}

if (!string.IsNullOrEmpty(nvc["txtPassword"]))
{
password = nvc["txtPassword"];
}

ExecuteLogin(userName, password);

DotNet Windows Form Image Transparency

Recently during a project I had a need to overlay an image on a windows form in order to indicate a status of inability.  This image had a semi-transparency quality as well as a full transparency background.  To my dismay, the semi-transparency rendered in full color and the full transparency background seemed to inherit the parent form, but not show the controls behind it as one would expect.

After sometime of researching the issue, I came to a determination that what I was trying to do could only be done in web development (HTML).  From my research I had assembled some ideas in how to make transparencies work.   I took ideas from several sources and came up with the following.

Step By Step ( see Sample Code )

1. Create a class that extends System.Windows.Forms.Control
2. Place code from sample cod
3. Compile Project
4. Add new control to the Form ( remember this is for a windows application )
5. Set Background Image

Sample Code


protected override CreateParams CreateParams
{
     // Make window transparent
     get
     {
          CreateParams cp = base.CreateParams;
          cp.ExStyle |= 0x20;  // WS_EX_TRANSPARENT return cp;
     }
}

protected override void OnPaintBackground(PaintEventArgs pevent)
{
// Do not paint the background
}

protected override void OnPaint(PaintEventArgs e)
{ 
     // Paint background image 
     if (BackgroundImage != null)
     {
          Bitmap bmp = new Bitmap(BackgroundImage);
          bmp.MakeTransparent(Color.White);
          e.Graphics.DrawImage(bmp, 0, 0, Width, Height);
     }
}

Note:  When you overlay an image – even transparent, you may see the controls behind, but you will not be able to access them.  This is true in both web and windows development.

8 Search Engine Friendly Web Design Tips

  1. Make meta tags relevant to the web page – not specifically to the site
  2. Add ALT attributes to images and make sure it describes the image
  3. Add Title attributes to links and make sure it describes the link and its function
  4. Have content that changes periodically – blog or news feeds can add dynamic and relevant content
  5. Flash-based content and sites with a lot of images are difficult
  6. Use the Google / Yahoo site manager tools
    ( http://google.com/webmasters/tools ) or ( http://siteexplorer.search.yahoo.com )
  7. Use a good stat services like StatCounter.com or Google Analytics
  8. Keep to W3C standards ( http://validator.w3.org )

    Note: A good web developer will not charge extra for most of these points.  A site is worthless unless setup properly for search engines.

Internet Explorer Crashes On ActiveX Plug-ins

I was recently trying to download some development tools from MSDN where a Microsoft File Download Plug-in is used.  Every time I clicked the download link, the file download manager tried to launch and then crash the Internet Explorer session.  I had also seen this with some open source remote help desk tools, but figured it was a bad update on the plug-ins.

Well the answer was, Microsoft is trying to manage your memory so to prevent attacks on your computer.  To install the plug-ins, you need to :

  1. Go to the Tools menu
  2. Click on Internet Options
  3. Click on the Advanced tab.
  4. Go to the Security Section
  5. Uncheck the “Enable memory protection to help mitigate online attacks *”
  6. Click Apply
  7. Click OK

Close Internet Explorer and then try your plug-in that previously crashed your Internet Explorer.  If you are not a local administrator, you will have to contact your IT department to do this for you.

Note:
When your plug-in is installed or you have finished your activity, re-enable the “Enable memory protection to help mitigate online attacks *” option as extra protection.  I and Microsoft do not recommend surfing without this option enabled.

Checking Active Process on Sql Server

I have needed to monitor the SQL servers a little more than usual. I am mostly concerned about memory and CPU usage. By properly setting our program names in the SQL connection string, I am able to find the offending applications a little easier. There are times, that I set the application and routine in the connection string when the offending process is not so obvious.

Here is my script that I use to view the offending SQL processes

SQL Query using SysProcess

use master
declare @memlimit as int, @cpulimit as int
set @memlimit = 100 — Memory Filter Limit
set @cpulimit = 200 — CPU Filter Limit
select spid, login_time, last_batch, hostname, program_name, memusage,cpu
from sysprocesses
where ( memusage > @memlimit or cpu > @cpulimit )

Once I have a list of offending processes, I seek and fix the code has the issue. If the process is a closed application like the BlackBerry® Mobile Data Server Connection Service, I check for updates or in rare cases set up a scheduled task to restart the service.

I am back – Whoo Whoo!

Despite the Blogger’s removal of FTP support, I have been able to continue using my blog. I have created my own ATOM feed interpretor. It was pretty easy to do in ASP.NET. Look for my future blog on how to perform the integration. Thanks to all who follow me and thanks for your patience.

~ Andrew

Blogger Removes FTP support

Well, it has happened. Blogger is pulling its FTP support. This means that this is my last post of this kind. I will be updating my blog portion of my site with a different technology unless blogger creates something new.

If this portion is down, it is because blogger removed its service that I used.

Sorry for any issues.

8 Firefox Plugins

Tonight I have assembled a list of 8 Firefox Plug-ins that either make my development life easier or simply add a little flair to my web surfing.  Each plug-in is my own choice and is not a paid endorsement.  These are all free.

IE TAB
Emulates the Internet Explorer rendering engine
Website

InterClue
Preview links before clicking on them
Website

Colorful Tabs
Colors tabs to make each unique
Website

ColorZilla
Advanced eyedropper that allows you to select colors from web pages
Website

Cooliris
3D wall for searching and viewing archives
Website

Download Helper
Allows you to download your favorite media including YouTube videos
Website

FireBug
Web Development Tool
Website

FireShot
Screen shot of the current page. Allows user to add annotations easily.
Website