If you want custom configuration from ports, you can configure it before building it make config. All ports configuration are stored in /var/db/ports/${CATEGORY_NAME}/options as makefile.
Configuring www/apache24
cd /usr/ports/www/apache24
make config
make
make install
This configuration wil...
Manual packaging
You can make your own package based on ports.
cd /usr/ports/www/apache24
make package BATCH=yes
This command will store your package in /usr/ports/packages/All.
Using poudriere
poudriere is currently the official package builder for FreeBSD.
Installing poudriere
pkg instal...
A jail is simply a chroot with strong isolation. So, if you want to create jail, you simply need to create an alternative root and starting a new jail in it.
Simple jail deployment from binaries
# create our alternative root path
JAILROOT="/path/to/my/jail"
mkdir -p "${JAILROOT}&q...
FreeBSD jails can have fine grained networking configuration. By default, every jails use the same network configuration than host.
Removing network support
jail -c name="nonetwork" path="/path/to/your/jail" ip4=disable ip6=disable
Allowing only IPv4 networking
jail -c name...
Regular expression matching is a powerful tool (in Java, and in other contexts) but it does have some drawbacks. One of these that regular expressions tends to be rather expensive.
Pattern and Matcher instances should be reused
Consider the following example:
/**
* Test if all strings in a lis...
Three basic tools.
nginx - free, open-source, high-performance HTTP server and reverse proxy, with high performance;
gunicorn - 'Green Unicorn' is a Python WSGI HTTP Server for UNIX (needed to manage your server);
supervisor - a client/server system that allows its users to monitor and control ...
When invoking a def, parameters may be assigned explicitly by name. Doing so means they needn't be correctly ordered. For example, define printUs() as:
// print out the three arguments in order.
def printUs(one: String, two: String, three: String) =
println(s"$one, $two, $three")
...
The for comprehension is a compact way to run a block of code that depends on the successful result of multiple futures.
With f1, f2, f3 three Future[String]'s that will contain the strings one, two, three respectively,
val fCombined =
for {
s1 <- f1
s2 <- f2
...
.iloc uses integers to read and write data to a DataFrame.
First, let's create a DataFrame:
df = pd.DataFrame({'one': [1, 2, 3, 4, 5],
'two': [6, 7, 8, 9, 10],
}, index=['a', 'b', 'c', 'd', 'e'])
This DataFrame looks like:
one two
a 1 6
b 2 ...
Command Structure is
sqlcmd -S yourservername\instancename -d database_name -o outputfilename_withpath -Q "your select query"
Switches are as follows
-S for servername and instance name
-d for source database
-o for target outputfile (it will create output file)
-Q fo...
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...
' A "Hello, World!" program in Visual Basic.
Module Hello
Sub Main()
MsgBox("Hello, World!") ' Display message on computer screen.
End Sub
End Module
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...
cordova-plugin-battery-status - used for monitoring device's battery status.
cordova-plugin-camera - provides an API for taking pictures and for choosing images from the system's image library.
cordova-plugin-contacts - provides access to the device contacts database.
cordova-plug...
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 ...
[TestFixture]
public class Tests {
[Test]
public void Test1() {
Assert.That(true, Is.EqualTo(true));
}
}
A test fixture marks a class as containing tests.
Pygame has a module, pygame.draw, that contains functions which can draw shapes directly to a Surface.
FunctionDescriptionpygame.draw.rectdraw a rectangle shapepygame.draw.polygondraw a shape with any number of sidespygame.draw.circledraw a circle around a pointpygame.draw.ellipsedraw a round shape...