Tutorial by Examples: er

Even with guard clauses, one cannot realistically always account for all possible error conditions that could be raised in the body of a procedure. The On Error GoTo statement instructs VBA to jump to a line label and enter "error handling mode" whenever an unexpected error occurs at runti...
Often when writing a specialized class, you'll want it to raise its own specific errors, and you'll want a clean way for user/calling code to handle these custom errors. A neat way to achieve this is by defining a dedicated Enum type: Option Explicit Public Enum FoobarError Err_FooWasNotBarre...
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_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...
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...
class Program { private static Lazy<ConnectionMultiplexer> _multiplexer = new Lazy<ConnectionMultiplexer>( () => ConnectionMultiplexer.Connect("localhost"), LazyThreadSafetyMode.ExecutionAndPublication); static void Main(string[] args...
In pointer arithmetic, the integer to be added or subtracted to pointer is interpreted not as change of address but as number of elements to move. #include <stdio.h> int main(void) { int array[] = {1, 2, 3, 4, 5}; int *ptr = &array[0]; int *ptr2 = ptr + sizeof(int) * 2; ...
Mesos is a cluster manager aiming for improved resource utilization by dynamically sharing resources among multiple frameworks. It was started at the University of California, Berkeley in 2009 and is in production use in many companies, including Twitter and Airbnb. It became an Apache top-level ...
docker network create app-backend This command will create a simple bridged network called appBackend. No containers are attached to this network by default.
docker network connect app-backend myAwesomeApp-1 This command attaches the myAwesomeApp-1 container to the app-backend network. When you add a container to a user-defined network, the embedded DNS resolver (which is not a full-featured DNS server, and is not exportable) allows each container on ...
docker network disconnect app-backend myAwesomeApp-1 This command detaches the myAwesomeApp-1 container from the app-backend network. The container will no longer be able to communicate with other containers on the network it has been disconnected from, nor use the embedded DNS resolver to look u...
docker network rm app-backend This command removes the user-defined app-backend network from the Docker host. All containers on the network not otherwise connected via another network will lose communication with other containers. It is not possible to remove the default bridge bridge network, th...
docker network inspect app-backend This command will output details about the app-backend network. The of the output of this command should look similar to: [ { "Name": "foo", "Id": "a0349d78c8fd7c16f5940bdbaf1adec8d8399b8309b2e8a969bd4e...
main.js A service worker is an event-driven worker registered against an origin and a path. It takes the form of a JavaScript file that can control the web page/site it is associated with, intercepting and modifying navigation and resource requests, and caching resources in a very granular fashio...
Data-only containers are obsolete and are now considered an anti-pattern! In the days of yore, before Docker's volume subcommand, and before it was possible to create named volumes, Docker deleted volumes when there were no more references to them in any containers. Data-only containers are obsolet...
The vast majority of modern JavaScript environments work according to an event loop. This is a common concept in computer programming which essentially means that your program continually waits for new things to happen, and when they do, reacts to them. The host environment calls into your program, ...

Page 133 of 417