Tutorial by Examples: al

Def: Final Keyword prevents child classes from overriding a method by prefixing the definition with final. If the class itself is being defined final then it cannot be extended Final Method class BaseClass { public function test() { echo "BaseClass::test() called\n"; } ...
Lazy evaluation means Haskell will evaluate only list items whose values are needed. The basic recursive definition is: f (0) <- 0 f (1) <- 1 f (n) <- f (n-1) + f (n-2) If evaluated directly, it will be very slow. But, imagine we have a list that records all the results, fibs ...
Query: SELECT * FROM Customers ORDER BY CustomerID LIMIT 3; Result: CustomerID CustomerName ContactName Address City PostalCode Country 1 Alfreds Futterkiste Maria Anders Obere Str. 57 Berlin 12209 Ge...
The Kotlin Standard Library also provides numerous useful functions to iteratively work upon collections. For example, the map function can be used to transform a list of items. val numbers = listOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 0) val numberStrings = numbers.map { "Number $it" } One of...
Use Conditionals via (syntax is in [brackets]): when [when:] Task: - name: run if operating system is debian command: echo "I am a Debian Computer" when: ansible_os_family == "Debian" loops [with_items:] loops [with_dicts:] Custom Facts [ wh...
Ordering the results and setting a limit can easily be achieved with 2 additional lines added to the chain, like so: $db = JFactory::getDbo(); $query = $db->getQuery(true); $query->select('*') ->from('#__users') ->where('username = '. $db->q('John')) ->ord...
iText for Java Importing the iText jars from the Central Maven Repository is the best way to install iText 7. These simple videos explain how to do this using different IDEs: How to import iText 7 in Eclipse to create a Hello World PDF? How to import iText 7 in Netbeans to create a Hello World ...
1. Add Devise Gem Open up your Gemfile and add this line gem 'devise' Then run; bundle install 2. Set up devise in your app Run the following command in the terminal rails g devise:install 3. Configure Devise Ensure you have defined default url options in your environments files. Open...
The degree of parallelism is the maximum number of concurrently executing tasks that will be used to process the query. var sequence = Enumerable.Range(1, 10000); var evenNumbers = sequence.AsParallel() .WithDegreeOfParallelism(4) .Where(x =&gt...
ADO connections can be used to perform pretty much any database function that the provider supports via SQL. In this case it isn't always necessary to use the Recordset returned by the Execute function, although it can be useful for obtaining key assignments after INSERT statements with @@Identity o...
The purpose of this example is to show how we can realize the Strategy pattern using Java 8 functional interfaces. We will start with a simple use case codes in classic Java, and then recode it in the Java 8 way. The example problem we using is a family of algorithms (strategies) that describe dif...
Hierarchy - LinearLayout(horizontal) - ImageView - LinearLayout(vertical) - TextView - TextView Code LinearLayout rootView = new LinearLayout(context); rootView.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT)); rootView.s...
With the appropriate storage backend running a new titan graph can be initialised via: graph = TitanFactory.open("config.properties"); Wehere config.properties defines several configurations relevant to the storage backend. Titan provides some sample configs in its downloadable package...
First, install socket.io module in node.js application. npm install socket.io --save Basic HTTP Setup The following example attaches socket.io to a plain node.js HTTP server listening on port 3000. var server = require('http').createServer(); var io = require('socket.io')(server); io.on(...
JasperReports Library JasperReports is a open source Java based reporting tool. The JasperReports Library can be downloaded from the Jaspersoft Community for the latest release. In recent releases the third-party jars in the lib folder are not distributed, they need to be download from public r...
Windows Phone 8.1 SDK requires Visual Studio. Either check "SDK" when installing Visual Studio or install the SDK directly here.
You should initialize state inside the constructor function of your component like this: export default class MyComponent extends Component { constructor(props) { super(props); this.state = { myInteger: 0 } } render() { return ( <View> ...
To initialize react-native init MyAwesomeProject To initialize with a specific version of React Native react-native init --version="0.36.0" MyAwesomeProject To Run for Android cd MyAwesomeProject react-native run-android To Run for iOS cd MyAwesomeProject react-native run-io...
Detailed instructions on getting windows-phone set up or installed.
Given a String containing the name of a class, it's Class object can be accessed using Class.forName: Class clazz = null; try { clazz = Class.forName("java.lang.Integer"); } catch (ClassNotFoundException ex) { throw new IllegalStateException(ex); } Java SE 1.2 It can be s...

Page 94 of 269