Processing Field collection items with Rules is fun, really! Have a look at this Rule (in Rules export format):
{ "rules_calculate_sum_of_prices_in_all_field_collection_items" : {
"LABEL" : "Calculate sum of prices in all field collection items",
"PLUGIN...
This example attempts to create a bucket called 'hello-world' and, as the bucket hello-world has already been created by someone else in S3's global namespace, throws the following exception. Change 'hello-world' to something else to avoid the exception by creating a uniquely named bucket. The new...
One of the most critical parts of dealing with NMS code is being able to support mulitple Minecraft versions. There are numerous ways to do this, but a simple solution is to use this code to store the version as a public static field:
public static final String NMS_VERSION = Bukkit.getServer().getC...
Create a new folder called MyClasses and create and add the following class
public class GmailEmailService:SmtpClient
{
// Gmail user-name
public string UserName { get; set; }
public GmailEmailService() :
base(ConfigurationManager.AppSettings["GmailHost"], Int32.Parse...
This example shows how to obtain the ancestry of a component using the ClassType and ClassParent properties. It uses a button Button1: TButton and a list box ListBox1: TListBox on a form TForm1.
When the user clicks the button, the name of the button’s class and the names of its parent classes are ...
This will be our example data frame:
df = pd.DataFrame({"color": ['red', 'blue', 'red', 'blue']},
index=[True, False, True, False])
color
True red
False blue
True red
False blue
Accessing with .loc
df.loc[True]
color
True red
True red
...
This example expects an error, as the hello-world bucket already exists and S3 uses a global namespace.
New-S3Bucket -BucketName "hello-world"
New-S3Bucket : The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a dif...
Lightweight simple translation module with dynamic json storage. Supports plain vanilla node.js apps and should work with any framework (like express, restify and probably more) that exposes an app.use() method passing in res and req objects. Uses common __('...') syntax in app and templates. Stores...
You can use any name for the function.
function custom_postype(){
register_post_type('cus_post',array(
'labels'=>array(
'name'=>'khaiyam'// Use any name you want to show in menu for your users
),
'public'=>true,// **Must required
...
SELECT e.emp_id , e.first_name , e.last_name FROM employees e INNER JOIN managers m ON m.mgr_id = e.mgr_id WHERE m.mgr_id = 'M01' ;
Results in:
EMP_IDFIRST_NAMELAST_NAMEE02ErinMacklemoreE04RonSonswan
Ultimately, for every manager we query for, we will see 1 or more employees returned.
Consult the above example tables when looking at this example.
SELECT m.mgr_id , m.first_name , m.last_name FROM managers m INNER JOIN employees e ON e.mgr_id = m.mgr_id WHERE e.emp_id = 'E03' ;
MGR_IDFIRST_NAMELAST_NAMEM03BarrelJones
As this is the inverse of the above example, we know that for ...
One of the common ways to parametrize your performance scripts is to use a CSV file. The best example of CSV input files usage is a login process. If you want to test your application across different users, you need to provide a list of user credentials.
Let’s assume that we have a login request t...
Another way to parametrize your performance scripts is to use database data through JDBC. JDBC is an application programming interface that defines how a client can access a database.
First of all, download the JDBC driver to your database (refer to the database vendor). For example, mysql driver c...
If you need to execute a repeating sequence of the same action with different parameters, use the ‘Parameterized Controller’ 3rd party plugin from JMeter-Plugins project.
You need to install this plugin first by following installation procedure.
Let’s assume that we want to parameterize the login ...
Within the Schema Builder, use the Schema facade with any connection. Run the connection() method to specify which connection to use:
Schema::connection('mysql2')->create('some_table', function($table)
{
$table->increments('id'):
});
There are multiple ways to define which connection to use in the Eloquent models. One way is to set the $connection variable in the model:
<?php
class SomeModel extends Eloquent {
protected $connection = 'mysql2';
}
The connection can also be defined at runtime via the setConnect...
When applied on a map, returns a new map with new or updated key val pairs.
It can be used to add new information in existing map.
(def userData {:name "Bob" :userID 2 :country "US"})
(assoc userData :age 27) ;; { :name "Bob" :userID 2 :country "US&qu...