text:
/// @file libc_signal.c
/// @brief Test Case Example for Libc Signal API

/****************************************************************************
 * Included Files
 ****************************************************************************/
#include <tinyara/config.h>
#include <stdio.h>
#include <errno.h>
#include <signal.h>
#include "tc_internal.h"

#define SIGINT  2				/* interrupt */
#define SIGQUIT 3				/* quit */

/****************************************************************************
 * Public Functions
 ****************************************************************************/

/**
* @fn                   :tc_libc_signal_sigaddset_sigdelset
* @brief                :sigaddset() adds the signal specified by the signo to the signal set pointed to by set.\
*                        sigdelset() deletes the signal specified by signo from the signal set pointed to by set.
* @scenario             :The sigaddset() adds the signal specified by the signo\
*                        sigdelset() deletes the signal specified by signo and  to verify we use sigismember.
* API's covered         :sigaddset, sigdelset
* Preconditions         :none
* Preconditions         :none
* @return               :void
*/
static void tc_libc_signal_sigaddset_sigdelset(void)
{
	int ret_chk = 0;
	sigset_t sigset;

	ret_chk = sigemptyset(&sigset);
	TC_ASSERT_EQ("sigemptyset", ret_chk, OK);

	ret_chk = sigaddset(&sigset, SIGQUIT);
	TC_ASSERT_EQ("sigaddset", ret_chk, OK);

	ret_chk = sigismember(&sigset, SIGQUIT);
	TC_ASSERT_EQ("sigismember", ret_chk, 1);

	ret_chk = sigdelset(&sigset, SIGQUIT);
	TC_ASSERT_EQ("sigdelset", ret_chk, OK);

	/* should not find that signal as it has already deleted */

	ret_chk = sigismember(&sigset, SIGQUIT);
	TC_ASSERT_NEQ("sigismember", ret_chk, 1);
	TC_ASSERT_NEQ("sigismember", ret_chk, ERROR);

	TC_SUCCESS_RESULT();
}

/**
* @fn                   :tc_libc_signal_sigemptyset_sigfillset
* @brief                :sigemptyset() and sigfillset() initialize the signal set pointed to by set,\
*                        such that all signals defined are included and excluded respectively.
* @scenario             :sigemptyset() and sigfillset() initialize the signal set pointed to by set,\
*                        such that all signals defined are included and excluded respectively. To verify we use sigismember.
* API's covered         :sigemptyset, sigfillset
* Preconditions         :none
* Preconditions         :none
* @return               :void
*/
static void tc_libc_signal_sigemptyset_sigfillset(void)
{
	int ret_chk = 0;
	sigset_t sigset;

	ret_chk = sigfillset(&sigset);
	TC_ASSERT_EQ("sigfillset", ret_chk, OK);

	ret_chk = sigismember(&sigset, SIGQUIT);
	TC_ASSERT_EQ("sigismember", ret_chk, 1);

	ret_chk = sigismember(&sigset, SIGINT);
	TC_ASSERT_EQ("sigismember", ret_chk, 1);

	ret_chk = sigemptyset(&sigset);
	TC_ASSERT_EQ("sigemptyset", ret_chk, OK);

	/* sigismember should not find any signal as all signals are set empty */

	ret_chk = sigismember(&sigset, SIGQUIT);
	TC_ASSERT_NEQ("sigemptyset", ret_chk, 1);
	TC_ASSERT_NEQ("sigismember", ret_chk, ERROR);

	/* sigfillset will fill all signals to signal set */

	ret_chk = sigfillset(&sigset);
	TC_ASSERT_EQ("sigfillset", ret_chk, OK);

	ret_chk = sigismember(&sigset, SIGQUIT);
	TC_ASSERT_EQ("sigismember", ret_chk, 1);

	ret_chk = sigismember(&sigset, SIGINT);
	TC_ASSERT_EQ("sigismember", ret_chk, 1);

	TC_SUCCESS_RESULT();
}

/**
* @fn                   :tc_libc_signal_sigismember
* @brief                :sigismember() function shall test whether the signal specified by signo is a member of the set pointed to by set.
* @scenario             :empty the sigset using sigemptyset() ,then verify it with sigismember() function which\
*                        shall test whether the signal specified by signo is a member
* API's covered         :sigismember()
* Preconditions         :sigemptyset()
* Preconditions         :none
* @return               :void
*/

static void tc_libc_signal_sigismember(void)
{
	int ret_chk = 0;
	sigset_t sigset;

	ret_chk = sigemptyset(&sigset);
	TC_ASSERT_EQ("sigemptyset", ret_chk, OK);

	ret_chk = sigismember(&sigset, SIGQUIT);
	TC_ASSERT_NEQ("sigismember", ret_chk, 1);
	TC_ASSERT_NEQ("sigismember", ret_chk, ERROR);

	/* sigfillset will fill all signals to signal set */

	ret_chk = sigfillset(&sigset);
	TC_ASSERT_EQ("sigfillset", ret_chk, OK);

	/* sigismember will find the signals which were filled by sigfillset */

	ret_chk = sigismember(&sigset, SIGQUIT);
	TC_ASSERT_EQ("sigismember", ret_chk, 1);

	TC_SUCCESS_RESULT();
}

/****************************************************************************
 * Name: libc_signal
 ****************************************************************************/

int libc_signal_main(void)
{
	tc_libc_signal_sigaddset_sigdelset();
	tc_libc_signal_sigemptyset_sigfillset();
	tc_libc_signal_sigismember();

	return 0;
}


text:
cask "rectangle" do
  version "0.57,63"
  sha256 "cbf2f6c4bd600628fb908a73a648be177739f1fde11b27759105d503b039b35f"

  url "https://github.com/rxhanson/Rectangle/releases/download/v#{version.csv.first}/Rectangle#{version.csv.first}.dmg",
      verified: "github.com/rxhanson/Rectangle/"
  name "Rectangle"
  desc "Move and resize windows using keyboard shortcuts or snap areas"
  homepage "https://rectangleapp.com/"

  livecheck do
    url "https://rectangleapp.com/downloads/updates.xml"
    strategy :sparkle
  end

  auto_updates true
  depends_on macos: ">= :el_capitan"

  app "Rectangle.app"

  uninstall quit: "com.knollsoft.Rectangle"

  zap trash: [
    "~/Library/Application Scripts/com.knollsoft.RectangleLauncher",
    "~/Library/Application Support/Rectangle",
    "~/Library/Caches/com.knollsoft.Rectangle",
    "~/Library/HTTPStorages/com.knollsoft.Rectangle",
    "~/Library/Containers/com.knollsoft.RectangleLauncher",
    "~/Library/Preferences/com.knollsoft.Rectangle.plist",
  ]
end

redpajama_set_name: RedPajamaGithub


text:
//
//  SA_CommandResponder.h
//
//	Copyright (c) 2016 Said Achmiz.
//
//	This software is licensed under the MIT license.
//	See the file "LICENSE" for more information.

#import <Foundation/Foundation.h>

/*********************/
#pragma mark Constants
/*********************/

extern NSString * const SA_DB_MESSAGE_BODY;
extern NSString * const SA_DB_MESSAGE_INFO;

/***************************************************/
#pragma mark - SA_CommandResponder class declaration
/***************************************************/

@interface SA_CommandResponder : NSObject

/**********************************************/
#pragma mark - Public methods (command replies)
/**********************************************/

- (NSArray *)repliesForCommandString:(NSString *)commandString messageInfo:(NSDictionary *)messageInfo error:(NSError **)error;

@end


text:
<?xml version="1.0" encoding="UTF-8"?>
<forms>
    <sitearea>
        <test>
            <displayGroups>
                <DisplayGroup>
                    <elements>
                        <ElementName1>ElementName1</ElementName1>
                        <ElementName2>ElementName2</ElementName2>
                    </elements>
                    <options>
                        <name>login</name>
                        Test
                        <legend>Form 1</legend>
                    </options>
                </DisplayGroup>
            </displayGroups>
            <elements>
                <ElementName1>
                    <type>text</type>
                    <name>ElementName1</name>
                    <options>
                        Label 1
                    </options>
                </ElementName1>
                <ElementName2>
                    <type>text</type>
                    <name>ElementName2</name>
                    <options>
                        Label 2
                    </options>
                </ElementName2>
                <ElementName3>
                    <type>text</type>
                    <name>ElementName3</name>
                    <options>
                        Label 3
                    </options>
                </ElementName3>
                <ElementName4>
                    <type>text</type>
                    <name>ElementName4</name>
                    <options>
                        Label 4
                    </options>
                </ElementName4>
            </elements>
            <legend>Form 1</legend>
            <method>post</method>
        </test>
    </sitearea>
</forms>


text: APCT_231-233_2015-09-30: In Class Exercise - sporting event ticket age check


text:
<?php
/**
 * Created by PhpStorm.
 * User: Double H
 * Date: 19-08-2015
 * Time: 09:01 PM
 */

namespace auction\widgets\grid;
use auction\models\MessageTemplate;
use yii\base\Widget;
use yii\web\HttpException;
use yii\web\JsExpression;
use yii\bootstrap\Modal;
use yii\helpers\Html;

class ModelCrud extends Widget
{

//    public $deleteUrl;
    public $updateUrl;
    public $createUrl;
    public $viewUrl;

//    public $deleteVerb='get';
    public $viewVerb='get';
    public $createVerb='get';
    public $updateVerb='get';

    public $size;

    public $updateModalSelector='.update-modal';
//    public $deleteModelSelector='.delete-modal';
    public $viewModalSelector='.view-modal';
    public $createModalSelector='#create-modal';

    public $pjaxContainerId='pjax-gridview';

//    public $deleteModelTitle='Delete';
    public $template='{view}{delete}{update}{create}';
    public $modelTitle='Model';
    public $modelClass;

    private $_renderJs;

    public function init(){
        if(!$this->updateUrl || !$this->createUrl || !$this->viewUrl){
            throw new HttpException(400, 'Urls Must Be defined');
        }
    }

    public function run(){

        $this->registerJs();
        $output=$this->initializeModal();

        return $output;
    }

    private function registerJs(){
        $view=$this->view;

        preg_replace_callback('/\\{([\w\-\/]+)\\}/', function ($matches){
            $name = $matches[1];
            $this->appendJs($name);
        },$this->template);

        $view->registerJs(substr($this->_renderJs,0,-1));
    }

    private function initializeModal(){

        Modal::begin([
            'id' => 'activity-modal',
            'size' => $this->size,
            'header' => '
'. $this->modelTitle .'
',
            'footer' => Html::button('Close', ['class' => 'btn btn-info', 'data-dismiss' => 'modal']),
        ]);

        Modal::end();

//        Modal::begin([
//            'id' => 'activity-delete-modal',
//            'header' => '
'. $this->deleteModelTitle .'
',
//            'footer' => Html::button('Close', ['class' => 'btn btn-default', 'data-dismiss' => 'modal'])
//                . PHP_EOL . Html::button('Delete', [
//                    'class' => 'btn btn-primary btn-modal-save',
//                    'id' => 'delete-role-model',
//                    'data-id' => '',
//                    'onClick' => new JsExpression('var id=$("#delete-role-model").attr("data-id");$.ajax({type:"'. $this->deleteVerb .'",url:"'.$this->deleteUrl.'",data:{id:id},success:function(){$.pjax.reload({container:"#'. $this->pjaxContainerId .'",timeout:2e3}),$("#activity-delete-modal").modal("hide")}});')
//                ]),
//        ]);
//        echo 'Are You Sure To Delete This Item';
//        Modal::end();

    }

    private function updateModalJs(){
        return 'jQuery(document).on("click","'. $this->updateModalSelector .'",function(){var t=$(this).attr("data-id");$.ajax({type:"'. $this->updateVerb .'",url:"'.$this->updateUrl.'",data:{id:t},success:function(t){$("#activity-modal").find(".modal-body").html(t),$("#activity-modal").modal("show")}})})';
    }

    private function viewModalJs(){
        return 'jQuery(document).on("click","'.$this->viewModalSelector.'",function(){var t=$(this).attr("data-id");$.ajax({type:"'.$this->viewVerb.'",url:"'.$this->viewUrl.'",data:{id:t},success:function(t){$("#activity-modal").find(".modal-body").html(t),$("#activity-modal").modal("show")}})})';
    }

    private function createModalJs(){
        return 'jQuery(document).on("click","'.$this->createModalSelector.'",function(){$.ajax({type:"'. $this->createVerb .'",url:"'.$this->createUrl.'",success:function(t){$("#activity-modal").find(".modal-body").html(t),$("#activity-modal").modal("show")}})})';
    }

//    private function deleteModalJs(){
//        return 'jQuery(document).on("click","'.$this->deleteModelSelector.'",function(){var t=$(this).attr("data-id");$("#delete-role-model").attr("data-id",t),$("#activity-delete-modal").modal("show")})';
//    }

    private function appendJs($name){
        switch ($name) {
            case "view":
                $this->_renderJs.=$this->viewModalJs().',';
                break;
            case "update":
                $this->_renderJs.=$this->updateModalJs().',';
                break;
//            case "delete":
//                $this->_renderJs.=$this->deleteModalJs().',';
//                break;
            case "create":
                $this->_renderJs.=$this->createModalJs().',';
                break;
            default:
                return ;
        }
    }
}


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="HandheldFriendly" content="True" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <title>Macbook-Pro - 🌐 Aaronpedia</title>
    <meta name="description" content="" />
    <link href="//fonts.googleapis.com/css?family=Noto+Sans:300,400,700" rel="stylesheet" type="text/css">
    <link href="//fonts.googleapis.com/css?family=Noto+Serif:400,700,400italic" rel="stylesheet" type="text/css">
    <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
    <link href="//aaronpedia.com/themes/saga/assets/css/style.css?v=1478103978703" rel="stylesheet" type="text/css">
    <link href="//aaronpedia.com/themes/saga/assets/css/animate.min.css?v=1478103978703" rel="stylesheet" type="text/css">
    <link href="http://aaronpedia.com/favicon.ico" rel="shortcut icon">
    <link rel="canonical" href="http://aaronpedia.com/http://aaronpedia.com/tag/Macbook-Pro/" />
    <meta name="referrer" content="origin" />

    <meta property="og:site_name" content="🌐 Aaronpedia" />
    <meta property="og:type" content="website" />
    <meta property="og:title" content="Macbook-Pro - 🌐 Aaronpedia" />
    <meta property="og:url" content="http://aaronpedia.com/http://aaronpedia.com/tag/Macbook-Pro/" />
    <meta name="twitter:card" content="summary" />
    <meta name="twitter:title" content="Macbook-Pro - 🌐 Aaronpedia" />
    <meta name="twitter:url" content="http://aaronpedia.com/http://aaronpedia.com/tag/Macbook-Pro/" />

    <meta name="generator" content="HubPress" />
    <link rel="alternate" type="application/rss+xml" title="🌐 Aaronpedia" href="http://aaronpedia.com/rss/" />

        🌐 Aaronpedia
        Aaron L'Heureux is an iOS engineer at Imgur. Previously: JS/Front-end at Amazon and Boston University.

Macbook-Pro

The state of Macbooks

                Over the past year, I distinctly recall a palpable frustration with Apple’s lineup. Not much had changed tangibly in years and lots of…

                 <time class="timesince" data-timesince="1477897200" datetime="2016-10-31T00:00" title="31 October 2016">2 days ago</time>
                 Aaron L'Heureux

                    Apple,  Macbook Pro,  Macbook,  AMD,  Intel

        Page 1 of 1

Copyright © 🌐 Aaronpedia. All Rights Reserved.

Published with HubPress

            Built with  and Free and Open-Source Software.


text:
from typing import Optional, Dict, Any

from django.conf import settings
from django_elasticsearch_dsl import (
    Document,
    GeoPointField,
    NestedField,
    TextField,
    IntegerField,
    BooleanField,
    DateField,
)
from django_elasticsearch_dsl.registries import registry

from mainapp.models import Meeting
from .index import text_analyzer

@registry.register_document
class MeetingDocument(Document):
    location = GeoPointField()
    sort_date = DateField()

    agenda_items = NestedField(
        attr="agendaitem_set",
        properties={
            "key": TextField(),
            "name": TextField(analyzer=text_analyzer),
            "position": IntegerField(),
            "public": BooleanField(),
        },
    )

    @staticmethod
    def prepare_location(instance: Meeting) -> Optional[Dict[str, Any]]:
        if instance.location:
            return instance.location.coordinates()

    def get_queryset(self):
        return (
            Meeting.objects.prefetch_related("agendaitem_set")
            .prefetch_related("location")
            .order_by("id")
        )

    class Index:
        name = settings.ELASTICSEARCH_PREFIX + "-meeting"

    class Django:
        model = Meeting
        queryset_pagination = settings.ELASTICSEARCH_QUERYSET_PAGINATION

        fields = ["id", "name", "short_name", "start", "end", "created", "modified"]


text:
import {expect} from "chai"

import {CategoricalTicker} from "@bokehjs/models/tickers/categorical_ticker"
import {FactorRange} from "@bokehjs/models/ranges/factor_range"

describe("CategoricalTicker Model", () => {

  describe("CategoricalTicker get_ticks method", () => {

    it("should handle case where range has no factors", () => {
      const ticker = new CategoricalTicker()
      const range = new FactorRange()
      const ticks = ticker.get_ticks(0, 10, range, null, {}) // cross_loc is null
      expect(ticks.major).to.be.deep.equal([])
      expect(ticks.minor).to.be.deep.equal([])
    })

    it("should handle case where range has factors", () => {
      const ticker = new CategoricalTicker()
      const range = new FactorRange({factors: ["foo", "bar", "bat"]})
      const ticks = ticker.get_ticks(0, 3, range, null, {}) // cross_loc is null
      expect(ticks.major).to.be.deep.equal(["foo", "bar", "bat"])
      expect(ticks.minor).to.be.deep.equal([])
    })

    it("should handle partial range correctly", () => {
      const ticker = new CategoricalTicker()
      const range = new FactorRange({factors: ["foo", "bar", "bat"]})
      //  should just show middle factor (index=2)
      const ticks = ticker.get_ticks(1, 2, range, null, {}) // cross_loc is null
      expect(ticks.major).to.be.deep.equal(["bar"])
      expect(ticks.minor).to.be.deep.equal([])
    })
  })
})


text:
package main

import (
	"fmt"
	"os"

	"github.com/docker/docker/cli"
	"github.com/docker/docker/daemon/config"
	"github.com/docker/docker/dockerversion"
	"github.com/docker/docker/pkg/jsonmessage"
	"github.com/docker/docker/pkg/reexec"
	"github.com/docker/docker/rootless"
	"github.com/moby/buildkit/util/apicaps"
	"github.com/moby/term"
	"github.com/sirupsen/logrus"
	"github.com/spf13/cobra"
)

var (
	honorXDG bool
)

func newDaemonCommand() (*cobra.Command, error) {
	cfg, err := config.New()
	if err != nil {
		return nil, err
	}
	opts := newDaemonOptions(cfg)

	cmd := &cobra.Command{
		Use:           "dockerd [OPTIONS]",
		Short:         "A self-sufficient runtime for containers.",
		SilenceUsage:  true,
		SilenceErrors: true,
		Args:          cli.NoArgs,
		RunE: func(cmd *cobra.Command, args []string) error {
			opts.flags = cmd.Flags()
			return runDaemon(opts)
		},
		DisableFlagsInUseLine: true,
		Version:               fmt.Sprintf("%s, build %s", dockerversion.Version, dockerversion.GitCommit),
	}
	cli.SetupRootCommand(cmd)

	flags := cmd.Flags()
	flags.BoolP("version", "v", false, "Print version information and quit")
	defaultDaemonConfigFile, err := getDefaultDaemonConfigFile()
	if err != nil {
		return nil, err
	}
	flags.StringVar(&opts.configFile, "config-file", defaultDaemonConfigFile, "Daemon configuration file")
	configureCertsDir()
	opts.installFlags(flags)
	if err := installConfigFlags(opts.daemonConfig, flags); err != nil {
		return nil, err
	}
	installServiceFlags(flags)

	return cmd, nil
}

func init() {
	if dockerversion.ProductName != "" {
		apicaps.ExportedProduct = dockerversion.ProductName
	}
	// When running with RootlessKit, $XDG_RUNTIME_DIR, $XDG_DATA_HOME, and $XDG_CONFIG_HOME needs to be
	// honored as the default dirs, because we are unlikely to have permissions to access the system-wide
	// directories.
	//
	// Note that even running with --rootless, when not running with RootlessKit, honorXDG needs to be kept false,
	// because the system-wide directories in the current mount namespace are expected to be accessible.
	// ("rootful" dockerd in rootless dockerd, #38702)
	honorXDG = rootless.RunningWithRootlessKit()
}

func main() {
	if reexec.Init() {
		return
	}

	// initial log formatting; this setting is updated after the daemon configuration is loaded.
	logrus.SetFormatter(&logrus.TextFormatter{
		TimestampFormat: jsonmessage.RFC3339NanoFixed,
		FullTimestamp:   true,
	})

	// Set terminal emulation based on platform as required.
	_, stdout, stderr := term.StdStreams()

	initLogging(stdout, stderr)

	onError := func(err error) {
		fmt.Fprintf(stderr, "%s\n", err)
		os.Exit(1)
	}

	cmd, err := newDaemonCommand()
	if err != nil {
		onError(err)
	}
	cmd.SetOut(stdout)
	if err := cmd.Execute(); err != nil {
		onError(err)
	}
}


text:
/* require:
jsziptools.js
adler32.js
inflate.js
utils.js
*/

/**
 * Decompress a zlib format buffer.
 *
 * @param {ArrayBuffer|Uint8Array|Array|string} bytes zlib format buffer.
 * @return {ArrayBuffer} buffer.
 */
zlib.decompress = function(bytes, check){
    return zpipe.inflate(utils.toBytes(bytes), true, true).buffer;
};

expose('jz.zlib.decompress', zlib.decompress);


text:
package com.sap.openui5;

import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.Reader;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.net.URLConnection;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.GenericServlet;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.io.IOUtils;
import org.mozilla.javascript.Context;
import org.mozilla.javascript.Function;
import org.mozilla.javascript.Scriptable;
import org.mozilla.javascript.ScriptableObject;
import org.mozilla.javascript.tools.shell.Global;

/**
 * The class LessFilter is used to compile CSS for Less files
 * on the fly - once they are requested by the application.
 *

 * This class must not be used in productive systems.
 *
 * @author Peter Muessig, Matthias Osswald
 */
public class LessFilter implements Filter {

  /** default prefix for the classpath */
  private static final String CLASSPATH_PREFIX = "META-INF";

  /** pattern to identify a theme request */
  private static final Pattern PATTERN_THEME_REQUEST = Pattern.compile("(.*)/(library\\.css|library-RTL\\.css|library-parameters\\.json)$");

  /** pattern to identify a theme request */
  private static final Pattern PATTERN_THEME_REQUEST_PARTS = Pattern.compile("(/resources/(.*)/themes/)([^/]*)/.*");

  /** base path for the less JS sources*/
  private static final String LESS_PATH = CLASSPATH_PREFIX + "/less/";

  /** array of scripts for the rhino less instance */
  private static final String[] LESS_JS = {
    "less-env.js", "less.js", "less-rtl-plugin.js", "less-api.js"
  };

  /** keeps the scope of the rhino */
  private Scriptable scope;

  /** function to parse the less input */
  private Function parse;

  /** filter configuration */
  private FilterConfig config;

  /** map for the lastModified timestamps for up-to-date check (library.source.less path --> max timestamp of all less files) */
  private Map<String, Long> lastModified = new HashMap<String, Long>();

  /** cache for the generated resources (resource path --> content) */
  private Map<String, String> cache = new HashMap<String, String>();

  /* (non-Javadoc)
   * @see javax.servlet.Filter#init(javax.servlet.FilterConfig)
   */
  public void init(FilterConfig filterConfig) throws ServletException {

    // keep the filter configuration
    this.config = filterConfig;

    // initialize the Less Compiler in the Rhino container
    try {

      // create a new JS execution context
      Context context = Context.enter();
      context.setOptimizationLevel(9);
      context.setLanguageVersion(Context.VERSION_1_7);

      // initialize the global context sharing object
      Global global = new Global();
      global.init(context);

      // create the scope
      this.scope = context.initStandardObjects(global);

      // load the scripts and evaluate them in the Rhino context
      ClassLoader loader = LessFilter.class.getClassLoader();
      for (String script : LESS_JS) {
        URL url = loader.getResource(LESS_PATH + script);
        Reader reader = new InputStreamReader(url.openStream(), "UTF-8");
        context.evaluateReader(this.scope, reader, script, 1, null);
      }

      // get environment object and set the resource loader used in less (see less-api.js)
      Scriptable env = (Scriptable) this.scope.get("__env", this.scope);
      env.put("resourceLoader", env, Context.javaToJS(new ResourceLoader(), this.scope));

      // keep the reference to the JS less API
      this.parse = (Function) this.scope.get("parse", this.scope);

    } catch (Exception ex) {
      String message = "Failed to initialize LESS compiler!";
      throw new ServletException(message, ex);
    } finally {
      // exit the context
      Context.exit();
    }

  } // method: init

  /* (non-Javadoc)
   * @see javax.servlet.Filter#destroy()
   */
  public void destroy() {
    this.parse = null;
    this.scope = null;
    this.config = null;
  } // method: destroy

  /* (non-Javadoc)
   * @see javax.servlet.Filter#doFilter(javax.servlet.ServletRequest, javax.servlet.ServletResponse, javax.servlet.FilterChain)
   */
  public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {

    // make sure that the request/response are http request/response
    if (request instanceof HttpServletRequest && response instanceof HttpServletResponse) {

      // determine the path of the request
      HttpServletRequest httpRequest = (HttpServletRequest) request;
      HttpServletResponse httpResponse = (HttpServletResponse) response;
      String method = httpRequest.getMethod().toUpperCase(); // NOSONAR
      String path = httpRequest.getServletPath() + httpRequest.getPathInfo();

      // only process GET or HEAD requests
      if (method.matches("GET|HEAD")) {

        // compile the less if required (up-to-date check happens in the compile function)
        Matcher m = PATTERN_THEME_REQUEST.matcher(path);
        if (m.matches()) {

          // check for existence of the resource
          URL url = this.findResource(path);
          if (url == null) {

            String prefixPath = m.group(1);
            String sourcePath = prefixPath + "/library.source.less";

            this.compile(sourcePath, false, false);

            // return the cached CSS or JSON file
            if (this.cache.containsKey(path)) {

              httpResponse.setStatus(HttpServletResponse.SC_OK);
              response.setContentType(this.config.getServletContext().getMimeType(path));
              httpResponse.addDateHeader("Last-Modified", this.lastModified.get(sourcePath));

              if ("GET".equals(method)) {
                OutputStream os = response.getOutputStream();
                IOUtils.write(this.cache.get(path), os, "UTF-8");
                IOUtils.closeQuietly(os);

                os.flush();
                os.close();
              }

              return;

            }

          } else {

            this.log("The resource " + path + " already exists and will not be compiled on-the-fly.");

          }

        }

      }

    }

    // proceed in the filter chain
    chain.doFilter(request, response);

  } // method: doFilter

  /**
   * logs the message prepended by the filter name (copy of {@link GenericServlet#log(String)})
   * @param msg the message
   */
  private void log(String msg) {
    this.config.getServletContext().log(this.config.getFilterName() + ": "+ msg);
  } // method: log

  /**
   * logs the message and Throwable prepended by the filter name (copy of {@link GenericServlet#log(String, Throwable)})
   * @param msg the message
   * @param t the Throwable
   */
  private void log(String msg, Throwable t) {
    this.config.getServletContext().log(this.config.getFilterName() + ": "+ msg, t);
  } // method: log

  /**
   * finds the resource for the given path
   * @param path path of the resource
   * @return URL to the resource or null
   * @throws MalformedURLException
   */
  private URL findResource(String path) throws MalformedURLException {

    // normalize the path (JarURLConnection cannot resolve non-normalized paths)
    String normalizedPath = URI.create(path).normalize().toString();

    // define the classpath for the classloader lookup
    String classPath = CLASSPATH_PREFIX + normalizedPath;

    // first lookup the resource in the web context path
    URL url = this.config.getServletContext().getResource(normalizedPath);

    // lookup the resource in the current threads classloaders
    if (url == null) {
      url = Thread.currentThread().getContextClassLoader().getResource(classPath);
    }

    // lookup the resource in the local classloader
    if (url == null) {
      url = ResourceServlet.class.getClassLoader().getResource(classPath);
    }

    return url;

  } // method: findResource

  /**
   * determines the max last modified timestamp for the given paths
   * @param paths array of paths
   * @return max last modified timestamp
   */
  private long getMaxLastModified(String[] paths) {
    long lastModified = -1;
    try {
      for (String path : paths) {
        URL url = this.findResource(path);
        if (url != null) {
          URLConnection c = url.openConnection();
          c.connect();
          lastModified = Math.max(lastModified, c.getLastModified());
        }
      }
    } catch (Exception ex) {
      this.log("Failed to determine max last modified timestamp.", ex);
    }
    return lastModified;
  } // method: getMaxLastModified

  /**
   * compiles the CSS, RTL-CSS and theme parameters as JSON
   * @param sourcePath source path
   * @param compressCSS true, if CSS should be compressed
   * @param compressJSON true if JSON should be compressed
   */
  private void compile(String sourcePath, boolean compressCSS, boolean compressJSON) {

    Matcher m = PATTERN_THEME_REQUEST_PARTS.matcher(sourcePath);
    if (m.matches()) {

      // extract the relevant parts from the request path
      String prefixPath = m.group(1);
      String library = m.group(2);
      String libraryName = library.replace('/', '.');
      String theme = m.group(3);
      String path = prefixPath + theme + "/";

      try {

        URL url = this.findResource(sourcePath);
        if (url != null) {

          // read the library.source.less
          URLConnection conn = url.openConnection();
          conn.connect();

          // up-to-date check
          String resources = this.cache.get(path + "resources");
          long lastModified = resources != null ? this.getMaxLastModified(resources.split(";")) : -1;
          if (!this.lastModified.containsKey(sourcePath) || this.lastModified.get(sourcePath) < lastModified) {

            // some info
            this.log("Compiling CSS/JSON of library " + libraryName + " for theme " + theme);

            // read the content
            InputStream is = conn.getInputStream();
            String input = IOUtils.toString(is, "UTF-8");
            IOUtils.closeQuietly(is);

            // time measurement begin
            long millis = System.currentTimeMillis();

            // compile the CSS/JSON
            Scriptable result = this.compileCSS(input, path, compressCSS, compressJSON, libraryName);

            // cache the result
            String css = Context.toString(ScriptableObject.getProperty((Scriptable) result, "css"));
            this.cache.put(path + "library.css", css);
            String rtlCss = Context.toString(ScriptableObject.getProperty((Scriptable) result, "cssRtl"));
            this.cache.put(path + "library-RTL.css", rtlCss);
            String json = Context.toString(ScriptableObject.getProperty((Scriptable) result, "json"));
            this.cache.put(path + "library-parameters.json", json);
            resources = Context.toString(ScriptableObject.getProperty((Scriptable) result, "resources"));
            this.cache.put(path + "resources", resources);

            // log the compile duration
            this.log("  => took " + (System.currentTimeMillis() - millis) + "ms");

            // store when the resource has been compiled
            this.lastModified.put(sourcePath, this.getMaxLastModified(resources.split(";")));

          }

        } else {
          this.log("The less source file cannot be found: " + sourcePath);
        }

      } catch (Exception ex) {
        // in case of error we also cleanup the cache!
        this.log("Failed to compile CSS for " + sourcePath, ex);
        this.cache.remove(path + "library.css");
        this.cache.remove(path + "library-RTL.css");
        this.cache.remove(path + "library-parameters.json");
        this.cache.remove(path + "resources");
        this.lastModified.remove(sourcePath);
      }

    }

  } // method: compile

  /**
   * compiles the CSS, RTL-CSS and theme parameters as JSON
   * @param input less input
   * @param path source path
   * @param compressCSS true, if CSS should be compressed
   * @param compressJSON true if JSON should be compressed
   * @param libraryName name of the library
   */
  private synchronized Scriptable compileCSS(String input, String path, boolean compressCSS, boolean compressJSON, String libraryName) {
    // compile the CSS/JSON within the Rhino environment
    return (Scriptable) Context.call(null, this.parse, this.scope, this.scope, new Object[] { input, path, compressCSS, compressJSON, libraryName });
  } // method: compileCSS

  /**
   * The ResourceLoader is used to load dedicated resources
   * requested by Rhino out of the classpath.
   */
  public class ResourceLoader {

    /**
     * loads a resource for the specified path
     * @param path path of the resource
     */
    public String load(String path) throws IOException {
      String content = null;
      URL resource = LessFilter.this.findResource(path);
      if (resource != null) {
        InputStream is = resource.openStream();
        content = IOUtils.toString(is, "UTF-8");
        IOUtils.closeQuietly(is);
      }
      return content;
    } // method: load

  } // inner class: ResourceLoader

} // class: LessFilter


text:
![Gabs](gabs_logo.png "Gabs")

Gabs is a small utility for dealing with dynamic or unknown JSON structures in golang. It's pretty much just a helpful wrapper around the golang json.Marshal/json.Unmarshal behaviour and map[string]interface{} objects. It does nothing spectacular except for being fabulous.

https://godoc.org/github.com/Jeffail/gabs

##How to install:

```bash
go get github.com/Jeffail/gabs
```

##How to use

###Parsing and searching JSON

```go
...

import "github.com/Jeffail/gabs"

jsonParsed, err := gabs.ParseJSON([]byte(`{
	"outter":{
		"inner":{
			"value1":10,
			"value2":22
		},
		"alsoInner":{
			"value1":20
		}
	}
}`))

var value float64
var ok bool

value, ok = jsonParsed.Path("outter.inner.value1").Data().(float64)
// value == 10.0, ok == true

value, ok = jsonParsed.Search("outter", "inner", "value1").Data().(float64)
// value == 10.0, ok == true

value, ok = jsonParsed.Path("does.not.exist").Data().(float64)
// value == 0.0, ok == false

exists := jsonParsed.Exists("outter", "inner", "value1")
// exists == true

exists := jsonParsed.Exists("does", "not", "exist")
// exists == false

exists := jsonParsed.ExistsP("does.not.exist")
// exists == false

...
```

###Iterating objects

```go
...

jsonParsed, _ := gabs.ParseJSON([]byte(`{"object":{ "first": 1, "second": 2, "third": 3 }}`))

// S is shorthand for Search
children, _ := jsonParsed.S("object").ChildrenMap()
for key, child := range children {
	fmt.Printf("key: %v, value: %v\n", key, child.Data().(string))
}

...
```

###Iterating arrays

```go
...

jsonParsed, _ := gabs.ParseJSON([]byte(`{"array":[ "first", "second", "third" ]}`))

// S is shorthand for Search
children, _ := jsonParsed.S("array").Children()
for _, child := range children {
	fmt.Println(child.Data().(string))
}

...
```

Will print:

```
first
second
third
```

Children() will return all children of an array in order. This also works on objects, however, the children will be returned in a random order.

###Searching through arrays

If your JSON structure contains arrays you can still search the fields of the objects within the array, this returns a JSON array containing the results for each element.

```go
...

jsonParsed, _ := gabs.ParseJSON([]byte(`{"array":[ {"value":1}, {"value":2}, {"value":3} ]}`))
fmt.Println(jsonParsed.Path("array.value").String())

...
```

Will print:

```
[1,2,3]
```

###Generating JSON

```go
...

jsonObj := gabs.New()
// or gabs.Consume(jsonObject) to work on an existing map[string]interface{}

jsonObj.Set(10, "outter", "inner", "value")
jsonObj.SetP(20, "outter.inner.value2")
jsonObj.Set(30, "outter", "inner2", "value3")

fmt.Println(jsonObj.String())

...
```

Will print:

```
{"outter":{"inner":{"value":10,"value2":20},"inner2":{"value3":30}}}
```

To pretty-print:

```go
...

fmt.Println(jsonObj.StringIndent("", "  "))

...
```

Will print:

```
{
  "outter": {
    "inner": {
      "value": 10,
      "value2": 20
    },
    "inner2": {
      "value3": 30
    }
  }
}
```

###Generating Arrays

```go
...

jsonObj := gabs.New()

jsonObj.Array("foo", "array")
// Or .ArrayP("foo.array")

jsonObj.ArrayAppend(10, "foo", "array")
jsonObj.ArrayAppend(20, "foo", "array")
jsonObj.ArrayAppend(30, "foo", "array")

fmt.Println(jsonObj.String())

...
```

Will print:

```
{"foo":{"array":[10,20,30]}}
```

Working with arrays by index:

```go
...

jsonObj := gabs.New()

// Create an array with the length of 3
jsonObj.ArrayOfSize(3, "foo")

jsonObj.S("foo").SetIndex("test1", 0)
jsonObj.S("foo").SetIndex("test2", 1)

// Create an embedded array with the length of 3
jsonObj.S("foo").ArrayOfSizeI(3, 2)

jsonObj.S("foo").Index(2).SetIndex(1, 0)
jsonObj.S("foo").Index(2).SetIndex(2, 1)
jsonObj.S("foo").Index(2).SetIndex(3, 2)

fmt.Println(jsonObj.String())

...
```

Will print:

```
{"foo":["test1","test2",[1,2,3]]}
```

###Converting back to JSON

This is the easiest part:

```go
...

jsonParsedObj := gabs.ParseJSON([]byte(`{
	"outter":{
		"values":{
			"first":10,
			"second":11
		}
	},
	"outter2":"hello world"
}`))

jsonOutput := jsonParsedObj.String()
// Becomes `{"outter":{"values":{"first":10,"second":11}},"outter2":"hello world"}`

...
```

And to serialize a specific segment is as simple as:

```go
...

jsonParsedObj := gabs.ParseJSON([]byte(`{
	"outter":{
		"values":{
			"first":10,
			"second":11
		}
	},
	"outter2":"hello world"
}`))

jsonOutput := jsonParsedObj.Search("outter").String()
// Becomes `{"values":{"first":10,"second":11}}`

...
```


text:
class SlugFormatValidator < ActiveModel::EachValidator
  SLUG_REGEX = /\A[a-z0-9-]+\z/

  def validate_each(record, attr_name, value)
    return if value.blank?
    record.errors.add(attr_name, :slug_format, options) unless value =~ SLUG_REGEX
  end
end


text:
base::LazyInstance<chrome::ChromeContentBrowserClient>
    g_chrome_content_browser_client = LAZY_INSTANCE_INITIALIZER;
#endif

#if !defined(CHROME_MULTIPLE_DLL_BROWSER)
base::LazyInstance<ChromeContentRendererClient>
    g_chrome_content_renderer_client = LAZY_INSTANCE_INITIALIZER;
base::LazyInstance<chrome::ChromeContentUtilityClient>
    g_chrome_content_utility_client = LAZY_INSTANCE_INITIALIZER;
base::LazyInstance<chrome::ChromeContentPluginClient>
    g_chrome_content_plugin_client = LAZY_INSTANCE_INITIALIZER;
#endif

#if defined(OS_POSIX)
base::LazyInstance<chrome::ChromeBreakpadClient>::Leaky
    g_chrome_breakpad_client = LAZY_INSTANCE_INITIALIZER;
#endif

extern int NaClMain(const content::MainFunctionParams&);
extern int ServiceProcessMain(const content::MainFunctionParams&);

namespace {

#if defined(OS_WIN)
const wchar_t kProfilingDll[] = L"memory_watcher.dll";

// Load the memory profiling DLL.  All it needs to be activated
// is to be loaded.  Return true on success, false otherwise.
bool LoadMemoryProfiler() {
  HMODULE prof_module = LoadLibrary(kProfilingDll);
  return prof_module != NULL;
}

// Early versions of Chrome incorrectly registered a chromehtml: URL handler,
// which gives us nothing but trouble. Avoid launching chrome this way since
// some apps fail to properly escape arguments.
bool HasDeprecatedArguments(const std::wstring& command_line) {
  const wchar_t kChromeHtml[] = L"chromehtml:";
  std::wstring command_line_lower = command_line;
  // We are only searching for ASCII characters so this is OK.
  StringToLowerASCII(&command_line_lower);
  std::wstring::size_type pos = command_line_lower.find(kChromeHtml);
  return (pos != std::wstring::npos);
}

// If we try to access a path that is not currently available, we want the call
// to fail rather than show an error dialog.
void SuppressWindowsErrorDialogs() {
  UINT new_flags = SEM_FAILCRITICALERRORS |
                   SEM_NOOPENFILEERRORBOX;

  // Preserve existing error mode.
  UINT existing_flags = SetErrorMode(new_flags);
  SetErrorMode(existing_flags | new_flags);
}

#endif  // defined(OS_WIN)

#if defined(OS_LINUX)
static void AdjustLinuxOOMScore(const std::string& process_type) {
  // Browsers and zygotes should still be killable, but killed last.
  const int kZygoteScore = 0;
  // The minimum amount to bump a score by.  This is large enough that
  // even if it's translated into the old values, it will still go up
  // by at least one.
  const int kScoreBump = 100;
  // This is the lowest score that renderers and extensions start with
  // in the OomPriorityManager.
  const int kRendererScore = chrome::kLowestRendererOomScore;
  // For "miscellaneous" things, we want them after renderers,
  // but before plugins.
  const int kMiscScore = kRendererScore - kScoreBump;
  // We want plugins to die after the renderers.
  const int kPluginScore = kMiscScore - kScoreBump;
  int score = -1;

  DCHECK(kMiscScore > 0);
  DCHECK(kPluginScore > 0);

  if (process_type == switches::kPluginProcess ||
      process_type == switches::kPpapiPluginProcess) {
    score = kPluginScore;
  } else if (process_type == switches::kPpapiBrokerProcess) {
    // The broker should be killed before the PPAPI plugin.
    score = kPluginScore + kScoreBump;
  } else if (process_type == switches::kUtilityProcess ||
             process_type == switches::kWorkerProcess ||
             process_type == switches::kGpuProcess ||
             process_type == switches::kServiceProcess) {
    score = kMiscScore;
#ifndef DISABLE_NACL
  } else if (process_type == switches::kNaClLoaderProcess) {
    score = kPluginScore;
#endif
  } else if (process_type == switches::kZygoteProcess ||
             process_type.empty()) {
    // For zygotes and unlabeled process types, we want to still make
    // them killable by the OOM killer.
    score = kZygoteScore;
  } else if (process_type == switches::kRendererProcess) {
    LOG(WARNING) << "process type 'renderer' "
                 << "should be created through the zygote.";
    // When debugging, this process type can end up being run directly, but
    // this isn't the typical path for assigning the OOM score for it.  Still,
    // we want to assign a score that is somewhat representative for debugging.
    score = kRendererScore;
  } else {
    NOTREACHED() << "Unknown process type";
  }
  if (score > -1)
    base::AdjustOOMScore(base::GetCurrentProcId(), score);
}
#endif  // defined(OS_LINUX)

// Enable the heap profiler if the appropriate command-line switch is
// present, bailing out of the app we can't.
void EnableHeapProfiler(const CommandLine& command_line) {
#if defined(OS_WIN)
  if (command_line.HasSwitch(switches::kMemoryProfiling))
    if (!LoadMemoryProfiler())
      exit(-1);
#endif
}

// Returns true if this subprocess type needs the ResourceBundle initialized
// and resources loaded.
bool SubprocessNeedsResourceBundle(const std::string& process_type) {
  return
#if defined(OS_WIN) || defined(OS_MACOSX)
      // Windows needs resources for the default/null plugin.
      // Mac needs them for the plugin process name.
      process_type == switches::kPluginProcess ||
#endif
#if defined(OS_POSIX) && !defined(OS_MACOSX)
      // The zygote process opens the resources for the renderers.
      process_type == switches::kZygoteProcess ||
#endif
#if defined(OS_MACOSX)
      // Mac needs them too for scrollbar related images and for sandbox
      // profiles.
      process_type == switches::kWorkerProcess ||
      process_type == switches::kNaClLoaderProcess ||
      process_type == switches::kPpapiPluginProcess ||
      process_type == switches::kPpapiBrokerProcess ||
      process_type == switches::kGpuProcess ||
#endif
      process_type == switches::kRendererProcess ||
      process_type == switches::kUtilityProcess;
}

#if defined(OS_POSIX)
// Check for --version and --product-version; return true if we encountered
// one of these switches and should exit now.
bool HandleVersionSwitches(const CommandLine& command_line) {
  const chrome::VersionInfo version_info;

#if !defined(OS_MACOSX)
  if (command_line.HasSwitch(switches::kProductVersion)) {
    printf("%s\n", version_info.Version().c_str());
    return true;
  }
#endif

  if (command_line.HasSwitch(switches::kVersion)) {
    printf("%s %s %s\n",
           version_info.Name().c_str(),
           version_info.Version().c_str(),
           chrome::VersionInfo::GetVersionStringModifier().c_str());
    return true;
  }

  return false;
}

#if !defined(OS_MACOSX) && !defined(OS_CHROMEOS)
// Show the man page if --help or -h is on the command line.
void HandleHelpSwitches(const CommandLine& command_line) {
  if (command_line.HasSwitch(switches::kHelp) ||
      command_line.HasSwitch(switches::kHelpShort)) {
    base::FilePath binary(command_line.argv()[0]);
    execlp("man", "man", binary.BaseName().value().c_str(), NULL);
    PLOG(FATAL) << "execlp failed";
  }
}
#endif

#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
void SIGTERMProfilingShutdown(int signal) {
  Profiling::Stop();
  struct sigaction sigact;
  memset(&sigact, 0, sizeof(sigact));
  sigact.sa_handler = SIG_DFL;
  CHECK(sigaction(SIGTERM, &sigact, NULL) == 0);
  raise(signal);
}

void SetUpProfilingShutdownHandler() {
  struct sigaction sigact;
  sigact.sa_handler = SIGTERMProfilingShutdown;
  sigact.sa_flags = SA_RESETHAND;
  sigemptyset(&sigact.sa_mask);
  CHECK(sigaction(SIGTERM, &sigact, NULL) == 0);
}
#endif  // !defined(OS_MACOSX) && !defined(OS_ANDROID)

#endif  // OS_POSIX

struct MainFunction {
  const char* name;
  int (*function)(const content::MainFunctionParams&);
};

}  // namespace

ChromeMainDelegate::ChromeMainDelegate() {
#if defined(OS_ANDROID)
// On Android the main entry point time is the time when the Java code starts.
// This happens before the shared library containing this code is even loaded.
// The Java startup code has recorded that time, but the C++ code can't fetch it
// from the Java side until it has initialized the JNI. See
// ChromeMainDelegateAndroid.
#else
  startup_metric_utils::RecordMainEntryPointTime();
#endif
}

ChromeMainDelegate::~ChromeMainDelegate() {
}

bool ChromeMainDelegate::BasicStartupComplete(int* exit_code) {
#if defined(OS_CHROMEOS)
  chromeos::BootTimesLoader::Get()->SaveChromeMainStats();
#endif

  const CommandLine& command_line = *CommandLine::ForCurrentProcess();

#if defined(OS_MACOSX)
  // Give the browser process a longer treadmill, since crashes
  // there have more impact.
  const bool is_browser = !command_line.HasSwitch(switches::kProcessType);
  ObjcEvilDoers::ZombieEnable(true, is_browser ? 10000 : 1000);

  SetUpBundleOverrides();
  chrome::common::mac::EnableCFBundleBlocker();
#endif

  Profiling::ProcessStarted();

#if defined(OS_POSIX)
  if (HandleVersionSwitches(command_line)) {
    *exit_code = 0;
    return true;  // Got a --version switch; exit with a success error code.
  }
#if !defined(OS_MACOSX) && !defined(OS_CHROMEOS)
  // This will directly exit if the user asked for help.
  HandleHelpSwitches(command_line);
#endif
#endif  // OS_POSIX

#if defined(OS_WIN)
  // Must do this before any other usage of command line!
  if (HasDeprecatedArguments(command_line.GetCommandLineString())) {
    *exit_code = 1;
    return true;
  }
#endif

  chrome::RegisterPathProvider();
#if defined(OS_CHROMEOS)
  chromeos::RegisterPathProvider();
#endif
#if !defined(DISABLE_NACL) && defined(OS_LINUX)
  nacl::RegisterPathProvider();
#endif

// No support for ANDROID yet as DiagnosticsController needs wchar support.
// TODO(gspencer): That's not true anymore, or at least there are no w-string
// references anymore. Not sure if that means this can be enabled on Android or
// not though.  As there is no easily accessible command line on Android, I'm
// not sure this is a big deal.
#if !defined(OS_ANDROID) && !defined(CHROME_MULTIPLE_DLL_CHILD)
  // If we are in diagnostics mode this is the end of the line: after the
  // diagnostics are run the process will invariably exit.
  if (command_line.HasSwitch(switches::kDiagnostics)) {
    diagnostics::DiagnosticsWriter::FormatType format =
        diagnostics::DiagnosticsWriter::HUMAN;
    if (command_line.HasSwitch(switches::kDiagnosticsFormat)) {
      std::string format_str =
          command_line.GetSwitchValueASCII(switches::kDiagnosticsFormat);
      if (format_str == "machine") {
        format = diagnostics::DiagnosticsWriter::MACHINE;
      } else if (format_str == "log") {
        format = diagnostics::DiagnosticsWriter::LOG;
      } else {
        DCHECK_EQ("human", format_str);
      }
    }

    diagnostics::DiagnosticsWriter writer(format);
    *exit_code = diagnostics::DiagnosticsController::GetInstance()->Run(
        command_line, &writer);
    diagnostics::DiagnosticsController::GetInstance()->ClearResults();
    return true;
  }
#endif

#if defined(OS_CHROMEOS)
  // If we are recovering from a crash on ChromeOS, then we will do some
  // recovery using the diagnostics module, and then continue on. We fake up a
  // command line to tell it that we want it to recover, and to preserve the
  // original command line.
  if (command_line.HasSwitch(chromeos::switches::kLoginUser) ||
      command_line.HasSwitch(switches::kDiagnosticsRecovery)) {

    // The statistics subsystem needs get initialized soon enough for the
    // statistics to be collected.  It's safe to call this more than once.
    base::StatisticsRecorder::Initialize();

    CommandLine interim_command_line(command_line.GetProgram());
    const char* kSwitchNames[] = {switches::kUserDataDir, };
    interim_command_line.CopySwitchesFrom(
        command_line, kSwitchNames, arraysize(kSwitchNames));
    interim_command_line.AppendSwitch(switches::kDiagnostics);
    interim_command_line.AppendSwitch(switches::kDiagnosticsRecovery);

    diagnostics::DiagnosticsWriter::FormatType format =
        diagnostics::DiagnosticsWriter::LOG;
    if (command_line.HasSwitch(switches::kDiagnosticsFormat)) {
      std::string format_str =
          command_line.GetSwitchValueASCII(switches::kDiagnosticsFormat);
      if (format_str == "machine") {
        format = diagnostics::DiagnosticsWriter::MACHINE;
      } else if (format_str == "human") {
        format = diagnostics::DiagnosticsWriter::HUMAN;
      } else {
        DCHECK_EQ("log", format_str);
      }
    }

    diagnostics::DiagnosticsWriter writer(format);
    int diagnostics_exit_code =
        diagnostics::DiagnosticsController::GetInstance()->Run(command_line,
                                                               &writer);
    if (diagnostics_exit_code) {
      // Diagnostics has failed somehow, so we exit.
      *exit_code = diagnostics_exit_code;
      return true;
    }

    // Now we run the actual recovery tasks.
    int recovery_exit_code =
        diagnostics::DiagnosticsController::GetInstance()->RunRecovery(
            command_line, &writer);

    if (recovery_exit_code) {
      // Recovery has failed somehow, so we exit.
      *exit_code = recovery_exit_code;
      return true;
    }
  } else {  // Not running diagnostics or recovery.
    diagnostics::DiagnosticsController::GetInstance()->RecordRegularStartup();
  }
#endif

  content::SetContentClient(&chrome_content_client_);

  return false;
}

#if defined(OS_MACOSX)
void ChromeMainDelegate::InitMacCrashReporter(const CommandLine& command_line,
                                              const std::string& process_type) {
  // TODO(mark): Right now, InitCrashReporter() needs to be called after
  // CommandLine::Init() and chrome::RegisterPathProvider().  Ideally,
  // Breakpad initialization could occur sooner, preferably even before the
  // framework dylib is even loaded, to catch potential early crashes.
  breakpad::InitCrashReporter(process_type);

#if defined(NDEBUG)
  bool is_debug_build = false;
#else
  bool is_debug_build = true;
#endif

  // Details on when we enable Apple's Crash reporter.
  //
  // Motivation:
  //    In debug mode it takes Apple's crash reporter eons to generate a crash
  // dump.
  //
  // What we do:
  // * We only pass crashes for foreground processes to Apple's Crash
  //    reporter. At the time of this writing, that means just the Browser
  //    process.
  // * If Breakpad is enabled, it will pass browser crashes to Crash Reporter
  //    itself.
  // * If Breakpad is disabled, we only turn on Crash Reporter for the
  //    Browser process in release mode.
  if (!command_line.HasSwitch(switches::kDisableBreakpad)) {
    bool disable_apple_crash_reporter = is_debug_build ||
        base::mac::IsBackgroundOnlyProcess();
    if (!breakpad::IsCrashReporterEnabled() && disable_apple_crash_reporter) {
      base::mac::DisableOSCrashDumps();
    }
  }

  // Mac Chrome is packaged with a main app bundle and a helper app bundle.
  // The main app bundle should only be used for the browser process, so it
  // should never see a --type switch (switches::kProcessType).  Likewise,
  // the helper should always have a --type switch.
  //
  // This check is done this late so there is already a call to
  // base::mac::IsBackgroundOnlyProcess(), so there is no change in
  // startup/initialization order.

  // The helper's Info.plist marks it as a background only app.
  if (base::mac::IsBackgroundOnlyProcess()) {
    CHECK(command_line.HasSwitch(switches::kProcessType) &&
          !process_type.empty())
        << "Helper application requires --type.";

    // In addition, some helper flavors only work with certain process types.
    base::FilePath executable;
    if (PathService::Get(base::FILE_EXE, &executable) &&
        executable.value().size() >= 3) {
      std::string last_three =
          executable.value().substr(executable.value().size() - 3);

      if (last_three == " EH") {
        CHECK(process_type == switches::kPluginProcess ||
              process_type == switches::kUtilityProcess)
            << "Executable-heap process requires --type="
            << switches::kPluginProcess << " or "
            << switches::kUtilityProcess << ", saw " << process_type;
      } else if (last_three == " NP") {
        CHECK_EQ(switches::kNaClLoaderProcess, process_type)
            << "Non-PIE process requires --type="
            << switches::kNaClLoaderProcess << ", saw " << process_type;
      } else {
        CHECK(process_type != switches::kPluginProcess &&
              process_type != switches::kNaClLoaderProcess)
            << "Non-executable-heap PIE process is intolerant of --type="
            << switches::kPluginProcess << " and "
            << switches::kNaClLoaderProcess << ", saw " << process_type;
      }
    }
  } else {
    CHECK(!command_line.HasSwitch(switches::kProcessType) &&
          process_type.empty())
        << "Main application forbids --type, saw " << process_type;
  }

  if (breakpad::IsCrashReporterEnabled())
    breakpad::InitCrashProcessInfo(process_type);
}
#endif  // defined(OS_MACOSX)

void ChromeMainDelegate::PreSandboxStartup() {
  const CommandLine& command_line = *CommandLine::ForCurrentProcess();
  std::string process_type =
      command_line.GetSwitchValueASCII(switches::kProcessType);

#if defined(OS_POSIX)
  breakpad::SetBreakpadClient(g_chrome_breakpad_client.Pointer());
#endif

#if defined(OS_MACOSX)
  // On the Mac, the child executable lives at a predefined location within
  // the app bundle's versioned directory.
  PathService::Override(content::CHILD_PROCESS_EXE,
                        chrome::GetVersionedDirectory().
                        Append(chrome::kHelperProcessExecutablePath));

  InitMacCrashReporter(command_line, process_type);
#endif

#if defined(OS_WIN)
  child_process_logging::Init();
#endif

  // Notice a user data directory override if any
  base::FilePath user_data_dir =
      command_line.GetSwitchValuePath(switches::kUserDataDir);
#if defined(OS_LINUX)
  // On Linux, Chrome does not support running multiple copies under different
  // DISPLAYs, so the profile directory can be specified in the environment to
  // support the virtual desktop use-case.
  if (user_data_dir.empty()) {
    std::string user_data_dir_string;
    scoped_ptr<base::Environment> environment(base::Environment::Create());
    if (environment->GetVar("CHROME_USER_DATA_DIR", &user_data_dir_string) &&
        IsStringUTF8(user_data_dir_string)) {
      user_data_dir = base::FilePath::FromUTF8Unsafe(user_data_dir_string);
    }
  }
#endif
#if defined(OS_MACOSX) || defined(OS_WIN)
  policy::path_parser::CheckUserDataDirPolicy(&user_data_dir);
#endif
  if (!user_data_dir.empty()) {
    CHECK(PathService::OverrideAndCreateIfNeeded(
        chrome::DIR_USER_DATA,
        user_data_dir,
        chrome::ProcessNeedsProfileDir(process_type)));
  }

  stats_counter_timer_.reset(new base::StatsCounterTimer("Chrome.Init"));
  startup_timer_.reset(new base::StatsScope<base::StatsCounterTimer>
                       (*stats_counter_timer_));

  // Enable the heap profiler as early as possible!
  EnableHeapProfiler(command_line);

  // Enable Message Loop related state asap.
  if (command_line.HasSwitch(switches::kMessageLoopHistogrammer))
    base::MessageLoop::EnableHistogrammer(true);

#if !defined(OS_ANDROID)
  // Android does InitLogging when library is loaded. Skip here.
  logging::OldFileDeletionState file_state =
      logging::APPEND_TO_OLD_LOG_FILE;
  if (process_type.empty()) {
    file_state = logging::DELETE_OLD_LOG_FILE;
  }
  logging::InitChromeLogging(command_line, file_state);
#endif

#if defined(OS_WIN)
  // TODO(darin): Kill this once http://crbug.com/52609 is fixed.
  ui::SetResourcesDataDLL(_AtlBaseModule.GetResourceInstance());
#endif

  if (SubprocessNeedsResourceBundle(process_type)) {
    // Initialize ResourceBundle which handles files loaded from external
    // sources.  The language should have been passed in to us from the
    // browser process as a command line flag.
#if defined(DISABLE_NACL)
    DCHECK(command_line.HasSwitch(switches::kLang) ||
           process_type == switches::kZygoteProcess ||
           process_type == switches::kGpuProcess ||
           process_type == switches::kPpapiBrokerProcess ||
           process_type == switches::kPpapiPluginProcess);
#else
    DCHECK(command_line.HasSwitch(switches::kLang) ||
           process_type == switches::kZygoteProcess ||
           process_type == switches::kGpuProcess ||
           process_type == switches::kNaClLoaderProcess ||
           process_type == switches::kPpapiBrokerProcess ||
           process_type == switches::kPpapiPluginProcess);
#endif

    // TODO(markusheintz): The command line flag --lang is actually processed
    // by the CommandLinePrefStore, and made available through the PrefService
    // via the preference prefs::kApplicationLocale. The browser process uses
    // the --lang flag to pass the value of the PrefService in here. Maybe
    // this value could be passed in a different way.
    const std::string locale =
        command_line.GetSwitchValueASCII(switches::kLang);
#if defined(OS_ANDROID)
    // The renderer sandbox prevents us from accessing our .pak files directly.
    // Therefore file descriptors to the .pak files that we need are passed in
    // at process creation time.
    int locale_pak_fd = base::GlobalDescriptors::GetInstance()->MaybeGet(
        kAndroidLocalePakDescriptor);
    CHECK(locale_pak_fd != -1);
    ResourceBundle::InitSharedInstanceWithPakFile(locale_pak_fd, false);

    int extra_pak_keys[] = {
      kAndroidChrome100PercentPakDescriptor,
      kAndroidUIResourcesPakDescriptor,
    };
    for (size_t i = 0; i < arraysize(extra_pak_keys); ++i) {
      int pak_fd =
          base::GlobalDescriptors::GetInstance()->MaybeGet(extra_pak_keys[i]);
      CHECK(pak_fd != -1);
      ResourceBundle::GetSharedInstance().AddDataPackFromFile(
          pak_fd, ui::SCALE_FACTOR_100P);
    }

    base::i18n::SetICUDefaultLocale(locale);
    const std::string loaded_locale = locale;
#else
    const std::string loaded_locale =
        ResourceBundle::InitSharedInstanceWithLocale(locale, NULL);

    base::FilePath resources_pack_path;
    PathService::Get(chrome::FILE_RESOURCES_PACK, &resources_pack_path);
    ResourceBundle::GetSharedInstance().AddDataPackFromPath(
        resources_pack_path, ui::SCALE_FACTOR_NONE);
#endif
    CHECK(!loaded_locale.empty()) << "Locale could not be found for " <<
        locale;

#if !defined(CHROME_MULTIPLE_DLL_BROWSER)
    if (process_type == switches::kUtilityProcess ||
        process_type == switches::kZygoteProcess) {
      chrome::ChromeContentUtilityClient::PreSandboxStartup();
    }
#endif
  }

#if defined(OS_POSIX) && !defined(OS_MACOSX)
  // Zygote needs to call InitCrashReporter() in RunZygote().
  if (process_type != switches::kZygoteProcess) {
#if defined(OS_ANDROID)
    if (process_type.empty())
      breakpad::InitCrashReporter(process_type);
    else
      breakpad::InitNonBrowserCrashReporterForAndroid(process_type);
#else  // !defined(OS_ANDROID)
    breakpad::InitCrashReporter(process_type);
#endif  // defined(OS_ANDROID)
  }
#endif  // defined(OS_POSIX) && !defined(OS_MACOSX)

  // After all the platform Breakpads have been initialized, store the command
  // line for crash reporting.
  crash_keys::SetSwitchesFromCommandLine(&command_line);
}

void ChromeMainDelegate::SandboxInitialized(const std::string& process_type) {
  startup_timer_->Stop();  // End of Startup Time Measurement.

  // Note: If you are adding a new process type below, be sure to adjust the
  // AdjustLinuxOOMScore function too.
#if defined(OS_LINUX)
  AdjustLinuxOOMScore(process_type);
#endif
#if defined(OS_WIN)
  SuppressWindowsErrorDialogs();
#endif
}

int ChromeMainDelegate::RunProcess(
    const std::string& process_type,
    const content::MainFunctionParams& main_function_params) {
  // ANDROID doesn't support "service", so no ServiceProcessMain, and arraysize
  // doesn't support empty array. So we comment out the block for Android.
#if !defined(OS_ANDROID)
  static const MainFunction kMainFunctions[] = {
#if defined(ENABLE_FULL_PRINTING) && !defined(CHROME_MULTIPLE_DLL_CHILD)
    { switches::kServiceProcess,     ServiceProcessMain },
#endif

#if defined(OS_MACOSX)
    { switches::kRelauncherProcess,
      mac_relauncher::internal::RelauncherMain },
#endif

    // This entry is not needed on Linux, where the NaCl loader
    // process is launched via nacl_helper instead.
#if !defined(DISABLE_NACL) && !defined(CHROME_MULTIPLE_DLL_BROWSER) && \
    !defined(OS_LINUX)
    { switches::kNaClLoaderProcess,  NaClMain },
#else
    { "<invalid>", NULL },  // To avoid constant array of size 0
                            // when DISABLE_NACL and CHROME_MULTIPLE_DLL_CHILD
#endif  // DISABLE_NACL
  };

  for (size_t i = 0; i < arraysize(kMainFunctions); ++i) {
    if (process_type == kMainFunctions[i].name)
      return kMainFunctions[i].function(main_function_params);
  }
#endif

  return -1;
}

void ChromeMainDelegate::ProcessExiting(const std::string& process_type) {
  if (SubprocessNeedsResourceBundle(process_type))
    ResourceBundle::CleanupSharedInstance();
#if !defined(OS_ANDROID)
  logging::CleanupChromeLogging();
#else
  // Android doesn't use InitChromeLogging, so we close the log file manually.
  logging::CloseLogFile();
#endif  // !defined(OS_ANDROID)
}

#if defined(OS_MACOSX)
bool ChromeMainDelegate::ProcessRegistersWithSystemProcess(
    const std::string& process_type) {
  return process_type == switches::kNaClLoaderProcess;
}

bool ChromeMainDelegate::ShouldSendMachPort(const std::string& process_type) {
  return process_type != switches::kRelauncherProcess &&
      process_type != switches::kServiceProcess;
}

bool ChromeMainDelegate::DelaySandboxInitialization(
    const std::string& process_type) {
  // NaClLoader does this in NaClMainPlatformDelegate::EnableSandbox().
  // No sandbox needed for relauncher.
  return process_type == switches::kNaClLoaderProcess ||
      process_type == switches::kRelauncherProcess;
}
#elif defined(OS_POSIX) && !defined(OS_ANDROID)
content::ZygoteForkDelegate* ChromeMainDelegate::ZygoteStarting() {
#if defined(DISABLE_NACL)
  return NULL;
#else
  return new NaClForkDelegate();
#endif
}

void ChromeMainDelegate::ZygoteForked() {
  Profiling::ProcessStarted();
  if (Profiling::BeingProfiled()) {
    base::debug::RestartProfilingAfterFork();
    SetUpProfilingShutdownHandler();
  }

  // Needs to be called after we have chrome::DIR_USER_DATA.  BrowserMain sets
  // this up for the browser process in a different manner.
  const CommandLine* command_line = CommandLine::ForCurrentProcess();
  std::string process_type =
      command_line->GetSwitchValueASCII(switches::kProcessType);
  breakpad::InitCrashReporter(process_type);

  // Reset the command line for the newly spawned process.
  crash_keys::SetSwitchesFromCommandLine(command_line);
}

#endif  // OS_MACOSX

content::ContentBrowserClient*
ChromeMainDelegate::CreateContentBrowserClient() {
#if defined(CHROME_MULTIPLE_DLL_CHILD)
  return NULL;
#else
  return &g_chrome_content_browser_client.Get();
#endif
}

content::ContentPluginClient* ChromeMainDelegate::CreateContentPluginClient() {
#if defined(CHROME_MULTIPLE_DLL_BROWSER)
  return NULL;
#else
  return &g_chrome_content_plugin_client.Get();
#endif
}

content::ContentRendererClient*
ChromeMainDelegate::CreateContentRendererClient() {
#if defined(CHROME_MULTIPLE_DLL_BROWSER)
  return NULL;
#else
  return &g_chrome_content_renderer_client.Get();
#endif
}

content::ContentUtilityClient*
ChromeMainDelegate::CreateContentUtilityClient() {
#if defined(CHROME_MULTIPLE_DLL_BROWSER)
  return NULL;
#else
  return &g_chrome_content_utility_client.Get();
#endif
}


text:
<?= t('Password Reset') ?>

    <form method="post" action="<?= $this->url->href('PasswordResetController', 'save') ?>">
        <?= $this->form->csrf() ?>

        <?= $this->form->label(t('Username'), 'username') ?>
        <?= $this->form->text('username', $values, $errors, array('autofocus', 'required')) ?>

<?= t('Your profile must have a valid email address.') ?>

        <?= $this->form->label(t('Enter the text below'), 'captcha') ?>
        <img src="<?= $this->url->href('CaptchaController', 'image') ?>" alt="Captcha">
        <?= $this->form->text('captcha', array(), $errors, array('required')) ?>

            <button type="submit" class="btn btn-blue"><?= t('Change Password') ?></button>

    </form>


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

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.7"/>
<title>ImGraph: charliesoft::ParamValidator Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

ImGraph

Main Page

Related Pages

Classes

Files

          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)"
               onblur="searchBox.OnSearchFieldFocus(false)"
               onkeyup="searchBox.OnSearchFieldChange(event)"/>

Class List

Class Index

Class Hierarchy

Class Members

 All Classes Functions Variables Enumerations Pages

Public Member Functions |
Protected Attributes |
List of all members

charliesoft::ParamValidator Class Referenceabstract

Inheritance diagram for charliesoft::ParamValidator:

  <map id="charliesoft::ParamValidator_map" name="charliesoft::ParamValidator_map">
<area href="classcharliesoft_1_1_file_is_folder.html" alt="charliesoft::FileIsFolder" shape="rect" coords="0,56,164,80"/>
<area href="classcharliesoft_1_1_val_exclusif.html" alt="charliesoft::ValExclusif" shape="rect" coords="174,56,338,80"/>
<area href="classcharliesoft_1_1_val_file_exist.html" alt="charliesoft::ValFileExist" shape="rect" coords="348,56,512,80"/>
<area href="classcharliesoft_1_1_val_needed.html" alt="charliesoft::ValNeeded" shape="rect" coords="522,56,686,80"/>
<area href="classcharliesoft_1_1_val_negativ.html" alt="charliesoft::ValNegativ" shape="rect" coords="696,56,860,80"/>
<area href="classcharliesoft_1_1_val_positiv.html" alt="charliesoft::ValPositiv" shape="rect" coords="870,56,1034,80"/>
<area href="classcharliesoft_1_1_val_range.html" alt="charliesoft::ValRange" shape="rect" coords="1044,56,1208,80"/>
</map>

Public Member Functions

void 	setParamOrigin (const ParamValue *p)

virtual void 	validate (const ParamValue &value)=0

Protected Attributes

const ParamValue * 	paramToValid_

The documentation for this class was generated from the following file:

D:/Travail/ProjetPerso/imGraph/Sources/blocks/ParamValidator.h

charliesoft

ParamValidator

Generated on Fri Mar 20 2015 23:27:11 for ImGraph by

     1.8.7


text:
Manual Storyboard
=================

How to instantiate Storyboards programatically. This is the finished application from the [Instantiate Storyboards Manually](http://docs.xamarin.com/guides/ios/user_interface/introduction_to_storyboards/#Instantiate_Storyboards_Manually) section of the Introduction to Storyboards document.

It also includes a sample detailing how to create conditional segues.


text:
using UnityEngine;
using System.Collections;

public class MainMenuSelector : MonoBehaviour {

	public bool isPlay = false;
	public bool isHowToPlay = false;
	public bool isCredits = false;
	public bool isQuit = false;

	private Color32 colorbase;

	void Start () {
		colorbase.r = 97;
		colorbase.g = 105;
		colorbase.b = 176;
		colorbase.a = 255;
	}

	void OnMouseEnter () {
		//change text color
		guiText.color = Color.red;
	}

	void OnMouseExit () {
		//change text color
		guiText.color = colorbase;
	}

	void OnMouseUp () {

		if (isPlay == true) {
			// load level 1
			Application.LoadLevel("Level 1");
		}
		else if (isHowToPlay == true) {
			// load how to play screen
			Application.LoadLevel("How To Play");
		}
		else if (isCredits == true) {
			// load credits screen
			Application.LoadLevel("Credits");
		}
		else if (isQuit==true) {
			//quit the game
			Application.Quit();
		}
	}
}


text:
/*	Public domain	*/

#ifndef _AGAR_CORE_NET_CLIENT_H_
#define _AGAR_CORE_NET_CLIENT_H_
#include <agar/core/begin.h>

#define NC_HOSTNAME_MAX	256
#define NC_PORTNUM_MAX	16
#define NC_USERNAME_MAX	48
#define NC_PASSWORD_MAX	64

typedef struct nc_session {
	const char *name;
	char host[NC_HOSTNAME_MAX];
	char port[NC_PORTNUM_MAX];
	char user[NC_USERNAME_MAX];
	char pass[NC_PASSWORD_MAX];
	int sock;
	struct {
		char *buf;
		size_t len;
		size_t maxlen;
	} read;
	char server_proto[32];
	char client_proto[32];
} NC_Session;

typedef struct nc_result {
	unsigned int argc;
	char	**argv;
	size_t	 *argv_len;
} NC_Result;

__BEGIN_DECLS
void       	 NC_InitSubsystem(Uint);
void	 	 NC_Init(NC_Session *, const char *, const char *);
void		 NC_Destroy(NC_Session *);
int		 NC_Connect(NC_Session *, const char *, const char *,
		             const char *, const char *);
int		 NC_Reconnect(NC_Session *);
void	 	 NC_Disconnect(NC_Session *);
long		 NC_Read(NC_Session *, size_t);
long		 NC_ReadBinary(NC_Session *, size_t);
int		 NC_Write(NC_Session *, const char *, ...);
NC_Result	*NC_Query(NC_Session *, const char *, ...);
NC_Result	*NC_QueryBinary(NC_Session *, const char *, ...);
void		 NC_FreeResult(NC_Result *);
__END_DECLS

#include <agar/core/close.h>
#endif /* _AGAR_CORE_NET_CLIENT_H_ */


text:
package at.newmedialab.lmf.util.solr.suggestion.params;

/**
 * ...
 * <p/>
 * Author: Thomas Kurz (tkurz@apache.org)
 */
public class SuggestionResultParams {

    public static final String SUGGESTIONS = "suggestions";
    public static final String SUGGESTION_COUNT = "suggestion_count";
    public static final String SUGGESTION_FACETS = "suggestion_facets";

}