text:
package org.apache.olingo.odata2.jpa.processor.core.access.data;

import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
import java.io.StringWriter;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.olingo.odata2.api.edm.EdmAssociationEnd;
import org.apache.olingo.odata2.api.edm.EdmException;
import org.apache.olingo.odata2.api.edm.EdmMapping;
import org.apache.olingo.odata2.api.edm.EdmNavigationProperty;
import org.apache.olingo.odata2.api.edm.EdmProperty;
import org.apache.olingo.odata2.api.edm.EdmSimpleType;
import org.apache.olingo.odata2.api.edm.EdmSimpleTypeKind;
import org.apache.olingo.odata2.api.edm.EdmStructuralType;
import org.apache.olingo.odata2.api.edm.EdmTypeKind;
import org.apache.olingo.odata2.jpa.processor.api.exception.ODataJPARuntimeException;
import org.apache.olingo.odata2.jpa.processor.api.model.JPAEdmMapping;
import org.apache.olingo.odata2.jpa.processor.core.model.JPAEdmMappingImpl;

public final class JPAEntityParser {

  /*
   * List of buffers used by the Parser
   */
  private static short MAX_SIZE = 10;
  public static final String ACCESS_MODIFIER_GET = "get";
  public static final String ACCESS_MODIFIER_SET = "set";
  private static final String ACCESS_MODIFIER_IS = "is";

  private HashMap<String, HashMap<String, Method>> jpaEntityAccessMap = null;
  private HashMap<String, HashMap<String, String>> jpaEmbeddableKeyMap = null;

  public JPAEntityParser() {
    jpaEntityAccessMap = new HashMap<String, HashMap<String, Method>>(
        MAX_SIZE);
    jpaEmbeddableKeyMap = new HashMap<String, HashMap<String, String>>();
  };

  public HashMap<String, Method> getJPAEntityAccessMap(final String jpaEntityName) {
    return jpaEntityAccessMap.get(jpaEntityName);
  }

  public HashMap<String, String> getJPAEmbeddableKeyMap(final String jpaEntityName) {
    return jpaEmbeddableKeyMap.get(jpaEntityName);
  }

  public List<Map<String, Object>> parse2EdmEntityList(final Collection<Object> jpaEntityList,
      final List<EdmProperty> properties)
      throws ODataJPARuntimeException {

    if (jpaEntityList == null) {
      return null;
    }
    List<Map<String, Object>> edmEntityList = new ArrayList<Map<String, Object>>();
    for (Object item : jpaEntityList) {
      edmEntityList.add(parse2EdmPropertyValueMap(item, properties));
    }

    return edmEntityList;
  }

  public final HashMap<String, Object> parse2EdmPropertyValueMap(final Object jpaEntity,
      final List<EdmProperty> selectPropertyList) throws ODataJPARuntimeException {

    HashMap<String, Object> edmEntity = new HashMap<String, Object>();
    HashMap<String, Method> accessModifierMap = null;
    Object propertyValue = null;
    String jpaEntityAccessKey = null;

    jpaEntityAccessKey = jpaEntity.getClass().getName();
    if (!jpaEntityAccessMap.containsKey(jpaEntityAccessKey)) {
      accessModifierMap =
          getAccessModifiers((List<EdmProperty>) selectPropertyList, jpaEntity.getClass(), ACCESS_MODIFIER_GET);
    } else {
      accessModifierMap = jpaEntityAccessMap.get(jpaEntityAccessKey);
    }

    for (EdmProperty property : selectPropertyList) {
      propertyValue = jpaEntity;

      try {
        String propertyName = property.getName();
        Method method = accessModifierMap.get(propertyName);
        if (method == null) {
          String methodName = jpaEmbeddableKeyMap.get(jpaEntityAccessKey).get(propertyName);
          if (methodName != null) {
        	  boolean isVirtualAccess = false;
        	  if (property.getMapping() != null && property.getMapping() instanceof JPAEdmMappingImpl) {
        		  isVirtualAccess = ((JPAEdmMappingImpl) property.getMapping()).isVirtualAccess();
        	  }
        	if (isVirtualAccess) {
        		propertyValue = getEmbeddablePropertyValue(methodName, propertyValue, true);
        	} else {
        		propertyValue = getEmbeddablePropertyValue(methodName, propertyValue);
        	}
          }
        } else {
          propertyValue = getPropertyValue(accessModifierMap.get(propertyName), propertyValue, propertyName);
        }
        if (property.getType().getKind()
            .equals(EdmTypeKind.COMPLEX)) {
          propertyValue = parse2EdmPropertyValueMap(propertyValue, (EdmStructuralType) property.getType());
        }
        edmEntity.put(propertyName, propertyValue);
      } catch (EdmException e) {
        throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
      } catch (SecurityException e) {
        throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
      } catch (IllegalArgumentException e) {
        throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
      }
    }

    return edmEntity;
  }

  public final List<Map<String, Object>> parse2EdmEntityList(final Collection<Object> jpaEntityList,
      final EdmStructuralType structuralType) throws ODataJPARuntimeException {
    if (jpaEntityList == null || structuralType == null) {
      return null;
    }
    List<EdmProperty> edmProperties = getEdmProperties(structuralType);
    List<Map<String, Object>> edmEntityList = new ArrayList<Map<String, Object>>();
    for (Object jpaEntity : jpaEntityList) {
      edmEntityList.add(parse2EdmPropertyValueMap(jpaEntity, edmProperties));
    }

    return edmEntityList;
  }

  public final HashMap<String, Object> parse2EdmPropertyValueMap(final Object jpaEntity,
      final EdmStructuralType structuralType) throws ODataJPARuntimeException {
    if (jpaEntity == null || structuralType == null) {
      return null;
    }
    return parse2EdmPropertyValueMap(jpaEntity, getEdmProperties(structuralType));
  }

  public final HashMap<String, Object> parse2EdmNavigationValueMap(
      final Object jpaEntity, final List<EdmNavigationProperty> navigationPropertyList)
      throws ODataJPARuntimeException {
    Object result = null;
    String methodName = null;
    HashMap<String, Object> navigationMap = new HashMap<String, Object>();
    if (jpaEntity == null) {
      return navigationMap;
    }
    if (navigationPropertyList != null
        && navigationPropertyList.size() != 0) {

    	try {
    		for (EdmNavigationProperty navigationProperty : navigationPropertyList) {
    			methodName = getAccessModifierName(navigationProperty.getName(),
    					navigationProperty.getMapping(), ACCESS_MODIFIER_GET);
    			Method getterMethod = null;
    			JPAEdmMapping jpaEdmMapping = (JPAEdmMapping)navigationProperty.getMapping();
    			if(jpaEdmMapping != null && jpaEdmMapping.isVirtualAccess()) {
    				getterMethod = jpaEntity.getClass().getMethod(ACCESS_MODIFIER_GET, String.class);
    			}else{
    				getterMethod = jpaEntity.getClass()
    						.getMethod(methodName, (Class<?>[]) null);
    			}

    			getterMethod.setAccessible(true);
    			result = getPropertyValue(getterMethod, jpaEntity,
    					navigationProperty.getMapping().getInternalName());
    			navigationMap.put(navigationProperty.getName(), result);
    		}
    	} catch (IllegalArgumentException e) {
        throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
      } catch (EdmException e) {
        throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
      } catch (SecurityException e) {
        throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
      } catch (NoSuchMethodException e) {
        throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
      }
    }
    return navigationMap;
  }

  public Method getAccessModifierSet(final Object jpaEntity, final String methodName) throws ODataJPARuntimeException {
    Class<?> jpaType = jpaEntity.getClass();
    String methodNameGet = ACCESS_MODIFIER_GET + methodName.substring(3);
    Method method = null;

    try {
      method = jpaType.getMethod(methodNameGet, (Class<?>[]) null);
      Class<?> parameterType = method.getReturnType();
      method = jpaType.getMethod(methodName, new Class<?>[] { parameterType });
    } catch (NoSuchMethodException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
    } catch (SecurityException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
    }

    return method;
  }

  public HashMap<String, Method> getAccessModifiers(final Object jpaEntity,
      final EdmStructuralType structuralType, final String accessModifier) throws ODataJPARuntimeException {
    return getAccessModifiers(getEdmProperties(structuralType), jpaEntity.getClass(), accessModifier);
  }

  public static Object getPropertyValue(final Method method, final Object entity, String propertyName)
		  throws ODataJPARuntimeException {
    Object propertyValue = null;
    if (method == null) {
      return null;
    }
    try {
      method.setAccessible(true);
      Class<?> returnType = method.getReturnType();

      if (returnType.equals(char[].class)) {
        char[] ch = (char[]) method.invoke(entity);
        if (ch != null) {
          propertyValue = (String) String.valueOf((char[]) method.invoke(entity));
        }
      } else if (returnType.equals(Character[].class)) {
        propertyValue = (String) toString((Character[]) method.invoke(entity));
      } else if (returnType.equals(char.class)) {
        char c = (Character) method.invoke(entity);
        if (c != '\u0000') {
          propertyValue = (String) String.valueOf(c);
        }
      } else if (returnType.equals(Character.class)) {
        Character c = (Character) method.invoke(entity);
        if (c != null) {
          propertyValue = toString(new Character[] { c });
        }
      } else if (returnType.equals(Blob.class)) {
        propertyValue = getBytes((Blob) method.invoke(entity));
      } else if (returnType.equals(Clob.class)) {
        propertyValue = getString((Clob) method.invoke(entity));
      } else {
    	  if(method.getParameterTypes().length>0) {
    		  propertyValue = method.invoke(entity,propertyName);
    	  } else {
    		  propertyValue = method.invoke(entity);
    	  }
      }
    } catch (IllegalAccessException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
    } catch (IllegalArgumentException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
    } catch (InvocationTargetException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
    } catch (SecurityException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
    }

    return propertyValue;
  }

  public static String getString(final Clob clob) throws ODataJPARuntimeException {
    Reader stringReader = null;
    try {

      if (clob == null) {
        return null;
      }

      stringReader = clob.getCharacterStream();
      StringWriter buffer = null;
      long clobSize = clob.length();
      long remainingClobSize = clobSize;
      int len = 0;
      int off = 0;
      boolean bufferNotEmpty = false;
      if (clobSize > Integer.MAX_VALUE) {
        buffer = new StringWriter(Integer.MAX_VALUE);
        len = Integer.MAX_VALUE;
        bufferNotEmpty = true;
      } else {
        buffer = new StringWriter((int) clobSize);
        len = (int) clobSize;
      }
      char c[] = new char[len];
      while (remainingClobSize > len) {
        stringReader.read(c, off, len);
        buffer.write(c);
        off = len + 1;
        remainingClobSize = remainingClobSize - Integer.MAX_VALUE;
        if (remainingClobSize > Integer.MAX_VALUE) {
          len = Integer.MAX_VALUE;
        } else {
          len = (int) remainingClobSize;
        }
      }
      if (remainingClobSize <= len) {
        stringReader.read(c, off, len);
      }
      if (bufferNotEmpty) {
        return buffer.toString();
      } else {
        return new String(c);
      }

    } catch (SQLException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
    } catch (IOException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
    } finally {
      if (stringReader != null) {
        try {
          stringReader.close();
        } catch (IOException e) {
          //do nothing
        }
      }
    }

  }

  public static byte[] getBytes(final Blob blob) throws ODataJPARuntimeException {
    InputStream is = null;
    ByteArrayOutputStream buffer = null;
    try {

      if (blob == null) {
        return null;
      }

      long blobSize = blob.length();
      long remainingBlobSize = blobSize;
      int len = 0;
      int off = 0;
      boolean bufferNotEmpty = false;
      if (blobSize > Integer.MAX_VALUE) { // Edge case when the Blob Size is more than 2GB
        buffer = new ByteArrayOutputStream(Integer.MAX_VALUE);
        len = Integer.MAX_VALUE;
        bufferNotEmpty = true;
      } else {
        buffer = new ByteArrayOutputStream((int) blobSize);
        len = (int) blobSize;
      }

      is = blob.getBinaryStream();
      byte b[] = new byte[len];
      while (remainingBlobSize > len) {
        is.read(b, off, len);
        buffer.write(b);
        off = len + 1;
        remainingBlobSize = remainingBlobSize - Integer.MAX_VALUE;
        if (remainingBlobSize > Integer.MAX_VALUE) {
          len = Integer.MAX_VALUE;
        } else {
          len = (int) remainingBlobSize;
        }
      }
      if (remainingBlobSize <= len) {
        is.read(b, off, len);
      }
      if (bufferNotEmpty) {
        return buffer.toByteArray();
      } else {
        return b;
      }
    } catch (SQLException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
    } catch (IOException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
    } finally {
      if (is != null) {
        try {
          is.close();
        } catch (IOException e) {
          // do nothing
        }
      }
    }
  }

  public Object getEmbeddablePropertyValue(final String methodName, final Object jpaEntity, boolean isVirtualAccess)
      throws ODataJPARuntimeException {

    String[] nameParts = methodName.split("\\.");
    Object propertyValue = jpaEntity;
    Method method = null;
    try {
      for (String namePart : nameParts) {
        if (propertyValue == null) {
          break;
        }
        if (isVirtualAccess) {

        	method = propertyValue.getClass().getMethod(ACCESS_MODIFIER_GET, String.class);
        	namePart = namePart.replaceFirst(ACCESS_MODIFIER_GET, "");
        } else {
        	method = propertyValue.getClass().getMethod(namePart, (Class<?>[]) null);
        }
        method.setAccessible(true);
        propertyValue = getPropertyValue(method, propertyValue,namePart);
      }
    } catch (NoSuchMethodException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
    } catch (SecurityException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
    }
    return propertyValue;
  }

  public Object getEmbeddablePropertyValue(final String methodName, final Object jpaEntity)
	      throws ODataJPARuntimeException {

	  return getEmbeddablePropertyValue(methodName, jpaEntity, false);
  }

  public static String toString(final Character[] input) {
    if (input == null) {
      return null;
    }

    StringBuilder builder = new StringBuilder();
    for (Character element : input) {
      if (element == null) {
        continue;
      }
      builder.append(element.charValue());
    }
    return builder.toString();

  }

  public static Character[] toCharacterArray(final String input) {
    if (input == null) {
      return null;
    }

    Character[] characters = new Character[input.length()];
    char[] chars = ((String) input).toCharArray();
    for (int i = 0; i < input.length(); i++) {
      characters[i] = new Character(chars[i]);
    }

    return characters;
  }

  public static String getAccessModifierName(final String propertyName, final EdmMapping mapping,
      final String accessModifier)
      throws ODataJPARuntimeException {
    String name = null;
    StringBuilder builder = new StringBuilder();
    String[] nameParts = {};
    if (mapping == null || mapping.getInternalName() == null) {
      name = propertyName;
    } else {
      name = mapping.getInternalName();
    }
    if (name != null) {
      nameParts = name.split("\\.");
    }
    if (nameParts.length == 1) {
      if (name != null) {
        char c = Character.toUpperCase(name.charAt(0));

        builder.append(accessModifier).append(c).append(name.substring(1))
            .toString();
      }
    } else if (nameParts.length > 1) {

      for (int i = 0; i < nameParts.length; i++) {
        name = nameParts[i];
        char c = Character.toUpperCase(name.charAt(0));
        if (i == 0) {
          builder.append(accessModifier).append(c).append(name.substring(1));
        } else {
          builder.append(".").append(accessModifier).append(c)
              .append(name.substring(1));
        }
      }
    } else {
      return null;
    }

    if (builder.length() > 0) {
      return builder.toString();
    } else {
      return null;
    }

  }

  public Method getAccessModifier(final Class<?> jpaEntityType, final EdmNavigationProperty navigationProperty,
      final String accessModifier)
      throws ODataJPARuntimeException {

    try {

      JPAEdmMapping navPropMapping = (JPAEdmMapping) navigationProperty.getMapping();

      String name;
      Class<?>[] params = null;
      if (navPropMapping != null && navPropMapping.isVirtualAccess()) {

    	  return jpaEntityType.getMethod(ACCESS_MODIFIER_SET, String.class, Object.class);
      } else {
	      name = getAccessModifierName(navigationProperty.getName(), (EdmMapping) navPropMapping, accessModifier);

	      if (accessModifier.equals(ACCESS_MODIFIER_SET)) {
	        EdmAssociationEnd end = navigationProperty.getRelationship().getEnd(navigationProperty.getToRole());
	        switch (end.getMultiplicity()) {
	        case MANY:
	          params = new Class<?>[] { navPropMapping.getJPAType() };
	          break;
	        case ONE:
	          params = new Class<?>[] { ((JPAEdmMapping) end.getEntityType().getMapping()).getJPAType() };
	        default:
	          break;
	        }
	      }
	      return jpaEntityType.getMethod(name, params);
      }

    } catch (NoSuchMethodException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
    } catch (SecurityException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
    } catch (EdmException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
    }
  }

  private HashMap<String, Method> getAccessModifiers(final List<EdmProperty> edmProperties,
      final Class<?> jpaEntityType,
      final String accessModifier) throws ODataJPARuntimeException {

    HashMap<String, Method> accessModifierMap = jpaEntityAccessMap.get(jpaEntityType.getName());
    if (accessModifierMap == null) {
      accessModifierMap = new HashMap<String, Method>();
      jpaEntityAccessMap.put(jpaEntityType.getName(), accessModifierMap);
    }
    HashMap<String, String> embeddableKey = jpaEmbeddableKeyMap.get(jpaEntityType.getName());
    if (embeddableKey == null) {
      embeddableKey = new HashMap<String, String>();
    }

    Method method = null;
    try {
      for (EdmProperty property : edmProperties) {
        String propertyName = property.getName();
        if (accessModifierMap.containsKey(propertyName)) {
          continue;
        }
        String methodName = getAccessModifierName(property.getName(), property.getMapping(), accessModifier);
        String[] nameParts = methodName.split("\\.");
        try {
          if (nameParts.length > 1) {
            if (!embeddableKey.containsKey(propertyName)) {
              embeddableKey.put(propertyName, methodName);
              continue;
            }
          } else {
        	  if (accessModifier.equals(ACCESS_MODIFIER_SET)) {
        		  JPAEdmMapping jpaEdmMapping = (JPAEdmMapping) property.getMapping();
        		  if(jpaEdmMapping != null && jpaEdmMapping.isVirtualAccess()) {
        			  accessModifierMap.put(propertyName, jpaEntityType.getMethod(ACCESS_MODIFIER_SET,
        					  new Class<?>[] { String.class,Object.class }));
        		  }else {
        			  accessModifierMap.put(propertyName, jpaEntityType.getMethod(methodName,
        					  new Class<?>[] { jpaEdmMapping.getJPAType() }));
        		  }
        	  } else {
        		  JPAEdmMapping jpaEdmMapping = (JPAEdmMapping) property.getMapping();
        		  if(jpaEdmMapping != null && jpaEdmMapping.isVirtualAccess()) {
        			  method = jpaEntityType.getMethod(ACCESS_MODIFIER_GET, String.class);
        		  }else{
        			  method = jpaEntityType.getMethod(methodName, (Class<?>[]) null);
        		  }
        	  }
          }
        } catch (EdmException exp) {
          throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, exp);
        } catch (NoSuchMethodException e1) {
          try {
            EdmSimpleType edmSimpleType = (EdmSimpleType) property.getType();
            if (edmSimpleType == EdmSimpleTypeKind.Boolean.getEdmSimpleTypeInstance()
                && accessModifier.equals(ACCESS_MODIFIER_GET)) {
              String nameWithIs = getAccessModifierName(property.getName(),
                  property.getMapping(), ACCESS_MODIFIER_IS);
              method = jpaEntityType.getMethod(nameWithIs, (Class<?>[]) null);
            } else {
              throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e1);
            }
          } catch (EdmException exp) {
            throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, exp);
          } catch (NoSuchMethodException exp) {
            throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, exp);
          } catch (SecurityException exp) {
            throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, exp);
          }
        } catch (SecurityException e1) {
          throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e1);
        }
        if (method != null) {
          accessModifierMap.put(propertyName, method);
        }
      }
    } catch (EdmException exp) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, exp);
    }
    if (!embeddableKey.isEmpty()) {
      jpaEmbeddableKeyMap.put(jpaEntityType.getName(), embeddableKey);
    }
    return accessModifierMap;
  }

  private List<EdmProperty> getEdmProperties(final EdmStructuralType structuralType) throws ODataJPARuntimeException {
    List<EdmProperty> edmProperties = new ArrayList<EdmProperty>();
    try {
      for (String propertyName : structuralType.getPropertyNames()) {
        edmProperties.add((EdmProperty) structuralType.getProperty(propertyName));
      }
    } catch (EdmException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.INNER_EXCEPTION, e);
    }
    return edmProperties;
  }

}


text:
namespace scheduler {
class RendererScheduler;
}

namespace content {

// Utility class for throttling a stream of resource requests targetted to a
// specific IPC sender. The throttling itself is very basic:
//  * When there is no high-priority work imminent to the main thread, as
//    indicated by the RendererScheduler, throttling is disabled.
//  * When >= N requests have been sent in a given time window, requests are
//    throttled. A timer periodically flushes a portion of the queued requests
//    until all such requests have been flushed.
// TODO(jdduke): Remove this class after resource requests become sufficiently
// cheap on the IO thread, crbug.com/440037.
class CONTENT_EXPORT ResourceDispatchThrottler : public IPC::Sender {
 public:
  // |flush_period| and |max_requests_per_flush| must be strictly positive
  // in duration/value.
  ResourceDispatchThrottler(IPC::Sender* proxied_sender,
                            scheduler::RendererScheduler* scheduler,
                            base::TimeDelta flush_period,
                            uint32_t max_requests_per_flush);
  ~ResourceDispatchThrottler() override;

  // IPC::Sender implementation:
  bool Send(IPC::Message* msg) override;

 private:
  friend class ResourceDispatchThrottlerForTest;

  // Virtual for testing.
  virtual base::TimeTicks Now() const;
  virtual void ScheduleFlush();

  void Flush();
  void FlushAll();
  void LogFlush();
  bool ForwardMessage(IPC::Message* msg);

  base::ThreadChecker thread_checker_;

  IPC::Sender* const proxied_sender_;
  scheduler::RendererScheduler* const scheduler_;
  const base::TimeDelta flush_period_;
  const uint32_t max_requests_per_flush_;

  base::Timer flush_timer_;
  base::TimeTicks last_flush_time_;
  uint32_t sent_requests_since_last_flush_;
  std::deque<IPC::Message*> throttled_messages_;

  DISALLOW_COPY_AND_ASSIGN(ResourceDispatchThrottler);
};

}  // namespace content

#endif  // CONTENT_RENDERER_SCHEDULER_RESOURCE_DISPATCH_THROTTLER_H_

redpajama_set_name: RedPajamaGithub


text:
package policy

import (
	"testing"

	"github.com/hyperledger/fabric-protos-go/common"
	"github.com/hyperledger/fabric-protos-go/peer"
	"github.com/hyperledger/fabric/common/cauthdsl"
	"github.com/hyperledger/fabric/core/policy/mocks"
	"github.com/hyperledger/fabric/msp"
	"github.com/hyperledger/fabric/protoutil"
	"github.com/pkg/errors"
	"github.com/stretchr/testify/assert"
	"github.com/stretchr/testify/mock"
)

func TestComponentIntegrationSignaturePolicyEnv(t *testing.T) {
	idds := &mocks.IdentityDeserializer{}
	id := &mocks.Identity{}

	spp := &cauthdsl.EnvelopeBasedPolicyProvider{
		Deserializer: idds,
	}
	ev := &ApplicationPolicyEvaluator{
		signaturePolicyProvider: spp,
	}

	spenv := cauthdsl.SignedByMspMember("msp")
	mspenv := protoutil.MarshalOrPanic(&peer.ApplicationPolicy{
		Type: &peer.ApplicationPolicy_SignaturePolicy{
			SignaturePolicy: spenv,
		},
	})

	idds.On("DeserializeIdentity", []byte("guess who")).Return(id, nil)
	id.On("GetIdentifier").Return(&msp.IdentityIdentifier{Id: "id", Mspid: "msp"})
	id.On("SatisfiesPrincipal", mock.Anything).Return(nil)
	id.On("Verify", []byte("batti"), []byte("lei")).Return(nil)
	err := ev.Evaluate(mspenv, []*protoutil.SignedData{{
		Identity:  []byte("guess who"),
		Data:      []byte("batti"),
		Signature: []byte("lei"),
	}})
	assert.NoError(t, err)
}

func TestEvaluator(t *testing.T) {
	okEval := &mocks.Policy{}
	nokEval := &mocks.Policy{}

	okEval.On("EvaluateSignedData", mock.Anything).Return(nil)
	nokEval.On("EvaluateSignedData", mock.Anything).Return(errors.New("bad bad"))

	spp := &mocks.SignaturePolicyProvider{}
	cpp := &mocks.ChannelPolicyReferenceProvider{}
	ev := &ApplicationPolicyEvaluator{
		signaturePolicyProvider:        spp,
		channelPolicyReferenceProvider: cpp,
	}

	// SCENARIO: bad policy argument

	err := ev.Evaluate([]byte("bad bad"), nil)
	assert.Error(t, err)
	assert.Contains(t, err.Error(), "failed to unmarshal ApplicationPolicy bytes")

	// SCENARIO: bad policy type

	err = ev.Evaluate([]byte{}, nil)
	assert.Error(t, err)
	assert.Contains(t, err.Error(), "unsupported policy type")

	// SCENARIO: signature policy supplied - good and bad path

	spenv := &common.SignaturePolicyEnvelope{}
	mspenv := protoutil.MarshalOrPanic(&peer.ApplicationPolicy{
		Type: &peer.ApplicationPolicy_SignaturePolicy{
			SignaturePolicy: spenv,
		},
	})
	spp.On("NewPolicy", spenv).Return(okEval, nil).Once()
	err = ev.Evaluate(mspenv, nil)
	assert.NoError(t, err)
	spp.On("NewPolicy", spenv).Return(nokEval, nil).Once()
	err = ev.Evaluate(mspenv, nil)
	assert.Error(t, err)
	assert.Contains(t, err.Error(), "bad bad")
	spp.On("NewPolicy", spenv).Return(nil, errors.New("bad policy")).Once()
	err = ev.Evaluate(mspenv, nil)
	assert.Error(t, err)
	assert.Contains(t, err.Error(), "bad policy")

	// SCENARIO: channel ref policy supplied - good and bad path

	chrefstr := "Quo usque tandem abutere, Catilina, patientia nostra?"
	chrefstrEnv := protoutil.MarshalOrPanic(&peer.ApplicationPolicy{
		Type: &peer.ApplicationPolicy_ChannelConfigPolicyReference{
			ChannelConfigPolicyReference: chrefstr,
		},
	})
	cpp.On("NewPolicy", chrefstr).Return(okEval, nil).Once()
	err = ev.Evaluate(chrefstrEnv, nil)
	assert.NoError(t, err)
	cpp.On("NewPolicy", chrefstr).Return(nokEval, nil).Once()
	err = ev.Evaluate(chrefstrEnv, nil)
	assert.Error(t, err)
	assert.Contains(t, err.Error(), "bad bad")
	cpp.On("NewPolicy", chrefstr).Return(nil, errors.New("bad policy")).Once()
	err = ev.Evaluate(chrefstrEnv, nil)
	assert.Error(t, err)
	assert.Contains(t, err.Error(), "bad policy")
}

func TestChannelPolicyReference(t *testing.T) {
	mcpmg := &mocks.ChannelPolicyManagerGetter{}
	mcpmg.On("Manager", "channel").Return(nil, false).Once()
	ape, err := New(nil, "channel", mcpmg)
	assert.Error(t, err)
	assert.Nil(t, ape)
	assert.Contains(t, err.Error(), "failed to retrieve policy manager for channel")

	mm := &mocks.PolicyManager{}
	mcpmg.On("Manager", "channel").Return(mm, true).Once()
	ape, err = New(nil, "channel", mcpmg)
	assert.NoError(t, err)
	assert.NotNil(t, ape)

	mcpmg.On("Manager", "channel").Return(mm, true)

	mp := &mocks.Policy{}
	mp.On("EvaluateSignedData", mock.Anything).Return(nil)
	mm.On("GetPolicy", "As the sun breaks above the ground").Return(mp, true)
	err = ape.evaluateChannelConfigPolicyReference("As the sun breaks above the ground", nil)
	assert.NoError(t, err)

	mm.On("GetPolicy", "An old man stands on the hill").Return(nil, false)
	err = ape.evaluateChannelConfigPolicyReference("An old man stands on the hill", nil)
	assert.Error(t, err)
	assert.Contains(t, err.Error(), "failed to retrieve policy for reference")
}


text:
<?php
namespace ssh;

// message types
const SSH_MSG_DISCONNECT = 1;
const SSH_MSG_IGNORE = 2;
const SSH_MSG_UNIMPLEMENTED = 3;
const SSH_MSG_DEBUG = 4;
const SSH_MSG_SERVICE_REQUEST = 5;
const SSH_MSG_SERVICE_ACCEPT = 6;
const SSH_MSG_KEXINIT = 20;
const SSH_MSG_NEWKEYS = 21;
const SSH_MSG_KEXDH_INIT = 30;
const SSH_MSG_KEXDH_REPLY = 31;
const SSH_MSG_USERAUTH_REQUEST = 50;
const SSH_MSG_USERAUTH_FAILURE = 51;
const SSH_MSG_USERAUTH_SUCCESS = 52;
const SSH_MSG_USERAUTH_BANNER = 53;
const SSH_MSG_USERAUTH_PASSWD_CHANGEREQ = 60;
const SSH_MSG_USERAUTH_PK_OK = 60;
const SSH_MSG_GLOBAL_REQUEST = 80;
const SSH_MSG_REQUEST_SUCCESS = 81;
const SSH_MSG_REQUEST_FAILURE = 82;
const SSH_MSG_CHANNEL_OPEN = 90;
const SSH_MSG_CHANNEL_OPEN_CONFIRMATION = 91;
const SSH_MSG_CHANNEL_OPEN_FAILURE = 92;
const SSH_MSG_CHANNEL_WINDOW_ADJUST = 93;
const SSH_MSG_CHANNEL_DATA = 94;
const SSH_MSG_CHANNEL_EXTENDED_DATA = 95;
const SSH_MSG_CHANNEL_EOF = 96;
const SSH_MSG_CHANNEL_CLOSE = 97;
const SSH_MSG_CHANNEL_REQUEST = 98;
const SSH_MSG_CHANNEL_SUCCESS = 99;
const SSH_MSG_CHANNEL_FAILURE = 100;

// disconnect reasons
const SSH_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT = 1;
const SSH_DISCONNECT_PROTOCOL_ERROR = 2;
const SSH_DISCONNECT_KEY_EXCHANGE_FAILED = 3;
const SSH_DISCONNECT_RESERVED = 4;
const SSH_DISCONNECT_MAC_ERROR = 5;
const SSH_DISCONNECT_COMPRESSION_ERROR = 6;
const SSH_DISCONNECT_SERVICE_NOT_AVAILABLE = 7;
const SSH_DISCONNECT_PROTOCOL_VERSION_NOT_SUPPORTED = 8;
const SSH_DISCONNECT_HOST_KEY_NOT_VERIFIABLE = 9;
const SSH_DISCONNECT_CONNECTION_LOST = 10;
const SSH_DISCONNECT_BY_APPLICATION = 11;
const SSH_DISCONNECT_TOO_MANY_CONNECTIONS = 12;
const SSH_DISCONNECT_AUTH_CANCELLED_BY_USER = 13;
const SSH_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE = 14;
const SSH_DISCONNECT_ILLEGAL_USER_NAME = 15;

// open failure reasons
const SSH_OPEN_ADMINISTRATIVELY_PROHIBITED = 1;
const SSH_OPEN_CONNECT_FAILED = 2;
const SSH_OPEN_UNKNOWN_CHANNEL_TYPE = 3;
const SSH_OPEN_RESOURCE_SHORTAGE = 4;

// channel extended data
const SSH_EXTENDED_DATA_STDERR = 1;


text:
namespace So.Wpf.Shapes
{
    using System.ComponentModel;
    using System.Windows;
    using System.Windows.Media;
    using System.Windows.Shapes;
    public class Arrow : Shape
    {
        public static readonly DependencyProperty LengthProperty = DependencyProperty.Register(
            "Length",
            typeof(double),
            typeof(Arrow),
            new PropertyMetadata(10.0, OnGeometryChanged));

        public static readonly DependencyProperty ShaftWidthProperty = DependencyProperty.Register(
            "ShaftWidth",
            typeof(double),
            typeof(Arrow),
            new PropertyMetadata(3.0, OnGeometryChanged));

        public static readonly DependencyProperty HeadWidthProperty = DependencyProperty.Register(
            "HeadWidth",
            typeof(double),
            typeof(Arrow),
            new PropertyMetadata(6.0, OnGeometryChanged));

        static Arrow()
        {
            Shape.StretchProperty.OverrideMetadata(typeof(Arrow), (PropertyMetadata)new FrameworkPropertyMetadata((object)Stretch.None));
        }

        [Category("Appearance")]
        public double Length
        {
            get { return (double)GetValue(LengthProperty); }
            set { SetValue(LengthProperty, value); }
        }

        [Category("Appearance")]
        public double ShaftWidth
        {
            get { return (double)GetValue(ShaftWidthProperty); }
            set { SetValue(ShaftWidthProperty, value); }
        }

        [Category("Appearance")]
        public double HeadWidth
        {
            get { return (double)GetValue(HeadWidthProperty); }
            set { SetValue(HeadWidthProperty, value); }
        }
        protected override Geometry DefiningGeometry
        {
            get
            {
                // Create a StreamGeometry for describing the shape
                StreamGeometry geometry = new StreamGeometry();
                geometry.FillRule = FillRule.EvenOdd;

                using (StreamGeometryContext context = geometry.Open())
                {
                    double y1 = (HeadWidth / 2) - (ShaftWidth / 2);
                    double x1 = Length - (HeadWidth / 2);
                    double y2 = (HeadWidth / 2) + (ShaftWidth / 2);
                    ScaleTransform scaleTransform;
                    scaleTransform = Width * Height > 0
                        ? new ScaleTransform(Width / Length, Height / HeadWidth)
                        : new ScaleTransform(1, 1);
                    var startPoint = scaleTransform.Transform(new Point(0, y1));
                    var p1 = scaleTransform.Transform(new Point(x1, y1));
                    var p2 = scaleTransform.Transform(new Point(x1, 0));
                    var p3 = scaleTransform.Transform(new Point(Length, HeadWidth / 2));
                    var p4 = scaleTransform.Transform(new Point(x1, HeadWidth));
                    var p5 = scaleTransform.Transform(new Point(x1, y2));
                    var p6 = scaleTransform.Transform(new Point(0, y2));

                    context.BeginFigure(startPoint, true, true);
                    context.LineTo(p1, true, true);
                    context.LineTo(p2, true, true);
                    context.LineTo(p3, true, true);
                    context.LineTo(p4, true, true);
                    context.LineTo(p5, true, true);
                    context.LineTo(p6, true, true);
                    context.Close();
                }

                // Freeze the geometry for performance benefits
                geometry.Freeze();
                return geometry;
            }
        }
        private static void OnGeometryChanged(DependencyObject d, DependencyPropertyChangedEventArgs ek)
        {
            Arrow arrow = (Arrow)d;
            arrow.InvalidateVisual();
        }
    }
}


text:
<?php
/**
 * test
 * @author  sunlijun <csljsun@gmail.com>
 * @date 2016-05-13
 * @since 1.0 [<description>]
 */

class TestTask extends \Phalcon\Cli\Task {

    public function testAction(array $params) {
        echo sprintf('hello %s', $params[0]) . PHP_EOL;
        echo sprintf('best regards, %s', $params[1]) . PHP_EOL;
    }
}


text:
package org.jboss.aerogear.unifiedpush.service.impl.health;

import static org.assertj.core.api.Assertions.assertThat;

import org.junit.Test;

public class PingTest {

    @Test
    public void testIsReachable() throws Exception {
        //given
        String host = "google.com";

        //when
        final boolean reachable = Ping.isReachable(host, 80);

        //then
        assertThat(reachable).isTrue();
    }
}


text:
set -o errexit -o nounset -o pipefail

# Install base packages

: ${ROOTFS:?"ERROR: ROOTFS must be set"}

cp -r /etc/yum.repos.d "${ROOTFS}/etc"

yum --installroot="${ROOTFS}" --nogpgcheck -t -y groupinstall core
yum --installroot="${ROOTFS}" --nogpgcheck -t -y install openssh-server grub2 tuned kernel chrony
yum --installroot="${ROOTFS}" --nogpgcheck -t -y install cloud-init cloud-utils-growpart

yum --installroot="${ROOTFS}" -C -t -y remove NetworkManager firewalld --setopt="clean_requirements_on_remove=1"


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>Using with Subversion (paver.svn) — Paver 1.1.0 documentation</title>

    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />

    <link rel="top" title="Paver 1.1.0 documentation" href="index.html" />
    <link rel="up" title="The Paver Standard Library" href="paverstdlib.html" />
    <link rel="next" title="Using with Bazaar-NG (bzr) (paver.bzr)" href="bzr.html" />
    <link rel="prev" title="Virtualenv Support (paver.virtual)" href="virtualenv.html" />

Navigation

          index

          modules |

          next |

          previous |

Paver 1.1.0 documentation »

The Paver Standard Library »

Using with Subversion (paver.svn)¶

Convenience functions for working with svn.

This module does not include any tasks, only functions.

At this point, these functions do not use any kind of library. They require
the svn binary on the path.

<tt class="descclassname">paver.svn.</tt><tt class="descname">checkout</tt><big>(</big>url, dest, revision=''<big>)</big>¶

Checks out the specified URL to the given destination.

<tt class="descclassname">paver.svn.</tt><tt class="descname">checkup</tt><big>(</big>url, dest, revision=''<big>)</big>¶

Does a checkout or update, depending on whether the destination
exists and is up to date (if a revision is passed in). Returns
true if a checkout or update was performed. False otherwise.

<tt class="descclassname">paver.svn.</tt><tt class="descname">export</tt><big>(</big>url, dest, revision=''<big>)</big>¶

Exports the specified URL to the given destination.

<tt class="descclassname">paver.svn.</tt><tt class="descname">info</tt><big>(</big>path=''<big>)</big>¶

Retrieves the svn info for the path and returns a dictionary of
the values. Names are normalized to lower case with spaces converted
to underscores.

<tt class="descclassname">paver.svn.</tt><tt class="descname">update</tt><big>(</big>path='', revision=''<big>)</big>¶

Run an svn update on the given path.

Previous topic

Virtualenv Support (paver.virtual)

Next topic

Using with Bazaar-NG (bzr) (paver.bzr)

This Page

Show Source

Quick search

    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

    Enter search terms or a module, class or function name.

Navigation

          index

          modules |

          next |

          previous |

Paver 1.1.0 documentation »

The Paver Standard Library »

        © Copyright 2008, SitePen, Inc..
      Last updated on Jul 30, 2012.
      Created using Sphinx 1.1.3.


text:
/*
 Currently, to reach the first milestone, the ajax-based-page-loading will not be implemented. In the first version
 page loading will be conventional to reduce complexity. In the future, when ajax-based-loading is implemented, the
 page could look something like the following:

require(['jquery', 'ko', 'uberlearner/js/courses/page/list/viewmodel', 'bootstrap'], function($, ko, viewModelFactory) {
    $(function() {
        ko.applyBindings(viewModelFactory()); //we apply the view-model page-wide for now
    });
});
*/

require(['jquery', 'bootstrap', 'uberlearner/js/utils/bindings/url-list', 'uberlearner/js/utils/messages/viewmodel'], function($) {

});


text:
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using log4net;
using log4net.Appender;
using log4net.Config;
using log4net.Repository.Hierarchy;
using MbUnit.Framework;
using Rhino.Commons.Logging;

namespace Rhino.Commons.Test
{
    using Util;

    [TestFixture]
    public class WithLogTests
    {
        [SetUp]
        public void TestInitialize()
        {
            //turn on log4net logging (and supress output to console)
            BasicConfigurator.Configure(new MemoryAppender());
        }

        [TearDown]
        public void TestCleanup()
        {
            LogManager.ResetConfiguration();
        }

        [Test]
        public void NoOpWillReturnEmptyCollection()
        {
            bool called = false;
            ICollection<string> logMessages = With.Log("SomeLogger", delegate
            {
                called = true;
            });

            Assert.IsTrue(called);
            Assert.IsTrue(logMessages.Count == 0);
        }

        [Test]
        public void WillReturnDebugLogEntryMessagesAndAbove()
        {
            ILog log = LogManager.GetLogger("SomeLog");

            string debugMessage = "Some debug message";
            string fatalMessage = "Some fatal message";
            IList<string> logMessages = With.Log(log.Logger.Name, delegate
            {
                log.Debug(debugMessage);
                log.Fatal(fatalMessage);
            });

            Assert.AreEqual(2, logMessages.Count);
            Assert.AreEqual(debugMessage, logMessages[0]);
            Assert.AreEqual(fatalMessage, logMessages[1]);
        }

        [Test]
        public void WillAcceptATypeAsTheLoggerParameter()
        {
            ILog log = LogManager.GetLogger(GetType());

            string debugMessage = "Some debug message";
            IList<string> logMessages = With.Log(GetType(), delegate
            {
                log.Debug(debugMessage);
            });

            Assert.AreEqual(1, logMessages.Count);
        }

        [Test]
        public void SafeToUseMultipleTimes()
        {
            ILog log = LogManager.GetLogger("SomeLog");

            With.Log(log.Logger.Name, delegate
            {
                log.Debug("Some debug message");
            });

            string debugMessage = "Another debug message";
            IList<string> logMessages = With.Log(log.Logger.Name, delegate
            {
                log.Debug(debugMessage);
            });

            Assert.AreEqual(1, logMessages.Count);
            Assert.AreEqual(debugMessage, logMessages[0]);
        }

        [Test]
        public void GotchaWillTurnOffLoggingAfterDispose()
        {
            ILog log = LogManager.GetLogger("SomeLog");

            With.Log(log.Logger.Name, delegate { });

            //wire up a new appender to listen to log entries
            InMemoryMessageAppender appender = new InMemoryMessageAppender();
            ((Logger)log.Logger).AddAppender(appender);

            log.Info("This messgae will go into the blackhole");

            Assert.IsTrue(appender.Messages.Count == 0);

        }
    }
}


text:
#include <QVariant>

#include "standard_list_widget_item.h"
#include "data_resource.h"

StandardListWidgetItem :: StandardListWidgetItem (const QString &text_r, QListWidget *parent_p, int type)
: QListWidgetItem (text_r, parent_p, type)
{

}

StandardListWidgetItem :: ~StandardListWidgetItem ()
{

}

void StandardListWidgetItem :: ShowData ()
{
	QVariant v = data (Qt :: UserRole);
	QString s = v.toString ();
	QByteArray ba = s.toLocal8Bit ();
	const char *value_s = ba.constData ();

	if ((s.startsWith (PROTOCOL_IRODS_S))  || (s.startsWith (PROTOCOL_FILE_S)))
		{

		}
	else if ((s.startsWith (PROTOCOL_HTTP_S))  || (s.startsWith (PROTOCOL_HTTPS_S)))
		{
			emit WebLinkSelected (value_s);
		}
}


text:
/*
 * MinIO Cloud Storage, (C) 2019 MinIO, Inc.
 *
 * 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.
 */

package csv

import (
	"encoding/json"
	"errors"
	"fmt"
	"io"

	"github.com/bcicen/jstream"
	csv "github.com/minio/minio/pkg/csvparser"
	"github.com/minio/minio/pkg/s3select/sql"
)

// Record - is a CSV record.
type Record struct {
	columnNames  []string
	csvRecord    []string
	nameIndexMap map[string]int64
}

// Get - gets the value for a column name. CSV fields do not have any
// defined type (other than the default string). So this function
// always returns fields using sql.FromBytes so that the type
// specified/implied by the query can be used, or can be automatically
// converted based on the query.
func (r *Record) Get(name string) (*sql.Value, error) {
	index, found := r.nameIndexMap[name]
	if !found {
		return nil, fmt.Errorf("column %v not found", name)
	}

	if index >= int64(len(r.csvRecord)) {
		// No value found for column 'name', hence return null
		// value
		return sql.FromNull(), nil
	}

	return sql.FromBytes([]byte(r.csvRecord[index])), nil
}

// Set - sets the value for a column name.
func (r *Record) Set(name string, value *sql.Value) (sql.Record, error) {
	r.columnNames = append(r.columnNames, name)
	r.csvRecord = append(r.csvRecord, value.CSVString())
	return r, nil
}

// Reset data in record.
func (r *Record) Reset() {
	if len(r.columnNames) > 0 {
		r.columnNames = r.columnNames[:0]
	}
	if len(r.csvRecord) > 0 {
		r.csvRecord = r.csvRecord[:0]
	}
	for k := range r.nameIndexMap {
		delete(r.nameIndexMap, k)
	}
}

// Clone the record.
func (r *Record) Clone(dst sql.Record) sql.Record {
	other, ok := dst.(*Record)
	if !ok {
		other = &Record{}
	}
	if len(other.columnNames) > 0 {
		other.columnNames = other.columnNames[:0]
	}
	if len(other.csvRecord) > 0 {
		other.csvRecord = other.csvRecord[:0]
	}
	other.columnNames = append(other.columnNames, r.columnNames...)
	other.csvRecord = append(other.csvRecord, r.csvRecord...)
	return other
}

// WriteCSV - encodes to CSV data.
func (r *Record) WriteCSV(writer io.Writer, opts sql.WriteCSVOpts) error {
	w := csv.NewWriter(writer)
	w.Comma = opts.FieldDelimiter
	w.AlwaysQuote = opts.AlwaysQuote
	w.Quote = opts.Quote
	w.QuoteEscape = opts.QuoteEscape
	if err := w.Write(r.csvRecord); err != nil {
		return err
	}
	w.Flush()
	if err := w.Error(); err != nil {
		return err
	}

	return nil
}

// WriteJSON - encodes to JSON data.
func (r *Record) WriteJSON(writer io.Writer) error {
	var kvs jstream.KVS = make([]jstream.KV, len(r.columnNames))
	for i := 0; i < len(r.columnNames); i++ {
		kvs[i] = jstream.KV{Key: r.columnNames[i], Value: r.csvRecord[i]}
	}
	return json.NewEncoder(writer).Encode(kvs)
}

// Raw - returns the underlying data with format info.
func (r *Record) Raw() (sql.SelectObjectFormat, interface{}) {
	return sql.SelectFmtCSV, r
}

// Replace - is not supported for CSV
func (r *Record) Replace(_ interface{}) error {
	return errors.New("Replace is not supported for CSV")
}

// NewRecord - creates new CSV record.
func NewRecord() *Record {
	return &Record{}
}


text:
<!DOCTYPE html>

Zapisy na pranie w DS Bursa Jagiellońska

                <form action="/week" method="get">
                    <input class="btn" type="submit" value="Lista bez logowania"/>
                </form>

                <fieldset class="fieldset">

                        <form th:action="@{/login}" method="post">

Login lub email:
<input type="text" name="username" required="true"/>

 Hasło:
<input type="password" name="password" required="true"/>

                            <input class="btn" type="submit" value="Zaloguj się"/>
                        </form>

                    Nie pamiętasz hasła?

                    Utwórz konto

                </fieldset>

                    UWAGA!

                    Na okres wakacji zostały wprowadzone małe zmiany.

                    Login: numer pokoju

                    Hasło: bursa

                    * Numer pokoju składa się z numeru składu i litery oznaczającej pokój. np. 33b, 24c, 19a

                    * Zmiana nie dotyczy części asystenckiej.

                    * Brak możliwości zmiany terminu.


text:
EXCLUDED_TABLES=(
            "assetindexdata"
            "assettransformindex"
            "cache"
            "sessions"
            "templatecaches"
            "templatecachecriteria"
            "templatecacheelements"
            )

IGNORED_TABLES_STRING=""
for TABLE in "${EXCLUDED_TABLES[@]}"
do
   IGNORED_TABLES_STRING+="--ignore-table=${LOCAL_DB_NAME}.${GLOBAL_DB_TABLE_PREFIX}${TABLE} "
done

# Additional arguments for mysqldump
MYSQLDUMP_ADDITIONAL_ARGS=""
MYSQLDUMP_ADDITIONAL_ARGS+="--add-drop-table "
MYSQLDUMP_ADDITIONAL_ARGS+="--comments "
MYSQLDUMP_ADDITIONAL_ARGS+="--create-options "
MYSQLDUMP_ADDITIONAL_ARGS+="--dump-date "
MYSQLDUMP_ADDITIONAL_ARGS+="--no-autocommit "
MYSQLDUMP_ADDITIONAL_ARGS+="--routines "
MYSQLDUMP_ADDITIONAL_ARGS+="--set-charset "
MYSQLDUMP_ADDITIONAL_ARGS+="--triggers "

# Arguments to dump just the schema
MYSQLDUMP_SCHEMA_ARGS=""
MYSQLDUMP_SCHEMA_ARGS+="--single-transaction "
MYSQLDUMP_SCHEMA_ARGS+="--no-data "
MYSQLDUMP_SCHEMA_ARGS+=$MYSQLDUMP_ADDITIONAL_ARGS

# Arguments to dump just the data
MYSQLDUMP_DATA_ARGS=""
MYSQLDUMP_DATA_ARGS+="--no-create-info "
MYSQLDUMP_DATA_ARGS+=$IGNORED_TABLES_STRING
MYSQLDUMP_DATA_ARGS+=$MYSQLDUMP_ADDITIONAL_ARGS

# Build the remote mysql credentials
REMOTE_DB_CREDS=""
if [ "${REMOTE_DB_USER}" != "" ] ; then
    REMOTE_DB_CREDS+="--user=${REMOTE_DB_USER} "
fi
if [ "${REMOTE_DB_PASSWORD}" != "" ] ; then
    REMOTE_DB_CREDS+="--password=${REMOTE_DB_PASSWORD} "
fi
if [ "${REMOTE_DB_HOST}" != "" ] ; then
    REMOTE_DB_CREDS+="--host=${REMOTE_DB_HOST} "
fi
if [ "${REMOTE_DB_PORT}" != "" ] ; then
    REMOTE_DB_CREDS+="--port=${REMOTE_DB_PORT} "
fi
# Use login-path if they have it set instead
if [ "${REMOTE_DB_LOGIN_PATH}" != "" ] ; then
    REMOTE_DB_CREDS="--login-path=${REMOTE_DB_LOGIN_PATH} "
fi
REMOTE_DB_CREDS+="${REMOTE_DB_NAME}"

# Build the local mysql credentials
LOCAL_DB_CREDS=""
if [ "${LOCAL_DB_USER}" != "" ] ; then
    LOCAL_DB_CREDS+="--user=${LOCAL_DB_USER} "
fi
if [ "${LOCAL_DB_PASSWORD}" != "" ] ; then
    LOCAL_DB_CREDS+="--password=${LOCAL_DB_PASSWORD} "
fi
if [ "${LOCAL_DB_HOST}" != "" ] ; then
    LOCAL_DB_CREDS+="--host=${LOCAL_DB_HOST} "
fi
if [ "${LOCAL_DB_PORT}" != "" ] ; then
    LOCAL_DB_CREDS+="--port=${LOCAL_DB_PORT} "
fi
# Use login-path if they have it set instead
if [ "${LOCAL_DB_LOGIN_PATH}" != "" ] ; then
    LOCAL_DB_CREDS="--login-path=${LOCAL_DB_LOGIN_PATH} "
fi
LOCAL_DB_CREDS+="${LOCAL_DB_NAME}"


text:
Implement the logic of the hangman game using functional reactive programming.

[Hangman][] is a simple word guessing game.

[Functional Reactive Programming][frp] is a way to write interactive
programs. It differs from the usual perspective in that instead of
saying "when the button is pressed increment the counter", you write
"the value of the counter is the sum of the number of times the button
is pressed."

Implement the basic logic behind hangman using functional reactive
programming.  You'll need to install an FRP library for this, this will
be described in the language/track specific files of the exercise.

[Hangman]: https://en.wikipedia.org/wiki/Hangman_%28game%29
[frp]: https://en.wikipedia.org/wiki/Functional_reactive_programming

# Tips

## Hints

One main aspect of Functional Programming is to have side-effect free functions, not to have to wonder that hidden objects a function has changed.

With Reactive Programming, instead of having a component actively looking for work, this work is pushed to the component. This is similar to callbacks, but at a much higher level, with more powerful abstractions. Very often, Reactive Programming is used in conjunction with Functional programming.

In the exercise, we will be using [RxJava](https://github.com/ReactiveX/RxJava), a well-known library for Reactive Programming with a Java API.

The simulated context of this exercise is an application receiving two inputs:

 - the new words to guess from some game engine,
 - the letters chosen by the player.

 Those two inputs are implemented with [Observables](http://reactivex.io/documentation/observable.html) - using the class [io.reactivex.Observable](http://reactivex.io/RxJava/2.x/javadoc/io/reactivex/Observable.html).
 Basically, you can subscribe to an `Observable` to "react" to the values that are produced somewhere. For example, the game engine pushes new words when it detects a new game has started, or keyboard events generate letter inputs.
 But many Reactive Frameworks offer powerful abstractions, such as [`map`](http://reactivex.io/documentation/operators/map.html) that allows you to change the received input, or [`combine`](http://reactivex.io/documentation/operators/combinelatest.html) that lets you merge together one or more `Observable`s.

The class `Output` is the expected result of the exercise processing, allowing a front-end to
display the complete state of the game without requiring from it any form of storage - thus making
it functional as well.
In this exercise, you have to find a way to use both inputs to generate this output in the form of an `Observable`.

## Setup

Go through the setup instructions for Java to install the necessary
dependencies:

[https://exercism.io/tracks/java/installation](https://exercism.io/tracks/java/installation)

# Running the tests

You can run all the tests for an exercise by entering the following in your
terminal:

```sh
$ gradle test
```

> Use `gradlew.bat` if you're on Windows

In the test suites all tests but the first have been skipped.

Once you get a test passing, you can enable the next one by removing the
`@Ignore("Remove to run test")` annotation.

## Submitting Incomplete Solutions
It's possible to submit an incomplete solution so you can see how others have
completed the exercise.


text:
from swgpy.object import *

def create(kernel):
	result = Tangible()

	result.template = "object/tangible/ship/components/armor/shared_armor_mandal_composite_j14.iff"
	result.attribute_template_id = 8
	result.stfName("space/space_item","armor_mandal_composite_j14_n")

	#### BEGIN MODIFICATIONS ####
	####  END MODIFICATIONS  ####

	return result


text:
import intern from './intern';
/**
 @module @ember/object
*/

/**
 Previously we used `Ember.$.uuid`, however `$.uuid` has been removed from
 jQuery master. We'll just bootstrap our own uuid now.

 @private
 @return {Number} the uuid
 */
let _uuid = 0;

/**
 Generates a universally unique identifier. This method
 is used internally by Ember for assisting with
 the generation of GUID's and other unique identifiers.

 @public
 @return {Number} [description]
 */
export function uuid() {
  return ++_uuid;
}

/**
 Prefix used for guids through out Ember.
 @private
 @property GUID_PREFIX
 @for Ember
 @type String
 @final
 */
const GUID_PREFIX = 'ember';

// Used for guid generation...
const numberCache  = [];
const stringCache  = {};

/**
  A unique key used to assign guids and other private metadata to objects.
  If you inspect an object in your browser debugger you will often see these.
  They can be safely ignored.

  On browsers that support it, these properties are added with enumeration
  disabled so they won't show up when you iterate over your properties.

  @private
  @property GUID_KEY
  @for Ember
  @type String
  @final
*/
export const GUID_KEY = intern(`__ember${+ new Date()}`);

export let GUID_DESC = {
  writable:     true,
  configurable: true,
  enumerable:   false,
  value: null
};

let nullDescriptor = {
  configurable: true,
  writable: true,
  enumerable: false,
  value: null
};

export let GUID_KEY_PROPERTY = {
  name: GUID_KEY,
  descriptor: nullDescriptor
};

/**
  Generates a new guid, optionally saving the guid to the object that you
  pass in. You will rarely need to use this method. Instead you should
  call `Ember.guidFor(obj)`, which return an existing guid if available.

  @private
  @method generateGuid
  @static
  @for @ember/object/internals
  @param {Object} [obj] Object the guid will be used for. If passed in, the guid will
    be saved on the object and reused whenever you pass the same object
    again.

    If no object is passed, just generate a new guid.
  @param {String} [prefix] Prefix to place in front of the guid. Useful when you want to
    separate the guid into separate namespaces.
  @return {String} the guid
*/
export function generateGuid(obj, prefix = GUID_PREFIX) {
  let ret = prefix + uuid();
  if (obj !== undefined && obj !== null) {
    if (obj[GUID_KEY] === null) {
      obj[GUID_KEY] = ret;
    } else {
      GUID_DESC.value = ret;
      if (obj.__defineNonEnumerable) {
        obj.__defineNonEnumerable(GUID_KEY_PROPERTY);
      } else {
        Object.defineProperty(obj, GUID_KEY, GUID_DESC);
      }
    }
  }
  return ret;
}

/**
  Returns a unique id for the object. If the object does not yet have a guid,
  one will be assigned to it. You can call this on any object,
  `Ember.Object`-based or not, but be aware that it will add a `_guid`
  property.

  You can also use this method on DOM Element objects.

  @public
  @static
  @method guidFor
  @for @ember/object/internals
  @param {Object} obj any object, string, number, Element, or primitive
  @return {String} the unique guid for this instance.
*/
export function guidFor(obj) {
  // special cases where we don't want to add a key to object
  if (obj === undefined) {
    return '(undefined)';
  }

  if (obj === null) {
    return '(null)';
  }

  let type = typeof obj;
  if ((type === 'object' || type === 'function') && obj[GUID_KEY]) {
    return obj[GUID_KEY];
  }

  let ret;
  // Don't allow prototype changes to String etc. to change the guidFor
  switch (type) {
    case 'number':
      ret = numberCache[obj];

      if (!ret) {
        ret = numberCache[obj] = `nu${obj}`;
      }

      return ret;

    case 'string':
      ret = stringCache[obj];

      if (!ret) {
        ret = stringCache[obj] = `st${uuid()}`;
      }

      return ret;

    case 'boolean':
      return obj ? '(true)' : '(false)';

    default:
      if (obj === Object) {
        return '(Object)';
      }

      if (obj === Array) {
        return '(Array)';
      }

      return generateGuid(obj);
  }
}


text:
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<body>
<canvas id="canvas" width="200" height="200"></canvas>
<script>
test(function(t) {
    assert_equals(typeof document.getElementById, 'function');

    var path = new Path2D();
    assert_true(path instanceof Path2D);
    assert_equals(typeof path.closePath, 'function');
    assert_equals(typeof path.moveTo, 'function');
    assert_equals(typeof path.lineTo, 'function');
    assert_equals(typeof path.quadraticCurveTo, 'function');
    assert_equals(typeof path.bezierCurveTo, 'function');
    assert_equals(typeof path.arcTo, 'function');
    assert_equals(typeof path.arc, 'function');
    assert_equals(typeof path.rect, 'function');
    assert_equals(typeof path.ellipse, 'function');
}, "Ensure that the constructor for Path object and dependent functions exist.");
</script>
</body>


text:
title: Setup Your Environment
overview: Setting Up Your Environment

order: 40

layout: docs2020
type: markdown
---

 Using a Developer SLATE Bundle

Installing Minislate

Under "More Resources" you will find the Github page for a project called Minislate, as well as installation instructions. Minislate acts as a self-contained instance of the SLATE platform, including all the components listed below. Using this gives you access to the Cluster and the components running within it as if you are the System Admin of a SLATE Cluster. This is the recommended environment for the tutorial because there is far less burden to download and install each software, and Minislate itself runs as a container on your local machine that can be stopped or deleted with ease.

 More Resources

 Install Each Piece Locally

Installing Docker

Docker is one of the containerizers that makes the rest of this stack possible. There are other containerizers, but Docker has the most community support and is very accessible. The "More Resources" button will lead you to the download page for various operating systems.

 More Resources

Installing Kubectl and Autocomplete

Kubectl is the command line interface (cli) used to interact with Kubernetes Clusters. Follow the "More Resources" button to access the installation page of Kubectl. There are many ways to install, including package managers like homebrew and snap. Be sure to look into the autocompletion setup for bash and zsh at the bottom of the page as well, it makes life MUCH easier.

 More Resources

Installing Minikube

In order to do local testing and have a single-node Kubernetes Cluster on hand, we'll download and install Minikube. Minikube is a project directly from Kubernetes specifically designed for a testing environment, so it has a large amount of community support. Go to the "More Resources" button below and it will take you to the Minikube github page with instructions on how to install. You will also need a VM driver such as VirtualBox that Minikube can use to start a VM for the Cluster.

 More Resources

Installing Helm and Setting Up Tiller

Helm is a package manager and templating system for Kubernetes. We use Helm in SLATE to maintain a repository of SLATE apps, and to limit what settings we need to expose to the end user to deploy an app. The value of Helm comes from a file called "values.yaml". This file exposes only the settings that a user needs to interact with to customzie a deployment, removing a lot of boilerplate work, and is used as the source for templating. Follow the "More Resources" link to download and install Helm.

 More Resources

SLATE Client

Finally, we will need access to the SLATE client. To use SLATE, create an account on the SLATE portal and ask your SLATE-affiliated organization to add you to their approved users list. Once you've been added, there will be instructions for how to download the client, and save your user token.

 More Resources


text:
package org.onesocialweb.openfire.handler.pep;

import org.jivesoftware.openfire.auth.UnauthorizedException;
import org.jivesoftware.openfire.container.BasicModule;
import org.xmpp.packet.IQ;

public abstract class PEPCommandHandler extends BasicModule {

    /**
     * Create a basic module with the given name.
     *
     * @param moduleName The name for the module or null to use the default
     */
	public PEPCommandHandler(String moduleName) {
		super(moduleName);
	}

    public abstract IQ handleIQ(IQ packet) throws UnauthorizedException;

	public abstract String getCommand();

}


text:
{% extends 'base.html' %}

{% load extra %}

{% block content %}

    {% if check.grafana_panel and check.grafana_panel.modifiable_url %}

{{ check.name }}

    {% else %}

{{ check.name }}

    {% endif %}

      {% if check.calculated_status == 'passing' %}
        {{ check.calculated_status|capfirst }}
      {% elif check.calculated_status == 'acked' %}
        {{ check.calculated_status|capfirst }}
      {% else %}
        {{ check.calculated_status|capfirst }}

          {% for hours in expire_after_hours %}

Snooze check for {{ hours }}h

          {% endfor %}

      {% endif %}

      {% if check.polymorphic_ctype.model == 'jenkinsstatuscheck' %}

      {% endif %}

Runbook

{% autoescape off %}{{ check.runbook }}{% endautoescape %}

Associated Services

    {% for service in services %}

    {{ service.name }}

    {% endfor %}

Check results

    {% if not checkresults %}

No results for this check

    {% else %}

          Status
          Time started
          Time complete
          Runtime
          {% if show_tags %}{% endif %}Message{% if show_tags %}{% endif %} /
            {% if not show_tags %}{% endif %}Tags{% if not show_tags %}{% endif %}

      {% for result in checkresults.prefetch_related %}

            {% if result.succeeded %}
              {{ result.status }}
            {% elif result.acked %}
              {{ result.status }}
            {% else %}

                {{ result.status }}

                  {% for hours in expire_after_hours %}

Snooze errors like this for {{ hours }}h

                  {% endfor %}

            {% endif %}

            {{ result.time|format_timestamp }}

          {{ result.time_complete|format_timestamp }}
          {{ result.took }} ms
          {% if not show_tags %}{% autoescape off %}{{ result.error|default:"" }}{% endautoescape %}
          {% else %}{% for tag in result.tags.all %}{{ tag }}{% if not forloop.last %}, {% endif %}{% endfor %}{% endif %}

      {% endfor %}

    {% endif %}

  {% for service in check.service_set.all %}
  {% if service.hackpad_id %}

Recovery instructions for linked service {{ service.name }}

  {% endif %}
  {% endfor %}

{% endblock content %}

{% block js %}
{% load compress %}
{{ block.super }}
{% compress js %}

{% endcompress %}
{% endblock js %}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Uses of Class org.apache.poi.util.Beta (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV

NEXT

FRAMES

NO FRAMES

All Classes

Uses of Class
org.apache.poi.util.Beta

Packages that use Beta

Package
Description

org.apache.poi.hssf.converter

org.apache.poi.hwpf.converter

org.apache.poi.hwpf.dev

org.apache.poi.ss.usermodel

org.apache.poi.ss.usermodel.charts

org.apache.poi.xslf.usermodel

org.apache.poi.xssf.usermodel

org.apache.poi.xssf.usermodel.charts

Uses of Beta in org.apache.poi.hssf.converter

Classes in org.apache.poi.hssf.converter with annotations of type Beta

Modifier and Type
Class and Description

class
AbstractExcelConverter

Common class for ExcelToFoConverter and ExcelToHtmlConverter

class
AbstractExcelUtils

Common class for ExcelToFoUtils and ExcelToHtmlUtils

class
ExcelToFoConverter

Converts xls files (97-2007) to XSL FO.

class
ExcelToFoUtils

class
ExcelToHtmlConverter

Converts xls files (97-2007) to HTML file.

class
ExcelToHtmlUtils

Uses of Beta in org.apache.poi.hwpf.converter

Classes in org.apache.poi.hwpf.converter with annotations of type Beta

Modifier and Type
Class and Description

class
AbstractWordConverter

class
AbstractWordUtils

class
DefaultFontReplacer

class
FoDocumentFacade

interface
FontReplacer

class
HtmlDocumentFacade

class
NumberFormatter

Utility class to translate numbers in letters, usually for lists.

interface
PicturesManager

User-implemented pictures manager to store images on-disk

class
TextDocumentFacade

class
WordToFoConverter

class
WordToFoUtils

class
WordToHtmlConverter

Converts Word files (95-2007) into HTML files.

class
WordToHtmlUtils

class
WordToTextConverter

Uses of Beta in org.apache.poi.hwpf.dev

Classes in org.apache.poi.hwpf.dev with annotations of type Beta

Modifier and Type
Class and Description

class
HWPFLister

Used by developers to list out key information on a HWPF file.

Uses of Beta in org.apache.poi.ss.usermodel

Classes in org.apache.poi.ss.usermodel with annotations of type Beta

Modifier and Type
Class and Description

class
DataConsolidateFunction

Enum mapping the values of STDataConsolidateFunction

Uses of Beta in org.apache.poi.ss.usermodel.charts

Classes in org.apache.poi.ss.usermodel.charts with annotations of type Beta

Modifier and Type
Interface and Description

interface
ChartAxis

High level representation of chart axis.

interface
ChartAxisFactory

A factory for different chart axis.

interface
ChartData

A base for all charts data types.

interface
ChartDataFactory

A factory for different charts data types.

interface
ChartDataSource<T>

Represents data model of the charts.

interface
ChartLegend

High level representation of chart legend.

class
DataSources

Class DataSources is a factory for ChartDataSource instances.

interface
LineChartData

Data for a Line Chart

interface
LineChartSeries

Represents a line chart series.

interface
ManualLayout

High level representation of chart element manual layout.

interface
ManuallyPositionable

Abstraction of chart element that can be positioned with manual
 layout.

interface
ScatterChartSeries

Represents scatter charts series.

interface
ValueAxis

Uses of Beta in org.apache.poi.xslf.usermodel

Classes in org.apache.poi.xslf.usermodel with annotations of type Beta

Modifier and Type
Class and Description

class
XMLSlideShow

High level representation of a ooxml slideshow.

class
XSLFAutoShape

Represents a shape with a preset geometry.

class
XSLFChart

Represents a Chart in a .pptx presentation

class
XSLFColor

Encapsulates logic to read color definitions from DrawingML and convert them to java.awt.Color

class
XSLFCommentAuthors

class
XSLFComments

class
XSLFCommonSlideData

class
XSLFConnectorShape

Specifies a connection shape.

class
XSLFDrawing

class
XSLFFactory

Instantiates sub-classes of POIXMLDocumentPart depending on their relationship type

class
XSLFFreeformShape

Represents a custom geometric shape.

class
XSLFGraphicFrame

class
XSLFGroupShape

Represents a group shape that consists of many shapes grouped together.

class
XSLFImageRenderer

For now this class renders only images supported by the javax.imageio.ImageIO
 framework.

class
XSLFNotes

class
XSLFNotesMaster

Notes master object associated with this layout.

class
XSLFPictureData

Instantiates sub-classes of POIXMLDocumentPart depending on their relationship type

class
XSLFPictureShape

Represents a picture shape

class
XSLFRelation

class
XSLFShape

Base super-class class for all shapes in PresentationML

class
XSLFSheet

class
XSLFSimpleShape

Represents a single (non-group) shape in a .pptx slide show

class
XSLFSlide

class
XSLFSlideLayout

class
XSLFSlideMaster

Slide master object associated with this layout.

class
XSLFTableStyles

class
XSLFTextBox

class
XSLFTextParagraph

Represents a paragraph of text within the containing text body.

class
XSLFTextRun

Represents a run of text within the containing text body.

class
XSLFTextShape

Represents a shape that can hold text.

class
XSLFTheme

A shared style sheet in a .pptx slide show

Uses of Beta in org.apache.poi.xssf.usermodel

Methods in org.apache.poi.xssf.usermodel with annotations of type Beta

Modifier and Type
Method and Description

void
XSSFPivotTable.addColumnLabel(DataConsolidateFunction function,
              int columnIndex)

Add a column label using data from the given column and specified function

void
XSSFPivotTable.addDataColumn(int columnIndex,
             boolean isDataField)

Add column containing data from the referenced area.

protected org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotCache
XSSFWorkbook.addPivotCache(java.lang.String rId)

Add pivotCache to the workbook

void
XSSFPivotTable.addReportFilter(int columnIndex)

Add filter for the column with the corresponding index and cell value

void
XSSFPivotTable.addRowLabel(int columnIndex)

Add a row label using data from the given column.

protected void
XSSFPivotCacheDefinition.commit()

protected void
XSSFPivotTable.commit()

protected void
XSSFPivotCacheRecords.commit()

protected void
XSSFPivotCacheDefinition.createCacheFields(Sheet sheet)

Generates a cache field for each column in the reference area for the pivot table.

protected void
XSSFPivotTable.createDefaultDataColumns()

XSSFPivotTable
XSSFSheet.createPivotTable(AreaReference source,
                CellReference position)

Create a pivot table and set area of source and a position for pivot table

XSSFPivotTable
XSSFSheet.createPivotTable(AreaReference source,
                CellReference position,
                Sheet sourceSheet)

Create a pivot table and set area of source, source sheet and a position for pivot table

protected void
XSSFPivotTable.createSourceReferences(AreaReference source,
                      CellReference position,
                      Sheet sourceSheet)

Creates cacheSource and workSheetSource for pivot table and sets the source reference as well assets the location of the pivot table

org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotCache
XSSFPivotCache.getCTPivotCache()

org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotCacheDefinition
XSSFPivotCacheDefinition.getCTPivotCacheDefinition()

org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotCacheRecords
XSSFPivotCacheRecords.getCtPivotCacheRecords()

org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotTableDefinition
XSSFPivotTable.getCTPivotTableDefinition()

Sheet
XSSFPivotTable.getDataSheet()

Sheet
XSSFPivotTable.getParentSheet()

XSSFPivotCache
XSSFPivotTable.getPivotCache()

XSSFPivotCacheDefinition
XSSFPivotTable.getPivotCacheDefinition()

XSSFPivotCacheRecords
XSSFPivotTable.getPivotCacheRecords()

java.util.List<XSSFPivotTable>
XSSFWorkbook.getPivotTables()

java.util.List<XSSFPivotTable>
XSSFSheet.getPivotTables()

Returns all the pivot tables for this Sheet

java.util.List<java.lang.Integer>
XSSFPivotTable.getRowLabelColumns()

void
XSSFPivotCacheDefinition.readFrom(java.io.InputStream is)

void
XSSFPivotTable.readFrom(java.io.InputStream is)

protected void
XSSFPivotCache.readFrom(java.io.InputStream is)

protected void
XSSFPivotCacheRecords.readFrom(java.io.InputStream is)

void
XSSFPivotTable.setCTPivotTableDefinition(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotTableDefinition pivotTableDefinition)

protected void
XSSFPivotTable.setDefaultPivotTableDefinition()

Set default values for the table definition.

void
XSSFPivotTable.setParentSheet(XSSFSheet parentSheet)

void
XSSFPivotTable.setPivotCache(XSSFPivotCache pivotCache)

void
XSSFPivotTable.setPivotCacheDefinition(XSSFPivotCacheDefinition pivotCacheDefinition)

void
XSSFPivotTable.setPivotCacheRecords(XSSFPivotCacheRecords pivotCacheRecords)

protected void
XSSFWorkbook.setPivotTables(java.util.List<XSSFPivotTable> pivotTables)

Constructors in org.apache.poi.xssf.usermodel with annotations of type Beta

Constructor and Description

XSSFPivotCache()

XSSFPivotCache(org.openxmlformats.schemas.spreadsheetml.x2006.main.CTPivotCache ctPivotCache)

XSSFPivotCache(PackagePart part,
              PackageRelationship rel)

Creates n XSSFPivotCache representing the given package part and relationship.

XSSFPivotCacheDefinition()

XSSFPivotCacheDefinition(PackagePart part,
                        PackageRelationship rel)

Creates an XSSFPivotCacheDefintion representing the given package part and relationship.

XSSFPivotCacheRecords()

XSSFPivotCacheRecords(PackagePart part,
                     PackageRelationship rel)

Creates an XSSFPivotCacheRecords representing the given package part and relationship.

XSSFPivotTable()

XSSFPivotTable(PackagePart part,
              PackageRelationship rel)

Creates an XSSFPivotTable representing the given package part and relationship.

Uses of Beta in org.apache.poi.xssf.usermodel.charts

Classes in org.apache.poi.xssf.usermodel.charts with annotations of type Beta

Modifier and Type
Class and Description

class
XSSFCategoryAxis

Category axis type.

class
XSSFChartAxis

Base class for all axis types.

class
XSSFChartDataFactory

class
XSSFChartLegend

Represents a SpreadsheetML chart legend

class
XSSFLineChartData

Holds data for a XSSF Line Chart

class
XSSFManualLayout

Represents a SpreadsheetML manual layout.

class
XSSFScatterChartData

Represents DrawingML scatter charts.

class
XSSFValueAxis

Value axis type.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

PREV

NEXT

FRAMES

NO FRAMES

All Classes

                Copyright 2014 The Apache Software Foundation or
        its licensors, as applicable.


text:
            {{ form.name }}

                {{ form.desc }}

This is home view


text:
  function AudioTexture( audio ){

    var analyzer = audio.analyzer;

    var fbc = analyzer.frequencyBinCount;

    // TODO: why 2 * 4 instead of 4 ?
    // fudge factor is to make sure texture reachs from 0 -> 1 in vUv coords
    var pixels = fbc / 8.2;

    //creates a canvas element
    var canvas              = document.createElement('canvas');
    canvas.style.zIndex     = 999;
    canvas.style.position   = 'absolute';
    canvas.style.top        = '50px';
    canvas.style.left       = '100px';
    canvas.style.border     = '1px solid red';

    // uncomment to see texture in upper left corner
    //document.body.appendChild( canvas );

    canvas.width = pixels;
    canvas.height = 1;

    var c = canvas.getContext('2d');

    var width = canvas.width;
    var height = canvas.height;

    var imageData = c.createImageData( width , height );

    c.putImageData( imageData , 0 , 0 );

    texture = new THREE.Texture( canvas );
    texture.update = textureUpdate.bind( texture )
    texture.analyzer = analyzer;
    texture.c = c;
    texture.pixels = pixels;
    texture.width = width;
    texture.height = height;

   // console.log( audio );

    return texture ;

  }

  textureUpdate = function(){

    if( this.analyzer){

      var imageData = this.c.createImageData( this.width , this.height );

      //transfers audio data to rgb values
      for (var i = 0; i < this.pixels ; i++) {

        var x = i;
        var y = 0;
        var r = this.analyzer.array[i]   | 0;
        var g = this.analyzer.array[i+1] | 0;
        var b = this.analyzer.array[i+2] | 0;
        var a = this.analyzer.array[i+3] | 0;
        setPixelData( imageData , x , y , r , g , b , a );

      }

      this.c.putImageData( imageData , 0 , 0 );

      //updates the texture
      this._needsUpdate =  true;

    }

    //console.log('ss');

  }

  //TODO: Move this to canvasFunctions

  setPixelData = function ( imageData, x, y, r, g, b, a) {

      index = ( x + y * imageData.width ) * 4;
      imageData.data[index+0] = r;
      imageData.data[index+1] = g;
      imageData.data[index+2] = b;
      imageData.data[index+3] = a;

  }


text:
package org.apache.giraph.jython;

import org.apache.giraph.graph.Language;
import org.apache.hadoop.conf.Configuration;
import org.python.util.PythonInterpreter;

import static org.apache.giraph.conf.GiraphConstants.COMPUTATION_FACTORY_CLASS;
import static org.apache.giraph.conf.GiraphConstants.COMPUTATION_LANGUAGE;
import static org.apache.giraph.jython.JythonComputationFactory.JYTHON_COMPUTATION_CLASS_NAME;

/**
 * Helpers for running jobs with Jython.
 */
public class JythonUtils {
  /**
   * The Jython interpreter. Cached here for fast access. We use a singleton
   * for this so that we can parse all of the Jython scripts once at startup
   * and then have their data loaded for the rest of the job.
   */
  private static final PythonInterpreter INTERPRETER =
      new PythonInterpreter();

  /** Don't construct */
  private JythonUtils() { }

  /**
   * Get Jython interpreter
   *
   * @return interpreter
   */
  public static PythonInterpreter getInterpreter() {
    return INTERPRETER;
  }

  /**
   * Sets up the Configuration for using Jython
   *
   * @param conf Configuration to se
   * @param klassName Class name of Jython Computation
   */
  public static void init(Configuration conf, String klassName) {
    COMPUTATION_LANGUAGE.set(conf, Language.JYTHON);
    COMPUTATION_FACTORY_CLASS.set(conf, JythonComputationFactory.class);
    JYTHON_COMPUTATION_CLASS_NAME.set(conf, klassName);
  }
}


text:
<title>
Inside Socialist Worker
</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<?php include "../../legacy-includes/Script.htmlf" ?>

<?php include "../../legacy-includes/TopLogo.htmlf" ?>

<?php include "../../legacy-includes/TopAd.htmlf" ?>

<?php include "../../legacy-includes/LeftButtons.htmlf" ?>

April 13, 2007 | Issue 627

HEALTH CARE IS A RIGHT

The U.S. health care system:

Sick and getting sicker

Health care is out of reach for the growing number of uninsured Americans--and increasingly so even for those with coverage. Is there a cure for this sick system?

READING BETWEEN THE LINES

Labor and business' health care alliance?

How "universal" are the recent business-backed proposals for national health care? Not very--and that's by design.

FEATURES AND COLUMNS

What's wrong with the STRIVE immigration bill

The STRIVE Act put forward by Rep. Luis Gutiérrez is designed to be an offer the right can't refuse. The immigrant rights movement needs to separate the myths about STRIVE from the reality.

Against the war or for a new strategy?

Bush's disastrous stay-the-course policy is giving confidence to Democrats to push for a change of course for U.S. imperialism. But the question is: How much of a change?

RUSSIA 1917 | Part 3

Lenin prepares the Bolsheviks

The Russian Revolution of 1917 was largely fought out over the question of which half of "dual power"--the Provisional Government or the soviets--would replace the other.

EDITORIALS

The torturers cry foul

To hear Tony Blair and George Bush describe the treatment of 15 British sailors detained by Iran, you'd think they had been...well, tortured in a U.S. military prison.

Is Gonzales' head ready to roll?

The scandal over the Bush administration's political firing of U.S. attorneys is coming closer and closer to taking down the country's top law enforcement official.

NATIONAL NEWS

LA immigrant march sends a message

The streets of downtown Los Angeles became a sea of red shirts stretching for blocks on April 7 when at least 20,000 people marched for immigrant rights.

CEOs cut jobs and line their pockets

How would you like to be paid $39 million for four months of work? That's the situation for Alan Mulally, the president and chief executive of Ford Motor Co.

ON THE PICKET LINE

Victory for Cal State faculty

In a major reversal after 23 months of stonewalling, California State University administrators settled a contract that gives the faculty union everything it demanded and more.

Labor in brief

Hayward, Calif., teachers

NEWS FROM OUR STRUGGLE

DePaul prof under fire for criticizing Israel

Supporters of academic freedom are organizing behind Norman Finkelstein, a DePaul University political science professor and outspoken supporter of Palestinian liberation.

News and reports

Protesting the witch-hunt at NEIU | Legal win against Seattle crackdown | Stop Blackwater's war profiteering | Stop the Nazis

VIEWS AND VOICES

A massacre where Bush declared "success"

Just how much worse the situation in Iraq has become was evident recently when a vicious massacre took place in the city of Tal Afar.

Bloomberg's insult to the poor

New York City Mayor Michael Bloomberg announced a disgusting experiment that would monetarily "reward" poor families.

Views in brief

Wal-Mart's plan for a new image | Forced to choose between work and kids | Choosing our words carefully

BOOKS AND ENTERTAINMENT

A loud voice with nothing to say

There's no getting around the fact that the 1970s movies Quentin Tarantino emulates in Grindhouse are called "exploitation" for a reason.

Where were you in the zombie war?

World War Z: An Oral History of the Zombie War is a fictional account of what happens when politicians put profit and ideology before human need.

<?php include "../../legacy-includes/BottomNavLinks.htmlf" ?>

<?php include "../../legacy-includes/RightAdFolder.htmlf" ?>