code
stringlengths
10
1.34M
language
stringclasses
1 value
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package sprite provides a 2D scene graph for rendering and animation. // // A tree of nodes is drawn by a rendering Engine, provided by another // package. T...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package portable implements a sprite Engine using the image package. // // It is intended to serve as a reference implementation for testing // other sprite ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package portable import ( "image" "image/draw" "golang.org/x/mobile/f32" ) // affine draws each pixel of dst using bilinear interpolation of the // affine...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package portable import ( "image" "image/color" "math" ) func bilinear(src image.Image, x, y float32) color.Color { switch src := src.(type) { case *imag...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package clock provides a clock and time functions for a sprite engine. package clock // A Time represents an instant in sprite time. // // The application u...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package clock // Standard tween functions. // // Easing means a slowing near the timing boundary, as defined by // a cubic bezier curve. Exact parameters match...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !gldebug package gl // TODO(crawshaw): build on more host platforms (makes it easier to gobind). // TODO(crawshaw): expand to cover OpenGL ES 3. //...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package glutil implements OpenGL utility functions. package glutil import ( "fmt" "golang.org/x/mobile/gl" ) // CreateProgram creates, compiles, and lin...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package glutil import ( "encoding/binary" "image" "sync" "golang.org/x/mobile/f32" "golang.org/x/mobile/geom" "golang.org/x/mobile/gl" ) var glimage st...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build linux,!android package glutil /* #cgo LDFLAGS: -lEGL #include <EGL/egl.h> #include <stdio.h> #include <stdlib.h> void createContext(EGLDisplay *out...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin package glutil // TODO(crawshaw): Only used in glutil tests for now (cgo is not support in _test.go files). // TODO(crawshaw): Export some ki...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gl //#include <GLES2/gl2.h> import "C" // Documented in gl.go. func f32GL4(f float32) C.GLclampf { return C.GLclampf(f) } func f32None(f float32) C....
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gl //#include <OpenGL/gl3.h> import "C" // Documented in gl.go. func f32GL4(f float32) C.GLfloat { return C.GLfloat(f) } func f32None(f float32) C....
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !gldebug package gl /* #cgo darwin LDFLAGS: -framework OpenGL #cgo linux LDFLAGS: -lGLESv2 #cgo darwin CFLAGS: -DGOOS_darwin #cgo linux CFLAG...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore // The gendebug program takes gl.go and generates a version of it // where each function includes tracing code that writes its arguments // t...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build gldebug package gl // Alternate versions of the types defined in types.go with extra // debugging information attached. For documentation, see type...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gl /* Partially generated from the Khronos OpenGL API specification in XML format, which is covered by the license: Copyright (c) 2013-2014 The Khro...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package gl // This file contains GL Types and their methods that are independent of the // "gldebug" build tag. import "golang.org/x/mobile/f32" // WriteAff...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* Package gl implements Go bindings for OpenGL ES 2. The bindings are deliberately minimal, staying as close the C API as possible. The semantics of each fun...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // An app that draws a green triangle on a red background. package main import ( "encoding/binary" "log" "golang.org/x/mobile/app" "golang.org/x/mobile/ap...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. /* This example program compiles to a gojni.so shared library, that can be loaded from an android application. Build it by configuring a cross compiler (see go....
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main // #cgo LDFLAGS: -llog // #include <android/log.h> // #include <string.h> import "C" import ( "fmt" "unsafe" ) //export LogHello func LogHello(...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "image" "log" "math" "os" "time" _ "image/jpeg" "golang.org/x/mobile/app" "golang.org/x/mobile/app/debug" "golang.org/x/mobile...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // This is the Go entry point for the libhello app. // It is invoked from Java. // // See README for details. package main import ( "golang.org/x/mobile/app" ...
Go
// Package hi provides a function for saying hello. package hi import "fmt" func Hello(name string) { fmt.Printf("Hello, %s!\n", name) }
Go
// Go MySQL Driver - A MySQL-Driver for Go's database/sql package // // Copyright 2012 Julien Schmidt. All rights reserved. // http://www.julienschmidt.com // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can o...
Go
// Go MySQL Driver - A MySQL-Driver for Go's database/sql package // // Copyright 2012 Julien Schmidt. All rights reserved. // http://www.julienschmidt.com // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can o...
Go
// Go MySQL Driver - A MySQL-Driver for Go's database/sql package // // Copyright 2012 Julien Schmidt. All rights reserved. // http://www.julienschmidt.com // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can o...
Go
// Go MySQL Driver - A MySQL-Driver for Go's database/sql package // // Copyright 2012 Julien Schmidt. All rights reserved. // http://www.julienschmidt.com // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can o...
Go
// Go MySQL Driver - A MySQL-Driver for Go's database/sql package // // Copyright 2012 Julien Schmidt. All rights reserved. // http://www.julienschmidt.com // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can o...
Go
// Go MySQL Driver - A MySQL-Driver for Go's database/sql package // // Copyright 2012 Julien Schmidt. All rights reserved. // http://www.julienschmidt.com // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can o...
Go
// Go MySQL Driver - A MySQL-Driver for Go's database/sql package // // Copyright 2012 Julien Schmidt. All rights reserved. // http://www.julienschmidt.com // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can o...
Go
// Go MySQL Driver - A MySQL-Driver for Go's database/sql package // // Copyright 2012 Julien Schmidt. All rights reserved. // http://www.julienschmidt.com // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can o...
Go
// Go MySQL Driver - A MySQL-Driver for Go's database/sql package // // Copyright 2012 Julien Schmidt. All rights reserved. // http://www.julienschmidt.com // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can o...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore // Language tag table generator. // Data read from the web. package main import ( "bufio" "code.google.com/p/go.text/cldr" "flag" "fmt" ...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package language import ( "errors" ) // Matcher is the interface that wraps the Match method. // // Match returns the best match for any of the given tags, a...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package language import ( "bytes" "fmt" "sort" "strconv" ) // get gets the string of length n for id from the given 4-byte string index. func get(idx stri...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package language implements BCP 47 language tags and related functionality. // // The Tag type, which is used to represent language tags, is agnostic to the ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package language import ( "fmt" "sort" ) // The Coverage interface is used to define the level of coverage of an // internationalization service. Note that ...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build go1.2 package language import "sort" var sortStable = sort.Stable
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build !go1.2 package language import "sort" func sortStable(s sort.Interface) { ss := stableSort{ s: s, pos: make([]int, s.Len()), } for i := ra...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package language import ( "bytes" "errors" "fmt" "regexp" "sort" "strconv" "strings" ) // isAlpha returns true if the byte is not a digit. // b must be...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package language // TODO: Various sets of commonly use tags and regions. // MustParse is like Parse, but panics if the given BCP 47 tag cannot be parsed. // I...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore // Generator for display name tables. package main import ( "flag" "fmt" "log" "net/http" "os" "path" "reflect" "sort" "strings" ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package display // This file contains common lookup code that is shared between the various // implementations of Namer and Dictionaries. import ( "fmt" "so...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package display provides display names for languages, scripts and regions in // a requested language. // // The data is based on CLDR's localeDisplayNames. I...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package display // This file contains sets of data for specific languages. Users can use these // to create smaller collections of supported languages and redu...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cldr import ( "encoding/xml" "errors" "fmt" "strings" ) // RuleProcessor can be passed to Collator's Process method, which // parses the rules and...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore // This tool generates types for the various XML formats of CLDR. package main import ( "archive/zip" "bytes" "encoding/xml" "flag" "fmt...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cldr // This file implements the various inheritance constructs defined by LDML. // See http://www.unicode.org/reports/tr35/#Inheritance_and_Validity /...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package cldr provides a parser for LDML and related XML formats. // This package is inteded to be used by the table generation tools // for the various inter...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cldr import ( "archive/zip" "bytes" "encoding/xml" "fmt" "io" "io/ioutil" "log" "os" "path/filepath" "regexp" "strings" ) // A Decoder load...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package cldr provides a parser for LDML and related XML formats. // This package is inteded to be used by the table generation tools // for the various inter...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package cldr import ( "fmt" "reflect" "sort" ) // Slice provides utilities for modifying slices of elements. // It can be wrapped around any slice of which...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package collate contains types for comparing and sorting Unicode strings // according to a given collation order. Package locale provides a high-level // in...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore // Collation table generator. // Data read from the web. package main import ( "archive/zip" "bufio" "bytes" "code.google.com/p/go.text/...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore package main import ( "archive/zip" "bufio" "bytes" "flag" "fmt" "io" "io/ioutil" "log" "net/http" "os" "path" "regexp" "strconv...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "bytes" "flag" "fmt" "io" "log" "os" "runtime/pprof" "sort" "strconv" "strings" "text/template" "time" "code.google.com/p/g...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build darwin package main /* #cgo LDFLAGS: -framework CoreFoundation #include <CoreFoundation/CFBase.h> #include <CoreFoundation/CoreFoundation.h> */ impo...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "math" "math/rand" "strings" "unicode" "unicode/utf16" "unicode/utf8" "code.google.com/p/go.text/language" "code.google.com/p/go...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build icu package main /* #cgo LDFLAGS: -licui18n -licuuc #include <stdlib.h> #include <unicode/ucol.h> #include <unicode/uiter.h> #include <unicode/utype...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "log" "unicode/utf16" "code.google.com/p/go.text/collate" "code.google.com/p/go.text/language" ) // Input holds an input string in ...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package collate import ( "bytes" "sort" ) const ( maxSortBuffer = 40960 maxSortEntries = 4096 ) type swapper interface { Swap(i, j int) } type sorter ...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package colltab import ( "fmt" "unicode" ) // Level identifies the collation comparison level. // The primary level corresponds to the basic sorting of text...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // The trie in this file is used to associate the first full character in an // UTF-8 string to a collation element. All but the last byte in a UTF-8 byte // se...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package colltab import ( "unicode/utf8" "code.google.com/p/go.text/unicode/norm" ) // table holds all collation data for a given collation ordering. type t...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package colltab // Init is for internal use only. func Init(data interface{}) Weigher { init, ok := data.(tableInitializer) if !ok { return nil } t := &t...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package colltab // A Weigher can be used as a source for Collator and Searcher. type Weigher interface { // Start finds the start of the segment that includes...
Go
// Copyright 2012 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package colltab import "unicode/utf8" // For a description of contractTrieSet, see exp/locale/collate/build/contract.go. type contractTrieSet []struct{ l, h,...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package collate // tableIndex holds information for constructing a table // for a certain locale based on the main table. type tableIndex struct { lookupOffse...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package triegen implements a code generator for a trie for associating // unsigned integer values with UTF-8 encoded runes. // // Many of the go.text package...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package triegen import ( "bytes" "fmt" "io" "strings" "text/template" ) // print writes all the data structures as well as the code necessary to use the ...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package triegen // This file defines Compacter and its implementations. import "io" // A Compacter generates an alternative, more space-efficient way to stor...
Go
// Copyright 2014 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package ucd provides a parser for Unicode Character Database files, the // format of which is defined in http://www.unicode.org/reports/tr44/. See // http://...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package encoding defines an interface for character encodings, such as Shift // JIS and Windows 1252, that can convert to and from UTF-8. // // To convert th...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package simplifiedchinese import ( "errors" "unicode/utf8" "code.google.com/p/go.text/encoding" "code.google.com/p/go.text/transform" ) // HZGB2312 is th...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package simplifiedchinese import ( "errors" "unicode/utf8" "code.google.com/p/go.text/encoding" "code.google.com/p/go.text/transform" ) var ( // GB18030...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package korean import ( "errors" "unicode/utf8" "code.google.com/p/go.text/encoding" "code.google.com/p/go.text/transform" ) // EUCKR is the EUC-KR encod...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package traditionalchinese import ( "errors" "unicode/utf8" "code.google.com/p/go.text/encoding" "code.google.com/p/go.text/transform" ) // Big5 is the B...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore package main // This program generates tables.go: // go run maketables.go | gofmt > tables.go import ( "bufio" "fmt" "log" "net/http" "...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package charmap provides simple character encodings such as IBM Code Page 437 // and Windows 1252. package charmap import ( "unicode/utf8" "code.google.c...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore package main // This program generates tables.go: // go run maketables.go | gofmt > tables.go // TODO: Emoji extensions? // http://www.unico...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package japanese import ( "errors" "unicode/utf8" "code.google.com/p/go.text/encoding" "code.google.com/p/go.text/transform" ) // EUCJP is the EUC-JP enc...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package japanese import ( "errors" "unicode/utf8" "code.google.com/p/go.text/encoding" "code.google.com/p/go.text/transform" ) // ISO2022JP is the ISO-20...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package japanese import ( "errors" "unicode/utf8" "code.google.com/p/go.text/encoding" "code.google.com/p/go.text/transform" ) // ShiftJIS is the Shift J...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package unicode provides Unicode encodings such as UTF-16. package unicode import ( "errors" "unicode/utf16" "unicode/utf8" "code.google.com/p/go.text/...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package transform provides reader and writer wrappers that transform the // bytes passing through as well as various transformations. Example // transformati...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package norm contains types and functions for normalizing Unicode strings. package norm import "unicode/utf8" // A Form denotes a canonical representation ...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore // Normalization table generator. // Data read from the web. // See forminfo.go for a description of the trie values associated with each rune...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore // Trie table generator. // Used by make*tables tools to generate a go file with trie data structures // for mapping UTF-8 to a 16-bit value. ...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package norm import ( "fmt" "unicode/utf8" ) const MaxSegmentSize = maxByteBufferSize // An Iter iterates over a string or byte slice, while normalizing it...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package norm import "io" type normWriter struct { rb reorderBuffer w io.Writer buf []byte } // Write implements the standard write interface. If the l...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package norm type valueRange struct { value uint16 // header: value:stride lo, hi byte // header: lo:n } type trie struct { index []uint8 values...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore package main import ( "bufio" "bytes" "flag" "fmt" "log" "net/http" "os" "path" "regexp" "runtime" "strconv" "strings" "time" "...
Go
// Copyright 2013 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package norm import ( "unicode/utf8" "code.google.com/p/go.text/transform" ) // Transform implements the transform.Transformer interface. It may need to //...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package norm import "unicode/utf8" type input struct { str string bytes []byte } func inputBytes(str []byte) input { return input{bytes: str} } func in...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build ignore // Generate test data for trie code. package main import ( "fmt" ) func main() { printTestTables() } // We take the smallest, largest an...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package norm import "unicode/utf8" const ( maxNonStarters = 30 // The maximum number of characters needed for a buffer is // maxNonStarters + 1 for the sta...
Go
// Copyright 2011 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package norm // This file contains Form-specific logic and wrappers for data in tables.go. // Rune info is stored in a separate trie per composing form. A com...
Go
/** * SMTP server. * * Sam Thorogood (c) 2010 */ package main import ( "fmt" "flag" "os" "runtime" "strings" "delivers" ) var ( fHelp *bool = flag.Bool("h", false, "to show help") fBindTo *string = flag.String("l", "localhost:60000", "address to bind on") fBasePath *string = flag.String("p", ""...
Go