Bashar Kokash' Blog

.Net Framework, windows and web development.

This site

Resources

Friends

Sponsors

  • MaximumASP
This Blog was moved

 Thanks to dotnetslackers for hosting my blog, but i think it's the ideal time for moving to separate blog.

you can reach me always on: BasharKokash.com

 

Microsoft Office Web Apps

Last Thursday 17.09.2009 was a really exciting day, Microsoft announced that Office web apps will be available for a selected group of Windows Live users as part of the Office Web Apps Technical Preview.

Well, I am also excited that I was one of those selected users. In order to check if this CTP version is available for your account, sing in to Windows Life and click More> then SkyDrive. You will notice that you have the  “New” option beside “Add file” and “Create”, this will allow you to create Office documents and edit them using the Office Web Apps, or if you already have Office document stored in your SkyDrive, just select a file and then you select to “View” or “Edit” that file.

I thought it is interesting to test and evaluate the new Office Web Apps for the common different scenarios to check what features are currently available and what’s not. From another hand I wanted to check the browser compatibility for features and layouts.

My Test environment includes only Windows PCs running on Windows 7 RTM and Windows XP SP3,  tested browsers: IE Explorer 8, and Chrome 3 and FireFox 3.5.

Test results:

- All browsers (IE, FireFox and Chrome):

-View and edit files, All features did as supposed to do regarding text formatting, tables, cells, and text alignment.

-Multiple users to edit the same file simultaneously worked properly in the three browsers.

- All working great with Arabic Language, except that the page layout is only left to right and you can't switch it to right to left which is required feature.

-Fire Fox & Chrome:

-All features and scenarios worked properly except that you can’t move your document to continue working on the local machine.

Chrome:

-Bug: In view document mode, the browser doesn’t respond when switching to Edit mode, but the Edit mode works when you select a file then select the Edit mode directly (well, we can’t blame Microsoft, since Chrome is not officially supported by Office web Apps).

Well, This is a great beginning for such an application to share most of its feature on most browsers, even no supported ones. If you have tested the Office Web Apps, please don’t hesitate to share, and add you experience as a comment.

Reference:

Microsoft Office Web Blog.

First Look at Office Web on Channel 9.

Moving to Windows 7 RTM

I have been using Windows 7 since its first beta version along with the RC one, actually the first time to see Windows 7 new cool features was at PDC 2008, of course I was concentrating on the development side that was presented by Scott Guthrie, all that previous time, I was using windows 7 just for testing on a machine that I use for development.

Well now after the Windows 7 RTM released was shipped I think I am ready to adopt it at all levels on all machines. Right now I use two machines at my small “Home Office” , this is were I do most of my development work, my personal laptop runs Windows Vista, and my work office PC runs Windows XP with a couple of Virtual PCs.

Well it started at my Home Office where I installed Widows 7 on a fresh clean machine, it was as easy as 1 2 3, but when upgrading from Windows Vista you might find some trouble, I haven't upgraded from Windows XP yet.

 

Anyway the following should be considered when Upgrading from Vista to Windows 7:

1 – Microsoft and I suggest to Use Windows 7 Upgrade Advisor Beta, it is a very good small utility that verifies that your PC is ready for Windows 7 (Hardware and Software).

2 – Install Windows Vista Service Pack 1 or Service Pack 2, or else you will not be able to upgrade and the only available option will be “Custom (Advanced)”, you can use it if you want a fresh new installation, the old Windows will be moved to folder “Windows.old”.

3 – According to Scott Hanselman: if you have .NET framework 4.0 and VS2010 Beta you should uninstall them before upgrading to Windows 7, then reinstall them again after a successful upgrade. More details here.

4 – I am not sure if this is the case for other anti-virus software, but apparently Windows 7 requires that you uninstall Kaspersky anti-virus, I Installed it after upgrading but apparently Windows 7 thinks that kaspersky will affect the system behaviors and performance so I installed an RC version of the Maintenance Plan 4 as a patch to Windows 7.

 

Related References:

- Windows 7 Home Page.

- Top 10 Tips Working Developers Should Know about Windows 7 by Scott Hanselman.

- Kaspersky Lab takes next step towards Windows 7 support

Removing duplicate data

Database duplicate rows and data are considered one of the biggest threats that face SQL developers. It may also affect the behaviors of applications that rely on that database the contains those duplicate rows, by providing mistaken data.

A SQL server database designer could solve this problem easily by using UNIQUE constrains or IDENTITY keys, that for sure will prevent adding records the may break any of those keys or constrains, but most of the times or let’s say sometimes, data could be obtained from different resources (for example a text file) where data could be uncertain,miss-typed, and/or not following rules and instructions, these sources may have no abilities to remove those duplicates, especially when large amounts of data are involved.

The solution is to import those data to SQL server as is using SQL Server Integrations Services, then check if it contain any duplicates and finally, process those duplicates (move or delete). The following is a practical example of how to  deal remove duplicate records using a cursor:

The input Data:

ID

FirstName

LastName

BirthDate

HiredDate

1 Ahmad Ali 1/1/1986 1/1/2005
1 Ahmad Ali 1/1/1986 1/1/2005
1 Ahmad Ali 1/1/1986 1/1/2005
2 Mohammad Ameen 2/2/1980 1/1/2004
2 Mohammad Ameen 2/2/1980 1/1/2004
3 Bashar Kokash 1/1/1986 3/5/2008
4 Asmaa Saeed 1/1/1987 1/1/2007
4 Asmaa Saeed 1/1/1987 1/1/2007
5 Morhaf Mosa 1/1/1983 1/1/2009

 

The T-SQL procedure:

CREATE PROCEDURE [dbo].[DELETEDUPLICATE]
AS
BEGIN

DECLARE @FIRSTNAME VARCHAR(50) ,
              @LASTNAME VARCHAR(50), 
              @COUNT INT,
              @BIRTHDATE DATETIME,
              @HIREDDATE DATETIME,
              @DELETEDROWS INT


SET        @DELETEDROWS = 0

DECLARE C_EMPLOYEE CURSOR FOR
    SELECT
FIRSTNAME,LASTNAME, BIRTHDATE,HIREDDATE,COUNT(*)
    FROM EMPLOYEE
    GROUP BY FIRSTNAME,LASTNAME, BIRTHDATE,HIREDDATE
    HAVING COUNT(*)>1 –This select statement gets only duplicate rows

OPEN C_EMPLOYEE

FETCH NEXT FROM C_EMPLOYEE INTO
    @FIRSTNAME ,@LASTNAME ,@BIRTHDATE ,@HIREDDATE ,@COUNT

WHILE @@FETCH_STATUS =0
BEGIN

DELETE TOP (@COUNT-1) – if there is 5 copies of a record then delete 4 and leave one
    FROM         EMPLOYEE
    WHERE        FIRSTNAME    = @FIRSTNAME
            AND LASTNAME    = @LASTNAME
            AND BIRTHDATE    = @BIRTHDATE
            AND HIREDDATE    = @HIREDDATE

SET @DELETEDROWS = @DELETEDROWS + @@ROWCOUNT
– gets the number of rows deleted


FETCH NEXT FROM C_EMPLOYEE INTO
    @FIRSTNAME ,@LASTNAME ,@BIRTHDATE ,@HIREDDATE ,@COUNT

END


CLOSE
C_EMPLOYEE
DEALLOCATE C_EMPLOYEE

RETURN @DELETEDROWS
END

The output data:

ID FirstName LastName BirthDate HiredDate
1 Ahmad Ali 1/1/1986 1/1/2005
2 Mohammad Ameen 2/2/1980 1/1/2004
3 Bashar Kokash 1/1/1986 3/5/2008
4 Asmaa Saeed 1/1/1987 1/1/2007
5 Morhaf Mosa 1/1/1983 1/1/2009

 

The Result:

Now as a result we have a new unique copy of the same duplicate data with a little effort, that may save time and cost if duplicates were not processed

ICT Security forum 2009 summary

On the previous two days 27-28 July, I attended the 5th ICT Security forum that was at Dedeman Hotel, Damascus, Syria.

This conference hosted speakers from counties around the world: Germany, Russia, Singapore, Lebanon, UAE, Romania, Tunisia, Malaysia and of course the host country Syria, but this post will summaries the lectures and activities that I found interesting and important to IT professionals as well as any technology user.

Live Hacking- The15-minute Network Penetration test by Alexander Hagenah, AGT:
Mr. Alex, presented the tools and methods needed for finding out the network vulnerabilities, getting into the victim host, creating a new administrator account and having access to the host command shell, this entire process was hidden from the victim its self. In his case he the victim host was a Windows XP box.

Digital Watermarking by Iyad Al Houshi, SCAN Syria:
This talk or lecture as I prefer to call was more scientific than others, Eng. Iyad discussed the limitations of standard encryption algorithms, then he started a detailed explanation about hiding data within multimedia files, using the LSB of each byte in an image was a simple example, he also mentioned more advanced ways of using keys and making use of the entire image data not only the least significant bits.

ICT For Security & Public Safety by Fadi Moubarak, Cisco:
Mr. Fadi started his talk with a video that draws attention to the great and rapid evolution of information technology and the importance of computer based networks in real life. One of the keys he focused on was Risk management rather than components security, he also presented the Cisco IPICS Intelligent Platform that controls media and information.

Emerging threats in the WEB 2.0 world by Stefan Tanase, Kaspersky Lab:
This talk was my favorite because it discussed one of the technologies that I personally and a lot of people around the world use every day. He started be defining the WEB 2.0 concept “User Driven Content” -I realized that not too many of the audience are familiar with that concept- then he goes throw the general structure of WEB 2.0 attacks, he blamed the wide spread of those attacks to technical vulnerability as well as to humans, because they may unintentionally help spreading those kind of attacks. He also pointed that Web 2.0 threats went beyond the malware because it lead to break your our privacy. Finally he showed some of the common threats like koobface for facebook and myspace and xss worm for twitter. Stefan actually drove me to ask him the following question: “I use Facebook and Twitter every day, so if I followed only the people that I physically know, and used only Facebook verified applications then, am I safe?” his answer was exactly what I’m looking for, he said ”The bad guys are trying to use the trust between friends and people, so If we were friends on facebook and my account was infected you may receive messages from my account but not from me and you may respond to the message because you trust me and your account will be infected, then my answer to your question will be no you are not safe”.

At the end, the forum was not as I had in my head, because no all the talks or lectures were at the same level and may were not received well by audience, I wish it gets better next year.

The best IT sector to work in

Introduction:

I was asked recently this question many times by different people or heard a lot of arguments and dissections about “What is the best IT sectors to work?”

This question comes usually from junior IT, Computer Systems Engineering or Computer Science students, who have just put their foot on the first step of the long education road thinking of the future.

But what bothers me, when I hear this question from fresh graduates who have spent their four or five last years studying IT. Regardless of the university or institute they have studied in, I suppose they should be familiar with basic and advanced IT concepts of the major they have chosen and studied.

 You can also hear such discussions in business environment between staff of different IT sections, for example Network administrator and software team leader, each showing the pros of his sector and the cons of the other.

 

IT Sectors:

For me I see IT sectors are divided as follows: Development, Administration and Business management.

·         Development:  this sector contains developers, designers, software architects, testers etc… those people who provide solutions, work in teams and lead the development process of computer systems and use tools such as diagrams, patterns, test cases, frameworks and programming languages.

 

·         Administrators:  those people who are in charge of maintaining, monitoring, giving advices, and troubleshooting already built systems. In IT we can distinguish two main Administration fields Database, and Networks administration.

 

·         Business managers: although this could be considered a separate sector beside IT, a lot of IT people tend to work in business positions; I think that is because management is more fun than writing code, those who could use their IT knowledge and their management skills are the most successful.

 

The answer to the question:

I consider each filed is perfect for certain people, so instead of asking the question “What is the best IT sectors to work?” the question should be asked like this “What is the best IT sector for me to work?”

Notice the significant meaning, we should find the field that suits us best, according to our experiences, skills, and passion especially for those who work in IT.

Posted: Jun 30 2009, 01:22 AM by BasharKokash | with no comments
Filed under:
New year 2009

New Year 2009,

During the previous year, I wasn't such a good blogger. I had only (27) blog posts and recieved only (9) comments, that's only because I was always out of time.

This new year (2009) I hope I will be a regular blogger. I will try to focus on the new technologies, as well as practical solutions for the common issues.

 

Framework Design Guidelines 2nd Edition

Last month I watched a PDC session for Brad Adams and Krzysztof Cwalina, it was titled "Framework deign guidlines", they talked about the .NET Framework and how it was developed over the years. Thoes guidelines were also publish in a book called "Framework Design Guidelines 2nd Edition".

I normally don't tend to buy every new published book, but after that PDC session I insisted to get this book somehow. Because Amazon.com doesn't deliver books to Syria, all it took: visit some different bookstores, talk to a couple of dealers, pay extra money and wait for a whole month to get this book delivered.


Finally I got my own copy, I can't wait to get started.

Hotfix for C#

After istalling .NET SP1, we all may encountered false C# compilation errors appear in the Error List  for ASP.NET Website projects.

Yes, that's because SP1 adds a new feature "live reporting of compilation errors" but unfortunately caused this bug, to solve this problem, I had to turn this feature off and loose its effects, but recently Microsoft has released a new hotfix that will solve this problem, you can download it here.

Thanks to chkdsk command...


I had accidentally unplugged the power of my PC at office while it's running. At first, I thanked GOD that I wasn't in a middle of a long programming task. I plugged the power again and started the PC, unfortunately the windows couldn't start at all, even on safe mode. After a while I decided to use the Windows XP CD, but I don't know why the setup couldn't read the file system on C drive, and suggested to format this drive even when I tried to install a new Windows version on D drive. Of course I will never format a drive while I don't have a recent backup of the data.

As a final solution I selected the Repair option using the Console during the Windows XP setup, and a DOS cmd was lunched, I couldn't access c drive and I get a file corrupted message, but when I tried CHKDSK command to check C for errors I was surprised that it could be able to start and check the disk for errors.

When restarting then everything was alright. Thanks chkdsk you save my PC.

Microsoft Visual Studio 2008 Service Pack 1

 Microsoft released the Visual Studio 2008 Service Pack 1 that includes numerous bug fixes, as well as updates.More Details

You can download the update here.

LINQPAD: Greate tool for LINQ

This is an amaizing free tool for LINQ.

LINQPad lets you interactively query SQL databases in a modern query language: LINQ

To download LINQPAD, please visit: http://www.linqpad.net/

Posted: Aug 11 2008, 05:11 PM by BasharKokash | with no comments
Filed under:
Using Unit Test in Visual Studio 2008 Professional

I would like to share you my article on Defaultdotaspx.com

It describes the basics of unit testing then a few steps about how to use unit tests in Visual studio 2008.

I hope this article helps to understand the basics so more complex scenarios would be easier.

Using Unit Test in Visual Studio 2008 Professional

Class browser

 My brother Bassl started to blog about windows clients applications, today he posted a new class browser tool, I think it's great and useful, but still need some more debugging since it's the first version, anyway you can browse your classes here, test it and give him your feedback.

Tools to block and eradicate SQL injection

 SQL injection is one of the most common attacks on websites, so Microsoft  has released an advisory for the recent SQL Injection attacks

Joe Stanger has a great post describing those tools for It professionals as well as developers.

More Posts Next page »