Tutorial by Examples

01 pointer-var usage POINTER. 01 character-field pic x(80) BASED value "Sample". ALLOCATE 1024 characters returning pointer-var ALLOCATE character-field ALLOCATE character-field INITIALIZED RETURNING pointer-var See http://open-cobol.sourceforge.net/faq/index.html#allo...
Julia code can create, manipulate, and execute command literals, which execute in the OS's system environment. This is powerful but often makes programs less portable. A command literal can be created using the `` literal. Information can be interpolated using the $ interpolation syntax, as with st...
Methods OnTriggerEnter() OnTriggerStay() OnTriggerExit() You can make a Collider into a Trigger in order to use the OnTriggerEnter(), OnTriggerStay() and OnTriggerExit() methods. A Trigger Collider will not physically react to collisions, other GameObjects simply pass through it. They are us...
Sometimes you might have branches lying around that have already had their changes merged into master. This finds all branches that are not master that have no unique commits as compared to master. This is very useful for finding branches that were not deleted after the PR was merged into master. ...
It's important to handle exceptions in your service. When developing the service, you can set the WCF to provide more detailed information, adding this tag to configuration file, usually Web.config: <serviceDebug includeExceptionDetailInFaults="true"/> This tag must be placed w...
You can handle exceptions and throw a most friendly message like 'Unavailable service' throwing a FaultException: try { // your service logic here } catch (Exception ex) { // You can do something here, like log the original exception throw new FaultException("There was a pro...
The FaultException can also includes a FaultCode, that is a string data you can use to pass additional information, so the client can be able to distinguish different exceptions: try { // your service logic here } catch (Exception ex) { throw new FaultException("There was a proble...
Example implementation of a prime factorization algorithm. A prime factorization algorithm will find for a given number n a list of primes, such that if you multiply those primes you get n. The below implementation will add -1 to the list of prime factors in case n < 0. Note that there exists no ...
Please note that by definition 1 is not a prime number. To check if a number n is a prime we should try to find a divisor i of n. If we cannot, then n is a prime. We have found a divisor when n % i == 0 evaluates to true. We only need to try odd numbers, since there's only one even prime, namely 2,...
void main() { var cat = new Cat(); print("Is cat hungry? ${cat.isHungry}"); // Is cat hungry? true print("Is cat cuddly? ${cat.isCuddly}"); // Is cat cuddly? false print("Feed cat."); cat.isHungry = false; print("Is cat ...
It took me a while to get this right, so I decided to share a solution because it might save someone else several days of trial and error. The problem: I want to be able to enable/disable WCF tracing in my C# .NET application and choose the trace output filename. I don't want users editing the .con...
-- Create and drop a view in the current database. CREATE VIEW few_rows_from_t1 AS SELECT * FROM t1 LIMIT 10; DROP VIEW few_rows_from_t1; -- Create and drop a view referencing a table in a different database. CREATE VIEW table_from_other_db AS SELECT x FROM db1.foo WHERE x IS NOT NULL; DROP V...
let playerLayoutChangeListener = new android.view.View.OnLayoutChangeListener( { onLayoutChange : function ( v:View, left:number, top:number, right:number, bottom:number, oldLeft:number, oldTop:number, oldRight:number, oldBottom:number):any { if (left != oldLeft || top != oldTop ...
A computed column is computed from an expression that can use other columns in the same table. The expression can be a noncomputed column name, constant, function, and any combination of these connected by one or more operators. Create table with a computed column Create table NetProfit ( Sa...
You can overload a def if the signature is different: def printValue(x: Int) { println(s"My value is an integer equal to $x") } def printValue(x: String) { println(s"My value is a string equal to '$x'") } printValue(1) // prints "My value is an integer equal ...
There are a few ways to inspect the contents of a zipfile. You can use the printdir to just get a variety of information sent to stdout with zipfile.ZipFile(filename) as zip: zip.printdir() # Out: # File Name Modified Size ...
Strings in Julia are delimited using the " symbol: julia> mystring = "Hello, World!" "Hello, World!" Note that unlike some other languages, the ' symbol cannot be used instead. ' defines a character literal; this is a Char data type and will only store a single Unico...
Multiple comparison operators used together are chained, as if connected via the && operator. This can be useful for readable and mathematically concise comparison chains, such as # same as 0 < i && i <= length(A) isinbounds(A, i) = 0 < i ≤ length(A) # same as Set...
We will look at how to implement custom comparisons by implementing a custom type, ordinal numbers. To simplify the implementation, we will focus on a small subset of these numbers: all ordinal numbers up to but not including ε₀. Our implementation is focused on simplicity, not speed; however, the i...
Julia supports a very large set of comparison operators. These include All of the following unicode sequences: > < >= ≥ <= ≤ == === ≡ != ≠ !== ≢ ∈ ∉ ∋ ∌ ⊆ ⊈ ⊂ ⊄ ⊊ ∝ ∊ ∍ ∥ ∦ ∷ ∺ ∻ ∽ ∾ ≁ ≃ ≄ ≅ ≆ ≇ ≈ ≉ ≊ ≋ ≌ ≍ ≎ ≐ ≑ ≒ ≓ ≔ ≕ ≖ ≗ ≘ ≙ ≚ ≛ ≜ ≝ ≞ ≟ ≣ ≦ ≧ ≨ ≩ ≪ ≫ ≬ ≭ ≮ ≯ ≰ ≱ ≲ ≳ ≴ ≵ ≶ ≷ ≸ ≹ ≺ ...

Page 776 of 1336