Overview [Web Development platform using browsers]
Popfly is the fun and easy way to build and share mashups, gadgets, and Web pages. It’s made up of online visual tools for building Web pages and mashups and a social network where you can host, share, rate, comment and even remix creations from other Popfly users. If you're new to mashups and are interested in starting there, check out a popfly Videos
you can create your own mashups,gadgets and web pages using your own msn mail account
Source: From internet page Java vs .NET Competing Platforms In the following lines, you will be taken through a journey to discover the roots of both the Java and the .NET technologies . You will learn the story behind these two competing technologies. For everything to be clear, specially for new comers to the IT field (who might still be fighting on which is better Java or C#), I would like to start by explaining the Java and the .NET platforms, as this will untangle the issue and resolve problems clearing the way for understanding the rest of the picture easily. Java Coalition Sun, jointly with IBM and Netscape, developed the Java language and the Java platform. (It basically took most of the functionality of Smalltalk, a 100% object oriented language developed early by IBM). Java Promise If you compile a program written in Java, it will not run on a computer unless this computer has a Java platform (called JRE: java runtime environment) installed on it. Each operating system has a version of the JRE that can be installed on it. There is a JRE for Windows, a JRE for Linux, a JRE for Solaris (Sun's UNIX operating system), a JRE for Mac OS ... etc. If you compiled your Java program, the same compiled program can be run on any of those operating systems that have the JRE installed. You do NOT need to recompile (or modify) your program for each operating system in order to run on it. That was the promise of Java. This promise, was very appealing for companies developing software for more than one operating system. Some of those companies developed their software for an operating system and then it took them several months to port it to a different operating system later on. (For instance some companies delivered the Apple Mac OS version of their program first, then ported it to windows after several months.) Java promised to make that porting instant, i.e. in zero time. Because once you compiled the Java program, it can be run on any operating system that has a JRE. That was the promise of Java and its great appeal at it started. This promise is still used to promote Java today. However, whether or not Java has fulfilled its promise is a matter of debate. IBM The reason why IBM joined forces with Sun to develop and promote Java was that IBM had a lot to gain from this. IBM sold many mainframes and server computers. The problem with those monster servers was that the number of programmers who could develop software for them was much fewer than programmers of regular programming languages on a PC. Just compare how many can program a mainframe using Cobol and how many know C++ or VB? This lead IBM to push Java strongly and heavily promote it. The reasoning behind this was that because Java is independent of the operating system and the machine it runs on (i.e. portable) any Java programmer can develop programs that can run on IBM's server computers, upppon which a lot of IBM's business depended. IBM had, and still has, a lot to gain from Java, and that's why it is pushing it so hard. IBM is also pushing open source for a similar reason. Netscape Netscape was to gain from the Java platform as well, hence the reason for its joining forces with both Sun and IBM. Netscape wanted the browser to be the center of everything. It wanted to cancel the importance of one operating system over the other. It even started the-browser-is-the-OS campaign which advocated that the browser was the important thing, and the specific OS on which it ran was irrelevant. Sure this angered its rival Microsoft. From its deep love and support for Java, Netscape even renamed its scripting language from LiveWire to JavaScript which is the name we know it now with. Microsoft Against those 3 giants (Netscape was relatively big at that time, before Microsoft 'sacked' it from its high position) stood Microsoft. IBM, Sun and Netscape all were to gain from Java. But for Microsoft, Java was a threat. Java promised portability across operating systems, this meant that no matter what OS you were using, you will still be able to run the program with the same functionality. This would in turn give lesser importance to which OS you are using, for you can then be using just any OS. Of course this strongly threatened Microsoft's monopoly over the operating system of the PC, namely Windows. That is why Microsoft fought ferociously against Java. Netscape stood as a pain in the neck for Microsoft for a while, and Bill Gates was unable to get any sleep at night, but when he did manage to get any, it was nothing but nightmares of Netscape dethroning Microsoft from its software empire. Borland Borland at first embraced the Java platform and the Java language by providing tools (IDEs) for Java. Unlike IBM and Netscape, however, it did not take sides with Sun, but remained unattached. When Microsoft launched its counterattack on Java in the form of the .NET platform, Borland quickly embraced the .NET platform as well and started providing products for both the .NET and the Java platforms. As always, borland stayed in the support-all-technologies place it has always enjoyed in the past. I personally respect Borland and the quality of their products a lot. (Think Delphi. Although I've never programmed in Pascal or Delphi before, yet I know Borland's products are cool. I've tried their analysis/design tools once in the past, then still owned by Together Software, and it was way cool and a lot of fun.) J++ Microsoft tried to ride the Java wave by adding J++ as one of the languages supported in its Visual Studio product group. J++ was basically Java, but Microsoft tried to pack it with other stuff from its own making it less portable because it is its very portability which threatened Microsoft's thrown over the OS of the PC. Sun then launched a counter-campaign with ads calling for "100% Java" and "Pure Java" trying to lure developers into going for the original portable Java it developed and not Microsoft's J++. Failing to win the marketing campaign, and finding that Microsoft is going too far with its modification of the Java language, Sun finally filed its famous law suit against Microsoft, which stayed in courts for a couple of years. This is nothing unusual for Microsoft which had law suits against it and court struggle before with Apple, IBM and others. Microsoft is popular for that kind of thing. The law suit accused Microsoft of violating Sun's conditions for using Java by modifying it. Finally, Sun won the legal battle and received a nice amount of money in compensation from Microsoft. Moreover, according to the settlement of the case, Microsoft was allowed to continue supporting its J++ product, but was not allowed to upgrade it to later Java versions. This spelled the end to Microsoft's dreams of riding the Java wave. C# and .NET Finding it has lost the battle for J++, and fears of the Java threat reemerging for Microsoft, it though of a new strategy to counteract Sun's Java. Microsoft developed the .NET technology, which 'borrowed' a lot of the features of the Java platform, except that it ran on the Windows OS (aka was not portable!). They also developed C#, which was basically nothing but Java with a new name! It was almost identical to Java in all respects (think garbage collection, no pointers). It's as if they repackaged their J++ into a new name. Such action was not surprising from a company like Microsoft with its long experience in using similar stealth strategies. The strength of the Java platform was that it supported many operating systems. In order to use the word "many" for its platform, Microsoft made its .NET platform support many programming languages! (Which was a bit absurd!). Anyway, the .NET platform used the same ideas of the Java one, except that it had different names for them (as usual with Microsoft). So now, Microsoft had a counter-element for each of the ones by Sun: Java, JRE, bytecode all had their equivalents in the Microsoft developer tools world (even the word "many!") Java Applets vs Flash Another feature Sun and the Java coalition tried to promote about Java besides its portability was the use of Java applets. Java applets were something Sun pushed so strongly at first and made a lot of propaganda for. The reasoning behind this was that an applet would run from within the web browser and therefore would be portable and accessible to anyone who has access to the web through a regular web browser. Netscape was also in for this. Because of the high appeal of animated graphics at the early days of the web, Sun made the mistake of heavily promoting Java applets as a way to make rich graphic animations and an interactive interface on the web. Macromedia was trying to push Flash forward to become the 'standard' in web animation and interactive web interfaces. Seeing the high competition from Java, Microsoft desided to strike again on Java, this time on the Java applet. Microsoft released Internet Explorer 5 with the Flash plugin preinstalled in it! This gave a strong push to Flash on the web, soon it became the standard for animated graphics in web pages and became a strong choice for rich interactive web applications. By doing so, Microsoft managed to kill the Java applet advantage in the filed of animation and interactivity on the web. Soon Microsoft realeased Windows XP without the JRE (needed to run Java programs) pre-installed on it. This outraged Sun, but they were unable to do anything about it except for a media campaign. By preinstalling the Flash plugin in its Inter Explorer 5 and delivering Windows XP without the JRE preinstalled, Microsoft managed to regain its controal and significantly reduce the threats of Java on its empire. Sun now is the one striving to paint a picture of coexistence of both the .NET and the Java platforms promoting the idea that both technologies can coexist together. Instructors and Students The business environment in which technology lives is a vital space where technology professionals must be aware of. You will not be able to advance well technically if you are not aware of the business background and the total picture of 'fights' and motives of giant software companies. I believe that a brief background about this should be an integral part of technology training. I try to brief my students with a bird's eye view of this picture before starting a technology course because it helps them see the big picture and know where they are standing instead of getting lost in a pool of technologies, terms and abbreviations. If you had that background, no one will be able to fool you by telling you C# is better than Java, or vice versa. No one will be able to tell you Java is dead! You will also have a sense of direction to where things are heading for the future. You will not be lost anymore in a spinning stream. Its easy, with such background under your arm, to bust any hypes that technically incompetent people might be propagating, you'll simply not fall into any of the hype. You'll be more stable, not to be blow off by the slightest of winds. More importantly, you will start asking the right questions. Microsoft is Nice Just in order not to get the wrong impression, despite Microsoft's twisted style of dealing with things, it has made a lot of contributions to the IT field. Suffice it to say that it has: Made thing very EASY. Integrated a lot of bright ideas and technologies that have been developed by others (some may call that stealing, but at least they're good at copying and integrating all that together). Made computer use popular. I lift my hat them in respect, despite their buggy software and their over hyped methods.
The shortcut menu in the Application Object Tree (AOT) has an Add-ins menu where you can find various development tools such as the cross-reference system and the Visual MorphXplorer.
To add your own tool to the Add-ins submenu
Create a menu item for the tool.
Locate the item you want to add to the Menu Items node.
Drag the menu item onto sysContextMenu in the Menus node.
Enabling and Disabling Menu Items According to Context All items in the sysContextMenu menu are automatically added to the Add-ins submenu. If you want to disable items according to the current context, you need to add to the verifyItem method for the SysContextMenu class.
verifyItem( identifiername MenuItemName , MenuItemType MenuItemType ) is automatically called for each item you add to the sysContextMenu menu. It takes the name of the menu item and the menu item type as parameters, and must return 0 (zero) if the item isn't available.
Example
The following extract from verifyItem shows the testing performed when the parameter is the menu item MorphXplorer.
case menuItemDisplayStr(MorphXplorer): if (this.selectionCount() != 1 firstNode.AOTIsOld() //Does not work for old nodes ) { return 0; } if (!docNode && (_firstType==UtilElementType::Class _firstType==UtilElementType::Table)) { return 1; } return 0;
Tip
There are other classes called SysContextMenu*, for example, SysContextMenuCompare. These classes are used when there are several levels in the add-ins hierarchy. For example, when you activate Compare on two objects, the Add-ins submenu is also available in the Compare dialog. The first() and next() methods on sysContextMenuCompare define the proper context.
Features - window management: - view opened windows as tabs - change windows position - close windows buttons: - open form design for currently opened form - open table browser for the active form or the table selected in the AOT - open current field in AOT - open Cross references for selected field (in AOT and for active form) - copy name/path/AxPath of selected AOT items - go to the application object of the current AOT item (for example to table form field) - Add-Ins menu for AOT Item - compare selected AOT item(s) - import XPO - search selected AOT item for something - refresh AOD - AxSearch integration
ITWorxA leading Egyptian software company providing outsourcing services, located in the Nasr City Free Zone.
Raya SoftwareProvides a wide range of enterprise level solutions and software applications.
OTSOrascom Technology Solutions provides a wide range of IT solutions and services.
Nile OnlineProvides Internet connectivity services.
NoorProvides Internet solutions and infrastructure.
Intercom EnterprisesProvides business solutions based on IBM technologies.
OpenCraftAn Egyptian software company providing IT solutions based on open source systems.
MacroCellA software company providing e-business and payment processing solutions.
GNS EgyptProvides e-business solutions.
SANDDevelops information systems.
IT SynergyProvides GIS and other services based on open source technology.
ConnectionDevelops GIS solutions.
quTIPProvides mobile information system solutions.
MSCIProvides consultancy, training, system integration and outsourcing services.
Giza SystemsDevelops information systems.
MicrotechAn Egyptian software company providing ERP solutions.
RITsolProvides ERP solutions.
ITGDevelops financial information systems.
AthearIT services company.
AssetAn Egyptian software company developing Arabic CMS products.
Comsys SoftwareDevelops retail management systems and other information systems.
EME ITProvides system integration solutions.
SICCAn Egyptian IT company providing barcode readers and other automatic data collection solutions.
AsgaTechAn Egyptian software company working in mobile solutions.
InformatiqueAn Egyptian software company providing Education systems and other solutions.
OmegaSoftDesigns and builds industrial ERP systems.
Bayan-TechProvides localization solutions.
RDIDevelops Arabic language technologies and multimedia CDs.
FC&EDDesigns and develops electronics devices and software.
Ebb & TideProvides web and multimedia solutions.
United OFOQDevelops HR software and other information systems.
4SProvides information systems and software development services.
SANAtechDevelops information systems and solutions based on open source technology.
Binary WorksDevelops web-based e-learning solutions.
IKDProvides Internet and wireless solutions.
Nile NetworksProvides network services.
eBSEGProvides e-business solutions.
EgyMarkProvides e-business solutions.
NRGDevelops enterprise solutions and web portals.
Cairo ITDevelops e-learning solutions.
Web Design and Development
GNSProvides web-based solutions for the tourism industry.
ArkanProvides web design, web development and hosting services.
Bit and BitsProvides website design and development services.
InSoftProvides website development services.
GozoorProvides web site design, web development and web hosting services.
Nile CreationsProvides web site design and development services.
MicroaxonProvides web development services.
We AreProvides advertising and web design services.
Design Co-ordinators InteractiveProvides web site desing, CD presentations and tours and Flash animation services.
LojineProvides web marketing and graphic desing services.
MRCO EgyptProvides web design and online marketing services.
Code-CornerProvides web development and web hosting services.
Hardware
IBSImports and assembles computer hardware.
In Alexandria
Online HorizonsProvides web development and web hosting services.
Arwa SoftwareDevelops information system software products.
From Kuwait
SakhrA leading software company with an R&D center in Egypt providing Arabic language technologies and enterprise solutions, located in the Nasr City Free Zone
HarfA software company based in Egypt developing Islamic software.
ITSoftCMMI level 4 certified Software Company located in the Nasr City Free Zone.
From Saudi Arabia
MCRProvides system integration and consulting services.
Arabia ITProvides off-the-shelf software programs and publications.
B9matA Saudi company providing web solutions with a development center in Cairo.
From UAE
Axiom ComputersDevelops information systems based on Oracle and J2EE technologies.
From USA
EDSProvides business and technology solutions.
SanteonA software company with offices in the US and Cairo.
eRevMaxDevelops software solutions for the tourism industry.
PicostationA US based software company with a development center in Egypt developing a mobile phone photo blogging application.
Net Pate GroupProvides web design and development services.
NordixValue added reseller of IT products. Provides network services.
From UK
LogicaCMGProvides system integration services for IT and wireless telecommunications.
From Germany
AMSProvides information systems for the medical sector.
From Australia
IOSAn Australian based software company with a development center in Egypt.
From Canada
NTG ClarityDelives network, telecom, IT and infrastructure solutions to network service providers and medium and large enterprises.
CIT GlobalProvides ecommerce solutions
Microsoft EDC http://www.edc2008. com EDC 2008 is the biggest Developers Conference of the year in Egypt, and is a critical event for any developer who wants to see the newest as well as the next-generation technology. EDC is full of sessions and activities that help you to learn the current and the future of the Microsoft Platform and get to know people who are as passionate about software as you are.
Hi Web developers friends , nowdays there is a new trend to use AJAX technology for building your business .
ASP.NET AJAX is a free framework for quickly creating efficient and interactive Web applications that work across all popular browsers.
ASP.NET AJAX is built-into ASP.NET 3.5. It is also available as a separate download for ASP.NET 2.0.With ASP.NET AJAX you can:Create next-generation interfaces with reusable AJAX components. Enhance existing pages using powerful AJAX controls with support for all modern browsers. Access remote services and data from the browser without tons of complicated script. Take advantage of the improved efficiency and ease of use in Visual Studio 2008, with its built-in support for ASP.NET AJAX, improved JavaScript support, and a new Web page designer interface
Microsoft Silverlight is a cross-browser, cross-platform client technology that helps you design, develop, and deliver media-enabled experiences and rich interactive applications on the Web. Silverlight appeals to both designers and to developers because it provides a powerful platform that makes it easy to develop Web applications with professional-quality graphics, audio, and video for an engaging user experience. Silverlight also offers powerful tools that will improve the productivity of both designers and developers.
Hi friends , to be ready for technical interview at any corporations you can find alot of questions to any technology like MS.Net , Java , SQL Server , Oracle , Python ....etc at http://www.geekinterview.com
solve this question : What is the difference between shadow and override ?
The Microsoft VHD Test Drive Program provides customers with an enhanced server-based software evaluation experience that’s faster, better supported and more flexible. You can now access the entire catalog of pre-configured Microsoft and partner products and solutions in the VHD format and start evaluating and testing today from www.microsoft.com/vhd. This download enables you evaluate Microsoft Office SharePoint Server 2007. Microsoft Office SharePoint Server 2007 is an integrated suite of server capabilities that can help improve organizational effectiveness by providing comprehensive content management and enterprise search, accelerating shared business processes, and facilitating information-sharing across boundaries for better business insight. Office SharePoint Server 2007 supports all intranet, extranet, and Web applications across an enterprise within one integrated platform, instead of relying on separate fragmented systems. Additionally, this collaboration and content management server provides IT professionals and developers with the platform and tools they need for server administration, application extensibility, and interoperability. This fully functional pre-configured VHD provides you a trial software will automatically expire after 30 days. This is a preconfigured virtual machine contained within the Virtual Hard Disk (VHD) format. Virtual Server 2005 R2 is required to run this VHD. Please refer to the system requirements section for more details.
A newbie's guide to .docx .docx is the default file format in the latest version of Microsoft Word in Office 2007. All docs in the new office family is based upon an open, standardized specification called Office Open XML.
Hi .Net Developers , i found a good article at msdn.com .i think it so helpful for you to deeply understand [Application Architecture for .NET: Designing Applications and Services]
i finished reading it and it so so so helpful for me , so i hope all of you read it carefully
By utilizing the capabilities of the NetAdvantage for ASP.NET controls, developers can create highly customized and powerful WebParts for Microsoft Windows Sharepoint (WSS) or Microsoft Office SharePoint collaboration portals and plug them directly into the SharePoint framework. SharePoint is a powerful web-based portal package that organizations are adopting as a means of online communication and collaboration. By presenting a user with a series of WebParts organized onto a single web page, information can be delivered to multiple end users. This allows developers to build interfaces that contain specific information unique to each user.
The QuickStart Tutorials are the fastest way to understand what the .NET Framework technology offers leading-edge developers. Inside you'll find information about the most compelling features of the .NET Framework technology, including how to put them immediately to work for you or your company
.NET Matters Deadlock monitor Stephen ToubCode download available at: NETMatters2007_10.exe (156 KB) Browse the Code Online [ http://msdn2.microsoft.com/en-us/magazine/cc164433(printer).aspx ] Q I'm using locks in my application to synchronize work on a bunch of threads. Unfortunately, I'm doing something incorrectly and my threads seem to just stop sometimes. I think I'm running into deadlocks, but I'm not sure how to find them. Is there any way I can do so programmatically? I'd like an exception to be thrown when a deadlock is encountered. Q I'm using locks in my application to synchronize work on a bunch of threads. Unfortunately, I'm doing something incorrectly and my threads seem to just stop sometimes. I think I'm running into deadlocks, but I'm not sure how to find them. Is there any way I can do so programmatically? I'd like an exception to be thrown when a deadlock is encountered. A First, it's important to understand what a deadlock among threads is and the conditions that lead to one. Threads deadlock when waiting on each other to release some resources, but by performing that blocking wait, they're not releasing the resources the other threads need in order to unblock. The threads can't make any progress until the resources are released, but because they're not making progress, the resources will never be released, the threads are locked up, and thus "deadlock." Many OS course textbooks will cite the four conditions necessary for a deadlock to occur: A First, it's important to understand what a deadlock among threads is and the conditions that lead to one. Threads deadlock when waiting on each other to release some resources, but by performing that blocking wait, they're not releasing the resources the other threads need in order to unblock. The threads can't make any progress until the resources are released, but because they're not making progress, the resources will never be released, the threads are locked up, and thus "deadlock." Many OS course textbooks will cite the four conditions necessary for a deadlock to occur: A limited number of a particular resource. In the case of a monitor in C# (what you use when you employ the lock keyword), this limited number is one, since a monitor is a mutual-exclusion lock (meaning only one thread can own a monitor at a time). The ability to hold one resource and request another. In C#, this is akin to locking on one object and then locking on another before releasing the first lock, for example: Copy Codelock(a) { lock(b) { ... } } No preemption capability. In C#, this means that one thread can't force another thread to release a lock. A circular wait condition. This means that there is a cycle of threads, each of which is waiting for the next to release a resource before it can continue. If any one of these conditions is not met, deadlock is not possible. The first condition is inherent to what a monitor is, so if you're using monitors, this one is set in stone. The second condition could be avoided by ensuring that you only ever lock one object at a time, but that's frequently not a feasible requirement in a large software project. The third condition could possibly be avoided in the Microsoft® .NET Framework by aborting or interrupting the thread holding the resource your thread requires, but a) that would require knowing which thread owned the resource, and b) that's an inherently dangerous operation (for the many reasons why, see msdn.microsoft.com/msdnmag/issues/05/10/Reliability). Thus, the way to avoid deadlocks is to avoid (or thwart) condition four. In his article in the April 2006 issue (available at msdn.microsoft.com/msdnmag/issues/06/04/Deadlocks), Joe Duffy discusses several techniques for avoiding and detecting deadlocks, including one known as lock leveling. In lock leveling, locks are assigned numerical values, and threads must only acquire locks that have higher numbers than locks they have already acquired. This prevents the possibility of a cycle. It's also frequently difficult to do well in a typical software application today, and a failure to follow lock leveling on every lock acquisition invites deadlock. Rather than prevent deadlocks wholesale, many systems attempt to detect them and then eliminate them once found. For example, SQL Server® can detect when deadlocks occur and abort one of the tasks involved in the cycle, thereby removing the deadlock. In his article, Joe builds a common language runtime (CLR) host that is capable of this form of deadlock detection in .NET applications that use monitors, a very cool feat. Unfortunately, using a custom CLR host isn't always practical for many .NET apps, including those that already have a custom host, like ASP.NET applications. As such, it would be beneficial to be able to utilize similar deadlock detection capabilities, without the need for a custom CLR host, such that these types of deadlocks could be detected at run time. This would be beneficial during development and testing phases, to identify coding errors where locks are being used incorrectly. It could also be used in production to detect and eliminate deadlocks as they occur (preventing a thread from causing one by blocking it from attempting the critical wait that would complete a cycle), however typical deadlock detection algorithms are costly and may not be appropriate in production systems for performance reasons. (I'll have a few comments on performance at the end of this column.) To address this need, I've built a sample wrapper for the .NET System.Threading.Monitor class that includes deadlock detection capabilities. As with Monitor, my DdMonitor class provides Enter and Exit methods, and under the covers it delegates to the equivalent methods on Monitor. However, it also tracks monitor usage and throws exceptions when the attempted acquisition of a lock will complete a cycle, which would result in deadlock. For the rest of this column, I'll detail the implementation of this deadlock monitor class and provide additional information on its usage as well as on the advantages and disadvantages of its deployment. The outline for the DdMonitor class is shown in Figure 1. From the start, note that DdMonitor does not completely mimic the public interface of System.Threading.Monitor. It provides the same public static TryEnter, Enter, and Exit methods, but it does not provide the Wait, Pulse, and PulseAll static public methods of its counterpart. Figure 1 DdMonitor Class Copy Codeclass DdMonitor { public static IDisposable Lock(object monitor) { ... } public static void Enter(object monitor) { ... } public static bool TryEnter(object monitor) { ... } public static bool TryEnter( object monitor, TimeSpan timeout) { ... } public static bool TryEnter( object monitor, int millisecondsTimeout) { ... } public static void Exit(object monitor) { ... } } DdMonitor also provides a public static Lock method. Since the C# lock keyword provides a nice abstraction over Monitor, it's beneficial to provide a similar one for DdMonitor. Without the ability to modify the C# language, it's impossible for us to obtain identical syntax, but we can get close: Copy Code// with Monitor lock(obj) { ... } // with DdMonitor using(DdMonitor.Lock(obj)) { ... } This syntactical feat is accomplished by implementing Lock, as shown in Figure 2. The Lock method delegates to DdMonitor.Enter to acquire the lock. However, it also instantiates a DdMonitorCookie object that implements IDisposable. This object's Dispose method will call DdMonitor.Exit to release the lock; this enables the developer to wrap DdMonitor.Lock in a C# using statement (Using in Visual Basic® or stack-allocation in C++/CLI) as shown previously. Figure 2 Implementing the Lock Method Copy Codepublic static IDisposable Lock(object monitor) { if (monitor == null) throw new ArgumentNullException("monitor"); IDisposable cookie = new DdMonitorCookie(monitor); Enter(monitor); return cookie; } private class DdMonitorCookie : IDisposable { private object _monitor; public DdMonitorCookie(object obj) { _monitor = obj; } public void Dispose() { if (_monitor != null) { DdMonitor.Exit(_monitor); _monitor = null; } } } The Enter method and two of the three TryEnter methods are simple wrappers for the third TryEnter method, as shown in Figure 3. These implementations are meant to follow the same specification as implemented by Monitor's Enter and TryEnter method. Calling Enter will block until the lock is acquired (we differ slightly by design in that our Enter method will throw an exception if a deadlock is detected, rather than blocking forever), and thus delegates to TryEnter with a Timeout.Infinite timeout. Note that Timeout.In- finite equals -1, which is a special value that signals TryEnter to block until lock acquisition, rather than failing out after the specific time. In contrast, the overload of TryEnter that doesn't accept a time value defaults to using a timeout of 0, meaning that it will return false if the lock cannot be acquired immediately (again, our implementation will also throw an exception if acquiring the lock would cause a deadlock; this decision is a debatable point with TryEnter, however, so you may choose to modify the implementation accordingly). Note that TryEnter will return true if the lock was acquired or false otherwise. The second overload of TryEnter simply converts the supplied TimeSpan timeout value into a number of milliseconds, validates the argument, and delegates to the final TryEnter overload, which is where all the real work happens. Figure 3 Implementing Enter Copy Codepublic static void Enter(object monitor) { TryEnter(monitor, Timeout.Infinite); } public static bool TryEnter(object monitor) { return TryEnter(monitor, 0); } public static bool TryEnter(object monitor, TimeSpan timeout) { long totalMilliseconds = (long)timeout.TotalMilliseconds; if (totalMilliseconds < -1 totalMilliseconds > Int32.MaxValue) throw new ArgumentOutOfRangeException("timeout"); return TryEnter(monitor, (int)totalMilliseconds); } Our design is relatively straightforward, though it does involve a few interesting implementation details. The implementation begins by validating the supplied parameters, ensuring that an object was actually supplied on which to be locked and that a valid timeout was supplied (meaning either -1 or a non-zero number of milliseconds). At this point, DdMonitor needs to access some shared state. Since there's no supported way for DdMonitor to interrogate the CLR for information about a monitor (including which thread may own it and which threads may be waiting on it), DdMonitor has to track this information manually. It does this by storing a static table of data structures that contain all of the relevant information about acquired monitors in the system, and every time an Enter or Exit operation is performed on a monitor, it updates this shared state. Note that this has a few implications. First, while we'll see that DdMonitor does end up delegating to Monitor with the same monitor object that was supplied by the user, DdMonitor knows nothing about direct calls to Monitor's methods, and thus it's not able to update its internal state information based on any such calls that are made. This means that deadlock detection will not function properly if you mix usage of DdMonitor and Monitor (or the lock keyword) in your app, causing false negatives and possibly not preventing some deadlocks. Another implication of this implementation is that this static table is AppDomain-specific. This shouldn't be a problem, since objects you lock on should also only live in one AppDomain. However, there are several special kinds of objects (such as Type and String) that are able to cross AppDomain boundaries, and if you lock on one of these domain-agile objects with DdMonitor from multiple domains, the static table maintained by DdMonitor in each domain will only contain a subset of the relevant information, again possibly leading to false negatives. A third issue with this approach has to do with reliability. A lock statement in C# expands to a call to Monitor.Enter followed immediately by a try block, whose body is equivalent to the body of the lock statement and whose finally block releases the monitor. The CLR, through a bit of JIT hackery, ensures that the try block is entered if the call to Monitor.Enter succeeds; this ensures that the finally block will also be executed if Monitor.Enter succeeds, which is important in the face of asynchronous exceptions that could otherwise occur between the call to Monitor.Enter and entering the try block (for more information, see msdn.microsoft.com/msdnmag/issues/05/10/Reliability and www.bluebytesoftware.com/blog/2007/01/30/MonitorEnterThreadAbortsAndOrphanedLocks.aspx). As you'll see in our DdMonitor implementation, however, there is code that comes after the actual underlying call to Monitor.Enter and before the try block that comes after the call to DdMonitor.Enter; as such, these reliability guarantees are lost with our implementation. You should keep all of these issues in mind in case any is dangerous to your scenarios. Back to our implementation of TryEnter, which is shown in Figure 4; it continues by obtaining its internal lock for this shared state. Once acquired, it accesses the dictionary to find any previous data on the monitor being entered. If no such data exists, that means that no threads currently own or are waiting on the monitor. In such a case, TryEnter initializes a new MonitorState object to track this monitor and puts it back into the table. Figure 4 Implementing TryEnter Copy Codeprivate static Dictionary
Hi Axapat friends , according to controlling source code of applications to be easily reused and maintained during the implementation phase , so i were to use the version control managment system with microsoft dynamics axapta . This article describes how to set up the Version Control Management System (VCMS) for Microsoft Dynamics AX 4.0 using Visual Studio 2005 SourceSafe (VSS) as the version control system.
All of contents of this blog are about computer science , information tech. topics and others . about some of contents of this blog , are linked from other sites like microsoft , google , youtube .....etc . so am not responsible of these sites' contents ThanksAhmed Eid