Tutorial by Examples: f

.htaccess can be used to force your HTTP site to redirect to HTTPS. Here's a quick way that doesn't require editing the code for your domain: RewriteEngine On RewriteCond %{HTTPS} =off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] Warning: The code above assumes that you can tr...
SP.SOD.executeOrDelayUntilScriptLoaded(showDialog,"sp.js"); function showDialog(){ var options = SP.UI.$create_DialogOptions(); options.url = "/mySite/lists/myList/NewForm.aspx"; options.dialogReturnValueCallback = myCallBackFunction; SP.UI.ModalDialog.show...
Creating List Items SP.SOD.executeOrDelayUntilScriptLoaded(createItem,"sp.js"); function createItem(){ var clientContext = new SP.ClientContext(); var list = clientContext.get_web().get_lists().getByTitle("List Title"); var newItem = list.addItem(); newIte...
SP.SOD.executeOrDelayUntilScriptLoaded(showUserInfo,"sp.js"); function showUserInfo(){ var clientContext = new SP.ClientContext(); var user = clientContext.get_web().get_currentUser(); clientContext.load(user); clientContext.executeQueryAsync(function(){ ...
Fortran 2003 introduced support for object oriented programming. This feature allows to take advantage of modern programming techniques. Derived types are defined with the following form: TYPE [[, attr-list] :: ] name [(name-list)] [def-stmts] [PRIVATE statement or SEQUENCE statement]. . . ...
It should be noted that Fetch does not support progress callbacks. See: https://github.com/github/fetch/issues/89. The alternative is to use XMLHttpRequest https://developer.mozilla.org/en-US/docs/Web/Events/progress. fetch('https://mywebsite.com/mydata.json').then(json => console.log(json)); ...
Note: You cannot develop react-native apps for iOS on Windows, only react-native android apps. The official setup docs for react-native on windows can be found here. If you need more details there is a granular guide here. Tools/Environment Windows 10 command line tool (eg Powershell or window...
Converting an NSDate object to string is just 3 steps. 1. Create an NSDateFormatter object Swift let dateFormatter = NSDateFormatter() Swift 3 let dateFormatter = DateFormatter() Objective-C NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; 2. Set the date format in whic...
You can use Gradle to auto-increment your package version each time you build it. To do so create a version.properties file in the same directory as your build.gradle with the following contents: VERSION_MAJOR=0 VERSION_MINOR=1 VERSION_BUILD=1 (Changing the values for major and minor as you s...
int squareNum (int a) { return a*a; } int : return type squareNum : function name int a : parameter type and name return a*a : return a value (same type as the return type defined at the beginning)
If you have a function declared you can call it anywhere else in the code. Here is an example of calling a function: void setup(){ Serial.begin(9600); } void loop() { int i = 2; int k = squareNum(i); // k now contains 4 Serial.println(k); delay(500); } int squareNum(int a)...
This simple example provides an explanation on some functions I found extremely useful since I have started using MATLAB: cellfun, arrayfun. The idea is to take an array or cell class variable, loop through all its elements and apply a dedicated function on each element. An applied function can eith...
The use of Matlab Coder sometimes denies the use of some very common functions, if they are not compatible to C++. Relatively often there exist undocumented helper functions, which can be used as replacements. Here is a comprehensive list of supported functions.. And following a collection of alte...
Array.prototype.map(): Returns a new array with the results of calling a provided function on every element in the original array. The following code example takes an array of persons and creates a new array containing persons with a 'fullName' property var personsArray = [ { id: 1, f...
In JavaScript all arguments are passed by value. When a function assigns a new value to an argument variable, that change will not be visible to the caller: var obj = {a: 2}; function myfunc(arg){ arg = {a: 5}; // Note the assignment is to the parameter variable itself } myfunc(obj); conso...
Information Inheritance allows you to derive a new class from an existing class. You do this using the INHERITING FROM addition in the CLASS subclass DEFINITION INHERITING FROM superclass. statement. The new class subclass inherits all of the components of the existing class superclass. The n...
Information The ABSTRACT and FINAL additions to the METHODS and CLASS statements allow you to define abstract and final methods or classes. An abstract method is defined in an abstract class and cannot be implemented in that class. Instead, it is implemented in a subclass of the class. Abstra...
During development, when certain code paths must be prevented from the reach of control flow, you may use assert(0) to indicate that such a condition is erroneous: switch (color) { case COLOR_RED: case COLOR_GREEN: case COLOR_BLUE: break; default: assert(0); ...
string outsidetext = "I am outside of bracket"; string.Format("{{I am in brackets!}} {0}", outsidetext); //Outputs "{I am in brackets!} I am outside of bracket"
Example : CLLocationManager *locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; locationManager.desiredAccuracy = kCLLocationAccuracyBest; locationManager.distanceFilter = 5; E.g. In the above example code above, location changes of less than 5 m...

Page 96 of 457