text:
import sys
sys.path.append('../')
import os
import numpy as np
from PIL import Image
import imageio
import torch
from torch.utils.data import Dataset
from .data_utils import quaternion_about_axis, quaternion_matrix, random_crop, random_flip
import json

def view_obj2camera_rgb(view):
    image_path = view.image_path
    intrinsics = view.camera.intrinsics
    h_in_view, w_in_view = view.shape
    rgb = imageio.imread(image_path).astype(np.float32) / 255.
    h_img, w_img = rgb.shape[:2]
    if h_in_view != h_img or w_in_view != w_img:
        intrinsics[0] *= w_img / w_in_view
        intrinsics[1] *= h_img / h_in_view
    intrinsics_4x4 = np.eye(4)
    intrinsics_4x4[:3, :3] = intrinsics
    c2w = view.camera.w_f_c
    ref_camera = np.concatenate([list(rgb.shape[:2]), intrinsics_4x4.flatten(), c2w.flatten()])
    return ref_camera, rgb

def view_obj2camera_rgb_path(view):
    img_size = view.shape
    image_path = view.image_path
    intrinsics = view.camera.intrinsics
    intrinsics_4x4 = np.eye(4)
    intrinsics_4x4[:3, :3] = intrinsics
    c2w = view.camera.w_f_c
    return image_path, img_size, intrinsics_4x4, c2w

def sample_target_view_for_training(views, input_rig_id, input_ids):
    input_rig_views = views[input_rig_id]
    input_cam_positions = np.array([input_rig_views[i].camera.w_f_c[:3, 3] for i in input_ids])

    remaining_rig_ids = []
    remaining_cam_ids = []

    for i, rig in enumerate(views):
        for j, cam in enumerate(rig):
            if i == input_rig_id and j in input_ids:
                continue
            else:
                cam_loc = views[i][j].camera.w_f_c[:3, 3]
                # if i != input_rig_id:
                #     print(np.min(np.linalg.norm(input_cam_positions - cam_loc, axis=1)))
                if np.min(np.linalg.norm(input_cam_positions - cam_loc, axis=1)) < 0.15:
                    remaining_rig_ids.append(i)
                    remaining_cam_ids.append(j)

    selected_id = np.random.choice(len(remaining_rig_ids))
    selected_view = views[remaining_rig_ids[selected_id]][remaining_cam_ids[selected_id]]
    return selected_view

def get_all_views_in_scene(all_views):
    cameras = []
    rgbs = []
    for rig in all_views:
        for i in range(len(rig)):
            camera, rgb = view_obj2camera_rgb(rig[i])
            cameras.append(camera)
            rgbs.append(rgb)
    return cameras, rgbs

def get_all_views_in_scene_cam_path(all_views):
    c2w_mats = []
    intrinsicss = []
    rgb_paths = []
    img_sizes = []
    for rig in all_views:
        for i in range(len(rig)):
            image_path, img_size, intrinsics_4x4, c2w = view_obj2camera_rgb_path(rig[i])
            rgb_paths.append(image_path)
            intrinsicss.append(intrinsics_4x4)
            c2w_mats.append(c2w)
            img_sizes.append(img_size)
    return rgb_paths, img_sizes, intrinsicss, c2w_mats

def sort_nearby_views_by_angle(query_pose, ref_poses):
    query_direction = np.sum(query_pose[:3, 2:4], axis=-1)
    query_direction = query_direction / np.linalg.norm(query_direction)
    ref_directions = np.sum(ref_poses[:, :3, 2:4], axis=-1)
    ref_directions = ref_directions / np.linalg.norm(ref_directions, axis=-1, keepdims=True)
    inner_product = np.sum(ref_directions * query_direction[None, ...], axis=1)
    sorted_inds = np.argsort(inner_product)[::-1]
    return sorted_inds

class Camera(object):
    """Represents a Camera with intrinsics and world from/to camera transforms.
    Attributes:
      w_f_c: The world from camera 4x4 matrix.
      c_f_w: The camera from world 4x4 matrix.
      intrinsics: The camera intrinsics as a 3x3 matrix.
      inv_intrinsics: The inverse of camera intrinsics matrix.
    """

    def __init__(self, intrinsics, w_f_c):
        """Constructor.
        Args:
          intrinsics: A numpy 3x3 array representing intrinsics.
          w_f_c: A numpy 4x4 array representing wFc.
        """
        self.intrinsics = intrinsics
        self.inv_intrinsics = np.linalg.inv(intrinsics)
        self.w_f_c = w_f_c
        self.c_f_w = np.linalg.inv(w_f_c)

class View(object):
    """Represents an image and associated camera geometry.
    Attributes:
      camera: The camera for this view.
      image: The np array containing the image data.
      image_path: The file path to the image.
      shape: The 2D shape of the image.
    """

    def __init__(self, image_path, shape, camera):
        self.image_path = image_path
        self.shape = shape
        self.camera = camera
        self.image = None

def _WorldFromCameraFromViewDict(view_json):
    """Fills the world from camera transform from the view_json.
    Args:
        view_json: A dictionary of view parameters.
    Returns:
        A 4x4 transform matrix representing the world from camera transform.
    """
    transform = np.identity(4)
    position = view_json['position']
    transform[0:3, 3] = (position[0], position[1], position[2])
    orientation = view_json['orientation']
    angle_axis = np.array([orientation[0], orientation[1], orientation[2]])
    angle = np.linalg.norm(angle_axis)
    epsilon = 1e-7
    if abs(angle) < epsilon:
        # No rotation
        return transform

    axis = angle_axis / angle
    rot_mat = quaternion_matrix(quaternion_about_axis(-angle, axis))
    transform[0:3, 0:3] = rot_mat[0:3, 0:3]
    return transform

def _IntrinsicsFromViewDict(view_params):
    """Fills the intrinsics matrix from view_params.
    Args:
        view_params: Dict view parameters.
    Returns:
        A 3x3 matrix representing the camera intrinsics.
    """
    intrinsics = np.identity(3)
    intrinsics[0, 0] = view_params['focal_length']
    intrinsics[1, 1] = (view_params['focal_length'] * view_params['pixel_aspect_ratio'])
    intrinsics[0, 2] = view_params['principal_point'][0]
    intrinsics[1, 2] = view_params['principal_point'][1]
    return intrinsics

def ReadView(base_dir, view_json):
    return View(
        image_path=os.path.join(base_dir, view_json['relative_path']),
        shape=(int(view_json['height']), int(view_json['width'])),
        camera=Camera(
            _IntrinsicsFromViewDict(view_json),
            _WorldFromCameraFromViewDict(view_json)))

def ReadScene(base_dir):
    """Reads a scene from the directory base_dir."""
    with open(os.path.join(base_dir, 'models.json')) as f:
        model_json = json.load(f)

    all_views = []
    for views in model_json:
        all_views.append([ReadView(base_dir, view_json) for view_json in views])
    return all_views

def InterpolateDepths(near_depth, far_depth, num_depths):
    """Returns num_depths from (far_depth, near_depth), interpolated in inv depth.
    Args:
        near_depth: The first depth.
        far_depth: The last depth.
        num_depths: The total number of depths to create, include near_depth and
        far_depth are always included and other depths are interpolated between
        them, in inverse depth space.
    Returns:
        The depths sorted in descending order (so furthest first). This order is
        useful for back to front compositing.
  """

    inv_near_depth = 1.0 / near_depth
    inv_far_depth = 1.0 / far_depth
    depths = []
    for i in range(0, num_depths):
        fraction = float(i) / float(num_depths - 1)
        inv_depth = inv_far_depth + (inv_near_depth - inv_far_depth) * fraction
        depths.append(1.0 / inv_depth)
    return depths

def ReadViewImages(views):
    """Reads the images for the passed views."""
    for view in views:
        # Keep images unnormalized as uint8 to save RAM and transmission time to
        # and from the GPU.
        view.image = np.array(Image.open(view.image_path))

def WriteNpToImage(np_image, path):
    """Writes an image as a numpy array to the passed path.
        If the input has more than four channels only the first four will be
        written. If the input has a single channel it will be duplicated and
        written as a three channel image.
    Args:
        np_image: A numpy array.
        path: The path to write to.
    Raises:
        IOError: if the image format isn't recognized.
    """

    min_value = np.amin(np_image)
    max_value = np.amax(np_image)
    if min_value < 0.0 or max_value > 255.1:
        print('Warning: Outside image bounds, min: %f, max:%f, clipping.', min_value, max_value)
        np.clip(np_image, 0.0, 255.0)
    if np_image.shape[2] == 1:
        np_image = np.concatenate((np_image, np_image, np_image), axis=2)

    if np_image.shape[2] == 3:
        image = Image.fromarray(np_image.astype(np.uint8))
    elif np_image.shape[2] == 4:
        image = Image.fromarray(np_image.astype(np.uint8), 'RGBA')

    _, ext = os.path.splitext(path)
    ext = ext[1:]
    if ext.lower() == 'png':
        image.save(path, format='PNG')
    elif ext.lower() in ('jpg', 'jpeg'):
        image.save(path, format='JPEG')
    else:
        raise IOError('Unrecognized format for %s' % path)

# only for training
class SpacesDataset(Dataset):
    def __init__(self, args, mode, **kwargs):
        self.folder_path = os.path.join(args.rootdir, 'data/spaces_dataset/data/800/')
        self.num_source_views = args.num_source_views
        self.mode = mode
        assert mode in ['train', 'test', 'validation']
        eval_scene_ids = [0, 9, 10, 23, 24, 52, 56, 62, 63, 73]
        train_scene_ids = [i for i in np.arange(0, 100) if i not in eval_scene_ids]
        if mode == 'train':
            self.scene_dirs = [os.path.join(self.folder_path, 'scene_{:03d}'.format(i)) for i in train_scene_ids]
        else:
            self.scene_dirs = [os.path.join(self.folder_path, 'scene_{:03d}'.format(i)) for i in eval_scene_ids]

        self.all_views_scenes = []
        for scene_dir in self.scene_dirs:
            views = ReadScene(scene_dir)
            self.all_views_scenes.append(views)

        self.input_view_types = ["small_quad", "medium_quad", "large_quad", "dense"]
        self.eval_view_indices_dict = {
            "small_quad": [5, 6, 7],
            "medium_quad": [2, 4, 5, 6, 7, 11],
            "large_quad": [1, 2, 4, 5, 6, 7, 8, 10, 11],
            "dense": [5, 7, 10, 11]
        }
        self.input_indices_dict = {
            "small_quad": [1, 2, 10, 11],
            "medium_quad": [1, 3, 10, 12],
            "large_quad": [0, 3, 9, 12],
            "dense": [0, 1, 2, 3, 4, 6, 8, 9, 12, 13, 14, 15]
        }

    def __len__(self):
        return len(self.all_views_scenes)

    def __getitem__(self, idx):
        all_views = self.all_views_scenes[idx]
        num_rigs = len(all_views)
        selected_rig_id = np.random.randint(low=0, high=num_rigs)  # select a rig position
        rig_selected = all_views[selected_rig_id]
        type = np.random.choice(self.input_view_types)  # select an input type
        input_ids = self.input_indices_dict[type]
        if len(input_ids) > self.num_source_views:
            input_ids = np.random.choice(input_ids, self.num_source_views, replace=False)

        ref_cameras = []
        ref_rgbs = []
        w_max, h_max = 0, 0
        for id in input_ids:
            ref_camera, ref_rgb = view_obj2camera_rgb(rig_selected[id])
            ref_rgbs.append(ref_rgb)
            ref_cameras.append(ref_camera)
            h, w = ref_rgb.shape[:2]
            w_max = max(w, w_max)
            h_max = max(h, h_max)

        ref_rgbs_np = np.zeros((len(ref_rgbs), h_max, w_max, 3), dtype=np.float32)
        for i, ref_rgb in enumerate(ref_rgbs):
            orig_h, orig_w = ref_rgb.shape[:2]
            h_start = int((h_max - orig_h) / 2.)
            w_start = int((w_max - orig_w) / 2.)
            ref_rgbs_np[i, h_start:h_start+orig_h, w_start:w_start+orig_w] = ref_rgb
            ref_cameras[i][4] += (w_max - orig_w) / 2.
            ref_cameras[i][8] += (h_max - orig_h) / 2.
            ref_cameras[i][0] = h_max
            ref_cameras[i][1] = w_max

        # select target view
        if self.mode != 'train':
            target_id = np.random.choice(self.eval_view_indices_dict[type])
            target_view = rig_selected[target_id]
            target_camera, target_rgb = view_obj2camera_rgb(target_view)
        else:
            target_view = sample_target_view_for_training(all_views, selected_rig_id, input_ids)
            target_camera, target_rgb = view_obj2camera_rgb(target_view)

        ref_cameras = np.array(ref_cameras)
        if np.random.choice([0, 1], p=[0.5, 0.5]) and self.mode == 'train':
            target_rgb, target_camera, ref_rgbs_np, ref_cameras = random_flip(target_rgb, target_camera,
                                                                              ref_rgbs_np, ref_cameras)

        near_depth = 1.
        far_depth = 100.
        depth_range = torch.tensor([near_depth, far_depth])

        return {'rgb': torch.from_numpy(target_rgb).float(),
                'camera': torch.from_numpy(target_camera).float(),
                'rgb_path': target_view.image_path,
                'src_rgbs': torch.from_numpy(ref_rgbs_np).float(),
                'src_cameras': torch.from_numpy(np.stack(ref_cameras, axis=0)).float(),
                'depth_range': depth_range
                }

class SpacesFreeDataset(Dataset):
    def __init__(self, args, mode, **kwargs):
        self.folder_path = os.path.join(args.rootdir, 'data/spaces_dataset/data/800/')
        self.mode = mode
        self.num_source_views = args.num_source_views
        self.random_crop = True
        assert mode in ['train', 'test', 'validation']
        # eval_scene_ids = [0, 9, 10, 23, 24, 52, 56, 62, 63, 73]
        eval_scene_ids = []
        # use all 100 scenes in spaces dataset for training
        train_scene_ids = [i for i in np.arange(0, 100) if i not in eval_scene_ids]
        if mode == 'train':
            self.scene_dirs = [os.path.join(self.folder_path, 'scene_{:03d}'.format(i)) for i in train_scene_ids]
        else:
            self.scene_dirs = [os.path.join(self.folder_path, 'scene_{:03d}'.format(i)) for i in eval_scene_ids]

        self.all_views_scenes = []
        self.all_rgb_paths_scenes = []
        self.all_intrinsics_scenes = []
        self.all_img_sizes_scenes = []
        self.all_c2w_scenes = []
        for scene_dir in self.scene_dirs:
            views = ReadScene(scene_dir)
            self.all_views_scenes.append(views)
            rgb_paths, img_sizes, intrinsicss, c2w_mats = get_all_views_in_scene_cam_path(views)
            self.all_rgb_paths_scenes.append(rgb_paths)
            self.all_img_sizes_scenes.append(img_sizes)
            self.all_intrinsics_scenes.append(intrinsicss)
            self.all_c2w_scenes.append(c2w_mats)

    def __len__(self):
        return len(self.all_views_scenes)

    def __getitem__(self, idx):
        all_views = self.all_views_scenes[idx]
        num_rigs = len(all_views)
        selected_rig_id = np.random.randint(low=0, high=num_rigs)  # select a rig position
        rig_selected = all_views[selected_rig_id]
        cam_id_selected = np.random.choice(16)
        cam_selected = rig_selected[cam_id_selected]
        render_camera, render_rgb = view_obj2camera_rgb(cam_selected)
        all_c2w_mats = self.all_c2w_scenes[idx]
        all_rgb_paths = self.all_rgb_paths_scenes[idx]
        all_intrinsics = self.all_intrinsics_scenes[idx]
        all_img_sizes = self.all_img_sizes_scenes[idx]
        sorted_ids = sort_nearby_views_by_angle(render_camera[-16:].reshape(4, 4), np.array(all_c2w_mats))
        nearby_view_ids_selected = np.random.choice(sorted_ids[1:],
                                                    self.num_source_views, replace=False)

        ref_cameras = []
        ref_rgbs = []
        w_max, h_max = 0, 0
        for id in nearby_view_ids_selected:
            rgb_path = all_rgb_paths[id]
            ref_rgb = imageio.imread(rgb_path).astype(np.float32) / 255.
            h_in_view, w_in_view = all_img_sizes[id]
            h_img, w_img = ref_rgb.shape[:2]
            ref_rgbs.append(ref_rgb)
            ref_intrinsics = all_intrinsics[id]
            if h_in_view != h_img or w_in_view != w_img:
                ref_intrinsics[0] *= w_img / w_in_view
                ref_intrinsics[1] *= h_img / h_in_view
            ref_c2w = all_c2w_mats[id]
            ref_camera = np.concatenate([list(ref_rgb.shape[:2]), ref_intrinsics.flatten(), ref_c2w.flatten()])
            ref_cameras.append(ref_camera)
            h, w = ref_rgb.shape[:2]
            w_max = max(w, w_max)
            h_max = max(h, h_max)

        ref_rgbs_np = np.ones((len(ref_rgbs), h_max, w_max, 3), dtype=np.float32)
        for i, ref_rgb in enumerate(ref_rgbs):
            orig_h, orig_w = ref_rgb.shape[:2]
            h_start = int((h_max - orig_h) / 2.)
            w_start = int((w_max - orig_w) / 2.)
            ref_rgbs_np[i, h_start:h_start+orig_h, w_start:w_start+orig_w] = ref_rgb
            ref_cameras[i][4] += (w_max - orig_w) / 2.
            ref_cameras[i][8] += (h_max - orig_h) / 2.
            ref_cameras[i][0] = h_max
            ref_cameras[i][1] = w_max

        ref_cameras = np.array(ref_cameras)
        if self.mode == 'train' and self.random_crop:
            render_rgb, render_camera, ref_rgbs_np, ref_cameras = random_crop(render_rgb, render_camera,
                                                                              ref_rgbs_np, ref_cameras)

        if self.mode == 'train' and np.random.choice([0, 1]):
            render_rgb, render_camera, ref_rgbs_np, ref_cameras = random_flip(render_rgb, render_camera,
                                                                              ref_rgbs_np, ref_cameras)

        near_depth = 0.7
        far_depth = 100
        depth_range = torch.tensor([near_depth, far_depth])

        return {'rgb': torch.from_numpy(render_rgb).float(),
                'camera': torch.from_numpy(render_camera).float(),
                'rgb_path': cam_selected.image_path,
                'src_rgbs': torch.from_numpy(ref_rgbs_np).float(),
                'src_cameras': torch.from_numpy(np.stack(ref_cameras, axis=0)).float(),
                'depth_range': depth_range
                }


text:
package com.hazelcast.client.impl.protocol.task.multimap;

import com.hazelcast.client.impl.protocol.ClientMessage;
import com.hazelcast.client.impl.protocol.codec.MultiMapValueCountCodec;
import com.hazelcast.client.impl.protocol.task.AbstractPartitionMessageTask;
import com.hazelcast.instance.Node;
import com.hazelcast.multimap.impl.MultiMapService;
import com.hazelcast.multimap.impl.operations.CountOperation;
import com.hazelcast.nio.Connection;
import com.hazelcast.security.permission.ActionConstants;
import com.hazelcast.security.permission.MultiMapPermission;
import com.hazelcast.spi.Operation;

import java.security.Permission;

/**
 * Client Protocol Task for handling messages with type id:
 * {@link com.hazelcast.client.impl.protocol.codec.MultiMapMessageType#MULTIMAP_VALUECOUNT}
 */
public class MultiMapValueCountMessageTask
        extends AbstractPartitionMessageTask<MultiMapValueCountCodec.RequestParameters> {

    public MultiMapValueCountMessageTask(ClientMessage clientMessage, Node node, Connection connection) {
        super(clientMessage, node, connection);
    }

    @Override
    protected Operation prepareOperation() {
        CountOperation operation = new CountOperation(parameters.name, parameters.key);
        operation.setThreadId(parameters.threadId);
        return operation;
    }

    @Override
    protected MultiMapValueCountCodec.RequestParameters decodeClientMessage(ClientMessage clientMessage) {
        return MultiMapValueCountCodec.decodeRequest(clientMessage);
    }

    @Override
    protected ClientMessage encodeResponse(Object response) {
        return MultiMapValueCountCodec.encodeResponse((Integer) response);
    }

    @Override
    public String getServiceName() {
        return MultiMapService.SERVICE_NAME;
    }

    @Override
    public Permission getRequiredPermission() {
        return new MultiMapPermission(parameters.name, ActionConstants.ACTION_READ);
    }

    @Override
    public String getDistributedObjectName() {
        return parameters.name;
    }

    @Override
    public String getMethodName() {
        return "valueCount";
    }

    @Override
    public Object[] getParameters() {
        return new Object[]{parameters.key};
    }
}

redpajama_set_name: RedPajamaGithub


text:
// File: SubscriberCallbacks.cs
// Project: ROS_C-Sharp
//
// ROS.NET
// Eric McCann <emccann@cs.uml.edu>
// UMass Lowell Robotics Laboratory
//
// Reimplementation of the ROS (ros.org) ros_cpp client in C#.
//
// Created: 11/06/2013
// Updated: 07/23/2014

#region Using

#endregion

namespace Ros_CSharp
{
    public class SubscriberCallbacks
    {
        public CallbackQueueInterface Callback;
        public SubscriberStatusCallback connect, disconnect;

        public SubscriberCallbacks() : this(null, null, null)
        {
        }

        public SubscriberCallbacks(SubscriberStatusCallback connectCB, SubscriberStatusCallback disconnectCB,
            CallbackQueueInterface Callback)
        {
            connect = connectCB;
            disconnect = disconnectCB;
            this.Callback = Callback;
        }

        internal ulong Get()
        {
            return ROS.getPID();
        }
    }
}


text:
/*
 * 	Core Owl Carousel CSS File
 *	v1.3.2
 */

/* clearfix */
.owl-carousel .owl-wrapper:after {
    content: ".";
    display: block;
    clear: both;
    visibility: hidden;
    line-height: 0;
    height: 0;
}

/* display none until init */
.owl-carousel {
    display: none;
    position: relative;
    width: 100%;
    -ms-touch-action: pan-y;
}

#services .owl-controls .owl-page span {
    border-radius: 0 !important;
    height: 5px;
    width: 25px;
}

.slides-navigation a:focus,
.slides-navigation a:hover {
    color: #ffffff !important;
}

.owl-carousel .owl-wrapper {
    display: none;
    position: relative;
    -webkit-transform: translate3d(0px, 0px, 0px);
}

.owl-carousel .owl-wrapper-outer {
    overflow: hidden;
    position: relative;
    width: 100%;
}

.owl-carousel .owl-wrapper-outer.autoHeight {
    -webkit-transition: height 500ms ease-in-out;
    -moz-transition: height 500ms ease-in-out;
    -ms-transition: height 500ms ease-in-out;
    -o-transition: height 500ms ease-in-out;
    transition: height 500ms ease-in-out;
}

.owl-carousel .owl-item {
    float: left;
}

.owl-controls .owl-page,
.owl-controls .owl-buttons div {
    cursor: pointer;
}

.owl-controls {
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

/* mouse grab icon */
.grabbing {
    cursor: url(images/grabbing.png) 8 8, move;
}

/* fix */
.owl-carousel .owl-wrapper,
.owl-carousel .owl-item {
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
    -webkit-transform: translate3d(0, 0, 0);
    -moz-transform: translate3d(0, 0, 0);
    -ms-transform: translate3d(0, 0, 0);
}

.owl-theme .owl-controls {
    margin-top: 10px;
    text-align: center;
}

/* Styling Next and Prev buttons */

/* Styling Pagination*/

.owl-carousel .owl-controls .owl-prev {
    position: absolute;
    top: -13%;
    right: 30px;
    pointer-events: auto;
}

.owl-carousel .owl-controls .owl-next {
    position: absolute;
    top: -13%;
    right: 0;
    pointer-events: auto;
}

.owl-carousel .owl-controls .owl-prev,
.owl-carousel .owl-controls .owl-next {
    z-index: 1;
    cursor: pointer;
    -webkit-transition: all 200ms ease-in;
    -o-transition: all 200ms ease-in;
    -moz-transition: all 200ms ease-in;
    color: #e0e0e0;
    line-height: 50px;
    text-align: center;
    font-size: 75px;
    width: 30px;
    height: 50px;
}

#owl-testimonial-widget .blog-carousel,
.portfolio-carousel,
#owl_blog_two_line .blog-carousel,
#owl_blog_three_line .blog-carousel,
#owl_shop_carousel .shop_carousel,
#owl_shop_carousel_1 .shop_carousel,
#owl-blog .blog-carousel {
    padding: 0 10px;
}

#owl-testimonial-widget .owl-controls .owl-prev,
#owl-testimonial-widget .owl-controls .owl-next,
#owl_blog_two_line .owl-controls .owl-prev,
#owl_blog_two_line .owl-controls .owl-next,
#owl_blog_three_line .owl-controls .owl-prev,
#owl_blog_three_line .owl-controls .owl-next,
#owl_portfolio_two_line .owl-controls .owl-prev,
#owl_portfolio_two_line .owl-controls .owl-next,
#owl_shop_carousel .owl-controls .owl-prev,
#owl_shop_carousel .owl-controls .owl-next,
#owl_shop_carousel_1 .owl-controls .owl-prev,
#owl_shop_carousel_1 .owl-controls .owl-next,
#owl-blog .owl-controls .owl-prev,
#owl-blog .owl-controls .owl-next {
    color: #fff;
    cursor: pointer;
    font-size: 21px;
    line-height: 25px;
    text-align: center;
    width: 25px;
    height: 28px;
    background: #222;
    border-radius: 3px;
}

.owl-theme .owl-controls .owl-page {
    display: inline-block;
    zoom: 1;
    *display: inline; /*IE7 life-saver */
}

.white-wrapper .owl-theme .owl-controls .owl-page span {
    background-color: #b8b8b8;
}

.owl-theme .owl-controls .owl-page span {
    background-color: #ffffff;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    display: block;
    height: 10px;
    margin: 5px 4px;
    width: 10px;
}

#owl-testimonial .owl-controls .owl-page.active span {
    background-color: #222222;
}

#owl-twitter .owl-controls .owl-page span {
    background-color: #ffffff;
    border-radius: 0 !important;
    display: block;
    height: 4px !important;
    margin: 5px 4px;
    width: 30px !important;
}

#clients .owl-controls .owl-prev,
#clients .owl-controls .owl-next {
    font-size: 21px !important;
    top: 30%;
    background: #dddddd;
    color: #ffffff;
    -webkit-border-radius: 30px;
    -moz-border-radius: 30px;
    border-radius: 30px;
    width: 30px;
    height: 30px;
    line-height: 30px;
}

#clients .owl-controls .owl-prev {
    left: -40px
}

#clients .owl-controls .owl-next {
    right: -40px
}

.owl-theme .owl-controls .owl-page.active span,
.owl-theme .owl-controls.clickable .owl-page:hover span {
    filter: Alpha(Opacity=100); /*IE7 fix*/
    opacity: 1;
}

/* If PaginationNumbers is true */

.owl-theme .owl-controls .owl-page span.owl-numbers {
    height: auto;
    width: auto;
    color: #FFF;
    padding: 2px 10px;
    font-size: 12px;
    -webkit-border-radius: 30px;
    -moz-border-radius: 30px;
    border-radius: 30px;
}

/* preloading images */
.owl-item.loading {
    min-height: 150px;
    background: url(images/ajaxloader.gif) no-repeat center center
}


text:
require 'spec_helper'

describe 'test::pacemaker_stonith' do
  context 'when all attributes are default, on rhel 7.x' do
    let(:chef_run) do
      ChefSpec::ServerRunner.new(platform: 'redhat', version: '7.0', step_into: 'pacemaker_stonith').converge(described_recipe)
    end

    before do
      stub_command('pcs stonith show stonith-ucs').and_return(false)
      stub_command('pcs stonith show stonith-del').and_return(true)
    end

    it 'converges' do
      chef_run
    end

    it 'creates pacemaker stonith when it does not exist' do
      expect(chef_run).to run_execute("create pacemaker stonith 'stonith-ucs'")
        .with(command: 'pcs stonith create stonith-ucs ucs location=b0s0 op monitor interval=5s')
    end

    it 'does not create pacemaker stonith when it exists' do
      stub_command('pcs stonith show stonith-ucs').and_return(true)
      expect(chef_run).not_to run_execute("create pacemaker stonith 'stonith-ucs'")
    end

    it 'deletes pacemaker stonith when it exists' do
      expect(chef_run).to run_execute("delete pacemaker stonith 'stonith-del'")
        .with(command: 'pcs stonith delete stonith-del')
    end

    it 'does not delete pacemaker stonith when it does not exist' do
      stub_command('pcs stonith show stonith-del').and_return(false)
      expect(chef_run).not_to run_execute("delete pacemaker stonith 'stonith-del'")
    end
  end
end


text:
package com.phpsysinfo.psidesktop.business.utils;

import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;
import java.net.URL;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JComponent;

public class SwingUtils {
  public static void set3Dimensions(JComponent c, Dimension d) {
    c.setMinimumSize(d);
    c.setPreferredSize(d);
    c.setMaximumSize(d);
  }

  public static void setComponent3Width(JComponent c, int width) {
    Dimension d = new Dimension(width, c.getPreferredSize().height);
    set3Dimensions(c, d);
  }

  public static Icon getIcon(String path) {
    final Image i = getImage(path);
    return (i != null) ? new ImageIcon(i) : null;
  }

  public static Image getImage(String path) {
    URL imageURL = SwingUtils.class.getResource(path);
    if (imageURL == null) {
      System.err.println("Resource not found: " + path);
      return null;
    }
    return Toolkit.getDefaultToolkit().getImage(imageURL);
  }
}


text:
<!DOCTYPE html >

          <title></title>
          <meta name="description" content="" />
          <meta name="keywords" content="" />
          <meta http-equiv="content-type" content="text/html; charset=UTF-8" />

      <link href="../lib/ref-index.css" media="screen" type="text/css" rel="stylesheet" />

_defaultPrefix

ReverseApplication ReverseAssets ReverseApplication ReverseAssets


text:
<html>
<head>
<script src="../../Loader.js"></script>
<script type="text/javascript">
var url = "../files/themeConfiguration.json";
var waitTime = 2;
function test_Gui_Dialog(t) {

	var dialog = new oscar.Gui.Dialog("dialog name", null);
    t.ok(dialog instanceof oscar.Gui.Dialog,"new oscar.Gui.Dialog returns Dialog object");
	t.eq(dialog.CLASS_NAME,"oscar.Gui.Dialog","dialog.CLASS_NAME set correctly");
	t.ok(dialog.dialog instanceof YAHOO.widget.SimpleDialog,"nested YAHOO dialog created");
	t.eq(dialog.name,"dialog name","name set correctly");

	dialog.setHeader("new header");
    t.eq(dialog.header,"new header", "header set correctly");

	content = "this is some new content";
	dialog.setContent(content);
	t.eq(dialog.body.innerHTML, content, "content was set correctly");

	dialog.createButton("button1", function() {
		t.debug_print("button1 handler");
	});
	dialog.createButton("button2");
	dialog.render();
    t.ok(dialog.container,"container created successfully");
    t.eq(dialog.container.className,"yui-skin-sam","container class set");
    t.ok(dialog.container.id,"container id set");
	t.eq(dialog.dialogButtons.length,2,"both buttons are in the dialog");

	dialog.hide();
	t.eq(null,dialog.dialog,"dialog was destroyed");
}
</script>
<body>

</body>
</html>


text:
'use strict';
const path = require('path');
const grpc = require('grpc');
const protoFiles = require('google-proto-files');
const resolve = require('resolve');
const GoogleAuth = require('google-auth-library');

const PROTO_ROOT_DIR = protoFiles('..');
const embedded_assistant_pb = grpc.load({
    root: PROTO_ROOT_DIR,
    file: path.relative(PROTO_ROOT_DIR, protoFiles.embeddedAssistant.v1alpha2)
}).google.assistant.embedded.v1alpha2;

class GoogleAssistant {
    constructor(credentials) {
        GoogleAssistant.prototype.endpoint_ = "embeddedassistant.googleapis.com";
        this.client = this.createClient_(credentials);
        this.locale = "en-US";
        this.deviceModelId = 'default';
        this.deviceInstanceId = 'default';
    }
    createClient_(credentials) {
        const sslCreds = grpc.credentials.createSsl();
        // https://github.com/google/google-auth-library-nodejs/blob/master/ts/lib/auth/refreshclient.ts
        const auth = new GoogleAuth();
        const refresh = new auth.UserRefreshClient();
        refresh.fromJSON(credentials, function (res) { });
        const callCreds = grpc.credentials.createFromGoogleCredential(refresh);
        const combinedCreds = grpc.credentials.combineChannelCredentials(sslCreds, callCreds);
        const client = new embedded_assistant_pb.EmbeddedAssistant(this.endpoint_, combinedCreds);
        return client;
    }

    assist(input) {
        const config = new embedded_assistant_pb.AssistConfig();
        config.setTextQuery(input);
        config.setAudioOutConfig(new embedded_assistant_pb.AudioOutConfig());
        config.getAudioOutConfig().setEncoding(1);
        config.getAudioOutConfig().setSampleRateHertz(16000);
        config.getAudioOutConfig().setVolumePercentage(100);
        config.setDialogStateIn(new embedded_assistant_pb.DialogStateIn());
        config.setDeviceConfig(new embedded_assistant_pb.DeviceConfig());
        config.getDialogStateIn().setLanguageCode(this.locale);
        config.getDeviceConfig().setDeviceId(this.deviceInstanceId);
        config.getDeviceConfig().setDeviceModelId(this.deviceModelId);
        const request = new embedded_assistant_pb.AssistRequest();
        request.setConfig(config);

        delete request.audio_in;
        const conversation = this.client.assist();
        return new Promise((resolve, reject) => {
            let response = {};
            conversation.on('data', (data) => {
                if (data.device_action) {
                    response.deviceAction = JSON.parse(data.device_action.device_request_json);
                } else if (data.dialog_state_out !== null && data.dialog_state_out.supplemental_display_text) {
                    response.text = data.dialog_state_out.supplemental_display_text;
                }
            });
            conversation.on('end', (error) => {
                // Response ended, resolve with the whole response.
                resolve(response);
            });
            conversation.on('error', (error) => {
                reject(error);
            });
            conversation.write(request);
            conversation.end();
        });
    }
}

const homedir = require('homedir')
const deviceCredentials = require(`${homedir()}/.config/google-oauthlib-tool/credentials.json`);

const CREDENTIALS = {
    client_id: deviceCredentials.client_id,
    client_secret: deviceCredentials.client_secret,
    refresh_token: deviceCredentials.refresh_token,
    type: "authorized_user"
};

const assistant = new GoogleAssistant(CREDENTIALS);
const stdio = require('stdio');
// Allow user to continually input questions and receive answers.
const promptUser = () => {
    stdio.question('> ', (err, prompt) => {
        assistant.assist(prompt)
            .then(({ text }) => {
                console.log(text); // Will log the answer
                promptUser();
            });
    });
};

promptUser();
module.exports = GoogleAssistant;


text:
package org.sameersingh.mf.learner

import org.sameersingh.mf._
import cc.factorie.{optimize, Example}
import cc.factorie.util.DoubleAccumulator
import cc.factorie.la._
import cc.factorie.model.{Parameters => FParameters, Weights2}
import scala.math._
import cc.factorie.optimize.{L2RegularizedConstantRate, ConstantLearningRate, OnlineTrainer}
import scala.util.Random

/**
 * @author sameer
 * @since 5/7/14.
 */
case class FactorizationConfig(k: Int, lambda: Double, baseRate: Double, iterations: Int, logEvery: Int, updateRows: Boolean = true, updateCols: Boolean = true)

abstract class BasicFactorization(val target: ObservedMatrix, val config: FactorizationConfig) {

  val random = new Random()

  def newDenseTensor2(l: Int) = {
    val t = new DenseTensor2(l, config.k)
    for (i <- 0 until t.size)
      t.update(i, random.nextDouble() / 1000.0)
//    println("init: " + t.mkString(", "))
    t
  }

  class Parameters extends FParameters {
    val rowFactors: Weights2 = Weights(newDenseTensor2(target.rowIDs.size))
    val colFactors: Weights2 = Weights(newDenseTensor2(target.colIDs.size))

    def rowTensor2 = parameters(rowFactors).asInstanceOf[Tensor2]

    def colTensor2 = parameters(colFactors).asInstanceOf[Tensor2]

    def rowTensor(id: ID): Tensor1 = rowTensor2.leftMultiply(new SingletonBinaryTensor1(target.rowIDs.size, id.idx))

    def colTensor(id: ID): Tensor1 = colTensor2.leftMultiply(new SingletonBinaryTensor1(target.colIDs.size, id.idx))
  }

  class CellExample(c: Cell, params: Parameters) extends Example {
    override def accumulateValueAndGradient(value: DoubleAccumulator, gradient: WeightsMapAccumulator): Unit = {
      val row = params.rowTensor(c.row)
      val col = params.colTensor(c.col)
      val est = pred(row, col)
      rowAndColGrads(c, row, col, est, gradient)
      value.accumulate(-loss(est, c.value.double))
    }
  }

  def rowAndColGrads(c: Cell, row: Tensor1, col: Tensor1, est: Double, gradient: WeightsMapAccumulator): Unit

  val params = new Parameters

  def avgValue(cells: Seq[Cell]): Double = cells.foldLeft(0.0)(_ + loss(_, params)) / cells.size.toDouble

  def avgValue(pred: Seq[Double], truth: Seq[Double]): Double = pred.zip(truth).foldLeft(0.0)((s, p) => s + loss(p._1, p._2)) / pred.size.toDouble

  def optimize = {
    val optimizer = new L2RegularizedConstantRate(config.lambda, config.baseRate, target.trainCells.size)
    // val trainer = new cc.factorie.optimize.BatchTrainer(params.parameters, optimizer)
    val trainer = new cc.factorie.optimize.OnlineTrainer(params.parameters, optimizer, config.iterations, config.logEvery)
    for (i <- 0 until config.iterations)
      trainer.processExamples(target.trainCells.map(c => new CellExample(c, params)))

    optimizer.finalizeWeights(params.parameters)
  }

  def debug {
    println("rows: " + params.rowTensor2.mkString(", "))
    println("cols: " + params.colTensor2.mkString(", "))
  }

  def pred(row: Tensor1, col: Tensor1): Double

  def loss(pred: Double, truth: Double): Double

  def loss(c: Cell, p: Parameters = params): Double = {
    val row = p.rowTensor(c.row)
    val col = p.colTensor(c.col)
    loss(pred(row, col), c.value.double)
  }

  def pred(c: Cell, p: Parameters = params): Double = {
    val row = p.rowTensor(c.row)
    val col = p.colTensor(c.col)
    pred(row, col)
  }

}

trait LogisticLoss extends BasicFactorization {

  def pred(row: Tensor1, col: Tensor1): Double = {
    val score = row dot col
    Util.sigmoid(score)
  }

  def loss(pred: Double, truth: Double): Double = {
    val lprob = log(pred)
    val liprob = log(1.0 - pred)
    assert(truth >= 0.0 || truth <= 1.0)
    val l = if ((lprob.isInfinite || liprob.isInfinite) && pred == truth) 0.0 else -(truth * lprob + (1.0 - truth) * liprob) // negative log likelihood
    if (l.isNaN)
      l
    l
  }

  def rowAndColGrads(c: Cell, row: Tensor1, col: Tensor1, est: Double, gradient: WeightsMapAccumulator) {
    val direction = (c.value.double - est) // gradient of negative log-likelihood
    if (config.updateRows) {
      val rowGrads = Array.fill(row.size)(0.0)
      // do the rows first
      for (k <- 0 until row.size) {
        rowGrads(k) = direction * col(k)
      }
      // we should be able to use this tensor directly but factorie doesnt support for l2 reg yet (can fix)
      val outerRowGradTensor = new Outer1Tensor2(new SingletonBinaryTensor1(target.rowIDs.size, c.row.idx), new DenseTensor1(rowGrads))
      val rowGradTensor = new SparseIndexedTensor2(target.rowIDs.size, row.size)
      rowGradTensor += outerRowGradTensor
      gradient.accumulate(params.rowFactors, rowGradTensor)
    }
    if (config.updateCols) {
      val colGrads = Array.fill(col.size)(0.0)
      // then do the cols
      for (k <- 0 until col.size) {
        colGrads(k) = direction * row(k)
      }
      // we should be able to use this tensor directly but factorie doesnt support for l2 reg yet (can fix)
      val outerColGradTensor = new Outer1Tensor2(new SingletonBinaryTensor1(target.colIDs.size, c.col.idx), new DenseTensor1(colGrads))
      val colGradTensor = new SparseIndexedTensor2(target.colIDs.size, col.size)
      colGradTensor += outerColGradTensor
      gradient.accumulate(params.colFactors, colGradTensor)
    }
  }
}

trait L2Loss extends BasicFactorization {
  override def loss(pred: Double, truth: Double): Double = StrictMath.pow(truth - pred, 2.0)

  override def pred(row: Tensor1, col: Tensor1): Double = row dot col

  override def rowAndColGrads(c: Cell, row: Tensor1, col: Tensor1, est: Double, gradient: WeightsMapAccumulator): Unit = {
    val err = (c.value.double - est)
     if (config.updateRows) {
       val rowGrads = Array.fill(row.size)(0.0)
       // do the rows first
       for (k <- 0 until row.size) {
         rowGrads(k) = 2.0 * err * col(k)
       }
       // we should be able to use this tensor directly but factorie doesnt support for l2 reg yet (can fix)
       val outerRowGradTensor = new Outer1Tensor2(new SingletonBinaryTensor1(target.rowIDs.size, c.row.idx), new DenseTensor1(rowGrads))
       val rowGradTensor = new SparseIndexedTensor2(target.rowIDs.size, row.size)
       rowGradTensor += outerRowGradTensor
       gradient.accumulate(params.rowFactors, rowGradTensor)
     }
     if (config.updateCols) {
       val colGrads = Array.fill(col.size)(0.0)
       // then do the cols
       for (k <- 0 until col.size) {
         colGrads(k) = 2.0 * err * row(k)
       }
       // we should be able to use this tensor directly but factorie doesnt support for l2 reg yet (can fix)
       val outerColGradTensor = new Outer1Tensor2(new SingletonBinaryTensor1(target.colIDs.size, c.col.idx), new DenseTensor1(colGrads))
       val colGradTensor = new SparseIndexedTensor2(target.colIDs.size, col.size)
       colGradTensor += outerColGradTensor
       gradient.accumulate(params.colFactors, colGradTensor)
     }

  }
}


text:
package testsuite.fabric.jdbc;

import java.sql.CallableStatement;
import java.sql.ResultSet;

import com.mysql.fabric.jdbc.FabricMySQLConnection;

import testsuite.fabric.BaseFabricTestCase;

/**
 * Testsuite for C/J Fabric regression tests.
 */
public class TestRegressions extends BaseFabricTestCase {
	private FabricMySQLConnection conn;

	public TestRegressions() throws Exception {
		super();
	}

	/**
	 * Test for Bug#73070 - prepareCall() throws NPE
	 *
	 * To test this, we create a basic stored procedure with a
	 * parameter, call it and check the result.
	 */
	public void testBug73070() throws Exception {
		this.conn = (FabricMySQLConnection)getNewDefaultDataSource().getConnection(this.username, this.password);
		this.conn.setServerGroupName("fabric_test1_global");

		this.conn.createStatement().executeUpdate("drop procedure if exists bug73070");
		this.conn.createStatement().executeUpdate("create procedure bug73070(in x integer) select x");
		CallableStatement stmt = this.conn.prepareCall("{call bug73070(?)}");
		stmt.setInt(1, 42);
		ResultSet rs = stmt.executeQuery();
		rs.next();
		assertEquals(42, rs.getInt(1));
		rs.close();
		stmt.close();
		this.conn.createStatement().executeUpdate("drop procedure bug73070");

		this.conn.close();
	}
}


text:
	<button class="u-button raised u-button-border default">BUTTON</button>
	<button class="u-button raised u-button-border default">BUTTON</button>
	<button class="u-button raised u-button-border default">BUTTON</button>

	<button class="u-button raised u-button-border default">BUTTON</button>
	<button class="u-button raised u-button-border default">BUTTON</button>
	<button class="u-button raised u-button-border default">BUTTON</button>

	<button class="u-button raised u-button-border default">BUTTON</button>
	<button class="u-button raised u-button-border default">BUTTON</button>
	<button class="u-button raised u-button-border default">BUTTON</button>

	<button class="u-button raised u-button-border default">BUTTON</button>
	<button class="u-button raised u-button-border default">BUTTON</button>
	<button class="u-button raised u-button-border default">BUTTON</button>


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

#ifndef AMQPMAN_H
#define AMQPMAN_H

#include <stdbool.h>
#include "azure_uamqp_c/session.h"
#include "azure_uamqp_c/message.h"

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#include "azure_c_shared_utility/umock_c_prod.h"

    typedef enum OPERATION_RESULT_TAG
    {
        OPERATION_RESULT_OK,
        OPERATION_RESULT_CBS_ERROR,
        OPERATION_RESULT_OPERATION_FAILED
    } OPERATION_RESULT;

    typedef enum AMQP_MANAGEMENT_STATE_TAG
    {
        AMQP_MANAGEMENT_STATE_IDLE,
        AMQP_MANAGEMENT_STATE_OPENING,
        AMQP_MANAGEMENT_STATE_OPEN,
        AMQP_MANAGEMENT_STATE_ERROR
    } AMQP_MANAGEMENT_STATE;

    typedef struct AMQP_MANAGEMENT_INSTANCE_TAG* AMQP_MANAGEMENT_HANDLE;
    typedef void(*ON_OPERATION_COMPLETE)(void* context, OPERATION_RESULT operation_result, unsigned int status_code, const char* status_description);
    typedef void(*ON_AMQP_MANAGEMENT_STATE_CHANGED)(void* context, AMQP_MANAGEMENT_STATE new_amqp_management_state, AMQP_MANAGEMENT_STATE previous_amqp_management_state);

    MOCKABLE_FUNCTION(, AMQP_MANAGEMENT_HANDLE, amqpmanagement_create, SESSION_HANDLE, session, const char*, management_node, ON_AMQP_MANAGEMENT_STATE_CHANGED, on_amqp_management_state_changed, void*, callback_context);
    MOCKABLE_FUNCTION(, void, amqpmanagement_destroy, AMQP_MANAGEMENT_HANDLE, amqp_management);
    MOCKABLE_FUNCTION(, int, amqpmanagement_open, AMQP_MANAGEMENT_HANDLE, amqp_management);
    MOCKABLE_FUNCTION(, int, amqpmanagement_close, AMQP_MANAGEMENT_HANDLE, amqp_management);
    MOCKABLE_FUNCTION(, int, amqpmanagement_start_operation, AMQP_MANAGEMENT_HANDLE, amqp_management, const char*, operation, const char*, type, const char*, locales, MESSAGE_HANDLE, message, ON_OPERATION_COMPLETE, on_operation_complete, void*, context);
    MOCKABLE_FUNCTION(, void, amqpmanagement_set_trace, AMQP_MANAGEMENT_HANDLE, amqp_management, bool, traceOn);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* AMQPMAN_H */


text:
//
//  Quad.cpp
//
//  This code is derived from Universal Tween Engine
//  Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
//

/**
 * Easing equation based on Robert Penner's work:
 * http://robertpenner.com/easing/
 * @author Aurelien Ribon | http://www.aurelienribon.com/
 */

#include "Quad.h"

namespace TweenEngine
{
    float QuadIn::compute(float t) { return t*t; }
    const char *QuadIn::toString() { return "Quad.IN"; }

    float QuadOut::compute(float t) { return -t*(t-2); }
    const char *QuadOut::toString() { return "Quad.OUT"; }

    float QuadInOut::compute(float t)
    {
        t*=2;
        if (t < 1) return 0.5f*t*t;
        return -0.5f * ((t-1)*(t-3) - 1);
    }
    const char *QuadInOut::toString() { return "Quad.INOUT"; }
}


text:
package org.java8.samples.misc;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Benjamin Winterberg
 */
public class Maps1 {

    public static void main(String[] args) {
        Map<Integer, String> map = new HashMap<>();

        for (int i = 0; i < 10; i++) {
            map.putIfAbsent(i, "val" + i);
        }

        map.forEach((id, val) -> System.out.println(val));

        map.computeIfPresent(3, (num, val) -> val + num);
        System.out.println(map.get(3));             // val33

        map.computeIfPresent(9, (num, val) -> null);
        System.out.println(map.containsKey(9));     // false

        map.computeIfAbsent(23, num -> "val" + num);
        System.out.println(map.containsKey(23));    // true

        map.computeIfAbsent(3, num -> "bam");
        System.out.println(map.get(3));             // val33

        System.out.println(map.getOrDefault(42, "not found"));      // not found

        map.remove(3, "val3");
        System.out.println(map.get(3));             // val33

        map.remove(3, "val33");
        System.out.println(map.get(3));             // null

        map.merge(9, "val9", (value, newValue) -> value.concat(newValue));
        System.out.println(map.get(9));             // val9

        map.merge(9, "concat", (value, newValue) -> value.concat(newValue));
        System.out.println(map.get(9));             // val9concat
    }

}


text:
package com.streamreduce.connections;

/**
 *
Author: Nick Heudecker

 *
Created: 9/5/12 09:26

 */
public abstract class AbstractAnalyticsProvider extends AbstractConnectionProvider implements AnalyticsProvider {

    @Override
    public String getType() {
        return TYPE;
    }

}


text:
A collection of snippets covering all of [expressjs](http://expressjs.com/), [ruby on rails](http://rubyonrails.org/), [emberjs](http://emberjs.com/), [electron](http://electron.atom.io/), rspec, [react](https://facebook.github.io/react/) and [body-parser](https://github.com/expressjs/body-parser) APIs.

There is no need to remember any short-code. Just write you codes in any of the supported frameworks /languages and watch dry do it job by suggesting snippets to you.
## Notes

* In software engineering, Don't Repeat Yourself (DRY) is a principle of software development, aimed at reducing repetition of information of all kinds, especially useful in multi-tier architectures.

* Using #DRY shouldn't be a problem, since you don't have to type out the complete prefix before choosing a snippet. If there is a better way to avoid prefix conflicts, please let me know in my [github issue](https://github.com/dayogreats/dry/issues/new).

* Contributions are always appreciated. Please fork this repo, make changes or additions, and send a pull request.

Thanks!

#FEATURES
+ Full react, emberjs, grunt, gulpjs, expressjs 4.x api documentation
+ LeftLabel color added to the prefix(es)
+ Express version indicated to show current support version
+ Footer comments added
+ Documentation Read more online link

# TODO
1. Add electron support

#USAGE

![1483039032972.gif](https://github.com/dayogreats/dry/blob/master/screenshoots/1483039032972.gif)