Tutorial by Examples: l

If you have successfully deployed the Lambda, you can also test it directly in the GUI. When you click the blue Test button for the first time, it presents you with a creation of a new test event. If you are testing the Java code from the Basic Lambda code in Java example, delete the whole body and...
The known sub-classes for Entity Events are: Sub-ClassesSub-ClassesSub-ClassesCreatureSpawnEventCreeperPowerEventEntityChangeBlockEventEntityCombustEventEntityCreatePortalEventEntityDamageEventEntityDeathEventEntityExplodeEventEntityInteractEventEntityPortalEnterEventEntityRegainHealthEventEntitySh...
UITabBarController building in Swift 3 Change image color and title according to selection with changing selected tab color. import UIKit class TabbarController: UITabBarController { override func viewDidLoad() { super.viewDidLoad() self.navigationController?.isNavigat...
There are a number of functions and methods for working with comma (or other character) separated lists in Progress 4GL. NUM-ENTRIES Returns the number of entries in a list. You can optionally specify delimiter, comma is default NUM-ENTRIES(string [, delimiter]) Using comma, the default deli...
Set createScriptingFileSystemObject = CreateObject("Scripting.FileSystemObject") Tools> References> Microsoft Scripting Runtime Associated DLL: ScrRun.dll Source: Windows OS MSDN-Accessing Files with FileSystemObject The File System Object (FSO) model provides an object-base...
Type Casting Type casting is a way to check the type of an instance, or to treat that instance as a different superclass or subclass from somewhere else in its own class hierarchy. Type casting in Swift is implemented with the is and as operators. These two operators provide a simple and express...
Here is a Rules example in Rules export format: { "rules_display_userpoints_after_updating_content" : { "LABEL" : "Display userpoints after updating content", "PLUGIN" : "reaction rule", "OWNER" : "rules", &qu...
public static class MyHelpers { public static MvcHtmlString MyCustomDiv(this HtmlHelper htmlHelper, string text, object htmlAttributes = null) { var mainTag = new TagBuilder("div"); mainTag.MergeAttributtes(htmlAttributes); mainTag.AddCssClas...
First create a disposable class: public class MyDisposableHelper: IDisposable { private bool _disposed; private readonly ViewContext _viewContext; public MyDisposableHelper(ViewContext viewContext) { if (viewContext == null) { throw ne...
Let's create a small piece of code that throws an exception: private void button1_Click(object sender, EventArgs e) { string msg = null; msg.ToCharArray(); } If we execute this, we get the following Exception and stack trace: System.NullReferenceException: "Object reference not...
Set createInternetExplorerObject = CreateObject("InternetExplorer.Application") Tools> References> Microsoft Internet Controls Associated DLL: ieframe.dll Source: Internet Explorer Browser MSDN-InternetExplorer object Controls an instance of Windows Internet Explorer through...
Detailed instructions on getting django-forms set up or installed.
Flexbox is a CSS3 module, standardized by the World Wide Web Consortium. It is a layout mode for element arrangement such that the elements behave predictably when the page layout must accommodate different display sizes. Because it is a part of CSS3, you don't need to install anything. It can be u...
Django Model Form with Django Class Based view is a classic way of building pages to do create/update operations in django application quickly. Within the form we can put methods to execute tasks. Its a cleaner way to put tasks in forms rather than putting in views/models. To give an example using ...
Built-in forms are great but sometimes there is a need to customize them, adding new fields or simply changing CSS attributes. This example is applicable to several use cases but here it is presented regarding PasswordChangeForm and its use in a Bootstrap website. The solution is to create another...
from django.test import TestCase from myapp.forms import MyForm class MyAppTests(TestCase): def test_forms(self): form_data = {'field1': 'fieldvalue1'} form = MyForm(data=form_data) self.assertTrue(form.is_valid())
To restrict the characters that can be typed into an entry widget, only numbers for instance, a validate command can be added to the entry. A validate command is a function that return True if the change is accepted, False otherwise. This function will be called each time the content of the entry is...
Detailed instructions on getting jq set up or installed. Install on Mac Using brew: $ brew install jq Then test: $ echo '{"name": "john"}' {"name": "john"} $ echo '{"name": "john"}' | jq '.' { "name": "john&quo...
The creators of Swift have put a lot of attention into making the language expressive and error handling is exactly that, expressive. If you try to invoke a function that can throw an error, the function call needs to be preceded by the try keyword. The try keyword isn't magical. All it does, is mak...

Page 716 of 861