Tutorial by Examples: ect

Connection factories are the managed objects that allows application to connect to provider by creating Connection object. javax.jms.ConnectionFactory is an interface that encapsulates configuration parameters defined by an administrator. For using ConnectionFactory client must execute JNDI lookup ...
The Reflection API could be used to change values of private and final fields even in the JDK default library. This could be used to manipulate the behaviour of some well known classes as we will see. What is not possible Lets start first with the only limitation means the only field we can't chan...
Most KVO and KVC functionality is already implemented by default on all NSObject subclasses. To start observing a property named firstName of an object named personObject do this in the observing class: [personObject addObserver:self forKeyPath:@"firstName" ...
There are three ways to create a graphics object From the Paint Event Every time the control is redrawn (resized, refreshed...) this event is called, use this way if you want the control to consistently draw on the control 'this will work on any object's paint event, not just the form ...
This example shows how to get every year from this year to 2011 (2012 - 1). WITH yearsAgo ( myYear ) AS ( -- Base Case: This is where the recursion starts SELECT DATEPART(year, GETDATE()) AS myYear UNION ALL -- This MUST be UNION ALL (cannot be UNION) -- Recurs...
Lists def lst = ['foo', 'bar', 'baz'] // using implicit argument lst.each { println it } // using explicit argument lst.each { val -> println val } // both print: // foo // bar // baz Iterate with index def lst = ['foo', 'bar', 'baz'] // explicit arguments are required lst.each...
def lst = ['foo', 'bar', 'baz'] lst.collect { it } // ['foo', 'bar', 'baz'] lst.collect { it.toUpperCase() } // ['FOO', 'BAR', 'BAZ'] To collect keys or values from a maps def map = [foo: 'FOO', bar: 'BAR', baz: 'BAZ'] def keys = map.collect { it.key } // ['foo', 'bar', 'baz'] def vals = m...
From lists def lst = ['foo', 'bar', 'baz'] // for each entry return a list containing [key, value] lst.collectEntries { [it, it.toUpperCase()] } // [foo: FOO, bar: BAR, baz: BAZ] // another option, return a map containing the single entry lst.collectEntries { [(it): it.toUpperCase()] } // [...
Apply the transformation to non-collection entries, delving into nested collections too and preserving the whole structure. def lst = ['foo', 'bar', ['inner_foo', 'inner_bar']] lst.collectNested { it.toUpperCase() } // [FOO, BAR, [INNER_FOO, INNER_BAR]]
For more advanced regex operations it's best to use CL_ABAP_REGEX and its related classes. DATA: lv_test TYPE string, lo_regex TYPE REF TO cl_abap_regex. lv_test = 'The quick brown fox'. CREATE OBJECT lo_regex EXPORTING pattern = 'q(...)\w'. DATA(lo_matcher) = lo_regex->cr...
Collections and Maps evaluates to true if not null and not empty and false if null or empty /* an empty map example*/ def userInfo = [:] if (!userInfo) userInfo << ['user': 'Groot', 'species' : 'unknown' ] will add user: 'Groot' , species : 'unknown' as default userInfo since the u...
a null object reference evaluates to false, a non null reference to true, but for for strings, collections, iterators and enumerations it also takes into account the size. def m = null if (!m) println "empty" else println "${m}" will print "empty" de...
Of course, the best way to detect mobile is for the hardware to notify you directly. Cordova PhoneGap exposes a 'deviceready' event, that you can add an event listener to. document.addEventListener('deviceready', function(){ Session.set('deviceready', true); }, false);
HTML template files are always loaded before everything else Files beginning with main. are loaded last Files inside any lib/ directory are loaded next Files with deeper paths are loaded next Files are then loaded in alphabetical order of the entire path Reference Link Reference page: Mete...
Geospatial collections generally involve storing GeoJSON in the Mongo database, streaming that data to the client, accessing the browser's window.navigator.geolocation, loading up a Map API, converting GeoJSON to LatLngs, and plotting on the map. Preferably all in realtime. Here are a list of reso...
The following example will log all of your collection queries to the server console in realtime. Meteor.startup( function () { var wrappedFind = Meteor.Collection.prototype.find; // console.log('[startup] wrapping Collection.find') Meteor.Collection.prot...
Inspecting an Object You can find the public methods an object can respond to using either the methods or public_methods methods, which return an array of symbols: class Foo def bar; 42; end end f = Foo.new def f.yay; 17; end p f.methods.sort #=> [:!, :!=, :!~, :<=>, :==, :===, :=...
It is possible to query an object about its instance variables using instance_variables, instance_variable_defined?, and instance_variable_get, and modify them using instance_variable_set and remove_instance_variable: class Foo attr_reader :bar def initialize @bar = 42 end end f = F...
numpy.dot can be used to multiply a list of vectors by a matrix but the orientation of the vectors must be vertical so that a list of eight two component vectors appears like two eight components vectors: >>> a array([[ 1., 2.], [ 3., 1.]]) >>> b array([[ 1., 2., ...
Here we will be checking out the latest copy of our project's code, run the tests and will make the application live.To achieve that, follow below steps: Open Jenkins in browser. Click the New Job link. Enter project name and select the Build a free-style software project link. Click on Ok but...

Page 53 of 99