text:
from util import LazyList, Token, ParserError, LogicError
import re
from cStringIO import StringIO

WHITESPACE = re.compile(r'^[\n\r \t]$')

def read_list(lst):
    items = []
    while not lst.eof() and lst.head() not in (")", "]"):
        item, lst = read(lst)
        if item is not None: items.append(item)
    return items, lst

def read(lst):
    # skip whitespace
    while True:
        if lst.eof(): break
        if not WHITESPACE.match(lst.head()): break
        lst = lst.tail()

    # anything to read?
    if lst.eof() or lst.head() in (")", "]"): return None, lst

    # lists
    for start_char, end_char in (("(", ")"), ("[", "]")):
        if lst.head() == start_char:
            item, lst = read_list(lst.tail())
            if lst.head() != end_char:
                raise ParserError, "Line %d: Missing %s" % (lst.lineno(),
                        end_char)
            return item, lst.tail()

    # single line comments
    if lst.head() == ";":
        while True:
            lst = lst.tail()
            if lst.eof(): return None, lst
            if lst.head() == "\n": return None, lst.tail()

    # nested comments
    if lst.head() == "#" and lst.tail().head() == "!":
        depth = 1
        lst = lst.tail()
        while True:
            lst = lst.tail()
            if lst.eof():
                raise ParserError, "Line %d: Missing !#" % lst.lineno()
            if lst.head() == "#" and lst.tail().head() == "!":
                depth += 1
                lst = lst.tail()
                continue
            if lst.head() == "!" and lst.tail().head() == "#":
                depth -= 1
                lst = lst.tail()
                if depth == 0: return None, lst.tail()
                continue

    # integers
    if ((lst.head() == "-" and lst.tail().head().isdigit()) or
            lst.head().isdigit()):
        val = lst.head()
        while True:
            lst = lst.tail()
            if not lst.head().isdigit(): break
            val += lst.head()
        return Token("integer", int(val)), lst

    # strings
    if lst.head() == '"':
        val = ""
        while True:
            lst = lst.tail()
            if lst.eof():
                raise ParserError, "Line %d: Missing \"" % lst.lineno()
            if lst.head() == '"': break
            if lst.head() == "\\" and not lst.tail().eof():
                lst = lst.tail()
                if lst.head() == "n": val += "\n"
                elif lst.head() == '"': val += '"'
                elif lst.head() == "\\": val += "\\"
                else:
                    raise ParserError, ("Line %d: Invalid escape sequence: "
                            "\\%s" % (lst.lineno(), lst.head()))
                continue
            val += lst.head()
        return Token("string", val), lst.tail()

    # booleans
    if lst.head() == "#" and lst.tail().head().lower() in ("f", "t"):
        return Token("boolean", lst.tail().head().lower() != "f"), \
                lst.tail().tail()

    # quotes
    if lst.head() == "'":
        item, lst = read(lst.tail())
        return [Token("symbol", "quote"), item], lst

    # symbols
    # symbols are non-whitespace characters that don't start comments and don't
    # have parentheses. further, an arbitrary character can be inserted into a
    # symbol by doing #\<char>
    val = ""
    while True:
        if lst.eof(): break
        if lst.head() in ("(", ")", ";", "[", "]"): break
        if lst.head() == "#" and lst.tail().head() == "!": break
        if WHITESPACE.match(lst.head()): break
        if lst.head() == "#" and lst.tail().head() == "\\":
            lst = lst.tail().tail()
            if lst.eof():
                raise ParserError, "Line %d: Missing character" % lst.lineno()
        val += lst.head()
        lst = lst.tail()
    if not val: raise LogicError, "no symbol?"
    return Token("symbol", val), lst

def parse(input):
    if not hasattr(input, "read"): input = StringIO(input)
    sexps, lst = read_list(LazyList(input))
    if not lst.eof(): raise LogicError, "didn't parse whole file?"
    return sexps

def serialize(node):
    if type(node) == Token: return str(node)
    assert type(node) == list
    return "(%s)" % " ".join(map(serialize, node))


text:
public class ToTest {
	public static int toTest() {
		return 23;
	}
}

redpajama_set_name: RedPajamaGithub


text:
var express = require('express'),
    http = require('http'),
    app = express(),
    bodyParser = require('body-parser'),

    postNormalize = require('./postNormalize'),
    fs = require('fs'),
    path = require('path'),
    Q = require('q'),
    _ = require('lodash');

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

app.use(postNormalize);

var storagePath = path.join(__dirname, 'storage');

app.get('/filesList', function(req, res, next) {
  var folder = _.without(_.compact(req.query.folder.split('/')), 'storage').join('/');

  getAllInDir(path.join(storagePath, folder)).done(function(filesStats) {
    var isRoot = folder ? false : true;
    res.send({
      status: 200,
      files: sortFiles(filesStats),
      isRoot: isRoot
    });
  }, function(err) {
    next(err);
  });
});

app.post('/upload', function(req, res) {
  var uploadPromises = [];
  _.each(req.files, function(file) {
    var userFolder = '/storage/attachments',
        newFilename = file.hash + path.extname(file.name),
        newFilePath = path.join(storagePath, newFilename),

        userUrl = path.join(userFolder, newFilename),

        defer = Q.defer();

    //fs.renameSync(file.path, newFilePath);
    fs.createReadStream(file.path).pipe(fs.createWriteStream(newFilePath)).on('close', function() {
      fs.unlink(file.path, function (err) {
        if(err) {
          console.log(err);
        }
      });

      defer.resolve(userUrl);
    }).on('error', function(err) {
      defer.reject(err);
    });

    uploadPromises.push(defer.promise);
  });

  Q.all(uploadPromises).done(function(files) {
    res.send({status: 200, files: files});
  }, function(err) {
    res.status(500).send({status: 500, err: err});
  });
});

var imageExtensions = ['.png', '.jpg', '.jpeg', '.bmp', '.gif', '.tiff'];

/**
 * Scan dir by path and return all files and dirs inside it.
 * @param {String} dirPath
 * @returns {Promise}
 */
var getAllInDir = function(dirPath) {
  var defer = Q.defer();
  fs.readdir(dirPath, function(err, fileNames) {
    if(err) {
      return defer.reject(err);
    }

    var out = {
      files: []
    };
    fileNames.forEach(function(fileName) {
      var fileStat = fs.statSync(path.join(dirPath, fileName)),
          fileData = {
            name: fileName,
            //path: path.join(dirPath, fileName),
            size: fileStat.size
          };

      if(fileStat.isFile()) {
        fileData.type = 'file';
        if(imageExtensions.indexOf(path.extname(fileName).toLowerCase() != -1)) {
          fileData.fileType = 'image';
        }
      } else if(fileStat.isDirectory()) {
        fileData.type = 'dir';
      }
      out.files.push(fileData);
    });

    defer.resolve(out.files);
  });

  return defer.promise;
};

/**
 * Sort files - dirs first, files last, by alphabet.
 * @param {Array} files
 * @returns {Array}
 */
var sortFiles = function(files) {
  return files.sort(function(a, b) {
    if(a.type == b.type) {
      return a.name.toLowerCase() > b.name.toLowerCase() ? 1 : -1;
    } else {
      if(a.type == 'dir' && b.type == 'file') {
        return -1;
      } else if(a.type == 'file' && b.type == 'dir') {
        return 1;
      } else {
        return a.name > b.name ? 1 : -1;
      }
    }
  });
};

app.use(express.static(__dirname));

var server = http.createServer(app);
server.listen(3000);


text:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Manage_user_plan extends CI_Controller {

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

		$this->data[]="";
		$this->data['url'] = base_url();
		$this->load->model('manage_user_plan_model');
		$this->load->library('parser');
		$this->data['base_url']=base_url();
		$this->load->library('session');

		if (!$this->session->userdata('homeonline')){
			$this->session->set_flashdata('category_error_login', " Your Session Is Expired!! Please Login Again. ");
			redirect('Login');
		}

	//	print_r($this->session->userdata('homeonline'));die;
	}

// Manage_user_plan Started Here.................................................................................................................

/*Manage_user_plan view Load Start.............................................................................................................*/
	function index($action=false) {
		if($action=="search") {
			$this->data['plantitle']=$plantitle=rtrim($this->input->post('plantitle'));
			$this->data['usertype']=$usertype=rtrim($this->input->post('username'));
			$this->data['listingType']=$listingType=rtrim($this->input->post('listingtype'));
			$this->data['plandetails']=$this->manage_user_plan_model->get_plandetails();
			$this->data['user_type']=$this->manage_user_plan_model->get_user_type($plantitle,$usertype);
			$this->data['userplans']=$this->manage_user_plan_model->get_userplans($plantitle,$usertype,$listingType);

			if($this->input->post('submit') == 'Export to CSV') {
				header('Content-type: text/csv');
				header('Content-Disposition: attachment; filename="UserPlans.csv"');
				print $this->manage_user_plan_model->get_userplans($plantitle,$usertype,$listingType);
				exit();
			}

		}else{
			$this->data['plandetails']=$this->manage_user_plan_model->get_plandetails();
			$this->data['user_type']=$this->manage_user_plan_model->get_user_type();
			$this->data['userplans']=$this->manage_user_plan_model->get_userplans();
		}

		$this->parser->parse('header',$this->data);
		$this->load->view('manage_user_plan',$this->data);
		$this->parser->parse('footer',$this->data);
	}

	/*Manage_user_plan view Load End.............................................................................................................*/

	/*Manage_user_plan Modal view Load Start.............................................................................................................*/
	function loadmodal($planid=false)
	{
		if(!empty($planid)){
		$this->data['planid']=$planid;
		$filter=$planid;
		$tittle=$this->data['updateplan']=$this->manage_user_plan_model->select_for_update($filter);
			$tittle=explode("For",$tittle[0]->planTitle);
			$plantypeid=$this->manage_user_plan_model->select_for_update_plantittle($tittle[0]);
			if(!empty($plantypeid)){
			$this->data['plantypeid']=$plantypeid[0]->planTypeID;
			}
		}
		$this->data['user_type']=$this->manage_user_plan_model->get_user_type();
		$this->data['plandetails']=$this->manage_user_plan_model->get_plandetails();
		$this->load->view('planmodal',$this->data);
	}
/*Manage_user_plan Modal view Load End.............................................................................................................*/

/*Manage_user_plan create insert and update start .........................................................................................*/
function adduserplan()
	{
		$submit=$this->input->post('submit');
		if(!empty($submit))
		{

			$plantitle=explode("-",$this->input->post('plantitle'));
			$planusertype=$this->input->post('planusertype');
			$planorder=$this->input->post('planorder');
			$listingtype=$this->input->post('listingtype');
			$planstatus=$this->input->post('planstatus');
			date_default_timezone_set("Asia/Kolkata");
			$date=date("Y-m-d h:i:s");

			if(!empty($plantitle[1]) && !empty($planusertype) && !empty($planorder) && !empty($listingtype) && !empty($planstatus)){

				$planid=$this->input->post('planid');
					if(!empty($planid)){

							$filter=array('planID'=>$this->input->post('planid'));
							$this->manage_user_plan_model->insert_userplan($plantitle[1],$planusertype,$planorder,'',$planstatus,$date,$listingtype,$filter);
							$this->session->set_flashdata('message_type', 'success');
							$this->session->set_flashdata('message', $this->config->item("index")." User Plan Updated Successfully!!");

					}else{
							$this->manage_user_plan_model->insert_userplan($plantitle[1],$planusertype,$planorder,'',$planstatus,$date,$listingtype);
							$this->session->set_flashdata('message_type', 'success');
							$this->session->set_flashdata('message', $this->config->item("index")." User Plan Added Successfully!!");
					}
			}else{
					$this->session->set_flashdata('message_type', 'error');
					$this->session->set_flashdata('message', $this->config->item("index")." All Fields Are Mendatory!!");
			}
		}else{
					$this->session->set_flashdata('message_type', 'error');
					$this->session->set_flashdata('message', $this->config->item("index")." Invalid Request!!");
		}
			redirect('Manage_user_plan');
	}

/*Manage_user_plan create insert and update End .........................................................................................*/

/*Add Plan Type view Load Start.............................................................................................................*/
	function AddPlanType()
	{
		$this->data['plantypelist']=$this->manage_user_plan_model->get_plantypelist();

			$this->parser->parse('header',$this->data);
			$this->load->view('addplantype',$this->data);
			$this->parser->parse('footer',$this->data);
	}
/*Add Plan Type view Load End.............................................................................................................*/

/*Add Plan Type Modal view Load Start.............................................................................................................*/
	function Addplantypemodal($plantypeid=false)
	{

		if(!empty($plantypeid))
		{
			$extraqry="where `planTypeID`=$plantypeid";
			$this->data['updateplantype']=$this->manage_user_plan_model->get_plantypelist($extraqry);
		}
		$this->load->view('addplantypemodal',$this->data);
	}
/*Add Plan Type Modal view Load End.............................................................................................................*/

/*Add Plan Type Insert Into Db Start.............................................................................................................*/
	function Insertplantype()
	{
		$submit=$this->input->post('submit');
		if(!empty($submit)){

			$plantitle=$this->input->post('plantitle');
			$planpriority=$this->input->post('planpriority');
			$plantypeid=$this->input->post('plantypeid');

				if(!empty($plantitle) && !empty($planpriority)){

					if(!empty($plantypeid)){
						$filter=array('planTypeID'=>$plantypeid);
						$this->manage_user_plan_model->insert_plantype($plantitle,$planpriority,$filter);
						$this->session->set_flashdata('message_type', 'success');
						$this->session->set_flashdata('message', $this->config->item("index")." Plan Type Updated Successfully!!");
					}else{
					$this->manage_user_plan_model->insert_plantype($plantitle,$planpriority);
					$this->session->set_flashdata('message_type', 'success');
					$this->session->set_flashdata('message', $this->config->item("index")." Plan Type Added Successfully!!");
					}

				}else{
					$this->session->set_flashdata('message_type', 'error');
					$this->session->set_flashdata('message', $this->config->item("index")." All Fields Are Mendatory!!");
					redirect('manage_user_plan/AddPlanType');
				}

		}else{

			$this->session->set_flashdata('message_type', 'error');
			$this->session->set_flashdata('message', $this->config->item("index")." Invalid Request!!");
		}

			redirect('Manage_user_plan/AddPlanType');
	}
/*Add Plan Type Insert Into Db End.............................................................................................................*/

/*Plan Consumption Log view Load Start.............................................................................................................*/

	function PlanConsumptionLog($action=false,$campaignid=false) {
		$query = '';

		if(!empty($campaignid)) {
			$this->data['campaignid']=$campaignid;
			$query=" AND rp_dbho_campaignmaster.campaignID=$campaignid";
		}

		if($action=="search"){
			$this->data['campaignname']=$campaignname=$this->input->post('campaignname');
			$this->data['companyname']=$companyname=$this->input->post('companyname');
			$this->data['listingtype']=$listingtype=$this->input->post('listingtype');
			$this->data['planname']=$planname=$this->input->post('planname');

			if(!empty($campaignname)){ $query.=" and `userCompanyName` like TRIM('%$campaignname%')"; }
			if(!empty($companyname)){ $query.="  and `userCompanyName` like TRIM('%$companyname%')"; }
			if(!empty($listingtype)){ $query.=" and `objectType` like TRIM('%$listingtype%')"; }
			if(!empty($planname)){ $query.=" and `planTitle` like TRIM('%$planname%')"; }

			if($this->input->post('submit') == 'Export to CSV') {

				 header('Content-type: text/csv');
				header('Content-Disposition: attachment; filename="PlanConsumptionLog.csv"');

					/* $planname='';
					$campaignname='';
					$campaignnamecreate='';
					$propertyproject='';
					$propertyproject='';
					$consumuedBy='';
					$consumuedon='';
					$consumuedtype='';
					$exportresultfinal='';
			$exportresultfinal.='"Plan Name"';
			$exportresultfinal.=',';
			$exportresultfinal.='"Campaign Name"';
			$exportresultfinal.=',';
			$exportresultfinal.='"Property/Project Name"';
			$exportresultfinal.=',';
			$exportresultfinal.='"Object Type"';
			$exportresultfinal.=',';
			$exportresultfinal.='"Consumued BY"';
			$exportresultfinal.=',';
			$exportresultfinal.='"Consumued On"';
			$exportresultfinal.=',';
			$exportresultfinal.='"Consumued For" ';

				foreach($exportresults as $exportresult){

					if(!empty($exportresult->objectType) && !empty($exportresult->objectID)){
								if($exportresult->objectType=='project'){
									$filter=array('projectID'=>$exportresult->objectID,'languageID'=>'1');
									$objectname=$this->manage_user_plan_model->get_object_name('rp_project_details','projectName',$filter);
								}elseif($exportresult->objectType=='property'){
									$filter=array('propertyID'=>$exportresult->objectID,'languageID'=>'1');
									$objectname=$this->manage_user_plan_model->get_object_name('rp_property_details','propertyName',$filter);
								}

					$planname=$exportresult->planTitle;
					$campaignname=$exportresult->userCompanyName;
					$campaignnamecreate=$exportresult->created;
					$propertyprojectname=isset($objectname[0]->name)?$objectname[0]->name:'';
					$propertyproject=$exportresult->objectType;
					$consumuedBy=$exportresult->createdBy;
					$consumuedon=$exportresult->createdon;
					$consumuedtype=$exportresult->UnitconsumuedType;

			$exportresultfinal.='"Plan Name"';
			$exportresultfinal.=',';
			$exportresultfinal.='"Campaign Name"';
			$exportresultfinal.=',';
			$exportresultfinal.='"Property/Project Name"';
			$exportresultfinal.=',';
			$exportresultfinal.='"Object Type"';
			$exportresultfinal.=',';
			$exportresultfinal.='"Consumued BY"';
			$exportresultfinal.=',';
			$exportresultfinal.='"Consumued On"';
			$exportresultfinal.=',';
			$exportresultfinal.='"Consumued For" ';

				}
				}*/

				print $exportresults=$this->manage_user_plan_model->Planlog($query);
				exit();

			}

			$this->data['log_details']=$this->manage_user_plan_model->Planlog($query);

		}else{
			$this->data['log_details']=$this->manage_user_plan_model->Planlog($query);
		}
		$this->data['plandetails']=$this->manage_user_plan_model->get_plandetails();
		$this->parser->parse('header',$this->data);
		$this->load->view('planconsumptionlog',$this->data);
		$this->parser->parse('footer',$this->data);
	}

/*Plan Consumption Log view Load End.............................................................................................................*/

}


text:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent"
    android:layout_height="match_parent" android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:background="@android:color/white"
    tools:context=".MainActivity$LineCharFragment">

    <com.github.mikephil.charting.charts.LineChart
        android:id="@+id/chart"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

</RelativeLayout>


text:
"""
	:author: Miten Chauhan

    This file holds the functions required to send a command over the
    network to control a node. It also holds the function to identify which
    COM port the coordinator is plugged in to.
"""

import time
import serial
import serial.tools.list_ports
import datetime

def emptyLog():
    """Deletes everything in the log file.

    Opens server_command_log.txt and overwrites everything inside the file
    with an empty string.
    """
    with open('server_command_log.txt', 'w') as log_file:
        log_file.write('')

def find_coordinater():
    """Find the COM port for the coordinator.

    Identify the COM Port the coordinator is connected to by scanning through
    all the devices connected to com ports.

    Returns:
        The COM Port the coordinator is plugged in to, or 'unidentified' if
        the coordinator's COM port couldn't be found. A string is returned
        for example:

            'COM5'
    """
    com_port = 'unidentified'
    ports = list(serial.tools.list_ports.comports())
    for port in ports:
        if "USB Serial Port" in port[1]:
            com_port = port[0]
    print '====== COM PORT : {} ======'.format(com_port)
    return com_port

def log_to_file(node, speed, direction, received):
    """Appends a string to a file.

    Saves a string to the end of the file.close

    Args:
        node: The name of the node the command was sent to.
        speed: the speed the node was set to.
        direction: the direction the node was set to.
        received: the message the node sent back to the server.
    """
    current_time = time.strftime("%Y-%m-%d %H:%M:%S")
    log = '{}\nSENT: node={}, speed={}, direction={}\nRECEIVED: {}\n \n'.format(current_time,node,speed,direction,received)
    with open('server_command_log.txt', 'a') as log_file:
        log_file.write(log)

def send_command(com, speed, direction):
    """Send a command over the network.

    Sends a command over the network containing the nodes name to identify
    which node is the intended target, the direction that node should be
    travelling in, and the speed the node should be travelling at.

    Args:
        com: The COM port the coordinator is plugged in to. This is so the
            program knows which port to send the command through.
        speed: the speed the node should be travelling at.
        direction: the direction the node should be travelling in.
    """
    port = serial.Serial(com, baudrate=9600, timeout=0)
    node = 'BELLE'
    command = '~{}*{}*{}*#'.format(node, direction, speed)
    port.write(command)
    node_response = ''
    # time.sleep is set to 1 second to give the network enough time
    # to send the full message before reading it.
    time.sleep(1)
    node_response = port.readline()
    print node_response
    direction_name = ''
    if direction == '21':
        direction_name = 'Forward'
    else:
        direction_name = 'Backward'
    log_to_file(node, speed, direction_name, node_response)


text:
@implementation DAEntity

-(void)encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:self._id   forKey:@"_id"];
    [aCoder encodeObject:self.createat forKey:@"createat"];
    [aCoder encodeObject:self.createby forKey:@"createby"];
    [aCoder encodeObject:self.editat forKey:@"editat"];
    [aCoder encodeObject:self.editby forKey:@"editby"];
    [aCoder encodeObject:self.valid forKey:@"valid"];

    [aCoder encodeObject:self._status forKey:@"_status"];
    [aCoder encodeObject:self._error forKey:@"_error"];
}

-(id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    self._id = [aDecoder decodeObjectForKey:@"_id"];
    self.createat = [aDecoder decodeObjectForKey:@"createat"];
    self.createby = [aDecoder decodeObjectForKey:@"createby"];
    self.editat = [aDecoder decodeObjectForKey:@"editat"];
    self.editby = [aDecoder decodeObjectForKey:@"editby"];
    self.valid = [aDecoder decodeObjectForKey:@"valid"];

    self._status = [aDecoder decodeObjectForKey:@"_status"];
    self._error = [aDecoder decodeObjectForKey:@"_error"];

    return self;
}

-(BOOL ) archiveRootObjectWithName :(NSString *) withName
{
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString* documentDir = [paths objectAtIndex:0];
    NSString *sContentsDir = [documentDir stringByAppendingPathComponent:@"entity"];
    if(![[NSFileManager defaultManager] fileExistsAtPath:sContentsDir]) {
        NSError *error;
        [[NSFileManager defaultManager] createDirectoryAtPath:sContentsDir withIntermediateDirectories:NO attributes:nil error:&error];
    }
    NSString *fileName = [NSString stringWithFormat:@"%@/%@", sContentsDir, withName];
    return [NSKeyedArchiver archiveRootObject:self toFile:fileName];
}

-(id ) unarchiveObjectWithFileWithName :(NSString *) withName
{
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString* documentDir = [paths objectAtIndex:0];
    NSString *sContentsDir = [documentDir stringByAppendingPathComponent:@"entity"];
    if(![[NSFileManager defaultManager] fileExistsAtPath:sContentsDir]) {
        NSError *error;
        [[NSFileManager defaultManager] createDirectoryAtPath:sContentsDir withIntermediateDirectories:NO attributes:nil error:&error];
    }
    NSString *fileName = [NSString stringWithFormat:@"%@/%@", sContentsDir, withName];
    return [NSKeyedUnarchiver unarchiveObjectWithFile: fileName];
}

-(BOOL ) archiveRootObjectWithPath:(NSString *) withPath withName :(NSString *)withName
{
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString* documentDir = [paths objectAtIndex:0];
    NSString *sContentsDir = [documentDir stringByAppendingPathComponent:withPath];
    if(![[NSFileManager defaultManager] fileExistsAtPath:sContentsDir]) {
        NSError *error;
        [[NSFileManager defaultManager] createDirectoryAtPath:sContentsDir withIntermediateDirectories:NO attributes:nil error:&error];
    }
    NSString *fileName = [NSString stringWithFormat:@"%@/%@", sContentsDir, withName];
    return [NSKeyedArchiver archiveRootObject:self toFile:fileName];
}

-(id ) unarchiveObjectWithFileWithPath:(NSString *) withPath withName :(NSString *)withName
{
    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString* documentDir = [paths objectAtIndex:0];
    NSString *sContentsDir = [documentDir stringByAppendingPathComponent:withPath];
    if(![[NSFileManager defaultManager] fileExistsAtPath:sContentsDir]) {
        NSError *error;
        [[NSFileManager defaultManager] createDirectoryAtPath:sContentsDir withIntermediateDirectories:NO attributes:nil error:&error];
    }
    NSString *fileName = [NSString stringWithFormat:@"%@/%@", sContentsDir, withName];
    return [NSKeyedUnarchiver unarchiveObjectWithFile: fileName];
}

@end


text:
package main;

import account.Account;

import java.util.Date;

public class Main {

    public static void main(String[] args) {
        Account a = new Account();
        a.deposit(2000);

        Account b = new Account();
        b.deposit(333);

        a.transfer(b, 150, "Birthday", new Date());
        b.withdraw(150);

        System.out.println(a.getTransactions());
        System.out.println(b.getTransactions());
    }
}


text:
package com.oath.cyclops.anym;

import com.oath.cyclops.types.Filters;
import cyclops.control.Option;
import cyclops.data.Seq;
import cyclops.function.Function3;
import cyclops.function.Function4;
import cyclops.function.Monoid;
import cyclops.monads.AnyM;
import cyclops.monads.WitnessType;
import cyclops.reactive.ReactiveSeq;
import cyclops.control.Either;
import com.oath.cyclops.types.MonadicValue;
import com.oath.cyclops.types.Value;
import cyclops.function.Predicates;
import cyclops.data.tuple.Tuple2;
import org.reactivestreams.Publisher;
import org.reactivestreams.Subscriber;

import java.io.PrintStream;
import java.io.PrintWriter;
import java.util.Iterator;
import java.util.Optional;
import java.util.function.*;
import java.util.stream.Collector;

/**
 * Wrapper around 'Any' scalar 'M'onad
 *
 * @author johnmcclean
 *
 * @param <T> Data types of elements managed by wrapped scalar Monad.
 */
@Deprecated //use cyclops-pure Do instead
public interface AnyMValue<W extends WitnessType<W>,T> extends  AnyM<W,T>,
                                                                Value<T>,
                                                                Filters<T>,
                                                                MonadicValue<T> {

    @Override
    default void print(final PrintStream str) {
        MonadicValue.super.print(str);
    }

    @Override
    default void print(final PrintWriter writer) {
        MonadicValue.super.print(writer);
    }

    @Override
    default void printOut() {
        MonadicValue.super.printOut();
    }

    @Override
    default void printErr() {
        MonadicValue.super.printErr();
    }

    @Override
    default <R> R fold(Function<? super T, ? extends R> present, Supplier<? extends R> absent){
        return get().fold(present,absent);
    }

    @Override
    default <R, A> R collect(Collector<? super T, A, R> collector) {
        return AnyM.super.collect(collector);
    }

    /**
     * Equivalence test, returns true if this Monad is equivalent to the supplied monad
     * e.g.
     * <pre>
     * {code
     *     Optional.of(1) and CompletableFuture.completedFuture(1) are equivalent
     * }
     * </pre>
     *
     *
     * @param t Monad to compare to
     * @return true if equivalent
     */
    default boolean eqv(final AnyMValue<?,T> t) {
        return Predicates.eqv(t)
                         .test(this);
    }

    default <R> R print(R r){
        System.out.println(r);
        return r;
    }

    default AnyMValue<W,T> combineEager(final Monoid<T> monoid, final AnyMValue<W,? extends T> v2) {
        return unit(this.<T> flatMap(t1 -> print(v2.map(t2 -> monoid.apply(t1, t2))))
                        .orElseGet(() -> orElseGet(() -> monoid.zero())));
    }

    @Override
    default void subscribe(final Subscriber<? super T> sub) {
        Object o = unwrap();
        if(o instanceof  Publisher){
            ((Publisher)o).subscribe(sub);
        }
        MonadicValue.super.subscribe(sub);

    }

    @Override
    default String mkString() {
        return fold(s->"AnyMValue[" + s + "]",()->"AnyMValue[]");

    }

    @Override
    default <U> AnyMValue<W,U> ofType(final Class<? extends U> type) {

        return (AnyMValue<W,U>) AnyM.super.ofType(type);
    }

    @Override
    default AnyMValue<W,T> filterNot(final Predicate<? super T> fn) {

        return (AnyMValue<W,T>) AnyM.super.filterNot(fn);
    }

    @Override
    default AnyMValue<W,T> notNull() {

        return (AnyMValue<W,T>) AnyM.super.notNull();
    }

    @Override
    default <T> AnyMValue<W,T> emptyUnit(){
        return empty();
    }

    @Override
    default AnyMValue<W,T> filter(Predicate<? super T> p){
        return (AnyMValue<W,T>)AnyM.super.filter(p);
    }

    @Override
    default <R> AnyMValue<W,R> map(Function<? super T, ? extends R> fn){
        return (AnyMValue<W,R>)AnyM.super.map(fn);
    }

    @Override
    default AnyMValue<W,T> peek(Consumer<? super T> c){
        return (AnyMValue<W,T>)AnyM.super.peek(c);
    }

    @Override
    default boolean isPresent() {
        Object unwrap = unwrap();
        if (unwrap instanceof Value) {
            return ((Value<T>) unwrap).isPresent();
        }else if(unwrap instanceof Optional){
            return ((Optional<T>) unwrap).isPresent();
        }else if(unwrap instanceof Iterable){
            return ((Iterable<T>)unwrap).iterator().hasNext();
        }else{
            return this.adapter().toIterable(this).iterator().hasNext();
        }

    }

    @Override
    default AnyMValue<W,Seq<T>> aggregate(AnyM<W,T> next){
        return (AnyMValue<W,Seq<T>>)AnyM.super.aggregate(next);
    }

    @Override
    default <R> AnyMValue<W,R> flatMapA(Function<? super T, ? extends AnyM<W,? extends R>> fn){
        return  (AnyMValue<W,R>)AnyM.super.flatMapA(fn);

    }

    default <R> AnyMValue<W,R> concatMap(final Function<? super T, ? extends Iterable<? extends R>> fn){
        return (AnyMValue<W,R>)MonadicValue.super.concatMap(fn);
    }
    default <R> AnyMValue<W,R> mergeMap(Function<? super T, ? extends Publisher<? extends R>> fn){
        return (AnyMValue<W,R>)MonadicValue.super.mergeMap(fn);
    }

    @Override
    default <R> AnyMValue<W,R> flatMap(Function<? super T, ? extends MonadicValue<? extends R>> fn){
        if(unwrap() instanceof MonadicValue){
            MonadicValue<T> unwrap = unwrap();
            return AnyM.ofValue(unwrap.flatMap(fn),adapter());
        }
        return flatMapA(fn.andThen(a->this.fromIterable(a)));
    }

    default Option<T> get() {
        return adapter().fold(e->{ throw new IllegalAccessError("misconfigured adapter : value adapter required");}
                             , v->v.get(this));
    }

    /* (non-Javadoc)
     * @see com.oath.cyclops.monad.AnyM#unit(java.lang.Object)
     */
    @Override
    default <T> AnyMValue<W,T> unit(T value){
        return (AnyMValue<W,T>)AnyM.super.unit(value);
    }

    /* (non-Javadoc)
     * @see com.oath.cyclops.monad.AnyM#zero()
     */
    @Override
    default <T> AnyMValue<W,T> empty(){
        return (AnyMValue<W,T>)AnyM.super.empty();
    }

    @Override
    default Either<AnyMValue<W,T>, AnyMSeq<W,T>> matchable() {
        return Either.left(this);
    }

    @Override
    default Iterator<T> iterator() {

        return AnyM.super.iterator();
    }

    @Override
    default ReactiveSeq<T> stream() {
        return AnyM.super.stream();
    }

    @Override
    default <T2, R1, R2, R3, R> AnyMValue<W,R> forEach4(final Function<? super T, ? extends MonadicValue<R1>> value1, final BiFunction<? super T, ? super R1, ? extends MonadicValue<R2>> value2, final Function3<? super T, ? super R1, ? super R2, ? extends MonadicValue<R3>> value3, final Function4<? super T, ? super R1, ? super R2, ? super R3, ? extends R> yieldingFunction) {
        return (AnyMValue<W,R>)MonadicValue.super.forEach4(value1,value2,value3,yieldingFunction);
    }

    @Override
    default <T2, R1, R2, R3, R> AnyMValue<W,R> forEach4(final Function<? super T, ? extends MonadicValue<R1>> value1, final BiFunction<? super T, ? super R1, ? extends MonadicValue<R2>> value2, final Function3<? super T, ? super R1, ? super R2, ? extends MonadicValue<R3>> value3, final Function4<? super T, ? super R1, ? super R2, ? super R3, Boolean> filterFunction, final Function4<? super T, ? super R1, ? super R2, ? super R3, ? extends R> yieldingFunction) {
        return (AnyMValue<W,R>)MonadicValue.super.forEach4(value1,value2,value3,filterFunction,yieldingFunction);
    }

    @Override
    default <T2, R1, R2, R> AnyMValue<W,R> forEach3(final Function<? super T, ? extends MonadicValue<R1>> value1, final BiFunction<? super T, ? super R1, ? extends MonadicValue<R2>> value2, final Function3<? super T, ? super R1, ? super R2, ? extends R> yieldingFunction) {
        return (AnyMValue<W,R>)MonadicValue.super.forEach3(value1,value2,yieldingFunction);
    }

    @Override
    default <T2, R1, R2, R> AnyMValue<W,R> forEach3(final Function<? super T, ? extends MonadicValue<R1>> value1, final BiFunction<? super T, ? super R1, ? extends MonadicValue<R2>> value2, final Function3<? super T, ? super R1, ? super R2, Boolean> filterFunction, final Function3<? super T, ? super R1, ? super R2, ? extends R> yieldingFunction) {
        return (AnyMValue<W,R>)MonadicValue.super.forEach3(value1,value2,filterFunction,yieldingFunction);
    }

    @Override
    default <R1, R> AnyMValue<W,R> forEach2(Function<? super T, ? extends MonadicValue<R1>> value1, final BiFunction<? super T, ? super R1, ? extends R> yieldingFunction) {
        return (AnyMValue<W,R>)MonadicValue.super.forEach2(value1,yieldingFunction);
    }

    @Override
    default <R1, R> AnyMValue<W,R> forEach2(Function<? super T, ? extends MonadicValue<R1>> value1, final BiFunction<? super T, ? super R1, Boolean> filterFunction, final BiFunction<? super T, ? super R1, ? extends R> yieldingFunction) {
        return (AnyMValue<W,R>)MonadicValue.super.forEach2(value1,filterFunction,yieldingFunction);
    }

  @Override
  default <T2, R> AnyMValue<W, R> zip(final AnyM<W, ? extends T2> anyM, final BiFunction<? super T, ? super T2, ? extends R> fn) {
    return (AnyMValue<W, R>)AnyM.super.zip(anyM,fn);
  }

  @Override
  default <U> AnyMValue<W, Tuple2<T, U>> zip(final AnyM<W, ? extends U> other) {
    return (AnyMValue)AnyM.super.zip(other);
  }
}


text:
package fii.admission.sali_examen;

import java.util.ArrayList;
import java.util.List;
import java.sql.*;

import org.springframework.stereotype.Service;

import fii.admission.MainApp;

@Service
public class SaliExamenService {

	static public List<SaliExamen> getAllSaliExamen() {
		ArrayList<SaliExamen> result = new ArrayList<SaliExamen>();
		Connection con = MainApp.getDBConnection();
		String query = "SELECT * FROM SALI_EXAMEN";
		try {
			Statement stmt = con.createStatement();
			ResultSet rs = stmt.executeQuery(query);
			while (rs.next()) {
				SaliExamen p = new SaliExamen();
				p.setSaliId(rs.getString("SALIID"));
				p.setExamenId(rs.getString("EXAMENID"));
				result.add(p);
			}
			stmt.close();
			rs.close();
			if (result.isEmpty())
				return null;
			else
				return result;
		} catch (Exception exc) {
			System.out.printf("[error][getAllSaliExamen] %s\n", exc.getMessage());
		}
		return null;
	}

	public static SaliExamen getSaliExamen(String saliid) {
		SaliExamen result = new SaliExamen();
		Connection con = MainApp.getDBConnection();
		String query = "SELECT * FROM SALI_EXAMEN WHERE saliid = ?";
		try {
			PreparedStatement pstmt = con.prepareStatement(query);
			pstmt.setString(1, saliid);
			ResultSet rs = pstmt.executeQuery();
			if (rs.next()) {
				result.setSaliId(rs.getString("SALIID"));
				result.setExamenId(rs.getString("EXAMENID"));
			} else
				return null;
			pstmt.close();
			rs.close();
			return result;
		} catch (Exception exc) {
			System.out.printf("[error][getSaliExamen] %s\n", exc.getMessage());
		}
		return null;
	}

	public static int updateSaliExamen(String saliid, SaliExamen saliExamen) {
		int result;
		Connection con = MainApp.getDBConnection();
		String query = "UPDATE SALI_EXAMEN SET saliid = ?, examenid = ? where saliid = ?";

		try {
			PreparedStatement pstmt = con.prepareStatement(query.toString());
			pstmt.setString(1, saliExamen.getSaliId());
			pstmt.setString(2, saliExamen.getExamenId());
			pstmt.setString(3, saliid);
			result = pstmt.executeUpdate();
			pstmt.close();
			return result;
		} catch (Exception exc) {
			System.out.printf("[error][updateSaliExamen] %s\n", exc.getMessage());
		}
		return 0;
	}

	public static int deleteSaliExamen(String saliid) {
		int result;
		Connection con = MainApp.getDBConnection();
		String query = "DELETE FROM SALI_EXAMEN WHERE saliid = ?";
		try {
			PreparedStatement pstmt = con.prepareStatement(query.toString());
			pstmt.setString(1, saliid);
			result = pstmt.executeUpdate();
			pstmt.close();
			return result;
		} catch (Exception exc) {
			System.out.printf("[error][deleteSaliExamen] %s\n", exc.getMessage());
		}
		return 0;
	}

	public static int insertSaliExamen(SaliExamen saliExamen) {
		int result;
		Connection con = MainApp.getDBConnection();
		String query = "INSERT INTO SALI_EXAMEN " + "(saliid, examenid)" + "VALUES ( ?, ?)";

		try {
			PreparedStatement pstmt = con.prepareStatement(query.toString());
			pstmt.setString(1, saliExamen.getSaliId());
			pstmt.setString(2, saliExamen.getExamenId());
			result = pstmt.executeUpdate();
			pstmt.close();
			return result;
		} catch (Exception exc) {
			System.out.printf("[error][updateSaliExamen] %s\n", exc.getMessage());
		}
		return 0;
	}
}


text:
package com.ctrip.xpipe.utils;

import org.junit.Assert;
import org.junit.Test;

import com.ctrip.xpipe.AbstractTest;

/**
 * @author wenchao.meng
 *
 * Nov 1, 2016
 */
public class StringUtilTest extends AbstractTest{

	@Test
	public void testSubHead(){

		Assert.assertEquals("12345", StringUtil.subHead("12345", 5));
		Assert.assertEquals("12345", StringUtil.subHead("123456", 5));

	}

	@Test
	public void testToString(){

		Assert.assertEquals(String.valueOf(Integer.MAX_VALUE), StringUtil.toString(Integer.MAX_VALUE));

		int []intArr = new int[]{1, 2, 3};
		Assert.assertEquals("[1, 2, 3]", StringUtil.toString(intArr));

		Object [] arrInArr = new Object[]{"a", intArr, "b"};
		Assert.assertEquals("[a, [1, 2, 3], b]", StringUtil.toString(arrInArr));

	}

	@Test
	public void test(){

		Assert.assertEquals("a,null,b,c", StringUtil.join(",", "a", null, "b", "c"));
		Assert.assertEquals("a,null,b,c,null", StringUtil.join(",", "a", null, "b", "c", null));

	}

	@Test
	public void testTrimEquals(){

		Assert.assertTrue(StringUtil.trimEquals(" abc ", " abc  \t"));
		Assert.assertFalse(StringUtil.trimEquals(null, " abc  \t"));
		Assert.assertFalse(StringUtil.trimEquals("abc ", null));

	}

	@Test
	public void testCompareVersion() {
		String version = "2.8.19";
		String targetVersion = "2.8.22";
		Assert.assertEquals(-1, StringUtil.compareVersion(version, targetVersion));
		version = "2.8.19.1";
		Assert.assertEquals(-1, StringUtil.compareVersion(version, targetVersion));
		version = "2.8";
		Assert.assertEquals(-1, StringUtil.compareVersion(version, targetVersion));
		version = "2.8.22.1";
		Assert.assertEquals(1, StringUtil.compareVersion(version, targetVersion));
	}

}


text:
layout: location_detail
partner_site: los_angeles
---

Apply

### Eligibility
###

---

Participation is restricted to Ph.D. students, postdoctoral researchers, and untenured faculty within 7 years of their Ph.D. However, there are no restrictions based on citizenship, country of study, or country of employment.  About 40 participants will be invited. We welcome applicants from all backgrounds and fields of study, especially applicants from groups currently under-represented in computational social science.

We evaluate applicants along a number of dimensions:
 - Research and teaching in the area of computational social science
 - Contributions to public goods, such as creating open source software, curating public datasets, and creating educational opportunities for others
 - Likelihood to benefit from participation
 - Likelihood to contribute to the educational experience of other participants
 - Potential to spread computational social science to new intellectual communities and areas of research.

 Further, when making our evaluations, attempt to account for an applicant's career stage and previous educational opportunities.

### How To Apply
###

---

Applicants must submit the following documents: (i) a curriculum vitae, (ii) a statement (maximum two pages double-spaced) describing
- Your current research
- Why you want to participate in SICSS Los Angeles
- How participation will aid your future research
All applications must include an e-mail and an alternative means of contact (e.g., phone number).

To apply, click [here](https://forms.gle/ZkqspfNKPxGT1R55A).

**~~In order to be guaranteed full consideration, all application materials must be submitted by March 12, 2020.~~
We have extended the application deadline to Wednesday April 1, 2020. Applications will be reviewed on a rolling basis thereafter.**

Inquiries can be sent to [sicss.ucla@gmail.com](mailto:sicss.ucla@gmail.com).


text:
import functools

class cached(object):
    def __init__(self, obj):
        self.cache = {}
        self.obj = obj

    def __get__(self, obj, objtype=None):
        """Support instance methods."""
        return functools.partial(self.__call__, obj)

    def __call__(self, *args, **kwargs):
        cache_key = '{}.{}'.format(args, kwargs)
        if cache_key not in self.cache:
            res = self.obj(*args, **kwargs)
            self.cache[cache_key] = res
            return res
        return self.cache[cache_key]


text:
package de.mirkosertic.bytecoder.classlib;

import de.mirkosertic.bytecoder.api.ClassLibProvider;

public class DatatransferClassLibProvider extends ClassLibProvider {

    @Override
    public String getResourceBase() {
        return "META-INF/modules/java.datatransfer/classes";
    }

    @Override
    public String[] additionalResources() {
        return new String[0];
    }
}


text:
function Panorama(options) {
	return this.init(options);
}

Panorama.prototype.removeImages = function() {
	for (var i = 0; i < this.options.total; i++) {
		try {
			this.panocontainer.remove(this.images[i]);
		} catch(E) {
		}
	}
};

Panorama.prototype.init = function(options) {
	this.options = options;
	if (!options || typeof (options.view) != 'object') {
		Ti.API.log('view is not object');
		return null;
	}
	this.images = [];
	this.panocontainer = Ti.UI.createScrollView({
		showVerticalScrollIndicator : false,
		showHorizontalScrollIndicator : false,
		contentHeight : this.options.view.getHeight(),
		width : Ti.UI.FILL,
		height : Ti.UI.FILL,
		visible : true
	});
	this.options.view.add(this.panocontainer);
	for (var i = 0; i < this.options.total; i++) {
		this.images[i] = Ti.UI.createImageView({
			top : 0,
			height : Ti.UI.FILL,
		});
		this.panocontainer.add(this.images[i]);
	}
	this.navi = Ti.UI.createView({
		bottom : 0,
		height : 40,
		opacity : 0.3,
		backgroundColor : 'black'
	});
	this.titlelabel = Ti.UI.createLabel({
		font : {
			fontSize : 20,
			fontWeight : 'bold'
		},
		textAlign : 'left',
		left : 10,
		color : 'white'
	});
	this.navi.add(this.titlelabel);
	this.options.view.add(this.navi);
	return this;
}

Panorama.prototype.setImage = function(_pano) {
	this.titlelabel.text = _pano.title + ' ' + _pano.subtitle;
	this.imagepath = _pano.panopath;
	var self = this;
	Ti.API.log(this.imagepath);
	var testImg = Ti.UI.createImageView({
		image : this.imagepath,
		height : Ti.UI.FILL,
		width : Ti.UI.SIZE || 'auto',
		visible : true
	});
	var img = testImg.toImage();
	var width = self.panocontainer.getSize().height * img.width / img.height;
	self.panocontainer.contentWidth = self.options.total * width;
	for (var i = 0; i < self.options.total; i++) {
		self.images[i].setImage(img);
		self.images[i].left = width * i;
		self.images[i].height = self.options.view.getHeight();
		self.images[i].width = width;
	}
	self.panocontainer.contentOffset = {
		x : self.options.total * width / 2,
		y : 0
	};
	self.options.view.fireEvent('complete', {
		image : self.image
	});
};

module.exports = Panorama;


text:
using System;
using System.Collections.Generic;
using System.Net;
using CodeClimber.GoogleReaderConnector.Exceptions;
using System.IO;

#if !WINDOWS_PHONE
using System.Web;
#endif

namespace CodeClimber.GoogleReaderConnector.Services
{
    public class HttpService: IHttpService
    {
        public IClientLoginService ClientLogin { get; set; }

        public HttpService()
        { }

        public HttpService(IClientLoginService clientLogin)
        {
            ClientLogin = clientLogin;
        }

        #region IHttpService Members

#if !WINDOWS_PHONE
        public Stream PerformGet(Uri url)
        {
            WebClient webClient = new WebClient();

            // Get the response, validate and return.
            Stream responseStream = null;
            try
            {
                webClient.Headers.Add("Authorization", "GoogleLogin auth=" + ClientLogin.Auth);
                responseStream = webClient.OpenRead(url);
            }
            catch (WebException webex)
            {
                HandleConnectionError(webex);
            }

            return responseStream;
        }

        public string PerformPost(Uri url, Dictionary<string, string> values)
        {
            WebClient webClient = new WebClient();
            webClient.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";
            string result="";
            try
            {
                webClient.Headers.Add("Authorization", "GoogleLogin auth=" + ClientLogin.Auth);
                result = webClient.UploadString(url, ConverToString(values));
            }
            catch (WebException webex)
            {
                HandleConnectionError(webex,true);
            }
            return result;
        }

        private static void HandleConnectionError(WebException webex, bool throwWrongUsernameAndPassword=false)
        {
            HttpWebResponse faultResponse = webex.Response as HttpWebResponse;
            if (faultResponse == null)
                throw new NetworkConnectionException(webex.Status + ": " + webex.Message);

            if (throwWrongUsernameAndPassword)
            {
                if (faultResponse.StatusCode == HttpStatusCode.Forbidden)
                    throw new IncorrectUsernameOrPasswordException(faultResponse.StatusCode, faultResponse.StatusDescription);
            }
            else
            {
                  if (faultResponse.StatusCode == HttpStatusCode.Unauthorized)
                      throw new LoginFailedException(faultResponse.StatusCode, faultResponse.StatusDescription);
            }

            if (faultResponse.StatusCode != HttpStatusCode.OK)
                throw new GoogleResponseException(faultResponse.StatusCode, faultResponse.StatusDescription);
        }
#endif

        public void PerformPostAsync(Uri url, Dictionary<string, string> values, Action<string> onSuccess = null, Action<Exception> onError = null, Action onFinally = null)
        {
            WebClient webClient = new WebClient();
            webClient.Headers[HttpRequestHeader.ContentType] = "application/x-www-form-urlencoded";

            webClient.UploadStringCompleted += delegate(object sender, UploadStringCompletedEventArgs e)
                {
                    try
                    {
                        if (e.Error != null)
                        {
                            if (onError != null)
                            {
                                WebException webex = e.Error as WebException;
                                HttpWebResponse faultResponse = webex.Response as HttpWebResponse;

                                if (faultResponse == null)
                                    onError(new NetworkConnectionException(webex.Status + ": " + webex.Message));

                                else if (faultResponse.StatusCode == HttpStatusCode.Forbidden)
                                    onError(new IncorrectUsernameOrPasswordException(
                                        faultResponse.StatusCode, faultResponse.StatusDescription));

                                else if (faultResponse.StatusCode != HttpStatusCode.OK)
                                    onError(new LoginFailedException(
                                        faultResponse.StatusCode, faultResponse.StatusDescription));
                                else
                                    onError(e.Error);
                            }
                            return;
                        }

                        if (onSuccess != null)
                        {
                            onSuccess(e.Result);
                        }
                    }
                    finally
                    {
                        if (onFinally != null)
                        {
                            onFinally();
                        }
                    }
                };
            webClient.Headers[HttpRequestHeader.Authorization] = "GoogleLogin auth=" + ClientLogin.Auth;
            webClient.UploadStringAsync(url, ConverToString(values));
        }

        public void PerformGetAsync(Uri requestUrl, Action<Stream> onSuccess = null, Action<Exception> onError = null, Action onFinally = null)
        {
            WebClient webClient = new WebClient();

            webClient.Headers[HttpRequestHeader.Authorization] = "GoogleLogin auth=" + ClientLogin.Auth;

            webClient.OpenReadCompleted += delegate(object sender, OpenReadCompletedEventArgs e)
                {
                    try
                    {
                        if (e.Error != null)
                        {
                            if (onError != null)
                            {
                                WebException webex = e.Error as WebException;
                                HttpWebResponse actualResponse = webex.Response as HttpWebResponse;

                                if (actualResponse == null)
                                {
                                    onError(new NetworkConnectionException(webex.Status + ": " + webex.Message));
                                }
                                else if (actualResponse.StatusCode == HttpStatusCode.Unauthorized)
                                {
                                    onError(new LoginFailedException(actualResponse.StatusCode, actualResponse.StatusDescription));
                                    return;
                                }
                                else onError(new GoogleResponseException(actualResponse.StatusCode,
                                                              actualResponse.StatusDescription));
                            }
                            return;
                        }

                        if (onSuccess != null)
                        {
                            onSuccess(e.Result);
                        }
                    }
                    finally
                    {
                        if (onFinally != null)
                        {
                            onFinally();
                        }
                    }
                };

            webClient.OpenReadAsync(requestUrl);
        }

        #endregion

        private static String ConverToString(Dictionary<string, string> dict)
        {
            string[] vars = new string[dict.Count];
            int i = 0;
            foreach (KeyValuePair<string, string> keyValuePair in dict)
            {
                vars[i++]=String.Format("{0}={1}", keyValuePair.Key, HttpUtility.UrlEncode(keyValuePair.Value));
            }
            return string.Join("&", vars);
        }

    }
}


text:
=head1 LICENSE

# Copyright [1999-2015] Wellcome Trust Sanger Institute and the EMBL-European Bioinformatics Institute
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

=head1 CONTACT

  Please email comments or questions to the public Ensembl
  developers list at <http://lists.ensembl.org/mailman/listinfo/dev>.

  Questions may also be sent to the Ensembl help desk at
  <http://www.ensembl.org/Help/Contact>.

=cut

=head1 NAME

Bio::EnsEMBL::Analysis::RunnableDB::WGA2GenesDirect -

=head1 SYNOPSIS

  my $db      = Bio::EnsEMBL::DBAdaptor->new($locator);
  my $genscan = Bio::EnsEMBL::Analysis::RunnableDB::WGA2GenesDirect
    ->new (-db         => $pipelinedb,
           -input_id   => $input_id
           -analysis   => $analysis );
  $genscan->fetch_input();
  $genscan->run();
  $genscan->write_output(); #writes to stdout

=head1 DESCRIPTION

=head1 METHODS

=cut
package Bio::EnsEMBL::Analysis::RunnableDB::WGA2GenesDirect;

use warnings ;
use vars qw(@ISA);
use strict;

use Bio::SeqIO;

use Bio::EnsEMBL::DBSQL::DBAdaptor;
use Bio::EnsEMBL::Analysis::RunnableDB::BaseGeneBuild;

use Bio::EnsEMBL::Utils::Exception qw(throw warning);

use Bio::EnsEMBL::Compara::DBSQL::DBAdaptor;

use Bio::EnsEMBL::Analysis::RunnableDB;

use Bio::EnsEMBL::Analysis::Config::General;
use Bio::EnsEMBL::Analysis::Config::WGA2GenesDirect;

#use Bio::EnsEMBL::Analysis::Tools::Logger;
use Bio::EnsEMBL::Analysis::Tools::WGA2Genes::GeneScaffold;
use Bio::EnsEMBL::Analysis::Tools::ClusterFilter;
use Bio::EnsEMBL::Analysis::Tools::GeneBuildUtils::TranscriptUtils
    qw(replace_stops_with_introns);

@ISA = qw(Bio::EnsEMBL::Analysis::RunnableDB
            Bio::EnsEMBL::Analysis::RunnableDB::BaseGeneBuild);

############################################################
=head2 new
    Title   :   fetch_input
=cut

sub new {
  my ($class,@args) = @_;
  my $self = $class->SUPER::new(@args);

  $self->read_and_check_config($WGA2GENES_CONFIG_BY_LOGIC);

  return $self;
}

############################################################
=head2 fetch_input
    Title   :   fetch_input
=cut

sub fetch_input {
  my( $self) = @_;

  my $input_id = $self->input_id;
  throw("No input id") unless defined($input_id);

  print "YOUR INPUT ID:",$input_id,"\n";

  my $q_dbh = $self->get_dbadaptor($self->QUERY_CORE_DB, undef, 1);
  my $t_dbh = $self->get_dbadaptor($self->TARGET_CORE_DB);
  my $compara_dbh = $self->get_dbadaptor($self->COMPARA_DB, 'compara');

  my $query_species =
      $q_dbh->get_MetaContainerAdaptor->get_Species->binomial;
  my $target_species =
      $t_dbh->get_MetaContainerAdaptor->get_Species->binomial;

  my $gdb_adap = $compara_dbh->get_GenomeDBAdaptor;
  my $q_gdb = $gdb_adap->fetch_by_name_assembly($query_species);
  my $t_gdb = $gdb_adap->fetch_by_name_assembly($target_species);

  ########
  # check that the default assembly for the query and target agrees
  # with that for the method_link_species_set GenomeDBs
  ########

  my ($q_assembly_version, $t_assembly_version);
  eval {
    $q_assembly_version = $q_dbh->get_CoordSystemAdaptor->
        fetch_by_name('toplevel',
                      $q_gdb->assembly);

    $t_assembly_version = $t_dbh->get_CoordSystemAdaptor->
        fetch_by_name('toplevel',
                      $t_gdb->assembly);
  };
  $@ and do {
    throw("Had trouble fetching coord systems for ".
          $q_gdb->assembly . " and " .
          $t_gdb->assembly . " from core dbs: $@");
  };

  ########
  # fetch the genes; need to work in the coordinate space of the
  # top-level slice to be consistent with compara
  ########
  my $gene = $q_dbh->get_GeneAdaptor->fetch_by_stable_id($input_id);
  $self->_check_gene($gene);
  $self->gene($gene);

  #########
  # get the compara data: MethodLinkSpeciesSet, reference DnaFrag,
  # and all GenomicAlignBlocks
  #########
  my $mlss = $compara_dbh->get_MethodLinkSpeciesSetAdaptor
      ->fetch_by_method_link_type_GenomeDBs($self->INPUT_METHOD_LINK_TYPE,
                                            [$q_gdb, $t_gdb]);
  throw("No MethodLinkSpeciesSet for :\n" .
        $self->INPUT_METHOD_LINK_TYPE . "\n" .
        $query_species . "\n" .
        $target_species)
      if not $mlss;

  my $dnafrag = $compara_dbh->get_DnaFragAdaptor->
      fetch_by_GenomeDB_and_name($q_gdb,
                                 $self->gene->slice->seq_region_name);

  my $gaba = $compara_dbh->get_GenomicAlignBlockAdaptor;

  my $gen_al_blocks =
      $gaba->fetch_all_by_MethodLinkSpeciesSet_DnaFrag($mlss,
                                                       $dnafrag,
                                                       $gene->start,
                                                       $gene->end);

  my (%chains, @chains);
  foreach my $block (@$gen_al_blocks) {
    my $qga = $block->reference_genomic_align;
    my ($tga) = @{$block->get_all_non_reference_genomic_aligns};

    ###########################################################
    ###### INVESTIGATE: do we want to just use level 1 chains?
    ###########################################################
    #next if $qga->level_id != 1 or $tga->level_id != 1;

    # fetch the target slice for later reference
    if (not exists $self->target_slices->{$tga->dnafrag->name}) {

      $self->target_slices->{$tga->dnafrag->name} =
          $t_dbh->get_SliceAdaptor->fetch_by_region('toplevel',
                                                    $tga->dnafrag->name);
    }

    if ($block->reference_genomic_align->dnafrag_strand < 0) {
      $block->reverse_complement;
    }

    push @{$chains{$block->group_id}}, $block;
  }

  foreach my $chain_id (keys %chains) {
    push @chains, [
                   sort {
                     $a->reference_genomic_align->dnafrag_start <=>
                     $b->reference_genomic_align->dnafrag_start;
                   } @{$chains{$chain_id}}
                   ];
  }
  $self->genomic_align_block_chains(\@chains);

}

############################################################
=head2 run
    Title   :   run
=cut

sub run {
  my ($self) = @_;

  my @res_tran;
  my $tran_stable_id;
  my @final_tran;
  print scalar(@{$self->genomic_align_block_chains}),"\n";
  foreach my $chain (@{$self->genomic_align_block_chains}) {

    my $gene_scaffold = Bio::EnsEMBL::Analysis::Tools::WGA2Genes::GeneScaffold->new(
#    my $gene_scaffold = Bio::EnsEMBL::Analysis::Tools::WGA2Genes::GeneScaffoldDirect->new(
                                                                                -genomic_align_blocks => $chain,
                                                                                -from_slice    => $self->gene->slice,
                                                                                -to_slices     => $self->target_slices,
                                                                                -transcripts   => $self->good_transcripts,
                                                                                -max_readthrough_dist => $self->MAX_EXON_READTHROUGH_DIST,
                                                                                -direct_target_coords => 1,
                                                                                );

    foreach my $tran (@{$self->good_transcripts}) {

      $tran_stable_id = $tran->stable_id;

      my $proj_trans =

          # Remember to remove the 1 in place transcripts as right now this is only used for testing purposes
          #$gene_scaffold->place_transcript($tran,1);
          $gene_scaffold->place_transcript($tran);

      if ($proj_trans) {

        push @res_tran, $proj_trans;
      }
    }
  }

  if ($self->TRANSCRIPT_FILTER){
    @res_tran = @{$self->filter->filter_results(\@res_tran)};
  }

  foreach my $res_tran (@res_tran){
    $res_tran = $self->process_transcript($res_tran,
                                          $tran_stable_id);
    push @final_tran, $res_tran;
  }
  # create new gene object for each transcript

  print "At the end of RUN, we had ", scalar(@final_tran), " transcripts\n";

  $self->output(\@final_tran);

}

############################################################
=head2 write_output
    Title   :   write_output
=cut

sub write_output {
  my ($self) = @_;

  my $trans_count = 0;

  my $t_dbh = $self->get_dbadaptor($self->TARGET_CORE_DB, '', 1);

  my $t_gene_adaptor = $t_dbh->get_GeneAdaptor();

 foreach my $t (@{$self->output}) {
   $t->analysis($self->analysis);

    my $gene = Bio::EnsEMBL::Gene->new( -analysis => $self->analysis,
                                        -biotype  => 'protein_coding',);

    foreach my $tsf ( @{ $t->get_all_supporting_features }){
      $tsf->analysis($self->analysis);
    }

    foreach my $exon (@{$t->get_all_Exons()}){
      $exon->analysis($self->analysis);

      foreach my $esf (@{$exon->get_all_supporting_features()}){
        $esf->analysis($self->analysis);
      }
    }

    $gene->add_Transcript($t);

    $t_gene_adaptor->store($gene);

    $trans_count++;

    print "TRANSCRIPT:\n";
    foreach my $e (@{$t->get_all_Exons}) {
      printf("%s\tEnsembl\tExon\t%d\t%d\t%d\t%d\t%d\n", $e->slice->seq_region_name, $e->start, $e->end, $e->strand, $e->phase, $e->end_phase);
    }
    my $seqio = Bio::SeqIO->new(-format => 'fasta',
                                -fh => \*STDOUT);
    $seqio->write_seq($t->translate);
  }

  print "For gene " . $self->input_id . " you stored ", $trans_count, " transcripts\n";
  # to do: write gene back to core target database
}

######################################
# internal methods
#####################################

sub _check_gene {
  my ($self, $gene) = @_;

  my @good_transcripts;

  foreach my $t (@{$gene->get_all_Transcripts}){
    #print "Transcript Start: ",$t->start, "  END: ", $t->end,"\n";
    #print "translation: ",$t->translateable_seq,"\n";

    if ((length($t->translateable_seq) % 3) == 0){

      push @good_transcripts, $t;

      }
    else{
      warn ("Gene ", $gene->display_id(), " contains no valid transcripts");
      #push @good_transcripts, $t;
      #print "Done\n";
      #exit(1);
    }
  }

  warn ("Gene ", $gene->display_id(), " contains no valid transcripts") if (scalar(@good_transcripts) == 0);

  $self->good_transcripts(\@good_transcripts);

  # throw an exception here if:
  # 1. gene is not protein-coding (translations in all transcripts)
  # 2. gene contains at least one transcript with a coding region
  #    that is not multiple-of-three in length

}

#################################################################
# FUNCTION  : process_transcript
#
# Description:
#    Subjects the given transcript to a few tests, returning
#    the transcript if they succeed, undef if not. If the
#    transcript contains less than $max_stops stops, these
#    are "spliced out"; otherwise the transcripts is rejected
#################################################################

sub process_transcript {
  my ($self,
      $tran,
      $source_id
) = @_;

  return 0 if not $tran;

  my (@processed_transcripts);

  my @exons = @{$tran->get_all_Exons};
  my ($tsf) = @{$tran->get_all_supporting_features};
  my $pep = $tran->translate->seq;

  if (CORE::length($pep) == 0) {
    logger_info("Rejecting proj of $source_id because was just a stop codon");
    return 0;
  }

  my $num_stops = $pep =~ s/\*/\*/g;

  ##################
  # number of stops is non-zero but acceptable. Need to
  # operate on the transcript to jump over the stops
  if($num_stops) {
    $tran = replace_stops_with_introns($tran,10);
  }

  return $tran;
}

###########################
# gets/sets
###########################

sub genomic_align_block_chains {
  my ($self, $val) = @_;

  if (defined $val) {
    $self->{_gen_al_chains} = $val;
  }

  return $self->{_gen_al_chains};
}

sub gene {
  my ($self, $val) = @_;

  if (defined $val) {
    $self->{_gene_recs} = $val;
  }

  return $self->{_gene_recs};
}

sub good_transcripts {
  my ($self, $val) = @_;

  if (defined $val) {
    $self->{_good_transcripts} = $val;
  }

  return $self->{_good_transcripts};
}

sub target_slices {
  my ($self, $val) = @_;

  if (defined $val) {
    $self->{_target_slices} = $val;
  }

  if (not exists $self->{_target_slices}) {
    $self->{_target_slices} = {};
  }

  return $self->{_target_slices};
}

####################################
# config variable holders
####################################

sub read_and_check_config {
  my ($self, $hash) = @_;

  $self->SUPER::read_and_check_config($hash);

  my $logic = $self->analysis->logic_name;

  foreach my $var (qw(INPUT_METHOD_LINK_TYPE
                      QUERY_CORE_DB
                      TARGET_CORE_DB
                      COMPARA_DB)) {

    throw("You must define $var in config for logic '$logic'" .
          " or in the DEFAULT entry")
        if not $self->$var;
  }

 # filter does not have to be defined, but if it is, it should
  # give details of an object and its parameters
  if ($self->TRANSCRIPT_FILTER) {
    if (not ref($self->TRANSCRIPT_FILTER) eq "HASH" or
        not exists($self->TRANSCRIPT_FILTER->{OBJECT}) or
        not exists($self->TRANSCRIPT_FILTER->{PARAMETERS})) {

      throw("FILTER in config foR '$logic' must be a hash ref with elements:\n" .
            "  OBJECT : qualified name of the filter module;\n" .
            "  PARAMETERS : anonymous hash of parameters to pass to the filter");
    } else {
      my $module = $self->TRANSCRIPT_FILTER->{OBJECT};
      my $pars   = $self->TRANSCRIPT_FILTER->{PARAMETERS};

      (my $class = $module) =~ s/::/\//g;
      eval{
        require "$class.pm";
      };
      throw("Couldn't require ".$class." Exonerate2Genes:require_module $@") if($@);

      $self->filter($module->new(%{$pars}));
    }
  }

}

#
# core options
#

sub INPUT_METHOD_LINK_TYPE {
  my ($self, $type) = @_;

  if (defined $type) {
    $self->{_input_method_link_type} = $type;
  }

  return $self->{_input_method_link_type};
}

sub COMPARA_DB {
  my ($self, $db) = @_;

  if (defined $db) {
    $self->{_compara_db} = $db;
  }

  return $self->{_compara_db};
}

sub QUERY_CORE_DB {
  my ($self, $db) = @_;

  if (defined $db) {
    $self->{_query_core_db} = $db;
  }

  return $self->{_query_core_db};
}

sub TARGET_CORE_DB {
  my ($self, $db) = @_;

  if (defined $db) {
    $self->{_target_core_db} = $db;
  }

  return $self->{_target_core_db};
}

#
# transcript editing and filtering
#

sub TRANSCRIPT_FILTER {
   my ($self, $val) = @_;

  if (defined $val) {
    $self->{_transcript_filter} = $val;
  }

  return $self->{_transcript_filter};
}

sub filter {
  my ($self, $val) = @_;
  if ($val) {
    $self->{_filter} = $val;
  }
  return $self->{_filter};
}

sub MAX_EXON_READTHROUGH_DIST {
  my ($self, $val) = @_;

  if (defined $val) {
    $self->{_max_ex_rt_dist} = $val;
  }

  return $self->{_max_ex_rt_dist};
}

sub MIN_COVERAGE {
  my ($self, $val) = @_;

  if (defined $val) {
    $self->{_min_coverage} = $val;
  }

  return $self->{_min_coverage};
}

1;


text:
package test.swissknife;

import org.junit.Test;

import com.bitwormhole.swissknife.test.TestingRunner;

public class VersionStringifyTest {

	@Test
	public void test() {

		String[] args = { "version-stringify" };

		TestingRunner.run(args);

	}

}


text:
mod err;

use ::descriptor::Descriptor;
use ::libc;

pub use self::err::{SlaveError, Result};
use std::os::unix::io::{AsRawFd, RawFd};

#[derive(Debug)]
pub struct Slave {
    pty: RawFd,
}

impl Slave {
    /// The constructor function `new` returns the Slave interface.
    pub fn new(path: *const ::libc::c_char) -> Result<Self> {
        match Self::open(path, libc::O_RDWR, None) {
            Err(cause) => Err(SlaveError::BadDescriptor(cause)),
            Ok(fd) => Ok(Slave { pty: fd }),
        }
    }

    pub fn dup2(&self, std: libc::c_int) -> Result<libc::c_int> {
        unsafe {
            match libc::dup2(self.as_raw_fd(), std) {
                -1 => Err(SlaveError::Dup2Error),
                d => Ok(d),
            }
        }
    }
}

impl Descriptor for Slave {}

impl AsRawFd for Slave {
    /// The accessor function `as_raw_fd` returns the fd.
    fn as_raw_fd(&self) -> RawFd {
        self.pty
    }
}

impl Drop for Slave {
    fn drop(&mut self) {
        Descriptor::drop(self);
    }
}


text:
/*
 * Compile this file together with the Vedis datastore engine source code
 * to generate the executable. For example:
 *  gcc -W -Wall -O6 vedis_intro.c vedis.c -o vedis_intro
*/
/*
 * This simple program is a quick introduction on how to embed and start
 * experimenting with Vedis without having to do a lot of tedious
 * reading and configuration.
 *
 * Introduction to the Command Execution Interfaces (CEI):
 *
 * Structured data storage is presented to clients via the command execution interface.
 * Basically, you execute one or more commands ala Redis (i.e. SET key value; HSET ds key value, GET key)
 * via [vedis_exec()] and you extract the execution result (The return value of the command) via
 * [vedis_exec_result()]. You could also register foreign commands via [vedis_register_commmand()].
 * You may also be tempted by installing a command consumer callback in case you
 * want to invoke multiple commands (pipelined request) in a single [vedis_exec()] call rather
 * than calling [vedis_exec_result()] which return only the execution result of the last executed
 * command.
 *
 * For an introduction to the Vedis C/C++ interface, please refer to:
 *        http://vedis.symisc.net/api_intro.html
 * For the full C/C++ API reference guide, please refer to:
 *        http://vedis.symisc.net/c_api.html
 * Vedis in 5 Minutes or Less:
 *        http://vedis.symisc.net/intro.html
 * Built-in Vedis Commands:
 *        http://vedis.symisc.net/commands.html
 */
/* $SymiscID: vedis_intro.c v1.0 Win7 2013-09-12 02:05 stable <chm@symisc.net> $ */
/*
 * Make sure you have the latest release of Vedis from:
 *  http://vedis.symisc.net/downloads.html
 */
#include <stdio.h>  /* puts() */
#include <stdlib.h> /* exit() */
/* Make sure this header file is available.*/
#include "vedis.h"
/*
 * Banner.
 */
static const char zBanner[] = {
	"============================================================\n"
	"Vedis Command Execution Intro                               \n"
	"                                    http://vedis.symisc.net/\n"
	"============================================================\n"
};
/*
 * Extract the datastore error log and exit.
 */
static void Fatal(vedis *pStore,const char *zMsg)
{
	if( pStore ){
		const char *zErr;
		int iLen = 0; /* Stupid cc warning */

		/* Extract the datastore error log */
		vedis_config(pStore,VEDIS_CONFIG_ERR_LOG,&zErr,&iLen);
		if( iLen > 0 ){
			/* Output the error log */
			puts(zErr); /* Always null termniated */
		}
	}else{
		if( zMsg ){
			puts(zMsg);
		}
	}
	/* Manually shutdown the library */
	vedis_lib_shutdown();
	/* Exit immediately */
	exit(0);
}

int main(int argc,char *argv[])
{
	vedis *pStore;            /* Vedis handle */
	vedis_value *pResult;     /* Return value of the last executed command */
	int rc;

	puts(zBanner);

	/* Create our datastore */
	rc = vedis_open(&pStore,argc > 1 ? argv[1] /* On-disk DB */ : ":mem:" /* In-mem DB */);
	if( rc != VEDIS_OK ){
		Fatal(0,"Out of memory");
	}

	/* Execute the simplest command */
	rc = vedis_exec(pStore,"SET test 'Hello World'",-1);
	if( rc != VEDIS_OK ){
		/* Seriously? */
		Fatal(pStore,0);
	}

	/* Another simple command (Multiple set) */
	rc = vedis_exec(pStore,"MSET username james age 27 mail dude@example.com",-1);
	if( rc != VEDIS_OK ){
		Fatal(pStore,0);
	}

	/* A configuration hashtable */
	rc = vedis_exec(pStore,"HSET config path '/usr/local/etc'",-1);
	if( rc != VEDIS_OK ){
		Fatal(pStore,0);
	}

	/* A quite complex command (Multiple hash set) using foreign data */
	rc = vedis_exec_fmt(pStore,
		"HMSET config pid %d user %s os %s scm %s",
		1024 /* pid */,
		"dean", /* user */
		"FreeBSD", /* OS */
		"Git" /* SCM */
		);
	if( rc != VEDIS_OK ){
		Fatal(pStore,0);
	}

	puts("Insertion..OK");

	/* Fetch some data */

	vedis_exec(pStore,"GET test",-1);
	/* Extract the return value of the last executed command (i.e. GET test) " */
	rc = vedis_exec_result(pStore,&pResult);
	if( rc != VEDIS_OK ){
		/* Seriously? */
		Fatal(pStore,0);
	}else{
		const char *zResponse;
		/* Cast the vedis object to a string */
		zResponse = vedis_value_to_string(pResult,0);
		/* Output */
		printf(" test ==> %s\n",zResponse); /* test ==> 'Hello world' */
	}

	vedis_exec(pStore,"GET mail",-1);
	/* 'GET mail' return value */
	rc = vedis_exec_result(pStore,&pResult);
	if( rc != VEDIS_OK ){
		Fatal(pStore,0);
	}else{
		const char *zResponse;
		/* Cast the vedis object to a string */
		zResponse = vedis_value_to_string(pResult,0);
		/* Output */
		printf(" mail ==> %s\n",zResponse); /* Should be 'dude@example.com' */
	}

	/*
	 * A command which return multiple value in array.
	 */
	vedis_exec(pStore,"MGET username age",-1); /* james 27*/

	vedis_exec_result(pStore,&pResult);

	if( vedis_value_is_array(pResult) ){
		/* Iterate over the elements of the returned array */
		vedis_value *pEntry;
		puts("Array entries:");
		while((pEntry = vedis_array_next_elem(pResult)) != 0 ){
			const char *zEntry;
			/* Cast to string and output */
			zEntry = vedis_value_to_string(pEntry,0);
			/* Output */
			printf("\t%s\n",zEntry);
		}
	}

	/* Extract hashtable data (i.e. pid field) */
	 vedis_exec(pStore,"HGET config pid",-1); /* 1024 */

	vedis_exec_result(pStore,&pResult);
	{
		int pid;
		/* Cast to integer */
		pid = vedis_value_to_int(pResult);
		/* Output */
		printf("pid ==> %d\n",pid); /* Should be 1024 */
	}

	/* All hashtable data */
	vedis_exec(pStore,"HVALS config",-1); /* All 'config' values */

	vedis_exec_result(pStore,&pResult);

	if( vedis_value_is_array(pResult) ){
		/* Iterate over the elements of the returned array */
		vedis_value *pEntry;
		puts("Array entries:");
		while((pEntry = vedis_array_next_elem(pResult)) != 0 ){
			const char *zEntry;
			/* Cast to string and output */
			zEntry = vedis_value_to_string(pEntry,0);
			/* Output */
			printf("\t%s\n",zEntry);
		}
	}
	puts("All done!");

	/* Auto-commit the transaction and close our datastore */
	vedis_close(pStore);
	return 0;
}


text:
import React from 'react';

import Link from '../../../link';
import FontAwesomeSymbol from '../../../fontAwesomeSymbol';
import { FontAwesome } from '../../../../utils';

type SidebarSocialLinkProps = {
  url: string;
  title: string;
  symbolName: FontAwesome.SymbolNames;
};

const SidebarSocialLink: React.FunctionComponent<SidebarSocialLinkProps> = ({ url, title, symbolName }) => (
  <Link to={url} className="sidebar-social-item" title={title}>
    <FontAwesomeSymbol symbolName={symbolName} />
    {title}
  </Link>
);

SidebarSocialLink.displayName = 'SidebarSocialLink';

export default SidebarSocialLink;


text:
call "%VS100COMNTOOLS%..\..\VC\vcvarsall.bat" AMD64

cd .
nmake -f PMSM_Sinusoidal_Drive.mk  GENERATE_REPORT=0 GENERATE_ASAP2=0
@if errorlevel 1 goto error_exit
exit /B 0

:error_exit
echo The make command returned an error of %errorlevel%
An_error_occurred_during_the_call_to_make


text:
$configFile = [System.IO.Path]::ChangeExtension($MyInvocation.MyCommand.Path, 'json')
if (Test-Path -Path $configFile)
{
    <#
        Allows reading the configuration data from a JSON file,
        for real testing scenarios outside of the CI.
    #>
    $ConfigurationData = Get-Content -Path $configFile | ConvertFrom-Json
}
else
{
    $ConfigurationData = @{
        AllNodes = @(
            @{
                NodeName        = 'localhost'

                Admin_UserName    = "$env:COMPUTERNAME\SqlAdmin"
                Admin_Password    = 'P@ssw0rd1'
                SqlLogin_UserName = "DscAdmin1"
                SqlLogin_Password = 'P@ssw0rd1'

                ServerName      = $env:COMPUTERNAME
                InstanceName    = 'DSCSQLTEST'
                Database1Name   = 'ScriptDatabase3'
                Database2Name   = 'ScriptDatabase4'

                GetQuery        = @'
SELECT Name FROM sys.databases WHERE Name = '$(DatabaseName)' FOR JSON AUTO
'@

                TestQuery       = @'
if (select count(name) from sys.databases where name = '$(DatabaseName)') = 0
BEGIN
    RAISERROR ('Did not find database [$(DatabaseName)]', 16, 1)
END
ELSE
BEGIN
    PRINT 'Found database [$(DatabaseName)]'
END
'@

                SetQuery        = @'
CREATE DATABASE [$(DatabaseName)]
'@

                CertificateFile = $env:DscPublicCertificatePath
            }
        )
    }
}

<#
    .SYNOPSIS
        Runs the SQL query as a Windows User.
#>
Configuration MSFT_SqlScriptQuery_RunSqlScriptQueryAsWindowsUser_Config
{
    Import-DscResource -ModuleName 'SqlServerDsc'

    node $AllNodes.NodeName
    {
        SqlScriptQuery 'Integration_Test'
        {
            ServerInstance       = Join-Path -Path $Node.ServerName -ChildPath $Node.InstanceName
            GetQuery             = $Node.GetQuery
            TestQuery            = $Node.TestQuery
            SetQuery             = $Node.SetQuery
            QueryTimeout         = 30
            Variable             = @(
                ('DatabaseName={0}' -f $Node.Database1Name)
            )

            PsDscRunAsCredential = New-Object `
                -TypeName System.Management.Automation.PSCredential `
                -ArgumentList @($Node.Admin_Username, (ConvertTo-SecureString -String $Node.Admin_Password -AsPlainText -Force))
        }
    }
}

<#
    .SYNOPSIS
        Runs the SQL query as a SQL login.
#>
Configuration MSFT_SqlScriptQuery_RunSqlScriptQueryAsSqlUser_Config
{
    Import-DscResource -ModuleName 'SqlServerDsc'

    node $AllNodes.NodeName
    {
        SqlScriptQuery 'Integration_Test'
        {
            ServerInstance = Join-Path -Path $Node.ServerName -ChildPath $Node.InstanceName
            GetQuery       = $Node.GetQuery
            TestQuery      = $Node.TestQuery
            SetQuery       = $Node.SetQuery
            QueryTimeout   = 30
            Variable       = @(
                ('DatabaseName={0}' -f $Node.Database2Name)
            )
            Credential     = New-Object `
                -TypeName System.Management.Automation.PSCredential `
                -ArgumentList @($Node.SqlLogin_Username, (ConvertTo-SecureString -String $Node.SqlLogin_Password -AsPlainText -Force))
        }
    }
}


text:
set -e
cd target
OLD=`ls lsd*.jar`
NEW=`echo $OLD | sed 's/-jar-with-dependencies//'`
mv $OLD $NEW


text:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:context="http://www.springframework.org/schema/context"
	xsi:schemaLocation="
  http://www.springframework.org/schema/beans
  http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
  http://www.springframework.org/schema/context
  http://www.springframework.org/schema/context/spring-context-3.0.xsd">

<context:property-placeholder location="classpath:serviceconfig/olat.properties, classpath:olat.local.properties" />

<bean id="translationDevManager" class="org.olat.core.util.i18n.devtools.TranslationDevManager">
	<constructor-arg ref="I18nManager" />
</bean>

</beans>