Tutorial by Examples: ado

r.connect({host: 'localhost', port: 28015}) .then((conn) => { return r.db("stackoverflow").table("examples") .insert({ // If `id` is not set, will automatically generate a UUID id: 1, name: 'Thinker', // Wi...
r.connect({host: 'localhost', port: 28015}) .then((conn) => { // Can also use .get({id: 1}) return r.db("stackoverflow").table("examples").get(1).run(conn) }).then((result) => { console.log(result); })
LaraDock is a Laravel Homestead like development environment but for Docker instead of Vagrant. https://github.com/LaraDock/laradock Installation *Requires Git and Docker Clone the LaraDock repository: A. If you already have a Laravel project, clone this repository on your Laravel root director...
Because of how gerrit relies on change-ids, in order to resolve conflicts (pull changes to your topic branch) the best practice is to rebase topic branch onto master/other branch you want to push to. This way you preserve the change-id without having to ammend the merge commit. For example if you su...
Another good practice to check when our threads have finished without block the thread waiting to recover the Future object from our Callable is to create our own implemetation for Runnables, using it together with the execute() method. In the next example, I show a custom class which implements Ru...
All we need are: ViewPager, TabLayout and 2 drawables for selected and default dots. Firstly, we have to add TabLayout to our screen layout, and connect it with ViewPager. We can do this in two ways: Nested TabLayout in ViewPager <android.support.v4.view.ViewPager android:id="@+i...
Using the Constructor A ReadOnlyCollection is created by passing an existing IList object into the constructor: var groceryList = new List<string> { "Apple", "Banana" }; var readOnlyGroceryList = new ReadOnlyCollection<string>(groceryList); Using LINQ Additiona...
A ReadOnlyCollection cannot be edited directly. Instead, the source collection is updated and the ReadOnlyCollection will reflect these changes. This is the key feature of the ReadOnlyCollection. var groceryList = new List<string> { "Apple", "Banana" }; var readOnlyGroc...
If the source collection is of a type that is not immutable, elements accessed through a ReadOnlyCollection can be modified. public class Item { public string Name { get; set; } public decimal Price { get; set; } } public static void FillOrder() { // An order is generated ...
Apart from CSS, model, and binding selectors, protractor can also locate elements using xpath View <ul> <li><a href='http://www.google.com'>Go to google</a></li> </ul> Code var googleLink= element(by.xpath('//ul/li/a')); expect(element.getText()).to.event...
Due to way that the float type is represented in computer memory, results of operations using this type can be inaccurate - some values are stored as approximations. Good examples of this are monetary calculations. If high precision is necessary, other types should be used. e.g. Java 7 provides Big...
You can use docker, without using docker daemon (engine), by using cloud providers. In this example, you should have a gcloud (Google Cloud util), that connected to your account docker-machine create --driver google --google-project `your-project-name` google-machine-type f1-large fm02 This exa...
Add a Shadow DOM to a div that will display "Hello, World!" instead of its initial content. <div id="Div1">intial content</div> <script> var shadow = Div1.attachShadow( { mode: 'open' } ) shadow.innerHTML = "Hello, World!" </script>...
Debugging takes time and effort. Instead of chasing bugs with a debugger, consider spending more time on making your code better by: Write and run Tests. Python and Django have great builtin testing frameworks - that can be used to test your code much faster than manually with a debugger. Writ...
function myFunction(x, y, z) { } var args = [0, 1, 2]; myFunction(...args); The spread syntax allows an expression to be expanded in places where multiple arguments (for function calls) or multiple elements (for array literals) or multiple variables are expected. Just like the rest parameters s...
When you get a working registry running you can pull or push images on it. For that you need the server.crt file into a special folder on your docker client. The certificate allows you to authenticate with the registry, and then encrypt communication. Copy server.crt from registry machine into /etc...
Hadoop is an open-source software framework for storage and large-scale processing of data-sets in a distributed computing environment. It is sponsored by Apache Software Foundation. It is designed to scale up from single servers to thousands of machines, each offering local comput...
Upload the APK to your phone. The -r flag will replace the existing app (if it exists) adb install -r ./app/build/outputs/apk/app-release-unsigned.apk The shareable signed APK is located at: ./app/build/outputs/apk/app-release.apk
Screenshot Adapter Class private class MyAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { final int EMPTY_VIEW = 77777; List<CustomData> datalist = new ArrayList<>(); MyAdapter() { super(); } @Override public RecyclerView.ViewHolder onCreateViewH...
CREATE USER readonly WITH ENCRYPTED PASSWORD 'yourpassword'; GRANT CONNECT ON DATABASE <database_name> to readonly; GRANT USAGE ON SCHEMA public to readonly; GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO readonly; GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly;

Page 6 of 7