text:
from __future__ import unicode_literals

import urllib
import frappe
from frappe.utils import get_request_site_address, get_datetime, nowdate
from frappe.website.router import get_pages, get_all_page_context_from_doctypes

no_cache = 1
no_sitemap = 1
base_template_path = "templates/www/sitemap.xml"

def get_context(context):
	"""generate the sitemap XML"""
	host = get_request_site_address()
	links = []
	for route, page in get_pages().iteritems():
		if not page.no_sitemap:
			links.append({
				"loc": urllib.basejoin(host, urllib.quote(page.name.encode("utf-8"))),
				"lastmod": nowdate()
			})

	for route, data in get_all_page_context_from_doctypes().iteritems():
		links.append({
			"loc": urllib.basejoin(host, urllib.quote((route or "").encode("utf-8"))),
			"lastmod": get_datetime(data.get("modified")).strftime("%Y-%m-%d")
		})

	return {"links":links}

redpajama_set_name: RedPajamaGithub


text:
Manage credentials for applications, databases, CI/CD tools, and services without causing friction in the development process.
This integration was integrated and tested with version 1.37.0 of DelineaDSV

## Configure DelineaDSV on Cortex XSOAR

1. Navigate to **Settings** > **Integrations** > **Servers & Services**.
2. Search for DelineaDSV.
3. Click **Add instance** to create and configure a new integration instance.

    | **Parameter** | **Required** |
    | --- | --- |
    | Server URL (e.g. https://example.com) | True |
    | Trust any certificate (not secure) | False |
    | Use system proxy settings | False |
    | Client ID | True |
    | Client Secret | True |

4. Click **Test** to validate the URLs, token, and connection.
## Commands
You can execute these commands from the Cortex XSOAR CLI, as part of an automation, or in a playbook.
After you successfully execute a command, a DBot message appears in the War Room with the command details.
### dsv-secret-get
***
Getting a secret fom DSV

#### Base Command

`dsv-secret-get`
#### Input

| **Argument Name** | **Description** | **Required** |
| --- | --- | --- |
| name | Secret name for DSV. | Required |

#### Context Output

| **Path** | **Type** | **Description** |
| --- | --- | --- |
| secret | String | Received JSON object secret |

#### Command Example
```!dsv-secret-get name="accounts/xsoar"```

#### Context Example
```json
{
    "DSV": {
        "Secret": {
            "attributes": {},
            "created": "2022-05-17T10:55:41Z",
            "createdBy": "users:thy-one:testuser@accessecm.com",
            "data": {
                "password": "XSOARPassword",
                "username": "xsoar"
            },
            "description": "",
            "id": "e88f725b-ff1c-4902-961e-fcdf3c7f712f",
            "lastModified": "2022-05-17T10:55:41Z",
            "lastModifiedBy": "users:thy-one:testuser@accessecm.com",
            "path": "accounts:xsoar",
            "version": "1"
        }
    }
}
```


text:
<ion-view cache-view="false" view-title="Options">
  <ion-content>
    <ion-list>
    <ion-toggle ng-model="settings.enableServer">
      Enable Server
    </ion-toggle>
    </ion-list>
  </ion-content>
</ion-view>


text:
require 'sinatra/base'
require File.expand_path('../../../modules/querystringbuilder.rb', __FILE__)

RSpec.configure do |c|
  c.include Sinatra::QueryStringBuilder
end

describe "query builder" do
  it  "has acces to a method defined in the module" do
    expect(build_property_array("test")).to eq([],[])
  end

end


text:
<?xml version="1.0" encoding="UTF-8"?>
<results title="genus">
 <result pre="11.ref034">34 ]. Among these studies, some have identified risk factors for the presence of " exact="Aedes" match="Aedes" post=" mosquito species, such as socio-economic factors [ 29 " name="genus"/>
</results>


text:
namespace NHTV {
struct Material {
  size_t texture;
  size_t shader;
};
}


text:
/* This file was generated by SableCC's ObjectMacro. */

package org.sablecc.objectmacro.codegeneration.java.macro;

import java.util.*;

public class MSetInternal
        extends Macro {

    private DSeparator ParamNameSeparator;

    private DBeforeFirst ParamNameBeforeFirst;

    private DAfterLast ParamNameAfterLast;

    private DNone ParamNameNone;

    final List<String> list_ParamName;

    final Context ParamNameContext = new Context();

    final StringValue ParamNameValue;

    private DSeparator ContextSeparator;

    private DBeforeFirst ContextBeforeFirst;

    private DAfterLast ContextAfterLast;

    private DNone ContextNone;

    final List<String> list_Context;

    final Context ContextContext = new Context();

    final StringValue ContextValue;

    private DSeparator SetParamsSeparator;

    private DBeforeFirst SetParamsBeforeFirst;

    private DAfterLast SetParamsAfterLast;

    private DNone SetParamsNone;

    final List<Macro> list_SetParams;

    final Context SetParamsContext = new Context();

    final MacroValue SetParamsValue;

    private Map<Context, StringValue> list_VarName = new LinkedHashMap<>();

    MSetInternal(
            Macros macros) {

        setMacros(macros);
        this.list_ParamName = new LinkedList<>();
        this.list_Context = new LinkedList<>();
        this.list_SetParams = new LinkedList<>();
        this.list_VarName = new LinkedHashMap<>();

        this.ParamNameValue
                = new StringValue(this.list_ParamName, this.ParamNameContext);
        this.ContextValue
                = new StringValue(this.list_Context, this.ContextContext);
        this.SetParamsValue
                = new MacroValue(this.list_SetParams, this.SetParamsContext);
    }

    MSetInternal(
            String pParamName,
            String pContext,
            List<Macro> pSetParams,
            Macros macros) {

        setMacros(macros);
        this.list_ParamName = new LinkedList<>();
        this.list_Context = new LinkedList<>();
        this.list_SetParams = new LinkedList<>();
        this.list_VarName = new LinkedHashMap<>();

        this.ParamNameValue
                = new StringValue(this.list_ParamName, this.ParamNameContext);
        this.ContextValue
                = new StringValue(this.list_Context, this.ContextContext);
        this.SetParamsValue
                = new MacroValue(this.list_SetParams, this.SetParamsContext);
        if (pSetParams != null) {
            addAllSetParams(pSetParams);
        }

        if (pParamName != null) {
            addParamName(pParamName);
        }
        if (pContext != null) {
            addContext(pContext);
        }
    }

    public void addAllParamName(
            List<String> strings) {

        if (this.macros == null) {
            throw ObjectMacroException.parameterNull("ParamName");
        }
        if (this.cacheBuilder != null) {
            throw ObjectMacroException
                    .cannotModify(this.getClass().getSimpleName());
        }
        for (String string : strings) {
            if (string == null) {
                throw ObjectMacroException.parameterNull("ParamName");
            }

            this.list_ParamName.add(string);
        }
    }

    public void addParamName(
            String string) {

        if (string == null) {
            throw ObjectMacroException.parameterNull("ParamName");
        }
        if (this.cacheBuilder != null) {
            throw ObjectMacroException
                    .cannotModify(this.getClass().getSimpleName());
        }

        this.list_ParamName.add(string);
    }

    public void addAllContext(
            List<String> strings) {

        if (this.macros == null) {
            throw ObjectMacroException.parameterNull("Context");
        }
        if (this.cacheBuilder != null) {
            throw ObjectMacroException
                    .cannotModify(this.getClass().getSimpleName());
        }
        for (String string : strings) {
            if (string == null) {
                throw ObjectMacroException.parameterNull("Context");
            }

            this.list_Context.add(string);
        }
    }

    public void addContext(
            String string) {

        if (string == null) {
            throw ObjectMacroException.parameterNull("Context");
        }
        if (this.cacheBuilder != null) {
            throw ObjectMacroException
                    .cannotModify(this.getClass().getSimpleName());
        }

        this.list_Context.add(string);
    }

    public void addAllSetParams(
            List<Macro> macros) {

        if (macros == null) {
            throw ObjectMacroException.parameterNull("SetParams");
        }
        if (this.cacheBuilder != null) {
            throw ObjectMacroException
                    .cannotModify(this.getClass().getSimpleName());
        }

        int i = 0;

        for (Macro macro : macros) {
            if (macro == null) {
                throw ObjectMacroException.macroNull(i, "SetParams");
            }

            if (getMacros() != macro.getMacros()) {
                throw ObjectMacroException.diffMacros();
            }

            verifyTypeSetParams(macro);
            this.list_SetParams.add(macro);
            this.children.add(macro);
            Macro.cycleDetector.detectCycle(this, macro);

            i++;
        }
    }

    void verifyTypeSetParams(
            Macro macro) {

        macro.apply(new InternalsInitializer("SetParams") {

            @Override
            void setParamRef(
                    MParamRef mParamRef) {

            }

            @Override
            void setStringValueArg(
                    MStringValueArg mStringValueArg) {

            }
        });
    }

    public void addSetParams(
            MParamRef macro) {

        if (macro == null) {
            throw ObjectMacroException.parameterNull("SetParams");
        }
        if (this.cacheBuilder != null) {
            throw ObjectMacroException
                    .cannotModify(this.getClass().getSimpleName());
        }

        if (getMacros() != macro.getMacros()) {
            throw ObjectMacroException.diffMacros();
        }

        this.list_SetParams.add(macro);
        this.children.add(macro);
        Macro.cycleDetector.detectCycle(this, macro);
    }

    public void addSetParams(
            MStringValueArg macro) {

        if (macro == null) {
            throw ObjectMacroException.parameterNull("SetParams");
        }
        if (this.cacheBuilder != null) {
            throw ObjectMacroException
                    .cannotModify(this.getClass().getSimpleName());
        }

        if (getMacros() != macro.getMacros()) {
            throw ObjectMacroException.diffMacros();
        }

        this.list_SetParams.add(macro);
        this.children.add(macro);
        Macro.cycleDetector.detectCycle(this, macro);
    }

    void setVarName(
            Context context,
            StringValue value) {

        if (value == null) {
            throw new RuntimeException("value cannot be null here");
        }

        this.list_VarName.put(context, value);
    }

    private String buildParamName() {

        StringBuilder sb = new StringBuilder();
        List<String> strings = this.list_ParamName;

        int i = 0;
        int nb_strings = strings.size();

        for (String string : strings) {

            sb.append(string);
            i++;
        }

        return sb.toString();
    }

    private String buildContext() {

        StringBuilder sb = new StringBuilder();
        List<String> strings = this.list_Context;

        int i = 0;
        int nb_strings = strings.size();

        for (String string : strings) {

            sb.append(string);
            i++;
        }

        return sb.toString();
    }

    private String buildSetParams() {

        StringBuilder sb = new StringBuilder();
        Context local_context = this.SetParamsContext;
        List<Macro> macros = this.list_SetParams;

        int i = 0;
        int nb_macros = macros.size();
        String expansion = null;

        for (Macro macro : macros) {
            expansion = macro.build(local_context);

            sb.append(expansion);
            i++;
        }

        return sb.toString();
    }

    private String buildVarName(
            Context context) {

        StringValue stringValue = this.list_VarName.get(context);
        return stringValue.build();
    }

    StringValue getParamName() {

        return this.ParamNameValue;
    }

    StringValue getContext() {

        return this.ContextValue;
    }

    MacroValue getSetParams() {

        return this.SetParamsValue;
    }

    private StringValue getVarName(
            Context context) {

        return this.list_VarName.get(context);
    }

    private void initSetParamsInternals(
            Context context) {

        for (Macro macro : this.list_SetParams) {
            macro.apply(new InternalsInitializer("SetParams") {

                @Override
                void setParamRef(
                        MParamRef mParamRef) {

                }

                @Override
                void setStringValueArg(
                        MStringValueArg mStringValueArg) {

                }
            });
        }
    }

    private void initParamNameDirectives() {

    }

    private void initContextDirectives() {

    }

    private void initSetParamsDirectives() {

    }

    @Override
    void apply(
            InternalsInitializer internalsInitializer) {

        internalsInitializer.setSetInternal(this);
    }

    @Override
    String build(
            Context context) {

        CacheBuilder cache_builder = this.cacheBuilders.get(context);

        if (cache_builder == null) {
            cache_builder = new CacheBuilder();
        }
        else if (cache_builder.getExpansion() == null) {
            throw new InternalException("Cycle detection detected lately");
        }
        else {
            return cache_builder.getExpansion();
        }

        this.cacheBuilders.put(context, cache_builder);
        List<String> indentations = new LinkedList<>();

        initSetParamsInternals(context);

        initParamNameDirectives();
        initContextDirectives();
        initSetParamsDirectives();

        StringBuilder sb0 = new StringBuilder();

        sb0.append("m");
        sb0.append(buildVarName(context));
        sb0.append(".set");
        sb0.append(buildParamName());
        sb0.append("(");
        sb0.append(buildContext());
        sb0.append(", ");
        sb0.append(buildSetParams());
        sb0.append(");");
        cache_builder.setExpansion(sb0.toString());
        return sb0.toString();
    }

    private void setMacros(
            Macros macros) {

        if (macros == null) {
            throw new InternalException("macros cannot be null");
        }

        this.macros = macros;
    }
}


text:
<?php

namespace Phug\Util\Partial;

/**
 * Class BlockTrait.
 */
trait ScopeTrait
{
    /**
     * @var string
     */
    private $scopeId = null;

    /**
     * {@inheritdoc}
     */
    public function setScope($object)
    {
        $this->scopeId = is_object($object) ? spl_object_hash($object) : null;

        return $this;
    }

    /**
     * {@inheritdoc}
     */
    public function getScopeId()
    {
        return $this->scopeId;
    }
}


text:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Vulcan
{
    public partial class Attributes : Form
    {
        public Attributes()
        {
            InitializeComponent();
        }

        private void Attributes_Load(object sender, EventArgs e)
        {

        }

        private void button4_Click(object sender, EventArgs e)
        {

        }

        private void button5_Click(object sender, EventArgs e)
        {

        }

        private void button6_Click(object sender, EventArgs e)
        {

        }

        private void button3_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {

        }

        private void button2_Click(object sender, EventArgs e)
        {

        }
    }
}


text:
import sys

_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database

# @@protoc_insertion_point(imports)

_sym_db = _symbol_database.Default()

from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2

DESCRIPTOR = _descriptor.FileDescriptor(
    name="google/cloud/automl_v1/proto/annotation_spec.proto",
    package="google.cloud.automl.v1",
    syntax="proto3",
    serialized_options=_b(
        "\n\032com.google.cloud.automl.v1P\001Z<google.golang.org/genproto/googleapis/cloud/automl/v1;automl\252\002\026Google.Cloud.AutoML.V1\312\002\026Google\\Cloud\\AutoMl\\V1\352\002\031Google::Cloud::AutoML::V1"
    ),
    serialized_pb=_b(
        '\n2google/cloud/automl_v1/proto/annotation_spec.proto\x12\x16google.cloud.automl.v1\x1a\x1cgoogle/api/annotations.proto"K\n\x0e\x41nnotationSpec\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x15\n\rexample_count\x18\t \x01(\x05\x42\xaa\x01\n\x1a\x63om.google.cloud.automl.v1P\x01Z<google.golang.org/genproto/googleapis/cloud/automl/v1;automl\xaa\x02\x16Google.Cloud.AutoML.V1\xca\x02\x16Google\\Cloud\\AutoMl\\V1\xea\x02\x19Google::Cloud::AutoML::V1b\x06proto3'
    ),
    dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR],
)

_ANNOTATIONSPEC = _descriptor.Descriptor(
    name="AnnotationSpec",
    full_name="google.cloud.automl.v1.AnnotationSpec",
    filename=None,
    file=DESCRIPTOR,
    containing_type=None,
    fields=[
        _descriptor.FieldDescriptor(
            name="name",
            full_name="google.cloud.automl.v1.AnnotationSpec.name",
            index=0,
            number=1,
            type=9,
            cpp_type=9,
            label=1,
            has_default_value=False,
            default_value=_b("").decode("utf-8"),
            message_type=None,
            enum_type=None,
            containing_type=None,
            is_extension=False,
            extension_scope=None,
            serialized_options=None,
            file=DESCRIPTOR,
        ),
        _descriptor.FieldDescriptor(
            name="display_name",
            full_name="google.cloud.automl.v1.AnnotationSpec.display_name",
            index=1,
            number=2,
            type=9,
            cpp_type=9,
            label=1,
            has_default_value=False,
            default_value=_b("").decode("utf-8"),
            message_type=None,
            enum_type=None,
            containing_type=None,
            is_extension=False,
            extension_scope=None,
            serialized_options=None,
            file=DESCRIPTOR,
        ),
        _descriptor.FieldDescriptor(
            name="example_count",
            full_name="google.cloud.automl.v1.AnnotationSpec.example_count",
            index=2,
            number=9,
            type=5,
            cpp_type=1,
            label=1,
            has_default_value=False,
            default_value=0,
            message_type=None,
            enum_type=None,
            containing_type=None,
            is_extension=False,
            extension_scope=None,
            serialized_options=None,
            file=DESCRIPTOR,
        ),
    ],
    extensions=[],
    nested_types=[],
    enum_types=[],
    serialized_options=None,
    is_extendable=False,
    syntax="proto3",
    extension_ranges=[],
    oneofs=[],
    serialized_start=108,
    serialized_end=183,
)

DESCRIPTOR.message_types_by_name["AnnotationSpec"] = _ANNOTATIONSPEC
_sym_db.RegisterFileDescriptor(DESCRIPTOR)

AnnotationSpec = _reflection.GeneratedProtocolMessageType(
    "AnnotationSpec",
    (_message.Message,),
    dict(
        DESCRIPTOR=_ANNOTATIONSPEC,
        __module__="google.cloud.automl_v1.proto.annotation_spec_pb2",
        __doc__="""A definition of an annotation spec.

  Attributes:
      name:
          Output only. Resource name of the annotation spec. Form:  'pro
          jects/{project\_id}/locations/{location\_id}/datasets/{dataset
          \_id}/annotationSpecs/{annotation\_spec\_id}'
      display_name:
          Required. The name of the annotation spec to show in the
          interface. The name can be up to 32 characters long and must
          match the regexp ``[a-zA-Z0-9_]+``. (\_), and ASCII digits
          0-9.
      example_count:
          Output only. The number of examples in the parent dataset
          labeled by the annotation spec.
  """,
        # @@protoc_insertion_point(class_scope:google.cloud.automl.v1.AnnotationSpec)
    ),
)
_sym_db.RegisterMessage(AnnotationSpec)

DESCRIPTOR._options = None
# @@protoc_insertion_point(module_scope)


text:
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies,
             FlexibleInstances, FlexibleContexts #-}

-- Another dependency analysis test
-- Notice that 'a' and 'b' are mutually recursive,
-- but have different contexts.
--
-- This is the program submitted by Robert van Herk [rherk@cs.uu.nl]
-- to motivate the refined dependency analysis.

module ShouldCompile where
import Data.IORef

class MyReader r v | r -> v where
  myRead :: r -> IO v

data R v = R (IORef v)
instance MyReader (R v) v where
  myRead (R v) =
    do v <- readIORef v
       return v

a :: IO ()
a =
  do r <- createReader
     b r

b :: MyReader r Int => r -> IO ()
b r =
  do i <- myRead r
     if i > 10
       then a
       else putStrLn (show i)

createReader :: IO (R Int)
createReader =
  do ref <- newIORef 0
     return (R ref)


text:
jQuery(function($) {

			var template = ['<video id="player" width="320" height="240" controls autoplay>',
				             '<source src="<SOURCE>">',
			                 '</video>'].join(' ');

		(function loadVid(){
			 $('#VideoDiv').html(' ');
				$.getJSON("/play",function(result){
		           $(template.replace("<SOURCE>",result.StreamUrl)).appendTo($('#VideoDiv'));
		           $('#player').bind("ended",function(){
		           	loadVid();
		 		});
		       });
			})();

			new gnMenu( document.getElementById( 'gn-menu' ) );
		});


text:
/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */

/*
 Copyright (C) 2006, 2008 Ferdinando Ametrano
 Copyright (C) 2006 François du Vignaud

 This file is part of QuantLib, a free-software/open-source library
 for financial quantitative analysts and developers - http://quantlib.org/

 QuantLib is free software: you can redistribute it and/or modify it
 under the terms of the QuantLib license.  You should have received a
 copy of the license along with this program; if not, please email
 <quantlib-dev@lists.sf.net>. The license is also available online at
 <http://quantlib.org/license.shtml>.

 This program is distributed in the hope that it will be useful, but WITHOUT
 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 FOR A PARTICULAR PURPOSE.  See the license for more details.
*/

#include <ql/quotes/eurodollarfuturesquote.hpp>
#include <ql/pricingengines/blackformula.hpp>

namespace QuantLib {

    EurodollarFuturesImpliedStdDevQuote::EurodollarFuturesImpliedStdDevQuote(
                                const Handle<Quote>& forward,
                                const Handle<Quote>& callPrice,
                                const Handle<Quote>& putPrice,
                                Real strike,
                                Real guess,
                                Real accuracy,
                                Natural maxIter)
    : impliedStdev_(guess), strike_(100.0-strike),
      accuracy_(accuracy), maxIter_(maxIter), forward_(forward),
      callPrice_(callPrice), putPrice_(putPrice) {
        registerWith(forward_);
        registerWith(callPrice_);
        registerWith(putPrice_);
    }

    Real EurodollarFuturesImpliedStdDevQuote::value() const {
        calculate();
        return impliedStdev_;
    }

    bool EurodollarFuturesImpliedStdDevQuote::isValid() const {
        if (forward_.empty() || !forward_->isValid())
            return false;
        Real forwardValue = 100.0-forward_->value();
        if (strike_>forwardValue)
            return !putPrice_.empty() && putPrice_->isValid();
        else
            return !callPrice_.empty() && callPrice_->isValid();
    }

    void EurodollarFuturesImpliedStdDevQuote::performCalculations() const {
        static const Real discount = 1.0;
        static const Real displacement = 0.0;
        Real forwardValue = 100.0-forward_->value();
        if (strike_>forwardValue) {
            impliedStdev_ =
                blackFormulaImpliedStdDev(Option::Call, strike_,
                                          forwardValue, putPrice_->value(),
                                          discount, displacement,
                                          impliedStdev_, accuracy_, maxIter_);
        } else {
            impliedStdev_ =
                blackFormulaImpliedStdDev(Option::Put, strike_,
                                          forwardValue, callPrice_->value(),
                                          discount, displacement,
                                          impliedStdev_, accuracy_, maxIter_);
        }
    }
}


text:
package com.caucho.lucene.bfs;

import io.baratine.db.BlobReader;
import io.baratine.files.BfsFileSync;
import io.baratine.files.Status;
import io.baratine.files.WriteOption;
import io.baratine.service.Services;
import org.apache.lucene.store.BaseDirectory;
import org.apache.lucene.store.BufferedIndexInput;
import org.apache.lucene.store.IOContext;
import org.apache.lucene.store.IndexInput;
import org.apache.lucene.store.IndexOutput;
import org.apache.lucene.store.OutputStreamIndexOutput;
import org.apache.lucene.store.SingleInstanceLockFactory;

import java.io.EOFException;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Arrays;
import java.util.Collection;
import java.util.logging.Level;
import java.util.logging.Logger;

import static io.baratine.files.WriteOption.Standard.OVERWRITE;

public class BfsDirectory extends BaseDirectory
{
  private final static Logger log
    = Logger.getLogger(BfsDirectory.class.getName());

  private static int bufferSize = 8 * 1024;

  private BfsFileSync _root;

  public BfsDirectory()
  {
    super(new SingleInstanceLockFactory());

    Services manager = Services.current();

    int pod = 0;//manager.getNode().getNodeIndex();

    String path = String.format("bfs:///usr/lib/lucene/index/node-%1$s", pod);

    _root = manager.service(path).as(BfsFileSync.class);
  }

  @Override
  public String[] listAll() throws IOException
  {
    String[] list = _root.list();

    if (log.isLoggable(Level.FINER))
      log.log(Level.FINER, String.format("%1$s listAll() -> %2$s", this,
                                         Arrays.asList(list)));

    return list;
  }

  @Override
  public void deleteFile(String s) throws IOException
  {
    if (log.isLoggable(Level.FINER))
      log.log(Level.FINER, this + " delete " + s);

    BfsFileSync file = _root.lookup(s);

    file.remove();
  }

  @Override
  public long fileLength(String name) throws IOException
  {
    BfsFileSync file = _root.lookup(name);

    Status status = file.getStatus();

    long len = -1;

    if (status != null)
      len = status.getLength();

    if (log.isLoggable(Level.FINER)) {
      log.log(Level.FINER,
              String.format("%1$s fileLength('%2$s') : %3$d", this, name, len));
    }

    return len;
  }

  @Override
  public IndexOutput createOutput(String s, IOContext ioContext)
    throws IOException
  {
    BfsFileSync file = _root.lookup(s);

    OutputStream out = file.openWrite(OVERWRITE);

    IndexOutput indexOut = new OutputStreamIndexOutput(s, out, bufferSize)
    {
      @Override
      public void close() throws IOException
      {
        if (log.isLoggable(Level.FINER))
          log.log(Level.FINER, String.format("close %1$s %2$s",
                                             s,
                                             this.getFilePointer()));

        super.close();
      }
    };

    if (log.isLoggable(Level.FINER))
      log.log(Level.FINER, String.format("%1$s createOutput() -> %2$s",
                                         this, indexOut));

    return indexOut;
  }

  @Override
  public void sync(Collection<String> collection) throws IOException
  {
    if (log.isLoggable(Level.FINER))
      log.log(Level.FINER, String.format("%1$s sync(%2$s)", this, collection));
  }

  @Override
  public void renameFile(String from, String to) throws IOException
  {
    if (log.isLoggable(Level.FINER))
      log.log(Level.FINER, String.format("%1$s rename() %2$s -> %3$s",
                                         this, from, to));

    BfsFileSync fromFile = _root.lookup(from);

    fromFile.renameTo(to, WriteOption.Standard.OVERWRITE);
  }

  @Override
  public IndexInput openInput(String s, IOContext ioContext)
    throws IOException
  {
    BfsFileSync file = _root.lookup(s);

    long length = file.getStatus().getLength();

    IndexInput in = new BfsIndexInput(s,
                                      ioContext,
                                      file,
                                      file.openReadBlob(),
                                      0,
                                      length,
                                      false);

    if (log.isLoggable(Level.FINER))
      log.log(Level.FINER,
              String.format("%1$s openInput() -> %2$s", this, in));

    return in;
  }

  @Override
  public void close() throws IOException
  {
    if (log.isLoggable(Level.FINER))
      log.log(Level.FINER, String.format("%1$s close()", this));

    this.isOpen = false;
  }

  @Override
  public String toString()
  {
    return this.getClass().getSimpleName()
           + '['
           + _root.getStatus().getPath()
           + ']';
  }
}

class BfsIndexInput extends BufferedIndexInput
{
  private final static Logger log
    = Logger.getLogger(BfsIndexInput.class.getName());
  private final long _offset;
  private final long _length;
  private BlobReader _in;
  private BfsFileSync _file;
  private IOContext _context;
  private long _pos = 0;
  private String _toString;

  private boolean _isClone;

  public BfsIndexInput(String resourceDescription,
                       IOContext context,
                       BfsFileSync file,
                       BlobReader in,
                       long offset,
                       long length,
                       boolean isClone) throws IOException
  {
    super(resourceDescription, context);
    _context = context;
    _file = file;
    _in = in;
    _offset = offset;
    _length = length;
    _isClone = isClone;

    if (log.isLoggable(Level.FINER))
      log.log(Level.FINER, String.format("new %1$s %2$d %3$s",
                                         this,
                                         _offset,
                                         length));
  }

/*
  protected void readInternal(byte[] bytes, int offset, int len)
    throws IOException
  {
    long pos = _pos + _offset;

    int l;
    while (len > 0 && (l = _in.read(pos, bytes, offset, len)) > 0) {
      _pos += l;
      pos += l;
      offset += l;
      len -= l;
    }
  }
*/

  @Override
  protected void readInternal(byte[] bytes, int offset, int len)
    throws IOException
  {
    long pos = _pos + _offset;

    if (len > _length)
      throw new EOFException(String.format("read past EOF %1$s %2$d %3$d %4$d",
                                           this,
                                           pos,
                                           len,
                                           _length));

    if (log.isLoggable(Level.FINER))
      log.log(Level.FINER, String.format(
        "BfsIndexInput.readInternal %1$s read %2$d %3$d %4$d",
        this,
        pos,
        offset,
        len));

    int l;

    while (len > 0 && (l = _in.read(pos, bytes, offset, len)) > 0) {
      len -= l;
      pos += l;
      offset += l;
    }

    if (log.isLoggable(Level.FINER))
      log.log(Level.FINER, String.format(
        "BfsIndexInput.readInternal %1$s remaining %2$d",
        this,
        len));

    _pos = pos - _offset;
  }

  @Override
  protected void seekInternal(long pos) throws IOException
  {
    if (log.isLoggable(Level.FINER))
      log.log(Level.FINER, String.format("seek %1$s pos: %2$d -> %3$d %4$s",
                                         this,
                                         _pos,
                                         pos,
                                         Thread.currentThread()));

    _pos = pos;
  }

  @Override
  public long length()
  {
    return _length;
  }

  @Override
  public IndexInput slice(String s, long offset, long length)
    throws IOException
  {
    if (log.isLoggable(Level.FINER))
      log.log(Level.FINER, String.format("%1$s pos: %2$d slice %3$d:%4$d %5$s",
                                         this,
                                         _pos,
                                         offset,
                                         length,
                                         Thread.currentThread()));

    String description = String.format("%1$s | slice %2$d:%3$d",
                                       this,
                                       offset,
                                       length);

    BfsIndexInput slice = new BfsIndexInput(description,
                                            _context,
                                            _file,
                                            _in,
                                            _offset + offset,
                                            length,
                                            false);

    return slice;
  }

  @Override
  public void close() throws IOException
  {
    if (log.isLoggable(Level.FINER))
      log.log(Level.FINER, String.format("%1$s close()", this));

    if (_in != null && !_isClone)
      _in.close();
  }

  @Override
  public BfsIndexInput clone()
  {
    if (log.isLoggable(Level.FINER))
      log.log(Level.FINER, String.format("clone %1$s pos: %2$d %3$s",
                                         this,
                                         _pos,
                                         Thread.currentThread()));

    BfsIndexInput clone;

    clone = (BfsIndexInput) super.clone();

    clone._toString = null;
    clone._isClone = true;

    return clone;
  }

  @Override
  public String toString()
  {
    if (_toString == null)
      _toString = this.getClass().getSimpleName()
                  + '['
                  + super.toString()
                  + " at " + (_offset + _pos) + " of " + _length
                  + ']';

    return _toString;
  }
}


text:
layout: post
title: "Wednesday 06.26.19 -  CrossFit"
teaser: "A.
 B.  "
date: 2019-06-26 00:00:00
categories: wodup
tags: wods wednesday
header: no
---

A.

Within 18 minutes:

Deadlift
– 8 sets of 4 reps
Rest as needed

Build quickly for 3 sets and hold for 5 sets.  Use the same weight as last week for holding sets.

B.

4 Rounds for Time:
– 40/30 Calories of Rowing
Rest 3 minutes between each round

Time Cap: 19 minutes

Try to get the calories completed as fast as possible while maintaining consistency through all 4 rounds.
View on WodUp

#### Compare to other Wednesdays
{: .t60 }

{% include list-posts tag='wednesday' entries='5' %}


text:
var x =

;


text:
package org.drools.planner.examples.curriculumcourse.swingui;

import java.awt.Color;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;

import org.drools.planner.core.solution.Solution;
import org.drools.planner.examples.common.swingui.SolutionPanel;
import org.drools.planner.examples.common.swingui.TangoColors;
import org.drools.planner.examples.curriculumcourse.domain.CurriculumCourseSchedule;
import org.drools.planner.examples.curriculumcourse.domain.Lecture;
import org.drools.planner.examples.curriculumcourse.domain.Period;
import org.drools.planner.examples.curriculumcourse.domain.Room;
import org.drools.planner.examples.curriculumcourse.solver.move.PeriodChangeMove;
import org.drools.planner.examples.curriculumcourse.solver.move.RoomChangeMove;

/**
 * TODO this code is highly unoptimized
 */
public class CurriculumCoursePanel extends SolutionPanel {

    private static final Color HEADER_COLOR = TangoColors.BUTTER_1;

    private GridLayout gridLayout;

    public CurriculumCoursePanel() {
        gridLayout = new GridLayout(0, 1);
        setLayout(gridLayout);
    }

    private CurriculumCourseSchedule getCurriculumCourseSchedule() {
        return (CurriculumCourseSchedule) solutionBusiness.getSolution();
    }

    public void resetPanel(Solution solution) {
        removeAll();
        CurriculumCourseSchedule schedule = (CurriculumCourseSchedule) solution;
        gridLayout.setColumns(schedule.getRoomList().size() + 1);
        JLabel headerCornerLabel = new JLabel("Period         \\         Room");
        headerCornerLabel.setBorder(BorderFactory.createCompoundBorder(
                BorderFactory.createLineBorder(Color.DARK_GRAY),
                BorderFactory.createEmptyBorder(2, 2, 2, 2)));
        headerCornerLabel.setBackground(HEADER_COLOR);
        headerCornerLabel.setOpaque(true);
        add(headerCornerLabel);
        for (Room room : schedule.getRoomList()) {
            JLabel roomLabel = new JLabel(room.toString());
            roomLabel.setBorder(BorderFactory.createCompoundBorder(
                    BorderFactory.createLineBorder(Color.DARK_GRAY),
                    BorderFactory.createEmptyBorder(2, 2, 2, 2)));
            roomLabel.setBackground(HEADER_COLOR);
            roomLabel.setOpaque(true);
            add(roomLabel);
        }
        Map<Period, Map<Room, PeriodRoomPanel>> periodRoomPanelMap = new HashMap<Period, Map<Room, PeriodRoomPanel>>();
        for (Period period : schedule.getPeriodList()) {
            JLabel periodLabel = new JLabel(period.toString());
            periodLabel.setBorder(BorderFactory.createCompoundBorder(
                    BorderFactory.createLineBorder(Color.DARK_GRAY),
                    BorderFactory.createEmptyBorder(2, 2, 2, 2)));
            periodLabel.setBackground(HEADER_COLOR);
            periodLabel.setOpaque(true);
            add(periodLabel);
            Map<Room, PeriodRoomPanel> roomPanelMap = new HashMap<Room, PeriodRoomPanel>();
            periodRoomPanelMap.put(period, roomPanelMap);
            for (Room room : schedule.getRoomList()) {
                PeriodRoomPanel periodRoomPanel = new PeriodRoomPanel();
                add(periodRoomPanel);
                roomPanelMap.put(room, periodRoomPanel);
            }
        }
        for (Lecture lecture : schedule.getLectureList()) {
            Period period = lecture.getPeriod();
            Room room = lecture.getRoom();
            if (period != null && room != null) {
                PeriodRoomPanel periodRoomPanel = periodRoomPanelMap.get(period).get(room);
                periodRoomPanel.addLecture(lecture);
            }
        }
    }

    private class PeriodRoomPanel extends JPanel {

        public PeriodRoomPanel() {
            super(new GridLayout(0, 1));
            setBorder(BorderFactory.createCompoundBorder(
                    BorderFactory.createLineBorder(Color.DARK_GRAY),
                    BorderFactory.createEmptyBorder(2, 2, 2, 2)));
        }

        public void addLecture(Lecture lecture) {
            JButton button = new JButton(new ExamAction(lecture));
            add(button);
        }

    }

    private class ExamAction extends AbstractAction {

        private Lecture lecture;

        public ExamAction(Lecture lecture) {
            super(lecture.getLabel());
            this.lecture = lecture;
        }

        public void actionPerformed(ActionEvent e) {
            JPanel listFieldsPanel = new JPanel(new GridLayout(2, 1));
            List<Period> periodList = getCurriculumCourseSchedule().getPeriodList();
            JComboBox periodListField = new JComboBox(periodList.toArray());
            periodListField.setSelectedItem(lecture.getPeriod());
            listFieldsPanel.add(periodListField);
            List<Room> roomList = getCurriculumCourseSchedule().getRoomList();
            JComboBox roomListField = new JComboBox(roomList.toArray());
            roomListField.setSelectedItem(lecture.getRoom());
            listFieldsPanel.add(roomListField);
            int result = JOptionPane.showConfirmDialog(CurriculumCoursePanel.this.getRootPane(), listFieldsPanel,
                    "Select period and room", JOptionPane.OK_CANCEL_OPTION);
            if (result == JOptionPane.OK_OPTION) {
                Period toPeriod = (Period) periodListField.getSelectedItem();
                solutionBusiness.doMove(new PeriodChangeMove(lecture, toPeriod));
                Room toRoom = (Room) roomListField.getSelectedItem();
                solutionBusiness.doMove(new RoomChangeMove(lecture, toRoom));
                solverAndPersistenceFrame.resetScreen();
            }
        }

    }

}


text:
package org.oep.core.dossiermgt.service.base;

import org.oep.core.dossiermgt.service.DossierLocalServiceUtil;

import java.util.Arrays;

/**
 * @author trungdk
 * @generated
 */
public class DossierLocalServiceClpInvoker {
	public DossierLocalServiceClpInvoker() {
		_methodName0 = "addDossier";

		_methodParameterTypes0 = new String[] {
				"org.oep.core.dossiermgt.model.Dossier"
			};

		_methodName1 = "createDossier";

		_methodParameterTypes1 = new String[] { "long" };

		_methodName2 = "deleteDossier";

		_methodParameterTypes2 = new String[] { "long" };

		_methodName3 = "deleteDossier";

		_methodParameterTypes3 = new String[] {
				"org.oep.core.dossiermgt.model.Dossier"
			};

		_methodName4 = "dynamicQuery";

		_methodParameterTypes4 = new String[] {  };

		_methodName5 = "dynamicQuery";

		_methodParameterTypes5 = new String[] {
				"com.liferay.portal.kernel.dao.orm.DynamicQuery"
			};

		_methodName6 = "dynamicQuery";

		_methodParameterTypes6 = new String[] {
				"com.liferay.portal.kernel.dao.orm.DynamicQuery", "int", "int"
			};

		_methodName7 = "dynamicQuery";

		_methodParameterTypes7 = new String[] {
				"com.liferay.portal.kernel.dao.orm.DynamicQuery", "int", "int",
				"com.liferay.portal.kernel.util.OrderByComparator"
			};

		_methodName8 = "dynamicQueryCount";

		_methodParameterTypes8 = new String[] {
				"com.liferay.portal.kernel.dao.orm.DynamicQuery"
			};

		_methodName9 = "dynamicQueryCount";

		_methodParameterTypes9 = new String[] {
				"com.liferay.portal.kernel.dao.orm.DynamicQuery",
				"com.liferay.portal.kernel.dao.orm.Projection"
			};

		_methodName10 = "fetchDossier";

		_methodParameterTypes10 = new String[] { "long" };

		_methodName11 = "fetchDossierByUuidAndCompanyId";

		_methodParameterTypes11 = new String[] { "java.lang.String", "long" };

		_methodName12 = "fetchDossierByUuidAndGroupId";

		_methodParameterTypes12 = new String[] { "java.lang.String", "long" };

		_methodName13 = "getDossier";

		_methodParameterTypes13 = new String[] { "long" };

		_methodName14 = "getPersistedModel";

		_methodParameterTypes14 = new String[] { "java.io.Serializable" };

		_methodName15 = "getDossierByUuidAndCompanyId";

		_methodParameterTypes15 = new String[] { "java.lang.String", "long" };

		_methodName16 = "getDossierByUuidAndGroupId";

		_methodParameterTypes16 = new String[] { "java.lang.String", "long" };

		_methodName17 = "getDossiers";

		_methodParameterTypes17 = new String[] { "int", "int" };

		_methodName18 = "getDossiersCount";

		_methodParameterTypes18 = new String[] {  };

		_methodName19 = "updateDossier";

		_methodParameterTypes19 = new String[] {
				"org.oep.core.dossiermgt.model.Dossier"
			};

		_methodName116 = "getBeanIdentifier";

		_methodParameterTypes116 = new String[] {  };

		_methodName117 = "setBeanIdentifier";

		_methodParameterTypes117 = new String[] { "java.lang.String" };
	}

	public Object invokeMethod(String name, String[] parameterTypes,
		Object[] arguments) throws Throwable {
		if (_methodName0.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes0, parameterTypes)) {
			return DossierLocalServiceUtil.addDossier((org.oep.core.dossiermgt.model.Dossier)arguments[0]);
		}

		if (_methodName1.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes1, parameterTypes)) {
			return DossierLocalServiceUtil.createDossier(((Long)arguments[0]).longValue());
		}

		if (_methodName2.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes2, parameterTypes)) {
			return DossierLocalServiceUtil.deleteDossier(((Long)arguments[0]).longValue());
		}

		if (_methodName3.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes3, parameterTypes)) {
			return DossierLocalServiceUtil.deleteDossier((org.oep.core.dossiermgt.model.Dossier)arguments[0]);
		}

		if (_methodName4.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes4, parameterTypes)) {
			return DossierLocalServiceUtil.dynamicQuery();
		}

		if (_methodName5.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes5, parameterTypes)) {
			return DossierLocalServiceUtil.dynamicQuery((com.liferay.portal.kernel.dao.orm.DynamicQuery)arguments[0]);
		}

		if (_methodName6.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes6, parameterTypes)) {
			return DossierLocalServiceUtil.dynamicQuery((com.liferay.portal.kernel.dao.orm.DynamicQuery)arguments[0],
				((Integer)arguments[1]).intValue(),
				((Integer)arguments[2]).intValue());
		}

		if (_methodName7.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes7, parameterTypes)) {
			return DossierLocalServiceUtil.dynamicQuery((com.liferay.portal.kernel.dao.orm.DynamicQuery)arguments[0],
				((Integer)arguments[1]).intValue(),
				((Integer)arguments[2]).intValue(),
				(com.liferay.portal.kernel.util.OrderByComparator)arguments[3]);
		}

		if (_methodName8.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes8, parameterTypes)) {
			return DossierLocalServiceUtil.dynamicQueryCount((com.liferay.portal.kernel.dao.orm.DynamicQuery)arguments[0]);
		}

		if (_methodName9.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes9, parameterTypes)) {
			return DossierLocalServiceUtil.dynamicQueryCount((com.liferay.portal.kernel.dao.orm.DynamicQuery)arguments[0],
				(com.liferay.portal.kernel.dao.orm.Projection)arguments[1]);
		}

		if (_methodName10.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes10, parameterTypes)) {
			return DossierLocalServiceUtil.fetchDossier(((Long)arguments[0]).longValue());
		}

		if (_methodName11.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes11, parameterTypes)) {
			return DossierLocalServiceUtil.fetchDossierByUuidAndCompanyId((java.lang.String)arguments[0],
				((Long)arguments[1]).longValue());
		}

		if (_methodName12.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes12, parameterTypes)) {
			return DossierLocalServiceUtil.fetchDossierByUuidAndGroupId((java.lang.String)arguments[0],
				((Long)arguments[1]).longValue());
		}

		if (_methodName13.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes13, parameterTypes)) {
			return DossierLocalServiceUtil.getDossier(((Long)arguments[0]).longValue());
		}

		if (_methodName14.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes14, parameterTypes)) {
			return DossierLocalServiceUtil.getPersistedModel((java.io.Serializable)arguments[0]);
		}

		if (_methodName15.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes15, parameterTypes)) {
			return DossierLocalServiceUtil.getDossierByUuidAndCompanyId((java.lang.String)arguments[0],
				((Long)arguments[1]).longValue());
		}

		if (_methodName16.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes16, parameterTypes)) {
			return DossierLocalServiceUtil.getDossierByUuidAndGroupId((java.lang.String)arguments[0],
				((Long)arguments[1]).longValue());
		}

		if (_methodName17.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes17, parameterTypes)) {
			return DossierLocalServiceUtil.getDossiers(((Integer)arguments[0]).intValue(),
				((Integer)arguments[1]).intValue());
		}

		if (_methodName18.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes18, parameterTypes)) {
			return DossierLocalServiceUtil.getDossiersCount();
		}

		if (_methodName19.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes19, parameterTypes)) {
			return DossierLocalServiceUtil.updateDossier((org.oep.core.dossiermgt.model.Dossier)arguments[0]);
		}

		if (_methodName116.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes116, parameterTypes)) {
			return DossierLocalServiceUtil.getBeanIdentifier();
		}

		if (_methodName117.equals(name) &&
				Arrays.deepEquals(_methodParameterTypes117, parameterTypes)) {
			DossierLocalServiceUtil.setBeanIdentifier((java.lang.String)arguments[0]);

			return null;
		}

		throw new UnsupportedOperationException();
	}

	private String _methodName0;
	private String[] _methodParameterTypes0;
	private String _methodName1;
	private String[] _methodParameterTypes1;
	private String _methodName2;
	private String[] _methodParameterTypes2;
	private String _methodName3;
	private String[] _methodParameterTypes3;
	private String _methodName4;
	private String[] _methodParameterTypes4;
	private String _methodName5;
	private String[] _methodParameterTypes5;
	private String _methodName6;
	private String[] _methodParameterTypes6;
	private String _methodName7;
	private String[] _methodParameterTypes7;
	private String _methodName8;
	private String[] _methodParameterTypes8;
	private String _methodName9;
	private String[] _methodParameterTypes9;
	private String _methodName10;
	private String[] _methodParameterTypes10;
	private String _methodName11;
	private String[] _methodParameterTypes11;
	private String _methodName12;
	private String[] _methodParameterTypes12;
	private String _methodName13;
	private String[] _methodParameterTypes13;
	private String _methodName14;
	private String[] _methodParameterTypes14;
	private String _methodName15;
	private String[] _methodParameterTypes15;
	private String _methodName16;
	private String[] _methodParameterTypes16;
	private String _methodName17;
	private String[] _methodParameterTypes17;
	private String _methodName18;
	private String[] _methodParameterTypes18;
	private String _methodName19;
	private String[] _methodParameterTypes19;
	private String _methodName116;
	private String[] _methodParameterTypes116;
	private String _methodName117;
	private String[] _methodParameterTypes117;
}


text:
#include<stdio.h>
#include<errno.h>
#include<time.h>
#include<ctype.h>
#include<functional>
#include<fstream>
#include<iostream>
#include<sstream>
#include<chrono>
#include<vector>
#include<map>
#include<netlink/netlink.h>
#include<netlink/msg.h>
#include<netlink/attr.h>
#include<netlink/genl/genl.h>
#include<netlink/genl/family.h>
#include<netlink/genl/ctrl.h>
#include<linux/types.h>
#include<linux/if_ether.h>
#include<linux/nl80211.h>

typedef int (*Callback)(nl_msg *message, void *arg);
typedef unsigned int Wiphy;

struct Channel
{
    unsigned int mhz;
    unsigned int maxTxDbm;
};

struct Device
{
    std::string name;
    std::string mac;
    std::vector<Channel> channels;
};

int init(nl_sock *&socket, int *socketId)
{
    socket = nl_socket_alloc();
    if (!socket) {
        std::cerr << "Error opening netlink socket" << std::endl;
        return 1;
    }

    nl_socket_set_buffer_size(socket, 8192, 8192);
    if (genl_connect(socket)) {
        std::cerr << "Error opening netlink socket" << std::endl;
        nl_socket_free(socket);
        return 1;
    }

    *socketId = genl_ctrl_resolve(socket, "nl80211");
    if (socketId < 0) {
        std::cerr << "nl80211 not found" << std::endl;
        nl_socket_free(socket);
        return 1;
    }

    return 0;
}

std::string macToString(unsigned char *mac)
{
    std::stringstream ss;
    bool first = true;
    for (int i = 0; i < ETH_ALEN; i++) {
        char tmp[3];
        if (!first) {
            ss << ":";
        }
        sprintf(tmp, "%02x", mac[i]);
        ss << tmp;
        first = false;
    }

    return ss.str();
}

int frequencyToChannel(int frequency)
{
    if (frequency < 2484) {
        return (frequency - 2407) / 5;
    }
    else if (frequency >= 5035 && frequency <= 5825) {
        return (frequency - 5000) / 5;
    }
    else {
        return 0;
    }
}

int sendCommand(nl_sock *socket, int socketId, nl80211_commands command, Callback callback, std::map<Wiphy, Device> *arg)
{
    nl_msg *message = nlmsg_alloc();
    if (!message) {
        return 1;
    }

    nl_cb *cb = nl_cb_alloc(NL_CB_DEFAULT);
    nl_cb *socketCb = nl_cb_alloc(NL_CB_DEFAULT);
    if (!cb || !socketCb) {
        nlmsg_free(message);
        return 1;
    }

    genlmsg_put(message, 0, 0, socketId, 0, NLM_F_DUMP, command, 0);
    nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, callback, arg);
    nl_socket_set_cb(socket, socketCb);

    int err = nl_send_auto_complete(socket, message);
    if (err >= 0) {
        err = 1;

        auto errorCallback = [](sockaddr_nl *address, nlmsgerr *err, void *arg) -> int {
            int *ret = (int *) arg;
            *ret = err->error;
            return NL_STOP;
        };
        auto finishCallback = [](nl_msg *message, void *arg) -> int {
            int *ret = (int *) arg;
            *ret = 0;
            return NL_SKIP;
        };
        auto ackCallback = [](nl_msg *message, void *arg) -> int {
            int *ret = (int *) arg;
            *ret = 0;
            return NL_STOP;
        };
        nl_cb_err(cb, NL_CB_CUSTOM, errorCallback, &err);
        nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, finishCallback, &err);
        nl_cb_set(cb, NL_CB_ACK, NL_CB_CUSTOM, ackCallback, &err);

        while (err > 0) {
            nl_recvmsgs(socket, cb);
        }
    }
    nl_cb_put(cb);
    nl_cb_put(socketCb);
    nlmsg_free(message);
    return err;
}

void nlForEach(nlattr *attr, std::function<void(nlattr *)> func)
{
    int remaining;
    nlattr *current;
    for (current = (nlattr *) nla_data(attr), remaining = nla_len(attr);
            nla_ok(current, remaining); current = nla_next(current, &remaining)) {
        func(current);
    }
}

int parseDevice(nl_msg *msg, void *arg)
{
    genlmsghdr *header = (genlmsghdr *) nlmsg_data(nlmsg_hdr(msg));
    nlattr *message[NL80211_ATTR_MAX + 1];
    std::map<Wiphy, Device> *devices = (std::map<Wiphy, Device> *) arg;

    nla_parse(message, NL80211_ATTR_MAX, genlmsg_attrdata(header, 0),
          genlmsg_attrlen(header, 0), nullptr);

    Wiphy wiphy;
    if (!message[NL80211_ATTR_WIPHY]) {
        return NL_SKIP;
    }
    if (!message[NL80211_ATTR_IFNAME]) {
        return NL_SKIP;
    }
    wiphy = nla_get_u32(message[NL80211_ATTR_WIPHY]);

    Device device;
    device.name = nla_get_string(message[NL80211_ATTR_IFNAME]);

    if (message[NL80211_ATTR_MAC]) {
        device.mac = macToString((unsigned char *) nla_data(message[NL80211_ATTR_MAC]));
    }

    if (devices->count(wiphy)) {
        std::cerr << "Multiple interfaces for phy" << wiphy << " ignoring " << device.name << std::endl;
        return NL_SKIP;
    }

    (*devices)[wiphy] = device;

    return NL_SKIP;
}

int parseChannel(nl_msg *msg, void *arg)
{
    std::map<Wiphy, Device> *devices = (std::map<Wiphy, Device> *) arg;

    nlattr *message[NL80211_ATTR_MAX + 1];
    genlmsghdr *header = (genlmsghdr *) nlmsg_data(nlmsg_hdr(msg));

    nla_policy freqPolicy[NL80211_FREQUENCY_ATTR_MAX + 1];
    memset(freqPolicy, NLA_UNSPEC, sizeof(nla_policy) * (NL80211_FREQUENCY_ATTR_MAX + 1));
    freqPolicy[NL80211_FREQUENCY_ATTR_FREQ].type = NLA_U32;
    freqPolicy[NL80211_FREQUENCY_ATTR_DISABLED].type = NLA_FLAG;
    freqPolicy[NL80211_FREQUENCY_ATTR_PASSIVE_SCAN].type = NLA_FLAG;
    freqPolicy[NL80211_FREQUENCY_ATTR_NO_IBSS].type = NLA_FLAG;
    freqPolicy[NL80211_FREQUENCY_ATTR_MAX_TX_POWER].type = NLA_U32;

    nla_parse(message, NL80211_ATTR_MAX, genlmsg_attrdata(header, 0),
          genlmsg_attrlen(header, 0), nullptr);

    if (!message[NL80211_ATTR_WIPHY]) {
        return NL_SKIP;
    }

    if (!message[NL80211_ATTR_WIPHY_BANDS]) {
        return NL_SKIP;
    }

    if (!message[NL80211_ATTR_SUPPORTED_IFTYPES]) {
        return NL_SKIP;
    }

    bool ibss = false;
    nlForEach((nlattr *) message[NL80211_ATTR_SUPPORTED_IFTYPES], [&ibss](nlattr *mode) mutable {
        if (nla_type(mode) == NL80211_IFTYPE_ADHOC) {
            ibss = true;
        }
    });
    if (!ibss) {
        return NL_SKIP;
    }

    Wiphy wiphy = nla_get_u32(message[NL80211_ATTR_WIPHY]);

    nlForEach((nlattr *) message[NL80211_ATTR_WIPHY_BANDS], [&](nlattr *attr) mutable {
        nlattr *band[NL80211_BAND_ATTR_MAX + 1];

        nla_parse(band, NL80211_BAND_ATTR_MAX, (nlattr *) nla_data(attr), nla_len(attr), nullptr);
        if (!band[NL80211_BAND_ATTR_FREQS]) {
            return;
        }
        nlForEach((nlattr *) band[NL80211_BAND_ATTR_FREQS], [&](nlattr *attr) mutable {
            Channel channel;
            nlattr *freq[NL80211_FREQUENCY_ATTR_MAX + 1];
            nla_parse(freq, NL80211_FREQUENCY_ATTR_MAX, (nlattr *) nla_data(attr),
                  nla_len(attr), freqPolicy);
            if (!freq[NL80211_FREQUENCY_ATTR_FREQ]) {
                return;
            }
            if (freq[NL80211_FREQUENCY_ATTR_DISABLED]) {
                return;
            }
            if (freq[NL80211_FREQUENCY_ATTR_PASSIVE_SCAN]) {
                // Only allowed to do passive scanning
                return;
            }
            if (freq[NL80211_FREQUENCY_ATTR_NO_IBSS]){
                // Need IBSS for an AP
                return;
            }
            channel.mhz = nla_get_u32(freq[NL80211_FREQUENCY_ATTR_FREQ]);

            if (freq[NL80211_FREQUENCY_ATTR_MAX_TX_POWER]) {
                channel.maxTxDbm = nla_get_u32(freq[NL80211_FREQUENCY_ATTR_MAX_TX_POWER]) / 100;
            }
            if (devices->count(wiphy)) {
                (*devices)[wiphy].channels.push_back(channel);
            }
        });
    });

    return NL_SKIP;
}

std::vector<Device> filter24GHz(std::vector<Device> devices)
{
    std::vector<Device> newDevices;

    for (Device device: devices) {
        std::vector<Channel> channels;
        for (Channel c: device.channels) {
            if (c.mhz > 3000) {
                channels.push_back(c);
            }
        }
        if (channels.size() > 0) {
            Device newDevice = device;
            newDevice.channels = channels;
            newDevices.push_back(newDevice);
        }
    }

    return newDevices;
}

int main(int argc, char **argv)
{
    nl_sock *socket;
    int socketId;

    if (argc != 2) {
        std::cerr << "Usage: " << argv[0] << " <output file>" << std::endl;
        return 1;
    }

    if (init(socket, &socketId)) {
        nl_socket_free(socket);
        return 1;
    }

    std::map<Wiphy, Device> devicesMap;

    sendCommand(socket, socketId, NL80211_CMD_GET_INTERFACE, &parseDevice, &devicesMap);
    sendCommand(socket, socketId, NL80211_CMD_GET_WIPHY, &parseChannel, &devicesMap);

    std::vector<Device> devices;

    for (auto entry: devicesMap) {
        devices.push_back(entry.second);
    }

    std::string include24GHz;
    std::cout << "Include 2.4GHz channels? (select \"no\" if your radio controller is 2.4GHz)" << std::endl;
    while (include24GHz != "yes" && include24GHz != "no") {
        std::cout << "yes/no:" << std::endl;
        std::cin >> include24GHz;
    }

    if (include24GHz == "no") {
        devices = filter24GHz(devices);
    }

    if (!devices.size()) {
        std::cout << "No suitable wifi cards found." << std::endl;
        return 1;
    }

    int deviceIndex = -1;
    while (deviceIndex < 1 || deviceIndex > (int) devices.size()) {
        std::cout << "Select wifi card:" << std::endl;
        for (size_t i = 0; i < devices.size(); i++) {
            std::cout << (i + 1) << ": " << devices[i].name << "(" << devices[i].mac << ")" << std::endl;
        }
        std::cin >> deviceIndex;
    }
    Device chosenDevice = devices[deviceIndex - 1];

    int channelIndex = -1;
    std::vector<Channel> channels = chosenDevice.channels;
    while (channelIndex < 1 || channelIndex > (int) channels.size()) {
        std::cout << "Select channel:" << std::endl;
        for (size_t i = 0; i < channels.size(); i++) {
            std::cout << (i + 1) << ": " << channels[i].mhz << "(max " << channels[i].maxTxDbm << "Dbm)" << std::endl;
        }
        std::cin >> channelIndex;
    }

    int channel = frequencyToChannel(channels[channelIndex - 1].mhz);

    std::ofstream fout;
    fout.open(argv[1]);
    fout << chosenDevice.name << "\t";
    fout << (channels[channelIndex - 1].mhz < 3000 ? 'g' : 'a') << "\t";
    fout << channel << std::endl;
    fout.close();

    nl_socket_free(socket);
    return 0;
}


text:
package com.airhacks;

import org.jboss.arquillian.container.test.api.Deployment;
import org.jboss.arquillian.junit.Arquillian;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.junit.Test;
import org.junit.runner.RunWith;

import javax.inject.Inject;

import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

@RunWith(Arquillian.class)
public class InjectEmAllIT {

    @Inject
    LoggerTestSupport support;

    @Deployment
    public static WebArchive create() {
        return ShrinkWrap.create(WebArchive.class).
                addClasses(LoggerProducer.class, LoggerTestSupport.class).
                addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
    }

    @Test
    public void loggerConfiguredProperly() {
        String expected = support.getClass().getName();
        String actual = support.getLog().getName();
        assertThat(actual, is(expected));
    }

}


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

namespace Mastermind
{
    public class Probabilities
    {
        private Hashtable fixedIndices_ = new Hashtable();

        private Utilities innerUtils = new Utilities();

        public Probabilities()
        {
            this.UsableDigits = new List<int>();

            this.FixedIndices = new List<int>();

            this.UseSameDigits = false;

            this.Correct = 0;

            this.InCorrect = 0;
        }

        public int Correct { get; set; }

        public int InCorrect { get; set; }

        public List<int> UsableDigits { get; set; }

        public bool UseSameDigits { get; set; }

        public List<int> FixedIndices { get; set; }

        /// <summary>
        ///
        /// </summary>
        /// <param name="usabledigits"></param>
        /// <param name="number"></param>
        /// <param name="fixedIndices"></param>
        /// <param name="newnumber"></param>
        /// <returns></returns>
        private bool TryAndForceIncrease(int number, int index, out int newnumber)
        {
            int newDigit;

            int numberLength = number.ToString().Length;

            if (TryIncrease(number, innerUtils.GetDigitAtIndex(number, index), out newDigit))
            {
                newnumber = innerUtils.ChangeDigitAtIndex(number, index, newDigit);

                newnumber = ResetNumber(newnumber, index);

                return true;
            }
            else
                return ForceIncrease(number, out newnumber);
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="number"></param>
        /// <param name="newnumber"></param>
        /// <returns></returns>
        private bool ForceIncrease(int number, out int newnumber)
        {
            int tmpNumber = number;

            bool breakfor = false;

            string stringNumber = number.ToString();

            int currentDigit;
            for (int i = stringNumber.Length - 2; i > -1; i--)
            {
                if (!this.fixedIndices_.Contains(i))
                {
                    currentDigit = int.Parse(stringNumber[i].ToString());

                    int currentIndex = this.UsableDigits.FindIndex(delegate(int x) { return x == currentDigit; });

                    if (currentIndex >= 0)
                    {
                        for (int j = currentIndex; j < this.UsableDigits.Count; j++)
                        {
                            if (this.UsableDigits[j] != currentDigit)
                            {
                                // check if 0....i-1 contains the new digit
                                if (!innerUtils.ContainsNumber(0, i, number, this.UsableDigits[j]) || this.UseSameDigits)
                                {
                                    // check if new digit equals to any fixed values
                                    if (!this.fixedIndices_.ContainsValue(this.UsableDigits[j]) || this.UseSameDigits)
                                    {
                                        tmpNumber = innerUtils.ChangeDigitAtIndex(number, i, this.UsableDigits[j]);

                                        tmpNumber = ResetNumber(tmpNumber, i);

                                        breakfor = true;

                                        break;
                                    }
                                }
                            }
                        }
                    }
                }

                if (breakfor)
                    break;
            }

            newnumber = tmpNumber;

            return tmpNumber != number;
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="number"></param>
        /// <param name="currentdigit"></param>
        /// <param name="nextdigit"></param>
        /// <returns></returns>
        private bool TryIncrease(int number, int currentdigit, out int nextdigit)
        {
            nextdigit = -1;

            if (this.UsableDigits.Contains(currentdigit))
            {
                int index = this.UsableDigits.FindIndex(delegate(int x) { return x == currentdigit; });

                if (index >= 0)
                {
                    if (index == this.UsableDigits.Count - 1)
                        return false;
                    else
                    {
                        if ((!innerUtils.ContainsNumber(number, this.UsableDigits[index + 1]) &&
                            !this.fixedIndices_.ContainsValue(this.UsableDigits[index + 1])) ||
                            this.UseSameDigits
                            )
                        {
                            nextdigit = this.UsableDigits[index + 1];
                            return true;
                        }
                        else
                            return TryIncrease(number, this.UsableDigits[index + 1], out nextdigit);
                    }
                }
                else
                    return false;
            }
            else
                return false;
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="number"></param>
        /// <param name="index"></param>
        /// <returns></returns>
        private int ResetNumber(int number, int index)
        {
            int tmpnumber = number;

            for (int i = index + 1; i < tmpnumber.ToString().Length; i++)
            {
                // check if index is fixed or not
                if (!this.fixedIndices_.Contains(i))
                {
                    int min = -1;

                    // find the min value and set it to the current index
                    for (int j = 0; j < this.UsableDigits.Count; j++)
                    {
                        if (!innerUtils.ContainsNumber(0, i, tmpnumber, this.UsableDigits[j]) || this.UseSameDigits)
                        {
                            if ((i == 0 && this.UsableDigits[j] != 0) || (i > 0))
                            {
                                min = this.UsableDigits[j];
                                break;
                            }
                        }
                    }

                    // set new value
                    tmpnumber = innerUtils.ChangeDigitAtIndex(tmpnumber, i, min);
                }
            }

            return tmpnumber;
        }

        public List<int> GetPossibleNumbersFromDigits(int digitCount)
        {
            List<int> result = new List<int>();

            if (digitCount > 3)
            {
                if (digitCount > 9)
                    digitCount = 9;

                this.UsableDigits.Sort();

                if (this.UsableDigits[0] > 0)
                    result = this.GetProbabilities(int.Parse(this.UsableDigits[0].ToString().PadRight(digitCount, '0')));
                else
                    result = this.GetProbabilities(int.Parse(this.UsableDigits[1].ToString().PadRight(digitCount, '0')));
            }

            return result;
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="number"></param>
        /// <returns></returns>
        public List<int> GetProbabilities(int currentNumber)
        {
            List<int> result = new List<int>();

            if (this.UsableDigits != null)
            {
                if (this.UsableDigits.Count > 0)
                {
                    if (currentNumber.ToString().Length <= this.UsableDigits.Count + this.Correct + this.InCorrect)
                    {
                        // sort digits first
                        this.UsableDigits.Sort();

                        // init fixed indices
                        this.fixedIndices_.Clear();
                        foreach (int i in this.FixedIndices)
                            this.fixedIndices_.Add(i, innerUtils.GetDigitAtIndex(currentNumber, i));

                        // reset the number
                        currentNumber = this.ResetNumber(currentNumber, -1);

                        // add the minimum value to the result
                        result.Add(currentNumber);

                        // get last usable index
                        int usableLastIndex = -1;
                        for (int i = currentNumber.ToString().Length - 1; i > -1; i--)
                        {
                            if (!this.FixedIndices.Contains(i))
                            {
                                usableLastIndex = i;
                                break;
                            }
                        }

                        if (usableLastIndex > -1)
                        {
                            int newNumber = 0;

                            // can we increase the current indexed number
                            while (TryAndForceIncrease(currentNumber, usableLastIndex, out newNumber))
                            {
                                if (newNumber != 0)
                                {
                                    // add it to the result
                                    result.Add(newNumber);

                                    // call it from the beginning
                                    currentNumber = newNumber;
                                }
                            }
                        }
                    }
                    else
                        throw new Exception("Not enough digits to generate new numbers!\r\nPool Size : " +
                            this.UsableDigits.Count.ToString() + "\r\nCorrect : " + this.Correct.ToString() +
                            "\r\nInCorrect : " + this.InCorrect.ToString() + "\r\nNumber : " + currentNumber.ToString());
                }
                else
                    throw new Exception("Digit pool length cannot be zero!");
            }
            else
                throw new Exception("Digit pool cannot be null!");

            return result;
        }

    }
}


text:
using MvvmCross.Plugin.JsonLocalization;
using System.Collections.Generic;

namespace Internationalization.Core.Services
{
    public class TextProviderBuilder : MvxTextProviderBuilder
    {
        public TextProviderBuilder()
            : base(Constants.GeneralNamespace, Constants.RootFolderForResources)
        {
        }

        protected override IDictionary<string, string> ResourceFiles
        {
            get
            {
                return new Dictionary<string, string> { { "strings", "strings" } };
            }
        }
    }
}


text:
<bill session="110" type="h" number="489" updated="2009-01-08T17:47:52-05:00">
	<status><introduced date="1168923600" datetime="2007-01-16"/></status>

	<introduced date="1168923600" datetime="2007-01-16"/>
	<titles>
		<title type="short" as="introduced">Commission On Reforming Entitlement Spending Act</title>
		<title type="short" as="introduced">CORE Spending Act</title>
		<title type="official" as="introduced">To establish a commission to develop legislation designed to reform entitlement benefit programs and ensure a sound fiscal future for the United States, and for other purposes.</title>
	</titles>
	<sponsor id="400644"/>
	<cosponsors>
		<cosponsor id="400279" joined="2007-03-05"/>
		<cosponsor id="400627" joined="2007-01-18"/>
		<cosponsor id="400626" joined="2007-01-18"/>
		<cosponsor id="400113" joined="2007-01-18"/>
		<cosponsor id="400154" joined="2007-02-28"/>
		<cosponsor id="400049" joined="2007-01-18"/>
		<cosponsor id="400287" joined="2007-02-14"/>
		<cosponsor id="400131" joined="2007-01-18"/>
		<cosponsor id="400175" joined="2007-01-19"/>
		<cosponsor id="412213" joined="2007-02-28"/>
		<cosponsor id="400016" joined="2007-01-30"/>
		<cosponsor id="400032" joined="2007-01-19"/>
		<cosponsor id="400654" joined="2007-01-18"/>
		<cosponsor id="412011" joined="2007-01-18"/>
		<cosponsor id="412191" joined="2007-01-18"/>
		<cosponsor id="400656" joined="2007-01-18"/>
	</cosponsors>
	<actions>
		<action date="1168923600" datetime="2007-01-16"><text>Referred to the Committee on the Budget, and in addition to the Committee on Rules, for a period to be subsequently determined by the Speaker, in each case for consideration of such provisions as fall within the jurisdiction of the committee concerned.</text></action>
		<action date="1168923600" datetime="2007-01-16"><text>Referred to House Budget</text></action>
		<action date="1168923600" datetime="2007-01-16"><text>Referred to House Rules</text></action>
	</actions>
	<committees>

	</committees>
	<relatedbills>

	</relatedbills>
	<subjects>

	</subjects>
	<amendments>

	</amendments>

	1/16/2007--Introduced.
Commission On Reforming Entitlement Spending Act, or CORE Spending Act - Establishes the Commission On Reforming Entitlement Spending to examine the long-term fiscal challenges facing the United States and develop legislation designed to address them. Authorizes the President and the House or Senate Budget Committee to submit alternatives to the legislative proposal submitted by the Commission. Requires the Director of the Congressional Budget Office (CBO) to prepare a long-term cost estimate of legislation proposed under this Act or a related amendment, and have it published in the Congressional Record as expeditiously as possible.

</bill>


text:
/*----------------------------------
    Selection Table Constructors
-----------------------------------*/
// Build a Fresh Network Table
function buildNetworkTable() {
  destroyTable('Network', false);
  $('#NetworkTable').DataTable({
    ajax: SCRIPT_ROOT + 'available_networks',
    columns: [
      {data: 'name', name: 'name', title: 'Network'},
      {data: 'refgen', name: 'refgen', title: 'RefGen'},
      {data: 'desc', name: 'desc', title: 'Description'},
    ],
    dom: '<"NetworkTitle">ft',
    order: [[0, 'asc']],
    paginate: false,
    scrollCollapse: true,
    scrollY: '10vh',
    select: true,
    searching: true,
  });
  $('div.NetworkTitle').html('Network');
  $('#NetworkTable tbody').on('click', 'tr', networkListner);
  return;
}

// Build a Fresh Ontology Table
function buildOntologyTable(network) {
  destroyTable('Ontology', false);
  $('#OntologyTable').DataTable({
    ajax: SCRIPT_ROOT + 'available_ontologies/' + network,
    columns: [
      {data: 'name', name: 'name', title: 'Ontology'},
      {data: 'refgen', name: 'refgen', title: 'RefGen'},
      {data: 'desc', name: 'desc', title: 'Description'},
    ],
    dom: '<"OntologyTitle">ft',
    initComplete: function(settings, json) {
      if (json.data.length < 1) {
        $('#GeneSelectTabs a[href="#TermGenesTab"]').tab('show');
      }
    },
    language: {
      emptyTable:
        'No ontologies available for this network. Please enter query genes in the "Custom Gene List" Tab.',
    },
    order: [[0, 'asc']],
    paginate: false,
    scrollCollapse: true,
    scrollY: '10vh',
    select: true,
    searching: true,
  });
  $('div.OntologyTitle').html('Ontology');
  $('#OntologyTable tbody').on('click', 'tr', ontologyListener);
  return;
}

// Build a Fresh Term Table
function buildTermTable(network, ontology) {
  destroyTable('Term', false);
  $('#TermTable').DataTable({
    ajax: SCRIPT_ROOT + 'available_terms/' + network + '/' + ontology,
    columns: [
      {data: 'name', name: 'name', title: 'Name'},
      {data: 'desc', name: 'desc', title: 'Desc'},
      {data: 'snps', name: 'snps', title: 'SNPs'},
      {data: 'genes', name: 'genes', title: 'Genes'},
    ],
    dom: '<"TermTitle">frtip',
    initComplete: function(settings, json) {
      if (json.data.length < 1) {
        $('#GeneSelectTabs a[href="#TermGenesTab"]').tab('show');
      }
    },
    language: {
      emptyTable:
        'No terms available for this ontology. Please enter query genes in the "Custom Gene List" Tab.',
    },
    order: [[0, 'asc']],
    paginate: false,
    scrollCollapse: true,
    scrollY: '23vh',
    select: true,
    searching: true,
  });
  $('div.TermTitle').html('Terms');
  $('#TermTable tbody').on('click', 'tr', termListener);
  return;
}

// Restore the term select tab to original
function resetOntology() {
  if ($.fn.DataTable.isDataTable('#OntologyTable')) {
    $('#OntologyTable')
      .DataTable()
      .rows()
      .deselect();
  }
  destroyTable('Term', true);
}

/*--------------------------------
      Gene Table Constructors
---------------------------------*/
function buildGeneTables() {
  // Derive Export Filename
  var name = curNetwork + '.';
  if (isTerm) {
    name += curTerm;
  } else {
    name += 'Custom';
  }

  // Settings for the tables!
  var tableOpts = {
    deferRender: false,
    order: [[4, 'asc'], [5, 'dec']],
    paging: true,
    paginate: false,
    rowId: 'id',
    scrollCollapse: true,
    scroller: {displayBuffer: 1500},
    scrollX: '100%',
    scrollY:
      $(window).height() -
      $('#cobHead').height() -
      $('#navTabs').height() -
      120,
    searching: true,
    select: {
      style: 'multi+shift',
      selector: 'td:not(td:nth-child(1), td:nth-child(2))',
    },
    buttons: [
      {extend: 'csv', filename: name, titleAttr: csvTitle},
      {text: 'Graph Subnet', action: makeSubnet, titleAttr: gsTitle},
      {text: 'GO', action: gont, enabled: hasGO, titleAttr: goTitle},
      {
        text: 'GWS',
        action: gws,
        titleAttr: gwsTitle,
        available: function(dt, config) {
          return hasGWS;
        },
      },
    ],
    columns: [
      {
        name: 'rendered',
        title: 'Vis',
        orderable: false,
        data: function(row) {
          if (row.render) {
            return (
              ''
            );
          } else {
            return (
              ''
            );
          }
        },
      },
      {
        name: 'info',
        title: 'Ref',
        orderable: false,
        data: function(row) {
          return (
            ''
          );
        },
        visible: refLinks[curNetwork] !== undefined,
      },
      {data: 'id', name: 'id', title: 'ID'},
      {data: 'alias', name: 'alias', title: 'Alias'},
      {data: 'fdr', name: 'fdr', title: 'FDR'},
      {data: 'cur_ldegree', name: 'cur_ldegree', title: 'Current Degree'},
      {data: 'ldegree', name: 'ldegree', title: 'Term Degree'},
      {data: 'gdegree', name: 'gdegree', title: 'Global Degree'},
      {data: 'chrom', name: 'chrom', title: 'Chrom'},
      {data: 'snp', name: 'snp', title: 'SNP'},
      {data: 'start', name: 'start', title: 'Start'},
      {data: 'end', name: 'end', title: 'End'},
      {
        data: 'numIntervening',
        name: 'numIntervening',
        title: 'Num Intervening',
      },
      {
        data: 'rankIntervening',
        name: 'rankIntervening',
        title: 'Rank Intervening',
      },
      {data: 'numSiblings', name: 'numSiblings', title: 'Num Siblings'},
      {
        data: 'windowSize',
        name: 'windowSize',
        title: 'Window Size',
        visible: false,
      },
      {
        data: 'flankLimit',
        name: 'flankLimit',
        title: 'Flank Limit',
        visible: false,
      },
      {data: 'annotations', name: 'annotations', title: 'Annotations'},
      //{data: 'parentNumIterations', name:'parentNumIterations', title: 'Num Parent Interactions'},
      //{data: 'parentAvgEffectSize', name:'parentAvgEffectSize', title: 'Avg Parent Effect Size'},
    ],
  };

  // Deep copy the options to prevent interference
  var geneOpts = $.extend(true, {}, tableOpts);
  var subOpts = $.extend(true, {}, tableOpts);

  /*--------------------------------
              Prep Work
  ---------------------------------*/
  // Destroy the old tables if present
  destroyTable('Gene', false);
  destroyTable('Subnet', false);

  // Set button information messages
  var csvTitle = 'Export all genes in this table to a CSV file';
  var gsTitle =
    'Build a new graph that includes only the currently selected genes and their neighbors, but you will be able to return to the current graph from the new graph';
  var gwsTitle =
    'Run a GeneWordSearch enrichment analysis on the genes in this table';
  if (hasGO) {
    var goTitle =
      'Run a GO term enrichment analysis on the genes in this table';
  } else {
    var goTitle =
      'GO enrichment not available for this organism, please contact site admin if needed.';
  }

  /*--------------------------------
       Setup The Gene Table
  ---------------------------------*/
  // Get gene data
  var geneData = [];
  Object.keys(geneDict).forEach(function(cur, idx, arr) {
    geneData.push(geneDict[cur]['data']);
  });

  // Build the table
  geneOpts.data = geneData;
  geneOpts.dom = '<"GeneTitle">frtpB';
  var gene_table = $('#GeneTable').DataTable(geneOpts);

  // Make certain columns invisible if there will be no useful data
  gene_table
    .columns([
      'snp:name',
      'fdr:name',
      'numIntervening:name',
      'rankIntervening:name',
      'numSiblings:name',
    ])
    .visible(isTerm);

  // Set the inline titles on the tables
  $('div.GeneTitle').html(
    'Gene Data ',
  );

  /*--------------------------------
       Setup The Subnet Table
  ---------------------------------*/
  // Build the table
  subOpts.data = [];
  subOpts.dom = '<"SubnetTitle">frtpB';
  var sub_table = $('#SubnetTable').DataTable(subOpts);

  // Set the inline titles on the tables
  $('div.SubnetTitle').html(
    'Subnet Data ',
  );

  // Make certain columns invisible if there will be no useful data
  sub_table.columns(['rendered:name']).visible(false);
  sub_table
    .columns([
      'snp:name',
      'fdr:name',
      'numIntervening:name',
      'rankIntervening:name',
      'numSiblings:name',
    ])
    .visible(isTerm);

  /*----------------------------------
       Setup The Table Listeners
  -----------------------------------*/
  // Set the info in the titles
  infoTips('#GeneTableInfo, #SubnetTableInfo');

  // Set up qtips on table buttons
  infoTips(gene_table.buttons(0, null).nodes(), 'bottom center', 'top center');
  infoTips(sub_table.buttons(0, null).nodes(), 'bottom center', 'top center');

  // Set listener for pop effect of subnetwork table
  $('#SubnetTable tbody').on('mouseover', 'tr', function(evt) {
    if (this['id'].length > 0) {
      window.clearTimeout(popTimerID);
      popTimerID = window.setTimeout(
        function(id) {
          cy.getElementById(id).flashClass('pop', 750);
        },
        10,
        this['id'],
      );
    }
  });

  // Prevent selection on gene table if noAdd flag
  $('#GeneTable')
    .DataTable()
    .on('user-select', function(evt) {
      // If we are in the process of adding a gene, kill this request
      if (noAdd) {
        evt.preventDefault();
        window.alert(
          "We're currently processing a previous add gene request, if you would like to add more than one at a time, please use the shift select method.",
        );
      }
    });

  // Handling a select on the gene table
  $('#GeneTable')
    .DataTable()
    .on('select deselect', function(evt) {
      geneSelect();
    });

  // Mirroring a select on the gene table
  $('#SubnetTable')
    .DataTable()
    .on('user-select', function(evt, dt, type, cell, ogEvent) {
      // Prevent changes on this table
      evt.preventDefault();

      // If already adding something kill it
      if (noAdd) {
        window.alert(
          "We're currently processing a previous add gene request, if you would like to add more than one at a time, please use the shift select method.",
        );
        return;
      }

      // Select the genes on the main table
      var tbl = $('#SubnetTable').DataTable();
      if ($(tbl.row(cell.index().row).node()).hasClass('selected')) {
        $('#GeneTable')
          .DataTable()
          .row('#' + tbl.row(cell.index().row).id())
          .deselect();
      } else {
        $('#GeneTable')
          .DataTable()
          .row('#' + tbl.row(cell.index().row).id())
          .select();
      }
    });
}

/*---------------------------------------
         Table Helper Functions
---------------------------------------*/
// Helper funtion to add gene to graph with plus
function selGene(id) {
  $('#GeneTable')
    .DataTable()
    .row('#' + id)
    .select();
  geneSelect();
}

// Helper function to remove gene from graph with check
function delGene(id) {
  $('#GeneTable')
    .DataTable()
    .row('#' + id)
    .deselect();
  removeGenes([id]);
}

// Run GWS enrichment on table
function gws(e, dt, node, config) {
  // Build the gene query list
  var geneList = dt.rows().ids();
  enrich(geneList, false);
}

// Run GO enrichment on table
function gont(e, dt, node, cofig) {
  // Build the gene query list
  var geneList = dt.rows().ids();
  enrich(geneList, true);
}

/*---------------------------------------
           Table Cleanup
---------------------------------------*/
function destroyTable(table, hide) {
  // Deconstruct the table if they exist
  var tableID = '#' + table + 'Table';
  if ($.fn.DataTable.isDataTable(tableID)) {
    $(tableID)
      .DataTable()
      .destroy();
    $(tableID)
      .off()
      .empty();
  }

  // Show the wait messages
  if (table === 'Ontology') {
    tableID = '#GeneSelect';
  }
  var waitID = tableID + 'Wait';

  $(tableID).toggleClass('hidden', hide);
  $(waitID).toggleClass('hidden', !hide);
}

/*-------------------------------
      Subnet Table Updater
-------------------------------*/
function updateSubnetTable(newGenes, newGenesSel) {
  // Get the table api ref
  var tbl = $('#SubnetTable').DataTable();

  // Find the genes we must add and remove
  var oldGenes = new Set();
  tbl
    .rows()
    .ids()
    .each(function(cur) {
      oldGenes.add(cur);
    });
  var toAdd = [...newGenes].filter((cur) => !oldGenes.has(cur));
  var toSub = [...oldGenes].filter((cur) => !newGenes.has(cur));

  // Get the data in the proper formats for adding and removing
  toAdd.forEach(function(cur, idx, arr) {
    arr[idx] = geneDict[cur]['data'];
  });
  toSub.forEach(function(cur, idx, arr) {
    arr[idx] = '#' + cur;
  });

  // Clear old data and add new
  if (toSub.length > 0) {
    tbl.rows(toSub).remove();
  }
  tbl.rows.add(toAdd).draw();

  // Update the selections
  tbl.rows('.selected').deselect();
  tbl.rows(newGenesSel).select();
}

/*--------------------------------
  Listeners for Selection Tables
---------------------------------*/
function networkListner() {
  // Save the selected row
  curNetwork = $('td', this)
    .eq(0)
    .text();

  // Clear obsolete graph
  clearResults();

  // Clean up tables
  curOntology = '';
  curTerm = '';
  destroyTable('Term', true);

  // Fetch and build the next table
  buildOntologyTable(curNetwork);

  // Set up the text completion engine for the gene list
  setupTextComplete(curNetwork, '#geneList');
}

function ontologyListener() {
  if (
    $('#OntologyTable')
      .DataTable()
      .rows()
      .count() < 1
  ) {
    return;
  }

  // Highlight the relevant row
  curOntology = $('td', this)
    .eq(0)
    .text();

  // Clear obsolete graph
  clearResults();

  // Prep the Term Table
  curTerm = '';

  // Fetch and build the network table
  buildTermTable(curNetwork, curOntology);
}

function termListener() {
  // Highlight the last line
  curTerm = $('td', this)
    .eq(0)
    .text();

  // Get the new Graph
  loadGraph(true, true, true);
}


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

namespace SQMImportExport.Import.DataSetters.Effects
{
    internal class EffectsParser : ParserBase<List<string>>
    {
        private readonly Regex _effectsRegex = new Regex(@"class Effects", RegexOptions.Compiled);

        public EffectsParser()
        {
            LineSetters.Add(new StringLineSetter("(?<value>.*)", x => ParseResult.Add(x)));
        }

        protected override Regex HeaderRegex
        {
            get { return _effectsRegex; }
        }
    }
}


text:
package com.expanset.hk2.persistence.jpa;

import javax.annotation.Nonnull;
import javax.persistence.EntityTransaction;
import javax.transaction.HeuristicMixedException;
import javax.transaction.HeuristicRollbackException;
import javax.transaction.RollbackException;
import javax.transaction.Status;
import javax.transaction.Synchronization;
import javax.transaction.SystemException;
import javax.transaction.Transaction;
import javax.transaction.xa.XAResource;

import org.apache.commons.lang.NotImplementedException;
import org.apache.commons.lang.Validate;

/**
 * Implementation of {@link Transaction} for JPA engine.
 */
public class JpaTransaction implements Transaction, AutoCloseable {

	protected int status = Status.STATUS_ACTIVE;

	protected final EntityTransaction transaction;

	/**
	 * @param transaction Started JPA transaction.
	 */
	public JpaTransaction(@Nonnull EntityTransaction transaction) {
		Validate.notNull(transaction, "transaction");

		this.transaction = transaction;

		transaction.begin();
	}

	@Override
	public int getStatus()
			throws SystemException {
		return status;
	}

	@Override
	public void setRollbackOnly()
			throws IllegalStateException, SystemException {
		status = Status.STATUS_MARKED_ROLLBACK;
		transaction.setRollbackOnly();
	}

	@Override
	public void registerSynchronization(Synchronization sync)
			throws RollbackException, IllegalStateException, SystemException {
		throw new NotImplementedException();
	}

	@Override
	public void commit()
			throws RollbackException, HeuristicMixedException, HeuristicRollbackException, SecurityException, IllegalStateException, SystemException {
		if(status == Status.STATUS_MARKED_ROLLBACK) {
			throw new RollbackException();
		}
		if(status != Status.STATUS_ACTIVE) {
			throw new IllegalStateException();
		}

		status = Status.STATUS_COMMITTING;
		try {
			transaction.commit();
		} finally {
			status = Status.STATUS_COMMITTED;
		}
	}

	@Override
	public void rollback()
			throws IllegalStateException, SystemException {
		if(status == Status.STATUS_ROLLEDBACK || status == Status.STATUS_COMMITTED) {
			return;
		}

		status = Status.STATUS_ROLLING_BACK;
		try {
			transaction.rollback();
		} finally {
			status = Status.STATUS_ROLLEDBACK;
		}
	}

	@Override
	public boolean enlistResource(XAResource xaRes)
			throws RollbackException, IllegalStateException, SystemException {
		throw new NotImplementedException();
	}

	@Override
	public boolean delistResource(XAResource xaRes, int flag)
			throws IllegalStateException, SystemException {
		throw new NotImplementedException();
	}

	@Override
	public void close()
			throws Exception {
	}
}