Tutorial by Examples: and

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...
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...
private static void saveItem(List<EventTracker> items) { List<WriteRequest> wrList = new ArrayList<>(); try { for (EventTracker item : items) { WriteRequest wreqItem; wreqItem = getWriteRequest(item); wrList.add(wreqItem);...
Technically, Ruby doesn't have functions, but methods. However, a Ruby method behaves almost identically to functions in other language: def double(n) n * 2 end This normal method/function takes a parameter n, doubles it and returns the value. Now let's define a higher order function (or met...
This example shows multiple producers and consumers sharing the same buffer. Protected entries in Ada implement a queue to handle waiting tasks. The default queuing policy is First In First Out. ------------------------------------------------------------------ -- Multiple producers and consumers ...
To include the base64 module in your script, you must import it first: import base64 The base64 encode and decode functions both require a bytes-like object. To get our string into bytes, we must encode it using Python's built in encode function. Most commonly, the UTF-8 encoding is used, howeve...
The base64 module also includes encoding and decoding functions for Base32. These functions are very similar to the Base64 functions: import base64 # Creating a string s = "Hello World!" # Encoding the string into bytes b = s.encode("UTF-8") # Base32 Encode the bytes e = b...
The base64 module also includes encoding and decoding functions for Base16. Base 16 is most commonly referred to as hexadecimal. These functions are very similar to the both the Base64 and Base32 functions: import base64 # Creating a string s = "Hello World!" # Encoding the string into...
Adobe created it's own encoding called ASCII85 which is similar to Base85, but has its differences. This encoding is used frequently in Adobe PDF files. These functions were released in Python version 3.4. Otherwise, the functions base64.a85encode() and base64.a85encode() are similar to the previous...
Just like the Base64, Base32, and Base16 functions, the Base85 encoding and decoding functions are base64.b85encode() and base64.b85decode(): import base64 # Creating a string s = "Hello World!" # Encoding the string into bytes b = s.encode("UTF-8") # Base85 Encode the byte...
Instead of typing our HTML markup into the return statements, we can use the render_template() function: from flask import Flask from flask import render_template app = Flask(__name__) @app.route("/about") def about(): return render_template("about-us.html") if __n...
To view your installed packages or themes, open settings with Ctrl+, and select either the "Packages" or "Themes" tab in the left-hand navigation bar. Note, the packages or themes you installed from other publishers will show up under the "Community Themes" section and ...
map() is a built-in function, which means that it is available everywhere without the need to use an 'import' statement. It is available everywhere just like print() If you look at Example 5 you will see that I had to use an import statement before I could use pretty print (import pprint). Thus ppr...
Keras is a high-level neural networks library, written in Python and capable of running on top of either TensorFlow or Theano. It was developed with a focus on enabling fast experimentation. Being able to go from idea to result with the least possible delay is key to doing good research. Use Keras ...
Uninstall-Module -Name <Name> -RequiredVersion <Version>
Locking on an stack-allocated / local variable One of the fallacies while using lock is the usage of local objects as locker in a function. Since these local object instances will differ on each call of the function, lock will not perform as expected. List<string> stringList = new List<st...
The continue statement in Objective-C programming language works somewhat like the break statement. Instead of forcing termination, however, continue forces the next iteration of the loop to take place, skipping any code in between. For the for loop, continue statement causes the conditional test a...

Page 122 of 153