Tutorial by Examples: e

You can allow role to access some action on resource by: $acl->allow('Administrator', 'products', 'create'); You can deny role to access some action on resource by: $acl->deny('Customer', 'categories', 'create'); You can check if role is allowed to some action on resource by using: $a...
By implementing Phalcon\Acl\RoleAware or Phalcon\Acl\ResourceAware you can use them as objects in Phalcon\Acl\Adapter\Memory::isAllowed(). // Create our class which will be used as roleName class UserRole implements Phalcon\Acl\RoleAware { protected $id; protected $roleName; publ...
Modifying the strings returned by the standard functions getenv(), strerror() and setlocale() is undefined. So, implementations may use static storage for these strings. The getenv() function, C11, §7.22.4.7, 4, says: The getenv function returns a pointer to a string associated with the matched...
To execute a function within a loop in node.js, it's fine to use a for loop for short loops. But the loop is long, using for loop will increase the time of processing which might cause the node process to hang. In such scenarios, you can use: asycn.times function recursiveAction(n, callback) { ...
When we want to handle array of data, its better to use async.each. When we want to perform something with all data & want to get the final callback once everything is done, then this method will be useful. This is handled in parallel way. function createUser(userName, callback) { //creat...
OpenLayers 3 or as it is referred OL-3 is a Javascript Library for web mapping, so in order to use it you'll need to add it in your html: first add the ol.css file to use the map styling of OL-3 : then add the ol.js file : you can also download OL-3 from the official site www.openlaye...
var path = "/test_javascript_upload.txt"; var content = "data to upload"; var accessToken = "<ACCESS_TOKEN>"; var uploadUrl = "https://content.dropboxapi.com/2/files/upload" var result; var xhr = new XMLHttpRequest(); xhr.onreadystatechange = fun...
To Retrieve URL path in STATIC BLOCK Or CMS pages To get SKIN URL {{skin url=’images/sampleimage.jpg’}} To get Media URL {{media url=’/sampleimage.jpg’}} To get Store URL {{store url=’mypage.html’}} To get Base URL {{base url=”}} TO Retrieve URL path in PHTML Not secure Skin URL &...
If you have a greedy match as the first quantifier, the whole RE will be greedy, If you have non-greedy match as the first quantifier, the whole RE will be non-greedy. set mydata { Device widget1: port: 156 alias: input2 Device widget2: alias: input1 Device widget3: port: 238 alias...
\m : Beginning of a word. \M : End of a word. \y : Word boundary. \Y : a point that is not a word boundary. \Z : matches end of data. Documentation: re_syntax
# example data DT = data.table(id = c(1,2,2,3,3,3))[, v := LETTERS[.I]][] To deal with "duplicates," combine counting rows in a group and subsetting rows by group. Keep one row per group Aka "drop duplicates" aka "deduplicate" aka "uniquify." unique(DT,...
TestSubscribers allow you to avoid the work creating your own Subscriber or subscribe Action<?> to verify that certain values where delivered, how many there are, if the Observable completed, an exception was raised and a whole lot more. Getting Started This example just shows an assertion...
There are many examples where backticks are used inside a query but for many it's still unclear when or where to use backticks ``. Backticks are mainly used to prevent an error called "MySQL reserved word". When making a table in PHPmyAdmin you are sometimes faced with a warning or alert ...
A bit field is a variable that holds various boolean states as individual bits. A bit on would represent true, and off would be false. In the past bit fields were routinely used as they saved memory and reduced processing load. Though the need to use bit field is no longer so important they do offer...
Literals in RDF may be language tagged strings. These literals have a text part as well as a language tag. For instance, the literal "color"@en has the text part "color" and the language tag "en". In a SPARQL query, use the lang function to get the language of a lite...
The SPARQL function langMatches can be used to compare the language tags of RDF literals in SPARQL queries. The simple equality operator, =, can be used to compare exact string matches, but will not correctly consider regional variants. For instance, the four possible values of ?str in: values ...
Even with identical tokens for inline functions, ODR can be violated if lookup of names doesn't refer to the same entity. let's consider func in following: header.h void overloaded(int); inline void func() { overloaded('*'); } foo.cpp #include "header.h" void foo() { ...
First, make sure your app can be backed up in AndroidManifest.xml, i.e. android:allowBackup is not false. Backup command: adb -s <device_id> backup -noapk <sample.package.id> Create a tar with dd command: dd if=backup.ab bs=1 skip=24 | python -c "import zlib,sys;sys.stdout.wri...
adb -s <serialNumber> shell dumpsys activity activities Very useful when used together with the watch unix command: watch -n 5 "adb -s <serialNumber> shell dumpsys activity activities | sed -En -e '/Stack #/p' -e '/Running activities/,/Run #0/p'"
You may use this command for listing the files for your own debuggable apk: adb shell run-as <sample.package.id> ls /data/data/sample.package.id/cache And this script for pulling from cache, this copy the content to sdcard first, pull and then remove it at the end: #!/bin/sh adb shell &q...

Page 635 of 1191