text:
import { types, getEnv, getSnapshot, flow } from "mobx-state-tree";
import { observable, toJS } from "mobx";
import produce, { setAutoFreeze } from "immer";
setAutoFreeze(false);

import { ContextUserReader } from "./user";
import { asContext, mixinModel, optionalModel, IndexType, incrementLetterId } from "./model-utils";
import { pack, unpack } from "./pack";
import * as Color from "./color";

const gRef = "g";
const dot = ".";
const array = "[";
const object = "{";
const mutate = "@";

const and = "a";
const or = "o";

const add = "+";
const minus = "-";
const times = "*";
const divide = "/";
const mod = "%";

const ifOp = "?";
const switchOp = "s";
const forOp = "f";

const lessThan = "<";
const greaterThan = ">";
const lessThanOrEqual = "v";
const greaterThanOrEqual = "^";

const equal = "=";
const strictEqual = "e";
const notEqual = "!";
const notStrictEqual = "n";

const importOp = "m";
const newOp = "w";
const typeofOp = "t";
const instanceOfOp = "i";
const classOp = "c";
const thisOp = "h";
const undef = "u";

const throwOp = () => {
  throw new Error("Special-cased op...this shouldn't be run!");
};
const opFuncs = {
  [ifOp]: throwOp,
  [switchOp]: throwOp,
  [and]: throwOp,
  [or]: throwOp,
  [gRef]: typeof window !== "undefined" ? window : global,
  [undef]: undefined,
  [dot](obj, key) {
    try {
      return obj[key];
    } catch (ex) {
      return ex;
    }
  },
  [add](...nums) {
    let sum;
    for (let i = 0; i < nums.length; i++) {
      if (i === 0) {
        sum = nums[i];
      } else {
        sum += nums[i];
      }
    }
    return sum;
  },
  [minus](...nums) {
    let sum;
    for (let i = 0; i < nums.length; i++) {
      if (i === 0) {
        sum = nums[i];
      } else {
        sum -= nums[i];
      }
    }
    return sum;
  },
  [array](...items) {
    return items;
  },
  [object](...kvs) {
    const obj = {};
    for (let i = 0; i < kvs.length; i = i + 2) {
      obj[kvs[i]] = kvs[i + 1];
    }
    return obj;
  },
  [lessThan](a, b) {
    return a < b;
  },
  [strictEqual](a, b) {
    return a === b;
  }
};

const ops = [];
for (const op in opFuncs) {
  ops.push(op);
}

export const Pkg = mixinModel(optionalModel({ resolved: false }))("Pkg", {
  id: types.identifier(types.string),
  path: types.string
})
  .actions(self => {
    const { system = SystemJS } = getEnv(self);
    return {
      afterCreate: flow(function*() {
        yield system.import(self.path);
        // TODO: error handling (retry?)
        self.resolved = true;
      })
    };
  })
  .views(self => ({
    get out() {
      if (resolved) {
        return system.get(self.path);
      }
      return Pkg;
    },
    equivalent(other) {
      return other === self || other.pkg === self;
    },
    get name() {
      return self.path.replace("https://unpkg.com/", "").split("/")[0];
    },
    get color() {
      return Color.dep;
    }
  }));

const PkgRef = types.model("PkgRef", { pkg: types.reference(Pkg) }).views(self => ({
  get out() {
    return self.pkg.out;
  },
  get name() {
    return self.pkg.name;
  },
  get color() {
    return self.pkg.color;
  }
}));

const Val = types
  .model("Val", {
    val: types.union(types.number, types.string, types.boolean, types.null)
  })
  .views(self => ({
    get out() {
      return self.val;
    },
    get name() {
      const { val } = self;
      if (typeof val === "string") {
        return `'${val}'`;
      } else {
        return String(val);
      }
    },
    get color() {
      return Color.val;
    },
    get width() {
      return Math.ceil((self.name.length + 3) / 6);
    }
  }))
  .actions(self => ({
    select(val) {
      if (typeof self.val === "number") {
        const numVal = Number(val);
        if (isNaN(numVal)) {
          return;
        }
        self.val = numVal;
        return;
      }
      self.val = val;
    }
  }));

const LocaleNameSet = types.map(types.string);
const Named = optionalModel({
  names: types.optional(types.map(LocaleNameSet), {})
});

const defaultOpNames = {
  [gRef]: "🌐",
  [dot]: "•",
  [ifOp]: "IF",
  [switchOp]: "SW",
  [and]: "&&",
  [or]: "||",
  [strictEqual]: "===",
  [undef]: "U"
};

const Op = mixinModel(Named)("Op", {
  op: types.enumeration(ops)
}).views(self => ({
  get out() {
    const { op } = self;
    if (!(op in opFuncs)) {
      throw new Error(self.op + " op not yet implemented!");
    }
    const opFunc = opFuncs[op];
    return opFunc;
  },
  get name() {
    // TODO: look up from context user
    const { op } = self;
    return defaultOpNames[op] || op;
  },
  get color() {
    return Color.op;
  },
  get width() {
    return Math.ceil((self.name.length + 3) / 6);
  }
}));

const Arg = mixinModel(ContextUserReader)("Arg", {
  arg: types.refinement(types.array(types.union(types.string, IndexType)), path => {
    const { length } = path;
    if (typeof path[0] === "number" && typeof path[1] === "number") {
      return length === 2;
    }
    for (let i = 0; i < length; i++) {
      if (i === length - 1) {
        if (typeof path[i] !== "number") {
          return false;
        }
      } else if (typeof path[i] !== "string") {
        return false;
      }
    }
    return true;
  })
}).views(self => ({
  get name() {
    return self.user.pathName(self.arg);
  },
  get color() {
    return Color.input;
  },
  get width() {
    return Math.ceil((self.name.length + 3) / 6);
  }
}));

// TODO: cleanup, refine this type definition
export const RefPath = types.union(
  types.string,
  types.refinement(types.array(types.union(IndexType, types.string)), ref => {
    const { length } = ref;
    if (typeof ref[0] === "number") {
      return length === 2 && typeof ref[1] === "string";
    }
    for (let i = 0; i < length; i++) {
      if (typeof ref[i] !== "string") {
        return false;
      }
    }
    return true;
  })
);

const Ref = mixinModel(ContextUserReader)("Ref", {
  ref: RefPath
}).views(self => ({
  get name() {
    const { ref } = self;
    return self.user.pathName(ref) || `(${ref.slice()})`;
  },
  get color() {
    return Color.pending;
  },
  get width() {
    return Math.ceil((self.name.length + 3) / 6);
  }
}));

const Node = types.union(Val, Op, Arg, Ref, PkgRef);

const Line = types.array(Node);

const walkPath = (base, up, walk) => {
  const finalPath = [...base];
  while (up--) {
    finalPath.pop();
  }
  for (const token of walk) {
    finalPath.push(token);
  }
  return finalPath;
};

const Dec = types.array(types.union(types.string, Line, types.late(() => Dec)));

const paramTypeEnum = {
  any: "A",
  num: "N",
  string: "S",
  bool: "B"
};

const paramTypeEnumList = [];
for (const enumKey in paramTypeEnum) {
  paramTypeEnumList.push(paramTypeEnum[enumKey]);
}

const ParamType = types.maybe(types.enumeration("ParamType", paramTypeEnumList));

const Param = optionalModel("Param", {
  type: types.maybe(types.string),
  validator: types.maybe(RefPath),
  rest: false
});

export const Group = mixinModel(
  optionalModel({
    name: types.maybe(types.string),
    decs: types.optional(types.array(types.string), [])
  })
)("Group", {
  id: types.identifier(types.string)
}).actions(self => ({
  add(decId) {
    const { decs } = self;
    const current = decs.find(d => d === decId);
    if (current === undefined) {
      decs.push(decId);
    }
  },
  moveUp(index) {
    const { decs } = self;
    if (index < 1) {
      return;
    }
    const swapIndex = index - 1;
    const swapItem = decs[swapIndex];
    decs[swapIndex] = decs[index];
    decs[index] = swapItem;
  },
  moveDown(index) {
    const { decs } = self;
    if (index >= decs.length - 1) {
      return;
    }
    const swapIndex = index + 1;
    const swapItem = decs[swapIndex];
    decs[swapIndex] = decs[index];
    decs[index] = swapItem;
  }
}));

export const ParamAspect = types
  .compose(
    "ParamAspect",
    ContextUserReader,
    optionalModel({
      params: types.optional(types.map(types.array(types.maybe(Param))), {})
    })
  )
  .views(self => ({
    get fullParams() {
      const plainParams = getSnapshot(self.params);
      return produce(plainParams, draft => {
        const fillParamsFrom = dec => {
          if (dec instanceof Array) {
            for (const node of dec) {
              if ("arg" in node) {
                const { arg } = node;
                const scopePath = arg.slice(0, -1);
                const index = arg[arg.length - 1];
                if (!draft[scopePath]) {
                  draft[scopePath] = [];
                }
                if (!draft[scopePath][index]) {
                  draft[scopePath][index] = {};
                  draft[scopePath][index].name = self.user.pathName(arg);
                }
              }
            }
            return;
          }
          dec.forEach((_, id) => {
            fillParamsFrom(dec.get(id));
          });
        };
        fillParamsFrom(self.main);
      });
    }
  }))
  .actions(self => ({
    addParam(path) {
      const pathKey = path.join(",");
      const { params } = self;
      if (!params.has(pathKey)) {
        params.set(pathKey, []);
      }
      params.get(pathKey).splice(0, 0, {});
    }
  }));

window.j = toJS;
export const SampleAspect = optionalModel("SampleAspect", {
  sampleLists: types.optional(types.map(types.array(types.array(types.union(Val, Ref, Op, PkgRef)))), {})
}).views(self => ({
  fullSample(mainId, sampleIndex = 0) {
    const { getDec, main, sampleLists } = self;
    const sampleList = sampleLists.get(mainId);
    if (!sampleList) {
      return null;
    }
    const sample = sampleList[sampleIndex];
    const sampleKey = `${mainId}-${sampleIndex}`;
    const copyFromDec = decToCopy => {
      const subCopyFromDec = (parent, sampleParent, id) => {
        // const sampleMainKey = `${id}${sampleKey}`;
        let thisDec;
        if (id == null) {
          thisDec = parent;
        } else {
          thisDec = parent.get(id);
        }
        if (thisDec instanceof Array) {
          if (id == null) {
            throw new Error("naw girl");
          }
          sampleParent.set(id, []);
          const sampleDec = sampleParent.get(id);
          for (let i = 0; i < thisDec.length; i++) {
            const node = thisDec[i];
            if ("arg" in node) {
              const { arg } = node;
              // if (arg.slice(0, -1).join(",") === mainId.join(",")) {
              if (arg[0] === mainId) {
                sampleDec[i] = sample[arg[arg.length - 1]];
              }
            } else if ("ref" in node && node.ref[0] === mainId) {
              sampleDec[i] = { ref: [sampleKey, ...node.ref.slice(1)] };
            } else {
              sampleDec[i] = node;
            }
          }
          return;
        }
        // sampleParent.set(id, new Map());
        if (id != null) {
          sampleParent.set(id, observable.map());
        }
        thisDec.forEach((_, subId) => {
          subCopyFromDec(thisDec, sampleParent, subId);
        });
      };
      const sampleResult = observable.map();
      subCopyFromDec(decToCopy, sampleResult);
      return sampleResult;
    };
    const decToCopy = getDec(mainId);
    // console.log("copying dec", decToCopy.toJSON());
    return copyFromDec(decToCopy);
  }
}));

export const Repo = mixinModel(ParamAspect, SampleAspect)("Repo", {
  main: Dec,
  packages: types.optional(types.map(Pkg), {}),
  groups: types.optional(types.map(Group), {}),
  comments: types.optional(types.map(types.array(types.string)), {})
})
  .views(self => ({
    get full() {
      const { main, fullSample } = self;
      const testSample = fullSample("o");
      const full = observable.map(main);
      full.set("o-0", testSample);
      return full;
    },
    getDec(path) {
      let dec = self.main;
      for (const id of path) {
        dec = dec.get(id);
      }
      return dec;
    },
    get out() {
      return self.run();
    },
    run(...initialPath) {
      const { main } = self;
      const gen = (path = [], scopes = {}) => {
        let dec = main;
        for (const id of path) {
          dec = dec.get(id);
        }
        if (dec instanceof Array) {
          if (!dec.length) {
            return undefined; // maybe return some special "pending" symbol instead?
          }
          const parseNode = node => {
            if ("out" in node) {
              return node.out;
            } else if ("ref" in node) {
              const { ref } = node;
              if (typeof ref === "string") {
                return gen([ref], scopes);
              } else {
                return gen(ref, scopes);
              }
            } else if ("arg" in node) {
              const { arg } = node;
              const scopePath = arg.length === 1 ? "" : arg.slice(0, -1);
              const index = arg[arg.length - 1];
              return scopes[scopePath][index];
            }
          };
          // special-case handling of conditional ops
          // for short-circuiting ("lazy evaluation") flow control behavior
          // as would be expected in plain JS
          const [{ op }] = dec;
          switch (op) {
            case ifOp:
              const cond = parseNode(dec[1]);
              if (cond) {
                return parseNode(dec[2]);
              } else {
                return parseNode(dec[3]);
              }
              break;
            case and:
              let andResult;
              for (let i = 1; i < dec.length; i++) {
                andResult = parseNode(dec[i]);
                if (!andResult) {
                  return andResult;
                }
              }
              return andResult;
              break;
            case or:
              let orResult;
              for (let i = 1; i < dec.length; i++) {
                orResult = parseNode(dec[i]);
                if (orResult) {
                  return orResult;
                }
              }
              return orResult;
              break;
            case switchOp:
              // TODO: try to generate a proper switch statement
              // but this requires "eval" or the Function constructor
              const [, switcherNode, ...casePairs] = dec;
              const { length } = casePairs;
              const switcher = parseNode(switcherNode);
              for (let i = 0; i < length; i += 2) {
                if (switcher === parseNode(casePairs[i])) {
                  return parseNode(casePairs[i + 1]);
                }
              }
              if (length % 2) {
                return parseNode(casePairs[length - 1]);
              }
              // throwing for now, but maybe that's too strict
              throw new Error("Switch case not matched. No default case defined.");
              break;
          }
          // TODO: short-circuit "for"?
          const outs = dec.map(parseNode);
          const [head, ...args] = outs;
          return typeof head === "function" ? head(...args) : head;
        }
        return function(...params) {
          scopes[path] = params;
          const retLine = gen([...path, "R"], scopes);
          return retLine;
        };
      };
      return gen(initialPath);
    }
  }))
  .actions(self => {
    const { getDec } = self;
    return {
      addToDec(scopePath, item = []) {
        const scope = getDec(scopePath);
        const ids = scope.keys();
        const lastId = ids[ids.length - 1];
        let newId = incrementLetterId(lastId);
        while (scope.get(newId)) {
          newId = incrementLetterId(newId);
        }
        scope.set(newId, item);
        return [...scopePath, newId];
      },
      addNode(item, path, index) {
        const dec = getDec(path);
        if (index === undefined) {
          index = dec.length - 1;
        }
        dec.splice(index, 0, item);
      },
      deleteFromDec(path, index) {
        if (index === undefined) {
          const scope = getDec(path.slice(0, -1));
          scope.delete(path[path.length - 1]);
          return;
        }
        const dec = getDec(path);
        dec.splice(index, 1);
      }
    };
  });

export const ContextRepo = asContext(Repo);


text:
LeetCode wants to give one of its best employees the option to travel among N cities to collect algorithm problems. But all work and no play makes Jack a dull boy, you could take vacations in some particular cities and weeks. Your job is to schedule the traveling to maximize the number of vacation days you could take, but there are certain rules and restrictions you need to follow.

Rules and restrictions:
1. You can only travel among N cities, represented by indexes from 0 to N-1. Initially, you are in the city indexed 0 on Monday.
2. The cities are connected by flights. The flights are represented as a N*N matrix (not necessary symmetrical), called flights representing the airline status from the city i to the city j. If there is no flight from the city i to the city j, flights[i][j] = 0; Otherwise, flights[i][j] = 1. Also, flights[i][i] = 0 for all i.
3. You totally have K weeks (each week has 7 days) to travel. You can only take flights at most once per day and can only take flights on each week's Monday morning. Since flight time is so short, we don't consider the impact of flight time.
4. For each city, you can only have restricted vacation days in different weeks, given an N*K matrix called days representing this relationship. For the value of days[i][j], it represents the maximum days you could take vacation in the city i in the week j.
5. You're given the flights matrix and days matrix, and you need to output the maximum vacation days you could take during K weeks.

### Example 1:
```
Input:flights = [[0,1,1],[1,0,1],[1,1,0]], days = [[1,3,1],[6,0,3],[3,3,3]]
Output: 12
Explanation:
Ans = 6 + 3 + 3 = 12.

One of the best strategies is:
1st week : fly from city 0 to city 1 on Monday, and play 6 days and work 1 day.
(Although you start at city 0, we could also fly to and start at other cities since it is Monday.)
2nd week : fly from city 1 to city 2 on Monday, and play 3 days and work 4 days.
3rd week : stay at city 2, and play 3 days and work 4 days.
```
### Example 2:
```
Input:flights = [[0,0,0],[0,0,0],[0,0,0]], days = [[1,1,1],[7,7,7],[7,7,7]]
Output: 3
Explanation:
Ans = 1 + 1 + 1 = 3.

Since there is no flights enable you to move to another city, you have to stay at city 0 for the whole 3 weeks.
For each week, you only have one day to play and six days to work.
So the maximum number of vacation days is 3.
```
### Example 3:
```
Input:flights = [[0,1,1],[1,0,1],[1,1,0]], days = [[7,0,0],[0,7,0],[0,0,7]]
Output: 21
Explanation:
Ans = 7 + 7 + 7 = 21

One of the best strategies is:
1st week : stay at city 0, and play 7 days.
2nd week : fly from city 0 to city 1 on Monday, and play 7 days.
3rd week : fly from city 1 to city 2 on Monday, and play 7 days.
```
### Note:
1. N and K are positive integers, which are in the range of [1, 100].
2. In the matrix flights, all the values are integers in the range of [0, 1].
3. In the matrix days, all the values are integers in the range [0, 7].
4. You could stay at a city beyond the number of vacation days, but you should work on the extra days, which won't be counted as vacation days.
5. If you fly from the city A to the city B and take the vacation on that day, the deduction towards vacation days will count towards the vacation days of city B in that week.
6. We don't consider the impact of flight hours towards the calculation of vacation days.

## Solution:
### Intuitive Approach
Starting from each city, when moving to the next week, add the days when there is connection. In a DFS fashion, enumerate every path and find out the max value.

### Dynamic Programming Approach
Let DP variable `dp[i][k]` be the max vacation day start from city i in week k, where `i = [0, N), k = [0, K)`.

The key for this problem is *the max vacation days starting from city i on week k doesn't depend on week k-1, but on week k+1 and of course subject to connectivity constraints*. This means even we have `dp[.][k]` on week k, after seeing new information days[k+1] we need to update `dp[.][k]`, but not the other way. Hence we will propagate the dp matrix backward from day K-1 to day 0.

The final answer is `dp[0][0]`.

#GOOGL
#GOOGL.MJ

#Dynamic Programming

redpajama_set_name: RedPajamaGithub


text:
package Mojolicious::Command::prefork;
use Mojo::Base 'Mojolicious::Command';

use Getopt::Long qw(GetOptionsFromArray :config no_auto_abbrev no_ignore_case);
use Mojo::Server::Prefork;

has description =>
  'Start application with preforking HTTP and WebSocket server';
has usage => sub { shift->extract_usage };

sub run {
  my ($self, @args) = @_;

  my $prefork = Mojo::Server::Prefork->new(app => $self->app);
  GetOptionsFromArray \@args,
    'a|accepts=i'            => sub { $prefork->accepts($_[1]) },
    'b|backlog=i'            => sub { $prefork->backlog($_[1]) },
    'c|clients=i'            => sub { $prefork->max_clients($_[1]) },
    'G|graceful-timeout=i'   => sub { $prefork->graceful_timeout($_[1]) },
    'I|heartbeat-interval=i' => sub { $prefork->heartbeat_interval($_[1]) },
    'H|heartbeat-timeout=i'  => sub { $prefork->heartbeat_timeout($_[1]) },
    'i|inactivity-timeout=i' => sub { $prefork->inactivity_timeout($_[1]) },
    'l|listen=s'       => \my @listen,
    'M|multi-accept=i' => sub { $prefork->multi_accept($_[1]) },
    'P|pid-file=s'     => sub { $prefork->pid_file($_[1]) },
    'p|proxy'          => sub { $prefork->reverse_proxy(1) },
    'r|requests=i'     => sub { $prefork->max_requests($_[1]) },
    'w|workers=i'      => sub { $prefork->workers($_[1]) };

  $prefork->listen(\@listen) if @listen;
  $prefork->run;
}

1;

=encoding utf8

=head1 NAME

Mojolicious::Command::prefork - Prefork command

=head1 SYNOPSIS

  Usage: APPLICATION prefork [OPTIONS]

    ./myapp.pl prefork
    ./myapp.pl prefork -m production -l http://*:8080
    ./myapp.pl prefork -l http://127.0.0.1:8080 -l https://[::]:8081
    ./myapp.pl prefork -l 'https://*:443?cert=./server.crt&key=./server.key'

  Options:
    -a, --accepts <number>               Number of connections for workers to
                                         accept, defaults to 1000
    -b, --backlog <size>                 Listen backlog size, defaults to
                                         SOMAXCONN
    -c, --clients <number>               Maximum number of concurrent
                                         connections, defaults to 1000
    -G, --graceful-timeout <seconds>     Graceful timeout, defaults to 20.
    -I, --heartbeat-interval <seconds>   Heartbeat interval, defaults to 5
    -H, --heartbeat-timeout <seconds>    Heartbeat timeout, defaults to 20
    -h, --help                           Show this summary of available options
        --home <path>                    Path to home directory of your
                                         application, defaults to the value of
                                         MOJO_HOME or auto-detection
    -i, --inactivity-timeout <seconds>   Inactivity timeout, defaults to the
                                         value of MOJO_INACTIVITY_TIMEOUT or 15
    -l, --listen <location>              One or more locations you want to
                                         listen on, defaults to the value of
                                         MOJO_LISTEN or "http://*:3000"
    -M, --multi-accept <number>          Number of connections to accept at
                                         once, defaults to 50
    -m, --mode <name>                    Operating mode for your application,
                                         defaults to the value of
                                         MOJO_MODE/PLACK_ENV or "development"
    -P, --pid-file <path>                Path to process id file, defaults to
                                         "prefork.pid" in a temporary diretory
    -p, --proxy                          Activate reverse proxy support,
                                         defaults to the value of
                                         MOJO_REVERSE_PROXY
    -r, --requests <number>              Maximum number of requests per
                                         keep-alive connection, defaults to 25
    -w, --workers <number>               Number of workers, defaults to 4

=head1 DESCRIPTION

L<Mojolicious::Command::prefork> starts applications with the
L<Mojo::Server::Prefork> backend.

This is a core command, that means it is always enabled and its code a good
example for learning to build new commands, you're welcome to fork it.

See L<Mojolicious::Commands/"COMMANDS"> for a list of commands that are
available by default.

=head1 ATTRIBUTES

L<Mojolicious::Command::prefork> inherits all attributes from
L<Mojolicious::Command> and implements the following new ones.

=head2 description

  my $description = $prefork->description;
  $prefork        = $prefork->description('Foo');

Short description of this command, used for the command list.

=head2 usage

  my $usage = $prefork->usage;
  $prefork  = $prefork->usage('Foo');

Usage information for this command, used for the help screen.

=head1 METHODS

L<Mojolicious::Command::prefork> inherits all methods from
L<Mojolicious::Command> and implements the following new ones.

=head2 run

  $prefork->run(@ARGV);

Run this command.

=head1 SEE ALSO

L<Mojolicious>, L<Mojolicious::Guides>, L<http://mojolicious.org>.

=cut


text:
<!doctype html>

  <meta charset="utf-8">

  <title>Component ListItem</title>

  <link rel="stylesheet" href="../../../css/fabric.css">
  <link rel="stylesheet" href="ListItem.css">

ListItem

  Alton Lafferty
  Meeting notes
  Today we discussed the importance of a, b, and c in regards to d.
  2:42p

  Alton Lafferty
  Meeting notes
  Today we discussed the importance of a, b, and c in regards to d.
  2:42p

  Alton Lafferty
  Meeting notes
  Today we discussed the importance of a, b, and c in regards to d.
  2:42p

  Alton Lafferty
  Meeting notes
  Today we discussed the importance of a, b, and c in regards to d.
  2:42p

  Alton Lafferty
  Meeting notes
  Today we discussed the importance of a, b, and c in regards to d.
  2:42p

  Alton Lafferty
  Meeting notes
  Today we discussed the importance of a, b, and c in regards to d.
  2:42p

  Perdivn Pitch.mp3
  08/11/14 12:32p


text:
package com.intellij.openapi.vcs.changes.actions.diff;

import com.intellij.openapi.extensions.ExtensionPointName;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.UserDataHolder;
import com.intellij.diff.chains.DiffRequestProducerException;
import com.intellij.diff.requests.DiffRequest;
import com.intellij.openapi.vcs.changes.Change;
import com.intellij.util.ThreeState;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public interface ChangeDiffRequestProvider {
  ExtensionPointName<ChangeDiffRequestProvider> EP_NAME =
    ExtensionPointName.create("com.intellij.openapi.vcs.changes.actions.diff.ChangeDiffRequestProvider");

  @NotNull
  ThreeState isEquals(@NotNull Change change1, @NotNull Change change2);

  boolean canCreate(@Nullable Project project, @NotNull Change change);

  @NotNull
  DiffRequest process(@NotNull ChangeDiffRequestProducer presentable,
                      @NotNull UserDataHolder context,
                      @NotNull ProgressIndicator indicator) throws ProcessCanceledException;
}


text:
require 'active_model_serializers'

module Spree
  module Wombat
    class RefundSerializer < ActiveModel::Serializer
      attributes :reason, :amount, :description
      has_one :payment, serializer: Spree::Wombat::PaymentSerializer

      def reason
        object.reason.try(:name)
      end
    end
  end
end


text:
package net.incivility.fantastchat.entity;

/**
 * Created by Administrator on 2016/5/4.
 */
public class VerifyBean {

    private String id;
    private String msg;

    public VerifyBean(String id, String msg) {
        this.id = id;
        this.msg = msg;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}


text:
package io.selendroid.server.grid;

import io.selendroid.SelendroidCapabilities;
import io.selendroid.SelendroidConfiguration;
import io.selendroid.exceptions.SelendroidException;
import io.selendroid.server.model.SelendroidStandaloneDriver;
import io.selendroid.server.util.HttpClientUtil;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;

import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.entity.StringEntity;
import org.apache.http.message.BasicHttpEntityEnclosingRequest;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.openqa.selenium.remote.CapabilityType;

public class SelfRegisteringRemote {
  private static final Logger log = Logger.getLogger(SelfRegisteringRemote.class.getName());
  private SelendroidConfiguration config;
  private SelendroidStandaloneDriver driver;

  public SelfRegisteringRemote(SelendroidConfiguration config, SelendroidStandaloneDriver driver) {
    this.config = config;
    this.driver = driver;
  }

  public void performRegistration() throws Exception {
    String tmp = config.getRegistrationUrl();

    HttpClient client = HttpClientUtil.getHttpClient();

    URL registration = new URL(tmp);
    if (log.isLoggable(Level.INFO)) {
      log.info("Registering selendroid node to Selenium Grid hub :" + registration);
    }
    BasicHttpEntityEnclosingRequest r =
        new BasicHttpEntityEnclosingRequest("POST", registration.toExternalForm());
    JSONObject nodeConfig = getNodeConfig();
    r.setEntity(new StringEntity(nodeConfig.toString()));

    HttpHost host = new HttpHost(registration.getHost(), registration.getPort());
    HttpResponse response = client.execute(host, r);
    if (response.getStatusLine().getStatusCode() != 200) {
      throw new SelendroidException("Error sending the registration request.");
    }
  }

  private JSONObject getNodeConfig() {
    JSONObject res = new JSONObject();
    try {
      res.put("class", "org.openqa.grid.common.RegistrationRequest");
      res.put("configuration", getConfiguration());
      JSONArray caps = new JSONArray();
      JSONArray devices = driver.getSupportedDevices();
      for (int i = 0; i < devices.length(); i++) {
        JSONObject device = (JSONObject) devices.get(i);
        JSONObject capa = new JSONObject();
        capa.put(SelendroidCapabilities.SCREEN_SIZE,
            device.getString(SelendroidCapabilities.SCREEN_SIZE));
        String version = device.getString(SelendroidCapabilities.PLATFORM_VERSION);
        capa.put(SelendroidCapabilities.PLATFORM_VERSION, version);
        capa.put(SelendroidCapabilities.EMULATOR, device.getString(SelendroidCapabilities.EMULATOR));
        capa.put(CapabilityType.BROWSER_NAME, "selendroid");
        capa.put(CapabilityType.PLATFORM, "ANDROID");
        capa.put(CapabilityType.VERSION, version);
        caps.put(capa);
      }
      res.put("capabilities", caps);
    } catch (JSONException e) {
      throw new SelendroidException(e.getMessage(), e);
    }

    return res;
  }

  /**
   * Extracts the configuration.
   *
   * @return The configuration
   * @throws JSONException On JSON errors.
   */
  private JSONObject getConfiguration() throws JSONException {
    JSONObject configuration = new JSONObject();

    configuration.put("port", config.getPort());
    configuration.put("register", true);

    if (config.getProxy() != null) {
      configuration.put("proxy", config.getProxy());
    } else {
      configuration.put("proxy", "org.openqa.grid.selenium.proxy.DefaultRemoteProxy");
    }
    configuration.put("role", "node");
    configuration.put("registerCycle", 5000);
    configuration.put("maxInstances", 5);

    // adding hub details
    URL registrationUrl;
    try {
      registrationUrl = new URL(config.getRegistrationUrl());
    } catch (MalformedURLException e) {
      e.printStackTrace();
      throw new SelendroidException("Grid hub url cannot be parsed: " + e.getMessage());
    }
    configuration.put("hubHost", registrationUrl.getHost());
    configuration.put("hubPort", registrationUrl.getPort());

    // adding driver details
    configuration.put("remoteHost", "http://" + config.getServerHost() + ":" + config.getPort());
    return configuration;
  }
}


text:
<?php

require_once 'Mime/Type/Magic/Adapter/Apache.php';

class Mime_Type_Magic_Adapter_ApacheTest extends PHPUnit_Framework_TestCase {

	public $subject;

	protected $_files;
	protected $_data;

	protected function setUp() {
		$this->_files = dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))) . '/data';
		$this->_data = dirname(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__))))))) .'/data';
	}

	public function testToArray() {
		$file = $this->_files . '/magic_apache_snippet.db';
		$this->subject = new Mime_Type_Magic_Adapter_Apache(compact('file'));

		$result = $this->subject->to('array');
		$this->assertEquals(38, count($result));
	}

	public function testAnalyzeFail() {
		$file = $this->_files . '/magic_apache_snippet.db';
		$this->subject = new Mime_Type_Magic_Adapter_Apache(compact('file'));

		$handle = fopen('php://memory', 'rb');
		$result = $this->subject->analyze($handle);
		fclose($handle);
		$this->assertNull($result);
	}

	public function testIntegrationShipped() {
		$file = $this->_files . '/magic_apache_snippet.db';
		$this->subject = new Mime_Type_Magic_Adapter_Apache(compact('file'));

		/* @todo Commented fail but should are present in data */
		$files = array(
			'image_gif.gif' => 'image/gif',
			'application_pdf.pdf' => 'application/pdf',
			'postscript_snippet.ps' => 'application/postscript',
			'wave_snippet.wav' => 'audio/x-wav',
			// 'gzip_snippet.gz' => 'application/x-gzip',
			'text_html_snippet.html' => 'text/html',
			'image_jpeg_snippet.jpg' => 'image/jpeg',
			'text_rtf_snippet.rtf' => 'application/rtf',
			// 'ms_word_snippet.doc' => 'application/msword',
			// 'audio_mpeg_snippet.mp3' => 'audio/mpeg',
			// 'text_plain_snippet.txt' => 'text/plain'
		);

		foreach ($files as $file => $mimeTypes) {
			$handle = fopen($this->_files . '/' . $file, 'rb');
			$this->assertContains($this->subject->analyze($handle), (array) $mimeTypes, "File `{$file}`.");
			fclose($handle);
		}
	}
}

?>


text:
package com.siyeh.ig.errorhandling;

import com.intellij.openapi.util.Ref;
import com.intellij.psi.*;
import com.intellij.psi.controlFlow.DefUseUtil;
import com.intellij.psi.util.InheritanceUtil;
import com.intellij.psi.util.PsiTreeUtil;
import com.siyeh.InspectionGadgetsBundle;
import com.siyeh.ig.BaseInspection;
import com.siyeh.ig.BaseInspectionVisitor;
import com.siyeh.ig.psiutils.ExpressionUtils;
import com.siyeh.ig.psiutils.ParenthesesUtils;
import com.siyeh.ig.psiutils.TypeUtils;
import com.siyeh.ig.psiutils.VariableSearchUtils;
import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * @author Bas Leijdekkers
 */
public class UnnecessaryInitCauseInspectionBase extends BaseInspection {
  @Nls
  @NotNull
  @Override
  public String getDisplayName() {
    return InspectionGadgetsBundle.message("unnecessary.initcause.display.name");
  }

  @NotNull
  @Override
  protected String buildErrorString(Object... infos) {
    return InspectionGadgetsBundle.message("unnecessary.initcause.problem.descriptor");
  }

  @Override
  public BaseInspectionVisitor buildVisitor() {
    return new UnnecessaryInitCauseVisitor();
  }

  private static class UnnecessaryInitCauseVisitor extends BaseInspectionVisitor {

    @Override
    public void visitMethodCallExpression(PsiMethodCallExpression expression) {
      super.visitMethodCallExpression(expression);
      final PsiReferenceExpression methodExpression = expression.getMethodExpression();
      final String name = methodExpression.getReferenceName();
      if (!"initCause".equals(name)) {
        return;
      }
      final PsiExpressionList argumentList = expression.getArgumentList();
      final PsiExpression argument = ExpressionUtils.getOnlyExpressionInList(argumentList);
      if (!TypeUtils.expressionHasTypeOrSubtype(argument, CommonClassNames.JAVA_LANG_THROWABLE)) {
        return;
      }
      final PsiMethod method = expression.resolveMethod();
      if (method == null) {
        return;
      }
      final PsiClass aClass = method.getContainingClass();
      if (aClass == null || !CommonClassNames.JAVA_LANG_THROWABLE.equals(aClass.getQualifiedName())) {
        return;
      }
      final PsiExpression qualifier = ParenthesesUtils.stripParentheses(methodExpression.getQualifierExpression());
      final PsiNewExpression newExpression = findNewExpression(qualifier);
      if (!isCauseConstructorAvailable(newExpression) || !canExpressionBeMovedBackwards(argument, newExpression)) {
        return;
      }
      registerMethodCallError(expression);
    }

    private static boolean canExpressionBeMovedBackwards(final PsiExpression cause, final PsiExpression newLocation) {
      if (cause == null || newLocation == null) return false;
      assert cause.getTextOffset() > newLocation.getTextOffset();
      final PsiCodeBlock block = PsiTreeUtil.getParentOfType(cause, PsiCodeBlock.class);
      final PsiCodeBlock newBlock = PsiTreeUtil.getParentOfType(newLocation, PsiCodeBlock.class);
      if (block == null || newBlock == null || !PsiTreeUtil.isAncestor(block, newBlock, false)) return false;
      final int offset = newLocation.getTextOffset();
      final Ref<Boolean> result = new Ref<Boolean>(Boolean.TRUE);
      cause.accept(new JavaRecursiveElementWalkingVisitor() {
        @Override
        public void visitReferenceExpression(PsiReferenceExpression expression) {
          if (!result.get().booleanValue()) {
            return;
          }
          super.visitReferenceExpression(expression);
          final PsiElement target = expression.resolve();
          if (!(target instanceof PsiVariable)) {
            return;
          }
          final PsiElement[] defs = DefUseUtil.getDefs(block, (PsiVariable)target, cause);
          for (PsiElement def : defs) {
            if (def.getTextOffset() > offset) {
              result.set(Boolean.FALSE);
            }
          }
        }
      });
      return result.get().booleanValue();
    }

    public static boolean isCauseConstructorAvailable(PsiNewExpression newExpression) {
      if (newExpression == null) {
        return false;
      }
      final PsiMethod constructor = newExpression.resolveConstructor();
      if (constructor == null) {
        return false;
      }
      final PsiClass aClass = constructor.getContainingClass();
      if (aClass == null) {
        return false;
      }
      final PsiExpressionList argumentList = newExpression.getArgumentList();
      if (argumentList == null) {
        return false;
      }
      final PsiExpression[] arguments = argumentList.getExpressions();
      outer:
      for (PsiMethod constructor1 : aClass.getConstructors()) {
        final PsiParameterList parameterList = constructor1.getParameterList();
        if (parameterList.getParametersCount() == arguments.length + 1) {
          final PsiParameter[] parameters = parameterList.getParameters();
          for (int i = 0; i < arguments.length; i++) {
            final PsiExpression argument = arguments[i];
            final PsiParameter parameter = parameters[i];
            final PsiType type = argument.getType();
            if (type == null || !parameter.getType().isAssignableFrom(type)) {
              continue outer;
            }
          }
          final PsiParameter lastParameter = parameters[parameters.length - 1];
          final PsiType type = lastParameter.getType();
          if (InheritanceUtil.isInheritor(type, CommonClassNames.JAVA_LANG_THROWABLE)) {
            return true;
          }
        }
      }
      return false;
    }
  }

  @Nullable
  static PsiNewExpression findNewExpression(PsiExpression expression) {
    if (expression instanceof PsiNewExpression) {
      return (PsiNewExpression)expression;
    }
    else if (expression instanceof PsiReferenceExpression) {
      final PsiReferenceExpression referenceExpression = (PsiReferenceExpression)expression;
      final PsiExpression definition = VariableSearchUtils.findDefinition(referenceExpression, null);
      if (!(definition instanceof PsiNewExpression)) {
        return null;
      }
      return (PsiNewExpression) definition;
    }
    return null;
  }
}


text:
require 'spec_helper'

describe Dossier::Responder do

  def mock_out_report_results(report)
    report.tap { |r|
      allow(r).to receive(:results).and_return(results)
      allow(r).to receive(:raw_results).and_return(results)
    }
  end

  let(:results)    { double(arrays: [%w[hi], %w[there]], hashes: [{hi: 'there'}]) }
  let(:report)     { EmployeeReport.new }
  let(:reports)    { [mock_out_report_results(report)] }

  let(:controller) {
    ActionController::Base.new.tap { |controller|
      controller.response = ActionDispatch::TestResponse.new(200, {}, [''])
    }
  }
  let(:responder)  { described_class.new(controller, reports, {}) }

  describe "to_html" do
    it "calls render on the report" do
      expect(report).to receive(:render)
      responder.to_html
    end
  end

  describe "to_json" do
    it "renders the report as json" do
      expect(controller).to receive(:render).with(json: results.hashes)
      responder.to_json
    end
  end

  describe "to_csv" do
    it "sets the content disposition" do
      expect(responder).to receive(:set_content_disposition!)
      responder.to_csv
    end

    it "sets the response body to a new csv streamer instance" do
      responder.to_csv
      expect(responder.controller.response_body).to be_a(Dossier::StreamCSV)
    end

    it "formats the headers that are passed to Dossier::StreamCSV" do
      expect(report).to receive(:format_header).with('hi')
      responder.to_csv
    end
  end

  describe "to_xls" do
    it "sets the content disposition" do
      expect(responder).to receive(:set_content_disposition!)
      responder.to_xls
    end

    it "sets the response body to a new xls instance" do
      responder.to_xls
      expect(responder.controller.response_body).to be_a(Dossier::Xls)
    end

    it "formats the headers that are passed to Dossier::Xls" do
      expect(report).to receive(:format_header).with('hi')
      responder.to_csv
    end
  end

end


text:
<?php
 $this->load->model('department/Degree_model');
        $this->load->model('branch/Course_model');
        $this->load->model('batch/Batch_model');
        $this->load->model('semester/Semester_model');
        $course = $this->Course_model->order_by_column('c_name');
        $semester = $this->Semester_model->order_by_column('s_name');
        $batch = $this->Batch_model->order_by_column('b_name');
        $degree = $this->Degree_model->order_by_column('d_name');

?>

                <?php echo form_open(base_url() . 'examschedual/create', array('class' => 'form-horizontal form-groups-bordered validate', 'role' => 'form', 'id' => 'exam_time_table_form', 'target' => '_top')); ?>

                    <?php
                    $validation_error = validation_errors();
                    if ($validation_error != '') {
                        ?>

                            <button class="close" data-dismiss="alert">×</button>

<?php echo $validation_error; ?>

                    <?php } ?>

                        <?php echo ucwords("department"); ?>*

                            <select name="degree" id="degree" class="form-control">
                                <option value="">Select</option>
                                <?php foreach ($degree as $row) { ?>
                                    <option value="<?php echo $row->d_id; ?>"><?php echo $row->d_name; ?></option>
                                <?php } ?>
                            </select>

                        <?php echo ucwords("Branch"); ?>*

                            <select name="course" id="course" class="form-control">

                            </select>

                        <?php echo ucwords("Batch"); ?>*

                            <select class="form-control" name="batch" id="batch">

                            </select>

                        <?php echo ucwords("Semester"); ?>*

                            <select class="form-control" id="semester" name="semester">
                                <option value="">Select</option>

                            </select>

                        <?php echo ucwords("Exam"); ?>*

                            <select class="form-control" id="exam" name="exam">

                            </select>

                        <?php echo ucwords("Subject"); ?>*

                            <select class="form-control" id="subject" name="subject">

                            </select>

                        <?php echo ucwords("Date"); ?>*

                            <input type="text" id="exam_date" class="form-control datepicker-normal" name="exam_date"/>

                        <?php echo ucwords("Start Time"); ?>*

                                <input type="text" id="start_time" class="form-control timepicker" name="start_time"/>

                        <?php echo ucwords("End Time"); ?>*

                                <input type="text" id="end_time" class="form-control timepicker" name="end_time"/>

                            <button type="submit" class="btn btn-info vd_bg-green"><?php echo ucwords("Add "); ?></button>

                <?php echo form_close(); ?>


text:
use ElectricCommander;
use ElectricCommander::PropDB;

use constant {
               SUCCESS => 0,
               ERROR   => 1,
             };

my $opts;

my $PLUGIN_NAME = "EC-Azure";
my $projName    = "@PLUGIN_KEY@-@PLUGIN_VERSION@";

if (!defined $PLUGIN_NAME) {
    print "PLUGIN_NAME must be defined\n";
    exit ERROR;
}

## get an EC object
my $ec = new ElectricCommander();
$ec->abortOnError(0);

my $opts;
$opts->{config} = "$[config]";

if (!defined $opts->{config} || "$opts->{config}" eq "") {
    print "config parameter must exist and be non-blank\n";
    exit ERROR;
}

# check to see if a config with this name already exists before we do anything else
my $xpath    = $ec->getProperty("/myProject/azure_cfgs/$opts->{config}");
my $property = $xpath->findvalue("//response/property/propertyName");

if (!defined $property || "$property" eq "") {
    my $errMsg = "Error: A configuration named '$opts->{config}' does not exist.";
    $ec->setProperty("/myJob/configError", $errMsg);
    print $errMsg;
    exit ERROR;
}

$ec->deleteProperty("/myProject/azure_cfgs/$opts->{config}");
$ec->deleteCredential($projName, $opts->{config});
exit SUCCESS;


text:
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListType
from pyangbind.lib.yangtypes import YANGDynClass
from pyangbind.lib.yangtypes import ReferenceType
from pyangbind.lib.base import PybindBase
from collections import OrderedDict
from decimal import Decimal
from bitarray import bitarray
import six

# PY3 support of some PY2 keywords (needs improved)
if six.PY3:
    import builtins as __builtin__

    long = int
elif six.PY2:
    import __builtin__

class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance - based on the path /network-instances/network-instance/protocols/protocol/isis/levels/level/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: This container defines ISIS level state information.
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__enabled",
        "__level_number",
        "__metric_style",
        "__authentication_check",
    )

    _yang_name = "state"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__enabled = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="enabled",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__level_number = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
                ),
                restriction_dict={"range": ["1..2"]},
            ),
            is_leaf=True,
            yang_name="level-number",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-isis-types:level-number",
            is_config=False,
        )
        self.__metric_style = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={"NARROW_METRIC": {}, "WIDE_METRIC": {}},
            ),
            is_leaf=True,
            yang_name="metric-style",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-isis-types:metric-style",
            is_config=False,
        )
        self.__authentication_check = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="authentication-check",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError("cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError("Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "isis",
                "levels",
                "level",
                "state",
            ]

    def _get_enabled(self):
        """
    Getter method for enabled, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/state/enabled (boolean)

    YANG Description: When set to true, the functionality within which this leaf is
defined is enabled, when set to false it is explicitly disabled.
    """
        return self.__enabled

    def _set_enabled(self, v, load=False):
        """
    Setter method for enabled, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/state/enabled (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_enabled is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_enabled() directly.

    YANG Description: When set to true, the functionality within which this leaf is
defined is enabled, when set to false it is explicitly disabled.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="enabled",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """enabled must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__enabled = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_enabled(self):
        self.__enabled = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="enabled",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    def _get_level_number(self):
        """
    Getter method for level_number, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/state/level_number (oc-isis-types:level-number)

    YANG Description: ISIS level number (level-1, level-2).
    """
        return self.__level_number

    def _set_level_number(self, v, load=False):
        """
    Setter method for level_number, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/state/level_number (oc-isis-types:level-number)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_level_number is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_level_number() directly.

    YANG Description: ISIS level number (level-1, level-2).
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=int,
                        restriction_dict={"range": ["0..255"]},
                        int_size=8,
                    ),
                    restriction_dict={"range": ["1..2"]},
                ),
                is_leaf=True,
                yang_name="level-number",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-isis-types:level-number",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """level_number must be of a type compatible with oc-isis-types:level-number""",
                    "defined-type": "oc-isis-types:level-number",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['1..2']}), is_leaf=True, yang_name="level-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-isis-types:level-number', is_config=False)""",
                }
            )

        self.__level_number = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_level_number(self):
        self.__level_number = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
                ),
                restriction_dict={"range": ["1..2"]},
            ),
            is_leaf=True,
            yang_name="level-number",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-isis-types:level-number",
            is_config=False,
        )

    def _get_metric_style(self):
        """
    Getter method for metric_style, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/state/metric_style (oc-isis-types:metric-style)

    YANG Description: ISIS metric style types(narrow, wide).
    """
        return self.__metric_style

    def _set_metric_style(self, v, load=False):
        """
    Setter method for metric_style, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/state/metric_style (oc-isis-types:metric-style)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_metric_style is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_metric_style() directly.

    YANG Description: ISIS metric style types(narrow, wide).
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={"NARROW_METRIC": {}, "WIDE_METRIC": {}},
                ),
                is_leaf=True,
                yang_name="metric-style",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-isis-types:metric-style",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """metric_style must be of a type compatible with oc-isis-types:metric-style""",
                    "defined-type": "oc-isis-types:metric-style",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=six.text_type,                                     restriction_type="dict_key",                                     restriction_arg={'NARROW_METRIC': {}, 'WIDE_METRIC': {}},), is_leaf=True, yang_name="metric-style", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-isis-types:metric-style', is_config=False)""",
                }
            )

        self.__metric_style = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_metric_style(self):
        self.__metric_style = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={"NARROW_METRIC": {}, "WIDE_METRIC": {}},
            ),
            is_leaf=True,
            yang_name="metric-style",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-isis-types:metric-style",
            is_config=False,
        )

    def _get_authentication_check(self):
        """
    Getter method for authentication_check, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/state/authentication_check (boolean)

    YANG Description: When set to true, reject all ISIS protocol PDUs that either have a mismatch
in authentication-type or authentication-key.
    """
        return self.__authentication_check

    def _set_authentication_check(self, v, load=False):
        """
    Setter method for authentication_check, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/state/authentication_check (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_authentication_check is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_authentication_check() directly.

    YANG Description: When set to true, reject all ISIS protocol PDUs that either have a mismatch
in authentication-type or authentication-key.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("true"),
                is_leaf=True,
                yang_name="authentication-check",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """authentication_check must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="authentication-check", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__authentication_check = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_authentication_check(self):
        self.__authentication_check = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="authentication-check",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    enabled = __builtin__.property(_get_enabled)
    level_number = __builtin__.property(_get_level_number)
    metric_style = __builtin__.property(_get_metric_style)
    authentication_check = __builtin__.property(_get_authentication_check)

    _pyangbind_elements = OrderedDict(
        [
            ("enabled", enabled),
            ("level_number", level_number),
            ("metric_style", metric_style),
            ("authentication_check", authentication_check),
        ]
    )

class state(PybindBase):
    """
  This class was auto-generated by the PythonClass plugin for PYANG
  from YANG module openconfig-network-instance-l2 - based on the path /network-instances/network-instance/protocols/protocol/isis/levels/level/state. Each member element of
  the container is represented as a class variable - with a specific
  YANG type.

  YANG Description: This container defines ISIS level state information.
  """
    __slots__ = (
        "_path_helper",
        "_extmethods",
        "__enabled",
        "__level_number",
        "__metric_style",
        "__authentication_check",
    )

    _yang_name = "state"

    _pybind_generated_by = "container"

    def __init__(self, *args, **kwargs):

        self._path_helper = False

        self._extmethods = False
        self.__enabled = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="enabled",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )
        self.__level_number = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
                ),
                restriction_dict={"range": ["1..2"]},
            ),
            is_leaf=True,
            yang_name="level-number",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-isis-types:level-number",
            is_config=False,
        )
        self.__metric_style = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={"NARROW_METRIC": {}, "WIDE_METRIC": {}},
            ),
            is_leaf=True,
            yang_name="metric-style",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-isis-types:metric-style",
            is_config=False,
        )
        self.__authentication_check = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="authentication-check",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

        load = kwargs.pop("load", None)
        if args:
            if len(args) > 1:
                raise TypeError("cannot create a YANG container with >1 argument")
            all_attr = True
            for e in self._pyangbind_elements:
                if not hasattr(args[0], e):
                    all_attr = False
                    break
            if not all_attr:
                raise ValueError("Supplied object did not have the correct attributes")
            for e in self._pyangbind_elements:
                nobj = getattr(args[0], e)
                if nobj._changed() is False:
                    continue
                setmethod = getattr(self, "_set_%s" % e)
                if load is None:
                    setmethod(getattr(args[0], e))
                else:
                    setmethod(getattr(args[0], e), load=load)

    def _path(self):
        if hasattr(self, "_parent"):
            return self._parent._path() + [self._yang_name]
        else:
            return [
                "network-instances",
                "network-instance",
                "protocols",
                "protocol",
                "isis",
                "levels",
                "level",
                "state",
            ]

    def _get_enabled(self):
        """
    Getter method for enabled, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/state/enabled (boolean)

    YANG Description: When set to true, the functionality within which this leaf is
defined is enabled, when set to false it is explicitly disabled.
    """
        return self.__enabled

    def _set_enabled(self, v, load=False):
        """
    Setter method for enabled, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/state/enabled (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_enabled is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_enabled() directly.

    YANG Description: When set to true, the functionality within which this leaf is
defined is enabled, when set to false it is explicitly disabled.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("false"),
                is_leaf=True,
                yang_name="enabled",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """enabled must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("false"), is_leaf=True, yang_name="enabled", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__enabled = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_enabled(self):
        self.__enabled = YANGDynClass(
            base=YANGBool,
            default=YANGBool("false"),
            is_leaf=True,
            yang_name="enabled",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    def _get_level_number(self):
        """
    Getter method for level_number, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/state/level_number (oc-isis-types:level-number)

    YANG Description: ISIS level number (level-1, level-2).
    """
        return self.__level_number

    def _set_level_number(self, v, load=False):
        """
    Setter method for level_number, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/state/level_number (oc-isis-types:level-number)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_level_number is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_level_number() directly.

    YANG Description: ISIS level number (level-1, level-2).
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=RestrictedClassType(
                        base_type=int,
                        restriction_dict={"range": ["0..255"]},
                        int_size=8,
                    ),
                    restriction_dict={"range": ["1..2"]},
                ),
                is_leaf=True,
                yang_name="level-number",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-isis-types:level-number",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """level_number must be of a type compatible with oc-isis-types:level-number""",
                    "defined-type": "oc-isis-types:level-number",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=RestrictedClassType(base_type=int, restriction_dict={'range': ['0..255']}, int_size=8), restriction_dict={'range': ['1..2']}), is_leaf=True, yang_name="level-number", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-isis-types:level-number', is_config=False)""",
                }
            )

        self.__level_number = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_level_number(self):
        self.__level_number = YANGDynClass(
            base=RestrictedClassType(
                base_type=RestrictedClassType(
                    base_type=int, restriction_dict={"range": ["0..255"]}, int_size=8
                ),
                restriction_dict={"range": ["1..2"]},
            ),
            is_leaf=True,
            yang_name="level-number",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-isis-types:level-number",
            is_config=False,
        )

    def _get_metric_style(self):
        """
    Getter method for metric_style, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/state/metric_style (oc-isis-types:metric-style)

    YANG Description: ISIS metric style types(narrow, wide).
    """
        return self.__metric_style

    def _set_metric_style(self, v, load=False):
        """
    Setter method for metric_style, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/state/metric_style (oc-isis-types:metric-style)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_metric_style is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_metric_style() directly.

    YANG Description: ISIS metric style types(narrow, wide).
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=RestrictedClassType(
                    base_type=six.text_type,
                    restriction_type="dict_key",
                    restriction_arg={"NARROW_METRIC": {}, "WIDE_METRIC": {}},
                ),
                is_leaf=True,
                yang_name="metric-style",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="oc-isis-types:metric-style",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """metric_style must be of a type compatible with oc-isis-types:metric-style""",
                    "defined-type": "oc-isis-types:metric-style",
                    "generated-type": """YANGDynClass(base=RestrictedClassType(base_type=six.text_type,                                     restriction_type="dict_key",                                     restriction_arg={'NARROW_METRIC': {}, 'WIDE_METRIC': {}},), is_leaf=True, yang_name="metric-style", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='oc-isis-types:metric-style', is_config=False)""",
                }
            )

        self.__metric_style = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_metric_style(self):
        self.__metric_style = YANGDynClass(
            base=RestrictedClassType(
                base_type=six.text_type,
                restriction_type="dict_key",
                restriction_arg={"NARROW_METRIC": {}, "WIDE_METRIC": {}},
            ),
            is_leaf=True,
            yang_name="metric-style",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="oc-isis-types:metric-style",
            is_config=False,
        )

    def _get_authentication_check(self):
        """
    Getter method for authentication_check, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/state/authentication_check (boolean)

    YANG Description: When set to true, reject all ISIS protocol PDUs that either have a mismatch
in authentication-type or authentication-key.
    """
        return self.__authentication_check

    def _set_authentication_check(self, v, load=False):
        """
    Setter method for authentication_check, mapped from YANG variable /network_instances/network_instance/protocols/protocol/isis/levels/level/state/authentication_check (boolean)
    If this variable is read-only (config: false) in the
    source YANG file, then _set_authentication_check is considered as a private
    method. Backends looking to populate this variable should
    do so via calling thisObj._set_authentication_check() directly.

    YANG Description: When set to true, reject all ISIS protocol PDUs that either have a mismatch
in authentication-type or authentication-key.
    """
        if hasattr(v, "_utype"):
            v = v._utype(v)
        try:
            t = YANGDynClass(
                v,
                base=YANGBool,
                default=YANGBool("true"),
                is_leaf=True,
                yang_name="authentication-check",
                parent=self,
                path_helper=self._path_helper,
                extmethods=self._extmethods,
                register_paths=True,
                namespace="http://openconfig.net/yang/network-instance",
                defining_module="openconfig-network-instance",
                yang_type="boolean",
                is_config=False,
            )
        except (TypeError, ValueError):
            raise ValueError(
                {
                    "error-string": """authentication_check must be of a type compatible with boolean""",
                    "defined-type": "boolean",
                    "generated-type": """YANGDynClass(base=YANGBool, default=YANGBool("true"), is_leaf=True, yang_name="authentication-check", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='http://openconfig.net/yang/network-instance', defining_module='openconfig-network-instance', yang_type='boolean', is_config=False)""",
                }
            )

        self.__authentication_check = t
        if hasattr(self, "_set"):
            self._set()

    def _unset_authentication_check(self):
        self.__authentication_check = YANGDynClass(
            base=YANGBool,
            default=YANGBool("true"),
            is_leaf=True,
            yang_name="authentication-check",
            parent=self,
            path_helper=self._path_helper,
            extmethods=self._extmethods,
            register_paths=True,
            namespace="http://openconfig.net/yang/network-instance",
            defining_module="openconfig-network-instance",
            yang_type="boolean",
            is_config=False,
        )

    enabled = __builtin__.property(_get_enabled)
    level_number = __builtin__.property(_get_level_number)
    metric_style = __builtin__.property(_get_metric_style)
    authentication_check = __builtin__.property(_get_authentication_check)

    _pyangbind_elements = OrderedDict(
        [
            ("enabled", enabled),
            ("level_number", level_number),
            ("metric_style", metric_style),
            ("authentication_check", authentication_check),
        ]
    )


text:
 K

 KAMEVO

 Déconnexion

	         <a class="js" href="user.php?id=<?php echo $_SESSION['ID']; ?>">
 <?php echo $_SESSION['pseudo']; ?>

 Explorer

 Accueil

<form class="form" action="" method="post">
	       <input type="search" class="f-input" name="search" placeholder=" Rechercher un profil">
	       </form>

Parcourir les catégories

	 	Technologie - 3562 personnes

	 	Gaming - 1253 personnes

	 	Beauté - 3541 personnes

	 	Bricolage - 451 personnes

	 	Autres - 784 personnes


text:
class UserSerializer < ActiveModel::Serializer
  attributes :id, :username, :password
end


text:
var app = app || {};

app.menuView = (function(){
    function MenuView(selector, data) {
        var deffer = Q.defer();

        $.get('templates/menu.html', function(template) {
            var temp = Handlebars.compile(template);
            var html = temp(data);
            $(selector).html(html);
        }).done(function(data) {
            deffer.resolve(data);
        }).fail(function (error) {
            deffer.reject(error);
        });

        return deffer.promise;
    }

    return {
        load: function (selector, data) {
            return MenuView(selector, data);
        }
    }
}());