Tutorial by Examples: c

file_unzip = 'filename.zip' unzip = zipfile.ZipFile(file_unzip, 'r') unzip.extractall() unzip.close()
file_untar = 'filename.tar.gz' untar = tarfile.TarFile(file_untar) untar.extractall() untar.close()
Generic type parameters are commonly defined at the class or interface level, but methods and (rarely) constructors also support declaring type parameters bound to the scope of a single method call. class Utility // no generics at the class level { @SafeVarargs public static <T> T ...
The VisibleExp property is a boolean expression, that determines if given tab is visible (when logical expression is TRUE) or hidden. You specify VisibleExp property for PXTab controls in Aspx page: <px:PXTabItem Text="Credit Card Processing Info" BindingContext="form" ...
Unlike the VisibleExp property, defined in Aspx, you manipulate AllowSelect property of a data view though BLC or BLC extension code. The AllowSelect property makes it possible to use more complex boolean expressions (in comparison to the VisibleExp property) and, if necessary, retrieve additional i...
Note: The output.library and name (in DllPlugin) must be the same. const path = require('path'); const webpack = require('webpack'); const ExtractTextPlugin = require('extract-text-webpack-plugin'); const extractCSS = new ExtractTextPlugin('vendor.css'); const isDevelopment = process.env.NODE_E...
Note: manifest (in DllReferencePlugin) should reference path (defined in DllPlugin) const webpack = require('webpack'); const path = require('path'); const isDevelopment = process.env.NODE_ENV !== 'production'; const ExtractTextPlugin = require('extract-text-webpack-plugin'); const extractCSS...
You can define methods and classes within JShell: jshell> void speak() { ...> System.out.println("hello"); ...> } jshell> class MyClass { ...> void doNothing() {} ...> } No access modifiers are necessary. As with other blocks, semicolons are require...
The DividerItemDecoration is a RecyclerView.ItemDecoration that can be used as a divider between items. DividerItemDecoration mDividerItemDecoration = new DividerItemDecoration(context, mLayoutManager.getOrientation()); recyclerView.addItemDecoration(mDividerItemDecoration); It su...
Here is a simple shortcut that runs the command upper_case when you press ctrl+u. { "keys": ["ctrl+u"], "command": "upper_case" } I've set the content of my keybindings like this, but it doesn't work! It's normal! It's because it has to be ...
The keyword function can be used to initiate pattern-matching on the the last argument of a function. For example, we can write a function called sum, which computes the sum of a list of integers, this way let rec sum = function | [] -> 0 | h::t -> h + sum t ;; val sum : int list -&...
For this example, we will used 4 bodies and will show only the last 8 bits of the bit masks for simplicity. The 4 bodies are 3 SKSpriteNodes, each with a physics body and a boundary: let edge = frame.insetBy(dx: 0, dy: 0) physicsBody = SKPhysicsBody(edgeLoopFrom: edge) Note that the 'ed...
If you have an Arduino connected to a computer or a Raspberry Pi, and want to send data from the Arduino to the PC you can do the following: Arduino: void setup() { // Opens serial port, sets data rate to 9600 bps: Serial.begin(9600); } void loop() { // Sends a line over serial: Se...
You can include/install Select2 in one of the two ways Directly using CDN's in your project under the head section of your project. link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet"/> <script src="https://cdnjs...
╔═══════════╦════════════╦═══════════════════════════════════════════════════════════════════╗ ║ From ║ To ║ Example ║ ╠═══════════╬════════════╬═══════════════════════════════════════════════════════════════════╣ ║String ...
Ffmpeg is a swiss knife for streaming project. For any kind of device streaming you only need to get the specification of device. To list the device ffmpeg -f dshow -list_devices true -i dummy Command prompt will list all the aviable device on machine. [dshow @ 0000000004052420] DirectShow vid...
In Rx Subjects have internal states that can control their behavior. A common use-case form Subject is subscribing it to multiple Observables. The following example creates two different Observables and subscribes a Subject to both of them. Then it tries to print all values that went through: let ...
Let's implement a basic protocol that converts Kelvin and Fahrenheit temperatures to Celsius. defmodule Kelvin do defstruct name: "Kelvin", symbol: "K", degree: 0 end defmodule Fahrenheit do defstruct name: "Fahrenheit", symbol: "°F", degree: 0 en...
import SpriteKit import UIKit protocol StackViewDelegate: class { func didTapOnView(at index: Int) } class GameMenuView: UIStackView { weak var delegate: StackViewDelegate? override init(frame: CGRect) { super.init(frame: frame) self.axis = .vertical sel...
1) IP based vhosts <VirtualHost 192.168.13.37> ServerName example.com DocumentRoot /var/www/domains/example.com/html ErrorLog /var/log/example.com/error.log CustomLog /var/log/example.com/access.log common </VirtualHost> <VirtualHost 192.168.47.11> ...

Page 741 of 826