Tutorial by Examples: ect

class SortDataObject extends DataObject { private static $db = array( 'Name' => 'Varchar', 'SortOrder' => 'Int' ); private static $default_sort = 'SortOrder DESC'; }
class MyDataObject extends DataObject { private static $db = array( 'Name' => 'Varchar' ); private static $has_one = array( 'OtherDataObject' => 'OtherDataObject' ); private static $summary_fields = array( 'Name', 'OtherDat...
class MyDataObject extends DataObject { private static $db = array( 'Name' => 'Varchar' ); private static $has_one = array( 'OtherDataObject' => 'OtherDataObject' ); private static $summary_fields = array( 'Name', 'OtherDat...
Given the following DataFrame: In [11]: df = pd.DataFrame(np.random.randn(6, 3), columns=['A', 'B', 'C']) In [12]: df.set_index(['A', 'B'], inplace=True) In [13]: df Out[13]: C A B 0.902764 -0.259656 -1.864541 -0.695893 0.308893 0...
You can combine the results of two identically structured queries with the UNION keyword. For example, if you wanted a list of all contact info from two separate tables, authors and editors, for instance, you could use the UNION keyword like so: select name, email, phone_number from authors u...
The Timeline object allows you to get the execution time for each node in the graph: you use a classic sess.run() but also specify the optional arguments options and run_metadata you then create a Timeline object with the run_metadata.step_stats data Here is an example program that measures...
The System.Web.SessionState.HttpSessionState object provides a way to persist values between HTTP requests. In the example below, a user's preference for warnings is being saved in the session. Later on, while serving another request to the user, the application can read this preference from session...
When one wishes to convert a list to a vector or data.frame object empty elements are typically dropped. This can be problematic which a list is created of a desired length are created with some empty values (e.g. a list with n elements is created to be added to an m x n matrix, data.frame, or data...
To work with ConstraintLayout, you need Android Studio Version 2.2 or newer and have at least version 32 (or higher) of Android Support Repository. Add the Constraint Layout library as a dependency in your build.gradle file: dependencies { compile 'com.android.support.constraint:constraint...
When allocating multidimensional arrays with malloc, calloc, and realloc, a common pattern is to allocate the inner arrays with multiple calls (even if the call only appears once, it may be in a loop): /* Could also be `int **` with malloc used to allocate outer array. */ int *array[4]; int i; ...
To create a parallel collection from a sequential collection, call the par method. To create a sequential collection from a parallel collection, call the seq method. This example shows how you turn a regular Vector into a ParVector, and then back again: scala> val vect = (1 to 5).toVector vect:...
In [188]: s = pd.Series(["a","b","c","a","c"], dtype="category") In [189]: s Out[189]: 0 a 1 b 2 c 3 a 4 c dtype: category Categories (3, object): [a, b, c] In [190]: df = pd.DataFrame({"A":["a&q...
First, here's what can happen when text/template is used for HTML. Note Harry's FirstName property). package main import ( "fmt" "html/template" "os" ) type Person struct { FirstName string LastName string Street string Cit...
var gradient = createLinearGradient( startX, startY, endX, endY ) gradient.addColorStop(gradientPercentPosition, CssColor) gradient.addColorStop(gradientPercentPosition, CssColor) [optionally add more color stops to add to the variety of the gradient] Creates a reusable linear gradient (object...
var gradient = createRadialGradient( centerX1, centerY1, radius1, // this is the "display' circle centerX2, centerY2, radius2 // this is the "light casting" circle ) gradient.addColorStop(gradientPercentPosition, CssColor) gradient.addColorStop(gradientPerce...
You can return an anonymous object from your function public static object FunctionWithUnknowReturnValues () { /// anonymous object return new { a = 1, b = 2 }; } And assign the result to a dynamic object and read the values in it. /// dynamic object dynamic x = FunctionWithUnknowR...
Add the required network permissions to the application manifest file: <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android....
To check that the connection to the server is valid: sqoop list-tables --connect "jdbc:sqlserver://<server_ip>:1433;database=<database_name>" --username <user_name> --password <password> Before doing this it is recommended ...
The data can be imported directly into Hive: sqoop import --hive-import --table EventLog --connect "jdbc:sqlserver://192.168.1.99:1433;database=Test_db" --username user --password password --split-by id ...
PhpStorm offers default settings for code styling for a large amount of languages based on best practices and common standards. But you can customize the styling for each language on a per-project base within the PhpStorm Settings > Editor > Code Style. Schemes Schemes are collections of ...

Page 38 of 99