[The views expressed on this website/blog are mine alone and do not necessarily reflect the views of my employer.]
Sunday, May 31, 2009
Thursday, May 28, 2009
Thursday, May 14, 2009
Weather modeling or web services aim to conserve power - Narendra Bhandari Intel
This is one of eye opening keynote. Just compiled some of the highlights from my twitter.
How S/W developers code programs has dramatic impact on power consumption in Data centers.
Loop vs Service has big impact on power.
It is time S/W professionals understand hardware chages taking place in hardware side of industry.
Dual Core to Multi Core to Many Core. Wether modelling to webservices everone need to optimise for sake of conserving power.
Visual Adernline, Intel Parallel Studio performance Tools from Intel to take advantage of hardware advances. Most of the tools are developed like VS2010 plug-ins and thus bring lot of value with simplied learning curve.
www.intel.com/go/parallel, www.intel.com/software and Intel Certified Solution Program
tech.ed 2009 Day2. Resul Pookutty's Key note session
Resul Pookutty's Key note session mesmerized everyone there. He is so impressive that session just got extended on and on.
He is so well prepared and organized with content. It is really unique of its kind.
Following is one of the clipping that were played at session. This one is from Oscar winning SDM.
Wednesday, May 13, 2009
Microsoft tech.ed 2009 Day1
Exciting first day. We shared pre-registration counter with Infosys.
TechEd 2009 - Hyderabad
Monday, May 11, 2009
Friday, May 08, 2009
icloud has launched
Xcerion XML internet OS/3. I posted this when I got beta my beta account. It is released last month.
icloud is a service based on the Xcerion Internet Operating System /3 (XIOS/3).
XIOS is the technical solution behind the service. It offers “A free online computer with desktop, applications and storage.”
icloud consists of a desktop with applications and files that you run through your web browser. Because it's running in the cloud (the internet) it can offer you impressive features such as easy sharing and rich collaboration.
Some of the feature include
It is available in three forms. Check this link. Also check link for applications made available by default.
Thursday, May 07, 2009
Cascading DropDownLists in DetailsView – Databinding error
I came across a requirement to have linked DropdownLists in insert mode of DetailsView bound to EntityDataSource.
In insert mode of DetailsView one of the fields is bound to a dropdownlist’s selected value. But the requirement here is values of dropdownlist vary depending on where condition bound to selected value of another dropdown list.
As shown above TaskID is one of the fields. But tasks vary based on project selected. This is achieved by converting TaskField to TemplateField. I have pasted below code for EditTemplate, InsertTemplate and ItemTempalte. In this only TaskID is bound column while project is added manually.
Without doing modifications shown below I was getting error
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
This is because upon postback DetailsView control is not re binding to selected value SelectedValue='<%# Bind("TaskID") %>'
<asp:TemplateField HeaderText="TaskID" SortExpression="TaskID">
<EditItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Eval("TaskID") %>'></asp:Label>
</EditItemTemplate>
<InsertItemTemplate>
<asp:DropDownList ID="DropDownList5" runat="server" AutoPostBack="True"
DataSourceID="EntityDataSource5" DataTextField="ProjectName"
DataValueField="ProjectID" Width="100%">
</asp:DropDownList>
<asp:EntityDataSource ID="EntityDataSource5" runat="server"
ConnectionString="name=MyEntities" include="Tasks"
DefaultContainerName="MyEntities" EntitySetName="Projects">
</asp:EntityDataSource>
<br />
<asp:DropDownList ID="DropDownList4" runat="server"
DataSourceID="EntityDataSource6" DataTextField="TaskDescription"
DataValueField="TaskID" Width="100%">
</asp:DropDownList>
<asp:EntityDataSource ID="EntityDataSource6" runat="server"
ConnectionString="name=MyEntities"
DefaultContainerName="MyEntities" EntitySetName="Tasks"
Where="it.ProjectID==@ProjectID" >
<WhereParameters>
<asp:ControlParameter ControlID="DropDownList5" Name="ProjectID"
Type="Int32" PropertyName="SelectedValue" />
</WhereParameters>
</asp:EntityDataSource>
</InsertItemTemplate>
<ItemTemplate>
<asp:Label ID="Label3" runat="server" Text='<%# Bind("TaskID") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
Also observe highlighted portions where autopostback is set for project dropdownlist and its selectedvalue is bound to DetailsView in where condition of Tasks Dropdownlist. But here TaskID selected value is not bound to TaskID field of DetailsView.
This binding is made in OnItemInserting event handler of DetailsView as shown below
<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" CellPadding="4"
DataKeyNames="ResourceID" DataSourceID="EntityDataSource2" ForeColor="#333333"
GridLines="None" Height="50px" Width="125px" OnItemInserted="DetailsView1_ItemInserted"
DefaultMode="Insert" OnItemInserting="DetailsView1_OnItemInserting">
with page behind file containing handler like
protected void DetailsView1_OnItemInserting(object sender, DetailsViewInsertEventArgs e)
{
String TaskID = ((DropDownList)(DetailsView1.FindControl("DropDownList4"))).SelectedValue;
e.Values.Add("TaskID", TaskID);
}
Here inserting event is handled to add TaskID field to values based on selected value of TaskID’s DropDownlist.
Primary and Unique keys
Today one of my colleagues expressed difficulty in ensuring uniqueness for certain columns in a table.
Characteristics of these columns are
- There are not necessary (allow-null) columns for inserting a row in a table in which they are defined
- But when inserted they must form a unique combination
What could have been done so easily with Unique Key became so difficult because of lack of referential integrity.
These columns could have been defined in a different table and referenced with a foreign key relationship to primary table.
Such a simple thing could not be corrected as we are so tightly coupled with its structure. Awful! a classic example of making life miserable by knowingly living with self made mistakes.
Tuesday, May 05, 2009
Built-in functions of Transact-SQL
Many a times, we end up spending lot of time doing something that made available to us just due to lack of awareness.
Today I spent 30 minutes to get date as string from datetime column in database. Doing this from code is quite a trivial task.
But here I want to bind a source to UI control. DATENAME function solved my problem just like that. It is built-in function of SQL.
Here are some more references for built-in functions from MSDN
- Aggregate Functions (Transact-SQL)
- Configuration Functions (Transact-SQL)
- Cryptographic Functions (Transact-SQL)
- Cursor Functions (Transact-SQL)
- Date and Time Data Types and Functions (Transact-SQL)
- Mathematical Functions (Transact-SQL)
- Metadata Functions (Transact-SQL)
- Ranking Functions (Transact-SQL)
- Replication Functions (Transact-SQL)
- Rowset Functions (Transact-SQL)
- Security Functions (Transact-SQL)
- String Functions (Transact-SQL)
- System Functions (Transact-SQL)
- System Statistical Functions (Transact-SQL)
- Text and Image Functions (Transact-SQL)
Monday, May 04, 2009
Wild west stunt show in Ramoji Film City
Ramoji Film City, the largest film studio complex in the world as certified by Guinness World Records, is an ultimate leisure destination for holidays in Hyderabad. Following photograph taken before the start of the show. It is just a part of complete set.
This particular show is so realistic and really makes you watch again and again.
MSDN for low bandwidth
Low bandwidth option of MSDN is really worth giving a try. Its much better than regular one.
Find some of the low bandwidth options for MSDN.
Low bandwidth
http://msdn.microsoft.com/en-us/library/system.collections.arraylist(loband).aspx
This option is really good.
Mobile/PDA
http://msdn.microsoft.com/en-us/library/system.collections.arraylist(pda).aspx
Not quite there. Option to choose language is desired.
Printer-friendly
http://msdn.microsoft.com/en-us/library/system.collections.arraylist(printer).aspx
Familiar one. But not so inviting
MSDN Inside the (IDE)
http://msdn.microsoft.com/en-us/library/system.collections.arraylist(ide).aspx
Useful, though can’t understand why feedback banner hides content at top. MSDN folks to correct this.
Friday, May 01, 2009
Using Set operations (SQL) to detect differences between two tables
Identifying differences between two tables can become quite a daunting task.
Using SQL set operations like {UNION,INTERSECT,EXCEPT} can greatly simply this is process.
Any attempt to use compare operations on .Net runtime turns out to be very costly affair for these operations.
I tried creating a set operations. Here my intention is to pass two tables which share same schema, then pass on ID field which
is anchor. This results a single table specifying Addedd/Changed/Deleted/UnChanged records. That makes whole set.
SELECT t1.*, 'Added'FROMTable1 t1
LEFT JOINTable2 t2 ONt1.ID = t2.ID
WHEREt2.ID IS NULL
union
SELECTt1.*,'Changed'
FROMTable1 t1
INNER JOINTable2 t2 ONt1.ID = t2.ID
except
SELECTt2.*,'Changed'
FROMTable1 t1
INNER JOINTable2 t2 ONt1.ID = t2.ID
union
SELECTt2.*, 'Deleted'
FROMTable1 t1
RIGHT JOINTable2 t2 ONt1.ID = t2.ID
WHEREt1.ID IS NULL
union
SELECTt1.*,'UnChanged'
FROMTable1 t1
INNER JOINTable2 t2 ONt1.ID = t2.ID
INTERSECT
SELECTt2.*,'UnChanged'
FROMTable1 t1
INNER JOINTable2 t2 ONt1.ID = t2.ID
ORDER BY XX
I tried this with two tables each having 100 columns and 5000 rows. I could detect above mentioned changes like Added/Changed/Deleted/UnChanged within 18 seconds.
Thus I believe set operations can offer much cleaner and simpler solution in such scenarios.