• الإعلانات

    • فيصل الحربي

      تسجيل عضوية جديدة في المنتدى   01/31/2016

      السلام عليكم ورحمة الله وبركاته  عزيزي العضو الجديد :  حاليا رسالة الإيميل لتأكيد صحة إيميلكم تذهب للبريد العشوائي ( جاري حل المشكلة )  فإذا لم تجد رسالة التحقق من إيميلكم في صندوق الوارد لديكم إتجه للبريد العشوائي ( JUNK)  وقم بتفعيل إشتراككم من هناك   

البحث في المنتدى

Showing results for tags 'elixir'.

  • البحث بالتاقات

    اكتب الكلمات المفتاحيه بينها علامه الفاصله
  • البحث بكاتب الموضوع

تم إيجاد 3 نتيجة

  1. Dot Net Code Elixir Number 0007

     What is TransactionScope object in Microsoft Dot Net Programming Code?      TransactionScope is an object which queues all SQL transactions inside its block and add them to the database distributed transactions. Its main benefit with handling multiple transactions automatically is to allow one call code to commit all transactions or one call code to rollback all transactions.      Its main disadvantage is combining all its block transactions within distributed transactions in the database, and if more than one connection pool is used, then all these pools are blocked in the database until the whole queued transactions are processed. The wrong usage of this object makes the database as a simple file to save data where in simple file case, it is impossible to have multithreaded operations. These multithreaded operations are the main reason for inventing databases. This wrong usage leads to too much timeout exceptions and transactions dead lock most of the time that results in a very slow heavy loaded system.      In the TransactionScope block, you cannot prevent select database calls from not being included in the transaction which leads to a very big transaction logs, memory and very heavy recovery data in case transaction is rolled back for any reason.      The best usage is to use only one connection pool through the whole TransactionScope process. The main need of this object is in case you have database calls that you cannot modify and you need to combine them with your code. So, it gives a great help in rollback for database transactions that you cannot modify or change.      It is recommended to use pool and separated transactions within the database connection object which needs much more logic codes in transactions for commit and rollback well. This leads to very fast light transactions, makes SQL transactions able to be applied to none selectcommand calls to the database easily, and keeps the multithreaded ability active, in which the databases were invented in the first manner. TransactionScope Example: Good Transaction Example:   Code Elixir Notes By Mohamed Sobeh: Dot Net Code Elixir Number 0007: https://goo.gl/jbQqqF Draft 0007 Dot Net Code Elixir E-Book: https://goo.gl/HrygWP
  2. What is the difference between Managed Code and UnManaged Code in Microsoft Dot Net Programming Code? Managed Code:            Is written to target the services of the managed runtime execution environment (like Common Language Runtime in .NET Framework). Themanaged code is always executed by a managed runtime execution environment rather than the operating system directly. Managed refers to a method of exchanging information between the program and the runtime environment. Because the execution of code is governed by the runtime environment, the environment can guarantee what the code is going to do and provide the necessary security checks before executing any piece of code. Because of the same reason the managed code also gets different services from the runtime environment like Garbage Collection, type checking, exception handling, and bounds checking … etc. This way managed code does not have to worry about memory allocations, and type safety … etc. Applications written in Java, C#, and VB.NET … etc. target a runtime environment which manages the execution and the code written using these types of languages. These languages are known as Managed Code. Managed code is always compiled into an Intermediate Language (MSIL in case of .NET Framework). The compiler used by .NET framework to compile managed codecompiles it into Intermediate Language and generates the necessarymetadata, which is symbolic information that describes all of the entry points and the constructs exposed in the Intermediate Language (e.g., methods, properties) and their characteristics. The Common Language Infrastructure(CLI) Standard describes how the information is to be encoded, and programming languages that target the runtime emit the correct encoding.           In .NET Framework Managed Code runs within the .Net Framework’s CLR and benefits from the services provided by the CLR. When we compile the managed code, the code gets compiled to an intermediate language (MSIL) and an executable file is created. When a user runs the executable file, the Just In Time Compiler of CLR compiles the intermediate language into a native code specific to the underlying architecture. Since this translation happens by the managed execution environment (CLR), the managedexecution environment can make guarantees about what the code is going to do, because it can actually reason about it. It can insert traps and sort of protection around the code. If it’s running in a sandboxed environment, it can insert all the appropriate garbage collection hooks, exception handling, type safety, array bounce, index checking and so forth.           Managed code also provides platform independence. As the managed code is first compiled to intermediate language, the CLR’s JIT Compiler takes care of compiling this intermediate language into the architecture specific instructions. UnManaged Code:            Is directly executed by the Operating System. Typically, applications written in VB 6, C++, and C … etc. are all examples of unmanaged code.Unmanaged code typically targets the processor architecture and is always dependent on the computer architecture. UnManaged code is always compiled to target a specific architecture and will only run on the intended platform. This means that if you want to run the same code on different architecture, then you will have to recompile the code using that particular architecture. UnManaged code is always compiled to the native code which is architecture specific. When we compile unmanaged code, it gets compiled into a binary x86 image. This image always depends on the platform on which the code was compiled and cannot be executed on the other platforms that are different than the one on which the code was compiled. Unmanaged codedoes not get any services from the managed execution environment.           In unmanaged code, the memory allocation, type safety, and security … etc. need to be taken care of by the developer. This makes unmanaged codeprone to memory leaks like buffer overruns and pointer overrides and so forth.           UnManaged executable files are basically a binary image, x86 code, loaded into memory. The program counter gets put there and that’s the last the Operating System knows. There are protections in place around memory management and port I/O and so forth, but the system doesn’t actually know what the application is doing. What Dot Net FrameWork programming languages can use UnMaaged Code?           UnManaged code can be written with C++, and C# … etc. Dot Net FrameWork programming languages. Why UnManaged Code is needed? Legacy – native code long predates managed code, and there are still native apps to maintain. Performance – all things being equal, native code should be faster and have a smaller memory footprint than managed code (things are rarely equal though, and for I/O bound tasks, the difference is negligible); also, non-deterministic garbage collection can play hell with real-time code. System or hardware-specific hacks – native code may have access to system calls or libraries that the managed code may not (such as for parallel processing or vector processing, although I imagine most managed languages should be able to expose an API for such operations). No Virtual Machine (Dot Net FrameWork RunTime Environment) available – you may be targeting a system for which no Virtual Machine has been developed, or doesn’t have the resources to run managed code (such as a microcontroller or other embedded system); also, your target system may not need the capabilities of a full-up Virtual Machine (predominately CPU-bound tasks, limited I/O … etc.). Maximum speed of execution – The managed code layer adds around 10% overhead to the program. Maximum flexibility – Some features of some APIs are unavailable through the managed code library. Using unmanaged APIs from a managed code program is possible but more difficult, and introduces its own performance issues. Dot Net Code Elixir Number 0002: https://goo.gl/gDi0kw Draft 0002 Dot Net Code Elixir E-Book: https://goo.gl/HrygWP
  3. What is the difference between using Empty String (“”) vs (string.Empty) in Microsoft Dot Net Programming Code? Answer using C# Dot Net Programming Language: Code 1: string textValue = “”; Code 2: string textValue = string.Empty; Code 1: each time empty string quotes are found, they are translated to a new empty string object. So, each “” is a new allocated useless object in memory especially for string since string object is an Immutable object (Any action with the object will lead to new allocated object and not modify the used object). Code 2: each time string.Empty is used, all empty string variables are assigned to only one static string object which reduces memory used for empty strings by assigning all empty strings to only one global empty string object which has special MSIL code in Dot Net to handle all empty strings as only one global string object during Active Dot Net framework life time. Note: there are tests on the internet shows a very small difference in speed (Milliseconds) which means nothing in most applications, but the main point here is reducing memory mainly and reducing number of useless objects the Garbage Collector need to release from memory. Dot Net Code Elixir Number 0001: https://goo.gl/9ZDBez Draft 0001 Dot Net Code Elixir E-Book: https://goo.gl/HrygWP