Tutorial by Examples: c

When nothing matches a wildcard such as * in bash, it gets passed on as a literal * to the command, as if you had typed \*. However, zsh throws an error. Bash: duncan@K7DXS-Laptop-Arch:~/test$ echo *.txt *.txt duncan@K7DXS-Laptop-Arch:~/test$ touch abc.txt duncan@K7DXS-Laptop-Arch:~/test$ echo...
For BLE slave devices to do any useful work, the GPIOs of the wireless MCU are almost always involved. For instance, to read temperature from an external sensor, the ADC functionality of GPIO pins may be required. TI's CC2640 MCU features a maximum of 31 GPIOs, given different packaging types. In t...
Cordova plugins are in simple words a layer on top of the respective native platform. Plugins provide an interface between to access the native platform.
Cordova Plugins provide a common interface to interact with the native code. Each plugin has an intermediary JavaScript file that provides access to platform specific features.
cordova plugin add <plugin-name> Example: cordova plugin add cordova-plugin-camera The plugin should be installed in the root directory of the project. Note: Before adding the plugin replace the platform specific www folder content with the outer www folder in the root directory. Th...
It crops the images in square shape. This cordova project uses two plugins: Cordova Camera Plugin -- https://github.com/apache/cordova-plugin-camera Cordova Crop Image Plugin -- https://github.com/jeduan/cordova-plugin-crop The Camera plugin is combined with the Crop Image Plugin by ...
In pygame you usually use Surfaces to represent the appearance of objects, and Rectangles to represent their positions. A Surface is like a blank sheet of paper which contain colors or images. There are two ways to create a Surface: blank from scratch or by loading an image. Create a Surface To cr...
There are kinds 3 of transparency supported in pygame: colorkeys, Surface alphas, and per-pixel alphas. Colorkeys Makes a color fully transparent, or more accurately, making a color simply not be blit. If you have an image with a black rect inside you could set a colorkey to prevent the black colo...
You can always run JavaScript from inside itself, although this is strongly discouraged due to the security vulnerabilities it presents (see Remarks for details). To run JavaScript from inside JavaScript, simply use the below function: eval("var a = 'Hello, World!'");
This example implements a custom binding that toggles visibility (similar to the existing visible binding), but will utilize jQuery's fading API to animate the transition from visible to invisible. Custom binding definition: //Add a custom binding called "fadeVisible" by adding it as a p...
EVALUATE a ALSO b ALSO TRUE WHEN 1 ALSO 1 THRU 9 ALSO c EQUAL 1 PERFORM all-life WHEN 2 ALSO 1 THRU 9 ALSO c EQUAL 2 PERFORM life WHEN 3 THRU 9 ALSO 1 ALSO c EQUAL 9 PERFORM disability WHEN OTHER PERFORM invalid END-EVALUATE
This example is a custom binding that replaces text whenever an input value is updated. In this case, spaces will be replaced with "+". It is intended to be used alongside the existing value binding, and shows binding with an object literal. Sample markup with the replaceText binding: &l...
index.html <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="Content-Security-Policy" content="default-src *; script-src 'self' 'unsafe-inline' 'unsafe-eval' *; style-src 'self' 'unsafe-inline' *"/> ...
Using the IntDef#flag() attribute set to true, multiple constants can be combined. Using the same example in this topic: public abstract class Car { //Define the list of accepted constants @IntDef(flag=true, value={MICROCAR, CONVERTIBLE, SUPERCAR, MINIVAN, SUV}) //Tell the compi...
CELERY Installation - pip install django-celery Add Basic project structure. - src/ - bin/celery_worker_start # will be explained later on - logs/celery_worker.log - stack/__init __.py - stack/celery.py - stack/settings.py - stack/urls.py - manage.py ...
.loc uses labels to read and write data. Let's setup a DataFrame: df = pd.DataFrame({'one': [1, 2, 3, 4, 5], 'two': [6, 7, 8, 9, 10], }, index=['a', 'b', 'c', 'd', 'e']) Then we can print the DataFrame to have a look at the shape: print df This will o...
Objects that are not built-in To print the source code of a Python object use inspect. Note that this won't work for built-in objects nor for objects defined interactively. For these you will need other methods explained later. Here's how to print the source code of the method randint from the ran...
Given an interface: public interface Logger { void log(String message); } Rather than usage: public void doJob(Logger logger) { if (logger != null) { logger.log("[doJob]:Step 1"); } // ... if (logger != null) { logger.log("[doJob]:Step 2&q...
In C, there are two unary operators - '++' and '--' that are very common source of confusion. The operator ++ is called the increment operator and the operator -- is called the decrement operator. Both of them can be used used in either prefix form or postfix form. The syntax for prefix form for ++ ...
CREATE CERTIFICATE My_New_Cert FROM FILE = 'D:\Temp\CertTest\certificateDER.cer' GO Create the certificate SELECT EncryptByCert(Cert_ID('My_New_Cert'), 'This text will get encrypted') encryption_test Usually, you would encrypt with a symmetric key, that key would get encrypted by the asym...

Page 593 of 826