How to createa Spring MVC web application using maven. We will start from scratch creating the project with maven, then we will add some depencencies and create the java code. Finally we will build the .war file.
I want to remove the 1st and the 5th columns of a text file of tab separated values. The file is as follows:
HEAD1 HEAD2 HEAD3 HEAD4 HEAD5 HEAD6 1.0 -3 3.4 2 7 9 -100 -30 -1 0 -80 7 70 7 8 0 3 0 71 4.5 2.1 0.6 37 4
If the size of your virtual disk inside Virtualbox is not big enough to save all your data you can always increase its size and resize the partition.
Download a kernel source from kernel.org and let’s suppose that it is extracted in the directory ~/linux-x.yy.zz
Sometimes it can be a good idea to start with a current kernel configuration. You can get this configuration from the text file /boot/config-xx.yy.zz or a compressed version from /proc/config.gz. Copy the text file into ~/linux-x.yy.zz/.config.
Now you can start configuring the new kernel by executing inside the dir ~/linux-x.yy.zz/:
Then compile the kernel, the modules and the image:
make make bzImage
If everything it’s ok the new kernel will be in ~/linux-x.yy.zz/arch/x86/boot/bzImage. Copy this file to the boot directory in the desired machine:
cp ~/linux-x.yy.zz/arch/x86/boot/bzImage /boot/vmlinuz-x.yy.z
Now you have to compile and install the modules:
make modules make modules_install
This will copy all the firmware and modules to /lib/firmware and /lib/modules/x.yy.z. If you want to change the directory you can do it by defining the INSTALL_MOD_PATH environment variable.
After install all the modules you have to go to /boot directory, create the initramfs and update the grub.
update-initramfs -c -k x.yy.zz update-grub
First create the virtual machine called myVirtualHost and register it:
VBoxManage createvm --name myVirtualHost --register
Then create a hard disk of 10Gbytes:
VBoxManage createhd --filename myhdd1.vdi -size 10240
This will create the file ~/.VirtualBox/HardDisks/myhdd1.vdi
Add an ide controller and the hard disk:
VBoxManage storagectl myVirtualHost --name "IDE Controller" --add ide VBoxManage modifyvm myVirtualHost --hda .VirtualBox/HardDisks/myhdd1.vdi
You can add more disks with these commands:
VBoxManage modifyvm myVirtualHost --hdb .VirtualBox/HardDisks/myhdd2.vdi VBoxManage storageattach myVirtualHost --storagectl "IDE Controller" --device 1 --port 0 --type hdd --medium .VirtualBox/HardDisks/myhdd3.vdi
Now I will give this machine 512Mbytes of RAM:
VBoxManage modifyvm myVirtualHost --memory 512 --acpi on
You have different network options. If you want to give your virtual machine its own IP addpress you have to use the bridged mode:
VBoxManage modifyvm myVirtualHost --nic1 bridged
If you want to use the same IP address than your host machine you can use NAT. In this case you can configure NAT port forwarding to access to some services, for example with these lines you can access the SSH service of our virtual machine by connecting to the port 2222 from your host.
VBoxManage modifyvm myVirtualHost --nic1 nat VBoxManage modifyvm myVirtualHost --natpf1 "guestssh,tcp,,2222,,22"
To launch the virtual machine and leave it in background you can use one of the following lines:
nohup VBoxHeadless -s myVirtualHost --vnc --vncpass mys3cr3t & nohup VBoxHeadless -s myVirtualHost --vrde off &
The first one will enable VNC and also terminal server.
The second one will disable both, VNC and terminal server.
One day, after restart my PC the grub console appears:
Part of this post is extracted from R-admin and R manual.
A package is loaded from a library by the function library(). Thus a library is a directory containing installed packages; the main library is R_HOME/library, but others can be used, for example by setting the environment variable R_LIBS or using the R function .libPaths():
> .libPaths()  "/home/jose/R/x86_64-redhat-linux-gnu-library/3.1"  "/usr/lib64/R/library"  "/usr/share/R/library"
The set of packages loaded on startup is by default:
> getOption("defaultPackages")  "datasets" "utils" "grDevices" "graphics" "stats" "methods"
To install a new package write:
> install.packages("PackageName", repos = "http://repository_url", dependencies = TRUE)
install.packages can install a source package from a local .tar.gz file by setting argument repos to NULL: this will be selected automatically if the name given is a single .tar.gz file.
install.packages can look in several repositories, specified as a character vector by the argument repos: these can include a CRAN mirror, Bioconductor, Omegahat, R-forge, rforge.net, local archives, local files, …). Function setRepositories() can select amongst those repositories that the R installation is aware of.
The available packates ready to install are shown by calling available.packages().
The command installed.packages finds details of all packages installed. The return value is a matrix with one row per package, row names the package names and column names (currently) “Package”, “LibPath”, “Version”, “Priority”, “Depends”, “Imports”, “LinkingTo”, “Suggests”, “Enhances”, “OS_type”, “License” and “Built”. To see only the name of the installed packages write:
To remove an installed package use the command remove.packages:
To load a package use the command library:
The attached packages and extra info can be asked by sessionInfo() command.
source causes R to accept its input from the named file or URL or connection. Input is read and ‘parse’d from that file until the end of the file is reached, then the parsed expressions are evaluated sequentially in the chosen environment.