You can push tasks or data to the firebase realtime database and run a worker which listens to the firebase queue to run some background processess
Setup firebase
Create a Firebase project in the Firebase console, if you don't already have one. If you already have an existing Google project a...
Expression<Func<int, bool>> checkEvenExpression = i => i%2 == 0;
// lambda expression is automatically converted to an Expression<Func<int, bool>>
keyword search
cd /usr/ports
make search key=apache
name search
cd /usr/ports
make search name=apache24
Using fresports
Official FreeBSD ports website (http://freshports.org/) give you a nice way to find ports and all information concerning it.
If you have found your software in the ports tree, now its the time to build it.
Simple build and install with manual configuration
cd /usr/ports/www/apache24
make
make install
Simple build and install with automatic configuration
cd /usr/ports/www/apache24
make BATCH=yes
make install
...
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...
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.