text:
Create a Web form that looks like this sample:

![Screenshot](https://raw.github.com/jasssonpet/TelerikAcademy/master/WebDesign/1.HTMLBasics/4.HTMLFormsFrames/1.RegistrationForm/index.png)

## Exercise 2
Create the following using tables and forms:

![Screenshot](https://raw.github.com/jasssonpet/TelerikAcademy/master/WebDesign/1.HTMLBasics/4.HTMLFormsFrames/2.Students/index.png)

## Exercise 3
Construct the following Grid component:

![Screenshot](https://raw.github.com/jasssonpet/TelerikAcademy/master/WebDesign/1.HTMLBasics/4.HTMLFormsFrames/3.GridComponent/index.png)

* Try to make a HTML page, that looks just like the example
* Not required to style for the homework

## Exercise 4*
Create the following HTML Page
* Hint: Use Fieldsets and Nested tables

![Screenshot](https://raw.github.com/jasssonpet/TelerikAcademy/master/WebDesign/1.HTMLBasics/4.HTMLFormsFrames/4.NotebookDetails/index.png)


text:
export function even(value: any): Promise<boolean> {
    return Promise.resolve(value % 2 === 0);
}

redpajama_set_name: RedPajamaGithub


text:
import java.util.*;
import java.util.concurrent.Phaser;
import java.util.concurrent.atomic.AtomicInteger;

public class HorseRace {

    private final int NUMBER_OF_HORSES = 12;
    private final static int INIT_PARTIES = 1;
    private final static Phaser manager = new Phaser(INIT_PARTIES);

    public static void main(String[] args) {
        Thread raceMonitor = new Thread(new RaceMonitor());
        raceMonitor.setDaemon(true);
        raceMonitor.start();
        new HorseRace().manageRace();
    }

    public void manageRace() {
        ArrayList<Horse> horseArray = new ArrayList<Horse>();
        for (int i = 0; i < NUMBER_OF_HORSES; i++) {
            horseArray.add(new Horse());
        }
        runRace(horseArray);
    }

    private void runRace(Iterable<Horse> team) {
        log("Assign all horses, then start race");
        for (final Horse horse : team) {
            final String dev = horse.toString();
            log("assign " + dev + " to the race");
            manager.register();
            new Thread() {

                @Override
                public void run() {
                    try {
                        Thread.sleep((new Random()).nextInt(1000));
                    } catch (InterruptedException ex) {
                    }
                    log(dev + ", please await all horses");
                    manager.arriveAndAwaitAdvance();
                    horse.run();
                }
            }.start();
        }
        try {
            Thread.sleep(1000);
        } catch (InterruptedException ex) {
        }
        log("All arrived at starting gate, start race");
        manager.arriveAndDeregister();
    }

    private static void log(String msg) {
        System.out.println(msg);
    }

    private static class Horse implements Runnable {

        private final static AtomicInteger idSource = new AtomicInteger();
        private final int id = idSource.incrementAndGet();

        @Override
        public void run() {
            log(toString() + ": running");
        }

        @Override
        public String toString() {
            return "horse #" + id;
        }
    }

    private static class RaceMonitor implements Runnable {

        @Override
        public void run() {
            while (true) {
                System.out.println("Number of horses ready to run: "
                        + HorseRace.manager.getArrivedParties());
                try {
                    Thread.sleep(1);
                } catch (InterruptedException ex) {
                }
            }
        }
    }
}


text:
from setuptools import setup, find_packages
import glob

setup(
        name='bdkd-datastore',
        version='0.1.8',
        description='Store and retrieve sets of files from an object store',
        author='Sirca Ltd',
        author_email='balram.ramanathan@sirca.org.au',
        url='http://github.com/sirca/bdkd',
        package_dir={'': 'lib'},
        packages=find_packages('lib'),
        entry_points = {
            'console_scripts': [
                'datastore-util = bdkd.datastore.util.ds_util:ds_util',
            ],
        },
        install_requires=['boto', 'PyYAML']
        )


text:
from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response

def index_view(request):
    print('Incoming request')
    return Response('
Hello World!
', status_code=200)

if __name__ == '__main__':
    with Configurator() as config:
        config.add_route('index', '/')
        config.add_view(index_view, route_name='index')
        app = config.make_wsgi_app()
    server = make_server('0.0.0.0', 6543, app)
    server.serve_forever()


text:
layout: default
title: cd01
---

* [poshcomplete-vim](https://github.com/cd01/poshcomplete-vim)
* [vimppm](https://github.com/cd01/vimppm)
* [pull requests](https://github.com/pulls?q=is:pr+is:closed+author:cd01+-user:cd01+-repo:hirocaster/wdpress69+-repo:supermomonga/awesome-yamada)
* [issues](https://github.com/issues?q=is%3Aissue+author%3Acd01+-user%3Acd01)


text:
class Post < ActiveRecord::Base
  include PgSearch

  belongs_to :persona
  belongs_to :post_type
  belongs_to :warrant_type
  validates :title, presence: true

  delegate :name, to: :persona, prefix: true

  pg_search_scope :search_for, against: {
    title: 'A',
    body: 'B'
  }, using: {
    tsearch: {
      prefix: true,
      negation: true,
      any_word: true,
      dictionary: 'english'
    }
  }
  paginates_per 5

  scope :approved, -> { where.not(approved: nil) }
  scope :announcements, -> { joins(:post_type).where(drop_down_items: { type: 'PostType', name: 'Announcement' }) }

  delegate :name, to: :persona, prefix: true
end


text:
require "chordproko/chord"
require "chordproko/chord_group"
require "chordproko/comment"
require "chordproko/directive"
require "chordproko/line"
require "chordproko/lyric"
require "chordproko/newline"
require "chordproko/parser"
require "chordproko/plain_song"
require "chordproko/sheet"
require "chordproko/transform"
require "chordproko/version"
module Chordproko
	@@formatter = "Chordproko::PlainSong"

	def self.set_formatter_class formatter
		@@formatter = formatter
	end
  def self.text song, options={}
  	parsed = Chordproko::Parser.new.parse(song)
  	transformed = Transform.new.apply(parsed)
  	sheet = Object.const_get(@@formatter).new(transformed, options)
  	sheet.to_s
  end
end


text:
/* https://paulund.co.uk/how-to-style-a-checkbox-with-css */

input[type=checkbox] {
  visibility: hidden;
}

.checkboxTwo {
  width: 120px;
  height: 40px;
  background: #333;
  margin: 20px 60px;

  border-radius: 50px;
  position: relative;
}

.checkboxTwo:before {
  content: '';
  position: absolute;
  top: 19px;
  left: 14px;
  height: 2px;
  width: 90px;
  background: #111;
}

.checkboxTwo label {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;

  transition: all .5s ease;
  cursor: pointer;
  position: absolute;
  top: 9px;
  z-index: 1;
  left: 12px;
  background: #ddd;
}

.checkboxTwo input[type=checkbox]:checked + label {
  left: 84px;
  background: #26ca28;
}


text:
%% $Date: 2012-07-06 17:42:54#$
%% $Revision: 148 $
\index{CAI}
\algdescgeneral{CAI}
%
{ %%%%%% Algorithm name %%%%%%
biophys\_indices (CAI is one index calculated within the overall program)
}
%
{ %%%%%% Algorithm summary %%%%%%
Calculation of Cellulose Absorption Index (CAI)
}
%
{ %%%%%% Category %%%%%%
Biophysics - dry vegetation (stress) indices
}
%
{ %%%%%% Inputs %%%%%%
Narrow band multi- or hyperspectral imagery (ENVI standard image data) including channels close to the wavelengths of 2000nm, 2100nm and 2200nm.\bigskip
}
%
{ %%%%%% Outputs %%%%%%
Single band with CAI values
}
%
{ %%%%%% Formula %%%%%%
\begin{displaymath}
CAI = 0.5 * ( R_{2000} + R_{2200} ) - R_{2100}
\end{displaymath}
}
%
{ %%%%%% Author %%%%%%
DLR-DFD
}
%
{ %%%%%% References %%%%%%
Nagler, P.L., Daughtry, C.S.T., Goward, S.N. (2000): Plant Litter and Soil Reflectance. In: Remote Sensing of Environment, 71, P.207-215.
}


text:
package org.unitedinternet.cosmo.model.hibernate;

import static org.unitedinternet.cosmo.model.hibernate.CollectionItemConstants.ATTR_EXCLUDE_FREE_BUSY_ROLLUP;
import static org.unitedinternet.cosmo.model.hibernate.CollectionItemConstants.ATTR_HUE;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.OneToMany;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.unitedinternet.cosmo.model.CollectionItem;
import org.unitedinternet.cosmo.model.CollectionItemDetails;
import org.unitedinternet.cosmo.model.Item;
import org.unitedinternet.cosmo.model.ItemTombstone;

/**
 * Hibernate persistent CollectionItem.
 */
@Entity
@DiscriminatorValue("collection")
public class HibCollectionItem extends HibItem implements CollectionItem {

    /**
     *
     */
    private static final long serialVersionUID = 2873258323314048223L;

    @OneToMany(targetEntity=HibCollectionItemDetails.class, mappedBy="primaryKey.collection", fetch=FetchType.LAZY)
    @Cascade( {CascadeType.DELETE })
    private Set<CollectionItemDetails> childDetails = new HashSet<CollectionItemDetails>(0);

    private transient Set<Item> children = null;

    public HibCollectionItem() {
    };

    /* (non-Javadoc)
     * @see org.unitedinternet.cosmo.model.CollectionItem#getChildren()
     */
    public Set<Item> getChildren() {
        if(children!=null) {
            return children;
        }

        children = new HashSet<Item>();
        for(CollectionItemDetails cid: childDetails) {
            children.add(cid.getItem());
        }

        return children;
    }

    /* (non-Javadoc)
     * @see org.unitedinternet.cosmo.model.CollectionItem#getChildDetails(org.unitedinternet.cosmo.model.Item)
     */
    public CollectionItemDetails getChildDetails(Item item) {
        for(CollectionItemDetails cid: childDetails) {
            if(cid.getItem().getUid().equals(item.getUid()) &&
                    cid.getItem().getName().equals(item.getName())&&
                    cid.getItem().getOwner().getUid().equals(item.getOwner().getUid()) ) {
                return cid;
            }
        }

        return null;
    }

    /* (non-Javadoc)
     * @see org.unitedinternet.cosmo.model.CollectionItem#getChild(java.lang.String)
     */
    public Item getChild(String uid) {
        for (Item child : getChildren()) {
            if (child.getUid().equals(uid)) {
                return child;
            }
        }
        return null;
    }

    /* (non-Javadoc)
     * @see org.unitedinternet.cosmo.model.CollectionItem#getChildByName(java.lang.String)
     */
    public Item getChildByName(String name) {
        for (Item child : getChildren()) {
            if (child.getName().equals(name)) {
                return child;
            }
        }
        return null;
    }

    /* (non-Javadoc)
     * @see org.unitedinternet.cosmo.model.CollectionItem#isExcludeFreeBusyRollup()
     */
    public boolean isExcludeFreeBusyRollup() {
        Boolean bv =  HibBooleanAttribute.getValue(this, ATTR_EXCLUDE_FREE_BUSY_ROLLUP);
        if(bv==null) {
            return false;
        }
        else {
            return bv.booleanValue();
        }
    }

    /* (non-Javadoc)
     * @see org.unitedinternet.cosmo.model.CollectionItem#setExcludeFreeBusyRollup(boolean)
     */
    public void setExcludeFreeBusyRollup(boolean flag) {
        HibBooleanAttribute.setValue(this, ATTR_EXCLUDE_FREE_BUSY_ROLLUP, flag);
    }

    /* (non-Javadoc)
     * @see org.unitedinternet.cosmo.model.CollectionItem#getHue()
     */
    public Long getHue() {
        return HibIntegerAttribute.getValue(this, ATTR_HUE);
    }

    /* (non-Javadoc)
     * @see org.unitedinternet.cosmo.model.CollectionItem#setHue(java.lang.Long)
     */
    public void setHue(Long value) {
        HibIntegerAttribute.setValue(this, ATTR_HUE, value);
    }

    /**
     * Remove ItemTombstone with an itemUid equal to a given Item's uid
     * @param item
     * @return true if a tombstone was removed
     */
    public boolean removeTombstone(Item item) {
        ItemTombstone ts = new HibItemTombstone(this, item);
        return tombstones.remove(ts);
    }

    /* (non-Javadoc)
     * @see org.unitedinternet.cosmo.model.CollectionItem#generateHash()
     */
    public int generateHash() {
        return getVersion();
    }

    public Item copy() {
        CollectionItem copy = new HibCollectionItem();
        copyToItem(copy);
        return copy;
    }
}


text:
file(REMOVE_RECURSE
  "CMakeFiles/path_planning.dir/src/main.cpp.o"
  "path_planning.pdb"
  "path_planning"
)

# Per-language clean rules from dependency scanning.
foreach(lang CXX)
  include(CMakeFiles/path_planning.dir/cmake_clean_${lang}.cmake OPTIONAL)
endforeach()


text:
/*
  Include declarations.
*/
#include "magick/studio.h"
#include "magick/blob.h"
#include "magick/blob-private.h"
#include "magick/color.h"
#include "magick/constitute.h"
#include "magick/draw.h"
#include "magick/exception.h"
#include "magick/exception-private.h"
#include "magick/delegate.h"
#include "magick/geometry.h"
#include "magick/histogram.h"
#include "magick/image.h"
#include "magick/image-private.h"
#include "magick/list.h"
#include "magick/magick.h"
#include "magick/memory_.h"
#include "magick/monitor.h"
#include "magick/monitor-private.h"
#include "magick/quantize.h"
#include "magick/resource_.h"
#include "magick/quantum-private.h"
#include "magick/static.h"
#include "magick/string_.h"
#include "magick/module.h"
#include "magick/transform.h"
#include "magick/utility.h"

/*
  Typedef declarations.
*/
typedef struct _EPTInfo
{
  size_t
    magick;

  MagickOffsetType
    postscript_offset,
    tiff_offset;

  size_t
    postscript_length,
    tiff_length;

  unsigned char
    *postscript,
    *tiff;
} EPTInfo;

/*
  Forward declarations.
*/
static MagickBooleanType
  WriteEPTImage(const ImageInfo *,Image *);

/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   I s E P T                                                                 %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  IsEPT() returns MagickTrue if the image format type, identified by the
%  magick string, is EPT.
%
%  The format of the IsEPT method is:
%
%      MagickBooleanType IsEPT(const unsigned char *magick,const size_t length)
%
%  A description of each parameter follows:
%
%    o magick: compare image format pattern against these bytes.
%
%    o length: Specifies the length of the magick string.
%
*/
static MagickBooleanType IsEPT(const unsigned char *magick,const size_t length)
{
  if (length < 4)
    return(MagickFalse);
  if (memcmp(magick,"\305\320\323\306",4) == 0)
    return(MagickTrue);
  return(MagickFalse);
}

/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   R e a d E P T I m a g e                                                   %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  ReadEPTImage() reads a binary Postscript image file and returns it.  It
%  allocates the memory necessary for the new Image structure and returns a
%  pointer to the new image.
%
%  The format of the ReadEPTImage method is:
%
%      Image *ReadEPTImage(const ImageInfo *image_info,
%        ExceptionInfo *exception)
%
%  A description of each parameter follows:
%
%    o image_info: the image info.
%
%    o exception: return any errors or warnings in this structure.
%
*/
static Image *ReadEPTImage(const ImageInfo *image_info,ExceptionInfo *exception)
{
  EPTInfo
    ept_info;

  Image
    *image;

  ImageInfo
    *read_info;

  MagickBooleanType
    status;

  MagickOffsetType
    offset;

  ssize_t
    count;

  /*
    Open image file.
  */
  assert(image_info != (const ImageInfo *) NULL);
  assert(image_info->signature == MagickSignature);
  if (image_info->debug != MagickFalse)
    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
      image_info->filename);
  assert(exception != (ExceptionInfo *) NULL);
  assert(exception->signature == MagickSignature);
  image=AcquireImage(image_info);
  status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
  if (status == MagickFalse)
    {
      image=DestroyImageList(image);
      return((Image *) NULL);
    }
  ept_info.magick=ReadBlobLSBLong(image);
  if (ept_info.magick != 0xc6d3d0c5ul)
    ThrowReaderException(CorruptImageError,"ImproperImageHeader");
  ept_info.postscript_offset=(MagickOffsetType) ReadBlobLSBLong(image);
  ept_info.postscript_length=ReadBlobLSBLong(image);
  (void) ReadBlobLSBLong(image);
  (void) ReadBlobLSBLong(image);
  ept_info.tiff_offset=(MagickOffsetType) ReadBlobLSBLong(image);
  ept_info.tiff_length=ReadBlobLSBLong(image);
  (void) ReadBlobLSBShort(image);
  ept_info.postscript=(unsigned char *) AcquireQuantumMemory(
    ept_info.postscript_length+1,sizeof(*ept_info.postscript));
  if (ept_info.postscript == (unsigned char *) NULL)
    ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
  (void) ResetMagickMemory(ept_info.postscript,0,(ept_info.postscript_length+1)*
    sizeof(*ept_info.postscript));
  ept_info.tiff=(unsigned char *) AcquireQuantumMemory(ept_info.tiff_length+1,
    sizeof(*ept_info.tiff));
  if (ept_info.tiff == (unsigned char *) NULL)
    ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
  (void) ResetMagickMemory(ept_info.tiff,0,(ept_info.tiff_length+1)*
    sizeof(*ept_info.tiff));
  offset=SeekBlob(image,ept_info.tiff_offset,SEEK_SET);
  if (offset < 0)
    ThrowReaderException(CorruptImageError,"ImproperImageHeader");
  count=ReadBlob(image,ept_info.tiff_length,ept_info.tiff);
  if (count != (ssize_t) (ept_info.tiff_length))
    (void) ThrowMagickException(exception,GetMagickModule(),CorruptImageWarning,
      "InsufficientImageDataInFile","`%s'",image->filename);
  offset=SeekBlob(image,ept_info.postscript_offset,SEEK_SET);
  if (offset < 0)
    ThrowReaderException(CorruptImageError,"ImproperImageHeader");
  count=ReadBlob(image,ept_info.postscript_length,ept_info.postscript);
  if (count != (ssize_t) (ept_info.postscript_length))
    (void) ThrowMagickException(exception,GetMagickModule(),CorruptImageWarning,
      "InsufficientImageDataInFile","`%s'",image->filename);
  (void) CloseBlob(image);
  image=DestroyImage(image);
  read_info=CloneImageInfo(image_info);
  (void) CopyMagickString(read_info->magick,"EPS",MaxTextExtent);
  image=BlobToImage(read_info,ept_info.postscript,ept_info.postscript_length,
    exception);
  if (image == (Image *) NULL)
    {
      (void) CopyMagickString(read_info->magick,"TIFF",MaxTextExtent);
      image=BlobToImage(read_info,ept_info.tiff,ept_info.tiff_length,exception);
    }
  read_info=DestroyImageInfo(read_info);
  if (image != (Image *) NULL)
    (void) CopyMagickString(image->filename,image_info->filename,MaxTextExtent);
  ept_info.tiff=(unsigned char *) RelinquishMagickMemory(ept_info.tiff);
  ept_info.postscript=(unsigned char *) RelinquishMagickMemory(
    ept_info.postscript);
  return(image);
}

/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   R e g i s t e r E P T I m a g e                                           %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  RegisterEPTImage() adds attributes for the EPT image format to
%  the list of supported formats.  The attributes include the image format
%  tag, a method to read and/or write the format, whether the format
%  supports the saving of more than one frame to the same file or blob,
%  whether the format supports native in-memory I/O, and a brief
%  description of the format.
%
%  The format of the RegisterEPTImage method is:
%
%      size_t RegisterEPTImage(void)
%
*/
ModuleExport size_t RegisterEPTImage(void)
{
  MagickInfo
    *entry;

  entry=SetMagickInfo("EPT");
  entry->decoder=(DecodeImageHandler *) ReadEPTImage;
  entry->encoder=(EncodeImageHandler *) WriteEPTImage;
  entry->magick=(IsImageFormatHandler *) IsEPT;
  entry->seekable_stream=MagickTrue;
  entry->adjoin=MagickFalse;
  entry->blob_support=MagickFalse;
  entry->description=ConstantString(
    "Encapsulated PostScript with TIFF preview");
  entry->module=ConstantString("EPT");
  (void) RegisterMagickInfo(entry);
  entry=SetMagickInfo("EPT2");
  entry->decoder=(DecodeImageHandler *) ReadEPTImage;
  entry->encoder=(EncodeImageHandler *) WriteEPTImage;
  entry->magick=(IsImageFormatHandler *) IsEPT;
  entry->adjoin=MagickFalse;
  entry->seekable_stream=MagickTrue;
  entry->blob_support=MagickFalse;
  entry->description=ConstantString(
    "Encapsulated PostScript Level II with TIFF preview");
  entry->module=ConstantString("EPT");
  (void) RegisterMagickInfo(entry);
  entry=SetMagickInfo("EPT3");
  entry->decoder=(DecodeImageHandler *) ReadEPTImage;
  entry->encoder=(EncodeImageHandler *) WriteEPTImage;
  entry->magick=(IsImageFormatHandler *) IsEPT;
  entry->seekable_stream=MagickTrue;
  entry->blob_support=MagickFalse;
  entry->description=ConstantString(
    "Encapsulated PostScript Level III with TIFF preview");
  entry->module=ConstantString("EPT");
  (void) RegisterMagickInfo(entry);
  return(MagickImageCoderSignature);
}

/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   U n r e g i s t e r E P T I m a g e                                       %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  UnregisterEPTImage() removes format registrations made by the
%  EPT module from the list of supported formats.
%
%  The format of the UnregisterEPTImage method is:
%
%      UnregisterEPTImage(void)
%
*/
ModuleExport void UnregisterEPTImage(void)
{
  (void) UnregisterMagickInfo("EPT");
}

/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                                             %
%                                                                             %
%                                                                             %
%   W r i t e E P T I m a g e                                                 %
%                                                                             %
%                                                                             %
%                                                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%  WriteEPTImage() writes an image in the Encapsulated Postscript format
%  with a TIFF preview.
%
%  The format of the WriteEPTImage method is:
%
%      MagickBooleanType WriteEPTImage(const ImageInfo *image_info,Image *image)
%
%  A description of each parameter follows.
%
%    o image_info: the image info.
%
%    o image:  The image.
%
*/
static MagickBooleanType WriteEPTImage(const ImageInfo *image_info,Image *image)
{
  char
     filename[MaxTextExtent];

  EPTInfo
    ept_info;

  Image
    *write_image;

  ImageInfo
    *write_info;

  MagickBooleanType
    status;

  /*
    Write EPT image.
  */
  assert(image_info != (const ImageInfo *) NULL);
  assert(image_info->signature == MagickSignature);
  assert(image != (Image *) NULL);
  assert(image->signature == MagickSignature);
  if (image->debug != MagickFalse)
    (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
  status=OpenBlob(image_info,image,WriteBinaryBlobMode,&image->exception);
  if (status == MagickFalse)
    return(status);
  write_image=CloneImage(image,0,0,MagickTrue,&image->exception);
  if (write_image == (Image *) NULL)
    return(MagickFalse);
  write_info=CloneImageInfo(image_info);
  (void) CopyMagickString(write_info->magick,"EPS",MaxTextExtent);
  if (LocaleCompare(image_info->magick,"EPT2") == 0)
    (void) CopyMagickString(write_info->magick,"EPS2",MaxTextExtent);
  if (LocaleCompare(image_info->magick,"EPT3") == 0)
    (void) CopyMagickString(write_info->magick,"EPS3",MaxTextExtent);
  (void) ResetMagickMemory(&ept_info,0,sizeof(ept_info));
  ept_info.magick=0xc6d3d0c5ul;
  ept_info.postscript=(unsigned char *) ImageToBlob(write_info,write_image,
    &ept_info.postscript_length,&image->exception);
  write_image=DestroyImage(write_image);
  write_info=DestroyImageInfo(write_info);
  if (ept_info.postscript == (void *) NULL)
    return(MagickFalse);
  write_image=CloneImage(image,0,0,MagickTrue,&image->exception);
  if (write_image == (Image *) NULL)
    return(MagickFalse);
  write_info=CloneImageInfo(image_info);
  (void) CopyMagickString(write_info->magick,"TIFF",MaxTextExtent);
  (void) FormatLocaleString(filename,MaxTextExtent,"tiff:%s",
    write_info->filename);
  (void) CopyMagickString(write_info->filename,filename,MaxTextExtent);
  (void) TransformImage(&write_image,(char *) NULL,"512x512>");
  if ((write_image->storage_class == DirectClass) ||
      (write_image->colors > 256))
    {
      QuantizeInfo
        quantize_info;

      /*
        EPT preview requires that the image is colormapped.
      */
      GetQuantizeInfo(&quantize_info);
      quantize_info.dither=IsPaletteImage(write_image,&image->exception) ==
        MagickFalse ? MagickTrue : MagickFalse;
      (void) QuantizeImage(&quantize_info,write_image);
    }
  write_info->compression=NoCompression;
  ept_info.tiff=(unsigned char *) ImageToBlob(write_info,write_image,
    &ept_info.tiff_length,&image->exception);
  write_image=DestroyImage(write_image);
  write_info=DestroyImageInfo(write_info);
  if (ept_info.tiff == (void *) NULL)
    {
      ept_info.postscript=(unsigned char *) RelinquishMagickMemory(
        ept_info.postscript);
      return(MagickFalse);
    }
  /*
    Write EPT image.
  */
  (void) WriteBlobLSBLong(image,(unsigned int) ept_info.magick);
  (void) WriteBlobLSBLong(image,30);
  (void) WriteBlobLSBLong(image,(unsigned int) ept_info.postscript_length);
  (void) WriteBlobLSBLong(image,0);
  (void) WriteBlobLSBLong(image,0);
  (void) WriteBlobLSBLong(image,(unsigned int) ept_info.postscript_length+30);
  (void) WriteBlobLSBLong(image,(unsigned int) ept_info.tiff_length);
  (void) WriteBlobLSBShort(image,0xffff);
  (void) WriteBlob(image,ept_info.postscript_length,ept_info.postscript);
  (void) WriteBlob(image,ept_info.tiff_length,ept_info.tiff);
  /*
    Relinquish resources.
  */
  ept_info.postscript=(unsigned char *) RelinquishMagickMemory(
    ept_info.postscript);
  ept_info.tiff=(unsigned char *) RelinquishMagickMemory(ept_info.tiff);
  (void) CloseBlob(image);
  return(MagickTrue);
}


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <TextView
        android:id="@+id/label"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />

    <EditText
        android:id="@+id/value"
        android:layout_below="@id/label"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="text" />

</RelativeLayout>


text:
package com.microsoft.azure.storage.table;

/**
 * Describes the payload formats supported for Tables.
 */
public enum TablePayloadFormat {
    /**
     * Use JSON with full metadata.
     */
    JsonFullMetadata,

    /**
     * Use JSON with minimal metadata.
     */
    Json,

    /**
     * Use JSON with no metadata.
     */
    JsonNoMetadata
}


text:
namespace Digimezzo.WPFControls.Enums
{
    public enum SlideDirection
    {
        LeftToRight = 1,
        RightToLeft = 2,
        UpToDown = 3,
        DownToUp = 4
    }
}


text:
package nz.org.nesi.goji.model.events;

public class EndpointCreatingEvent extends EndpointEvent {

	public EndpointCreatingEvent(String ep) {
		super(ep);
	}

}


text:
layout: slides
title: "Paper-topic discussions"
category: hidden
type: course
semester: Fall 2018
college: Wellesley College
permalink: /cognition/paper/
---
# On the paper.

<img src="https://images.unsplash.com/photo-1530819568329-97653eafbbfa" width="60%" />

???

---

class: center, middle, statement, dark
< recap >

---

class: center, middle, statement, dark
The mind faces many maddeningly hard engineering problems, and we have an arsenal of mental faculties for solving each of them approximately.

---

class: center, middle, statement, dark
We have representations of space, quantity, value, the future, and the past.

---

class: center, middle, statement, dark
We can also represent time.

---

class: center, middle, statement, dark
Perception is bounded temporally, with events that are too quick or too slow. We create technologies to perceive temporal scales beyond these bounds (e.g., Muybridge's photos of a galloping horse).

---

class: center, middle, statement, dark
We represent the past, the present, and the future.

---

class: center, middle, statement, dark
The present moment is a physical reality, but the present as an extended interval is a psychological construction (the "specious present").

---

class: center, middle, statement, dark
"Living systems contain self-sustaining biochemical and biophysical oscillations,
whose periods range from fractions of a second to a year and perhaps
more" — Gallistel

---

class: center, middle, statement, dark
We have a circadian rhythm (e.g., that guy in a cave).

---

class: center, middle, statement, dark
We have neural oscillations at a range of frequencies.

---

class: center, middle, statement, dark
And disorders, such as Parkinson's, seem to affect the timescale of experience and action.

---

class: center, middle, statement, dark
We can also represent cause and effect.

---

class: center, middle, statement, dark
Causation does not equal correlation, but even so, from correlations we can infer causality.

---

class: center, middle, statement, dark
Michotte's studies of launching events were some of the early experiments on the perception of causality. Manipulating the timing and other factors affect perception of causality.

---

class: center, middle, statement, dark
From Heider & Simmel's movies of correlated movements of shape, we infer a whole world of causal factors, such as chasing and hiding.

---

class: center, middle, statement, dark
Causal graphical models (Bayes nets) are a useful tool for representing the causal structure of probabilistic events. They are made up of nodes that represent events or properties, directed edges that represent causation, and (conditional) probability tables that attach to nodes.

---

class: center, middle, statement, dark
One can draw a casual model that reflects our best understanding of causality, or instead one that reflects a person's incorrect theory about how a particular causal system works.

---

class: center, middle, statement, dark
Occam's razor is the idea that simpler explanations are better explanations. But what is "simpler"? Fewer root causes? Fewer nodes in the casual graphical model? It's up for debate.

---

class: center, middle, statement, dark
Networks aren't usefuly only for representing causality through Bayes nets.

---

class: center, middle, statement, dark
We can use networks to represent the structure of our knowledge.

---

class: center, middle, statement, dark
We can use networks to describe social ties.

---

class: center, middle, statement, dark
We can use networks to learn.

---

class: center, middle, statement, dark
Networks are made up of {nodes, vertices, entities} and {edges, links}, and can be directed or undirected, weighted or unweighted.

---

class: center, middle, statement, dark
We can also represent other people, their thoughts, their thoughts about our thoughts, &c.

---

class: center, middle, statement, dark
Theory of mind is the spark of social cognition, as seen in the Sally-Anne task.

---

class: center, middle, statement, dark
There is a debate as to whether theory of mind is best thought of as an intuitive theory ("Theory theory") or rather is the result of simulating what others would think using your own mind ("Simulation theory").

---

class: center, middle, statement, dark
Many social scenarios benefit from social reasoning and their essences are captured in economic games.

---

class: center, middle, statement, dark
Consider Keynesian beauty contests.

---

class: center, middle, statement, dark
Schelling coordination games and focal points ("Schelling points").

---

class: center, middle, statement, dark
And the El Farol Problem / minority game.

---

class: center, middle, statement, dark
But social reasoning has its limits — it is bounded.

---

class: center, middle, statement, dark
One such limit is a recursion limit, how many nested layers of thinking about think we can do.

---

class: center, middle, statement, dark
</ recap >

---

# Administrivia
- Attendance sheet
- Assignment #6, answer key

---

# The paper.

- Goal is to answer the question you posed, leveraging existing research
- ~2000 words
- APA format
- 1 << references << 100

---

# Warmup, at start of each round

- Introduce yourselves
- Wall person poses question
- Rotating person asks any clarifying questions
- Rotating person restates the question
- Wall person confirms that rotating person understood

---

# Warmup 1 (1 minute)

---

# Warmup 2 (1 minute)

---

# Warmup 3 (1 minute)

---

# Warmup 4 (1 minute)

---

# Warmup 5 (1 minute)

---

# Round 1 (5 minutes)

How might you analyze the phenomenon at Marr's computational level of analysis?

---

# Round 2 (5 minutes)

What personal experiences have you had that relate to the question? (Alternatively, have you seen the phenomenon appear in movies, books, plays, or in other artforms?)

---

# Round 3 (5 minutes)

How might you analyze the phenomenon at Marr's representational/algorithmic level of analysis?

---

# Round 4 (5 minutes)

What other fields, besides psychology or neuroscience, might have something useful to say about the question?

---

# Round 5 (5 minutes)

How might you analyze the phenomenon at Marr's implementation level of analysis?

---

class: center, middle
# Fin.


text:
require 'spec_helper'

feature 'Deleting an user', type: :feature do
  background do
    @user = create :user, :admin
    login_as @user
  end

  let!(:other) { create :user }

  scenario 'As a user I can not delete users' do
    @user.update_column :admin, false

    expect { page.driver.delete user_path other }.not_to change { User.count }
    expect(page.driver.status_code).to eq 302 # redirect
  end

  scenario 'As an admin I can delete users' do
    visit users_path other

    expect {
      click_link 'Delete', href: user_path(other)
    }.to change { User.count }.by -1
  end
end


text:
/*
Enter your query here.
*/
SELECT ROUND(MIN(LAT_N), 4) FROM STATION WHERE LAT_N > 38.7780;


text:
using System.Diagnostics.Contracts;
using DotNetRevolution.Core.Domain.CodeContract;

namespace DotNetRevolution.Core.Domain
{
    [ContractClass(typeof(DomainEventDispatcherContract))]
    public interface IDomainEventDispatcher
    {
        void Publish(params IDomainEventHandlerContext[] contexts);

        void Publish(params IDomainEvent[] domainEvents);
    }
}


text:
/*
 * Do not modify this file. This file is generated from the kms-2014-11-01.normal.json service model.
 */
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Net;
using System.Text;
using System.Xml.Serialization;

using Amazon.KeyManagementService.Model;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
using Amazon.Runtime.Internal.Transform;
using Amazon.Runtime.Internal.Util;
using ThirdParty.Json.LitJson;

namespace Amazon.KeyManagementService.Model.Internal.MarshallTransformations
{
    /// <summary>
    /// Response Unmarshaller for ListAliases operation
    /// </summary>
    public class ListAliasesResponseUnmarshaller : JsonResponseUnmarshaller
    {
        /// <summary>
        /// Unmarshaller the response from the service to the response class.
        /// </summary>
        /// <param name="context"></param>
        /// <returns></returns>
        public override AmazonWebServiceResponse Unmarshall(JsonUnmarshallerContext context)
        {
            ListAliasesResponse response = new ListAliasesResponse();

            context.Read();
            int targetDepth = context.CurrentDepth;
            while (context.ReadAtDepth(targetDepth))
            {
                if (context.TestExpression("Aliases", targetDepth))
                {
                    var unmarshaller = new ListUnmarshaller<AliasListEntry, AliasListEntryUnmarshaller>(AliasListEntryUnmarshaller.Instance);
                    response.Aliases = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("NextMarker", targetDepth))
                {
                    var unmarshaller = StringUnmarshaller.Instance;
                    response.NextMarker = unmarshaller.Unmarshall(context);
                    continue;
                }
                if (context.TestExpression("Truncated", targetDepth))
                {
                    var unmarshaller = BoolUnmarshaller.Instance;
                    response.Truncated = unmarshaller.Unmarshall(context);
                    continue;
                }
            }

            return response;
        }

        /// <summary>
        /// Unmarshaller error response to exception.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="innerException"></param>
        /// <param name="statusCode"></param>
        /// <returns></returns>
        public override AmazonServiceException UnmarshallException(JsonUnmarshallerContext context, Exception innerException, HttpStatusCode statusCode)
        {
            ErrorResponse errorResponse = JsonErrorResponseUnmarshaller.GetInstance().Unmarshall(context);
            if (errorResponse.Code != null && errorResponse.Code.Equals("DependencyTimeout"))
            {
                return new DependencyTimeoutException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
            }
            if (errorResponse.Code != null && errorResponse.Code.Equals("InvalidMarker"))
            {
                return new InvalidMarkerException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
            }
            if (errorResponse.Code != null && errorResponse.Code.Equals("KMSInternal"))
            {
                return new KMSInternalException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
            }
            return new AmazonKeyManagementServiceException(errorResponse.Message, innerException, errorResponse.Type, errorResponse.Code, errorResponse.RequestId, statusCode);
        }

        private static ListAliasesResponseUnmarshaller _instance = new ListAliasesResponseUnmarshaller();

        internal static ListAliasesResponseUnmarshaller GetInstance()
        {
            return _instance;
        }

        /// <summary>
        /// Gets the singleton.
        /// </summary>
        public static ListAliasesResponseUnmarshaller Instance
        {
            get
            {
                return _instance;
            }
        }

    }
}


text:
LA LISTE DES COURS

    <form name="form" method="post" role="form" class="form-horizontal" novalidate>

            Rechercher

                <input placeholder = "la recherche par nom" type="text" id="search" class="form-control col-sm-4" ng-model="query">

                <select id="options" class="form-control" ng-model="departement" ng-options="departement.id as departement.code  for departement in departements | orderBy: 'code'"></select>

                <button class="btn btn-success" ng-click="filtrer()">Filtrer</button>

    </form>

                Numero

                Intitule
                Type de cours
                Actions

                {{(currentPage - 1) * itemsPerPage + $index + 1}}

                {{cour.intitule}}
                {{cour.typeCours.nom}}
                  Modifier |    Supprimer

    <pagination  boundary-links="true" total-items="totalItems" ng-model="currentPage" ng-change="pageChanged()" previous-text="‹" next-text="›" first-text="«" last-text="»"></pagination>
    <form>
        <button class="btn btn-primary" ng-click="afficherFenetre()">Ajouter un Cours</button>
    </form>


text:
namespace System.Buffers
{
    internal sealed class ArrayPoolEventSource
    {
        internal readonly static ArrayPoolEventSource Log = new ArrayPoolEventSource();

        // TODO: EventSource instrumentation https://github.com/dotnet/corert/issues/2414

        internal bool IsEnabled()
        {
            return false;
        }

        internal enum BufferAllocatedReason : int
        {
            Pooled,
            OverMaximumSize,
            PoolExhausted
        }

        internal void BufferRented(int bufferId, int bufferSize, int poolId, int bucketId)
        {
        }

        internal void BufferAllocated(int bufferId, int bufferSize, int poolId, int bucketId, BufferAllocatedReason reason)
        {
        }

        internal void BufferReturned(int bufferId, int bufferSize, int poolId)
        {
        }
    }
}


text:
package main

import (
	"bytes"
	"crypto/md5"
	"fmt"
	"go/ast"
	"go/format"
	"go/printer"
	"go/token"
	"go/types"
	"io"
	"io/ioutil"
	"os"
	"os/exec"
	"path/filepath"
	"regexp"
	"strings"
	"syscall"

	"github.com/jessevdk/go-flags"
	"github.com/zimmski/go-tool/importing"
	"github.com/zimmski/osutil"

	"github.com/zimmski/go-mutesting"
	"github.com/zimmski/go-mutesting/astutil"
	"github.com/zimmski/go-mutesting/mutator"
	_ "github.com/zimmski/go-mutesting/mutator/branch"
	_ "github.com/zimmski/go-mutesting/mutator/expression"
	_ "github.com/zimmski/go-mutesting/mutator/statement"
)

const (
	returnOk = iota
	returnHelp
	returnBashCompletion
	returnError
)

type options struct {
	General struct {
		Debug                bool `long:"debug" description:"Debug log output"`
		DoNotRemoveTmpFolder bool `long:"do-not-remove-tmp-folder" description:"Do not remove the tmp folder where all mutations are saved to"`
		Help                 bool `long:"help" description:"Show this help message"`
		Verbose              bool `long:"verbose" description:"Verbose log output"`
	} `group:"General options"`

	Files struct {
		Blacklist []string `long:"blacklist" description:"List of MD5 checksums of mutations which should be ignored. Each checksum must end with a new line character."`
		ListFiles bool     `long:"list-files" description:"List found files"`
		PrintAST  bool     `long:"print-ast" description:"Print the ASTs of all given files and exit"`
	} `group:"File options"`

	Mutator struct {
		DisableMutators []string `long:"disable" description:"Disable mutator by their name or using * as a suffix pattern"`
		ListMutators    bool     `long:"list-mutators" description:"List all available mutators"`
	} `group:"Mutator options"`

	Filter struct {
		Match string `long:"match" description:"Only functions are mutated that confirm to the arguments regex"`
	} `group:"Filter options"`

	Exec struct {
		Exec    string `long:"exec" description:"Execute this command for every mutation (by default the built-in exec command is used)"`
		NoExec  bool   `long:"no-exec" description:"Skip the built-in exec command and just generate the mutations"`
		Timeout uint   `long:"exec-timeout" description:"Sets a timeout for the command execution (in seconds)" default:"10"`
	} `group:"Exec options"`

	Test struct {
		Recursive bool `long:"test-recursive" description:"Defines if the executer should test recursively"`
	} `group:"Test options"`

	Remaining struct {
		Targets []string `description:"Packages, directories and files even with patterns (by default the current directory)"`
	} `positional-args:"true" required:"true"`
}

func checkArguments(args []string, opts *options) (bool, int) {
	p := flags.NewNamedParser("go-mutesting", flags.None)

	p.ShortDescription = "Mutation testing for Go source code"

	if _, err := p.AddGroup("go-mutesting", "go-mutesting arguments", opts); err != nil {
		return true, exitError(err.Error())
	}

	completion := len(os.Getenv("GO_FLAGS_COMPLETION")) > 0

	_, err := p.ParseArgs(args)
	if (opts.General.Help || len(args) == 0) && !completion {
		p.WriteHelp(os.Stdout)

		return true, returnHelp
	} else if opts.Mutator.ListMutators {
		for _, name := range mutator.List() {
			fmt.Println(name)
		}

		return true, returnOk
	}

	if err != nil {
		return true, exitError(err.Error())
	}

	if completion {
		return true, returnBashCompletion
	}

	if opts.General.Debug {
		opts.General.Verbose = true
	}

	return false, 0
}

func debug(opts *options, format string, args ...interface{}) {
	if opts.General.Debug {
		fmt.Printf(format+"\n", args...)
	}
}

func verbose(opts *options, format string, args ...interface{}) {
	if opts.General.Verbose || opts.General.Debug {
		fmt.Printf(format+"\n", args...)
	}
}

func exitError(format string, args ...interface{}) int {
	_, _ = fmt.Fprintf(os.Stderr, format+"\n", args...)

	return returnError
}

type mutatorItem struct {
	Name    string
	Mutator mutator.Mutator
}

type mutationStats struct {
	passed     int
	failed     int
	duplicated int
	skipped    int
}

func (ms *mutationStats) Score() float64 {
	total := ms.Total()

	if total == 0 {
		return 0.0
	}

	return float64(ms.passed) / float64(total)
}

func (ms *mutationStats) Total() int {
	return ms.passed + ms.failed + ms.skipped
}

func mainCmd(args []string) int {
	var opts = &options{}
	var mutationBlackList = map[string]struct{}{}

	if exit, exitCode := checkArguments(args, opts); exit {
		return exitCode
	}

	files := importing.FilesOfArgs(opts.Remaining.Targets)
	if len(files) == 0 {
		return exitError("Could not find any suitable Go source files")
	}

	if opts.Files.ListFiles {
		for _, file := range files {
			fmt.Println(file)
		}

		return returnOk
	} else if opts.Files.PrintAST {
		for _, file := range files {
			fmt.Println(file)

			src, _, err := mutesting.ParseFile(file)
			if err != nil {
				return exitError("Could not open file %q: %v", file, err)
			}

			mutesting.PrintWalk(src)

			fmt.Println()
		}

		return returnOk
	}

	if len(opts.Files.Blacklist) > 0 {
		for _, f := range opts.Files.Blacklist {
			c, err := ioutil.ReadFile(f)
			if err != nil {
				return exitError("Cannot read blacklist file %q: %v", f, err)
			}

			for _, line := range strings.Split(string(c), "\n") {
				if line == "" {
					continue
				}

				if len(line) != 32 {
					return exitError("%q is not a MD5 checksum", line)
				}

				mutationBlackList[line] = struct{}{}
			}
		}
	}

	var mutators []mutatorItem

MUTATOR:
	for _, name := range mutator.List() {
		if len(opts.Mutator.DisableMutators) > 0 {
			for _, d := range opts.Mutator.DisableMutators {
				pattern := strings.HasSuffix(d, "*")

				if (pattern && strings.HasPrefix(name, d[:len(d)-2])) || (!pattern && name == d) {
					continue MUTATOR
				}
			}
		}

		verbose(opts, "Enable mutator %q", name)

		m, _ := mutator.New(name)
		mutators = append(mutators, mutatorItem{
			Name:    name,
			Mutator: m,
		})
	}

	tmpDir, err := ioutil.TempDir("", "go-mutesting-")
	if err != nil {
		panic(err)
	}
	verbose(opts, "Save mutations into %q", tmpDir)

	var execs []string
	if opts.Exec.Exec != "" {
		execs = strings.Split(opts.Exec.Exec, " ")
	}

	stats := &mutationStats{}

	for _, file := range files {
		verbose(opts, "Mutate %q", file)

		src, fset, pkg, info, err := mutesting.ParseAndTypeCheckFile(file)
		if err != nil {
			return exitError(err.Error())
		}

		err = os.MkdirAll(tmpDir+"/"+filepath.Dir(file), 0755)
		if err != nil {
			panic(err)
		}

		tmpFile := tmpDir + "/" + file

		originalFile := fmt.Sprintf("%s.original", tmpFile)
		err = osutil.CopyFile(file, originalFile)
		if err != nil {
			panic(err)
		}
		debug(opts, "Save original into %q", originalFile)

		mutationID := 0

		if opts.Filter.Match != "" {
			m, err := regexp.Compile(opts.Filter.Match)
			if err != nil {
				return exitError("Match regex is not valid: %v", err)
			}

			for _, f := range astutil.Functions(src) {
				if m.MatchString(f.Name.Name) {
					mutationID = mutate(opts, mutators, mutationBlackList, mutationID, pkg, info, file, fset, src, f, tmpFile, execs, stats)
				}
			}
		} else {
			_ = mutate(opts, mutators, mutationBlackList, mutationID, pkg, info, file, fset, src, src, tmpFile, execs, stats)
		}
	}

	if !opts.General.DoNotRemoveTmpFolder {
		err = os.RemoveAll(tmpDir)
		if err != nil {
			panic(err)
		}
		debug(opts, "Remove %q", tmpDir)
	}

	if !opts.Exec.NoExec {
		fmt.Printf("The mutation score is %f (%d passed, %d failed, %d duplicated, %d skipped, total is %d)\n", stats.Score(), stats.passed, stats.failed, stats.duplicated, stats.skipped, stats.Total())
	} else {
		fmt.Println("Cannot do a mutation testing summary since no exec command was executed.")
	}

	return returnOk
}

func mutate(opts *options, mutators []mutatorItem, mutationBlackList map[string]struct{}, mutationID int, pkg *types.Package, info *types.Info, file string, fset *token.FileSet, src ast.Node, node ast.Node, tmpFile string, execs []string, stats *mutationStats) int {
	for _, m := range mutators {
		debug(opts, "Mutator %s", m.Name)

		changed := mutesting.MutateWalk(pkg, info, node, m.Mutator)

		for {
			_, ok := <-changed

			if !ok {
				break
			}

			mutationFile := fmt.Sprintf("%s.%d", tmpFile, mutationID)
			checksum, duplicate, err := saveAST(mutationBlackList, mutationFile, fset, src)
			if err != nil {
				fmt.Printf("INTERNAL ERROR %s\n", err.Error())
			} else if duplicate {
				debug(opts, "%q is a duplicate, we ignore it", mutationFile)

				stats.duplicated++
			} else {
				debug(opts, "Save mutation into %q with checksum %s", mutationFile, checksum)

				if !opts.Exec.NoExec {
					execExitCode := mutateExec(opts, pkg, file, src, mutationFile, execs)

					debug(opts, "Exited with %d", execExitCode)

					msg := fmt.Sprintf("%q with checksum %s", mutationFile, checksum)

					switch execExitCode {
					case 0:
						fmt.Printf("PASS %s\n", msg)

						stats.passed++
					case 1:
						fmt.Printf("FAIL %s\n", msg)

						stats.failed++
					case 2:
						fmt.Printf("SKIP %s\n", msg)

						stats.skipped++
					default:
						fmt.Printf("UNKOWN exit code for %s\n", msg)
					}
				}
			}

			changed <- true

			// Ignore original state
			<-changed
			changed <- true

			mutationID++
		}
	}

	return mutationID
}

func mutateExec(opts *options, pkg *types.Package, file string, src ast.Node, mutationFile string, execs []string) (execExitCode int) {
	if len(execs) == 0 {
		debug(opts, "Execute built-in exec command for mutation")

		diff, err := exec.Command("diff", "-u", file, mutationFile).CombinedOutput()
		if err == nil {
			execExitCode = 0
		} else if e, ok := err.(*exec.ExitError); ok {
			execExitCode = e.Sys().(syscall.WaitStatus).ExitStatus()
		} else {
			panic(err)
		}
		if execExitCode != 0 && execExitCode != 1 {
			fmt.Printf("%s\n", diff)

			panic("Could not execute diff on mutation file")
		}

		defer func() {
			_ = os.Rename(file+".tmp", file)
		}()

		err = os.Rename(file, file+".tmp")
		if err != nil {
			panic(err)
		}
		err = osutil.CopyFile(mutationFile, file)
		if err != nil {
			panic(err)
		}

		pkgName := pkg.Path()
		if opts.Test.Recursive {
			pkgName += "/..."
		}

		test, err := exec.Command("go", "test", "-timeout", fmt.Sprintf("%ds", opts.Exec.Timeout), pkgName).CombinedOutput()
		if err == nil {
			execExitCode = 0
		} else if e, ok := err.(*exec.ExitError); ok {
			execExitCode = e.Sys().(syscall.WaitStatus).ExitStatus()
		} else {
			panic(err)
		}

		if opts.General.Debug {
			fmt.Printf("%s\n", test)
		}

		switch execExitCode {
		case 0: // Tests passed -> FAIL
			fmt.Printf("%s\n", diff)

			execExitCode = 1
		case 1: // Tests failed -> PASS
			if opts.General.Debug {
				fmt.Printf("%s\n", diff)
			}

			execExitCode = 0
		case 2: // Did not compile -> SKIP
			if opts.General.Verbose {
				fmt.Println("Mutation did not compile")
			}

			if opts.General.Debug {
				fmt.Printf("%s\n", diff)
			}
		default: // Unknown exit code -> SKIP
			fmt.Println("Unknown exit code")
			fmt.Printf("%s\n", diff)
		}

		return execExitCode
	}

	debug(opts, "Execute %q for mutation", opts.Exec.Exec)

	execCommand := exec.Command(execs[0], execs[1:]...)

	execCommand.Stderr = os.Stderr
	execCommand.Stdout = os.Stdout

	execCommand.Env = append(os.Environ(), []string{
		"MUTATE_CHANGED=" + mutationFile,
		fmt.Sprintf("MUTATE_DEBUG=%t", opts.General.Debug),
		"MUTATE_ORIGINAL=" + file,
		"MUTATE_PACKAGE=" + pkg.Path(),
		fmt.Sprintf("MUTATE_TIMEOUT=%d", opts.Exec.Timeout),
		fmt.Sprintf("MUTATE_VERBOSE=%t", opts.General.Verbose),
	}...)
	if opts.Test.Recursive {
		execCommand.Env = append(execCommand.Env, "TEST_RECURSIVE=true")
	}

	err := execCommand.Start()
	if err != nil {
		panic(err)
	}

	// TODO timeout here

	err = execCommand.Wait()

	if err == nil {
		execExitCode = 0
	} else if e, ok := err.(*exec.ExitError); ok {
		execExitCode = e.Sys().(syscall.WaitStatus).ExitStatus()
	} else {
		panic(err)
	}

	return execExitCode
}

func main() {
	os.Exit(mainCmd(os.Args[1:]))
}

func saveAST(mutationBlackList map[string]struct{}, file string, fset *token.FileSet, node ast.Node) (string, bool, error) {
	var buf bytes.Buffer

	h := md5.New()

	err := printer.Fprint(io.MultiWriter(h, &buf), fset, node)
	if err != nil {
		return "", false, err
	}

	checksum := fmt.Sprintf("%x", h.Sum(nil))

	if _, ok := mutationBlackList[checksum]; ok {
		return checksum, true, nil
	}

	mutationBlackList[checksum] = struct{}{}

	src, err := format.Source(buf.Bytes())
	if err != nil {
		return "", false, err
	}

	err = ioutil.WriteFile(file, src, 0666)
	if err != nil {
		return "", false, err
	}

	return checksum, false, nil
}


text:
import threading,time
TOTAL = 0
MY_LOCK = threading.Lock()
class CountThread(threading.Thread):
    def run(self):
        global TOTAL
        for i in range(10):
            #time.sleep(1)
            MY_LOCK.acquire()
            TOTAL = TOTAL + 1
            MY_LOCK.release()
        print('%s\n' % (TOTAL))

a = CountThread()
b = CountThread()
a.start()
b.start()


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
    <title>Ionic Seed App</title>

    <link href="lib/css/ionic.css" rel="stylesheet">

    <link href="css/app.css" rel="stylesheet">
    <link href="css/ionic.contrib.frostedGlass.css" rel="stylesheet">

    <ion-pane ng-controller="PageCtrl">
      <ion-header-bar frosted-bar title="'Blurred...man!'" type="bar-frosted"></ion-header-bar>
      <ion-content has-header="true" has-footer="true" padding="true" start-y="120">

      </ion-content>

        <button class="button button-clear button-positive" ng-click="add()">Add Message</button>

    </pane>


text:
<?xml version="1.0" encoding="utf-8"?>
<bitmap android:src="@drawable/tw_text_select_handle_middle_mtrl_alpha"
  xmlns:android="http://schemas.android.com/apk/res/android" />


text:
<?xml version="1.0" encoding="utf-8" ?>

<collections>
  <collection>
    <name>Cure/inflict light wounds</name>
    <entry>1</entry>
  </collection>
  <collection>
    <name>Cure/inflict moderate wounds</name>
    <entry>2</entry>
  </collection>
  <collection>
    <name>Cure/inflict serious wounds</name>
    <entry>3</entry>
  </collection>
  <collection>
    <name>Cure/inflict critical wounds</name>
    <entry>4</entry>
  </collection>
  <collection>
    <name>Mass cure/inflict light wounds</name>
    <entry>5</entry>
  </collection>
  <collection>
    <name>Heal/Harm</name>
    <entry>6</entry>
  </collection>
  <collection>
    <name>Regenerate</name>
    <entry>7</entry>
  </collection>
  <collection>
    <name>Mass cure/inflict critical wounds</name>
    <entry>8</entry>
  </collection>
  <collection>
    <name>Mass heal/harm</name>
    <entry>9</entry>
  </collection>
</collections>


text:
<?php

echo
'

          Logo

favorite_borderamis

forumForum

perm_identityEspace membre

notificationsNotifications

mail_outlineMessages

';

?>


text:
- Please do necessary changes to the variables and inventory files and run the below command.

```
ansible-playbook main.yml -i inventory.ini --user=madhuakula --ask-sudo-pass -vvv
```


text:
/** Automatically generated file. DO NOT MODIFY */
package com.umer.androidxhalofloatingwindowframehelp;

public final class BuildConfig {
    public final static boolean DEBUG = true;
}


text:
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const path = require('path')
const webpack = require('webpack')
const ManifestPlugin = require('./lib/ManifestPlugin')
const getSha = require('./lib/git-sha1')

module.exports = function buildWebpackConfig ({ build = false }) {
  const sha = build ? (process.env.SHA || getSha()) : ''
  const BUILD_PATH = path.resolve(__dirname, 'public')
  const OUTPUT_PATH = path.join(sha, '/')
  const timestamp = new Date().toISOString()
  console.log('=== Digdag ===')
  console.log('Config: ', build ? 'Release' : 'Development')
  console.log('Build path: ', BUILD_PATH)
  console.log('Output path: ', OUTPUT_PATH)
  console.log('Timestamp:', timestamp)
  console.log('Sha:', sha)
  const config = {
    mode: build ? 'production' : 'development',
    entry: {
      tether: 'tether',
      app: './index.jsx'
    },
    output: {
      path: path.join(BUILD_PATH, OUTPUT_PATH),
      pathinfo: !build,
      publicPath: path.join('/', OUTPUT_PATH),
      filename: '[name].js'
    },
    target: 'web',
    devtool: build ? 'source-map' : 'cheap-module-source-map',
    module: {
      rules: [{
        test: /\.(js|jsx|ts|tsx)$/,
        exclude: /(node_modules)/,
        loader: 'babel-loader'
      }, {
        test: /\.css$/,
        use: [MiniCssExtractPlugin.loader, 'css-loader'],
        include: [path.join(__dirname, 'node_modules'), path.join(__dirname, 'public')]
      }, {
        test: /\.(scss)$/,
        use: [
          MiniCssExtractPlugin.loader,
          'css-loader',
          {
            loader: 'postcss-loader',
            options: {
              postcssOptions: {
                plugins: function () {
                  return [
                    require('precss'),
                    require('autoprefixer')
                  ];
                }
              }
            }
          }, {
            loader: 'sass-loader'
          }
        ]
      },{
        test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,
        loader: 'file-loader'
      }, {
        test: /\.(woff|woff2)$/,
        loader: 'url-loader?prefix=font/&limit=5000'
      }, {
        test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,
        loader: 'url-loader?limit=10000&mimetype=application/octet-stream'
      }, {
        test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
        loader: 'url-loader?limit=10000&mimetype=image/svg+xml'
      }, {
        test: /\.gif/,
        loader: 'url-loader?limit=10000&mimetype=image/gif'
      }, {
        test: /\.jpg/,
        loader: 'url-loader?limit=10000&mimetype=image/jpg'
      }, {
        test: /\.png/,
        loader: 'url-loader?limit=10000&mimetype=image/png'
      }, {
        test: /\.less$/,
        use: [MiniCssExtractPlugin.loader, 'css-loader', 'less-loader']
      }]
    },
    resolve: {
      extensions: ['*', '.ts', '.tsx', '.js', '.jsx']
    },
    plugins: [
      // Only include the english locale for momentjs
      // This shrinks our output bundle size by a couple hundred KB
      /* eslint-disable */
      new webpack.ContextReplacementPlugin(/moment[\\\/]locale$/, /^\.\/(en)$/),
      /* eslint-enable */
      getHtmlPlugin({ build, timestamp, filename: 'index.html', sha }),
      new MiniCssExtractPlugin({
        filename: '[name].css'
      }),
      new webpack.ProvidePlugin({
        $: 'jquery',
        jQuery: 'jquery',
        'window.jQuery': 'jquery',
        'window.Tether': 'tether'
      }),
      new webpack.DefinePlugin({
        'process.env.NODE_ENV': `'${build ? 'production' : 'development'}'`
      })
    ],
    devServer: {
      historyApiFallback: {
        index: OUTPUT_PATH
      },
      contentBase: build ? BUILD_PATH : './',
      port: 9000,
      quiet: false,
      stats: {
        cached: false,
        chunk: false,
        colors: true,
        modules: false
      }
    }
  }

  // Minify, dedupe
  if (build) {
    config.plugins.push(
      new webpack.optimize.OccurrenceOrderPlugin(),
      new ManifestPlugin({ sha, timestamp })
    )
  }

  return config
}

function getHtmlPlugin ({ build, filename, sha, timestamp }) {
  const data = {
    sha,
    timestamp,
    title: process.env.CONSOLE_TITLE || 'Digdag'
  }
  return new HtmlWebpackPlugin({
    build,
    data,
    filename,
    inject: false,
    minify: {
      collapseWhitespace: true,
      keepClosingSlash: true,
      minifyCSS: true,
      minifyJS: true,
      minifyURLs: true,
      removeComments: true,
      removeEmptyAttributes: true,
      removeRedundantAttributes: true,
      removeStyleLinkTypeAttributes: true,
      useShortDoctype: true
    },
    template: './lib/html-template.js'
  })
}


text:
import { GridError } from '../infrastructure/error';
import { getValueFactory } from '../services/value';
import { hasOwnProperty } from '../utility/kit';
import { Node } from './node';

export function nodeBuilder(columnMap, groupBy, valueFactory, level = 0) {
  if (groupBy.length === 0) {
    return () => [];
  }

  const groupKey = groupBy[0];
  if (!hasOwnProperty.call(columnMap, groupKey)) {
    throw new GridError('node.build', `can't find column "${groupKey}"`);
  }

  const column = columnMap[groupKey];
  const getValue = getValueFactory(column);
  return (rows, getRowIndex = i => i) => {
    const keys = [];
    const nodes = [];
    const groups = {};
    for (let i = 0, length = rows.length; i < length; i++) {
      const row = rows[i];
      const index = getRowIndex(i);
      const key = getValue(row);
      if (!hasOwnProperty.call(groups, key)) {
        const node = new Node(key, level);
        node.source = groupKey;
        node.rows.push(index);
        keys.push(key);
        nodes.push(node);
        groups[key] = {
          node,
          rows: [row],
        };
      } else {
        const group = groups[key];
        group.node.rows.push(index);
        group.rows.push(row);
        keys.push(key);
      }
    }

    const nextGroupBy = groupBy.slice(1);
    if (nextGroupBy.length) {
      const build = nodeBuilder(columnMap, nextGroupBy, valueFactory, level + 1);
      for (let i = 0, length = keys.length; i < length; i++) {
        const key = keys[i];
        const group = groups[key];
        const node = group.node;
        const rows = node.rows;
        node.children = build(group.rows, i => rows[i]);
      }
    }

    return nodes;
  };
}


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

	<title>SHTOOLS - Gravity and magnetics routines</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../../css/sh.css">
	<link rel="icon" type="image/vnd.microsoft.icon" href="../../images/favicon.ico">

				HOME
				DOWNLOAD
				DOCUMENTATION
				FAQ

>  Home > Documentation > Fortran 95 > Gravity and Magnetics

BAtoHilm

Calculate iteratively the relief along an interface of constant density contrast that corresponds to a given Bouguer anomaly using the algorithm of Wieczorek and Phillips (1998).

Usage

call BAtoHilm (cilm, ba, grid, lmax, nmax, mass, r0, rho, gridtype, w, plx, zero, filtertype, filterdeg, lmaxcalc)

Parameters

cilm : output, real*8, dimension (2, lmaxcalc+1, lmaxcalc+1)

An estimate of the real spherical harmonic coefficients (geodesy normalized) of relief along an interface with density contrast rho that satisfies the Bouguer anomaly ba. The degree zero term corresponds to the mean radius of the relief.

ba : input, real*8, dimension (2, lmaxcalc+1, lmaxcalc+1)

The real spherical harmonic coefficients of the Bouguer anomaly referenced to a spherical interface r0.

grid : input, real*8, dimension (lmax+1, 2*lmax+1) for gridtype 1, (2*lmax+2, 2*lmax+2) for gridtype 2, (2*lmax+2, 4*lmax+4) for gridtype 3

The initial estimate for the radii of the interface evaluated on a grid corresponding to a function of maximum spherical harmonic degree lmax. This is calculated by a call to either MakeGridGLQ or MakeGridDH. This grid must contain the degree-0 average radius of the interface.

lmax : input, integer

The spherical harmonic bandwidth of the input relief grid, which determines the dimensions of grid. If lmaxcalc is not set, this determines also the maximum spherical harmonic degree of the output spherical harmonic coefficients of the relief and the input spherical harmonics of the Bouguer anomaly.

nmax : input, integer

The maximum order used in the Taylor-series expansion used in calculating the potential coefficients.

mass : input, real*8

The mass of the planet in kg.

r0 : input, real*8

The reference radius of the Bouguer anomaly ba.

rho : input, real*8

The density contrast of the relief in kg/m^3.

gridtype : input, integer

1 = Gauss-Legendre grids, calculated using SHGLQ and MakeGridGLQ. 2 = Equally sampled Driscoll-Healy grids, n by n, calculated using MakeGridDH. 3 = Equally spaced Driscoll-Healy grids, n by 2n, calculated using MakeGridDH.

w : optional, input, real*8, dimension (lmax+1)

The weights used in the Gauss-Legendre quadrature. These are calculated from a call to SHGLQ. If present, one of plx or zero must also be present.

plx : optional, input, real*8, dimension (lmax+1, (lmax+1)*(lmax+2)/2)

An array of the associated Legendre functions calculated at the nodes used in the Gauss-Legendre quadrature. These are determined from a call to SHGLQ.

zero : optional, input, real*8, dimension (lmax+1)

The nodes used in the Gauss-Legendre quadrature over latitude, calculated by a call to SHGLQ.

filtertype : optional, input, integer, default = 0

Apply a filter when calculating the relief in order to minimize the destabilizing effects of downward continuation which amplify uncertainties in the Bouguer anomaly. If 0, no filtering is applied. If 1, use the minimum amplitude filter DownContFilterMA. If 2, use the minimum curvature filter DownContFilterMC.

filterdeg : optional, input, integer

The spherical harmonic degree for which the filter is 0.5.

lmaxcalc : optional, input, integer, default = lmax

The maximum degree that will be calculated in the spherical harmonic expansions.

Description

IBAtoHilm is used to solve iteratively for the relief along an interface that corresponds to a given Bouguer anomaly. This is equation 18 of Wieczorek and Phillips (1998) which implicitly takes into consideration the finite-amplitude correction. Each iteration takes as input a guess for the relief (specified by grid) and outputs the iteratively improved spherical harmonic coefficients of this relief. These coefficients can then be re-expanded and re-input into this routine as the next guess. For the initial guess, it is often sufficient to use the relief predicted using the first-order "mass sheet" approximation. The input relief grid can be of one of three type specified by gridtype: 1 for Gauss-Legendre grids, 2 for equally sampled Driscoll-Healy grids (n by n), and 3 for equally spaced Driscoll-Healy grid (n by 2n).

If the algorithm does not converge, one might want to try damping the initial estimate. Alternatively, iterations of the following form have proven successfulin in damping oscilations between successive iterations:

h3 = (h2+h1)/2

h4 = f(h3)

It is important to understand that as an intermediate step, this routine calculates the spherical harmonic coefficients of the relief raised to the nth power, i.e., grid**n. As such, if the input function is bandlimited to degree L, the resulting function will thus be bandlimited to degree L*nmax. This subroutine implicitly assumes that lmax is greater than or equal to L*nmax. If this is not the case, aliasing will occur. In practice, for accurate results, it is found that lmax needs only to be about twice the size of L, though this should be verified for each application. Thus, if the input function is considered to be bandlimited to degree L, the function should be evaluated on a grid corresponding to a maximum degree of about 2L.

If the input grid is evaluated on the Gauss-Legendre points, it is necessary to specify the optional parameters w andzero, or w and plx, which are calculated by a call to SHGLQ. If memory is not an issue, the algorithm can be speeded up by inputing the optional array plx of precomputed associated Legendre functions on the Gauss-Legendre nodes. If plx is not specified, then it is necessary to input the optional array zero that contains the latitudinal Gauss-Legendre quadrature nodes.

This routine uses geodesy 4-pi normalized spherical harmonics that exclude the Condon-Shortley phase.

References

Wieczorek, M. A. and R. J. Phillips, Potential anomalies on a sphere: applications to the thickness of the lunar crust, J. Geophys. Res., 103, 1715-1724, 1998.

See also

batohilmrhoh, cilmplus, cilmplusrhoh, shexpandglq, makegridglq, shglq, shexpanddh, makegriddh, glqgridcoord, downcontfilterma, downcontfiltermc

>  Home > Documentation > Fortran 95 > Gravity and Magnetics

			Institut de Physique du Globe de Paris
			University of Sorbonne Paris Cité
			© 2015 Mark Wieczorek


text:
<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

namespace Common\Api;
class SystemApi {

}


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/background"
    android:orientation="vertical" >

    <Button
        android:id="@+id/add_account"
        android:layout_width="30dp"
        android:layout_height="30dp"
        android:layout_gravity="right"
        android:layout_marginRight="10dip"
        android:layout_marginTop="10dip"
        android:background="@drawable/add_account" />

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:layout_gravity="center"
        android:gravity="center"
        android:layout_marginTop="120dip"
        >

        <ImageView
            android:id="@+id/user_head"
            android:layout_width="120dip"
            android:layout_height="120dip"
            android:src="@drawable/user_head"
             />

        <Spinner
         android:id="@+id/spinner_user_list"
         android:layout_width="200dip"
         android:layout_height="wrap_content"
         android:layout_marginTop="25dip"
         android:layout_gravity="center"
         android:background="@drawable/account_select" />
    </LinearLayout>

    <Button
    android:id="@+id/btn_login"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/button_login"
    android:layout_marginTop="50dp"
    android:layout_gravity="center"
	android:textColor="@color/white"
	android:text="@string/Login"
	android:textSize="23sp"
    />
</LinearLayout>


text:
        Gallery

Home

gallery

                    Add Gallery

                            <form class="form-horizontal" method="POST" ng-submit="addGallery()" id="formgal">

                                    Name

                                        <input type="text" name="name" class="form-control" ng-model="newgallery.name" required=""/>

                                    Description

                                        <input type="text" name="description" class="form-control" ng-model="newgallery.description"/>

                                    Photo

                                        <button ngf-select="uploadFiles($files, $invalidFiles)"
                                                accept="image/*"
                                                ngf-max-height="5000"
                                                ngf-max-size="5MB"
                                                ngf-multiple="true" type="button">
                                            Select Files
                                        </button>
                                        {{fileValidation.msg}}

                                                            {{f.name}} {{f.$errorParam}}

= 0" ng-class="{cancel: uploadstatus == 1}">

{{f.progressmsg}}

                                                                            {{f.progress}}% Complete

{{f.name}} {{f.$error}} {{f.$errorParam}}

                                            {{errorMsg}}

                                <uib-accordion ng-show="item_files">

                                        <uib-accordion-heading>
                                            Images
                                        </uib-accordion-heading>

                                                            Show
                                                            Delete

                                </uib-accordion>

                                        <button class="btn btn-primary" type="submit">Submit</button>
                                        <button class="btn btn-danger" type="button" ng-click="hideForm()">Cancel</button>

                            </form>

{{gallery.name}}

{{gallery.description}}

                        Open
                        <button type="button" style="color: initial;" class="btn btn-default" ng-click="showForm(gallery)">edit</button>
                        <button type="button" style="color: initial;" class="btn btn-default" confirmed-click="deleteGallery(gallery)" ng-confirm-click="Would you like to delete this item?!">delete</button>

        <img src="<?php echo public_url() . 'adm/assets/img/loading.gif' ?>" alt=""/>

Please wait...


text:
from UnitTest import UnitTest

# XXX fails with a JavaScript error: "In application LibTest -
# undefined: set is not defined
# pyjslib.py, line 1484
# pyjslib.py, line 206
# SetTest.py, line 5
# try:
#     # try to use the built-in set type
#     Set = set
# except NameError:
#     # fall back to sets module
#     from sets import Set
from sets import Set

class SetTest(UnitTest):

    def testInit(self):
        value = Set(['a', 'b', 'c'])

        self.assertTrue('b' in value)
        self.assertTrue('d' not in value)

    def testAdd(self):
        value = Set()
        value.add("a")
        value.add("b")
        value.add("a")

        self.assertTrue('a' in value)
        self.assertTrue('c' not in value)
        self.assertTrue(len(value) is 2)

    def testRemove(self):
        value = Set(['a', 'b', 'c'])
        value.remove('a')

        self.assertTrue('a' not in value)
        self.assertTrue('b' in value)

    def testIter(self):
        items = ['a', 'b', 'c']
        value = Set(items)

        for i in value:
            items.remove(i)

        self.assertTrue(len(items) is 0)

    def testAddObject(self):
        v1 = DummyClass('a')
        v2 = DummyClass('b')
        v3 = DummyClass('b')
        v4 = DummyClass('c')

        value = Set()
        value.add(v1)
        value.add(v2)
        value.add(v1)
        value.add(v3)

        self.assertTrue(v1 in value)
        self.assertTrue(v2 in value)
        self.assertTrue(v3 in value)
        self.assertTrue(v4 not in value)
        self.assertTrue(len(value) is 3)

class DummyClass:
    def __init__(self, value):
        self.value = value

    def getValue(self):
        return self.value


text:
package edu.ur.ir.item;

import edu.ur.dao.CountableDAO;
import edu.ur.dao.CrudDAO;

/**
 * Interface for saving published date.
 *
 * @author Sharmila Ranganathan
 *
 */
public interface PublishedDateDAO extends CountableDAO,
CrudDAO<PublishedDate>{}


text: mysqldump --all-databases > ~/backup.sql


text:
var Andy = {
  name: 'Andrew Dushane',
  age: 35,
  awesomeness: 100,
  goHome: function() {
    console.log('Get on the Green Line toward Harlem.');
    console.log('Get off at Harlem.');
    console.log('Take the 90 North.');
  },
  hometown: 'Ann Arbor',
  residence: 'Orlando, FL',
  married: true,
  family: {
    wife: 'Gladys',
    son1: 'Lucas',
    son2: 'David',
    daughter: 'Isabella'
  },
  inChicago: true,
  liveFreeorDie: function() {
    while(true) {
      console.log(breathe);
    }
  },
  changeName: function(newName) {
    if(typeof(newName) == 'string') {
      this.name = newName;
      return 'Name has been changed to ' + newName;
    } else {
      return 'That name is not a valid string.';
    }
  }
}
Andy.quirk = function( food ) {
  return food + ' is better with hot sauce.';
}
Andy.contact = function( contactMethod ) {
  if( contactMethod != 'text' ) {
    return 'Just text me bro.';
  }
  else return 'Ok got it.';
}
console.log(Andy.changeName('You know my name.'));
Andy.tellAboutMe = function () {
  return 'My name is ' + this.name + '. I am ' + this.age + " years old. I'm from " + this.hometown + '. My level of awesomenewss is ' + this.awesomeness + '.';
}
console.log(Andy.tellAboutMe());

var jonSnow = {
  name: 'Jon Snow',
  parentage: 'unknown',
  fan_theories: 'many',
  has_cool_sword: true,
  king_in_the_north: false,
  job: "Night's Watch",
  position: 'Lord Commander',
  alive: 'maybe',
  pet: {
    species: 'direwolf',
    name: 'Ghost'
  },
  tellMyStory: function() {
    return 'My name is ' + this.name + '. My parents are ' + this.parentage + '. There are ' + this.fan_theories + ' fan theories about my origins. I work at the ' + this.job + ", I'm the " + this.position + '. I have a ' + this.pet.species + ' named ' + this.pet.name + '.';
  }
}
console.log(jonSnow.tellMyStory());


text:
/*
 * Set match_start to the longest match starting at the given string and
 * return its length. Matches shorter or equal to prev_length are discarded,
 * in which case the result is equal to prev_length and match_start is garbage.
 *
 * IN assertions: cur_match is the head of the hash chain for the current
 * 	string (strstart) and its distance is <= MAX_DIST, and prev_length >=1
 * OUT assertion: the match length is not greater than s->lookahead
 */

#include <stdint.h>

#include "deflate.h"

#ifdef FASTEST
#define longest_match fastest_longest_match
#elif (defined(UNALIGNED_OK) && MAX_MATCH == 258)
#define longest_match std2_longest_match
#else
#define longest_match std1_longest_match
#endif

/*
 * Standard longest_match
 *
 */
local unsigned std1_longest_match(deflate_state *z_const s, IPos cur_match)
{
	z_const unsigned wmask = s->w_mask;
    z_const Posf *prev = s->prev;

	unsigned chain_length;
	IPos limit;
	int len, best_len, nice_match;
	unsigned char *scan, *match, *strend, scan_end, scan_end1;

	/*
	 * The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple
	 * of 16. It is easy to get rid of this optimization if necessary.
	 */
	Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");

	/*
	 * Do not waste too much time if we already have a good match
	 */
	best_len = s->prev_length;
	chain_length = s->max_chain_length;
	if ((unsigned)best_len >= s->good_match)
		chain_length >>= 2;

	/*
	 * Do not looks for matches beyond the end of the input. This is
	 * necessary to make deflate deterministic
	 */
    nice_match = (uInt)s->nice_match > s->lookahead ? s->lookahead : s->nice_match;

	/*
	 * Stop when cur_match becomes <= limit. To simplify the code,
	 * we prevent matches with the string of window index 0
	 */
	limit = s->strstart > MAX_DIST(s) ? s->strstart - MAX_DIST(s) : 0;

	scan = s->window + s->strstart;
	strend = s->window + s->strstart + MAX_MATCH;
	scan_end1 = scan[best_len-1];
	scan_end = scan[best_len];

	Assert((unsigned long)s->strstart <= s->window_size - MIN_LOOKAHEAD,
		"need lookahead");
	do {
		Assert(cur_match < s->strstart, "no future");
		match = s->window + cur_match;

		/*
		 * Skip to next match if the match length cannot increase
		 * or if the match length is less than 2. Note that the checks
		 * below for insufficient lookahead only occur occasionally
		 * for performance reasons. Therefore uninitialized memory
		 * will be accessed and conditional jumps will be made that
		 * depend on those values. However the length of the match
		 * is limited to the lookahead, so the output of deflate is not
		 * affected by the uninitialized values.
		 */
		if (match[best_len] != scan_end ||
		match[best_len-1] != scan_end1 ||
		*match != *scan ||
		*++match != scan[1])
			continue;

		/*
		 * The check at best_len-1 can be removed because it will
		 * be made again later. (This heuristic is not always a win.)
		 * It is not necessary to compare scan[2] and match[2] since
		 * they are always equal when the other bytes match, given
		 * that the hash keys are equal and that HASH_BITS >= 8.
		 */
		scan += 2;
		match++;
		Assert(*scan == *match, "match[2]?");

		/*
		 * We check for insufficient lookahead only every 8th
		 * comparision; the 256th check will be made at strstart + 258.
		 */
		do {
		} while (*++scan == *++match && *++scan == *++match &&
			 *++scan == *++match && *++scan == *++match &&
			 *++scan == *++match && *++scan == *++match &&
			 *++scan == *++match && *++scan == *++match &&
			 scan < strend);

		Assert(scan <= s->window+(unsigned int)(s->window_size-1),
			"wild scan");

		len = MAX_MATCH - (int)(strend - scan);
		scan = strend - MAX_MATCH;

		if (len > best_len) {
			s->match_start = cur_match;
			best_len = len;
			if (len >= nice_match)
				break;
			scan_end1 = scan[best_len-1];
			scan_end = scan[best_len];
		} else {
			/*
			 * The probability of finding a match later if we here
			 * is pretty low, so for performance it's best to
			 * outright stop here for the lower compression levels
			 */
			if (s->level < 6)
				break;
		}
	} while ((cur_match = prev[cur_match & wmask]) > limit && --chain_length);

	if ((unsigned int)best_len <= s->lookahead)
		return best_len;
	return s->lookahead;
}

/*
 * UNALIGNED_OK longest_match
 *
 */
local unsigned std2_longest_match(deflate_state *z_const s, IPos cur_match)
{
	z_const unsigned wmask = s->w_mask;
    z_const Posf *prev = s->prev;

	unsigned short scan_start, scan_end;
	unsigned chain_length;
	IPos limit;
	int len, best_len, nice_match;
	unsigned char *scan, *strend;

	/*
	 * The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple
	 * of 16. It is easy to get rid of this optimization if necessary.
	 */
	Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");

	/*
	 * Do not waste too much time if we already have a good match
	 */
	best_len = s->prev_length;
	chain_length = s->max_chain_length;
	if ((unsigned)best_len >= s->good_match)
		chain_length >>= 2;

	/*
	 * Do not looks for matches beyond the end of the input. This is
	 * necessary to make deflate deterministic
	 */
    nice_match = (uInt)s->nice_match > s->lookahead ? s->lookahead : s->nice_match;

	/*
	 * Stop when cur_match becomes <= limit. To simplify the code,
	 * we prevent matches with the string of window index 0
	 */
	limit = s->strstart > MAX_DIST(s) ? s->strstart - MAX_DIST(s) : 0;

	scan = s->window + s->strstart;
	strend = s->window + s->strstart + MAX_MATCH - 1;
	scan_start = *(unsigned short *)scan;
	scan_end = *(unsigned short *)(scan + best_len-1);

	Assert((unsigned long)s->strstart <= s->window_size - MIN_LOOKAHEAD,
		"need lookahead");
	do {
        unsigned char *match;
		Assert(cur_match < s->strstart, "no future");
		match = s->window + cur_match;

		/*
		 * Skip to next match if the match length cannot increase
		 * or if the match length is less than 2. Note that the checks
		 * below for insufficient lookahead only occur occasionally
		 * for performance reasons. Therefore uninitialized memory
		 * will be accessed and conditional jumps will be made that
		 * depend on those values. However the length of the match
		 * is limited to the lookahead, so the output of deflate is not
		 * affected by the uninitialized values.
		 */
		if (zlikely((*(unsigned short *)(match + best_len - 1) != scan_end)))
			continue;
		if (*(unsigned short *)match != scan_start)
			continue;

		/* It is not necessary to compare scan[2] and match[2] since
		 * they are always equal when the other bytes match, given that
		 * the hash keys are equal and that HASH_BITS >= 8. Compare 2
		 * bytes at a time at strstart+3, +5, ... up to strstart+257.
		 * We check for insufficient lookahead only every 4th
		 * comparison; the 128th check will be made at strstart+257.
		 * If MAX_MATCH-2 is not a multiple of 8, it is necessary to
		 * put more guard bytes at the end of the window, or to check
		 * more often for insufficient lookahead.
		 */
		Assert(scan[2] == match[2], "scan[2]?");
		scan++;
		match++;

		do {
		} while (*(unsigned short *)(scan += 2)== *(unsigned short *)(match += 2)&&
			 *(unsigned short *)(scan += 2)== *(unsigned short *)(match += 2)&&
			 *(unsigned short *)(scan += 2)== *(unsigned short *)(match += 2)&&
			 *(unsigned short *)(scan += 2)== *(unsigned short *)(match += 2)&&
			 scan < strend);

		/*
		 * Here, scan <= window + strstart + 257
		 */
		Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
		if (*scan == *match)
			scan++;

		len = (MAX_MATCH -1) - (int)(strend-scan);
		scan = strend - (MAX_MATCH-1);

		if (len > best_len) {
			s->match_start = cur_match;
			best_len = len;
			if (len >= nice_match)
				break;
			scan_end = *(unsigned short *)(scan + best_len - 1);
		} else {
			/*
			 * The probability of finding a match later if we here
			 * is pretty low, so for performance it's best to
			 * outright stop here for the lower compression levels
			 */
			if (s->level < 6)
                break;
		}
	} while (--chain_length && (cur_match = prev[cur_match & wmask]) > limit);

	if ((unsigned)best_len <= s->lookahead)
		return best_len;
	return s->lookahead;
}

/*
 * FASTEST-only longest_match
 *
 */
local unsigned fastest_longest_match(deflate_state *z_const s, IPos cur_match)
{
	unsigned char *scan, *match, *strend;
	int len;

	/*
	 * The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple
	 * of 16. It is easy to get rid of this optimization if necessary
	 */
	Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");

	Assert((unsigned long)s->strstart <= s->window_size - MIN_LOOKAHEAD,
		"need lookahead");

	Assert(cur_match < s->strstart, "no future");

	match = s->window + cur_match;
	scan = s->window + s->strstart;
	strend = s->window + s->strstart + MAX_MATCH;

	if (*match++ != *scan++ || *match++ != *scan++)
		return MIN_MATCH-1;

	/*
	 * The check at best_len-1 can be removed because it will be made
	 * again later. (This heuristic is not always a win.) It is not
	 * necessary to compare scan[2] and match[2] since they are always
	 * equal when the other bytes match, given that the hash keys are equal
	 * and that HASH_BITS >= 8.
	 */
	Assert(*scan == *match, "match[2]?");

	do {
	} while (*++scan == *++match && *++scan == *++match &&
		 *++scan == *++match && *++scan == *++match &&
		 *++scan == *++match && *++scan == *++match &&
		 *++scan == *++match && *++scan == *++match &&
		 scan < strend);

	Assert(scan <= s->window+(unsigned int)(s->window_size-1), "wild scan");

	len = MAX_MATCH - (long)(strend - scan);
	if (len < MIN_MATCH)
		return MIN_MATCH-1;

	s->match_start = cur_match;
	return (unsigned)len <= s->lookahead ? len : s->lookahead;
}