text:
package net.gility.okweather.ui.fragment;

import android.app.Dialog;
import android.app.DialogFragment;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.hwangjr.rxbus.Bus;

import net.gility.okweather.R;
import net.gility.okweather.dagger.Injector;
import net.gility.okweather.model.BusAction;
import net.gility.okweather.storage.Preferences;
import net.gility.okweather.ui.cell.IconDialogCell;

import javax.inject.Inject;

/**
 * @author Alimy
 */

public class IconDialogFragment extends DialogFragment {
    @Inject Preferences mPreferences;
    @Inject Bus mBus;

    public static IconDialogFragment instance() {
        return new IconDialogFragment();
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Injector.instance.inject(this);
    }

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

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        super.onCreateDialog(savedInstanceState);

        LayoutInflater inflater = LayoutInflater.from(getActivity());
        IconDialogCell iconDialogCell = (IconDialogCell) inflater.inflate(R.layout.cell_dialog_icon, (ViewGroup) getActivity().findViewById(R.id.dialog_root));
        iconDialogCell.checkType(mPreferences.getIconType());
        iconDialogCell.setOnDoneClickListenner(new IconDialogCell.OnDoneClickListenner() {
            @Override
            public void onDoneClickListenner(View view, int type) {
                switch (type) {
                    case IconDialogCell.TYPE_ONE:
                        mPreferences.begin()
                                .putInt("未知", R.mipmap.none)
                                .putInt("晴", R.mipmap.type_one_sunny)
                                .putInt("阴", R.mipmap.type_one_cloudy)
                                .putInt("多云", R.mipmap.type_one_cloudy)
                                .putInt("少云", R.mipmap.type_one_cloudy)
                                .putInt("晴间多云", R.mipmap.type_one_cloudytosunny)
                                .putInt("小雨", R.mipmap.type_one_light_rain)
                                .putInt("中雨", R.mipmap.type_one_light_rain)
                                .putInt("大雨", R.mipmap.type_one_heavy_rain)
                                .putInt("阵雨", R.mipmap.type_one_thunderstorm)
                                .putInt("雷阵雨", R.mipmap.type_one_thunder_rain)
                                .putInt("霾", R.mipmap.type_one_fog)
                                .putInt("雾", R.mipmap.type_one_fog)
                                .apply();
                        break;
                    case IconDialogCell.TYPE_TWO:
                        mPreferences.begin()
                                .putInt("未知", R.mipmap.none)
                                .putInt("晴", R.mipmap.type_two_sunny)
                                .putInt("阴", R.mipmap.type_two_cloudy)
                                .putInt("多云", R.mipmap.type_two_cloudy)
                                .putInt("少云", R.mipmap.type_two_cloudy)
                                .putInt("晴间多云", R.mipmap.type_two_cloudytosunny)
                                .putInt("小雨", R.mipmap.type_two_light_rain)
                                .putInt("中雨", R.mipmap.type_two_rain)
                                .putInt("大雨", R.mipmap.type_two_rain)
                                .putInt("阵雨", R.mipmap.type_two_rain)
                                .putInt("雷阵雨", R.mipmap.type_two_thunderstorm)
                                .putInt("霾", R.mipmap.type_two_haze)
                                .putInt("雾", R.mipmap.type_two_fog)
                                .putInt("雨夹雪", R.mipmap.type_two_snowrain)
                                .apply();
                        break;
                }

                mPreferences.setIconType(type);
                mBus.post(BusAction.CHANGE_ICONS_TYPE, type);
                IconDialogFragment.this.dismiss();
            }
        });
        AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()).setView(iconDialogCell);
        return builder.create();
    }
}


text: search_result['878']=["topic_00000000000001F4.html","PaymentsController Class",""];

redpajama_set_name: RedPajamaGithub


text:
<?php namespace App;

use Illuminate\Database\Eloquent\Model;

class Customer extends Model {

	protected $fillable = [
        'name',
        'logo',
        'description',
        'casehistory',
        'web'
    ];

    /**
     * Get the services associates that given customer
     *
     * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
     */
    public function services()
    {
        return $this->belongsToMany('App\Service');
    }

    /**
     * A customer can have many slides.
     *
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function slides(){
        return $this->hasMany('App\Slide');
    }

    /**
     * Get a list of the services associates with the current customer.
     *
     * @return array
     */
    public function getServiceListAttribute(){

        return $this->services->lists('id');

    }

}


text:
@implementation WBSOperationBar

- (id)init
{
    self = [super init];
    if (self) {
        self.backgroundColor = [UIColor grayColor];

        [self setLayout];
        [self addBorder];
    }

    return self;
}

- (void)setLayout
{
    NSMutableArray *items = [[NSMutableArray alloc]init];
    NSArray *images    = @[@"toolbar-keyboardUp", @"toolbar-separatorline", @"toolbar-comments", @"toolbar-editingComment", @"toolbar-star", @"toolbar-share", @"toolbar-report"];
    NSArray *selectors = @[@"switchMode:", @"", @"showComments:", @"editComment:", @"toggleStar:", @"share:", @"report:"];

    [images enumerateObjectsUsingBlock:^(NSString *imageName, NSUInteger idx, BOOL *stop) {
        UIImage *image = [UIImage imageNamed:imageName];
        if (idx != 1) {
            UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
            [button addTarget:self action:NSSelectorFromString(selectors[idx]) forControlEvents:UIControlEventTouchUpInside];
            button.frame = CGRectMake(0, 0, image.size.width, image.size.height);
            [button setBackgroundImage:image forState:UIControlStateNormal];

            UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithCustomView:button];

            ((WBSBlogAppDelegate *)[UIApplication sharedApplication].delegate).inNightMode = [WBSConfig getMode];
            if (((WBSBlogAppDelegate *)[UIApplication sharedApplication].delegate).inNightMode) {
                self.barTintColor = [UIColor colorWithRed:22.0/255 green:22.0/255 blue:22.0/255 alpha:1.0];
                barButton.tintColor = [UIColor clearColor];
            } else {
                self.barTintColor = [UIColor colorWithRed:246.0/255 green:246.0/255 blue:246.0/255 alpha:1.0];
                barButton.tintColor = [UIColor clearColor];
            }

            [items addObject:barButton];
        } else {
            UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
            UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithCustomView:imageView];
            [items addObject:barButton];
        }

        if (idx == 0) {
            UIBarButtonItem *fixedSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil];
            fixedSpace.width = 5;
            [items addObject:fixedSpace];
        } else {
            [items addObject:[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil]];
        }

    }];

    [self setItems:items];
}

- (void)setIsStarred:(BOOL)isStarred
{
    UIBarButtonItem *starBarButton = self.items[8];
    UIButton *starButton = (UIButton *)starBarButton.customView;

    if (isStarred) {
        [starButton setImage:[UIImage imageNamed:@"toolbar-starred"] forState:UIControlStateNormal];
    } else {
        [starButton setImage:[UIImage imageNamed:@"toolbar-star"] forState:UIControlStateNormal];
    }

    _isStarred = isStarred;
}

- (void)switchMode:(id)sender
{
    if (_switchMode) {_switchMode();}
}

- (void)showComments:(id)sender
{
    if (_showComments) {_showComments();}
}

- (void)editComment:(id)sender
{
    if (_editComment) {_editComment();}
}

- (void)toggleStar:(id)sender
{
    if (_toggleStar) {_toggleStar();}
}

- (void)share:(id)sender
{
    if (_share) {_share();}
}

- (void)report:(id)sender
{
    if (_report) {_report();}
}

- (void)addBorder
{
    UIView *upperBorder = [[UIView alloc]init];
    upperBorder.backgroundColor = [UIColor lightGrayColor];
    upperBorder.translatesAutoresizingMaskIntoConstraints = NO;
    [self addSubview:upperBorder];

    UIView *bottomBorder = [[UIView alloc]init];
    bottomBorder.backgroundColor = [UIColor lightGrayColor];
    bottomBorder.translatesAutoresizingMaskIntoConstraints = NO;
    [self addSubview:bottomBorder];

    NSDictionary *views = NSDictionaryOfVariableBindings(upperBorder, bottomBorder);

    [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"|[upperBorder]|" options:0 metrics:nil views:views]];
    [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[upperBorder(0.5)]->=0-[bottomBorder(0.5)]|"
                                                                 options:NSLayoutFormatAlignAllLeft | NSLayoutFormatAlignAllRight
                                                                 metrics:nil views:views]];
}

@end


text:
var Metalsmith = require('metalsmith'),
  drafts = require('metalsmith-drafts'),
  layouts = require('metalsmith-layouts'),
  markdown = require('metalsmith-markdown'),
  assets = require('metalsmith-assets'),
  collections = require('metalsmith-collections'),
  autotoc = require('metalsmith-autotoc'),
  argv = require('minimist')(process.argv);
var serve = require('metalsmith-serve');
var watch = require('metalsmith-watch');
var sass = require('metalsmith-sass');
const hljs = require('highlight.js');
const marked = require('marked');

var renderer = new marked.Renderer();

renderer.code = function (code, infostring, escaped) {
  /**  Copied from the default implementation, with the following changes.
   * 1. Find a series of 4 spaces and convert it into tabs
   * 2. Add "hljs" to the code class. I don't get why, but metalsmith-metallic was doing this, so I copied the pattern.
   * 3. Remove this.options.langPrefix, because metalsmith-metallic didn't have this.
   */
  code = code.replace(/ {4}/g, '\t'); // Convert spaces back into tabs
  var lang = (infostring || '').match(/\S*/)[0];
  if (this.options.highlight) {
    var out = this.options.highlight(code, lang);
    if (out != null && out !== code) {
      escaped = true;
      code = out;
    }
  }

  if (!lang) {
    return '
' + (escaped ? code : escape(code, true)) + '
';
  }

  return (
    '
' +
    (escaped ? code : escape(code, true)) +
    '
\n'
  );
};

build(function () {
  console.log('Done building.');
});

function build(callback) {
  const smith = Metalsmith(__dirname)
    // This is the source directory
    .source('./src')

    // This is where I want to build my files to
    .destination('./docs')

    // Clean the build directory before running any plugins
    .clean(true)

    // Use the drafts plugin
    .use(drafts())

    // Use Github Flavored Markdown for content
    .use(
      markdown({
        gfm: true,
        tables: true,
        highlight: function (code, lang) {
          // TODO what if there is no lang? highlightAuto..
          return hljs.highlight(lang, code).value;
        },
        renderer,
      }),
    )

    // Generate a table of contents JSON for every heading.
    .use(
      autotoc({
        selector: 'h1, h2, h3, h4, h5, h6',
        headerIdPrefix: 'subhead',
      }),
    )

    // Group my content into 4 distinct collections. These collection names
    // are defined as `collection: <name>` inside the markdown YAML.
    // .use(
    //   collections({
    //     "Get Started": { sortBy: "date" },
    //     Tutorials: { sortBy: "date" },
    //     "User Authentication": { sortBy: "date" },
    //     "Building with React & Flux": { sortBy: "date" },
    //   })
    // )

    // Use handlebars as layout engine.
    //.use(layouts('handlebars'))
    .use(layouts({ engine: 'ejs' }))

    .use(
      sass({
        outputStyle: 'expanded',
      }),
    )

    // Use the assets plugin to specify where assets are stored
    .use(
      assets({
        source: './assets',
        destination: './assets',
      }),
    );

  if (argv.dev) {
    smith
      .use(
        serve({
          port: 8001,
          verbose: true,
        }),
      )
      .use(
        watch({
          paths: {
            'src/*.md': true,
            'src/*': '**/**',
            'layouts/*': '**/*',
            'assets/*.css': '**/*',
          },
        }),
      );
  }

  smith.build(function (err) {
    var message = err ? err : 'Build complete';
    console.log(message);
    callback();
  });
}


text:
ACCEPTED

#### According to
GRIN Taxonomy for Plants

#### Published in
Acta Horti Gothob. 12:208. 1938

#### Original name
null

### Remarks
null


text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.brewguide.android.coffeebrewguide">

    <application
        android:allowBackup="true"
        android:icon="@drawable/launcher_icon"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".BrewMethodActivity"
            android:label="@string/title_activity_aeropress"
            android:parentActivityName=".MainActivity"
            android:theme="@style/AppTheme.NoActionBar">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.brewguide.android.coffeebrewguide.MainActivity" />
        </activity>
        <activity
            android:name=".MenuActivity"
            android:label="@string/title_activity_menu"
            android:parentActivityName=".MainActivity"
            android:theme="@style/AppTheme.NoActionBar">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value="com.brewguide.android.coffeebrewguide.MainActivity" />
        </activity>
    </application>

</manifest>


text:
/*
  Write a program that generates 100 random integers between 0 and 9 and
  displays the count for each number.
*/

public class E7_07 {
  public static void main(String[] args) {
    int[] counts = new int[10];
    for (int i = 0; i < 100; i++) {
      counts[(int)(Math.random() * 10)]++;
    }

    for (int i = 0; i < counts.length; i++) {
      System.out.println(i + ": " + counts[i]);
    }
  }
}


text:
Contributed By Check Point Software Technologies LTD.

Dynamic IDA Enrichment (aka. DIE)
=================================

### What is it?

DIE is an IDA python plugin designed to enrich IDA`s static analysis with dynamic data.
This is done using the IDA Debugger API, by placing breakpoints in key locations and saving the current system context once those breakpoints are hit.

The saved context consist of function arguments and register states, and it is saved upon each function CALL and function RETURN.

DIE takes advantage of IDA`s powerful analysis engine so that when context is taken DIE is fully aware of known function prototypes, data types, structures, unions, arrays and basically every piece of information IDA provides during static analysis.

In order to take this one step further, once context has been saved, DIE attempts to parse the individual data types based on an integrated (and extensible!) value parser framework.

So for example, if the current context has a function argument with type 'CHAR *' DIE will dereference its address and show a human readable ASCII string as value.

If the current context holds a argument with unknown value, DIE will not give up and attempt to guess the value using all relevant parsers.

This parser framework is the real power behind DIE, parser plugins can parse anything from BOOL values to image files to injected code.

The resault is a dynamic databse that holds parsed runtime arguments, which are avilable to the user during static analysis.

### I'm not sure I got it, do you have an example?

Well, yes. I'm glad you asked!
These videos show DIE in action, check them out if you want to understand a little bit more about how DIE works.

#### Example Video I
[Bypass Password Protection](https://vimeo.com/130815897)
In which we are going to demonstrate how DIE can be used in order to bypass a (very) simple password protection scheme.

#### Example Video II
[Code Coverage](https://vimeo.com/130815898)
In which we will show you how running DIE before even looking at the static analysis helps with code coverage, indirect calls, and function defenitions.

#### Example Video III
[Querying DieDB](https://vimeo.com/130815899)
In which we will show you how to use DIEDB to quickly locate the Explosive trojan de-obfuscation fuction.

### I want to write my own value parser plugin

Great, Value parser plugins are the heart of DIE. Without them DIE is practically usless.
Check out the [value parser writing manual](https://github.com/ynvb/DIE/blob/master/ValueParserWritingManual.md) and if your plugin turns out good, share it with the community!

Installation
------------

#### Prerequisits
1. IDA >= 6.8 (for versions 6.6 and 6.7 check out the issues page)
2. Python 2.7

#### How to install
1. Simply download DIE and run `pip install -r requirments.txt` from DIE's directory.
2. Copy the file `die_proxy.py` into IDA plugin directory
3. Create an enviorment variable named DIEDIR and set it's value to DIE directory.

For the Windows Handle parser plugin, you will also need to install [PyWin32](http://sourceforge.net/projects/pywin32/files/pywin32/) (manually :( )

If for some reason you want to install all the dependencies manually:

3. Yapsy     - install using `pip install yapsy` or your favorite package manager
4. Pywin32   - install via
5. Sark      - install using `pip install -e git+https://github.com/tmr232/Sark.git#egg=Sark`
6. yaml      - install using `pip install pyyaml`
7. attrdict  - install using `pip install attrdict`


text:
"""
tests.helpers.event_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Tests event helpers.
"""
# pylint: disable=protected-access,too-many-public-methods
# pylint: disable=too-few-public-methods
import unittest
from datetime import datetime

import homeassistant.core as ha
from homeassistant.helpers.event import *

class TestEventHelpers(unittest.TestCase):
    """
    Tests the Home Assistant event helpers.
    """

    def setUp(self):     # pylint: disable=invalid-name
        """ things to be run when tests are started. """
        self.hass = ha.HomeAssistant()
        self.hass.states.set("light.Bowl", "on")
        self.hass.states.set("switch.AC", "off")

    def tearDown(self):  # pylint: disable=invalid-name
        """ Stop down stuff we started. """
        self.hass.stop()

    def test_track_point_in_time(self):
        """ Test track point in time. """
        before_birthday = datetime(1985, 7, 9, 12, 0, 0, tzinfo=dt_util.UTC)
        birthday_paulus = datetime(1986, 7, 9, 12, 0, 0, tzinfo=dt_util.UTC)
        after_birthday = datetime(1987, 7, 9, 12, 0, 0, tzinfo=dt_util.UTC)

        runs = []

        track_point_in_utc_time(
            self.hass, lambda x: runs.append(1), birthday_paulus)

        self._send_time_changed(before_birthday)
        self.hass.pool.block_till_done()
        self.assertEqual(0, len(runs))

        self._send_time_changed(birthday_paulus)
        self.hass.pool.block_till_done()
        self.assertEqual(1, len(runs))

        # A point in time tracker will only fire once, this should do nothing
        self._send_time_changed(birthday_paulus)
        self.hass.pool.block_till_done()
        self.assertEqual(1, len(runs))

        track_point_in_time(
            self.hass, lambda x: runs.append(1), birthday_paulus)

        self._send_time_changed(after_birthday)
        self.hass.pool.block_till_done()
        self.assertEqual(2, len(runs))

    def test_track_time_change(self):
        """ Test tracking time change. """
        wildcard_runs = []
        specific_runs = []

        track_time_change(self.hass, lambda x: wildcard_runs.append(1))
        track_utc_time_change(
            self.hass, lambda x: specific_runs.append(1), second=[0, 30])

        self._send_time_changed(datetime(2014, 5, 24, 12, 0, 0))
        self.hass.pool.block_till_done()
        self.assertEqual(1, len(specific_runs))
        self.assertEqual(1, len(wildcard_runs))

        self._send_time_changed(datetime(2014, 5, 24, 12, 0, 15))
        self.hass.pool.block_till_done()
        self.assertEqual(1, len(specific_runs))
        self.assertEqual(2, len(wildcard_runs))

        self._send_time_changed(datetime(2014, 5, 24, 12, 0, 30))
        self.hass.pool.block_till_done()
        self.assertEqual(2, len(specific_runs))
        self.assertEqual(3, len(wildcard_runs))

    def test_track_state_change(self):
        """ Test track_state_change. """
        # 2 lists to track how often our callbacks get called
        specific_runs = []
        wildcard_runs = []

        track_state_change(
            self.hass, 'light.Bowl', lambda a, b, c: specific_runs.append(1),
            'on', 'off')

        track_state_change(
            self.hass, 'light.Bowl', lambda a, b, c: wildcard_runs.append(1),
            ha.MATCH_ALL, ha.MATCH_ALL)

        # Set same state should not trigger a state change/listener
        self.hass.states.set('light.Bowl', 'on')
        self.hass.pool.block_till_done()
        self.assertEqual(0, len(specific_runs))
        self.assertEqual(0, len(wildcard_runs))

        # State change off -> on
        self.hass.states.set('light.Bowl', 'off')
        self.hass.pool.block_till_done()
        self.assertEqual(1, len(specific_runs))
        self.assertEqual(1, len(wildcard_runs))

        # State change off -> off
        self.hass.states.set('light.Bowl', 'off', {"some_attr": 1})
        self.hass.pool.block_till_done()
        self.assertEqual(1, len(specific_runs))
        self.assertEqual(2, len(wildcard_runs))

        # State change off -> on
        self.hass.states.set('light.Bowl', 'on')
        self.hass.pool.block_till_done()
        self.assertEqual(1, len(specific_runs))
        self.assertEqual(3, len(wildcard_runs))

    def _send_time_changed(self, now):
        """ Send a time changed event. """
        self.hass.bus.fire(ha.EVENT_TIME_CHANGED, {ha.ATTR_NOW: now})


text:
.header, .footer{
    background-color: lawngreen;
    border: 1px solid white;
}

.azul{
    background-color: blueviolet;
    border: 1px solid white;
}

.verde{
    background-color: mediumseagreen;
    border: 1px solid white;
}

.tablet{
    background-color: deepskyblue;
    border: 1px solid white;
}

.rojo{
    background-color: indianred;
    border: 1px solid white;
}

body{
    text-align: center;
}


text:
<!DOCTYPE html>

    <title>Chord Diagram</title>
    <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.css">
    <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.theme.min.css">
    <link rel="stylesheet" href="../../dist/dex-jquery.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.css"/>
    <link rel="stylesheet" href="../../dist/dex-bootstrap.css">
    <link rel="stylesheet" href="../../dist/dex.css">


text:
import test from 'ava';
import request from 'supertest';

import {http} from '..';

import actions from '../test-fixtures/actions';

test('http', async t => {

    const {app} = http(actions);

    await request(app)
        .post('/toUpper')
        .send({message: 'hi'})
        .expect(/HI/);

    await request(app)
        .get('/customEvent')
        .expect(/fooEvent/);

    await request(app)
        .get('/error')
        .expect(/SHIPMENT: error/);

    await request(app)
        .post('/nonExistent')
        .expect(404);

    t.pass();

});


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Un Livre dont vous êtes le héros !</title>

    <link href="bootstrap-3.3.7-dist/css/bootstrap.css" rel="stylesheet">

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

            <button>

            </button>

            <button>

            </button>

            <button>

            </button>

            <button>

            </button>

            <button>

            </button>

            <button>

            </button>

            <button>

            </button>

            <button>

            </button>

            <button>

            </button>

Vous arrivez rapidement devant une enseigne aux couleurs avenantes. Cette auberge vous paraît sympathique et vous décidez d'y trouver abri jusqu'au lendemain où vous vous mettrez en route vers les montagnes. Vous attachez votre cheval à l'extérieur et entrez. Une foule bruyante remplit la salle de l'auberge. Votre entrée semble aviver les conversations. Vous marchez jusqu'à l'endroit où se tient le propriétaire et lui demandez combien vous coûtera un lit pour la nuit. Il vous répond que le tarif usuel est de 3 pièces d'or, et qu'il peut également vous servir un repas chaud pour 2 pièces d'or supplémentaires.

Vous arrivez rapidement devant une enseigne aux couleurs avenantes. Cette auberge vous paraît sympathique et vous décidez d'y trouver abri jusqu'au lendemain où vous vous mettrez en route vers les montagnes. Vous attachez votre cheval à l'extérieur et entrez. Une foule bruyante remplit la salle de l'auberge. Votre entrée semble aviver les conversations. Vous marchez jusqu'à l'endroit où se tient le propriétaire et lui demandez combien vous coûtera un lit pour la nuit. Il vous répond que le tarif usuel est de 3 pièces d'or, et qu'il peut également vous servir un repas chaud pour 2 pièces d'or supplémentaires.

Si vous acceptez son offre, ôtez 5 pièces d'or de votre bourse.

Si vous préférez manger vos propres provisions, rayez une ration sur la liste de vos possessions. Vous payez à l'aubergiste ses 3 pièces d'or et vous montez au premier étage.

          ---


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>AZSim Azure Simulator</title>

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

        <button class="navbar-toggler navbar-toggler-right" aria-expanded="false" aria-controls="navbarColor01" aria-label="Toggle navigation" type="button" data-toggle="collapse" data-target="#navbarColor01">

        </button>
        AZSim

                    Home

                    Simulations

                    Config

                    Info

Overview

 Active simulations

Simulators

1
Alerts

 Simulations

                                Delete
                                Name
                                ID
                                Status
                                Start
                                End

                                <button data-bind="click: deleteSimulation" class="btn btn-danger">Delete</button>

Create simulation

                            <button class="btn btn-success" type="button" data-bind="click: addSimulation">IoT Hub Client (IoT Device)</button>
                            <button class="btn btn-success" type="button">API</button>
                            <button class="btn btn-success" type="button">CosmosDB</button>

 Simulators

                                ID

                                Twin patch
                                Frequency
                                Payload
                                Primary key
                                IoT Hub
                                Runtime
                                Status

                                <button data-bind="click: deleteSimulator" class="btn btn-danger">Delete</button>

                                        <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                            Operations
                                        </button>

                                            Provision
                                            Test
                                            Start
                                            Stop
                                            Update twin
                                            Reboot

                                    <input data-bind="textInput: deviceTwin" type="text" />

                                    <input style="width:40px" data-bind="textInput: frequency" type="text" />

                                    <input data-bind="textInput: payload" type="text" />

 Simulator hosts

                                Action
                                ID
                                Status
                                Runtime

                                    <button data-bind="click: runProcess" class="btn btn-success">Create simulator</button>

                                    <button data-bind="click: deleteSimulatorHost" class="btn btn-danger">Delete</button>

Create simulation host

                            <button class="btn btn-success" type="button">Local machine</button>
                            <button class="btn btn-success" type="button">Kubernetes</button>
                            <button class="btn btn-success" type="button">Azure Container Instances</button>

2

IoT Hub Client Device Simulation

                        <form lpformnum="1">

                                Simulation name
                                <input data-bind="textInput: simulation.name" class="form-control lastpassClearHidden" style='background-position: 98% 50%; background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAASCAYAAABSO15qAAAAAXNSR0IArs4c6QAAAPhJREFUOBHlU70KgzAQPlMhEvoQTg6OPoOjT+JWOnRqkUKHgqWP4OQbOPokTk6OTkVULNSLVc62oJmbIdzd95NcuGjX2/3YVI/Ts+t0WLE2ut5xsQ0O+90F6UxFjAI8qNcEGONia08e6MNONYwCS7EQAizLmtGUDEzTBNd1fxsYhjEBnHPQNG3KKTYV34F8ec/zwHEciOMYyrIE3/ehKAqIoggo9inGXKmFXwbyBkmSQJqmUNe15IRhCG3byphitm1/eUzDM4qR0TTNjEixGdAnSi3keS5vSk2UDKqqgizLqB4YzvassiKhGtZ/jDMtLOnHz7TE+yf8BaDZXA509yeBAAAAAElFTkSuQmCC"); background-repeat: no-repeat; background-attachment: scroll; cursor: auto; background-size: 16px 18px;' type="text" placeholder="Enter simulation name">
                                Only stored for reference.

                                Simulator preset
                                <select class="form-control" id="simulationType" data-bind="options: simulation.presets, optionsText: 'name',value:simulation.selectedPreset"></select>

<button class="btn btn-primary row" data-bind="click: loadPreset" type="submit">Load preset</button>

                                Simulation config
                                <textarea class="form-control" rows="5" data-bind="textInput: simulation.configuration"></textarea>

Invalid JSON causing parse failure.

                                Payload template

                                    <input type="file" id="file" class="custom-file-input">

                                Payload template
                                <textarea class="form-control" rows="10" data-bind="textInput: simulation.payload"></textarea>

                                        Start

                                            <input class="form-control" type="datetime-local" value="2011-08-19T13:45:00" id="example-datetime-local-input">

                                        End

                                            <input class="form-control" type="datetime-local" value="2011-08-19T13:45:00" id="example-datetime-local-input">

                                    <input class="form-check-input" type="checkbox">
                                    Auto-run

                            <button class="btn btn-primary row" data-bind="click: confirmSimulation">Confirm</button>

                        </form>

Simulation output

This is a simple hero unit, a simple
umbotron-style component for calling extra attention to featured content or information.

This is a simple hero unit, a simple
umbotron-style component for calling extra attention to featured content or information.

                            This is a simple hero unit, a simple
umbotron-style component for calling extra attention to featured
content or information.
                            This is a simple hero unit, a simple
umbotron-style component for calling extra attention to featured
content or information.
                            This is a simple hero unit, a simple
umbotron-style component for calling extra attention to featured
content or information.
                            This is a simple hero unit, a simple
umbotron-style component for calling extra attention to featured
content or information.
                            This is a simple hero unit, a simple
umbotron-style component for calling extra attention to featured
content or information.


text:
**Note** Consider using [`grunt-jsbeautifier`](https://npmjs.com/grunt-jsbeautifier) instead.

> Grunt plugin for running js-beautify

## Getting Started
This plugin requires Grunt `~0.4.5`

If you haven't used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

```shell
npm install grunt-js-beautify --save-dev
```

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

```js
grunt.loadNpmTasks('grunt-js-beautify');
```

## The "js_beautify" task

### Overview
In your project's Gruntfile, add a section named `js_beautify` to the data object passed into `grunt.initConfig()`.

```js
grunt.initConfig({
  js_beautify: {
    options: {
      // js-beautify options go here
    },
    files: {
      'your_file_group_name: ['**/*.js', 'somedir/app.js']
    },
  },
});
```

### Options

The options are all the [standard options](https://www.npmjs.com/package/js-beautify#options) offered by js-beautify.
### Usage Examples

#### Custom Options
In this example, custom options are used to specify the js-beautify arguments. Anything not specify will revert to the [defaults](https://www.npmjs.com/package/js-beautify#options).

```js
grunt.initConfig({
  js_beautify: {
    options: {
    	end_with_newline: true,
    	max_preserve_newlines: 1
	 },
    files: {
      'dest/default_options': ['src/testing', 'src/123'],
    },
  },
});
```

## Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).


text:
/**
 * Older Linux versions support the 'iw' interface, more recent ones the 'cfg80211' interface.
 */

#ifndef _wl_cfg80211_h_
#define _wl_cfg80211_h_

#include <linux/wireless.h>
#include <typedefs.h>
#include <proto/ethernet.h>
#include <wlioctl.h>
#include <linux/wireless.h>
#include <net/cfg80211.h>
#include <linux/rfkill.h>

#include <wl_cfgp2p.h>

struct wl_conf;
struct wl_iface;
struct bcm_cfg80211;
struct wl_security;
struct wl_ibss;

#define htod32(i) (i)
#define htod16(i) (i)
#define dtoh32(i) (i)
#define dtoh16(i) (i)
#define htodchanspec(i) (i)
#define dtohchanspec(i) (i)

#define WL_DBG_NONE	0
#define WL_DBG_P2P_ACTION (1 << 5)
#define WL_DBG_TRACE	(1 << 4)
#define WL_DBG_SCAN 	(1 << 3)
#define WL_DBG_DBG 	(1 << 2)
#define WL_DBG_INFO	(1 << 1)
#define WL_DBG_ERR	(1 << 0)

#ifdef DHD_LOG_DUMP
extern void dhd_log_dump_print(const char *fmt, ...);
extern char *dhd_log_dump_get_timestamp(void);
struct bcm_cfg80211 *wl_get_bcm_cfg80211_ptr(void);
#endif /* DHD_LOG_DUMP */

/* 0 invalidates all debug messages.  default is 1 */
#define WL_DBG_LEVEL 0xFF

#ifdef CUSTOMER_HW4
#define CFG80211_ERROR_TEXT		"CFG80211-INFO2) "
#else
#define CFG80211_ERROR_TEXT		"CFG80211-ERROR) "
#endif

#if defined(DHD_DEBUG)
#ifdef DHD_LOG_DUMP
#define	WL_ERR(args)	\
do {	\
	if (wl_dbg_level & WL_DBG_ERR) {	\
		printk(KERN_INFO CFG80211_ERROR_TEXT "%s : ", __func__);	\
		printk args;	\
		dhd_log_dump_print("[%s] %s: ", dhd_log_dump_get_timestamp(), __func__);	\
		dhd_log_dump_print args;	\
	}	\
} while (0)
#else
#define	WL_ERR(args)									\
do {										\
	if (wl_dbg_level & WL_DBG_ERR) {				\
			printk(KERN_INFO CFG80211_ERROR_TEXT "%s : ", __func__);	\
			printk args;						\
		}								\
} while (0)
#endif /* DHD_LOG_DUMP */
#else /* defined(DHD_DEBUG) */
#define	WL_ERR(args)									\
do {										\
	if ((wl_dbg_level & WL_DBG_ERR) && net_ratelimit()) {				\
			printk(KERN_INFO CFG80211_ERROR_TEXT "%s : ", __func__);	\
			printk args;						\
		}								\
} while (0)
#endif /* defined(DHD_DEBUG) */

#ifdef WL_INFORM
#undef WL_INFORM
#endif

#define	WL_INFORM(args)									\
do {										\
	if (wl_dbg_level & WL_DBG_INFO) {				\
			printk(KERN_INFO "CFG80211-INFO) %s : ", __func__);	\
			printk args;						\
		}								\
} while (0)

#ifdef WL_SCAN
#undef WL_SCAN
#endif
#define	WL_SCAN(args)								\
do {									\
	if (wl_dbg_level & WL_DBG_SCAN) {			\
		printk(KERN_INFO "CFG80211-SCAN) %s :", __func__);	\
		printk args;							\
	}									\
} while (0)
#ifdef WL_TRACE
#undef WL_TRACE
#endif
#define	WL_TRACE(args)								\
do {									\
	if (wl_dbg_level & WL_DBG_TRACE) {			\
		printk(KERN_INFO "CFG80211-TRACE) %s :", __func__);	\
		printk args;							\
	}									\
} while (0)
#ifdef WL_TRACE_HW4
#undef WL_TRACE_HW4
#endif
#ifdef CUSTOMER_HW4
#define	WL_TRACE_HW4(args)					\
do {										\
	if (wl_dbg_level & WL_DBG_ERR) {				\
			printk(KERN_INFO "CFG80211-TRACE) %s : ", __func__);	\
			printk args;						\
		} 								\
} while (0)
#else
#define	WL_TRACE_HW4			WL_TRACE
#endif /* CUSTOMER_HW4 */
#if (WL_DBG_LEVEL > 0)
#define	WL_DBG(args)								\
do {									\
	if (wl_dbg_level & WL_DBG_DBG) {			\
		printk(KERN_DEBUG "CFG80211-DEBUG) %s :", __func__);	\
		printk args;							\
	}									\
} while (0)
#else				/* !(WL_DBG_LEVEL > 0) */
#define	WL_DBG(args)
#endif				/* (WL_DBG_LEVEL > 0) */
#define WL_PNO(x)
#define WL_SD(x)

#define WL_SCAN_RETRY_MAX	3
#define WL_NUM_PMKIDS_MAX	MAXPMKID
#define WL_SCAN_BUF_MAX 	(1024 * 8)
#define WL_TLV_INFO_MAX 	1500
#define WL_SCAN_IE_LEN_MAX      2048
#define WL_BSS_INFO_MAX		2048
#define WL_ASSOC_INFO_MAX	512
#define WL_IOCTL_LEN_MAX	2048
#define WL_EXTRA_BUF_MAX	2048
#define WL_SCAN_ERSULTS_LAST 	(WL_SCAN_RESULTS_NO_MEM+1)
#define WL_AP_MAX		256
#define WL_FILE_NAME_MAX	256
#define WL_DWELL_TIME 		200
#define WL_MED_DWELL_TIME       400
#define WL_MIN_DWELL_TIME	100
#define WL_LONG_DWELL_TIME 	1000
#define IFACE_MAX_CNT 		2
#define WL_SCAN_CONNECT_DWELL_TIME_MS 		200
#define WL_SCAN_JOIN_PROBE_INTERVAL_MS 		20
#define WL_SCAN_JOIN_ACTIVE_DWELL_TIME_MS 	320
#define WL_SCAN_JOIN_PASSIVE_DWELL_TIME_MS 	400
#define WL_AF_TX_MAX_RETRY 	5

#define WL_AF_SEARCH_TIME_MAX           450
#define WL_AF_TX_EXTRA_TIME_MAX         200

#define WL_SCAN_TIMER_INTERVAL_MS	10000 /* Scan timeout */
#define WL_CHANNEL_SYNC_RETRY 	5
#define WL_INVALID 		-1

#ifdef DHD_LOSSLESS_ROAMING
#define WL_ROAM_TIMEOUT_MS	1000 /* Roam timeout */
#endif
/* Bring down SCB Timeout to 20secs from 60secs default */
#ifndef WL_SCB_TIMEOUT
#define WL_SCB_TIMEOUT 20
#endif

/* SCAN_SUPPRESS timer values in ms */
#define WL_SCAN_SUPPRESS_TIMEOUT 31000 /* default Framwork DHCP timeout is 30 sec */
#define WL_SCAN_SUPPRESS_RETRY 3000

#define WL_PM_ENABLE_TIMEOUT 10000

#ifdef WLTDLS
#define TDLS_TUNNELED_PRB_REQ	"\x7f\x50\x6f\x9a\04"
#define TDLS_TUNNELED_PRB_RESP	"\x7f\x50\x6f\x9a\05"
#endif /* WLTDLS */

#ifdef WLAIBSS
/* Custom AIBSS beacon parameters */
#define AIBSS_INITIAL_MIN_BCN_DUR	500
#define AIBSS_MIN_BCN_DUR		5000
#define AIBSS_BCN_FLOOD_DUR		5000
#define AIBSS_PEER_FREE			3
#endif /* WLAIBSS */

/* driver status */
enum wl_status {
	WL_STATUS_READY = 0,
	WL_STATUS_SCANNING,
	WL_STATUS_SCAN_ABORTING,
	WL_STATUS_CONNECTING,
	WL_STATUS_CONNECTED,
	WL_STATUS_DISCONNECTING,
	WL_STATUS_AP_CREATING,
	WL_STATUS_AP_CREATED,
	/* whole sending action frame procedure:
	 * includes a) 'finding common channel' for public action request frame
	 * and b) 'sending af via 'actframe' iovar'
	 */
	WL_STATUS_SENDING_ACT_FRM,
	/* find a peer to go to a common channel before sending public action req frame */
	WL_STATUS_FINDING_COMMON_CHANNEL,
	/* waiting for next af to sync time of supplicant.
	 * it includes SENDING_ACT_FRM and WAITING_NEXT_ACT_FRM_LISTEN
	 */
	WL_STATUS_WAITING_NEXT_ACT_FRM,
#ifdef WL_CFG80211_SYNC_GON
	/* go to listen state to wait for next af after SENDING_ACT_FRM */
	WL_STATUS_WAITING_NEXT_ACT_FRM_LISTEN,
#endif /* WL_CFG80211_SYNC_GON */
	/* it will be set when upper layer requests listen and succeed in setting listen mode.
	 * if set, other scan request can abort current listen state
	 */
	WL_STATUS_REMAINING_ON_CHANNEL,
#ifdef WL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST
	/* it's fake listen state to keep current scan state.
	 * it will be set when upper layer requests listen but scan is running. then just run
	 * a expire timer without actual listen state.
	 * if set, other scan request does not need to abort scan.
	 */
	WL_STATUS_FAKE_REMAINING_ON_CHANNEL
#endif /* WL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST */
};

/* wi-fi mode */
enum wl_mode {
	WL_MODE_BSS,
	WL_MODE_IBSS,
	WL_MODE_AP
};

/* driver profile list */
enum wl_prof_list {
	WL_PROF_MODE,
	WL_PROF_SSID,
	WL_PROF_SEC,
	WL_PROF_IBSS,
	WL_PROF_BAND,
	WL_PROF_CHAN,
	WL_PROF_BSSID,
	WL_PROF_ACT,
	WL_PROF_BEACONINT,
	WL_PROF_DTIMPERIOD
};

/* donlge escan state */
enum wl_escan_state {
	WL_ESCAN_STATE_IDLE,
	WL_ESCAN_STATE_SCANING
};
/* fw downloading status */
enum wl_fw_status {
	WL_FW_LOADING_DONE,
	WL_NVRAM_LOADING_DONE
};

enum wl_management_type {
	WL_BEACON = 0x1,
	WL_PROBE_RESP = 0x2,
	WL_ASSOC_RESP = 0x4
};

enum wl_pm_workq_act_type {
	WL_PM_WORKQ_SHORT,
	WL_PM_WORKQ_LONG,
	WL_PM_WORKQ_DEL
};

/* beacon / probe_response */
struct beacon_proberesp {
	__le64 timestamp;
	__le16 beacon_int;
	__le16 capab_info;
	u8 variable[0];
} __attribute__ ((packed));

/* driver configuration */
struct wl_conf {
	u32 frag_threshold;
	u32 rts_threshold;
	u32 retry_short;
	u32 retry_long;
	s32 tx_power;
	struct ieee80211_channel channel;
};

typedef s32(*EVENT_HANDLER) (struct bcm_cfg80211 *cfg, bcm_struct_cfgdev *cfgdev,
                            const wl_event_msg_t *e, void *data);

/* bss inform structure for cfg80211 interface */
struct wl_cfg80211_bss_info {
	u16 band;
	u16 channel;
	s16 rssi;
	u16 frame_len;
	u8 frame_buf[1];
};

/* basic structure of scan request */
struct wl_scan_req {
	struct wlc_ssid ssid;
};

/* basic structure of information element */
struct wl_ie {
	u16 offset;
	u8 buf[WL_TLV_INFO_MAX];
};

/* event queue for cfg80211 main event */
struct wl_event_q {
	struct list_head eq_list;
	u32 etype;
	wl_event_msg_t emsg;
	s8 edata[1];
};

/* security information with currently associated ap */
struct wl_security {
	u32 wpa_versions;
	u32 auth_type;
	u32 cipher_pairwise;
	u32 cipher_group;
	u32 wpa_auth;
	u32 auth_assoc_res_status;
};

/* ibss information for currently joined ibss network */
struct wl_ibss {
	u8 beacon_interval;	/* in millisecond */
	u8 atim;		/* in millisecond */
	s8 join_only;
	u8 band;
	u8 channel;
};

/* cfg driver profile */
struct wl_profile {
	u32 mode;
	s32 band;
	u32 channel;
	struct wlc_ssid ssid;
	struct wl_security sec;
	struct wl_ibss ibss;
	u8 bssid[ETHER_ADDR_LEN];
	u16 beacon_interval;
	u8 dtim_period;
	bool active;
};

struct net_info {
	struct net_device *ndev;
	struct wireless_dev *wdev;
	struct wl_profile profile;
	s32 mode;
	s32 roam_off;
	unsigned long sme_state;
	bool pm_restore;
	bool pm_block;
	s32 pm;
	struct list_head list; /* list of all net_info structure */
};

/* association inform */
#define MAX_REQ_LINE 1024
struct wl_connect_info {
	u8 req_ie[MAX_REQ_LINE];
	s32 req_ie_len;
	u8 resp_ie[MAX_REQ_LINE];
	s32 resp_ie_len;
};

/* firmware /nvram downloading controller */
struct wl_fw_ctrl {
	const struct firmware *fw_entry;
	unsigned long status;
	u32 ptr;
	s8 fw_name[WL_FILE_NAME_MAX];
	s8 nvram_name[WL_FILE_NAME_MAX];
};

/* assoc ie length */
struct wl_assoc_ielen {
	u32 req_len;
	u32 resp_len;
};

/* wpa2 pmk list */
struct wl_pmk_list {
	pmkid_list_t pmkids;
	pmkid_t foo[MAXPMKID - 1];
};

#define ESCAN_BUF_SIZE (64 * 1024)

struct escan_info {
	u32 escan_state;
#if defined(STATIC_WL_PRIV_STRUCT)
#ifndef CONFIG_DHD_USE_STATIC_BUF
#error STATIC_WL_PRIV_STRUCT should be used with CONFIG_DHD_USE_STATIC_BUF
#endif /* CONFIG_DHD_USE_STATIC_BUF */
#if defined(CUSTOMER_HW4) && defined(DUAL_ESCAN_RESULT_BUFFER)
	u8 *escan_buf[2];
#else
	u8 *escan_buf;
#endif /* CUSTOMER_HW4 && DUAL_ESCAN_RESULT_BUFFER */
#else
#if defined(CUSTOMER_HW4) && defined(DUAL_ESCAN_RESULT_BUFFER)
	u8 escan_buf[2][ESCAN_BUF_SIZE];
#else
	u8 escan_buf[ESCAN_BUF_SIZE];
#endif /* CUSTOMER_HW4 && DUAL_ESCAN_RESULT_BUFFER */
#endif /* STATIC_WL_PRIV_STRUCT */
#if defined(CUSTOMER_HW4) && defined(DUAL_ESCAN_RESULT_BUFFER)
	u8 cur_sync_id;
	u8 escan_type[2];
#endif /* CUSTOMER_HW4 && DUAL_ESCAN_RESULT_BUFFER */
	struct wiphy *wiphy;
	struct net_device *ndev;
};

#ifdef ESCAN_BUF_OVERFLOW_MGMT
#define BUF_OVERFLOW_MGMT_COUNT 3
typedef struct {
	int RSSI;
	int length;
	struct ether_addr BSSID;
} removal_element_t;
#endif /* ESCAN_BUF_OVERFLOW_MGMT */

struct ap_info {
/* Structure to hold WPS, WPA IEs for a AP */
	u8   probe_res_ie[VNDR_IES_MAX_BUF_LEN];
	u8   beacon_ie[VNDR_IES_MAX_BUF_LEN];
	u8   assoc_res_ie[VNDR_IES_MAX_BUF_LEN];
	u32 probe_res_ie_len;
	u32 beacon_ie_len;
	u32 assoc_res_ie_len;
	u8 *wpa_ie;
	u8 *rsn_ie;
	u8 *wps_ie;
	bool security_mode;
};

struct sta_info {
	/* Structure to hold WPS IE for a STA */
	u8  probe_req_ie[VNDR_IES_BUF_LEN];
	u8  assoc_req_ie[VNDR_IES_BUF_LEN];
	u32 probe_req_ie_len;
	u32 assoc_req_ie_len;
};

struct afx_hdl {
	wl_af_params_t *pending_tx_act_frm;
	struct ether_addr	tx_dst_addr;
	struct net_device *dev;
	struct work_struct work;
	u32 bssidx;
	u32 retry;
	s32 peer_chan;
	s32 peer_listen_chan; /* search channel: configured by upper layer */
	s32 my_listen_chan;	/* listen chanel: extract it from prb req or gon req */
	bool is_listen;
	bool ack_recv;
	bool is_active;
};

struct parsed_ies {
	wpa_ie_fixed_t *wps_ie;
	u32 wps_ie_len;
	wpa_ie_fixed_t *wpa_ie;
	u32 wpa_ie_len;
	bcm_tlv_t *wpa2_ie;
	u32 wpa2_ie_len;
};

#ifdef WL11U
/* Max length of Interworking element */
#define IW_IES_MAX_BUF_LEN 		9
#endif
#ifdef WLFBT
#define FBT_KEYLEN		32
#endif
#define MAX_EVENT_BUF_NUM 16
typedef struct wl_eventmsg_buf {
	u16 num;
	struct {
		u16 type;
		bool set;
	} event [MAX_EVENT_BUF_NUM];
} wl_eventmsg_buf_t;

typedef struct wl_if_event_info {
	bool valid;
	int ifidx;
	int bssidx;
	uint8 mac[ETHER_ADDR_LEN];
	char name[IFNAMSIZ+1];
} wl_if_event_info;

#if defined(DHD_ENABLE_BIGDATA_LOGGING)
#define GET_BSS_INFO_LEN 90
#endif /* DHD_ENABLE_BIGDATA_LOGGING */

/* private data of cfg80211 interface */
struct bcm_cfg80211 {
	struct wireless_dev *wdev;	/* representing cfg cfg80211 device */

	struct wireless_dev *p2p_wdev;	/* representing cfg cfg80211 device for P2P */
	struct net_device *p2p_net;    /* reference to p2p0 interface */

	struct wl_conf *conf;
	struct cfg80211_scan_request *scan_request;	/* scan request object */
	EVENT_HANDLER evt_handler[WLC_E_LAST];
	struct list_head eq_list;	/* used for event queue */
	struct list_head net_list;     /* used for struct net_info */
	spinlock_t eq_lock;	/* for event queue synchronization */
	spinlock_t cfgdrv_lock;	/* to protect scan status (and others if needed) */
	struct completion act_frm_scan;
	struct completion iface_disable;
	struct completion wait_next_af;
	struct mutex usr_sync;	/* maily for up/down synchronization */
	struct wl_scan_results *bss_list;
	struct wl_scan_results *scan_results;

	/* scan request object for internal purpose */
	struct wl_scan_req *scan_req_int;
	/* information element object for internal purpose */
#if defined(STATIC_WL_PRIV_STRUCT)
	struct wl_ie *ie;
#else
	struct wl_ie ie;
#endif

	/* association information container */
#if defined(STATIC_WL_PRIV_STRUCT)
	struct wl_connect_info *conn_info;
#else
	struct wl_connect_info conn_info;
#endif
#ifdef DEBUGFS_CFG80211
	struct dentry		*debugfs;
#endif /* DEBUGFS_CFG80211 */
	struct wl_pmk_list *pmk_list;	/* wpa2 pmk list */
	tsk_ctl_t event_tsk;  		/* task of main event handler thread */
	void *pub;
	u32 iface_cnt;
	u32 channel;		/* current channel */
	u32 af_sent_channel;	/* channel action frame is sent */
	/* next af subtype to cancel the remained dwell time in rx process */
	u8 next_af_subtype;
#ifdef WL_CFG80211_SYNC_GON
	ulong af_tx_sent_jiffies;
#endif /* WL_CFG80211_SYNC_GON */
	struct escan_info escan_info;   /* escan information */
	bool active_scan;	/* current scan mode */
	bool ibss_starter;	/* indicates this sta is ibss starter */
	bool link_up;		/* link/connection up flag */

	/* indicate whether chip to support power save mode */
	bool pwr_save;
	bool roam_on;		/* on/off switch for self-roaming */
	bool scan_tried;	/* indicates if first scan attempted */
#if defined(BCMSDIO) || defined(BCMPCIE)
	bool wlfc_on;
#endif
	bool vsdb_mode;
	bool roamoff_on_concurrent;
	u8 *ioctl_buf;		/* ioctl buffer */
	struct mutex ioctl_buf_sync;
	u8 *escan_ioctl_buf;
	u8 *extra_buf;	/* maily to grab assoc information */
	struct dentry *debugfsdir;
	struct rfkill *rfkill;
	bool rf_blocked;
	struct ieee80211_channel remain_on_chan;
	enum nl80211_channel_type remain_on_chan_type;
	u64 send_action_id;
	u64 last_roc_id;
	wait_queue_head_t netif_change_event;
	wl_if_event_info if_event_info;
	struct completion send_af_done;
	struct afx_hdl *afx_hdl;
	struct ap_info *ap_info;
	struct sta_info *sta_info;
	struct p2p_info *p2p;
	bool p2p_supported;
	void *btcoex_info;
	struct timer_list scan_timeout;   /* Timer for catch scan event timeout */
#ifdef WL_CFG80211_GON_COLLISION
	u8 block_gon_req_tx_count;
	u8 block_gon_req_rx_count;
#endif /* WL_CFG80211_GON_COLLISION */
	s32(*state_notifier) (struct bcm_cfg80211 *cfg,
		struct net_info *_net_info, enum wl_status state, bool set);
	unsigned long interrested_state;
	wlc_ssid_t hostapd_ssid;
#ifdef WL11U
	bool wl11u;
#endif /* WL11U */
	bool sched_scan_running;	/* scheduled scan req status */
#ifdef WL_SCHED_SCAN
	struct cfg80211_sched_scan_request *sched_scan_req;	/* scheduled scan req */
#endif /* WL_SCHED_SCAN */
#ifdef WL_HOST_BAND_MGMT
	u8 curr_band;
#endif /* WL_HOST_BAND_MGMT */
	bool scan_suppressed;
	struct timer_list scan_supp_timer;
	struct work_struct wlan_work;
	struct mutex event_sync;	/* maily for up/down synchronization */
	bool disable_roam_event;
	struct delayed_work pm_enable_work;
	vndr_ie_setbuf_t *ibss_vsie;	/* keep the VSIE for IBSS */
	int ibss_vsie_len;
#ifdef WLAIBSS
	u32 aibss_txfail_pid;
	u32 aibss_txfail_seq;
#endif /* WLAIBSS */
	u32 rmc_event_pid;
	u32 rmc_event_seq;
#ifdef WLAIBSS_MCHAN
	struct ether_addr ibss_if_addr;
	bcm_struct_cfgdev *ibss_cfgdev; /* For AIBSS */
#endif /* WLAIBSS_MCHAN */
	bcm_struct_cfgdev *bss_cfgdev;  /* For DUAL STA/STA+AP */
	s32 cfgdev_bssidx;
	bool bss_pending_op;		/* indicate where there is a pending IF operation */
#ifdef WLFBT
	uint8 fbt_key[FBT_KEYLEN];
#endif
	int roam_offload;
	bool nan_running;
#if defined(CUSTOMER_HW4) && defined(WL_CFG80211_P2P_DEV_IF)
	bool down_disc_if;
#endif /* CUSTOMER_HW4 && WL_CFG80211_P2P_DEV_IF */
	bool need_wait_afrx;
	struct wl_wsec_key wep_key;
#ifdef QOS_MAP_SET
	uint8	 *up_table;	/* user priority table, size is UP_TABLE_MAX */
#endif /* QOS_MAP_SET */
	struct ether_addr last_roamed_addr;
#ifdef WLTDLS
	u8 *tdls_mgmt_frame;
	u32 tdls_mgmt_frame_len;
	s32 tdls_mgmt_freq;
#endif /* WLTDLS */
#ifdef DHD_LOSSLESS_ROAMING
	struct timer_list roam_timeout;   /* Timer for catch roam timeout */
#endif
#if defined(DHD_ENABLE_BIGDATA_LOGGING)
	char bss_info[GET_BSS_INFO_LEN];
	wl_event_msg_t event_auth_assoc;
	u32 assoc_reject_status;
	u32 roam_count;
#endif /* DHD_ENABLE_BIGDATA_LOGGING */
	spinlock_t net_list_sync;
};

static inline struct wl_bss_info *next_bss(struct wl_scan_results *list, struct wl_bss_info *bss)
{
	return bss = bss ?
		(struct wl_bss_info *)((uintptr) bss + dtoh32(bss->length)) : list->bss_info;
}
static inline s32
wl_alloc_netinfo(struct bcm_cfg80211 *cfg, struct net_device *ndev,
	struct wireless_dev * wdev, s32 mode, bool pm_block)
{
	struct net_info *_net_info;
	s32 err = 0;
	unsigned long int flags;

	if (cfg->iface_cnt == IFACE_MAX_CNT)
		return -ENOMEM;
	_net_info = kzalloc(sizeof(struct net_info), GFP_KERNEL);
	if (!_net_info)
		err = -ENOMEM;
	else {
		_net_info->mode = mode;
		_net_info->ndev = ndev;
		_net_info->wdev = wdev;
		_net_info->pm_restore = 0;
		_net_info->pm = 0;
		_net_info->pm_block = pm_block;
		_net_info->roam_off = WL_INVALID;
		spin_lock_irqsave(&cfg->net_list_sync, flags);
		cfg->iface_cnt++;
		list_add(&_net_info->list, &cfg->net_list);
		spin_unlock_irqrestore(&cfg->net_list_sync, flags);
	}
	return err;
}
static inline void
wl_dealloc_netinfo(struct bcm_cfg80211 *cfg, struct net_device *ndev)
{
	struct net_info *_net_info, *next;
	unsigned long int flags;

	spin_lock_irqsave(&cfg->net_list_sync, flags);
	list_for_each_entry_safe(_net_info, next, &cfg->net_list, list) {
		if (ndev && (_net_info->ndev == ndev)) {
			list_del(&_net_info->list);
			cfg->iface_cnt--;
			kfree(_net_info);
		}
	}
	spin_unlock_irqrestore(&cfg->net_list_sync, flags);
}
static inline void
wl_delete_all_netinfo(struct bcm_cfg80211 *cfg)
{
	struct net_info *_net_info, *next;
	unsigned long int flags;

	spin_lock_irqsave(&cfg->net_list_sync, flags);
	list_for_each_entry_safe(_net_info, next, &cfg->net_list, list) {
		list_del(&_net_info->list);
			if (_net_info->wdev)
				kfree(_net_info->wdev);
			kfree(_net_info);
	}
	cfg->iface_cnt = 0;
	spin_unlock_irqrestore(&cfg->net_list_sync, flags);
}
static inline u32
wl_get_status_all(struct bcm_cfg80211 *cfg, s32 status)

{
	struct net_info *_net_info, *next;
	u32 cnt = 0;
	unsigned long int flags;

	spin_lock_irqsave(&cfg->net_list_sync, flags);
	list_for_each_entry_safe(_net_info, next, &cfg->net_list, list) {
		if (_net_info->ndev &&
			test_bit(status, &_net_info->sme_state))
			cnt++;
	}
	spin_unlock_irqrestore(&cfg->net_list_sync, flags);
	return cnt;
}
static inline void
wl_set_status_all(struct bcm_cfg80211 *cfg, s32 status, u32 op)
{
	struct net_info *_net_info, *next;
	unsigned long int flags;

	spin_lock_irqsave(&cfg->net_list_sync, flags);
	list_for_each_entry_safe(_net_info, next, &cfg->net_list, list) {
		switch (op) {
			case 1:
				break; /* set all status is not allowed */
			case 2:
				/*
				 * Release the spinlock before calling notifier. Else there
				 * will be nested calls
				 */
				spin_unlock_irqrestore(&cfg->net_list_sync, flags);
				clear_bit(status, &_net_info->sme_state);
				if (cfg->state_notifier &&
					test_bit(status, &(cfg->interrested_state)))
					cfg->state_notifier(cfg, _net_info, status, false);
				return;
			case 4:
				break; /* change all status is not allowed */
			default:
				break; /* unknown operation */
		}
	}
	spin_unlock_irqrestore(&cfg->net_list_sync, flags);
}
static inline void
wl_set_status_by_netdev(struct bcm_cfg80211 *cfg, s32 status,
	struct net_device *ndev, u32 op)
{

	struct net_info *_net_info, *next;
	unsigned long int flags;

	spin_lock_irqsave(&cfg->net_list_sync, flags);
	list_for_each_entry_safe(_net_info, next, &cfg->net_list, list) {
		if (ndev && (_net_info->ndev == ndev)) {
			switch (op) {
				case 1:
					/*
					 * Release the spinlock before calling notifier. Else there
					 * will be nested calls
					 */
					spin_unlock_irqrestore(&cfg->net_list_sync, flags);
					set_bit(status, &_net_info->sme_state);
					if (cfg->state_notifier &&
						test_bit(status, &(cfg->interrested_state)))
						cfg->state_notifier(cfg, _net_info, status, true);
					return;
				case 2:
					/*
					 * Release the spinlock before calling notifier. Else there
					 * will be nested calls
					 */
					spin_unlock_irqrestore(&cfg->net_list_sync, flags);
					clear_bit(status, &_net_info->sme_state);
					if (cfg->state_notifier &&
						test_bit(status, &(cfg->interrested_state)))
						cfg->state_notifier(cfg, _net_info, status, false);
					return;
				case 4:
					change_bit(status, &_net_info->sme_state);
					break;
			}
		}

	}
	spin_unlock_irqrestore(&cfg->net_list_sync, flags);
}

static inline u32
wl_get_status_by_netdev(struct bcm_cfg80211 *cfg, s32 status,
	struct net_device *ndev)
{
	struct net_info *_net_info, *next;
	u32 stat = 0;
	unsigned long int flags;

	spin_lock_irqsave(&cfg->net_list_sync, flags);
	list_for_each_entry_safe(_net_info, next, &cfg->net_list, list) {
		if (ndev && (_net_info->ndev == ndev)) {
			stat = test_bit(status, &_net_info->sme_state);
		}
	}
	spin_unlock_irqrestore(&cfg->net_list_sync, flags);
	return stat;
}

static inline s32
wl_get_mode_by_netdev(struct bcm_cfg80211 *cfg, struct net_device *ndev)
{
	struct net_info *_net_info, *next;
	s32 mode = -1;
	unsigned long int flags;

	spin_lock_irqsave(&cfg->net_list_sync, flags);
	list_for_each_entry_safe(_net_info, next, &cfg->net_list, list) {
		if (ndev && (_net_info->ndev == ndev)) {
			mode = _net_info->mode;
			break;
		}
	}
	spin_unlock_irqrestore(&cfg->net_list_sync, flags);
	return mode;
}

static inline void
wl_set_mode_by_netdev(struct bcm_cfg80211 *cfg, struct net_device *ndev,
	s32 mode)
{
	struct net_info *_net_info, *next;
	unsigned long int flags;

	spin_lock_irqsave(&cfg->net_list_sync, flags);
	list_for_each_entry_safe(_net_info, next, &cfg->net_list, list) {
		if (ndev && (_net_info->ndev == ndev)) {
			_net_info->mode = mode;
		}
	}
	spin_unlock_irqrestore(&cfg->net_list_sync, flags);
}
static inline struct wl_profile *
wl_get_profile_by_netdev(struct bcm_cfg80211 *cfg, struct net_device *ndev)
{
	struct net_info *_net_info, *next;
	struct wl_profile *prof = NULL;
	unsigned long int flags;

	spin_lock_irqsave(&cfg->net_list_sync, flags);
	list_for_each_entry_safe(_net_info, next, &cfg->net_list, list) {
		if (ndev && (_net_info->ndev == ndev)) {
			prof = &_net_info->profile;
			break;
		}
	}
	spin_unlock_irqrestore(&cfg->net_list_sync, flags);
	return prof;
}
static inline struct net_info *
wl_get_netinfo_by_netdev(struct bcm_cfg80211 *cfg, struct net_device *ndev)
{
	struct net_info *_net_info, *next, *info = NULL;
	unsigned long int flags;

	spin_lock_irqsave(&cfg->net_list_sync, flags);
	list_for_each_entry_safe(_net_info, next, &cfg->net_list, list) {
		if (ndev && (_net_info->ndev == ndev)) {
			info = _net_info;
			break;
		}
	}
	spin_unlock_irqrestore(&cfg->net_list_sync, flags);
	return info;
}
#define bcmcfg_to_wiphy(cfg) (cfg->wdev->wiphy)
#define bcmcfg_to_prmry_ndev(cfg) (cfg->wdev->netdev)
#define bcmcfg_to_prmry_wdev(cfg) (cfg->wdev)
#define bcmcfg_to_p2p_wdev(cfg) (cfg->p2p_wdev)
#define ndev_to_wl(n) (wdev_to_wl(n->ieee80211_ptr))
#define ndev_to_wdev(ndev) (ndev->ieee80211_ptr)
#define wdev_to_ndev(wdev) (wdev->netdev)

#if defined(WL_ENABLE_P2P_IF)
#define ndev_to_wlc_ndev(ndev, cfg)	((ndev == cfg->p2p_net) ? \
	bcmcfg_to_prmry_ndev(cfg) : ndev)
#else
#define ndev_to_wlc_ndev(ndev, cfg)	(ndev)
#endif /* WL_ENABLE_P2P_IF */

#if defined(WL_CFG80211_P2P_DEV_IF)
#define wdev_to_wlc_ndev(wdev, cfg)	\
	((wdev->iftype == NL80211_IFTYPE_P2P_DEVICE) ? \
	bcmcfg_to_prmry_ndev(cfg) : wdev_to_ndev(wdev))
#define cfgdev_to_wlc_ndev(cfgdev, cfg)	wdev_to_wlc_ndev(cfgdev, cfg)
#define bcmcfg_to_prmry_cfgdev(cfgdev, cfg) bcmcfg_to_prmry_wdev(cfg)
#elif defined(WL_ENABLE_P2P_IF)
#define cfgdev_to_wlc_ndev(cfgdev, cfg)	ndev_to_wlc_ndev(cfgdev, cfg)
#define bcmcfg_to_prmry_cfgdev(cfgdev, cfg) bcmcfg_to_prmry_ndev(cfg)
#else
#define cfgdev_to_wlc_ndev(cfgdev, cfg)	(cfgdev)
#define bcmcfg_to_prmry_cfgdev(cfgdev, cfg) (cfgdev)
#endif /* WL_CFG80211_P2P_DEV_IF */

#if defined(WL_CFG80211_P2P_DEV_IF)
#define ndev_to_cfgdev(ndev)	ndev_to_wdev(ndev)
#define cfgdev_to_ndev(cfgdev)  cfgdev ? (cfgdev->netdev) : NULL
#define discover_cfgdev(cfgdev, cfg) (cfgdev->iftype == NL80211_IFTYPE_P2P_DEVICE)
#else
#define ndev_to_cfgdev(ndev)	(ndev)
#define cfgdev_to_ndev(cfgdev)	(cfgdev)
#define discover_cfgdev(cfgdev, cfg) (cfgdev == cfg->p2p_net)
#endif /* WL_CFG80211_P2P_DEV_IF */

#if defined(WL_CFG80211_P2P_DEV_IF)
#define scan_req_match(cfg)	(((cfg) && (cfg->scan_request) && \
	(cfg->scan_request->wdev == cfg->p2p_wdev)) ? true : false)
#elif defined(WL_ENABLE_P2P_IF)
#define scan_req_match(cfg)	(((cfg) && (cfg->scan_request) && \
	(cfg->scan_request->dev == cfg->p2p_net)) ? true : false)
#else
#define scan_req_match(cfg)	(((cfg) && p2p_is_on(cfg) && p2p_scan(cfg)) ? \
	true : false)
#endif /* WL_CFG80211_P2P_DEV_IF */

#define wl_to_sr(w) (w->scan_req_int)
#if defined(STATIC_WL_PRIV_STRUCT)
#define wl_to_ie(w) (w->ie)
#define wl_to_conn(w) (w->conn_info)
#else
#define wl_to_ie(w) (&w->ie)
#define wl_to_conn(w) (&w->conn_info)
#endif
#define wiphy_from_scan(w) (w->escan_info.wiphy)
#define wl_get_drv_status_all(cfg, stat) \
	(wl_get_status_all(cfg, WL_STATUS_ ## stat))
#define wl_get_drv_status(cfg, stat, ndev)  \
	(wl_get_status_by_netdev(cfg, WL_STATUS_ ## stat, ndev))
#define wl_set_drv_status(cfg, stat, ndev)  \
	(wl_set_status_by_netdev(cfg, WL_STATUS_ ## stat, ndev, 1))
#define wl_clr_drv_status(cfg, stat, ndev)  \
	(wl_set_status_by_netdev(cfg, WL_STATUS_ ## stat, ndev, 2))
#define wl_clr_drv_status_all(cfg, stat)  \
	(wl_set_status_all(cfg, WL_STATUS_ ## stat, 2))
#define wl_chg_drv_status(cfg, stat, ndev)  \
	(wl_set_status_by_netdev(cfg, WL_STATUS_ ## stat, ndev, 4))

#define for_each_bss(list, bss, __i)	\
	for (__i = 0; __i < list->count && __i < WL_AP_MAX; __i++, bss = next_bss(list, bss))

#define for_each_ndev(cfg, iter, next) \
	list_for_each_entry_safe(iter, next, &cfg->net_list, list)

/* In case of WPS from wpa_supplicant, pairwise siute and group suite is 0.
 * In addtion to that, wpa_version is WPA_VERSION_1
 */
#define is_wps_conn(_sme) \
	((wl_cfgp2p_find_wpsie((u8 *)_sme->ie, _sme->ie_len) != NULL) && \
	 (!_sme->crypto.n_ciphers_pairwise) && \
	 (!_sme->crypto.cipher_group))

#ifdef WLFBT
#if defined(WLAN_AKM_SUITE_FT_8021X) && defined(WLAN_AKM_SUITE_FT_PSK)
#define IS_AKM_SUITE_FT(sec) (sec->wpa_auth == WLAN_AKM_SUITE_FT_8021X || \
	sec->wpa_auth == WLAN_AKM_SUITE_FT_PSK)
#elif defined(WLAN_AKM_SUITE_FT_8021X)
#define IS_AKM_SUITE_FT(sec) (sec->wpa_auth == WLAN_AKM_SUITE_FT_8021X)
#elif defined(WLAN_AKM_SUITE_FT_PSK)
#define IS_AKM_SUITE_FT(sec) (sec->wpa_auth == WLAN_AKM_SUITE_FT_PSK)
#else
#define IS_AKM_SUITE_FT(sec) false
#endif /* WLAN_AKM_SUITE_FT_8021X && WLAN_AKM_SUITE_FT_PSK */
#else
#define IS_AKM_SUITE_FT(sec) false
#endif /* WLFBT */

#ifdef BCMCCX
#define IS_AKM_SUITE_CCKM(sec) (sec->wpa_auth == WLAN_AKM_SUITE_CCKM)
#else
#define IS_AKM_SUITE_CCKM(sec) false
#endif /* BCMCCX */

extern s32 wl_cfg80211_attach(struct net_device *ndev, void *context);
extern s32 wl_cfg80211_attach_post(struct net_device *ndev);
extern void wl_cfg80211_detach(void *para);

extern void wl_cfg80211_event(struct net_device *ndev, const wl_event_msg_t *e,
            void *data);
void wl_cfg80211_set_parent_dev(void *dev);
struct device *wl_cfg80211_get_parent_dev(void);

extern s32 wl_cfg80211_up(void *para);
extern s32 wl_cfg80211_down(void *para);
extern s32 wl_cfg80211_notify_ifadd(int ifidx, char *name, uint8 *mac, uint8 bssidx);
extern s32 wl_cfg80211_notify_ifdel(int ifidx, char *name, uint8 *mac, uint8 bssidx);
extern s32 wl_cfg80211_notify_ifchange(int ifidx, char *name, uint8 *mac, uint8 bssidx);
extern struct net_device* wl_cfg80211_allocate_if(struct bcm_cfg80211 *cfg, int ifidx, char *name,
	uint8 *mac, uint8 bssidx);
extern int wl_cfg80211_register_if(struct bcm_cfg80211 *cfg, int ifidx, struct net_device* ndev);
extern int wl_cfg80211_remove_if(struct bcm_cfg80211 *cfg, int ifidx, struct net_device* ndev);
extern int wl_cfg80211_scan_stop(bcm_struct_cfgdev *cfgdev);
extern bool wl_cfg80211_is_concurrent_mode(void);
extern void* wl_cfg80211_get_dhdp(void);
extern bool wl_cfg80211_is_p2p_active(void);
extern void wl_cfg80211_dbg_level(u32 level);
extern s32 wl_cfg80211_get_p2p_dev_addr(struct net_device *net, struct ether_addr *p2pdev_addr);
extern s32 wl_cfg80211_set_p2p_noa(struct net_device *net, char* buf, int len);
extern s32 wl_cfg80211_get_p2p_noa(struct net_device *net, char* buf, int len);
extern s32 wl_cfg80211_set_wps_p2p_ie(struct net_device *net, char *buf, int len,
	enum wl_management_type type);
extern s32 wl_cfg80211_set_p2p_ps(struct net_device *net, char* buf, int len);

/* btcoex functions */
void* wl_cfg80211_btcoex_init(struct net_device *ndev);
void wl_cfg80211_btcoex_deinit(void);

#ifdef WL_SUPPORT_AUTO_CHANNEL
#define CHANSPEC_BUF_SIZE	1024
#define CHAN_SEL_IOCTL_DELAY	300
#define CHAN_SEL_RETRY_COUNT	15
#define CHANNEL_IS_RADAR(channel)	(((channel & WL_CHAN_RADAR) || \
	(channel & WL_CHAN_PASSIVE)) ? true : false)
#define CHANNEL_IS_2G(channel)	(((channel >= 1) && (channel <= 14)) ? \
	true : false)
#define CHANNEL_IS_5G(channel)	(((channel >= 36) && (channel <= 165)) ? \
	true : false)
extern s32 wl_cfg80211_get_best_channels(struct net_device *dev, char* command,
	int total_len);
#endif /* WL_SUPPORT_AUTO_CHANNEL */

extern int wl_cfg80211_ether_atoe(const char *a, struct ether_addr *n);
extern int wl_cfg80211_hex_str_to_bin(unsigned char *data, int dlen, char *str);
extern int wl_cfg80211_hang(struct net_device *dev, u16 reason);
extern s32 wl_mode_to_nl80211_iftype(s32 mode);
int wl_cfg80211_do_driver_init(struct net_device *net);
void wl_cfg80211_enable_trace(bool set, u32 level);
extern s32 wl_update_wiphybands(struct bcm_cfg80211 *cfg, bool notify);
extern s32 wl_cfg80211_if_is_group_owner(void);
extern  chanspec_t wl_chspec_host_to_driver(chanspec_t chanspec);
extern chanspec_t wl_ch_host_to_driver(u16 channel);
extern s32 wl_set_tx_power(struct net_device *dev,
	enum nl80211_tx_power_setting type, s32 dbm);
extern s32 wl_get_tx_power(struct net_device *dev, s32 *dbm);
extern s32 wl_add_remove_eventmsg(struct net_device *ndev, u16 event, bool add);
extern void wl_stop_wait_next_action_frame(struct bcm_cfg80211 *cfg, struct net_device *ndev);
#ifdef WL_HOST_BAND_MGMT
extern s32 wl_cfg80211_set_band(struct net_device *ndev, int band);
#endif /* WL_HOST_BAND_MGMT */
extern void wl_cfg80211_add_to_eventbuffer(wl_eventmsg_buf_t *ev, u16 event, bool set);
extern s32 wl_cfg80211_apply_eventbuffer(struct net_device *ndev,
	struct bcm_cfg80211 *cfg, wl_eventmsg_buf_t *ev);
extern void get_primary_mac(struct bcm_cfg80211 *cfg, struct ether_addr *mac);
extern void wl_cfg80211_update_power_mode(struct net_device *dev);
extern void wl_terminate_event_handler(void);
#if defined(DHD_ENABLE_BIGDATA_LOGGING)
extern s32 wl_cfg80211_get_bss_info(struct net_device *dev, char* cmd, int total_len);
extern s32 wl_cfg80211_get_connect_failed_status(struct net_device *dev, char* cmd, int total_len);
#endif /* DHD_ENABLE_BIGDATA_LOGGING */

#define SCAN_BUF_CNT	2
#define SCAN_BUF_NEXT	1
#define WL_SCANTYPE_LEGACY	0x1
#define WL_SCANTYPE_P2P		0x2
#if defined(DUAL_ESCAN_RESULT_BUFFER)
#define wl_escan_set_sync_id(a, b) ((a) = (b)->escan_info.cur_sync_id)
#define wl_escan_set_type(a, b) ((a)->escan_info.escan_type\
		[((a)->escan_info.cur_sync_id)%SCAN_BUF_CNT] = (b))
static inline wl_scan_results_t *wl_escan_get_buf(struct bcm_cfg80211 *cfg, bool aborted)
{
	u8 index;
	if (aborted) {
		if (cfg->escan_info.escan_type[0] == cfg->escan_info.escan_type[1])
			index = (cfg->escan_info.cur_sync_id + 1)%SCAN_BUF_CNT;
		else
			index = (cfg->escan_info.cur_sync_id)%SCAN_BUF_CNT;
	}
	else
		index = (cfg->escan_info.cur_sync_id)%SCAN_BUF_CNT;

	return (wl_scan_results_t *)cfg->escan_info.escan_buf[index];
}
static inline int wl_escan_check_sync_id(s32 status, u16 result_id, u16 wl_id)
{
	if (result_id != wl_id) {
		WL_ERR(("ESCAN sync id mismatch :status :%d "
			"cur_sync_id:%d coming sync_id:%d\n",
			status, wl_id, result_id));
		return -1;
	}
	else
		return 0;
}
static inline void wl_escan_print_sync_id(s32 status, u16 result_id, u16 wl_id)
{
	if (result_id != wl_id) {
		WL_ERR(("ESCAN sync id mismatch :status :%d "
			"cur_sync_id:%d coming sync_id:%d\n",
			status, wl_id, result_id));
	}
}
#define wl_escan_increment_sync_id(a, b) ((a)->escan_info.cur_sync_id += b)
#define wl_escan_init_sync_id(a) ((a)->escan_info.cur_sync_id = 0)
#else
#define wl_escan_set_sync_id(a, b) ((a) = htod16(0x1234))
#define wl_escan_set_type(a, b)
#define wl_escan_get_buf(a, b) ((wl_scan_results_t *) (a)->escan_info.escan_buf)
#define wl_escan_check_sync_id(a, b, c) 0
#define wl_escan_print_sync_id(a, b, c)
#define wl_escan_increment_sync_id(a, b)
#define wl_escan_init_sync_id(a)
#endif /* DUAL_ESCAN_RESULT_BUFFER */
extern void wl_cfg80211_ibss_vsie_set_buffer(vndr_ie_setbuf_t *ibss_vsie, int ibss_vsie_len);
extern s32 wl_cfg80211_ibss_vsie_delete(struct net_device *dev);
#ifdef WLAIBSS
extern void wl_cfg80211_set_txfail_pid(int pid);
#endif /* WLAIBSS */
extern void wl_cfg80211_set_rmc_pid(int pid);

#ifdef WLFBT
extern void wl_cfg80211_get_fbt_key(uint8 *key);
#endif

/* Action frame specific functions */
extern u8 wl_get_action_category(void *frame, u32 frame_len);
extern int wl_get_public_action(void *frame, u32 frame_len, u8 *ret_action);

#ifdef WL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST
struct net_device *wl_cfg80211_get_remain_on_channel_ndev(struct bcm_cfg80211 *cfg);
#endif /* WL_CFG80211_VSDB_PRIORITIZE_SCAN_REQUEST */

#ifdef WL_SUPPORT_ACS
#define ACS_MSRMNT_DELAY 1000 /* dump_obss delay in ms */
#define IOCTL_RETRY_COUNT 5
#define CHAN_NOISE_DUMMY -80
#define OBSS_TOKEN_IDX 15
#define IBSS_TOKEN_IDX 15
#define TX_TOKEN_IDX 14
#define CTG_TOKEN_IDX 13
#define PKT_TOKEN_IDX 15
#define IDLE_TOKEN_IDX 12
#endif /* WL_SUPPORT_ACS */

extern int wl_cfg80211_get_ioctl_version(void);
extern int wl_cfg80211_enable_roam_offload(struct net_device *dev, int enable);

#ifdef WL_NAN
extern int wl_cfg80211_nan_cmd_handler(struct net_device *ndev, char *cmd,
	int cmd_len);
#endif /* WL_NAN */

#ifdef WL_CFG80211_P2P_DEV_IF
extern void wl_cfg80211_del_p2p_wdev(void);
#endif /* WL_CFG80211_P2P_DEV_IF */

#if defined(CUSTOMER_HW4)
extern int wl_cfg80211_is_primary_device(struct net_device *ndev);
extern int wl_cfg80211_is_connected(struct net_device *ndev);
#endif /* CUSTOMER_HW4 */

#ifdef QOS_MAP_SET
extern uint8 *wl_get_up_table(void);
#endif /* QOS_MAP_SET */

#define RETURN_EIO_IF_NOT_UP(wlpriv)                        \
do {                                    \
	struct net_device *checkSysUpNDev = bcmcfg_to_prmry_ndev(wlpriv);           \
	if (unlikely(!wl_get_drv_status(wlpriv, READY, checkSysUpNDev))) {  \
		WL_INFORM(("device is not ready\n"));           \
		return -EIO;                        \
	}                               \
} while (0)

#endif /* _wl_cfg80211_h_ */


text:
===============
Pinot Connector
===============

The Pinot connector allows querying and creating tables in an external Pinot
database. This can be used to query pinot data or join pinot data with
something else.

Configuration
-------------

To configure the Pinot connector, create a catalog properties file
in ``etc/catalog`` named, for example, ``pinot.properties``, to
mount the Pinot connector as the ``pinot`` catalog.
Create the file with the following contents, replacing the
connection properties as appropriate for your setup:

.. code-block:: none

    connector.name=pinot
    pinot.controller-urls=controller_host1:9000,controller_host2:9000

Where the ``pinot.controller-urls`` property allows you to specify a
comma separated list of the pinot controller host/port pairs.

Multiple Pinot Servers
^^^^^^^^^^^^^^^^^^^^^^

You can have as many catalogs as you need, so if you have additional
Pinot clusters, simply add another properties file to ``etc/catalog``
with a different name (making sure it ends in ``.properties``). For
example, if you name the property file ``sales.properties``, Presto
will create a catalog named ``sales`` using the configured connector.

Map Pinot Schema to Presto Schema
---------------------------------

In general Pinot schema to Presto schema mapping are pretty straight forward.
By default, the data type mapping follows the table below.

.. list-table::
   :widths: 100 100
   :header-rows: 1

   * - Pinot Data Type
     - Presto Data Type
   * - INT
     - INTEGER
   * - LONG
     - BIGINT
   * - FLOAT
     - DOUBLE
   * - DOUBLE
     - DOUBLE
   * - BYTES
     - VARBINARY
   * - STRING
     - VARCHAR

Since Pinot defines each field as dimension, metric or time(date_time) field,
it's possible to infer Presto data type ``DATE`` and ``TIMESTAMP``:

- A Pinot ``TIME`` field with timeGranularity ``{ "TimeFormat":"EPOCH", "TimeUnit":"DAYS", "TimeUnitSize": 1 }`` could be map to a ``DATE`` type.
- A Pinot ``TIME`` field with timeGranularity ``{ "TimeFormat":"EPOCH", "TimeUnit":"MILLISECONDS", "TimeUnitSize": 1 }`` could be map to a ``TIMESTAMP`` type.
- A Pinot ``DATE_TIME`` field with format ``1:DAYS:EPOCH`` could be map to a ``DATE`` type.
- A Pinot ``DATE_TIME`` field with format ``1:MILLISECONDS:EPOCH`` could be map to a ``TIMESTAMP`` type.

There are a few configurations that control this behavior:

* ``pinot.infer-date-type-in-schema``: This config is false by default.
  Setting it to true will infer a Pinot ``TIME``/``DATE_TIME`` field to ``DATE`` in Presto if possible.

* ``pinot.infer-timestamp-type-in-schema``: This config is false by default.
  Setting it to true will infer a Pinot ``TIME``/``DATE_TIME`` field to ``TIMESTAMP`` in Presto if possible.

Below is an example with config: ``pinot.infer-timestamp-type-in-schema=true``.

Sample Pinot Schema:

.. code-block:: JSON

  {
    "schemaName": "meetupRsvp",
    "dimensionFieldSpecs": [
      {
        "name": "venue_name",
        "dataType": "STRING"
      },
      {
        "name": "event_name",
        "dataType": "STRING"
      },
      {
        "name": "event_id",
        "dataType": "STRING"
      },
      {
        "name": "event_time",
        "dataType": "LONG"
      },
      {
        "name": "group_city",
        "dataType": "STRING"
      },
      {
        "name": "group_country",
        "dataType": "STRING"
      },
      {
        "name": "group_id",
        "dataType": "LONG"
      },
      {
        "name": "group_name",
        "dataType": "STRING"
      }
    ],
    "metricFieldSpecs": [
      {
        "name": "rsvp_count",
        "dataType": "INT"
      }
    ],
    "timeFieldSpec": {
      "incomingGranularitySpec": {
        "name": "mtime",
        "dataType": "LONG",
        "timeType": "MILLISECONDS"
      }
    }
  }

Sample Presto Schema:

.. code-block:: none

  table_catalog | table_schema | table_name |  column_name  | ordinal_position | column_default | is_nullable | data_type |  comment  | extra_info
  ---------------+--------------+------------+---------------+------------------+----------------+-------------+-----------+-----------+------------
  pinot         | default      | meetuprsvp | venue_name    |                1 | NULL           | YES         | varchar   | DIMENSION | NULL
  pinot         | default      | meetuprsvp | rsvp_count    |                2 | NULL           | YES         | integer   | METRIC    | NULL
  pinot         | default      | meetuprsvp | group_city    |                3 | NULL           | YES         | varchar   | DIMENSION | NULL
  pinot         | default      | meetuprsvp | event_id      |                4 | NULL           | YES         | varchar   | DIMENSION | NULL
  pinot         | default      | meetuprsvp | group_country |                5 | NULL           | YES         | varchar   | DIMENSION | NULL
  pinot         | default      | meetuprsvp | group_id      |                6 | NULL           | YES         | bigint    | DIMENSION | NULL
  pinot         | default      | meetuprsvp | group_name    |                7 | NULL           | YES         | varchar   | DIMENSION | NULL
  pinot         | default      | meetuprsvp | event_name    |                8 | NULL           | YES         | varchar   | DIMENSION | NULL
  pinot         | default      | meetuprsvp | mtime         |                9 | NULL           | YES         | timestamp | TIME      | NULL
  pinot         | default      | meetuprsvp | event_time    |               10 | NULL           | YES         | bigint    | DIMENSION | NULL

Querying Pinot
--------------

The Pinot catalog exposes all pinot tables inside a flat schema. The
schema name is immaterial when querying but running ``SHOW SCHEMAS``,
will show just one schema entry of ``default``.

The name of the pinot catalog is the catalog file you created above
without the ``.properties`` extension.

For example, if you created a
file called ``mypinotcluster.properties``, you can see all the tables
in it using the command::

    SHOW TABLES from mypinotcluster.default

OR::

    SHOW TABLES from mypinotcluster.foo

Both of these commands will list all the tables in your pinot cluster.
This is because Pinot does not have a notion of schemas.

Consider you have a table called ``clicks`` in the ``mypinotcluster``.
You can see a list of the columns in the ``clicks`` table using either
of the following::

    DESCRIBE mypinotcluster.dontcare.clicks;
    SHOW COLUMNS FROM mypinotcluster.dontcare.clicks;

Finally, you can access the ``clicks`` table::

    SELECT count(*) FROM mypinotcluster.default.clicks;

How the Pinot connector works
-----------------------------

The connector tries to push the maximal subquery inferred from the
presto query into pinot. It can push down everything Pinot supports
including aggregations, group by, all UDFs etc. It generates the
correct Pinot PQL keeping Pinot's quirks in mind.

By default, it sends aggregation and limit queries to the Pinot broker
and does a parallel scan for non-aggregation/non-limit queries. The
pinot broker queries create a single split that lets the Pinot broker
do the scatter gather. Whereas, in the parallel scan mode, there is
one split created for one-or-more Pinot segments and the Pinot servers
are directly contacted by the Presto servers (ie., the Pinot broker is
not involved in the parallel scan mode)

There are a few configurations that control this behavior:

* ``pinot.prefer-broker-queries``: This config is true by default.
  Setting it to false will also create parallel plans for
  aggregation and limit queries.
* ``pinot.forbid-segment-queries``: This config is false by default.
  Setting it to true will forbid parallel querying and force all
  querying to happen via the broker.
* ``pinot.non-aggregate-limit-for-broker-queries``: To prevent
  overwhelming the broker, the connector only allows querying the
  pinot broker for ``short`` queries. We define a ``short`` query to
  be either an aggregation (or group-by) query or a query with a limit
  less than the value configured for
  ``pinot.non-aggregate-limit-for-broker-queries``. The default value
  for this limit is 25K rows.


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

import com.facebook.presto.pinot.query.PinotQueryGenerator;
import com.facebook.presto.spi.ConnectorSplit;
import com.facebook.presto.spi.HostAddress;
import com.facebook.presto.spi.schedule.NodeSelectionStrategy;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.ImmutableList;

import java.util.List;
import java.util.Optional;

import static com.facebook.presto.spi.schedule.NodeSelectionStrategy.NO_PREFERENCE;
import static com.google.common.base.MoreObjects.toStringHelper;
import static com.google.common.base.Preconditions.checkArgument;
import static java.util.Objects.requireNonNull;

public class PinotSplit
        implements ConnectorSplit
{
    private final String connectorId;
    private final SplitType splitType;
    private final List<PinotColumnHandle> expectedColumnHandles;

    // Properties needed for broker split type
    private final Optional<PinotQueryGenerator.GeneratedPinotQuery> brokerPinotQuery;

    // Properties needed for segment split type
    private final Optional<String> segmentPinotQuery;
    private final List<String> segments;
    private final Optional<String> segmentHost;
    private final Optional<Integer> grpcPort;

    @JsonCreator
    public PinotSplit(
            @JsonProperty("connectorId") String connectorId,
            @JsonProperty("splitType") SplitType splitType,
            @JsonProperty("expectedColumnHandles") List<PinotColumnHandle> expectedColumnHandles,
            @JsonProperty("brokerQuery") Optional<PinotQueryGenerator.GeneratedPinotQuery> brokerPinotQuery,
            @JsonProperty("segmentPinotQuery") Optional<String> segmentPinotQuery,
            @JsonProperty("segments") List<String> segments,
            @JsonProperty("segmentHost") Optional<String> segmentHost,
            @JsonProperty("grpcPort") Optional<Integer> grpcPort)
    {
        this.connectorId = requireNonNull(connectorId, "connector id is null");
        this.splitType = requireNonNull(splitType, "splitType id is null");
        this.expectedColumnHandles = requireNonNull(expectedColumnHandles, "expected column handles is null");
        this.brokerPinotQuery = requireNonNull(brokerPinotQuery, "brokerPinotQuery is null");
        this.segmentPinotQuery = requireNonNull(segmentPinotQuery, "segmentPinotQuery is null");
        this.segments = ImmutableList.copyOf(requireNonNull(segments, "segment is null"));
        this.segmentHost = requireNonNull(segmentHost, "host is null");
        this.grpcPort = grpcPort;

        // make sure the segment properties are present when the split type is segment
        if (splitType == SplitType.SEGMENT) {
            checkArgument(segmentPinotQuery.isPresent(), "segmentPinotQuery is missing from the split");
            checkArgument(!segments.isEmpty(), "Segments are missing from the split");
            checkArgument(segmentHost.isPresent(), "Segment host address is missing from the split");
        }
        else {
            checkArgument(brokerPinotQuery.isPresent(), "brokerPinotQuery is missing from the split");
        }
    }

    public static PinotSplit createBrokerSplit(String connectorId, List<PinotColumnHandle> expectedColumnHandles, PinotQueryGenerator.GeneratedPinotQuery brokerQuery)
    {
        return new PinotSplit(
                requireNonNull(connectorId, "connector id is null"),
                SplitType.BROKER,
                expectedColumnHandles,
                Optional.of(requireNonNull(brokerQuery, "brokerQuery is null")),
                Optional.empty(),
                ImmutableList.of(),
                Optional.empty(),
                Optional.empty());
    }

    public static PinotSplit createSegmentSplit(String connectorId, String segmentPinotQuery, List<PinotColumnHandle> expectedColumnHandles, List<String> segments, String segmentHost, int grpcPort)
    {
        return new PinotSplit(
                requireNonNull(connectorId, "connector id is null"),
                SplitType.SEGMENT,
                expectedColumnHandles,
                Optional.empty(),
                Optional.of(requireNonNull(segmentPinotQuery, "segmentPinotQuery is null")),
                requireNonNull(segments, "segments are null"),
                Optional.of(requireNonNull(segmentHost, "segmentHost is null")),
                Optional.of(grpcPort));
    }

    @JsonProperty
    public String getConnectorId()
    {
        return connectorId;
    }

    @JsonProperty
    public SplitType getSplitType()
    {
        return splitType;
    }

    @JsonProperty
    public Optional<PinotQueryGenerator.GeneratedPinotQuery> getBrokerPinotQuery()
    {
        return brokerPinotQuery;
    }

    @JsonProperty
    public Optional<String> getSegmentPinotQuery()
    {
        return segmentPinotQuery;
    }

    @JsonProperty
    public Optional<String> getSegmentHost()
    {
        return segmentHost;
    }

    @JsonProperty
    public List<String> getSegments()
    {
        return segments;
    }

    // Extract grpc host name from the segmentHost.
    // Usually segmentHost is in the format of `Server_127.0.0.1_8090`, so the hostname can be parsed from it, or will just use the entire string for that.
    public Optional<String> getGrpcHost()
    {
        if (segmentHost.isPresent()) {
            String[] hostSplits = segmentHost.get().split("_");
            return (hostSplits.length > 1) ? Optional.of(hostSplits[hostSplits.length - 2]) : segmentHost;
        }
        return Optional.empty();
    }

    @JsonProperty
    public Optional<Integer> getGrpcPort()
    {
        return grpcPort;
    }

    @Override
    public String toString()
    {
        return toStringHelper(this)
                .add("connectorId", connectorId)
                .add("splitType", splitType)
                .add("columnHandle", expectedColumnHandles)
                .add("segmentPinotQuery", segmentPinotQuery)
                .add("brokerPinotQuery", brokerPinotQuery)
                .add("segments", segments)
                .add("segmentHost", segmentHost)
                .toString();
    }

    @JsonProperty
    public List<PinotColumnHandle> getExpectedColumnHandles()
    {
        return expectedColumnHandles;
    }

    @Override
    public NodeSelectionStrategy getNodeSelectionStrategy()
    {
        return NO_PREFERENCE;
    }

    @Override
    public List<HostAddress> getPreferredNodes(List<HostAddress> sortedCandidates)
    {
        return ImmutableList.of();
    }

    @Override
    public Object getInfo()
    {
        return this;
    }

    public enum SplitType
    {
        SEGMENT,
        BROKER,
    }
}


text:
//
//  KBRadioButton.m
//  KBContactsSelectionExample
//
//  Created by Kamil Burczyk on 13.12.2014.
//  Copyright (c) 2014 Sigmapoint. All rights reserved.
//

#import "KBRadioButton.h"
#import "KBContactsSelectionViewController.h"

@implementation KBRadioButton

- (void)awakeFromNib
{
    [self addTarget:self action:@selector(redraw) forControlEvents:UIControlEventAllEvents];
}

- (void)redraw
{
    [self setNeedsDisplay];
}

- (void)drawRect:(CGRect)rect
{
    CGContextRef ctx = UIGraphicsGetCurrentContext();
    CGContextSetStrokeColorWithColor(ctx, [UIColor lightGrayColor].CGColor);

    if (self.highlighted) {
        //CGContextSetFillColorWithColor(ctx, [UIColor lightGrayColor].CGColor);
    } else if (self.selected) {

        UIImage *image = [UIImage imageNamed:@"privacy_tick.png"];
        CGRect imageRect = CGRectMake(image.size.width/4.0f , image.size.height/4.0f, image.size.width/2.0f, image.size.height/2.0f);

        CGContextTranslateCTM(ctx, 0, image.size.height);
        CGContextScaleCTM(ctx, 1.0, -1.0);

        CGContextDrawImage(ctx, imageRect, image.CGImage);

        //CGContextSetFillColorWithColor(ctx, _innerCircleFillColor.CGColor);
    } else {
        //CGContextSetFillColorWithColor(ctx, [UIColor whiteColor].CGColor);
    }
    /*
    CGContextStrokeEllipseInRect(ctx, CGRectInset(self.bounds, 2, 2));
    CGContextFillEllipseInRect(ctx, CGRectInset(self.bounds, 5, 5));
     */
}

@end


text:
class AclRepository
  include Hanami::Repository

  def self.find_by_name(name)
    query do
      where(name: name)
    end.first
  end

  def self.find_by_owner_id(id)
    query do
      where(owner_id: id)
    end
  end

end


text:
package org.febit.web.component;

/**
 *
 * @author zqq90
 */
public interface Component {

}


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"/>
<title>CmdMessenger: Class Members - Functions</title>

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

CmdMessenger
    4.0.0

CmdMessenger is a serial port messaging library for the .Net / Mono Platform.

Main Page

Packages

Classes

Class List

Class Index

Class Hierarchy

Class Members

All

Functions

Properties

Events

a

b

c

d

e

g

i

m

n

o

p

q

r

s

t

u

w

- a -

AddArgument()
: CommandMessenger.SendCommand

AddArguments()
: CommandMessenger.SendCommand

AddBinArgument()
: CommandMessenger.SendCommand

AddGeneralStrategy()
: CommandMessenger.Queue.CommandQueue

AddReceiveCommandStrategy()
: CommandMessenger.CmdMessenger

AddSendCommandStrategy()
: CommandMessenger.CmdMessenger

ArduinoAvailable()
: CommandMessenger.ConnectionManager

AsyncWorkerJob()
: CommandMessenger.AsyncWorker

Attach()
: CommandMessenger.CmdMessenger

Available()
: CommandMessenger.ReceivedCommand

<address class="footer">
Generated on Fri Apr 24 2015 23:15:52 for CmdMessenger by

 1.7.6.1
</address>


text:
package com.noctarius.borabora;

import com.noctarius.borabora.builder.WriterBuilder;
import com.noctarius.borabora.builder.encoder.GraphBuilder;
import com.noctarius.borabora.impl.WriterBuilderImpl;

/**
 * The <tt>Writer</tt> interface is used to create new writers to generate the
 * CBOR data streams from Java data structures and values. A Writer instance is
 * created using a {@link WriterBuilder} retrieved using the {@link #newBuilder()}
 * method and configured to the users needs.
 *
The same Writer instance can be used to generate multiple new streams in
 * parallel, however {@link Output} implementations and {@link GraphBuilder}
 * instances are not considered to be thread-safe and should only be used
 * by a single thread. The Writer instance can be configured once and used
 * concurrently though.

 */
public interface Writer {

    /**
     * Returns a new {@link GraphBuilder} instance bound to the given <tt>output</tt>.
     * GraphBuilders are not thread-safe by design and so are {@link Output} instances.
     * Any returns instance should only be used by a single thread!
     *
     * @param output the Output instance to bind the new builder to
     * @return a new GraphBuilder instance bound to the given output instance @
     */
    GraphBuilder newGraphBuilder(Output output);

    /**
     * Returns a new {@link WriterBuilder} instance to configure and create the final
     * Writer.
     *
     * @return a new WriterBuilder instance
     */
    static WriterBuilder newBuilder() {
        return new WriterBuilderImpl();
    }

    /**
     * Creates a new {@link Writer} instance with the default configuration. This method is a shorthand for
     *
Writer.newBuilder().build()
 and the result is equivalent.
     *
     * @return a new <tt>Writer</tt> instance with default configuration
     */
    static Writer newWriter() {
        return newBuilder().build();
    }

}


text:
// Contact Form Scripts

$(function () {

  $("#contactForm input,#contactForm textarea").jqBootstrapValidation({
    preventSubmit: true,
    submitError  : function ($form, event, errors) {
      // additional error messages or events
    },
    submitSuccess: function ($form, event) {
      event.preventDefault(); // prevent default submit behaviour
      // get values from FORM
      //var name      = $("input#name").val();
      var email     = $("input#email").val();
      //var phone     = $("input#phone").val();
      //var message   = $("textarea#message").val();

      //var firstName = name; // For Success/Failure Message
      // Check for white space in name for Success/Fail message
      //if (firstName.indexOf(' ') >= 0) {
      //  firstName = name.split(' ').slice(0, -1).join(' ');
      //}
      $.ajax({
        url     : "https://formspree.io/dosvid.org.ua@gmail.com",
        type    : "POST",
        data    : {
          //name   : name,
          email  : email,
          //message: message
        },
        dataType: 'json',
        success : function () {
          // Success message
          var $success = $('#success');
          $success.html("
");
          $success.find('.alert-success').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×")
              .append("</button>");
          $success.find('.alert-success')
              .append("Дякуємо, ми обов'язково повідомимо Вас про доступність сервісу");
          $success.find('.alert-success')
              .append('
');

          //clear all fields
          $('#contactForm').trigger("reset");
        },
        error   : function () {
          // Fail message
          var $success = $('#success');
          $success.html("
");
          $success.find('.alert-danger').html("<button type='button' class='close' data-dismiss='alert' aria-hidden='true'>×")
              .append("</button>");
          $success.find('.alert-danger').append($("").text("Вибачте , здається наш сервер не відповідає. Ви можете підписатись на нас в соцмережах"));
          $success.find('.alert-danger').append('
');
          //clear all fields
          $('#contactForm').trigger("reset");
        },
      });
    },
    filter       : function () {
      return $(this).is(":visible");
    },
  });

  $("a[data-toggle=\"tab\"]").click(function (e) {
    e.preventDefault();
    $(this).tab("show");
  });
});

/*When clicking on Full hide fail/success boxes */
$('#name').focus(function () {
  $('#success').html('');
});