text:
"""
 CLI application for SSH management.
"""

from copy import copy
import logging
import os.path
import sys

import paramiko

from ryu import version
from ryu.lib import hub
from ryu.services.protocols.bgp.base import Activity
from ryu.services.protocols.bgp.operator.command import Command
from ryu.services.protocols.bgp.operator.command import CommandsResponse
from ryu.services.protocols.bgp.operator.command import STATUS_OK
from ryu.services.protocols.bgp.operator.commands.root import RootCmd
from ryu.services.protocols.bgp.operator.internal_api import InternalApi

SSH_PORT = "ssh_port"
SSH_HOST = "ssh_host"
SSH_HOST_KEY = "ssh_host_key"
SSH_USERNAME = "ssh_username"
SSH_PASSWORD = "ssh_password"

DEFAULT_SSH_PORT = 4990
DEFAULT_SSH_HOST = "localhost"
DEFAULT_SSH_HOST_KEY = None
DEFAULT_SSH_USERNAME = "ryu"
DEFAULT_SSH_PASSWORD = "ryu"

CONF = {
    SSH_PORT: DEFAULT_SSH_PORT,
    SSH_HOST: DEFAULT_SSH_HOST,
    SSH_HOST_KEY: DEFAULT_SSH_HOST_KEY,
    SSH_USERNAME: DEFAULT_SSH_USERNAME,
    SSH_PASSWORD: DEFAULT_SSH_PASSWORD,
}

LOG = logging.getLogger('bgpspeaker.cli')

def find_ssh_server_key():
    if CONF[SSH_HOST_KEY]:
        return paramiko.RSAKey.from_private_key_file(CONF[SSH_HOST_KEY])
    elif os.path.exists("/etc/ssh_host_rsa_key"):
        # OSX
        return paramiko.RSAKey.from_private_key_file(
            "/etc/ssh_host_rsa_key")
    elif os.path.exists("/etc/ssh/ssh_host_rsa_key"):
        # Linux
        return paramiko.RSAKey.from_private_key_file(
            "/etc/ssh/ssh_host_rsa_key")
    else:
        return paramiko.RSAKey.generate(1024)

class SshServer(paramiko.ServerInterface):
    TERM = "ansi"
    PROMPT = "bgpd> "
    WELCOME = "\n\rHello, this is Ryu BGP speaker (version %s).\n\r" % version

    class HelpCmd(Command):
        help_msg = 'show this help'
        command = 'help'

        def action(self, params):
            return self.parent_cmd.question_mark()[0]

    class QuitCmd(Command):
        help_msg = 'exit this session'
        command = 'quit'

        def action(self, params):
            self.api.sshserver.end_session()
            return CommandsResponse(STATUS_OK, True)

    def __init__(self, sock, addr):
        super(SshServer, self).__init__()
        self.sock = sock
        self.addr = addr

        # tweak InternalApi and RootCmd for non-bgp related commands
        self.api = InternalApi(log_handler=logging.StreamHandler(sys.stderr))
        setattr(self.api, 'sshserver', self)
        self.root = RootCmd(self.api)
        self.root.subcommands['help'] = self.HelpCmd
        self.root.subcommands['quit'] = self.QuitCmd

        self.transport = paramiko.Transport(self.sock)
        self.transport.load_server_moduli()
        host_key = find_ssh_server_key()
        self.transport.add_server_key(host_key)
        self.transport.start_server(server=self)

        self.is_connected = True

        # For pylint
        self.buf = None
        self.chan = None
        self.curpos = None
        self.histindex = None
        self.history = None
        self.prompted = None
        self.promptlen = None

    def check_auth_none(self, username):
        return paramiko.AUTH_SUCCESSFUL

    def check_auth_password(self, username, password):
        if (username == CONF[SSH_USERNAME]
                and password == CONF[SSH_PASSWORD]):
            return paramiko.AUTH_SUCCESSFUL
        return paramiko.AUTH_FAILED

    def check_channel_request(self, kind, chanid):
        if kind == 'session':
            return paramiko.OPEN_SUCCEEDED
        return paramiko.OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED

    def check_channel_shell_request(self, channel):
        hub.spawn(self._handle_shell_request)
        return True

    def check_channel_pty_request(self, channel, term, width, height,
                                  pixelwidth, pixelheight, modes):
        self.TERM = term
        return True

    def check_channel_window_change_request(self, channel, width, height,
                                            pixelwidth, pixelheight):
        return True

    @staticmethod
    def _is_echoable(c):
        return not (c < chr(0x20) or c == chr(0x7F))

    @staticmethod
    def _is_enter(c):
        return c == chr(0x0d)

    @staticmethod
    def _is_eof(c):
        return c == chr(0x03)

    @staticmethod
    def _is_esc(c):
        return c == chr(0x1b)

    @staticmethod
    def _is_hist(c):
        return c == chr(0x10) or c == chr(0x0e)

    @staticmethod
    def _is_del(c):
        return (c == chr(0x04) or c == chr(0x08) or c == chr(0x15)
                or c == chr(0x17) or c == chr(0x0c) or c == chr(0x7f))

    @staticmethod
    def _is_curmov(c):
        return c == chr(0x01) or c == chr(0x02) or c == chr(0x05) \
            or c == chr(0x06)

    @staticmethod
    def _is_cmpl(c):
        return c == chr(0x09)

    def _handle_csi_seq(self):
        c = self.chan.recv(1)
        c = c.decode()  # For Python3 compatibility
        if c == 'A':
            self._lookup_hist_up()
        elif c == 'B':
            self._lookup_hist_down()
        elif c == 'C':
            self._movcursor(self.curpos + 1)
        elif c == 'D':
            self._movcursor(self.curpos - 1)
        else:
            LOG.error("unknown CSI sequence. do nothing: %c", c)

    def _handle_esc_seq(self):
        c = self.chan.recv(1)
        c = c.decode()  # For Python3 compatibility
        if c == '[':
            self._handle_csi_seq()
        else:
            LOG.error("non CSI sequence. do nothing")

    def _send_csi_seq(self, cmd):
        self.chan.send('\x1b[' + cmd)

    def _movcursor(self, curpos):
        if self.prompted and curpos < len(self.PROMPT):
            self.curpos = len(self.PROMPT)
        elif self.prompted and curpos > (len(self.PROMPT) + len(self.buf)):
            self.curpos = len(self.PROMPT) + len(self.buf)
        else:
            self._send_csi_seq('%dG' % (curpos + 1))
            self.curpos = curpos

    def _clearscreen(self, prompt=None):
        if not prompt and self.prompted:
            prompt = self.PROMPT
        # clear screen
        self._send_csi_seq('2J')
        # move cursor to the top
        self._send_csi_seq('d')
        # redraw prompt and buf
        self._refreshline(prompt=prompt)

    def _clearline(self, prompt=None):
        if not prompt and self.prompted:
            prompt = self.PROMPT
        self.prompted = False
        self._movcursor(0)
        self._send_csi_seq('2K')
        if prompt:
            self.prompted = True
            self.chan.send(prompt)
            self._movcursor(len(prompt))
        self.buf = []

    def _refreshline(self, prompt=None):
        if not prompt and self.prompted:
            prompt = self.PROMPT
        buf = copy(self.buf)
        curpos = copy(self.curpos)
        self._clearline(prompt=prompt)
        self.chan.send(''.join(buf))
        self.buf = buf
        self.curpos = curpos
        self._movcursor(curpos)

    def _refreshnewline(self, prompt=None):
        if not prompt and self.prompted:
            prompt = self.PROMPT
        buf = copy(self.buf)
        curpos = copy(self.curpos)
        self._startnewline(prompt)
        self.chan.send(''.join(buf))
        self.buf = buf
        self.curpos = curpos
        self._movcursor(curpos)

    def _startnewline(self, prompt=None, buf=''):
        if not prompt and self.prompted:
            prompt = self.PROMPT
        if isinstance(buf, str):
            buf = list(buf)
        if self.chan:
            self.buf = buf
            if prompt:
                self.chan.send('\n\r' + prompt + ''.join(buf))
                self.curpos = len(prompt) + len(buf)
                self.prompted = True
            else:
                self.chan.send('\n\r' + ''.join(buf))
                self.curpos = len(buf)
                self.prompted = False

    def _lookup_hist_up(self):
        if len(self.history) == 0:
            return
        self.buf = self.history[self.histindex]
        self.curpos = self.promptlen + len(self.buf)
        self._refreshline()
        if self.histindex + 1 < len(self.history):
            self.histindex += 1

    def _lookup_hist_down(self):
        if self.histindex > 0:
            self.histindex -= 1
            self.buf = self.history[self.histindex]
            self.curpos = self.promptlen + len(self.buf)
            self._refreshline()
        else:
            self._clearline()

    def _do_cmpl(self, buf, is_exec=False):
        cmpleter = self.root
        is_spaced = buf[-1] == ' ' if len(buf) > 0 else False
        cmds = [tkn.strip() for tkn in ''.join(buf).split()]
        ret = []

        for i, cmd in enumerate(cmds):
            subcmds = cmpleter.subcommands
            matches = [x for x in subcmds.keys() if x.startswith(cmd)]

            if len(matches) == 1:
                cmpled_cmd = matches[0]
                cmpleter = subcmds[cmpled_cmd](self.api)

                if is_exec:
                    ret.append(cmpled_cmd)
                    continue

                if (i + 1) == len(cmds):
                    if is_spaced:
                        result, cmd = cmpleter('?')
                        result = result.value.replace('\n', '\n\r').rstrip()
                        self.prompted = False
                        buf = copy(buf)
                        self._startnewline(buf=result)
                        self.prompted = True
                        self._startnewline(buf=buf)
                    else:
                        self.buf = buf[:(-1 * len(cmd))] + \
                            list(cmpled_cmd + ' ')
                        self.curpos += len(cmpled_cmd) - len(cmd) + 1
                        self._refreshline()
            else:
                self.prompted = False
                buf = copy(self.buf)
                if len(matches) == 0:
                    if cmpleter.param_help_msg:
                        self.prompted = True
                        ret.append(cmd)
                        continue
                    else:
                        self._startnewline(buf='Error: Not implemented')
                else:
                    if (i + 1) < len(cmds):
                        self._startnewline(buf='Error: Ambiguous command')
                    else:
                        self._startnewline(buf=', '.join(matches))
                ret = []
                self.prompted = True
                if not is_exec:
                    self._startnewline(buf=buf)
                break

        return ret

    def _execute_cmd(self, cmds):
        result, _ = self.root(cmds)
        LOG.debug("result: %s", result)
        if cmds[0] == 'quit':
            self.is_connected = False
            return result.status
        self.prompted = False
        self._startnewline()
        output = result.value.replace('\n', '\n\r').rstrip()
        self.chan.send(output)
        self.prompted = True
        self._startnewline()
        return result.status

    def end_session(self):
        self._startnewline(prompt=False, buf='bye.\n\r')
        self.chan.close()

    def _handle_shell_request(self):
        LOG.info("session start")
        chan = self.transport.accept(20)
        if not chan:
            LOG.info("transport.accept timed out")
            return

        self.chan = chan
        self.buf = []
        self.curpos = 0
        self.history = []
        self.histindex = 0
        self.prompted = True
        self.chan.send(self.WELCOME)
        self._startnewline()

        while self.is_connected:
            c = self.chan.recv(1)
            c = c.decode()  # For Python3 compatibility

            if len(c) == 0:
                break

            LOG.debug("ord:%d, hex:0x%x", ord(c), ord(c))
            self.promptlen = len(self.PROMPT) if self.prompted else 0
            if c == '?':
                cmpleter = self.root
                cmds = [tkn.strip() for tkn in ''.join(self.buf).split()]

                for i, cmd in enumerate(cmds):
                    subcmds = cmpleter.subcommands
                    matches = [x for x in subcmds.keys() if x.startswith(cmd)]
                    if len(matches) == 1:
                        cmpled_cmd = matches[0]
                        cmpleter = subcmds[cmpled_cmd](self.api)

                result, cmd = cmpleter('?')
                result = result.value.replace('\n', '\n\r').rstrip()
                self.prompted = False
                buf = copy(self.buf)
                self._startnewline(buf=result)
                self.prompted = True
                self._startnewline(buf=buf)
            elif self._is_echoable(c):
                self.buf.insert(self.curpos - self.promptlen, c)
                self.curpos += 1
                self._refreshline()
            elif self._is_esc(c):
                self._handle_esc_seq()
            elif self._is_eof(c):
                self.end_session()
            elif self._is_curmov(c):
                # <C-a>
                if c == chr(0x01):
                    self._movcursor(self.promptlen)
                # <C-b>
                elif c == chr(0x02):
                    self._movcursor(self.curpos - 1)
                # <C-e>
                elif c == chr(0x05):
                    self._movcursor(self.promptlen + len(self.buf))
                # <C-f>
                elif c == chr(0x06):
                    self._movcursor(self.curpos + 1)
                else:
                    LOG.error("unknown cursor move cmd.")
                    continue
            elif self._is_hist(c):
                # <C-p>
                if c == chr(0x10):
                    self._lookup_hist_up()
                # <C-n>
                elif c == chr(0x0e):
                    self._lookup_hist_down()
            elif self._is_del(c):
                # <C-d>
                if c == chr(0x04):
                    if self.curpos < (self.promptlen + len(self.buf)):
                        self.buf.pop(self.curpos - self.promptlen)
                        self._refreshline()
                # <C-h> or delete
                elif c == chr(0x08) or c == chr(0x7f):
                    if self.curpos > self.promptlen:
                        self.buf.pop(self.curpos - self.promptlen - 1)
                        self.curpos -= 1
                        self._refreshline()
                # <C-u>
                elif c == chr(0x15):
                    self._clearline()
                # <C-w>
                elif c == chr(0x17):
                    pos = self.curpos - self.promptlen
                    i = pos
                    flag = False
                    for c in reversed(self.buf[:pos]):
                        if flag and c == ' ':
                            break
                        if c != ' ':
                            flag = True
                        i -= 1
                    del self.buf[i:pos]
                    self.curpos = self.promptlen + i
                    self._refreshline()
                # <C-l>
                elif c == chr(0x0c):
                    self._clearscreen()
            elif self._is_cmpl(c):
                self._do_cmpl(self.buf)
            elif self._is_enter(c):
                if len(''.join(self.buf).strip()) != 0:
                    # cmd line interpretation
                    cmds = self._do_cmpl(self.buf, is_exec=True)
                    if cmds:
                        self.history.insert(0, self.buf)
                        self.histindex = 0
                        self._execute_cmd(cmds)
                    else:
                        LOG.debug("no command is interpreted. "
                                  "just start a new line.")
                        self._startnewline()
                else:
                    LOG.debug("blank buf is detected. "
                              "just start a new line.")
                    self._startnewline()

            LOG.debug("curpos: %d, buf: %s, prompted: %s", self.curpos,
                      self.buf, self.prompted)

        LOG.info("session end")

def ssh_server_factory(sock, addr):
    SshServer(sock, addr)

class Cli(Activity):
    def __init__(self):
        super(Cli, self).__init__()

    def _run(self, *args, **kwargs):
        for k, v in kwargs.items():
            if k in CONF:
                CONF[k] = v

        listen_info = (CONF[SSH_HOST], CONF[SSH_PORT])
        LOG.info("starting ssh server at %s:%d" % listen_info)
        server = hub.StreamServer(listen_info, ssh_server_factory)
        server.serve_forever()

SSH_CLI_CONTROLLER = Cli()


text:
layout: package
name: "dipy"
tag: "dipy"
doc: "http://nipy.org/dipy/"
github: "https://github.com/nipy/dipy"
one-liner: "Focuses on diffusion magnetic resonance imaging (dMRI) analysis."
description: "Dipy is a free and open source software project focusing on diffusion magnetic resonance imaging (dMRI) analysis."
category: "diffusion-mri"
---

redpajama_set_name: RedPajamaGithub


text:
package com.cloudrain.derecho.netty.udt.echo.bytes;

import io.netty.channel.ChannelHandler.Sharable;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.channel.udt.nio.NioUdtProvider;

/**
 * Handler implementation for the echo server.
 */
@Sharable
public class ByteEchoServerHandler extends ChannelInboundHandlerAdapter {

    @Override
    public void channelActive(final ChannelHandlerContext ctx) {
        System.err.println("ECHO active " + NioUdtProvider.socketUDT(ctx.channel()).toStringOptions());
    }

    @Override
    public void channelRead(final ChannelHandlerContext ctx, Object msg) {
        ctx.write(msg);
    }

    @Override
    public void channelReadComplete(ChannelHandlerContext ctx) {
        ctx.flush();
    }

    @Override
    public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) {
        cause.printStackTrace();
        ctx.close();
    }
}


text:
layout: page
title: Other-Markdown-Tools
---
If you would like a tool added to this list [email me](mailto:pritchard.adam@gmail.com).

A bigger list of tools (that probably negates the need for this page) can be found at [github.com/writekit/awesome-markdown](https://github.com/writekit/awesome-markdown).

## Tools

### Editors

* [StackEdit](https://stackedit.io): In-browser MD document editor
* [Minimalist Online Markdown Editor](http://markdown.pioul.fr/)
* [Mou](http://25.io/mou/): Desktop editor for OS X

## Libraries

### JavaScript

* [Marked](https://github.com/chjj/marked)
* [Remarkable](https://github.com/jonschlinkert/remarkable)
* [PageDown](https://code.google.com/p/pagedown/) (and [PageDown Extra](https://github.com/jmcmanus/pagedown-extra))
* [markdown-it](https://github.com/markdown-it/markdown-it)
* [Gitdown](https://github.com/gajus/gitdown): GitHub markdown preprocessor
* [reMarked.js](https://github.com/leeoniya/reMarked.js): HTML-to-Markdown processor
* [Kramed](https://github.com/GitbookIO/kramed): Fork of Marked


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AvalonDock.MVVMTestApp
{
    class ToolViewModel : PaneViewModel
    {
        public ToolViewModel(string name)
        {
            Name = name;
            Title = name;
        }

        public string Name
        {
            get;
            private set;
        }

        #region IsVisible

        private bool _isVisible = true;
        public bool IsVisible
        {
            get { return _isVisible; }
            set
            {
                if (_isVisible != value)
                {
                    _isVisible = value;
                    RaisePropertyChanged("IsVisible");
                }
            }
        }

        #endregion

    }
}


text:
; #########################################################################
; Simple BASS Player in MASM32
; by TBD
;
; MASM32 package (c) Steve 'Hutch' Hutchesson http://www.movsd.com
; BASS engine (c) Un4seen Developments http://www.un4seen.com/
;
; History
;   1.1 (05.Jun.2oo2) - added VU meter
;                       added song name in status
;   1.0 (22.Mar.2oo2) - first version
; #########################################################################

      .486                      ; create 32 bit code
      .model flat, stdcall      ; 32 bit memory model
      option casemap :none      ; case sensitive

;     include files
;     ~~~~~~~~~~~~~
      include \masm32\include\windows.inc
      include \masm32\include\masm32.inc
      include \masm32\include\gdi32.inc
      include \masm32\include\user32.inc
      include \masm32\include\kernel32.inc
      include \masm32\include\Comctl32.inc
      include \masm32\include\comdlg32.inc
      include \masm32\include\winmm.inc

      include ..\bass.inc

;     libraries
;     ~~~~~~~~~
      includelib \masm32\lib\masm32.lib
      includelib \masm32\lib\gdi32.lib
      includelib \masm32\lib\user32.lib
      includelib \masm32\lib\kernel32.lib
      includelib \masm32\lib\Comctl32.lib
      includelib \masm32\lib\comdlg32.lib
      includelib \masm32\lib\winmm.lib

      includelib ..\..\c\bass.lib

      WinMain          PROTO :DWORD,:DWORD,:DWORD,:DWORD
      WndProc          PROTO :DWORD,:DWORD,:DWORD,:DWORD
      TopXY            PROTO :DWORD,:DWORD
      GetFileName      PROTO :DWORD,:DWORD,:DWORD
      Do_Status        PROTO :DWORD
      RegisterWinClass PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD
      MsgLoop          PROTO
      Main             PROTO
      Level            PROTO :DWORD,:DWORD,:DWORD,:DWORD,:DWORD
      Do_ToolBar       PROTO :DWORD
      SetBmpColor      PROTO :DWORD

      wsprintfA PROTO C :DWORD,:VARARG
      wsprintf equ <wsprintfA>

      ;=============
      ; Local macros
      ;=============

      szText MACRO Name, Text:VARARG
        LOCAL lbl
          jmp lbl
            Name db Text,0
          lbl:
        ENDM

      m2m MACRO M1, M2
        push M2
        pop  M1
      ENDM

      return MACRO arg
        mov eax, arg
        ret
      ENDM

      DisplayMenu MACRO handl, IDnum
        invoke LoadMenu,hInstance,IDnum
        invoke SetMenu,handl,eax
      ENDM

      DisplayWindow MACRO handl, ShowStyle
        invoke ShowWindow,handl, ShowStyle
        invoke UpdateWindow,handl
      ENDM

      ; ---------------------------
      ; macros for creating toolbar
      ; ---------------------------

      TBextraData MACRO
        mov tbb.fsState,   TBSTATE_ENABLED
        mov tbb.dwData,    0
        mov tbb.iString,   0
      ENDM

      ; ------------------------------

      TBbutton MACRO bID, cID, bStyle
        mov tbb.iBitmap,   bID  ;; button  ID number
        mov tbb.idCommand, cID  ;; command ID number
        mov tbb.fsStyle,   bStyle
        invoke SendMessage,hToolBar,TB_ADDBUTTONS,1,ADDR tbb
      ENDM

      ; ------------------------------

      TBblank MACRO
        mov tbb.iBitmap,   0
        mov tbb.idCommand, 0
        mov tbb.fsStyle,   TBSTYLE_SEP
        invoke SendMessage,hToolBar,TB_ADDBUTTONS,1,ADDR tbb
      ENDM

      ; ------------------------------

      Create_Tool_Bar MACRO Wd, Ht

        szText tbClass,"ToolbarWindow32"

        invoke CreateWindowEx,0,
                              ADDR tbClass,
                              ADDR tbClass,
                              WS_CHILD or WS_VISIBLE or TBSTYLE_FLAT,
                              0,0,500,20,
                              hWin,NULL,
                              hInstance,NULL

        mov hToolBar, eax

        invoke SendMessage,hToolBar,TB_BUTTONSTRUCTSIZE,sizeof TBBUTTON,0

        ; ---------------------------------------
        ; Put width & height of bitmap into DWORD
        ; ---------------------------------------
        mov  ecx,Wd  ;; loword = bitmap Width
        mov  eax,Ht  ;; hiword = bitmap Height
        shl  eax,16
        mov  ax, cx

        mov bSize, eax

        invoke SendMessage,hToolBar,TB_SETBITMAPSIZE,0,bSize

        invoke SetBmpColor,hTbBmp
        mov hTbBmp,eax

        mov tbab.hInst, 0
        m2m tbab.nID,   hTbBmp
        invoke SendMessage,hToolBar,TB_ADDBITMAP,12,ADDR tbab

        invoke SendMessage,hToolBar,TB_SETBUTTONSIZE,0,bSize
      ENDM

    ; --------------------------------------------
    ; equates to use directly in the message loop
    ; --------------------------------------------
        m_hWnd   equ <msg.hwnd>
        m_Msg    equ <msg.message>
        m_wParam equ <msg.wParam>
        m_lParam equ <msg.lParam>

.data?
      hInstance     dd ?
      CommandLine   dd ?
      hCursor       dd ?
      hWnd          dd ?
      ModHandle     dd ?
      ModName       dd ?
      MusicFile     dd ?
      hStatus       dd ?
      hTbBmp        dd ?
      hToolBar      dd ?
      SurroundOn    dd ?
      timer         dd ?
      hWinLevel     dd ?
      specdc        dd ?
      specbmp       dd ?
      specbuf       dd ?
      VIS_WIDTH     = 84
      VIS_HEIGHT    = 9
      ofn           OPENFILENAME <>  ; structure
      bmp           BITMAPINFO <>

.code

; #########################################################################

start:

      invoke InitCommonControls

      invoke GetModuleHandle, NULL
      mov hInstance, eax

      invoke LoadCursor,NULL,IDC_ARROW
      mov hCursor, eax

      call Main

      invoke ExitProcess,eax

; data
      szClassName    db "BASS_Player",0
      szDisplayName  db "Simple BASS Player",0
      szAboutText    db "BASSPlayer",13,10,"Copyright © TBD 2oo2",0
      szOpen         db "Open A File",0
      szFiles        db "MO3, MOD, S3M, IT, XM, MTM, UMX Files",0,"*.mo3;*.mod;*.s3m;*.it;*.xm;*.mtm;*.umx",0,0
      szFormatString db "%03u:%03u | %s",0

; #########################################################################

Main proc

    LOCAL Wwd:DWORD,Wht:DWORD,Wtx:DWORD,Wty:DWORD

    invoke RegisterWinClass,ADDR WndProc,ADDR szClassName,
                       0,hCursor,COLOR_BTNFACE+1

    invoke CreateWindowEx,WS_EX_LEFT,
                          ADDR szClassName,
                          ADDR szDisplayName,
                          WS_VISIBLE or WS_CAPTION or WS_SYSMENU or WS_MINIMIZEBOX,
                          300,300,220,94,
                          NULL,NULL,
                          hInstance,NULL
    mov hWnd,eax

    DisplayMenu hWnd,600
    DisplayWindow hWnd,SW_SHOWNORMAL

    call MsgLoop
    ret

Main endp

; #########################################################################

RegisterWinClass proc lpWndProc:DWORD, lpClassName:DWORD,
                      Icon:DWORD, Cursor:DWORD, bColor:DWORD

    LOCAL wc:WNDCLASSEX

    mov wc.cbSize,         sizeof WNDCLASSEX
    mov wc.style,          CS_BYTEALIGNCLIENT or \
                           CS_BYTEALIGNWINDOW
    m2m wc.lpfnWndProc,    lpWndProc
    mov wc.cbClsExtra,     NULL
    mov wc.cbWndExtra,     NULL
    m2m wc.hInstance,      hInstance
    m2m wc.hbrBackground,  bColor
    mov wc.lpszMenuName,   NULL
    m2m wc.lpszClassName,  lpClassName
    m2m wc.hIcon,          Icon
    m2m wc.hCursor,        Cursor
    m2m wc.hIconSm,        Icon

    invoke RegisterClassEx, ADDR wc

    ret

RegisterWinClass endp

; ########################################################################

MsgLoop proc

    LOCAL msg:MSG

    StartLoop:
      invoke GetMessage,ADDR msg,NULL,0,0
      cmp eax, 0
      je ExitLoop
      invoke TranslateMessage, ADDR msg
      invoke DispatchMessage,  ADDR msg
      jmp StartLoop
    ExitLoop:

    mov eax, msg.wParam
    ret

MsgLoop endp

; #########################################################################

WndProc proc hWin   :DWORD,
             uMsg   :DWORD,
             wParam :DWORD,
             lParam :DWORD

    LOCAL var    :DWORD
    LOCAL caW    :DWORD
    LOCAL caH    :DWORD
    LOCAL Rct    :RECT
    LOCAL buffer1[128]:BYTE  ; these are two spare buffers
    LOCAL buffer2[128]:BYTE  ; for text manipulation etc..
    LOCAL szFileName[260]:BYTE
	local p64    :QWORD      ; for 64-bit parameters!!!

    .if uMsg == WM_COMMAND
    ;======== toolbar commands ========
        .if wParam == 50
            invoke BASS_ChannelPlay, ModHandle, 0    ; play tune
            test eax,eax
            jz error
            invoke SetTimer, hWin, NULL, 50, NULL ;

        .elseif wParam == 51
            invoke BASS_ChannelStop, ModHandle

        .elseif wParam == 52
            invoke BASS_ChannelGetPosition, ModHandle, BASS_POS_MUSIC_ORDER
            .if eax != -1
                mov ebx, eax
                .while 1
                    dec ebx
                    and ebx, 0000000011111111b
					mov DWORD PTR [p64], ebx
					mov DWORD PTR [p64+4], 0
                    invoke BASS_ChannelSetPosition, ModHandle, p64, BASS_POS_MUSIC_ORDER
                .break .if eax
                .endw
            .endif

        .elseif wParam == 53
            invoke BASS_ChannelGetPosition, ModHandle, BASS_POS_MUSIC_ORDER
            .if eax !=-1
                mov ebx, eax
                .while 1
                    inc ebx
                    and ebx, 0000000011111111b
					mov DWORD PTR [p64], ebx
					mov DWORD PTR [p64+4], 0
                    invoke BASS_ChannelSetPosition, ModHandle, p64, BASS_POS_MUSIC_ORDER
                .break .if eax
                .endw
            .endif

        .elseif wParam == 54
            .if SurroundOn == FALSE
                invoke BASS_ChannelFlags, ModHandle, BASS_MUSIC_SURROUND, BASS_MUSIC_SURROUND
                mov SurroundOn, TRUE
            .else
                invoke BASS_ChannelFlags, ModHandle, 0, BASS_MUSIC_SURROUND
                mov SurroundOn, FALSE
            .endif
        .endif

    ;======== menu commands ========

        .if wParam == 1001
            mov szFileName[0],0     ; set 1st byte to zero

            mov ofn.lStructSize, sizeof OPENFILENAME
            m2m ofn.hWndOwner,   hWnd
            m2m ofn.hInstance,   hInstance
            m2m ofn.lpstrFilter, offset szFiles
            mov eax, ebp
            sub eax, 220h
            push eax
            pop ofn.lpstrFile
            mov ofn.nMaxFile,    sizeof szFileName
            m2m ofn.lpstrTitle,  offset szOpen
            mov ofn.Flags,       OFN_EXPLORER or OFN_FILEMUSTEXIST or \
                                 OFN_LONGNAMES

            invoke GetOpenFileName,ADDR ofn
            cmp szFileName[0],0     ; zero if cancel pressed in dlgbox
            je @F

            invoke BASS_MusicFree, ModHandle
            mov eax, BASS_SAMPLE_LOOP or BASS_MUSIC_POSRESET or BASS_MUSIC_RAMPS
            .if SurroundOn == TRUE
                or eax, BASS_MUSIC_SURROUND
            .endif
            mov DWORD PTR [p64], 0
            mov DWORD PTR [p64+4], 0
            invoke BASS_MusicLoad, 0, ADDR szFileName, p64, 0, eax, 0    ; load musicfile
            test eax,eax
            jz error

            mov [ModHandle], eax                                    ; save handle for future use
            invoke BASS_ChannelGetTags, ModHandle, BASS_TAG_MUSIC_NAME
            mov [ModName], eax

            invoke SendMessage, hWin, WM_COMMAND, 50, 0

            @@:

        .endif

        .if wParam == 1010
            invoke SendMessage,hWin,WM_SYSCOMMAND,SC_CLOSE,NULL

        .elseif wParam == 1900
            invoke MessageBox, 0, ADDR szAboutText, ADDR szDisplayName, 0
        .endif
    ;====== end menu commands ======
    .elseif uMsg == WM_TIMER
        invoke BASS_ChannelGetPosition, ModHandle, BASS_POS_MUSIC_ORDER
        mov edx, eax
        and eax, 0000000011111111b
        sar edx, 16
        invoke wsprintf, ADDR buffer1, ADDR szFormatString, eax, edx, ModName
        invoke SendMessage, hStatus, SB_SETTEXT, 0, ADDR buffer1

    .elseif uMsg == WM_CREATE
        invoke Do_ToolBar,hWin
        invoke Do_Status,hWin
        mov bmp.bmiHeader.biSize, sizeof bmp.bmiHeader
        mov bmp.bmiHeader.biWidth, VIS_WIDTH
        mov bmp.bmiHeader.biHeight, -VIS_HEIGHT
        mov bmp.bmiHeader.biPlanes, 1
        mov bmp.bmiHeader.biBitCount, 8
        mov bmp.bmiHeader.biClrUsed, VIS_WIDTH+1
        mov bmp.bmiHeader.biClrImportant, VIS_WIDTH+1
        invoke GetSysColor,COLOR_BTNFACE
        mov bmp.bmiColors, eax                   ; change from RGB to BGR
        mov cl, bmp.bmiColors.rgbRed
        mov bmp.bmiColors.rgbBlue, cl
        mov bmp.bmiColors.rgbRed, al
        mov eax, 1
        mov ebx, 255
        .while eax <= VIS_WIDTH ; create pallete
         mov bmp.bmiColors[eax*sizeof bmp.bmiColors].rgbRed, 0
         mov bmp.bmiColors[eax*sizeof bmp.bmiColors].rgbGreen, bl
         mov bmp.bmiColors[eax*sizeof bmp.bmiColors].rgbBlue, 0
         sub ebx, 2
         inc eax
        .endw
        invoke CreateDIBSection, 0, ADDR bmp, DIB_RGB_COLORS, ADDR specbuf, NULL, 0
        mov specbmp, eax
        invoke CreateCompatibleDC, 0
        mov specdc, eax
        invoke SelectObject, specdc, specbmp

        push hWin
        pop  hWinLevel
        invoke timeSetEvent, 25, 25, ADDR Level, 0, TIME_PERIODIC
        mov timer, eax

        invoke BASS_Init, -1, 44100, 0, hWin, 0          ; BASS_Init
        test eax,eax
        jz error

        invoke BASS_Start                                       ; start BASS engine
        test eax,eax
        jz error

        mov SurroundOn, FALSE

    .elseif uMsg == WM_SYSCOLORCHANGE
        invoke Do_ToolBar,hWin

    .elseif uMsg == WM_KEYDOWN
        .IF wParam == VK_LEFT
            invoke SendMessage, hWin, WM_COMMAND, 52, 0
        .ELSEIF wParam == VK_RIGHT
            invoke SendMessage, hWin, WM_COMMAND, 53, 0
        .ENDIF

    .elseif uMsg == WM_SIZE                                    ; needed to update the status
        invoke SendMessage,hToolBar,TB_AUTOSIZE,0,0
        invoke MoveWindow,hStatus,0,0,0,0,TRUE

    .elseif uMsg == WM_CLOSE
    .elseif uMsg == WM_DESTROY
        invoke timeKillEvent, timer
        invoke KillTimer, hWin, NULL
        invoke BASS_Free
        .if hTbBmp != NULL
          invoke DeleteObject, hTbBmp
        .endif
        .if specbmp != NULL
          invoke DeleteObject, specbmp
        .endif
        .if specdc != NULL
          invoke DeleteDC, specdc
        .endif
        invoke PostQuitMessage,NULL
        return 0

    .endif

    invoke DefWindowProc,hWin,uMsg,wParam,lParam
error:
    ret

WndProc endp

; ##########################################################################

Do_ToolBar proc hWin :DWORD

    LOCAL bSize :DWORD
    LOCAL tbab  :TBADDBITMAP
    LOCAL tbb   :TBBUTTON

    invoke LoadBitmap,hInstance,750
    mov hTbBmp,eax

    Create_Tool_Bar 16, 16

    TBextraData     ; additional data for TBBUTTON structure

    TBblank
    TBbutton  0,  50, TBSTYLE_BUTTON
    TBbutton  1,  51, TBSTYLE_BUTTON
    TBbutton  2,  52, TBSTYLE_BUTTON
    TBbutton  3,  53, TBSTYLE_BUTTON
    TBbutton  4,  54, TBSTYLE_CHECK

    ret

Do_ToolBar endp

; #########################################################################

Do_Status proc hParent:DWORD

    LOCAL sbParts[ 4] :DWORD

    invoke CreateStatusWindow,WS_CHILD or WS_VISIBLE,NULL, hParent, 200
    mov hStatus, eax

    ret

Do_Status endp

; ########################################################################

SetBmpColor proc hBitmap:DWORD

    LOCAL mDC       :DWORD
    LOCAL hBrush    :DWORD
    LOCAL hOldBmp   :DWORD
    LOCAL hReturn   :DWORD
    LOCAL hOldBrush :DWORD

    invoke CreateCompatibleDC,NULL
    mov mDC,eax

    invoke SelectObject,mDC,hBitmap
    mov hOldBmp,eax

    invoke GetSysColor,COLOR_BTNFACE
    invoke CreateSolidBrush,eax
    mov hBrush,eax

    invoke SelectObject,mDC,hBrush
    mov hOldBrush,eax

    invoke GetPixel,mDC,1,1
    invoke ExtFloodFill,mDC,1,1,eax,FLOODFILLSURFACE

    invoke SelectObject,mDC,hOldBrush
    invoke DeleteObject,hBrush

    invoke SelectObject,mDC,hBitmap
    mov hReturn,eax
    invoke DeleteDC,mDC

    mov eax,hReturn

    ret

SetBmpColor endp

; ##################################################################################

Level proc uses ebx, p1,p2,p3,p4,p5 :DWORD

    LOCAL hDC         :DWORD
    LOCAL buffer1[12] :BYTE

    .if ModHandle != 0
       invoke GetDC, hWinLevel
       mov hDC, eax

       mov ecx, [specbuf]                             ; clear window
       xor ebx, ebx
       .while ebx < VIS_WIDTH * VIS_HEIGHT
         mov BYTE PTR [ebx+ecx], 0
         inc ebx
       .endw

       invoke BASS_ChannelGetLevel, ModHandle
       mov ecx, [specbuf]
       .if eax != -1                                  ; error?
        .if ah > VIS_WIDTH                            ; level exceed VIS_WIDTH
          mov ah, VIS_WIDTH
        .endif
        xor ebx, ebx
        .while bl < ah                                ; display level
          mov BYTE PTR [ebx+ecx], bl                  ; line 1
          mov BYTE PTR [ebx+ecx+VIS_WIDTH], bl        ; line 2
          mov BYTE PTR [ebx+ecx+VIS_WIDTH*2], bl      ; line 3
          mov BYTE PTR [ebx+ecx+VIS_WIDTH*3], bl      ; line 4
          inc bl
        .endw
		ror eax,16         ; get right channel
		add ecx,VIS_WIDTH*5
        .if ah > VIS_WIDTH                            ; level exceed VIS_WIDTH
          mov ah, VIS_WIDTH
        .endif
        xor ebx, ebx
        .while bl < ah                                ; display level
          mov BYTE PTR [ebx+ecx], bl                  ; line 1
          mov BYTE PTR [ebx+ecx+VIS_WIDTH], bl        ; line 2
          mov BYTE PTR [ebx+ecx+VIS_WIDTH*2], bl      ; line 3
          mov BYTE PTR [ebx+ecx+VIS_WIDTH*3], bl      ; line 4
          inc bl
        .endw
       .endif
       invoke BitBlt, hDC, 125, 9, VIS_WIDTH,VIS_HEIGHT, specdc, 0, 0, SRCCOPY
       invoke ReleaseDC, hWinLevel, hDC
    .endif

    ret

Level endp

; ##################################################################################

end start

; ############################################################### [ END ] ##########


text:
<?php defined('BASEPATH') || exit('No direct script access allowed');

/**
 * Emailer language file (Brazilian Portuguese)
 *
 * Localization strings used by Bonfire's Emailer module.
 *
 * @package Bonfire\Modules\Emailer\Language\Portuguese_Br
 * @author  Bonfire Dev Team
 * @link    http://cibonfire.com/docs/developer
 */

$lang['emailer_template']                = 'Template';
$lang['emailer_email_template']          = 'Template de Email';
$lang['emailer_emailer_queue']           = 'Fila de Email ';

$lang['emailer_system_email']            = 'Email do sistema';
$lang['emailer_system_email_note']       = 'Todos os e-mail gerados pelo sistema são enviados a partir de.';
$lang['emailer_email_server']            = 'Email Server';
$lang['emailer_settings']                = 'Configurações de e-mail';
$lang['emailer_settings_note']           = 'Mail usa as funções padrões PHP de email, por isso não são necessários ajustes.';
$lang['emailer_location']                = 'localização';
$lang['emailer_server_address']          = 'Endereço do Servidor';
$lang['emailer_port']                    = 'Porta';
$lang['emailer_timeout_secs']            = 'Timeout (segundos)';
$lang['emailer_email_type']              = 'Tipo de e-mail';
$lang['emailer_test_settings']           = 'E-mail Configurações de teste';

$lang['emailer_template_note']           = 'Os e-mails são enviados em formato HTML. Eles podem ser personalizados editando o cabeçalho e rodapé, abaixo.';
$lang['emailer_header']                  = 'Cabeçalho';
$lang['emailer_footer']                  = 'Rodapé';

$lang['emailer_test_header']             = 'Teste suas definições';
$lang['emailer_test_intro']              = 'Insira um endereço de e-mail abaixo para verificar se as configurações de e-mail estão funcionando.
 Salvar as configurações atuais antes dos testes.';
$lang['emailer_test_button']             = 'Enviar e-mail de teste';
$lang['emailer_test_result_header']      = 'Resultados do Teste';
$lang['emailer_test_debug_header']       = 'Debug Information';
$lang['emailer_test_success']            = 'The email appears to be set correctly. If you do not see the email in your inbox, try looking in your Spam box or Junk mail.';
$lang['emailer_test_error']              = 'The email looks like it is not set correctly.';

$lang['emailer_test_mail_subject']       = 'Parabéns! O sistema de email (Emailer) do seu Bonfire está funcionando!';
$lang['emailer_test_mail_body']          = 'Se você estiver vendo este e-mail, então provavelmente o sistema de emails (Emailer) do seu Bonfire está funcionando!';

$lang['emailer_stat_no_queue']           = 'Você não tem nenhum e-mails na fila.';
$lang['emailer_total_in_queue']          = 'Total de Emails na fila:';
$lang['emailer_total_sent']              = 'Total de Emails enviados:';

$lang['emailer_sent']                    = 'Enviados';
$lang['emailer_attempts']                = 'tentativas';
$lang['emailer_id']                      = 'ID';
$lang['emailer_to']                      = 'Para';
$lang['emailer_subject']                 = 'Assunto';

$lang['emailer_missing_data']            = 'Um ou mais campos obrigatórios não foram preenchidos.';
$lang['emailer_no_debug']                = 'O E-mail foi enfileirado. Não há dados de depuração (debug) disponível.';

$lang['emailer_delete_success']          = '%d registros deletados.';
$lang['emailer_delete_failure']          = 'Não foi possível excluir os registros: %s';
$lang['emailer_delete_error']            = 'Erro ao deletar os registros: %s';
$lang['emailer_delete_confirm']          = 'Tem certeza de que deseja excluir estes e-mails?';

// $lang['emailer_create_email']         = 'Send New Email';
// $lang['emailer_create_setting']       = 'Email Configure';
// $lang['emailer_create_email_error']   = 'Error in creating emails: %s';
// $lang['emailer_create_email_success'] = 'Email(s) are inserted into email queue.';
// $lang['emailer_create_email_failure'] = 'Fail in creating emails: %s';

$lang['form_validation_emailer_system_email']  = 'Email do sistema';
$lang['form_validation_emailer_email_server']  = 'Email Server';
$lang['form_validation_emailer_sendmail_path'] = 'Sendmail Path';
// $lang['form_validation_emailer_smtp_address']  = 'SMTP Server Address';
// $lang['form_validation_emailer_smtp_username'] = 'SMTP Username';
// $lang['form_validation_emailer_smtp_password'] = 'SMTP Password';
// $lang['form_validation_emailer_smtp_port']     = 'SMTP Port';
// $lang['form_validation_emailer_smtp_timeout']  = 'SMTP timeout';


text:
"""
chalmers.service selects the correct service for the platform on import
"""
from __future__ import absolute_import

import os, platform

if os.name == 'nt':

    from .win32_local_service import Win32LocalService as LocalService
    from .win32_system_service import Win32SystemService as SystemService

    def Service(target_user):
        "Slecet service instance based on target user"
        if target_user is False:
            return LocalService(target_user)
        else:
            return SystemService(target_user)

elif platform.system() == 'Darwin':
    from .darwin_service import DarwinService as SystemService
    LocalService = SystemService

else:
    from .posix_service import (
        PosixSystemService as SystemService,
        PosixLocalService as LocalService
    )


text:
浏览页面时,当

                            <eqx-select class="select-sm border-width select-contain" model=sendType
                                        change=changeTriggerType(v)>
                                <eqx-select-option value=v ng-repeat="v in sendTypes">{{v.title}}</eqx-select-option>
                            </eqx-select>

页面元素

                            <eqx-select class="select-sm border-width select-contain" model=sourceElem
                                        change=getTriggerSources(sourceElem)>
                                <eqx-select-option value=null>点击选择元素</eqx-select-option>
                                <eqx-select-option value=triggerSource ng-repeat="triggerSource in triggerSources">
                                    {{triggerSource.name}}
                                </eqx-select-option>
                            </eqx-select>

{{triggerEvent.title}}     编辑

                                    <form role=form>

延迟时间

<input limit-input
                                                                                class="input_kuang short"
                                                                                type=number step=0.1 min=0
                                                                                max=20
                                                                                ng-model="triggerEvent.delay">

                                                         {{$index+1}}

显示
                                                            隐藏

                                                         {{$index+1}}

隐藏

                                    </form>

{{triggerEvent.title}}

                                    <form role=form>

延迟时间

<input limit-input
                                                                                class="input_kuang short"
                                                                                type=number step=0.1 min=0
                                                                                max=20
                                                                                ng-model="triggerEvent.delay">

随机图片 {{$index+1}} 取消

                                    </form>

添加触发

                                    {{eventType.title}}

确定 清除


text:
struct wl_resource;

namespace wl {

extern const struct wl_buffer_interface kMockWlBufferImpl;

// Manage wl_buffer object.
class MockBuffer : public ServerObject {
 public:
  MockBuffer(wl_resource* resource, std::vector<base::ScopedFD>&& fds);

  MockBuffer(const MockBuffer&) = delete;
  MockBuffer& operator=(const MockBuffer&) = delete;

  ~MockBuffer() override;

 private:
  std::vector<base::ScopedFD> fds_;
};

}  // namespace wl

#endif  // UI_OZONE_PLATFORM_WAYLAND_TEST_MOCK_BUFFER_H_


text:
#ifndef DynamicLinkerEnvironmentExtractor_h
#define DynamicLinkerEnvironmentExtractor_h

#include <mach/machine.h>
#include <wtf/Noncopyable.h>
#include <wtf/RetainPtr.h>
#include <wtf/Vector.h>
#include <wtf/text/CString.h>

namespace WebKit {

class EnvironmentVariables;

class DynamicLinkerEnvironmentExtractor {
    WTF_MAKE_NONCOPYABLE(DynamicLinkerEnvironmentExtractor);

public:
    DynamicLinkerEnvironmentExtractor(NSString *executablePath, cpu_type_t architecture);

    void getExtractedEnvironmentVariables(EnvironmentVariables&) const;

private:
    void processSingleArchitecture(const void* data, size_t length);
    void processFatFile(const void* data, size_t length);
    void processLoadCommands(const void* data, size_t length, int32_t numberOfCommands, bool shouldByteSwap);
    size_t processLoadCommand(const void* data, size_t length, bool shouldByteSwap);
    void processEnvironmentVariable(const char* environmentString);

    RetainPtr<NSString> m_executablePath;
    cpu_type_t m_architecture;

    Vector<std::pair<CString, CString>> m_extractedVariables;
};

} // namespace WebKit

#endif // DynamicLinkerEnvironmentExtractor_h


text:
/* Author:  G. Jungman */

#ifndef __GSL_SF_BESSEL_H__
#define __GSL_SF_BESSEL_H__

#include <stdlib.h>
#include <gsl/gsl_mode.h>
#include <gsl/gsl_precision.h>
#include <gsl/gsl_sf_result.h>

#undef __BEGIN_DECLS
#undef __END_DECLS
#ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
#else
# define __BEGIN_DECLS /* empty */
# define __END_DECLS /* empty */
#endif

__BEGIN_DECLS

/* Regular Bessel Function J_0(x)
 *
 * exceptions: none
 */
int gsl_sf_bessel_J0_e(const double x,  gsl_sf_result * result);
double gsl_sf_bessel_J0(const double x);

/* Regular Bessel Function J_1(x)
 *
 * exceptions: GSL_EUNDRFLW
 */
int gsl_sf_bessel_J1_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_J1(const double x);

/* Regular Bessel Function J_n(x)
 *
 * exceptions: GSL_EUNDRFLW
 */
int gsl_sf_bessel_Jn_e(int n, double x, gsl_sf_result * result);
double gsl_sf_bessel_Jn(const int n, const double x);

/* Regular Bessel Function J_n(x),  nmin <= n <= nmax
 *
 * exceptions: GSL_EDOM, GSL_EUNDRFLW
 */
int gsl_sf_bessel_Jn_array(int nmin, int nmax, double x, double * result_array);

/* Irregular Bessel function Y_0(x)
 *
 * x > 0.0
 * exceptions: GSL_EDOM, GSL_EUNDRFLW
 */
int gsl_sf_bessel_Y0_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_Y0(const double x);

/* Irregular Bessel function Y_1(x)
 *
 * x > 0.0
 * exceptions: GSL_EDOM, GSL_EOVRFLW, GSL_EUNDRFLW
 */
int gsl_sf_bessel_Y1_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_Y1(const double x);

/* Irregular Bessel function Y_n(x)
 *
 * x > 0.0
 * exceptions: GSL_EDOM, GSL_EOVRFLW, GSL_EUNDRFLW
 */
int gsl_sf_bessel_Yn_e(int n,const double x, gsl_sf_result * result);
double gsl_sf_bessel_Yn(const int n,const double x);

/* Irregular Bessel function Y_n(x), nmin <= n <= nmax
 *
 * x > 0.0
 * exceptions: GSL_EDOM, GSL_EOVRFLW, GSL_EUNDRFLW
 */
int gsl_sf_bessel_Yn_array(const int nmin, const int nmax, const double x, double * result_array);

/* Regular modified Bessel function I_0(x)
 *
 * exceptions: GSL_EOVRFLW
 */
int gsl_sf_bessel_I0_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_I0(const double x);

/* Regular modified Bessel function I_1(x)
 *
 * exceptions: GSL_EOVRFLW, GSL_EUNDRFLW
 */
int gsl_sf_bessel_I1_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_I1(const double x);

/* Regular modified Bessel function I_n(x)
 *
 * exceptions: GSL_EOVRFLW, GSL_EUNDRFLW
 */
int gsl_sf_bessel_In_e(const int n, const double x, gsl_sf_result * result);
double gsl_sf_bessel_In(const int n, const double x);

/* Regular modified Bessel function  I_n(x) for n=nmin,...,nmax
 *
 * nmin >=0, nmax >= nmin
 * exceptions: GSL_EDOM, GSL_EOVRFLW, GSL_EUNDRFLW
 */
int gsl_sf_bessel_In_array(const int nmin, const int nmax, const double x, double * result_array);

/* Scaled regular modified Bessel function
 *  exp(-|x|) I_0(x)
 *
 * exceptions: none
 */
int gsl_sf_bessel_I0_scaled_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_I0_scaled(const double x);

/* Scaled regular modified Bessel function
 *  exp(-|x|) I_1(x)
 *
 * exceptions: GSL_EUNDRFLW
 */
int gsl_sf_bessel_I1_scaled_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_I1_scaled(const double x);

/* Scaled regular modified Bessel function
 *  exp(-|x|) I_n(x)
 *
 * exceptions: GSL_EUNDRFLW
 */
int gsl_sf_bessel_In_scaled_e(int n, const double x, gsl_sf_result * result);
double gsl_sf_bessel_In_scaled(const int n, const double x);

/* Scaled regular modified Bessel function
 *  exp(-|x|) I_n(x)  for n=nmin,...,nmax
 *
 * nmin >=0, nmax >= nmin
 * exceptions: GSL_EUNDRFLW
 */
int gsl_sf_bessel_In_scaled_array(const int nmin, const int nmax, const double x, double * result_array);

/* Irregular modified Bessel function K_0(x)
 *
 * x > 0.0
 * exceptions: GSL_EDOM, GSL_EUNDRFLW
 */
int gsl_sf_bessel_K0_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_K0(const double x);

/* Irregular modified Bessel function K_1(x)
 *
 * x > 0.0
 * exceptions: GSL_EDOM, GSL_EOVRFLW, GSL_EUNDRFLW
 */
int gsl_sf_bessel_K1_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_K1(const double x);

/* Irregular modified Bessel function K_n(x)
 *
 * x > 0.0
 * exceptions: GSL_EDOM, GSL_EOVRFLW, GSL_EUNDRFLW
 */
int gsl_sf_bessel_Kn_e(const int n, const double x, gsl_sf_result * result);
double gsl_sf_bessel_Kn(const int n, const double x);

/* Irregular modified Bessel function  K_n(x)  for n=nmin,...,nmax
 *
 * x > 0.0, nmin >=0, nmax >= nmin
 * exceptions: GSL_EDOM, GSL_EOVRFLW, GSL_EUNDRFLW
 */
int gsl_sf_bessel_Kn_array(const int nmin, const int nmax, const double x, double * result_array);

/* Scaled irregular modified Bessel function
 *  exp(x) K_0(x)
 *
 * x > 0.0
 * exceptions: GSL_EDOM
 */
int gsl_sf_bessel_K0_scaled_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_K0_scaled(const double x);

/* Scaled irregular modified Bessel function
 *  exp(x) K_1(x)
 *
 * x > 0.0
 * exceptions: GSL_EDOM, GSL_EUNDRFLW
 */
int gsl_sf_bessel_K1_scaled_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_K1_scaled(const double x);

/* Scaled irregular modified Bessel function
 *  exp(x) K_n(x)
 *
 * x > 0.0
 * exceptions: GSL_EDOM, GSL_EUNDRFLW
 */
int gsl_sf_bessel_Kn_scaled_e(int n, const double x, gsl_sf_result * result);
double gsl_sf_bessel_Kn_scaled(const int n, const double x);

/* Scaled irregular modified Bessel function  exp(x) K_n(x)  for n=nmin,...,nmax
 *
 * x > 0.0, nmin >=0, nmax >= nmin
 * exceptions: GSL_EDOM, GSL_EUNDRFLW
 */
int gsl_sf_bessel_Kn_scaled_array(const int nmin, const int nmax, const double x, double * result_array);

/* Regular spherical Bessel function j_0(x) = sin(x)/x
 *
 * exceptions: none
 */
int gsl_sf_bessel_j0_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_j0(const double x);

/* Regular spherical Bessel function j_1(x) = (sin(x)/x - cos(x))/x
 *
 * exceptions: GSL_EUNDRFLW
 */
int gsl_sf_bessel_j1_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_j1(const double x);

/* Regular spherical Bessel function j_2(x) = ((3/x^2 - 1)sin(x) - 3cos(x)/x)/x
 *
 * exceptions: GSL_EUNDRFLW
 */
int gsl_sf_bessel_j2_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_j2(const double x);

/* Regular spherical Bessel function j_l(x)
 *
 * l >= 0, x >= 0.0
 * exceptions: GSL_EDOM, GSL_EUNDRFLW
 */
int gsl_sf_bessel_jl_e(const int l, const double x, gsl_sf_result * result);
double gsl_sf_bessel_jl(const int l, const double x);

/* Regular spherical Bessel function j_l(x) for l=0,1,...,lmax
 *
 * exceptions: GSL_EDOM, GSL_EUNDRFLW
 */
int gsl_sf_bessel_jl_array(const int lmax, const double x, double * result_array);

/* Regular spherical Bessel function j_l(x) for l=0,1,...,lmax
 * Uses Steed's method.
 *
 * exceptions: GSL_EDOM, GSL_EUNDRFLW
 */
int gsl_sf_bessel_jl_steed_array(const int lmax, const double x, double * jl_x_array);

/* Irregular spherical Bessel function y_0(x)
 *
 * exceptions: none
 */
int gsl_sf_bessel_y0_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_y0(const double x);

/* Irregular spherical Bessel function y_1(x)
 *
 * exceptions: GSL_EUNDRFLW
 */
int gsl_sf_bessel_y1_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_y1(const double x);

/* Irregular spherical Bessel function y_2(x)
 *
 * exceptions: GSL_EUNDRFLW
 */
int gsl_sf_bessel_y2_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_y2(const double x);

/* Irregular spherical Bessel function y_l(x)
 *
 * exceptions: GSL_EUNDRFLW
 */
int gsl_sf_bessel_yl_e(int l, const double x, gsl_sf_result * result);
double gsl_sf_bessel_yl(const int l, const double x);

/* Irregular spherical Bessel function y_l(x) for l=0,1,...,lmax
 *
 * exceptions: GSL_EUNDRFLW
 */
int gsl_sf_bessel_yl_array(const int lmax, const double x, double * result_array);

/* Regular scaled modified spherical Bessel function
 *
 * Exp[-|x|] i_0(x)
 *
 * exceptions: none
 */
int gsl_sf_bessel_i0_scaled_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_i0_scaled(const double x);

/* Regular scaled modified spherical Bessel function
 *
 * Exp[-|x|] i_1(x)
 *
 * exceptions: GSL_EUNDRFLW
 */
int gsl_sf_bessel_i1_scaled_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_i1_scaled(const double x);

/* Regular scaled modified spherical Bessel function
 *
 * Exp[-|x|] i_2(x)
 *
 * exceptions: GSL_EUNDRFLW
 */
int gsl_sf_bessel_i2_scaled_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_i2_scaled(const double x);

/* Regular scaled modified spherical Bessel functions
 *
 * Exp[-|x|] i_l(x)
 *
 * i_l(x) = Sqrt[Pi/(2x)] BesselI[l+1/2,x]
 *
 * l >= 0
 * exceptions: GSL_EDOM, GSL_EUNDRFLW
 */
int gsl_sf_bessel_il_scaled_e(const int l, double x, gsl_sf_result * result);
double gsl_sf_bessel_il_scaled(const int l, const double x);

/* Regular scaled modified spherical Bessel functions
 *
 * Exp[-|x|] i_l(x)
 * for l=0,1,...,lmax
 *
 * exceptions: GSL_EUNDRFLW
 */
int gsl_sf_bessel_il_scaled_array(const int lmax, const double x, double * result_array);

/* Irregular scaled modified spherical Bessel function
 * Exp[x] k_0(x)
 *
 * x > 0.0
 * exceptions: GSL_EDOM, GSL_EUNDRFLW
 */
int gsl_sf_bessel_k0_scaled_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_k0_scaled(const double x);

/* Irregular modified spherical Bessel function
 * Exp[x] k_1(x)
 *
 * x > 0.0
 * exceptions: GSL_EDOM, GSL_EUNDRFLW, GSL_EOVRFLW
 */
int gsl_sf_bessel_k1_scaled_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_k1_scaled(const double x);

/* Irregular modified spherical Bessel function
 * Exp[x] k_2(x)
 *
 * x > 0.0
 * exceptions: GSL_EDOM, GSL_EUNDRFLW, GSL_EOVRFLW
 */
int gsl_sf_bessel_k2_scaled_e(const double x, gsl_sf_result * result);
double gsl_sf_bessel_k2_scaled(const double x);

/* Irregular modified spherical Bessel function
 * Exp[x] k_l[x]
 *
 * k_l(x) = Sqrt[Pi/(2x)] BesselK[l+1/2,x]
 *
 * exceptions: GSL_EDOM, GSL_EUNDRFLW
 */
int gsl_sf_bessel_kl_scaled_e(int l, const double x, gsl_sf_result * result);
double gsl_sf_bessel_kl_scaled(const int l, const double x);

/* Irregular scaled modified spherical Bessel function
 * Exp[x] k_l(x)
 *
 * for l=0,1,...,lmax
 * exceptions: GSL_EDOM, GSL_EUNDRFLW
 */
int gsl_sf_bessel_kl_scaled_array(const int lmax, const double x, double * result_array);

/* Regular cylindrical Bessel function J_nu(x)
 *
 * exceptions: GSL_EDOM, GSL_EUNDRFLW
 */
int gsl_sf_bessel_Jnu_e(const double nu, const double x, gsl_sf_result * result);
double gsl_sf_bessel_Jnu(const double nu, const double x);

/* Irregular cylindrical Bessel function Y_nu(x)
 *
 * exceptions:
 */
int gsl_sf_bessel_Ynu_e(double nu, double x, gsl_sf_result * result);
double gsl_sf_bessel_Ynu(const double nu, const double x);

/* Regular cylindrical Bessel function J_nu(x)
 * evaluated at a series of x values. The array
 * contains the x values. They are assumed to be
 * strictly ordered and positive. The array is
 * over-written with the values of J_nu(x_i).
 *
 * exceptions: GSL_EDOM, GSL_EINVAL
 */
int gsl_sf_bessel_sequence_Jnu_e(double nu, gsl_mode_t mode, size_t size, double * v);

/* Scaled modified cylindrical Bessel functions
 *
 * Exp[-|x|] BesselI[nu, x]
 * x >= 0, nu >= 0
 *
 * exceptions: GSL_EDOM
 */
int gsl_sf_bessel_Inu_scaled_e(double nu, double x, gsl_sf_result * result);
double gsl_sf_bessel_Inu_scaled(double nu, double x);

/* Modified cylindrical Bessel functions
 *
 * BesselI[nu, x]
 * x >= 0, nu >= 0
 *
 * exceptions: GSL_EDOM, GSL_EOVRFLW
 */
int gsl_sf_bessel_Inu_e(double nu, double x, gsl_sf_result * result);
double gsl_sf_bessel_Inu(double nu, double x);

/* Scaled modified cylindrical Bessel functions
 *
 * Exp[+|x|] BesselK[nu, x]
 * x > 0, nu >= 0
 *
 * exceptions: GSL_EDOM
 */
int gsl_sf_bessel_Knu_scaled_e(const double nu, const double x, gsl_sf_result * result);
double gsl_sf_bessel_Knu_scaled(const double nu, const double x);

int gsl_sf_bessel_Knu_scaled_e10_e(const double nu, const double x, gsl_sf_result_e10 * result);

/* Modified cylindrical Bessel functions
 *
 * BesselK[nu, x]
 * x > 0, nu >= 0
 *
 * exceptions: GSL_EDOM, GSL_EUNDRFLW
 */
int gsl_sf_bessel_Knu_e(const double nu, const double x, gsl_sf_result * result);
double gsl_sf_bessel_Knu(const double nu, const double x);

/* Logarithm of modified cylindrical Bessel functions.
 *
 * Log[BesselK[nu, x]]
 * x > 0, nu >= 0
 *
 * exceptions: GSL_EDOM
 */
int gsl_sf_bessel_lnKnu_e(const double nu, const double x, gsl_sf_result * result);
double gsl_sf_bessel_lnKnu(const double nu, const double x);

/* s'th positive zero of the Bessel function J_0(x).
 *
 * exceptions:
 */
int gsl_sf_bessel_zero_J0_e(unsigned int s, gsl_sf_result * result);
double gsl_sf_bessel_zero_J0(unsigned int s);

/* s'th positive zero of the Bessel function J_1(x).
 *
 * exceptions:
 */
int gsl_sf_bessel_zero_J1_e(unsigned int s, gsl_sf_result * result);
double gsl_sf_bessel_zero_J1(unsigned int s);

/* s'th positive zero of the Bessel function J_nu(x).
 *
 * exceptions:
 */
int gsl_sf_bessel_zero_Jnu_e(double nu, unsigned int s, gsl_sf_result * result);
double gsl_sf_bessel_zero_Jnu(double nu, unsigned int s);

__END_DECLS

#endif /* __GSL_SF_BESSEL_H__ */


text:
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using Microsoft.CodeAnalysis.Sarif.Sdk;

namespace Microsoft.CodeAnalysis.Sarif.Driver.Sdk
{
    public interface IResultLogger
    {
        void Log(ResultKind messageKind, IAnalysisContext context, string message);

        void Log(ResultKind messageKind, IAnalysisContext context, FormattedMessage message);
    }
}


text:
import {MethodExpression} from '../expressions/method_expression';
import {IExpression} from '../expressions/iexpression';

export class Day extends MethodExpression {

    constructor(ex: IExpression) {
        super();

        this.expressions = [ex];
    }

    public methodName: string = 'day';
}


text:
define(function(require, exports, modules) {
    require('loadTemplate');
    require('bootstrap');

    $('[data-toggle="tooltip"]').tooltip();

    var showUpload = function() {
        $('#uploadImg').slideToggle();
    };
    $('#openUpload').click(function() {
        showUpload();
    });

    var showSample = function() {
        $('#useSamepleImg').slideToggle();
    };
    $('#sampleBtn').click(function() {
        showSample();
    });

    var uploadOneFile = function() {
        var xhr = new XMLHttpRequest();
        var fd = new FormData();
        var file = document.getElementById('uploadFile').files[0];
        fd.append("multipartFile", file);

        xhr.open("POST", "pictureUpload");
        xhr.send(fd);

    };
    $('#uploadBtn').click(function() {
        uploadOneFile();
    });
});


text:
package org.jboss.arquillian.ajocado.waiting;

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertSame;
import static org.testng.Assert.assertTrue;
import static org.testng.Assert.fail;

import org.jboss.arquillian.ajocado.waiting.selenium.DefaultSeleniumWaiting;
import org.jboss.arquillian.ajocado.waiting.selenium.SeleniumCondition;
import org.jboss.arquillian.ajocado.waiting.selenium.SeleniumWaiting;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

/**
 * @author Lukas Fryc
 * @version $Revision$
 */
public class TestWaitingFailure {
    SeleniumWaiting seleniumWaiting;

    private final SeleniumCondition failureCondition = new SeleniumCondition() {

        @Override
        public boolean isTrue() {
            return false;
        }
    };

    @BeforeClass
    public void setupSeleniumWaiting() {
        seleniumWaiting = new DefaultSeleniumWaiting().timeout(1);
    }

    @Test
    public void testDefault() {

        try {
            seleniumWaiting.until(failureCondition);
            fail();
        } catch (WaitTimeoutException e) {
            // should succeed
        }
    }

    @Test
    public void testCustomRuntimeException() {
        RuntimeException exception = new RuntimeException();

        try {
            seleniumWaiting.failWith(exception).until(failureCondition);
            fail();
        } catch (Exception e) {
            assertSame(e, exception);
        }
    }

    @Test
    public void testCustomException() {
        Exception exception = new Exception();

        try {
            seleniumWaiting.failWith(exception).until(failureCondition);
            fail();
        } catch (Exception e) {
            assertSame(e.getCause(), exception);
        }
    }

    @Test
    public void testMessage() {
        String message = "some message";

        try {
            seleniumWaiting.failWith(message).until(failureCondition);
            fail();
        } catch (Exception e) {
            assertTrue(e instanceof WaitTimeoutException);
            assertEquals(e.getMessage(), message);
        }
    }

    @Test
    public void testDontFail() {
        seleniumWaiting.dontFail().until(failureCondition);
    }
}


text:
module.exports.controller = function(app) {
  this.app = app;

  /*
   * Example usage:
   * /search?q=searchterm
   */
  app.get('/search', function(req, res) {
    console.log("Search")
    var q = encodeURIComponent(req.query.q || "");

    app.get('tpb').search(q
      //, {category: '208'}
    ).then(function(results){
      if (results.length == 0) {
        console.log("no results found");
        // res.json({'results':results});
        // res.send(200);
        // return;
      }

      res.status(200);
      var resultObj = {results: results};
      res.send(JSON.stringify(resultObj));
    }).catch(function(err){
      console.log(err);
    });

  });

}


text:
package ru.alttiri.stepik.contest_java.collections;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

/**
 # 4.10 Lists. Bypassing

 The list of strings is given.

 List<String> nameList = new ArrayList<>(Arrays.asList("Mr.Green", "Mr.Yellow", "Mr.Red"));

 Output each its element in the loop with a new line.

 Sample Output:
 Mr.Green
 Mr.Yellow
 Mr.Red

 */
public class Main10 {
    public static void main(String[] args) {

        List<String> nameList = new ArrayList<>(Arrays.asList("Mr.Green", "Mr.Yellow", "Mr.Red"));

        nameList.forEach(System.out::println);

//        Iterator<String> iterator = nameList.iterator();
//        while (iterator.hasNext()) {
//            System.out.println(iterator.next());
//        }

    }
}


text:
using content::OpenURLParams;

namespace {

// The maximum number of most visited items to display.
const unsigned int kMostVisitedCount = 8;

// The number of recently closed items to get.
const unsigned int kRecentlyClosedCount = 8;

// Menus more than this many chars long will get trimmed.
const int kMaximumMenuWidthInChars = 50;

}  // namespace

struct GlobalHistoryMenu::ClearMenuClosure {
  GtkWidget* container;
  GlobalHistoryMenu* menu_bar;
  int tag;
};

struct GlobalHistoryMenu::GetIndexClosure {
  bool found;
  int current_index;
  int tag;
};

class GlobalHistoryMenu::HistoryItem {
 public:
  HistoryItem()
      : menu_item(NULL),
        session_id(0) {}

  // The title for the menu item.
  string16 title;
  // The URL that will be navigated to if the user selects this item.
  GURL url;

  // A pointer to the menu_item. This is a weak reference in the GTK+ version
  // because the GtkMenu must sink the reference.
  GtkWidget* menu_item;

  // This ID is unique for a browser session and can be passed to the
  // TabRestoreService to re-open the closed window or tab that this
  // references. A non-0 session ID indicates that this is an entry can be
  // restored that way. Otherwise, the URL will be used to open the item and
  // this ID will be 0.
  SessionID::id_type session_id;

  // If the HistoryItem is a window, this will be the vector of tabs. Note
  // that this is a list of weak references. The |menu_item_map_| is the owner
  // of all items. If it is not a window, then the entry is a single page and
  // the vector will be empty.
  std::vector<HistoryItem*> tabs;

 private:
  DISALLOW_COPY_AND_ASSIGN(HistoryItem);
};

GlobalHistoryMenu::GlobalHistoryMenu(Browser* browser)
    : browser_(browser),
      profile_(browser_->profile()),
      top_sites_(NULL),
      ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)),
      tab_restore_service_(NULL) {
}

GlobalHistoryMenu::~GlobalHistoryMenu() {
  if (tab_restore_service_)
    tab_restore_service_->RemoveObserver(this);

  STLDeleteContainerPairSecondPointers(menu_item_history_map_.begin(),
                                       menu_item_history_map_.end());
  menu_item_history_map_.clear();
}

void GlobalHistoryMenu::Init(GtkWidget* history_menu,
                             GtkWidget* history_menu_item) {
  history_menu_.Own(history_menu);

  // We have to connect to |history_menu_item|'s "activate" signal instead of
  // |history_menu|'s "show" signal because we are not supposed to modify the
  // menu during "show"
  g_signal_connect(history_menu_item, "activate",
                   G_CALLBACK(OnMenuActivateThunk), this);

  if (profile_) {
    top_sites_ = profile_->GetTopSites();
    if (top_sites_) {
      GetTopSitesData();

      // Register for notification when TopSites changes so that we can update
      // ourself.
      registrar_.Add(this, chrome::NOTIFICATION_TOP_SITES_CHANGED,
                     content::Source<history::TopSites>(top_sites_));
    }
  }
}

void GlobalHistoryMenu::GetTopSitesData() {
  DCHECK(top_sites_);

  top_sites_->GetMostVisitedURLs(
      base::Bind(&GlobalHistoryMenu::OnTopSitesReceived,
                 weak_ptr_factory_.GetWeakPtr()));
}

void GlobalHistoryMenu::OnTopSitesReceived(
    const history::MostVisitedURLList& visited_list) {
  ClearMenuSection(history_menu_.get(), GlobalMenuBar::TAG_MOST_VISITED);

  int index = GetIndexOfMenuItemWithTag(
      history_menu_.get(),
      GlobalMenuBar::TAG_MOST_VISITED_HEADER) + 1;

  for (size_t i = 0; i < visited_list.size() && i < kMostVisitedCount; ++i) {
    const history::MostVisitedURL& visited = visited_list[i];
    if (visited.url.spec().empty())
      break;  // This is the signal that there are no more real visited sites.

    HistoryItem* item = new HistoryItem();
    item->title = visited.title;
    item->url = visited.url;

    AddHistoryItemToMenu(item,
                         history_menu_.get(),
                         GlobalMenuBar::TAG_MOST_VISITED,
                         index++);
  }
}

GlobalHistoryMenu::HistoryItem* GlobalHistoryMenu::HistoryItemForMenuItem(
    GtkWidget* menu_item) {
  MenuItemToHistoryMap::iterator it = menu_item_history_map_.find(menu_item);
  return it != menu_item_history_map_.end() ? it->second : NULL;
}

GlobalHistoryMenu::HistoryItem* GlobalHistoryMenu::HistoryItemForTab(
    const TabRestoreService::Tab& entry) {
  const TabNavigation& current_navigation =
      entry.navigations.at(entry.current_navigation_index);
  HistoryItem* item = new HistoryItem();
  item->title = current_navigation.title();
  item->url = current_navigation.virtual_url();
  item->session_id = entry.id;

  return item;
}

GtkWidget* GlobalHistoryMenu::AddHistoryItemToMenu(HistoryItem* item,
                                                   GtkWidget* menu,
                                                   int tag,
                                                   int index) {
  string16 title = item->title;
  std::string url_string = item->url.possibly_invalid_spec();

  if (title.empty())
    title = UTF8ToUTF16(url_string);
  ui::ElideString(title, kMaximumMenuWidthInChars, &title);

  GtkWidget* menu_item = gtk_menu_item_new_with_label(
      UTF16ToUTF8(title).c_str());

  item->menu_item = menu_item;
  gtk_widget_show(menu_item);
  g_object_set_data(G_OBJECT(menu_item), "type-tag", GINT_TO_POINTER(tag));
  g_signal_connect(menu_item, "activate",
                   G_CALLBACK(OnRecentlyClosedItemActivatedThunk), this);

  std::string tooltip = gtk_util::BuildTooltipTitleFor(item->title, item->url);
  gtk_widget_set_tooltip_markup(menu_item, tooltip.c_str());

  menu_item_history_map_.insert(std::make_pair(menu_item, item));
  gtk_menu_shell_insert(GTK_MENU_SHELL(menu), menu_item, index);

  return menu_item;
}

int GlobalHistoryMenu::GetIndexOfMenuItemWithTag(GtkWidget* menu, int tag_id) {
  GetIndexClosure closure;
  closure.found = false;
  closure.current_index = 0;
  closure.tag = tag_id;

  gtk_container_foreach(
      GTK_CONTAINER(menu),
      reinterpret_cast<void (*)(GtkWidget*, void*)>(GetIndexCallback),
      &closure);

  return closure.current_index;
}

void GlobalHistoryMenu::ClearMenuSection(GtkWidget* menu, int tag) {
  ClearMenuClosure closure;
  closure.container = menu;
  closure.menu_bar = this;
  closure.tag = tag;

  gtk_container_foreach(
      GTK_CONTAINER(menu),
      reinterpret_cast<void (*)(GtkWidget*, void*)>(ClearMenuCallback),
      &closure);
}

// static
void GlobalHistoryMenu::GetIndexCallback(GtkWidget* menu_item,
                                         GetIndexClosure* closure) {
  int tag = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(menu_item), "type-tag"));
  if (tag == closure->tag)
    closure->found = true;

  if (!closure->found)
    closure->current_index++;
}

// static
void GlobalHistoryMenu::ClearMenuCallback(GtkWidget* menu_item,
                                          ClearMenuClosure* closure) {
  DCHECK_NE(closure->tag, 0);

  int tag = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(menu_item), "type-tag"));
  if (closure->tag == tag) {
    HistoryItem* item = closure->menu_bar->HistoryItemForMenuItem(menu_item);

    if (item) {
      closure->menu_bar->menu_item_history_map_.erase(menu_item);
      delete item;
    }

    GtkWidget* submenu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(menu_item));
    if (submenu)
      closure->menu_bar->ClearMenuSection(submenu, closure->tag);

    gtk_container_remove(GTK_CONTAINER(closure->container), menu_item);
  }
}

void GlobalHistoryMenu::Observe(int type,
                                const content::NotificationSource& source,
                                const content::NotificationDetails& details) {
  if (type == chrome::NOTIFICATION_TOP_SITES_CHANGED) {
    GetTopSitesData();
  } else {
    NOTREACHED();
  }
}

void GlobalHistoryMenu::TabRestoreServiceChanged(TabRestoreService* service) {
  const TabRestoreService::Entries& entries = service->entries();

  ClearMenuSection(history_menu_.get(), GlobalMenuBar::TAG_RECENTLY_CLOSED);

  // We'll get the index the "Recently Closed" header. (This can vary depending
  // on the number of "Most Visited" items.
  int index = GetIndexOfMenuItemWithTag(
      history_menu_.get(),
      GlobalMenuBar::TAG_RECENTLY_CLOSED_HEADER) + 1;

  unsigned int added_count = 0;
  for (TabRestoreService::Entries::const_iterator it = entries.begin();
       it != entries.end() && added_count < kRecentlyClosedCount; ++it) {
    TabRestoreService::Entry* entry = *it;

    if (entry->type == TabRestoreService::WINDOW) {
      TabRestoreService::Window* entry_win =
          static_cast<TabRestoreService::Window*>(entry);
      std::vector<TabRestoreService::Tab>& tabs = entry_win->tabs;
      if (tabs.empty())
        continue;

      // Create the item for the parent/window.
      HistoryItem* item = new HistoryItem();
      item->session_id = entry_win->id;

      GtkWidget* submenu = gtk_menu_new();
      GtkWidget* restore_item = gtk_menu_item_new_with_label(
          l10n_util::GetStringUTF8(
              IDS_HISTORY_CLOSED_RESTORE_WINDOW_LINUX).c_str());
      g_object_set_data(G_OBJECT(restore_item), "type-tag",
                        GINT_TO_POINTER(GlobalMenuBar::TAG_RECENTLY_CLOSED));
      g_signal_connect(restore_item, "activate",
                       G_CALLBACK(OnRecentlyClosedItemActivatedThunk), this);
      gtk_widget_show(restore_item);

      // The mac version of this code allows the user to click on the parent
      // menu item to have the same effect as clicking the restore window
      // submenu item. GTK+ helpfully activates a menu item when it shows a
      // submenu so toss that feature out.
      menu_item_history_map_.insert(std::make_pair(restore_item, item));
      gtk_menu_shell_append(GTK_MENU_SHELL(submenu), restore_item);

      GtkWidget* separator = gtk_separator_menu_item_new();
      gtk_widget_show(separator);
      gtk_menu_shell_append(GTK_MENU_SHELL(submenu), separator);

      // Loop over the window's tabs and add them to the submenu.
      int subindex = 2;
      std::vector<TabRestoreService::Tab>::const_iterator iter;
      for (iter = tabs.begin(); iter != tabs.end(); ++iter) {
        TabRestoreService::Tab tab = *iter;
        HistoryItem* tab_item = HistoryItemForTab(tab);
        item->tabs.push_back(tab_item);
        AddHistoryItemToMenu(tab_item,
                             submenu,
                             GlobalMenuBar::TAG_RECENTLY_CLOSED,
                             subindex++);
      }

      std::string title = item->tabs.size() == 1 ?
          l10n_util::GetStringUTF8(
              IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_SINGLE) :
          l10n_util::GetStringFUTF8(
              IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_MULTIPLE,
              base::IntToString16(item->tabs.size()));

      // Create the menu item parent. Unlike mac, it's can't be activated.
      GtkWidget* parent_item = gtk_menu_item_new_with_label(title.c_str());
      gtk_widget_show(parent_item);
      g_object_set_data(G_OBJECT(parent_item), "type-tag",
                        GINT_TO_POINTER(GlobalMenuBar::TAG_RECENTLY_CLOSED));
      gtk_menu_item_set_submenu(GTK_MENU_ITEM(parent_item), submenu);

      gtk_menu_shell_insert(GTK_MENU_SHELL(history_menu_.get()), parent_item,
                            index++);
      ++added_count;
    } else if (entry->type == TabRestoreService::TAB) {
      TabRestoreService::Tab* tab = static_cast<TabRestoreService::Tab*>(entry);
      HistoryItem* item = HistoryItemForTab(*tab);
      AddHistoryItemToMenu(item,
                           history_menu_.get(),
                           GlobalMenuBar::TAG_RECENTLY_CLOSED,
                           index++);
      ++added_count;
    }
  }
}

void GlobalHistoryMenu::TabRestoreServiceDestroyed(
    TabRestoreService* service) {
  tab_restore_service_ = NULL;
}

void GlobalHistoryMenu::OnRecentlyClosedItemActivated(GtkWidget* sender) {
  WindowOpenDisposition disposition =
      event_utils::DispositionForCurrentButtonPressEvent();
  HistoryItem* item = HistoryItemForMenuItem(sender);

  // If this item can be restored using TabRestoreService, do so. Otherwise,
  // just load the URL.
  TabRestoreService* service =
      TabRestoreServiceFactory::GetForProfile(browser_->profile());
  if (item->session_id && service) {
    service->RestoreEntryById(browser_->tab_restore_service_delegate(),
                              item->session_id, UNKNOWN);
  } else {
    DCHECK(item->url.is_valid());
    browser_->OpenURL(OpenURLParams(item->url, content::Referrer(), disposition,
                      content::PAGE_TRANSITION_AUTO_BOOKMARK, false));
  }
}

void GlobalHistoryMenu::OnMenuActivate(GtkWidget* sender) {
  if (!tab_restore_service_) {
    tab_restore_service_ = TabRestoreServiceFactory::GetForProfile(profile_);
    if (tab_restore_service_) {
      tab_restore_service_->LoadTabsFromLastSession();
      tab_restore_service_->AddObserver(this);

      // If LoadTabsFromLastSession doesn't load tabs, it won't call
      // TabRestoreServiceChanged(). This ensures that all new windows after
      // the first one will have their menus populated correctly.
      TabRestoreServiceChanged(tab_restore_service_);
    }
  }
}


text:
@class DVTFilePath, NSString;

@interface IDEPlaygroundAuxiliarySourceFrameworkStructure : NSObject <NSSecureCoding>
{
    DVTFilePath *_buildProductsPath;
    NSString *_sourcesModuleName;
    DVTFilePath *_frameworkBundlePath;
    DVTFilePath *_originalResourcesDirectory;
    DVTFilePath *_resourcesFolderPath;
    DVTFilePath *_modulesFolderPath;
    DVTFilePath *_moduleBundlePath;
    DVTFilePath *_modulePath;
    DVTFilePath *_dylibPath;
}

+ (BOOL)supportsSecureCoding;
@property(readonly, copy) DVTFilePath *dylibPath; // @synthesize dylibPath=_dylibPath;
@property(readonly, copy) DVTFilePath *modulePath; // @synthesize modulePath=_modulePath;
@property(readonly, copy) DVTFilePath *moduleBundlePath; // @synthesize moduleBundlePath=_moduleBundlePath;
@property(readonly, copy) DVTFilePath *modulesFolderPath; // @synthesize modulesFolderPath=_modulesFolderPath;
@property(readonly, copy) DVTFilePath *resourcesFolderPath; // @synthesize resourcesFolderPath=_resourcesFolderPath;
@property(readonly, copy) DVTFilePath *originalResourcesDirectory; // @synthesize originalResourcesDirectory=_originalResourcesDirectory;
@property(readonly, copy) DVTFilePath *frameworkBundlePath; // @synthesize frameworkBundlePath=_frameworkBundlePath;
@property(readonly, copy) NSString *sourcesModuleName; // @synthesize sourcesModuleName=_sourcesModuleName;
@property(readonly, copy) DVTFilePath *buildProductsPath; // @synthesize buildProductsPath=_buildProductsPath;
- (BOOL)removeDirectoryStructure:(id *)arg1;
- (BOOL)createDirectoryStructureIfNecessary:(id *)arg1;
- (unsigned long long)hash;
- (BOOL)isEqual:(id)arg1;
- (void)encodeWithCoder:(id)arg1;
- (id)initWithCoder:(id)arg1;
- (id)initWithBuildProductsPath:(id)arg1 resourcesDirectory:(id)arg2 sourcesModuleName:(id)arg3;

@end


text:
package net.cloudkit.enterprises.mongodb;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.mongodb.core.MongoOperations;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

@RunWith(SpringJUnit4ClassRunner.class)
// ApplicationContext will be loaded from "classpath:/app-config.xml"
@ContextConfiguration(locations = {"classpath*:application-context*.xml"})
@ActiveProfiles("development")
public class MongoTest {

    @Autowired
    MongoOperations mongoTemplate;

    @Test
    public void test() {
        // production
        // System.setProperty("spring.profiles.active", "development");

        // TODO
        /*
        mongoTemplate.findOne(new Query(Criteria.where("name").is(name)), Users.class, USER_COLLECTION);
        mongoTemplate.remove(new Query(Criteria.where("name").is(name)),Users.class,USER_COLLECTION);
        mongoTemplate.updateFirst(new Query(Criteria.where("name").is(name)), Update.update(key, value), Users.class);
        mongoTemplate.findAll(Users.class);
        */
    }

    public static void main(String[] args) {

    }

}


text:
<!--
  ~ Copyright (c) 2010-2017 Evolveum
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<role oid="00000001-d34d-b33f-f00d-00000000010b">
	<name>Role10b</name>
	<description>Induced by Role1b</description>
	<assignment> <!-- metarole 1 'default' -->
		<targetRef oid="00000001-d34d-b33f-f00d-M00000000001" type="RoleType"/>
	</assignment>
</role>


text:
cask 'expandrive' do
  version '6.1.1'
  sha256 '5e49e51a0917c3fa30256e41d5f694802edec01d7ea36a505871b843061e6ddb'

  url "https://updates.expandrive.com/apps/expandrive/v/#{version.dots_to_hyphens}/download.dmg"
  name 'ExpanDrive'
  homepage 'https://www.expandrive.com/apps/expandrive/'

  app 'ExpanDrive.app'

  zap trash: [
               '~/Library/Application Support/ExpanDrive',
               '~/Library/Preferences/com.expandrive.exfs.plist',
               '~/Library/Preferences/com.expandrive.ExpanDrive.plist',
               '~/Library/Preferences/com.expandrive.ExpanDrive2.plist',
               '~/Library/Preferences/com.expandrive.ExpanDrive3.plist',
               '~/Library/Preferences/com.expandrive.ExpanDrive.helper.plist',
             ]
end


text:
class StatusesController < ApplicationController
  authorize_resource

  # GET /statuses
  # GET /statuses.xml
  def index
    @statuses = Status.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @statuses }
    end
  end

  # GET /statuses/new
  # GET /statuses/new.xml
  def new
    @status = Status.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @status }
    end
  end

  # GET /statuses/1/edit
  def edit
    @status = Status.find(params[:id])
  end

  # POST /statuses
  # POST /statuses.xml
  def create
    @status = Status.new(params[:status])

    respond_to do |format|
      if @status.save
        format.html { redirect_to(statuses_url, :notice => 'Status was successfully created.') }
        format.xml  { render :xml => @status, :status => :created, :location => @status }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @status.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /statuses/1
  # PUT /statuses/1.xml
  def update
    @status = Status.find(params[:id])

    respond_to do |format|
      if @status.update_attributes(params[:status])
        format.html { redirect_to(statuses_url, :notice => 'Status was successfully updated.') }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @status.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /statuses/1
  # DELETE /statuses/1.xml
  def destroy
    @status = Status.find(params[:id])
    @status.destroy

    respond_to do |format|
      format.html { redirect_to(statuses_url) }
      format.xml  { head :ok }
    end
  end
end


text:
namespace Lucia {
namespace Maigui
{
    namespace OpenGL
    {
        struct Vertex_Buffer
        {
            Vertex_Buffer(float nx,float ny,float nz,float nu,float nv,float ne,float nn):
            x(nx),y(ny),z(nz),u(nu),v(nv),e(ne),n(nn){};
            float x;
            float y;
            float z;
            float u;
            float v;
            float e;
            float n;
        };
        enum Shader
        {
            ITEM,
            TEXT,
            NIL
        };
        extern Shader activeShader;
        extern GLuint programID;
        // We do not need a sphere or any other primitive just yet.
        // vao and size of the square
        extern GLuint VaoID;
        extern GLuint VboID;
        extern string vertex;
        extern string Fragment;
        extern std::vector<Vertex_Buffer> data;

        void attachWrappers(Skin *s,Maths::Matrix<4> *view,Maths::Matrix<4> *projection);
        void cleanUp();
    };
};
}

#endif // MAIGUI_OPENGL_H_INCLUDED