Tutorial by Examples

.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...
Active patterns are just simple functions. Like functions you can define additional parameters: let (|HasExtension|_|) expected (uri : string) = let result = uri.EndsWith (expected, StringComparison.CurrentCultureIgnoreCase) match result with | true -> Some true | _ -> N...
SP.SOD.executeOrDelayUntilScriptLoaded( function(){ deleteItem(1); }, "sp.js"); function deleteItem(id){ var clientContext = new SP.ClientContext(); var list = clientContext.get_web().get_lists().getByTitle("List Title"); var item = list.getItemById(id); it...
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(showDialog,"sp.js"); function showDialog(){ SP.UI.ModalDialog.showModalDialog( { url: "/org/it/web/wik/Lists/ExampleCode/DispForm.aspx?ID=6" } ); }
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(){ ...
SP.SOD.executeOrDelayUntilScriptLoaded(myFunction,"sp.js"); function myFunction(){ var clientContext = new SP.ClientContext(); var list = clientContext.get_web().get_lists().getByTitle("List Title"); var item = list.getItemById(1); // get item with ID == 1 ...
Basic Example Use the set_viewXml method of the SP.CamlQuery object to specify a CAML query to retrieve items. SP.SOD.executeOrDelayUntilScriptLoaded(showListItems,"core.js"); function showListItems(){ var clientContext = new SP.ClientContext(); var list = clientContext.get_...
SP.SOD.executeOrDelayUntilScriptLoaded(showDialog,"sp.js"); function showDialog(){ var dialogOptions = SP.UI.$create_DialogOptions(); dialogOptions.title = "Your Title Here!"; var dummyElement = document.createElement("div"); dummyElement.style.te...
The plotly package allows many kind of interactive plots, including maps. There are a few ways to create a map in plotly. Either supply the map data yourself (via plot_ly() or ggplotly()), use plotly's "native" mapping capabilities (via plot_geo() or plot_mapbox()), or even a combination o...
A do-while loop is very similar to a while loop, except that the condition is checked at the end of each cycle, not at the start. The loop is therefore guaranteed to execute at least once. The following code will print 0, as the condition will evaluate to false at the end of the first iteration: i...
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]. . . ...
In order to obtain class-like behavior, type and related procedures (subroutine and functions) shall be placed in a module: Example: module MShape implicit none private type, public :: Shape private integer :: radius contains procedure :: set => sh...
C++11 std::string supports iterators, and so you can use a ranged based loop to iterate through each character: std::string str = "Hello World!"; for (auto c : str) std::cout << c; You can use a "traditional" for loop to loop through every character: std::stri...
var ws = new WebSocket('ws://host.com/path'); ws.onopen = () => { // connection opened ws.send('something'); // send a message }; ws.onmessage = (e) => { // a message was received console.log(e.data); }; ws.onerror = (e) => { // an error occurred console.log(e...
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)); ...
var request = new XMLHttpRequest(); request.onreadystatechange = (e) => { if (request.readyState !== 4) { return; } if (request.status === 200) { console.log('success', request.responseText); } else { console.warn('error'); } }; request.open('GET', 'https://my...
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...
With ng-model you can bind a variable to any type of input field. You can display the variable using double curly braces, eg {{myAge}}. <input type="text" ng-model="myName"> <p>{{myName}}</p> As you type in the input field or change it in any way you will s...

Page 294 of 1336