text:
namespace variables {

// Builtin vars ----------------------------------------------------------------

extern const char kHostCpu[];
extern const char kHostCpu_HelpShort[];
extern const char kHostCpu_Help[];

extern const char kHostOs[];
extern const char kHostOs_HelpShort[];
extern const char kHostOs_Help[];

extern const char kCurrentCpu[];
extern const char kCurrentCpu_HelpShort[];
extern const char kCurrentCpu_Help[];

extern const char kCurrentOs[];
extern const char kCurrentOs_HelpShort[];
extern const char kCurrentOs_Help[];

extern const char kCurrentToolchain[];
extern const char kCurrentToolchain_HelpShort[];
extern const char kCurrentToolchain_Help[];

extern const char kDefaultToolchain[];
extern const char kDefaultToolchain_HelpShort[];
extern const char kDefaultToolchain_Help[];

extern const char kGnVersion[];
extern const char kGnVersion_HelpShort[];
extern const char kGnVersion_Help[];

extern const char kInvoker[];
extern const char kInvoker_HelpShort[];
extern const char kInvoker_Help[];

extern const char kPythonPath[];
extern const char kPythonPath_HelpShort[];
extern const char kPythonPath_Help[];

extern const char kRootBuildDir[];
extern const char kRootBuildDir_HelpShort[];
extern const char kRootBuildDir_Help[];

extern const char kRootGenDir[];
extern const char kRootGenDir_HelpShort[];
extern const char kRootGenDir_Help[];

extern const char kRootOutDir[];
extern const char kRootOutDir_HelpShort[];
extern const char kRootOutDir_Help[];

extern const char kTargetCpu[];
extern const char kTargetCpu_HelpShort[];
extern const char kTargetCpu_Help[];

extern const char kTargetName[];
extern const char kTargetName_HelpShort[];
extern const char kTargetName_Help[];

extern const char kTargetOs[];
extern const char kTargetOs_HelpShort[];
extern const char kTargetOs_Help[];

extern const char kTargetGenDir[];
extern const char kTargetGenDir_HelpShort[];
extern const char kTargetGenDir_Help[];

extern const char kTargetOutDir[];
extern const char kTargetOutDir_HelpShort[];
extern const char kTargetOutDir_Help[];

// Target vars -----------------------------------------------------------------

extern const char kAllDependentConfigs[];
extern const char kAllDependentConfigs_HelpShort[];
extern const char kAllDependentConfigs_Help[];

extern const char kAllowCircularIncludesFrom[];
extern const char kAllowCircularIncludesFrom_HelpShort[];
extern const char kAllowCircularIncludesFrom_Help[];

extern const char kArflags[];
extern const char kArflags_HelpShort[];
extern const char kArflags_Help[];

extern const char kArgs[];
extern const char kArgs_HelpShort[];
extern const char kArgs_Help[];

extern const char kAsmflags[];
extern const char kAsmflags_HelpShort[];
extern const char* kAsmflags_Help;

extern const char kAssertNoDeps[];
extern const char kAssertNoDeps_HelpShort[];
extern const char kAssertNoDeps_Help[];

extern const char kBundleRootDir[];
extern const char kBundleRootDir_HelpShort[];
extern const char kBundleRootDir_Help[];

extern const char kBundleContentsDir[];
extern const char kBundleContentsDir_HelpShort[];
extern const char kBundleContentsDir_Help[];

extern const char kBundleResourcesDir[];
extern const char kBundleResourcesDir_HelpShort[];
extern const char kBundleResourcesDir_Help[];

extern const char kBundleDepsFilter[];
extern const char kBundleDepsFilter_HelpShort[];
extern const char kBundleDepsFilter_Help[];

extern const char kBundleExecutableDir[];
extern const char kBundleExecutableDir_HelpShort[];
extern const char kBundleExecutableDir_Help[];

extern const char kXcassetCompilerFlags[];
extern const char kXcassetCompilerFlags_HelpShort[];
extern const char kXcassetCompilerFlags_Help[];

extern const char kCflags[];
extern const char kCflags_HelpShort[];
extern const char* kCflags_Help;

extern const char kCflagsC[];
extern const char kCflagsC_HelpShort[];
extern const char* kCflagsC_Help;

extern const char kCflagsCC[];
extern const char kCflagsCC_HelpShort[];
extern const char* kCflagsCC_Help;

extern const char kCflagsObjC[];
extern const char kCflagsObjC_HelpShort[];
extern const char* kCflagsObjC_Help;

extern const char kCflagsObjCC[];
extern const char kCflagsObjCC_HelpShort[];
extern const char* kCflagsObjCC_Help;

extern const char kCheckIncludes[];
extern const char kCheckIncludes_HelpShort[];
extern const char kCheckIncludes_Help[];

extern const char kCodeSigningArgs[];
extern const char kCodeSigningArgs_HelpShort[];
extern const char kCodeSigningArgs_Help[];

extern const char kCodeSigningScript[];
extern const char kCodeSigningScript_HelpShort[];
extern const char kCodeSigningScript_Help[];

extern const char kCodeSigningSources[];
extern const char kCodeSigningSources_HelpShort[];
extern const char kCodeSigningSources_Help[];

extern const char kCodeSigningOutputs[];
extern const char kCodeSigningOutputs_HelpShort[];
extern const char kCodeSigningOutputs_Help[];

extern const char kCompleteStaticLib[];
extern const char kCompleteStaticLib_HelpShort[];
extern const char kCompleteStaticLib_Help[];

extern const char kConfigs[];
extern const char kConfigs_HelpShort[];
extern const char kConfigs_Help[];

extern const char kData[];
extern const char kData_HelpShort[];
extern const char kData_Help[];

extern const char kDataDeps[];
extern const char kDataDeps_HelpShort[];
extern const char kDataDeps_Help[];

extern const char kDataKeys[];
extern const char kDataKeys_HelpShort[];
extern const char kDataKeys_Help[];

extern const char kDefines[];
extern const char kDefines_HelpShort[];
extern const char kDefines_Help[];

extern const char kDepfile[];
extern const char kDepfile_HelpShort[];
extern const char kDepfile_Help[];

extern const char kDeps[];
extern const char kDeps_HelpShort[];
extern const char kDeps_Help[];

extern const char kExterns[];
extern const char kExterns_HelpShort[];
extern const char kExterns_Help[];

extern const char kFriend[];
extern const char kFriend_HelpShort[];
extern const char kFriend_Help[];

extern const char kFrameworkDirs[];
extern const char kFrameworkDirs_HelpShort[];
extern const char kFrameworkDirs_Help[];

extern const char kFrameworks[];
extern const char kFrameworks_HelpShort[];
extern const char kFrameworks_Help[];

extern const char kIncludeDirs[];
extern const char kIncludeDirs_HelpShort[];
extern const char kIncludeDirs_Help[];

extern const char kInputs[];
extern const char kInputs_HelpShort[];
extern const char kInputs_Help[];

extern const char kLdflags[];
extern const char kLdflags_HelpShort[];
extern const char kLdflags_Help[];

extern const char kLibDirs[];
extern const char kLibDirs_HelpShort[];
extern const char kLibDirs_Help[];

extern const char kLibs[];
extern const char kLibs_HelpShort[];
extern const char kLibs_Help[];

extern const char kMetadata[];
extern const char kMetadata_HelpShort[];
extern const char kMetadata_Help[];

extern const char kOutputDir[];
extern const char kOutputDir_HelpShort[];
extern const char kOutputDir_Help[];

extern const char kOutputExtension[];
extern const char kOutputExtension_HelpShort[];
extern const char kOutputExtension_Help[];

extern const char kOutputName[];
extern const char kOutputName_HelpShort[];
extern const char kOutputName_Help[];

extern const char kOutputPrefixOverride[];
extern const char kOutputPrefixOverride_HelpShort[];
extern const char kOutputPrefixOverride_Help[];

extern const char kOutputs[];
extern const char kOutputs_HelpShort[];
extern const char kOutputs_Help[];

extern const char kPartialInfoPlist[];
extern const char kPartialInfoPlist_HelpShort[];
extern const char kPartialInfoPlist_Help[];

extern const char kPool[];
extern const char kPool_HelpShort[];
extern const char kPool_Help[];

extern const char kPrecompiledHeader[];
extern const char kPrecompiledHeader_HelpShort[];
extern const char kPrecompiledHeader_Help[];

extern const char kPrecompiledHeaderType[];
extern const char kPrecompiledHeaderType_HelpShort[];
extern const char kPrecompiledHeaderType_Help[];

extern const char kPrecompiledSource[];
extern const char kPrecompiledSource_HelpShort[];
extern const char kPrecompiledSource_Help[];

extern const char kProductType[];
extern const char kProductType_HelpShort[];
extern const char kProductType_Help[];

extern const char kPublic[];
extern const char kPublic_HelpShort[];
extern const char kPublic_Help[];

extern const char kPublicConfigs[];
extern const char kPublicConfigs_HelpShort[];
extern const char kPublicConfigs_Help[];

extern const char kPublicDeps[];
extern const char kPublicDeps_HelpShort[];
extern const char kPublicDeps_Help[];

extern const char kRebase[];
extern const char kRebase_HelpShort[];
extern const char kRebase_Help[];

extern const char kResponseFileContents[];
extern const char kResponseFileContents_HelpShort[];
extern const char kResponseFileContents_Help[];

extern const char kScript[];
extern const char kScript_HelpShort[];
extern const char kScript_Help[];

extern const char kSources[];
extern const char kSources_HelpShort[];
extern const char kSources_Help[];

extern const char kSwiftflags[];
extern const char kSwiftflags_HelpShort[];
extern const char* kSwiftflags_Help;

extern const char kXcodeTestApplicationName[];
extern const char kXcodeTestApplicationName_HelpShort[];
extern const char kXcodeTestApplicationName_Help[];

extern const char kTestonly[];
extern const char kTestonly_HelpShort[];
extern const char kTestonly_Help[];

extern const char kVisibility[];
extern const char kVisibility_HelpShort[];
extern const char kVisibility_Help[];

extern const char kWalkKeys[];
extern const char kWalkKeys_HelpShort[];
extern const char kWalkKeys_Help[];

extern const char kWeakFrameworks[];
extern const char kWeakFrameworks_HelpShort[];
extern const char kWeakFrameworks_Help[];

extern const char kWriteValueContents[];
extern const char kWriteValueContents_HelpShort[];
extern const char kWriteValueContents_Help[];

extern const char kWriteOutputConversion[];
extern const char kWriteOutputConversion_HelpShort[];
extern const char kWriteOutputConversion_Help[];

extern const char kWriteRuntimeDeps[];
extern const char kWriteRuntimeDeps_HelpShort[];
extern const char kWriteRuntimeDeps_Help[];

extern const char kXcodeExtraAttributes[];
extern const char kXcodeExtraAttributes_HelpShort[];
extern const char kXcodeExtraAttributes_Help[];

extern const char kGenDeps[];
extern const char kGenDeps_HelpShort[];
extern const char kGenDeps_Help[];

// -----------------------------------------------------------------------------

struct VariableInfo {
  VariableInfo();
  VariableInfo(const char* in_help_short, const char* in_help);

  const char* help_short;
  const char* help;
};

using VariableInfoMap = std::map<std::string_view, VariableInfo>;

// Returns the built-in readonly variables.
// Note: this is used only for help so this getter is not threadsafe.
const VariableInfoMap& GetBuiltinVariables();

// Returns the variables used by target generators.
// Note: this is used only for help so this getter is not threadsafe.
const VariableInfoMap& GetTargetVariables();

}  // namespace variables

#endif  // TOOLS_GN_VARIABLES_H_


text:
load('vertx.js')

var config = {name: 'tim', age: 823823};

var id = vertx.deployVerticle('deploy/child.js', config, 1);

redpajama_set_name: RedPajamaGithub


text:
using Fluid.Values;
using System;
using System.IO;
using System.Text.Encodings.Web;
using System.Globalization;

namespace Sandwych.Reporting.OpenDocument.Values
{
    public class OdsTableCellDataValue : FluidValue, IEquatable<OdsTableCellDataValue>
    {
        private string CellFormat { get; }
        private object Value { get; }

        public OdsTableCellDataValue(string cellFormat, object value)
        {
            this.CellFormat = cellFormat;
            this.Value = value;
            this.Type = FluidValues.Array;
        }

        public override FluidValues Type { get; }

        public override bool Equals(FluidValue other)
        {
            if (other == NilValue.Instance)
            {
                return this.Value == null;
            }

            if (other is OdsTableCellDataValue)
            {
                return this.Equals(other);
            }

            return false;
        }

        public override bool ToBooleanValue()
        {
            throw new NotSupportedException();
        }

        public override double ToNumberValue()
        {
            throw new NotSupportedException();
        }

        public override object ToObjectValue()
        {
            throw new NotSupportedException();
        }

        public override string ToStringValue()
        {
            throw new NotSupportedException();
        }

        public override void WriteTo(TextWriter writer, TextEncoder encoder, CultureInfo cultureInfo)
        {
            throw new NotImplementedException();
        }

        public bool Equals(OdsTableCellDataValue other)
        {
            throw new NotImplementedException();
        }
    }
}


text:
Run shell sessions within Atom Editor using `term2` package.
Run **Vim, Emacs, Htop, etc.** in Atom.
It's based on `pty.js` as shell spawner, and `term.js` as xterm, with the power
of Atom Package environment.

_It's a fork and rebuilt version of "[Term](http://atom.io/packages/term)" package._

## What about this fork ?!

This fork adds a 'ShellOverride' configuration option which allows to override
the shell Term2 is using (your default shell).

If your default shell is zsh you see that it's not yet fully compatible with
Term2 (scrolling might not work):
setting ShellOverride to i.e. 'bash' let you use Term2 with another (working)
shell without messing up with your default shell configuration.

The fork was focused on this option in the first place but evolved a lot since.

To install **Term2** easily into your Atom:

```console
$ apm install term2
```

![Vim, Emacs and HTop](https://dl.dropboxusercontent.com/u/20947008/webbox/atom/atom-term3.png)

## Key Bindings and Events

| key binding | event | action |
| ----------- | ----- | ------ |
| `ctrl + alt + t` | `term2:open` | Opens new terminal tab pane |
| `ctrl + alt + up`| `term2:open-split-up` | Opens new terminal tab pane in up split |
| `ctrl + alt + right`| `term2:open-split-right` | Opens new terminal tab pane in right split |
| `ctrl + alt + down`| `term2:open-split-down` | Opens new terminal tab pane in down split |
| `ctrl + alt + left`| `term2:open-split-left` | Opens new terminal tab pane in left split |
| `ctrl + k, t, t` | `term2:open` | Opens new terminal tab pane |
| `ctrl + k, t, up`| `term2:open-split-up` | Opens new terminal tab pane in up split |
| `ctrl + k, t, right`| `term2:open-split-right` | Opens new terminal tab pane in right split |
| `ctrl + k, t, down`| `term2:open-split-down` | Opens new terminal tab pane in down split |
| `ctrl + k, t, left`| `term2:open-split-left` | Opens new terminal tab pane in left split |
| `cmd + k, t, t` | `term2:open` | Opens new terminal tab pane |
| `cmd + k, t, up`| `term2:open-split-up` | Opens new terminal tab pane in up split |
| `cmd + k, t, right`| `term2:open-split-right` | Opens new terminal tab pane in right split |
| `cmd + k, t, down`| `term2:open-split-down` | Opens new terminal tab pane in down split |
| `cmd + k, t, left`| `term2:open-split-left` | Opens new terminal tab pane in left split |
| `ctrl + insert | `term2:copy` | Copy text (if `ctrl + c` is not working) |
| `shift + insert | `term2:paste` | Paste text (if `ctrl + v` is not working) |

## Customize Title

You can customize Title with using some variables. These are the current variables you can use:

| title variable | value |
| -------------- | ----- |
| `bashName` | Current Shell's name, (e.g. bash, zsh) |
| `hostName` | OS's host name |
| `platform` | Platform name, (e.g. darwin, linux) |
| `home` | Home path of current user |

Default version of **title template** is

```
Terminal ({{ bashName }})
```

## Additional Features

  - **Run a defined command automatically** when shell session starts.
  - You can customize font-family or font-size (default to Atom settings values)
  - You can define **Terminal Colors** in `config.cson`.
  - Turn on or off **blinking cursor**
  - Change **scrollback** limit
  - Start shell sessions with additional parameters.
  - You can **pipe the text and paths** to the Terminal sessions.
  - Paste from clipboard

### Note about colors

Currently, you will need to adjust the colors in `config.cson`
(then you should be able to edit them in the package settings view).

You can add something like (please note the 2 examples of color format):

```cson
term2:
  colors:
    normalBlack: #000
    normalRed:
      red: 255
      blue: 0
      green: 0
      alpha: 1
    normalGreen: ...
    normalYellow: ...
    normalBlue: ...
    normalPurple: ...
    normalCyan: ...
    normalWhite: ...
    brightBlack: ...
    brightRed: ...
    brightGreen: ...
    brightYellow: ...
    brightBlue: ...
    brightPurple: ...
    brightCyan: ...
    brightWhite: ...
    background: ...
    foreground: ...
```

- **Colors are not taken from the Atom theme.**
- alpha channel are not used for now.
- _The background color is for now the only exception and is not used.
The background is transparent so you benefit of Atom app background color._

## FAQ

### Why some commands do not work like in my previous terminal ?

It's [a known `$PATH` issue](https://github.com/webBoxio/atom-term2/issues/50).
You are probably an OS X user (if not, let us know).
GUI app doesn't get `/etc/paths` (and might come from `/usr/local/bin`).
There is some workaround for OS X 10.9-, but OS X 10.10+ doesn't execute
`/etc/launchd.conf` anymore.
So, in order to get the right PATH in atom-term2 context, you have this
solutions:

- In your `.(bash|zsh|*)rc`, add

  ```bash
  export PATH=$(cat /etc/paths | xargs | tr " " :)
  # or just hardcode your path like this
  export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin
  ```

- You can automatically call a command when you open a terminal to `login` by
editing your Atom config:

  ```cson
  term2:
    autoRunCommand: 'login -f `whoami`'
  ```

---

## [Contributors](https://github.com/webBoxio/atom-term2/graphs/contributors)

## [License](LICENSE)


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

        <title>overlay</title>


text:
"""
Linux compiler backend - responsible for taking program events emitted by the
driver and converting them into code.
"""
import logging

from ..backend_utils import FunctionStack
from .common32 import Common32Backend
from ..util import mangle_label

LOGGER = logging.getLogger('spc.linux_x86')

class LinuxX86Stack(FunctionStack):
    """
    Specializes the default function stack for the x86 Linux code
    generator.
    """

    #
    # Stack layout:
    #
    #   | ...     |
    #   | param_2 |
    #   | param_1 |__/-- 8(%ebp)
    #   | <ret>   |__/-- 4(%ebp)
    #   | old_ebp |__/-- %ebp
    #   | local_1 |
    #   | local_2 |
    #   | ...     |
    #

    def _starting_locals_offset(self):
        return 0

    def _starting_param_offset(self):
        return 8

    def _expand_stack(self, size):
        self.backend._write_instr('    sub ${}, %esp', size)

    def _shrink_stack(self, size):
        self.backend._write_instr('    add ${}, %esp', size)

class LinuxX86Templates:
    """
    Template code which is plugged into the generic 32-bit backend, which
    generates GAS-compatible x86 code.
    """
    frame_reg = '%ebp'
    return_reg = '%eax'
    tmp_regs = ['%eax', '%edx']

    platform_os = 'linux'
    platform_arch = 'x86'
    comment_fmt = '/* {} */'

    def __init__(self):
        self.backend = None
        self.main_func = None

    def make_func_stack(self):
        return LinuxX86Stack(self.backend)

    def _write_instr(self, *args, **kwargs):
        """
        Convenience method to avoid writing out 'backend'
        """
        self.backend._write_instr(*args, **kwargs)

    def emit_label(self, label):
        self._write_instr('{}:', label)

    def emit_data_segment(self):
        self._write_instr('.data')

    def emit_stack_string(self, base_addr, escaped_bytes):
        for idx, byte in enumerate(escaped_bytes):
            self._write_instr('    movb ${}, %al', byte)
            self._write_instr('    movb %al, {}(%ebp)', base_addr + idx)

    def emit_static_string(self, unescaped_bytes):
        self._write_instr('    .string "{}"', unescaped_bytes)

    def emit_static_space(self, size):
        self._write_instr('    .space {}', size)

    def emit_text_segment(self):
        self._write_instr('.text')

    def emit_prog_header(self):
        self._write_instr('.global _start')
        self._write_instr('_start:')
        self._write_instr('    call _main_stub')
        self._write_instr('    movl $1, %eax')
        self._write_instr('    movl $0, %ebx')
        self._write_instr('    int $0x80')

    def emit_prog_footer(self, main_label):
        self._write_instr('_main_stub:')
        self._write_instr('    jmp {}', main_label)

    def emit_export(self, name, type_of):
        self._write_instr('.globl {}', mangle_label(name))

    def emit_func_header(self, name):
        self._write_instr('    pushl %ebp')
        self._write_instr('    movl %esp, %ebp')

    def emit_func_footer(self):
        self._write_instr('    popl %ebp')
        self._write_instr('    ret')

    def emit_asm(self, name, code):
        for instr in code.splitlines():
            self._write_instr('{}', instr)

    def emit_move_word(self, move_reg,
                        src_reg, src_offset,
                        dest_reg, dest_offset):
        self._write_instr('    movl {}({}), {}', src_offset, src_reg, move_reg)
        self._write_instr('    movl {}, {}({})', move_reg, dest_offset, dest_reg)

    def emit_move_byte(self, move_reg,
                        src_reg, src_offset,
                        dest_reg, dest_offset):
        self._write_instr('    movb {}({}), {}', src_offset, src_reg, move_reg)
        self._write_instr('    movb {}, {}({})', move_reg, dest_offset, dest_reg)

    def emit_load_int(self, reg, value):
        self._write_instr('    movl ${}, {}', value, reg)

    def emit_load_byte(self, reg, value):
        self._write_instr('    movb ${}, {}', value, reg)

    def emit_load_static_addr(self, reg, name):
        self._write_instr('    movl ${}, {}', mangle_label(name), reg)

    def emit_load_stack_addr(self, reg, offset):
        self._write_instr('    movl %ebp, {}', reg)
        self._write_instr('    add ${}, {}', offset, reg)

    def emit_load_stack_word(self, reg, offset):
        self._write_instr('    movl {}(%ebp), {}', offset, reg)

    def emit_save_stack_word(self, reg, offset):
        self._write_instr('    movl {}, {}(%ebp)', reg, offset)

    def emit_load_stack_byte(self, reg, offset):
        self._write_instr('    movb {}(%ebp), {}', offset, reg)

    def emit_save_stack_byte(self, reg, offset):
        self._write_instr('    movb {}, {}(%ebp)', reg, offset)

    def emit_int_to_byte(self, reg):
        self._write_instr('    shll $24, {}', reg)
        self._write_instr('    sarl $24, {}', reg)

    def emit_byte_to_int(self, reg):
        # This is necessary because movb uses the byte registers, unlike
        # MARS which zeros a word register and then loads the byte. The byte
        # registers leave the other 24-bits intact, which we don't want
        # because the byte we're upcasting should have zeroes in those bits
        self._write_instr('    shll $24, {}', reg)
        self._write_instr('    sarl $24, {}', reg)

    def emit_array_offset(self, reg, array_offset, index_offset, elem_size):
        self._write_instr('    movl {}(%ebp), %eax', index_offset, reg)
        self._write_instr('    imull ${}, %eax, %ecx', elem_size)
        self._write_instr('    movl {}(%ebp), {}', array_offset, reg)
        self._write_instr('    addl %ecx, {}', reg)

    def emit_left_array_offset(self, reg, array_offset, index_offset, elem_size):
        self._write_instr('    movl {}(%ebp), %eax', index_offset, reg)
        self._write_instr('    imull ${}, %eax, %ecx', elem_size)
        self._write_instr('    movl {}(%ebp), {}', array_offset, reg)
        self._write_instr('    subl %ecx, {}', reg)

    def emit_struct_offset(self, reg, total_offset):
        self._write_instr('    add ${}, {}', total_offset, reg)

    def emit_add(self, dest_reg, rhs_reg):
        self._write_instr('    add {}, {}', rhs_reg, dest_reg)

    def emit_sub(self, dest_reg, rhs_reg):
        self._write_instr('    sub {}, {}', rhs_reg, dest_reg)

    def emit_mul(self, dest_reg, rhs_reg):
        self._write_instr('    imul {}, {}', rhs_reg, dest_reg)
        if dest_reg != '%eax':
            self._write_instr('    movl %eax, {}', dest_reg)

    # These are a bit bizarre - in x86, to do the division:
    #
    # c = a / b
    #
    # You have to load a into EDX:EAX (EDX are bits 63-32,
    # EAX are bits 31-0 of this weird 64-bit integer made of
    # those two registers mashed together). This typically
    # involves zeroing EDX, moving a into EAX, and then
    # sign extending EAX into EDX (via the instruction CLTD).
    #
    # Then, you divide this implicit argument by b, and the
    # processor will dump the result into EAX and the remainder
    # into EDX

    def emit_div(self, dest_reg, rhs_reg):
        move_rhs = rhs_reg in ('%eax', '%edx')

        if move_rhs:
            self._write_instr('    movl {}, %ecx', rhs_reg)

        self._write_instr('    xor %edx, %edx')
        self._write_instr('    cltd')

        if move_rhs:
            self._write_instr('    idivl %ecx')
        else:
            self._write_instr('    idivl {}', rhs_reg)

        if dest_reg != '%eax':
            self._write_instr('    movl %eax, {}', dest_reg)

    def emit_mod(self, dest_reg, rhs_reg):
        move_rhs = rhs_reg in ('%eax', '%edx')

        if move_rhs:
            self._write_instr('    movl {}, %ecx', rhs_reg)

        self._write_instr('    xor %edx, %edx')
        self._write_instr('    cltd')

        if move_rhs:
            self._write_instr('    idivl %ecx')
        else:
            self._write_instr('    idivl {}', rhs_reg)

        if dest_reg != '%edx':
            self._write_instr('    movl %edx, {}', dest_reg)

    class CompareContext:
        def __init__(self, owner, lhs, rhs):
            self.owner = owner
            self.lhs = lhs
            self.rhs = rhs
            self.skip_label = next(owner.backend.label_maker)

        def __enter__(self):
            self.owner._write_instr('    cmpl {}, {}', self.rhs, self.lhs)
            self.owner._write_instr('    movl $1, {}', self.lhs)
            return self

        def __exit__(self, *err):
            self.owner._write_instr('    xor {}, {}', self.lhs, self.lhs)
            self.owner._write_instr('{}:', self.skip_label)

    def emit_less(self, dest_reg, rhs_reg):
        with self.CompareContext(self, dest_reg, rhs_reg) as ctx:
            self._write_instr('    jl {}', ctx.skip_label)

    def emit_greater(self, dest_reg, rhs_reg):
        with self.CompareContext(self, dest_reg, rhs_reg) as ctx:
            self._write_instr('    jg {}', ctx.skip_label)

    def emit_lesseq(self, dest_reg, rhs_reg):
        with self.CompareContext(self, dest_reg, rhs_reg) as ctx:
            self._write_instr('    jle {}', ctx.skip_label)

    def emit_greateq(self, dest_reg, rhs_reg):
        with self.CompareContext(self, dest_reg, rhs_reg) as ctx:
            self._write_instr('    jge {}', ctx.skip_label)

    def emit_eq(self, dest_reg, rhs_reg):
        with self.CompareContext(self, dest_reg, rhs_reg) as ctx:
            self._write_instr('    je {}', ctx.skip_label)

    def emit_noteq(self, dest_reg, rhs_reg):
        with self.CompareContext(self, dest_reg, rhs_reg) as ctx:
            self._write_instr('    jne {}', ctx.skip_label)

    def emit_bit_and(self, dest_reg, rhs_reg):
        self._write_instr('    andl {}, {}', rhs_reg, dest_reg)

    def emit_bit_or(self, dest_reg, rhs_reg):
        self._write_instr('    orl {}, {}', rhs_reg, dest_reg)

    def emit_shiftleft(self, dest_reg, rhs_reg):
        self._write_instr('    shll {}, {}', rhs_reg, dest_reg)

    def emit_shiftright_arith(self, dest_reg, rhs_reg):
        self._write_instr('    shrl {}, {}', rhs_reg, dest_reg)

    def emit_shiftright_log(self, dest_reg, rhs_reg):
        self._write_instr('    sarl {}, {}', rhs_reg, dest_reg)

    def emit_bit_not(self, reg):
        self._write_instr('    not {}', reg)

    def emit_branch_if_zero(self, reg, label):
        self._write_instr('    cmp $0, {}', reg)
        self._write_instr('    jz {}', label)

    def emit_branch_if_nonzero(self, reg, label):
        self._write_instr('    cmp $0, {}', reg)
        self._write_instr('    jnz {}', label)

    def emit_not(self, reg):
        skip_label = next(self.backend.label_maker)

        self._write_instr('    cmpl $0, {}', reg)

        # Not xor, since that switches with flags, which we need to preserve
        # in order to do the jump
        self._write_instr('    movl $0, {}', reg)

        self._write_instr('    jnz {}', skip_label)
        self._write_instr('    movl $1, {}', reg)
        self._write_instr('{}:', skip_label)

    def emit_indirect_call(self, reg):
        self._write_instr('    call *{}', reg)

    def emit_jump(self, label):
        self._write_instr('    jmp {}', label)

def get_backend(output, filename, is_library):
    """
    Returns the backend represented by this module.
    """
    return Common32Backend(LinuxX86Templates(), output, filename, is_library)


text:
import cx from 'classnames';
import { Component, createRef } from 'react';

// use this only as type, @types/sortablejs and sortablejs cannot be used with `esModuleInterop: false`
import * as _sortableJS from 'sortablejs';

import reorder from '../utils/reorder';
import { EASE_OUT_CUBIC } from '../utils/timingFunctions';

// use this as value
const sortableJS: typeof _sortableJS = (_sortableJS as any).default;

const DRAGGING_CLS = 'zent-sortable--grabbing';

export interface ISortableProps<T>
  extends Omit<_sortableJS.Options, 'onChange'> {
  // zent wrapper api
  tag?: React.ComponentType | string;
  className?: string;
  items?: T[];
  filterClass?: string;
  onChange?: (newItems: T[]) => void;
}

const addElementsDraggingCursor = (selector: string, element?: HTMLElement) => {
  const container = element || document;
  container.querySelectorAll(selector).forEach((el: HTMLElement) => {
    el.style.cursor = 'grabbing';
  });
};

const removeElementsDraggingCursor = (
  selector: string,
  element?: HTMLElement
) => {
  const container = element || document;
  container.querySelectorAll(selector).forEach((el: HTMLElement) => {
    el.style.cursor = '';
  });
};

export class Sortable<T> extends Component<ISortableProps<T>> {
  static defaultProps = {
    tag: 'div',
  };

  sortable: _sortableJS;
  containerRef = createRef<HTMLElement>();

  handleAddDraggingCursor = () => {
    const { handle } = this.props;
    addElementsDraggingCursor('html');
    handle && addElementsDraggingCursor(handle, this.containerRef.current);
    this.containerRef.current?.classList.add(DRAGGING_CLS);
  };

  handleRemoveDraggingCursor = () => {
    const { handle } = this.props;
    removeElementsDraggingCursor('html');
    handle && removeElementsDraggingCursor(handle, this.containerRef.current);
    this.containerRef.current?.classList.remove(DRAGGING_CLS);
  };

  private initSortable = () => {
    const { onMove, onEnd, onChange, filterClass, children, ...rest } =
      this.props;

    const instance = this.containerRef.current;
    if (!instance) {
      return;
    }

    const sortableOptions: _sortableJS.Options = {
      filter: filterClass ? `.${filterClass}` : '',
      ghostClass: 'zent-sortable__ghost',
      chosenClass: 'zent-sortable__chosen',
      dragClass: 'zent-sortable__drag',
      fallbackClass: 'zent-sortable__fallback',
      animation: 200,
      easing: EASE_OUT_CUBIC,
      forceFallback: true,
      onChoose: e => {
        this.handleAddDraggingCursor();
        this.props.onChoose?.(e);
      },
      onMove: (e, originalEvent) => {
        const { onMove } = this.props;
        if (onMove) {
          return onMove(e, originalEvent);
        }

        if (filterClass && e.related.classList.contains(filterClass)) {
          return false;
        }

        // insert point is based on direction
        return true;
      },
      onUnchoose: e => {
        this.handleRemoveDraggingCursor();
        this.props.onUnchoose?.(e);
      },
      onEnd: e => {
        const { items, onEnd, onChange } = this.props;
        onEnd && onEnd(e);

        if (!items) {
          return;
        }

        const { oldIndex, newIndex } = e;
        // 拖拽过程中偶先newIndex超出newItems.length的情况,约束一下index的范围
        const nextIndex = Math.max(0, Math.min(newIndex, items.length - 1));
        const newItems = reorder(items, oldIndex, nextIndex);
        onChange && onChange(newItems);
      },
      ...rest,
    };

    this.sortable = sortableJS.create(instance, sortableOptions);
  };

  private destroySortableInstance() {
    if (this.sortable) {
      this.sortable.destroy();
      this.sortable = null;
    }
  }

  componentDidMount() {
    this.initSortable();
  }

  componentWillUnmount() {
    this.destroySortableInstance();
  }

  render() {
    const { className, children, tag, handle } = this.props;
    const classString = cx(`zent-sortable`, className, {
      'zent-sortable--handle': handle,
    });
    const Com: any = tag;
    return (
      <Com
        ref={this.containerRef}
        className={classString}
        /* ts-plugin-version-attribute ignores this element, but it may be a tr... */
        data-zv={__ZENT_VERSION__}
      >
        {children}
      </Com>
    );
  }
}

export default Sortable;


text:
from tempfile import NamedTemporaryFile
import io
import os
import subprocess

def run_code(tokens):
    code = tokens[0].strip()
    try:
        stdin = tokens[1]
    except IndexError:
        stdin = None

    script_file = NamedTemporaryFile(delete=True)

    with io.open(script_file.name, 'w', encoding='utf-8') as fp:
        fp.write(code)

    os.chmod(script_file.name, 0755)
    script_file.file.close()

    process = subprocess.Popen(
        [script_file.name],
        env={
            'LC_ALL': 'en_US.UTF-8',
        },
        stdin=subprocess.PIPE,
        stdout=subprocess.PIPE,
        stderr=subprocess.STDOUT)
    if stdin:
        process.stdin.write(stdin.encode('utf-8'))
        process.stdin.close()
    process.wait()
    stdout = process.stdout.read()

    return stdout


text:
.class public Lorg/codehaus/jackson/map/ser/std/StdContainerSerializers;
.super Ljava/lang/Object;
.source "StdContainerSerializers.java"

# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lorg/codehaus/jackson/map/ser/std/StdContainerSerializers$IteratorSerializer;,
        Lorg/codehaus/jackson/map/ser/std/StdContainerSerializers$IndexedListSerializer;
    }
.end annotation

# direct methods
.method protected constructor <init>()V
    .locals 0

    .prologue
    .line 21
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public static collectionSerializer(Lorg/codehaus/jackson/type/JavaType;ZLorg/codehaus/jackson/map/TypeSerializer;Lorg/codehaus/jackson/map/BeanProperty;Lorg/codehaus/jackson/map/JsonSerializer;)Lorg/codehaus/jackson/map/ser/std/ContainerSerializerBase;
    .locals 6
    .param p0, "elemType"    # Lorg/codehaus/jackson/type/JavaType;
    .param p1, "staticTyping"    # Z
    .param p2, "vts"    # Lorg/codehaus/jackson/map/TypeSerializer;
    .param p3, "property"    # Lorg/codehaus/jackson/map/BeanProperty;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/codehaus/jackson/type/JavaType;",
            "Z",
            "Lorg/codehaus/jackson/map/TypeSerializer;",
            "Lorg/codehaus/jackson/map/BeanProperty;",
            "Lorg/codehaus/jackson/map/JsonSerializer",
            "<",
            "Ljava/lang/Object;",
            ">;)",
            "Lorg/codehaus/jackson/map/ser/std/ContainerSerializerBase",
            "<*>;"
        }
    .end annotation

    .prologue
    .line 40
    .local p4, "valueSerializer":Lorg/codehaus/jackson/map/JsonSerializer;, "Lorg/codehaus/jackson/map/JsonSerializer<Ljava/lang/Object;>;"
    new-instance v0, Lorg/codehaus/jackson/map/ser/std/CollectionSerializer;

    move-object v1, p0

    move v2, p1

    move-object v3, p2

    move-object v4, p3

    move-object v5, p4

    invoke-direct/range {v0 .. v5}, Lorg/codehaus/jackson/map/ser/std/CollectionSerializer;-><init>(Lorg/codehaus/jackson/type/JavaType;ZLorg/codehaus/jackson/map/TypeSerializer;Lorg/codehaus/jackson/map/BeanProperty;Lorg/codehaus/jackson/map/JsonSerializer;)V

    return-object v0
.end method

.method public static enumSetSerializer(Lorg/codehaus/jackson/type/JavaType;Lorg/codehaus/jackson/map/BeanProperty;)Lorg/codehaus/jackson/map/JsonSerializer;
    .locals 1
    .param p0, "enumType"    # Lorg/codehaus/jackson/type/JavaType;
    .param p1, "property"    # Lorg/codehaus/jackson/map/BeanProperty;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/codehaus/jackson/type/JavaType;",
            "Lorg/codehaus/jackson/map/BeanProperty;",
            ")",
            "Lorg/codehaus/jackson/map/JsonSerializer",
            "<*>;"
        }
    .end annotation

    .prologue
    .line 57
    new-instance v0, Lorg/codehaus/jackson/map/ser/std/EnumSetSerializer;

    invoke-direct {v0, p0, p1}, Lorg/codehaus/jackson/map/ser/std/EnumSetSerializer;-><init>(Lorg/codehaus/jackson/type/JavaType;Lorg/codehaus/jackson/map/BeanProperty;)V

    return-object v0
.end method

.method public static indexedListSerializer(Lorg/codehaus/jackson/type/JavaType;ZLorg/codehaus/jackson/map/TypeSerializer;Lorg/codehaus/jackson/map/BeanProperty;Lorg/codehaus/jackson/map/JsonSerializer;)Lorg/codehaus/jackson/map/ser/std/ContainerSerializerBase;
    .locals 6
    .param p0, "elemType"    # Lorg/codehaus/jackson/type/JavaType;
    .param p1, "staticTyping"    # Z
    .param p2, "vts"    # Lorg/codehaus/jackson/map/TypeSerializer;
    .param p3, "property"    # Lorg/codehaus/jackson/map/BeanProperty;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/codehaus/jackson/type/JavaType;",
            "Z",
            "Lorg/codehaus/jackson/map/TypeSerializer;",
            "Lorg/codehaus/jackson/map/BeanProperty;",
            "Lorg/codehaus/jackson/map/JsonSerializer",
            "<",
            "Ljava/lang/Object;",
            ">;)",
            "Lorg/codehaus/jackson/map/ser/std/ContainerSerializerBase",
            "<*>;"
        }
    .end annotation

    .prologue
    .line 33
    .local p4, "valueSerializer":Lorg/codehaus/jackson/map/JsonSerializer;, "Lorg/codehaus/jackson/map/JsonSerializer<Ljava/lang/Object;>;"
    new-instance v0, Lorg/codehaus/jackson/map/ser/std/StdContainerSerializers$IndexedListSerializer;

    move-object v1, p0

    move v2, p1

    move-object v3, p2

    move-object v4, p3

    move-object v5, p4

    invoke-direct/range {v0 .. v5}, Lorg/codehaus/jackson/map/ser/std/StdContainerSerializers$IndexedListSerializer;-><init>(Lorg/codehaus/jackson/type/JavaType;ZLorg/codehaus/jackson/map/TypeSerializer;Lorg/codehaus/jackson/map/BeanProperty;Lorg/codehaus/jackson/map/JsonSerializer;)V

    return-object v0
.end method

.method public static iterableSerializer(Lorg/codehaus/jackson/type/JavaType;ZLorg/codehaus/jackson/map/TypeSerializer;Lorg/codehaus/jackson/map/BeanProperty;)Lorg/codehaus/jackson/map/ser/std/ContainerSerializerBase;
    .locals 1
    .param p0, "elemType"    # Lorg/codehaus/jackson/type/JavaType;
    .param p1, "staticTyping"    # Z
    .param p2, "vts"    # Lorg/codehaus/jackson/map/TypeSerializer;
    .param p3, "property"    # Lorg/codehaus/jackson/map/BeanProperty;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/codehaus/jackson/type/JavaType;",
            "Z",
            "Lorg/codehaus/jackson/map/TypeSerializer;",
            "Lorg/codehaus/jackson/map/BeanProperty;",
            ")",
            "Lorg/codehaus/jackson/map/ser/std/ContainerSerializerBase",
            "<*>;"
        }
    .end annotation

    .prologue
    .line 52
    new-instance v0, Lorg/codehaus/jackson/map/ser/std/IterableSerializer;

    invoke-direct {v0, p0, p1, p2, p3}, Lorg/codehaus/jackson/map/ser/std/IterableSerializer;-><init>(Lorg/codehaus/jackson/type/JavaType;ZLorg/codehaus/jackson/map/TypeSerializer;Lorg/codehaus/jackson/map/BeanProperty;)V

    return-object v0
.end method

.method public static iteratorSerializer(Lorg/codehaus/jackson/type/JavaType;ZLorg/codehaus/jackson/map/TypeSerializer;Lorg/codehaus/jackson/map/BeanProperty;)Lorg/codehaus/jackson/map/ser/std/ContainerSerializerBase;
    .locals 1
    .param p0, "elemType"    # Lorg/codehaus/jackson/type/JavaType;
    .param p1, "staticTyping"    # Z
    .param p2, "vts"    # Lorg/codehaus/jackson/map/TypeSerializer;
    .param p3, "property"    # Lorg/codehaus/jackson/map/BeanProperty;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/codehaus/jackson/type/JavaType;",
            "Z",
            "Lorg/codehaus/jackson/map/TypeSerializer;",
            "Lorg/codehaus/jackson/map/BeanProperty;",
            ")",
            "Lorg/codehaus/jackson/map/ser/std/ContainerSerializerBase",
            "<*>;"
        }
    .end annotation

    .prologue
    .line 46
    new-instance v0, Lorg/codehaus/jackson/map/ser/std/StdContainerSerializers$IteratorSerializer;

    invoke-direct {v0, p0, p1, p2, p3}, Lorg/codehaus/jackson/map/ser/std/StdContainerSerializers$IteratorSerializer;-><init>(Lorg/codehaus/jackson/type/JavaType;ZLorg/codehaus/jackson/map/TypeSerializer;Lorg/codehaus/jackson/map/BeanProperty;)V

    return-object v0
.end method


text:
Code snippet to create/update hash files for salt winrepo:

```powershell
$bucket = "systemprep-repo"
$key = "windows/"
$savepath = "$env:userprofile\Downloads\$bucket"

# Download the files from the s3 bucket
$s3objects = Get-S3Object -BucketName $bucket -Key $key | where { $_.Key[-1] -ne "/" }
$s3objects | % { Read-S3Object -BucketName $bucket -Key $_.Key -File "${savepath}\$(${_}.Key.replace('/','\'))" }

# hash strings to match against
$hash_match = "md5$|sha512$|sha384$|sha256$|sha1$"

# Generate hashes for all files
$orig_files = Get-Item -Path "${savepath}\$(${key}.replace('/','\'))" | Get-ChildItem -Recurse -File
$hashes = $orig_files | Where { $_.Name -notmatch $hash_match } | Get-FileHash -Algorithm SHA512

# Write hashes to the same directory as the file
$hashes | % { "$($_.Hash.ToLower()) $($_.Path.Split('\')[-1])" | Set-Content "$($_.Path).$($_.Algorithm)" }

# Upload hash files to the s3 bucket
$hash_files = Get-Item -Path "${savepath}\$(${key}.replace('/','\'))" | Get-ChildItem -Recurse -File | where { $_.Name -match $hash_match }
$hash_files | % { Write-S3Object -BucketName $bucket -Key $($_.FullName.SubString(($savepath).length).Replace('\','/').TrimStart('/')) -File $_.FullName }
```


text:
package com.mogoo.market.ui;

import java.util.ArrayList;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.InputType;
import android.util.Log;
import android.view.GestureDetector;
import android.view.GestureDetector.OnGestureListener;
import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;

import android.view.View.OnFocusChangeListener;
import android.view.View.OnTouchListener;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.ViewFlipper;

import com.mogoo.market.R;

import com.mogoo.market.model.HotKeyInfo;
import com.mogoo.market.model.HotKeyInfoListReq;
import com.mogoo.market.model.onRequestCallBack;
import com.mogoo.market.uicomponent.MyToast;
import com.mogoo.market.utils.ToolsUtils;
import com.mogoo.market.widget.KeywordsFlow;
import com.mogoo.market.widget.SearchBar;
import com.mogoo.parser.Result;

/**
 * 搜索
 */
public class SearchActivity extends BaseLoadableListActivityWithViewAndHeader implements OnTouchListener,
OnGestureListener
{

    private View noDateView;

	/**蒙板层**/
	private ImageView mMaskLayer;

    private SearchBar mSearchBar;
    private KeywordsFlow keywordsFlow;
    private ViewFlipper  mViewFilpper;
	//手势检测
	private GestureDetector mGestureDetector;
	//滑动像素 ,大于这个值的时候才滑动
	private final int SliderPixD = 500;
	//当前页
	private int currentIndex =1;
	//获得 推荐组建TextView 集合
 	//测试代码
	private  static ArrayList<HotKeyInfo> keywords=new ArrayList();

	private Context mContext;

    private String keyword = "";

	private View mMarket_center_lay;
	private View mMarket_top_lay;

	@Override
	protected void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		this.mContext=this;

		loadData();
		init();
		MyToast.makeText(this,
				getResources().getText(R.string.search_tip_text),
				Toast.LENGTH_LONG).show();
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
	}

	@Override
	public boolean onTouchEvent(MotionEvent event) {
		// TODO Auto-generated method stub

		//return super.onTouchEvent(event);
		return mGestureDetector.onTouchEvent(event);
	}

	public void init()
	{
		mMarket_top_lay=LayoutInflater.from(this).inflate(R.layout.top_cate, null);
	 	noDateView=new TextView(this);
		((TextView) noDateView).setText(this.getResources().getString(R.string.nodata));

		mGestureDetector = new GestureDetector(this);

 		mSearchBar = (SearchBar)mMarket_top_lay.findViewById(R.id.SearchBar);

 		setAnimListener();
	}

	/**
	 * 添加动画界面的事件
	 * */

	public void setAnimListener(){

		mMarket_center_lay=LayoutInflater.from(this).inflate(R.layout.search_activity, null);
 		keywordsFlow = (KeywordsFlow)mMarket_center_lay.findViewById(R.id.keywordsFlow);
 		keywordsFlow.setVisibility(View.VISIBLE);
 		mViewFilpper =(ViewFlipper)mMarket_center_lay.findViewById(R.id.search_viewflipper);
		mMaskLayer = (ImageView)mMarket_center_lay.findViewById(R.id.maskLayer);

		mSearchBar.mEditText.clearFocus();
		mSearchBar.mEditText.setText(keyword);
	//   mSearchBar.mEditText.setOnFocusChangeListener(mEditFoucListener);
		mMaskLayer.setOnClickListener(mEventListner);

		mSearchBar.mSearBtn.setOnClickListener(mEventListner);

		keywordsFlow.setDuration(800l);
	    keywordsFlow.setOnItemClickListener(mEventListner);

	    getBaseCenterLayout().setVisibility(View.VISIBLE);
		setBaseCenterLayout(mMarket_center_lay);

		getBaseHeaderLayout().setVisibility(View.VISIBLE);
		setBaseTopLayout(mMarket_top_lay);
	}

	/**
	 * 加载数据
	 * @param url--请求地址
	 * @param requestType --0:post,1:get
	 * @param params --请求参数
	 * @return
	 */
	private void loadData()
	{
		HotKeyInfoListReq.onGetHotKey(this, new onRequestCallBack(){

			@Override
			public void onFail(Result result) {
				// TODO Auto-generated method stub
				Log.d("keywords", "keywords===========false========================================"+keywords);
			}

			@Override
			public void onSuccess(Result result) {
				// TODO Auto-generated method stub
				keywords=(ArrayList<HotKeyInfo>) result.getData();

				feedkeywordsFlow(keywordsFlow,keywords);
				keywordsFlow.go2Show(KeywordsFlow.ANIMATION_IN);
				Log.d("keyworws", "keywords==================================================="+keywords);
			}

		});

	}

	private android.view.View.OnClickListener mEventListner = new android.view.View.OnClickListener()
    {

		public void onClick(View v) {

	        if(v.getId()==R.id.search_btn){
                        hiddenInput(mSearchBar.mEditText);
	        	keyword = mSearchBar.mEditText.getText().toString().trim();

	        }
	        else if(v instanceof TextView)
			{
				keyword = ((TextView) v).getText().toString();
                mSearchBar.mEditText.setText(keyword);
			}
	        if(keyword==null||keyword.equals("")){
				MyToast.makeText(mContext, R.string.key_words_tip, MyToast.LENGTH_SHORT).show();
				return;
			}
	        Intent childintent = new Intent();
	        childintent.putExtra("keyword", keyword);
	        childintent.setClass(mContext, SearchKeywordListActivity.class);
			MarketGroupActivity mga = MarketGroupActivity.getInstance();
			childintent.putExtra(MarketGroupActivity.EXTRA_BACK_INTENT, mga.getNowTabIntent());
			mga.setupTabChildView(childintent);
			mga.setupTabIntent(MarketGroupActivity.getCurrentTab(),childintent);
		}

	};

	@Override
	public void finish() {
		// TODO Auto-generated method stub
		super.finish();
	}

	/**隐藏软键盘*/
	public void hiddenInput(EditText t){

		InputMethodManager imm=(InputMethodManager)getSystemService(INPUT_METHOD_SERVICE);
		if(SearchActivity.this.getCurrentFocus()!=null)
                imm.hideSoftInputFromWindow(SearchActivity.this.getCurrentFocus().getWindowToken(),InputMethodManager.HIDE_NOT_ALWAYS);
	}

    /** 搜索框的 FocusChangeListener */
    private OnFocusChangeListener mEditFoucListener = new OnFocusChangeListener()
    {
    	public void onFocusChange(View view, boolean hasFocse)
        {
    		mSearchBar.mEditText.setInputType(InputType.TYPE_NULL);

            if(hasFocse)
            {
               // mMaskLayer.setVisibility(View.VISIBLE);

            }
        }
    };

	/**---- 按下事件,获得推荐字符串对应的keyword----**/
	@Override
	public boolean onDown(MotionEvent e) {
		// TODO Auto-generated method stub

		return true;
	}

	/**---- 左右切换响应的事件 ----**/
	@Override
	public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,
			float velocityY) {
		//keywords 为空不处理滑动事件
	    if(keywords == null || keywords.size() < 1){
	        return false;
	    }

		if( velocityX < SliderPixD )
		{
			HandleNext();
			return true;
		}
		else if ( velocityX > SliderPixD )
		{
			HandlePre();
			return true;
		}

		return false;
	}

	/**---- 处理上一页 左 ----**/
	private void HandlePre()
	{
		if(keywordsFlow.MAX * currentIndex >= keywords.size()){
			currentIndex=1;
		}else{
			currentIndex++;
		}
		gotoPage(KeywordsFlow.ANIMATION_OUT);
	}

	/**---- 处理下一页 右 ----**/
	private void HandleNext()
	{
	    if(currentIndex==1){
	        currentIndex=(int) Math.ceil(((double) keywords.size())/keywordsFlow.MAX);
	    }else{
	        currentIndex--;
	    }
		gotoPage(KeywordsFlow.ANIMATION_IN);
	}

	private void gotoPage(int type)
	{
		//清空数组,然后联网拉取最新的字符串
	    keywordsFlow.rubKeywords();
		feedkeywordsFlow(keywordsFlow,keywords);
		keywordsFlow.go2Show(type);
	}

	/**
	 * 随机生成12个不重复的数,找出对应的字符串
	 * @param keywordsFlow
	 * @param arr
	 */
    private void feedkeywordsFlow(KeywordsFlow keywordsFlow,ArrayList<HotKeyInfo> arr)
    {
    	int size = keywordsFlow.MAX * currentIndex;
    	size = arr.size()>=size? size:arr.size();
    	for(int i=keywordsFlow.MAX * (currentIndex - 1); i < size; i++)
    	{
    		HotKeyInfo key=arr.get(i);
    		String tmp = key.getName();
    		keywordsFlow.feedKeyword(tmp);
    	}
    }

	@Override
	public void onLongPress(MotionEvent e) {
		// TODO Auto-generated method stub

	}

	@Override
	public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX,
			float distanceY) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public void onShowPress(MotionEvent e) {
		// TODO Auto-generated method stub

	}

	@Override
	public boolean onSingleTapUp(MotionEvent e) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean onTouch(View v, MotionEvent event) {
		// TODO Auto-generated method stub
		return mGestureDetector.onTouchEvent(event);
	}

	private long exitTime = 0;

	@Override
	public boolean onKeyDown(int keyCode, KeyEvent event) {
		// TODO Auto-generated method stub
		if(keyCode == KeyEvent.KEYCODE_BACK && event.getAction() == KeyEvent.ACTION_DOWN) {
			if((System.currentTimeMillis() - exitTime) > 5000) {
				ToolsUtils.showExitToast(getApplicationContext());
				exitTime = System.currentTimeMillis();
//                feedkeywordsFlow(keywordsFlow,keywords);
//				keywordsFlow.go2Show(KeywordsFlow.ANIMATION_IN);
//		        getBaseCenterLayout().setVisibility(View.VISIBLE);
//		 		setBaseCenterLayout(mMarket_center_lay);
			}else {
				Intent intent = new Intent(SearchActivity.this, MarketGroupActivity.class);
				intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
				intent.putExtra(MarketGroupActivity.EXTRA_FINISH_SELF, true);
				startActivity(intent);
			}
			return true;
		}
		return false;

	}
}


text:
#include "debug.h"
#include "Efipart.h"
#include "EfiShellLib.h"

#include STRING_DEFINES_FILE

typedef union {
  FAT_BOOT_SECTOR     Fat;
  FAT_BOOT_SECTOR_EX  Fat32;
} EFI_FAT_BOOT_SECTOR;

FAT_VOLUME_TYPE
ValidBPB (
  IN  EFI_FAT_BOOT_SECTOR *Bpb,
  IN  UINTN               BlockSize
  );

VOID
DumpBpb (
  IN  FAT_VOLUME_TYPE     FatType,
  IN  EFI_FAT_BOOT_SECTOR *Bpb,
  IN  UINTN               BlockSize
  );

typedef union {
  VOID                  *RawData;
  UINT8                 *PtrMath;
  EFI_TABLE_HEADER      *Hdr;
  EFI_PARTITION_HEADER  *Partition;
  EFI_SYSTEM_TABLE      *Sys;
  EFI_RUNTIME_SERVICES  *RT;
  EFI_BOOT_SERVICES     *BS;
} EFI_TABLE_HEADER_PTR;

VOID
EFIFileAttributePrint (
  IN UINT64 Attrib
  );

CHAR16  *
EFIClassString (
  IN  UINT32  Class
  );

BOOLEAN
IsValidEfiHeader (
  IN  UINTN                 BlockSize,
  IN  EFI_TABLE_HEADER_PTR  Hdr
  );

VOID
EFITableHeaderPrint (
  IN  VOID      *Buffer,
  IN  UINTN     ByteSize,
  IN  UINT64    BlockAddress,
  IN  BOOLEAN   IsBlkDevice
  );

VOID
DumpGenericHeader (
  IN  EFI_TABLE_HEADER_PTR  Tbl
  );

VOID
DumpPartition (
  IN  EFI_TABLE_HEADER_PTR  Tbl
  );

VOID
DumpFileHeader (
  IN  EFI_TABLE_HEADER_PTR  Tbl
  );

VOID
DumpSystemTable (
  IN  EFI_TABLE_HEADER_PTR  Tbl
  );

VOID
EFIStructsPrint (
  IN  VOID                    *Buffer,
  IN  UINTN                   BlockSize,
  IN  UINT64                  BlockAddress,
  IN  EFI_BLOCK_IO_PROTOCOL   *BlkIo
  )
{
  MASTER_BOOT_RECORD  *Mbr;
  INTN                Index;
  BOOLEAN             IsBlkDevice;
  FAT_VOLUME_TYPE     FatType;

  Print (L"\n");
  Mbr = NULL;
  if (BlockAddress == 0 && BlkIo != NULL) {
    Mbr = (MASTER_BOOT_RECORD *) Buffer;
    if (ValidMBR (Mbr, BlkIo)) {
      PrintToken (STRING_TOKEN (STR_DEBUG_VALID_MBR), HiiDmemHandle);
      for (Index = 0; Index < MAX_MBR_PARTITIONS; Index++) {

        PrintToken (
          STRING_TOKEN (STR_DEBUG_PARTITION_START),
          HiiDmemHandle,
          Index,
          Mbr->Partition[Index].OSIndicator,
          EXTRACT_UINT32 (Mbr->Partition[Index].StartingLBA),
          EXTRACT_UINT32 (Mbr->Partition[Index].SizeInLBA)
          );
      }
    } else {
      FatType = ValidBPB ((EFI_FAT_BOOT_SECTOR *) Buffer, BlockSize);
      if (FatType != FatUndefined) {
        DumpBpb (FatType, (EFI_FAT_BOOT_SECTOR *) Buffer, BlockSize);
      }
    }
  }

  if (!Mbr) {
    IsBlkDevice = (BOOLEAN) (BlkIo != NULL);
    EFITableHeaderPrint (Buffer, BlockSize, BlockAddress, IsBlkDevice);
  }
}

typedef
VOID
(*EFI_DUMP_HEADER) (
  IN  EFI_TABLE_HEADER_PTR  Tbl
  );

typedef struct {
  UINT64          Signature;
  CHAR16          *String;
  EFI_DUMP_HEADER Func;
} TABLE_HEADER_INFO;

TABLE_HEADER_INFO DmemTableHeader[] = {
  EFI_PARTITION_SIGNATURE,
  L"Partition",
  DumpPartition,
  EFI_SYSTEM_TABLE_SIGNATURE,
  L"System",
  DumpSystemTable,
  EFI_BOOT_SERVICES_SIGNATURE,
  L"Boot Services",
  DumpGenericHeader,
  EFI_RUNTIME_SERVICES_SIGNATURE,
  L"Runtime Services",
  DumpGenericHeader,
  0x00,
  L"",
  DumpGenericHeader
};

static UINT8   FatNumber[] = { 12, 16, 32, 0 };

VOID
EFITableHeaderPrint (
  IN  VOID      *Buffer,
  IN  UINTN     ByteSize,
  IN  UINT64    BlockAddress,
  IN  BOOLEAN   IsBlkDevice
  )
{
  EFI_TABLE_HEADER_PTR  Hdr;
  INTN                  Index;

  Hdr.RawData = Buffer;
  if (IsValidEfiHeader (ByteSize, Hdr)) {
    for (Index = 0; DmemTableHeader[Index].Signature != 0x00; Index++) {

      if (DmemTableHeader[Index].Signature == Hdr.Hdr->Signature) {
        PrintToken (
          STRING_TOKEN (STR_DEBUG_VALID_EFI_HEADER),
          HiiDmemHandle,
          (IsBlkDevice ? "LBA" : "Address"),
          BlockAddress,
          (IsBlkDevice ? "" : "----")
          );
        PrintToken (
          STRING_TOKEN (STR_DEBUG_TABLE_STRUCT),
          HiiDmemHandle,
          DmemTableHeader[Index].String,
          Hdr.Hdr->HeaderSize,
          Hdr.Hdr->Revision
          );
        DmemTableHeader[Index].Func (Hdr);
        return ;
      }
    }
    //
    // Dump the Generic Header, since we don't know the type
    //
    DmemTableHeader[Index].Func (Hdr);
  }
}

BOOLEAN
IsValidEfiHeader (
  IN  UINTN                 BlockSize,
  IN  EFI_TABLE_HEADER_PTR  Hdr
  )
{
  if ((UINTN) Hdr.RawData > (UINTN) ((UINT8 *) Hdr.RawData + BlockSize)) {
    return FALSE;
  }

  if (Hdr.Hdr == NULL) {
    return FALSE;
  }
  //
  // Check buffer alignment to solve native alignment issue on IA-64 processor
  //
  if ((((UINTN) Hdr.RawData) & 0x07) != 0) {
    return FALSE;
  }

  if (Hdr.Hdr->HeaderSize == 0x00) {
    return FALSE;
  }

  if (Hdr.Hdr->HeaderSize > BlockSize) {
    return FALSE;
  }

  return TRUE;
}

VOID
DumpGenericHeader (
  IN  EFI_TABLE_HEADER_PTR  Tbl
  )
{
  PrintToken (
    STRING_TOKEN (STR_DEBUG_HEADER_REV),
    HiiDmemHandle,
    Tbl.Hdr->Signature,
    Tbl.Hdr->Revision,
    Tbl.Hdr->HeaderSize,
    Tbl.Hdr->CRC32
    );
}

VOID
DumpPartition (
  IN  EFI_TABLE_HEADER_PTR  Tbl
  )
{
  PrintToken (
    STRING_TOKEN (STR_DEBUG_LBA_UNUSABLE),
    HiiDmemHandle,
    Tbl.Partition->FirstUsableLba,
    Tbl.Partition->LastUsableLba,
    Tbl.Partition->UnusableSpace
    );
  PrintToken (
    STRING_TOKEN (STR_DEBUG_FREE_SPACE),
    HiiDmemHandle,
    Tbl.Partition->FreeSpace,
    Tbl.Partition->RootFile
    );
  PrintToken (
    STRING_TOKEN (STR_DEBUG_BLOCK_SIZE),
    HiiDmemHandle,
    Tbl.Partition->BlockSize,
    Tbl.Partition->DirectoryAllocationNumber
    );
}

CHAR16 *
EFIClassString (
  IN  UINT32  Class
  )
{
  switch (Class) {
  case EFI_FILE_CLASS_FREE_SPACE:
    return L"Free Space";

  case EFI_FILE_CLASS_EMPTY:
    return L"Empty";

  case EFI_FILE_CLASS_NORMAL:
    return L"Normal";

  default:
    return L"Invalid";
  }
}

VOID
DumpSystemTable (
  IN  EFI_TABLE_HEADER_PTR  Tbl
  )
{
  EFI_STATUS                Status;
  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;
  VOID                      *AcpiTable;
  VOID                      *Acpi20Table;
  VOID                      *SMBIOSTable;
  VOID                      *SalSystemTable;
  VOID                      *MpsTable;

  AcpiTable       = NULL;
  Acpi20Table     = NULL;
  SMBIOSTable     = NULL;
  SalSystemTable  = NULL;
  MpsTable        = NULL;

  PrintToken (
    STRING_TOKEN (STR_DEBUG_CONIN_CONOUT),
    HiiDmemHandle,
    Tbl.Sys->ConsoleInHandle,
    Tbl.Sys->ConsoleOutHandle,
    Tbl.Sys->StandardErrorHandle
    );

  Status = BS->HandleProtocol (Tbl.Sys->ConsoleInHandle, &gEfiDevicePathProtocolGuid, (VOID *) &DevicePath);
  if (!EFI_ERROR (Status) && DevicePath) {
    PrintToken (STRING_TOKEN (STR_DEBUG_CONSOLE_IN_ON), HiiDmemHandle, LibDevicePathToStr (DevicePath));
  }

  Status = BS->HandleProtocol (Tbl.Sys->ConsoleOutHandle, &gEfiDevicePathProtocolGuid, (VOID *) &DevicePath);
  if (!EFI_ERROR (Status) && DevicePath) {
    PrintToken (STRING_TOKEN (STR_DEBUG_CONSOLE_OUT_ON), HiiDmemHandle, LibDevicePathToStr (DevicePath));
  }

  Status = BS->HandleProtocol (Tbl.Sys->StandardErrorHandle, &gEfiDevicePathProtocolGuid, (VOID *) &DevicePath);
  if (!EFI_ERROR (Status) && DevicePath) {
    PrintToken (STRING_TOKEN (STR_DEBUG_STD_ERROR_ON), HiiDmemHandle, LibDevicePathToStr (DevicePath));
  }

  PrintToken (STRING_TOKEN (STR_DEBUG_RUNTIME_SERVICES), HiiDmemHandle, (UINT64) Tbl.Sys->RuntimeServices);
  PrintToken (STRING_TOKEN (STR_DEBUG_BOOT_SERVICES), HiiDmemHandle, (UINT64) Tbl.Sys->BootServices);

  EFI64_CODE (
    Status = LibGetSystemConfigurationTable(&gEfiSalSystemTableGuid, &SalSystemTable);
    if (!EFI_ERROR(Status)) {
      PrintToken (STRING_TOKEN(STR_DEBUG_SAL_SYSTEM_TABLE), HiiDmemHandle, (UINT64)SalSystemTable);
    }
  )

  Status = LibGetSystemConfigurationTable (&gEfiAcpiTableGuid, &AcpiTable);
  if (!EFI_ERROR (Status)) {
    PrintToken (STRING_TOKEN (STR_DEBUG_ACPI_TABLE), HiiDmemHandle, (UINT64) AcpiTable);
  }

  Status = LibGetSystemConfigurationTable (&gEfiAcpi20TableGuid, &Acpi20Table);
  if (!EFI_ERROR (Status)) {
    PrintToken (STRING_TOKEN (STR_DEBUG_APCI_2_TABLE), HiiDmemHandle, (UINT64) Acpi20Table);
  }

  Status = LibGetSystemConfigurationTable (&gEfiMpsTableGuid, &MpsTable);
  if (!EFI_ERROR (Status)) {
    PrintToken (STRING_TOKEN (STR_DEBUG_MPS_TABLE), HiiDmemHandle, (UINT64) MpsTable);
  }

  Status = LibGetSystemConfigurationTable (&gEfiSmbiosTableGuid, &SMBIOSTable);
  if (!EFI_ERROR (Status)) {
    PrintToken (STRING_TOKEN (STR_DEBUG_SMBIOS_TABLE), HiiDmemHandle, (UINT64) SMBIOSTable);
  }
}

FAT_VOLUME_TYPE
ValidBPB (
  IN  EFI_FAT_BOOT_SECTOR *Bpb,
  IN  UINTN               BlockSize
  )
{
  UINT32          BlockSize32;
  BOOLEAN         IsFat;
  UINT32          RootSize;
  UINT32          RootLba;
  UINT32          FirstClusterLba;
  UINT32          MaxCluster;
  UINT32          Sectors;
  FAT_VOLUME_TYPE FatType;

  BlockSize32 = (UINT32) BlockSize;

  if (Bpb->Fat.SectorsPerFat == 0) {
    FatType = FAT32;
  } else {
    FatType = FatUndefined;
  }

  IsFat = TRUE;
  if (Bpb->Fat.Ia32Jump[0] != 0xe9 && Bpb->Fat.Ia32Jump[0] != 0xeb && Bpb->Fat.Ia32Jump[0] != 0x49) {
    IsFat = FALSE;
  }

  Sectors = (Bpb->Fat.Sectors == 0) ? Bpb->Fat.LargeSectors : Bpb->Fat.Sectors;

  if (Bpb->Fat.SectorSize != BlockSize32 || Bpb->Fat.ReservedSectors == 0 || Bpb->Fat.NoFats == 0 || Sectors == 0) {
    IsFat = FALSE;
  }

  if (Bpb->Fat.SectorsPerCluster != 1 &&
      Bpb->Fat.SectorsPerCluster != 2 &&
      Bpb->Fat.SectorsPerCluster != 4 &&
      Bpb->Fat.SectorsPerCluster != 8 &&
      Bpb->Fat.SectorsPerCluster != 16 &&
      Bpb->Fat.SectorsPerCluster != 32 &&
      Bpb->Fat.SectorsPerCluster != 64 &&
      Bpb->Fat.SectorsPerCluster != 128
      ) {
    IsFat = FALSE;
  }

  if (FatType == FAT32 && (Bpb->Fat32.LargeSectorsPerFat == 0 || Bpb->Fat32.FsVersion != 0)) {
    IsFat = FALSE;
  }

  if (Bpb->Fat.Media != 0xf0 &&
      Bpb->Fat.Media != 0xf8 &&
      Bpb->Fat.Media != 0xf9 &&
      Bpb->Fat.Media != 0xfb &&
      Bpb->Fat.Media != 0xfc &&
      Bpb->Fat.Media != 0xfd &&
      Bpb->Fat.Media != 0xfe &&
      Bpb->Fat.Media != 0xff &&
      //
      // FujitsuFMR
      //
      Bpb->Fat.Media != 0x00 &&
      Bpb->Fat.Media != 0x01 &&
      Bpb->Fat.Media != 0xfa
      ) {
    IsFat = FALSE;
  }

  if (FatType != FAT32 && Bpb->Fat.RootEntries == 0) {
    IsFat = FALSE;
  }
  //
  // If this is fat32, refuse to mount mirror-disabled volumes
  //
  if (FatType == FAT32 && (Bpb->Fat32.ExtendedFlags & 0x80)) {
    IsFat = FALSE;
  }

  if (FatType != FAT32 && IsFat) {
    RootSize        = Bpb->Fat.RootEntries * sizeof (FAT_DIRECTORY_ENTRY);
    RootLba         = Bpb->Fat.NoFats * Bpb->Fat.SectorsPerFat + Bpb->Fat.ReservedSectors;
    FirstClusterLba = RootLba + (RootSize / Bpb->Fat.SectorSize);
    MaxCluster      = (Bpb->Fat.Sectors - FirstClusterLba) / Bpb->Fat.SectorsPerCluster;
    FatType         = (MaxCluster + 1) < 4087 ? FAT12 : FAT16;
  }

  return IsFat ? FatType : FatUndefined;
}

VOID
DumpBpb (
  IN  FAT_VOLUME_TYPE     FatType,
  IN  EFI_FAT_BOOT_SECTOR *Bpb,
  IN  UINTN               BlockSize
  )
{
  UINT32  Sectors;

  Sectors             = (Bpb->Fat.Sectors == 0) ? Bpb->Fat.LargeSectors : Bpb->Fat.Sectors;

  PrintToken (STRING_TOKEN (STR_DEBUG_FAT_BPB), HiiDmemHandle, FatNumber[FatType]);
  if (FatType == FAT32) {
    PrintToken (
      STRING_TOKEN (STR_DEBUG_FATLABEL),
      HiiDmemHandle,
      sizeof (Bpb->Fat32.FatLabel),
      Bpb->Fat32.FatLabel,
      sizeof (Bpb->Fat32.SystemId),
      Bpb->Fat32.SystemId,
      sizeof (Bpb->Fat32.OemId),
      Bpb->Fat32.OemId
      );
  } else {
    PrintToken (
      STRING_TOKEN (STR_DEBUG_FATLABEL_SYSTEMID),
      HiiDmemHandle,
      sizeof (Bpb->Fat.FatLabel),
      Bpb->Fat.FatLabel,
      sizeof (Bpb->Fat.SystemId),
      Bpb->Fat.SystemId,
      sizeof (Bpb->Fat.OemId),
      Bpb->Fat.OemId
      );
  }

  PrintToken (STRING_TOKEN (STR_DEBUG_SECTORSIZE), HiiDmemHandle, Bpb->Fat.SectorSize, Bpb->Fat.SectorsPerCluster);
  PrintToken (
    STRING_TOKEN (STR_DEBUG_RES_SECTORS),
    HiiDmemHandle,
    Bpb->Fat.ReservedSectors,
    Bpb->Fat.NoFats,
    Bpb->Fat.RootEntries,
    Bpb->Fat.Media
    );
  if (FatType == FAT32) {
    PrintToken (STRING_TOKEN (STR_DEBUG_SECTORS), HiiDmemHandle, Sectors, Bpb->Fat32.LargeSectorsPerFat);
  } else {
    PrintToken (STRING_TOKEN (STR_DEBUG_SECTORS), HiiDmemHandle, Sectors, Bpb->Fat.SectorsPerFat);
  }

  PrintToken (STRING_TOKEN (STR_DEBUG_SECTORSPERTRACK), HiiDmemHandle, Bpb->Fat.SectorsPerTrack, Bpb->Fat.Heads);

}


text:
namespace VistaMedTools
{
    partial class FileOrDirSelect
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Component Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.label1 = new System.Windows.Forms.Label();
            this.textBox1 = new System.Windows.Forms.TextBox();
            this.button1 = new System.Windows.Forms.Button();
            this.openFileDialog = new System.Windows.Forms.OpenFileDialog();
            this.folderBrowserDialog = new System.Windows.Forms.FolderBrowserDialog();
            this.SuspendLayout();
            //
            // label1
            //
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(-3, 0);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(36, 13);
            this.label1.TabIndex = 0;
            this.label1.Text = "Файл";
            //
            // textBox1
            //
            this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.textBox1.Location = new System.Drawing.Point(0, 17);
            this.textBox1.Name = "textBox1";
            this.textBox1.Size = new System.Drawing.Size(217, 20);
            this.textBox1.TabIndex = 1;
            this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged);
            //
            // button1
            //
            this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
            this.button1.Image = global::VistaMedTools.Properties.Resources.open;
            this.button1.Location = new System.Drawing.Point(223, 15);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(31, 23);
            this.button1.TabIndex = 2;
            this.button1.UseVisualStyleBackColor = true;
            this.button1.Click += new System.EventHandler(this.button1_Click);
            //
            // openFileDialog
            //
            this.openFileDialog.Filter = "*.xls;*.xlsx|*.xls;*.xlsx";
            this.openFileDialog.Title = " ";
            //
            // FileOrDirSelect
            //
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.Controls.Add(this.button1);
            this.Controls.Add(this.textBox1);
            this.Controls.Add(this.label1);
            this.Name = "FileOrDirSelect";
            this.Size = new System.Drawing.Size(257, 46);
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.TextBox textBox1;
        private System.Windows.Forms.Button button1;
        private System.Windows.Forms.OpenFileDialog openFileDialog;
        private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog;
    }
}


text:
class ThreadSafeMessaging;

// =======================================================================================
//                                      ProcessMessagesSystem
// =======================================================================================

///---------------------------------------------------------------------------------------
/// \brief	Brief description...
///
/// # ProcessMessagesSystem
/// Detailed description...
/// Created on: 7-12-2012
///---------------------------------------------------------------------------------------

class ProcessingMessagesSystem: public EntitySystem
{
public:
	ProcessingMessagesSystem( ThreadSafeMessaging* p_messageProcesser );
	~ProcessingMessagesSystem();

	void process();

	void initialize();

private:
	ThreadSafeMessaging* m_messageProcesser;

};


text:
#import <Foundation/NSObject.h>
#import <Onyx2D/O2Image.h>

@class O2ImageSource;

typedef O2ImageSource *O2ImageSourceRef;

@class NSData,NSDictionary,NSURL,O2Image,O2DataProvider;

extern NSString *kO2ImagePropertyDPIWidth;
extern NSString *kO2ImagePropertyDPIHeight;

@interface O2ImageSource : NSObject {
   O2DataProvider *_provider;
   NSDictionary   *_options;
}

+(O2ImageSourceRef)newImageSourceWithDataProvider:(O2DataProvider *)provider options:(CFDictionaryRef)options;
+(O2ImageSourceRef)newImageSourceWithData:(CFDataRef)data options:(CFDictionaryRef)options;
+(O2ImageSourceRef)newImageSourceWithURL:(NSURL *)url options:(CFDictionaryRef)options;

+(BOOL)isPresentInDataProvider:(O2DataProvider *)provider;

-initWithDataProvider:(O2DataProvider *)provider options:(NSDictionary *)options;

-(unsigned)count;

-(CFDictionaryRef)copyPropertiesAtIndex:(unsigned)index options:(CFDictionaryRef)options;
-(O2ImageRef)createImageAtIndex:(unsigned)index options:(CFDictionaryRef)options;

O2ImageRef O2ImageSourceCreateImageAtIndex(O2ImageSourceRef self,size_t index,CFDictionaryRef options);

@end


text:
package com.monkeyhand.security.model.json;

public class AuthenticationRequest {

	private String username;
	private String password;

	public AuthenticationRequest() {

	}

	public AuthenticationRequest(String username, String password) {
		this.username = username;
		this.password = password;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}
}


text:
using Newtonsoft.Json;
using System.Globalization;

namespace WGSharpAPI
{
    public class Meta
    {
        [JsonProperty("count")]
        public int Count { get; set; }

        public override string ToString()
        {
            return string.Format(CultureInfo.InvariantCulture, "Count = {0}", Count);
        }
    }
}


text:
__Description__: If the `reset` option is passed it should reset the result set

__Notes__

+ `getLastResult(reset = false, raw = false)`
+ `getLastResult({reset, raw})`
+ The `reset` option in `getLastResult` works a bit diffrant than that of `getRes`. The `reset` removes the set in question from the results not the complete results like `getRes` `reset` does


text:
define([
    'underscore',
    'jquery',
    'react',
    'kendo',
    './KendoGrid'
], function (_, $, React, kendo, KendoGrid) {
    'use strict';

    var PropTypes = React.PropTypes;

    var KendoGridPickerTemplate = '
<input id="#: uid #" type="checkbox" value="#: id #" name="checkboxSelector">
';

    function enableCheckboxSelection(grid) {
        grid.selectable.userEvents.notify = function (eventName, data) {
            // Make all "tap/click" events seem like they have the ctrlKey pressed, which gives a checkbox-style UX
            if (eventName === 'tap') {
                data.event.ctrlKey = true;
            }
            this.trigger(eventName, data);
        };
    }

    var KendoGridPicker = React.createClass({

        propTypes: {
            columns: PropTypes.array.isRequired,
            value: PropTypes.array,
            onChange: PropTypes.func
        },

        getDefaultProps: function () {
            return {
                autoBind: true,
                editable: false,
                pageable: false,
                height: 250,
                onChange: $.noop,
                value: []  // list of selected records, just like combo.
            };
        },

        render: function () {
            var columns = [{ title: '', template: kendo.template(KendoGridPickerTemplate), width: 34 }].concat(this.props.columns);

            return this.transferPropsTo(KendoGrid({ columns: columns, selectable: 'multiple, row', onChange: this.onGridChange }));
        },

        componentDidMount: function () {
            var grid = $(this.getDOMNode()).data('kendoGrid');

            // The standard kendo grid multiple selection UI requires holding the Control key to select multiple rows.
            // Change the behavior to allow individual clicks to toggle the row's selection state.
            enableCheckboxSelection(grid);

            this.updateCheckboxValues();
            grid.bind('dataBound', this.updateCheckboxValues);
        },

        componentDidUpdate: function () {
            this.updateCheckboxValues();
        },

        updateCheckboxValues: function () {
            // the SSP page has changed, so we have new DOM.
            // Sync up the DOM with the checked state.
            var $rootNode = $(this.getDOMNode());
            var valueIDs = _.pluck(this.props.value, 'id');

            // Update the checked state of checkbox inputs
            $rootNode.find('input[type="checkbox"]').val(valueIDs);
        },

        onGridChange: function (selectedValues) {
            var grid = $(this.getDOMNode()).data('kendoGrid');

            // The `selectedValues` represents the selection for the current page of results. We need to merge those values
            // with existing values on separate pages.
            var modelsOnThisPage = grid.dataSource.view().map(function (model) {
                return model.id;
            });
            var valuesOnOtherPages = this.props.value.filter(function (dataItem) {
                return modelsOnThisPage.indexOf(dataItem.id) === -1;
            });

            selectedValues = selectedValues.map(function (model) {
                return model.toJSON();
            }).concat(valuesOnOtherPages);

            this.props.onChange(selectedValues);
        }
    });

    return KendoGridPicker;
});


text:
/**
 * @author Viacheslav G. Rybalov
 */
#include <string.h>
#include "ArrayType.h"
#include "PacketParser.h"
#include "ClassManager.h"

using namespace jdwp;
using namespace ArrayType;

void
ArrayType::NewInstanceHandler::Execute(JNIEnv *jni) throw(AgentException)
{
    jclass cls = m_cmdParser->command.ReadReferenceTypeID(jni);
    jint length = m_cmdParser->command.ReadInt();

    JDWP_ASSERT(cls != 0);
    char* signature = 0;
    jvmtiError err;
    JVMTI_TRACE(err, GetJvmtiEnv()->GetClassSignature(cls, &signature, 0));
    JvmtiAutoFree afv1(signature);
    if (err != JVMTI_ERROR_NONE) {
        throw AgentException(err);
    }

    JDWP_TRACE_DATA("NewInstance: received: refTypeID=" << cls
        << ", length=" << length
        << ", signature=" << JDWP_CHECK_NULL(signature));

    if ((signature == 0) || (strlen(signature) < 2)) {
        throw AgentException(JDWP_ERROR_INVALID_OBJECT);
    }
    if(signature[0] != '[') {
        throw AgentException(JDWP_ERROR_INVALID_ARRAY);
    }

    jarray arr = 0;
    switch (signature[1]) {
        case 'Z': {
            JDWP_TRACE_DATA("NewInstance: new boolean array");
            arr = jni->NewBooleanArray(length);
            break;
        }
        case 'B': {
            JDWP_TRACE_DATA("NewInstance: new byte array");
            arr = jni->NewByteArray(length);
            break;
        }
        case 'C': {
            JDWP_TRACE_DATA("NewInstance: new char array");
            arr = jni->NewCharArray(length);
            break;
        }
        case 'S': {
            JDWP_TRACE_DATA("NewInstance: new short array");
            arr = jni->NewShortArray(length);
            break;
        }
        case 'I': {
            JDWP_TRACE_DATA("NewInstance: new int array");
            arr = jni->NewIntArray(length);
            break;
        }
        case 'J': {
            JDWP_TRACE_DATA("NewInstance: new long array");
            arr = jni->NewLongArray(length);
            break;
        }
        case 'F': {
            arr = jni->NewFloatArray(length);
            JDWP_TRACE_DATA("NewInstance: new float array");
            break;
        }
        case 'D': {
            JDWP_TRACE_DATA("NewInstance: new double array");
            arr = jni->NewDoubleArray(length);
            break;
        }
        case 'L':
        case '[': {
            char* name = GetClassManager().GetClassName(&signature[1]);
            JvmtiAutoFree jafn(name);
            jobject loader;
            JVMTI_TRACE(err, GetJvmtiEnv()->GetClassLoader(cls, &loader));
            if (err != JVMTI_ERROR_NONE) {
                throw AgentException(err);
            }
            jclass elementClass =
                GetClassManager().GetClassForName(jni, name, loader);
            JDWP_TRACE_DATA("NewInstance: new object array: "
                "class=" << JDWP_CHECK_NULL(name));
            arr = jni->NewObjectArray(length, elementClass, 0);
            break;
        }
        default:
            JDWP_TRACE_DATA("NewInstance: bad type signature: "
                << JDWP_CHECK_NULL(signature));
            throw AgentException(JDWP_ERROR_INVALID_ARRAY);
    }
    GetClassManager().CheckOnException(jni);
    if (arr == 0) {
        throw AgentException(JDWP_ERROR_OUT_OF_MEMORY);
    }

    JDWP_TRACE_DATA("NewInstance: send: tag=" << JDWP_TAG_ARRAY
                << ", newArray=" << arr);
    m_cmdParser->reply.WriteByte(JDWP_TAG_ARRAY);
    m_cmdParser->reply.WriteArrayID(jni, arr);
}


text:
@implementation LeftView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    self.backgroundColor = [UIColor lightGrayColor];
    return self;
}

@end


text:
package org.apache.cassandra.db.marshal;

import java.io.UnsupportedEncodingException;
import java.nio.ByteBuffer;
import java.util.Arrays;
import java.util.Random;
import java.util.UUID;

import com.google.common.base.Charsets;

import org.apache.cassandra.utils.ByteBufferUtil;
import org.apache.cassandra.utils.FBUtilities;
import org.junit.Test;

public class TypeCompareTest
{
    @Test
    public void testAscii()
    {
        AsciiType comparator = new AsciiType();
        assert comparator.compare(FBUtilities.EMPTY_BYTE_BUFFER, ByteBufferUtil.bytes("asdf")) < 0;
        assert comparator.compare(ByteBufferUtil.bytes("asdf"), FBUtilities.EMPTY_BYTE_BUFFER) > 0;
        assert comparator.compare(FBUtilities.EMPTY_BYTE_BUFFER, FBUtilities.EMPTY_BYTE_BUFFER) == 0;
        assert comparator.compare(ByteBufferUtil.bytes("z"), ByteBufferUtil.bytes("a")) > 0;
        assert comparator.compare(ByteBufferUtil.bytes("a"), ByteBufferUtil.bytes("z")) < 0;
        assert comparator.compare(ByteBufferUtil.bytes("asdf"), ByteBufferUtil.bytes("asdf")) == 0;
        assert comparator.compare(ByteBufferUtil.bytes("asdz"), ByteBufferUtil.bytes("asdf")) > 0;
    }

    @Test
    public void testBytes()
    {
        BytesType comparator = new BytesType();
        assert comparator.compare(FBUtilities.EMPTY_BYTE_BUFFER, ByteBufferUtil.bytes("asdf")) < 0;
        assert comparator.compare(ByteBufferUtil.bytes("asdf"), FBUtilities.EMPTY_BYTE_BUFFER) > 0;
        assert comparator.compare(FBUtilities.EMPTY_BYTE_BUFFER, FBUtilities.EMPTY_BYTE_BUFFER) == 0;
        assert comparator.compare(ByteBufferUtil.bytes("z"), ByteBufferUtil.bytes("a")) > 0;
        assert comparator.compare(ByteBufferUtil.bytes("a"), ByteBufferUtil.bytes("z")) < 0;
        assert comparator.compare(ByteBufferUtil.bytes("asdf"), ByteBufferUtil.bytes("asdf")) == 0;
        assert comparator.compare(ByteBufferUtil.bytes("asdz"), ByteBufferUtil.bytes("asdf")) > 0;
    }

    @Test
    public void testUTF8()
    {
        UTF8Type comparator = new UTF8Type();
        assert comparator.compare(FBUtilities.EMPTY_BYTE_BUFFER, ByteBufferUtil.bytes("asdf")) < 0;
        assert comparator.compare(ByteBufferUtil.bytes("asdf"), FBUtilities.EMPTY_BYTE_BUFFER) > 0;
        assert comparator.compare(FBUtilities.EMPTY_BYTE_BUFFER, FBUtilities.EMPTY_BYTE_BUFFER) == 0;
        assert comparator.compare(ByteBufferUtil.bytes("z"), ByteBufferUtil.bytes("a")) > 0;
        assert comparator.compare(ByteBufferUtil.bytes("z"), ByteBufferUtil.bytes("z")) == 0;
        assert comparator.compare(ByteBufferUtil.bytes("a"), ByteBufferUtil.bytes("z")) < 0;
    }

    @Test
    public void testLong()
    {
        Random rng = new Random();
        ByteBuffer[] data = new ByteBuffer[1000];
        for (int i = 0; i < data.length; i++)
        {
            data[i] = ByteBuffer.allocate(8);
            rng.nextBytes(data[i].array());
        }

        Arrays.sort(data, LongType.instance);

        for (int i = 1; i < data.length; i++)
        {

            long l0 = data[i - 1].getLong(data[i - 1].position()+data[i - 1].arrayOffset());
            long l1 = data[i].getLong(data[i].position()+data[i].arrayOffset());
            assert l0 <= l1;
        }
    }

    @Test
    public void testTimeUUID()
    {
        // two different UUIDs w/ the same timestamp
        UUID uuid1 = UUID.fromString("1077e700-c7f2-11de-86d5-f5bcc793a028");
        byte[] bytes1 = new byte[16];
        ByteBuffer bb1 = ByteBuffer.wrap(bytes1);
        bb1.putLong(uuid1.getMostSignificantBits());  bb1.putLong(uuid1.getLeastSignificantBits());

        UUID uuid2 = UUID.fromString("1077e700-c7f2-11de-982e-6fad363d5f29");
        byte[] bytes2 = new byte[16];
        ByteBuffer bb2 = ByteBuffer.wrap(bytes2);
        bb2.putLong(uuid2.getMostSignificantBits());  bb2.putLong(uuid2.getLeastSignificantBits());

        assert new TimeUUIDType().compare(ByteBuffer.wrap(bytes1), ByteBuffer.wrap(bytes2)) != 0;
    }
}


text:
package com.action.bingfabianchengyuanli.chapter01;

import java.util.concurrent.TimeUnit;

/**
 * @Description TODO
 * @Author wuyunfeng
 * @Date 2020-05-25 11:15
 * @Version 1.0
 */
public class Demo1 {

    public static void main(String[] args) {
        System.out.println("main enter");

        Runnable target;
        Thread t1 = new Thread(new Runnable() {
            @Override
            public void run() {
                while (true) {
                    try {
                        System.out.println("t1 is executing");
                        TimeUnit.SECONDS.sleep(1);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        });

        t1.start();
        System.out.println("main exit");

    }

}


text:
node-eventstore-postgre
=======================

## Why I create this eventstore?
I firstly checked [Greg Young's event store](http://www.geteventstore.com), but it only provide atom REST interface for node.js,
which need too many round trips (each event for each round trip) to get events from a given aggregate.

Later I tried to find node.js event store implementations, however, many are using NOSQL databases which I don't think it will support
transaction very well.

Finally, I decide write a simple one using rational database.

Inspired by [Greg Young's cqrs document](http://cqrs.files.wordpress.com/2010/11/cqrs_documents.pdf).

## Install
```
npm install node-eventstore-postgre
```

## APIs
I am using coffeescript to the usages. before everything, do this
``` coffeescript
EventStore = require 'node-eventstore-postgre'
eventStore = new EventStore 'postgres://ronliu:123456@localhost/test', publish   #Pass in postgre connection string and publish method
eventStore.init()   #Initialise necessary tables and functions using create if not exists style
```
### Get events from a given aggregate id
It will take 2 arguments:

* aggregateId
* startOverVersion, like given 3, it should return events from version 4

``` coffeescript
events = eventStore.readEvents aggregateId, statOverVersion
```

### Given aggregate id, output a snap shot with version

It will take 2 arguments:

* aggregateId
``` coffeescript
snapshot = eventStore.readSnapshot aggregateId # {data: aggregate, version: version} or undefined
```

### Write events to
It will take 4 arguments:

* aggregateId
* aggregate type
* originating version: the version when we read used to check optimistic concurrency conflicts
* events array
* snapshot

``` coffeescript
eventStore.writeEvents aggregateId, 'customer', 2, [
	{eventName: 'customerAdded', data: name: 'ron', createdOn: new Date()},
	{eventName: 'customerActivated', data: comment: 'good customer'},
], name: 'john', isActive: true
```

## Status
* From 0.2, it support snapshot


text:
<?php
class ControllerErrorNotFound extends Controller {
	public function index() {
		$this->load->language('error/not_found');

		$this->document->setTitle($this->language->get('heading_title'));

		$data['heading_title'] = $this->language->get('heading_title');

		$data['text_not_found'] = $this->language->get('text_not_found');

		$data['breadcrumbs'] = array();

		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('text_home'),
			'href' => $this->url->link('common/dashboard', 'token=' . $this->session->data['token'], 'SSL')
		);

		$data['breadcrumbs'][] = array(
			'text' => $this->language->get('heading_title'),
			'href' => $this->url->link('error/not_found', 'token=' . $this->session->data['token'], 'SSL')
		);

		$data['header'] = $this->load->controller('common/header');
		$data['column_left'] = $this->load->controller('common/column_left');
		$data['footer'] = $this->load->controller('common/footer');

		$this->response->setOutput($this->load->view('error/not_found.tpl', $data));
	}
}


text:
"""Tests task scheduling"""
import time
import asyncio
import unittest
from functools import partial

from tests import app

class TestScheduler(app.TaskQueueBase, unittest.TestCase):
    schedule_periodic = True

    def test_scheduler(self):
        scheduler = self.tq_app.backend
        self.assertEqual(scheduler.cfg.default_task_queue, '%s1' % self.name())
        self.assertTrue(scheduler.tasks.next_run)

    def test_next_scheduled(self):
        scheduler = self.tq_app.backend
        entry, t = scheduler.tasks.next_scheduled()
        self.assertEqual(entry, 'testperiodic')

    def test_next_scheduled_entries(self):
        scheduler = self.tq_app.backend
        entry, t = scheduler.tasks.next_scheduled(['anchoredeveryhour'])
        self.assertEqual(entry, 'anchoredeveryhour')
        self.assertTrue(t > 0)

    async def test_periodic(self):
        scheduler = self.tq_app.backend
        future = asyncio.Future()
        cbk = partial(self._test_periodic, future)
        await scheduler.on_events('task', '*', cbk)
        try:
            result = await future
            self.assertTrue(result < time.time())
        finally:
            await scheduler.remove_event_callback('task', '*', cbk)

    async def test_rpc_next_scheduled_tasks(self):
        next = await self.proxy.tasks.next_scheduled_tasks()
        self.assertTrue(isinstance(next, list))
        self.assertEqual(len(next), 2)
        self.assertEqual(next[0], 'testperiodic')

    def _test_periodic(self, future, channel, event, task):
        try:
            self.assertEqual(task.name, 'testperiodic')
            if event != 'done':
                return
        except Exception as exc:
            future.set_exception(exc)
        else:
            future.set_result(task.result)


text:
@interface BTPlane : NSObject

@property float y;

- (id) initWithY: (float) y;
- (void) draw;

@end


text:
Reports Stream API chains, Iterable.forEach and Map.forEach calls that can be automatically converted into classical loops.

Example:

  String joinNonEmpty(List<String> list) {
    return list.stream() // Stream can be converted to loop
      .filter(s -> !s.isEmpty())
      .map(String::trim)
      .collect(Collectors.joining(", "));
  }

After the fix is applied, the result will be like this:

  String joinNonEmpty(List<String> list) {
    StringJoiner joiner = new StringJoiner(", ");
    for (String s : list) {
      if (!s.isEmpty()) {
        String trim = s.trim();
        joiner.add(trim);
      }
    }
    return joiner.toString();
  }

  Note that sometimes this inspection might cause slight semantic changes.
  Special care should be taken when it comes to short-circuiting, as it's not specified how many elements will be actually read when
  the stream short-circuits.

Use checkbox below to suggest conversions for streams with unrecognized source. In this case, iterator will be created from the stream.
  For example, when checkbox is checked, the conversion will be suggested here:

  List<ProcessHandle> handles = ProcessHandle.allProcesses().collect(Collectors.toList());

In this case, the result will be like this:

  List<ProcessHandle> handles = new ArrayList<>();
  for (Iterator<ProcessHandle> it = ProcessHandle.allProcesses().iterator(); it.hasNext(); ) {
    ProcessHandle allProcess = it.next();
    handles.add(allProcess);
  }

New in 2017.1


text:
docker run --rm \
 -v /var/run/docker.sock:/var/run/docker.sock \
 -v $(which docker):$(which docker) \
 -v $(pwd):$(pwd) \
 -e HOST_PROJECT_PATH=$(pwd) \
 -e HOST_GOPATH=${GOPATH} \
 -e DOCKER_IMAGE_NAME=${DOCKER_IMAGE_NAME-mailgun/vulcand} \
 golang:1.4-onbuild bash $(pwd)/scripts/static-compile-docker.sh


text:
<!---
  category: NetworkingAndWebServices
  samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620606&clcid=0x409
--->

# Socket activity trigger stream socket sample

This sample shows how to use the Socket Activity Stream Socket API to keep a socket connection alive beyond the lifetime of the application.

This sample connects to a server listening on TCP port 40404. The application can be terminated but the connection to the server will remain alive and will get background notifications if the server sends messages on the connection.

This sample requires the following capabilities:

-   **Private Networks (Client & Server)** - If the server it connects to is in intranet then it requires private Network capabilities.

For more information on network capabilities, see [How to set network capabilities](http://msdn.microsoft.com/library/windows/apps/hh770532).

**Note**  This sample uses IP loopback. Network communications using an IP loopback address cannot normally be used for inter process communication between a Universal Windows Platform (UWP) app and a different process (a different UWP app or a desktop app) because this is restricted by network isolation. Network communication using an IP loopback address is allowed within the same process for communication purposes in a UWP app.

## Related topics

### Other resources

[Adding support for networking](http://msdn.microsoft.com/library/windows/apps/hh452752)

[How to configure network isolation capabilities](http://msdn.microsoft.com/library/windows/apps/hh770532)

## System requirements

**Client:** Windows 10

**Server:** Windows Server 2016 Technical Preview

**Phone:** Windows 10

## Build the sample

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

## Run the sample

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

### Deploying the sample

- Select **Build** \> **Deploy Solution**.

### Deploying and running the sample

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

This sample requires two computers that can connect to each other over a network. One computer will play the role of the client, while the other computer will play the role of the server.

To deploy this sample after building it, select Deploy Solution from the Build menu.

The sample must be deployed to both the client and server computers.

To run the sample, first the start the server app on the server computer. It will wait for the clients to connect.

After the server app has started, start the client app on the client computer.

1. Specify the server name in the text box and click connect.

2. Once a connection is established, you can terminate the client application.

Once the client is connected, you can send messages from the server application text box. The client displays received messages as toast notifications.


text:
using ExcelDna.Integration;
using ExcelDna.IntelliSense;

namespace TestAddIn
{
    public class AddIn : IExcelAddIn
    {
        public void AutoOpen()
        {
            IntelliSenseServer.Install();
            //ExcelDna.Logging.LogDisplay.Show();
            //ExcelDna.Logging.LogDisplay.DisplayOrder = ExcelDna.Logging.DisplayOrder.NewestFirst;
        }

        public void AutoClose()
        {
            // The explicit Uninstall call was added in version 1.0.10,
            // to give us a chance to unhook the WinEvents (which needs to happen on the main thread)
            // No easy plan to do this from the AppDomain unload event, which runs on a ThreadPool thread.
            IntelliSenseServer.Uninstall();
        }
    }
}


text:
<?php
namespace Basico\Doctrine\Types;

use Doctrine\DBAL\Types\ConversionException;

use Doctrine\DBAL\Types\Type;
use Doctrine\DBAL\Platforms\AbstractPlatform;

class SqlServerSmalldatetime extends Type {

    const MYTYPE = 'SqlServerSmalldatetime'; // modify to match your type name

    public function getName() {
        return self::MYTYPE;
    }

    public function getSQLDeclaration (array $fieldDeclaration, AbstractPlatform $platform) {
        return null;
    }

    /**
     * @param Datetime $value
     */
    public function convertToDatabaseValue($value, AbstractPlatform $platform) {
        return ($value !== null)
            ? $value->format('Y-m-d H:i:s') : null;
    }

    /**
     * @param string $value
     */
    public function convertToPHPValue($value, AbstractPlatform $platform) {
        if($value == null)
            return null;

        $datetime = \DateTime::createFromFormat('Y-m-d H:i:s', $value);
        if (!$datetime)
            throw ConversionException::conversionFailed($value, $this->getName());
        return $datetime;
    }
}

?>


text:
require 'time'
require 'mechanize'

module Anitama
  class Program < Struct.new(:book_id, :title, :update_time)
  end

  class Scraping
    URL_BASE = "http://www.weeeef.com/weeeefww1"

    def initialize
      @a = Mechanize.new
      @a.user_agent_alias = 'Windows Chrome'
    end

    def main
      create_session
      program_list
      filter_program(program_list)
    end

    def download(book_id, path)
      create_session
      node_id = media_file_node_id(book_id)
      _download(node_id, path)
    end

    private

    def create_session
      @a.get(URL_BASE + "/Transition?command=top&group=G0000049")
      unixtime = Time.now.to_i
      @a.get(URL_BASE + "/CategoryServlet?groupId=null&time=#{unixtime}")
    end

    def program_list
      res = @a.get(URL_BASE + "/BookServlet")
      res.xml.css('Books Book').map do |book|
        book_id = book.attr('id')
        title = book.attr('label')
        update_time = Time.parse(book.attr('updateTime'))
        Program.new(book_id, title, update_time)
      end
    end

    def filter_program(list)
      list.reject do |program|
        # mp3が複数含まれていて扱いが面倒なのでとりあえず取得対象からはずしておく
        program.title.include?('校内放送マイクバトル')
      end
    end

    def media_file_node_id(book_id)
      res = @a.get(URL_BASE + "/BookXmlGet?BookId=#{book_id}&time=897")
      nodes = res.xml.xpath('./Node/Node/Node').select do |node|
        !!node.xpath('./Sound/Title').first
      end
      if nodes.size == 0
        raise "Undefined media file."
      end
      if nodes.size >= 2
        raise "Multiple media files in 1 program. Should fix code."
      end

      nodes.first.xpath('./Id').text
    end

    def _download(media_file_node_id, path)
      res = @a.post(URL_BASE + "/OriginalGet", {
        nodeId: media_file_node_id,
        type: 'S',
        time: 6405,
      })
      unless res.code.to_i == 200
        raise "response code is not 200: #{res.code}"
      end
      if res.body.bytesize < 1024 * 1024 # 1M
        raise "file size too small maybe failed"
      end
      File.binwrite(path, res.body)
    end
  end
end


text:
class Pacifist < Cask
  url 'http://www.charlessoft.com/cgi-bin/pacifist_download.cgi?type=dmg'
  homepage 'http://www.charlessoft.com/'
  version 'latest'
  no_checksum
  link 'Pacifist.app'
end