jump to navigation

Microsoft OpenDoor Expo Jeddah 2010 November 13, 2010

Posted by Bilal in .NET, General, Microsoft, Tech News, Tips & Tricks, Updates, Windows.
Tags: , , , , , , , , , , , , , ,
1 comment so far

Microsoft OpenDoor 2010 Saudi Arabia took place in two cities Riyadh (2nd and 3rd Nov) and Jeddah (7th Nov) at Intercontinental Hotel. It was the first time that Microsoft CEO, Steve Ballmer visited KSA and delivered the Key Note but his visit was limited to one day and it was in Riyadh only.

The registration was web based and no registration fee was mentioned. I happen to know about Professional Developer Conference (PDC) that used to have separate registration fee for students and professionals. Anyhow, for this expo, a bar code was issued to each participant against his Windows Live ID.

The Expo started with the keynote of Developer & Platform group Manager
Adel Al-Massarani about Cloud Computing and Abdurrahman Al-Qahtani
Manager Windows Phone Group, about the new Windows Phone 7. It was followed by the presentation of the Platinum Sponsors

Mobily was also a platinum sponsor but they are already making too much advertisement through different mediums. No time was given to the Gold Sponsors. All of the sponsors have their stalls in the lobby where attendees can easily get their information.

After that there were three options to go:

  • Track A for IT Professional
  • Track B for Developers
  • Track C for Technical Managers

Each track was taking place in separate hall. Attendees had full choice to attend any of the tracks at any time as per their taste.

I joined the Track B (Developers). It started with a presentation of Mohamad Halbi about Windows Azure Platform, the cloud service operating system. It was a brief but comprehensive overview of the Azure Platform right from the start to a live working demo. He showed how windows Cloud could be utilized to get a cost effective and reliable performance.

It was followed by lunch and prayer break.

The next session was about Microsoft Web platform by Abdurrahman Al-Qahtani. He demonstrated about the new Web Platform and also gave some working demonstrations.

After a break of about 15 min, the stage was conquered by Jerry Yasir about the advanced features in Microsoft Excel 2010 and its interaction with Microsoft Sharepoint 2010. He showed how we can get the graphical representation of data and its distribution/sharing with other people through SharePoint.

Then there was prayer break. Refreshment was available in the side room that can be utilized by anybody at any time.

Last session of the track was about Visual Studio 2010 from Architecture Point of view by Abdurrahman Al-Qahtani. He should that how the advanced tools in VS 2010 can help in understanding/designing the architecture of a system graphically using UML.

In the last, there was a combined closing session of all the tracks in which winners were selected through a lucky draw. Gifts include 3 web-cameras and 1 XBOX 360 and another set of 2 web-cameras and 1 Xbox360 for the female participants.

And so, a wonderful Expo by Microsoft came to an end. We wish to see more such events in the near future by international companies like Microsoft, Google, Apple, etc… Also, we expect to see Steve Ballmer in Jeddah next year.

 

This slideshow requires JavaScript.

The language of this installation package is not supported by your system. October 12, 2010

Posted by Bilal in Microsoft, Tips & Tricks.
Tags: , , , ,
5 comments

Yesterday I downloaded the Office 2010 trail and tried to install. Previously I have used the Beta1 also in its early days. After re-installing the Window I stick to the Office 2007 because I was facing some issues in the beta so I prefer to wait for the stable version.

The direct installation attempt was not successful because even after uninstalling the Office 2007 there were still some components (like office connector for WLM 2011) that were required to be removed. To avoid the delay in extraction each time then getting the error of still some components remaining for uninstall, I extracted the exe file (ProfessionalPlus.exe) with WinZip. After  fully remove the required components, I executed the installer from the extracted files and I got a new error:

office language error

It was really strange for me because I clearly remember selecting the language as English. I cross checked the language of my system but I could not find the gap.

After googling the issue I came to know that the cause of this error is the extraction method. Why it is so, it does not make any logic.

The result for the issue is fully explained HERE.

Server.MapPath February 15, 2010

Posted by Bilal in .NET, APS, C#, Microsoft, Visual Studio 2005, Visual Studio 2008.
Tags: , , , , ,
add a comment

Server.MapPath specifies the relative or virtual path to map to a physical directory.

  • Server.MapPath(“.”) returns the current physical directory of the file (e.g. aspx) being executed
  • Server.MapPath(“..”) returns the parent directory
  • Server.MapPath(“~”) returns the physical path to the root of the application
  • Server.MapPath(“/”) returns the physical path to the root of the domain name (is not necessarily the same as the root of the application)

An example:

Let’s say you pointed a web site application (http://www.example.com/) to the root of your domain

C:\Inetpub\wwwroot

and installed your shop application (as virtual directory in IIS and marked as application) in

D:\WebApps\shop 

If, you call Server.MapPath in following request:

http://www.example.com/shop/product/GetProduct.aspx?id=2342

then,

  • Server.MapPath(“.”) returns D:\WebApps\shop\products
  • Server.MapPath(“..”) returns D:\WebApps\shop
  • Server.MapPath(“~”) returns D:\WebApps\shop
  • Server.MapPath(“/”) returns C:\Inetpub\wwwroot
  • Server.MapPath(“/shop”) returns D:\WebApps\shop

If Path starts with either a forward (/) or backward slash (\), the MapPath method returns a path as if Path were a full, virtual path.

If Path doesn’t start with a slash, the MapPath method returns a path relative to the directory of the request being processed.

Note: In C#, @ is the verbatim literal string operator meaning that the string should be used “as is” and not be processed for escape sequences.

Source: Link

NTEXT vs NVARCHAR(MAX) in SQL 2005 May 28, 2009

Posted by Bilal in Microsoft, SQL Server 2005.
Tags: , , , , , , , ,
2 comments

I recently profiled a sproc that makes heavy use of the TSQL SUBSTRING function (hundreds of thousands of times) to see how it performs on a SQL 2005 database compared to a SQL 2000 database. Much to my surprise the SQL 2005 database performed worse…dramatically worse than SQL 2000.

After much researching it turns out the problem is that the column the text was stored in was an NTEXT, but SQL 2005 has deprecated the NTEXT in favor of NVARCHAR(MAX). Now, you’d think that string functions on NTEXT would have the same performance on 2005 as it did on 2000, but thats not the case.

Ok, so NTEXT is old badness, and NVARCHAR(MAX) is new goodness. Then the next logical step would be to convert the column to be a NVARCHAR(MAX) data type, but here lies a little but very important gotcha.

By default NTEXT stores the text value in the LOB structure and the table structure just holds a pointer to the location in the LOB where the text lives.

Conversely, the default setting for NVARCHAR(MAX) is to store its text value in the table structure, unless the text is over 8,000 bytes at which point it behaves like an NTEXT and stores the text value in the LOB , and stores a pointer to the text in the table.

So, just to recap, the default settings for NTEXT and NVARCHAR(MAX) are completely opposite.

Now, what do you think will happen when you execute an ALTER COLUMN on a NTEXT column that changes the data type to a NVARCHAR(MAX)? Where do you think the data will be stored? In the LOB structure or the table structure?

Well, lets walk through an example. First create a table with one NTEXT column:

CREATE TABLE [dbo].[testTable](
[testText] [ntext] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]

Next, put 20 rows in the table:

INSERT INTO testTable SELECT 'hmmm...i wonder if this will work'

Then run a select query with IO STATISTICS:

SET STATISTICS IO ON
SELECT * FROM testTable
SET STATISTICS IO OFF

Now, looking at the IO stats, we see there was only 1 logical read, but 60 LOB logical reads. This is pretty much as expected as NTEXT stores its text value in the LOB not the table:

Table ‘testTable’. Scan count 1, logical reads 1, physical reads 0, read-ahead reads 0, lob logical reads 60, lob physical reads 0, lob read-ahead reads 0.

Now, lets alter the table to be an NVARCHAR(MAX):

ALTER TABLE testTable ALTER COLUMN testText NVARCHAR(MAX) null

Now when we run the select query again with UI STATISTICS we still get a lot of LOB reads (though less than we did with NTEXT). So its obvious that when SQL Server did the alter table, it didn’t use the default NVARCHAR(MAX) setting of text in row, but kept the text in the LOB and still uses pointers lookups to get the text out of the LOB.

Table ‘testTable’. Scan count 1, logical reads 1, physical reads 0, read-ahead reads 0, lob logical reads 40, lob physical reads 0, lob read-ahead reads 0.

This is not as expected and can be devastating for performance if you don’t catch it, since NVARCHAR(MAX) with text not in row actually performs WORSE than NTEXT when doing SUBSTRING calls.

So how do we fix this problem? Its actually fairly easy. After running your alter table, run an update statement setting the column value to itself, like so:

UPDATE testTable SET testText = testText

SQL server moves the text from the LOB structure to the table (if less than 8,000 bytes). So when we run the select again with IO STATISTICS we get 0 LOB reads.

Table ‘testTable’. Scan count 1, logical reads 1, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.

YEA! This is what we want.

Now, just for grins, what do you think happens if we change the NVARCHAR(MAX) back to NTEXT? Well it turns out that SQL Server moves the text back to the LOB structure. Completely backwards from what it did when converting NTEXT to NVARCHAR(MAX).

Source: Making Stuff Faster

OpenFileDialog.SafeFileName March 10, 2009

Posted by Bilal in .NET, C#, Microsoft, VB, Visual Studio 2005, Visual Studio 2008.
Tags: , , , , , ,
2 comments

I had developed an application in VS2008 with .NET 2.0 . The application was deployed using the VS2008 deployment project  with .NET Framework as pre-req. AutoCAD 2009 was already installed on all the client machines so the pre-req conditions were satisfied so .NET Framework was not skipped during the installation of the application.

Later on,  I made a clean installation of WIN XP SP3 on my development machine. I skipped VS 2008 because I could not find its proper usage. VS2005 was sufficient for me.

Today, I got the a request for some updates in the application. For this purpose, I converted it to VS2005. On building the application is got the error about OpenFileDialog.SafeFileName. It was really a strange thing as the application was working smoothly on all the client machines.

SafeFileName returns only the File Name from the whole path. Although, I got the problem solved by doing some string operations:
String safeName = opdg.FileName.Substring(opdg.FileName.LastIndexOf("\\") + 1);
// 1 has been added to skip the \

I Googled about it and it was disclosed that this property is available in .NET Framework 2.0 SP1 which is installed along with VS2008.

Missing Items in Visual Studio 2005 Menu February 22, 2009

Posted by Bilal in .NET, C#, Microsoft, SQL Server 2005, Tips & Tricks, VB, Visual Studio 2005.
Tags: , , , , , ,
1 comment so far

I noticed some missing menu items in the VS2005 (like clean, rebuild, and many others) but i continued by using the commands from other locations; until I got stucked!  I wanted to export a form as a template but the Export was not available in the File menu.
The details of my environment are:

Since, I installed Resharper for the first time, the first option that came to my mind is that its due to Resharper. I tried to explore different options in the Resharper and VS specially the Key Mapping but no result. I was only left with the option to uninstall Resharper and I did it. But to my surprise, the problem was still there.
In such a situation, I call my rescue agent GooGle. The first suggestion provided by the agent worked well and my problem was solved.
I had installed SQL Server 2005 for the first time (initially, I was using SQL 2000 as per client requirements) but I don’t considered it bcoz it’s a Microsoft product and it was least expected to interfere in the scenario. I was WRONG. This problem occurred due to a bug in it.

Here is the solution provided by Microsoft.

Hope it will also solve your problem if u faced such an issue.

Five things we have learned from Bill Gates July 11, 2008

Posted by Bilal in Microsoft, Tech News.
Tags: , , ,
1 comment so far

Whether or not you are a fan of Bill Gates, it is impossible to deny the impact he has made on the spread of computer technology across the planet during the past three decades. Since Friday June 28, was Gates’ last day as a full-time Microsoft employee, this is the perfect time to look back at five of the most important lessons we’ve learned from the meteoric, tumultuous, and lucrative career of the world’s most famous software engineer.

5. Geeks can be businessmen, too

Before Bill Gates, computer programmers were mostly considered to be a necessary evil for businesses. They were stereotyped as misanthropic weirdos that you stick in dark corners in the back office. However, Gates, became the most successful businessman on earth — if you judge business success by profits — and almost singlehandedly transformed the term “geek” from an insult to a badge of honor in the process.

4. You don’t have to be first to win

Gates and Microsoft rarely got to the party first with new technologies and innovations, but they were simply better at bringing technology products to the masses than anyone else in the industry. Internet Explorer is the most famous example, but Microsoft Windows, Microsoft Word, and Microsoft Excel are also great examples. Microsoft was merely better at executing. It didn’t hurt that Microsoft often had the most resources, but Gates and Co. showed over and over again that they knew how to best take advantage of those resources.

3. Computing will spread everywhere

In the 1980s when the computer was still mostly a novelty, Gates expressed his vision that there would one day be “a computer on every desk and in every home.” That vision has nearly become a reality in the U.S. and it’s in the process of coming to fruition across the globe. Plus, Gates’ vision of the computing experience has continued to inspire the industry in general as well as Microsoft’s product plans — from the smartphone to the Tablet PC to speech recognition to the touch-based interface.

2. Arrogance breeds failure

In the movie Pirates of Silicon Valley, the Bill Gates character says to Steve Ballmer, “Success is a menace. It fools smart people into thinking that they can’t lose.” He was referring to IBM and the fact that it let Microsoft sneak in and steal the thunder in the launch of the PC. A decade later, Microsoft’s own success and arrogance led to its anti-trust defeat to the U.S. government. But Microsoft also remained humble and paranoid enough to always be on the lookout for the next small company that might do to it what it had done to IBM. Some of the most popular targets in its cross hairs: Apple, Netscape, Linux, and Google.

1. Software matters

The one message that Bill Gates spent his career reiterating was that software matters. Gates and Microsoft always believed in the magic of software to create amazing digital experiences. When “Micros-Soft” (as it was originally known) first launched in the 1970s, the computer business was all about the hardware. It was Gates and his vision of what people could do with computers that moved software to the center of the computing experience.