Tutorial by Examples

execute the following command to insert the text into a view with a focus (if it supports text input) 6.0 Send text on SDK 23+ adb shell "input keyboard text 'Paste text on Android Device'" If already connected to your device via adb: input text 'Paste text on Android Device' 6...
Prints all packages, optionally only those whose package name contains the text in <FILTER>. adb shell pm list packages [options] <FILTER> All <FILTER> adb shell pm list packages Attributes: -f to see their associated file. -i See the installer for the packages. -u to ...
You can't reassign constants. const foo = "bar"; foo = "hello"; Prints: Uncaught TypeError: Assignment to constant.
Declaring a variable const only prevents its value from being replaced by a new value. const does not put any restrictions on the internal state of an object. The following example shows that a value of a property of a const object can be changed, and even new properties can be added, because the ob...
You can initialize a constant by using the const keyword. const foo = 100; const bar = false; const person = { name: "John" }; const fun = function () = { /* ... */ }; const arrowFun = () => /* ... */ ; Important You must declare and initialize a constant in the same statement....
General syntax git push <remotename> <object>:<remotebranchname> Example git push origin master:wip-yourname Will push your master branch to the wip-yourname branch of origin (most of the time, the repository you cloned from). Delete remote branch Deleting the remote br...
A one-liner that helps granting or revoking vulnerable permissions. granting adb shell pm grant <sample.package.id> android.permission.<PERMISSION_NAME> revoking adb shell pm revoke <sample.package.id> android.permission.<PERMISSION_NAME> Granting all run...
This command print all relevant application data: version code version name granted permissions (Android API 23+) etc.. adb shell dumpsys package <your.package.id>
It is common to want two views to be side by side, centered in their superview. The common answer given on Stack Overflow is to embed these two views in a UIView and center the UIView. This is not necessary or recommended. From the UILayoutGuide docs: There are a number of costs associated with...
Without JSX Here's a basic example that uses React's main API to create a React element and the React DOM API to render the React element in the browser. <!DOCTYPE html> <html> <head> <meta charset="UTF-8" /> <title>Hello React!</title> ...
In all versions of Python, we can represent infinity and NaN ("not a number") as follows: pos_inf = float('inf') # positive infinity neg_inf = float('-inf') # negative infinity not_a_num = float('nan') # NaN ("not a number") In Python 3.5 and higher, we can also us...
Python supports using a for loop directly on a list: my_list = ['foo', 'bar', 'baz'] for item in my_list: print(item) # Output: foo # Output: bar # Output: baz You can also get the position of each item at the same time: for (index, item) in enumerate(my_list): print('The item i...
This code can be added to any event like a listener, button, etc. A blocking JDialog will appear and will remain until the process is complete. final JDialog loading = new JDialog(parentComponent); JPanel p1 = new JPanel(new BorderLayout()); p1.add(new JLabel("Please wait..."), BorderLa...
The most basic form of data binding is text interpolation using the “Mustache” syntax (double curly braces): <span>Message: {{ msg }}</span> The mustache tag will be replaced with the value of the msg property on the corresponding data object. It will also be updated whenever the dat...
The double mustaches interprets the data as plain text, not HTML. In order to output real HTML, you will need to use triple mustaches: <div>{{{ raw_html }}}</div> The contents are inserted as plain HTML - data bindings are ignored. If you need to reuse template pieces, you should use...
Mustaches can also be used inside HTML attributes: <div id="item-{{ id }}"></div> Note that attribute interpolations are disallowed in Vue.js directives and special attributes. Don’t worry, Vue.js will raise warnings for you when mustaches are used in wrong places.
Vue.js allows you to append optional “filters” to the end of an expression, denoted by the “pipe” symbol: {{ message | capitalize }} Here we are “piping” the value of the message expression through the built-in capitalize filter, which is in fact just a JavaScript function that returns the capit...
class Greeter { greeting: string; constructor(message: string) { this.greeting = message; } greet(): string { return this.greeting; } }; let greeter = new Greeter("Hello, world!"); console.log(greeter.greet()); Here we have a class, Gree...
You can use the clearRect method to clear any rectangular section of the canvas. // Clear the entire canvas ctx.clearRect(0, 0, canvas.width, canvas.height); Note: clearRect is dependent on the transformation matrix. To deal with this, it's possible to reset the transformation matrix befor...
GitHub is a huge collection of Git repositories. In other words, you can think of GitHub as a collection of many projects! Creating An Account Visit GitHub's main page Here Pick a username, enter in your email address, and pick a secure password and you're ready to go! Useful Tools For Git/...

Page 150 of 1336