Archive for 'Other'
FIX Protocol FAQs are posted
Posted on 18. May, 2009 by khader.
As requested, I have compiled good number of frequently asked questions on FIX protocol. I tried my best to answer them precisely. I have added them under Sections tab on right menu or can click here.
Feel free to write to me if you have any specific questions on this topic.
Cheers!
Continue Reading
HtmlGenericControl ID Property is not specified - ASP.Net (Visual Studio)
Posted on 18. May, 2009 by khader.
You would see this quite often in Visual Studio (mainly 2008) while working with ASP.Net and User Controls. This is been very tricky. It is not actually a problem, but Visiual Studio could not render this control inside another page. It was kind of a pain not being able to see User control inside main pages. It took a while to figure it out.
If you are using HtmlGeneric controls (such as <body>, <div>, <span>, <p>, <link> etc) in your User Control they must have ‘ID’ attribute defined though you are not using it.
For example we had
<link href="~/App_Themes/Default/Default.css" runat="server" rel="stylesheet" type="text/css" />
All I need to do was add ‘id’ attribute to this tag as
<link href="~/App_Themes/Default/Default.css" runat="server" rel="stylesheet" type="text/css" id="dummy"/>
Cheers!
Continue Reading
HttpException (0×80004005): The IListSource does not contain any data sources - Anatomy
Posted on 05. May, 2009 by khader.
This is one of the common errors I saw when I was testing our new asp.net application recently. I asked my team, the answer was simple patch. But I wasn’t happy. I didn’t find any good explanation from anybody on internet either. I did little research. Here’s my explanation.
First, couple of points to note:
- This occurs when you are binding a NULL dataset to Data control such a GridView, FormView etc. We could avoid this by simple checking whether dataset is null. I don’t think it is a robust solution.
- NULL datasource is returned mostly when some thing is WRONG/ERROR with your query or stored procedure.
Then, what happened to the SQLException handling code? I had the same question. But look at the following piece of code.
//....
DataSet dsDataSet = null;
dbConn = new SqlConnection(_connStr);
try
{
dbAdapter = new SqlDataAdapter(SqlString, dbConn);
dsDataSet = new DataSet();
dbAdapter.Fill(dsDataSet);
}
catch (SqlException sqlException)
{
System.Diagnostics.Trace.WriteLine(sqlException.ToString());
}
catch (Exception genException)
{
System.Diagnostics.Trace.WriteLine(genException.ToString());
}
return dsDataSet;
//....
It looks great. It has all that you usually think of. But this is the same code which was bugging me. It simply returns NULL dataset even when I am missing my Stored Procedure in Database. What happened SQLException?
Here the culprit is the function “dbAdapter.Fill(dsDataSet);”. If you look at the FILL function documentation you will see few other signatures. The default signature simply tries to add or refresh the rows in dataset. If you look at the details carefully it says, it doesn’t fill the Dataset if there are any erros from the SELECT/SQL. Same thing happened in my case. I was missing stored procedures in my new database. It kept simply throwing the IListSource exception instead of SQLException.
You can carefully use this function with some extra checks to avoid this error. It is very important to handle this otherwise you may end up spending lot of time to find out that you are missing some database object.
-Khader Vali
Continue Reading
HttpException (0×80004005): Maximum request length exceeded.
Posted on 01. May, 2009 by khader.
These days I have been developing couple of prototypes using ASP.Net. I love to use ASP.Net for quick prototypes. I am throwing some of the key issues I am facing. We connected our app to real database that has millions of rows. First thing we came across was request length exception.
HttpException (0×80004005): Maximum request length exceeded.
You may have this error in case of
- large data downloads through grids etc
- large file uploads, attachments etc
It is mostly to do with buffer used by IIS server to process request. The size can be increased by one of the parameter in web.config. as follows:
Remember the max allowed is 4GB, Which lot more than required. If that is not sufficient you may have to look into your application design.
…
<httpRuntime maxRequestLength=”102400″ />
…
</system.web>
Continue Reading
Tooltip for GridView Column Headers (ASP.Net)
Posted on 30. Mar, 2009 by khader.
I just wanted to add auto tooltips for my GridView headers. There are couple of ways but I don’t want to use javascript and wanted to use simple ‘title’ attribute. It took couple of hours to get the working code supporting sortable columns. I thought it will be very useful for others. Here’s the code and logic behind it.
I am using RowDataBound event of the GridView to add tooltip manually. So I created a event handler. In the handler I checking the type of column header whether it is simple Text or a Link to sort the data. The reason is I cannot retrieve the name of the Column if is clickable header. Here is the code (VBScript):
'Assume your grid control name - GVDashBoard
Protected Sub GVDashBoard_RowDataBound(ByVal sender As Object,
ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs)
Handles GVDashBoard.RowDataBound
Dim titleSet As Boolean = False
If e.Row.RowType = DataControlRowType.Header Then
For Each cell As TableCell In e.Row.Cells
For Each ctl As Control In cell.Controls
If ctl.GetType().ToString().Contains("DataControlLinkButton") Then
cell.Attributes.Add("title", "Sort by - " + CType(ctl,LinkButton).Text)
titleSet = True
End If
Next
If Not titleSet Then
cell.Attributes.Add("title", "Tooltip for Column - " + cell.Text)
End If
titleSet = False
Next
End If
End Sub
If you are looking to add a tooltip manually you can do shown below:
Continue Reading
Grid Computing Vs Cloud Computing
Posted on 19. Mar, 2009 by khader.
Recently we started hearing a lot about these terms. They are bit confusing and not many are clear about the distinction. I tried to google it to see if there is any simple and clear explanation somewhere. But I wasn’t that lucky. So let me explain this in a simplest possible way.
Grid Computing term is in use from quite some time and has clear meaning and context where as Cloud computing is relatively new and has a broad meaning to it.
Grid refers to the set of independent computers that are used in parallel to run a very lengthy process like research etc. All these computers do their job independently and the results are added up. This whole coordination is handled by special software. (I will keep specifics away for the sake simplicity). This whole computing process is known as Grid Computing.
Coming to Cloud computing, it refers to the set of services that run independently (may be on one processor, multiple processors, or in totally different environment) and brought together to serve a specific purpose. Here service could be of any size and nature. For example, a storefront might be using Credit card processing service hosted on different machine from different company, and paypal services by Paypal etc. All these services are generally accessed over internet hence the name Cloud.
I think it was simple to start with. To understand more, bringing multiple services together is always a challenge and there are many methodologies and commercial and non-commercial softwares. Different terms are used in different context. There are lots of resources available to learn more. I have listed some of the very useful links below.
Happy learning!
Related Terms:
- Enterprise Bus
- Middleware
- Utility Computing
- Virtual Servers
- Super Computer
- SaaS (Software as a Service)
- CPU Scavenging
- Shared Computing
- Distributed Computing
References:
- Grid Computing on Wikipedia
- Cloud Computing on Wikipedia
- Cloud Computing Article on InfoWorld
- Cloud Computing from Sun
- Grid Computing from IBM
- Xgrid from Apple
- Appistry a Cloud Computing software
- Cloud Computing Services by Amazon
- Google Apps
Continue Reading
Unix Internals - 1 day Workshop
Posted on 03. Feb, 2009 by khader.
Something that scares many programmer is Unix internals. I have put created this 1 day course to make it easy. It covers the Unix operating system design, architecture and various aspects just as much as you need.
You can download the course presentation here - Part 1 Part 2.
Course contents:
- Unix Operating System Design
- Boot Process
- Shutdown Process
- Process Management
- Memory Management
- File System
- Networking