upload.pretilute.com | ||
ASP.NET PDF Viewer using C#, VB/NETGiven that ildasm.exe is a free tool that ships with the .NET Platform 2.0 SDK, this, obviously, means any individual is able to view the internal composition of your code libraries. Worse, using the File Dump menu option of ildasm.exe, it is possible to dump an assembly s CIL code to a local file. If you were to do so, you could open the resulting *.il file using any text editor. If an evildoer has some basic knowledge of the syntax of CIL, he or she could now alter any member to perform any evil task (scan the local hard drive for sensitive information, inject viruses, etc). Just for illustrative purposes, assume that you have updated the CIL code to change the string literal within GetSensitiveInformation to return "The magic value is FOO!" rather than the intended "The magic value is 9" (see Figure 5-2): how to add barcode font to excel 2003, download barcode for excel 2010, excel barcode add-in 2007, active barcode excel 2010 download, barcode for excel 2010 free, barcode add in for excel, excel barcode add in freeware, barcode formula for excel 2007, barcode in excel vba, how to print a barcode in excel 2010,The second kind of concrete type definition we look at in this section is a discriminated union. Here is a very simple example: type type type type Route = int Make = string Model = string Transport = | Car of Make * Model | Bicycle | Bus of Route 11 end; 12 13 procedure update_emp_info( p_empno in number, p_new_sal in number, p_new_ename in varchar2, p_ora_rowscn in number, p_num_of_rows_updated in out number ) 14 is 15 begin 16 p_num_of_rows_updated := 0; 17 update my_emp 18 set sal = p_new_sal, 19 ename = p_new_ename 20 where empno = p_empno 21 and p_ora_rowscn = ora_rowscn; 22 p_num_of_rows_updated := sql%rowcount; 23 end; 24 end; 25 / Package body created. The only difference between this package and the package opt_lock_chksum_demo discussed earlier is that here we use the pseudo column ora_rowscn instead of the checksum of modified column values. The Java class that invokes the preceding package to demonstrate optimistic locking would be exactly the same as the class DemoOptLockingUsingChecksum, except that it would use the package opt_lock_scn_demo instead of opt_lock_chksum_demo. Hence, I do not list it here, in order to conserve space. Each alternative of a discriminated union is called a discriminator. You can build values simply by using the discriminator much as if it were a function: > let nick = Car("BMW","360");; val nick : Transport > let don = [ Bicycle; Bus 8 ];; val don : Transport list > let james = [ Car ("Ford","Fiesta"); Bicycle ];; val james : Transport list You can also use discriminators in pattern matching: let averageSpeed (tr: Transport) = match tr with | Car _ -> 35 | Bicycle -> 16 | Bus _ -> 24 Several of the types you ve already met are defined as discriminated unions. For example, the 'a option type is defined as follows: We have covered many alternatives to implement optimistic locking. Which one should you use Usually the technique that saves the old values and does a simple comparison with the new values is the simplest and generally the best technique. It does make the APIs more complicated, though, since you need to pass the old and new values back and forth. It also adds to the network traffic depending on the number of columns being modified and their size. The technique that calculates the checksum proxies the old column values with a checksum. Checksum calculation can, however, take extra CPU time, and there does exist a tiny chance that the checksum for two different input values is the same. For an existing application, the technique of using a shadow column will work only if it is feasible to change the current tables to add the new columns for an existing application. And using ora_rowscn is feasible only if you are using 10g and you can create (or re-create) your tables with the rowdependencies option.
|