Tuesday, August 26, 2008

Shallow Copy vs Deep Copy in .NET

Posted on/at 6:28 AM by Admin

hi Developers ,

in that post, i am describing the difference between shallow and deep copy by the use of C# language.

shallow and deep copy are used for copying data between objects.

Shallow Copy:

creating a new object, and then copying the nonstatic fields of the current object to the new object.

If a field is a value type --> a bit-by-bit copy of the field is performed

If a field is a reference type --> the reference is copied but the referred object is not; therefore, the original object and its clone refer to the same object.

in C# and VB.NET, shallow copy is done by the object method MemberwiseClone()

Example:

the following are clsShallow class to be cloned which include value types (like Age) and ref types (like EmpSalary is a class)

public class clsShallow
{
public static string CompanyName = "My Company";
public int Age;
public string EmployeeName;
public clsRefSalary EmpSalary;

public clsShallow CreateShallowCopy(clsShallow inputcls)
{
return (clsShallow)inputcls.MemberwiseClone();
}
}
public class clsRefSalary
{
public clsRefSalary(int _salary)
{
Salary = _salary;
}
public int Salary;
}

now, let us debug and trace the outputs to do the shallow copy by the use of CreateShallowCopy() method

first, use the following code to call the CreateShallowCopy method from other classes

// Creates an instance of clsShallow and assign values to its fields.
clsShallow objshallow = new clsShallow();
objshallow.Age = 25;
objshallow.EmployeeName = "Ahmed Eid";

// add the ref value to the objshallow
clsRefSalary clsref = new clsRefSalary(1000);
objshallow.EmpSalary = clsref;

// Performs a shallow copy of m1 and assign it to m2.
clsShallow m2 = objshallow.CreateShallowCopy(objshallow);

// then modify the clsref salary value to be 2000
clsref.Salary = 2000;

// so the m1 object salary value become 2000
int EmpSalary = objshallow.EmpSalary.Salary;

After assigning the values (value and ref types ones) to the object objShallow and before doing the shallow copy
the values are : (for the current object value)
Age : 25 (value type)
EmpSalry: has salary value of 1000 (ref type)

shal1

then do the shallow copy and modify the value of clsref.salary ,reference field type, then check the values of m2 , new created object. (ref and value fields) again

shal2

the values are : (for the new created object)
Age : 25 (value type) a new copy of the objShallow object
EmpSalry: has salary value of 2000 (ref type) a refernce to objShallow.EmpSalry object, which is also referenced to the clsref object.

Note: values of m2.EmpSalry and clsref are the same after modifying the clsref values. (reference type concept)

Deep Copy:
creating a new object, and then copying the nonstatic fields of the current object to the new object.

If a field is a value type --> a bit-by-bit copy of the field is performed
If a field is a reference type --> a new copy of the referred object is performed.

Note: the classes to be cloned must be flagged as [Serializable]

Example:

the following are clsDeep class to be cloned which include value types (like Age) and ref types (like EmpSalary is a class)

[Serializable]
// serialize the classes in case of deep copy
public class clsDeep
{
public static string CompanyName = "My Company";
public int Age;
public string EmployeeName;
public clsRefSalary EmpSalary;
public clsDeep CreateDeepCopy(clsDeep inputcls)
{
MemoryStream m = new MemoryStream();
BinaryFormatter b = new BinaryFormatter();
b.Serialize(m, inputcls);
m.Position = 0;
return (clsDeep)b.Deserialize(m);
}
}

[Serializable]
public class clsRefSalary
{
public clsRefSalary(int _salary)
{
Salary = _salary;
}
public int Salary;
}

now, let us debug and trace the outputs to do the deep copy by the use of CreateDeepCopy() method

first, use the following code to call the CreateDeepCopy method from other classes

// Creates an instance of clsDeep and assign values to its fields.
clsDeep objdeep = new clsDeep();
objdeep.Age = 25;
objdeep.EmployeeName = "Ahmed Eid";

// add the ref value
clsRefSalary clsref = new clsRefSalary(1000);
objdeep.EmpSalary = clsref;

// Performs a shallow copy of m1 and assign it to m2.
clsDeep m2 = objdeep.CreateDeepCopy(objdeep);

// then modify the clsref salary value to be 2000
clsref.Salary = 2000;

// so the m1 object salary value become 2000
int EmpSalary = objdeep.EmpSalary.Salary;

After assigning the values (value and ref types ones) to the object objDeep and before doing the deep copy

the values are : (for the current object value)
Age : 25 (value type)
EmpSalry: has salary value of 1000 (ref type)

deep1

then do the deep copy and modify the value of clsref.salary ,reference field type, then check the values of m2 , new created object. (ref and value fields) again

deep2

the values are : (for the new created object)
Age : 25 (value type) a new copy of the objDeep object
EmpSalry: has salary value of 1000, a new copy of the objDeep object

Note: values of m2.EmpSalry and objDeep.EmpSalary are not the same as deep copy creates a new object of the reference type (objDeep.EmpSalary) in m2.EmpSalry. but clsref and objDeep.EmpSalary are the same (Refernce type concept)

With the help of Google I found a very smart method for performing deep copy. Its performance is good than the one i used on that post.


/// <summary>
/// Using generics will solve some performance issues
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="item"></param>
/// <returns></returns>
public static T DeepCopy<T>(T item)
{
BinaryFormatter formatter = new BinaryFormatter();
MemoryStream stream = new MemoryStream();
formatter.Serialize(stream, item);
stream.Seek(0, SeekOrigin.Begin);
T result = (T)formatter.Deserialize(stream);
stream.Close();
return result;
}

i hope that post help you to deeply understand the difference b/w shallw and deep copy in .NET

Ahmed Eid

Sunday, August 24, 2008

Code Review Checklist

Posted on/at 4:43 AM by Admin

By the use of coding standards as i disscussed here View , developers can review their tasks using the following check list:

.NET Coding Standards

Posted on/at 2:00 AM by Admin

Hi .NET developers and team leaders,

According to my practical work on Microsoft Visual Studio.NET, it were obligated to use standards for coding, design and implementation. I readed carefully about standards and naming conventions from multiple sources and summarized it then added some modifications to unify our .NET development among the team.

This topic defines some of the standards related to the formatting, naming conventions, and organization for any code written for software development.

All developers implementing HTML, Active Server Pages (ASP) and .NET application should comply with the standards outlined below. Also, each Development manager should strictly enforce these standards during all phases of application development. This document should be used as a guiding principle during all source code reviews and sign-off.

the following are some headlines of our coding standards to be discussed here:

  1. Documentation
  2. Naming Conventions
  3. Hints and Remarks

OK, lets start describing the following items:

  1. Documentation

You should know that work on a team and may be you leave them for another company, so you should document your work task by task. I followed a lot of problems to understand friends' code on my team after moving to another company. Story

I were working on Human resource management system on my company, and after movement of some colleagues to another company i faced difficulty to understand their codes especially the ones which are not documented. so i asked from my team leader to re-implement some works of it and he approved my point.

///////////////////////////////////////
/// creator name: Ahmed Eid
/// creation date: 1 jan 2008
/// description : Handles the submittion of Adduser.aspx
/// edited By : Hany Mohamed
/// updated date: 2 feb 2003
/// reason for update: fixing number over flow bug
///////////////////////////////////////

Note: if developers use visual source safe or TFS , it will be easy to track the changes of file modifications.

  • In line Comments developers should document methods and each line code need to documented within classes.

    Method documentation:
/// <summary>
/// Here is the description of method functionality
/// </summary>
/// <param name="Param1">describe each param usage</param>
/// <param name="Param2">describe each param usage</param>
/// <param name="Param3">describe each param usage</param>
public void DoSomeThing(int Param1,string Param2,out int Param3)
{
// do somethiong method
}

Note: if you finished method signature, only write /// on the line above your method to prepare the documentation as above.

Inline documentation:

if the code lines need to be described, you must do to be reference for all of reviewing that code ( may be you return back to your code but you could not understand it smile_regular )

2. Naming Conventions

visual studio.NET

    • Files Name Files should be named a descriptive name and they should not be named with numbers for example: submitorder1.asp , submitorder2.asp … Descriptive file name samples:


    • adduser.aspx
    • viewUserDetails.aspx
    • viewAccoutStatus.aspx
    • reportUsersPerCountry.aspx
    • For shadow pages(pages that execute code on the server and redirects the user) acAdduser.aspx (ac is for action)reGenerateAccessXML.aspx

According to the use of DNN we will add a prefix [ mod_ ] to user controls names if this UC will be defined as DNN module Ex. Mod_ adduser.ascx

    • Files Structure A well structure should always be in place; the files should not all be under one folder. Structure can be defined according to factors:
      • Based on application business purpose normally for public site
    • / (Root)

      • Product-X
        • Admin
          AddUser.aspx
          • EditUser.aspx
          • ....
        • Registeration
          • Register.aspx
          • Confirm.aspx
          • EditUser.aspx
          • ....
      • Product-Y
        • ...
      • Component-X (may be other .NET application added to solution)
        • ...
      • Reports
        • ...
      • ...etc

    • Class Name: Class Names should be Nouns and the First letter of the class name should be Caps and the rest of the name should be small.

Samples:

  • Connection (good old ADO connection)
  • User
  • Product This class names shows that a class is an entity that performs an action. Not the action itself.

Hence class names like these

  • ManageUsers
  • DbFunctions

Naming above gives the idea of something wrong in the design/implementation itself.
Correct naming is:

  • Users or UserManagement
  • DbAccessLayer

This case pplies on everything (almost) except for the static classes like those who has global functionality. And supports other class

    • Methods Names Methods Names should be verbs and it should be written with the Camel Naming convention system which is to write every first letter of the name with CAPS and the rest small without the verb itself example: GetUserInfo(), GetUserPassword()
    • Variables

    ° Variables name should never be x , y, z or i or any other chars that are not descriptive.

    ° Variables names should consists of the first letter of the variable type and the rest should be the use of the variable

    ° Variables name should be written using the Camel Naming convention system. Example: iUserId, sUserName

    ° Boolean Variables should be Positive sense Names example: isEmpty, isActive

    integer --> iUserId
    double --> dBasicSalary
    string --> sName
    float --> fPercent
    ..... and so on

    Note: you can customize your naming conventions as you like you must keep that standard among team. you may write string as strName

    • Control Names The following list of Control Names is to be used when creating names for HTML elements, Control names. When naming an element, the prefix is concatenated with a unique name for the element.

      Label --> LblCountryName
      TextBox --> txtCountryName
      CheckBox --> chkCountry
      Optionbox --> optCountry
      drobdownlist --> ddlCountry
      Combobox --> cmbCountry
      ListBox --> lstCountry
      Button --> btnCountry
      TreeView--> trvCountry
      ListView --> lstvCountry
      Progressbar --> pbCountry
      DataGrid --> dgCountry
      Repeater --> rptCountry
      DataList --> dlCountry
      Image --> imgCountr
  • Database
  • Tables

    - Tables’ names will not start with any initials but rather with the name right away.
    For example: Customers instead of [Database prefix]_TableName. like : hr_ Employees - Tables’ names should not contain any spaces whatsoever (all spaces should be replaced with underscores).
    - Tables’ names should be plural when applicable. For example: Users not User, Customers not Customer. · All tables’ names should be descriptive.
  1. Table Fields
    • pfk = primary foreign key & lfk = logical foreign key
    • All fields’ names should be descriptive
    • For the identity it will be AutoId For the foreign key it will be prefix_fieldName
      • The foreign key from another table of the current database will be pfk_CustomerId

      • The foreign key from another database table or external file structure like XML,..etc will be lfk_userI
    • Fields names should not contain any spaces whatsoever (all spaces should be replaced with underscores)
  2. Views
    • All views’ names should be descriptive
    • All views names should start with database prefix For example: hrvw_Employee
  3. Stored Procedures
    • All stored procedures’ names should be descriptive
    • All stored procedure names should start with a database prefix instead of SP since system stored procedures start with sp. For example: hr_AddEmployee

    and so on .....

    3. Hints and Remarks

    • Avoid Late Binding
    • Use StringBuilder class for string manipulation (don’t use string class)
    • Web Development should also Cache there Page
    • Developer has to use the .NET field validation for each of the following validation
      • Mandatory
      • Email format
      • Phone Format
      • Range like the age range
      • Password and password confirmation Comparison
    • Errors messages:
      • Should be spell checked
      • Should be in a proper and consistent format
      • Correct messages are displayed for each condition
      • Messages useful & meaningful for the user (e.g. “Driver error 80004005” will not be understood by a normal user)
      • Different errors are handled by different messages (invalid data types & entry length can not have the same message)
      • All Javascripts and VB scripts should be in one block in the beginning or the end of the file
      • All HTML tags should be small letters
      • Any developer using .NET should use regions when ever possible to have a better and easier look at his code

these are some coding standards we use on .NET environment development. so you could follow them or customize it to match your case.

if you have any inquiry about that topic, please don't hesitate to contact me at aes_fci@hotmail.com

Thanks

Tuesday, August 19, 2008

SQL Server 2005 - Merge Replication Step by Step Procedure

Posted on/at 7:32 AM by Admin

  • Introduction

Replication is a set of technologies for copying and distributing data and database objects from one database to another and then synchronizing between databases to maintain consistency. Using replication, you can distribute data to different locations and to remote or mobile users over local and wide area networks, dial-up connections, wireless connections, and the Internet.

Replication is the process of sharing data between databases in different locations. Using replication, we can create copies of the database and share the copy with different users so that they can make changes to their local copy of database and later synchronize the changes to the source database.

Terminologies before getting started:



Microsoft SQL Server 2000 supports the following types of replication

Publisher is a server that makes the data available for subscription to other servers. In addition to that, publisher also identifies what data has changed at the subscriber during the synchronizing process. Publisher contains publication(s).

Subscriber is a server that receives and maintains the published data. Modifications to the data at subscriber can be propagated back to the publisher.

Distributor is the server that manages the flow of data through the replication system. Two types of distributors are present, one is remote distributor and the other one local distributor. Remote distributor is separate from publisher and is configured as distributor for replication. Local distributor is a server that is configured as publisher and distributor.

Agents are the processes that are responsible for copying and distributing data between publisher and subscriber. There are different types of agents supporting different types of replication.

Snapshot Agent is an executable file that prepares snapshot files containing schema and data of published tables and database objects, stores the files in the snapshot folder, and records synchronization jobs in the distribution database.

An article can be any database object, like Tables (Column filtered or Row filtered), Views, Indexed views, Stored Procedures, and User defined functions.

Publication is a collection of articles.

Subscription is a request for copy of data or database objects to be replicated.


arc

Replication Types

Microsoft SQL Server 2005 supports the following types of replication:

  • Snapshot Replication
  • Transactional Replication
  • Merge Replication
Snapshot Replication
    • Snapshot replication is also known as static replication. Snapshot replication copies and distributes data and database objects exactly as they appear at the current moment in time.
    • Subscribers are updated with complete modified data and not by individual transactions, and are not continuous in nature.
    • This type is mostly used when the amount of data to be replicated is small and data/DB objects are static or does not change frequently.
Transactional Replication
    • Transactional replication is also known as dynamic replication. In transactional replication, modifications to the publication at the publisher are propagated to the subscriber incrementally.
    • Publisher and the subscriber are always in synchronization and should always be connected.
    • This type is mostly used when subscribers always need the latest data for processing.
Merge replication

It allows making autonomous changes to replicated data on the Publisher and on the Subscriber. With merge replication, SQL Server captures all incremental data changes in the source and in the target databases, and reconciles conflicts according to rules you configure or using a custom resolver you create. Merge replication is best used when you want to support autonomous changes on the replicated data on the Publisher and on the Subscriber.

Replication agents involved in merge replication are snapshot agent and merge agent.

Implement merge replication if, changes are made constantly at the publisher and subscribing servers, and must be merged in the end.

By default, the publisher wins all conflicts that it has with subscribers because it has the highest priority. Conflict resolver can be customized

Before starting the replication process:

assume that we have 2 server:

  • EGYPT-AEID: is the publisher server ( contains HRatPublisher )
  • SPS: is the subscriber server ( contains HRatSubscriber )
    use SQL server Authentication mode for login

on the publisher database i created table: Employees with fields of (ID, Name, Salary) to replicate its data to the subscriber server.

i will use publisher as subscriber also

Note: Check that SQL Server Agent is running on the publisher and the subscriber

Steps:

  1. Open SQL Server Management Studio and login with SQL Server Authentication to configure Publishing, Subscribers, and Distribution

1

a- Configure the appropriate server as publisher or distributor.

2

b- Enable the appropriate database for merge replication

pub db

2- Create new local publication from DB-Server --> Replication --> Local Publications --> Right Click --> New Pub

bub1

then choose the database that contains the data or objects you want to replicate

image

then choose the replication type and then specify the SQL server versions that will be used by subscribers to that publication like SQL Server 2005, SQL mobile Edition, SQL for Win CE ....etc

bub4

after that manage the replication articles, data and db objects, by choosing objects to be replicated

Note: you can manage the replication properties for selected objects

bub5

Then add filters to published tables to optimize performance and then configure the snapshot agent

bub6

bub7

and configure the security for snapshot agent

bub8

finally rename the publication and click finish

bub9

3- create a new subscription for the created "MyPublication01" Publication by right click on MyPublication01 --> New Subscription

that to configure the "Merge Agent" for replication on the subscriber database

pub10

bub11

then choose one or more subscriber databases. you can add new SQL Server subscribers

image

then specify the Merge Agent security as mentioned above on "Agent Snapshot"

and so specify the synchronization schedule for each agent.

Schedules:

  • Run Continuously: add schedule times to be auto run continuously
  • Run on demand only: manually run the synchronization

image

and then next up to final step, then click finish

you can check the errors from "Replication Monitor" by right click on Local Replication --> Launch Replication Monitor

Advantages in Replication:

Users can avail the following advantages by using replication process:

  • Users working in different geographic locations can work with their local copy of data thus allowing greater autonomy.
  • Database replication can also supplement your disaster-recovery plans by duplicating the data from a local database server to a remote database server. If the primary server fails, your applications can switch to the replicated copy of the data and continue operations.
  • You can automatically back up a database by keeping a replica on a different computer. Unlike traditional backup methods that prevent users from getting access to a database during backup, replication allows you to continue making changes online.
  • You can replicate a database on additional network servers and reassign users to balance the loads across those servers. You can also give users who need constant access to a database their own replica, thereby reducing the total network traffic.
  • Database-replication logs the selected database transactions to a set of internal replication-management tables, which can then be synchronized to the source database. Database replication is different from file replication, which essentially copies files.
Replication Performance Tuning Tips:
  • By distributing partitions of data to different Subscribers.
  • When running SQL Server replication on a dedicated server, consider setting the minimum memory amount for SQL Server to use from the default value of 0 to a value closer to what SQL Server normally uses.
  • Don’t publish more data than you need. Try to use Row filter and Column filter options wherever possible as explained above.
  • Avoid creating triggers on tables that contain subscribed data.
  • Applications that are updated frequently are not good candidates for database replication.
  • For best performance, avoid replicating columns in your publications that include TEXT, NTEXT or IMAGE data types.

if you have any inquiry about that topic, please don't hesitate to contact me at aes_fci@hotmail.com

thanks

Monday, August 18, 2008

Pre-Master Final Project (Reverse Query Processing)

Posted on/at 6:29 AM by Admin

Hi,

On Sep 2007, I joined faculty of computers and information at Cairo university for achieving master degree on computer science. This year was full study stage for 6 courses which are:

  1. Information System Development Methodologies
  2. Natural Language Processing
  3. Object Oriented Database
  4. Databases Systems
  5. Data Mining
  6. E-Commerce

with these courses there is a final project to pass for master registration.
I started to survey about opened topics on computer science fields like

  • Parallel and Distributed Computing
  • Requirements Engineering
  • Software Engineering
  • Web Based Decision Support Systems
  • Advances in Data and Knowledge Engineering
  • Data Mining and Computer Modeling in Tourisim
  • Health and Biomedical Informatics
  • Multimedia Computing
  • Natural Language Processing
  • Networks and Information Security
  • ....etc

and to continue proofing that TOPIC for my master degree. after surveying about these fields and opened topics on them, I found set of topics that match my hobbies in software engineering like:

  • Reverse Query Processing
  • Morphological Analysis and generation
  • Text and web content mining
  • Model-Driven DSS
  • Radiology structured-reporting
  • Gene sequence Annotation
  • Domain-Specific RE Processes
  • ...etc

after that, I decided to start on Reverse Query Processing under supervision of Dr. Ali El Bastawesy , the following are some notes after finalizing and discussing the project.

Abstract

Nowadays, there are a lot of techniques used for testing a database management system (DBMS) by generating a set of test databases and then execute queries on top of them. However, for DBMS testing, it would be a big advantage if we can control the input and/or the output (e.g., the cardinality) of each individual operator of a test query for a particular test case. RQP gets a query and a result as input and returns a possible database instance that could have produced that result for that query. RQP also has other applications such as testing the performance of DBMS and debugging SQL queries. There are a number of commercial tools to automatically generate test databases. These tools take a database schema (table layouts plus integrity constraints) and table sizes as input in order to generate new database instances with tuples.


Areas of RQP:

- Database Testing
- Software quality assurance

RQP Applications:

1- Generating Test Databases

The application that started this work is the generation of test databases for regression tests or to test the specification of an application. If the application code is available (e.g., Java or C# with embedded SQL), then the application code can be analyzed using data flow analysis in order to find all code paths. Based on this information, RQP can be applied to the SQL statements which are embedded in the application in order to generate a test database that will provide data for all possible code paths.

For example, consider an application with an if-else block where the if condition relies on the result R of a query Q. Given that query Q and different results R (e.g. one R for each branch of the if-else block), RQP can generate different databases to test all code paths of that application (R can be given by the testers manually or by some code analysis tools

foreach price in SELECT price FROM Product do
if(price>=0 && price<=10)
//do something
else if(price>10) //do something else
end
if
end foreach

2- SQL Debugger


3- Program Verification


4- Database Sampling, Compression


Some databases are large and query processing might be expensive even if materialization and indexing is used. One requirement might be to provide a compressed, read-only variant of a database that very quickly gives approximate answers to a pre-defined set of parameterized queries


sample


Problem Definition:


The problem of database application testing can be broadly partitioned into the problems of test cases generation, test data preparation and test outcomes verification. Among the three problems, the problem of test cases generation directly affects the effectiveness of testing.

Given an SQL Query Q, the Schema SD of a relational database (including integrity constraints), and a Table R (called RTable), find a database instance D such that: R = Q(D) and D is compliant with SD and its integrity constraints.

prob def

RQP Architecture

arc


Multi Reverse Query Processing:


RQP is not capable to support multiple queries and the corresponding expected results as input. Thus, in [6] we studied the problem of Multi-RQP (or MRQP for short). Unlike RQP, MRQP gets a set of SQL SELECT queries, the corresponding expected query results and a database schema as input and tries to generate one test database that returns the expected results for all the given queries


multimult1


here, I tried to describe the topic briefly so please don't hesitate to contact me for more information


Thanks

Friday, August 15, 2008

Software Engineer - Middle East at Google.com

Posted on/at 10:44 PM by Admin

Hi ,

i got an E-Mail from www.google.com/ about new vacancies for Software Engineers at Middle-East which is

"
Hi there!

Code Jam has let us know that you may be interested in hearing from us about potential roles @ Google.
The good news is that we have offices throughout the world and we're particularly keen to hire Arabic-speaking engineers for our new Google development offices in the Middle East.

We're not working on simply localising technologies developed in other countries, nor do we seek engineers who want to work on improving infrastructure. Instead, Google software engineers invent whole new technologies from scratch; stuff that will interest & inspire users across the world and affect 100's of 1,000's of people.

"We are not simply looking for engineers to solve the problems they already know the answers to; we are interested in engineers who can work out the answers to questions they have not come across before."

If this is something that might interest you, please let us know!

Make sure that you have the words "Code Jam 2008" on your CV and apply via the online application here:

Job Description:
------------------------------------------------------------------------
Software Engineer - Middle East


This position will be available at a Google site in the Middle East.

The area: Software Engineering
Google's software engineers develop the next-generation technologies for which we've become world-renowned. In addition to revolutionizing search technology, we use our world-class programming skills to innovate in a number of other areas as well. Our projects include working on advanced information-retrieval algorithms, massive scalability and storage solutions, and large-scale applications that enrich the user experience. We also work extensively on networking systems, advertising systems and complex transaction systems in consumer applications.

The role: Software Engineer - Middle East
Software Engineers at Google are developers who yearn to create and implement full product life-cycles – not just code solutions. This means you need to have a solid foundation in computer science, you consistently come up with new ideas and you would naturally strive for a deep understanding of your products in order to be able to continually improve upon them. With the bigger picture in mind, you will seek to code elegant systems. Our teams develop massively scalable, distributed software systems and also collaborate on multitudes of smaller projects that have universal appeal – which requires research, awareness, interactivity and asking questions. You bring strong competencies in data structures and algorithms, along with a technical fascination for how stuff fits together. You're motivated to experiment and take chances in order to make a difference in your field, unafraid to stand up for your ideas and eager to embrace change. As a Google engineer, you will work on problems in a number of areas, including cutting-edge information retrieval algorithms, scalability issues related to dealing with huge amounts of data and a rapidly increasing user population, and developing Google's portfolio of Arab specific products. You'll be comfortable within an agile software development environment, where engineers each handle all aspects of system architecture, design, coding and testing, without a job hierarchy.

Responsibilities:
- Research, conceive and develop software applications to extend and improve on Google's Arab specific product offering.
- Contribute to a wide variety of projects utilising natural language processing, artificial intelligence, data compression, machine learning and search technologies.
- Collaborate on scalability issues involving access to massive amounts of data and information. - Solve all problems that come your way.

Requirements:
- MS in Computer Science/Computer Engineering or PhD (preferred) with an exceptionally strong record of academic achievement.
- Strong C/C++/Java programming skills and several years of software development experience.
- Software background and success developing large scale, web-based applications, ideally launched in the Arab market.
- Substantial knowledge of Unix/Linux or Windows environments.
- Extensive experience with designing and programming distributed systems.
- Enthusiasm for finding and solving interesting technical problems from a globally scaled perspective.
- Fluency in English and Arabic (both classical and modern) as well as good knowledge and understanding of Arab culture

------------------------------------------------------------------------
Apply Here


I look forward to hearing from you!!
Jenny


--
Jenny Brown
Technical Recruiter, Google, Inc.
jennybrown@google.com
+44(0)2078814417

*Tips to interviewing at Google*
http://www.youtube.com/watch?v=w887NIa_V9w

*** Currently hiring experienced engineers for the ARAB region, to invent & develop specialist Arabic Google products: http://www.google.com/support/jobs/bin/answer.py?answer=96739
http://www.youtube.com/watch?v=6rkPwCYkbas

"

Thursday, August 14, 2008

MB6-503 Exam Questions [Sample]

Posted on/at 9:59 PM by Admin

Hi , i worked as Microsoft Application developer using Microsoft Dynamics Axapta 4.0 and be certified from microsoft on that technology

Microsoft Dynamics AX 4.0 Installation and Configuration

Training Materials:
- 8626: Installation and Configuration for Microsoft Dynamics AX 4.0


Skills Being Measured:

• Understand and articulate how to set up and configure Microsoft Dynamics AX 4.0, including understanding the components used in a Microsoft Dynamics AX 4.0 deployment.

• Install and set up those components, including supporting components such as Active Directory, SQL Server 2005, and IIS, as well as the Microsoft Dynamics AX 4.0 components that include Microsoft Dynamics AX 4.0 Database, Application Object Server, Application File Server, and Client.

• Understand how to configure Microsoft Dynamics AX 4.0 Enterprise Portal, Reporting Services, and Application Integration Se


Time Requirements and Questions:
- 90 minutes to complete the exam
- 50 questions with a passing rate of 70%
- Multiple Choice and Multiple Answer questions

The following questions are demo ones from the exam

Question: 1

Database improvements to Microsoft Dynamics 4.0 include: Choose the 3 that apply.

A - A change to Unicode to help support data in more languages than Microsoft Dynamics AX

3.0.
B - RecID improvements that help increase performance and scalability.
C - A change in the Database Wizard to help make creating the database an easier task.
D - A change to optimistic concurrency that helps shorten the amount of time that database
objects are locked.

Answer: A, B, D

Question: 2

A system implementer working with a customer on moving from Microsoft Dynamics AX 3.0 to
Microsoft Dynamics AX 4.0. What important effect to the database must be considered before
upgrading to Microsoft Dynamics AX 4.0?

A - The database can be converted without any special consideration.
B - The Microsoft Dynamics AX 3.0 database must be converted to Unicode before upgrading the
data to Microsoft Dynamics AX 4.0.
C - The database cannot be upgraded but instead all the data must be manually exported from
the old database and manually imported to the new database.
D - The upgrade checklist will automatically handle any needed changes to the database.

Answer: B

Question: 3

A customer asks the implementer to install their production Microsoft Dynamics AX 4.0 on a
single computer, in order to save money. What response would be appropriate for the
implementer to give to the customer? Choose the 2 that apply.

A - The single computer install should not be used in a production environment because of
potential performance issues.
B - The only appropriate place for a single computer install at a customer site is for development

and testing.
C - The single computer install would be the optimal install in a production environment.
D - The single computer install is for Partners only and should never be used at a customer site.

Answer: A, B

Question: 4

Which of the following is true in relation to the Help languages in Microsoft Dynamics AX 4.0?
Choose the 2 that apply.


A - It is possible to install help in multiple languages.
B - The Help files for all languages are now installed by default.
C - It is possible to view the Help files in multiple languages at one time on a Microsoft Dynamics


AX 4.0 client.
D - Users can switch between Help languages by changing the user settings in the Microsoft
Dynamics AX 4.0 client.

Answer: A, D

Question: 5

The Application Object Server (AOS) has been changed to a true Windows Service. What are the
advantages of this change? Choose the 3 that apply.

A - Improved server status reporting to the Windows event log. This lets administrators view
errors and warnings that can help in troubleshooting problems.
B - Eliminating the dependency on the Microsoft Dynamics AX 4.0 Server Manager removes a
security threat by which an attacker can send a command to the AOS to shut it down.
C - Changing to a true Windows Service means that the AOS service will always run as
Administrator.
D - The AOS service can be configured to start at system startup and continue to run even when
no user is logged into the system.

Answer: A, B, D

Question: 6

The application file server contains the files in which the Microsoft Dynamics AX 4.0 business
logic is stored. Because of the sensitive nature of the customer data stored in these files, which of
the following is true?


A - This directory must not be accessible by the Application Object Server computers.
B - Only the AOS service should have write access to these files
C - Only the Microsoft Dynamics AX 4.0 administrator should have write access to these files.
D - Only the AOS service and the Microsoft Dynamics AX 4.0 administrator should have write


access to these files.

Answer: D

Question: 7

The system implementer is preparing to install Microsoft Dynamics AX 4.0 at a customer site.
Before starting the install the implementer needs to know if the customers network infrastructure
has the ability to handle the requirements for Microsoft Dynamics AX 4.0. What are the minimum
bandwidth and latency numbers required for Microsoft Dynamics AX 4.0?

A - Bandwidth = 100 MB per second
Latency = Less than 50 milliseconds
B - Bandwidth = 10 MB per second
Latency = Less than 5 milliseconds
C - Bandwidth = 100 MB per second
Latency = less than 5 milliseconds
D - Bandwidth = 100 MB per second
Latency = more than 5 milliseconds

Answer: C

Question: 8

What are the critical areas of knowledge required by a Microsoft Dynamics AX 4.0 system
implementer? Choose the 3 that apply.

A - Networking
B - Microsoft SQL Server
C - Active Directory
D - Version Control System

Answer: A, B, C

Question: 9

The core computer roles for Microsoft Dynamics AX 4.0 are? Choose the 3 that apply.

A - Database server
B - Enterprise Portal server
C - Object server
D - Client

Answer: A, C, D

Question: 10

The system implementer is preparing to install the Application Object Server on a computer at a
customer site but finds that this computer has a 64-bit operating system installed. What is the
proper procedure in this case?

A - Microsoft Dynamics AX 4.0 cannot be installed on a computer with a 64-bit operating system.
B - Microsoft Dynamics AX 4.0 can be installed on a computer with a 64-bit operating system, but
it will run in 32-bit mode.
C - Microsoft Dynamics AX 4.0 can be installed on a computer with a 64-bit operating system and
will run in 64-bit mode.
D - Microsoft Dynamics AX 4.0 can be installed on a computer with a 64-bit operating system but
only after making modifications in the AOT.

Answer: B

Question: 11

The VAR is working with a customer to gather information necessary to evaluate the customer’s
infrastructure for installing Microsoft Dynamics AX 4.0. What information about the current
infrastructure is important to know for the Microsoft Dynamics AX 4.0 installation?


A - Network bandwidth
B - Any existing databases.
C - Operating systems currently installed
D - All of the above.


Answer: D

Question: 12

At a customer site, the system implementer is confronted with a problem. The IT Operations
Manager wants to install the application files on one of the Application Object Server (AOS). What
proper response can the system implementer give to the IT Operations Manager?

A - Installing the application file server on an AOS is acceptable but because there can only be
one application file server in the Microsoft Dynamics AX 4.0 environment it need only be
installed on a single AOS computer.

B - Installing the application file server on an AOS is acceptable but the application file server
should be installed on every AOS computer that is installed in the Microsoft Dynamics AX 4.0
environment.

C - The application file server should not be installed on an AOS computer.
D - It is mandatory to install the application file server on a AOS computer. Otherwise the AOS
will not be able to find the location of the application files.

Answer: A

Monday, August 11, 2008

.NET Framework 3.5 Enhancements Training Kit

Posted on/at 11:04 PM by Admin

Hi .NET Developers,

Published date of Training kit : 11-8-2008 Download

The .NET Framework 3.5 Enhancements Training Kit includes presentations, hands-on labs, demos, and event materials. This content is designed to help you learn how to utilize the .NET 3.5 Enhancement features including:

The following features had their labs updated in this release:
• ASP.NET AJAX History
• ASP.NET MVC
• ASP.NET Dynamic Data
• ADO.NET Data Services
• ADO.NET Entity Framework

The following features had labs added in this release:
• .NET Framework Client Profile
• WCF 3.5 SP1

The following features have supporting presentations included in this release:
• ASP.NET AJAX 3.5 SP1
• ASP.NET MVC
• ASP.NET Dynamic Data
• ASP.NET Routing
• ADO.NET Data Services
• ADO.NET Entity Framework
• WCF 3.5 SP1
• Visual Studio 2008 SP1

The following features have supporting demos included in this release:
• ASP.NET AJAX 3.5 SP1
• ASP.NET Dynamic Data
• ADO.NET Data Services
• ADO.NET Entity Framework

so you can download the training kit source from

http://www.microsoft.com/downloads/details.aspx?FamilyID=355C80E9-FDE0-4812-98B5-8A03F5874E96&displaylang=en



HTML Application (HTA)

Posted on/at 10:52 AM by Admin

if you want to open HTML page or website as an C++ application,Windows Application or any .Exe application, just rename the HTML file from .html to .hta . HTA can be used for prototyping, making wizards, or building full-scale applications.

By the use of HTA, you will focus on the html page or website content and thereby you won't find the browser toolbars, address bar, menus, buttons ...etc.

HTA for internal applications usage:

if you have internal tools, Web-Based applications, like attendance module for all employees, development team portals, collaboration portals, time tracker system ...etc. you need the employees or colleagues to dont care about explorer bars and focus on the core of your application, it will be useful to use the HTA

Example:




How can you do that:



just, you can rename the .html files to be .hta

OR,

you can use the following code:





references:
http://msdn.microsoft.com/en-us/library/ms536496.aspx
http://en.wikipedia.org/wiki/HTML_Application

Sunday, August 10, 2008

Naming Conventions for AX 4.0

Posted on/at 4:15 PM by Admin

Hi AX developers ,

According to my practical work on Microsoft Dynamics Ax 4.0 (Morphx IDE), it were obligated to use naming conventions for coding, design and implementation standards. I readed carefully "Best Practices for Microsoft Dynamics AX Development" View and summarized it then added some modifications to unify our development.

Naming Conventions for AOT









Naming Conventions for MorphX Controls





Naming Conventions for X++



these are some of naming conventions we used on ax development, you may customize naming conventions to your development state.
References:

Microsoft Certified.!

Posted on/at 1:08 AM by Admin




Saturday, August 9, 2008

Microsoft Dynamics AX 2009 demos

Posted on/at 1:54 AM by Admin

Hi, Microsoft Dynamics AX 2009 can help you meet the needs of your people as well as the evolving demands of your business. Watch the videos and learn more from resources that relate to four key business challenges



other videos at :

using SilverLight:

http://www.microsoft.com/dynamics/ax/product/demos.mspx

Using Windows Media Player:

http://www.microsoft.com/dynamics/ax/product/demos_wmv.mspx

Friday, August 8, 2008

Split string as Array in SQL

Posted on/at 5:09 PM by Admin

Hi,



i was in need to split string in T-sql but i can't find built-in function to do that, thereby i wrote a function to do the following:



By the use of T-SQL:



if you have string like "Ahmed,Eid,Salim" or Ids like "120,234,123,546"

and you need deal with that string as array on SQL DB Engine and find items of it.





The SQL Function like:

Tuesday, August 5, 2008

MCTS Exam 70-536 Microsoft® .NET Framework 2.0—Application Development Foundation [Sample]

Posted on/at 4:23 AM by Admin

Hi friends, I got MCTS certification

MCTS: Microsoft Certified Technology Specialist

It enables professionals to target specific technologies and distinguish themselves by demonstrating in-depth knowledge and expertise in their specialized technologies.

To earn the MCTS: .NET Framework 2.0 :
- Exam 70–536 TS: Microsoft .NET Framework 2.0–Application Development Foundation
- Exam 70–528 TS: Microsoft .NET Framework 2.0 – Web-Based Client Development

The following questions are samples of Exam 70-536

Question: 1

You are writing a custom dictionary. The custom-dictionary class is named MyDictionary. You
need to ensure that the dictionary is type safe.
Which code segment should you use?


A. Class MyDictionaryImplements Dictionary(Of String, String)
B. Class MyDictionary Inherits HashTable
C. Class MyDictionary Implements IDictionary
D. Class MyDictionary
End Class
Dim t As New Dictionary(Of String, String)
Dim dict As MyDictionary = CType(t, MyDictionary)

Answer: A

Question: 2

You write a class named Employee that includes the following code segment.


Private m_EmployeeId As String
Private m_EmployeeName As String
Private m_JobTitleName As String
Public Function GetName() As String
Return m_EmployeeName
End Function
Public Function GetTitle() As String
Return m_JobTitleName
End Function
End Class


You need to expose this class to COM in a type library. The COM interface must also facilitate
forward-compatibility across new versions of the Employee class. You need to choose a method
for generating the COM interface.
What should you do?


A. Add the following attribute to the class definition.
_Public Class Employee
B. Add the following attribute to the class
definition. _Public Class Employee
C. Add the following attribute to the class definition. _Public Class Employee
D. Define an interface for the class and add the following attribute to the class
definition. _Public Class EmployeeImplements
IEmployee

Answer: D

Question: 3

You are developing a custom event handler to automatically print all open documents.
The event handler helps specify the number of copies to be printed. You need to develop a
custom event arguments class to pass as a parameter to the event handler.
Which code segment should you use?


A. public class PrintingArgs {
private int copies;
public PrintingArgs(int numberOfCopies) {
this.copies = numberOfCopies;
}
public int Copies {
get { return this.copies; }
}}


B. public class PrintingArgs : EventArgs {
private int copies;
public PrintingArgs(int numberOfCopies) {
this.copies = numberOfCopies;
}
public int Copies {
get { return this.copies; }
}}
C. public class PrintingArgs {
private EventArgs eventArgs;
public PrintingArgs(EventArgs ea) {
this.eventArgs = ea;
}public EventArgs Args {get { return eventArgs; }}}
D. public class PrintingArgs : EventArgs {
private int copies;}

Answer: B

Question: 4

You use Reflection to obtain information about a method named MyMethod.
You need to ascertain whether MyMethod is accessible to a derived class. What should you do?


A. Call the IsAssembly property of the MethodInfo class.
B. Call the IsVirtual property of the MethodInfo class.
C. Call the IsStatic property of the MethodInfo class.
D. Call the IsFamily property of the MethodInfo class.

Answer: D

Question: 5

You are creating a class that uses unmanaged resources. This class maintains references to
managed resources on other objects. You need to ensure that users of this class can explicitly
release resources when the class instance ceases to be needed. Which three actions should you
perform? (Each correct answer presents part of the solution. Choose three.)

A.
Define the class such that it inherits from the WeakReference class.
B.
Define the class such that it implements the IDisposable interface.
C. Create a class destructor that calls methods on other objects to release the managed
resources.
D.Create a class destructor that releases the unmanaged resources.
E.Create a Dispose method that calls System.GC.Collect to force garbage collection.
F.Create a Dispose method that releases unmanaged resources and calls methods on other
objects to release the managed resources.

Answer: B, D, F

Question: 6

You are working on a debug build of an application.
You need to find the line of code that caused an exception to be thrown. Which property of the
Exception class should you use to achieve this goal?


A. Data
B. Message
C. StackTrace
D. Source

Answer: C

Question: 7

You need to write a code segment that performs the following tasks:

* Retrieves the name of each paused service.
* Passes the name to the Add method of Collection1.
Which code segment should you use?

A. ManagementObjectSearcher^ searcher =
gcnew ManagementObjectSearcher(
“Select * from Win32_Service where State = ‘Paused’”);for each (ManagementObject^
svc in searcher->Get()) {
Collection1->Add(svc[“DisplayName”]);}
B. ManagementObjectSearcher^ searcher =
gcnew ManagementObjectSearcher(
“Select * from Win32_Service”, “State = ‘Paused’”);for each (ManagementObject^ svc in
searcher->Get()) {
Collection1->Add(svc[“DisplayName”]);}
C. ManagementObjectSearcher^ searcher =
gcnew ManagementObjectSearcher(
“Select * from Win32_Service”);for each (ManagementObject^ svc in searcher->Get()) {
if ((String^) svc["State"] == "'Paused'") {
Collection1->Add(svc[“DisplayName”]);
}}
D. ManagementObjectSearcher^ searcher =
gcnew ManagementObjectSearcher();searcher->Scope = gcnew
ManagementScope(“Win32_Service”);for each (ManagementObject^ svc in
searcher->Get()) {
if ((String^)svc["State"] == "Paused") {
Collection1->Add(svc[“DisplayName”]);
}}

Answer: A

Question: 8

You need to serialize an object of type List(Of Integer) in a binary format. The object is named
data. Which code segment should you use?

A. Dim formatter As New BinaryFormatter()Dim ms As New
MemoryStream()formatter.Serialize(ms, data)
B. Dim formatter As New BinaryFormatter()Dim ms As New MemoryStream() For i As
Integer = 1 To 20
formatter.Serialize(ms, data(i - 1))Next
C. Dim formatter As New BinaryFormatter()Dim buffer As New Byte(data.Count) {}Dim ms As
New MemoryStream(buffer, True)formatter.Serialize(ms, data)
D. Dim formatter As New BinaryFormatter()Dim ms As New MemoryStream()While
ms.CanRead formatter.Serialize(ms, data)End While\

Answer: A

Question: 9

You are developing an application that dynamically loads assemblies from an application
directory.
You need to write a code segment that loads an assembly named Company1.dll into the current
application domain. Which code segment should you use?


A. AppDomain^ domain = AppDomain::CurrentDomain;String^ myPath =
Path::Combine(domain->BaseDirectory,
“Company1.dll”);Assembly^ assm = Assembly::LoadFrom(myPath);
B. AppDomain ^ domain = AppDomain::CurrentDomain;String^ myPath =
Path::Combine(domain->BaseDirectory,
“Company1.dll”);Assembly^ assm = Assembly::Load(myPath);
C.AppDomain^ domain = AppDomain::CurrentDomain;String^ myPath =
Path::Combine(domain->DynamicDirectory,
“Company1.dll”);Assembly^ assm = AppDomain::CurrentDomain::Load(myPath);

D. AppDomain^ domain = AppDomain::CurrentDomain;Assembly^ assm =
Domain->GetData(“Company1.dll”);

Answer: A

Question: 10

You are testing a newly developed method named PersistToDB. This method accepts a
parameter of type EventLogEntry. This method does not return a value. You need to create a
code segment that helps you to test the method. The code segment must read entries from the
application log of local computers and then pass the entries on to the PersistToDB method. The
code block must pass only events of type Error or Warning from the source MySource to the
PersistToDB method.
Which code segment should you use?

A. EventLog myLog = new EventLog(“Application”, “.”);
foreach (EventLogEntry entry in myLog.Entries)
{
if (entry.Source == "MySource")
{
PersistToDB(entry);
}
}
B. EventLog myLog = new EventLog(“Application”, “.”);
myLog.Source = “MySource”;
foreach (EventLogEntry entry in myLog.Entries)
{
if (entry.EntryType == (EventLogEntryType.Error &
EventLogEntryType.Warning))
{
PersistToDB(entry);
}
}
C. EventLog myLog = new EventLog(“Application”, “.”);
foreach (EventLogEntry entry in myLog.Entries)
{
if (entry.Source == "MySource")
{
if (entry.EntryType == EventLogEntryType.Error
entry.EntryType == EventLogEntryType.Warning)
{
PersistToDB(entry);
}
}
}


D. EventLog myLog = new EventLog(“Application”, “.”);
myLog.Source = “MySource”;
foreach (EventLogEntry entry in myLog.Entries)
{
if (entry.EntryType == EventLogEntryType.Error
entry.EntryType == EventLogEntryType.Warning)
{
PersistToDB(entry);
}

Answer: C

Question: 11

You are developing a class library. Portions of your code need to access system environment
variables.
You need to force a runtime SecurityException only when callers that are higher in the call stack
do not have the necessary permissions.
Which call method should you use?


A. Set->Demant();
B. Set->Assert();
C. Set->PermitOnly();
D. Set->Deny();

Answer: A

Question: 12

You create the definition for a Vehicle class by using the following code segment.

Public Class Vehicle
_
Public vehicleType As String
Public model As String
_
Public year As Integer
_
Public miles As Integer
Public condition As ConditionType
Public Sub New()
End Sub
Public Enum ConditionType
BelowAverage
Average
AboveAverage
End Enum
End Class

You create an instance of the Vehicle class. You populate the public fields of the Vehicle class
instance as shown in the following table:

MemberValuevehicleTypecarmodelraceryear2002miles15000conditionAboveAverage
You need to identify the XML block that is produced when this Vehicle class instance is
serialized.
Which block of XML represents the output of serializing the Vehicle instance?


A.

racer
15000
AboveAverage

B.

racer
15000
Excellent

C.

racer
15000
Excellent

D.

car
racer
15000
Excellent

Answer: B

Question: 13

You are developing an application for a client residing in Hong Kong.
You need to display negative currency values by using a minus sign. Which code segment should
you use?


A. Dim objCulture As NumberFormatInfo = _
New CultureInfo("zh-HK").NumberFormatobjCulture.NumberNegativePattern = 1
Return NumberToPrint.ToString("C", objCulture)
B. Dim objCulture As NumberFormatInfo = _
New CultureInfo("zh-HK").NumberFormatobjCulture.CurrencyNegativePattern =
1Return NumberToPrint.ToString("C", objCulture)

C. Dim objCulture As NumberFormatInfo = _
New CultureInfo("zh-HK").NumberFormatReturn NumberToPrint.ToString("-{0}",
objCulture)
D. Dim objCulture As NumberFormatInfo = _
New CultureInfo("zh-HK").NumberFormatReturn NumberToPrint.ToString("()",
objCulture)

Answer: B

Question: 14

Your application uses two threads, named thread One and thread Two.
You need to modify the code to prevent the execution of thread One until thread Two completes
execution.
What should you do?


A. Configure threadOne to run at a lower priority.
B. Configure threadTwo to run at a higher priority.
C. Use a WaitCallback delegate to synchronize the threads.
D. Call the Sleep method of threadOne.
E. Call the SpinLock method of threadOne.

Answer: C

Question: 15

You are developing a method to hash data with the Secure Hash Algorithm. The data is passed
to your method as a byte array named message. You need to compute the hash of the incoming
parameter by using SHA1. You also need to place the result into a byte array named hash. Which
code segment should you use?

A. Dim objSHA As New SHA1CryptoServiceProviderDim hash() As Byte =
NothingobjSHA.TransformBlock(message, 0, message.Length, hash, 0)
B. Dim objSHA As New SHA1CryptoServiceProviderDim hash() As Byte =
BitConverter.GetBytes(objSHA.GetHashCode)
C. Dim objSHA As New SHA1CryptoServiceProviderDim hash() As Byte =
objSHA.ComputeHash(message)
D. Dim objSHA As New SHA1CryptoServiceProviderobjSHA.GetHashCode()Dim
hash() As Byte = objSHA.Hash

Answer: C

Question: 16

You are writing a custom dictionary. The custom-dictionary class is named MyDictionary. You
need to ensure that the dictionary is type safe.
Which code segment should you use?


A. class MyDictionary : Dictionary
B. class MyDictionary : HashTable
C. class MyDictionary : IDictionary
D. class MyDictionary { ... }
Dictionary t = new Dictionary();MyDictionary dictionary =
(MyDictionary)t;

Answer: A

Question: 17

You work as a developer at Company.com. You are creating an application that provides
information about the local computer. The application contains a form that lists each logical drive
with the drive properties, such as type, volume label, and capacity.
You are required to write a procedure that retrieves properties of each logical drive on the local
computer.
What should you do?
Arrange the appropriate actions in the correct order.

Answer:


Question: 18

You are developing an application for a client residing in Hong Kong.
You need to display negative currency values by using a minus sign. Which code segment should
you use?


A. NumberFormatInfo^ culture =
gcnew CultureInfo(“zh-HK”)::NumberFormat; culture->NumberNegativePattern = 1;
return numberToPrint->ToString(“C”, culture);
B. NumberFormatInfo^ culture =
gcnew CultureInfo(“zh-HK”)::NumberFormat; culture->CurrencyNegativePattern = 1;
return numberToPrint->ToString(“C”, culture);
C. CultureInfo^ culture =
gcnew CultureInfo(“zh-HK”); return numberToPrint->ToString(“-(0)”, culture);
D. CultureInfo^ culture =
gcnew CultureInfo(“zh-HK”); return numberToPrint->ToString(“()”, culture);

Answer: B

Question: 19

You are developing a method to hash data with the Secure Hash Algorithm. The data is passed
to your method as a byte array named message. You need to compute the hash of the incoming
parameter by using SHA1. You also need to place the result into a byte array named hash. Which
code segment should you use?

A. SHA1 ^sha = gcnew SHA1CryptoServiceProvider();array^hash = nullptr;sha>
TransformBlock(message, 0, message->Length, hash, 0);
B. SHA1 ^sha = gcnew SHA1CryptoServiceProvider();array^hash =
BitConverter::GetBytes(sha->GetHashCode());
C. SHA1 ^sha = gcnew SHA1CryptoServiceProvider();array^hash = sha>
ComputeHash(message);
D. SHA1 ^sha = gcnew
SHA1CryptoServiceProvider();sha->GetHashCode();array^hash = sha->Hash;

Answer: C

Question: 20

You are writing an application that uses SOAP to exchange data with other applications.
You use a Department class that inherits from ArrayList to send objects to another application.
The Department object is named dept.
You need to ensure that the application serializes the Department object for transport by using
SOAP. Which code should you use?


A. SoapFormatter^ formatter = gcnew SoapFormatter();array^ buffer = gcnew
array(dept->Capacity);MemoryStream^ stream = gcnew MemoryStream(buffer);
for each (Object^ o in dept) {
formatter->Serialize(stream, o);}
B. SoapFormatter^ formatter = gcnew SoapFormatter();array^ buffer = gcnew
array(dept->Capacity);MemoryStream^ stream = gcnew MemoryStream(buffer);
formatter->Serialize(stream, dept);
C. SoapFormatter^ formatter = gcnew SoapFormatter();MemoryStream^ stream = gcnew
MemoryStream();for each (Object^ o in dept) {
formatter->Serialize(stream, o);}
D. SoapFormatter^ formatter = gcnew SoapFormatter();MemoryStream^ stream = gcnew
MemoryStream();formatter->Serialize(stream, dept);

Answer: D

Question: 21

You need to write a code segment that will create a common language runtime (CLR) unit of
isolation within an application. Which code segment should you use?

A. Dim mySetup As AppDomainSetup = _
AppDomain.CurrentDomain.SetupInformationmySetup.ShadowCopyFiles = "true"


.................. and so on so far

About Me

Developers house is a blog for posting technical articles in different technology like Microsft, Java, Oracle ..etc Microsoft technology includes c#,VB.net,ASP.net,Ajax,SilverLight,TFS,VS.NET 2003,2005,2008,2010 , SQL Server 2000, 2005 , Expression Blend , ...etc I hope it is helpful for all of you and if you are interested to post articles on it, only send me at ahmad.eed@gmail.com