This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Testing DOM performance | |
(function (depth, width, tag, tag2) { | |
console.log('Tree depth: ' + depth); | |
console.log('Children per level ' + width); | |
console.log('Tag to build tree with ' + tag); | |
console.log('Replacement tag ' + tag2); | |
console.time('maketree'); | |
var starttree = (function makeTree(depth, width, root, tag) { | |
if (depth == 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Comparison of binding button actions as inline functions (closures) | |
* profile to see the difference in both cases. | |
* vs. binding the same instance (by function name). Compare the memory heap | |
*/ | |
// Bind function expression (closure) - 1M times | |
(function (numButtons) { | |
var btn = new sap.m.Button({text: "hello"}); | |
for(var i = 0; i < numButtons; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function () { | |
var body = document.body.parentElement.replaceChild(document.createElement('body'), document.body); | |
var head = document.head.parentElement.replaceChild(document.createElement('head'), document.head); | |
var bootstrap = document.createElement('script'); | |
bootstrap.setAttribute('src', 'https://openui5.hana.ondemand.com/resources/sap-ui-core.js'); | |
bootstrap.setAttribute('id', 'sap-ui-bootstrap'); | |
bootstrap.setAttribute('data-sap-ui-theme', 'sap_bluecrystal'); | |
bootstrap.setAttribute('data-sap-ui-libs', 'sap.m'); | |
document.head.appendChild(bootstrap); | |
document.body.setAttribute('id', 'content'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Creating empty objects in different ways and checking execution time, heap size etc. | |
*/ | |
// Property-less object | |
console.time('zoop'); | |
var zoop = (function (numObjects) { | |
var pooz = Object.create(null); | |
for(var i = 0; i< numObjects; i++) { | |
pooz[i] = Object.create(null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// OpenUI5 Tree Table Test binding to OData Model | |
(function (serviceUrl, entitySet, navigationProperty, label, propertyBindingPath) { | |
var tt = new sap.ui.table.TreeTable({ | |
columns: [ | |
new sap.ui.table.Column({ | |
label: label, | |
template: new sap.m.Label({text: propertyBindingPath}) | |
}) | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, sys, requests | |
from lxml import objectify, etree | |
WEBDAV_STATUS_CODE = { # See http://tools.ietf.org/html/rfc4918 | |
'OK' : 200, | |
'CREATED' : 201, | |
'NO_CONTENT' : 204, | |
'MULTI_STATUS' : 207, | |
'NOT_FOUND' : 404, | |
'METHOD_NOT_ALLOWED' : 405, |