Tutorial by Examples: by

Dim Value As Byte A Byte is an unsigned 8 bit data type. It can represent integer numbers between 0 and 255 and attempting to store a value outside of that range will result in runtime error 6: Overflow. Byte is the only intrinsic unsigned type available in VBA. The casting function to convert ...
'Declare an array of bytes, assign single-byte character codes, and convert to a string Dim singleByteChars(4) As Byte singleByteChars(0) = 72 singleByteChars(1) = 101 singleByteChars(2) = 108 singleByteChars(3) = 108 singleByteChars(4) = 111 Dim stringFromSingleByteChars As String stringFro...
'Declare an array of bytes, assign multi-byte character codes, and convert to a string Dim multiByteChars(9) As Byte multiByteChars(0) = 87 multiByteChars(1) = 0 multiByteChars(2) = 111 multiByteChars(3) = 0 multiByteChars(4) = 114 multiByteChars(5) = 0 multiByteChars(6) = 108 multiByteChar...
This is the first phase of referencing. Essentially when you assign by reference, you're allowing two variables to share the same value as such. $foo = &$bar; $foo and $bar are equal here. They do not point to one another. They point to the same place (the "value"). You can also...
Occasionally there comes time for you to implicitly return-by-reference. Returning by reference is useful when you want to use a function to find to which variable a reference should be bound. Do not use return-by-reference to increase performance. The engine will automatically optimize this o...
This allows you to pass a variable by reference to a function or element that allows you to modify the original variable. Passing-by-reference is not limited to variables only, the following can also be passed by reference: New statements, e.g. foo(new SomeClass) References returned from functi...
Strings can be assigned directly to byte arrays and visa-versa. Remember that Strings are stored in a Multi-Byte Character Set (see Remarks below) so only every other index of the resulting array will be the portion of the character that falls within the ASCII range. Dim bytes() As Byte Dim exampl...
Intent: Define an interface for creating an object, but let sub classes decide which class to instantiate. Factory Method lets a class defer instantiation to sub classes. UML diagram: Product: It defines an interface of the objects the Factory method creates. ConcreteProduct: Implements Produc...
Given a basic model: class SpreadsheetCells(Base): __tablename__ = 'spreadsheet_cells' id = Column(Integer, primary_key=True) y_index = Column(Integer) x_index = Column(Integer) You can retrieve an ordered list by chaining the order_by method. query = session.query(Spreads...
SELECT product, SUM(quantity) AS "Total quantity" FROM order_details GROUP BY product;
Assume a table of employees in which each row is an employee who has a name, a department, and a salary. SELECT department, MIN(salary) AS "Lowest salary" FROM employees GROUP BY department; This would tell you which department contains the employee with the lowest salary, and what t...
The contents of files and network messages may represent encoded characters. They often need to be converted to unicode for proper display. In Python 2, you may need to convert str data to Unicode characters. The default ('', "", etc.) is an ASCII string, with any values outside of ASCII ...
Subroutine arguments in Perl are passed by reference, unless they are in the signature. This means that the members of the @_ array inside the sub are just aliases to the actual arguments. In the following example, $text in the main program is left modified after the subroutine call because $_[0] in...
Const baseString As String = "Hello World" Dim byteLength As Long byteLength = LenB(baseString) 'byteLength = 22
[ alias ] ignored = ! git ls-files --others --ignored --exclude-standard --directory \ && git ls-files --others -i --exclude-standard Shows one line per file, so you can grep (only directories): $ git ignored | grep '/$' .yardoc/ doc/ Or count: ~$ git ignored | ...
Press controlr and type a pattern. For example, if you recently executed man 5 crontab, you can find it quickly by starting to type "crontab". The prompt will change like this: (reverse-i-search)`cr': man 5 crontab The `cr' there is the string I typed so far. This is an incremental s...
curl -XGET 'http://www.example.com:9200/myIndexName/myTypeName/1' Output: { "_index" : "myIndexName", "_type" : "myTypeName", "_id" : "1", "_version" : 1, "found": true, "_source&qu...
set myVariable [expr { $myVariable * 17 }] This shows how you can use a simple expression to update a variable. The expr command does not update the variable for you; you need to take its result and write it to the variable with set. Note that newlines are not important in the little language un...
$ git show dae86e1950b1277e545cee180551750029cfe735 $ git show dae86e19 You can specify revision (or in truth any object: tag, tree i.e. directory contents, blob i.e. file contents) using SHA-1 object name, either full 40-byte hexadecimal string, or a substring that is unique to the repository. ...
Bytecode is the set of instructions used by the JVM. To illustrate this let's take this Hello World program. public static void main(String[] args){ System.out.println("Hello World"); } This is what it turns into when compiled into bytecode. public static main([Ljava/lang/String...

Page 8 of 23