Tutorial by Examples

When a tabular form is posted, the items in each record are available to PL/SQL code via the "APEX_APPLICATION.G_Fnn" arrays. G_F01 corresponds to the first editable column, G_F02 to the 2nd, and so on. For example, you can loop through each record and access the posted values for each fie...
Every Time you create an anonymous class, it retains an implicit reference to its parent class. So when you write: public class LeakyActivity extends Activity { ... foo.registerCallback(new BarCallback() { @Override public void onBar() { ...
Often you will want to wrap some of Android's classes in easier to use utility classes. Those utility classes often require a context to access the android OS or your apps' resources. A common example of this is a wrapper for the SharedPreferences class. In order to access Androids shared preference...
This is the code for changing output application file name (.apk). The name can be configured by assigning a different value to newName android { applicationVariants.all { variant -> def newName = "ApkName"; variant.outputs.each { output -> def ...
If you are optimizing all images manually, disable APT Cruncher for a smaller APK file size. android { aaptOptions { cruncherEnabled = false } }
synchronized is a low-level concurrency construct that can help preventing multiple threads access the same resources. Introduction for the JVM using the Java language. anInstance.synchronized { // code to run when the intristic lock on `anInstance` is acquired // other thread cannot enter co...
/* within a class, def, trait or object, but not a constructor */ synchronized { /* code to run when an intrisctic lock on `this` is acquired */ /* no other thread can get the this lock unless execution is suspended with * `wait` on `this` */ }
The GetParentFolderName method returns the parent folder for any path. While this can also be used with folders, it is arguably more useful for extracting the path from an absolute file path: Dim fso As New Scripting.FileSystemObject Debug.Print fso.GetParentFolderName("C:\Users\Me\My Docume...
In some cases it is necessary to calculate a variable amount of values on separate Futures. Assume to have a List[Future[Int]], but instead a List[Int] needs to be processed. Then the question is how to turn this instance of List[Future[Int]] into a Future[List[Int]]. For this purpose there is the s...
Creating a namedtuple with type hints is done using the function NamedTuple from the typing module: import typing Point = typing.NamedTuple('Point', [('x', int), ('y', int)]) Note that the name of the resulting type is the first argument to the function, but it should be assigned to a variable ...
Keeping a GUI responsive while running a lengthy process requires either some very elaborate "callbacks" to allow the GUI to process its message queue, or the use of (background) (worker) threads. Kicking off any number of threads to do some work usually isn't a problem. The fun starts wh...
Start with importing the library. from amqpstorm import Connection When consuming messages, we first need to define a function to handle the incoming messages. This can be any callable function, and has to take a message object, or a message tuple (depending on the to_tuple parameter defined in ...
Start with importing the library. from amqpstorm import Connection from amqpstorm import Message Next we need to open a connection to the RabbitMQ server. connection = Connection('127.0.0.1', 'guest', 'guest') After that we need to set up a channel. Each connection can have multiple channel...
PostgreSQL is an actively developed and mature open source database. Using the psycopg2 module, we can execute queries on the database. Installation using pip pip install psycopg2 Basic usage Lets assume we have a table my_table in the database my_database defined as follows. idfirst_namelast_n...
In the early forms of Fortran the only mechanism for creating global variable store visible from subroutines and functions is to use the COMMON block mechanism. This permitted sequences of variables to be names and shared in common. In addition to named common blocks there may also be a blank (unna...
Loops can be nested, to preform iterated task within another iterated task. Consider the following loops: ch = 'abc'; m = 3; for c = ch for k = 1:m disp([c num2str(k)]) % NUM2STR converts the number stored in k to a charachter, % so it can be concatanet...
If you want have a long text to display in the context, you need to set a custom content. For example, you have this: But you wish your text will be fully shown: All you need to do, is to add a style to your content like below: private void generateNotification(Context context) { ...
Following example shows steps involved in initializing a view from XIB. This is not a complex operation but exact steps need to be followed in order to do it right way first time, avoiding exceptions. How does loadNibNamed Works Main steps are: Create XIB Create class .h and .m Define outlet...
The first thing to do when taking your Meteor app offline is to create some visual indication of whether the local client app is connected to the server or not. There are lots of ways to do this, but the simplest way is to probably do something like this: Template.registerHelper('getOnlineStatus', ...
One of the easier steps is adding the appcache. Appcache will allow your application content to load even when there is no internet access. You won't be able to get any data from your mongo servers, but the static content and assets will be available offline. meteor add appcache

Page 445 of 1336