Tutorial by Examples: c

Setup a simple html file in the root of the project directory Filename: index.html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> </head> <body> <div id="App"></div> ...
Using webpack, you can bundle your component: $ webpack This will create our output file in build directory. Open the HTML page in a browser to see component in action
Cryptography is the science of using mathematical constructs (codes) to make communication secure. The field of cryptography is a subset of the field of Information Security. There are many cryptographic operations possible; some best known examples are: Encryption : transforming a plaintext mes...
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...
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, { ...
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...
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...
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...
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 ...
With Class-Based Views, we use classes instead of methods to implement our views. A simple example of using Class-Based Views looks as follows: from flask import Flask from flask.views import View app = Flask(__name__) class HelloWorld(View): def dispatch_request(self): ret...
Dim classFile : classFile = "carClass.vbs" Dim fsObj : Set fsObj = CreateObject("Scripting.FileSystemObject") Dim vbsFile : Set vbsFile = fsObj.OpenTextFile(classFile, 1, False) Dim myFunctionsStr : myFunctionsStr = vbsFile.ReadAll vbsFile.Close Set vbsFile = Nothing Set fs...
Sample uses Install-Package Google.Apis.AnalyticsReporting.v4 Public Shared Function getServiceInitializer() As BaseClientService Dim serviceAccountCredentialFilePath = "Path to Json service account key file" REM from Google Developers console Dim myKeyEMail ...

Page 617 of 826