Friday, December 15, 2006

Mac's Promise to run Windows

Recently Mac books have started using Intel processors, Apple gives out adds saying , "Now Mac runs both Mac Os X and Windows, it is pc you will ever need". I don’t know how they say that. I have seen frustration of users in many blogs, mostly complaining that Windows does not detect their Mac hardware properly. Now , it is apple who promised to run Windows on their hardware, so it should their sole responsibility to support it fully. Isn't it?

In some part I was convinced that macbooks are the best buy as they are able to run both Mac and Windows on a single hardware, in addition to its great design. But today I also came to know from one of my colleges that macbook don’t have any bios therefore you can't do a clean installation of Windows in Mac hardware , it only possible when you use a software called Boot camp. Isn’t it ironic?
I wished I could have buy a Macbook-Pro. Unless, Apple comes up a better hardware level support with Windows , I put a pause to that for the time being. Also, Apple should think of Vista support too.

But, i use Ipod which is much superior to Microsoft's Zune player.:-)

Wednesday, December 6, 2006

Why do we avoid writing unit tests most of the time?

In our early computer science classes we are taught about the formal software development methods. One the most important part of software process is "Testing". Testing comes in various stage of a software product. Some occurs in development phase like unit testing others like regression testing, takes place when a software is under the hands of QA team. One thing that most of the developer don't like is to write unit tests (That also includes me). We all the know the benefit of test based software development but i can assure you most of the time we try to avoid this up. This is not only true for ISV's but also companies like Microsoft. For example, the first release of Microsoft Word(http://www.joelonsoftware.com/articles/fog0000000043.html - check #5 Point). In all the cases when there is a bug in live system , it surely proves that proper testing process has not been executed. This true for all of us. Now why we avoid testing at early stage, well let's look into the following

1. In tight schedule program, often the unit test is almost skipped.This is beacuse , our client are in a real hurry to get a running version. This happens in most of the outsourced projects where budget is a big factor.
2. Programmers are too lazy to write unit tests[ example. me :-)].
3. Time Saving.
4. 100% Confident about a piece of code.

Now as we have so many excuses to avoid writing unit tests, i would like to add one more controversy to it. Let's say a developer has wrote a magnificent piece of complex javascript code that is the heart of software system, after a year or two the developer leaves the company , and right after a major update the code somehow breaks. Now what will happen, think ? If there was unit test for this, don't you think it could have been much easier to point out the exact error?

Au revoir!

Saturday, December 2, 2006

Looking back at your mistakes..

After the end of every iteration in a project life cycle, we always think that we could have write our program more smartly. Humans are meant to made mistakes, but great ones are those who learn from them. Making mistakes is inevitable but we can't avoid them completely.

it is often a real good practice that we all do some analysis after accomplishing each iteration. For ex, all the developers can sit together for a coffee and discuss frankly what is best and the worst things they have done so far and what should be done to avoid those in future .But in reality, i believe that most of us never do this kind of practice.So what needs to be done, if we really want to impose this on a team. Any guess ?

Solution 1 :

Every organized company has a issue tracking system(we at Pageflakes never do a task unless it is properly entered in an issue tracker). Issue tracker is a great source for monitoring progress and accomplishment for an iteration. Issue tracker always says , how a bug has occurred or how to do a new task but it is never meant for the word "Why". Developer does his assigned tasks and marks it with some status and forwards it for further processing , but what if before changing a task , we ensure that a developer must answer, "how did i do the task?". If developers are pretty honest , at the end of each project cycle this can help to create a true project metrics that can become a true life saver someday.

Solution 2 :

These days we all use Microsoft outlook . i believe this is the holy grail in modern age to keep you organized round the clock. In outlook we can create an event send it to others as well to keep us synced( For ex: "Send weekly status") . Now, is it possible to send a reminder that will tell a developer to send the mistakes and best things that he/she has done for particular issue? I believe this is great.


So far, these are only two from many tactics that we can follow to rectify our mistakes. But the question is, at the end of the day do we really care?

Finally i leave you with this quote i found(source : http://www.codinghorror.com/)

Look, Mike," Tomas said. "I can hand off my code today and call it 'feature complete', but I've probably got three weeks of cleanup work to do once I hand it off." Mike asked what Tomas meant by "cleanup." "I haven't gotten the company logo to show up on every page, and I haven't gotten the agent's name and phone number to print on the bottom of every page. It's little stuff like that. All of the important stuff works fine. I'm 99-percent done."


Good day!

Monday, November 20, 2006

Subscribe web feeds using Pageflakes in Firefox 2.0

New version of the popular browser firefox 2.0 made feed subscription easier than before by including a cool web feed reader feature .




This feature lets you subscribe to feeds from a list of reader option that comes with the default installation, but sadly there is no entry for Pageflakes at the moment. Now, to have Pageflakes in your list of options , there is a way that I've found from Mozilla Links , which describes a way for adding your own custom feed reader to the list.

From that article, i have created the following link for you , that will do the work for you right away and let you subscribe feeds using Pageflakes from right this moment.

Make Pageflakes your Default Feed Reader.

This will also mark Pageflakes as the default selection in the dropdown list, just check the "Always use Pageflakes to subscribe to feeds" option and that's it.







Note:You need to visit Pageflakes and setup your page first before applying the above mentioned procedure.

Thursday, November 16, 2006

Case sensitive query in Sql Server

Often it is needed that you need to search by tag directly from sql server or let's say you want to verify password against db(though i do it with hash matching). The most coolest way of doing is to add an "COLLATE SQL_Latin1_General_CP1_CS_AS" clause in your where statement.

For example,

SELECT *
FROM Eco_Tags
where [Title] = N'Fun' COLLATE SQL_Latin1_General_CP1_CS_AS

This will make sure that if there 'Fun' and 'fun' tags, it will only get the 'Fun' ones'.

Wednesday, November 15, 2006

Plenty of browser options!!!

Suddenly, the browser war has come up with its new look. Now a days, it is really hard to do CSS designing which works in all browsers. All browser ? These days , Firefox has browser series 1.0.*, 1.5 and 2.0 . IE has 6 and 7. There are other browsers that i am not considering like Safari along with the older versions of Firefox and IE. None of them has compatibility with each other 100%. They all claim to follow W3C standard strictly, but in reality you pull your hair out , understanding why the same CSS works in one browser but fails in other.

I want to say , If you have released a new browser with all new features , why we are considering old ones and why there so many versions with so much deviation out there, which making our lives difficult everyday.

A Reader's Toolbox

To buy domain you need not to worry about browsers compatibility because all browsers are supporting. The browsers issues must be kept in mind when you start website design. Many companies are using modern practices like search engine optimization for their websites. For websites promotion and marketing seo advertising is getting popular day to day. Latest backup software can help you to save your data and information. You can save your money when buying business web hosting because you can buy in bulk. Most of webhosting domain provides cheap rates in bulk buying.

Monday, November 13, 2006

Sql Server 2005 - Powerful paging using WITH statement

Sql server 2005 formerly named "Yukon" , is bundled with loads of features that can rock a database developer's mind.Among many of features, one thing that is truly mind blowing is the mighty WITH statement. Previously , it is a real tedious task to do paging from database. Some of the option were creating temp table, using cursors,etc. But, now is the time to forget those tricky methodologies.

Lets consider a simple table called employee( emp_id, name, salary). Now, suppose that we need to create a gridview with paging. One option is to bring all the data from database and do the paging in client-side and another one is to do selective fetch. In both cases we can use a stored procedure that takes some parameter and returns a resultset.

Let's see the following...

CREATE PROCEDURE GetEmployees
@Status int,
@StartIndex int,
@PageSize int
AS

WITH FilteredList( [emp_id],[name], [salary], [RowNumber])
AS
(
SELECT
[emp_id],
[name],
[salary],
ROW_NUMBER() OVER ( ORDER BY [ID] DESC) AS [RowNumber]

FROM
Employee
)

SELECT
*
FROM
FilteredList
WHERE
RowNumber BETWEEN (@StartIndex + 1) AND (@StartIndex + @PageSize)


Actually , the WITH creates a in-memory data structure based on ROWNUMBER or any other identifier that we might give. Finally, we separate the result based on that identifier. But anyway in the end it makes our life more simple at the end of the day.

Here in Pageflakes, i use it almost everywhere possible, which surely saves my time and nothing else.

Saturday, November 11, 2006

New and Improved Pageflakes

The new and improved Pageflakes site has been launched with a great look and with its own community site. Community site offers “use before you add” feature, by which before adding a flake/feed/podcast , you can have a live preview that will help you build customized start page in no time. The Pageflakes community has its own Blog/Forum section , beside that you can now rate a module, view public pages of other users.Finally, it has a new template gallery concept which give the option to add custom pages by other users as your own.

New community homepage http://www.pageflakes.com/community. Dont forget to visit http://www.pageflakes.com

Thursday, November 2, 2006

Asp.net Repeater over Datatlist

If you are doing a div based css design using datalist , then to tell you the truth , the design will be altered anyhow , cause data list always enters a span or table right into your html code, for that reason i use repeater simple but yet powerful in this type of task.

Using a repeater is same as datalist , just you wont get any template time desing view. But that will give you a full control over your html , which is required in lot of cases.

Wednesday, November 1, 2006

Moving to Blogspot

I had a blog site of my own (http://www.mehfuz.com) , which is a php based solution. Sometimes, it used to happen that the server went down and all my blogs get lost, I had to start from the beginning every time the blog server refreshes. I realized that for blogging any personal service is no good solution.

Still, i was too lazy to sign up any free blogger account , till i found that google users can log in to blogger with their existing account and decided to switch to Blogspot and say good-bye to my hosting service forever. :-)

Monday, October 16, 2006

Highlighting Search Text (Pageflakes Community)

i recently used text highlighting in a project( pageflakes community - under development), using the simplest, yet powerful class of .net called

System.Text.RegularExpressions.MatchEvaluator


Sometimes, you need to highlight the search key words ( ex.google), there are loads of methods available out there for doing so , but very simple yet power code block i have just pasted below.


private string HighLight(string inputText, string searchKey)
{
if (searchKey.Length > 0)
{
// Setup the regular expression and add the Or operator.
Regex RegExp = new Regex(searchKey.Replace(" ", "|").Trim(), RegexOptions.IgnoreCase);
// Highlight keywords by calling the delegate each time a keyword is found.

return RegExp.Replace(inputText, new MatchEvaluator(ReplaceKeyWords));
}
return inputText;
}


public string ReplaceKeyWords(Match m)
{
return "" + m.Value + "";
}


/*CSS */
span.highlight
{
background-color : Yellow;
}



Use call this function with a search key and text to highlight and it will do the rest.


A Reader's Toolbox

The seo software highlights on keywords research to increase traffic of your website. Especially in the affiliate business, you need backups of your website so that in case of lost of data you can retrieve it. For starting a telecom related business you need pc phone for customer support with huge bandwidth and space of cheap hosting. In order to find a good server for hosting you should know best domain host must have minimum down time. Especially the wireless internet booster is necessary for boosting up your speed.

Tuesday, October 10, 2006

Quick and dirty solution for compression.

This is a real cheap solution in terms of http compression.Just to make sure the following code on page load.

protected void Page_Load(object sender, EventArgs e)
{
if(!Request.UserAgent.ToLower().Contains("konqueror"))
{
if(Request.Headers["Accept-encoding"] != null
&& Request.Headers["Accept-encoding"].Contains("gzip"))
{
Response.Filter = new GZipStream(Response.Filter,
CompressionMode.Compress, true);
Response.AppendHeader("Content-encoding", "gzip");
}
else if(Request.Headers["Accept-encoding"] != null &&
Request.Headers["Accept-encoding"].Contains("deflate"))
{
Response.Filter = new DeflateStream(Response.Filter,
CompressionMode.Compress, true);
Response.AppendHeader("Content-encoding", "deflate");
}
}
}


Source : http://www.codeproject.com/aspnet/HttpCompressionQnD.asp

Thursday, September 7, 2006

Joel Spolsky and fog creek

I am subscribed to the occasional news letter of joel spolky, and to tell you the truth this guy always comes up with great stuffs , that i just cant stop to read.Apart from my daynight work at pageflakes, this kind of writings really gives me a pump up.I wonder how people can be such an idea generating machine.

To leave you with that , dont forget to check the link out.

http://www.joelonsoftware.com/articles/FindingGreatDevelopers.html

This writing do tell , that all job sites are full crap and nothing else, this is true on some cases too.Also, This reminds me of an old saying, "Work work and work , and dont care about reward" (self created).

Friday, September 1, 2006

Nuts and bolts of sp_executesql

Today i was having a problem for setting parameter in sp_executesql then i found this great piece of writing , which gave some great tactics for working with sp_executesql and also its side effect.

http://www.sommarskog.se/dynamic_sql.html#sp_executesql