Data sets often contain comments that explain the data format or contain the license and usage terms. You usually want to ignore these lines when you read in the DataFrame.
The readtable function assumes that comment lines begin with the '#' character. However, your file may use comment marks like ...
Assuming you have a model that looks like the following, we will get up an running with a simple barebones read-only API driven by Django REST Framework ("DRF").
models.py
class FeedItem(models.Model):
title = models.CharField(max_length=100, blank=True)
url = models.URLField(b...
To separate API logic from the component, we are creating the API client as a separate class. This example class makes a request to Wikipedia API to get random wiki articles.
import { Http, Response } from '@angular/http';
import { Injectable } from '@angular/core';
import { Observabl...
Since defining all of the authorization logic in the AuthServiceProvider could become cumbersome in large applications, Laravel allows you to split your authorization logic into "Policy" classes. Policies are plain PHP classes that group authorization logic based on the resource they autho...
a = [1, 2, 3, 4, 5]
# steps through the list backwards (step=-1)
b = a[::-1]
# built-in list method to reverse 'a'
a.reverse()
if a = b:
print(True)
print(b)
# Output:
# True
# [5, 4, 3, 2, 1]
One drawback of creating private method in Javascript is memory-inefficient because a copy of the private method will be created every time a new instance is created. See this simple example.
function contact(first, last) {
this.firstName = first;
this.lastName = last;
this.mobile;
...
USER_SOURCE describes the text source of the stored objects owned by the current user. This view does not display the OWNER column.
select * from user_source where type='TRIGGER' and lower(text) like '%order%'
ALL_SOURCE describes the text source of the stored objects accessible to the current ...
Query store can be enabled on database by using the following command:
ALTER DATABASE tpch SET QUERY_STORE = ON
SQL Server/Azure SQL Database will collect information about executed queries and provide information in sys.query_store views:
sys.query_store_query
sys.query_store_query_text
sy...
If you want to remove some query or query plan from query store, you can use the following commands:
EXEC sp_query_store_remove_query 4;
EXEC sp_query_store_remove_plan 3;
Parameters for these stored procedures are query/plan id retrieved from system views.
You can also just remove execution ...
Add the readonly attribute to prevent user input. A readonly field can't be edited
<input class="form-control" type="text" placeholder="Readonly input here…" readonly>
Add the disabled attribute to disable an input field. A disbled field can't be edited either...
The $http requests require time which varies depending on the server, some may take a few milliseconds, and some may take up to a few seconds. Often the time required to retrieve the data from a request is critical. Assuming the response value is an array of names,
consider the following example:
...
List all the node versions installed
nvm ls
v4.5.0
v6.7.0
Run command using any node installed version
nvm run 4.5.0 --version or nvm exec 4.5.0 node --version
Running node v4.5.0 (npm v2.15.9)
v4.5.0
nvm run 6.7.0 --version or nvm exec 6.7.0 node --version
Running node v6.7.0...
Before getting started, make sure you have the latest Azure PowerShell installed. Once installed, start an Azure PowerShell session from your machine. First, you'll need to log in and authenticate to Windows Azure.
Add-AzureRmAccount
You'll receive a dialog box asking for your Azure credentials...
Passing ByRef or ByVal indicates whether the actual value of an argument is passed to the CalledProcedure by the CallingProcedure, or whether a reference (called a pointer in some other languages) is passed to the CalledProcedure.
If an argument is passed ByRef, the memory address of the argument i...
Default modifier
If no modifier is specified for a parameter, that parameter is implicitly passed by reference.
Public Sub DoSomething1(foo As Long)
End Sub
Public Sub DoSomething2(ByRef foo As Long)
End Sub
The foo parameter is passed ByRef in both DoSomething1 and DoSomething2.
Wa...
Getting a table with vertical headers.
Twitter bootstrap now support vertical header on a well formatted normal table. To achieve this just use .table-reflow class
Use twitter bootstrap .table-reflow class on a well formed table to achieve a table with vertical headers. Additionally you can combin...
Installation via NodeJS is the recommended method. It is preferred because you can use it to build the files selecting just the components you want.
Step 1: Install Node (Link)
Step 2: Install Gulp globally ( -g ) on your computer
npm install -g gulp
Semantic UI uses Gulp to provide command ...
This document details the steps to obtain the facebook access tokens and the using the tokens to fetch FB feeds.
Example:
A live example is available in
https://newtonjoshua.com
Introduction to Graph API:
The Graph API is the primary way to get data in and out of Facebook's platform. It's a...
There are two classes of methods for solving Linear Equations:
Direct Methods: Common characteristics of direct methods are that they transform the original equation into equivalent equations that can be solved more easily, means we get solve directly from an equation.
Iterative Method: It...