text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="es" sourcelanguage="en">
<context>
    <name>ArrowToolOptionsBox</name>
    <message>
        <source>Pick:</source>
        <translation>Escoger:</translation>
    </message>
    <message>
        <source>Position</source>
        <translation type="vanished">Posición</translation>
    </message>
    <message>
        <source>E/W:</source>
        <translation>X:</translation>
    </message>
    <message>
        <source>N/S:</source>
        <translation>Y:</translation>
    </message>
    <message>
        <source>Z:</source>
        <translation>Z:</translation>
    </message>
    <message>
        <source>SO:</source>
        <translation>Orden:</translation>
    </message>
    <message>
        <source>Rotation</source>
        <translation type="vanished">Rotación</translation>
    </message>
    <message>
        <source>Scale</source>
        <translation>Escala</translation>
    </message>
    <message>
        <source>Global:</source>
        <translation>Global:</translation>
    </message>
    <message>
        <source>H:</source>
        <translation>H:</translation>
    </message>
    <message>
        <source>V:</source>
        <translation>V:</translation>
    </message>
    <message>
        <source>Maintain:</source>
        <translation>Mantener:</translation>
    </message>
    <message>
        <source>Shear</source>
        <translation>Inclinar</translation>
    </message>
    <message>
        <source>Center</source>
        <translation type="vanished">Centro</translation>
    </message>
    <message>
        <source>Lock</source>
        <translation type="vanished">Bloquear</translation>
    </message>
    <message>
        <source>(</source>
        <translation>(</translation>
    </message>
    <message>
        <source>)</source>
        <translation>)</translation>
    </message>
    <message>
        <source>Center Position</source>
        <translation>Posición centro</translation>
    </message>
    <message>
        <source>Position:</source>
        <translation>Posición:</translation>
    </message>
    <message>
        <source>Rotation:</source>
        <translation>Rotación:</translation>
    </message>
</context>
<context>
    <name>BrushTool</name>
    <message>
        <source>Thickness</source>
        <translation type="vanished">Grosor</translation>
    </message>
    <message>
        <source>Hardness:</source>
        <translation>Dureza:</translation>
    </message>
    <message>
        <source>Accuracy:</source>
        <translation>Precisión:</translation>
    </message>
    <message>
        <source>Selective</source>
        <translation>Selectivo</translation>
    </message>
    <message>
        <source>Preset:</source>
        <translation>Ajuste:</translation>
    </message>
    <message>
        <source>Break Sharp Angles</source>
        <translation type="vanished">Quebrar ángulos agudos</translation>
    </message>
    <message>
        <source>Pencil Mode</source>
        <translation type="vanished">Modo lápiz</translation>
    </message>
    <message>
        <source>Pressure Sensitivity</source>
        <translation type="vanished">Sensibilidad a presión</translation>
    </message>
    <message>
        <source>Cap</source>
        <translation>Extremos</translation>
    </message>
    <message>
        <source>Join</source>
        <translation>Uniones</translation>
    </message>
    <message>
        <source>Miter:</source>
        <translation>Inglete:</translation>
    </message>
    <message>
        <source>Size</source>
        <translation>Tamaño</translation>
    </message>
    <message>
        <source>Break</source>
        <translation>Quebrar</translation>
    </message>
    <message>
        <source>Pencil</source>
        <translation>Lápiz</translation>
    </message>
    <message>
        <source>Pressure</source>
        <translation>Presión</translation>
    </message>
    <message>
        <source>Smooth:</source>
        <translation>Suavizado:</translation>
    </message>
    <message>
        <source>Range:</source>
        <translation>Rango:</translation>
    </message>
    <message>
        <source>Snap</source>
        <translation>Adherencia</translation>
    </message>
</context>
<context>
    <name>BrushToolOptionsBox</name>
    <message>
        <source>Preset Name</source>
        <translation>Nombre del ajuste</translation>
    </message>
    <message>
        <source>OK</source>
        <translation>Aceptar</translation>
    </message>
    <message>
        <source>Cancel</source>
        <translation>Cancelar</translation>
    </message>
</context>
<context>
    <name>ControlPointEditorTool</name>
    <message>
        <source>Auto Select Drawing</source>
        <translation>Seleccionar dibujo automáticamente</translation>
    </message>
</context>
<context>
    <name>ControlPointSelection</name>
    <message>
        <source>Set Linear Control Point</source>
        <translation>Definir punto de control lineal</translation>
    </message>
    <message>
        <source>Set Nonlinear Control Point</source>
        <translation>Definir punto de control no lineal</translation>
    </message>
</context>
<context>
    <name>EditTool</name>
    <message>
        <source>Scale Constraint:</source>
        <translation>Restringir escala:</translation>
    </message>
    <message>
        <source>Auto Select Column</source>
        <translation>Seleccionar columna automáticamente</translation>
    </message>
    <message>
        <source>Global Key</source>
        <translation>Clave global</translation>
    </message>
    <message>
        <source>Lock Center E/W</source>
        <translation>Bloquear centro X</translation>
    </message>
    <message>
        <source>Lock Center N/S</source>
        <translation>Bloquear centro Y</translation>
    </message>
    <message>
        <source>Lock Position E/W</source>
        <translation>Bloquear posición X</translation>
    </message>
    <message>
        <source>Lock Position N/S</source>
        <translation>Bloquear posición Y</translation>
    </message>
    <message>
        <source>Lock Rotation</source>
        <translation>Bloquear rotación</translation>
    </message>
    <message>
        <source>Lock Shear H</source>
        <translation>Bloquear inclinación H</translation>
    </message>
    <message>
        <source>Lock Shear V</source>
        <translation>Bloquear inclinación V</translation>
    </message>
    <message>
        <source>Lock Scale H</source>
        <translation>Bloquear escala H</translation>
    </message>
    <message>
        <source>Lock Scale V</source>
        <translation>Bloquear escala V</translation>
    </message>
    <message>
        <source>Lock Global Scale</source>
        <translation>Bloquear escala global</translation>
    </message>
    <message>
        <source>E/W and N/S Positions</source>
        <translation>Posiciones X e Y</translation>
    </message>
    <message>
        <source>Z Position</source>
        <translation>Posición Z</translation>
    </message>
    <message>
        <source>SO</source>
        <translation>Orden</translation>
    </message>
    <message>
        <source>Rotation</source>
        <translation>Rotación</translation>
    </message>
    <message>
        <source>Global Scale</source>
        <translation>Escala global</translation>
    </message>
    <message>
        <source>Horizontal and Vertical Scale</source>
        <translation>Escala horizontal y vertical</translation>
    </message>
    <message>
        <source>Shear</source>
        <translation>Inclinación</translation>
    </message>
    <message>
        <source>Center Position</source>
        <translation>Posición centro</translation>
    </message>
    <message>
        <source>Active Axis</source>
        <translation>Eje activo</translation>
    </message>
</context>
<context>
    <name>EraserTool</name>
    <message>
        <source>Size:</source>
        <translation>Tamaño:</translation>
    </message>
    <message>
        <source>Hardness:</source>
        <translation>Dureza:</translation>
    </message>
    <message>
        <source>Type:</source>
        <translation>Tipo:</translation>
    </message>
    <message>
        <source>Mode:</source>
        <translation>Modo:</translation>
    </message>
    <message>
        <source>Selective</source>
        <translation>Selectivo</translation>
    </message>
    <message>
        <source>Invert</source>
        <translation>Invertir</translation>
    </message>
    <message>
        <source>Frame Range</source>
        <translation>Rango de fotogramas</translation>
    </message>
    <message>
        <source>Pencil Mode</source>
        <translation>Modo lápiz</translation>
    </message>
</context>
<context>
    <name>FillTool</name>
    <message>
        <source>Frame Range</source>
        <translation>Rango de fotogramas</translation>
    </message>
    <message>
        <source>Type:</source>
        <translation>Tipo:</translation>
    </message>
    <message>
        <source>Selective</source>
        <translation>Selectivo</translation>
    </message>
    <message>
        <source>Mode:</source>
        <translation>Modo:</translation>
    </message>
    <message>
        <source>Onion Skin</source>
        <translation>Piel de cebolla</translation>
    </message>
    <message>
        <source>Fill Depth</source>
        <translation>Profundidad de relleno</translation>
    </message>
    <message>
        <source>Segment</source>
        <translation>Segmento</translation>
    </message>
    <message>
        <source>Autopaint Lines</source>
        <translation>Pintar autom. líneas</translation>
    </message>
</context>
<context>
    <name>FingerTool</name>
    <message>
        <source>Size:</source>
        <translation>Tamaño:</translation>
    </message>
    <message>
        <source>Invert</source>
        <translation>Invertir</translation>
    </message>
</context>
<context>
    <name>FullColorBrushTool</name>
    <message>
        <source>Thickness</source>
        <translation type="vanished">Grosor</translation>
    </message>
    <message>
        <source>Pressure Sensitivity</source>
        <translation type="vanished">Sensibilidad a presión</translation>
    </message>
    <message>
        <source>Opacity:</source>
        <translation type="vanished">Opacidad:</translation>
    </message>
    <message>
        <source>Hardness:</source>
        <translation>Dureza:</translation>
    </message>
    <message>
        <source>Preset:</source>
        <translation>Ajuste:</translation>
    </message>
    <message>
        <source>Size</source>
        <translation>Tamaño</translation>
    </message>
    <message>
        <source>Pressure</source>
        <translation>Presión</translation>
    </message>
    <message>
        <source>Opacity</source>
        <translation>Opacidad</translation>
    </message>
    <message>
        <source>Eraser</source>
        <translation>Borrador</translation>
    </message>
    <message>
        <source>Lock Alpha</source>
        <translation>Respetar alfa</translation>
    </message>
</context>
<context>
    <name>FullColorEraserTool</name>
    <message>
        <source>Size:</source>
        <translation>Tamaño:</translation>
    </message>
    <message>
        <source>Opacity:</source>
        <translation>Opacidad:</translation>
    </message>
    <message>
        <source>Hardness:</source>
        <translation>Dureza:</translation>
    </message>
    <message>
        <source>Type:</source>
        <translation>Tipo:</translation>
    </message>
    <message>
        <source>Invert</source>
        <translation>Invertir</translation>
    </message>
    <message>
        <source>Frame Range</source>
        <translation>Rango de fotogramas</translation>
    </message>
</context>
<context>
    <name>HookTool</name>
    <message>
        <source>Snap</source>
        <translation>Adherir</translation>
    </message>
</context>
<context>
    <name>MagnetTool</name>
    <message>
        <source>Size:</source>
        <translation>Tamaño:</translation>
    </message>
</context>
<context>
    <name>PaintBrushTool</name>
    <message>
        <source>Size:</source>
        <translation>Tamaño:</translation>
    </message>
    <message>
        <source>Mode:</source>
        <translation>Modo:</translation>
    </message>
    <message>
        <source>Selective</source>
        <translation>Selectivo</translation>
    </message>
</context>
<context>
    <name>PinchTool</name>
    <message>
        <source>Size:</source>
        <translation>Tamaño:</translation>
    </message>
    <message>
        <source>Corner:</source>
        <translation>Ángulo:</translation>
    </message>
    <message>
        <source>Manual</source>
        <translation>Manual</translation>
    </message>
</context>
<context>
    <name>PlasticTool</name>
    <message>
        <source>Build Skeleton</source>
        <translation>Crear esqueleto</translation>
    </message>
    <message>
        <source>Paint Rigid</source>
        <translation>Pintar rigidez</translation>
    </message>
    <message>
        <source>Animate</source>
        <translation>Animar</translation>
    </message>
    <message>
        <source>Rigid</source>
        <translation>Rígido</translation>
    </message>
    <message>
        <source>Flex</source>
        <translation>Flexible</translation>
    </message>
    <message>
        <source>Mode:</source>
        <translation>Modo:</translation>
    </message>
    <message>
        <source>Vertex Name:</source>
        <translation>Nombre del vértice:</translation>
    </message>
    <message>
        <source>Allow Stretching</source>
        <translation>Permitir estiramiento</translation>
    </message>
    <message>
        <source>Thickness</source>
        <translation>Grosor</translation>
    </message>
    <message>
        <source>Keep Distance</source>
        <translation>Mantener distancia</translation>
    </message>
    <message>
        <source>Global Key</source>
        <translation>Clave global</translation>
    </message>
    <message>
        <source>A group of skeletons already exists for current column. Replacing it will also substitute any existing vertex animation.

Do you want to continue?</source>
        <translation>Ya existe un grupo de esqueletos para la columna actual. Reemplazarlo también sustituirá cualquier animación de vértices existente.

¿Desea continuar?</translation>
    </message>
    <message>
        <source>Ok</source>
        <translation>Aceptar</translation>
    </message>
    <message>
        <source>Cancel</source>
        <translation>Cancelar</translation>
    </message>
    <message>
        <source>Copy Skeleton</source>
        <translation>Copiar esqueleto</translation>
    </message>
    <message>
        <source>Paste Skeleton</source>
        <translation>Pegar esqueleto</translation>
    </message>
    <message>
        <source>Delete Vertex</source>
        <translation>Borrar vértice</translation>
    </message>
    <message>
        <source>Set Key</source>
        <translation>Marcar clave</translation>
    </message>
    <message>
        <source>Set Rest Key</source>
        <translation>Marcar clave de reposo</translation>
    </message>
    <message>
        <source>Show Mesh</source>
        <translation>Mostrar malla</translation>
    </message>
    <message>
        <source>Show Rigidity</source>
        <translation>Mostrar rigidez</translation>
    </message>
    <message>
        <source>Show SO</source>
        <translation>Mostrar orden</translation>
    </message>
    <message>
        <source>Show Skeleton Onion Skin</source>
        <translation>Mostrar piel de cebolla del esqueleto</translation>
    </message>
    <message>
        <source>The previous vertex name will be discarded, and all associated keys will be lost.

Do you want to proceed?</source>
        <translation>Se descartará el nombre anterior del vértice, y se perderán todos los claves asociados al mismo.

¿Desea continuar?</translation>
    </message>
    <message>
        <source>Set Global Key</source>
        <translation>Marcar clave global</translation>
    </message>
    <message>
        <source>Set Global Rest Key</source>
        <translation>Marcar clave global de reposo</translation>
    </message>
    <message>
        <source>Edit Mesh</source>
        <translation>Editar malla</translation>
    </message>
    <message>
        <source>Snap To Mesh</source>
        <translation>Adherir a la malla</translation>
    </message>
    <message>
        <source>Angle Bounds</source>
        <translation>Límites de ángulo</translation>
    </message>
    <message>
        <source>Swap Edge</source>
        <translation>Intercambiar borde</translation>
    </message>
    <message>
        <source>Collapse Edge</source>
        <translation>Colapsar borde</translation>
    </message>
    <message>
        <source>Split Edge</source>
        <translation>Dividir borde</translation>
    </message>
    <message>
        <source>Cut Mesh</source>
        <translation>Cortar malla</translation>
    </message>
</context>
<context>
    <name>PlasticToolOptionsBox</name>
    <message>
        <source>Create Mesh</source>
        <translation>Crear malla</translation>
    </message>
    <message>
        <source>Skeleton:</source>
        <translation>Esqueleto:</translation>
    </message>
    <message>
        <source>SO</source>
        <translation>Orden</translation>
    </message>
    <message>
        <source>Angle</source>
        <translation>Ángulo</translation>
    </message>
    <message>
        <source>Distance</source>
        <translation>Distancia</translation>
    </message>
</context>
<context>
    <name>PrimitiveParam</name>
    <message>
        <source>Shape:</source>
        <translation>Forma:</translation>
    </message>
    <message>
        <source>Thickness:</source>
        <translation>Grosor:</translation>
    </message>
    <message>
        <source>Opacity:</source>
        <translation>Opacidad:</translation>
    </message>
    <message>
        <source>Hardness:</source>
        <translation>Dureza:</translation>
    </message>
    <message>
        <source>Polygon Sides:</source>
        <translation>Lados del polígono:</translation>
    </message>
    <message>
        <source>Auto Group</source>
        <translation>Agrupar automáticamente</translation>
    </message>
    <message>
        <source>Auto Fill</source>
        <translation>Rellenar automáticamente</translation>
    </message>
    <message>
        <source>Selective</source>
        <translation>Selectivo</translation>
    </message>
    <message>
        <source>Pencil Mode</source>
        <translation>Modo lápiz</translation>
    </message>
    <message>
        <source>Cap</source>
        <translation>Extremos</translation>
    </message>
    <message>
        <source>Join</source>
        <translation>Uniones</translation>
    </message>
    <message>
        <source>Miter:</source>
        <translation>Inglete:</translation>
    </message>
    <message>
        <source>Size:</source>
        <translation>Tamaño:</translation>
    </message>
    <message>
        <source>Snap</source>
        <translation>Adherir</translation>
    </message>
</context>
<context>
    <name>PumpTool</name>
    <message>
        <source>Size:</source>
        <translation>Tamaño:</translation>
    </message>
    <message>
        <source>Accuracy:</source>
        <translation>Precisión:</translation>
    </message>
</context>
<context>
    <name>QObject</name>
    <message>
        <source>Min:</source>
        <translation>Mín:</translation>
    </message>
    <message>
        <source>Max:</source>
        <translation>Máx:</translation>
    </message>
    <message>
        <source>Yes</source>
        <translation>Sí</translation>
    </message>
    <message>
        <source>No</source>
        <translation>No</translation>
    </message>
    <message>
        <source>The copied selection cannot be pasted in the current drawing.</source>
        <translation>La selección copiada no puede ser pegada en el dibujo actual.</translation>
    </message>
    <message>
        <source>The current column is locked.</source>
        <translation>La columna actual está bloqueada.</translation>
    </message>
    <message>
        <source>The current column is not visible in Camera Stand.</source>
        <translation type="vanished">La columna actual no se encuentra visible en la vista de mesa de trabajo.</translation>
    </message>
    <message>
        <source>It is not possible to edit the audio column.</source>
        <translation>No es posible editar la columna de audio.</translation>
    </message>
    <message>
        <source>It is not possible to edit the Magpie column.</source>
        <translation>No es posible editar la columna de Magpie.</translation>
    </message>
    <message>
        <source>The current tool cannot be used on a Level column.</source>
        <translation>No es posible usar la herramienta actual en una columna de nivel.</translation>
    </message>
    <message>
        <source>The current tool cannot be used on a Mesh column.</source>
        <translation>No es posible usar la herramienta actual en una columna de malla.</translation>
    </message>
    <message>
        <source>The current tool cannot be used in Level Strip mode.</source>
        <translation>No es posible usar la herramienta actual en la cinta de nivel.</translation>
    </message>
    <message>
        <source>The current tool cannot be used to edit a motion path.</source>
        <translation>No es posible usar la herramienta actual para editar una trayectoria de movimiento.</translation>
    </message>
    <message>
        <source>The current level is not editable.</source>
        <translation>El nivel actual no es editable.</translation>
    </message>
    <message>
        <source>The current tool cannot be used on a Vector Level.</source>
        <translation>No es posible usar la herramienta actual en un nivel vectorial.</translation>
    </message>
    <message>
        <source>The current tool cannot be used on a Toonz Level.</source>
        <translation>No es posible usar la herramienta actual en un nivel de imagen de Toonz.</translation>
    </message>
    <message>
        <source>The current tool cannot be used on a Raster Level.</source>
        <translation>No es posible usar la herramienta actual en un nivel de imagen.</translation>
    </message>
    <message>
        <source>The current tool cannot be used on a Mesh Level.</source>
        <translation>No es posible usar la herramienta actual en un nivel de malla.</translation>
    </message>
    <message>
        <source>The current tool cannot be used on a mesh-deformed level</source>
        <translation>No es posible usar la herramienta actual en un nivel de malla deformada.</translation>
    </message>
    <message>
        <source>The current frame is locked: any editing is forbidden.</source>
        <translation>El fotograma actual está bloqueado: no se permite su edición.</translation>
    </message>
    <message>
        <source>Ok</source>
        <translation>Aceptar</translation>
    </message>
    <message>
        <source>Cancel</source>
        <translation>Cancelar</translation>
    </message>
    <message>
        <source>Paste</source>
        <translation>Pegar</translation>
    </message>
    <message>
        <source>Move Center</source>
        <translation>Mover centro</translation>
    </message>
    <message>
        <source>RGB Picker (R%1, G%2, B%3)</source>
        <translation>Selector RVA (R%1, V%2, A%3)</translation>
    </message>
    <message>
        <source>Group</source>
        <translation>Agrupar</translation>
    </message>
    <message>
        <source>Ungroup</source>
        <translation>Desagrupar</translation>
    </message>
    <message>
        <source>Move Group</source>
        <translation>Mover grupo</translation>
    </message>
    <message>
        <source>Modify Fx Gadget  </source>
        <translation>Control de modificación de efectos</translation>
    </message>
    <message>
        <source>%1   Level : %2  Frame : %3</source>
        <translation>%1   Nivel : %2  Fotograma : %3</translation>
    </message>
    <message>
        <source>Modify Stroke Tool</source>
        <translation>Modificar trazo</translation>
    </message>
    <message>
        <source>Modify Spline</source>
        <translation>Modificar curva</translation>
    </message>
    <message>
        <source>Deform Raster</source>
        <translation>Deformar imagen</translation>
    </message>
    <message>
        <source>Transform Raster</source>
        <translation>Transformar imagen</translation>
    </message>
    <message>
        <source>Set Save Box : (X%1,Y%2,W%3,H%4)->(X%5,Y%6,W%7,H%8)</source>
        <translation>Definir marco delimitador : (X%1,Y%2,An%3,Al%4)->(X%5,Y%6,An%7,Al%8)</translation>
    </message>
</context>
<context>
    <name>RGBPickerTool</name>
    <message>
        <source>Type:</source>
        <translation>Tipo:</translation>
    </message>
    <message>
        <source>Passive Pick</source>
        <translation>Selección pasiva</translation>
    </message>
</context>
<context>
    <name>RGBPickerToolOptionsBox</name>
    <message>
        <source>Pick Screen</source>
        <translation>Seleccionar de pantalla</translation>
    </message>
</context>
<context>
    <name>RasterSelectionTool</name>
    <message>
        <source>Modify Savebox</source>
        <translation>Modificar marco delimitador</translation>
    </message>
    <message>
        <source>No Antialiasing</source>
        <translation>Sin suavizado de bordes</translation>
    </message>
</context>
<context>
    <name>RasterTapeTool</name>
    <message>
        <source>Type:</source>
        <translation>Tipo:</translation>
    </message>
    <message>
        <source>Distance:</source>
        <translation>Distancia:</translation>
    </message>
    <message>
        <source>Style Index:</source>
        <translation>Índice del estilo:</translation>
    </message>
    <message>
        <source>Opacity:</source>
        <translation>Opacidad:</translation>
    </message>
    <message>
        <source>Frame Range</source>
        <translation>Rango de fotogramas</translation>
    </message>
    <message>
        <source>Angle:</source>
        <translation>Ángulo:</translation>
    </message>
</context>
<context>
    <name>SelectionTool</name>
    <message>
        <source>Type:</source>
        <translation>Tipo:</translation>
    </message>
</context>
<context>
    <name>SelectionToolOptionsBox</name>
    <message>
        <source>H:</source>
        <translation>H:</translation>
    </message>
    <message>
        <source>V:</source>
        <translation>V:</translation>
    </message>
    <message>
        <source>Rotation</source>
        <translation>Rotación</translation>
    </message>
    <message>
        <source>E/W:</source>
        <translation>X:</translation>
    </message>
    <message>
        <source>N/S:</source>
        <translation>Y:</translation>
    </message>
    <message>
        <source>Thickness</source>
        <translation>Grosor</translation>
    </message>
    <message>
        <source>Link</source>
        <translation>Vincular</translation>
    </message>
</context>
<context>
    <name>SkeletonTool</name>
    <message>
        <source>Show Only Active Skeleton</source>
        <translation>Mostrar sólo esqueleto activo</translation>
    </message>
    <message>
        <source>Global Key</source>
        <translation>Clave global</translation>
    </message>
    <message>
        <source>Mode:</source>
        <translation>Modo:</translation>
    </message>
    <message>
        <source>Reset Pinned Center</source>
        <translation>Restablecer centro fijado</translation>
    </message>
</context>
<context>
    <name>StylePickerTool</name>
    <message>
        <source>No current level.</source>
        <translation>No hay nivel actual.</translation>
    </message>
    <message>
        <source>Current level has no available palette.</source>
        <translation>El nivel actual no tiene una paleta disponible.</translation>
    </message>
    <message>
        <source>Palette must have more than one palette to be organized.</source>
        <translation>Es necesario que exista más de una paleta para poder organizarlas.</translation>
    </message>
    <message>
        <source>Mode:</source>
        <translation>Modo:</translation>
    </message>
    <message>
        <source>Passive Pick</source>
        <translation>Selección pasiva</translation>
    </message>
    <message>
        <source>Organize Palette</source>
        <translation>Organizar paleta</translation>
    </message>
</context>
<context>
    <name>StylePickerToolOptionsBox</name>
    <message>
        <source>With this option being activated, the picked style will be
moved to the end of the first page of the palette.</source>
        <translation>Con esta opción activa, el estilo escogido será
movido hacia el final de la primera página de la paleta.</translation>
    </message>
</context>
<context>
    <name>TrackerTool</name>
    <message>
        <source>Width:</source>
        <translation>Ancho:</translation>
    </message>
    <message>
        <source>Height:</source>
        <translation>Altura:</translation>
    </message>
    <message>
        <source>X:</source>
        <translation>X:</translation>
    </message>
    <message>
        <source>Y:</source>
        <translation>Y:</translation>
    </message>
</context>
<context>
    <name>TypeTool</name>
    <message>
        <source>Font:</source>
        <translation>Tipografía:</translation>
    </message>
    <message>
        <source>Style:</source>
        <translation>Estilo:</translation>
    </message>
    <message>
        <source>Vertical Orientation</source>
        <translation>Orientación vertical</translation>
    </message>
    <message>
        <source>Size:</source>
        <translation>Tamaño:</translation>
    </message>
</context>
<context>
    <name>VectorSelectionTool</name>
    <message>
        <source>Mode:</source>
        <translation>Modo:</translation>
    </message>
    <message>
        <source>Preserve Thickness</source>
        <translation>Preservar grosor</translation>
    </message>
    <message>
        <source>Cap</source>
        <translation>Extremos</translation>
    </message>
    <message>
        <source>Join</source>
        <translation>Uniones</translation>
    </message>
    <message>
        <source>Miter:</source>
        <translation>Inglete:</translation>
    </message>
</context>
<context>
    <name>VectorTapeTool</name>
    <message>
        <source>Smooth</source>
        <translation>Suavizar</translation>
    </message>
    <message>
        <source>Join Vectors</source>
        <translation>Unir vectores</translation>
    </message>
    <message>
        <source>Distance</source>
        <translation>Distancia</translation>
    </message>
    <message>
        <source>Mode:</source>
        <translation>Modo:</translation>
    </message>
    <message>
        <source>Type:</source>
        <translation>Tipo:</translation>
    </message>
</context>
</TS>


text:
<?xml version="1.0" encoding="utf-8"?>
<!--
    Copyright 2014 Gustavo Martin Morcuende

    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.
-->

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/weather_main_drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="name.gumartinm.weather.information.activity.MainTabsActivity">

    <!-- The main content view -->
    <LinearLayout
        android:orientation="vertical"
        android:padding="0dip"
        android:gravity="center_horizontal"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <include layout="@layout/weather_general_toolbar"/>

        <android.support.design.widget.TabLayout
            android:id="@+id/weather_main_sliding_tabs"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="top"
            android:layout_margin="4dip"
            app:tabMaxWidth="0dp"
            app:tabGravity="fill"
            app:tabMode="fixed"
            android:fillViewport="false">
        </android.support.design.widget.TabLayout>

        <android.support.v4.view.ViewPager
            android:id="@+id/pager"
            android:layout_width="match_parent"
            android:layout_height="0px"
            android:layout_weight="1"
            android:layout_margin="4dip">
        </android.support.v4.view.ViewPager>
    </LinearLayout>

    <!-- The navigation drawer -->
    <android.support.design.widget.NavigationView
        android:id="@+id/weather_main_left_drawer"
        android:layout_height="match_parent"
        android:layout_width="wrap_content"
        android:layout_gravity="start"
        app:headerLayout="@layout/weather_main_drawer_header"
        app:menu="@menu/weather_main_menu"/>

</android.support.v4.widget.DrawerLayout>

redpajama_set_name: RedPajamaGithub


text:
package com.miraclewong.notificationdemo;

import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;

/**
 * Created by miraclewong on 15/12/21.
 */
public class BaseTools {
    /**
     * 获取当前应用版本号
     * @param context
     * @return version
     * @throws Exception
     */
    public static String getAppVersion(Context context) throws Exception {
        // 获取packagemanager的实例
        PackageManager packageManager = context.getPackageManager();
        // getPackageName()是你当前类的包名,0代表是获取版本信息
        PackageInfo packInfo = packageManager.getPackageInfo(context.getPackageName(),0);
        String versionName = packInfo.versionName;
        return versionName;
    }

    /**
     * 获取当前系统SDK版本号
     */
    public static int getSystemVersion(){
		/*获取当前系统的android版本号*/
        int version= android.os.Build.VERSION.SDK_INT;
        return version;
    }
}


text:
package org.cvit.cabig.dmr.cmef;

public class CmefServiceException extends Exception {

	private static final long serialVersionUID = 1L;

	public CmefServiceException() {}
	public CmefServiceException(String msg) {
		super(msg);
	}
	public CmefServiceException(String msg, Exception cause) {
		super(msg, cause);
	}
	public CmefServiceException(Exception cause) {
		super(cause);
	}
}


text:
package com.hilton.effectiveandroid.opengl;

import java.nio.FloatBuffer;
import java.nio.IntBuffer;

import javax.microedition.khronos.opengles.GL10;

import android.app.Activity;
import android.opengl.GLSurfaceView;
import android.os.Bundle;

public class HelloOpenGLActivity extends Activity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        GLSurfaceView view = new GLSurfaceView(this);
        view.setRenderer(new HelloOpenGLRender());
        setContentView(view);
    }

    private class HelloOpenGLRender extends SimpleRenderer {
        float x = 0.8f;
        float[] rectVertice = new float[] {
                x, x, 0.0f,
                x, -x, 0.0f,
                -x, x, 0.0f,
                -x, -x, 0.0f
        };
        int y = 65535;
        int[] rectColor = new int[] {
                0, y, 0, 0,
                0, 0, y, 0,
                y, 0, 0, 0,
                y, y, 0, 0
        };
        FloatBuffer rectVerticesBuffer;
        IntBuffer rectColorBuffer;
        private float translateX;
        private float translateY;
        private float step = 0.02f;
        private float maxx = 1.0f;
        private float maxy = 1.0f;
        private float rotateStep = 10.f;
        private float rotate;
        public HelloOpenGLRender() {
            rectVerticesBuffer = FloatBuffer.wrap(rectVertice);
            rectColorBuffer = IntBuffer.wrap(rectColor);
            translateX = 0.0f;
            translateY = 0.0f;
            rotate = 0.0f;
        }

        @Override
        public void onDrawFrame(GL10 gl) {
            super.onDrawFrame(gl);
            gl.glTranslatef(translateX, translateY, -1.0f);
            gl.glRotatef(rotate, 0.0f, 0.0f, 1.0f);
            gl.glVertexPointer(3, GL10.GL_FLOAT, 0, rectVerticesBuffer);
            gl.glColorPointer(4, GL10.GL_FIXED, 0, rectColorBuffer);
            gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 4);

            translateX += step;
            translateY += step;
            if (translateX > maxx) {
                translateX = -maxx;
                step *= -1;
            }
            if (translateX < -maxx) {
                translateX = maxx;
                step *= -1;
            }
            if (translateY > maxy) {
                translateY = -maxy;
                step *= -1;
            }
            if (translateY < -maxy) {
                translateY = maxy;
                step *= -1;
            }

            rotate += rotateStep;
        }
    }
}


text:
package com.custardsource.parfait.dxm;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.channels.FileChannel;

public class FileByteBufferFactory implements ByteBufferFactory {

    private final File file;

    public FileByteBufferFactory(File file) {
        this.file = file;
    }

    public ByteBuffer build(int length) throws IOException {
        RandomAccessFile fos = null;
        try {
            if (file.getParentFile().exists()) {
                file.delete();  /* directory update visible to MMV PMDA */
                if (file.exists()) {
                    throw new RuntimeException(
                            "Could not delete existing file "
                                    + file.getCanonicalPath());
                }
            } else if (!file.getParentFile().mkdirs()) {
                throw new RuntimeException(
                        "Could not create output directory "
                                + file.getParentFile().getCanonicalPath());
            }
            fos = new RandomAccessFile(file, "rw");
            fos.setLength(length);
            ByteBuffer tempDataFile = fos.getChannel().map(FileChannel.MapMode.READ_WRITE, 0, length);
            tempDataFile.order(ByteOrder.nativeOrder());
            fos.close();

            return tempDataFile;
        } finally {
            if (fos != null) {
                fos.close();
            }
        }
    }

    @Override
    public String toString() {
        try {
            return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE).append("file", file.getCanonicalPath()).toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}


text:
/*
 * file ipv4RecvDemux.c
 *
 */
/* Embedded Xinu, Copyright (C) 2009.  All rights reserved. */

#include <stddef.h>
#include <ipv4.h>
#include <network.h>

/**
 *  Determines if an IP packet is destined for one of our network interfaces.
 *  @param dst destination IP address
 *  @return TRUE If destined for one of our netifs, otherwise FALSE
 */
bool ipv4RecvDemux(struct netaddr *dst)
{
#if NNETIF
    int i;
    struct netif *netptr;

    /* Check every interface */
    for (i = 0; i < NNETIF; i++)
    {
        netptr = &netiftab[i];

        /* Skip closed interfaces */
        if (netptr->state != NET_ALLOC)
        {
            continue;
        }

        /* Check if destination IP matches IP for interface */
        if (netaddrequal(dst, &netptr->ip)
            || netaddrequal(dst, &netptr->ipbrc))
        {
            return TRUE;
        }
    }
#endif                          /* NNETIF */
    return FALSE;
}


text:
#ifndef DocumentOrderedMap_h
#define DocumentOrderedMap_h

#include <wtf/HashCountedSet.h>
#include <wtf/HashMap.h>
#include <wtf/text/AtomicStringImpl.h>

namespace WebCore {

class Element;
class TreeScope;

class DocumentOrderedMap {
public:
    void add(AtomicStringImpl*, Element*);
    void remove(AtomicStringImpl*, Element*);
    void clear();

    bool contains(AtomicStringImpl*) const;
    bool containsMultiple(AtomicStringImpl*) const;
    // concrete instantiations of the get<>() method template
    Element* getElementById(AtomicStringImpl*, const TreeScope*) const;
    Element* getElementByMapName(AtomicStringImpl*, const TreeScope*) const;
    Element* getElementByLowercasedMapName(AtomicStringImpl*, const TreeScope*) const;
    Element* getElementByLabelForAttribute(AtomicStringImpl*, const TreeScope*) const;

    void checkConsistency() const;

    void reportMemoryUsage(MemoryObjectInfo*) const;

private:
    template<bool keyMatches(AtomicStringImpl*, Element*)> Element* get(AtomicStringImpl*, const TreeScope*) const;

    typedef HashMap<AtomicStringImpl*, Element*> Map;

    // We maintain the invariant that m_duplicateCounts is the count of all elements with a given key
    // excluding the one referenced in m_map, if any. This means it one less than the total count
    // when the first node with a given key is cached, otherwise the same as the total count.
    mutable Map m_map;
    mutable HashCountedSet<AtomicStringImpl*> m_duplicateCounts;
};

inline bool DocumentOrderedMap::contains(AtomicStringImpl* id) const
{
    return m_map.contains(id) || m_duplicateCounts.contains(id);
}

inline bool DocumentOrderedMap::containsMultiple(AtomicStringImpl* id) const
{
    return m_duplicateCounts.contains(id);
}

} // namespace WebCore

#endif // DocumentOrderedMap_h


text:
#pragma once

#include <ts/ink_memory.h>
#include <sys/stat.h>
#include <ts/TextView.h>

namespace ts
{
/** A file class for supporting path operations.
 */
class FilePath
{
  typedef FilePath self; ///< Self reference type.
public:
  FilePath();
  /// Construct from a null terminated string.
  explicit FilePath(char const *path);
  /// Construct from a string view.
  explicit FilePath(TextView const &path);
  /// Copy constructor - copies the path.
  FilePath(self const &that);
  /// Move constructor.
  FilePath(self &&that);
  /// Assign a new path.
  self &operator=(char const *path);
  /// Combine two paths, making sure there is exactly one separator between them.
  self operator/(self const &rhs);
  /// Create a new instance by appended @a path.
  self operator/(char const *path);
  /// Check if there is a path.
  bool has_path() const;
  /// Check if the path is absolute.
  bool is_absolute() const;
  /// Check if the path is not absolute.
  bool is_relative() const;
  /// Check if file is readable.
  bool is_readable() const;
  /// Access the path as a null terminated string.
  operator const char *() const;
  /// Access the path explicitly.
  char const *path() const;

  /// Return the file type value.
  int file_type() const;
  /// Size of the file or block device.
  off_t physical_size() const;

  bool is_char_device() const;
  bool is_block_device() const;
  bool is_dir() const;
  bool is_regular_file() const;

  // Utility methods.
  ats_scoped_fd open(int flags) const;

protected:
  /// Get the stat buffer.
  /// @return A valid stat buffer or @c nullptr if the system call failed.
  template <typename T> T stat(T (*f)(struct stat const *)) const;

  std::string _path; ///< File path.

  enum class STAT_P : int8_t { INVALID = -1, UNDEF = 0, VALID = 1 };
  mutable STAT_P _stat_p = STAT_P::UNDEF; ///< Whether _stat is valid.
  mutable struct stat _stat;              ///< File information.
};

/** A file support class for handling files as bulk content.

    @note This is used primarily for configuration files where the entire file is read every time
    and it's rarely (if ever) useful to read it incrementally. The general scheme is the entire file
    is read and then @c TextView elements are used to reference the bulk content.

    @internal The design goal of this class is to supplant the free functions later in this header.

 */
class BulkFile : public FilePath
{
  typedef BulkFile self;  ///< Self reference type.
  typedef FilePath super; ///< Parent type.
public:
  // Inherit super class constructors.
  using super::super;
  ///< Conversion constructor from base class.
  BulkFile(super &&that);
  /// Read the contents of the file in a local buffer.
  /// @return @c errno
  int load();
  TextView content() const;

private:
  std::string _content; ///< The file contents.
  size_t _len = -1;     ///< Length of file content.
};

/* ------------------------------------------------------------------- */

inline FilePath::FilePath()
{
  ink_zero(_stat);
}
inline FilePath::FilePath(char const *path) : _path(path)
{
  ink_zero(_stat);
}
inline FilePath::FilePath(TextView const &path) : _path(path.data(), path.size())
{
  ink_zero(_stat);
}
inline FilePath::FilePath(self const &that) : _path(that._path)
{
  ink_zero(_stat);
}
inline FilePath::FilePath(self &&that) : _path(std::move(that._path))
{
  ink_zero(_stat);
}
inline FilePath::operator const char *() const
{
  return _path.c_str();
}
inline char const *
FilePath::path() const
{
  return _path.c_str();
}

inline bool
FilePath::has_path() const
{
  return !_path.empty();
}
inline bool
FilePath::is_absolute() const
{
  return !_path.empty() && '/' == _path[0];
}
inline bool
FilePath::is_relative() const
{
  return !this->is_absolute();
}

template <typename T> T FilePath::stat(T (*f)(struct stat const *)) const
{
  if (STAT_P::UNDEF == _stat_p) {
    _stat_p = ::stat(_path.c_str(), &_stat) >= 0 ? STAT_P::VALID : STAT_P::INVALID;
  }
  return _stat_p == STAT_P::VALID ? f(&_stat) : T();
}

FilePath operator/(FilePath const &lhs, FilePath const &rhs);
FilePath operator/(char const *lhs, FilePath const &rhs);

inline int
FilePath::file_type() const
{
  return this->stat<int>([](struct stat const *s) -> int { return s->st_mode & S_IFMT; });
}

inline bool
FilePath::is_dir() const
{
  return this->file_type() == S_IFDIR;
}
inline bool
FilePath::is_char_device() const
{
  return this->file_type() == S_IFCHR;
}
inline bool
FilePath::is_block_device() const
{
  return this->file_type() == S_IFBLK;
}
inline bool
FilePath::is_regular_file() const
{
  return this->file_type() == S_IFREG;
}

inline off_t
FilePath::physical_size() const
{
  return this->stat<off_t>([](struct stat const *s) { return s->st_size; });
}

inline BulkFile::BulkFile(super &&that) : super(that) {}

/* ------------------------------------------------------------------- */
} // namespace ts
/* ------------------------------------------------------------------- */


text:
topic: sample
languages:
- csharp
products:
- windows
- windows-uwp
---

<!---
  category: PlayReady
  samplefwlink: https://aka.ms/playreadyuwp
--->

# PlayReady sample

Shows several common scenarios to playback protected content with PlayReady.

> **Note:** This sample is part of a large collection of UWP feature samples.
> If you are unfamiliar with Git and GitHub, you can download the entire collection as a
> [ZIP file](https://github.com/Microsoft/Windows-universal-samples/archive/master.zip), but be
> sure to unzip everything to access shared dependencies. For more info on working with the ZIP file,
> the samples collection, and GitHub, see [Get the UWP samples from GitHub](https://aka.ms/ovu2uq).
> For more samples, see the [Samples portal](https://aka.ms/winsamples) on the Windows Dev Center.

***C# Scenarios***

**Scenario 1: Reactive License Request(C#):**
This example shows the basics of configuring the MediaElement's MediaProtectionManager property to support PlayReady and reactively handle license service requests. In this configuration license service requests are triggered automatically by PlayReady when the DRM does not have a media license available.

**Scenario 2: Proactive License Request(C#):**
This example shows how an application can actively manage DRM license requests and the individualization process. Individualization is a onetime configuration process that enables an application to able to make license requests for protected playback.

**Scenario 3: Hardware DRM(C#):**
This example shows how to configure a device to use either software or hardware DRM. Hardware DRM provides higher security and performance whereas software based DRM provides better compatibility on older devices.

**Scenario 4: Secure Stop(C#):**
Secure Stop enables a service to better manage concurrent streams for an account. The application can send a secure stop message from PlayReady that notifies a service that playback has stopped and a temporary playback license is no longer available.

**XBox One:**
In order to use PlayReady DRM within a Universal Application on Xbox One, an additional <DeviceCapability> needs to be added to the app manifest. The capability will need to be added manually to the manifest as a setting is not yet available from within the App Manifest Designer.

-	Right-click on the package.appxmanifest from Visual Studio and edit with the XML (text) Editor.
-	Add the following <DeviceCapability> and save:

```xml
<Capabilities>
    ...
    <DeviceCapability Name="6a7e5907-885c-4bcb-b40a-073c067bd3d5" />
</Capabilities>
```

**Note** The Windows universal samples require Visual Studio 2017 to build and Windows 10 to execute.

To obtain information about Windows 10 development, go to the [Windows Dev Center](https://dev.windows.com)

To obtain information about Microsoft Visual Studio and the tools for developing Windows apps, go to [Visual Studio](http://go.microsoft.com/fwlink/?LinkID=532422)

## Related topics

### Reference

[Windows.Media.Protection namespace](https://msdn.microsoft.com/library/windows/apps/br207056.aspx)
[Windows.Media.Protection.PlayReady namespace](https://msdn.microsoft.com/library/windows/apps/dn986454.aspx)
[Windows.Media.Streaming.Adaptive namespace](https://msdn.microsoft.com/library/windows/apps/windows.media.streaming.adaptive.aspx)

### Conceptual

[PlayReady DRM](https://msdn.microsoft.com/windows/uwp/audio-video-camera/playready-client-sdk)
[Hardware DRM](https://msdn.microsoft.com/windows/uwp/audio-video-camera/hardware-drm)
[Adaptive Streaming with PlayReady](https://msdn.microsoft.com/windows/uwp/audio-video-camera/adaptive-streaming-with-playready)

### Related samples

* [AdaptiveStreaming](../AdaptiveStreaming)
* [PlayReady sample](/archived/PlayReady/) for JavaScript (archived)

## System requirements

* Windows 10

## Build the sample

1. If you download the samples ZIP, be sure to unzip the entire archive, not just the folder with the sample you want to build.
2. Start Microsoft Visual Studio 2017 and select **File** \> **Open** \> **Project/Solution**.
3. Starting in the folder where you unzipped the samples, go to the Samples subfolder, then the subfolder for this specific sample, then the subfolder for your preferred language (C++, C#, or JavaScript). Double-click the Visual Studio Solution (.sln) file.
4. Press Ctrl+Shift+B, or select **Build** \> **Build Solution**.

## Run the sample

**Note** Ensure that the CPU is selected that matches the machine running the sample. For example, if its Windows on x64 then x64 needs to be selected. If it does not match than the Protected Media Path will not work and playback will fail.

The next steps depend on whether you just want to deploy the sample or you want to both deploy and run it.

### Deploying the sample

- Select Build > Deploy Solution.

### Deploying and running the sample

- To debug the sample and then run it, press F5 or select Debug >  Start Debugging. To run the sample without debugging, press Ctrl+F5 or select Debug > Start Without Debugging.


text:
public class Main
{

	public static void printProf ( Professor prof)
	{
		System.out.println("Nome: " + prof.getNome());
		System.out.println("Matricula: " + prof.getMatricula());
		System.out.println("Idade: " + prof.getIdade());
		System.out.println();
	}

	public static void main(String[] args)
	{
		Professor profH1 = new ProfessorHorista("Joao", "2087h", 28, 25, 28.32);
		Professor profI1 = new ProfessorIntegral("Gabriel", "2088i", 31, 2000.76);

		printProf(profH1);

		profH1.setNome("Joao Alves");
		profH1.setMatricula("2087h1");
		profH1.setIdade(32);

		printProf(profH1);
		printProf(profI1);

		profI1.setNome("Gabriel Araújo");
		profI1.setMatricula("2087i1");
		profI1.setIdade(36);

		printProf(profI1);

	}
}


text:
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)

require 'bundler/setup' # Set up gems listed in the Gemfile.
require 'bootsnap/setup'


text:
from erecharges.blueprints.home.forms import PhoneRechargeForm
from erecharges.providers.claro import do_recharge
from flask import render_template, Blueprint, url_for, request, flash
from werkzeug.utils import redirect

bp_home = Blueprint('home', __name__)

@bp_home.route('/')
def index():
    form_phonerecharge = PhoneRechargeForm()
    return render_template('home/index.html', form_phonerecharge=form_phonerecharge)

@bp_home.route('/confirm/', methods=['POST'])
def confirm():
    form_phonerecharge = PhoneRechargeForm()
    if form_phonerecharge.validate_on_submit():
        form_data = request.form
        response = do_recharge(
            phone_number=form_data.get('phone_number'),
            amount=form_data.get('amount_options'),
        )
        if response: flash('Recarga exitosa al número {} con S/. {} soles'.format(
                form_data.get('phone_number'), form_data.get('amount_options')),
                'text-success bg-success')
        else: flash('No se pudo hacer la recarga al número {}'.format(
            form_data.get('phone_number')), 'text-danger bg-danger')
    return redirect(url_for('home.index'))


text:
<?php namespace Fly\Support;

class ClassLoader {

	/**
	 * The registered directories.
	 *
	 * @var array
	 */
	protected static $directories = array();

	/**
	 * Indicates if a ClassLoader has been registered.
	 *
	 * @var bool
	 */
	protected static $registered = false;

	/**
	 * Load the given class file.
	 *
	 * @param  string  $class
	 * @return void
	 */
	public static function load($class)
	{
		$class = static::normalizeClass($class);

		foreach (static::$directories as $directory)
		{
			if (file_exists($path = $directory.DIRECTORY_SEPARATOR.$class))
			{
				require_once $path;

				return true;
			}
		}
	}

	/**
	 * Get the normal file name for a class.
	 *
	 * @param  string  $class
	 * @return string
	 */
	public static function normalizeClass($class)
	{
		if ($class[0] == '\\') $class = substr($class, 1);

		return str_replace(array('\\', '_'), DIRECTORY_SEPARATOR, $class).'.php';
	}

	/**
	 * Register the given class loader on the auto-loader stack.
	 *
	 * @return void
	 */
	public static function register()
	{
		if ( ! static::$registered)
		{
			static::$registered = spl_autoload_register(array('\Fly\Support\ClassLoader', 'load'));
		}
	}

	/**
	 * Add directories to the class loader.
	 *
	 * @param  string|array  $directories
	 * @return void
	 */
	public static function addDirectories($directories)
	{
		static::$directories = array_merge(static::$directories, (array) $directories);

		static::$directories = array_unique(static::$directories);
	}

	/**
	 * Remove directories from the class loader.
	 *
	 * @param  string|array  $directories
	 * @return void
	 */
	public static function removeDirectories($directories = null)
	{
		if (is_null($directories))
		{
			static::$directories = array();
		}
		else
		{
			$directories = (array) $directories;

			static::$directories = array_filter(static::$directories, function($directory) use ($directories)
			{
				return ( ! in_array($directory, $directories));
			});
		}
	}

	/**
	 * Gets all the directories registered with the loader.
	 *
	 * @return array
	 */
	public static function getDirectories()
	{
		return static::$directories;
	}

}


text:
require 'serverspec'

set :backend, :exec
set :path, '/sbin:/usr/local/sbin:$PATH'

describe 'default' do
  it 'service collectd should be running' do
    expect(service 'collectd').to be_enabled
    expect(service 'collectd').to be_running
  end
  it 'creates attribute-driven plugins' do
    plugins = %w(cpu df disk interface memory swap syslog)
    plugins.each do |plugin|
      expect(file "/opt/collectd/etc/conf.d/#{plugin}.conf").to be_file
    end
  end
  describe file('/opt/collectd/etc/conf.d/write_graphite.conf') do
    it { should be_a_file }
    its(:content) { should include 'Host "localhost"' }
    its(:content) { should include 'Port 2003' }
    its(:content) { should include 'Prefix "collectd."' }
  end
end


text:
// Copyright 2019 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/core/frame/frame_view.h"

#include "third_party/blink/renderer/core/display_lock/display_lock_utilities.h"
#include "third_party/blink/renderer/core/frame/frame_client.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/remote_frame.h"
#include "third_party/blink/renderer/core/html/html_frame_owner_element.h"
#include "third_party/blink/renderer/core/intersection_observer/intersection_geometry.h"
#include "third_party/blink/renderer/core/intersection_observer/intersection_observer.h"
#include "third_party/blink/renderer/core/layout/layout_embedded_content.h"
#include "third_party/blink/renderer/core/layout/layout_view.h"
#include "third_party/blink/renderer/core/page/page.h"
#include "ui/gfx/geometry/rect_conversions.h"
#include "ui/gfx/geometry/transform.h"

namespace blink {

FrameView::FrameView(const gfx::Rect& frame_rect)
    : EmbeddedContentView(frame_rect),
      frame_visibility_(blink::mojom::FrameVisibility::kRenderedInViewport) {}

Frame& FrameView::GetFrame() const {
  if (const LocalFrameView* lfv = DynamicTo<LocalFrameView>(this))
    return lfv->GetFrame();
  return DynamicTo<RemoteFrameView>(this)->GetFrame();
}

bool FrameView::CanThrottleRenderingForPropagation() const {
  if (CanThrottleRendering())
    return true;
  Frame& frame = GetFrame();
  if (!frame.IsCrossOriginToMainFrame())
    return false;
  if (frame.IsLocalFrame() && To<LocalFrame>(frame).IsHidden())
    return true;
  LocalFrame* parent_frame = DynamicTo<LocalFrame>(GetFrame().Tree().Parent());
  return (parent_frame && !frame.OwnerLayoutObject());
}

bool FrameView::DisplayLockedInParentFrame() {
  Frame& frame = GetFrame();
  LayoutEmbeddedContent* owner = frame.OwnerLayoutObject();
  if (!owner)
    return false;
  DCHECK(owner->GetFrameView());
  if (owner->GetFrameView()->IsDisplayLocked())
    return true;
  // We check the inclusive ancestor to determine whether the subtree is locked,
  // since the contents of the frame are in the subtree of the frame, so they
  // would be locked if the frame owner is itself locked.
  // We use a paint check here, since as lock as we don't allow paint, we are
  // display locked.
  return DisplayLockUtilities::LockedInclusiveAncestorPreventingPaint(*owner);
}

void FrameView::UpdateViewportIntersection(unsigned flags,
                                           bool needs_occlusion_tracking) {
  if (!(flags & IntersectionObservation::kImplicitRootObserversNeedUpdate))
    return;

  // This should only run in child frames.
  Frame& frame = GetFrame();
  HTMLFrameOwnerElement* owner_element = frame.DeprecatedLocalOwner();
  if (!owner_element)
    return;

  Document& owner_document = owner_element->GetDocument();
  gfx::Rect viewport_intersection, mainframe_intersection;
  TransformationMatrix main_frame_transform_matrix;
  DocumentLifecycle::LifecycleState parent_lifecycle_state =
      owner_document.Lifecycle().GetState();
  mojom::blink::FrameOcclusionState occlusion_state =
      owner_document.GetFrame()->GetOcclusionState();
  bool should_compute_occlusion =
      needs_occlusion_tracking &&
      occlusion_state ==
          mojom::blink::FrameOcclusionState::kGuaranteedNotOccluded &&
      parent_lifecycle_state >= DocumentLifecycle::kPrePaintClean;

  LayoutEmbeddedContent* owner_layout_object =
      owner_element->GetLayoutEmbeddedContent();
  if (!owner_layout_object || owner_layout_object->ContentSize().IsEmpty() ||
      (flags & IntersectionObservation::kAncestorFrameIsDetachedFromLayout)) {
    // The frame, or an ancestor frame, is detached from layout, not visible, or
    // zero size; leave viewport_intersection empty, and signal the frame as
    // occluded if necessary.
    occlusion_state = mojom::blink::FrameOcclusionState::kPossiblyOccluded;
  } else if (parent_lifecycle_state >= DocumentLifecycle::kLayoutClean &&
             !owner_document.View()->NeedsLayout()) {
    unsigned geometry_flags =
        IntersectionGeometry::kShouldUseReplacedContentRect;
    if (should_compute_occlusion)
      geometry_flags |= IntersectionGeometry::kShouldComputeVisibility;

    IntersectionGeometry geometry(nullptr, *owner_element, {} /* root_margin */,
                                  {IntersectionObserver::kMinimumThreshold},
                                  {} /* target_margin */, geometry_flags);
    PhysicalRect new_rect_in_parent = geometry.IntersectionRect();
    if (new_rect_in_parent.size != rect_in_parent_.size ||
        ((new_rect_in_parent.X() - rect_in_parent_.X()).Abs() +
             (new_rect_in_parent.Y() - rect_in_parent_.Y()).Abs() >
         LayoutUnit(mojom::blink::kMaxChildFrameScreenRectMovement))) {
      rect_in_parent_ = new_rect_in_parent;
      if (Page* page = GetFrame().GetPage()) {
        rect_in_parent_stable_since_ = page->Animator().Clock().CurrentTime();
      } else {
        rect_in_parent_stable_since_ = base::TimeTicks::Now();
      }
    }
    if (should_compute_occlusion && !geometry.IsVisible())
      occlusion_state = mojom::blink::FrameOcclusionState::kPossiblyOccluded;

    // Generate matrix to transform from the space of the containing document
    // to the space of the iframe's contents.
    TransformState parent_frame_to_iframe_content_transform(
        TransformState::kUnapplyInverseTransformDirection);
    // First transform to box coordinates of the iframe element...
    owner_layout_object->MapAncestorToLocal(
        nullptr, parent_frame_to_iframe_content_transform, 0);
    // ... then apply content_box_offset to translate to the coordinate of the
    // child frame.
    parent_frame_to_iframe_content_transform.Move(
        owner_layout_object->PhysicalContentBoxOffset());
    TransformationMatrix matrix =
        parent_frame_to_iframe_content_transform.AccumulatedTransform()
            .Inverse();
    if (geometry.IsIntersecting()) {
      PhysicalRect intersection_rect = PhysicalRect::EnclosingRect(
          matrix
              .ProjectQuad(gfx::QuadF(gfx::RectF(geometry.IntersectionRect())))
              .BoundingBox());

      // Don't let EnclosingRect turn an empty rect into a non-empty one.
      if (intersection_rect.IsEmpty()) {
        viewport_intersection =
            gfx::Rect(ToFlooredPoint(intersection_rect.offset), gfx::Size());
      } else {
        viewport_intersection = ToEnclosingRect(intersection_rect);
      }

      // Because the geometry code uses enclosing rects, we may end up with an
      // intersection rect that is bigger than the rect we started with. Clamp
      // the size of the viewport intersection to the bounds of the iframe's
      // content rect.
      // TODO(crbug.com/1266532): This should be
      //   viewport_intersection.Intersect(gfx::Rect(gfx::Point(),
      //       owner_layout_object->ContentSize()));
      // but it exposes a bug of incorrect origin of viewport_intersection in
      // multicol.
      gfx::Point origin = viewport_intersection.origin();
      origin.SetToMax(gfx::Point());
      viewport_intersection.set_origin(origin);
      gfx::Size size = viewport_intersection.size();
      size.SetToMin(ToRoundedSize(owner_layout_object->ContentSize()));
      viewport_intersection.set_size(size);
    }

    PhysicalRect mainframe_intersection_rect;
    if (!geometry.UnclippedIntersectionRect().IsEmpty()) {
      mainframe_intersection_rect = PhysicalRect::EnclosingRect(
          matrix
              .ProjectQuad(
                  gfx::QuadF(gfx::RectF(geometry.UnclippedIntersectionRect())))
              .BoundingBox());

      if (mainframe_intersection_rect.IsEmpty()) {
        mainframe_intersection = gfx::Rect(
            ToFlooredPoint(mainframe_intersection_rect.offset), gfx::Size());
      } else {
        mainframe_intersection = ToEnclosingRect(mainframe_intersection_rect);
      }
      // TODO(crbug.com/1266532): This should be
      //   mainframe_intersection.Intersect(gfx::Rect(gfx::Point(),
      //       owner_layout_object->ContentSize()));
      // but it exposes a bug of incorrect origin of mainframe_intersection in
      // multicol.
      gfx::Point origin = mainframe_intersection.origin();
      origin.SetToMax(gfx::Point());
      mainframe_intersection.set_origin(origin);
      gfx::Size size = mainframe_intersection.size();
      size.SetToMin(ToRoundedSize(owner_layout_object->ContentSize()));
      mainframe_intersection.set_size(size);
    }

    TransformState child_frame_to_root_frame(
        TransformState::kUnapplyInverseTransformDirection);
    if (owner_layout_object) {
      owner_layout_object->MapAncestorToLocal(
          nullptr, child_frame_to_root_frame,
          kTraverseDocumentBoundaries | kApplyRemoteMainFrameTransform);
      child_frame_to_root_frame.Move(
          owner_layout_object->PhysicalContentBoxOffset());
    }
    main_frame_transform_matrix =
        child_frame_to_root_frame.AccumulatedTransform();
  } else if (occlusion_state ==
             mojom::blink::FrameOcclusionState::kGuaranteedNotOccluded) {
    // If the parent LocalFrameView is throttled and out-of-date, then we can't
    // get any useful information.
    occlusion_state = mojom::blink::FrameOcclusionState::kUnknown;
  }

  // An iframe's content is always pixel-snapped, even if the iframe element has
  // non-pixel-aligned location.
  gfx::Transform main_frame_gfx_transform =
      main_frame_transform_matrix.ToTransform();
  main_frame_gfx_transform.RoundTranslationComponents();

  SetViewportIntersection(mojom::blink::ViewportIntersectionState(
      viewport_intersection, mainframe_intersection, gfx::Rect(),
      occlusion_state, frame.GetMainFrameViewportSize(),
      frame.GetMainFrameScrollOffset(), main_frame_gfx_transform));

  UpdateFrameVisibility(!viewport_intersection.IsEmpty());

  if (ShouldReportMainFrameIntersection()) {
    gfx::Rect projected_rect = gfx::ToEnclosingRect(
        main_frame_transform_matrix
            .ProjectQuad(gfx::QuadF(gfx::RectF(mainframe_intersection)))
            .BoundingBox());
    // Return <0, 0, 0, 0> if there is no area.
    if (projected_rect.IsEmpty())
      projected_rect.set_origin(gfx::Point(0, 0));
    GetFrame().Client()->OnMainFrameIntersectionChanged(projected_rect);
  }

  // We don't throttle zero-area or display:none iframes unless they are
  // cross-origin and ThrottleCrossOriginIframes is enabled, because in practice
  // they are sometimes used to drive UI logic.
  bool hidden_for_throttling = viewport_intersection.IsEmpty();
  bool is_display_none = !owner_layout_object;
  bool has_zero_area = FrameRect().IsEmpty();
  bool has_flag = RuntimeEnabledFeatures::
      ThrottleDisplayNoneAndVisibilityHiddenCrossOriginIframesEnabled();
  if (!has_flag && (is_display_none || has_zero_area))
    hidden_for_throttling = false;
  bool subtree_throttled = false;
  Frame* parent_frame = GetFrame().Tree().Parent();
  if (parent_frame && parent_frame->View()) {
    subtree_throttled =
        parent_frame->View()->CanThrottleRenderingForPropagation();
  }
  UpdateRenderThrottlingStatus(hidden_for_throttling, subtree_throttled,
                               DisplayLockedInParentFrame());
}

void FrameView::UpdateFrameVisibility(bool intersects_viewport) {
  blink::mojom::FrameVisibility frame_visibility;
  if (LifecycleUpdatesThrottled())
    return;
  if (IsVisible()) {
    frame_visibility =
        intersects_viewport
            ? blink::mojom::FrameVisibility::kRenderedInViewport
            : blink::mojom::FrameVisibility::kRenderedOutOfViewport;
  } else {
    frame_visibility = blink::mojom::FrameVisibility::kNotRendered;
  }
  if (frame_visibility != frame_visibility_) {
    frame_visibility_ = frame_visibility;
    VisibilityChanged(frame_visibility);
  }
}

void FrameView::UpdateRenderThrottlingStatus(bool hidden_for_throttling,
                                             bool subtree_throttled,
                                             bool display_locked,
                                             bool recurse) {
  bool visibility_changed =
      (hidden_for_throttling_ || subtree_throttled_ || display_locked_) !=
      (hidden_for_throttling || subtree_throttled || display_locked);
  hidden_for_throttling_ = hidden_for_throttling;
  subtree_throttled_ = subtree_throttled;
  display_locked_ = display_locked;
  if (visibility_changed)
    VisibilityForThrottlingChanged();
  if (recurse) {
    for (Frame* child = GetFrame().Tree().FirstChild(); child;
         child = child->Tree().NextSibling()) {
      if (FrameView* child_view = child->View()) {
        child_view->UpdateRenderThrottlingStatus(
            child_view->IsHiddenForThrottling(),
            child_view->IsAttached() && CanThrottleRenderingForPropagation(),
            child_view->IsDisplayLocked(), true);
      }
    }
  }
}

bool FrameView::RectInParentIsStable(
    const base::TimeTicks& event_timestamp) const {
  if (event_timestamp - rect_in_parent_stable_since_ <
      base::Milliseconds(mojom::blink::kMinScreenRectStableTimeMs)) {
    return false;
  }
  LocalFrameView* parent = ParentFrameView();
  if (!parent)
    return true;
  return parent->RectInParentIsStable(event_timestamp);
}

}  // namespace blink


text:
import dicom
import os
from dicom.sequence import Sequence
import numpy as np
import glob

np.random.seed(1234)
import matplotlib.pyplot as plt
from matplotlib import animation
import os
import cPickle as pickle

#file_list = glob.glob('/data/dsb15_pkl/pkl_validate/*/study/sax_*.pkl')
file_list = glob.glob(os.path.expanduser('~/test/*/study/sax_*.pkl') )
#folder_list = glob.glob( os.path.expanduser('~/storage/data/dsb15/*/*/study/*/') )

print len(file_list)
#folder_list.sort()
np.random.seed(317070)
np.random.shuffle(file_list)
file_list = sorted(file_list)

def convert_to_number(value):
    value = str(value)
    try:
        if "." in value:
            return float(value)
        else:
            return int(value)
    except:
        pass
    return value

def clean_metadata(metadatadict):
    keys = sorted(list(metadatadict.keys()))
    for key in keys:
        value = metadatadict[key]
        if key == 'PatientAge':
            metadatadict[key] = int(value[:-1])
        else:
            if isinstance(value, Sequence):
                #convert to list
                value = [i for i in value]
            if isinstance(value, (list,)):
                metadatadict[key] = [convert_to_number(i) for i in value]
            else:
                metadatadict[key] = convert_to_number(value)
    return metadatadict

def normalize_contrast(imdata, metadata=None):
    # normalize contrast
    flat_data = np.concatenate([i.flatten() for i in imdata]).flatten()
    high = np.percentile(flat_data, 95.0)
    low  = np.percentile(flat_data, 5.0)
    for i in xrange(len(imdata)):
        image = imdata[i]
        image = 1.0 * (image - low) / (high - low)
        image = np.clip(image, 0.0, 1.0)
        imdata[i] = image

    return imdata

def clean_image_data(imdata, metadata):
    """
    clean up 4d-tensor of imdata consistently (fix contrast, move upside up, etc...)
    :param imdata:
    :return:
    """

    # normalize contrast
    flat_data = np.concatenate([i.flatten() for i in imdata]).flatten()
    high = np.percentile(flat_data, 95.0)
    low  = np.percentile(flat_data, 5.0)
    print high,low
    for i in xrange(len(imdata)):
        image = imdata[i]
        image = 1.0 * (image - low) / (high - low)
        image = np.clip(image, 0.0, 1.0)
        imdata[i] = image

    return imdata

def set_upside_up(imdata, metadata=None):
    # turn upside up
    F = np.array(metadata["ImageOrientationPatient"]).reshape( (2,3) )

    f_1 = F[1,:]/np.linalg.norm(F[1,:])
    f_2 = F[0,:]/np.linalg.norm(F[0,:])

    x_e = np.array([1,0,0])
    y_e = np.array([0,1,0])
    z_e = np.array([0,0,1])

    a, b, c = False, False, False
    if abs(np.dot(y_e, f_1)) >= abs(np.dot(y_e, f_2)):
        for i in xrange(len(imdata)):
            image = imdata[i]
            image = np.swapaxes(image, 1, 2)
            imdata[i] = image
            f_1,f_2 = f_2,f_1
        a = True

    if np.dot(y_e, f_1) < 0:
        for i in xrange(len(imdata)):
            imdata[i] = imdata[i][:,::-1,:]
        b = True

    if np.dot(x_e, f_2) < 0:
        for i in xrange(len(imdata)):
            #imdata[i] = imdata[i][:,:,::-1]
            pass
        print f_1, f_2
        print "FLIP COLS %d"%metadata["PatientID"], a,b,True
        col_flipa = True
    else:
        col_flipa = False

    return imdata, col_flipa

def clean_images(data, metadata):
    """
    clean up 4d-tensor of imdata consistently (fix contrast, move upside up, etc...)
    :param data:
    :return:
    """
    from configuration import config
    for process in [set_upside_up, normalize_contrast]:
        data = process(data, metadata)
    return data

for file in file_list:
    if "sax" not in file:
        continue
    data = pickle.load(open(file, "r"))

    imdata = data['data']
    clean_imdata, col_flip = set_upside_up([imdata], clean_metadata(data['metadata'][0]))

    if not col_flip:
        continue

    clean_imdata = clean_imdata[0]

    fig, (ax1, ax2) = plt.subplots(1, 2)
    mngr = plt.get_current_fig_manager()
    # to put it into the upper left corner for example:
    mngr.window.setGeometry(50, 100, 600, 300)

    im1 = ax1.imshow(imdata[0], cmap='gist_gray_r', vmin=0, vmax=255)
    im2 = ax2.imshow(clean_imdata[0], cmap='gist_gray_r', vmin=0, vmax=255)
    fig.suptitle(file)

    def init():
        im1.set_data(imdata[0])
        im2.set_data(clean_imdata[0])

    def animate(i):
        im1.set_data(imdata[i])
        im2.set_data(clean_imdata[i])
        return im1, im2

    anim = animation.FuncAnimation(fig, animate, init_func=init, frames=len(imdata), interval=50)

    plt.show()


text:
async function runShellCommand(command) {
  const { spawn } = await import('child_process')

  return new Promise((resolve) => {
    const [name, ...args] = command.split(' ')
    const childProcess = spawn(name, args)
    let stderr = ''
    let stdout = ''

    childProcess.stderr.on('data', (data) => {
      stderr += data.toString()
    })
    childProcess.stdout.on('data', (data) => {
      stdout += data.toString()
    })
    childProcess.on('close', (code) => resolve({ code, stderr: stderr.trim(), stdout: stdout.trim() }))
  })
}

export async function doesTagExist(name) {
  return (await runShellCommand(`git tag -v ${name}`)).stderr !== `error: tag '${name}' not found.`
}

export async function getAllBranches() {
  const { stdout } = await runShellCommand('git branch --all')

  return stdout
    .split('\n')
    .map((line) => line.trim())
    .filter((line) => !!line)
    .reduce(
      (result, line) => {
        if (line.startsWith('*')) {
          const branchName = line.split('*')[1].trim()

          return {
            ...result,
            current: branchName,
            local: [...result.local, branchName]
          }
        } else if (line.startsWith('remotes/origin/')) {
          if (!line.includes('HEAD')) {
            return {
              ...result,
              remote: [...result.remote, line.split('remotes/origin/')[1]]
            }
          }

          return result
        } else return { ...result, local: [...result.local, line] }
      },
      { current: null, local: [], remote: [] }
    )
}

export async function getCurrentBranch() {
  return (await runShellCommand('git branch --show-current')).stdout
}

export async function isCommitRequired() {
  return (await runShellCommand('git status -s')).stdout !== ''
}

export async function isExistingBranch(name) {
  return (await runShellCommand(`git rev-parse --verify ${name}`)).code === 0
}

export async function isPushRequired() {
  return (await runShellCommand('git status')).stdout.includes('Your branch is ahead of')
}

export async function isValidBranchName(name) {
  return (await runShellCommand(`git check-ref-format --branch ${name}`)).code === 0
}


text:
**Finding Lane Lines on the Road**

Goals:
* Make a pipeline that finds lane lines on the road
* Modify the code to draw segmented and full lane lines on images
* Modify the code to draw cuved lane lines on images

[//]: # (Image References)

[image1]: ./test_images_output/gray/gray_solidWhiteCurve.jpg "Grayscale"

[image2]: ./test_images_output/segmented/segmented_solidWhiteCurve.jpg "Pipeline"

[image3]: ./test_images_output/full/full_solidWhiteCurve.jpg "Full line"

---

### Reflection

### 1. Describe your pipeline. As part of the description, explain how you modified the draw_lines() function.

My pipeline to find lane lines consists of 6 steps. (After reading in the image)
1. change the image to gray scale. As shown below.
2. Apply Gaussian Blur on the image, using kernel size of 5.
3. Apply Canny edge detector on the blurred image to get the gradient of pixels.
4. Bound the region of interest where the lane lines are.
5. Apply the hough transform and draw the detected lane lines on the image.
6. Add weight on the lines to the original image so the lines look more transparent.
Note: I modified the hough_lines() function to return both the lines and the image.

##### sample image
![alt text][image2]

To draw the full lines. I modified the draw_lines() function as follows:
1. Find the slopes of each lines
2. Seperate them into left and right according to their slope (greater than 0.4 or less than -0.4)
3. Average each the left and right lines
4. Compute the slope of each side
5. Compute the top and bottom point according to the slope
6. Draw the line

##### sample image on test image
![alt text][image3]

### 2. Identify potential shortcomings with your current pipeline

One potential shortcomings with this current pipeline is that when the camera is not facing directly at the lane lines (lane lines are shifted to the right or left), the paramters need to be redefined, and it would fail if the driver is switching between lane lines etc.

Another shortcoming is when the gradient is not that strong, for example at night. Even though it is hard for human to see at night as wel, the current pipeline can be improved if we filters other than grayscale.

### 3. Suggest possible improvements to your pipeline

As mentioned in the shortcoming, one of the improvement can be made is use filter for night vision so the computer can see the lane more clearly.

In general, I think this pipeline is good for pre-defined condition (when the lane lines is known to be directly in front). However, when the environment changed (car blocking the line etc), our algorithm won't detect the lane lines well.


text:
// Karma configuration
// Generated on Thu May 02 2013 23:29:14 GMT+0200 (CEST)

// base path, that will be used to resolve files and exclude
basePath = '..';

// list of files / patterns to load in the browser
files = [
  JASMINE,
  JASMINE_ADAPTER,
  'components/jquery/jquery.js',
  'components/angular/angular.js',
  'components/angular-mocks/angular-mocks.js',
  'modules/*/*.js',
  'modules/*/test/*Spec.js'
];

// list of files to exclude
exclude = [

];

// test results reporter to use
// possible values: 'dots', 'progress', 'junit'
reporters = ['dots'];

// enable / disable colors in the output (reporters and logs)
colors = true;

// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
logLevel = LOG_INFO;

// enable / disable watching file and executing tests whenever any file changes
autoWatch = false;

// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers = ['Chrome', 'Firefox'];

// If browser does not capture in given timeout [ms], kill it
captureTimeout = 60000;

// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun = false;


text:
/**
 * @module typings/core
 */

// Core
import { Core } from '../core';
// Modules
import { LogLevels } from '../modules/Logger';
// Definitions
import {
  IgnoreOption,
  ISchemaAttribute,
  ITransitionPage,
  IView,
  PreventCheck,
  RequestCustomError,
} from './index';

export interface IBarbaOptions {
  /** Array of transitions. */
  transitions?: ITransitionPage[];
  /** Array of views. */
  views?: IView[];
  /** Request timeout. */
  timeout?: number;
  /** Custom request error. */
  requestError?: RequestCustomError | undefined;
  /** Disable cache or ignore some routes. */
  cacheIgnore?: IgnoreOption;
  /** Disable prefetch or ignore routes. */
  prefetchIgnore?: IgnoreOption;
  /** Custom prevent check. */
  prevent?: PreventCheck | null;
  /** Prevent click when transition is running. */
  preventRunning?: boolean;
  /** Custom [data-attribute]. */
  schema?: ISchemaAttribute;
  /** Enable debug mode. */
  debug?: boolean;
  /** Log level. */
  logLevel?: keyof typeof LogLevels;
}

export interface IBarbaPlugin<T> {
  /** Plugin version */
  version: string;
  /** Plugin name */
  name: string;
  /** Install method */
  install(barba: Core, options?: T): void;
  /** Init method */
  init(): void;
}


text:
package com.gome.haoyuangong.net.volley;

import java.util.Map;

import org.json.JSONObject;

import com.android.volley.AuthFailureError;
import com.android.volley.DefaultRetryPolicy;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.ServerError;
import com.android.volley.TimeoutError;
import com.android.volley.Response.ErrorListener;
import com.android.volley.Response.Listener;
import com.android.volley.RetryPolicy;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.gome.haoyuangong.LogDataUtils;
import com.gome.haoyuangong.LogUpdate;
import com.gome.haoyuangong.log.Logger;
import com.gome.haoyuangong.net.NetConfig;
import com.gome.haoyuangong.net.RequestHandlerListener;
import com.gome.haoyuangong.utils.StringUtils;
import com.google.gson.Gson;
//import com.jrj.stock.trade.utils.JSONUtils;

public class JsonRequest<T> extends VolleyRequest<T>{
	private Class<T> jsonClass;

	public JsonRequest(int method, String url, RequestHandlerListener listener,Class<T> jsonClass) {
		super(method, url, listener);
		this.jsonClass = jsonClass;
	}
	public JsonRequest(int method,String url,Map<String, String> params,RequestHandlerListener listener,Class<T> jsonClass) {
		super(method, url,params, listener);
		this.jsonClass = jsonClass;
	}
	public JsonRequest(int method,String url,Map<String, String> params,RequestHandlerListener listener,Class<T> jsonClass,boolean isJsonPost) {
		super(method, url,params, listener,isJsonPost);
		this.jsonClass = jsonClass;
	}
	Request jsonObjectRequest ;
	protected void init() {
		initErrorListener();
		if(method==Method.POST&&params!=null&&params.size()>0&&isJsonPost){
			initListener2();
			initJson();
			return;
		}
		initListener();
		Logger.info("Request", url);
		jsonObjectRequest = new com.android.volley.toolbox.StringRequest(method, url, listener,errorListener
		){
			@Override
			protected Map<String, String> getParams() throws AuthFailureError {
				if(params!=null&&params.entrySet().size()>0){
					Logger.info("params", params.toString());
					return validFormat(params);
				}
				return super.getParams();
			}
			@Override
			public Map<String, String> getHeaders() throws AuthFailureError {
				Map<String, String> rt = NetConfig.getHeaders(isNormalPost);
				addCustomHeader(rt);
				Logger.info("headers", rt.toString());
				return rt;
			}
//			@Override
			public RetryPolicy getRetryPolicy() {
				RetryPolicy retryPolicy = new DefaultRetryPolicy(NetConfig.getConnectionTimeout(), 0, DefaultRetryPolicy.DEFAULT_BACKOFF_MULT);
				return retryPolicy;
			}
		};
	}

	private void initJson(){
		JSONObject json = new JSONObject(params);
		jsonObjectRequest = new com.android.volley.toolbox.JsonObjectRequest(method, url, json, listener2, errorListener);
	}
	private Listener<String> listener;
	private  ErrorListener errorListener;
	private Listener<JSONObject> listener2;
	private void initListener(){
		listener = new Response.Listener<String>() {
			@Override
			public void onResponse(String response) {
				Logger.error("onResponse", response);
				try {
					Gson json = new Gson();
					T object = json.fromJson(response, jsonClass);
					if(object == null){
						throw new Exception();
					}else{
						onSuccess(response,object);
						onEnd();
					}

				} catch (Exception e) {
					Logger.error("onResponse", "JSON错误 ", e);
					onFailure(0,"json解析错误");
					onEnd();
				}
			}
		};
	}
	private void initErrorListener(){
		errorListener=new Response.ErrorListener() {
			@Override
			public void onErrorResponse(VolleyError error) {
				Logger.info("onErrorResponse", getErrorStr(error)+" --> "+getUrl());
				if (error instanceof TimeoutError) {
					LogUpdate.getInstance().addLog(LogDataUtils.FUNCTIONID_LOG_TIMEOUT,getUrl(), String.valueOf(-1), "连接超时");
				}else if ((error instanceof ServerError) || (error instanceof AuthFailureError)) {
					LogUpdate.getInstance().addLog(LogDataUtils.FUNCTIONID_LOG_TIMEOUT,getUrl(), String.valueOf(-1), "网络连接异常,请稍后再试");
				}

				onFailure(0,getErrorStr(error));
				onEnd();
			}
		};
	}

	private void initListener2(){
		listener2 = new Response.Listener<JSONObject>() {
			@Override
			public void onResponse(JSONObject response) {
				try {
					if(response == null || StringUtils.isBlank(response.toString())){
						throw new Exception();
					}else{
						Gson json = new Gson();
						T object = json.fromJson(response.toString(), jsonClass);
						onSuccess(response.toString(),object);
						onEnd();
					}
				} catch (Exception e) {
					e.printStackTrace();
					onFailure(0,"json解析错误");
					onEnd();
				}
			}
		};
	}

	public void cancel(){
		super.cancel();
		jsonObjectRequest.cancel();
	}
	@Override
	public Object getTargetRequest() {
		return jsonObjectRequest;
	}
	@Override
	public void setTag(Object obj) {
		jsonObjectRequest.setTag(obj);
	}

	public void addCustomHeader(Map<String,String> header){

	}

}


text:
@(paymentRedirectUrl: String)(implicit lang: Lang,
        token: uk.gov.dvla.vehicles.presentation.common.filters.CsrfPreventionAction.CsrfPreventionToken,
        config: utils.helpers.Config,
        dateService: uk.gov.dvla.vehicles.presentation.common.services.DateService)

@import controllers.routes.Payment
@import uk.gov.dvla.vehicles.presentation.common.views.html.widgets.base.csrfTokenHiddenField
@import views.html.vrm_assign.main
@import views.vrm_assign.Payment.CancelId

@main(
    title = Messages("vrm_assign_payment.title")
) {

@Messages("vrm_assign_payment.title")

@Messages("vrm_assign_payment.title2")

@Messages("vrm_assign_payment.p2")

    <iframe
        src="@paymentRedirectUrl"
        @*seamless="seamless" Logic group recommends we do NOT use this field *@
        title="@Messages("vrm_assign_payment.iframe.title")"
        width="100%"
        height="730"
        frameborder="0" @* Logic group recommends this field *@
         @* Logic group recommends this field. This IE-specific attribute, which has never been part of a recognised standard, is no longer present in HTML5. http://help.simplytestable.com/errors/html-validation/the-x-attribute-on-the-y-element-is-obsolete-use-css-instead/the-allowtransparency-attribute-on-the-iframe-element-is-obsolete-use-css-instead/ *@
        @*sandbox="allow-forms allow-same-origin allow-scripts allow-top-navigation" Logic group recommends we do NOT use this field *@
    >
    @* POST body could return trxRef that we can CSRF against, we need to ask them to enable it. Else we can have CSRF on the callback url *@

        @csrfTokenHiddenField()
        @Messages("vrm_assign_payment.cancel.button")

}


text:
package com.karasiq.shadowcloud.webapp.components.folder

import com.karasiq.bootstrap.Bootstrap.default._
import com.karasiq.common.memory.MemorySize
import com.karasiq.shadowcloud.model.File
import com.karasiq.shadowcloud.webapp.components.common.AppIcons
import com.karasiq.shadowcloud.webapp.components.file.FilePreview.PreviewVariants
import com.karasiq.shadowcloud.webapp.components.file.{FileDownloadLink, FilePreview}
import com.karasiq.shadowcloud.webapp.context.{AppContext, FolderContext}
import com.karasiq.shadowcloud.webapp.utils.Blobs
import org.scalajs.dom.DragEvent
import rx._
import rx.async._
import scalaTags.all._

import scala.scalajs.concurrent.JSExecutionContext.Implicits.queue

object PreviewsFileListItem {
  def apply(file: File, selectedFile: Var[Option[File]])(implicit context: AppContext, fc: FolderContext): PreviewsFileListItem = {
    new PreviewsFileListItem(file, selectedFile)
  }
}

class PreviewsFileListItem(file: File, selectedFile: Var[Option[File]])(implicit context: AppContext, fc: FolderContext)
    extends BootstrapHtmlComponent {
  lazy val previews = {
    FilePreview
      .getPreviews(fc.regionId, file.id)
      .toRx(PreviewVariants.empty)
  }

  def renderTag(md: ModifierT*): TagT = {
    val dragAndDropHandlers = Seq[Modifier](
      draggable,
      ondragstart := { ev: DragEvent ⇒
        DragAndDrop.addFolderContext(ev.dataTransfer)
        DragAndDrop.addFileHandle(ev.dataTransfer, file)
      }
    )
    val fileLink = FileDownloadLink(file)(file.path.name)

    GridSystem.row(
      GridSystem.col(3)(
        Rx[Frag](previews().image match {
          case Some(thumbnail) ⇒
            val blob     = Blobs.fromBytes(thumbnail.data.toArray)
            val imageUrl = Blobs.getUrl(blob)
            img(Bootstrap.image.responsive, Bootstrap.image.rounded, src := imageUrl, marginBottom := 10.px)

          case None ⇒
            AppIcons.file
        }),
        textAlign.center,
        verticalAlign.middle,
        lineHeight := 50.px
      ),
      GridSystem.col(9)(
        GridSystem.row(
          GridSystem.col(9)(Rx[Frag](if (selectedFile().contains(file)) b(fileLink) else span(fileLink, cursor.pointer))),
          GridSystem.col(3)(
            GridSystem.mkRow(MemorySize.toString(file.checksum.size)),
            GridSystem.mkRow(context.timeFormat.timestamp(file.timestamp.lastModified)),
            color.gray,
            // fontStyle.italic,
            fontWeight.bold,
            fontSizeAdjust := 0.4,
            lineHeight := 80.pct
          )
        ),
        Rx[Frag](previews().text match {
          case Some(text) ⇒
            GridSystem.mkRow(
              if (text.format == "text/html") raw(text.data) else text.data,
              maxHeight := 5.em,
              color.gray,
              // fontFamily := "monospace",
              fontSize := 12.px,
              // whiteSpace.`pre-wrap`,
              // lineHeight := 80.pct,
              overflow.hidden
            )

          case None ⇒
            ()
        })
      ),
      "tr-hover".addClass,
      // border := "solid 0.1px",
      marginTop := 8.px,
      marginBottom := 8.px,
      wordWrap.`break-word`,
      onclick := Callback.onClick(_ ⇒ selectedFile() = Some(file)),
      dragAndDropHandlers
    )
  }
}


text:
package channeldb

import (
	"bytes"
	"testing"

	"github.com/btcsuite/btcd/chaincfg/chainhash"
	"github.com/btcsuite/btcd/wire"
	"github.com/lightningnetwork/lnd/channeldb/kvdb"
	"github.com/stretchr/testify/require"
)

var (
	testChainHash = [chainhash.HashSize]byte{
		0x51, 0xb6, 0x37, 0xd8, 0xfc, 0xd2, 0xc6, 0xda,
		0x48, 0x59, 0xe6, 0x96, 0x31, 0x13, 0xa1, 0x17,
		0x2d, 0xe7, 0x93, 0xe4,
	}

	testChanPoint1 = wire.OutPoint{
		Hash: chainhash.Hash{
			0x51, 0xb6, 0x37, 0xd8, 0xfc, 0xd2, 0xc6, 0xda,
			0x48, 0x59, 0xe6, 0x96, 0x31, 0x13, 0xa1, 0x17,
			0x2d, 0xe7, 0x93, 0xe4,
		},
		Index: 1,
	}
)

// TestPersistReport tests the writing and retrieval of a report on disk with
// and without a spend txid.
func TestPersistReport(t *testing.T) {
	tests := []struct {
		name      string
		spendTxID *chainhash.Hash
	}{
		{
			name:      "Non-nil spend txid",
			spendTxID: &testChanPoint1.Hash,
		},
		{
			name:      "Nil spend txid",
			spendTxID: nil,
		},
	}

	for _, test := range tests {
		test := test

		t.Run(test.name, func(t *testing.T) {
			db, cleanup, err := MakeTestDB()
			require.NoError(t, err)
			defer cleanup()

			channelOutpoint := testChanPoint1

			testOutpoint := testChanPoint1
			testOutpoint.Index++

			report := &ResolverReport{
				OutPoint:        testOutpoint,
				Amount:          2,
				ResolverType:    1,
				ResolverOutcome: 2,
				SpendTxID:       test.spendTxID,
			}

			// Write report to disk, and ensure it is identical when
			// it is read.
			err = db.PutResolverReport(
				nil, testChainHash, &channelOutpoint, report,
			)
			require.NoError(t, err)

			reports, err := db.FetchChannelReports(
				testChainHash, &channelOutpoint,
			)
			require.NoError(t, err)
			require.Equal(t, report, reports[0])
		})
	}
}

// TestFetchChannelReadBucket tests retrieval of the reports bucket for a
// channel, testing that the appropriate error is returned based on the state
// of the existing bucket.
func TestFetchChannelReadBucket(t *testing.T) {
	db, cleanup, err := MakeTestDB()
	require.NoError(t, err)
	defer cleanup()

	channelOutpoint := testChanPoint1

	testOutpoint := testChanPoint1
	testOutpoint.Index++

	// If we attempt to get reports when we do not have any present, we
	// expect to fail because our chain hash bucket is not present.
	_, err = db.FetchChannelReports(
		testChainHash, &channelOutpoint,
	)
	require.Equal(t, ErrNoChainHashBucket, err)

	// Finally we write a report to disk and check that we can fetch it.
	report := &ResolverReport{
		OutPoint:        testOutpoint,
		Amount:          2,
		ResolverOutcome: 1,
		ResolverType:    2,
		SpendTxID:       nil,
	}

	err = db.PutResolverReport(
		nil, testChainHash, &channelOutpoint, report,
	)
	require.NoError(t, err)

	// Now that the channel bucket exists, we expect the channel to be
	// successfully fetched, with no reports.
	reports, err := db.FetchChannelReports(testChainHash, &testChanPoint1)
	require.NoError(t, err)
	require.Equal(t, report, reports[0])
}

// TestFetchChannelWriteBucket tests the creation of missing buckets when
// retrieving the reports bucket.
func TestFetchChannelWriteBucket(t *testing.T) {
	createReportsBucket := func(tx kvdb.RwTx) (kvdb.RwBucket, error) {
		return tx.CreateTopLevelBucket(closedChannelBucket)
	}

	createChainHashBucket := func(reports kvdb.RwBucket) (kvdb.RwBucket,
		error) {

		return reports.CreateBucketIfNotExists(testChainHash[:])
	}

	createChannelBucket := func(chainHash kvdb.RwBucket) (kvdb.RwBucket,
		error) {

		var chanPointBuf bytes.Buffer
		err := writeOutpoint(&chanPointBuf, &testChanPoint1)
		require.NoError(t, err)

		return chainHash.CreateBucketIfNotExists(chanPointBuf.Bytes())
	}

	tests := []struct {
		name  string
		setup func(tx kvdb.RwTx) error
	}{
		{
			name: "no existing buckets",
			setup: func(tx kvdb.RwTx) error {
				return nil
			},
		},
		{
			name: "reports bucket exists",
			setup: func(tx kvdb.RwTx) error {
				_, err := createReportsBucket(tx)
				return err
			},
		},
		{
			name: "chainhash bucket exists",
			setup: func(tx kvdb.RwTx) error {
				reports, err := createReportsBucket(tx)
				if err != nil {
					return err
				}

				_, err = createChainHashBucket(reports)
				return err
			},
		},
		{
			name: "channel bucket exists",
			setup: func(tx kvdb.RwTx) error {
				reports, err := createReportsBucket(tx)
				if err != nil {
					return err
				}

				chainHash, err := createChainHashBucket(reports)
				if err != nil {
					return err
				}

				_, err = createChannelBucket(chainHash)
				return err
			},
		},
	}

	for _, test := range tests {
		test := test

		t.Run(test.name, func(t *testing.T) {
			db, cleanup, err := MakeTestDB()
			require.NoError(t, err)
			defer cleanup()

			// Update our db to the starting state we expect.
			err = kvdb.Update(db, test.setup, func() {})
			require.NoError(t, err)

			// Try to get our report bucket.
			err = kvdb.Update(db, func(tx kvdb.RwTx) error {
				_, err := fetchReportWriteBucket(
					tx, testChainHash, &testChanPoint1,
				)
				return err
			}, func() {})
			require.NoError(t, err)
		})
	}
}