Tutorial by Examples: dp

$username = "[email protected]" $pwdTxt = Get-Content "C:\temp\Stored_Password.txt" $securePwd = $pwdTxt | ConvertTo-SecureString $credObject = New-Object System.Management.Automation.PSCredential -ArgumentList $username, $securePwd # Now, $credObject is having the credential...
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...
Lets say you have a user schema, which contains name , contactNo, address, and friends. var UserSchema = new mongoose.Schema({ name : String, contactNo : Number, address : String, friends :[{ type: mongoose.Schema.Types.ObjectId, ref : User }] }); If y...
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...
Query to search last executed sp's in db SELECT execquery.last_execution_time AS [Date Time], execsql.text AS [Script] FROM sys.dm_exec_query_stats AS execquery CROSS APPLY sys.dm_exec_sql_text(execquery.sql_handle) AS execsql ORDER BY execquery.last_execution_time DESC Query to search thro...
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder() .detectDiskWrites() .penaltyLog() //Logs a message to LogCat .build())
Structs may be used to implement code in an object oriented manner. A struct is similar to a class, but is missing the functions which normally also form part of a class, we can add these as function pointer member variables. To stay with our coordinates example: /* coordinates.h */ typedef stru...
Environment Setup: Download android sdk of API level 17 or more Node.js (https://nodejs.org/) Appium software (http://appium.io/) Selenium jars (http://www.seleniumhq.org/download/) Appium jar (https://search.maven.org/#search%7Cga%7C1%7Cg%3Aio.appium%20a%3Ajava-client) .apk file of the appl...
SWIFT: Getting an instance of UIStoryboard programmatically can be done as follows: let storyboard = UIStoryboard(name: "Main", bundle: nil) where: name => the name of the storyboard without the extension bundle => the bundle containing the storyboard file and its relate...
from sqlalchemy import create_engine cnx = create_engine('mysql+pymysql://username:password@server:3306/database').connect() sql = 'select * from mytable' df = pd.read_sql(sql, cnx)
The PERCENTILE_DISC function lists the value of the first entry where the cumulative distribution is higher than the percentile that you provide using the numeric_literal parameter. The values are grouped by rowset or partition, as specified by the WITHIN GROUP clause. The PERCENTILE_CONT functi...
Consider the Binary Tree: Pre-order traversal(root) is traversing the node then left sub-tree of the node and then the right sub-tree of the node. So the pre-order traversal of above tree will be: 1 2 4 5 3 6 7 In-order traversal(root) is traversing the left sub-tree of the node then the node ...
The following would work in IE9+ import React from 'react' class App extends React.Component { constructor () { super() this.state = {someData: null} } componentDidMount () { var request = new XMLHttpRequest(); request.open('GET', '/my/url', true); request...
You are an Outlook user and understand terms such as “email”, “received time”, “subject” and “Folder Pane”. You know how to access Outlook’s Visual Basic Editor and create a module. See Introduction Part 1 if necessary. You have at least a basic knowledge of VBA. I declare Subroutines and variab...
The following example shows how to properly construct both GET and POST requests against Web API 2 (CORS must be configured server-side, if sent from another domain): <script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.js"></script> CORS with Wi...
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.6.1/angular.js"></script> CORS with Windows Authentication test (Angular) <script type="text/javascript"> var app = angular.module('myApp', []); app.c...
Python includes a profiler called cProfile. This is generally preferred over using timeit. It breaks down your entire script and for each method in your script it tells you: ncalls: The number of times a method was called tottime: Total time spent in the given function (excluding time made in c...
Let's consider the below snippet, Get-ChildItem -Path C:\MyFolder | Select-Object Name, CreationTime, Length It simply output the folder content with the selected properties. Something like, What if I want to display the file size in KB ? This is where calcualted properties comes handy. Get-...
From the tool-bar open the Java Perspective. Create a new Java project Right-click into the Package Explorer, and from the menu select New -> Java Project In the upcoming dialog enter a project name, then click Finish. Now you have the new project in your workspace. Create a new Java ...
A (m x n) matrix can be representes by a surface by using surf; The color of the surface is automatically set as function of the values in the (m x n) matrix. If the colormap is not specified, the default one is applied. A colorbar can be added to display the current colormap and indicate the map...

Page 17 of 21