Tutorial by Examples: cet

It is common for an AsyncTask to require a reference to the Activity that called it. If the AsyncTask is an inner class of the Activity, then you can reference it and any member variables/methods directly. If, however, the AsyncTask is not an inner class of the Activity, you will need to pass an A...
Instead of web pages, we can also load the document files into iOS WebView like .pdf, .txt, .doc etc.. loadData method is used to load NSData into webview. Swift //Assuming there is a text file in the project named "home.txt". let localFilePath = NSBundle.mainBundle().pathForResource(&...
Sometimes specific instances of data should be used. Recreation is not desired and referencing static data would have a code smell. It is possible to specify a XmlAdapter instance the Unmarshaller should use, which allows the user to use XmlAdapters with no zero-arg constructor and/or pass data to ...
Sometimes gotoAndStop() is called in the middle of the code that refers some frame-based properties. But, right after the frame is changed all links to properties that existed on the current frame are invalidated, so any processing that involves them should be immediately terminated. There are two ...
NgZone reference can be injected via the Dependency Injection (DI). my.component.ts import { Component, NgOnInit, NgZone } from '@angular/core'; @Component({...}) export class Mycomponent implements NgOnInit { constructor(private _ngZone: NgZone) { } ngOnInit() { this._ngZone.runO...
This linker error happens, if the linker can't find a used symbol. Most of the time, this happens if a used library is not linked against. qmake: LIBS += nameOfLib cmake: TARGET_LINK_LIBRARIES(target nameOfLib) g++ call: g++ -o main main.cpp -Llibrary/dir -lnameOfLib One might also for...
Sharing a simple string was easy, but you can do much more. In this example, I'll also store a complete array of strings, along with a gradient brush to be used for the background. This should give you a pretty good idea of just how much you can do with resources: <Window x:Class="WPFApplic...
This is an example of a package-info.java file that binds an XML namespace to a serializable Java class. This should be placed in the same package as the Java classes that should be serialized using the namespace. /** * A package containing serializable classes. */ @XmlSchema ( xmlns = ...
MERGE INTO TargetTable AS Target USING (VALUES (1,'Value1'), (2, 'Value2'), (3,'Value3')) AS Source (PKID, ColumnA) ON Target.PKID = Source.PKID WHEN MATCHED THEN UPDATE SET target.ColumnA= source.ColumnA WHEN NOT MATCHED THEN INSERT (PKID, ColumnA) VALUES (Source.PKID...
Enable Offline Work: Click File -> Settings. Search for "gradle" and click in Offline work box. Go to Compiler (in same settings dialog just below Gradle) and add --offline to Command-line Options text box. Improve Gradle Performance Add following two line of code in your gradle...
Do not allocate new objects in onDraw @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); Paint paint = new Paint(); //Do not allocate here } Instead of drawing drawables in canvas... drawable.setBounds(boundsRect); drawable.draw(canvas); Use a B...
Website: https://www.sourcetreeapp.com Price: free (account is necessary) Platforms: OS X and Windows Developer: Atlassian
If you have multiple libraries in the same solution, you can add local (project) references between them: { "dependencies": { "NETStandard.Library": "1.6.0", "MyOtherLibrary": { "target": "project" } }...
Single character escape sequences Some escape sequences consist of a backslash followed by a single character. For example, in alert("Hello\nWorld");, the escape sequence \n is used to introduce a newline in the string parameter, so that the words "Hello" and "World" ...
One of the core benefits of Typescript is that it enforces data types of values that you are passing around your code to help prevent mistakes. Let's say you're making a pet dating application. You have this simple function that checks if two pets are compatible with each other... checkCompatible...
This example has two parts - some boilerplate steps for adding Castle Windsor to your WCF service, and then a simple, concrete example to show how we configure and use Windsor's container. That makes the example a little bit long. If you already understand using a DI container then you likely only ...
To save a reference to a cell in a variable, you must use the Set syntax, for example: Dim R as Range Set R = ActiveSheet.Cells(3, 1) later... R.Font.Color = RGB(255, 0, 0) Why is the Set keyword required? Set tells Visual Basic that the value on the right hand side of the = is meant to be ...
In Symfony, the built-in ChoiceType (and EntityType or DocumentType extending it), basicaly work with a constant choice list. If you want to make it work with ajax calls, you have to change them to accept any sumitted extra choices. How to start with an empty choice list ? When you build your...
Atlassian SourceTree is a visual tool for Mac and Windows to manage source code repositories. This can be used with Codecommit as a remote repository but need to add an extra configuration option to the local repository in SourceTree to be able to connect with codecommit. First, setup Codecommit fo...
Sometimes you need to replace a value matching a pattern with a new value that's based on that specific match, making it impossible to predict the new value. For these types of scenarios, a MatchEvaluator can be very useful. In PowerShell, a MatchEvaluator is as simple as a scriptblock with a singl...

Page 2 of 4