Spring is a framework, which provides bunch of classes, by using this we don't need to write boiler plate logic in our code, so Spring provides an abstract layer on J2ee.
For Example in Simple JDBC Application programmer is responsible for
Loading the driver class
Creating the connection
Cre...
What happens when we execute python -m SimpleHTTPServer 9000?
To answer this question we should understand the construct of SimpleHTTPServer (https://hg.python.org/cpython/file/2.7/Lib/SimpleHTTPServer.py) and BaseHTTPServer(https://hg.python.org/cpython/file/2.7/Lib/BaseHTTPServer.py).
Firstly, P...
Expression<Func<int, bool>> checkEvenExpression = i => i%2 == 0;
// lambda expression is automatically converted to an Expression<Func<int, bool>>
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
...
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 ...
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...