Tutorial by Examples: add

ClientContext oClientContext = new ClientContext("http://MyServer/sites/MySiteCollection"); File oFile = oClientContext.Web.GetFileByServerRelativeUrl("Default.aspx"); LimitedWebPartManager limitedWebPartManager = oFile.GetLimitedWebPartManager(PersonalizationScope.Shared); ...
add_action('init', 'process_post'); function process_post(){ if($_POST) var_dump($_POST); }
add_action('init' , function(){ echo 'i did something'; });
class sample{ public function __construct(){ add_action('init', array($this, 'samp') ); } public function samp(){ // must be public!! echo 'i did something'; } } new sample();
class sample{ public static function add_action_func(){ //note __CLASS__ will also include any namespacing add_action('init', array(__CLASS__, 'samp') ); } public static function samp(){ echo 'i did something'; } } sample::add_a...
@org.junit.Test public void should_$name$() { $END$ } Make sure to check the Shorted FQ names box when creating this template. When you type "should" (the abbreviation), this will add the necessary import org.junit.Test; statement at the top of the file, and this code: @Test...
Let's take an example of a function which receives two arguments and returns a value indicating their sum: def two_sum(a, b): return a + b By looking at this code, one can not safely and without doubt indicate the type of the arguments for function two_sum. It works both when supplied with ...
Assuming that you have successfully created a JFrame and that Swing has been imported... You can import Swing entirely import javax.Swing.*; or You can import the Swing Components/Frame that you intend to use import javax.Swing.Jframe; import javax.Swing.JButton; Now down to adding the J...
For any object (i.e, variable, array, union, struct, pointer or function) the unary address operator can be used to access the address of that object. Suppose that int i = 1; int *p = NULL; So then a statement p = &i;, copies the address of the variable i to the pointer p. I...
Add one common horizontal line for all categorical variables # sample data df <- data.frame(x=('A', 'B'), y = c(3, 4)) p1 <- ggplot(df, aes(x=x, y=y)) + geom_bar(position = "dodge", stat = 'identity') + theme_bw() p1 + geom_hline(aes(yintercept=5), colour=...
There are several additional attributes that the Volley NetworkImageView adds to the standard ImageView. However, these attributes can only be set in code. The following is an example of how to make an extension class that will pick up the attributes from your XML layout file and apply them to the N...
Nine-patch images allow optional definition of the padding lines in the image. The padding lines are the lines on the right and at the bottom. If a View sets the 9-patch image as its background, the padding lines are used to define the space for the View's content (e.g. the text input in an EditTex...
Validates a value is a valid IP address var_dump(filter_var('185.158.24.24', FILTER_VALIDATE_IP)); var_dump(filter_var('2001:0db8:0a0b:12f0:0000:0000:0000:0001', FILTER_VALIDATE_IP)); var_dump(filter_var('192.168.0.1', FILTER_VALIDATE_IP)); var_dump(filter_var('127.0.0.1', FILTER_VALIDATE_IP)); ...
In order to have google maps work properly with turbolinks, add the javascript tag directly to the layout header rather than including it in a view. # app/views/layouts/my_layout.html.haml !!! %html{:lang => 'en'} %head - # ... = google_maps_api_script_tag The google_maps_api_s...
On the profile view, show the profile fields of a user or group in a list as well as the address fields on a google map. - # app/views/profiles/show.html.haml %h1 Contact Information .profile_fields = render @profile_fields .google_map{data: address_fields: @address_fields.to_json } The ap...
First it is important to understand that the Core Data Model is the *.xcdatamodeld file. You will notice you have not entities. You will have to create one yourself. At the bottom of Xcode you will notice a button that says "Add Entity" click it and you will have a new entity in the ...
Under the attributes section you add the attributes to your model. This button is a plus located at the bottom of the section. You can add any attributes that are relevant to your app. You have several options of types to choose from ranging from Booleans to Dates and more. The Inspector panel also ...
Relationships are relationship between entities that can be one-to-one or one-to-many. Creating a relationship is not needed to use Core Data.
To add a value to a Set, use the .add() method: mySet.add(5); If the value already exist in the set it will not be added again, as Sets contain unique values. Note that the .add() method returns the set itself, so you can chain add calls together: mySet.add(1).add(2).add(3);
To create a human-readable presentation of a model object you need to implement Model.__str__() method (or Model.__unicode__() on python2). This method will be called whenever you call str() on a instance of your model (including, for instance, when the model is used in a template). Here's an exampl...

Page 8 of 32