Tutorial by Examples: acl

A commonly used utility library is Lodash. To install it into your Aurelia CLI driven application first you need to install it using Npm. npm install lodash --save Now in your preferred IDE/code editor open up the following file in your project directory: aurelia_project/aurelia.json and scroll do...
Given the 4 points of a cubic Bezier curve the following function returns its length. Method: The length of a cubic Bezier curve does not have a direct mathematical calculation. This "brute force" method finds a sampling of points along the curve and calculates the total distance spanne...
This basic example shows how an application can instantiate a classloader and use it to dynamically load a class. URL[] urls = new URL[] {new URL("file:/home/me/extras.jar")}; Classloader loader = new URLClassLoader(urls); Class<?> myObjectClass = loader.findClass("com.exampl...
There are frequent behavior patterns that can result in a lot of boilerplate code. By declaring a method that takes a Closure as a parameter, you can simplify your program. As an example, it is a common pattern to retrieve a database connection, start a transaction, do work, and then either commit ...
Defining the base class: open class BaseClass { val x = 10 } Defining the derived class: class DerivedClass: BaseClass() { fun foo() { println("x is equal to " + x) } } Using the subclass: fun main(args: Array<String>) { val derivedClass = Deri...
Defining the base class: open class Person { fun jump() { println("Jumping...") } } Defining the derived class: class Ninja: Person() { fun sneak() { println("Sneaking around...") } } The Ninja has access to all of the methods in Pe...
Unity networking provides the High Level API (HLA) to handle network communications abstracting from low level implementations. In this example we will see how to create a Server that can communicate with one or multiple clients. The HLA allows us to easily serialize a class and send objects of ...
Pre-requisites: cx_Oracle package - See here for all versions Oracle instant client - For Windows x64, Linux x64 Setup: Install the cx_Oracle package as: sudo rpm -i <YOUR_PACKAGE_FILENAME> Extract the Oracle instant client and set environment variables as: ORACLE_HOME=&...
import scala.reflect.runtime.universe._ val mirror = runtimeMirror(getClass.getClassLoader) val module = mirror.staticModule("org.data.TempClass")
Modern browsers provide a classList object to ease manipulation of the element's class attribute. Older browsers require direct manipulation of the element's className property. * Note class names are not stored in the element's property in any particular order W3C DOM4 Removing one class from an...
Modern browsers provide a classList object to ease manipulation of the element's class attribute. Older browsers require direct manipulation of the element's className property. * Note class names are not stored in the element's property in any particular order W3C DOM4 Testing if an element cont...
The Maven Surefire plugin runs during the test phase of the Maven build process or when test is specified as a Maven goal. The following directory structure and minimum pom.xml file will configure Maven to run a test. Directory structure inside the project's root directory: ─ project_root ├─ p...
Suppose you have a table and you want to change one of this table primary id. you can use the following scrpit. primary ID here is "PK_S" begin for i in (select a.table_name, c.column_name from user_constraints a, user_cons_columns c where a.CONSTRAINT_TYPE...
Suppose you have the table T1 and it has relation with many tables and its primary key constraint name is "pk_t1" you want to disable these foreign keys you can use: Begin For I in (select table_name, constraint_name from user_constraint t where r_constraint_name='pk_t1') loop E...
Use the analytical function row_number(): with t as ( select col1 , col2 , row_number() over (order by col1, col2) rn from table ) select col1 , col2 from t where rn between N and M; -- N and M are both inclusive Oracle 12c handles this more easily with OFFSET and FETCH.
Using the Swift class Mirror works if you want to extract name, value and type (Swift 3: type(of: value), Swift 2: value.dynamicType) of properties for an instance of a certain class. If you class inherits from NSObject, you can use the method class_copyPropertyList together with property_getAttrib...
Monkey patching is the modification of classes or objects outside of the class itself. Sometimes it is useful to add custom functionality. Example: Override String Class to provide parsing to boolean class String def to_b self =~ (/^(true|TRUE|True|1)$/i) ? true : false end end A...
PHPUnit provides the following function to assert whether an object is an instance of a class: assertInstanceOf($expected, $actual[, $message = '']) The first parameter $expected is the name of a class (string). The second parameter $actual is the object to be tested. $message is an optional ...
Okay it took me about a day to figure it out so here I am posting the steps I followed to get my Database First working in a Class Project (.NET Core), with a .NET Core Web App. Step 1 - Install .NET Core Make Sure you are using .NET Core not DNX (Hint: You should be able to see the .NET Core opti...
What is a metaclass? In Python, everything is an object: integers, strings, lists, even functions and classes themselves are objects. And every object is an instance of a class. To check the class of an object x, one can call type(x), so: >>> type(5) <type 'int'> >>> typ...

Page 4 of 6