Tutorial by Examples

It is common practice to create groups of items by creating simple value nodes with item ID as key. For example, we can add a user to the group "administrators" by creating a node at /administrators/$user_id with a value true. We don't want anyone to know who administrators are, for securi...
Detailed instructions on getting mono set up or installed.
function downloadCsv() { var blob = new Blob([csvString]); if (window.navigator.msSaveOrOpenBlob){ window.navigator.msSaveBlob(blob, "filename.csv"); } else { var a = window.document.createElement("a"); a.href = window.URL.createObjectURL(blob, { ...
There are two operators for pointers: Address-of operator (&): Returns the memory address of its operand. Contents-of (Dereference) operator(*): Returns the value of the variable located at the address specified by its operator. int var = 20; int *ptr; ptr = &var; cout << var &...
Create a new ASP.Net Project: Select the empty template: Add two new folders: App and Scripts in the root folder: Add npm configuration file in the root folder: { "version": "1.0.0", "name": "phaser.js.environment.setup", "priva...
Dim count As Integer = 0 Dim message As String If count = 0 Then message = "There are no items." ElseIf count = 1 Then message = "There is 1 item." Else message = "There are " & count & " items." End If
9.0 If(condition > value, "True", "False") We can use the If operator instead of If...Then...Else..End If statement blocks. Consider the following example: If 10 > 9 Then MsgBox("True") Else MsgBox("False") End If is the same as M...
Creating a List Node class listNode { public: int data; listNode *next; listNode(int val):data(val),next(NULL){} }; Creating List class class List { public: listNode *head; List():head(NULL){} void insertAtBegin(int val); void insertAtEnd(int val)...
Security was a part of the dark side of the symfony documentation, it has a dedicated component named Security Component. This component is configured in the security.yml file of the main application project. The default configuration is like this one : # app/config/security.yml security: p...
In a nutshell, Our Custom Element Should Have a Built in Search Functionality, that searches and marks places on the map. Accept An attribute called location-array , which is a list of places Have a Listener , for listening to an event called “google-map-ready“.This event is fired, when the ele...
Getting You Browser Ready - Polyfill it Create a new landing page for our element, at index.html. Include polyfills for a custom element to work.Also import the custom element g-map, which we registered with Polymer. Note: Webcomponents, are the necessary polyfill for browser support. Polym...
For Searching a place, we use the powerful element that Polymer ships, called google-map-search . All you need to do, is pass a map object and a query string to the element like so: <google-map-search map=[[map]] query=[[query]]></google-map-search> How do we pass the map ob...
Our goal however, was to make a list of places mark all of them on the map and, mark any other place of our choice, by using the search box We have a search box, where the user can search for one query at a time.In order to accommodate multiple queries, we need to cache the results for each ...
<link rel=import href="../bower_components/google-map/google-map.html"> <link rel=import href="../bower_components/google-map/google-map-marker.html"> <link rel=import href="../bower_components/google-map/google-map-search.html"> <link rel=import...
To find the largest items in a collection, heapq module has a function called nlargest, we pass it two arguments, the first one is the number of items that we want to retrieve, the second one is the collection name: import heapq numbers = [1, 4, 2, 100, 20, 50, 32, 200, 150, 8] print(heapq.nl...
The most interesting property of a heap is that its smallest element is always the first element: heap[0] import heapq numbers = [10, 4, 2, 100, 20, 50, 32, 200, 150, 8] heapq.heapify(numbers) print(numbers) # Output: [2, 4, 10, 100, 8, 50, 32, 200, 150, 20] heapq.heappop(numbers) # 2...
Let's create a very simple view to respond a "Hello World" template in html format. To do that go to my_project/my_app/views.py (Here we are housing our view functions) and add the following view: from django.http import HttpResponse def hello_world(request): html = "&lt...
The default Django project template is fine but once you get to deploy your code and for example devops put their hands on the project things get messy. What you can do is separate your source code from the rest that is required to be in your repository. You can find a usable Django project templ...
Sometimes, you want to add listeners on particular events not natively provided by the components, in particular mouse events. To do so, you will have to add them by yourself using an EventTrigger component : using UnityEngine; using UnityEngine.EventSystems; [RequireComponent(typeof( EventTrig...
Options have a flatMap method. This means they can be used in a for comprehension. In this way we can lift regular functions to work on Options without having to redefine them. val firstOption: Option[Int] = Option(1) val secondOption: Option[Int] = Option(2) val myResult = for { firstValue ...

Page 992 of 1336