Tutorial by Examples: c

When dealing with large configuration sets of value, it might become quite unhandy to load them one buy one. Option model which comes with asp.net offers a convenient way to map a section to a dotnet poco: For instance, one might hydrate StorageOptions directly from a configuration section b addin...
You can also source configuration from an in memory object such as a Dictionary<string,string> .AddInMemoryCollection(new Dictionary<string, string> { ["akey"] = "a value" }) This can reveal helpful in integration/unit testing scenarios.
To use OpenGL ES in your application you must add this to the manifest: <uses-feature android:glEsVersion="0x00020000" android:required="true"/> Create your extended GLSurfaceView: import static android.opengl.GLES20.*; // To use all OpenGL ES 2.0 methods and constants...
In order to be able to directly deploy web project changes to an Web Server, the following steps must be followed. If target server has Internet access, the process is quite simple, as Microsoft has a Web Platform package to do almost everything that is needed. Cleanup Make sure that C:\Progra...
While good software design often maximizes code reusability, sometimes it can be useful to define asynchronous tasks inline in your code via Lambda expressions to maximize code readability. In this example, we will create a single class which contains a main() method. Inside this method, we will us...
import com.couchbase.client.core.endpoint.SSLEngineFactory import com.couchbase.client.java.env.DefaultCouchbaseEnvironment import com.couchbase.client.java.CouchbaseCluster object CouchbaseConnection extends App { //Create default environment object. //Set the keystone file path(downlo...
The Assets folder is the most common place to store your GLSL-ES shader files. To use them in your OpenGL ES application you need to load them to a string in the first place. This functions creates a string from the asset file: private String loadStringFromAssetFile(Context myContext, String filePa...
A function returns everything that is not captured by something else. If u use the return keyword, every statement after the return line will not be executed! Like this: Function Test-Function { Param ( [switch]$ExceptionalReturn ) "Start" if($Exceptio...
Character literals provide the most convenient way to express char values in Java source code. A character literal consists of: An opening single-quote (') character. A representation of a character. This representation cannot be a single-quote or a line-break character, but it can be an escap...
At the very core, your entity main DAC must have GUID column (NoteID) to reference CSAnswers table and must have field that identify the class of the Entity. We will make use of Order Type to define list of attributes to gather particular order type-specific information. Create a Graph Extension f...
var indexController = myApp.controller("indexController", function ($scope) { // Application logic goes here });
While using Image/Colour as an background in a CardView, You might end up with slight white paddings (If default Card colour is white) on the edges. This occurs due to the default rounded corners in the Card View. Here is how to avoid those margins in Pre-lollipop devices. We need to use an attribu...
Fully configuration of Web deployment without Internet connection (offline) is harder to make because Web platform installer (UI) operates by querying packages list and content from an Internet location. Cleanup Make sure that C:\Program Files\IIS does not contain older version of Microsoft We...
To be able to change the view location, you need to implement the IViewLocationExpander. The ExpandViewLocations method returns an IEnumerable<string> containing the different locations where to search, with public class MyViewLocationExpander : IViewLocationExpander { public IEnumerabl...
You now need to register the Expander, in order for it to be used by the Razor View Engine. Just add this in the ConfigureServices of your Startup class. public void ConfigureServices(IServiceCollection services) { services.Configure<RazorViewEngineOptions>(options => { opti...
This method is to check data connection by ping certain IP or Domain name. public Boolean isDataConnected() { try { Process p1 = java.lang.Runtime.getRuntime().exec("ping -c 1 8.8.8.8"); int returnVal = p1.waitFor(); boolean reachable = (returnVal==0); ...
public static boolean isConnectedNetwork (Context context) { ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); return cm.getActiveNetworkInfo () != null && cm.getActiveNetworkInfo ().isConnectedOrConnecting (); ...
Toasts are generally used when we want to display an information to the user regarding some action that has successfully (or not) happened and this action does not require the user to take any other action. Like when a message has been sent, for example: Toast.makeText(this, "Message Sent!&quo...
From Apple documentation for IV, This parameter is ignored if ECB mode is used or if a stream cipher algorithm is selected. func AESEncryption(key: String) -> String? { let keyData: NSData! = (key as NSString).data(using: String.Encoding.utf8.rawValue) as NSData! ...

Page 677 of 826