Tutorial by Examples

By Assembly Name, add library Add-Type -AssemblyName "System.Math" or by file path: Add-Type -Path "D:\Libs\CustomMath.dll" To Use added type: [CustomMath.NameSpace]::Method(param1, $variableParam, [int]castMeAsIntParam)
Directives can be used to build reusable components. Here is an example of a "user box" component: userBox.js angular.module('simpleDirective', []).directive('userBox', function() { return { scope: { username: '=username', reputation: '=reputation' }, ...
Once Powershell remoting is enabled (Enable-PSRemoting) You can run commands on the remote computer like this: Invoke-Command -ComputerName "RemoteComputerName" -ScriptBlock { Write host "Remote Computer Name: $ENV:ComputerName" } The above method creates a temporary se...
CREATE VIEW view_EmployeeInfo AS SELECT EmployeeID, FirstName, LastName, HireDate FROM Employee GO Rows from views can be selected much like tables: SELECT FirstName FROM view_EmployeeInfo You may also create a view with a calculated column. We can...
CREATE VIEW view_EmployeeInfo WITH ENCRYPTION AS SELECT EmployeeID, FirstName, LastName, HireDate FROM Employee GO
CREATE VIEW view_PersonEmployee AS SELECT P.LastName, P.FirstName, E.JobTitle FROM Employee AS E INNER JOIN Person AS P ON P.BusinessEntityID = E.BusinessEntityID GO Views can use joins to select data from numerous sources like tables, table functio...
UPDATE HelloWorlds SET HelloWorld = 'HELLO WORLD!!!' WHERE Id = 5 The above code updates the value of the field "HelloWorld" with "HELLO WORLD!!!" for the record where "Id = 5" in HelloWorlds table. Note: In an update statement, It is advised to use a "where&...
A simple form of updating is incrementing all the values in a given field of the table. In order to do so, we need to define the field and the increment value The following is an example that increments the Score field by 1 (in all rows): UPDATE Scores SET score = score + 1 This can be dang...
The obvious way to zero a register is to MOV in a 0—for example: B8 00 00 00 00 MOV eax, 0 Notice that this is a 5-byte instruction. If you are willing to clobber the flags (MOV never affects the flags), you can use the XOR instruction to bitwise-XOR the register with itself: 33 C0 ...
Background If the Carry (C) flag holds a value that you want to put into a register, the naïve way is to do something like this: mov al, 1 jc NotZero mov al, 0 NotZero: Use 'sbb' A more direct way, avoiding the jump, is to use "Subtract with Borrow": sbb al,a...
Background To find out if a register holds a zero, the naïve technique is to do this: cmp eax, 0 But if you look at the opcode for this, you get this: 83 F8 00 cmp eax, 0 Use test test eax, eax ; Equal to zero? Examine the opcode you get: 85 c0 test ea...
We will use the built in tooth growth dataset. We are interested in whether there is a statistically significant difference in tooth growth when the guinea pigs are given vitamin C vs orange juice. Here's the full example: teethVC = ToothGrowth[ToothGrowth$supp == 'VC',] teethOJ = ToothGrowth[To...
The rep function can be used to repeat a vector in a fairly flexible manner. # repeat counting numbers, 1 through 5 twice rep(1:5, 2) [1] 1 2 3 4 5 1 2 3 4 5 # repeat vector with incomplete recycling rep(1:5, 2, length.out=7) [1] 1 2 3 4 5 1 2 The each argument is especially useful for ex...
var multiplexer = ConnectionMultiplexer.Connect("localhost"); IDatabase db = multiplexer.GetDatabase(); // intialize key with empty string await db.StringSetAsync("key", ""); // create transaction that utilize multiplexing and pipelining ITransaction transacton...
History The first computers Early computers had a block of memory that the programmer put code and data into, and the CPU executed within this environment. Given that the computers then were very expensive, it was unfortunate that it would do one job, stop and wait for the next job to be loaded in...
High Level Design The 80386 is a 32-bit processor, with a 32-bit addressable memory space. The designers of the Paging subsystem noted that a 4K page design mapped into those 32 bits in quite a neat way - 10 bits, 10 bits and 12 bits: +-----------+------------+------------+ | Dir index | Page ind...
The 80486 Paging Subsystem was very similar to the 80386 one. It was backward compatible, and the only new features were to allow for memory cache control on a Page-by-Page basis - the OS designers could mark specific pages as not to be cached, or to use different write-through or write-back caching...
When the Pentium was being developed, memory sizes, and the programs that ran in them, were getting larger. The OS had to do more and more work to maintain the Paging Subsystem just in the sheer number of Page Indexes that needed to be updated when large programs or data sets were being used. So th...
class Program { private static Lazy<ConnectionMultiplexer> _multiplexer = new Lazy<ConnectionMultiplexer>( () => ConnectionMultiplexer.Connect("localhost"), LazyThreadSafetyMode.ExecutionAndPublication); static void Main(string[] args...
Connect to Redis server and allow admin (risky) commands ConfigurationOptions options = new ConfigurationOptions() { EndPoints = { { "localhost", 6379}}, AllowAdmin = true, ConnectTimeout = 60*1000, }; Connectio...

Page 422 of 1336