text:
/a/lib/tsc.js -b -w -verbose
//// [/user/username/projects/demo/core/tsconfig.json]
{
  "extends": "../tsconfig-base.json",
  "compilerOptions": {
    "outDir": "../lib/core",
    "rootDir": "."
  }
}

//// [/user/username/projects/demo/core/utilities.ts]
import * as A from '../animals';

export function makeRandomName() {
    return "Bob!?! ";
}

export function lastElementOf<T>(arr: T[]): T | undefined {
    if (arr.length === 0) return undefined;
    return arr[arr.length - 1];
}

//// [/user/username/projects/demo/animals/tsconfig.json]
{
  "extends": "../tsconfig-base.json",
  "compilerOptions": {
    "outDir": "../lib/animals",
    "rootDir": ".",
  },
  "references": [
    { "path": "../core" }
  ]
}

//// [/user/username/projects/demo/animals/animal.ts]
export type Size = "small" | "medium" | "large";
export default interface Animal {
    size: Size;
}

//// [/user/username/projects/demo/animals/dog.ts]
import Animal from '.';
import { makeRandomName } from '../core/utilities';

export interface Dog extends Animal {
    woof(): void;
    name: string;
}

export function createDog(): Dog {
    return ({
        size: "medium",
        woof: function(this: Dog) {
            console.log(`${this.name} says "Woof"!`);
        },
        name: makeRandomName()
    });
}

//// [/user/username/projects/demo/animals/index.ts]
import Animal from './animal';

export default Animal;
import { createDog, Dog } from './dog';
export { createDog, Dog };

//// [/user/username/projects/demo/zoo/tsconfig.json]
{
  "extends": "../tsconfig-base.json",
  "compilerOptions": {
    "outDir": "../lib/zoo",
    "rootDir": "."
  },
  "references": [
    {
      "path": "../animals"
    }
  ]
}

//// [/user/username/projects/demo/zoo/zoo.ts]
import { Dog, createDog } from '../animals/index';

export function createZoo(): Array<Dog> {
    return [
        createDog()
    ];
}

//// [/user/username/projects/demo/tsconfig.json]
{
  "files": [],
  "references": [
    {
      "path": "./core"
    },
    {
      "path": "./animals"
    },
    {
      "path": "./zoo"
    }
  ]
}

//// [/user/username/projects/demo/tsconfig-base.json]
{
    "compilerOptions": {
        "declaration": true,
        "target": "es5",
        "module": "commonjs",
        "strict": true,
        "noUnusedLocals": true,
        "noUnusedParameters": true,
        "noImplicitReturns": true,
        "noFallthroughCasesInSwitch": true,
        "composite": true
    }
}

//// [/a/lib/lib.d.ts]
/// <reference no-default-lib="true"/>
interface Boolean {}
interface Function {}
interface CallableFunction {}
interface NewableFunction {}
interface IArguments {}
interface Number { toExponential: any; }
interface Object {}
interface RegExp {}
interface String { charAt: any; }
interface Array<T> { length: number; [n: number]: T; }
interface ReadonlyArray<T> {}
declare const console: { log(msg: any): void; };

Output::
>> Screen clear
12:00:46 AM - Starting compilation in watch mode...

12:00:47 AM - Projects in this build:
    * core/tsconfig.json
    * animals/tsconfig.json
    * zoo/tsconfig.json
    * tsconfig.json

12:00:48 AM - Project 'core/tsconfig.json' is out of date because output file 'lib/core/utilities.js' does not exist

12:00:49 AM - Building project '/user/username/projects/demo/core/tsconfig.json'...

animals/index.ts(1,20): error TS6059: File '/user/username/projects/demo/animals/animal.ts' is not under 'rootDir' '/user/username/projects/demo/core'. 'rootDir' is expected to contain all source files.

animals/index.ts(1,20): error TS6307: File '/user/username/projects/demo/animals/animal.ts' is not listed within the file list of project '/user/username/projects/demo/core/tsconfig.json'. Projects must list all files or use an 'include' pattern.

animals/index.ts(4,32): error TS6059: File '/user/username/projects/demo/animals/dog.ts' is not under 'rootDir' '/user/username/projects/demo/core'. 'rootDir' is expected to contain all source files.

animals/index.ts(4,32): error TS6307: File '/user/username/projects/demo/animals/dog.ts' is not listed within the file list of project '/user/username/projects/demo/core/tsconfig.json'. Projects must list all files or use an 'include' pattern.

core/utilities.ts(1,1): error TS6133: 'A' is declared but its value is never read.

core/utilities.ts(1,20): error TS6059: File '/user/username/projects/demo/animals/index.ts' is not under 'rootDir' '/user/username/projects/demo/core'. 'rootDir' is expected to contain all source files.

core/utilities.ts(1,20): error TS6307: File '/user/username/projects/demo/animals/index.ts' is not listed within the file list of project '/user/username/projects/demo/core/tsconfig.json'. Projects must list all files or use an 'include' pattern.

12:00:50 AM - Project 'animals/tsconfig.json' can't be built because its dependency 'core' has errors

12:00:51 AM - Skipping build of project '/user/username/projects/demo/animals/tsconfig.json' because its dependency '/user/username/projects/demo/core' has errors

12:00:52 AM - Project 'zoo/tsconfig.json' can't be built because its dependency 'animals' was not built

12:00:53 AM - Skipping build of project '/user/username/projects/demo/zoo/tsconfig.json' because its dependency '/user/username/projects/demo/animals' was not built

12:00:54 AM - Found 7 errors. Watching for file changes.

Program root files: ["/user/username/projects/demo/core/utilities.ts"]
Program options: {"declaration":true,"target":1,"module":1,"strict":true,"noUnusedLocals":true,"noUnusedParameters":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"composite":true,"outDir":"/user/username/projects/demo/lib/core","rootDir":"/user/username/projects/demo/core","watch":true,"configFilePath":"/user/username/projects/demo/core/tsconfig.json"}
Program files::
/a/lib/lib.d.ts
/user/username/projects/demo/animals/animal.ts
/user/username/projects/demo/animals/dog.ts
/user/username/projects/demo/animals/index.ts
/user/username/projects/demo/core/utilities.ts

Semantic diagnostics in builder refreshed for::
/a/lib/lib.d.ts
/user/username/projects/demo/animals/animal.ts
/user/username/projects/demo/animals/dog.ts
/user/username/projects/demo/animals/index.ts
/user/username/projects/demo/core/utilities.ts

WatchedFiles::
/user/username/projects/demo/core/tsconfig.json:
  {"fileName":"/user/username/projects/demo/core/tsconfig.json","pollingInterval":250}
/user/username/projects/demo/core/utilities.ts:
  {"fileName":"/user/username/projects/demo/core/utilities.ts","pollingInterval":250}
/user/username/projects/demo/animals/tsconfig.json:
  {"fileName":"/user/username/projects/demo/animals/tsconfig.json","pollingInterval":250}
/user/username/projects/demo/animals/animal.ts:
  {"fileName":"/user/username/projects/demo/animals/animal.ts","pollingInterval":250}
/user/username/projects/demo/animals/dog.ts:
  {"fileName":"/user/username/projects/demo/animals/dog.ts","pollingInterval":250}
/user/username/projects/demo/animals/index.ts:
  {"fileName":"/user/username/projects/demo/animals/index.ts","pollingInterval":250}
/user/username/projects/demo/zoo/tsconfig.json:
  {"fileName":"/user/username/projects/demo/zoo/tsconfig.json","pollingInterval":250}
/user/username/projects/demo/zoo/zoo.ts:
  {"fileName":"/user/username/projects/demo/zoo/zoo.ts","pollingInterval":250}
/user/username/projects/demo/tsconfig.json:
  {"fileName":"/user/username/projects/demo/tsconfig.json","pollingInterval":250}

FsWatches::

FsWatchesRecursive::
/user/username/projects/demo/core:
  {"directoryName":"/user/username/projects/demo/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}}
/user/username/projects/demo/animals:
  {"directoryName":"/user/username/projects/demo/animals","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}}
/user/username/projects/demo/zoo:
  {"directoryName":"/user/username/projects/demo/zoo","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}}

exitCode:: ExitStatus.undefined

Change:: Prepend a line

//// [/user/username/projects/demo/core/utilities.ts]

import * as A from '../animals';

export function makeRandomName() {
    return "Bob!?! ";
}

export function lastElementOf<T>(arr: T[]): T | undefined {
    if (arr.length === 0) return undefined;
    return arr[arr.length - 1];
}

Output::
>> Screen clear
12:00:58 AM - File change detected. Starting incremental compilation...

12:00:59 AM - Project 'core/tsconfig.json' is out of date because output file 'lib/core/utilities.js' does not exist

12:01:00 AM - Building project '/user/username/projects/demo/core/tsconfig.json'...

animals/index.ts(1,20): error TS6059: File '/user/username/projects/demo/animals/animal.ts' is not under 'rootDir' '/user/username/projects/demo/core'. 'rootDir' is expected to contain all source files.

animals/index.ts(1,20): error TS6307: File '/user/username/projects/demo/animals/animal.ts' is not listed within the file list of project '/user/username/projects/demo/core/tsconfig.json'. Projects must list all files or use an 'include' pattern.

animals/index.ts(4,32): error TS6059: File '/user/username/projects/demo/animals/dog.ts' is not under 'rootDir' '/user/username/projects/demo/core'. 'rootDir' is expected to contain all source files.

animals/index.ts(4,32): error TS6307: File '/user/username/projects/demo/animals/dog.ts' is not listed within the file list of project '/user/username/projects/demo/core/tsconfig.json'. Projects must list all files or use an 'include' pattern.

core/utilities.ts(2,1): error TS6133: 'A' is declared but its value is never read.

core/utilities.ts(2,20): error TS6059: File '/user/username/projects/demo/animals/index.ts' is not under 'rootDir' '/user/username/projects/demo/core'. 'rootDir' is expected to contain all source files.

core/utilities.ts(2,20): error TS6307: File '/user/username/projects/demo/animals/index.ts' is not listed within the file list of project '/user/username/projects/demo/core/tsconfig.json'. Projects must list all files or use an 'include' pattern.

12:01:01 AM - Found 7 errors. Watching for file changes.

Program root files: ["/user/username/projects/demo/core/utilities.ts"]
Program options: {"declaration":true,"target":1,"module":1,"strict":true,"noUnusedLocals":true,"noUnusedParameters":true,"noImplicitReturns":true,"noFallthroughCasesInSwitch":true,"composite":true,"outDir":"/user/username/projects/demo/lib/core","rootDir":"/user/username/projects/demo/core","watch":true,"configFilePath":"/user/username/projects/demo/core/tsconfig.json"}
Program files::
/a/lib/lib.d.ts
/user/username/projects/demo/animals/animal.ts
/user/username/projects/demo/animals/dog.ts
/user/username/projects/demo/animals/index.ts
/user/username/projects/demo/core/utilities.ts

Semantic diagnostics in builder refreshed for::
/user/username/projects/demo/core/utilities.ts

WatchedFiles::
/user/username/projects/demo/core/tsconfig.json:
  {"fileName":"/user/username/projects/demo/core/tsconfig.json","pollingInterval":250}
/user/username/projects/demo/core/utilities.ts:
  {"fileName":"/user/username/projects/demo/core/utilities.ts","pollingInterval":250}
/user/username/projects/demo/animals/tsconfig.json:
  {"fileName":"/user/username/projects/demo/animals/tsconfig.json","pollingInterval":250}
/user/username/projects/demo/animals/animal.ts:
  {"fileName":"/user/username/projects/demo/animals/animal.ts","pollingInterval":250}
/user/username/projects/demo/animals/dog.ts:
  {"fileName":"/user/username/projects/demo/animals/dog.ts","pollingInterval":250}
/user/username/projects/demo/animals/index.ts:
  {"fileName":"/user/username/projects/demo/animals/index.ts","pollingInterval":250}
/user/username/projects/demo/zoo/tsconfig.json:
  {"fileName":"/user/username/projects/demo/zoo/tsconfig.json","pollingInterval":250}
/user/username/projects/demo/zoo/zoo.ts:
  {"fileName":"/user/username/projects/demo/zoo/zoo.ts","pollingInterval":250}
/user/username/projects/demo/tsconfig.json:
  {"fileName":"/user/username/projects/demo/tsconfig.json","pollingInterval":250}

FsWatches::

FsWatchesRecursive::
/user/username/projects/demo/core:
  {"directoryName":"/user/username/projects/demo/core","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}}
/user/username/projects/demo/animals:
  {"directoryName":"/user/username/projects/demo/animals","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}}
/user/username/projects/demo/zoo:
  {"directoryName":"/user/username/projects/demo/zoo","fallbackPollingInterval":500,"fallbackOptions":{"watchFile":"PriorityPollingInterval"}}

exitCode:: ExitStatus.undefined


text:
<!DOCTYPE html>

	<title>CITA 410</title>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
	<meta name="description" content="" />

	<link rel="stylesheet" type="text/css" href="css/kickstart.css" media="all" />
	<link rel="stylesheet" type="text/css" href="style.css" media="all" />

		Microsoft Student Partner Video

 <video width="854" height="480" controls>
  <source src="movies/alfred.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>

redpajama_set_name: RedPajamaGithub


text:
"""Git interaction library.
bup repositories are in Git format. This library allows us to
interact with the Git data structures.
"""
import os, sys, zlib, time, subprocess, struct, stat, re, tempfile, glob
from bup.helpers import *
from bup import _helpers, path, midx, bloom, xstat

max_pack_size = 1000*1000*1000  # larger packs will slow down pruning
max_pack_objects = 200*1000  # cache memory usage is about 83 bytes per object
SEEK_END=2  # os.SEEK_END is not defined in python 2.4

verbose = 0
ignore_midx = 0
home_repodir = os.path.expanduser('~/.bup')
repodir = None

_typemap =  { 'blob':3, 'tree':2, 'commit':1, 'tag':4 }
_typermap = { 3:'blob', 2:'tree', 1:'commit', 4:'tag' }

_total_searches = 0
_total_steps = 0

class GitError(Exception):
    pass

def repo(sub = ''):
    """Get the path to the git repository or one of its subdirectories."""
    global repodir
    if not repodir:
        raise GitError('You should call check_repo_or_die()')

    # If there's a .git subdirectory, then the actual repo is in there.
    gd = os.path.join(repodir, '.git')
    if os.path.exists(gd):
        repodir = gd

    return os.path.join(repodir, sub)

def shorten_hash(s):
    return re.sub(r'([^0-9a-z]|\b)([0-9a-z]{7})[0-9a-z]{33}([^0-9a-z]|\b)',
                  r'\1\2*\3', s)

def repo_rel(path):
    full = os.path.abspath(path)
    fullrepo = os.path.abspath(repo(''))
    if not fullrepo.endswith('/'):
        fullrepo += '/'
    if full.startswith(fullrepo):
        path = full[len(fullrepo):]
    if path.startswith('index-cache/'):
        path = path[len('index-cache/'):]
    return shorten_hash(path)

def all_packdirs():
    paths = [repo('objects/pack')]
    paths += glob.glob(repo('index-cache/*/.'))
    return paths

def auto_midx(objdir):
    args = [path.exe(), 'midx', '--auto', '--dir', objdir]
    try:
        rv = subprocess.call(args, stdout=open('/dev/null', 'w'))
    except OSError, e:
        # make sure 'args' gets printed to help with debugging
        add_error('%r: exception: %s' % (args, e))
        raise
    if rv:
        add_error('%r: returned %d' % (args, rv))

    args = [path.exe(), 'bloom', '--dir', objdir]
    try:
        rv = subprocess.call(args, stdout=open('/dev/null', 'w'))
    except OSError, e:
        # make sure 'args' gets printed to help with debugging
        add_error('%r: exception: %s' % (args, e))
        raise
    if rv:
        add_error('%r: returned %d' % (args, rv))

def mangle_name(name, mode, gitmode):
    """Mangle a file name to present an abstract name for segmented files.
    Mangled file names will have the ".bup" extension added to them. If a
    file's name already ends with ".bup", a ".bupl" extension is added to
    disambiguate normal files from semgmented ones.
    """
    if stat.S_ISREG(mode) and not stat.S_ISREG(gitmode):
        return name + '.bup'
    elif name.endswith('.bup') or name[:-1].endswith('.bup'):
        return name + '.bupl'
    else:
        return name

(BUP_NORMAL, BUP_CHUNKED) = (0,1)
def demangle_name(name):
    """Remove name mangling from a file name, if necessary.

    The return value is a tuple (demangled_filename,mode), where mode is one of
    the following:

    * BUP_NORMAL  : files that should be read as-is from the repository
    * BUP_CHUNKED : files that were chunked and need to be assembled

    For more information on the name mangling algorythm, see mangle_name()
    """
    if name.endswith('.bupl'):
        return (name[:-5], BUP_NORMAL)
    elif name.endswith('.bup'):
        return (name[:-4], BUP_CHUNKED)
    else:
        return (name, BUP_NORMAL)

def calc_hash(type, content):
    """Calculate some content's hash in the Git fashion."""
    header = '%s %d\0' % (type, len(content))
    sum = Sha1(header)
    sum.update(content)
    return sum.digest()

def _shalist_sort_key(ent):
    (mode, name, id) = ent
    assert(mode+0 == mode)
    if stat.S_ISDIR(mode):
        return name + '/'
    else:
        return name

def tree_encode(shalist):
    """Generate a git tree object from (mode,name,hash) tuples."""
    shalist = sorted(shalist, key = _shalist_sort_key)
    l = []
    for (mode,name,bin) in shalist:
        assert(mode)
        assert(mode+0 == mode)
        assert(name)
        assert(len(bin) == 20)
        s = '%o %s\0%s' % (mode,name,bin)
        assert(s[0] != '0')  # 0-padded octal is not acceptable in a git tree
        l.append(s)
    return ''.join(l)

def tree_decode(buf):
    """Generate a list of (mode,name,hash) from the git tree object in buf."""
    ofs = 0
    while ofs < len(buf):
        z = buf[ofs:].find('\0')
        assert(z > 0)
        spl = buf[ofs:ofs+z].split(' ', 1)
        assert(len(spl) == 2)
        mode,name = spl
        sha = buf[ofs+z+1:ofs+z+1+20]
        ofs += z+1+20
        yield (int(mode, 8), name, sha)

def _encode_packobj(type, content, compression_level=1):
    szout = ''
    sz = len(content)
    szbits = (sz & 0x0f) | (_typemap[type]<<4)
    sz >>= 4
    while 1:
        if sz: szbits |= 0x80
        szout += chr(szbits)
        if not sz:
            break
        szbits = sz & 0x7f
        sz >>= 7
    if compression_level > 9:
        compression_level = 9
    elif compression_level < 0:
        compression_level = 0
    z = zlib.compressobj(compression_level)
    yield szout
    yield z.compress(content)
    yield z.flush()

def _encode_looseobj(type, content, compression_level=1):
    z = zlib.compressobj(compression_level)
    yield z.compress('%s %d\0' % (type, len(content)))
    yield z.compress(content)
    yield z.flush()

def _decode_looseobj(buf):
    assert(buf);
    s = zlib.decompress(buf)
    i = s.find('\0')
    assert(i > 0)
    l = s[:i].split(' ')
    type = l[0]
    sz = int(l[1])
    content = s[i+1:]
    assert(type in _typemap)
    assert(sz == len(content))
    return (type, content)

def _decode_packobj(buf):
    assert(buf)
    c = ord(buf[0])
    type = _typermap[(c & 0x70) >> 4]
    sz = c & 0x0f
    shift = 4
    i = 0
    while c & 0x80:
        i += 1
        c = ord(buf[i])
        sz |= (c & 0x7f) << shift
        shift += 7
        if not (c & 0x80):
            break
    return (type, zlib.decompress(buf[i+1:]))

class PackIdx:
    def __init__(self):
        assert(0)

    def find_offset(self, hash):
        """Get the offset of an object inside the index file."""
        idx = self._idx_from_hash(hash)
        if idx != None:
            return self._ofs_from_idx(idx)
        return None

    def exists(self, hash, want_source=False):
        """Return nonempty if the object exists in this index."""
        if hash and (self._idx_from_hash(hash) != None):
            return want_source and os.path.basename(self.name) or True
        return None

    def __len__(self):
        return int(self.fanout[255])

    def _idx_from_hash(self, hash):
        global _total_searches, _total_steps
        _total_searches += 1
        assert(len(hash) == 20)
        b1 = ord(hash[0])
        start = self.fanout[b1-1] # range -1..254
        end = self.fanout[b1] # range 0..255
        want = str(hash)
        _total_steps += 1  # lookup table is a step
        while start < end:
            _total_steps += 1
            mid = start + (end-start)/2
            v = self._idx_to_hash(mid)
            if v < want:
                start = mid+1
            elif v > want:
                end = mid
            else: # got it!
                return mid
        return None

class PackIdxV1(PackIdx):
    """Object representation of a Git pack index (version 1) file."""
    def __init__(self, filename, f):
        self.name = filename
        self.idxnames = [self.name]
        self.map = mmap_read(f)
        self.fanout = list(struct.unpack('!256I',
                                         str(buffer(self.map, 0, 256*4))))
        self.fanout.append(0)  # entry "-1"
        nsha = self.fanout[255]
        self.sha_ofs = 256*4
        self.shatable = buffer(self.map, self.sha_ofs, nsha*24)

    def _ofs_from_idx(self, idx):
        return struct.unpack('!I', str(self.shatable[idx*24 : idx*24+4]))[0]

    def _idx_to_hash(self, idx):
        return str(self.shatable[idx*24+4 : idx*24+24])

    def __iter__(self):
        for i in xrange(self.fanout[255]):
            yield buffer(self.map, 256*4 + 24*i + 4, 20)

class PackIdxV2(PackIdx):
    """Object representation of a Git pack index (version 2) file."""
    def __init__(self, filename, f):
        self.name = filename
        self.idxnames = [self.name]
        self.map = mmap_read(f)
        assert(str(self.map[0:8]) == '\377tOc\0\0\0\2')
        self.fanout = list(struct.unpack('!256I',
                                         str(buffer(self.map, 8, 256*4))))
        self.fanout.append(0)  # entry "-1"
        nsha = self.fanout[255]
        self.sha_ofs = 8 + 256*4
        self.shatable = buffer(self.map, self.sha_ofs, nsha*20)
        self.ofstable = buffer(self.map,
                               self.sha_ofs + nsha*20 + nsha*4,
                               nsha*4)
        self.ofs64table = buffer(self.map,
                                 8 + 256*4 + nsha*20 + nsha*4 + nsha*4)

    def _ofs_from_idx(self, idx):
        ofs = struct.unpack('!I', str(buffer(self.ofstable, idx*4, 4)))[0]
        if ofs & 0x80000000:
            idx64 = ofs & 0x7fffffff
            ofs = struct.unpack('!Q',
                                str(buffer(self.ofs64table, idx64*8, 8)))[0]
        return ofs

    def _idx_to_hash(self, idx):
        return str(self.shatable[idx*20:(idx+1)*20])

    def __iter__(self):
        for i in xrange(self.fanout[255]):
            yield buffer(self.map, 8 + 256*4 + 20*i, 20)

_mpi_count = 0
class PackIdxList:
    def __init__(self, dir):
        global _mpi_count
        assert(_mpi_count == 0) # these things suck tons of VM; don't waste it
        _mpi_count += 1
        self.dir = dir
        self.also = set()
        self.packs = []
        self.do_bloom = False
        self.bloom = None
        self.refresh()

    def __del__(self):
        global _mpi_count
        _mpi_count -= 1
        assert(_mpi_count == 0)

    def __iter__(self):
        return iter(idxmerge(self.packs))

    def __len__(self):
        return sum(len(pack) for pack in self.packs)

    def exists(self, hash, want_source=False):
        """Return nonempty if the object exists in the index files."""
        global _total_searches
        _total_searches += 1
        if hash in self.also:
            return True
        if self.do_bloom and self.bloom:
            if self.bloom.exists(hash):
                self.do_bloom = False
            else:
                _total_searches -= 1  # was counted by bloom
                return None
        for i in xrange(len(self.packs)):
            p = self.packs[i]
            _total_searches -= 1  # will be incremented by sub-pack
            ix = p.exists(hash, want_source=want_source)
            if ix:
                # reorder so most recently used packs are searched first
                self.packs = [p] + self.packs[:i] + self.packs[i+1:]
                return ix
        self.do_bloom = True
        return None

    def refresh(self, skip_midx = False):
        """Refresh the index list.
        This method verifies if .midx files were superseded (e.g. all of its
        contents are in another, bigger .midx file) and removes the superseded
        files.

        If skip_midx is True, all work on .midx files will be skipped and .midx
        files will be removed from the list.

        The module-global variable 'ignore_midx' can force this function to
        always act as if skip_midx was True.
        """
        self.bloom = None # Always reopen the bloom as it may have been relaced
        self.do_bloom = False
        skip_midx = skip_midx or ignore_midx
        d = dict((p.name, p) for p in self.packs
                 if not skip_midx or not isinstance(p, midx.PackMidx))
        if os.path.exists(self.dir):
            if not skip_midx:
                midxl = []
                for ix in self.packs:
                    if isinstance(ix, midx.PackMidx):
                        for name in ix.idxnames:
                            d[os.path.join(self.dir, name)] = ix
                for full in glob.glob(os.path.join(self.dir,'*.midx')):
                    if not d.get(full):
                        mx = midx.PackMidx(full)
                        (mxd, mxf) = os.path.split(mx.name)
                        broken = False
                        for n in mx.idxnames:
                            if not os.path.exists(os.path.join(mxd, n)):
                                log(('warning: index %s missing\n' +
                                    '  used by %s\n') % (n, mxf))
                                broken = True
                        if broken:
                            del mx
                            unlink(full)
                        else:
                            midxl.append(mx)
                midxl.sort(key=lambda ix:
                           (-len(ix), -xstat.stat(ix.name).st_mtime))
                for ix in midxl:
                    any_needed = False
                    for sub in ix.idxnames:
                        found = d.get(os.path.join(self.dir, sub))
                        if not found or isinstance(found, PackIdx):
                            # doesn't exist, or exists but not in a midx
                            any_needed = True
                            break
                    if any_needed:
                        d[ix.name] = ix
                        for name in ix.idxnames:
                            d[os.path.join(self.dir, name)] = ix
                    elif not ix.force_keep:
                        debug1('midx: removing redundant: %s\n'
                               % os.path.basename(ix.name))
                        unlink(ix.name)
            for full in glob.glob(os.path.join(self.dir,'*.idx')):
                if not d.get(full):
                    try:
                        ix = open_idx(full)
                    except GitError, e:
                        add_error(e)
                        continue
                    d[full] = ix
            bfull = os.path.join(self.dir, 'bup.bloom')
            if self.bloom is None and os.path.exists(bfull):
                self.bloom = bloom.ShaBloom(bfull)
            self.packs = list(set(d.values()))
            self.packs.sort(lambda x,y: -cmp(len(x),len(y)))
            if self.bloom and self.bloom.valid() and len(self.bloom) >= len(self):
                self.do_bloom = True
            else:
                self.bloom = None
        debug1('PackIdxList: using %d index%s.\n'
            % (len(self.packs), len(self.packs)!=1 and 'es' or ''))

    def add(self, hash):
        """Insert an additional object in the list."""
        self.also.add(hash)

def open_idx(filename):
    if filename.endswith('.idx'):
        f = open(filename, 'rb')
        header = f.read(8)
        if header[0:4] == '\377tOc':
            version = struct.unpack('!I', header[4:8])[0]
            if version == 2:
                return PackIdxV2(filename, f)
            else:
                raise GitError('%s: expected idx file version 2, got %d'
                               % (filename, version))
        elif len(header) == 8 and header[0:4] < '\377tOc':
            return PackIdxV1(filename, f)
        else:
            raise GitError('%s: unrecognized idx file header' % filename)
    elif filename.endswith('.midx'):
        return midx.PackMidx(filename)
    else:
        raise GitError('idx filenames must end with .idx or .midx')

def idxmerge(idxlist, final_progress=True):
    """Generate a list of all the objects reachable in a PackIdxList."""
    def pfunc(count, total):
        qprogress('Reading indexes: %.2f%% (%d/%d)\r'
                  % (count*100.0/total, count, total))
    def pfinal(count, total):
        if final_progress:
            progress('Reading indexes: %.2f%% (%d/%d), done.\n'
                     % (100, total, total))
    return merge_iter(idxlist, 10024, pfunc, pfinal)

def _make_objcache():
    return PackIdxList(repo('objects/pack'))

class PackWriter:
    """Writes Git objects inside a pack file."""
    def __init__(self, objcache_maker=_make_objcache, compression_level=1):
        self.count = 0
        self.outbytes = 0
        self.filename = None
        self.file = None
        self.idx = None
        self.objcache_maker = objcache_maker
        self.objcache = None
        self.compression_level = compression_level

    def __del__(self):
        self.close()

    def _open(self):
        if not self.file:
            (fd,name) = tempfile.mkstemp(suffix='.pack', dir=repo('objects'))
            self.file = os.fdopen(fd, 'w+b')
            assert(name.endswith('.pack'))
            self.filename = name[:-5]
            self.file.write('PACK\0\0\0\2\0\0\0\0')
            self.idx = list(list() for i in xrange(256))

    def _raw_write(self, datalist, sha):
        self._open()
        f = self.file
        # in case we get interrupted (eg. KeyboardInterrupt), it's best if
        # the file never has a *partial* blob.  So let's make sure it's
        # all-or-nothing.  (The blob shouldn't be very big anyway, thanks
        # to our hashsplit algorithm.)  f.write() does its own buffering,
        # but that's okay because we'll flush it in _end().
        oneblob = ''.join(datalist)
        try:
            f.write(oneblob)
        except IOError, e:
            raise GitError, e, sys.exc_info()[2]
        nw = len(oneblob)
        crc = zlib.crc32(oneblob) & 0xffffffff
        self._update_idx(sha, crc, nw)
        self.outbytes += nw
        self.count += 1
        return nw, crc

    def _update_idx(self, sha, crc, size):
        assert(sha)
        if self.idx:
            self.idx[ord(sha[0])].append((sha, crc, self.file.tell() - size))

    def _write(self, sha, type, content):
        if verbose:
            log('>')
        if not sha:
            sha = calc_hash(type, content)
        size, crc = self._raw_write(_encode_packobj(type, content,
                                                    self.compression_level),
                                    sha=sha)
        if self.outbytes >= max_pack_size or self.count >= max_pack_objects:
            self.breakpoint()
        return sha

    def breakpoint(self):
        """Clear byte and object counts and return the last processed id."""
        id = self._end()
        self.outbytes = self.count = 0
        return id

    def _require_objcache(self):
        if self.objcache is None and self.objcache_maker:
            self.objcache = self.objcache_maker()
        if self.objcache is None:
            raise GitError(
                    "PackWriter not opened or can't check exists w/o objcache")

    def exists(self, id, want_source=False):
        """Return non-empty if an object is found in the object cache."""
        self._require_objcache()
        return self.objcache.exists(id, want_source=want_source)

    def maybe_write(self, type, content):
        """Write an object to the pack file if not present and return its id."""
        sha = calc_hash(type, content)
        if not self.exists(sha):
            self._write(sha, type, content)
            self._require_objcache()
            self.objcache.add(sha)
        return sha

    def new_blob(self, blob):
        """Create a blob object in the pack with the supplied content."""
        return self.maybe_write('blob', blob)

    def new_tree(self, shalist):
        """Create a tree object in the pack."""
        content = tree_encode(shalist)
        return self.maybe_write('tree', content)

    def _new_commit(self, tree, parent, author, adate, committer, cdate, msg):
        l = []
        if tree: l.append('tree %s' % tree.encode('hex'))
        if parent: l.append('parent %s' % parent.encode('hex'))
        if author: l.append('author %s %s' % (author, _git_date(adate)))
        if committer: l.append('committer %s %s' % (committer, _git_date(cdate)))
        l.append('')
        l.append(msg)
        return self.maybe_write('commit', '\n'.join(l))

    def new_commit(self, parent, tree, date, msg):
        """Create a commit object in the pack."""
        userline = '%s <%s@%s>' % (userfullname(), username(), hostname())
        commit = self._new_commit(tree, parent,
                                  userline, date, userline, date,
                                  msg)
        return commit

    def abort(self):
        """Remove the pack file from disk."""
        f = self.file
        if f:
            self.idx = None
            self.file = None
            f.close()
            os.unlink(self.filename + '.pack')

    def _end(self, run_midx=True):
        f = self.file
        if not f: return None
        self.file = None
        self.objcache = None
        idx = self.idx
        self.idx = None

        # update object count
        f.seek(8)
        cp = struct.pack('!i', self.count)
        assert(len(cp) == 4)
        f.write(cp)

        # calculate the pack sha1sum
        f.seek(0)
        sum = Sha1()
        for b in chunkyreader(f):
            sum.update(b)
        packbin = sum.digest()
        f.write(packbin)
        f.close()

        obj_list_sha = self._write_pack_idx_v2(self.filename + '.idx', idx, packbin)

        nameprefix = repo('objects/pack/pack-%s' % obj_list_sha)
        if os.path.exists(self.filename + '.map'):
            os.unlink(self.filename + '.map')
        os.rename(self.filename + '.pack', nameprefix + '.pack')
        os.rename(self.filename + '.idx', nameprefix + '.idx')

        if run_midx:
            auto_midx(repo('objects/pack'))
        return nameprefix

    def close(self, run_midx=True):
        """Close the pack file and move it to its definitive path."""
        return self._end(run_midx=run_midx)

    def _write_pack_idx_v2(self, filename, idx, packbin):
        idx_f = open(filename, 'w+b')
        idx_f.write('\377tOc\0\0\0\2')

        ofs64_ofs = 8 + 4*256 + 28*self.count
        idx_f.truncate(ofs64_ofs)
        idx_f.seek(0)
        idx_map = mmap_readwrite(idx_f, close=False)
        idx_f.seek(0, SEEK_END)
        count = _helpers.write_idx(idx_f, idx_map, idx, self.count)
        assert(count == self.count)
        idx_map.close()
        idx_f.write(packbin)

        idx_f.seek(0)
        idx_sum = Sha1()
        b = idx_f.read(8 + 4*256)
        idx_sum.update(b)

        obj_list_sum = Sha1()
        for b in chunkyreader(idx_f, 20*self.count):
            idx_sum.update(b)
            obj_list_sum.update(b)
        namebase = obj_list_sum.hexdigest()

        for b in chunkyreader(idx_f):
            idx_sum.update(b)
        idx_f.write(idx_sum.digest())
        idx_f.close()

        return namebase

def _git_date(date):
    return '%d %s' % (date, time.strftime('%z', time.localtime(date)))

def _gitenv():
    os.environ['GIT_DIR'] = os.path.abspath(repo())

def list_refs(refname = None):
    """Generate a list of tuples in the form (refname,hash).
    If a ref name is specified, list only this particular ref.
    """
    argv = ['git', 'show-ref', '--']
    if refname:
        argv += [refname]
    p = subprocess.Popen(argv, preexec_fn = _gitenv, stdout = subprocess.PIPE)
    out = p.stdout.read().strip()
    rv = p.wait()  # not fatal
    if rv:
        assert(not out)
    if out:
        for d in out.split('\n'):
            (sha, name) = d.split(' ', 1)
            yield (name, sha.decode('hex'))

def read_ref(refname):
    """Get the commit id of the most recent commit made on a given ref."""
    l = list(list_refs(refname))
    if l:
        assert(len(l) == 1)
        return l[0][1]
    else:
        return None

def rev_list(ref, count=None):
    """Generate a list of reachable commits in reverse chronological order.

    This generator walks through commits, from child to parent, that are
    reachable via the specified ref and yields a series of tuples of the form
    (date,hash).

    If count is a non-zero integer, limit the number of commits to "count"
    objects.
    """
    assert(not ref.startswith('-'))
    opts = []
    if count:
        opts += ['-n', str(atoi(count))]
    argv = ['git', 'rev-list', '--pretty=format:%ct'] + opts + [ref, '--']
    p = subprocess.Popen(argv, preexec_fn = _gitenv, stdout = subprocess.PIPE)
    commit = None
    for row in p.stdout:
        s = row.strip()
        if s.startswith('commit '):
            commit = s[7:].decode('hex')
        else:
            date = int(s)
            yield (date, commit)
    rv = p.wait()  # not fatal
    if rv:
        raise GitError, 'git rev-list returned error %d' % rv

def rev_get_date(ref):
    """Get the date of the latest commit on the specified ref."""
    for (date, commit) in rev_list(ref, count=1):
        return date
    raise GitError, 'no such commit %r' % ref

def rev_parse(committish):
    """Resolve the full hash for 'committish', if it exists.

    Should be roughly equivalent to 'git rev-parse'.

    Returns the hex value of the hash if it is found, None if 'committish' does
    not correspond to anything.
    """
    head = read_ref(committish)
    if head:
        debug2("resolved from ref: commit = %s\n" % head.encode('hex'))
        return head

    pL = PackIdxList(repo('objects/pack'))

    if len(committish) == 40:
        try:
            hash = committish.decode('hex')
        except TypeError:
            return None

        if pL.exists(hash):
            return hash

    return None

def update_ref(refname, newval, oldval):
    """Change the commit pointed to by a branch."""
    if not oldval:
        oldval = ''
    assert(refname.startswith('refs/heads/'))
    p = subprocess.Popen(['git', 'update-ref', refname,
                          newval.encode('hex'), oldval.encode('hex')],
                         preexec_fn = _gitenv)
    _git_wait('git update-ref', p)

def guess_repo(path=None):
    """Set the path value in the global variable "repodir".
    This makes bup look for an existing bup repository, but not fail if a
    repository doesn't exist. Usually, if you are interacting with a bup
    repository, you would not be calling this function but using
    check_repo_or_die().
    """
    global repodir
    if path:
        repodir = path
    if not repodir:
        repodir = os.environ.get('BUP_DIR')
        if not repodir:
            repodir = os.path.expanduser('~/.bup')

def init_repo(path=None):
    """Create the Git bare repository for bup in a given path."""
    guess_repo(path)
    d = repo()  # appends a / to the path
    parent = os.path.dirname(os.path.dirname(d))
    if parent and not os.path.exists(parent):
        raise GitError('parent directory "%s" does not exist\n' % parent)
    if os.path.exists(d) and not os.path.isdir(os.path.join(d, '.')):
        raise GitError('"%s" exists but is not a directory\n' % d)
    p = subprocess.Popen(['git', '--bare', 'init'], stdout=sys.stderr,
                         preexec_fn = _gitenv)
    _git_wait('git init', p)
    # Force the index version configuration in order to ensure bup works
    # regardless of the version of the installed Git binary.
    p = subprocess.Popen(['git', 'config', 'pack.indexVersion', '2'],
                         stdout=sys.stderr, preexec_fn = _gitenv)
    _git_wait('git config', p)

def check_repo_or_die(path=None):
    """Make sure a bup repository exists, and abort if not.
    If the path to a particular repository was not specified, this function
    initializes the default repository automatically.
    """
    guess_repo(path)
    try:
        os.stat(repo('objects/pack/.'))
    except OSError, e:
        if e.errno == errno.ENOENT:
            if repodir != home_repodir:
                log('error: %r is not a bup repository; run "bup init"\n'
                    % repo())
                sys.exit(15)
            else:
                init_repo()
        else:
            log('error: %s\n' % e)
            sys.exit(14)

_ver = None
def ver():
    """Get Git's version and ensure a usable version is installed.

    The returned version is formatted as an ordered tuple with each position
    representing a digit in the version tag. For example, the following tuple
    would represent version 1.6.6.9:

        ('1', '6', '6', '9')
    """
    global _ver
    if not _ver:
        p = subprocess.Popen(['git', '--version'],
                             stdout=subprocess.PIPE)
        gvs = p.stdout.read()
        _git_wait('git --version', p)
        m = re.match(r'git version (\S+.\S+)', gvs)
        if not m:
            raise GitError('git --version weird output: %r' % gvs)
        _ver = tuple(m.group(1).split('.'))
    needed = ('1','5', '3', '1')
    if _ver < needed:
        raise GitError('git version %s or higher is required; you have %s'
                       % ('.'.join(needed), '.'.join(_ver)))
    return _ver

def _git_wait(cmd, p):
    rv = p.wait()
    if rv != 0:
        raise GitError('%s returned %d' % (cmd, rv))

def _git_capture(argv):
    p = subprocess.Popen(argv, stdout=subprocess.PIPE, preexec_fn = _gitenv)
    r = p.stdout.read()
    _git_wait(repr(argv), p)
    return r

class _AbortableIter:
    def __init__(self, it, onabort = None):
        self.it = it
        self.onabort = onabort
        self.done = None

    def __iter__(self):
        return self

    def next(self):
        try:
            return self.it.next()
        except StopIteration, e:
            self.done = True
            raise
        except:
            self.abort()
            raise

    def abort(self):
        """Abort iteration and call the abortion callback, if needed."""
        if not self.done:
            self.done = True
            if self.onabort:
                self.onabort()

    def __del__(self):
        self.abort()

_ver_warned = 0
class CatPipe:
    """Link to 'git cat-file' that is used to retrieve blob data."""
    def __init__(self):
        global _ver_warned
        wanted = ('1','5','6')
        if ver() < wanted:
            if not _ver_warned:
                log('warning: git version < %s; bup will be slow.\n'
                    % '.'.join(wanted))
                _ver_warned = 1
            self.get = self._slow_get
        else:
            self.p = self.inprogress = None
            self.get = self._fast_get

    def _abort(self):
        if self.p:
            self.p.stdout.close()
            self.p.stdin.close()
        self.p = None
        self.inprogress = None

    def _restart(self):
        self._abort()
        self.p = subprocess.Popen(['git', 'cat-file', '--batch'],
                                  stdin=subprocess.PIPE,
                                  stdout=subprocess.PIPE,
                                  close_fds = True,
                                  bufsize = 4096,
                                  preexec_fn = _gitenv)

    def _fast_get(self, id):
        if not self.p or self.p.poll() != None:
            self._restart()
        assert(self.p)
        assert(self.p.poll() == None)
        if self.inprogress:
            log('_fast_get: opening %r while %r is open\n'
                % (id, self.inprogress))
        assert(not self.inprogress)
        assert(id.find('\n') < 0)
        assert(id.find('\r') < 0)
        assert(not id.startswith('-'))
        self.inprogress = id
        self.p.stdin.write('%s\n' % id)
        self.p.stdin.flush()
        hdr = self.p.stdout.readline()
        if hdr.endswith(' missing\n'):
            self.inprogress = None
            raise KeyError('blob %r is missing' % id)
        spl = hdr.split(' ')
        if len(spl) != 3 or len(spl[0]) != 40:
            raise GitError('expected blob, got %r' % spl)
        (hex, type, size) = spl

        it = _AbortableIter(chunkyreader(self.p.stdout, int(spl[2])),
                           onabort = self._abort)
        try:
            yield type
            for blob in it:
                yield blob
            assert(self.p.stdout.readline() == '\n')
            self.inprogress = None
        except Exception, e:
            it.abort()
            raise

    def _slow_get(self, id):
        assert(id.find('\n') < 0)
        assert(id.find('\r') < 0)
        assert(id[0] != '-')
        type = _git_capture(['git', 'cat-file', '-t', id]).strip()
        yield type

        p = subprocess.Popen(['git', 'cat-file', type, id],
                             stdout=subprocess.PIPE,
                             preexec_fn = _gitenv)
        for blob in chunkyreader(p.stdout):
            yield blob
        _git_wait('git cat-file', p)

    def _join(self, it):
        type = it.next()
        if type == 'blob':
            for blob in it:
                yield blob
        elif type == 'tree':
            treefile = ''.join(it)
            for (mode, name, sha) in tree_decode(treefile):
                for blob in self.join(sha.encode('hex')):
                    yield blob
        elif type == 'commit':
            treeline = ''.join(it).split('\n')[0]
            assert(treeline.startswith('tree '))
            for blob in self.join(treeline[5:]):
                yield blob
        else:
            raise GitError('invalid object type %r: expected blob/tree/commit'
                           % type)

    def join(self, id):
        """Generate a list of the content of all blobs that can be reached
        from an object.  The hash given in 'id' must point to a blob, a tree
        or a commit. The content of all blobs that can be seen from trees or
        commits will be added to the list.
        """
        try:
            for d in self._join(self.get(id)):
                yield d
        except StopIteration:
            log('booger!\n')

def tags():
    """Return a dictionary of all tags in the form {hash: [tag_names, ...]}."""
    tags = {}
    for (n,c) in list_refs():
        if n.startswith('refs/tags/'):
            name = n[10:]
            if not c in tags:
                tags[c] = []

            tags[c].append(name)  # more than one tag can point at 'c'

    return tags


text:
from django.conf.urls import url
from django.views.generic import RedirectView

import views

urlpatterns = [
    # Legacy: Redirect to /contributors/email
    url(r'^contributor/(?P<email>[\w.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4})/$',
        RedirectView.as_view(url="/contributors/%(email)s/", permanent=True)),

    # List contributors
    url(r'^contributors/$',
        views.ContributorsView.as_view(),
        name='pontoon.contributors'),

    # Contributor profile by email
    url(r'^contributors/(?P<email>[\w.%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4})/$',
        views.contributor_email,
        name='pontoon.contributors.contributor.email'),

    # Contributor timeline
    url(r'^contributors/(?P<username>[\w-]+)/timeline/$',
        views.contributor_timeline,
        name='pontoon.contributors.contributor.timeline'),

    # Contributor profile by username
    url(r'^contributors/(?P<username>[\w-]+)/$',
        views.contributor_username,
        name='pontoon.contributors.contributor.username'),

    # Current user's profile
    url(r'^profile/$',
        views.profile,
        name='pontoon.contributors.profile'),

    # Current user's settings
    url(r'^settings/', views.settings,
        name='pontoon.contributors.settings'),

    # API: Toogle user profile attribute
    url(r'^api/v1/user/(?P<username>[\w-]+)/$',
        views.toggle_user_profile_attribute,
        name='pontoon.contributors.toggle_user_profile_attribute'),

    # AJAX
    url(r'^save-user-name/', views.save_user_name,
        name='pontoon.contributors.save_user_name'),
]


text:
package hardware::sensors::hwgste::snmp::mode::sensors;

use base qw(centreon::plugins::templates::hardware);

use strict;
use warnings;

sub set_system {
    my ($self, %options) = @_;

    $self->{regexp_threshold_overload_check_section_option} = '^(temperature|humidity)$';
    $self->{regexp_threshold_numeric_check_section_option} = '^(temperature|humidity)$';

    $self->{cb_hook2} = 'snmp_execute';

    $self->{thresholds} = {
        default => [
            ['invalid', 'UNKNOWN'],
            ['normal', 'OK'],
            ['outOfRangeLo', 'WARNING'],
            ['outOfRangeHi', 'WARNING'],
            ['alarmLo', 'CRITICAL'],
            ['alarmHi', 'CRITICAL'],
        ],
    };

    $self->{components_path} = 'hardware::sensors::hwgste::snmp::mode::components';
    $self->{components_module} = ['temperature', 'humidity'];
}

sub snmp_execute {
    my ($self, %options) = @_;

    $self->{snmp} = $options{snmp};
    my $oid_sensEntry = '.1.3.6.1.4.1.21796.4.1.3.1';
    push @{$self->{request}}, { oid => $oid_sensEntry };
    $self->{results} = $self->{snmp}->get_multiple_table(oids => $self->{request});
}

sub new {
    my ($class, %options) = @_;
    my $self = $class->SUPER::new(package => __PACKAGE__, %options, no_absent => 1);
    bless $self, $class;

    $self->{version} = '1.0';
    $options{options}->add_options(arguments =>
                                {
                                });

    return $self;
}

1;

__END__

=head1 MODE

Check HWg-STE sensors.

=over 8

=item B<--component>

Which component to check (Default: '.*').
Can be: 'temperature', 'humidity'.

=item B<--filter>

Exclude some parts.
Can also exclude specific instance: --filter=sensor,10

=item B<--threshold-overload>

Set to overload default threshold values (syntax: section,[instance,]status,regexp)
It used before default thresholds (order stays).
Example: --threshold-overload='sensor,CRITICAL,^(?!(normal)$)'

=item B<--warning>

Set warning threshold for temperature, humidity (syntax: type,instance,threshold)
Example: --warning='temperature,.*,30'

=item B<--critical>

Set critical threshold for temperature, humidity (syntax: type,instance,threshold)
Example: --critical='humidty,.*,40'

=back

=cut


text:
Oops

Something went wrong on our end.
Please try again or come back in a little while if the problem persists.

That is taking longer than expected.
Please double check your internet connection or try again later.

There seem to be some network issues.
Please double check your internet connection and try again.

We could not find the page you are looking for.
You may have mistyped the address.

Something went wrong.
Please try again or come back in a little while if the problem persists.

    Back to the previous page
    Back to the home page


text:
package io.datarouter.nodewatch.storage.alertthreshold;

import java.util.List;

import io.datarouter.model.field.Field;
import io.datarouter.model.field.imp.StringField;
import io.datarouter.model.field.imp.StringFieldKey;
import io.datarouter.model.key.primary.base.BaseRegularPrimaryKey;

public class TableSizeAlertThresholdKey extends BaseRegularPrimaryKey<TableSizeAlertThresholdKey>{

	private String clientName;
	private String tableName;

	public static class FieldKeys{
		public static final StringFieldKey clientName = new StringFieldKey("clientName");
		public static final StringFieldKey tableName = new StringFieldKey("tableName");
	}

	@Override
	public List<Field<?>> getFields(){
		return List.of(
				new StringField(FieldKeys.clientName, clientName),
				new StringField(FieldKeys.tableName, tableName));
	}

	public TableSizeAlertThresholdKey(){
	}

	public TableSizeAlertThresholdKey(String clientName, String tableName){
		this.clientName = clientName;
		this.tableName = tableName;
	}

	public String getClientName(){
		return clientName;
	}

	public String getTableName(){
		return tableName;
	}

}


text:
package ru.job4j.srp;

import java.util.ArrayList;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Collectors;
/**
 * Реализация интерфейса Store.
 */
public class MemStore implements Store {

    private final List<Employee> employers = new ArrayList<>();

    public void add(Employee em) {
        employers.add(em);
    }

    @Override
    public List<Employee> findBy(Predicate<Employee> filter) {
        return employers.stream().filter(filter).collect(Collectors.toList());
    }
}


text:
<?php echo _e( 'Tweet Links' ) ?>

		Use Tweet Links to generate shortcodes for tweet, retweet, and reply. These can be used anywhere within a post or page. You can also enable a custom tweet links message beneath each post or page.

	<form class="form-table" name="tweet_links_form" method="POST" action="<?php echo $_SERVER['REQUEST_URI']; ?>">

Settings

									Twitter Handle

									@<input name="tweet_links_handle" type="text" id="tweet_links_handle" value="<?php echo ( ! empty( $data['handle'] ) ? esc_html( $data['handle'] ) : '' ) ?>" class="regular-text" />

									Shorten URL

									<input name="tweet_links_shortener_on" type="checkbox" id="tweet_links_shortener_on" value="1" <?php echo ( ! empty( $data['shortener_on'] ) ? 'checked' : '' ) ?>/>
										( http://example.com/?p=1234 )

									Open In Seperate Tab

									<input name="tweet_links_blank_on" type="checkbox" id="tweet_links_blank_on" value="1" <?php echo ( ! empty( $data['blank_on'] ) ? 'checked' : '' ) ?>/>
										Links will open in new tab

									Include Tags In Tweet

									<input name="tweet_links_tags_on" type="checkbox" id="tweet_links_tags_on" value="1" <?php echo ( ! empty( $data['tags_on'] ) ? 'checked' : '' ) ?>/>
										#example_tag

Use the following shortcodes anywhere in a post or page:

[tweetlinks type="tweet" text="Tweet this post"]

[tweetlinks type="retweet" text="Retweet this post"]

[tweetlinks type="reply" text="Reply to this post on Twitter"]

Post/Page Options

									Show Tweet Message

									<input name="tweet_links_message_on" type="checkbox" id="tweet_links_message_on" value="1" <?php echo ( ! empty( $data['message_on'] ) ? 'checked' : '' ) ?>/>
										Show custom message

									Show For Posts

									<input name="tweet_links_message_post_on" type="checkbox" id="tweet_links_message_post_on" value="1" <?php echo ( ! empty( $data['message_post_on'] ) ? 'checked' : '' ) ?>/>
									Recommended

									Show For Pages

									<input name="tweet_links_message_page_on" type="checkbox" id="tweet_links_message_page_on" value="1" <?php echo ( ! empty( $data['message_page_on'] ) ? 'checked' : '' ) ?>/>

										Example: Share this on Twitter: {TWEET}, {RETWEET}, or {REPLY} with a comment.

									<textarea name="tweet_links_custom_message" id="tweet_links_custom_message" class="large-text" rows="3"><?php echo ( ! empty( $data['custom_message'] ) ? esc_html( $data['custom_message'] ) : '' ) ?></textarea>

			NOTE: You will need to add a tweet id to your post/page for retweet or reply to work correctly. You can grab a tweet id from the twitter url: https://twitter.com/username/status/0123456789012345678

			<input type="submit" name="submit" id="submit" class="button button-primary" value="Save Changes" />

	</form>


text:
from .engine import Box2DEngine, Vec2
from .engine.body_def import BodyDef
from .transform import BodyTransform

from nytram.engine import EngineAttr

from ctypes import byref

class Body:
    """ Represents a Box2D Body """
    entity = EngineAttr("applyTransform")

    def __init__(self, fixtures, wrapTransform=True, **kwargs):
        """ Initialize the Body """
        self.id = None
        self.fixtures = fixtures
        self.bodyDef = BodyDef(**kwargs)
        self.wrapTransform = wrapTransform

    def applyTransform(self):
        """ Apply the Body Transform """
        if self.wrapTransform:
            bodyTransform = BodyTransform(self.entity.transform)
            self.entity.transform = bodyTransform

    def start(self):
        """ Start the body in the Physics Engine """
        self.bodyDef.position = Vec2(self.position.x, self.position.y)
        self.id = Box2DEngine.World_AddBody(self.world.id, self.bodyDef)

        for fixture in self.fixtures:
            fixture.addToBody(self)

    def applyImpulse(self, impulse):
        """ Apply the impulse """
        Box2DEngine.Body_ApplyImpulse(self.id, byref(impulse))

    @property
    def world(self):
        """ Return the world this body is associated with """
        return self.entity.scene.world

    @property
    def mass(self):
        """ Return the body's current mass """
        return Box2DEngine.Body_GetMass(self.id)

    @property
    def position(self):
        """ Return the body's matching transform position """
        return self.entity.transform.position

    @property
    def velocity(self):
        """ Return the body's current velocity """
        return Box2DEngine.Body_GetVelocity(self.id).contents

    def getPositionInPhysicsEngine(self):
        """ Get the position in the physics engine """
        return Box2DEngine.Body_GetPosition(self.id).contents

    def setPositionInPhysicsEngine(self, position):
        """ Set the position in the physics engine """
        Box2DEngine.Body_SetPosition(self.id, byref(position))


text:
package org.openstack.api.restful.ceilometer.v2.elements

/**
 * ceilometer AlarmChange representation
 * @author Antonio Murgia
 * @version 22/10/14
 */
import java.util.Date

case class AlarmChange(alarm_id : String,
                       detail : String,
                       event_id : Option[String],
                       on_behalf_of : String,
                       project_id : String,
                       timestamp : java.sql.Timestamp,
                       `type`: AlarmChangeType,
                       user_id : String) {

}
/*
alarm_id
Type:	unicode
The UUID of the alarm

detail
Type:	unicode
JSON fragment describing change

event_id
Type:	unicode
The UUID of the change event

on_behalf_of
Type:	unicode
The tenant on behalf of which the change is being made

project_id
Type:	unicode
The project ID of the initiating identity

timestamp
Type:	datetime
The time/date of the alarm change

type
Type:	Enum(creation, rule change, state transition, deletion)
The type of change

user_id
Type:	unicode
The user ID of the initiating identity
 */


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
Ext.define('sisprod.view.TestProgram.BatteryContextMenu', {
   extend: 'Ext.menu.Menu',
   alias: 'widget.batteryContextMenu',
   messages: {
       msgBattery: 'Battery',
       msgBatteryCode: 'Code',
       msgTitleList: 'No Program Battery',
       msgTipProgram: 'Program Battery'
   },
   width: 300,
   maxHeight:200,
   gridStore: null,
   initComponent: function(){
       var me = this;
       Ext.apply(this, {
           items: [
                {
                    title: me.messages.msgTitleList,
                    xtype: 'panel',
                    dockedItems: [{
                        dock: 'right',
                        xtype: 'toolbar',
                        items: [
                            {
                                iconCls: 'calendar',
                                xtype: 'button',
                                tooltip: me.messages.msgTipProgram,
                                action: 'programBattery'
                            }
                        ]
                    }],
                    items: [
                        {
                            margins: '5 0 0 0',
                            xtype: 'gridpanel',
                            id: 'gridTestProgramContext',
                            store: me.gridStore,
                            sortableColumns: false,
                            enableColumnHide: false,
                            columns: [
                                {
                                    text: me.messages.msgBattery,
                                    dataIndex: 'batteryName',
                                    flex: 10
                                },
                                {
                                    text: me.messages.msgBatteryCode,
                                    dataIndex: 'batteryCode',
                                    flex: 5
                                }
                            ]
                        }
                    ]
                }
           ]
       });
       me.callParent(arguments);
   }
});


text:
<?php

namespace HCLabs\Bills\Tests\Value;

use HCLabs\Bills\Value as DTO;

class UUIDTest extends \PHPUnit_Framework_TestCase
{
    /**
     * @test
     */
    public function it_should_accept_strings()
    {
        new DTO\UUID('abc123');
    }

    /**
     * @test
     */
    public function it_should_provide_a_string_representation()
    {
        $accountId = new DTO\UUID('abc123');

        $this->assertSame('abc123', (string) $accountId);
    }
}


text:
package net.safedata.springboot.training.d04.s01.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.concurrent.ListenableFuture;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;

@Service
@SuppressWarnings("unused")
public class ProductService {

    private static final Logger LOGGER = LoggerFactory.getLogger(ProductService.class);

    private final AsyncComponent asyncComponent;

    @Autowired
    public ProductService(final AsyncComponent asyncComponent) {
        this.asyncComponent = asyncComponent;
    }

    public void callAllAsyncMethods() {
        // 1st stage - invoking the async methods
        LOGGER.info("Invoking an async method which doesn't have a return object...");
        asyncComponent.voidReturningAsyncCall();

        LOGGER.info("Invoking an async method which returns a Future object...");
        final Future<String> future = asyncComponent.asyncMethodReturningAFuture();

        LOGGER.info("Invoking an async method which returns a ListenableFuture object...");
        final ListenableFuture<String> listenableFuture = asyncComponent.asyncMethodReturningAListenableFuture();

        LOGGER.info("Invoking an async method which returns a CompletableFuture object...");
        final CompletableFuture<String> completableFuture = asyncComponent.asyncMethodReturningACompletableFuture();

        // 2nd stage - getting the returned values
        try {
            final String value = future.get(4000, TimeUnit.MILLISECONDS);
            LOGGER.info("The returned future value is '{}'", value);
        } catch (final Exception e) {
            handleException(e);
        }

        completableFuture.whenCompleteAsync((value, error) -> LOGGER.debug("{}", value));
        final String result = completableFuture.join();
    }

    public void asyncMethodReturningAFuture() {
        final Future<String> future = asyncComponent.asyncMethodReturningAFuture();

        try {
            getAndDisplayValue(future);
        } catch (final ExecutionException | InterruptedException e) {
            handleException(e);
        }
    }

    public void asyncMethodReturningAListenableFuture() {
        final ListenableFuture<String> listenableFuture = asyncComponent.asyncMethodReturningAListenableFuture();

        try {
            getAndDisplayValue(listenableFuture);
        } catch (final ExecutionException | InterruptedException e) {
            handleException(e);
        }
    }

    public void asyncMethodReturningACompletableFuture() {
        final CompletableFuture<String> completableFuture = asyncComponent.asyncMethodReturningACompletableFuture();

        try {
            getAndDisplayValue(completableFuture);
        } catch (final ExecutionException | InterruptedException e) {
            handleException(e);
        }
    }

    private void getAndDisplayValue(final Future<String> futureValue)
            throws ExecutionException, InterruptedException {

        if (futureValue.isDone()) {
            final String theValue = futureValue.get();
            System.out.println("The " + futureValue.getClass().getSimpleName() + " value is '" + theValue + "'");
        }
    }

    private void handleException(final Exception ex) {
        LOGGER.error(ex.getMessage(), ex);
    }
}


text:
import json
import math
from handlers.Home_Core import Home_Core

class TermTopicMatrix3(Home_Core):
	def __init__(self, request, response, bow_db, lda_db):
		super(TermTopicMatrix3, self).__init__(request, response)
		self.bowDB = bow_db
		self.ldaDB = lda_db
		self.bow = bow_db.db
		self.lda = lda_db.db

	def GetTopics(self):
		table = self.lda.topics
		rows = self.lda().select( table.topic_index, orderby = table.topic_index, limitby = (0, 2000) )
		return [ 'Topic {}'.format(d.topic_index+1) for d in rows ]

	def GetTerms(self):
		table = self.lda.terms
		rows = self.lda().select( table.term_text, orderby = table.term_index, limitby = (0, 1000) )
		return [ d.term_text for d in rows ]

	def GetTermTopicMatrix(self):
		table = self.lda.term_topic_matrix
		rows = self.lda().select( table.term_index, table.topic_index, table.value, orderby = table.rank, limitby = (0, 250000) )
		return [{
			'rowIndex' : d['term_index'],
			'columnIndex' : d['topic_index'],
			'value' : d['value']
		} for d in rows]


text:
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>com.google.cloud.dataflow</groupId>
  <artifactId>google-cloud-dataflow-starter</artifactId>
  <version>0.0.1-SNAPSHOT</version>

  <build>
   <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.3</version>
        <configuration>
          <source>7</source>
          <target>7</target>
        </configuration>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
      <groupId>com.google.cloud.dataflow</groupId>
      <artifactId>google-cloud-dataflow-java-sdk-all</artifactId>
      <version>LATEST</version>
    </dependency>

    <!-- slf4j API frontend binding with JUL backend -->
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.7</version>
    </dependency>
    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-jdk14</artifactId>
      <version>1.7.7</version>
    </dependency>
  </dependencies>
</project>


text:
import { listen } from '../util/ipc';
import { Firewall } from './Firewall';
import { img_rules } from './rules/img';
import { img_allow_rules } from './rules/img_allow';
import { script_rules } from './rules/script';
import { Counters } from './Counter';

const counter = new Counters<string>();

new Firewall({img: img_rules, script: script_rules, imgAllow: img_allow_rules}, counter);

listen('stat', () => ({total: counter.total}));


text:
@class NSIndexPath, NSString, UICollectionReusableView, UICollectionView, UICollectionViewCell;

@protocol UICollectionViewDataSource <NSObject>
- (UICollectionViewCell *)collectionView:(UICollectionView *)arg1 cellForItemAtIndexPath:(NSIndexPath *)arg2;
- (int)collectionView:(UICollectionView *)arg1 numberOfItemsInSection:(int)arg2;

@optional
- (UICollectionReusableView *)collectionView:(UICollectionView *)arg1 viewForSupplementaryElementOfKind:(NSString *)arg2 atIndexPath:(NSIndexPath *)arg3;
- (int)numberOfSectionsInCollectionView:(UICollectionView *)arg1;
@end


text:
@class TKDCubalogApp;

@interface TKDTokaidoSplashController : NSWindowController <TKDActivationProgress, TKDAppSupportEnsure, NSWindowDelegate>

@property (nonatomic, strong) IBOutlet NSTextField *status;
@property (nonatomic, strong) IBOutlet NSProgressIndicator *progress;

@property (nonatomic, strong) TKDCubalogApp *logger;

-(void) start;

@end


text:
function __sdkman_post_installation_hook {
    mv "$binary_input" "$zip_output"
}


text:
<?php

$datos = $datosPrincipales->row_array();
$datosPredDia = $ultimaPredDiaria->row_array();
$datosPredSem = $ultimaPredSem->row_array();

$viento = $datos['viento'];
$temp = $datos['temp'];
$dirViento = $datos['dirViento'];
$presion = $datos['presion'];
$probLluvia = $datos['probLluvia'];
$lluvia = $datos['lluvia'] / 0.0394;
$humedad = $datos['humedad'];
$icono = $datos['icono'];

?>

<img src="<?= base_url() ?>assets/images/iconosTiempo/<?= $icono ?>.png"/ alt="icono" class="responsive-img" width="40%">

<?= $temp ?>ºC

<img src="<?= base_url() ?>assets/images/arrow.png" alt="icono" class="responsive-img" width="100%" style="max-width:50px;max-height:50px;" id="arrowViento"/>
<?= $dirViento ?>

<?= $viento ?>km/h

<?= $humedad ?>%

<?= round($presion) ?>hPa

<?= round($lluvia,3, PHP_ROUND_HALF_UP) ?>mm

PREDICCIÓN

<?= date('H:i',$datosPredDia['time03']) ?>

      <img src="<?= base_url() ?>assets/images/iconosTiempo/<?= $datosPredDia['icono03'] ?>.png"/ alt="icono" class="responsive-img" width="80%">

<?=round($datosPredDia['temp03'],1,PHP_ROUND_HALF_UP)?>oC

<?= $datosPredDia['intPrec03'] ?>mm

<?= date('H:i',$datosPredDia['time06']) ?>

      <img src="<?= base_url() ?>assets/images/iconosTiempo/<?= $datosPredDia['icono06'] ?>.png"/ alt="icono" class="responsive-img" width="80%">

<?=round($datosPredDia['temp06'],1,PHP_ROUND_HALF_UP)?>oC

<?= $datosPredDia['intPrec06'] ?>mm

<?= date('H:i',$datosPredDia['time09']) ?>

      <img src="<?= base_url() ?>assets/images/iconosTiempo/<?= $datosPredDia['icono09'] ?>.png"/ alt="icono" class="responsive-img" width="80%">

<?=round($datosPredDia['temp09'],1,PHP_ROUND_HALF_UP)?>oC

<?= $datosPredDia['intPrec09'] ?>mm

<?= date('H:i',$datosPredDia['time12']) ?>

      <img src="<?= base_url() ?>assets/images/iconosTiempo/<?= $datosPredDia['icono12'] ?>.png"/ alt="icono" class="responsive-img" width="80%">

<?=round($datosPredDia['temp12'],1,PHP_ROUND_HALF_UP)?>oC

<?= $datosPredDia['intPrec12'] ?>mm

<?= date('d/m',$datosPredSem['time01']) ?>

      <img src="<?= base_url() ?>assets/images/iconosTiempo/<?= $datosPredSem['icono01'] ?>.png"/ alt="icono" width="50px" class="">

<?= round($datosPredSem['minTemp01']) ?>ºC/<?= round($datosPredSem['maxTemp01']) ?>ºC

<?= $datosPredSem['probPrec01'] ?>%

<?= $datosPredSem['intPrec01'] ?>mm

      <img src="<?= base_url() ?>assets/images/arrow.png" alt="icono" class="responsive-img" width="90%" style="max-width:50px;max-height:50px;" id="arrowViento01"/>
<?= $datosPredSem['dirViento01'] ?>

<?= $datosPredSem['velViento01'] ?>

km/h

<?= date('d/m',$datosPredSem['time02']) ?>

      <img src="<?= base_url() ?>assets/images/iconosTiempo/<?= $datosPredSem['icono02'] ?>.png"/ alt="icono" width="50px" class="">

<?= round($datosPredSem['minTemp02']) ?>ºC/<?= round($datosPredSem['maxTemp02']) ?>ºC

<?= $datosPredSem['probPrec02'] ?>%

<?= $datosPredSem['intPrec02'] ?>mm

        <img src="<?= base_url() ?>assets/images/arrow.png" alt="icono" class="responsive-img" width="90%" style="max-width:50px;max-height:50px;" id="arrowViento02"/>
<?= $datosPredSem['dirViento02'] ?>

<?= $datosPredSem['velViento02'] ?>

km/h

<?= date('d/m',$datosPredSem['time03']) ?>

      <img src="<?= base_url() ?>assets/images/iconosTiempo/<?= $datosPredSem['icono03'] ?>.png"/ alt="icono" width="50px" class="">

<?= round($datosPredSem['minTemp03']) ?>ºC/<?= round($datosPredSem['maxTemp03']) ?>ºC

<?= $datosPredSem['probPrec03'] ?>%

<?= $datosPredSem['intPrec03'] ?>mm

        <img src="<?= base_url() ?>assets/images/arrow.png" alt="icono" class="responsive-img" width="90%" style="max-width:50px;max-height:50px;" id="arrowViento03"/>
<?= $datosPredSem['dirViento03'] ?>

<?= $datosPredSem['velViento03'] ?>

km/h

<?= date('d/m',$datosPredSem['time04']) ?>

      <img src="<?= base_url() ?>assets/images/iconosTiempo/<?= $datosPredSem['icono04'] ?>.png"/ alt="icono" width="50px" class="">

<?= round($datosPredSem['minTemp04']) ?>ºC/<?= round($datosPredSem['maxTemp04']) ?>ºC

<?= $datosPredSem['probPrec04'] ?>%

<?= $datosPredSem['intPrec04'] ?>mm

        <img src="<?= base_url() ?>assets/images/arrow.png" alt="icono" class="responsive-img" width="90%" style="max-width:50px;max-height:50px;" id="arrowViento04"/>
<?= $datosPredSem['dirViento04'] ?>

<?= $datosPredSem['velViento04'] ?>

km/h

<?= date('d/m',$datosPredSem['time05']) ?>

      <img src="<?= base_url() ?>assets/images/iconosTiempo/<?= $datosPredSem['icono05'] ?>.png"/ alt="icono" width="50px" class="">

<?= round($datosPredSem['minTemp05']) ?>ºC/<?= round($datosPredSem['maxTemp05']) ?>ºC

<?= $datosPredSem['probPrec05'] ?>%

<?= $datosPredSem['intPrec05'] ?>mm

        <img src="<?= base_url() ?>assets/images/arrow.png" alt="icono" class="responsive-img" width="90%" style="max-width:50px;max-height:50px;" id="arrowViento05"/>
<?= $datosPredSem['dirViento05'] ?>

<?= $datosPredSem['velViento05'] ?>

km/h

<?= date('d/m',$datosPredSem['time06']) ?>

      <img src="<?= base_url() ?>assets/images/iconosTiempo/<?= $datosPredSem['icono06'] ?>.png"/ alt="icono" width="50px" class="">

<?= round($datosPredSem['minTemp06']) ?>ºC/<?= round($datosPredSem['maxTemp06']) ?>ºC

<?= $datosPredSem['probPrec06'] ?>%

<?= $datosPredSem['intPrec06'] ?>mm

        <img src="<?= base_url() ?>assets/images/arrow.png" alt="icono" class="responsive-img" width="90%" style="max-width:50px;max-height:50px;" id="arrowViento06"/>
<?= $datosPredSem['dirViento06'] ?>

<?= $datosPredSem['velViento06'] ?>

km/h

<?= date('d/m',$datosPredSem['time07']) ?>

      <img src="<?= base_url() ?>assets/images/iconosTiempo/<?= $datosPredSem['icono07'] ?>.png"/ alt="icono" width="50px" class="vertical-align">

<?= round($datosPredSem['minTemp07']) ?>ºC/<?= round($datosPredSem['maxTemp07']) ?>ºC

<?= $datosPredSem['probPrec07'] ?>%

<?= $datosPredSem['intPrec07'] ?>mm

        <img src="<?= base_url() ?>assets/images/arrow.png" alt="icono" class="responsive-img" width="90%" style="max-width:50px;max-height:50px;" id="arrowViento07"/>
<?= $datosPredSem['dirViento07'] ?>

<?= $datosPredSem['velViento07'] ?>

km/h


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _cookieParser = require('cookie-parser');

var _cookieParser2 = _interopRequireDefault(_cookieParser);

var _dddos = require('dddos');

var _dddos2 = _interopRequireDefault(_dddos);

var _express = require('express');

var _express2 = _interopRequireDefault(_express);

var _hashpass = require('./hashpass');

var _hashpass2 = _interopRequireDefault(_hashpass);

var _ipFix = require('./ip-fix');

var _ipFix2 = _interopRequireDefault(_ipFix);

var _log = require('./log');

var _log2 = _interopRequireDefault(_log);

var _onlineCounter = require('./online-counter');

var _onlineCounter2 = _interopRequireDefault(_onlineCounter);

var _registeredUser = require('./registered-user');

var _registeredUser2 = _interopRequireDefault(_registeredUser);

var _config = require('../helpers/config');

var _config2 = _interopRequireDefault(_config);

var _logger = require('../helpers/logger');

var _logger2 = _interopRequireDefault(_logger);

var _tools = require('../helpers/tools');

var Tools = _interopRequireWildcard(_tools);

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var BEFORE = (0, _config2.default)('system.log.middleware.before');
var middlewares = [];

function setupDdos() {
  if ('ddos' === BEFORE) {
    middlewares.push(_log2.default);
  }
  if (!(0, _config2.default)('server.ddosProtection.enabled')) {
    return;
  }
  middlewares.push(new _dddos2.default({
    errorData: (0, _config2.default)('server.ddosProtection.errorData'),
    errorCode: (0, _config2.default)('server.ddosProtection.errorCode'),
    weight: (0, _config2.default)('server.ddosProtection.weight'),
    maxWeight: (0, _config2.default)('server.ddosProtection.maxWeight'),
    checkInterval: (0, _config2.default)('server.ddosProtection.checkInterval'),
    rules: (0, _config2.default)('server.ddosProtection.rules'),
    logFunction: function logFunction() {
      for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
        args[_key] = arguments[_key];
      }

      _logger2.default.error.apply(_logger2.default, [_logger2.default, Tools.translate('DDoS detected:')].concat(args));
    }
  }).express());
}

function setupStatic() {
  if ('static' === BEFORE) {
    middlewares.push(_log2.default);
  }
  middlewares.push(_express2.default.static(__dirname + '/../../public'));
}

if ('all' === BEFORE) {
  middlewares.push(_log2.default);
}

middlewares.push(_ipFix2.default);

middlewares.push(_onlineCounter2.default);

if ((0, _config2.default)('server.ddosProtection.static')) {
  setupDdos();
  setupStatic();
} else {
  setupStatic();
  setupDdos();
}

if ('middleware' === BEFORE) {
  middlewares.push(_log2.default);
}

middlewares.push((0, _cookieParser2.default)());

middlewares.push(_hashpass2.default);

middlewares.push(_registeredUser2.default);

if ('request' === BEFORE) {
  middlewares.push(_log2.default);
}

exports.default = middlewares;
//# sourceMappingURL=index.js.map


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Fl. sicul. syn. 1:148. 1843

#### Original name
null

### Remarks
null


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel='shortcut icon' href='img/favicon.ico' type='image/x-icon'/ >
    <title>Joshua Weigand</title>

    <link href="css/bootstrap.min.css" rel="stylesheet">

    <link href="css/landing-page.css" rel="stylesheet">

    <link href="font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="http://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">

                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    Toggle navigation

                </button>
                Joshua Weigand

                        About

                        Resume

                        Portfolio

                        Contact

        <video preload = "true" autoplay= "autoplay" loop="loop" volume=0 poster="img/header.jpg">
          <source src = "video/Particle.mp4" type = "video/mp4">
              <source src = "video/Particle.webm" type = "video/webm">
        </video>

404. That's An Error.


text:
TasksModel = function TasksModel() {
    // an array for the tasks loaded from the server
    // starts out empty
    this.tasks = [];

   // this is the default task filter object
   // Values copied from the Flex app
    this.taskFilter = {
        completed : 0,
        startDate : "3/1/2013",
		// not in book but this will force the category drop down to select something by default
        taskCategoryID : 0
    }

    this.taskCompletedOptions = [
        {"id":-1,"label":"All"},
        {"id":0,"label":"Open Tasks"},
        {"id":1,"label":"Completed Tasks"}
    ];

    this.taskCategories = [];

    this.scheduledTasks = [];
    // used to keep track of tasks manually added
    // changing the date will reload data from the database and wipe out all tasks displayed
    // keeping track of the manual tasks we can re-add them to the data that comes back from the dB
    this.addedTasks = [];

}


text:
<?php
include("_lists_core.php");

// function paginate($total, $curr_page) {
// 	print '
';
// 	print " Page {$curr_page} of {$total} total results ";
// 	if($curr_page > 1) {
// 		print " prev";
// 	}
// 	print " next";
// 	print '
';
// }

if(isset($_REQUEST['list'])) {
	$list = array_pop(explode('-',$_REQUEST['list']));
	print "
{$list}
";
//	include ('../_share_url.php');
	$share_data = array('url'=>"{$CFG_site_url}widgets/lists/shared_list.php?list={$_REQUEST['list']}", 'title'=>$list, 'description'=>$share_description);
	?>

		<a class="addthis_button" id="toolbar_<?=$event->hash_id?>" href="">

	<?php
	include('_tag_editor.php');

	foreach($userInfo['user_items'] as $user_item) {
		$tags = explode(';', str_replace('; ', ';',$user_item->tags));

		if(in_array($list, $tags)) {
			$item = unserialize(stripcslashes($user_item->serialized_item_data));
			include('_wc_item.tpl');
		}
	}

} elseif (isset($_REQUEST['wc_str'])) {
	$page = isset($_REQUEST['page'])?$_REQUEST['page']:1;
	$items_per_page = 20;
	// WORLDCAT API key
	$wskey = 'VPnMvg8kQ0CkElqTdoYKiMpOChql73nORdo1w5fXb5KNveKLwk1SqgiDpfWAX28vi2OAb1xa5yATOOCY';
	require_once('../lib/magpierss/rss_fetch.inc');
	$url='http://worldcat.org/webservices/catalog/search/opensearch?q='.$_REQUEST['wc_str'].'&wskey='.$wskey.'&count='.$items_per_page.'&start='.(($page-1)*$items_per_page);

	$rss = fetch_rss( $url );
	include('_tag_editor.php');
	paginate($rss->channel['opensearch']['totalresults'], $page, $items_per_page);
	foreach ($rss->items as $item) {
		include('_wc_item.tpl');
	}
	paginate($rss->channel['opensearch']['totalresults'], $page, $items_per_page);

} elseif(isset($_REQUEST['add_tag'])) {
	// create an initial array of SUBMITTED tag info.
	$tag_data = array(
		'item_id'=>$_REQUEST['item_id'],
		'serialized_item_data'=>$_REQUEST['serialized_item_data'],
		'tags'=>$_REQUEST['tags'],
		'user_id'=>$nypl_user_id);

// strip dupes from tags array
//$tag_data['tags'] = explode()

	//check if this user / item combo exists in the database already
	// IF so UPDATE that record by adding this tag.
	// ELSE insert a new record with this tag

	if(isset($userInfo['$user_item_tags'][$_REQUEST['item_id']])) {
		if (!in_array($_REQUEST['tags'], explode(';',$user_item_tags[$_REQUEST['item_id']])	)) {
			$tag_data['tags'] = $userInfo['user_item_tags'][$_REQUEST['item_id']].';'.$tag_data['tags'];
			$result = doUpdate('list_items', $tag_data, "item_id = '{$_REQUEST['item_id']}' AND user_id = '{$nypl_user_id}'");
		}
	} else {
//		$tag_data['tags'] .= trim(str_replace(';', '', $_REQUEST['tags']));
		$result = doInsert('list_items', $tag_data);
	}
} elseif (isset($_REQUEST['remove'])) {
	$listInfo = explode('-',$_REQUEST['remove']);
	doQuery("UPDATE list_items SET tags = replace(tags, '{$listInfo[1]}', '')  WHERE user_id = '{$listInfo[0]}' AND item_id = '{$listInfo[2]}'");
}

$userInfo = get_user_info();

$tag_nav_options = "
View your lists
";

foreach($userInfo['user_tags'] as $user_tag) {
	$tag_nav_options .= "
{$user_tag}
";
}
?>


text:
/**
 *
 */
package io.pkts.framer;

import io.pkts.buffer.Buffer;
import io.pkts.packet.Packet;
import io.pkts.protocol.Protocol;

import java.io.IOException;

/**
 * Simple interface for framers.
 *
 * @author jonas@jonasborjesson.com
 */
public interface Framer<T extends Packet> {

    /**
     *
     * @return the protocol this framer is capable of framing
     */
    Protocol getProtocol();

    /**
     * Ask the framer to frame the buffer into a packet. Note that the
     * {@link Packet} has not been parsed, just framed.
     *
     * @param parent
     *            the parent frame or null if the frame doesn't have one.
     * @param buffer
     *            the buffer containing all the raw data
     *
     * @return a new frame
     * @throws IOException
     *             in case something goes wrong when reading data from the
     *             buffer
     */
    T frame(T parent, Buffer buffer) throws IOException;

    /**
     * Check whether the supplied data could be framed into a frame of this
     * type. Typically, a {@link Framer} will read a few bytes in an effort to
     * figure out if the incoming data may be something it recognizes. E.g., a
     * HTTP {@link Framer} could check if the first bytes match "GET", "POST",
     * "PUT" and "DELETE" if if so assume that the payload indeed is HTTP and
     * therefore return true. Of course, you may never really know until you
     * actually have parsed the entire body but this method should return quick
     * and if turns out that the data isn't what it thought, throw an exception
     * and the framework will take care of it.
     *
     * @param data
     *            the data to check whether it could be a frame of this type
     * @return true if the data indeed could be of this framer type, false if
     *         not
     */
    boolean accept(Buffer data) throws IOException;

}


text:
#include "StdAfx.h"
#include "ScrCaptureWnd.h"
#include "Canvas.h"
#include "CanvasContainer.h"
#include "Util.h"

CScrCaptureWnd* CScrCaptureWnd::m_pInstance = NULL;

class CDialogBuilderCallbackEx : public IDialogBuilderCallback
{
public:
	CControlUI* CreateControl(LPCTSTR pstrClass)
	{
		if( _tcscmp(pstrClass, DUI_CTR_CANVAS) == 0 ) return new CCanvasUI;
		else if( _tcscmp(pstrClass, DUI_CTR_CANVASCONTAINER) == 0 ) return new CCanvasContainerUI;
		return NULL;
	}
};

CScrCaptureWnd::CScrCaptureWnd() : m_hEditMenu(NULL), m_bClipChoiced(false)
{
	m_ptClipBasePoint.x = m_ptClipBasePoint.y = 0;
	::ZeroMemory(&m_rcWindow, sizeof(m_rcWindow));
	::ZeroMemory(&m_rcClipPadding, sizeof(m_rcClipPadding));
	::ZeroMemory(m_sClipDrawStringBuf, sizeof(m_sClipDrawStringBuf));
};

CScrCaptureWnd::~CScrCaptureWnd()
{
	::DestroyMenu(m_hEditMenu);
}

CScrCaptureWnd* CScrCaptureWnd::Instance()
{
	if (m_pInstance == NULL) m_pInstance = new CScrCaptureWnd;
	return m_pInstance;
}

LPCTSTR CScrCaptureWnd::GetWindowClassName() const
{
	return _T("UIScrCaptureFrame");
}

UINT CScrCaptureWnd::GetClassStyle() const
{
	return UI_CLASSSTYLE_DIALOG | CS_DBLCLKS;
}

void CScrCaptureWnd::OnFinalMessage(HWND /*hWnd*/)
{
	delete this;
};

void CScrCaptureWnd::Init()
{
	m_hEditMenu = ::CreatePopupMenu();
	::AppendMenu(m_hEditMenu, MF_STRING, MENUCMD_ADDRECTANGE, _T("Ìí¼Ó¾ØÐÎ"));
	::AppendMenu(m_hEditMenu, MF_STRING, MENUCMD_ADDELLIPSE, _T("Ìí¼ÓÍÖÔ²"));
	::AppendMenu(m_hEditMenu, MF_STRING, MENUCMD_ADDARROW, _T("Ìí¼Ó¼ýÍ·"));
	::AppendMenu(m_hEditMenu, MF_STRING, MENUCMD_ADDBRUSH, _T("Ìí¼Ó»Ë¢¹¤¾ß"));
	::AppendMenu(m_hEditMenu, MF_STRING, MENUCMD_ADDTEXT, _T("Ìí¼ÓÎÄ×Ö"));
	::AppendMenu(m_hEditMenu, MF_STRING, MENUCMD_UNDO, _T("³·Ïú±à¼"));
	::AppendMenu(m_hEditMenu, MF_SEPARATOR, 0, NULL);
	::AppendMenu(m_hEditMenu, MF_STRING, MENUCMD_RECHOICE, _T("ÖØÐÂÑ¡Ôñ½ØͼÇøÓò"));
	::AppendMenu(m_hEditMenu, MF_STRING, MENUCMD_SAVEANDQUIT, _T("¸´ÖƲ¢Í˳ö½Øͼ"));
	::AppendMenu(m_hEditMenu, MF_STRING, MENUCMD_SAVE, _T("±£´æ"));
	::AppendMenu(m_hEditMenu, MF_SEPARATOR, 0, NULL);
	::AppendMenu(m_hEditMenu, MF_STRING, MENUCMD_HIDETOOLBAR, _T("Òþ²Ø±à¼¹¤¾ßÀ¸"));
	::AppendMenu(m_hEditMenu, MF_STRING, MENUCMD_QUIT, _T("Í˳ö½ØÆÁ"));

	m_pDesktopImage = m_pm.FindControl(_T("desktopimage"));
	m_pDesktopMask = m_pm.FindControl(_T("desktopmask"));
	m_pDesktopMaskBorder = m_pm.FindControl(_T("desktopmaskborder"));
	m_pDesktopCanvasContainer = static_cast<CContainerUI*>(m_pm.FindControl(_T("desktopcanvascontainer")));
	if (m_pDesktopImage == NULL || m_pDesktopMask == NULL ||
		m_pDesktopMaskBorder == NULL || m_pDesktopCanvasContainer == NULL) ::PostQuitMessage(0L);

	::GetWindowRect(::GetDesktopWindow(), &m_rcWindow);
	::SetWindowPos(GetHWND(), NULL, m_rcWindow.left, m_rcWindow.top, m_rcWindow.right-m_rcWindow.left, m_rcWindow.bottom-m_rcWindow.top, SWP_NOZORDER);

	HBITMAP hDesktopBmp = CreateDesktopBitmap(GetHWND());
	m_pm.AddImage(_T("desktopimage"), hDesktopBmp, m_rcWindow.right-m_rcWindow.left, m_rcWindow.bottom-m_rcWindow.top, false);
	HBITMAP hDesktopBmpMask = CreateDesktopMaskBitmap(GetHWND());
	m_pm.AddImage(_T("desktopimagemask"), hDesktopBmpMask, m_rcWindow.right-m_rcWindow.left, m_rcWindow.bottom-m_rcWindow.top, true);

	m_pDesktopImage->SetBkImage(_T("desktopimage"));
	m_pDesktopMask->SetBkImage(_T("desktopimagemask"));
}

void CScrCaptureWnd::OnPrepare()
{
}

void CScrCaptureWnd::Notify(TNotifyUI& msg)
{
	if( msg.sType == _T("windowinit") ) {
		OnPrepare();
	}
	else if( msg.sType == _T("click") ) {
	}
}

RECT CScrCaptureWnd::GetWindowRect() const
{
	return m_rcWindow;
}

RECT CScrCaptureWnd::GetClipPadding() const
{
	return m_rcClipPadding;
}

void CScrCaptureWnd::SetClipPadding(RECT rc) {
	m_rcClipPadding = rc;
	_stprintf_s(m_sClipDrawStringBuf, MAX_PATH - 1, _T("file='desktopimagemask' scale9='%d,%d,%d,%d' hole='true'"),
		m_rcClipPadding.left, m_rcClipPadding.top, m_rcClipPadding.right, m_rcClipPadding.bottom);
	m_pDesktopMask->SetBkImage(m_sClipDrawStringBuf);
	m_pDesktopMaskBorder->SetPos(GetClipRect());
	m_pDesktopCanvasContainer->SetPos(GetCanvasContainerRect());
}

RECT CScrCaptureWnd::GetClipRect() const
{
	RECT rc = m_rcClipPadding;
	rc.left = rc.left+m_rcWindow.left;
	rc.top = rc.top+m_rcWindow.top;
	rc.right = m_rcWindow.right-rc.right;
	rc.bottom = m_rcWindow.bottom-rc.bottom;
	return rc;
}

RECT CScrCaptureWnd::GetCanvasContainerRect() const
{
	RECT rcInset = m_pDesktopCanvasContainer->GetInset();
	RECT rc = m_rcClipPadding;
	rc.left = rc.left+m_rcWindow.left-rcInset.left;
	rc.top = rc.top+m_rcWindow.top-rcInset.left;
	rc.right = m_rcWindow.right-rc.right+rcInset.left;
	rc.bottom = m_rcWindow.bottom-rc.bottom+rcInset.left;
	return rc;
}

LRESULT CScrCaptureWnd::MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled)
{
	if( uMsg == WM_KEYDOWN ) {
		if( wParam == VK_ESCAPE ) {
			PostQuitMessage(0);
			return true;
		}

	}
	return false;
}

LRESULT CScrCaptureWnd::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	if( uMsg == WM_CREATE ) {
		m_pm.Init(m_hWnd);
		m_pm.AddPreMessageFilter(this);
		CDialogBuilder builder;
		CDialogBuilderCallbackEx cb;
		CControlUI* pRoot = builder.Create(_T("ScrCapture.xml"), (UINT)0, &cb, &m_pm);
		ASSERT(pRoot && "Failed to parse XML");
		m_pm.AttachDialog(pRoot);
		m_pm.AddNotifier(this);
		Init();
		return 0;
	}
	else if( uMsg == WM_DESTROY ) {
		::PostQuitMessage(0L);
	}
	else if(uMsg == WM_LBUTTONDOWN) {
		if (!m_bClipChoiced) {
			m_pDesktopCanvasContainer->SetEnabled(false);
			m_ptClipBasePoint.x = GET_X_LPARAM(lParam);
			m_ptClipBasePoint.y = GET_Y_LPARAM(lParam);
			return 0;
		}
	}
	else if(uMsg == WM_LBUTTONUP) {
		if (!m_bClipChoiced) {
			m_bClipChoiced = true;
			m_pDesktopMaskBorder->SetVisible(false);
			m_pDesktopCanvasContainer->SetVisible(true);
			m_pDesktopCanvasContainer->SetEnabled(true);
			SetClipPadding(m_rcClipPadding);
			return 0;
		}
		else {

		}
	}
	else if(uMsg == WM_LBUTTONDBLCLK) {
		// todo:Íê³É½Øͼ£¬±£´æµ½¼ôÌù°å
		m_bClipChoiced = true;
		::PostQuitMessage(0L);
		return 0;
	}
	else if(uMsg == WM_RBUTTONUP) {
		if (m_bClipChoiced) {
			POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
			RECT rcClipRect = GetClipRect();
			if (::PtInRect(&rcClipRect, pt)) {
				::ClientToScreen(m_hWnd, &pt);
				::TrackPopupMenu(m_hEditMenu, TPM_TOPALIGN, pt.x, pt.y, 0, m_hWnd, NULL);
				::PostMessage(m_hWnd, WM_NULL, 0, 0);
			}
			else {
				m_bClipChoiced = false;
				m_pDesktopCanvasContainer->SetEnabled(false);
				::SendMessage(m_hWnd, WM_MOUSEMOVE, 0, MAKELPARAM(pt.x, pt.y));
			}
		}
		else {
			// Í˳ö½Øͼ
			::PostQuitMessage(0L);
		}
		return 0;
	}
	else if(uMsg == WM_MOUSEMOVE) {
		if (!m_bClipChoiced) {
			if( ::GetKeyState(VK_LBUTTON) < 0 ) { // ×ó¼ü°´ÏÂ״̬
				if (m_ptClipBasePoint.x != GET_X_LPARAM(lParam) || m_ptClipBasePoint.y != GET_Y_LPARAM(lParam)) {
					m_rcClipPadding.left = min(GET_X_LPARAM(lParam), m_ptClipBasePoint.x)-m_rcWindow.left; if (m_rcClipPadding.left < 0) m_rcClipPadding.left = 0;
					m_rcClipPadding.top = min(GET_Y_LPARAM(lParam), m_ptClipBasePoint.y)-m_rcWindow.top; if (m_rcClipPadding.top < 0) m_rcClipPadding.top = 0;
					m_rcClipPadding.right = m_rcWindow.right-max(GET_X_LPARAM(lParam), m_ptClipBasePoint.x); if (m_rcClipPadding.right < 0) m_rcClipPadding.right = 0;
					m_rcClipPadding.bottom = m_rcWindow.bottom-max(GET_Y_LPARAM(lParam), m_ptClipBasePoint.y); if (m_rcClipPadding.bottom < 0) m_rcClipPadding.bottom = 0;
					m_pDesktopMaskBorder->SetVisible(false);
					m_pDesktopCanvasContainer->SetVisible(true);
					SetClipPadding(m_rcClipPadding);
				}
			}
			else {
				RECT rc;
				HWND hWnd;
				::EnableWindow(m_hWnd, FALSE);
				hWnd = SmallestWindowFromCursor(rc);
				::EnableWindow(m_hWnd, TRUE);
				::SetFocus(m_hWnd);
				rc.left = rc.left-m_rcWindow.left; if (rc.left < 0) rc.left = 0;
				rc.top = rc.top-m_rcWindow.top; if (rc.top < 0) rc.top = 0;
				rc.right = m_rcWindow.right-rc.right; if (rc.right < 0) rc.right = 0;
				rc.bottom = m_rcWindow.bottom-rc.bottom; if (rc.bottom < 0) rc.bottom = 0;
				if (rc.left != m_rcClipPadding.left || rc.right != m_rcClipPadding.right || rc.top != m_rcClipPadding.top || rc.bottom != m_rcClipPadding.bottom) {
					SetClipPadding(rc);
					m_pDesktopMaskBorder->SetVisible(true);
					m_pDesktopCanvasContainer->SetVisible(false);
				}
			}
		}
		else {

		}
	}
	else if(uMsg == WM_COMMAND) {
		switch (LOWORD(wParam))
		{
		case MENUCMD_ADDRECTANGE:
			return 0;
		case MENUCMD_ADDELLIPSE:
			return 0;
		case MENUCMD_ADDARROW:
			return 0;
		case MENUCMD_ADDBRUSH:
			return 0;
		case MENUCMD_ADDTEXT:
			return 0;
		case MENUCMD_UNDO:
			return 0;
		case MENUCMD_RECHOICE:
			{
				m_bClipChoiced = false;
				m_pDesktopCanvasContainer->SetEnabled(false);
				POINT pt;
				::GetCursorPos(&pt);
				::SendMessage(m_hWnd, WM_MOUSEMOVE, 0, MAKELPARAM(pt.x, pt.y));
			}
			return 0;
		case MENUCMD_SAVEANDQUIT:
			{
				// todo:
				PostQuitMessage(0L);
			}
			return 0;
		case MENUCMD_SAVE:
			{
				// todo:µ¯³ö±£´æ¶Ô»°¿ò
			}
			return 0;
		case MENUCMD_HIDETOOLBAR:
			return 0;
		case MENUCMD_QUIT:
			PostQuitMessage(0L);
			return 0;
		}
	}
	LRESULT lRes = 0;
	if( m_pm.MessageHandler(uMsg, wParam, lParam, lRes) ) return lRes;
	return CWindowWnd::HandleMessage(uMsg, wParam, lParam);
}