Tutorial by Examples: c

Vim comes with several pre-installed color schemes. In Linux, the color schemes that come with Vim are stored in /usr/share/vim/vim74/colors/ (where 74 is your version number, sans periods); MacVim stores them in /Applications/MacVim.app/Contents/Resources/vim/runtime/colors. Changing Color Schemes...
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` */ }
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...
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 ...
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...
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...
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
The appcache will cause some confusion in your development workflow, because it hides Meteor's auto-updating features. When you turn off the server component of your app, the client portion in your browser will continue working. This is a good thing! But, you don't get the immediate feedback that ...
The first step to logging is simply to run Meteor from the shell, and you'll get the server logs in the command console. meteor The next step is to pipe the contents of std_out and std_err to a logfile, like so: meteor > my_app_log.log 2> my_app_err.log
Once you have your server side logging in place, it's time to hop over to the client side. If you haven't explored the console API, be prepared for a treat. There's actually all sorts of things that you can do with the built in Console API that's native to every Chrome and Safari installation. So mu...
Once you have both your server-side logging running, and your client side development tools, you can start looking at Meteor specific extensions like the Meteor Chrome DevTools Extension. This lets you actually observe server logging in the client! Because the database is everywhere. As is logging. ...
The following uses the Chrome Logging API. If the .group() syntax is used in multiple templates, it will graphically organize the console logs from different templates into a hierarchical tree. You can also see how to inspect the current data context, and how to stringify data. Template.landingPa...

Page 275 of 826