Tutorial by Examples: c

Custom Renderer help to allows to add new properties and render them differently in native platform that can not be otherwise does through shared code. In this example we will add radius and shadow to a boxview. Firstly, we should create custom control in PCL project, which will declare some requir...
In this exemple, we want to execute code which is stored in a string format. # the string str <- "1+1" # A string is not an expression. is.expression(str) [1] FALSE eval(str) [1] "1+1" # parse convert string into expressions parsed.str <- parse(text="1+1...
Instead of using regex, the Lua string library has a special set of characters used in syntax matches. Both can be very similar, but Lua pattern matching is more limited and has a different syntax. For instance, the character sequence %a matches any letter, while its upper-case version represents al...
string <- ' some text on line one; and then some text on line two ' Trimming Whitespace "Trimming" whitespace typically refers to removing both leading and trailing whitespace from a string. This may be done using a combination of the previous examples. gsub is used to for...
Creating a chart that displays a static dataset is relatively simple. For example, if we have this array of objects as the data: var data = [ {title: "A", value: 53}, {title: "B", value: 12}, {title: "C", value: 91}, {title: "D", value: 24...
Debian/Ubuntu # apt-get update & apt-get -y upgrade # apt-get install cron Fedora/CentOS # yum -y update # yum install vixie-cron Arch # pacman --noconfirm -Syu # pacman -S cronie
To get a list of available serial ports use python -m serial.tools.list_ports at a command prompt or from serial.tools import list_ports list_ports.comports() # Outputs list of available serial ports from the Python shell.
Add the debugger statement in your content script var foo = 1; debugger; foo = 2; Open the Developer Tool on the web page where your content script is injected to see the code execution pause at those lines.
HTML: <div ng-app="myApp" ng-controller="Controller"> <some-chart data="data"></some-chart> </div> Javascript: angular.module('myApp', []) .directive('someChart', function() { return { restrict: 'E', scope: {dat...
Below are some tips to remember while we are writing a select query in MySQL that can help us and reduce our query time:- Whenever we use where in a large table we should make sure the column in where clause are index or not. Ex:- Select * from employee where user_id > 2000. user_id if ind...
Drawing text in canvas with your font from assets. Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/SomeFont.ttf"); Paint textPaint = new Paint(); textPaint.setTypeface(typeface); canvas.drawText("Your text here", x, y, textPaint);
A function is a named block of code which is used to define reusable code that should be easy to use. It is usually included inside a script to help reuse code (to avoid duplicate code) or distributed as part of a module to make it useful for others in multiple scripts. Scenarios where a function m...
A script is a text file with the file extension .ps1 that contains PowerShell commands that will be executed when the script is called. Because scripts are saved files, they are easy to transfer between computers. Scripts are often written to solve a specific problem, ex.: Run a weekly maintenan...
Temporary tables could be very useful to keep temporary data. Temporary tables option is available in MySQL version 3.23 and above. Temporary table will be automatically destroyed when the session ends or connection is closed. The user can also drop temporary table. Same temporary table name can b...
Although Julia is not a purely functional language, it has full support for many of the cornerstones of functional programming: first-class functions, lexical scope, and closures. The fixed-point combinator is a key combinator in functional programming. Because Julia has eager evaluation semantics ...
The SKI combinator system is sufficient to represent any lambda calculus terms. (In practice, of course, lambda abstractions blow up to exponential size when they are translated into SKI.) Due to the simplicity of the system, implementing the S, K, and I combinators is extraordinarily simple: A Dir...
Frequently you may want to filter structures and other complex data types. Searching an array of structs for entries that contain a particular value is a very common task, and easily achieved in Swift using functional programming features. What's more, the code is extremely succinct. struct Painter...
The Autobahn package can be used for Python web socket server factories. Python Autobahn package documentation To install, typically one would simply use the terminal command (For Linux): sudo pip install autobahn (For Windows): python -m pip install autobahn Then, a simple echo server ca...
To easily select a buffer by filename, you can use: :b [part_of_filename]<Tab><Tab><Tab>...<Enter> The first Tab will expand the word to a full filename, and subsequent Tab presses will cycle through the list of possible matches. When multiple matches are available, you ...
<C-^> will switch to and from the previous edited file. On most keyboards <C-^> is CTRL-6. 3<C-^> will switch to buffer number 3. This is very quick, but only if you know the buffer number. You can see the buffer numbers from :ls or from a plugin such as MiniBufExplorer.

Page 495 of 826