This blog is subject the DISCLAIMER below.

Saturday, February 10, 2007

Source Control and Team Development Part 4

See previous parts here

The Only Chapter


In the first meeting, you defined a set of features, classes, and functional tests. You got Class A and Class B. You go home. You start writing a set of unit tests for your features. You write a skeleton of your classes. Just empty functions that returns dummy values. You compile, it compiles fine. Now you Check-In your files to the Source Control Server; just a single click. Before the check-in starts, unit tests are run, of course non of them are passed; you only have skeleton classes. Now check-in is complete. You go to sleep.
Next day you wake up, open you PC, in your home. You click "Update" to get the latest version of other people source code. Then you continue developing your classes. You implement seven functions. You compile, test, and find that 30% of tests have been passed. You check-in your code with a message stating a description of the change.

After 3 days, you find that some previously-passed tests have failed. You browse the history of the class that have failed the test, you click a single button and you have a side-by-side view of the current file version and the last-working version. The changed lines are highlighted for you. You compare only 3 lines, and decide to change one of them, and viola: that test have been passed again. You check-in your code with a message stating the correction.

Now you go to the second failed test, you remember that you have made a change that corrected that before and that maybe you have removed that change forgetting what it was for. You perform a search of the check-in messages using the keyword you used for that change, you got the file version that has that bug corrected, the exact lines that you changed to fix that bug is highlighted for you. You fix the current version with that code, and here it is; the test have been passed. You check-in your code with a message saying that you re-fixed that bug again.

Someday you find something inside someone else's code that preventing your code from working. You fix it in his file. You check his file in with a message describing your change. When he checks-in his file with different changes, the server merges both of your files if you haven't modified the same lines. The server lets him know that he doesn't have the latest version and that a merge will happen, he previews the merge and approves it.

The big day has come. You sit together, you don't have anything to do. The project was already integrated each day, and all the tests have been passed, you just go to college and get the maximum grade and go home having 4 feelings:
1- I love programming
2- We CAN make things right
3- I WANT to make a much bigger project next time
4- "Weeee are the champions"

See:

Test-Driven Development
Source Control

Other team management stuff:

Scrum

Other development techniques:

Extreme Programming (XP)

Finally, this is all about Agile Software Development

Big thanks to the MDC 2007 ;)

.. more.

Source Control and Team Development Part 3

See part 1 here
See part 2 here

Chapter 7

Suddenly some remembers that he has the flash memory that they used to transfer the last working version of the file. He gets is and replaces the non-working file, compiles, runs, and there it is. It works now. Still it doesn't have the bugfix that they wanted to restore.

They accept that, and prepare to go to college, each one thinking how they are going to hide that bug from being noticed, or how they would convince the professor to have mercy on them if he noticed it.

Later that night, each one of them have four feelings:
1- I hate programming
2- We can never make anything right
3- I won't spend much effort in such project again
4- WE ARE LOSEEERS :'(

The End

So what we have here ??
We have people who lost self-confidence thus will never be able to make something big, not because they can't, but only because either they don't want to, or they believe they can't.

So, what's the solution ? What do these people who make big software do ? Can this scenario ever be different ??

"Yes, sure it can be different, those people are just idiots!" Says someone smartly "They could've named the folders better!!"

Well, there is indeed a different scenario. But it is not like that smart one said.
This scenario is MUCH shorter than the former. It even consists of only one chapter.

To be con... Ops, sorry, I mean see the next article :D



.. more.

Unit Test

Testing, testing, and testing, the most important phase especially in case working with group

So, testing anything before delivering it, is equal to develop it itself. And to avoid what
happens in teams refer to TeamDevelopment to know.

In this article, I’ll demonstrate the basic test that applied on functions in particular public functions and the called Unit Test. (Private functions will be the next)

Walk with me to test these simple functions:

public static int Add(int op1, int op2)
{
return op1 + op2;

}
public static int Subtract(int op1, int op2)
{
return op1 - op2;

}
public static int Multiply(int op1, int op2)
{
return op1 * op2;
}public static int Divide(int op1, int op2)
{
return op1 / op2;

}
static void Main(string[] args)
{
Console.WriteLine(
"Add: " + Add(5, 0));
Console.WriteLine(
"Subtract: " + Subtract(5, 0));
Console.WriteLine(
"Multiply: " + Multiply(5, 0));
Console.WriteLine(
"Divide: " + Divide(5, 0));
}

Good, but something waiting you

So, I’ll try and catch the Divide function to not get this error.


But till now I give up fatal error, what about logic error, should I write a program to test my function to by passing different parameters each time, yes, I should, what Unit Test actually do is that plus some information.

So, in our Math library, right click on any public method then select Create Unit tests, a cute dialog appeared in tree mode (Project, namespace, Class, Members, Methods) we then select Divide method to apply unit test on it, NOO, do not press Ok, we almost done, below output project: select create a new visual C# test project, enter a name for this unit test project say, DivideMethodUnitTest.

Going to Solution Explorer, we notice a new project has been added, yes, it’s DivideMethodUnitTest test project. It contains a class called [YourClassNameTest]
open it

[TestMethod()]

public void DivideTest(){//some code}

It generates a method to test Divide method, and some code, we going to put our
edits

int op1 = 5; // TODO: Initialize to an appropriate value
int op2 = 0; // TODO: Initialize to an appropriate value

int expected = 0;
int actual;
actual = UnitTestSample.Math.Divide(op1, op2);


Right click on DivideMethodUnitTest test project and select Set as startUp project, Ctr + F5 Test result window opened to inform me that the test has been faild : double click on failed it opens new windows contains some information about what has happened

Error Message:
Test method DivideMethodUnitTest.MathTest.DivideTest threw exception: System. DivideByZeroException: Attempted to divide by zero..

So, what should I do now is to catch this error, after that I’ll go to retest Divide method, and Comment Assert.Inconclusive(“A method…..”);


int op1 = 5; // TODO: Initialize to an appropriate value
int op2 = 0; // TODO: Initialize to an appropriate value
int expected = 0;
int actual;
actual = UnitTestSample.Math.Divide(op1, op2);

Congrats, your test window tells you Passed, double click on passed, it tells you Standard Console Output: Attempted to divide by zero

By passing more parameters I can get the logic error and the unit test informs me about that
int op1 = 5; // TODO: Initialize to an appropriate value
int op2 = 1; // TODO: Initialize to an appropriate value
int expected = 2;
int actual;
actual = UnitTestSample.Math.Divide(op1, op2);

Again, the test has been failed double click on failed it opens new windows contains some
information about what has happened


Error Message:
Assert.AreEqual failed. Expected:<2>, Actual:<5>. UnitTestSample.Math.Divide did not return the expected value.

So, give the right op1, op2, and expected values, to check for logic error

.. more.

Friday, February 09, 2007

What's new in C# 3.0 ? Part 2

Consider the following , iam working in a project and i made a class and i made a simple method inside this class after small period i wanted to modify or add something in this method all what i have to do just back to the code of this function and modify its code , this is good

but what if this Method was in dll or was in a sealed class or i wanted to add method in a class of the primitive data types ? what can i do ?? the Extension Method was the Solution.

eg.. i want to add a small Method to the string type which return the second word in a given string
it will be like this

static class beta
{
public static string GetSecondWord(this string input)
{
string y="";
int count = 0;
bool flag = false ;
foreach (char c in input)
{
if (c == ' ')
{
flag = true;
count++;
}
if (flag == true && count == 1)
{
if( c != ' ')
y += c;

}
}
return y;
}
}


Notes :
  1. Make sure that the class is static
  2. Add this keyword before the type of the argument you want to extend.
so now you can write this code,

string x = "some string value";
string y = x.GetSecondWord();
That’s it.
See you in the Next Part isA


.. more.

Microsoft Unveils Windows Mobile 6

Microsoft has reportedly unveiled a new version of it's Windows Mobile operating system (OS), Windows Mobile 6, which has the look of Windows Vista, plus features that were earlier available only on PCs.
Windows Mobile 6 promises to take advantage of features in Exchange Server 2007, as also provide a richer e-mail experience on devices.
Reportedly, the new version includes Windows Live, offering instant messaging with more than one person at a time, as well as sending files/images and record/send voice notes.

Another new feature that comes from Exchange Server 2007 is the ability to reply to meeting requests made in Microsoft Outlook in various ways such as email reply and forwarding the message to someone else from the mobile device. Presently, a user can either just accept or decline the invite. It now also supports direct e-mail push technology to receive and send e-mails faster.

Windows Mobile 6 also introduces the ability to view e-mails in their original HTML Internet format with live Web links from smart phones.

Moreover, it allows viewing, navigating, and editing documents in original Word, Outlook, Excel, and Powerpoint format, without affecting tables, images, or text. Other features include support for synchronisation with Vista via the new Windows Mobile Device Center, improved search, encryption of data stored on removable memory cards, .NET Compact Framework, SQL Server, and usability of the device as a modem for notebook PCs.

According to Microsoft, Windows Mobile 6 will be available in the second quarter of 2007. And, manufacturers that are expected to come out with new devices supporting Windows Mobile 6 include Toshiba, Lenovo, LG Electronics, and Samsung Electronics.

the source :
http://www.techtree.com/India/News/Microsoft_Unveils_Windows_Mobile_6/551-79016-580.html

.. more.

Smart Client Application Part3

Office Smart Client Applications

Microsoft Office System 2003 provides you with a useful platform on which to build smart client applications, especially in an enterprise setting. With an Office smart client solution, you can integrate data sources, accessed through Web services, with the features of Word 2003, Excel 2003, InfoPath 2003, or other Office applications to develop smart client solutions.
Microsoft Office 2003 & 2oo7 has a number of key features and options for building smart client solutions. These include:

Smart tags: Smart tags give applications a way to provide users with context sensitive data pertaining to the contents of a document and allow them to easily see and use relevant information when working within a document.

Smart documents: Smart documents provide a more powerful way for the user to interact with documents and business Web services.

Microsoft Visual Studio® Tools for the Microsoft Office System: This suite of tools enables developers to create managed code Office smart client applications by using the Microsoft Visual Studio .NET development system.
Microsoft Office InfoPath™: InfoPath is an application that can gather structured data from the user by using a form-like interface. InfoPath provides support for XML Web services, a form-based user interface, and support for standard technologies such as WSDL and UDDI. InfoPath supports limited offline use by allowing the user to interact with the form when offline and then allowing the user to forward the form to a Web service when the user is online.

Mobile Smart Client Applications

Mobile smart clients are applications that run on smart devices — Pocket PCs, Smartphones, and other small form factor devices such as set-top boxes. These applications are developed using the .NET Compact Framework, which is a subset of the full .NET Framework.
The .NET Compact Framework has many of the features of the full .NET Framework, supports XML, and consumes Web services. It is optimized for use on small form factor devices, and it includes the Windows Forms designer for developing the user interface.
By using the Visual Studio .NET Smart Device Projects, you can develop smart clients that will run on the .NET Compact Framework. This approach allows you to develop, test and debug an application by using Visual Studio .NET on an emulator of the small form factor device. The use of an emulator significantly speeds up development and testing of these types of applications.
Mobile smart client applications are typically used to provide mobile access to essential data and services, or to collect and aggregate data when the user is mobile.
Examples of these types of applications are insurance and financial data-gathering applications, inventory management applications, and personal productivity management applications.
This guide does not specifically focus on mobile smart client applications, although many of the architectural issues and solutions that it discusses are relevant to smart devices.

.. more.

The RSS in 5 minutes

The RSS in 5 minutes

The abbreviation :
RSS is a abbreviation to (Rich Site Summary or Really Simple Syndication ) .

What is RSS service ?

RSS is a way to delivering the changing of a web site content . Many news-related sites, weblogs and any publishers syndicate their content as a RSS Feed to whoever wants it.( it is a XML format designed for sharing headlines and other Web content as in the example below).

To whom the service mainly ?
To all internet users that are visiting a large number of sites daily like (news sites , blogs and so on) that may be consumed the user’s time ,although not all sites update daily .From the RSS goals a try to decrease the internet traffic .

Are all sites support this service ?
no, until now , but most of sites support that .The number of sites offering RSS feeds is growing rapidly and includes big names like Yahoo News and Amazon.com.

Are this service need a fees ?
No , it is free 100% .

How can I use this service ?
By using programs called as feed readers or aggregators can check a list of feeds on behalf of a user and display any updated articles that they find. It is common to find web feeds on major websites and many smaller ones. There are two type of Feed readers or Aggregators

  • Standalone programs , programs embedd in web browsers .
  • Web Based Newsreaders like google reader and NewsGator Online they require no software installation and make the user's "feeds" available on any computer with Web access.

screen shot from google reader

Feed representation
On Web pages, web feeds (RSS) are typically linked with the word "Subscribe", an orange square, or a rectangle with the letters or . Many news aggregators such as My Yahoo! publish subscription buttons for use on Web pages to simplify the process of adding news feeds.


Fast RSS 2.0 syntax via example :
RSS defines an XML grammar (a set of HTML-like tags) for sharing news. Each RSS text file contains both static information about your site, plus dynamic information about your new stories, all surrounded by matching start and end tags.Each story is defined by an tag, which contains a headline TITLE, URL, DESCRIPTION and pubDate. Here's an example :


The resources :

http://en.wikipedia.org/wiki/RSS_%28file_format%29#Example_-_RSS_2.0

http://www.webreference.com/authoring/languages/xml/rss/intro/

http://www.whatisrss.com/

.. more.

Source Control and Team Development Part 2

see part 1 here

Chapter 4


They start thinking and analyze whose part is this?? Finally after a lot of argument, they decide that Person X and Y are responsible for that feature. Those two takes a side and start a conversation about who will modify which part of his code. They agree on some changes.

Each one goes to his PC, make the changes, and gets his file back to the main PC. "Stop! don't overwrite the old files!!" Someone shouts nervously "Backup the old folder first, as the new changes might break more than they fix so we can return to the old files". They create a new folder and name it "after changes". They put the whole project in it and then overwrite the old files in this with the new ones in this new directory. They try that feature and it works.

Chapter 5

While they are partying the success in having a running feature, by playing and resting. Someone was playing around with their application happy that they created something that works. Suddenly he gets another exception. "Oh damn it!" he says in dissatisfaction "can't we have a single happy moment that it works fine?!!".

He gathers the playing members and wakes the sleeping ones telling them the awful news. When he shows them the exception, silence goes around. Each one of themselves wishing that it is not his part so that he can get away with it and go continue resting.

Once again, after discussions, they made modifications, created a new folder, and fixed the problem.

Chapter 6

Six days, Eighteen folders later...

This day is the big day; the deadline. They should go and give a working copy of the project to the supervisor. After a long sleepless night, they've got so many folders with a lot of names like "after modification", "this one will work isA", "KEFAAYAAA", "at night", "3 am version", "last 1", last 2", "final", and "the final last one".

"YOU ARE A BIG *** **** MY OLD CODE HAD NO PROBLEM, WHY YOU MADE ME CHANGE IT", the other one replies "GO TO HELL, IF YOU WAS NOT THAT STUPID YOU WOULD HAVE KNOWN THAT EARLIER"...
[cut: after 15 minutes of yelling and thousands of dirty words]
"HEY PEOPLE, LISTEN TO ME!!! We've only 30 minutes to go and this must be fixed! Stop fighting like kids and do something!!" says someone impatiently.

They stop fighting keeping in mind they will complete it later. "The correction of this was in one of the old versions, from two days ago, I know it" says A "let me try". He takes over the keyboard again, keeps staring to the folder list trying to know which folder it was. He has 3 candidates, so he goes into each one of them opening the above-one-thousand-lines-of-code file and seeking for the correction desperately inside two or three functions in each file.

Finally after an hour and a half, and calls from friends at college saying that the professor is angry because there is no ready team and that he threatens to leave, and after a lot of "Com'on forget that stupid bugs, let's just go we7na we 7azzena", and after a lot of closed-eye concentration moments, he finds the correction and applies it to the final version of their application.

He runs the application to try it, and "DA-DOOOOM!!", the application doesn't work at all. You have seen so many different reactions in a single minute, someone sits on the floor crying, someone had his face blown in red out of anger, another one just hits his head against the wall.

To be continued...


.. more.

Source Control and Team Development

I haven't met a lot of teams who have actually used this feature. Since we are facing a new semester where we should start implementing our graduation project, I will introduce it.

You are in a team ? You divide the coding among you ? Then you definitely need Source Control.

Let me first tell you the scenario that you face each day of your team work:

Chapter One

Person A was assigned Class A, and Person B was assigned Class B. Till now everything is okay; each one works in him own home till he finishes, isn't it ? Now they've finished. It is time to integrate work into a single project to start testing. They sit together in a single place, each one with his computer. They gather the source files and put them on someone machine. They create a project and add the source files. They hit "compile". They get a huge list of errors.

Chapter Two

After the initial depression that their hopes and prayers that the project works from the first time painlessly have not been responded to, they start to fix the errors.

Each one boots his PC/laptop, gets the list of errors in his file, opens the IDE, and start fixing. After fixing all the errors he has, he gets his updated file to the main PC which they agreed to integrate their files using it. He does that by putting his file on a flash drive, or better, on the LAN.

Now the person on that PC, gets the new file and overwrites the old file. Then he tries to compile again, yet he still gets some errors from another one's file. He waits till that person gets his files and compiles. And "Hooray!!" it has compiled "Thank GOD!" they say in relief.

Chapter 3

Now it is time to launch the project and see if it is working. They double-click the executable, and "BOOOOM!" they get an exception even before they see the application window.

The exception is in Class A, "Who's class is this?!!" whispers someone in frustration. Person A replies "It's mine". He takes over the keyboard and traces till he find the error. Fixing it requires some modification in someone else's work. He modifies his own file, while that someone goes to his PC and fixes his own. He gets the file back, he put it in the project folder, overwriting the old file while interrupting the one who is still fixing his file on that PC.

Now they compile again, "Thank GOD there is no compile-errors this time" someone says to himself proudly. They run the application. They see the application window this time. They tried to use it but it doesn't make the expected behavior.

To be continued...

.. more.

Dream.Build.Play - XNA Gaming Code Contest

This is your chance to make the dream come true! Create an original game for Windows or Xbox 360™* using XNA Game Studio Express, a new tool from Microsoft®. Then enter your game in the Dream-Build-Play Challenge. Besides worldwide fame and recognition, you could also win some fantastic prizes!
DreamBuildPlay

About XNA Game Studio Express

XNA Game Studio Express is a revolutionary new tool that makesit easy to develop video games for both Microsoft Windows and Xbox 360™. Whether you’re an experienced developer or a total newbie, this innovative software, along with the XNA Creators Club, helps you to build the games of your dreams more easily.

First released in beta in August 2006, the XNA Game Studio Express is now available in its complete, final form—absolutely free. Download it today and create games for Windows at no charge. You can also build games for Xbox 360 with an active subscription to the XNA Creators Club.

To learn more about XNA Game Studio Express, head over to theXNA Developer Center. And come back to this contest web site

Hint:- This article was copied from Microsoft Student Partners Articles

.. more.

Thursday, February 08, 2007

Smart Client Applications Part 2

Types of Smart Clients

Smart client vary in design and implementation so they can take many different forms and styles. These forms can divide into three categories:
· Windows smart client applications
· Office smart client applications
· Mobile smart client applications

It’s common that smart client applications target on one or more of these platforms, depending on the users and functionality required .such flexibility is one of the strength keys of the smart client applications.

Windows Smart Client Applications

To develop a rich client application, you may think to develop applications that uses available system resources and that provides a rich user interface.
Windows smart client applications represent an evolution of traditional rich client applications.

A Windows smart client application is suitable in situations where an application needs to be deployed and accessed as a familiar desktop-type application. These types of applications typically provide the majority of their functionality themselves but can integrate with or coordinate other applications when appropriate. They provide application functionality tuned to particular tasks to provide specific or high-performance processing or graphical capabilities. Windows smart client applications are typically most suitable for applications that run on desktop, laptop, or tablet PCs.

These kinds of Windows smart client applications can be used in a wide variety of situations, for instance as LOB, financial, scientific, or collaborative applications.
Examples of these kinds of applications are Microsoft Money and the Microsoft Outlook® messaging and collaboration client.

.. more.

What's new in C# 3.0 ? Part 1

in the name of ALLAH

Sorry for being late to write this article.
as c# 3.0 came with many new features, i will discuss every one in a single post.

First i will discuss the difference between the static languages and dynamic languages
coz there are many of people say ( C# 3.0 became dynamic language ) and sure this is wrong

static lang. : - every variable has its own data type, and we can't give the variable any value not compatible with its type, eg .. if int x=8; we can't say x="fci-h"; this will raise an error.
examples for the static langs. : - c++ , java and c#.

dynamic langs. : - where the data type of any variable can be changed Automatically during the running time according to the value of this variable.
examples for the dynamic langs. : - python.

now lets start :D

implicitly typed local variables (using Var keyword)

In the implicitly typed local variables the data type is being inferred by the initialization value of this variable during the compilation time, eg…
var i = 5; //= int i = 5;
var s = "Hello"; //= string s = "Hello";
var d = 1.0; //= double d = 1.0;
var numbers = new int[] {1, 2, 3}; //= int[] numbers = new int[] {1, 2, 3};

and so on, but we must consider that all of this variables are local variables.

Some of implicitly typed local vaiables restrictions

1 : - it must be initialized during its declaration.
eg ... var x; // Error, no initializer to infer type from.

2 : - the initialization value can't be object or Collection value it can be new expression of objects or collection by using new keyword.
eg .. Var y = {1, 2, 3}; // Error, collection initializer not permitted.
var numbers = new int[] {1, 2, 3}; // Valid

3 : - it can't set to be null during the Compile time.
eg .. var z = null; // Error, null type not permitted.

4 : - we can't use var as a return type of any method.
Public var add ( int x,int y); // invalid.

That’s it.
See you in the Next Part isA

.. more.

Wednesday, February 07, 2007

العقده اتفكت

معليش يا جماعه انا هخرج عن التكنيكال وبعيد عن الانجليزي
يعني بالعربي انا فرحااااااااااان جداااا
العقده اتفكت اخيراً انتو متخيلين ايه اللي حصل النهارده 8 من حاسبان حلوان اتكرمو ..... لا مش بهزر بجد والله ده اللي حصل
3 MSPs (Mohamed Gamal, Mustafa Ossama, and Magdy Wagih)
Ramy Mahrous, Sherif Sakr, Islam Turk, Mona Essam, and Rowyda Mohamed
بجد مبروووووووووك للكل مش للي كسبو بس ... لا للكل علشان العقده اتفكت

يلا كفايه كده ... سلام

.. more.

Some of MDC Day 3 Sessions (Exclusive)

Now, you can download some of MDC Day 3 sessions, you can also download some of MDC Day 2 sessions from here and some of MDC Day 1 sessions from here (I am sorry, you've to have Office 2007 or compatibility package to view it you can download it from here)

Web Client Software Factory
Download

Interop with C++
Download

Visual C++ 2005 IDE
Download

p&p Mobile Dev
Download

As soon all MDC presentations be available on MDC site we will announce that

.. more.

Tuesday, February 06, 2007

Advanced C++ part 6 : Advanced Memory Management part 3 : overriding new and delete, and why you would need that

You can override new and delete for a certain class. So your operators will be called only if that class (or its derived classes) is being dynamically allocated. You can also override the global new and delete so your operators will be called on any dynamic allocation that occurs in your program.

Question:

Why would I need to override new and delete?


Answer:
For global or class-based:
In case you want to implement your garbage collector, or whatever application that needs to keep track of memory allocations (profiler, reference counter, etc.)

For class based:
For some classes you might need to allocate them on a certain memory location (like video memory or a shared memory area, I don't know if you might need that on a memory-mapped file or not.)

Question:

How to override it then?

Answer:

This is just example code to show you how you can do it, not how you should do it.

Global

void* operator new (size_t size)
{
void* allocated_mem = malloc(size);
if (!allocated_mem)
throw std::bad_alloc(); // if failed to allocate, throw bad_alloc exception
return allocated_mem;
}
void operator delete (void *pointer)
{
free(pointer);
}

Class-based

Definition
static void* operator new (size_t size);
static void operator delete (void* p);
Implementation

void* Class1::operator new (size_t size)
{
void* allocated_mem = malloc(size);
return allocated_mem;
} // At this point, Class1 default constructor get called (automatically)


// At this point Class1 destructor gets called (automatically)
void Class1::operator delete (void* pointer)
{
free(p);
} // At this point Class1 destructor gets called (automatically)

Next article isA will take about placement new.

Further reading:
http://www.informit.com/guides/content.asp?g=cplusplus&seqNum=40&rl=1

.. more.

MDC 2007 between good and bad

in the name of ALLAH

as all of us know that tom is the last day in the MDC , but i wanna Know your opinions about it
Is the MDC was useful for You This year ? ( plz explain the negative and the positive points in your opinion )
about my opinion ...

Negative : -
1 :- Few new subjects to explain ( in a comparison with MDC 2006 ).
2 :- Many sessions about VSTS.
3 :- Not all of the speakers were good.
4 :- they didn't speak about C# 3.0 and Poor about LINQ project.

Positive : -
1 : - i attended the Some of useful sessions like ( Phoneix and VSTS in day0 by Mr - Ahmed Bahaa )

2 : - the food was delicious :D.

waiting ur opinions

.. more.

Some of MDC Day 2 Sessions (Exclusive)

Now, you can download some of MDC Day 2 sessions, you can also download some of MDC Day 1 sessions from here

Updated in 7/2/2007

(I am sorry, you've to have Office 2007 or compatibility package to view it you can download it from here)

Overview of Team Foundation Server by Sachin Rekhi
Download part1, part2, and part3

Delving into Visual Studio 2005 Team Edition for Software Architects by Abhishek Mathur
Downlaod

Overview of LINQ by Charlie Calvert
Download

T-SQL Tips & Techniques by stephen Forte/Richard Campbell
Download

SaaS Architecture by Edward Jezierski
Download

Server Control Development for ASP.NET-AJAX style updating to the content by Patrick Hynds
Session and DEMO

Delving into Visual Studio 2005 Team Edition for DB PRO by Sachin Rekhi
Download

Delving into Visual Studio 2005 Team Edition for Software Developers by Abhishek Mathur
Download

Introduction to Windows Presentation Foundation VS Designer and Expression Blend by Dina Lasheen
Download

SQL CLR in Action by stephen Forte/Richard Campbell
Download

.. more.

Monday, February 05, 2007

Some of MDC Day 1 Sessions (Exclusive)

Now, you can download some of MDC Day 1 Sessions
(I am sorry, you've to have Office 2007 or compatibility package to view it)

Updated on 6/2/2007

Overview of Microsoft Solutions Framework by Rafal Lukawiecki
Download

Profile Guided Optimization by Andrew Pardoe
Download

Windows CardSpace and Identity Metasystem by Rafal Lukawiecki
Download

Overview of Microsoft Dynamics from a developers prespective by Rafal Lukawiecki
Download

Phoneix Andrew Pardoe
Download

Agile Software Development by Edward Jezierski
Download

Black Belt ASP.NET Tips & Tricks by Patrick Hynds
Session and DEMO

If you've any trouble downloading any session, please comment your compliment

.. more.

MDC Day 1 Notes 1

in the name of ALLAH

this is the Topics Which Patric Was Speaking about today in Asp.Net tips\tricks Session

1 : - The intermediate Page
2 : - Focus Of The First Text To Write
3 : - Asp.Net Support RSS
4 : - maintain The Scroll Position After The Post Back Process
5 : -Membership Provider
6 : - Control The Authentication Mode.

Thats it

.. more.

Sunday, February 04, 2007

Differences between Pointers and References

1- Reference must be initialized and assigned to the object it references to, like

int &ref_integer ; // error




int number;

int &ref_integer = number; // right

pointers have not to point to something when declared, it’s enough to mention to which type it points

int *p_integer; // right


But also in reference you do not need to mention to which object or variable it references iff (if and only if) you make it external

int &ref_integer ; // error

extern int &ref_integer ; // right

2- Reference can not be reinitilized
int number, anotherNumber;

int &ref_integer = number; // right


&ref_integer = anotherNumber; //error


where pointer can be.

int number, anotherNumber;


int* p_integer;

p_integer = &number;


p_integer = &anotherNumber;


3- ‘&’ operator when is used with reference it returns the address of the variable the reference references, like

int integer;

int &ref_integer = integer;


cout<<&integer<<endl; // prints XXXXXXX

cout<<&ref_integer<<endl; // prints XXXXXXX


but in pointers, when ‘&’ operator is used it references to the address of the pointer not the address of the varible it poitns to
int* p_integer;

p_integer = &integer;

cout<<&integer<<endl; // prints XXXXXXX

cout<<&p_integer<<endl; // prints YYYYYYY


.. more.

Saturday, February 03, 2007

Explore the Java Platform part2 - Resources

Explore the Java Platform
Part 2
Resources


In this part we are going to define the resources used to develop and run a java application.

2. Java Runtime Environment (JRE)
The Java Runtime Environment, or JRE, is a software bundle from Sun Microsystems that allows a computer system to run a Java application. Java applications are in widespread use and necessary to view many Internet pages.
The software bundle consists of the Java Virtual Machine and the application and programming interface (API). The API provides a set of standard class libraries. The virtual machine and API have to be consistent with each other and are therefore bundled together as the JRE. This can be considered a virtual computer in which the virtual machine is the processor and the API is the user interface. Sun also distributes a superset of the JRE called the Java 2 SDK (more commonly known as the JDK), which includes development tools such as the Java compiler, Javadoc, and debugger.
2.1 Components of the JRE

2.1.1 Java Virtual machine (JVM)
A Java Virtual Machine (JVM) is a virtual machine that interprets and executes Java bytecode. This code is most often generated by Java language compilers, although the JVM can also be targeted by compilers of other languages. JVM's may be developed by other companies as long as they adhere to the JVM standard published by Sun.
The JVM is a crucial component of the Java Platform. The availability of JVMs on many types of hardware and software platforms enables Java to function both as middleware and a platform in its own right. Hence the expression "Write once, run anywhere." The use of the same bytecode for all platforms allows Java to be described as "Compile once, run anywhere", as opposed to "Write once, compile anywhere", which describes cross-platform compiled languages.

2.1.2 Libraries
Java libraries are the compiled byte codes of source code developed by the JRE implementer to support application development in Java. Examples of these libraries are:

The core libraries, which include:
-Collection libraries which implement data structures such as lists, dictionaries, trees and sets
-XML Parsing libraries
-Security
-Internationalization and localization libraries

The integration libraries, which allow the application writer to communicate with external systems. These libraries include:
-The Java Database Connectivity (JDBC) API for database access
-Java Naming and Directory Interface (JNDI) for lookup and discovery
-RMI and CORBA for distributed application development

User Interface libraries, which include:
-The (heavyweight, or native) Abstract Windowing Toolkit (AWT), which provides GUI components, the means for laying out those components and the means for handling events from those components
-The (lightweight) Swing libraries, which are built on AWT but provide (non-native) implementations of the AWT.
-APIs for audio capture, processing, and playback

There are more libraries than mentioned above, but the three categories mentioned above are the main categories.

2.1.3 Plugins
Plugins enable a special kind of java applications called “Applets” to be run in Web Browsers. We will talk about applets in coming articles.

2.1.4 Java Web Start
Java Web Start is a framework developed by Sun Microsystems which allows application software for the Java Platform to be started directly from the Internet using a web browser. Unlike Java applets, Web Start applications do not run inside the browser, and the sandbox in which they run does not have to be as restricted, although this can be configured. One chief advantage of Web Start over applets is that they overcome many compatibility problems with browsers' Java Plugins and different JVM versions. On the other hand, Web Start programs cannot communicate with the browser as easily as applets. To assist migration, a Java Applet can also be used as a Java Web Start application.

2.1.5 Licensing and documentation

2.2 APIs
The classes in the Java APIs are organized into separate groups called packages. Each package contains a set of related interfaces, classes and exceptions. Refer to the separate platforms for a description of the packages available.
Sun has defined three platforms targeting different application environments and segmented many of its APIs so that they belong to one of the platforms.
The platforms are:

Java Platform, Micro Edition (Java ME) — targeting environments with limited resources like cellular phones.
Java Platform, Standard Edition (Java SE) — targeting workstation environments.
Java Platform, Enterprise Edition (Java EE) — targeting large distributed enterprise or Internet environments.

As mentioned before, java platform is very wide in terms of functionality; in addition, java is an open source platform which makes it possible for any one to edit and add more functionality, so, in order to utilize this feature, there is a standard process defined to allow interested parties to be involved in the definition of future versions and features of the Java platform. This process is called the Java Community Process (JCP).

The JCP involves the use of Java Specification Requests (JSR), which are formal documents that describe proposed specifications and technologies to be added to the Java platform. Formal public reviews of JSRs are conducted before the JSR becomes final and is voted on by the JCP Executive Committee. A final JSR provides a reference implementation which provides a free implementation of the technology in source code form and a Technology Compatibility Kit to verify the API specification.

Extensions and related architectures
The extensions to standard Java are typically in javax.* packages. They are not included in the JDK or JRE. Extensions and architectures closely tied to the Java programming language include:
Java EE (previously J2EE) (Java Platform, Enterprise Edition—for distributed enterprise applications)
Java ME (previously J2ME) (Java Platform, Micro Edition—for PDAs and cellular phones)
JMF (Java Media Framework)
JNDI (Java Naming and Directory Interface)
JSML (Java Speech API Markup Language)
JDBC (Java DataBase Connectivity)
JDO (Java Data Objects)
JAI (Java Advanced Imaging)
JAIN (Java API for Integrated Networks)
JDMK (Java Dynamic Management Kit)
Jini (a network architecture for the construction of federated distributed systems)
Jiro
Java Card (Java for smart cards)
JavaSpaces
JML (Java Modeling Language)
JMI (Java Metadata Interface)
JMX (Java Management Extensions)
JSP (JavaServer Pages)
JSF (JavaServer Faces)
JNI (Java Native Interface)
JXTA (Open Protocols for Peer-to-Peer (P2P) Virtual Network)
Java 3D (A high level API for 3D graphics programming)
JOGL (Java OpenGL—A low level API for 3D graphics programming, using OpenGL)
LWJGL (Light Weight Java Game Library—A low level API providing access to OpenGL, OpenAL and various input devices)
OSGi (Dynamic Service Management and Remote Maintenance)

2.3 Summary and coming articles
This article can be considered the entry point for discussing the java platform in a more detailed view. We described the components of the JRE including the JVM and APIs.
Starting from the next article, we are going to discuss the main three platforms of java one by one showing the functionality of each platform.

.. more.

Friday, February 02, 2007

How to Install IIS on Vista®

The way is bit different from Windows XP, to install IIS on Vista

Go to your control panel then Programs then open Programs and features from right pane tasks select Turn windows features on or off.
Or
Go to your control panel then switch to Classic view then open Programs and features from right pane tasks select Turn windows features on or off.

Hint
Till now, this step is equivalent to what we was doing in Windows XP (Control panel, add or remove program then add or remove windows components).

To install IIS, select Internet Information Service, then press Ok, Congrats you did and you do not need to have your Windows CD in your CD room.

To configure your IIS
Go to your control panel then System and Maintenance then open Administrative Tools then select IIS Manager. (You may find IIS6 Manager, this indicates that you’ve installed IIS 7 and IIS 6 and for each its configuration)
Or
Go to your control panel then switch to Classic view then open Administrative Tools then select IIS Manager. (You may find IIS6 Manager, this indicates that you’ve installed IIS 7 and IIS 6 and for each its configuration)

.. more.

Smart Client Applications Part 1

Hey all that’s the first technical article to me, so I hope it is good.

First of all, we have 2 kinds of applications:
Thin Clients ->Browser Clients that deal with Server Network
Rich Clients -> Windows Applications –Desktop Applications

So the smart client technology do the following take the advantage of the thin client applications and the advantage of the rich client applications integrated with XML webservices.

Smart Client: Applications and devices that can take advantage of the power of local processing, but have the flexibility of Web-based computing.

So because of the flexibility of smart client applications , we have to talk about the characteristics of the smart client. If any application have these characteristics so it can be called smart:

Utilizes Local Resources

A smart client application always has code artifacts on the client that enable local resources to be utilized. What do we mean by local resources? We mean everything from hardware to software resources. A smart client may take advantage of the local CPU or GPU, local memory or disk, or any local devices connected to the client, such as a telephone, bar-code/RFID reader, and so on. But it may also take advantage of local software, such as Microsoft Office applications, or any installed line-of-business (LOB) applications that interact with it.

Connected

Smart client applications are never standalone and always form part of a larger distributed solution. This could mean that the application interacts with a number of Web services that provide access to data or an LOB application. Very often, the application has access to specific services that help maintain the application and provide deployment and update services.

Offline Capable

Because they are running on the local machine, one of the key benefits that smart client applications offer is that they can be made to work even when the user is not connected. For applications running in occasional or intermittent connectivity situations, such as those used by traveling workers or even those running on laptops, tablets, PDA's, and so on, where connectivity cannot be guaranteed at all times, being able to work while disconnected is essential. Even when the client is connected, the smart client application can improve performance and usability by caching data and managing the connection in an intelligent way.


Intelligent Install and Update

Smart client applications manage their deployment and update in a much more intelligent way than traditional rich client applications. The .NET framework enables application artifacts to be deployed using a variety of techniques, including simple file copy or download over HTTP. Applications can be updated while running and can be deployed on demand by clicking on a URL. The Microsoft® .NET Framework provides a powerful security mechanism that guarantees the integrity of the application and its related assemblies. Assemblies can be given limited permissions in order to restrict their functionality in semi-trusted scenarios.

Client Device Flexibility

The .NET Framework together with the .NET Compact Framework provides a common platform upon which smart client applications can be built. Often, there will be multiple versions of the smart client application, each targeting a specific device type and taking advantage of the devices unique features and providing functionality appropriate to its usage.




.. more.

Thursday, February 01, 2007

Linux How to: Install Speedtouch ADSL modem

In this article, i am going to explain how to install your Speedtouch ADSL modem on linux, so that you can start a new experience with linux and open source.

At first, you need to download the firmware for the modem from here. it contains many files for different versions of speedtouch. The file we need specifically is ZZZL_3.012. You also need to download the firmware extractor from here. Ofcourse you have to dowload them from Windows :D.

Extract the firmware

After downloading those files, you need to open a terminal and copy and paste these commands:

unzip SpeedTouch330_firmware_3012.zip &&
chmod +x firmware-extractor &&
./firmware-extractor ZZZL_3.012

Secrets

Then, open a text editor and copy n' paste this line:

"username@isp" "*" "password"

Ofcourse, you need to substitute the username and password with the ones given by your ISP. Then save this file in your home folder and call it secrets

If your ISP uses PPPoE skip down to PPP over Ethernet

PPP over ATM

Open a text editor again and copy and paste this:

noipdefault
defaultroute
user 'username@isp'
noauth
updetach
usepeerdns
plugin pppoatm.so
0.00

### If the firmware loads and pppd won't
### connect uncomment this option to make
### pppd be more verbose in the system log

# debug

### For more details (and more options)
### read man pppd

Replace the username and ISP with the real values. Also you need to replace the 0.00 with VP/VC value (determined by your ISP, In case you have subscribed with Tedata the value is 0.35).

Save this file in your home folder with the name speedtch

Go to "We are almost done"

PPP Over Ethernet

Open a text editor again and copy and paste this:

noipdefault
defaultroute
user 'username@isp'
noauth
updetach
usepeerdns
plugin rp-pppoe.so
nas0

### If the firmware loads and pppd won't
### connect uncomment this option to make
### pppd be more verbose in the system log

# debug

### For more details (and more options)
### read man pppd

You have to substitute the username and ISP for the real values.

Save this file in your home folder with the name speedtch

We are almost done

You need to become root(log on as root or type su then enter the root password), open a terminal and copy and paste those commands:

cp speedtch-{1,2}.bin /lib/firmware &&
install -m400 speedtch /etc/ppp/peers &&
install -m400 secrets /etc/ppp/chap-secrets &&
install -m400 secrets /etc/ppp/pap-secrets

Now reboot and you are done :)

Connect to the internet

Open a terminal and type this command:

pppd call speedtch

Congratulations, you are finally connected :)

Notes:

  • I have performed this tutorial in OpenSUSE 10.2. The link mentioned in the references below mentions the steps for other distros, although it should be almost the same.

  • This tutorial applies to Speedtouch 330 version, other versions may need other firmware. If so replace "ZZZL_3.012" with the firmware you want to try in the script that extracts the firmware. You may try other firmware files from the same zip file you have downloaded above.
References:
http://www.linux-usb.org/SpeedTouch/index.html

.. more.

Casting in C++

There are 4 types to convert from type to type (Casting) as demonstrated below

1. The standard cast to convert one type to another.
2. There is a special cast to do away with the const type-modification
3. A third cast is used to change the interpretation of information
4. There is a cast form which is used in combination with polymorphism

1 - The first (static_cast) is to convert from one type to another like from double to int.
Example 1
int anInteger = 0;
double aDouble = 12.75;
anInteger = static_cast<int>(aDouble);

Example 2
What’s the situation in where the arithmetic assignment operators used
in mixed type like:
anInteger+= aDouble; //anInteger = anInteger + aDouble;
Let’s see what happens behind the scene
anInteger = static_cast<int>(aDouble) + anInteger; //done if you cast anInteger to double

2- The second (const_cast) is to convert from a constant variable to a non constant variable.

Example 1
If I’ve function like that
void ShowText(char *c)
{
printf("%s\n", c);
}

And I want to pass it a parameter like that
char const fci[] = "Hello, FCI-H!";
ShowText(fci); //error
If I try that, Compile complains and shoots this error “Error
1 error C2664: 'ShowText' : cannot convert parameter 1 from 'const char [14]'
to 'char *'”

So, we should do that
ShowText(const_cast<char*>(fci)); //no error and it prints Hello, FCI-H!

3- The third (reinterpret_cast) is to convert from any integral type to any pointer type and vice versa, but it does not work with constants (see No. 2). Plus it’s very unsafe, try to not use it.There is a practical use of reinterpret_cast is in hash function, because it generates two indexes for two different values rarely end up with the same index and it’s allow pointers to be treated as integral type.

Example 1
void pointerToInteger(void *ptr)
{
int aNumber = reinterpret_cast<int>(ptr);
printf("%d\n", aNumber * 2 );
}
Your assignment is to know how to call this function :p

4- The fourth is (dynamic_cast) is to convert from base class pointer to derived class pointer or from base class reference to derived class reference. But it should be one virtual function at least in the base class. (I’ll talk about it in details in the next article after Allah willing).

To be continued...

.. more.

ما هي تفاصيل خدمه AdSense الجزء الثاني

=================
الجزء التاني

كيفيه اختيار جوجل للاعلان :
جوجل يمتلك قاعده بيانات رهيبه في جميع الاقسام و الافرع و التخصصات . تحتوي مدي واسع من الشركات كبيرة كانت او صغيرة . و مصنفه جغرافيا و عالميا ؛ كما يمكن تصنيفها حسب اللغه المستخدمه ايضا .
جوجل يفهم محتواي الصفحه المتواجد فيها فهما دقيقا حتي لو تواجدت كلمات لها معاني عديده فان جوجل يختار انسبها للصفحه الحاليه.





وسيله اخري لزياده الربح :
ان وضع محرك البحث جوجل في موقعكم يزيد من احتماليه الربح . بعيدا من انه سوف يزيد حرية زائر الموقع في البحث فإنه لو اختار احد الاعلانات كما هو موضح في الصورة فستزيد من معدل الربح .


التحكم الشخصي في الاعلانات المعروضه
تتم هذه الخطوه بين جوجل ومستخدم الخدمه بتحديد بعض الفلاتر كوسيله لاتاحه المزيد من المرونه لصاحب الموقع التي تمنع اعلانات معينه كاعلانات للشركات المنافسه مثلا او تحدد اعلانات معينه .


Competitive Filter فلترةاعلانات الشركات المنافسه .



Contextual Filterفلتره الاعلانات الغير مرغوب فيها .



Editorial Review


جميع اعلانات جوجل المعروضه في الموقع يتم عرضها و الموافقه عليها قبل عرضها



Filters keep out inappropriateand competitive ads: Customisable default ads


امكانيه اختيار الاعلانات التي سوف تعرض في حاجه فشل جوجل في عرض اعلانات تتوافق مع الصفحه


كما يتيح لك جوجل اختيار المنظر العام لاعلان و اختيار لون مناسب له(كما موضح في الصورة) حتي يتوافق مع لون الصفحه في الموقع و يتيح لك جوجل العديد من المميزات الاخري .


هذه المعلومات هي مبنيه من فهمي لهذه الخاصيه .ولا يتم اعتمادها بشكل رسمي .
المصدر
:

http://www.google.com/services/adsense_tour

.. more.

ما هي تفاصيل خدمه AdSense الجزء الاول

بسم الله الرحمن الرحيم .
اول مقاله تقنيه باللغه العربيه في عالم الويب من صنيعي انا . :)
محدش يسألني عملت كده ليه ؟ لاني مش عارف انا عملت كده ليه :) . كل الي فاكرو وقت كتابه المقال اني كنت زهقان و مش لاقي حاجه اعملها بالليل .
لو حد ليه تعليق علي المقاله.. انا برحب بيه .

جوجل . كلمه لا يزيد عمرها عن العشر سنين و رغم ذلك أثبتت نفسها أمام الملايين يوميا . بدأت مشوارها و كفاحها السريع بمحرك بحث غني عن التعريف لتنشر به كلمه جوجل امام العالم و لتصبح الكلمه الوحيده التي يهتف بها العالم اجمع في وقت اختلف فيه العالم علي كل شئ . استطاعت كلمه جوجل ان تلفت جميع الانظار و بجدارة و تعرض عليهم العشرات من الخدمات لتحتل بها نفس هذا التقدير الرهيب .
اليوم اعرض لكم خدمه جديدة نسبياً لجوجل استطاعت بها جوجل حفر اسمها في جداران العديد من المواقع التي لا
تملكها . إنها خدمه
AdSense .
اعتقد أن الجميع قد سمع عن هذه الخدمة في الاونه الأخيرة .
و إليكم هنا بالتفصيل .

ما هي ال
AdSense ؟
هو برنامج اعلاني يهدف للتوليد ايرادات (اموال) من كل صفحه في الموقع الذي ستتواجد فيه هذه الخدمه في موقعك .
ال AdSense
هو عبارة عن مجموعه من صور و الروابط الالكترونية سيعرضها جوجل في موقعك ؛ هذه الروابط مرتبطه بمحتوي
الصفحه المتواجد فيها ال
AdSense

كما في الصورة .فمثلا لو كانت الصفحه الحاليه في موقعك تتحدث عن البورصه ستجل الاعلانات كلها المتواجده في هذه الصفحه ايضا مرتبطه بالبورصه .
يتيح لك جوجل لك اختيار المكان المناسب في موقعك لوضع الاعلان و تفعيل الخدمه وكما لك مطلق الحريه في تفعيل هذه الخدمه في بعض او كل صفحات الموقع .



صلاحيه الاستخدام
تستطيع استخدام الخدمه ليوم او شهر ؛ كما تشاء فلن تخسر شئ فهذا اختيارك .

معرفه الارباح وطريقه الربح :
جوجل يحسب ارباحك في حاله ضغط احد الزوار علي احد الاعلانات من موقعك و كل الف عرض للاعلان في موقعك ايضا.
وكما هو موضح بالاسفل جوجل يعرض ليك الربح اليومي علي شكل تقرير
.







سهوله الاستخدام

كل ما عليك فعله لربط موقعك بهذه الخدمة . هو نسخ و لصق كود جاهز معد من قبل جوجل للشخص طالب الخدمة .


نهايه الجزء الاول
:)
يا رب يعجبكم

.. more.