Tutorial by Examples: c

The entire idea with dependency injection is that a class does not instantiate its dependencies but requests them (through constructor or property). Using Castle the way for specifying the way to resolve a dependency is by using the DependsOn: public class Foo : IFoo { public Foo(IBar bar, st...
When registering a component use the Interceptors() method to specify what are the interceptors/types of interceptors to be used for this component: The TInterceptor must implement the IInterceptor interface A single interceptor by type: container.Register( Component.For<MyInterceptor>...
<PropertyGroup> <DirectoryToCreate>NewDirectory</DirectoryToCreate> </PropertyGroup> <MakeDir Directories="$(DirectoryToCreate)" />
<PropertyGroup> <DirectoryToRemove>TempData</DirectoryToRemove> </PropertyGroup> <RemoveDir Directories="$(DirectoryToRemove)" />
<Exec Command="echo Hello World" />
<PropertyGroup> <CustomMessage>Hello World</CustomMessage> <MessageImportance>Low</MessageImportance> <!-- Low / Normal / High --> </PropertyGroup> <Message Text="$(CustomMessage)" Importance="$(MessageImportance)" /> ...
<PropertyGroup> <LinkedSolution>LinkedSolution.sln</LinkedSolution> <BuildType>Build</BuildType> <!-- Build / Rebuild --> <BuildArchitecture>x86</BuildArchitecture> <!-- x86 / 64 --> <BuildConfiguration>Debug</BuildCo...
1) Services A service is a constructor function that is invoked once at runtime with new, just like what we would do with plain javascript with only difference that AngularJs is calling the new behind the scenes. There is one thumb rule to remember in case of services Services are constructors...
There is no additional installation required for excel-formula on top of what is already required for excel. Please refer to excel documentation.
Eclipse debugging starts with what is referred to as Agents. The JVM, which runs the complied .class sources has a feature that allows externally libraries (written in either Java or C++) to be injected into the JVM, just about runtime. These external libraries are referred to as Agents and they ha...
Via jCenter including the following in your project's build.gradle file: compile 'com.google.android.exoplayer:exoplayer:rX.X.X' where rX.X.X is the your preferred version. For the latest version, see the project's Releases. For more details, see the project on Bintray.
// 1. Instantiate the player. player = ExoPlayer.Factory.newInstance(RENDERER_COUNT); // 2. Construct renderers. MediaCodecVideoTrackRenderer videoRenderer = ... MediaCodecAudioTrackRenderer audioRenderer = ... // 3. Inject the renderers through prepare. player.prepare(videoRenderer, audioRend...
public class ReplaceFont { public static void changeDefaultFont(Context context, String oldFont, String assetsFont) { Typeface typeface = Typeface.createFromAsset(context.getAssets(), assetsFont); replaceFont(oldFont, typeface); } private static void replaceFont(String oldFont, Type...
Add the required libraries into the dependencies section of your Android module's build.gradle: android { ... defaultConfig { ... testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } } dependencies { ... androidTestCompile 'com.android.su...
In order to enable writing more complex UI tests the UIAutomatorViewer is needed. The tool located at /tools/ makes a fullscreen screenshot including the layouts of the currently displayed views. See the subsequent picture to get an idea of what is shown: For the UI tests we are looking for resou...
Putting UIAutomator tests together to a test suite is a quick thing: package de.androidtest.myapplication; import org.junit.runner.RunWith; import org.junit.runners.Suite; @RunWith(Suite.class) @Suite.SuiteClasses({InterAppTest1.class, InterAppTest2.class}) public class AppTestSuite {} ...
This example creates a MediaSession object when a Service is started. The MediaSession object is released when the Service gets destroyed: public final class MyService extends Service { private static MediaSession s_mediaSession; @Override public void onCreate() { // Insta...
Form controls have some default styling without using any special classes. However labels and controls can be wrapped in .form-group tags for optimum spacing. <form> <div class="form-group"> <label for="input-email">Email address</label> &lt...
Trigger speech to text translation private void startListening() { //Intent to listen to user vocal input and return result in same activity Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); //Use a language model based on free-form speech recognition. ...
The following code can be used to trigger speech-to-text translation without showing a dialog: public void startListeningWithoutDialog() { // Intent to listen to user vocal input and return the result to the same activity. Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEEC...

Page 532 of 826