Skip to content

Instantly share code, notes, and snippets.

View robertberry-zz's full-sized avatar

Rob Berry robertberry-zz

View GitHub Profile
public class MultiThreadedHttpConnectionManager implements HttpConnectionManager {
/**
* Gets the total number of pooled connections. This is the total number of
* connections that have been created and are still in use by this connection
* manager. This value will not exceed the {@link #getMaxTotalConnections()
* maximum number of connections}.
*
* @return the total number of pooled connections
*/
@robertberry-zz
robertberry-zz / gist:4202591
Created December 4, 2012 10:46
SQL Alchemy update
def update_existing_accounts(session):
q = session.query(StaffMember.email, StaffMember.honourific).\
filter(EPrintUser.staff_id == StaffMember.id).\
as_scalar()
return session.query(EPrintUser).\
update({EPrintUser.email: q.email,
EPrintUser.honourific: q.honourific})
package code
package snippet
import code.model.User
import scala.xml.{NodeSeq, Text}
import net.liftweb.util._
import net.liftweb.common._
import code.lib._
import Helpers._
@robertberry-zz
robertberry-zz / gist:3498170
Created August 28, 2012 13:51
Example citedBy request
POST http://cdc315-services.elsevier.com/EWSXAbstractsMetadataWebSvc/XAbstractsMetadataServiceV10 HTTP/1.1
Accept: text/xml
Accept: multipart/*
Accept: application/soap
Content-Length: 1033
Content-Type: text/xml; charset=utf-8
SOAPAction:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@robertberry-zz
robertberry-zz / gist:3498151
Created August 28, 2012 13:49
Example citedBy response
<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<Q1:EASIResp xmlns:Q1="http://webservices.elsevier.com/schemas/easi/headers/types/v1">
<TransRespId>
</TransRespId>
<RespId>
</RespId>
<ServerId>22201.XAbstractsMetadata_cert_001</ServerId>
</Q1:EASIResp>
#!/usr/bin/env perl
use DBI;
use Test::More;
my $user; # set these
my $sid;
my $host;
my $pass;
@robertberry-zz
robertberry-zz / gist:2787296
Created May 25, 2012 10:54
Prints for division function
=method prints_for_division
Returns an EPrints results set for all prints in a given division.
=cut
sub prints_for_division {
my ($session, $division) = shift;
my $dataset = $session->get_repository->get_dataset("eprint");
package EPrints::Plugin::Export::Test::HelloExport;
@ISA = ('EPrints::Plugin::Export');
use strict;
sub new
{
my ($class, %opts) = @_;