text:
<!DOCTYPE html>

        <meta charset="utf-8">

        <title>AppUI - Web App Bootstrap Admin Template</title>

        <meta name="description" content="AppUI is a Web App Bootstrap Admin Template created by pixelcave and published on Themeforest">
        <meta name="author" content="pixelcave">
        <meta name="robots" content="noindex, nofollow">

        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

        <link rel="shortcut icon" href="img/favicon.png">
        <link rel="apple-touch-icon" href="img/icon57.png" sizes="57x57">
        <link rel="apple-touch-icon" href="img/icon72.png" sizes="72x72">
        <link rel="apple-touch-icon" href="img/icon76.png" sizes="76x76">
        <link rel="apple-touch-icon" href="img/icon114.png" sizes="114x114">
        <link rel="apple-touch-icon" href="img/icon120.png" sizes="120x120">
        <link rel="apple-touch-icon" href="img/icon144.png" sizes="144x144">
        <link rel="apple-touch-icon" href="img/icon152.png" sizes="152x152">
        <link rel="apple-touch-icon" href="img/icon180.png" sizes="180x180">

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

        <link rel="stylesheet" href="css/plugins.css">

        <link rel="stylesheet" href="css/main.css">

        <link rel="stylesheet" href="css/themes.css">

Loading..

Profile

                                <form action="index.html" method="post" class="form-control-borderless" onsubmit="return false;">

                                        Name
                                        <input type="text" id="side-profile-name" name="side-profile-name" class="form-control" value="John Doe">

                                        Email
                                        <input type="email" id="side-profile-email" name="side-profile-email" class="form-control" value="john.doe@example.com">

                                        New Password
                                        <input type="password" id="side-profile-password" name="side-profile-password" class="form-control">

                                        Confirm New Password
                                        <input type="password" id="side-profile-password-confirm" name="side-profile-password-confirm" class="form-control">

                                        <button type="submit" class="btn btn-effect-ripple btn-primary" onclick="App.sidebar('close-sidebar-alt');">Save</button>

                                </form>

Settings

                                <form action="index.html" method="post" class="form-horizontal form-control-borderless" onsubmit="return false;">

                                        Notifications

                                            <input type="checkbox" checked>

                                        Public Profile

                                            <input type="checkbox" checked>

                                        Enable API

                                            <input type="checkbox">

                                        <button type="submit" class="btn btn-effect-ripple btn-primary" onclick="App.sidebar('close-sidebar-alt');">Save</button>

                                </form>

                             AppUI

                                    Dashboard

                                    User Interface

                                            Widgets

                                            Elements

                                                    Blocks & Grid

                                                    Typography

                                                    Buttons & Dropdowns

                                                    Navigation & More

                                                    Progress & Loading

                                                    Tables

                                            Forms

                                                    Components

                                                    Wizard

                                                    Validation

                                            Icon Packs

                                                    Font Awesome

                                                    Glyphicons Pro

                                    Components

                                            To-do List

                                            Gallery

                                            Google Maps

                                            Calendar

                                            Charts

                                            CSS3 Animations

                                            Tree View Lists

                                            Nestable & Sortable Lists

                                    UI Layouts

                                            Static

                                            Static Fixed Width

                                            Top Header (Fixed)

                                            Bottom Header (Fixed)

                                            Sidebar Mini (Static)

                                            Sidebar Mini (Fixed)

                                            Visible Alternative Sidebar

                                    Extra Pages

                                            Base

                                                    Blank

                                                    Error

                                                    Search Results (5)

                                                    FAQ

                                                    Invoice

                                            Web Application

                                                    User Profile

                                                    Forum (3)

                                                    Pricing Tables

                                                    Article

                                                    Timeline

                                                    Contacts

                                                    Tickets

                                            Login, Register & Lock

                                                    Login

                                                    Login 2

                                                    Password Reminder

                                                    Register

                                                    Lock Screen

                                    Email Center

                                    Social Net

                                    Media Box

                                    eStore

                            78 GB / 100 GB

                            Crafted with  by pixelcave

                             © AppUI 2.7

                                SOCIAL NET

                                <form action="page_ready_search_results.html" method="post" class="navbar-form-custom">
                                    <input type="text" id="top-search" name="top-search" class="form-control" placeholder="Search..">
                                </form>

                                        ADMINISTRATOR

                                            Inbox

                                            Profile

                                            Media Manager

                                            Settings

                                            Lock Account

                                            Log out

                            People

                                        Online

                                                5
                                                Olivia Rogers
                                                Graphic Designer

                                                3
                                                Joe Jones
                                                Web Designer

                                                2
                                                Nancy Cruz
                                                Writer

                                                Ethan Hayes
                                                Web Developer

                                                Julie Bennett
                                                Photographer

                                        Away

                                                Harold Green
                                                Product Manager

                                                Alan George
                                                Freelancer

                                        Offline

                                                Nathan Moore
                                                UX Designer

                                                Jason Gomez
                                                CEO

Jeremy Doe

 Web Designer, Tokyo

                                                 Friend Request

                                                 Follow

                                Anna Wigren (2)

2 min ago

                                         Hey admin?

                                         How are you?

just now

                                         I'm fine, thanks! And you?

                                <form action="page_app_social.html" method="post" class="remove-margin">
                                    <input type="text" id="chat-message" name="chat-message" class="form-control" placeholder="Type a message and hit enter..">
                                </form>

                                        just now
                                        Dennis Franklin uploaded 4 New Photos

                                             Love
                                             Tweet

                                        <form action="page_app_social.html" method="post" onsubmit="return false;">
                                            <textarea class="form-control" rows="2" placeholder="Write your comment.."></textarea>
                                            <button type="submit" class="btn btn-effect-ripple btn-sm btn-primary">Publish</button>
                                        </form>

                                        1 week ago
                                        George Nelson posted 1 New Article

How to be more productive Read More..

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas ultrices, justo vel imperdiet gravida, urna ligula hendrerit nibh, ac cursus nibh sapien in purus. Mauris tincidunt tincidunt turpis in porta. Integer fermentum tincidunt auctor. Vestibulum ullamcorper, odio sed rhoncus imperdiet, enim elit sollicitudin orci, eget dictum leo mi nec lectus.

Nam commodo turpis id lectus scelerisque vulputate. Integer sed dolor erat. Fusce erat ipsum, varius vel euismod sed, tristique et lectus? Etiam egestas fringilla enim, id convallis lectus laoreet at. Fusce purus nisi, gravida sed consectetur ut, interdum quis nisi. Quisque egestas nisl id lectus facilisis scelerisque? Proin rhoncus dui at ligula vestibulum ut facilisis ante sodales! Suspendisse potenti. Aliquam tincidunt sollicitudin sem nec ultrices. Sed at mi velit. Ut egestas tempor est, in cursus enim venenatis eget!

                                             Love
                                             Tweet

                                                    Madison Carr
                                                    50 min ago

Thank you for this, many great tips!

                                                    Vincent Castillo
                                                    1 day ago

An awesome read, well done!

                                                    <form action="page_app_social.html" method="post" onsubmit="return false;">
                                                        <textarea class="form-control" rows="2" placeholder="Write your comment.."></textarea>
                                                        <button type="submit" class="btn btn-effect-ripple btn-sm btn-primary">Publish</button>
                                                    </form>

                                        30 min ago
                                        Laura Ross checked in at Bar-Cafe

                                             Love
                                             Tweet

                                        <form action="page_app_social.html" method="post" onsubmit="return false;">
                                            <textarea class="form-control" rows="2" placeholder="Write your comment.."></textarea>
                                            <button type="submit" class="btn btn-effect-ripple btn-sm btn-primary">Publish</button>
                                        </form>

                                        2 People
                                        Birthday this week

                                                        Dylan Cruz

                                                        29 years old on Friday

                                                        Phillip Peters

                                                        34 years old tomorrow

                                        5 People
                                        People you may know

                                                        Sarah Hart

                                                        5 common friends

                                                        Mark Aguilar

                                                        2 common friends

                                                        Karen Jackson

                                                        3 common friends

                                                        Russell Larson

                                                        5 common friends

                                                        Howard Adams

                                                        5 common friends

                                        Twitter

                                                    30 min ago
                                                    Howard Adams

In hac habitasse platea dictumst. Proin ac nibh rutrum lectus rhoncus eleifend. #dev

                                                    3 hours ago
                                                    Jeremy Doe

Sed porttitor pretium venenatis. Suspendisse potenti. Aliquam quis ligula elit. Aliquam at orci ac neque semper dictum.

                                                    yesterday
                                                    Russell Larson

In hac habitasse platea dictumst. Proin ac nibh rutrum lectus rhoncus eleifend #design

                                                    2 days ago
                                                    Nancy Kruz

Donec lacinia venenatis metus at bibendum? In hac habitasse platea dictumst. Proin ac nibh rutrum lectus rhoncus eleifend.

                                                    3 days ago
                                                    Madison Carr

In hac habitasse platea dictumst. Proin ac nibh rutrum lectus rhoncus eleifend.

                                        Pro Plan
                                        Account Status

                                                            100GB

                                                            3 Databases

                                                            2 Emails

                                                             Support


text:
require 'test_helper'

class GeocodeJobMock
  attr_reader :calls_to

  def initialize
    @calls_to = Hash.new{|h, k| h[k] = 0}
  end

  def perform_later(*args)
    called(__method__)
  end

  private
    def called(method_name)
      @calls_to[method_name] += 1
    end
end

class LocationsControllerTest < ActionController::TestCase
  setup do
    LocationsController::geocodejob = GeocodeJobMock.new
    @location = locations(:one)
  end

  test "should get index" do
    get :index
    assert_response :success
    assert_not_nil assigns(:locations)
  end

  test "should get new" do
    get :new
    assert_response :success
  end

  test "should show location" do
    get :show, params: { id: @location }
    assert_response :success
  end

  test "should get edit" do
    get :edit, params: { id: @location }
    assert_response :success
  end

  test "should update location" do
    city_new = @location.city + "X"
    @request.headers['X-Forwarded-For'] = @location.host
    patch :update, params: {
      id: @location,
      location: {
        city: city_new,
        host: @location.host,
        latitude: @location.latitude,
        longitude: @location.longitude
      }
    }
    assert_redirected_to location_path(assigns(:location))
    @location.reload
    assert_equal city_new, @location.city
  end

  test "should destroy location" do
    assert_difference('Location.count', -1) do
      delete :destroy, params: { id: @location }
    end

    assert_redirected_to locations_path
  end

  test "should obtain new location when unknown" do
    @request.headers['X-Forwarded-For'] = '192.168.2.1'
    assert_difference("LocationsController::geocodejob.calls_to[:perform_later]", 1) do
      assert_difference('Location.count', 1) do
        get :current, format: :json
        assert_response :success
      end
    end
  end

  test "should obtain new location when known location is old" do
    @request.headers['X-Forwarded-For'] = '192.168.1.2'
    assert_difference("LocationsController::geocodejob.calls_to[:perform_later]", 1) do
      assert_difference('Location.count', 1) do
        get :current, format: :json
        assert_response :success
      end
    end
  end

  test "should obtain existing location when known" do
    # in test/fixtures/locations.yml, id: 1
    @request.headers['X-Forwarded-For'] = '192.168.1.1'
    assert_difference("LocationsController::geocodejob.calls_to[:perform_later]", 0) do
      assert_difference('Location.count', 0) do
        get :current, format: :json
        assert_response :success
        json = JSON.parse(response.body)
        assert_equal 1, json['id']
        assert_equal @request.headers['X-Forwarded-For'], json['host']
      end
    end
  end

  test "should obtain latest location when known" do
    # in test/fixtures/locations.yml, id: 4 and 5
    assert_difference("LocationsController::geocodejob.calls_to[:perform_later]", 0) do
      @request.headers['X-Forwarded-For'] = '192.168.1.4'
      assert_difference('Location.count', 0) do
        get :current, format: :json
        assert_response :success
        json = JSON.parse(response.body)
        assert_equal 5, json['id']
      end
    end
  end

  test "should obtain server location when known" do
  # in test/fixtures/locations.yml, id: 6
  @request.headers['HTTP_HOST'] = 'www.example.com'
    assert_difference('Location.count', 0) do
      get :server, format: :json
      assert_response :success
      json = JSON.parse(response.body)
      assert_equal 6, json['id']
      assert_equal @request.headers['HTTP_HOST'], json['host']
    end
  end
end

redpajama_set_name: RedPajamaGithub


text:
package fr.wuzuf.netty.handlers.codec.tn3270;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.ChannelPipeline;
import io.netty.channel.socket.SocketChannel;
import io.netty.handler.logging.LogLevel;
import io.netty.handler.logging.LoggingHandler;

/**
 * Creates a newly configured {@link ChannelPipeline} for a new channel.
 */
public class ClientInitializer extends ChannelInitializer<SocketChannel> {

    public ClientInitializer() {
    }

    @Override
    public void initChannel(SocketChannel ch) {
        ChannelPipeline pipeline = ch.pipeline();

        // Logging handler useful for troubleshooting
        pipeline.addLast(new LoggingHandler(LogLevel.INFO));

        // TN3270 Decoders and encoders
        pipeline.addLast(new Codec());

        // Handshake
        pipeline.addLast(new HandshakeMessageHandler());

        // Reply to timing marks
        pipeline.addLast(new TimingMarkHandler());

        // TN3270 Decoding
        pipeline.addLast(new DataMessageHandler());

        // End of Message

    }
}


text:
enum lightType {
  FIRE,
  CANDLE,
  LIGHTBULB
};

class CandleLED {
	public:
    CandleLED(uint8_t);
		CandleLED(uint8_t, lightType);
		CandleLED(uint8_t, lightType, float);
    void update();
    void flash(bool);
  private:
    uint8_t _pin;
    uint32_t _nextUpdateMillis;
		float _intensity;
		uint8_t _type;
    bool _isFlashing;
};

#endif


text:
package jlApns

import (
	"bytes"
	"encoding/binary"
	"encoding/hex"
	"encoding/json"
	"errors"
	"log"
)

type AlertDictionary struct {
	Title        string   `json:"title,omitempty"`
	Body         string   `json:"body,omitempty"`
	TitleLocKey  string   `json:"title-loc-key,omitempty"`
	TitleLocArgs []string `json:"title-loc-args,omitempty"`
	ActionLocKey string   `json:"action-loc-key,omitempty"`
	LocKey       string   `json:"loc-key,omitempty"`
	LocArgs      []string `json:"loc-args,omitempty"`
	LaunchImage  string   `json:"launch-image,omitempty"`
}

type Payload struct {
	Alert            interface{} `json:"alert,omitempty"`
	Badge            int         `json:"badge,omitempty"`
	Sound            string      `json:"sound,omitempty"`
	ContentAvailable int         `json:"content-available,omitempty"`
	Category         string      `json:"category,omitempty"`
}

func NewPayload(Alert interface{}, Badge int, Sound string) *Payload {
	return &Payload{Alert: Alert, Badge: Badge, Sound: Sound}
}

func (p *Payload) toJsonData() ([]byte, error) {
	return json.Marshal(map[string]interface{}{"aps": p})
}

type FailInfo struct {
	Pid  uint32
	Code uint8
}

func NewFailInfoFromByte(data []byte) *FailInfo {
	if len(data) != 6 || data[0] != 8 {
		return nil
	}
	buf := bytes.NewReader(data[2:6])
	var value uint32
	binary.Read(buf, binary.LittleEndian, &value)
	return &FailInfo{Pid: value, Code: uint8(data[1])}
}

const (
	deviceTokenItemid            = 1
	payloadItemid                = 2
	notificationIdentifierItemid = 3
	expirationDateItemid         = 4
	priorityItemid               = 5
)

type PushNotificationReq struct {
	Tokens  []string
	payload *Payload
	Expiry  uint32 `json:",omitempty"`
}

func EncodePushNotificationToData(identifier int32, expiry uint32, tokenString string, payloadData []byte, priority uint8) ([]byte, error) {
	token, err := hex.DecodeString(tokenString)
	if err != nil {
		return nil, err
	}
	if len(token) != 32 {
		return nil, errors.New("device token has incorrect length")
	}
	if len(payloadData) > 2048 {
		payloadData = payloadData[:2048]
	}

	// 1+4+ (1+2+32) + (1+2+len(payloadData)) + (1+2+4) + (1+2+4) + (1+2+1)
	totolLen := 1 + 4 + (1 + 2 + 32) + (1 + 2 + len(payloadData)) + (1 + 2 + 4) + (1 + 2 + 4) + (1 + 2 + 1)
	buf := make([]byte, 0, totolLen)
	frameBuffer := bytes.NewBuffer(buf)
	binary.Write(frameBuffer, binary.BigEndian, uint8(2))
	binary.Write(frameBuffer, binary.BigEndian, uint32(totolLen-5))

	binary.Write(frameBuffer, binary.BigEndian, uint8(deviceTokenItemid))
	binary.Write(frameBuffer, binary.BigEndian, uint16(32))
	binary.Write(frameBuffer, binary.BigEndian, token)

	binary.Write(frameBuffer, binary.BigEndian, uint8(payloadItemid))
	binary.Write(frameBuffer, binary.BigEndian, uint16(len(payloadData)))
	binary.Write(frameBuffer, binary.BigEndian, payloadData)

	binary.Write(frameBuffer, binary.BigEndian, uint8(notificationIdentifierItemid))
	binary.Write(frameBuffer, binary.BigEndian, uint16(4))
	binary.Write(frameBuffer, binary.BigEndian, uint32(identifier))

	binary.Write(frameBuffer, binary.BigEndian, uint8(expirationDateItemid))
	binary.Write(frameBuffer, binary.BigEndian, uint16(4))
	binary.Write(frameBuffer, binary.BigEndian, uint32(expiry))

	binary.Write(frameBuffer, binary.BigEndian, uint8(priorityItemid))
	binary.Write(frameBuffer, binary.BigEndian, uint16(1))
	binary.Write(frameBuffer, binary.BigEndian, uint8(priority))

	buf = frameBuffer.Bytes()
	if len(buf) != totolLen {
		log.Printf("unknown bug for encode length:%d vs %d", len(buf), totolLen)
		return nil, errors.New("unknown bug for encode length")
	}

	return buf, nil
}


text:
@interface DownloadManager : NetworkAbstractManager

@end
@interface DownloadEntity : NSObject
@property (nonatomic, strong) NSString *did;
@property (nonatomic, assign, getter = isCached) BOOL cached;

@end


text:
import Ember from 'ember';

export default Ember.Controller.extend({
  selectedSet: null,

  actions: {
    showEditSetModal: function (set) {
      this.set('selectedSet', set);
      this.get('editSetModal').send('show');
    },
    editSet: function () {
      let set = this.get('selectedSet');
      set.set('items', set.get('itemsTextarea').split('\n').join(','));
      set.save();
    }
  }
});


text:
#ifndef SkDraw_DEFINED
#define SkDraw_DEFINED

#include "SkCanvas.h"
#include "SkMask.h"
#include "SkPaint.h"
#include "SkStrokeRec.h"

class SkBitmap;
class SkClipStack;
class SkBaseDevice;
class SkBlitter;
class SkMatrix;
class SkPath;
class SkRegion;
class SkRasterClip;
struct SkDrawProcs;
struct SkRect;
class SkRRect;

class SkDraw {
public:
    SkDraw();

    void    drawPaint(const SkPaint&) const;
    void    drawPoints(SkCanvas::PointMode, size_t count, const SkPoint[],
                       const SkPaint&, bool forceUseDevice = false) const;
    void    drawRect(const SkRect& prePaintRect, const SkPaint&, const SkMatrix* paintMatrix,
                     const SkRect* postPaintRect) const;
    void    drawRect(const SkRect& rect, const SkPaint& paint) const {
        this->drawRect(rect, paint, NULL, NULL);
    }
    void    drawRRect(const SkRRect&, const SkPaint&) const;
    /**
     *  To save on mallocs, we allow a flag that tells us that srcPath is
     *  mutable, so that we don't have to make copies of it as we transform it.
     *
     *  If prePathMatrix is not null, it should logically be applied before any
     *  stroking or other effects. If there are no effects on the paint that
     *  affect the geometry/rasterization, then the pre matrix can just be
     *  pre-concated with the current matrix.
     */
    void    drawPath(const SkPath& path, const SkPaint& paint,
                     const SkMatrix* prePathMatrix, bool pathIsMutable) const {
        this->drawPath(path, paint, prePathMatrix, pathIsMutable, false);
    }

    void drawPath(const SkPath& path, const SkPaint& paint,
                  SkBlitter* customBlitter = NULL) const {
        this->drawPath(path, paint, NULL, false, false, customBlitter);
    }

    /* If dstOrNull is null, computes a dst by mapping the bitmap's bounds through the matrix. */
    void    drawBitmap(const SkBitmap&, const SkMatrix&, const SkRect* dstOrNull,
                       const SkPaint&) const;
    void    drawSprite(const SkBitmap&, int x, int y, const SkPaint&) const;
    void    drawText(const char text[], size_t byteLength, SkScalar x,
                     SkScalar y, const SkPaint& paint) const;
    void    drawPosText(const char text[], size_t byteLength,
                        const SkScalar pos[], int scalarsPerPosition,
                        const SkPoint& offset, const SkPaint& paint) const;
    void    drawVertices(SkCanvas::VertexMode mode, int count,
                         const SkPoint vertices[], const SkPoint textures[],
                         const SkColor colors[], SkXfermode* xmode,
                         const uint16_t indices[], int ptCount,
                         const SkPaint& paint) const;

    /**
     *  Overwrite the target with the path's coverage (i.e. its mask).
     *  Will overwrite the entire device, so it need not be zero'd first.
     *
     *  Only device A8 is supported right now.
     */
    void drawPathCoverage(const SkPath& src, const SkPaint& paint,
                          SkBlitter* customBlitter = NULL) const {
        this->drawPath(src, paint, NULL, false, true, customBlitter);
    }

    /** Helper function that creates a mask from a path and an optional maskfilter.
        Note however, that the resulting mask will not have been actually filtered,
        that must be done afterwards (by calling filterMask). The maskfilter is provided
        solely to assist in computing the mask's bounds (if the mode requests that).
    */
    static bool DrawToMask(const SkPath& devPath, const SkIRect* clipBounds,
                           const SkMaskFilter*, const SkMatrix* filterMatrix,
                           SkMask* mask, SkMask::CreateMode mode,
                           SkStrokeRec::InitStyle style);

    enum RectType {
        kHair_RectType,
        kFill_RectType,
        kStroke_RectType,
        kPath_RectType
    };

    /**
     *  Based on the paint's style, strokeWidth, and the matrix, classify how
     *  to draw the rect. If no special-case is available, returns
     *  kPath_RectType.
     *
     *  Iff RectType == kStroke_RectType, then strokeSize is set to the device
     *  width and height of the stroke.
     */
    static RectType ComputeRectType(const SkPaint&, const SkMatrix&,
                                    SkPoint* strokeSize);

    static bool ShouldDrawTextAsPaths(const SkPaint&, const SkMatrix&);
    void        drawText_asPaths(const char text[], size_t byteLength,
                                 SkScalar x, SkScalar y, const SkPaint&) const;
    void        drawPosText_asPaths(const char text[], size_t byteLength,
                                    const SkScalar pos[], int scalarsPerPosition,
                                    const SkPoint& offset, const SkPaint&) const;
    static SkScalar ComputeResScaleForStroking(const SkMatrix& );
private:
    void    drawDevMask(const SkMask& mask, const SkPaint&) const;
    void    drawBitmapAsMask(const SkBitmap&, const SkPaint&) const;

    void    drawPath(const SkPath&, const SkPaint&, const SkMatrix* preMatrix,
                     bool pathIsMutable, bool drawCoverage,
                     SkBlitter* customBlitter = NULL) const;

    void drawLine(const SkPoint[2], const SkPaint&) const;
    void drawDevPath(const SkPath& devPath, const SkPaint& paint, bool drawCoverage,
                     SkBlitter* customBlitter, bool doFill) const;
    /**
     *  Return the current clip bounds, in local coordinates, with slop to account
     *  for antialiasing or hairlines (i.e. device-bounds outset by 1, and then
     *  run through the inverse of the matrix).
     *
     *  If the matrix cannot be inverted, or the current clip is empty, return
     *  false and ignore bounds parameter.
     */
    bool SK_WARN_UNUSED_RESULT
    computeConservativeLocalClipBounds(SkRect* bounds) const;

    /** Returns the current setting for using fake gamma and contrast. */
    uint32_t SK_WARN_UNUSED_RESULT scalerContextFlags() const;

public:
    SkPixmap        fDst;
    const SkMatrix* fMatrix;        // required
    const SkRasterClip* fRC;        // required

    const SkClipStack* fClipStack;  // optional, may be null
    SkBaseDevice*   fDevice;        // optional, may be null

#ifdef SK_DEBUG
    void validate() const;
#else
    void validate() const {}
#endif
};

#endif


text:
#include "condor_common.h"
#include <tchar.h>
#include "exception_handling.WINDOWS.h"

#include "condor_debug.h"

//============================== Global Variables =============================
//
// Declare the static variables of the ExceptionHandler class
//
TCHAR ExceptionHandler::m_szLogFileName[MAX_PATH];
LPTOP_LEVEL_EXCEPTION_FILTER ExceptionHandler::m_previousFilter;
HANDLE ExceptionHandler::m_hReportFile;
pid_t ExceptionHandler::m_pid = -1;
ExceptionHandler::SYMINITIALIZEPROC ExceptionHandler::_SymInitialize = 0;
ExceptionHandler::SYMCLEANUPPROC ExceptionHandler::_SymCleanup = 0;
ExceptionHandler::STACKWALKPROC ExceptionHandler::_StackWalk = 0;
ExceptionHandler::SYMFUNCTIONTABLEACCESSPROC
						ExceptionHandler::_SymFunctionTableAccess = 0;
ExceptionHandler::SYMGETMODULEBASEPROC
						ExceptionHandler::_SymGetModuleBase = 0;
ExceptionHandler::SYMGETSYMFROMADDRPROC
						ExceptionHandler::_SymGetSymFromAddr = 0;
ExceptionHandler::SYMGETLINEFROMADDRPROC
						ExceptionHandler::_SymGetLineFromAddr = 0;
ExceptionHandler g_ExceptionHandler;  // Declare global instance of class

//============================== Class Methods =============================

//=============// Constructor //=============
ExceptionHandler::ExceptionHandler( ){
    // Install the unhandled exception filter function
    m_previousFilter = SetUnhandledExceptionFilter(MSJUnhandledExceptionFilter);
    // Figure out what the report file will be named, and store it away
    GetModuleFileName( 0, m_szLogFileName, MAX_PATH );
    // Look for the '.' before the "EXE" extension.  Replace the extension
    // with "RPT"
	PTSTR pszDot = _tcsrchr( m_szLogFileName, _T('.') );
    if ( pszDot )    {
		pszDot++;   // Advance past the '.'
        if ( _tcslen(pszDot) >= 3 )
            _tcscpy( pszDot, _T("RPT") );   // "RPT" -> "Report"
	}
}

//============// Destructor //============
ExceptionHandler::~ExceptionHandler( ){
    SetUnhandledExceptionFilter( m_previousFilter );
}

//===========================================================
// When we are instantiated, our constructor set ourselves
// up to be the exception handler.  Here we provide some methods
// to allow the user to reset the default exception handler on & off.
//==========================================================
void ExceptionHandler::TurnOff() {
	SetUnhandledExceptionFilter( m_previousFilter );
}

void ExceptionHandler::TurnOn() {
	SetUnhandledExceptionFilter(MSJUnhandledExceptionFilter);
}

//==============================================================
// Lets user change the name of the report file to be generated
//==============================================================
void ExceptionHandler::SetLogFileName( PTSTR pszLogFileName ){
    _tcsncpy( m_szLogFileName, pszLogFileName, COUNTOF(m_szLogFileName) );
}

//==============================================================
// Lets user change the pid of the process we are dumping for
//==============================================================
void ExceptionHandler::SetPID( pid_t pid ){
    m_pid = pid;
}

//===========================================================
// Entry point where control comes on an unhandled exception
//===========================================================
LONG WINAPI ExceptionHandler::MSJUnhandledExceptionFilter(
                                             PEXCEPTION_POINTERS pExceptionInfo )
{
	dprintf ( D_ALWAYS, "Intercepting an unhandled exception.\n" );
	m_hReportFile = CreateFile( m_szLogFileName,
                                GENERIC_WRITE,
								0,
                                0,
								CREATE_ALWAYS,
                                FILE_FLAG_WRITE_THROUGH,
                                0 );
	if ( m_hReportFile )    {
		dprintf ( D_ALWAYS, "Dropping a core file.\n" );
        // SetFilePointer( m_hReportFile, 0, 0, FILE_END );
        GenerateExceptionReport( pExceptionInfo );
        CloseHandle( m_hReportFile );
		m_hReportFile = 0;
	}
    if ( m_previousFilter )
		return m_previousFilter( pExceptionInfo );
    else
		return EXCEPTION_CONTINUE_SEARCH;
}
//===========================================================================
// Open the report file, and write the desired information to it.  Called by
// MSJUnhandledExceptionFilter
//===========================================================================
void ExceptionHandler::GenerateExceptionReport(
    PEXCEPTION_POINTERS pExceptionInfo ){
	// Start out with a banner
    _tprintf( _T("//=====================================================\n") );
    PEXCEPTION_RECORD pExceptionRecord = pExceptionInfo->ExceptionRecord;
	// First print the pid of the process
	_tprintf(   _T("PID: %d\n"), m_pid );
    // Now print information about the type of fault
    _tprintf(   _T("Exception code: %08X %s\n"),
                pExceptionRecord->ExceptionCode,
                GetExceptionString(pExceptionRecord->ExceptionCode) );
    // Now print information about where the fault occured
    TCHAR szFaultingModule[MAX_PATH];
	DWORD section, offset;
    GetLogicalAddress(  pExceptionRecord->ExceptionAddress,
                        szFaultingModule,
                        sizeof( szFaultingModule ),
                        section, offset );
    _tprintf( _T("Fault address:  %08X %02X:%08X %s\n"),
              pExceptionRecord->ExceptionAddress,
              section, offset, szFaultingModule );
    PCONTEXT pCtx = pExceptionInfo->ContextRecord;
	// dprintf(D_ALWAYS,"TEST: SHOWING REGISTERS\n");
	// Show the registers
#ifdef _M_IX86  // Intel Only!
	_tprintf( _T("\nRegisters:\n") );
    _tprintf(_T("EAX:%08X\nEBX:%08X\nECX:%08X\nEDX:%08X\nESI:%08X\nEDI:%08X\n"),
             pCtx->Eax, pCtx->Ebx, pCtx->Ecx, pCtx->Edx, pCtx->Esi, pCtx->Edi );
    _tprintf( _T("CS:EIP:%04X:%08X\n"), pCtx->SegCs, pCtx->Eip );
    _tprintf( _T("SS:ESP:%04X:%08X  EBP:%08X\n"),
              pCtx->SegSs, pCtx->Esp, pCtx->Ebp );
    _tprintf( _T("DS:%04X  ES:%04X  FS:%04X  GS:%04X\n"),
              pCtx->SegDs, pCtx->SegEs, pCtx->SegFs, pCtx->SegGs );
    _tprintf( _T("Flags:%08X\n"), pCtx->EFlags );
#endif
    if ( !InitImagehlpFunctions() )    {
        //dprintf(D_ALWAYS,"IMAGEHLP.DLL or its exported procs not found\n");
		//dprintf(D_ALWAYS," ----> GetLastError = %d\n",GetLastError() );
#ifdef _M_IX86  // Intel Only!
        // Walk the stack using x86 specific code
		IntelStackWalk( pCtx );
#endif
		return;
	}
	ImagehlpStackWalk( pCtx );
    _SymCleanup( GetCurrentProcess() );
	// Just to make sure we didn't get cut off whilst dumping a core
	// file, we print a footer that should allways appear.
	_tprintf( _T("\n//=====================================================\n") );
}
//======================================================================
// Given an exception code, returns a pointer to a static string with a
// description of the exception
//======================================================================
#define EXCEPTION( x ) case EXCEPTION_##x: return _T(#x);
LPTSTR ExceptionHandler::GetExceptionString( DWORD dwCode ){
    switch ( dwCode )    {
		EXCEPTION( ACCESS_VIOLATION )
        EXCEPTION( DATATYPE_MISALIGNMENT )
		EXCEPTION( BREAKPOINT )
        EXCEPTION( SINGLE_STEP )
		EXCEPTION( ARRAY_BOUNDS_EXCEEDED )
        EXCEPTION( FLT_DENORMAL_OPERAND )
		EXCEPTION( FLT_DIVIDE_BY_ZERO )
        EXCEPTION( FLT_INEXACT_RESULT )
        EXCEPTION( FLT_INVALID_OPERATION )
		EXCEPTION( FLT_OVERFLOW )
        EXCEPTION( FLT_STACK_CHECK )
		EXCEPTION( FLT_UNDERFLOW )
        EXCEPTION( INT_DIVIDE_BY_ZERO )
		EXCEPTION( INT_OVERFLOW )
        EXCEPTION( PRIV_INSTRUCTION )
		EXCEPTION( IN_PAGE_ERROR )
        EXCEPTION( ILLEGAL_INSTRUCTION )
        EXCEPTION( NONCONTINUABLE_EXCEPTION )
		EXCEPTION( STACK_OVERFLOW )
        EXCEPTION( INVALID_DISPOSITION )
		EXCEPTION( GUARD_PAGE )
        EXCEPTION( INVALID_HANDLE )
	}
    // If not one of the "known" exceptions, try to get the string
    // from NTDLL.DLL's message table.
	static TCHAR szBuffer[512] = { 0 };
    FormatMessage(  FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_HMODULE,
                    GetModuleHandle( _T("NTDLL.DLL") ),
                    dwCode, 0, szBuffer, sizeof( szBuffer ), 0 );
    return szBuffer;
}
//==============================================================================
// Given a linear address, locates the module, section, and offset containing
// that address.
//
// Note: the szModule paramater buffer is an output buffer of length specified
// by the len parameter (in characters!)
//==============================================================================
BOOL ExceptionHandler::GetLogicalAddress(
        PVOID addr, PTSTR szModule, DWORD len, DWORD& section, DWORD& offset ) {
    MEMORY_BASIC_INFORMATION mbi;
    if ( !VirtualQuery( addr, &mbi, sizeof(mbi) ) )
		return FALSE;
    DWORD hMod = (DWORD)mbi.AllocationBase;
    if ( !GetModuleFileName( (HMODULE)hMod, szModule, len ) )
        return FALSE;    // Point to the DOS header in memory
    PIMAGE_DOS_HEADER pDosHdr = (PIMAGE_DOS_HEADER)hMod;
    // From the DOS header, find the NT (PE) header
    PIMAGE_NT_HEADERS pNtHdr = (PIMAGE_NT_HEADERS)(hMod + pDosHdr->e_lfanew);
    PIMAGE_SECTION_HEADER pSection = IMAGE_FIRST_SECTION( pNtHdr );
    DWORD rva = (DWORD)addr - hMod; // RVA is offset from module load address
    // Iterate through the section table, looking for the one that encompasses
    // the linear address.
	for (   unsigned i = 0;
            i < pNtHdr->FileHeader.NumberOfSections;
            i++, pSection++ )    {
        DWORD sectionStart = pSection->VirtualAddress;
        DWORD sectionEnd = sectionStart
                    + max(pSection->SizeOfRawData, pSection->Misc.VirtualSize);
        // Is the address in this section???
        if ( (rva >= sectionStart) && (rva <= sectionEnd) ) {
            // Yes, address is in the section.  Calculate section and offset,
            // and store in the "section" & "offset" params, which were
            // passed by reference.
			section = i+1;
            offset = rva - sectionStart;
			return TRUE;
		}
	}
    return FALSE;   // Should never get here!
}
//============================================================
// Walks the stack, and writes the results to the report file
//============================================================
void ExceptionHandler::IntelStackWalk( PCONTEXT pContext ) {
    _tprintf( _T("\nCall stack:\n") );
    _tprintf( _T("Address   Frame     Logical addr  Module\n") );
    DWORD pc = pContext->Eip;
	PDWORD pFrame, pPrevFrame;
    pFrame = (PDWORD)pContext->Ebp;
	do {
        TCHAR szModule[MAX_PATH] = _T("");
		DWORD section = 0, offset = 0;
        GetLogicalAddress((PVOID)pc, szModule,sizeof(szModule),section,offset );
        _tprintf( _T("%08X  %08X  %04X:%08X %s\n"),
                  pc, pFrame, section, offset, szModule );
        pc = pFrame[1];
		pPrevFrame = pFrame;
        pFrame = (PDWORD)pFrame[0]; // proceed to next higher frame on stack
        if ( (DWORD)pFrame & 3 )    // Frame pointer must be aligned on a
            break;                  // DWORD boundary.  Bail if not so.
        if ( pFrame <= pPrevFrame )
			break;
        // Can two DWORDs be read from the supposed frame address?
        if ( IsBadWritePtr(pFrame, sizeof(PVOID)*2) )
			break;
    } while ( 1 );
}

// Note: this function was from MSDN:
// http://msdn.microsoft.com/code/default.asp?url=/msdn-files/026/001/909/Working%20Set%20Tuner/Source%20Files/CrashHandler_cpp.asp
BOOL ExceptionHandler::InternalSymGetLineFromAddr ( IN  HANDLE			hProcess,
													IN  DWORD			dwAddr,
													OUT PDWORD			pdwDisplacement,
													OUT PIMAGEHLP_LINE  Line)
{
    // The problem is that the symbol engine finds only those source
    // line addresses (after the first lookup) that fall exactly on
    // a zero displacement. I'll walk backward 100 bytes to
    // find the line and return the proper displacement.
    DWORD dwTempDis = 0 ;

    while ( FALSE == _SymGetLineFromAddr(hProcess,dwAddr - dwTempDis,pdwDisplacement,Line))
    {
        dwTempDis += 1 ;
        if ( 100 == dwTempDis )
        {
            return ( FALSE ) ;
        }
    }

    // I found the line, and the source line information is correct, so
    // change the displacement if I had to search backward to find
    // the source line.
    if ( 0 != dwTempDis )
    {
        *pdwDisplacement = dwTempDis ;
    }
    return ( TRUE ) ;
}

//============================================================
// Walks the stack, and writes the results to the report file
//============================================================
void ExceptionHandler::ImagehlpStackWalk( PCONTEXT pContext ) {
    _tprintf( _T("\nCall stack:\n") );
//	_tprintf( _T(_SymGetLineFromAddr ? "(Line number api available)\n" : "(Line number api not available)\n"));
	_tprintf( _T("Address   Frame\n") );

	SymSetOptions(SYMOPT_LOAD_LINES);

    // Could use SymSetOptions here to add the SYMOPT_DEFERRED_LOADS flag
    STACKFRAME sf;
	memset( &sf, 0, sizeof(sf) );
    // Initialize the STACKFRAME structure for the first call.  This is only
    // necessary for Intel CPUs, and isn't mentioned in the documentation.
    sf.AddrPC.Offset       = pContext->Eip;
    sf.AddrPC.Mode         = AddrModeFlat;
    sf.AddrStack.Offset    = pContext->Esp;
    sf.AddrStack.Mode      = AddrModeFlat;
    sf.AddrFrame.Offset    = pContext->Ebp;
    sf.AddrFrame.Mode      = AddrModeFlat;
	while ( 1 )    {
        if ( ! _StackWalk(  IMAGE_FILE_MACHINE_I386,
                            GetCurrentProcess(),
                            GetCurrentThread(),
							&sf,
                            pContext,
							0,
                            _SymFunctionTableAccess,
                            _SymGetModuleBase,
							0 ) )
            break;
        if ( 0 == sf.AddrFrame.Offset ) // Basic sanity check to make sure
            break;                      // the frame is OK.  Bail if not.
        _tprintf( _T("%08X  %08X  "), sf.AddrPC.Offset, sf.AddrFrame.Offset );
        // IMAGEHLP is wacky, and requires you to pass in a pointer to an
        // IMAGEHLP_SYMBOL structure.  The problem is that this structure is
        // variable length.  That is, you determine how big the structure is
        // at runtime.  This means that you can't use sizeof(struct).
        // So...make a buffer that's big enough, and make a pointer
        // to the buffer.  We also need to initialize not one, but TWO
        // members of the structure before it can be used.
        BYTE symbolBuffer[ sizeof(IMAGEHLP_SYMBOL) + 512 ];
        PIMAGEHLP_SYMBOL pSymbol = (PIMAGEHLP_SYMBOL)symbolBuffer;
        // pSymbol->SizeOfStruct = sizeof(symbolBuffer);
		pSymbol->SizeOfStruct = sizeof(IMAGEHLP_SYMBOL);
        pSymbol->MaxNameLength = 511;
		pSymbol->Name[0] = '\0';
        DWORD symDisplacement = 0;  // Displacement of the input address,
                                    // relative to the start of the symbol

		if ( _SymGetSymFromAddr(GetCurrentProcess(), sf.AddrPC.Offset,
                               &symDisplacement, pSymbol) )
		{
			IMAGEHLP_LINE lineInfo;
			lineInfo.SizeOfStruct = sizeof(IMAGEHLP_LINE); // Ok m$, if you say so
			ZeroMemory ( &lineInfo, sizeof (IMAGEHLP_LINE)) ;
			bool bGotLineNum = false;
			if (_SymGetLineFromAddr) // if this OS has the get linenum function
			{
				// call it
				bGotLineNum = InternalSymGetLineFromAddr(GetCurrentProcess(), sf.AddrPC.Offset,
										&symDisplacement, &lineInfo);
			}

			if (bGotLineNum)
				_tprintf( _T("%hs (%s:%d)\n"), pSymbol->Name, lineInfo.FileName,
					lineInfo.LineNumber);
			else
				_tprintf( _T("%hs+%X\n"), pSymbol->Name, symDisplacement );
		} else {
			// No symbol found.  Print out the logical address instead.
			//DWORD thelasterr = GetLastError();
			//char nambuf[50];
			//DWORD namebuflen=49;
			//GetUserName(nambuf,&namebuflen);
			//dprintf(D_ALWAYS,"exphnd: Could not find sym %s, err=%d, user=%s\n",
			//	pSymbol->Name, thelasterr, nambuf );
            TCHAR szModule[MAX_PATH] = _T("");
            DWORD section = 0, offset = 0;
            GetLogicalAddress(  (PVOID)sf.AddrPC.Offset,
                                szModule, sizeof(szModule), section, offset );
            _tprintf( _T("%04X:%08X %s\n"),
                      section, offset, szModule );
		}
	}
}
//============================================================================
// Helper function that writes to the report file, and allows the user to use
// printf style formating
//============================================================================
int __cdecl ExceptionHandler::_tprintf(const TCHAR * format, ...) {
    TCHAR szBuff[1024];
	int retValue;
	DWORD cbWritten;
	va_list argptr;

	va_start( argptr, format );
    retValue = wvsprintf( szBuff, format, argptr );
	va_end( argptr );
    WriteFile( m_hReportFile, szBuff, retValue * sizeof(TCHAR), &cbWritten, 0 );
    return retValue;
}
//=========================================================================
// Load IMAGEHLP.DLL and get the address of functions in it that we'll use
//=========================================================================
BOOL ExceptionHandler::InitImagehlpFunctions( void ) {
    HMODULE hModImagehlp = LoadLibrary( _T("IMAGEHLP.DLL") );
    if ( !hModImagehlp )
		return FALSE;
    _SymInitialize = (SYMINITIALIZEPROC)GetProcAddress( hModImagehlp,
                                                        "SymInitialize" );
    if ( !_SymInitialize )
		return FALSE;
    _SymCleanup = (SYMCLEANUPPROC)GetProcAddress( hModImagehlp, "SymCleanup" );
    if ( !_SymCleanup )
		return FALSE;
    _StackWalk = (STACKWALKPROC)GetProcAddress( hModImagehlp, "StackWalk" );
    if ( !_StackWalk )
		return FALSE;
    _SymFunctionTableAccess = (SYMFUNCTIONTABLEACCESSPROC)
                        GetProcAddress( hModImagehlp, "SymFunctionTableAccess" );
    if ( !_SymFunctionTableAccess )
		return FALSE;
    _SymGetModuleBase=(SYMGETMODULEBASEPROC)GetProcAddress( hModImagehlp,
                                                            "SymGetModuleBase");
    if ( !_SymGetModuleBase )
		return FALSE;
    _SymGetSymFromAddr=(SYMGETSYMFROMADDRPROC)GetProcAddress( hModImagehlp,
                                                            "SymGetSymFromAddr" );
    if ( !_SymGetSymFromAddr )
		return FALSE;

	// Note: we are not checking if _SymGetLineFromAddr is NULL because we'll just
	// avoid calling it if it does not exist.  All the other fcns are required,
	// this one is optional.
	_SymGetLineFromAddr= (SYMGETLINEFROMADDRPROC) GetProcAddress( hModImagehlp,
														"SymGetLineFromAddr" );

    if ( !_SymInitialize( GetCurrentProcess(), NULL, TRUE ) )
		return FALSE;

    return TRUE;
}


text:
package org.apache.commons.lang3;

/**
 * Specializes {@link NumberRange} for {@link Double}s.
 *
 *

 * This class is not designed to interoperate with other NumberRanges
 *

 *
 * @since 3.13.0
 */
public final class DoubleRange extends NumberRange<Double> {

    private static final long serialVersionUID = 1L;

    /**
     * Creates a range with the specified minimum and maximum values (both inclusive).
     *
     *

     * The range uses the natural ordering of the elements to determine where values lie in the range.
     *

     *
     *

     * The arguments may be passed in the order (min,max) or (max,min). The getMinimum and getMaximum methods will return the correct values.
     *

     *
     * @param fromInclusive the first value that defines the edge of the range, inclusive.
     * @param toInclusive the second value that defines the edge of the range, inclusive.
     * @return the range object, not null.
     */
    public static DoubleRange of(final double fromInclusive, final double toInclusive) {
        return of(Double.valueOf(fromInclusive), Double.valueOf(toInclusive));
    }

    /**
     * Creates a range with the specified minimum and maximum values (both inclusive).
     *
     *

     * The range uses the natural ordering of the elements to determine where values lie in the range.
     *

     *
     *

     * The arguments may be passed in the order (min,max) or (max,min). The getMinimum and getMaximum methods will return the correct values.
     *

     *
     * @param fromInclusive the first value that defines the edge of the range, inclusive.
     * @param toInclusive the second value that defines the edge of the range, inclusive.
     * @return the range object, not null.
     * @throws IllegalArgumentException if either element is null.
     */
    public static DoubleRange of(final Double fromInclusive, final Double toInclusive) {
        return new DoubleRange(fromInclusive, toInclusive);
    }

    /**
     * Creates an instance.
     *
     * @param number1 the first element, not null
     * @param number2 the second element, not null
     * @throws NullPointerException when element1 is null.
     * @throws NullPointerException when element2 is null.
     */
    private DoubleRange(final Double number1, final Double number2) {
        super(number1, number2, null);
    }

}


text:
ACCEPTED

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

#### Published in
Icon. fung. (Prague) 1: 2 (1837)

#### Original name
Coniothecium chomatosporum Corda, 1837

### Remarks
null


text:
#include <stdlib.h>
#include <string.h>

#include "utils/http.h"

#include "utils/http/generics.h"
#include "utils/http/parameter_internal.h"
#include "utils/http/primitives.h"

/**
 * Representation of an HTTP parameter
 */
struct http_parameter {
	http__item base;

	lwc_string *name;		/**< Parameter name */
	lwc_string *value;		/**< Parameter value */
};

/**
 * Destructor for an HTTP parameter
 *
 * \param self  Parameter to destroy
 */
static void http_destroy_parameter(http_parameter *self)
{
	lwc_string_unref(self->name);
	lwc_string_unref(self->value);
	free(self);
}

/**
 * Parse an HTTP parameter
 *
 * \param input      Pointer to current input byte. Updated on exit.
 * \param parameter  Pointer to location to receive on-heap parameter.
 * \return NSERROR_OK on success,
 * 	   NSERROR_NOMEM on memory exhaustion,
 * 	   NSERROR_NOT_FOUND if no parameter could be parsed
 *
 * The returned parameter is owned by the caller.
 */
nserror http__parse_parameter(const char **input, http_parameter **parameter)
{
	const char *pos = *input;
	lwc_string *name;
	lwc_string *value;
	http_parameter *param;
	nserror error;

	/* token "=" ( token | quoted-string ) */

	error = http__parse_token(&pos, &name);
	if (error != NSERROR_OK)
		return error;

	http__skip_LWS(&pos);

	if (*pos != '=') {
		lwc_string_unref(name);
		return NSERROR_NOT_FOUND;
	}

	pos++;

	http__skip_LWS(&pos);

	if (*pos == '"')
		error = http__parse_quoted_string(&pos, &value);
	else
		error = http__parse_token(&pos, &value);

	if (error != NSERROR_OK) {
		lwc_string_unref(name);
		return error;
	}

	param = malloc(sizeof(*param));
	if (param == NULL) {
		lwc_string_unref(value);
		lwc_string_unref(name);
		return NSERROR_NOMEM;
	}

	HTTP__ITEM_INIT(param, NULL, http_destroy_parameter);
	param->name = name;
	param->value = value;

	*parameter = param;
	*input = pos;

	return NSERROR_OK;
}

/* See parameter.h for documentation */
nserror http_parameter_list_find_item(const http_parameter *list,
		lwc_string *name, lwc_string **value)
{
	bool match;

	while (list != NULL) {
		if (lwc_string_caseless_isequal(name, list->name,
				&match) == lwc_error_ok && match)
			break;

		list = (http_parameter *) list->base.next;
	}

	if (list == NULL)
		return NSERROR_NOT_FOUND;

	*value = lwc_string_ref(list->value);

	return NSERROR_OK;
}

/* See parameter.h for documentation */
const http_parameter *http_parameter_list_iterate(const http_parameter *cur,
		lwc_string **name, lwc_string **value)
{
	if (cur == NULL)
		return NULL;

	*name = lwc_string_ref(cur->name);
	*value = lwc_string_ref(cur->value);

	return (http_parameter *) cur->base.next;
}

/* See parameter.h for documentation */
void http_parameter_list_destroy(http_parameter *list)
{
	http__item_list_destroy(list);
}


text:
package org.drools.example.api.namedkiesessionfromfile;

import org.kie.api.KieServices;
import org.kie.api.builder.KieModule;
import org.kie.api.builder.KieRepository;
import org.kie.api.runtime.KieContainer;
import org.kie.api.runtime.KieSession;

import java.io.File;
import java.io.PrintStream;

public class NamedKieSessionFromFileExample {

    public void go(PrintStream out) {
        KieServices ks = KieServices.Factory.get();
        KieRepository kr = ks.getRepository();

        KieModule kModule = kr.addKieModule(ks.getResources().newFileSystemResource(getFile("named-kiesession")));

        KieContainer kContainer = ks.newKieContainer(kModule.getReleaseId());

        KieSession kSession = kContainer.newKieSession("ksession1");
        kSession.setGlobal("out", out);

        Object msg1 = createMessage(kContainer, "Dave", "Hello, HAL. Do you read me, HAL?");
        kSession.insert(msg1);
        kSession.fireAllRules();
    }

    public static void main(String[] args) {
        new NamedKieSessionFromFileExample().go(System.out);
    }

    private static Object createMessage(KieContainer kContainer, String name, String text) {
        Object o = null;
        try {
            Class cl = kContainer.getClassLoader().loadClass("org.drools.example.api.namedkiesession.Message");
            o = cl.getConstructor(new Class[]{String.class, String.class}).newInstance(name, text);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return o;
    }

    public static File getFile(String exampleName) {
        File folder = new File("drools-examples-api").getAbsoluteFile();
        File exampleFolder = null;
        while (folder != null) {
            exampleFolder = new File(folder,
                                     exampleName);
            if (exampleFolder.exists()) {
                break;
            }
            exampleFolder = null;
            folder = folder.getParentFile();
        }

        if (exampleFolder != null) {

            File targetFolder = new File(exampleFolder,
                                         "target");
            if (!targetFolder.exists()) {
                throw new RuntimeException("The target folder does not exist, please build project " + exampleName + " first");
            }

            for (String str : targetFolder.list()) {
                if (str.startsWith(exampleName) && !str.endsWith("-sources.jar") && !str.endsWith("-tests.jar") && !str.endsWith("-javadoc.jar")) {
                    return new File(targetFolder, str);
                }
            }
        }

        throw new RuntimeException("The target jar does not exist, please build project " + exampleName + " first");
    }

}


text:
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/*
 * Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/licenses/publicdomain/
 * Contributor: Robert Sayre
 */

var gTestfile = 'regress-449627.js';
//-----------------------------------------------------------------------------
var BUGNUMBER = 449627;
var summary = 'Crash with JIT in js_FillPropertyCache';
var actual = 'No Crash';
var expect = 'No Crash';

printBugNumber(BUGNUMBER);
printStatus (summary);

jit(true);

/************************ BROWSER DETECT (http://www.quirksmode.org/js/detect.html) ************************/

if (typeof navigator == 'undefined')
{
  navigator = {
    userAgent: "Firefox",
    vendor: "Mozilla",
    platform: "Mac"
  };
}

global = this;

var BrowserDetect = {
    init: function _init()
    {
      this.browser=this.searchString(this.dataBrowser) || "An unknown browser";

      this.OS= this.searchString(this.dataOS)||"an unknown OS";
    },
    searchString: function _searchString(a)
    {
      for(var i=0; i < a.length; i++)
      {
	var b=a[i].string;
	var c=a[i].prop;
	this.versionSearchString=a[i].versionSearch||a[i].identity;
	if(b)
	{
	  if(b.indexOf(a[i].subString)!=-1)
	    return a[i].identity;
        }
	else if(c)
	return a[i].identity;
      }
    },

    searchVersion:function _searchVersion(a)
    {
      var b=a.indexOf(this.versionSearchString);
      if(b==-1)
      	return;
      return parseFloat(a.substring(b+this.versionSearchString.length+1));
    },

    dataBrowser:[
      {
	string:navigator.userAgent,subString:"OmniWeb",versionSearch:"OmniWeb/",identity:"OmniWeb"
      },
      {
	string:navigator.vendor,subString:"Apple",identity:"Safari"
      },
      {
	prop:global.opera,identity:"Opera"
      },
      {
	string:navigator.vendor,subString:"iCab",identity:"iCab"
      },
      {
	string:navigator.vendor,subString:"KDE",identity:"Konqueror"
      },
      {
	string:navigator.userAgent,subString:"Firefox",identity:"Firefox"
      },
      {
	string:navigator.vendor,subString:"Camino",identity:"Camino"
      },
      {
	string:navigator.userAgent,subString:"Netscape",identity:"Netscape"
      },
      {
	string:navigator.userAgent,subString:"MSIE",identity:"Explorer",versionSearch:"MSIE"
      },
      {
	string:navigator.userAgent,subString:"Gecko",identity:"Mozilla",versionSearch:"rv"
      },
      {
	string:navigator.userAgent,subString:"Mozilla",identity:"Netscape",versionSearch:"Mozilla"
      }
    ],
    dataOS:[
      {
	string:navigator.platform,subString:"Win",identity:"Windows"
      },
      {
	string:navigator.platform,subString:"Mac",identity:"Mac"
      },
      {
	string:navigator.platform,subString:"Linux",identity:"Linux"
      }
    ]
  };

BrowserDetect.init();

jit(false);

reportCompare(expect, actual, summary);


text:
package tests.api.javax.net.ssl;

import javax.net.ssl.SSLKeyException;

import junit.framework.TestCase;

public class SSLKeyExceptionTest extends TestCase {

    private static String[] msgs = {
            "",
            "Check new message",
            "Check new message Check new message Check new message Check new message Check new message" };

    /**
     * Test for SSLKeyException(String) constructor Assertion:
     * constructs SSLKeyException with detail message msg. Parameter
     * msg is not null.
     */
    public void test_Constructor01() {
        SSLKeyException skE;
        for (int i = 0; i < msgs.length; i++) {
            skE = new SSLKeyException(msgs[i]);
            assertEquals("getMessage() must return: ".concat(msgs[i]), skE.getMessage(), msgs[i]);
            assertNull("getCause() must return null", skE.getCause());
        }
    }

    /**
     * Test for SSLPeerUnverifiedException(String) constructor Assertion:
     * constructs SSLPeerUnverifiedException with detail message msg. Parameter
     * msg is null.
     */
    public void test_Constructor02() {
        String msg = null;
        SSLKeyException skE = new SSLKeyException(msg);
        assertNull("getMessage() must return null.", skE.getMessage());
        assertNull("getCause() must return null", skE.getCause());
    }
}


text:
SCRIPT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source ${SCRIPT_ROOT}/funcs-make.sh
source ${SCRIPT_ROOT}/funcs-cmake.sh
source ${SCRIPT_ROOT}/funcs-swig.sh
source ${SCRIPT_ROOT}/funcs-python.sh
source ${SCRIPT_ROOT}/funcs-lua.sh

function simpleelastix_build_dependencies()
{
    # Not sure why we need Lua when we don't need the Lua wrapping
    mapt-get install lua5.3 liblua5.3-dev
    require_pythondev
    require_cmake 3.10
    require_swig 3
}

function simpleelastix_download()
{
    git clone https://github.com/kaspermarstal/SimpleElastix ${1}

    cd ${1}

    #git reset --hard 2a79d15
    #git checkout v1.2.4  #Nov 13, 2019
    #git checkout v1.1.0
    #git reset --hard 49af818 # Sep 10, 2018  (v1.1.0)
    #git reset --hard cf75ff4 # Dec 21, 2017  (Git ITK v4.13.0)
    #git reset --hard 3de935c # Oct 30, 2017
    #git reset --hard v1.1.0

    # works from cmake 3.1 onwards:
    #sed -i '/EXCLUDE_FROM_MAIN 1/d' SuperBuild/SuperBuild.cmake

    cd ..
}

function simpleelastix_configure()
{
    if [[ -e "Makefile" ]]; then
        cprint "Configure ${1} (${2}): already configured."
    else
        # Show
        cmake -LAH "${@:3}"
        # Configure and build in one go
        cmake "${@:3}"
    fi
}

function simpleelastix_source_install()
{
    if [[ ! -d simpleelastix && ${ARG_SKIPLONG} == true ]]; then
        cprint "Skipping simpleelastix installation"
        return
    fi

    # Will be called again by "source_install" but
    # we need it already here to modify the arguments:
    simpleelastix_build_dependencies

    local _SYSTEM_SWIG="-DSimpleITK_USE_SYSTEM_SWIG:BOOL=OFF"
    if [[ $(require_new_version $(swig_version) 3) == false ]]; then
        _SYSTEM_SWIG="-DSimpleITK_USE_SYSTEM_SWIG:BOOL=ON \
                      -DSWIG_EXECUTABLE:FILEPATH=$(cmd_full_bin swig) \
                      -DSWIG_DIR:PATH=$(cmd_path swig)"
    fi

    local _SYSTEM_LUA="-DSimpleITK_USE_SYSTEM_LUA:BOOL=OFF"
    if [[ $(require_new_version $(lua_version) 5.3) == false ]]; then
        _SYSTEM_LUA="-DSimpleITK_USE_SYSTEM_LUA:BOOL=ON"
    fi

    local _SYSTEM_VIRTUALENV="-DSimpleITK_USE_SYSTEM_VIRTUALENV:BOOL=OFF"
    if [[ $(python_hasmodule virtualenv) == true || $(python_hasmodule venv) == true ]]; then
        _SYSTEM_VIRTUALENV="-DSimpleITK_USE_SYSTEM_VIRTUALENV:BOOL=ON"
    fi

    # http://simpleelastix.readthedocs.io/GettingStarted.html#manually-building-on-linux
    local rversion=${1}
    source_install simpleelastix "${rversion}" \
                  -DCMAKE_INSTALL_PREFIX:PATH='${prefix}' \
                  -DBUILD_EXAMPLES:BOOL=OFF \
                  -DBUILD_SHARED_LIBS:BOOL=OFF \
                  -DBUILD_TESTING:BOOL=OFF \
                  -DBUILD_DOCUMENTS:BOOL=OFF \
                  ${_SYSTEM_SWIG} \
                  ${_SYSTEM_LUA} \
                  -DSimpleITK_PYTHON_USE_VIRTUALENV:BOOL=OFF \
                  -DSimpleITK_USE_SYSTEM_ELASTIX:BOOL=OFF \
                  -DSimpleITK_USE_SYSTEM_ITK:BOOL=OFF \
                  -DSimpleITK_Module_AnisotropicDiffusionLBR:BOOL=ON \
                  -DPYTHON_EXECUTABLE:FILEPATH=$(python_full_bin) \
                  -DPYTHON_INCLUDE_DIR:PATH=$(python_include) \
                  -DPYTHON_LIBRARY:FILEPATH=$(python_lib) \
                  -DWRAP_DEFAULT:BOOL=OFF \
                  -DWRAP_PYTHON:BOOL=ON \
                  -DWRAP_RUBY:BOOL=OFF \
                  -DWRAP_JAVA:BOOL=OFF \
                  -DWRAP_CSHARP:BOOL=OFF \
                  -DWRAP_LUA:BOOL=OFF \
                  -DWRAP_TCL:BOOL=OFF \
                  -DWRAP_R:BOOL=OFF \
                  ../simpleelastix-'${version}'/SuperBuild
}

function simpleelastix_install()
{
    local outdir="SimpleITK-build/Wrapping/Python"
    if [[ -f ${outdir}/Packaging/setup.py ]]; then
        cd ${outdir}
        $(python_bin) Packaging/setup.py install
    else
        cerror "Missing file python ${outdir}/Packaging/setup.py"
    fi
}

function simpleelastix_exists()
{
    python_hasmodule "SimpleITK"
}

function simpleelastix_version()
{
    if [[ $(simpleelastix_exists) == false ]]; then
        echo 0
    else
        python -c "import SimpleITK;print(SimpleITK.Version_VersionString())"
    fi
}

function require_simpleelastix()
{
    require_software simpleelastix
}


text:
Super Simple WYSIWYG Editor on Bootstrap(3.0 and 2.x).

[![Build Status](https://secure.travis-ci.org/HackerWins/summernote.png)](http://travis-ci.org/HackerWins/summernote)
[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)

### Summernote
Summernote is a javascript program that helps you to create WYSIWYG Editor on web.

Home Page: http://hackerwins.github.io/summernote/

### Why Summernote?

Summernote has something specials no like others.
* Simple UI
* Interative WYSIWYG editing
* Handy integration with server

#### Inspired by
* Gmail WYSIWYG Editor (http://www.gmail.com)
* Redactor (http://imperavi.com/redactor/)

### Easy to install

Summernote uses opensouce libraries(jQuery, bootstrap, fontAwesome)

#### 01. include js/css

Include Following code into `<head>` tag of your HTML:

```html
<!-- include libries(jQuery, bootstrap, fontawesome) -->
<script type="text/javascript" src="//code.jquery.com/jquery-1.9.1.min.js"></script>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" />
<script type="text/javascript" src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.min.css" />

<!-- include summernote css/js-->
<link rel="stylesheet" href="summernote.css" />
<script type="text/javascript" src="summernote.min.js"></script>
```

If your summernote download is placed in a different folder, don't forget to change file's paths.

#### 02. target elements
And place `div` tag to somewhere in the `body` tag. This element will be placed by the visual representation of the summernote.
```html
<div id="summernote">Hello Summernote</div>
```

#### 03. summernote
Finally, run script after document ready.
```javascript
$(document).ready(function() {
  $('#summernote').summernote();
});
```

### API
Get HTML `code` if you need.

```javascript
var sHTML = $('#summernote').code();
```

`Destroy` summernote.

```javascript
$('#summernote').destroy();
```

#### Dependencies
* jQuery: http://jquery.com/
* bootstrap: http://twitter.github.io/bootstrap (both 2.x and 3.x)
* fontAwesome: https://github.com/FortAwesome/Font-Awesome (both 3.x and 4.x)

### Supported platform
* Modern Browser (Safari, Chrome, Firefox, Opera, Internet Explorer 9+)
* OS (Windows, Mac)

### Upcoming Features
* Air Mode
* Responsive Toolbar
* Table: Handles(Sizing, Selection) and Popover
* support IE8
* Clipboard
* Media Object Selection

### Change Log

#### v0.5 2013-12-29
* Support both Font-Awesome 3.x and 4.x
* CodeMirror as Codeview
* Insert Video (by cdownie)
* Support 5 Languages(by hendrismit, tschiela, inomies, cverond)
* Restructuring: jQuery build pattern

#### v0.4 2013-11-01
* Support both Bootstrap 3.0 and 2.x
* Fullscreen
* Codeview
* Image Upload callback

#### v0.3 2013-09-01
* Bugs(image upload, fontsize, tab, recent color, ...)
* Help dialog(keyboard shortcut)
* Init options(event callbacks, custom toolbar)
* Resize bar
* Support IE8 Beta(some range bugs, can't insert Image)

#### v0.2, 2013-08-01
* Undo/Redo
* Image sizing handle and popover
* Support standalone css
* Support Multiple Editor
* Remove jQuery.curstyles dependency

#### v0.1, 2013-07-01
* Font style: size, color, bold, italic, underline, remove font style
* Para style: bullet, align, outdent, indent, line height
* Image: drag & drop, dialog
* Link: popover and dialog
* Table: create table with dimension picker

### for Hacker

#### structure of summernote.js

```
summernote.js - Renderer.js (Generate markup) - Locale.js (Locale object)
              ㄴEventHandler.js - Editor.js  (Abstract editor)
                                ㄴStyle.js   (Style Getter and Setter)
                                ㄴHistory.js (Store on jQuery.data)
                                ㄴToolbar.js (Toolbar module)
                                ㄴPopover.js (Popover module)
                                ㄴHandle.js  (Handle module)
                                ㄴDialog.js  (Dialog module)
-----------------------------Core Script-----------------------------
  agent.js  (agent information)
  async.js  (aysnc utility)
  key.js    (keycode object)
  dom.js    (dom functions)
  list.js   (list functions)
  range.js  (W3CRange extention)
---------------------------------------------------------------------
```

#### build summernote
```bash
# grunt-cli is need by grunt; you might have this installed already
npm install -g grunt-cli
npm install

# build full version of summernote: dist/summernote.js
grunt build

# generate minified copy: dist/summernote.min.js, dist/summernote.css
grunt dist
```
At this point, you should now have a `build/` directory populated with everything you need to use summernote.

#### test summernote
run tests with PhantomJS
```bash
grunt test
```

#### start local server for developing summernote.
run local server with connect and watch.
```bash
# this will open a browser on http://localhost:3000.
grunt server
# If you change source code, automatically reload your page.
```

#### Coding convention
* JSHint: http://www.jshint.com/about/
* JSHint rule: https://github.com/HackerWins/summernote/blob/master/.jshintrc

### Contacts
* Email: susukang98@gmail.com
* Twitter: http://twitter.com/hackerwins

### License
summernote may be freely distributed under the MIT license.


text:
package org.cloudfoundry.client.v3.builds;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.immutables.value.Value;

/**
 * The response payload for the Create Build operation
 */
@JsonDeserialize
@Value.Immutable
abstract class _CreateBuildResponse extends Build {

}


text:
// This module addresses the problem of matching the fields in Microsoft's Comma Separated Value (CSV) format.
// This problem is addressed in Jeffrey Friedl's book *Mastering Regular Expressions*, pg. 213
// and you can compare this solution to his discussion there.
//
// Two separate approaches are taken.
// The first is to define a grammar that will match only one field, and then find them all in a loop with the global flag set.
// The second is to define a grammar that scoops up all fields in one fell swoop.
//
// The Microsoft format calls for escaping a quote within a quoted string by using a pair of quotes.
// Therefore, this is not entirely just a pattern matching problem.
// Regardless of whether using `regex` or `apg-exp`,
// a replacement process (translation) must follow the pattern matching (parsing) process.
// In this simple case, it is easiest to just use the built-in, JavaScript string replacement functions.
// However, I will also show how it can be almost as easily done with `apg-exp`.
// The only thing that makes `apg-exp` slightly more inconvenient is that it is not built into the JavaScript language.
(function() {
  try {
    var apgexp = require("apg-exp");
    var apglib = require("apg-lib");
    var grammar1 = new (require("./grammars/csv-fields.js"))();
    var grammar2 = new (require("./grammars/csv.js"))();
    var exp, str, rstr, result, value;
    str = 'Ten Thousand,10000, 2710 ,,"10,000","It\'s ""10 Grand"", baby",10K';
    exp = new apgexp(grammar1, "g");
    console.log();
    console.log("the single-field grammar:");
    console.log(exp.source);
    console.log();
    console.log("the input string:");
    console.log(str);
    // This first pass simply finds the raw fields. Neither the surrounding or embedded quotes are removed.
    console.log("the raw fields:");
    while(true){
      result = exp.exec(str);
      if(result === null){
        break;
      }
      console.log("field: "+result[0]);
    }
    // This pass will use the SABNF grammar to distinguish between quoted and non-quoted fields.
    // In this case, the grammar will eliminate the surrounding quotes as part of the parsing or pattern matching process.
    // But replacing the interior pairs of quotes with a single quote requires a second, translation, step.
    // I'll do it here both with the JavaScript string replacement function and the `apg-exp` replacement function.
    console.log();
    console.log("the input string:");
    console.log(str);
    console.log("the field values found separately:");
    while(true){
      result = exp.exec(str);
      if(result === null){
        break;
      }
      if(result.rules['quoted-text']){
        if(result.rules['double-quote']){
          // Replace the double quote with a single quote using the built-in JavaScript `replace()` function.
          var phrase = result.rules['quoted-text'][0].phrase;
          rstr = phrase.replace(/""/g, '"');
          console.log("value: "+rstr + " : JavaScript replacement function");
          // Replace the double quote with a single quote using the `apg-exp replace()` function.
          // Note that in the SABNF syntax `%d34` represents a double quote, character code 34.
          // (Yes, the constructor should be outside of the loop, but I wanted it explicitly displayed here
          // for clarity.)
          debugger;
          var rrexp = new apgexp('rule = 2%d34\n', "g");
          rstr = rrexp.replace(phrase, '"');
          console.log("value: "+rstr + " : apg-exp replacement function");
        }else{
          console.log("value: "+result.rules['quoted-text'][0].phrase);
        }
      }
      if(result.rules['text']){
        console.log("value: "+result.rules['text'][0].phrase);
      }
    }
    // Now we will try to scoop them all up at once.
    // The advantage here is that we get all of the raw comma-separated fields in a single array.
    // In this case `result.rules['field']` is an array of phrase objects. i.e. `{phrase : string, index : number}`.
    // The disadvantage is that we have to remove the surrounding quotes as well as replace the
    // interior pairs of quotes in separate steps.
    // It also points out a weakness in the `apg-exp result` format.
    // Even though it is more complete than its JavaScript `RegExp` counterpart in that it has all
    // of the matched phrases for each rule (`RegExp` grouping) instead of just the last one matched,
    // there is no easy way to associate which `result.rules['quoted-text']` belongs to which
    // `result.rules['field']`.
    // (We could do this with a translation of the `exp.ast` object, but that is for another time and place.)
    exp = new apgexp(grammar2);
    exp.exclude(["any-but-quote", "any-but-comma"]);
    console.log();
    console.log("the 'all-at-once' grammar:");
    console.log(exp.source);
    console.log();
    console.log("the input string:");
    console.log(str);
    console.log("the field values found all at once:");
    result = exp.exec(str);
    var rrexp = new apgexp('rule = 2%d34\n', "g");
    var rexp = new apgexp('rule = (%^ %d34) / (%d34 %$)\n', "g");
    result.rules['field'].forEach(function(field){
      /* replace pairs of quotes, if any */
      value = rrexp.replace(field.phrase, '"');
      /* remove surrounding quotes, if any */
      value = rexp.replace(value, '');
      console.log("value: "+value);
    });
  } catch (e) {
    console.log("EXCEPTION: " + e.message);
  }
})();


text:
<?php

/* Hi5EvaluatieParagraph Fixture generated on: 2011-04-15 15:04:25 : 1302873145 */
class Hi5EvaluatieParagraphFixture extends CakeTestFixture
{
    public $name = 'Hi5EvaluatieParagraph';
    public $import = array('model' => 'Hi5EvaluatieParagraph', 'records' => true);
}


text:
<?php

if (!defined('APP_PATH')) {
    define('APP_PATH', dirname(__DIR__));
}

$vendorDir = APP_PATH . '/vendor';

$loader = require APP_PATH . '/init_autoloader.php';
require APP_PATH . '/Bootstrap.php';

$loader->add('apptest', __DIR__);


text:
package com.cg.sql;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import com.cg.connection.MyConnection;

public class StatementDemo {

	public static void showAllEmployee(){
		Connection con=null;
		Statement st=null;
		ResultSet rs=null;
		try {
//step 1 : getConnection
			con=MyConnection.getCon();
//step 2 : create statement object to execute SQL cmd
			st=con.createStatement();
			String sql="select * from myemp";
//step 3 : create ResultSet object to store result from DB
			rs=st.executeQuery(sql);
//step 4 : get the data from the ResultSet
			System.out.println("|===============================================================================|");
			System.out.println("|			Employee Records					|");
			System.out.println("|===============================================================================|");
			System.out.println("|EmpNo\t|\tEName\t|\tGrade\t|\tDate Of Birth"
					+ "\t\t|DeptNo\t|");
			System.out.println("|===============================================================================|");
			while(rs.next()){
				System.out.println("|"+rs.getInt(1)
						+"\t|\t"+rs.getString(2)
						+"\t|\t"+rs.getString(3)
						+"\t|\t"+rs.getString(4)
						+"\t|"+rs.getString(5)
						+"\t|");
			}
			System.out.println("|===============================================================================|");
		} catch (SQLException e) {
			e.printStackTrace();
		}finally{
			try {
				if(st!=null)
					st.close();
				if(con!=null)
					MyConnection.closeCon();
			} catch (Exception e2) {
				e2.printStackTrace();
			}
		}
	}
}


text:
package org.linqs.psl.utils.textsimilarity;

import org.linqs.psl.database.ReadableDatabase;
import org.linqs.psl.model.function.ExternalFunction;
import org.linqs.psl.model.term.Constant;
import org.linqs.psl.model.term.ConstantType;
import org.linqs.psl.model.term.StringAttribute;

import com.wcohen.ss.BasicStringWrapper;
import com.wcohen.ss.Level2MongeElkan;

/**
 * Wraps the Level 2 Monge-Elkan string similarity from the Second String library.
 * Level 2 means that tokens are broken up before comparison.
 * If the similarity is below a threshold (default=0.5) it returns 0.
 */
public class Level2MongeElkanSimilarity implements ExternalFunction {
	// similarity threshold (default=0.5)
	private double simThresh;

	// constructors
	public Level2MongeElkanSimilarity() {
		this.simThresh = 0.5;
	}
	public Level2MongeElkanSimilarity(double simThresh) {
		this.simThresh = simThresh;
	}

	@Override
	public int getArity() {
		return 2;
	}

	@Override
	public ConstantType[] getArgumentTypes() {
		return new ConstantType[] { ConstantType.String, ConstantType.String };
	}

	@Override
	public double getValue(ReadableDatabase db, Constant... args) {
		String a = ((StringAttribute) args[0]).getValue();
		String b = ((StringAttribute) args[1]).getValue();
		BasicStringWrapper aWrapped = new BasicStringWrapper(a);
		BasicStringWrapper bWrapped = new BasicStringWrapper(b);

		Level2MongeElkan mongeElkan = new Level2MongeElkan();
		double sim = mongeElkan.score(aWrapped, bWrapped);

		if (sim < simThresh)
			return 0.0;
		else
			return sim;
	 }
}


text:
$:.unshift(File.dirname(__FILE__)) unless
  $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))

require 'cardjour/application'

module Cardjour
end


text:
package authentication

// TestSigner represents an authentication key signer which we can use for
// testing purposes only. This will largely be a stub to send through client
// unit tests.
type TestSigner struct{}

// NewTestSigner constructs a new instance of test signer
func NewTestSigner() (Signer, error) {
	return &TestSigner{}, nil
}

func (s *TestSigner) DefaultAlgorithm() string {
	return ""
}

func (s *TestSigner) KeyFingerprint() string {
	return ""
}

func (s *TestSigner) Sign(dateHeader string, isManta bool) (string, error) {
	return "", nil
}

func (s *TestSigner) SignRaw(toSign string) (string, string, error) {
	return "", "", nil
}


text:
#pragma once

namespace avr_halib
{
namespace object
{
	/**\brief Special delegate calling functions of childs
	 * \tparam parameter the parameter of the delegate call
	 *
	 * This delegate is only usefull in certain situations, especally if one wants polymorphic behaviour in classes, but without the overhead of the virtual keyword.
	 * This delegate costs exactly 2 bytes of ram and an indirect call.
	 **/
	template < typename parameter=void >
	class ThisDelegate
	{
		/**\brief Define stub to be void pointer**/
        typedef void (*invoke_stub)(void const *, parameter);
		/**\brief Storage of stub pointer**/
        volatile invoke_stub stub_ptr_;

		/**\brief Helper class to invoke stubbed function
		 * \tparam T the type of the object
		 * \tparam Fxn the type of the function
		 *
		 * This helper calls the stub pointer after casting it to the
		 * appropriate type
		 **/
        template < typename T, void (T::*Fxn)(parameter) >
        struct mem_fn_stub
		{
			/**\brief invoke the stub pointer
			 * \param obj_ptr the pointer to the object of type T
			 * \param a0 the parameter of the call to the function
			 **/
            static void invoke(void const * obj_ptr, parameter a0)
			{
                T * obj = static_cast<T *>(const_cast<void *>(obj_ptr));
                (obj->*Fxn)(a0);
            }
        };

        template < void (*Fxn)(parameter) >
        struct function_stub {
            static void invoke(void const *, parameter a0) {
                (*Fxn)(a0);
            }
        };

	protected:
		/**\brief Constructor
		 *
		 * Sets function pointer to 0
		 **/
        ThisDelegate() : stub_ptr_(0) {}

		/**\brief Call the registered function
		 * \param a0 the parameter of the call
		 **/
		void operator()(parameter a0) const
		{
            (*stub_ptr_)(this, a0);
        }

	public:
		/**\brief reset function pointer to 0**/
        void reset()
		{
            stub_ptr_ = 0;
        }

		/**\brief check if function was registered
		 * \return true if there is one, false otherwise
		 **/
        bool isEmpty()
		{
            return stub_ptr_ == 0;
        }

		/**\brief bind a new function
		 * \tparam T the type containing the function
		 * \tparam Fxn the function of type T
		 **/
        template < typename T, void (T::*Fxn)(parameter) >
        void bind()
		{
            stub_ptr_ = &mem_fn_stub<T, Fxn>::invoke;
        }

		/**
         * \brief Assigns a function to this delegate object
         * \tparam Fxn Function pointer
         *
         * \see setDelegateFunction
         */
        template < void (*Fxn)(parameter) >
        void bind()
		{
            stub_ptr_ = &function_stub<Fxn>::invoke;
        }

		/**\brief overloaded cast to bool
		 *
		 * Can be used as another way for isEmpty
		 **/
        operator bool() const
		{
            return stub_ptr_;
        }
	};

	/**\brief Special delegate calling functions of childs, version without parameters
	 *
	 * This delegate is only usefull in certain situations, especally if one wants polymorphic behaviour in classes, but without the overhead of the virtual keyword.
	 * This delegate costs exactly 2 bytes of ram and an indirect call.
	 **/
	template<>
	class ThisDelegate<void>
	{
		/**\brief Define stub to be void pointer**/
        typedef void (*invoke_stub)(void const *);
		/**\brief Storage of stub pointer**/
        volatile invoke_stub stub_ptr_;

		/**\brief Helper class to invoke stubbed function
		 * \tparam T the type of the object
		 * \tparam Fxn the type of the function
		 *
		 * This helper calls the stub pointer after casting it to the
		 * appropriate type
		 **/
        template < typename T, void (T::*Fxn)() >
        struct mem_fn_stub {
			/**\brief invoke the stub pointer
			 * \param obj_ptr the pointer to the object of type T
			 **/
            static void invoke(void const * obj_ptr)
			{
                T * obj = static_cast<T *>(const_cast<void *>(obj_ptr));
                (obj->*Fxn)();
            }
        };

		template < void (*Fxn)() >
        struct function_stub {
            static void invoke(void const *) {
                (*Fxn)();
            }
        };

	protected:
		/**\brief Constructor
		 *
		 * Sets function pointer to 0
		 **/
        ThisDelegate() : stub_ptr_(0) {}

		/**\brief Call the registered function**/
		void operator()() const
		{
            (*stub_ptr_)(this);
        }

	public:
		/**\brief reset function pointer to 0**/
        void reset()
		{
            stub_ptr_ = 0;
        }

		/**\brief check if function was registered
		 * \return true if there is one, false otherwise
		 **/
        bool isEmpty()
		{
            return stub_ptr_ == 0;
        }

		/**\brief bind a new function
		 * \tparam T the type containing the function
		 * \tparam Fxn the function of type T
		 **/
        template < typename T, void (T::*Fxn)() >
        void bind()
		{
            stub_ptr_ = &mem_fn_stub<T, Fxn>::invoke;
        }

		/**
         * \brief Assigns a function to this delegate object
         * \tparam Fxn Function pointer
         *
         * \see setDelegateFunction
         */
        template < void (*Fxn)() >
        void bind()
		{
            stub_ptr_ = &function_stub<Fxn>::invoke;
        }

		/**\brief overloaded cast to bool
		 *
		 * Can be used as another way for isEmpty
		 **/
        operator bool() const
		{
            return stub_ptr_;
        }
	};
}
}


text:
@interface ScaleScrollViewController : BaseViewController

@end


text:
import 'styles/core.scss'
import 'react-s-alert/dist/s-alert-default.css'
import 'react-s-alert/dist/s-alert-css-effects/slide.css'
import './index.scss'

import ReactFireMixin from 'reactfire'
import reactMixin from 'react-mixin'
import Firebase from 'firebase'
import i18next from 'i18next'
import LanguageDetector from 'i18next-browser-languagedetector'
import Alert from 'react-s-alert'

import { WAIT_TIME } from 'utils/config'
import config from 'utils/config'
import firebaseUtils from 'utils/firebase/index'
import Loading from 'components/Loading/index'
import Navigation from 'components/Navigation/index'
import Modals from 'components/Modals/index'
import CustomAlert from 'components/CustomAlert/index'
import Footer from 'components/Footer/index'

const firebaseRef = new Firebase(config.firebaseRef())

export class CoreLayout extends React.Component {
  static propTypes = {
    children: React.PropTypes.element.isRequired,
    history: React.PropTypes.object.isRequired,
    location: React.PropTypes.object.isRequired,
  }

  constructor() {
    super()
    this.state = {
      userFirebase: undefined,
    }
  }

  componentDidMount() {
    this._onAuth()
    setTimeout(() => {
      this._watchConnected()
      document.querySelector('.CoreLayout__overlay').classList.add('CoreLayout__overlay--hide')
    }, WAIT_TIME)
  }

  _isBinded(bindVar) {
    return typeof this.firebaseRefs[bindVar] !== 'undefined'
  }

  _onAuth() {
    firebaseRef.onAuth((authData) => {
      if (!authData) {
        if (this._isBinded('userFirebase')) {
          this.unbind('userFirebase')
          this.props.history.pushState(null, '/')
        }
        return
      }
      firebaseUtils.users.create(authData)
        .then(() => {
          const uid = authData.auth.uid
          const firebaseRefUsers = new Firebase(`${config.firebaseRef()}users/${uid}`)
          this.bindAsObject(firebaseRefUsers, 'userFirebase')
          if (this.props.location.pathname === '/') {
            this.props.history.pushState(null, '/timeline')
          }
        })
    })
  }

  _setLang() {
    const options = {
      init: {
        fallbackLng: 'en',
        resources: {
          en: require('utils/i18n/resources/en'),
          ja: require('utils/i18n/resources/ja'),
        },
      },
    }

    i18next
      .use(LanguageDetector)
      .init(options.init)
  }

  _watchConnected() {
    const firebaseRefConnected = new Firebase(`${config.firebaseRef()}.info/connected`)
    firebaseRefConnected.on('value', (snap) => {
      if (!snap.val()) {
        Alert.error(i18next.t('connected__false'), {
          timeout: 'none',
        })
        return
      }
      Alert.closeAll()
    })
  }

  render() {
    this._setLang()
    const children = React.cloneElement(
      this.props.children,
      { userFirebase: this.state.userFirebase }
    )
    return (

        <Alert
          position='top-right'
          effect='slide'
          timeout={3000}
          contentTemplate={CustomAlert} />
        <Modals {...this.state} {...this.props} />
        <Navigation {...this.state} {...this.props} />

          <Loading />

          {children}

    )
  }
}

export default reactMixin.decorate(ReactFireMixin)(CoreLayout)


text:
$(document).ready(function(){
  // makeListsSortable()
  addToRoster()
  subtractFromRoster();
  checkBoxListenersOn()
  nameFilterListener()
  titleSubmitListener()
  gradeFilterButtonListener()
  nameFilterButtonListener()
});

$(document).ajaxComplete(function() {
  filterElements()
  // makeListsSortable()
  addToRoster()
  subtractFromRoster();
});

function rosterIds(){
  return ($('#selected-students-list').find('.student-id-hidden-field')).toArray().map(function(element){
    return $(element).val()
  })
}

function makeListsSortable(){
  $( "#all-students-list, #selected-students-list" ).sortable({
    appendTo: 'body',
    connectWith: ".connectedSortable",
    scroll: false,
    start: function (event, ui) {
      ui.item.toggleClass("highlight");
    },
    stop: function (event, ui) {
          ui.item.toggleClass("highlight");
    },
    update: function(){
      updateLists()
    }
  }).disableSelection();
}

function updateLists(){
  $.ajax({
  url: window.location.href.slice(0, -5)
  type: 'patch',
  data:  {roster_ids: rosterIds()},
  success: (function(message){
    $('#draggable-student-lists').html(message)
    })
  })
}

function addToRoster(){
  $('.add-icon').on('click', function(e){
    $($(this).parent()).hide()
    $("#selected-students-list").append($(this).parent());
    updateLists()
  })
}
function subtractFromRoster(){
  $('.minus-icon').on('click', function(e){
    $(this).parent().remove();
    updateLists()
  })
}

function checkedGrades(){
  return $('.grade-checkbox-full').toArray().map(function(element){
    return $(element).next().text().trim()
  })
}

function checkBoxListenersOn(){
  $('.grade-checkbox-empty').on('click', function(){
    $(this).removeClass('fa-circle-o');
    $(this).removeClass('grade-checkbox-empty');
    $(this).addClass('fa-check-circle');
    $(this).addClass('grade-checkbox-full');
    checkBoxListenersOff()
    checkBoxListenersOn();
    filterElements()
  });

  $('.grade-checkbox-full').on('click', function(){
    $(this).removeClass('fa-check-circle');
    $(this).removeClass('grade-checkbox-full');
    $(this).addClass('fa-circle-o');
    $(this).addClass('grade-checkbox-empty');
    checkBoxListenersOff();
    checkBoxListenersOn();
    filterElements()
  });
}

function checkBoxListenersOff(){
  $('.grade-checkbox-empty').off()
  $('.grade-checkbox-full').off()
}

function nameFilterListener(){
  $('#student-name-filter-field').on('keyup', function(){
    filterElements()
  })
}

function filterByName(element){
  var re = new RegExp($("#student-name-filter-field").val(), "i")
    if (!$(element).text().match(re)){
      return false
    }else {
      return true
    }
}

function filterByGrade(element){
  // $('.sortable-student-info-wrapper').each(function(index, element){
    if (checkedGrades().length == 0){
      return true
    }else if(checkedGrades().indexOf($(element).find('.student-grade-hidden-field').val()) >= 0){
      return true
    }else {
      return false
    }
  // })
}

function filterElement(element){
  if (!!filterByName(element) && !!filterByGrade(element)){
    $(element).show()
  }else {
    $(element).hide()
  }
}

function filterElements(){
  $('.sortable-student-info-wrapper').each(function(index, element){
    filterElement(element)
  })
}

function titleSubmitListener(){
  $('.title-submit-form').on('submit', function(e){
    e.preventDefault()
    e.stopPropagation()

    $.ajax({
      url: window.location.href.slice(0, -5) + '/title',
      type: 'post',
      data:  {title: $('#roster_title').val()},
      success: (function(message){
        $('#title-header').html(message.title)
      })
    })
  })
}

function nameFilterButtonListener(){
  $("#show-name-filter-btn").on('click', function(){
    $('#filter-by-name').slideToggle(500)
  })
}

function gradeFilterButtonListener(){
  $("#show-grade-filter-btn").on('click', function(){
    $('#filter-by-grade').slideToggle(500)
  })
}


text:
import { Component, ViewChild } from '@angular/core';
import { SpService } from '../../../sharepoint/sharepoint.service';
import { DataTable } from 'primeng/primeng';
import { TemplateComponent } from '../../form.template';

@Component({
    selector: 'rtk_operations',
    templateUrl: './rtk_operations.component.html',
    styleUrls: ['./rtk_operations.component.css'],
})
export class operationRTKComponent extends TemplateComponent {
    @ViewChild(DataTable) dataTable: DataTable;

    constructor(private spservice: SpService) {
        super(spservice,
            {
                listName: 'List8',
                listTitle: 'Операции РТК',
                viewName: 'Все элементы'
            });

    }

    onRowSelect(event) {
        this.newItem = false;
        this.item = this.cloneItem(event.data);
        this.displayDialog = true;
    }

}


text:
stack = ["python", "selenium", "hello"]
element = None
second_element = None

# add an element to the end of the list

print (stack)

# retrieve the last item from list

print(stack)
print(element)

# retrieve the last item from list

print(stack)
print(second_element)

# add an element to the end of the list

print(stack)


text:
Param(
    [Parameter(Mandatory=$True,Position=1)]
	[string]$PHP_ZIP,
	[Parameter(Mandatory=$True,Position=2)]
    [string]$SQLSRV_DRIVER,
    [Parameter(Mandatory=$True,Position=3)]
    [string]$PDO_DRIVER
    )

$ErrorActionPreference = "Stop"

$startingDir=$pwd.Path
$tempFolder=Join-Path $startingDir "temp"

Remove-Item temp -Recurse -Force -ErrorAction Ignore
New-Item -ItemType directory -Path temp

Write-Host "Installing chocolatey..."
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
Write-Host "Installing Git..."
choco install -y git

$gitDir = 'C:\Program Files\Git\cmd\git.exe'
Write-Host "Installing Python3..."
choco install -y python3
RefreshEnv
Write-Host "Installing pyodbc..."
C:\Python*\Scripts\pip3.exe install pyodbc | Out-Null
Write-Host "Downloading MSODBCSQL..."
#This needs to be manually updated when there is a new release
(New-object System.Net.WebClient).DownloadFile('https://download.microsoft.com/download/D/5/E/D5EEF288-A277-45C8-855B-8E2CB7E25B96/x64/msodbcsql.msi', "$tempFolder\msodbcsql.msi")
Write-Host "Installing MSODBCSQL..."
msiexec /quiet /passive /qn /i $tempFolder\msodbcsql.msi IACCEPTMSODBCSQLLICENSETERMS=YES | Out-Null
Write-Host "Installing 7-Zip..."
choco install -y 7zip.install

Write-Host "Installing PHP..."
$phpDir="C:\php"

# remove existing PHP and setup new one
Remove-Item $phpDir -Recurse -ErrorAction Ignore
New-Item -ItemType directory -Path $phpDir
Expand-Archive $PHP_ZIP -DestinationPath $phpDir

# copy drivers to extensions directory and rename to a standard nomenclature
# for consistency with run-perf_tests.py
Copy-Item $SQLSRV_DRIVER $phpDir\ext\php_sqlsrv.dll
Copy-Item $PDO_DRIVER $phpDir\ext\php_pdo_sqlsrv.dll

# setup driver
Copy-Item $phpDir\php.ini-production $phpDir\php.ini
Add-Content $phpDir\php.ini "extension=$phpDir\ext\php_openssl.dll"
Add-Content $phpDir\php.ini "extension=$phpDir\ext\php_mbstring.dll"

Add-Content $phpDir\php.ini "extension=$phpDir\ext\php_sqlsrv.dll"
Add-Content $phpDir\php.ini "extension=$phpDir\ext\php_pdo_sqlsrv.dll"

Move-Item $phpDir\php.ini C:\Windows -force
Copy-Item $phpDir\ssleay32.dll C:\Windows -force
Copy-Item $phpDir\libeay32.dll C:\Windows -force
cd $startingDir
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";" + $phpDir + ";" + $gitDir, [System.EnvironmentVariableTarget]::Machine)
$env:Path = $env:Path + ";" + $phpDir + ";" + $gitDir
RefreshEnv

# setup composer
wget https://getcomposer.org/installer -O composer-setup.php
php composer-setup.php
php composer.phar install
Remove-Item temp -Recurse -Force -ErrorAction Ignore
Write-Host "Setup completed!"