APT and APT-GET
Easiest and fastest way is with apt-get command. This command may be considered as lower-level and "back-end", and support other APT-based tools. There are no fancy loaders, only basic progress info. This is fastest way for installing apps.
Usage:
sudo apt-get install ...
To check if a method was called on a mocked object you can use the Mockito.verify method:
Mockito.verify(someMock).bla();
In this example, we assert that the method bla was called on the someMock mock object.
You can also check if a method was called with certain parameters:
Mockito.verify(som...
Sitecore Instance Manager is open-source tool which is used for managing the local park of Sitecore instances. You can install, locate, maintain, reinstal or delete Sitecore products. It also helps you install your sitecore instance with any sitecore packages, modules and only thing you need to do i...
The following C code uses the OpenMP parallel programming model to write the thread ID and number of threads to stdout using multiple threads.
#include <omp.h>
#include <stdio.h>
int main ()
{
#pragma omp parallel
{
// ID of the thread in the current team
...
Please note that continued use of Sublime Text requires that you purchase a license and you are asked to note the terms and conditions.
The process of installing Sublime Text is different for each platform, but in each case you need to visit the download page.
After installing ST3, it is common to...
With Parallel List Comprehensions language extension,
[(x,y) | x <- xs | y <- ys]
is equivalent to
zip xs ys
Example:
[(x,y) | x <- [1,2,3] | y <- [10,20]]
-- [(1,10),(2,20)]
Code snippet:
import java.util.Set;
public class ThreadStatus {
public static void main(String args[]) throws Exception {
for (int i = 0; i < 5; i++){
Thread t = new Thread(new MyThread());
t.setName("MyThread:" + i);
t.start();
...
// application/controllers/Company_controller.php
<?php
if(!defined('BASEPATH'))
exit('No direct script access allowed');
class Company_controller extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->model('companies_mo...
Assuming you have Eclipse IDE for Java Developers installed, start Eclipse, click "Help" -> "Install New Software..."
Select "--All Available Sites--" at "Work with:", and navigate to "Eclipse Plugin Development Tools".
Select "Eclipse Pl...
Phoenix framework is written in Elixir, and Elixir itself is based on Erlang language and leverages the Erlang VM, known for running low-latency, distributed and fault-tolerant systems. Both languages are required for using phoenix framework. Following following step to install phoenix framework:
1...
ActionMailer supports three callbacks
before_action
after_action
around_action
Provide these in your Mailer class
class UserMailer < ApplicationMailer
after_action :set_delivery_options, :prevent_delivery_to_guests, :set_business_headers
Then create these methods under the private ...
git log --pretty=format:"%Cgreen%ci %Cblue%cn %Cgreen%cr%Creset %s"
This will give a nice overview of all commits (1 per line) with date, user and commit message.
The --pretty option has many placeholders, each starting with %. All options can be found here
Tests all polygon sides for intersections to determine if 2 polygons are colliding.
// polygon objects are an array of vertices forming the polygon
// var polygon1=[{x:100,y:100},{x:150,y:150},{x:50,y:150},...];
// The polygons can be both concave and convex
// return true if the 2 polygons ...
Sometimes you want an installation without anything except the bare minimum phoenix setup. The follow command will give you that.
mix phoenix.new web --no-brunch --no-ecto
Note: You must have installed Elixir, Erlang, Hex, Mix and the Phoenix archive for skeleton installation
$router = new \Phalcon\Mvc\Router(false);
$router->removeExtraSlashes(true);
$request = new \Phalcon\Http\Request();
$action = strtolower($request->getMethod()); // get, post, etc.
$modules = ['calendar', 'main', 'user']; // names of the modules you create
// you can define other static...
For browsers that do not support the progress element, you can use this as a workaround.
<progress max="100" value="20">
<div class="progress-bar">
<span style="width: 20%;">Progress: 20%</span>
</div>
</pr...
Sometimes we need to change words position from one place to another or reduce size of the words and change the color of words automatically to improve the attraction of our website or web apps. JQuery helps a lot with this concept using fadeIn(), hide(), slideDown() but its functionality are limite...
In order to call a function through a function pointer, the function pointer's type must exactly match the function's type. Otherwise, the behaviour is undefined. Example:
int f();
void (*p)() = reinterpret_cast<void(*)()>(f);
p(); // undefined