text:
package main

import (
	"archive/tar"
	"bufio"
	"bytes"
	"compress/gzip"
	"errors"
	"fmt"
	"github.com/codegangsta/cli"
	"github.com/evoL/gif/image"
	"github.com/evoL/gif/store"
	"io"
	"io/ioutil"
	"net/http"
	"os"
	"path"
	"path/filepath"
	"regexp"
	"strings"
)

var extensionWhitelist = [...]string{"gif", "jpeg", "jpg", "png", "webp"}
var extensionWhitelistMap map[string]struct{} = make(map[string]struct{})

func computeWhitelist() {
	for _, ext := range extensionWhitelist {
		extensionWhitelistMap[ext] = struct{}{}
	}
}

func ImportCommand(c *cli.Context) {
	location := c.Args().First()

	ltype, err := parseLocation(location)

	if err != nil {
		fmt.Println(err.Error())
		os.Exit(1)
	}

	s := getStore()
	defer s.Close()

	switch ltype {
	case urlLocation:
		importFromUrl(s, location)
	case fileLocation:
		importFromFile(s, location)
	case directoryLocation:
		importDirectory(s, filepath.Clean(location), c.Bool("recursive"))
	}
}

func importFromUrl(s *store.Store, location string) {
	response, err := http.Get(location)
	if err != nil {
		fmt.Println("Import Error: " + err.Error())
		os.Exit(1)
	}

	if response.StatusCode >= 300 {
		fmt.Printf("Import Error: %s %s\n", response.Proto, response.Status)
		os.Exit(1)
	}

	defer response.Body.Close()

	err = importFromReader(s, response.Body)
	if err != nil {
		fmt.Println("Import Error: " + err.Error())
		os.Exit(1)
	}
}

func importFromFile(s *store.Store, location string) {
	file, err := os.Open(location)
	if err != nil {
		fmt.Println("Import Error: " + err.Error())
		os.Exit(1)
	}
	defer file.Close()

	if err = importFromReader(s, file); err != nil {
		fmt.Println("Import Error: " + err.Error())
		os.Exit(1)
	}
}

func importDirectory(s *store.Store, location string, recursive bool) {
	if len(extensionWhitelistMap) == 0 {
		computeWhitelist()
	}

	writer := image.DefaultWriter()
	defer writer.Flush()

	entries, err := ioutil.ReadDir(location)
	if err != nil {
		fmt.Println("Import Error: " + err.Error())
		os.Exit(1)
	}

	for _, entry := range entries {
		currentPath := filepath.Join(location, entry.Name())

		if entry.IsDir() {
			if recursive {
				importDirectory(s, currentPath, recursive)
			}
		} else {
			extensionWithDot := filepath.Ext(currentPath)
			if extensionWithDot == "" {
				continue
			}

			extension := extensionWithDot[1:]

			if _, ok := extensionWhitelistMap[extension]; ok {
				img, err := image.FromFile(currentPath)
				if err != nil {
					fmt.Fprintf(writer, "[error]\t%s: %s\f", currentPath, err.Error())
					continue
				}

				img.Tags = []string{entry.Name()}

				AddInterface(s, writer, img, false)
			}
		}
	}
}

func importFromReader(s *store.Store, reader io.Reader) error {
	bufferedReader := bufio.NewReader(reader)

	// The gzip header has 10 bytes, so let's peek the next 10 bytes and check if the header is OK
	testBytes, err := bufferedReader.Peek(10)
	if err != nil {
		return err
	}
	testBuffer := bytes.NewBuffer(testBytes)
	_, err = gzip.NewReader(testBuffer)
	if err == nil {
		gzipReader, _ := gzip.NewReader(bufferedReader)
		return importBundle(s, gzipReader)
	}

	// Check if it's valid JSON
	if images, err := store.ParseMetadata(bufferedReader); err == nil {
		importUrls(s, images)
		return nil
	}

	return errors.New("Invalid import file")
}

func importBundle(s *store.Store, reader *gzip.Reader) error {
	tarReader := tar.NewReader(reader)

	writer := image.DefaultWriter()
	defer writer.Flush()

	dirname, err := ioutil.TempDir("", "gif-import")
	if err != nil {
		return err
	}

	imageMap := map[string]store.ExportedImage{}
	metadataRead := false
	idRegexp := regexp.MustCompile(`\A[0-9a-fA-F]{40}\z`)
	imageQueue := []string{}

	for {
		header, err := tarReader.Next()
		if err == io.EOF {
			break
		}
		if err != nil {
			return err
		}

		// Read metadata
		if header.Name == "gif.json" {
			images, err := store.ParseMetadata(tarReader)
			if err != nil {
				return err
			}
			metadataRead = true

			// Put the images into a map for faster access
			for _, exported := range images {
				imageMap[exported.Id] = exported
			}

			// Empty the queue, if any
			for _, queuedImageId := range imageQueue {
				tempPath := path.Join(dirname, queuedImageId+".gif")
				img, err := image.FromFile(tempPath)
				if err != nil {
					fmt.Fprintf(writer, "[error]\t%s\t%s\f", queuedImageId[:8], err.Error())
					continue
				}

				if queuedImageId != img.Id {
					fmt.Fprintf(writer, "[warn]\t%s\tID mismatch, new ID: %s\f", queuedImageId[:8], img.Id)
				}

				queuedImage := imageMap[queuedImageId]
				img.Url = queuedImage.Url
				img.Tags = queuedImage.Tags

				if queuedImage.AddedAt != "" {
					if err = img.SetAddedAtFromString(queuedImage.AddedAt); err != nil {
						fmt.Fprintf(writer, "[warn]\t%s\tCould not set addition date: %s\f", queuedImage.Id[:8], queuedImage.AddedAt)
					}
				}

				AddInterface(s, writer, img, false)
			}
			imageQueue = nil
			os.RemoveAll(dirname)

			continue
		}

		imageId := strings.TrimSuffix(header.Name, ".gif")
		if !idRegexp.MatchString(imageId) {
			// Skip files that don't match
			continue
		}

		// TODO: Check if ID exists

		if metadataRead {
			// Read and add the current image
			exported := imageMap[imageId]

			buffer := new(bytes.Buffer)
			if _, err := io.Copy(buffer, tarReader); err != nil {
				fmt.Fprintf(writer, "[error]\t%s\t%s\f", imageId[:8], err.Error())
				continue
			}

			img := image.FromData(buffer.Bytes())

			if exported.Id != img.Id {
				fmt.Fprintf(writer, "[warn]\t%s\tID mismatch, new ID: %s\f", exported.Id[:8], img.Id)
			}

			img.Url = exported.Url
			img.Tags = exported.Tags

			if exported.AddedAt != "" {
				_ = img.SetAddedAtFromString(exported.AddedAt)

			}

			AddInterface(s, writer, img, false)
		} else {
			// Put the file into temporary storage which will be merged into the store later
			tempPath := path.Join(dirname, header.Name)
			tempFile, err := os.Create(tempPath)
			if err != nil {
				fmt.Fprintf(writer, "[error]\t%s\t%s\f", imageId[:8], err.Error())
				continue
			}
			defer tempFile.Close()

			if _, err := io.Copy(tempFile, tarReader); err != nil {
				fmt.Fprintf(writer, "[error]\t%s\t%s\f", imageId[:8], err.Error())
				continue
			}

			imageQueue = append(imageQueue, imageId)
		}
	}

	if !metadataRead {
		os.RemoveAll(dirname)
		return errors.New("Archive does not contain a gif.json file.")
	}

	return nil
}

func importUrls(s *store.Store, images []store.ExportedImage) {
	writer := image.DefaultWriter()
	defer writer.Flush()

	for _, exported := range images {
		img, err := image.FromUrl(exported.Url)
		if err != nil {
			fmt.Fprintf(writer, "[error]\t%s\t%s\f", exported.Id[:8], err.Error())
			continue
		}

		if exported.Id != img.Id {
			fmt.Fprintf(writer, "[warn]\t%s\tID mismatch, new ID: %s\f", exported.Id[:8], img.Id)
		}

		img.Tags = exported.Tags

		if exported.AddedAt != "" {
			if err = img.SetAddedAtFromString(exported.AddedAt); err != nil {
				fmt.Fprintf(writer, "[warn]\t%s\tCould not set addition date: %s\f", exported.Id[:8], exported.AddedAt)
			}
		}

		AddInterface(s, writer, img, false)
	}
}


text:
// ==========================================================================
// Project:   SproutCore - JavaScript Application Framework
// Copyright: ©2006-2011 Strobe Inc. and contributors.
//            portions copyright @2009 Apple Inc.
// License:   Licensed under MIT license (see license.js)
// ==========================================================================

/*global module test htmlbody ok equals same stop start Q$ */

var pane, view;

module("SC.View#didAppendToDocument");

test("Check that didAppendToDocument gets called at the right moment", function() {
   var counter=0;
   pane = SC.MainPane.create({
     childViews: [
       SC.View.extend({
         render: function (context, firstTime) {
           context.push('new string');
         },
         didAppendToDocument: function(){
           counter++;
         }
       })
     ]
   });
   equals(counter, 0, "");
   pane.append(); // make sure there is a layer...
   equals(counter, 1, "");
   view  = pane.childViews[0];
   view.displayDidChange();
   SC.RunLoop.begin().end();
   equals(counter, 2, "");

   var additionalView = SC.View.extend({
     didAppendToDocument: function(){
       counter++;
     }
   });
   additionalView = additionalView.create();
   pane.appendChild(additionalView);

   SC.RunLoop.begin().end();
   equals(counter, 3, "");
   pane.remove();
});

redpajama_set_name: RedPajamaGithub


text:
/**
 * This example demonstrates the use of split buttons. A split button is similar to a menu
 * button, but its arrow can fire an event separately from the default click event of the
 * button.  This event would typically be used to display a dropdown menu, but can also be
 * used to attach a custom action.
 */
Ext.define('KitchenSink.view.button.SplitButtons', {
    extend: 'Ext.Container',
    xtype: 'split-buttons',
    layout: 'vbox',
    //<example>
    profiles: {
        classic: {
            width: 470
        },
        neptune: {
            width: 590
        },
        triton: {
            width: 620
        },
        'neptune-touch': {
            width: 675
        }
    },
    //</example>

    initComponent: function() {
        Ext.apply(this, {
            width: this.profileInfo.width,
            items: [{
                xtype: 'checkbox',
                boxLabel: 'disabled',
                margin: '0 0 0 10',
                listeners: {
                    change: this.toggleDisabled,
                    scope: this
                }
            }, {
                xtype: 'container',
                layout: {
                    type: 'table',
                    columns: 4,
                    tdAttrs: { style: 'padding: 5px 10px;' }
                },
                defaults: {
                    menu: [{
                        text:'Menu Item 1'
                    },{
                        text:'Menu Item 2'
                    },{
                        text:'Menu Item 3'
                    }]
                },

                items: [{
                    xtype: 'component',
                    html: 'Text Only'
                }, {
                    xtype: 'splitbutton',
                    text: 'Small'
                }, {
                    xtype: 'splitbutton',
                    text: 'Medium',
                    scale: 'medium'
                }, {
                    xtype: 'splitbutton',
                    text: 'Large',
                    scale: 'large'
                }, {
                    xtype: 'component',
                    html: 'Icon Only'
                }, {
                    iconCls: 'button-home-small',
                    xtype: 'splitbutton'
                }, {
                    xtype: 'splitbutton',
                    iconCls: 'button-home-medium',
                    scale: 'medium'
                }, {
                    xtype: 'splitbutton',
                    iconCls: 'button-home-large',
                    scale: 'large'
                }, {
                    xtype: 'component',
                    html: 'Icon and Text (left)'
                }, {
                    xtype: 'splitbutton',
                    iconCls: 'button-home-small',
                    text: 'Small'
                }, {
                    xtype: 'splitbutton',
                    iconCls: 'button-home-medium',
                    text: 'Medium',
                    scale: 'medium'
                }, {
                    xtype: 'splitbutton',
                    iconCls: 'button-home-large',
                    text: 'Large',
                    scale: 'large'
                }, {
                    xtype: 'component',
                    html: 'Icon and Text (top)'
                }, {
                    xtype: 'splitbutton',
                    iconCls: 'button-home-small',
                    text: 'Small',
                    iconAlign: 'top'
                }, {
                    xtype: 'splitbutton',
                    iconCls: 'button-home-medium',
                    text: 'Medium',
                    scale: 'medium',
                    iconAlign: 'top'
                }, {
                    xtype: 'splitbutton',
                    iconCls: 'button-home-large',
                    text: 'Large',
                    scale: 'large',
                    iconAlign: 'top'
                }, {
                    xtype: 'component',
                    html: 'Icon and Text (right)'
                }, {
                    xtype: 'splitbutton',
                    iconCls: 'button-home-small',
                    text: 'Small',
                    iconAlign: 'right'
                }, {
                    xtype: 'splitbutton',
                    iconCls: 'button-home-medium',
                    text: 'Medium',
                    scale: 'medium',
                    iconAlign: 'right'
                }, {
                    xtype: 'splitbutton',
                    iconCls: 'button-home-large',
                    text: 'Large',
                    scale: 'large',
                    iconAlign: 'right'
                }, {
                    xtype: 'component',
                    html: 'Icon and Text (bottom)'
                }, {
                    xtype: 'splitbutton',
                    iconCls: 'button-home-small',
                    text: 'Small',
                    iconAlign: 'bottom'
                }, {
                    xtype: 'splitbutton',
                    iconCls: 'button-home-medium',
                    text: 'Medium',
                    scale: 'medium',
                    iconAlign: 'bottom'
                }, {
                    xtype: 'splitbutton',
                    iconCls: 'button-home-large',
                    text: 'Large',
                    scale: 'large',
                    iconAlign: 'bottom'
                }]
            }]
        });
        this.callParent();
    },

    toggleDisabled: function(checkbox, newValue, oldValue) {
        var toggleFn = newValue ? 'disable' : 'enable';

        Ext.each(this.query('button'), function(item) {
            item[toggleFn]();
        });
    }

});


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W30337_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans6.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">1 1/20/2014

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">GEOLOGIC PROGNOSIS

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Well Name: Hendrickson Federal 5-36H'l Rig: Cyclone 14 Prospect: Antelope Target: Three Forks Spacing: 2560

    <p class="styleSans6.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">El Pre-Staked ' Staked

    <p class="styleSans8.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Rig Grade Elevation: KB: RKB:

    <p class="styleSans299.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">FORMATION Pierre Shale Greenhorn
Dakota Group (fka Mow ) Basal Dakota Sand Dunham Salt Top Dunham Salt Base ine Salt Top
Pine Salt Base Minnekahta Opeche Salt Top Opeche Salt Base Minnelusa Group
SUBSEA
200 2,234 2,629 —3,397 -4,725 -4,455 —4,745 4,805 -4,872 -4,991 -5,029 —5,279 -5,644 6,208 6,354 —6,980 ~7,153 —7,794 —8,585 -8.608 ~8,669 ~8,709 —8,739 ~8,674
TVD 1,938 4,372 4,767 5,535 6,863 6,593 6,883
.0
('5 _'

7,010 7,129 7,167 7,417 7,782 8,346 8,492
Kibbey Top Charles Base Last Charles Salt Mission Canyon odeole pper Bakken Shale Middle Bakken Member ower Bakken Shale Three Forks/Base of Shale Three Forks Tar at End of Lateral
9,291
10,723 10,746 10,807 10,847 10,877
I—

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans6.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">Hendrickson Federal 5-36H1 AFE

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">SHL: 365' FSL Sec. 36 McKenzie
BHL: 1950' FNL Car '3':

    <p class="styleSans6.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">uvu. LU
McKenzie

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">2116' 22' 2138'

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">2393' 153N ND 2310' 153N ND

    <p class="styleSans7.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">FWL 94W
FWL 94W


text:
		<carousel interval="myInterval">
			<slide ng-repeat="slide in slides" active="slide.active">

Slide {{$index}}

{{slide.text}}

			</slide>
		</carousel>

A Warm Welcome!

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ipsa, ipsam, eligendi, in quo sunt possimus non incidunt odit vero aliquid similique quaerat nam nobis illo aspernatur vitae fugiat numquam repellat.

{{productCatg.p_catg_id}}