text:
package com.siyeh.ig.dataflow;

import com.intellij.codeInspection.InspectionProfileEntry;
import com.siyeh.ig.LightJavaInspectionTestCase;

public class TooBroadScopeInspectionTest extends LightJavaInspectionTestCase {

  public void testTooBroadScope() {
    doTest();
  }

  @Override
  protected InspectionProfileEntry getInspection() {
    return new TooBroadScopeInspection();
  }

  @Override
  protected String getBasePath() {
    return "/plugins/InspectionGadgets/test/com/siyeh/igtest/dataflow/scope";
  }
}


text:
package queue

import (
	"container/heap"
	"time"

	observerpb "github.com/cilium/cilium/api/v1/observer"
)

// PriorityQueue is a priority queue of observerpb.GetFlowsResponse. It
// implements heap.Interface. GetFlowsResponse objects are ordered based on
// their timestamp value; the older the timestamp, the higher the priority.
//
// This implementation is loosely based on the priority queue example in
// "container/heap".
type PriorityQueue struct {
	h minHeap
}

type minHeap []*observerpb.GetFlowsResponse

// Ensure that minHeap implements heap.Interface.
var _ heap.Interface = (*minHeap)(nil)

// NewPriorityQueue creates a new PriorityQueue with initial capacity n.
func NewPriorityQueue(n int) *PriorityQueue {
	h := make(minHeap, 0, n)
	heap.Init(&h)
	return &PriorityQueue{h}
}

// Len is the number of objects in the queue.
func (pq PriorityQueue) Len() int {
	return pq.h.Len()
}

// Push adds object resp to the queue.
func (pq *PriorityQueue) Push(resp *observerpb.GetFlowsResponse) {
	heap.Push(&pq.h, resp)
}

// Pop removes and returns the oldest object in the queue. Pop returns nil when
// the queue is empty.
func (pq *PriorityQueue) Pop() *observerpb.GetFlowsResponse {
	resp := heap.Pop(&pq.h).(*observerpb.GetFlowsResponse)
	return resp
}

// PopOlderThan removes and returns objects in the queue that are older than t.
// Objects in the returned list are sorted chronologically from the oldest to
// the more recent.
func (pq *PriorityQueue) PopOlderThan(t time.Time) []*observerpb.GetFlowsResponse {
	// pre-allocate enough memory for the slice to hold every element in the
	// queue as flushing the entire queue is a common pattern
	ret := make([]*observerpb.GetFlowsResponse, 0, pq.Len())
	for {
		resp := pq.Pop()
		if resp == nil {
			return ret
		}
		if t.Before(resp.GetTime().AsTime()) {
			pq.Push(resp)
			return ret
		}
		ret = append(ret, resp)
	}
}

func (h minHeap) Len() int {
	return len(h)
}

func (h minHeap) Less(i, j int) bool {
	if h[i].GetTime().GetSeconds() == h[j].GetTime().GetSeconds() {
		return h[i].GetTime().GetNanos() < h[j].GetTime().GetNanos()
	}
	return h[i].GetTime().GetSeconds() < h[j].GetTime().GetSeconds()
}

func (h minHeap) Swap(i, j int) {
	n := len(h)
	if (i >= 0 && i <= n-1) && (j >= 0 && j <= n-1) {
		h[i], h[j] = h[j], h[i]
	}
}

func (h *minHeap) Push(x interface{}) {
	resp := x.(*observerpb.GetFlowsResponse)
	*h = append(*h, resp)
}

func (h *minHeap) Pop() interface{} {
	old := *h
	n := len(old)
	if n == 0 {
		return (*observerpb.GetFlowsResponse)(nil)
	}
	resp := old[n-1]
	old[n-1] = nil // avoid memory leak
	*h = old[0 : n-1]
	return resp
}

redpajama_set_name: RedPajamaGithub


text:
#ifndef GDCMPRESENTATIONCONTEXTRQ_H
#define GDCMPRESENTATIONCONTEXTRQ_H

#include "gdcmTypes.h"
#include "gdcmAbstractSyntax.h"
#include "gdcmTransferSyntaxSub.h"
#include "gdcmDataSet.h"

namespace gdcm
{
class PresentationContext;
namespace network
{

/**
 * \brief PresentationContextRQ
 * Table 9-13
 * PRESENTATION CONTEXT ITEM FIELDS
 * \see PresentationContextAC
 */
class GDCM_EXPORT PresentationContextRQ
{
public:
  PresentationContextRQ();

  /// Initialize Presentation Context with AbstractSyntax set to asname
  /// and with a single TransferSyntax set to tsname (dfault to Implicit VR
  /// LittleEndian when not specified ).
  PresentationContextRQ( UIDs::TSName asname, UIDs::TSName tsname =
    UIDs::ImplicitVRLittleEndianDefaultTransferSyntaxforDICOM  );

  std::istream &Read(std::istream &is);
  const std::ostream &Write(std::ostream &os) const;
  size_t Size() const;

  void SetAbstractSyntax( AbstractSyntax const & absyn );
  AbstractSyntax const &GetAbstractSyntax() const { return SubItems; }
  AbstractSyntax &GetAbstractSyntax() { return SubItems; }

  void AddTransferSyntax( TransferSyntaxSub const &ts );
  typedef std::vector<TransferSyntaxSub>::size_type SizeType;
  TransferSyntaxSub const & GetTransferSyntax(SizeType i) const { return TransferSyntaxes[i]; }
  TransferSyntaxSub & GetTransferSyntax(SizeType i) { return TransferSyntaxes[i]; }
  std::vector<TransferSyntaxSub> const & GetTransferSyntaxes() const {return TransferSyntaxes; }
  SizeType GetNumberOfTransferSyntaxes() const { return TransferSyntaxes.size(); }

  void SetPresentationContextID( uint8_t id );
  uint8_t GetPresentationContextID() const;

  void Print(std::ostream &os) const;

  bool operator==(const PresentationContextRQ & pc) const
    {
    assert( TransferSyntaxes.size() == 1 ); // TODO
    assert( pc.TransferSyntaxes.size() == 1 );
    return SubItems == pc.SubItems && TransferSyntaxes == pc.TransferSyntaxes;
    }

  PresentationContextRQ(const PresentationContext & pc);

private:
  static const uint8_t ItemType;
  static const uint8_t Reserved2;
  uint16_t ItemLength; // len of last transfer syntax
  uint8_t /*PresentationContext*/ID;
  static const uint8_t Reserved6;
  static const uint8_t Reserved7;
  static const uint8_t Reserved8;
  /*
  This variable field shall contain the following sub-items: one Abstract
  Syntax and one or more Transfer Syntax(es). For a complete
  description of the use and encoding of these sub-items see Sections
  9.3.2.2.1 and 9.3.2.2.2.
   */
  AbstractSyntax SubItems;
  std::vector<TransferSyntaxSub> TransferSyntaxes;
};

} // end namespace network

} // end namespace gdcm

#endif //GDCMPRESENTATIONCONTEXTRQ_H


text:
package com.chriscartland.octaviastreethilton.auth;

import android.util.Log;

import com.firebase.client.AuthData;
import com.firebase.client.Firebase;
import com.firebase.client.FirebaseError;

/**
 * Created by cartland on 1/2/15.
 */
public class FirebaseAuthManager implements GoogleOAuthManager.GoogleOAuthManagerCallback {

    private static final String TAG = FirebaseAuthManager.class.getSimpleName();

    private final Firebase mFirebase;
    private FirebaseAuthCallback mFirebaseAuthCallback;

    public interface FirebaseAuthCallback {
        void onReceivedFirebaseAuth(AuthData authData, FirebaseError error);
    }

    public FirebaseAuthManager(Firebase reference) {
        mFirebase = reference;
    }

    public void setCallback(FirebaseAuthCallback callback) {
        mFirebaseAuthCallback = callback;
    }

    @Override
    public void onReceivedGoogleOAuthToken(String token, String error) {
        Log.d(TAG, "onReceivedGoogleOAuthToken(token=..., error=" + error + ")");
        if (token != null) {
            authGoogleFirebase(token);
        } else {
            mFirebase.unauth();
            mFirebaseAuthCallback.onReceivedFirebaseAuth(null,
                    new FirebaseError(FirebaseError.PROVIDER_ERROR, error));
        }
    }

    private void authGoogleFirebase(String token) {
        mFirebase.authWithOAuthToken("google", token, new Firebase.AuthResultHandler() {
            @Override
            public void onAuthenticated(AuthData authData) {
                // the Google user is now authenticated with Firebase
                Log.d(TAG, "Google user authenticated: " + authData.getUid());
                mFirebaseAuthCallback.onReceivedFirebaseAuth(authData, null);
            }

            @Override
            public void onAuthenticationError(FirebaseError firebaseError) {
                // there was an error
                Log.d(TAG, "Firebase authentication error with Google: " + firebaseError);
                mFirebaseAuthCallback.onReceivedFirebaseAuth(null, firebaseError);
            }
        });
    }
}


text:
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Mimo extends CI_Controller {

	public function __construct(){
		parent::__construct();

		$this->load->model('users','users');
		$this->load->model('login_tokens','login_tokens');
		$this->load->model('posts','posts');
		$this->load->model('thoughts','thoughts');
		$this->load->model('followers','followers');
		$this->load->model('post_likes','post_likes');
		$this->load->model('getposts');

		$this->load->model('comments');
		$this->load->model('upload');
		$this->load->model('notif');
		$this->load->model('password_tokens');

		$this->load->model('genre','genre');
		$this->load->model('about','about');

		$this->load->library('notify');
		$this->load->library('login');
		$this->load->library('mail');
		$this->load->library('topics');
		$this->load->library('facebook');
		$this->load->library('image');

	}//end of __contruct

	public function index()
	{
		if($this->login->isLoggedIn()){
			$id = $this->login->isLoggedIn();
			$condition = array('id'=>$id);
			$data['users'] = $this->users->read($condition);
			$headerdata['title'] = "MimO | Music Hall";
			$this->load->view('include/header',$headerdata);
			$this->load->view('include/topnav', $data);
			$this->load->view('mimo_v/musichall');
			$this->load->view('include/footer');
		}
		else{
			redirect('home');
		}
		// echo $this->login->isLoggedIn();

	}//end of index

	public function settings()
	{
		//check if user is logged in
		if($this->login->isLoggedIn()){
			if(isset($_POST['account'])){
			$id = $this->login->isLoggedIn();
			$selector= 'username';
			$condition = array('id'=>$id);
			$previoususername= $this->users->read($condition,$selector)[0]['username'];
			$selector= 'lastname';
			$previouslastname= $this->users->read($condition,$selector)[0]['lastname'];
			$selector= 'firstname';
			$previousfirstname= $this->users->read($condition,$selector)[0]['firstname'];
			$selector= 'picture';
			$previousprofile= $this->users->read($condition,$selector)[0]['picture'];
			$selector= 'header';
			$previousheader= $this->users->read($condition,$selector)[0]['header'];

			$username = $this->input->post("username", TRUE);
			$lastname = $this->input->post("lastname", TRUE);
			$firstname= $this->input->post("firstname", TRUE);

			$profileimage= $_FILES['imgProfile'];
			$headerimage= $_FILES['imgHeader'];
			if($profileimage['name']=='') {
					//echo "
An Image Please.
";
					$profilelink=$previousprofile;
			}
			else{
			//print_r ($image);
			$profilelink=$this->image->uploadImage($profileimage);
				if($profilelink==NULL)
				{
					$profilelink=$previousprofile;
					echo "";
				}
			}

			if($headerimage['name']=='') {
					//echo "
An Image Please.
";
					$headerlink=$previousheader;
			}
			else{
			//print_r ($image);
			$headerlink=$this->image->uploadImage($headerimage);
			}

			if ($username==NULL){
				$username=$previoususername;
			}
			if ($lastname==NULL){
				$lastname=$previouslastname;
			}
			if ($firstname==NULL){
				$firstname=$previousfirstname;
			}

			$data = array(
					'username'=>$username,
					'lastname'=>$lastname,
					'firstname'=>$firstname,
					'picture'=>$profilelink,
					'header'=>$headerlink
					);
			$this->users->update($data,$condition);

			}
			if(isset($_POST['mymusic'])){
			$id = $this->login->isLoggedIn();
			$selector= 'career';
			$condition = array('user_id'=>$id);
			$previouscareer= $this->about->read($condition,$selector)[0]['career'];
			$genre1 = $this->input->post("genre1", TRUE);
			$genre2 = $this->input->post("genre2", TRUE);
			$genre3 = $this->input->post("genre3", TRUE);
			$mcareer =$this->input->post("mcareer", TRUE);
			$career="";
			if($mcareer==""){
				$career=$previouscareer;
			}
			else{
				foreach($mcareer as $car)
				{
					$career .= $car. ",";

				}
			}
			if($genre1=="None")
				{ $genre1=NULL;
				}
			if($genre2=="None")
				{ $genre2=NULL;
				}
			if($genre3=="None")
				{ $genre3=NULL;
				}

			$data = array(
					'genre1'=>$genre1,
					'genre2'=>$genre2,
					'genre3'=>$genre3,
					'career'=>$career
					);

			$this->about->update($data,$condition);
			}
			$id = $this->login->isLoggedIn();
			$condition = array('id'=>$id);
			$data['users'] = $this->users->read($condition);
			$condition = array('user_id'=>$id);
			$data['about'] = $this->about->read($condition);
			$data['genre'] = $this->genre->read();
			$headerdata['title'] = "MimO | Settings";
			$this->load->view('include/header',$headerdata);
			$this->load->view('include/topnav', $data);
			$this->load->view('mimo_v/settings', $data);
			$this->load->view('include/footer');
		}
		else{
			redirect('home');
		}

	}//end of settings

	public function artist()
	{
		if($this->login->isLoggedIn()){
			$id = $this->login->isLoggedIn();
			$condition = array('id'=>$id);
			$data['users'] = $this->users->read($condition);
			$headerdata['title'] = "MimO | Artist";
			$this->load->view('include/header',$headerdata);
			$this->load->view('include/topnav', $data);
			$this->load->view('mimo_v/artist');
			$this->load->view('include/footer');
		}
		else{
			redirect('home');
		}
	}//end of artist

	public function genre()
	{
		if($this->login->isLoggedIn()){
			$id = $this->login->isLoggedIn();
			$condition = array('id'=>$id);
			$data['users'] = $this->users->read($condition);
			$headerdata['title'] = "MimO | Genres";
			$this->load->view('include/header',$headerdata);
			$this->load->view('include/topnav', $data);
			$this->load->view('mimo_v/genre');
			$this->load->view('include/footer');
		}
		else{
			redirect('home');
		}
	}//end of genre

	public function myStudio()
	{
		if($this->login->isLoggedIn()){
			if(isset($_GET['username'])){
				$username = $_GET['username'];
				//check if user exists
				$condition = array('username'=>$username);
				if($this->users->read($condition)){
					$user = $this->users->read($condition);
					$data['user'] = $user;
					$user_id=$user[0]['id'];
					$condition = array('user_id'=>$user_id);
					$data['about'] = $this->about->read($condition);

					//get collection lists
					$collectionList = $this->getposts->getcollections($user_id);
					$data['collectionList'] =$collectionList;

				}
				else{
					redirect('mimo');
				}

			}
			else{
				redirect('mimo');
			}
			$id = $this->login->isLoggedIn();
			$condition = array('id'=>$id);
			$data['users'] = $this->users->read($condition);

			$headerdata['title'] = "MimO | My Studio";
			$this->load->view('include/header',$headerdata);
			$this->load->view('include/topnav', $data);
			$this->load->view('mimo_v/mystudio');
			$this->load->view('include/footer');
		}
		else{
			redirect('home');
		}

	}//end of myStudio
	public function deletecollection(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$colid = $this->input->post("collectionid");
			$data = array('id'=>$colid);
			$this->upload->del('collections',$data);
			echo 'deleted';
		}
		else{
          	redirect('error');
        }
	}
	public function deletecollectionsong(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$colid = $this->input->post("collectionid");
			$data = array('id'=>$colid);
			$this->upload->del('collection_songs',$data);
			echo 'deleted';
		}
		else{
          	redirect('error');
        }
	}
	public function posts(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$browseUserid = $this->input->post("browseuser");
			if($this->getposts->readthoughts($browseUserid)){
				$posts = $this->getposts->readthoughts($browseUserid);
				$result = array();
	                foreach($posts as $post) {

	                      $p=array('PostId'=>$post['id'],
	                      			'PostUserPicture'=>$post['picture'],
	                      			'PostBody'=>$this->topics->link_add($post['body']),
	                      			'PostUser'=>$post['username'],
	                      			'PostLikes'=>$post['likes'],
	                      			'PostComments'=>$post['comments'],
	                      			'PostDate'=>$post['posted_at']
	                      	);
	                      array_push($result,$p);
	                }
	              echo json_encode($result);
          }
          else{
          	echo json_encode(array('PostId'=>"error"));
          }
		}
		else{
			redirect('error');
		}
	}//end of posts function
	public function audioposts(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$browseUserid = $this->input->post("browseuser");
			if($this->getposts->readaudios($browseUserid)){
				$posts = $this->getposts->readaudios($browseUserid);
	            $res = array();
	                foreach($posts as $results) {
	                	$p=array(
	                			'id'=>$results['id'],
	                			'username'=>$results['username'],
	                			'picture'=>$results['picture'],
	                			'about'=>$this->topics->link_add($results['about']),
	                			'posted_at'=>$results['posted_at'],
	                			'likes'=>$results['likes'],
	                			'comments'=>$results['comments'],
	                			'cover'=>$results['cover'],
	                			'title'=>$results['title'],
	                			'path'=>$results['path'],
	                			'genre'=>$results['genre'],
	                			'views'=>$results['views']
	                		);
	                	array_push($res,$p);

	                }
			echo json_encode($res);
            }else{
        		echo json_encode(array('id'=>"error"));
        	}
		}
		else{
			redirect('error');
		}
	}//end of audioposts function
	public function videoposts(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$browseUserid = $this->input->post("browseuser");
			if($this->getposts->readvideos($browseUserid)){
				$posts = $this->getposts->readvideos($browseUserid);
				$res = array();
	                foreach($posts as $results) {
	                	$p=array(
	                			'id'=>$results['id'],
	                			'username'=>$results['username'],
	                			'picture'=>$results['picture'],
	                			'description'=>$this->topics->link_add($results['description']),
	                			'posted_at'=>$results['posted_at'],
	                			'likes'=>$results['likes'],
	                			'comments'=>$results['comments'],
	                			'name'=>$results['name'],
	                			'url'=>$results['url'],
	                			'plays'=>$results['plays']
	                		);
	                	array_push($res,$p);

	                }
			echo json_encode($res);
        	}
        	else{
        		echo json_encode(array('id'=>"error"));
        	}
		}
		else{
			redirect('error');
		}
	}//end of videoposts function
	public function likes(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$postid = $this->input->post("postid");
			$likerid = $this->login->isLoggedIn();
			$selector = 'likes';
			$condition = array('id'=>$postid);
			$numlikes = $this->posts->read($condition,$selector)[0]['likes'];
			$condition = array('post_id'=>$postid,'user_id'=>$likerid);
			if(!$this->post_likes->read($condition)){
				$data = array('likes'=>$numlikes+1);
				$condition = array('id'=>$postid);
				$this->posts->update($data,$condition);
				$data = array('id'=>null,'post_id'=>$postid,'user_id'=>$likerid);
				$this->post_likes->create($data);
				$this->notify->createNotify('',$postid,'2');

				$selector = 'likes';
				$condition = array('id'=>$postid);
				$likes = $this->posts->read($condition,$selector)[0]['likes'];
				echo json_encode(array('likes'=>$likes,'stats'=>'like'));
			}
			else{
				$data = array('likes'=>$numlikes-1);
				$condition = array('id'=>$postid);
				$this->posts->update($data,$condition);
				$data = array('post_id'=>$postid,'user_id'=>$likerid);
				$this->post_likes->del($data);

				$selector = 'likes';
				$condition = array('id'=>$postid);
				$likes = $this->posts->read($condition,$selector)[0]['likes'];
				echo json_encode(array('likes'=>$likes,'stats'=>'unlike'));
			}

		}
		else{
			redirect('error');
		}
	}//end of likes function
	public function checklikes(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$postid = $this->input->post("postid");
			$userid = $this->input->post("userid");

			$con = array('post_id'=>$postid,'user_id'=>$userid);
			if($this->upload->select('post_likes',$con)){
				echo json_encode(array('stat'=>'like'));
			}
			else{
				echo json_encode(array('stat'=>'notlike'));
			}
		}
		else{
			redirect('error');
		}
	}

	public function delete(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$postid = $this->input->post("postid");
			$selector = 'type';
			$condition = array('id'=>$postid);
			$type = $this->posts->read($condition,$selector)[0]['type'];
			$this->posts->del($condition);
			if($type==1){
				$data = array('post_id'=>$postid);
				$this->thoughts->del($data,'thoughts');
				echo $type;
			}
			else if($type==2){
				$data = array('post_id'=>$postid);
				$this->thoughts->del($data,'audios');
				echo $type;
			}
			else if($type==3){
				$data = array('post_id'=>$postid);
				$this->thoughts->del($data,'videos');
				echo $type;
			}

		}
		else{
			redirect('error');
		}
	}
	public function addnewcol(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$postid = $this->input->post("colid");
			$collectionList = $this->input->post("option");
			$newCollection = $this->input->post("newcol");
			$userid = $this->input->post("userid");
			if($newCollection!=''||$collectionList!=''){
				if($newCollection!=''){
						$data = array(
										'id'=>null,
										'user_id'=>$userid,
										'name'=>$newCollection,
										'count'=>13
							);
						$this->upload->insert('collections',$data);
						$lastCollectionId = $this->upload->c();
						$data = array(
										'id'=>null,
										'collection_id'=>$lastCollectionId,
										'post_id'=>$postid
							);
						$this->upload->insert('collection_songs',$data);
						echo json_encode(array('status'=>"Audio successfully added to the new collection!"));

				}
				else{
					$condition = array('collection_id'=>$collectionList,'post_id'=>$postid);
					if(!$this->upload->select('collection_songs',$condition)){
						$data = array(
										'id'=>null,
										'collection_id'=>$collectionList,
										'post_id'=>$postid
							);
						$this->upload->insert('collection_songs',$data);

						$condition = array('id'=>$collectionList);
						$count = $this->upload->select('collections',$condition,'count')[0]['count'];
						$data = array('count'=>$count+1);
						$this->upload->update('collections',$data,$condition);
						echo json_encode(array('status'=>"Added Successfully"));
					}
					else{
						echo json_encode(array('status'=>"This audio already exists in this collection list!"));
					}
				}
			}
			else{
				echo json_encode(array('status'=>""));
			}
		}
		else{
			redirect('error');
		}
	}
	public function getcollectionlist(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$userid = $this->input->post("userid");
			$condition = array('user_id'=>$userid);
			$list = $this->upload->select('collections',$condition);
			echo json_encode($list);
		}
		else{
			redirect('error');
		}
	}
	public function hallposts(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$start = $this->input->post("start");
			$userid = $this->login->isLoggedIn();
			if($this->getposts->allposts($userid)){
				$posts = $this->getposts->allposts($userid);
				$data = array();
				$result = array();
	                foreach($posts as $post) {
	                	$phpdate = strtotime( $post['posted_at'] );
	                      $p=array('PostType'=>$post['type'],
	                      			'PostId'=>$post['id'],
	                      			'PostUserPicture'=>$post['picture'],
	                      			'PostUser'=>$post['username'],
	                      			'PostLikes'=>$post['likes'],
	                      			'PostComments'=>$post['comments'],
	                      			'PostDate'=>date( 'M d Y h:i a', $phpdate ),
	                      			'thoughtBody'=>$this->topics->link_add($post['body']),
	                      			'audioAbout'=>$this->topics->link_add($post['about']),
	                      			'videoAbout'=>$this->topics->link_add($post['description']),
	                      			'audioPath'=>$post['path'],
	                      			'videoPath'=>$post['url'],
	                      			'audioTitle'=>$post['title'],
	                      			'videoTitle'=>$post['name'],
	                      			'audioGenre'=>$post['genre'],
	                      			'audioCover'=>$post['cover'],
	                      			'audioviews'=>$post['views'],
	                      			'videoviews'=>$post['plays'],
	                      	);
	                      array_push($result,$p);
	                }
	                for ($i = $start; $i < $start+5; $i++) {
				        if ($i < count($result)) {
				                array_push($data, $result[$i]);
				        }
					}
	              echo json_encode($data);
        }
        else{
          	echo json_encode(array('PostId'=>"error"));
        }
	}
	else{
		redirect('error');
	}
	}//end of hallposts

	public function thoughts(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$thoughts = $this->input->post("thoughts");
			$id = $this->login->isLoggedIn();
			if($thoughts!=''){
				$data = array(
						'id'=>null,
						'user_id'=>$id,
						'likes'=>0,
						'comments'=>0,
						'type'=>1
						);
				$this->posts->create($data);
				$topics = $this->topics->getTopics($thoughts);
				$post_id = $this->posts->c();
				if($this->notify->createNotify($thoughts,0,'1')){
					foreach ($this->notify->createNotify($thoughts,0,'1') as $key => $n) {
	                    $s = $id;
	                    $condition = array('username'=>$key);
	                    if($this->users->read($condition,'id')){
		                    $r = $this->users->read($condition,'id')[0]['id'];
		                    if($r!=$s){
			                    if ($r != 0) {
			                    	$data = array('id'=>null,
			                    				  'type'=>$n["type"],
			                    				  'receiver'=>$r,
			                    				  'sender'=>$s,
			                    				  'post_id'=>$post_id,
			                    				  'notifurl'=>'http://localhost/mimo/notification?pid='.$post_id.''

			                    				  );
			                    	$this->notif->create($data);
			                    }
		                	}
		                }
	                }
            	}

				$data = array(
						'id'=>null,
						'post_id'=>$post_id,
						'body'=>$thoughts,
						'topics'=>$topics
						);
				$this->thoughts->create($data);
				$query = $this->getposts->newthoughts($post_id);
				echo json_encode($query);

			}
			else{
				echo 'error';
			}
		}
		else{
			redirect('error');
		}
	}//end of thoughts

	public function audios(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$title = $_POST['title'];
			$desc = $_POST['audDescInput'];
			$genre = $_POST['genre'];
			if($title==''){
				$title = 'Untitled';
			}
			$type = explode('.', $_FILES["file"]["name"]);
			$type = strtolower($type[count($type)-1]);
			$noover = uniqid(rand()).'.'.$type;
			$url = "C:\wamp64\www\mimo\assets\uploads\audios/".$noover;
		    move_uploaded_file($_FILES['file']['tmp_name'], $url);
		    $path = "http://localhost/mimo/assets/uploads/audios/".$noover;
			$image= $_FILES['uploadAudioImg'];
			if($image['name']=='') {
					$audioart= "https://i.imgur.com/rtZYgdC.jpg";
			}
			else{
				$audioart=$this->image->uploadImage($image);
				}

		    $id = $this->login->isLoggedIn();
				$data = array(
						'id'=>null,
						'user_id'=>$id,
						'likes'=>0,
						'comments'=>0,
						'type'=>2
						);
				$this->posts->create($data);
				$topics = $this->topics->getTopics($desc);
				$post_id = $this->posts->c();
				if($this->notify->createNotify($desc,0,'1')){
					foreach ($this->notify->createNotify($desc,0,'1') as $key => $n) {
	                    $s = $id;
	                    $condition = array('username'=>$key);
	                    if($this->users->read($condition,'id')){
		                    $r = $this->users->read($condition,'id')[0]['id'];
		                    if($r!=$s){
			                    if ($r != 0) {
			                    	$data = array('id'=>null,
			                    				  'type'=>$n["type"],
			                    				  'receiver'=>$r,
			                    				  'sender'=>$s,
			                    				  'post_id'=>$post_id,
			                    				  'notifurl'=>'http://localhost/mimo/notification?pid='.$post_id.''

			                    				  );
			                    	$this->notif->create($data);
			                    }
		                	}
		                }
	                }
            	}
				$data = array(
							'id'=>null,
							'post_id'=>$post_id,
							'title'=>strip_tags($title),
							'genre'=>$genre,
							'about'=>$desc,
							'path'=>$path,
							'cover'=>$audioart,
							'topics'=>$topics

					);
				$this->upload->insert('audios',$data);
				$query = $this->getposts->newaudios($post_id);
				echo json_encode($query);

		}
		else{
			redirect('error');
		}
	}//end of audios()
	public function videos(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$title = $_POST['title'];
			$desc = $_POST['vidDescInput'];
			if($title==''){
				$title = 'Untitled';
			}
			$types = explode('.', $_FILES["vidUpload"]["name"]);
			$types = strtolower($types[count($types)-1]);
			$noover = uniqid(rand()).'.'.$types;
			$url = "C:\wamp64\www\mimo\assets\uploads/videos/".$noover;
		    move_uploaded_file($_FILES['vidUpload']['tmp_name'], $url);
		    $path = "http://localhost/mimo/assets/uploads/videos/".$noover;

		    $id = $this->login->isLoggedIn();
				$data = array(
						'id'=>null,
						'user_id'=>$id,
						'likes'=>0,
						'comments'=>0,
						'type'=>3
						);
				$this->posts->create($data);
				$topics = $this->topics->getTopics($desc);
				$post_id = $this->posts->c();
				if($this->notify->createNotify($desc,0,'1')){
					foreach ($this->notify->createNotify($desc,0,'1') as $key => $n) {
	                    $s = $id;
	                    $condition = array('username'=>$key);
	                    if($this->users->read($condition,'id')){
		                    $r = $this->users->read($condition,'id')[0]['id'];
		                    if($r!=$s){
			                    if ($r != 0) {
			                    	$data = array('id'=>null,
			                    				  'type'=>$n["type"],
			                    				  'receiver'=>$r,
			                    				  'sender'=>$s,
			                    				  'post_id'=>$post_id,
			                    				  'notifurl'=>'http://localhost/mimo/notification?pid='.$post_id.''

			                    				  );
			                    	$this->notif->create($data);
			                    }
		                	}
		                }
	                }
            	}
				$data = array(
							'id'=>null,
							'post_id'=>$post_id,
							'name'=>strip_tags($title),
							'description'=>$desc,
							'url'=>$path,
							'topics'=>$topics

					);
				$this->upload->insert('videos',$data);
		    	$query = $this->getposts->newvideos($post_id);
				echo json_encode($query);
		}
		else{
			redirect('error');
		}
	}//end of videos()

	public function comment(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$comment = $this->input->post("comment");
			$postid = $this->input->post("postid");
			$comment = strip_tags($comment);
			$id = $this->login->isLoggedIn();
			if($comment!=''){
				//get current comment number
				$selector = 'comments';
				$condition = array('id'=>$postid);
				$numcom = $this->posts->read($condition,$selector)[0]['comments'];

				//update number of comments in posts table
				$data = array('comments'=>$numcom+1);
				$condition = array('id'=>$postid);
				$this->posts->update($data,$condition);

				//insert comment data in comment table
				$data = array(
						'id'=>null,
						'post_id'=>$postid,
						'user_id'=>$id,
						'comment'=>$comment
						);
				$this->comments->create($data);
				$id = $this->comments->c();
				$datas = $this->comments->aftercom($id);
				$datas[0]['comment'] = $this->topics->link_add($datas[0]['comment']);
				$phpdate = strtotime( $datas[0]['posted_at'] );
				$datas[0]['posted_at'] = date( 'M d Y h:i a', $phpdate );
				echo json_encode($datas);

				//create notification comment
				$id = $this->login->isLoggedIn();
				$this->notify->createNotify('',$postid,'3');
				if($this->notify->createNotify($comment,0,'1')){
					foreach ($this->notify->createNotify($comment,0,'4') as $key => $n) {
	                    $s = $id;
	                    $condition = array('username'=>$key);
	                    if($this->users->read($condition,'id')){
		                    $r = $this->users->read($condition,'id')[0]['id'];
		                    if($r!=$s){
			                    if ($r != 0) {
			                    	$data = array('id'=>null,
			                    				  'type'=>$n["type"],
			                    				  'receiver'=>$r,
			                    				  'sender'=>$s,
			                    				  'post_id'=>$postid,
			                    				  'notifurl'=>'http://localhost/mimo/notification?pid='.$postid.''

			                    				  );
			                    	$this->notif->create($data);
			                    }
		                	}
		                }
	                }
            	}
			}
			else{

			}

		}
		else{
			redirect('error');
		}
	}//end of comment()
	public function getcomments(){
		$postid = $this->input->post("postid");
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$query = $this->comments->getcom($postid);
			$result = array();
                foreach($query as $post) {
                	$phpdate = strtotime( $post['posted_at'] );
                      $p=array('comment'=>$this->topics->link_add($post['comment']),
                      			'username'=>$post['username'],
                      			'picture'=>$post['picture'],
                      			'posted_at'=>date( 'M d Y h:i a', $phpdate )
                      	);
                      array_push($result,$p);
                }
              echo json_encode($result);
		}
		else{
			redirect('error');
		}
	}//end of getcomments()
	public function checkfollow(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$userid = $this->input->post("userid");
			$followerid = $this->input->post("followerid");
			if($this->followers->read($userid,$followerid)){
				$isFollowing = true;
				echo json_encode(array('status'=>$isFollowing));
			}
			else{
				$isFollowing = false;
				echo json_encode(array('status'=>$isFollowing));
			}
		}
		else{
			redirect('error');
		}
	}//end of checkfollow()
	public function follow(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$userid = $this->input->post("userid");
			$followerid = $this->input->post("followerid");
			//get current number of followers in about table
				$selector = 'followers';
				$condition = array('user_id'=>$userid);
				$cf = $this->about->read($condition,$selector)[0]['followers'];

			if(!$this->followers->read($userid,$followerid)){
				$data = array('id'=>null, 'user_id'=>$userid,'follower_id'=>$followerid);
				$this->followers->create($data);
				$this->notify->createNotify('','','5',$userid);

				//update number of followers
				$data = array('followers'=>$cf+1);
				$this->about->update($data,$condition);
				$cf=$cf+1;
			}
			else{
				$data = array('user_id'=>$userid,'follower_id'=>$followerid);
				$this->followers->del($data);
				$this->notify->createNotify('','','6',$userid);

				//update number of followers
				$data = array('followers'=>$cf-1);
				$this->about->update($data,$condition);
				$cf=$cf-1;
			}
			echo json_encode(array('followers'=>$cf));
		}
		else{
			redirect('error');
		}
	}//end of follow
	public function changepass(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$email = $this->input->post("email");
			$cstrong = True;
       		$token = bin2hex(openssl_random_pseudo_bytes(64, $cstrong));
			$selector = 'id';
			$condition = array('email'=>$email);
			$userid = $this->users->read($condition,$selector)[0]['id'];
			$data = array('id'=>null,'token'=>sha1($token),'user_id'=>$userid);
			$this->password_tokens->create($data);
			$this->mail->sendMail('Forgot Password!', "Click here to change your password!", $email);
		}
		else{
			redirect('error');
		}
	}

	public function logout() {

		if (isset($_COOKIE['SNID'])) {
			    	$data = array('token'=>sha1($_COOKIE['SNID']));
			        $this->login_tokens->del($data);
			    }
			    setcookie("SNID", '', time() - 60 * 60 * 24 * 7, '/', NULL, NULL, TRUE);
			    setcookie("SNID_", '1', time() - 60 * 60 * 24 * 3, '/', NULL, NULL, TRUE);
        redirect('home');
    }//end of logout

	public function collectionlist()
	{
		if($this->login->isLoggedIn()){
			$colid = $_GET['name'];
			if(isset($_GET['name'])){
				$con = array('id'=>$colid);
				if($this->upload->select('collections',$con)){
				$name = $this->upload->select('collections',$con)[0]['name'];
				$cdata['name'] = $name;
				$user_id = $this->upload->select('collections',$con,'user_id')[0]['user_id'];
				$cdata['colid'] = $colid;
				$cdata['user_id'] = $user_id;
				$cdata['id']=$colid;

				$con = array('user_id'=>$user_id);
				$colist = $this->upload->select('collections',$con);
				$cdata['colist'] = $colist;

				$id = $this->login->isLoggedIn();
				$condition = array('id'=>$id);
				$data['users'] = $this->users->read($condition);

				$headerdata['title'] = "MimO | My Studio";
				$this->load->view('include/header',$headerdata);
				$this->load->view('include/topnav', $data);
				$this->load->view('mimo_v/collectionlist',$cdata);
				$this->load->view('include/footer');
				}
				else{
					redirect('mimo');
				}
			}
			else{
				redirect('mimo');
			}
		}
		else{
			redirect('home');
		}
	}
	public function audioview(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$audioid = $this->input->post("audioid");
			$condition = array('post_id'=>$audioid);
			$currentnumview = $this->upload->select('audios',$condition,'views')[0]['views'];
			$updatednumview = $currentnumview+1;
			$data = array('views'=>$updatednumview);
			$condition = array('post_id'=>$audioid);
			$this->upload->update('audios',$data,$condition);
			echo json_encode(array('views'=>$updatednumview));
		}
		else{
			redirect('error');
		}
	}
	public function videoview(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$videoid = $this->input->post("videoid");
			$condition = array('post_id'=>$videoid);
			$currentnumview = $this->upload->select('videos',$condition,'plays')[0]['plays'];
			$updatednumview = $currentnumview+1;
			$data = array('plays'=>$updatednumview);
			$condition = array('post_id'=>$videoid);
			$this->upload->update('videos',$data,$condition);
			echo json_encode(array('views'=>$updatednumview));
		}
		else{
			redirect('error');
		}
	}
	public function reportpost(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$reportid = $this->input->post("reportid");
			$userid = $this->input->post("userid");
			$con = array('post_id'=>$reportid,'user_id'=>$userid);
			if(!$this->upload->select('report',$con)){

				$con = array('id'=>$reportid);
				$reportnum = $this->upload->select('posts',$con,'reports')[0]['reports'];
				$data = array('id'=>null,'post_id'=>$reportid,'user_id'=>$userid);
				$this->upload->insert('report',$data);
				$data = array('reports'=>$reportnum+1);
				$con = array('id'=>$reportid);
				$this->upload->update('posts',$data,$con);
				echo json_encode(array('status'=>'The post is now held for review.'));
			}
			else{
				echo json_encode(array('status'=>'You have already reported this post.'));
			}
		}
		else{
			redirect('error');
		}
	}
	public function reviewposts(){
		if ($_SERVER['REQUEST_METHOD'] == "POST") {
			$posts = $this->upload->select('posts');
			foreach ($posts as $p) {
				if($p['reports']>=20){
					$data = array('id'=>$p['id']);
					$this->upload->del('posts',$data);
					echo 'success';
				}
			}
		}
		else{
			redirect('error');
		}
	}
}


text:
require 'right_chimp'
require 'rspec'

ENV['TEST'] = 'true'


text: - [Python program](https://github.com/lsa1es/Zabbix/tree/master/Icones)


text:
'use strict';

var util         = require('util')
  , path         = require('path')
  , fs           = require('fs')
  , EventEmitter = require('events').EventEmitter
  , logger
  , NAMES        = require(path.join(__dirname, 'metrics', 'names.js'))
  , feature_flag = require(path.join(__dirname, 'feature_flags.js'))
  , flatten      = require('./util/flatten')
  , exists       = fs.existsSync || path.existsSync
  ;

/**
 * CONSTANTS -- we gotta lotta 'em
 */
var DEFAULT_CONFIG_PATH = path.join(__dirname, 'config.default.js');
var DEFAULT_CONFIG = require(DEFAULT_CONFIG_PATH).config;
var DEFAULT_FILENAME = 'newrelic.js';
var AZURE_APP_NAME = 'APP_POOL_ID';
var CONFIG_FILE_LOCATIONS = [
  process.env.NEW_RELIC_HOME,
  process.cwd(),
  process.env.HOME,
  path.join(__dirname, '..', '..', '..') // above node_modules
];

// the REPL has no main module
if (process.mainModule && process.mainModule.filename) {
  CONFIG_FILE_LOCATIONS.splice(2, 0, path.dirname(process.mainModule.filename));
}

/*
 * ENV_MAPPING, LIST_VARS, and BOOLEAN_VARS could probably be unified and
 * objectified, but this is simple and works.
 */
var ENV_MAPPING = {
  newrelic_home               : "NEW_RELIC_HOME",
  app_name                    : "NEW_RELIC_APP_NAME",
  license_key                 : "NEW_RELIC_LICENSE_KEY",
  ssl                         : "NEW_RELIC_USE_SSL",
  host                        : "NEW_RELIC_HOST",
  port                        : "NEW_RELIC_PORT",
  proxy                       : "NEW_RELIC_PROXY_URL",
  proxy_host                  : "NEW_RELIC_PROXY_HOST",
  proxy_port                  : "NEW_RELIC_PROXY_PORT",
  proxy_user                  : "NEW_RELIC_PROXY_USER",
  proxy_pass                  : "NEW_RELIC_PROXY_PASS",
  ignore_server_configuration : "NEW_RELIC_IGNORE_SERVER_CONFIGURATION",
  agent_enabled               : "NEW_RELIC_ENABLED",
  apdex_t                     : "NEW_RELIC_APDEX",
  capture_params              : "NEW_RELIC_CAPTURE_PARAMS",
  ignored_params              : "NEW_RELIC_IGNORED_PARAMS",
  logging                     : {
    level    : "NEW_RELIC_LOG_LEVEL",
    filepath : "NEW_RELIC_LOG"
  },
  error_collector             : {
    enabled             : "NEW_RELIC_ERROR_COLLECTOR_ENABLED",
    ignore_status_codes : "NEW_RELIC_ERROR_COLLECTOR_IGNORE_ERROR_CODES"
  },
  transaction_tracer          : {
    enabled               : "NEW_RELIC_TRACER_ENABLED",
    transaction_threshold : "NEW_RELIC_TRACER_THRESHOLD",
    top_n                 : "NEW_RELIC_TRACER_TOP_N"
  },
  debug                       : {
    internal_metrics : "NEW_RELIC_DEBUG_METRICS",
    tracer_tracing   : "NEW_RELIC_DEBUG_TRACER"
  },
  rules                       : {
    name   : "NEW_RELIC_NAMING_RULES",
    ignore : "NEW_RELIC_IGNORING_RULES"
  },
  enforce_backstop            : "NEW_RELIC_ENFORCE_BACKSTOP",
  browser_monitoring: {
    enable : "NEW_RELIC_BROWSER_MONITOR_ENABLE",
    debug  : "NEW_RELIC_BROWSER_MONITOR_DEBUG"
  },
  high_security: "NEW_RELIC_HIGH_SECURITY"
};

// values in list variables are comma-delimited lists
var LIST_VARS = [
  "NEW_RELIC_APP_NAME",
  "NEW_RELIC_IGNORED_PARAMS",
  "NEW_RELIC_ERROR_COLLECTOR_IGNORE_ERROR_CODES",
  "NEW_RELIC_IGNORING_RULES"
];

// values in object lists are comma-delimited object literals
var OBJECT_LIST_VARS = [
  "NEW_RELIC_NAMING_RULES"
];

/*
 * Values in boolean variables. Is pretty tolerant about values, but
 * don't get fancy and just use 'true' and 'false', everybody.
 */
var BOOLEAN_VARS = [
  "NEW_RELIC_IGNORE_SERVER_CONFIGURATION",
  "NEW_RELIC_ENABLED",
  "NEW_RELIC_CAPTURE_PARAMS",
  "NEW_RELIC_ERROR_COLLECTOR_ENABLED",
  "NEW_RELIC_TRACER_ENABLED",
  "NEW_RELIC_DEBUG_METRICS",
  "NEW_RELIC_DEBUG_TRACER",
  "NEW_RELIC_ENFORCE_BACKSTOP",
  "NEW_RELIC_USE_SSL",
  "NEW_RELIC_BROWSER_MONITOR_ENABLE",
  "NEW_RELIC_BROWSER_MONITOR_DEBUG",
  "NEW_RELIC_HIGH_SECURITY"
];

// Config keys that can't be set by the server if high_security === true
var HIGH_SECURITY_SETTINGS = {
  ssl: true,
  capture_params: false
};
var HIGH_SECURITY_KEYS = Object.keys(HIGH_SECURITY_SETTINGS);

// blank out these config values before sending to the collector
var REDACT_BEFORE_SEND = ['proxy_pass', 'proxy_user', 'proxy'];

function isTruthular(setting) {
  if (setting === undefined || setting === null) return false;

  var normalized = setting.toString().toLowerCase();
  switch (normalized) {
    case 'false':
    case 'f':
    case 'no':
    case 'n':
    case 'disabled':
    case '0':
      return false;

    default:
      return true;
  }
}

function fromObjectList(setting) {
  try {
    return JSON.parse('[' + setting + ']');
  }
  catch (error) {
    logger.error("New Relic configurator could not deserialize object list:");
    logger.error(error.stack);
  }
}

function _findConfigFile() {
  var candidate
    , filepath
    ;

  for (var i = 0; i < CONFIG_FILE_LOCATIONS.length; i++) {
    candidate = CONFIG_FILE_LOCATIONS[i];
    if (!candidate) continue;

    filepath = path.join(path.resolve(candidate), DEFAULT_FILENAME);
    if (!exists(filepath)) continue;

    return fs.realpathSync(filepath);
  }
}

function _failHard() {
  var mainpath = path.resolve(path.join(process.cwd(), DEFAULT_FILENAME))
    , altpath  = path.resolve(path.dirname(process.mainModule.filename),
                              DEFAULT_FILENAME)
    ;

  var locations;
  if (mainpath !== altpath) {
    locations = mainpath + " or\n" + altpath;
  }
  else {
    locations = mainpath;
  }

  throw new Error(
    "Unable to find New Relic module configuration. A default\n" +
    "configuration file can be copied from " + DEFAULT_CONFIG_PATH + "\n" +
    "and put at " + locations + "."
  );
}

function Config(config) {
  EventEmitter.call(this);

  // 1. start by cloning the defaults
  var basis = JSON.parse(JSON.stringify(DEFAULT_CONFIG));
  Object.keys(basis).forEach(function cb_forEach(key) {
    this[key] = basis[key];
  }, this);

  // 2. initialize undocumented, internal-only default values

  // feature flags are mostly private settings for gating unreleased features
  // flags are set in the feature_flags.js file
  this.feature_flag = feature_flag.prerelease;

  // set by environment
  this.newrelic_home = null;
  // set by configuration file loader
  this.config_file_path = null;
  // set by collector on handshake
  this.run_id = null;
  this.application_id = null;
  this.web_transactions_apdex = {};
  // how frequently harvester runs
  this.data_report_period = 60;
  // feature level of this account
  this.product_level = 0;
  // product-level related
  this.collect_traces = true;
  this.collect_errors = true;

  this.browser_monitoring.loader = 'rum';
  this.browser_monitoring.loader_version = '';

  // TODO: currently does not support this, but high-security mode requires
  // that we explicitly state how we handle this feature
  this.transaction_tracer.record_sql = 'off';

  // 3. override defaults with values from the loaded / passed configuration
  this._fromPassed(config);

  // 3.5. special values (only Azure environment APP_POOL_ID for now)
  this._fromSpecial();

  // 4. override config with environment variables
  this._fromEnvironment();

  // 5. clean up anything that requires postprocessing
  this._canonicalize();

  // 6. put the version in the config
  this.version = require(path.join(__dirname, '..', 'package.json')).version;

  // 7. apply high security overrides
  if (this.high_security === true) {
    this._applyHighSecurity();
  }
}
util.inherits(Config, EventEmitter);

/**
 * Because this module and logger depend on each other, the logger needs
 * a way to inject the actual logger instance once it's constructed.
 * It's kind of a Rube Goldberg device, but it works.
 *
 * @param {Logger} bootstrapped The actual, configured logger.
 */
Config.prototype.setLogger = function setLogger(bootstrapped) {
  logger = bootstrapped;
};

/**
 * Accept any configuration passed back from the server. Will log all
 * recognized, unsupported, and unknown parameters. Some may not be set,
 * depending on the setting of ignore_server_configuration.
 *
 * @param {object} json The config blob sent by New Relic.
 */
Config.prototype.onConnect = function onConnect(json, recursion) {
  json = json || {};
  if (this.high_security === true && recursion !== true && json.high_security !== true) {
    this.agent_enabled = false;
    this.emit('agent_enabled', false);
    return;
  }
  if (Object.keys(json).length === 0) return;

  Object.keys(json).forEach(function cb_forEach(key) {
    this._fromServer(json, key);
  }, this);

  this.emit('change', this);
};

/**
 * The guts of the logic about how to deal with server-side configuration.
 *
 * @param {object} params A configuration dictionary.
 * @param {string} key    The particular configuration parameter to set.
 */
Config.prototype._fromServer = function _fromServer(params, key) {
  switch (key) {
    // handled by the connection
    case 'messages':
      break;

    // *sigh* Xzibit, etc.
    case 'agent_config':
      this.onConnect(params[key], true);
      break;

    // if it's undefined or null, so be it
    case 'agent_run_id':
      this.run_id = params.agent_run_id;
      break;

    // handled by config.onConnect
    case 'high_security':
      break;

    // always accept these settings
    case 'collect_traces':
    case 'collect_errors':
    case 'product_level':
    case 'application_id':
      this._alwaysUpdateIfChanged(params, key);
      break;

    // also accept these settings
    case 'url_rules':
    case 'metric_name_rules':
    case 'transaction_name_rules':
      this._emitIfSet(params, key);
      break;

    // setting these can be disabled by ignore_server_configuration
    case 'ssl':
    case 'apdex_t':
    case 'web_transactions_apdex':
    case 'data_report_period':
    case 'capture_params':
    case 'ignored_params':
      this._updateIfChanged(params, key);
      break;
    case 'transaction_tracer.enabled':
      this._updateNestedIfChanged(
        params,
        this.transaction_tracer,
        'transaction_tracer.enabled',
        'enabled'
      );
      break;
    case 'transaction_tracer.transaction_threshold':
      this._updateNestedIfChanged(
        params,
        this.transaction_tracer,
        'transaction_tracer.transaction_threshold',
        'transaction_threshold'
      );
      break;
    case 'error_collector.enabled':
      this._updateNestedIfChanged(
        params,
        this.error_collector,
        'error_collector.enabled',
        'enabled'
      );
      break;
    case 'error_collector.ignore_status_codes':
      this._updateNestedIfChanged(
        params,
        this.error_collector,
        'error_collector.ignore_status_codes',
        'ignore_status_codes'
      );
      this._canonicalize();
      break;

    case 'collect_analytics_events':
      // never enable from server-side
      // but we allow the server to disable
      if (params.collect_analytics_events === false)
        this.transaction_events.enabled = false;
      break;

    case 'transaction_events.max_samples_stored':
      this._updateNestedIfChanged(
        params,
        this.transaction_events,
        key,
        'max_samples_stored'
      );
      break;

    case 'transaction_events.max_samples_per_minute':
      this._updateNestedIfChanged(
        params,
        this.transaction_events,
        key,
        'max_samples_per_minute'
      );
      break;

    case 'transaction_events.enabled':
      this._updateNestedIfChanged(
        params,
        this.transaction_events,
        key,
        'enabled'
      );
      break;

    // these are used by browser_monitoring
    // and the api.getRUMHeader() method
    case 'js_agent_file':
    case 'js_agent_loader_file':
    case 'beacon':
    case 'error_beacon':
    case 'browser_key':
    case 'js_agent_loader':
      this._updateNestedIfChangedRaw(
        params,
        this.browser_monitoring,
        key,
        key
      );
      break;

    case 'browser_monitoring.loader':
      this._updateNestedIfChangedRaw(
        params,
        this.browser_monitoring,
        key,
        'loader'
      );
      break;

    // these settings aren't supported by the agent (yet)
    case 'sampling_rate':
    case 'episodes_file':
    case 'episodes_url':
    case 'cross_process_id':
    case 'cross_application_tracing':
    case 'encoding_key':
    case 'trusted_account_ids':
    case 'transaction_tracer.record_sql':
    case 'slow_sql.enabled':
    case 'rum.load_episodes_file':
      this.logUnsupported(params, key);
      break;

    default:
      this.logUnknown(params, key);
  }
};

/**
 * Change a value sent by the collector if and only if it's different from the
 * value we already have. Emit an event with the key name and the new value,
 * and log that the value has changed.
 *
 * @param {object} json Config blob sent by collector.
 * @param {string} key  Value we're looking to set.
 */
Config.prototype._alwaysUpdateIfChanged = function _alwaysUpdateIfChanged(json, key) {
  var value = json[key];
  if (value !== null && value !== undefined && this[key] !== value) {
    if (Array.isArray(value) && Array.isArray(this[key])) {
      value.forEach(function cb_forEach(element) {
        if (this[key].indexOf(element) === -1) this[key].push(element);
      }, this);
    }
    else {
      this[key] = value;
    }
    this.emit(key, value);
    logger.debug("Configuration of %s was changed to %s by New Relic.", key, value);
  }
};

/**
 * Change a value sent by the collector if and only if it's different from the
 * value we already have. Emit an event with the key name and the new value,
 * and log that the value has changed. Parameter will be ignored if
 * ignore_server_configuration is set.
 *
 * @param {object} json Config blob sent by collector.
 * @param {string} key  Value we're looking to set.
 */
Config.prototype._updateIfChanged = function _updateIfChanged(json, key) {
  this._updateNestedIfChanged(json, this, key, key);
};

/**
 * Some parameter values are nested, need a simple way to change them as well.
 * Will merge local and remote if and only if both are arrays. Parameter will
 * be ignored if ignore_server_configuration is set.
 *
 * @param {object} remote    JSON sent from New Relic.
 * @param {object} local     A portion of this configuration object.
 * @param {string} remoteKey The name sent by New Relic.
 * @param {string} localKey  The local name.
 */
Config.prototype._updateNestedIfChanged = function _updateNestedIfChanged(remote, local, remoteKey, localKey) {
  if (this.ignore_server_configuration) return this.logDisabled(remote, remoteKey);
  // if high-sec mode is enabled, we do not accept server changes to high-sec
  if (this.high_security && HIGH_SECURITY_KEYS.indexOf(localKey) !== -1) {
    return this.logDisabled(remote, remoteKey);
  }
  else return this._updateNestedIfChangedRaw(remote, local, remoteKey, localKey);
};

Config.prototype._updateNestedIfChangedRaw = function _updateNestedIfChangedRaw(
    remote, local, remoteKey, localKey) {
  var value = remote[remoteKey];
  if (value !== null && value !== undefined && local[localKey] !== value) {
    if (Array.isArray(value) && Array.isArray(local[localKey])) {
      value.forEach(function cb_forEach(element) {
        if (local[localKey].indexOf(element) === -1) local[localKey].push(element);
      });
    }
    else {
      local[localKey] = value;
    }
    this.emit(remoteKey, value);
    logger.debug("Configuration of %s was changed to %s by New Relic.", remoteKey, value);
  }
};

/**
 * Some parameter values are just to be passed on.
 *
 * @param {object} json Config blob sent by collector.
 * @param {string} key  Value we're looking to set.
 */
Config.prototype._emitIfSet = function _emitIfSet(json, key) {
  var value = json[key];
  if (value !== null && value !== undefined) this.emit(key, value);
};

/**
 * The agent would normally do something with this parameter, but server-side
 * configuration is disabled via ignore_server_configuration.
 *
 * @param {object} json Config blob sent by collector.
 * @param {string} key  Value the agent won't set.
 */
Config.prototype.logDisabled = function logDisabled(json, key) {
  var value = json[key];
  if (value !== null && value !== undefined) {
    logger.debug(
      "Server-side configuration of %s is currently disabled by local configuration. " +
      "(Server sent value of %j.)",
      key,
      value
    );
  }
};

/**
 * Help support out by putting in the logs the fact that we don't currently
 * support the provided configuration key, and including the sent value.
 *
 * @param {object} json Config blob sent by collector.
 * @param {string} key  Value the agent doesn't set.
 */
Config.prototype.logUnsupported = function logUnsupported(json, key) {
  var flavor;
  if (this.ignore_server_configuration) {
    flavor = "ignored";
  }
  else {
    flavor = "not supported by the Node.js agent";
  }

  var value = json[key];
  if (value !== null && value !== undefined) {
    logger.debug(
      "Server-side configuration of %s is currently %s. (Server sent value of %j.)",
      key,
      flavor,
      value
    );
    this.emit(key, value);
  }
};

/**
 * The agent knows nothing about this parameter.
 *
 * @param {object} json Config blob sent by collector.
 * @param {string} key  Value the agent knows nothing about.
 */
Config.prototype.logUnknown = function logUnknown(json, key) {
  var value = json[key];
  logger.debug(
    "New Relic sent unknown configuration parameter %s with value %j.",
    key,
    value
  );
};

/**
 * Ensure that the apps names are always returned as a list.
 */
Config.prototype.applications = function applications() {
  var apps = this.app_name;

  if (Array.isArray(apps) && apps.length > 0) {
    return apps;
  }
  if (apps && typeof apps === 'string') {
    return [apps];
  }
  else {
    return [];
  }
};

/**
 * Safely overwrite defaults with values passed to constructor.
 *
 * @param object external The configuration being loaded.
 * @param object internal Whichever chunk of the config being overrridden.
 */
Config.prototype._fromPassed = function _fromPassed(external, internal) {
  if (!external) return;
  if (!internal) internal = this;

  Object.keys(external).forEach(function cb_forEach(key) {
    // if it's not in the defaults, it doesn't exist
    if (internal[key] === undefined) return;

    var node = external[key];
    if (Array.isArray(node)) {
      internal[key] = node;
    }
    else if (typeof node === 'object') {
      this._fromPassed(node, internal[key]);
    }
    else {
      internal[key] = node;
    }
  }, this);
};

/**
 * Some values should be picked up only if they're not otherwise set, like
 * the Windows / Azure application name. Don't set it if there's already
 * a non-empty value set via the configuration file, and allow these
 * values to be overwritten by environment variables. Just saves a step for
 * PaaS users who don't want to have multiple settings for a single piece
 * of configuration.
 */
Config.prototype._fromSpecial = function _fromSpecial() {
  var name = this.app_name;
  if (name === null || name === undefined || name === '' ||
      (Array.isArray(name) && name.length === 0)) {
    var azureName = process.env[AZURE_APP_NAME];
    if (azureName) this.app_name = azureName.split(',');
  }
};

/**
 * Recursively visit the nodes of the constant containing the mapping between
 * environment variable names, overriding any configuration values that are
 * found in the environment. Operates purely via side effects.
 *
 * @param object metadata The current level of the mapping object. Should never
 *                        need to set this yourself.
 * @param object data     The current level of the configuration object. Should
 *                        never need to set this yourself.
 */
Config.prototype._fromEnvironment = function _fromEnvironment(metadata, data) {
  if (!metadata) metadata = ENV_MAPPING;
  if (!data) data = this;

  Object.keys(metadata).forEach(function cb_forEach(value) {
    // if it's not in the config, it doesn't exist
    if (data[value] === undefined) return;

    var node = metadata[value];
    if (typeof node === 'string') {
      var setting = process.env[node];
      if (setting) {
        if (LIST_VARS.indexOf(node) > -1) {
          data[value] = setting.split(',').map(function cb_map(k) { return k.trim(); });
        }
        else if (OBJECT_LIST_VARS.indexOf(node) > -1) {
          data[value] = fromObjectList(setting);
        }
        else if (BOOLEAN_VARS.indexOf(node) > -1) {
          data[value] = isTruthular(setting);
        }
        else {
          data[value] = setting;
        }
      }
    }
    else {
      // don't crash if the mapping has config keys the current config doesn't.
      if (!data[value]) data[value] = {};
      this._fromEnvironment(node, data[value]);
    }
  }, this);
};

/**
 * Depending on how the status codes are set, they could be strings, which
 * makes strict equality testing / indexOf fail. To keep things cheap, parse
 * them once, after configuration has finished loading. Other one-off shims
 * based on special properties of configuration values should go here as well.
 */
Config.prototype._canonicalize = function _canonicalize() {
  var codes = this.error_collector && this.error_collector.ignore_status_codes;
  if (codes) {
    this.error_collector.ignore_status_codes = codes.map(function cb_map(code) {
      return parseInt(code, 10);
    });
  }
};

/**
 * This goes through the settings that high security mode needs and coerces
 * them to be correct.
 */
Config.prototype._applyHighSecurity = function() {
  var self = this;
  HIGH_SECURITY_KEYS.forEach(function (key) {
    var hsValue = HIGH_SECURITY_SETTINGS[key];
    if (self[key] !== hsValue) {
      logger.warn('High Security Mode: %s was set to %s, coercing to %s',
                  key, self[key], hsValue);
      self[key] = hsValue;
      self.emit(key, hsValue);
    }
  });
};

/**
 * The agent will use the supportability metrics object if it's
 * available.
 *
 * @param string suffix Supportability metric name.
 * @param number duration Milliseconds that the measured operation took.
 */
Config.prototype.measureInternal = function measureInternal(suffix, duration) {
  if (this.debug.supportability) {
      var internal = this.debug.supportability;
      internal.measureMilliseconds(NAMES.SUPPORTABILITY + suffix, null, duration);
  }
};

Config.prototype.validateFlags = function validateFlags() {
  Object.keys(this.feature_flag).forEach(function cb_forEach(key) {
    if (feature_flag.released.indexOf(key) > -1)
      logger.warn('Feature flag ' + key + ' has been released');
    if (feature_flag.unreleased.indexOf(key) > -1)
      logger.warn('Feature flag ' + key + ' has been deprecated');
  });
};

/**
 * Get a JSONifiable object containing all settings we want to report to the
 * collector and store in the environment_values table.
 *
 * @return Object containing simple key-value pairs of settings
 */
Config.prototype.publicSettings = function publicSettings () {
  var settings = {};

  for (var key in this) {
    if (this.hasOwnProperty(key)) {
      var item = this[key];

      if (REDACT_BEFORE_SEND.indexOf(key) > -1) {
        item = '****';
      }

      settings[key] = item;
    }
  }

  // Agent-side setting is 'enable', but collector-side setting is
  // 'auto_instrument'. Send both values up.
  settings.browser_monitoring.auto_instrument = settings.browser_monitoring.enable;

  // Remove simple circular references
  settings = JSON.parse(JSON.stringify(settings));

  settings = flatten({}, '', settings);

  return settings;
};

/**
 * Create a configuration, either from a configuration file or the node
 * process's environment.
 *
 * For configuration via file, check these directories, in order, for a
 * file named 'newrelic.js':
 *
 *   1. The process's current working directory at startup.
 *   2. The same directory as the process's main module (i.e. the filename
 *      passed to node on the command line).
 *   3. The directory pointed to by the environment variable NEW_RELIC_HOME.
 *   4. The current process's HOME directory.
 *   5. If this module is installed as a dependency, the directory above the
 *      node_modules folder in which newrelic is installed.
 *
 * For configration via environment (useful on Joyent, Azure, Heroku, or
 * other PaaS offerings), set NEW_RELIC_NO_CONFIG_FILE to something truthy
 * and read README.md for details on what configuration variables are
 * necessary, as well as a complete enumeration of the other available
 * variables.
 *
 * @param {object} config Optional configuration to be used in place of a
 *                        config file.
 */
function initialize(config) {
  /* When the logger is required here, it bootstraps itself and then
   * injects itself into this module's closure via setLogger on the
   * instance of the logger it creates.
   *
   * TODO: Find a way to do this that's not an antipattern.
   */
  logger = require(path.join(__dirname, 'logger.js'));

  if (config) return new Config(config);

  if (isTruthular(process.env.NEW_RELIC_NO_CONFIG_FILE)) {
    config = new Config({});
    if (config.newrelic_home) delete config.newrelic_home;
    return config;
  }

  var filepath = _findConfigFile();
  if (!filepath) return _failHard();

  try {
    config = new Config(require(filepath).config);
    config.config_file_path = filepath;
    logger.debug("Using configuration file %s.", filepath);

    config.validateFlags();

    return config;
  }
  catch (error) {
    throw new Error(
      "Unable to read configuration file " + filepath + ". A default\n" +
      "configuration file can be copied from " + DEFAULT_CONFIG_PATH + "\n" +
      "and renamed to 'newrelic.js' in the directory from which you'll be starting\n" +
      "your application."
    );
  }
}

/**
 * Preserve the legacy initializer, but also allow consumers to manage their
 * own configuration if they choose.
 */
Config.initialize = initialize;

module.exports = Config;


text:
var readdirp =  require('..')
  , path = require('path')
  , through = require('through2')

// print out all JavaScript files along with their size
readdirp({ root: path.join(__dirname), fileFilter: '*.js' })
  .on('warn', function (err) { console.error('non-fatal error', err); })
  .on('error', function (err) { console.error('fatal error', err); })
  .pipe(through.obj(function (entry, _, cb) {
    this.push({ path: entry.path, size: entry.stat.size });
    cb();
  }))
  .pipe(through.obj(
    function (res, _, cb) {
      this.push(JSON.stringify(res) + '\n');
      cb();
    })
  )
  .pipe(process.stdout);


text:
from __future__ import absolute_import
from __future__ import division, print_function, unicode_literals

from .._compat import Counter
from ._summarizer import AbstractSummarizer

class EdmundsonKeyMethod(AbstractSummarizer):
    def __init__(self, stemmer, bonus_words):
        super(EdmundsonKeyMethod, self).__init__(stemmer)
        self._bonus_words = bonus_words

    def __call__(self, document, sentences_count, weight):
        significant_words = self._compute_significant_words(document, weight)

        return self._get_best_sentences(document.sentences,
            sentences_count, self._rate_sentence, significant_words)

    def _compute_significant_words(self, document, weight):
        # keep only stems contained in bonus words
        words = map(self.stem_word, document.words)
        words = filter(self._is_bonus_word, words)

        # compute frequencies of bonus words in document
        word_counts = Counter(words)
        word_frequencies = word_counts.values()

        # no frequencies means no significant words
        if not word_frequencies:
            return ()

        # return only words greater than weight
        max_word_frequency = max(word_frequencies)
        return tuple(word for word, frequency in word_counts.items()
            if frequency/max_word_frequency > weight)

    def _is_bonus_word(self, word):
        return word in self._bonus_words

    def _rate_sentence(self, sentence, significant_words):
        words = map(self.stem_word, sentence.words)
        return sum(w in significant_words for w in words)

    def rate_sentences(self, document, weight=0.5):
        significant_words = self._compute_significant_words(document, weight)

        rated_sentences = {}
        for sentence in document.sentences:
            rated_sentences[sentence] = self._rate_sentence(sentence,
                significant_words)

        return rated_sentences


text:
title: "Suit in a landscape"
excerpt: "PaperFaces portrait of @ryandawidjan drawn with Paper for iOS on an iPad."
image:
  path: &image /assets/images/paperfaces-ryandawidjan-twitter.jpg
  feature: *image
  thumbnail: /assets/images/paperfaces-ryandawidjan-twitter-150.jpg
categories: [paperfaces]
tags: [portrait, illustration, Paper for iOS, time lapse]
---

PaperFaces portrait of project donator [@ryandawidjan](https://twitter.com/ryandawidjan).

{% include_cached boilerplate/paperfaces.md %}

{% youtube OhQJoyX-t0w %}


text:
        <meta charset="UTF-8">
        <title>Commander</title>
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">

        <link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet" type="text/css">
        <link href="https://fonts.googleapis.com/css?family=Montserrat" rel="stylesheet" type="text/css">
        <link href="css/style.css" rel="stylesheet" type="text/css">
        <link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/css/bootstrap-datepicker.standalone.min.css" rel="stylshee" type="text/css">

        <?php require_once 'topMenu.php'; ?>

Votre commande a été passée, le professionnel que vous avez contacté a été prévenu.


text:
class MbusMaster : public node::ObjectWrap {
 public:
  static void Init(v8::Handle<v8::Object> module);

 private:
  explicit MbusMaster();
  ~MbusMaster();

  static NAN_METHOD(New);
  static NAN_METHOD(OpenSerial);
  static NAN_METHOD(OpenTCP);
  static NAN_METHOD(Close);
  static NAN_METHOD(ScanSecondary);
  static NAN_METHOD(Get);
  static v8::Persistent<v8::Function> constructor;
  mbus_handle *handle;
  bool connected;
  uv_rwlock_t queueLock;
  bool serial;
};

#endif


text:
var util = require("util");

function ValidationError(message) {
  Error.call(this);
  Error.captureStackTrace(this, this.constructor);

  this.name = 'ValidationError';
  this.message = message;
}

util.inherits(ValidationError, Error);
module.exports = ValidationError;


text:
layout: page
title: Huffman Vision Holdings Party
date: 2016-05-24
author: Austin Mays
tags: weekly links, java
status: published
summary: Sed et erat sapien. Maecenas euismod volutpat scelerisque. Sed.
banner: images/banner/meeting-01.jpg
booking:
  startDate: 04/08/2017
  endDate: 04/12/2017
  ctyhocn: PICTNHX
  groupCode: HVHP
published: true
---
Suspendisse pretium posuere velit, ac venenatis nisl vulputate id. Nam elit enim, viverra sit amet congue a, rhoncus non est. Maecenas sit amet egestas ante. Sed turpis purus, tempor vel sem non, faucibus lobortis lectus. Etiam eget orci ut ipsum tempus ornare eu vitae purus. Curabitur nisl mauris, venenatis in arcu vel, auctor sagittis sem. Nam dignissim tortor sem, nec accumsan orci finibus consectetur. Nam suscipit, nibh et lacinia gravida, mi justo lacinia turpis, vitae tincidunt diam mi a justo. Quisque nec ante erat.
Suspendisse sollicitudin metus velit. Nunc auctor, nisl id volutpat maximus, erat odio cursus dui, eu convallis purus metus eget ligula. Quisque pharetra augue non nulla blandit varius. Nulla vestibulum orci in magna euismod, eu interdum nisl tempus. Nam ante erat, ultricies ac iaculis ut, vulputate non nisi. Suspendisse tempus efficitur nulla, ut finibus eros gravida feugiat. Phasellus viverra velit quis urna hendrerit, sed sagittis magna posuere. Phasellus nisi velit, pulvinar maximus facilisis eget, vestibulum in mauris.

* Phasellus et diam hendrerit, venenatis nisi et, dignissim ante
* In dignissim mi quis dui aliquet, vel pellentesque tellus gravida
* Ut venenatis quam sit amet laoreet aliquam
* Quisque ultrices velit consequat orci commodo, ut bibendum sapien tempus.

Fusce luctus erat nec lectus fringilla, ut mattis odio volutpat. Ut porttitor nibh magna, at molestie tellus consequat at. Morbi a ligula non ex porta tempor. Vivamus nibh quam, ultricies ac eleifend vitae, suscipit sed libero. Praesent sed magna ac eros elementum fermentum non quis libero. In pretium cursus ultrices. Vestibulum ac hendrerit ante. Morbi vehicula viverra lacus at vestibulum. Phasellus et scelerisque dolor, in aliquet orci. Sed interdum sapien purus, et sagittis augue elementum vel. Nullam blandit risus quis augue pulvinar, ut tincidunt metus ornare. Phasellus vestibulum lectus sit amet accumsan viverra. Integer vitae risus suscipit, tincidunt magna nec, vestibulum quam.


text:
/****************************************************************************/
/**
 *  @file   LineRenderingFunction.h
 *  @author Yukio Yasuhara, Naohisa Sakamoto
 */
/****************************************************************************/
#pragma once
#include <kvs/LineObject>
#include <kvs/RGBColor>
#include <kvs/Vector3>
#include <kvs/OpenGL>

namespace
{

#if defined( KVS_ENABLE_OPENGL )

/*
 * VC: vertex color, VCs: vertex color array
 * LC: line color,   LCs: line color array
 * S: size,   Ss: size array
 */

/*==========================================================================*/
/**
 *  Rendering strip line with VCs and S.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Strip_VCs_S( const kvs::LineObject* line, const float dpr )
{
    kvs::OpenGL::SetLineWidth( line->size(0) * dpr );
    kvs::OpenGL::Begin( GL_LINE_STRIP );
    {
        const size_t nvertices = line->numberOfVertices();
        for ( size_t i = 0; i < nvertices; i++ )
        {
            kvs::OpenGL::Color( line->color(i) );
            kvs::OpenGL::Vertex( line->coord(i) );
        }
    }
    kvs::OpenGL::End();
}

/*==========================================================================*/
/**
 *  Rendering strip ine with VCs and Ss.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Strip_VCs_Ss( const kvs::LineObject* line, const float dpr )
{
    const size_t nlines = line->numberOfVertices() - 1;
    for ( size_t i = 0; i < nlines; i++ )
    {
        kvs::OpenGL::SetLineWidth( line->size(i) * dpr );
        kvs::OpenGL::Begin( GL_LINES );
        kvs::OpenGL::Color( line->color(i) );
        kvs::OpenGL::Vertex( line->coord(i) );
        kvs::OpenGL::Color( line->color(i+1) );
        kvs::OpenGL::Vertex( line->coord(i+1) );
        kvs::OpenGL::End();
    }
}

/*==========================================================================*/
/**
 *  Rendering strip line with LC and S.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Strip_LC_S( const kvs::LineObject* line, const float dpr )
{
    kvs::OpenGL::SetLineWidth( line->size(0) * dpr );
    kvs::OpenGL::Begin( GL_LINE_STRIP );
    kvs::OpenGL::Color( line->color(0) );
    const size_t nvertices = line->numberOfVertices();
    for ( size_t i = 0; i < nvertices; i++ )
    {
        kvs::OpenGL::Vertex( line->coord(i) );
    }
    kvs::OpenGL::End();
}

/*==========================================================================*/
/**
 *  Rendering strip line with LCs and S.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Strip_LCs_S( const kvs::LineObject* line, const float dpr )
{
    kvs::OpenGL::SetLineWidth( line->size( 0 ) * dpr );
    kvs::OpenGL::Begin( GL_LINES );
    const size_t num = line->numberOfVertices() - 1;
    for ( size_t i = 0; i < num; i++ )
    {
        kvs::OpenGL::Color( line->color(i) );
        kvs::OpenGL::Vertex( line->coord(i) );
        kvs::OpenGL::Vertex( line->coord(i+1) );
    }
    kvs::OpenGL::End();
}

/*==========================================================================*/
/**
 *  Rendering strip line with LC and Ss.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Strip_LC_Ss( const kvs::LineObject* line, const float dpr )
{
    kvs::OpenGL::Color( line->color(0) );
    const size_t num = line->numberOfVertices() - 1;
    for ( size_t i = 0; i < num; i++ )
    {
        kvs::OpenGL::SetLineWidth( line->size(i) * dpr );
        kvs::OpenGL::Begin( GL_LINES );
        kvs::OpenGL::Vertex( line->coord(i) );
        kvs::OpenGL::Vertex( line->coord(i+1) );
        kvs::OpenGL::End();
    }
}

/*==========================================================================*/
/**
 *  Rendering strip line with LCs and Ss.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Strip_LCs_Ss( const kvs::LineObject* line, const float dpr )
{
    const size_t num = line->numberOfVertices() - 1;
    for ( size_t i = 0; i < num; i++ )
    {
        kvs::OpenGL::SetLineWidth( line->size(i) * dpr );
        kvs::OpenGL::Color( line->color(i) );
        kvs::OpenGL::Begin( GL_LINES );
        kvs::OpenGL::Vertex( line->coord(i) );
        kvs::OpenGL::Vertex( line->coord(i+1) );
        kvs::OpenGL::End();
    }
}

/*==========================================================================*/
/**
 *  Rendering uniline with VCs and S.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Uniline_VCs_S( const kvs::LineObject* line, const float dpr )
{
    kvs::OpenGL::SetLineWidth( line->size(0) * dpr );
    kvs::OpenGL::Begin( GL_LINE_STRIP );
    const size_t nconnections = line->numberOfConnections();
    for ( size_t i = 0; i < nconnections; i++ )
    {
        const size_t id = *( line->connections().data() + i );
        kvs::OpenGL::Color( line->color(id) );
        kvs::OpenGL::Vertex( line->coord(id) );
    }
    kvs::OpenGL::End();
}

/*==========================================================================*/
/**
 *  Rendering uniline with VCs and Ss.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Uniline_VCs_Ss( const kvs::LineObject* line, const float dpr )
{
    const size_t num = line->numberOfConnections() - 1;
    for ( size_t i = 0; i < num; i++ )
    {
        const size_t id1 = *( line->connections().data() + i   );
        const size_t id2 = *( line->connections().data() + i+1 );
        kvs::OpenGL::SetLineWidth( line->size(i) * dpr );
        kvs::OpenGL::Begin( GL_LINES );
        kvs::OpenGL::Color( line->color(id1) );
        kvs::OpenGL::Vertex( line->coord(id1) );
        kvs::OpenGL::Color( line->color(id2) );
        kvs::OpenGL::Vertex( line->coord(id2) );
        kvs::OpenGL::End();
    }
}

/*==========================================================================*/
/**
 *  Rendering uniline with LC and S.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Uniline_LC_S( const kvs::LineObject* line, const float dpr )
{
    kvs::OpenGL::SetLineWidth( line->size(0) * dpr );
    kvs::OpenGL::Begin( GL_LINE_STRIP );
    kvs::OpenGL::Color( line->color(0) );
    const size_t nsegments = line->numberOfConnections() - 1;
    for ( size_t i = 0; i < nsegments; ++i )
    {
        const auto id = line->connections().at(i);
        kvs::OpenGL::Vertex( line->coord(id) );
    }
    kvs::OpenGL::End();
}

/*==========================================================================*/
/**
 *  Rendering uniline with LCs and S.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Uniline_LCs_S( const kvs::LineObject* line, const float dpr )
{
    kvs::OpenGL::SetLineWidth( line->size(0) * dpr );
    kvs::OpenGL::Begin( GL_LINES );
    const size_t nsegments = line->numberOfConnections() - 1;
    for ( size_t i = 0; i < nsegments; ++i )
    {
        const auto id0 = line->connections().at( i + 0 );
        const auto id1 = line->connections().at( i + 1 );
        kvs::OpenGL::Color( line->color(i) );
        kvs::OpenGL::Vertex( line->coord( id0 ) );
        kvs::OpenGL::Vertex( line->coord( id1 ) );
    }
    kvs::OpenGL::End();
}

/*==========================================================================*/
/**
 *  Rendering uniline with LC and Ss.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Uniline_LC_Ss( const kvs::LineObject* line, const float dpr )
{
    kvs::OpenGL::Color( line->color(0) );
    const size_t nsegments = line->numberOfConnections() - 1;
    for ( size_t i = 0; i < nsegments; ++i )
    {
        const auto id0 = line->connections().at( i + 0 );
        const auto id1 = line->connections().at( i + 1 );
        kvs::OpenGL::SetLineWidth( line->size(i) * dpr );
        kvs::OpenGL::Begin( GL_LINES );
        kvs::OpenGL::Vertex( line->coord( id0 ) );
        kvs::OpenGL::Vertex( line->coord( id1 ) );
        kvs::OpenGL::End();
    }
}

/*==========================================================================*/
/**
 *  Rendering uniline with LCs and Ss.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Uniline_LCs_Ss( const kvs::LineObject* line, const float dpr )
{
    const size_t nsegments = line->numberOfConnections() - 1;
    for ( size_t i = 0; i < nsegments; ++i )
    {
        const auto id0 = line->connections().at( i + 0 );
        const auto id1 = line->connections().at( i + 1 );
        kvs::OpenGL::SetLineWidth( line->size(i) * dpr );
        kvs::OpenGL::Color( line->color(i) );
        kvs::OpenGL::Begin( GL_LINES );
        kvs::OpenGL::Vertex( line->coord( id0 ) );
        kvs::OpenGL::Vertex( line->coord( id1 ) );
        kvs::OpenGL::End();
    }
}

/*==========================================================================*/
/**
 *  Rendering polyline with VCs and S.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Polyline_VCs_S( const kvs::LineObject* line, const float dpr )
{
    kvs::OpenGL::SetLineWidth( line->size(0) * dpr );
    const size_t nconnections = line->numberOfConnections();
    for ( size_t i = 0; i < nconnections; i++ )
    {
        kvs::OpenGL::Begin( GL_LINE_STRIP );
        const size_t index = 2 * i;
        const size_t id1 = *( line->connections().data() + index );
        const size_t id2 = *( line->connections().data() + index + 1 );
        for ( size_t j = id1; j <= id2; j++ )
        {
            kvs::OpenGL::Color( line->color(j) );
            kvs::OpenGL::Vertex( line->coord(j) );
        }
        kvs::OpenGL::End();
    }
}

/*==========================================================================*/
/**
 *  Rendering polyline with VCs and Ss.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Polyline_VCs_Ss( const kvs::LineObject* line, const float dpr )
{
    int ctr = 0;
    const size_t nconnections = line->numberOfConnections();
    for ( size_t i = 0; i < nconnections; i++ )
    {
        const size_t index = 2 * i;
        const size_t id1 = *( line->connections().data() + index   );
        const size_t id2 = *( line->connections().data() + index + 1 );
        for ( size_t j = id1; j < id2; j++ )
        {
            kvs::OpenGL::SetLineWidth( line->size(ctr) * dpr );
            kvs::OpenGL::Begin( GL_LINES );
            kvs::OpenGL::Color( line->color(j) );
            kvs::OpenGL::Vertex( line->coord(j) );
            kvs::OpenGL::Color( line->color(j+1) );
            kvs::OpenGL::Vertex( line->coord(j+1) );
            kvs::OpenGL::End();
            ctr++;
        }
    }
}

/*==========================================================================*/
/**
 *  Rendering polyline with LC and S.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Polyline_LC_S( const kvs::LineObject* line, const float dpr )
{
    kvs::OpenGL::SetLineWidth( line->size(0) * dpr );
    const size_t nconnections = line->numberOfConnections();
    for ( size_t i = 0; i < nconnections; i++ )
    {
        kvs::OpenGL::Begin( GL_LINE_STRIP );
        kvs::OpenGL::Color( line->color(0) );
        const size_t index = 2 * i;
        const size_t id1 = *( line->connections().data() + index );
        const size_t id2 = *( line->connections().data() + index + 1 );
        for ( size_t j = id1; j < id2; j++ )
        {
            kvs::OpenGL::Vertex( line->coord(j) );
            kvs::OpenGL::Vertex( line->coord(j+1) );
        }
        kvs::OpenGL::End();
    }
}

/*==========================================================================*/
/**
 *  Rendering polyline with LCs and S.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Polyline_LCs_S( const kvs::LineObject* line, const float dpr )
{
    kvs::OpenGL::SetLineWidth( line->size(0) * dpr );
    int ctr = 0;
    const size_t nconnections = line->numberOfConnections();
    for ( size_t i = 0; i < nconnections; i++ )
    {
        kvs::OpenGL::Begin( GL_LINE_STRIP );
        const size_t index = 2 * i;
        const size_t id1 = *( line->connections().data() + index );
        const size_t id2 = *( line->connections().data() + index + 1 );
        for ( size_t j = id1; j < id2; j++ )
        {
            kvs::OpenGL::Color( line->color(ctr) );
            kvs::OpenGL::Vertex( line->coord(j) );
            kvs::OpenGL::Vertex( line->coord(j+1) );
            ctr++;
        }
        kvs::OpenGL::End();
    }
}

/*==========================================================================*/
/**
 *  Rendering polyline with LC and Ss.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Polyline_LC_Ss( const kvs::LineObject* line, const float dpr )
{
    int ctr = 0;
    const size_t nconnections = line->numberOfConnections();
    for ( size_t i = 0; i < nconnections; i++ )
    {
        kvs::OpenGL::Color( line->color(0) );
        const size_t index = 2 * i;
        const size_t id1 = *( line->connections().data() + index   );
        const size_t id2 = *( line->connections().data() + index + 1 );
        for ( size_t j = id1; j < id2; j++ )
        {
            kvs::OpenGL::SetLineWidth( line->size(ctr) * dpr );
            kvs::OpenGL::Begin( GL_LINES );
            kvs::OpenGL::Vertex( line->coord(j) );
            kvs::OpenGL::Vertex( line->coord(j+1) );
            kvs::OpenGL::End();
            ctr++;
        }
    }
}

/*==========================================================================*/
/**
 *  Rendering polyline with LCs and Ss.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Polyline_LCs_Ss( const kvs::LineObject* line, const float dpr )
{
    int ctr = 0;
    const size_t nconnections = line->numberOfConnections();
    for ( size_t i = 0; i < nconnections; i++ )
    {
        const size_t index = 2 * i;
        const size_t id1 = *( line->connections().data() + index   );
        const size_t id2 = *( line->connections().data() + index+1 );
        for ( size_t j = id1; j < id2; j++ )
        {
            kvs::OpenGL::SetLineWidth( line->size(ctr) * dpr );
            kvs::OpenGL::Begin( GL_LINES );
            kvs::OpenGL::Color( line->color(ctr) );
            kvs::OpenGL::Vertex( line->coord(j) );
            kvs::OpenGL::Vertex( line->coord(j+1) );
            kvs::OpenGL::End();
            ctr++;
        }
    }
}

/*==========================================================================*/
/**
 *  Rendering segment line VCs and S.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Segment_VCs_S( const kvs::LineObject* line, const float dpr )
{
    kvs::OpenGL::SetLineWidth( line->size(0) * dpr );
    kvs::OpenGL::Begin( GL_LINES );
    const size_t num = line->numberOfConnections() * 2;
    for ( size_t i = 0; i < num; i++ )
    {
        const size_t id = *( line->connections().data() + i );
        kvs::OpenGL::Color( line->color(id) );
        kvs::OpenGL::Vertex( line->coord(id) );
    }
    kvs::OpenGL::End();
}

/*==========================================================================*/
/**
 *  Rendering segment line VCs and Ss.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Segment_VCs_Ss( const kvs::LineObject* line, const float dpr )
{
    const size_t nconnections = line->numberOfConnections();
    for ( size_t i = 0; i < nconnections; i++ )
    {
        const size_t index = 2 * i;
        const size_t id1 = *( line->connections().data() + index   );
        const size_t id2 = *( line->connections().data() + index + 1 );
        kvs::OpenGL::SetLineWidth( line->size(i) * dpr );
        kvs::OpenGL::Begin( GL_LINES );
        kvs::OpenGL::Color( line->color(id1) );
        kvs::OpenGL::Vertex( line->coord(id1) );
        kvs::OpenGL::Color( line->color(id2) );
        kvs::OpenGL::Vertex( line->coord(id2) );
        kvs::OpenGL::End();
    }
}

/*==========================================================================*/
/**
 *  Rendering segment line LC and S.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Segment_LC_S( const kvs::LineObject* line, const float dpr )
{
    kvs::OpenGL::SetLineWidth( line->size(0) * dpr );
    kvs::OpenGL::Color( line->color(0) );
    kvs::OpenGL::Begin( GL_LINES );
    const size_t num = line->numberOfConnections() * 2;
    for ( size_t i = 0; i < num; i++ )
    {
        const size_t id = *( line->connections().data() + i );
        kvs::OpenGL::Vertex( line->coord(id) );
    }
    kvs::OpenGL::End();
}

/*==========================================================================*/
/**
 *  Rendering segment line LCs and S.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Segment_LCs_S( const kvs::LineObject* line, const float dpr )
{
    kvs::OpenGL::SetLineWidth( line->size(0) * dpr );
    kvs::OpenGL::Begin( GL_LINES );
    const size_t nconnections = line->numberOfConnections();
    for ( size_t i = 0; i < nconnections; i++ )
    {
        const size_t index = 2 * i;
        const size_t id1 = *( line->connections().data() + index   );
        const size_t id2 = *( line->connections().data() + index + 1 );
        kvs::OpenGL::Color( line->color(i) );
        kvs::OpenGL::Vertex( line->coord(id1) );
        kvs::OpenGL::Vertex( line->coord(id2) );
    }
    kvs::OpenGL::End();
}

/*==========================================================================*/
/**
 *  Rendering segment line with LC and Ss.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Segment_LC_Ss( const kvs::LineObject* line, const float dpr )
{
    kvs::OpenGL::Color( line->color(0) );
    const size_t nconnections = line->numberOfConnections();
    for ( size_t i = 0; i < nconnections; i++ )
    {
        const size_t index = 2 * i;
        const size_t id1 = *( line->connections().data() + index );
        const size_t id2 = *( line->connections().data() + index + 1 );
        kvs::OpenGL::SetLineWidth( line->size( i ) * dpr );
        kvs::OpenGL::Begin( GL_LINES );
        kvs::OpenGL::Vertex( line->coord( id1 ) );
        kvs::OpenGL::Vertex( line->coord( id2 ) );
        kvs::OpenGL::End();
    }
}

/*==========================================================================*/
/**
 *  Rendering segment line with LCs and Ss.
 *  @param line [in] pointer to the line object
 *  @param dpr [in] device pixel ratio
 */
/*==========================================================================*/
void Rendering_Segment_LCs_Ss( const kvs::LineObject* line, const float dpr )
{
    const size_t nconnections = line->numberOfConnections();
    for ( size_t i = 0; i < nconnections; i++ )
    {
        const size_t index = 2 * i;
        const size_t id1 = *( line->connections().data() + index );
        const size_t id2 = *( line->connections().data() + index + 1 );
        kvs::OpenGL::Color( line->color( i ) );
        kvs::OpenGL::SetLineWidth( line->size( i ) * dpr );
        kvs::OpenGL::Begin( GL_LINES );
        kvs::OpenGL::Vertex( line->coord( id1 ) );
        kvs::OpenGL::Vertex( line->coord( id2 ) );
        kvs::OpenGL::End();
    }
}

typedef void (*LineRenderingFunctionType)( const kvs::LineObject* line, const float dpr );

enum LineRenderingType
{
    Type_Strip_VCs_S       = 0,
    Type_Strip_VCs_Ss      = 1,
    Type_Strip_LC_S        = 2,
    Type_Strip_LCs_S       = 3,
    Type_Strip_LC_Ss       = 4,
    Type_Strip_LCs_Ss      = 5,

    Type_Uniline_VCs_S     = 6,
    Type_Uniline_VCs_Ss    = 7,
    Type_Uniline_LC_S      = 8,
    Type_Uniline_LCs_S     = 9,
    Type_Uniline_LC_Ss     = 10,
    Type_Uniline_LCs_Ss    = 11,

    Type_Polyline_VCs_S    = 12,
    Type_Polyline_VCs_Ss   = 13,
    Type_Polyline_LC_S     = 14,
    Type_Polyline_LCs_S    = 15,
    Type_Polyline_LC_Ss    = 16,
    Type_Polyline_LCs_Ss   = 17,

    Type_Segment_VCs_S     = 18,
    Type_Segment_VCs_Ss    = 19,
    Type_Segment_LC_S      = 20,
    Type_Segment_LCs_S     = 21,
    Type_Segment_LC_Ss     = 22,
    Type_Segment_LCs_Ss    = 23,

    NumberOfRenderingTypes = 24
};

LineRenderingFunctionType Rendering[NumberOfRenderingTypes] =
{
    &Rendering_Strip_VCs_S,
    &Rendering_Strip_VCs_Ss,
    &Rendering_Strip_LC_S,
    &Rendering_Strip_LCs_S,
    &Rendering_Strip_LC_Ss,
    &Rendering_Strip_LCs_Ss,

    &Rendering_Uniline_VCs_S,
    &Rendering_Uniline_VCs_Ss,
    &Rendering_Uniline_LC_S,
    &Rendering_Uniline_LCs_S,
    &Rendering_Uniline_LC_Ss,
    &Rendering_Uniline_LCs_Ss,

    &Rendering_Polyline_VCs_S,
    &Rendering_Polyline_VCs_Ss,
    &Rendering_Polyline_LC_S,
    &Rendering_Polyline_LCs_S,
    &Rendering_Polyline_LC_Ss,
    &Rendering_Polyline_LCs_Ss,

    &Rendering_Segment_VCs_S,
    &Rendering_Segment_VCs_Ss,
    &Rendering_Segment_LC_S,
    &Rendering_Segment_LCs_S,
    &Rendering_Segment_LC_Ss,
    &Rendering_Segment_LCs_Ss,
};

#define RETURN_RENDERING_TYPE(type) \
    switch( line->colorType() ) \
    { \
    case kvs::LineObject::VertexColor: \
    { \
        return( ( nsizes == 1 ) ? \
                Type_ ## type ## _VCs_S : \
                Type_ ## type ## _VCs_Ss ); \
    } \
    default: \
    { \
        if( nsizes == 1 ) \
            return( ( ncolors == 1 ) ? \
                    Type_ ## type ## _LC_S : \
                    Type_ ## type ## _LCs_S ); \
        else \
            return( ( ncolors == 1 ) ? \
                    Type_ ## type ## _LC_Ss : \
                    Type_ ## type ## _LCs_Ss ); \
    } \
    }

LineRenderingType GetLineRenderingType( const kvs::LineObject* line )
{
    const size_t nsizes = line->numberOfSizes();
    const size_t ncolors = line->numberOfColors();
    switch( line->lineType() )
    {
    case kvs::LineObject::Strip:    RETURN_RENDERING_TYPE( Strip );
    case kvs::LineObject::Uniline:  RETURN_RENDERING_TYPE( Uniline );
    case kvs::LineObject::Polyline: RETURN_RENDERING_TYPE( Polyline );
    case kvs::LineObject::Segment:  RETURN_RENDERING_TYPE( Segment );
    default: break;
    }

    return( Type_Strip_VCs_S );
};

void LineRenderingFunction( const kvs::LineObject* line, const float dpr = 1.0f )
{
    if ( line->numberOfVertices() > 0 )
    {
        LineRenderingType type = GetLineRenderingType( line );
        Rendering[type]( line, dpr );
    }
};

#else

void LineRenderingFunction( const kvs::LineObject* )
{
}

#endif // KVS_ENABLE_OPENGL

} // end of namespace