text:
<!DOCTYPE html>

    <title>Minimal 1.0 - UI Elements</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta charset="UTF-8" />

    <link rel="icon" type="image/ico" href="http://tattek.com/minimal/assets/images/favicon.ico" />

    <link href="assets/css/vendor/bootstrap/bootstrap.min.css" rel="stylesheet">
    <link href="http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
    <link rel="stylesheet" href="assets/css/vendor/animate/animate.css">
    <link type="text/css" rel="stylesheet" media="all" href="assets/js/vendor/mmenu/css/jquery.mmenu.all.css" />
    <link rel="stylesheet" href="assets/js/vendor/videobackground/css/jquery.videobackground.css">
    <link rel="stylesheet" href="assets/css/vendor/bootstrap-checkbox.css">

    <link rel="stylesheet" href="assets/js/vendor/jgrowl/css/jquery.jgrowl.min.css">
    <link rel="stylesheet" href="assets/js/vendor/chosen/css/chosen.min.css">
    <link rel="stylesheet" href="assets/js/vendor/chosen/css/chosen-bootstrap.css">
    <link rel="stylesheet" href="assets/js/vendor/typeahead/css/typeahead.js-bootstrap.css">
    <link rel="stylesheet" href="assets/js/vendor/datepicker/css/bootstrap-datetimepicker.css">
    <link rel="stylesheet" href="assets/js/vendor/no-ui-slider/css/jquery.nouislider.min.css">
    <link rel="stylesheet" href="assets/js/vendor/tabdrop/css/tabdrop.css">

    <link href="assets/css/minimal.css" rel="stylesheet">

              MINIMAL

               <input type="text" placeholder="Search...">

                  2

You have 2 new tasks

Layout

80%

                          40% Complete (success)

Schemes

15%

                          45% Complete

Forms

5%

                          5% Complete (warning)

JavaScript

30%

                          30% Complete (danger)

Dropdowns

60%

                          60% Complete

Check all tasks

                  1

You have 1 new message

                        Ing. Imrich Kamarel
                        12 mins

Duis aute irure dolor in reprehenderit in voluptate velit esse cillum

                        Arnold Karlsberg
                        1 hour

Lorem ipsum dolor sit amet, consectetur adipisicing elit

                        John Douey
                        3 hours

Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia

                        Peter Kay
                        5 hours

Ut enim ad minim veniam, quis nostrud exercitation

                        George McCain
                        6 hours

Lorem ipsum dolor sit amet, consectetur adipisicing elit

Check all messages

                  3

You have 3 new notifications

                      New user registered.
                      18 mins

                      Server down.
                      27 mins

                      New order.
                      36 mins

                      Server restared.
                      45 mins

                      Server started.
                      50 mins

Check all notifications

                  John Douey

Backgrounds:

                      Video BG

                          <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="videobg-check">

                     Profile

                     Calendar

                     Inbox 3

                     Logout

                Navigation

                       Dashboard
                      1

                       Forms

                           Common Elements

                           Validation

                           Form Wizard

                       Interface

                           UI Elements

                           Typography

                           Tiles

                       Buttons & Icons

                       Grid Layout

                       Tables

                           Bootstrap Tables

                           DataTables

                       Example Pages
                      mails

                           Login Page

                           Calendar

                           Page 404

                           Page 500

                           Page Offline

                           Gallery

                           Timeline

                           Vertical Mail
                          5

                           Horizontal Mail
                          mails

                           Vector Maps

                           Google Maps

                       Widgets

                       Charts & Graphs

                Orders Summary

                    This week sales

26, 149

                    This week balance

318, 651

                General Settings

                  Switch ON

                      <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="switch-on" checked="">

                  Switch OFF

                      <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="switch-off">

 UI Elements // Place subtitle here...

You are here

Minimal

Interface

UI Elements

Hello, world!

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

Learn more

Two-sided Cards

                                New Users

0

This month plan %

                                0%

                              Check Summary

                                New Orders

0

This month plan %

                                0%

                              Check Summary

                                Sales

0

This month plan %

                                0%

                              Check Summary

                                Visits

0

This month plan %

                                0%

                              Check Summary

Alert Dialogs

                      <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                      Warning! This is the dismissable alert dialog.

                      Heads up! This alert needs your attention, but it's not super important.

                      Heads up! This alert needs your attention, but it's not super important.

                      <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>

Oh snap! You got an error!

Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.

                        <button type="button" class="btn btn-danger">Take this action</button>
                        <button type="button" class="btn btn-default">Or do this</button>

                      Heads up! This alert have class .alert-red.

                      Heads up! This alert have class .alert-cyan.

                      Heads up! This alert have class .alert-green.

                      Heads up! This alert have class .alert-greensea.

                      <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>

Heads up! This alert have class .alert-redbrown

Change this and that and try again. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.

                        <button type="button" class="btn btn-danger">Take this action</button>
                        <button type="button" class="btn btn-default">Or do this</button>

Modal Dialogs

                    Open Modal Dialog
                    Open Modal Confirmation

                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">Close</button>

Modal title

One fine body…

                            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">Close</button>

Modal title

                            <form role="form">

                                Normal input field
                                <input type="text" class="form-control" id="exampleInput">

                                Password input field
                                <input type="password" class="form-control" id="passwordInput">

                                Input with placeholder
                                <input type="text" class="form-control" id="placeholderInput" placeholder="This is a placeholder...">

                                Normal textarea
                                <textarea class="form-control" rows="3"></textarea>

                            </form>

                            <button class="btn btn-red" data-dismiss="modal" aria-hidden="true">Close</button>
                            <button class="btn btn-green">Save changes</button>

Progress Bars

Basic Progress Bars

                        40% Complete (success)

                        20% Complete

                        80% Complete

Striped Progress Bars

                        40% Complete

                        20% Complete

Animated Progress Bars

                        40% Complete

                        20% Complete

Stacked Progress Bar

                        35% Complete

                        20% Complete

                        10% Complete

Other Variations

class="progress progress-striped progress-thin"

                          25% Complete

class="progress progress-striped progress-little"

                          40% Complete

class="progress progress-striped progress-thin no-radius"

                          60% Complete

<div class="percent">20%</div>

20%

                          20% Complete

Value in container

animated progress bar load

                        0%

Tooltip Types

                    <button id="topTooltip" class="btn btn-default" data-toggle="tooltip" data-placement="top" title="" data-original-title="Tooltip on top">Tooltip on top</button>
                    <button id="rightTooltip" class="btn btn-default" data-toggle="tooltip" data-placement="right" title="" data-original-title="Tooltip on right">Tooltip on right</button>
                    <button id="bottomTooltip" class="btn btn-default" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="Tooltip on bottom">Tooltip on bottom</button>
                    <button id="leftTooltip" class="btn btn-default" data-toggle="tooltip" data-placement="left" title="" data-original-title="Tooltip on left">Tooltip on left</button>

Growl Notifications

                    <button class="btn btn-default bottommargin" id="defaultGrowl">Default growl notification</button>
                    <button class="btn btn-info bottommargin" id="stickyGrowl">Sticky growl notification</button>
                    <button class="btn btn-danger bottommargin" id="headerGrowl">Growl notification with header</button>
                    <button class="btn btn-success bottommargin" id="longerGrowl">Growl notification with longer live</button>
                    <button class="btn btn-warning bottommargin" id="specialGrowl">Growl notification with callback</button>

Pagination Types

Default Pagination

«

1

2

3

4

5

»

«

1

2

3

4

5

»

«

1

2

3

4

5

»

«

1

2

3

4

5

»

Custom Pagination

1

2

3

4

5

1

2

3

4

5

1

2

3

4

5

1

2

3

4

5

Accordion Types

                              Collapsible Group Item #1

                            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

                              Collapsible Group Item #2

                            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

                              Collapsible Group Item #3

                            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

Notification Dialogs

Normal Notification Field

This notification, have this classes class="notification".

Warning Notification Field

This notification, have this classes class="notification notification-warning".

Danger Notification Field

This notification, have this classes class="notification notification-danger".

Success Notification Field

This notification, have this classes class="notification notification-success".

Info Notification Field

This notification, have this classes class="notification notification-info".

Red Notification Field

This notification, have this classes class="notification notification-red".

Green Notification Field

This notification, have this classes class="notification notification-green".

Orange Notification Field

This notification, have this classes class="notification notification-orange".

Amethyst Notification Field

This notification, have this classes class="notification notification-amethyst".

Labels & Badges

                        Default
                        Primary
                        Success
                        Info
                        Warning
                        Danger
                        Cyan
                        Red
                        Green
                        Orange
                        Amethyst
                        Greensea
                        Dutch
                        Hotpink
                        Drank
                        Blue
                        Slategray
                        Redbrown

<span class="label label-default">Default</span>
<span class="label label-primary">Primary</span>
<span class="label label-success">Success</span>
<span class="label label-info">Info</span>
<span class="label label-warning">Warning</span>
<span class="label label-danger">Danger</span>
<span class="label label-cyan">Cyan</span>
<span class="label label-red">Red</span>
<span class="label label-green">Green</span>
<span class="label label-orange">Orange</span>
<span class="label label-amethyst">Amethyst</span>
<span class="label label-greensea">Greensea</span>
<span class="label label-dutch">Dutch</span>
<span class="label label-hotpink">Hotpink</span>
<span class="label label-drank">Drank</span>
<span class="label label-blue">Blue</span>
<span class="label label-slategray">Slategray</span>
<span class="label label-redbrown ">Redbrown</span>

                        1
                        2
                        3
                        4
                        5
                        6
                        7
                        8
                        9
                        10
                        11
                        12
                        13
                        14
                        15
                        16
                        17
                        18

<span class="badge">1</span>
<span class="badge badge-primary">2</span>
<span class="badge badge-success">3</span>
<span class="badge badge-info">4</span>
<span class="badge badge-warning">5</span>
<span class="badge badge-danger">6</span>
<span class="badge badge-cyan">7</span>
<span class="badge badge-red">8</span>
<span class="badge badge-green">9</span>
<span class="badge badge-orange">10</span>
<span class="badge badge-amethyst">11</span>
<span class="badge badge-greensea">12</span>
<span class="badge badge-dutch">13</span>
<span class="badge badge-hotpink">14</span>
<span class="badge badge-drank">15</span>
<span class="badge badge-blue">16</span>
<span class="badge badge-slategray">17</span>
<span class="badge badge-redbrown">18</span>

Pager Types

Default example

Previous

Next

Default aligned links

← Older

Newer →

Default optional disabled state

← Older

Newer →

Custom example

Previous

Next

Custom aligned links

 Older

Newer

Custom optional disabled state

 Older

Newer

Multi Accordion

                              Multi-Collapsible Group Item #1

                            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

                              Multi-Collapsible Group Item #2

                            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

                              Multi-Collapsible Group Item #3

                            Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.

Tab Navigation

Normal Tabs

Home

Profile

Messages

Disabled link

                          Dropdown

Action

Another action

Something else here

Separated link

Normal Tabs with TabDrop

Tab 1

Tab 2

Tab 3

Tab 4

Tab 5

Tab 6

Tab 7

Tab 8

Tab 9

Tab 10

Tab 11

Tab 12

Tab 13

Tab 14

Tab 15

Tab 16

Tab 17

Tab 18

Tab 19

Tab 20

Justified Tabs

Home

Profile

Messages

Tab 1

Tab 2

Tab 3

Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et.

Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et.

Tab 1

Tab 2

Tab 3

Tab 1

Tab 2

Tab 3

Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et.

Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer

Tab 1

Tab 2

Tab 3

Pills Navigation

Normal Pills

Home

Profile

Messages

Disabled link

                          Dropdown

Action

Another action

Something else here

Separated link

Normal Pills with TabDrop

Pill 1

Pill 2

Pill 3

Pill 4

Pill 5

Pill 6

Pill 7

Pill 8

Pill 9

Pill 10

Pill 11

Pill 12

Pill 13

Pill 14

Pill 15

Pill 16

Pill 17

Pill 18

Pill 19

Pill 20

Justified Pills

Home

Profile

Messages

Stacked Pills

Home

Profile

Messages

Breadcrumbs Navigation

Home

Home

Library

Home

Library

Data

Panel Types

                            Basic panel example

Panel heading without title

                            Panel content

Panel title

                            Panel content

                            Panel content

Panel footer

Primary Panel title

                            Panel can have these color classes:
 .panel-primary/.panel-success/.panel-danger/.panel-info/.panel-warning/.panel-red/.panel-cyan/.panel-green/.panel-orange/.panel-amethyst/.panel-greensea/.panel-dutch/.panel-hotpink/.panel-drank/.panel-transparent-black/.panel-transparent-white/.panel-blue/.panel-redbrown/.panel-slategray

Greensea Panel title

                            Panel content

Transparent Panel title

                            Panel content

Panel with table heading

Some default panel content here. Nulla vitae elit libero, a pharetra augue. Aenean lacinia bibendum nulla sed consectetur. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nullam id dolor id nibh ultricies vehicula ut id elit.

                                #
                                First Name
                                Last Name
                                Username

                                1
                                Mark
                                Otto
                                @mdo

                                2
                                Jacob
                                Thornton
                                @fat

                                3
                                Larry
                                the Bird
                                @twitter

                                4
                                Ici
                                Kamarel
                                @icko

Panel with list group heading

Some default panel content here. Nulla vitae elit libero, a pharetra augue. Aenean lacinia bibendum nulla sed consectetur. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nullam id dolor id nibh ultricies vehicula ut id elit.

Cras justo odio

Dapibus ac facilisis in

Morbi leo risus

Porta ac consectetur ac

Vestibulum at eros

List Groups

Cras justo odio

Dapibus ac facilisis in

Morbi leo risus

Porta ac consectetur ac

Vestibulum at eros

14 Cras justo odio

12 Dapibus ac facilisis in

26 Morbi leo risus

19 Porta ac consectetur ac

36 Vestibulum at eros

                            Cras justo odio

                          Dapibus ac facilisis in
                          Morbi leo risus
                          Porta ac consectetur ac
                          Vestibulum at eros

List group item heading

Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.

List group item heading

Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.

List group item heading

Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.

Other Elements

                        <form role="form">

                            TypeAhead
                            <input type="text" class="form-control" id="typeahead">

                        </form>

Toggle Switches

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch" checked>

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch01">

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch03" checked>

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch04" checked>

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch05" checked>

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch23" checked>

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch06" checked>

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch07" checked>

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch08" checked>

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch09" checked>

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch10" checked>

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch24" checked>

Dropdown Menu

Action

Another action

Something else here

Separated link

Toggle Switches with labels

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch11" checked>

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch12">

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch13" checked>

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch14" checked>

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch15" checked>

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch21" checked>

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch16" checked>

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch17" checked>

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch18" checked>

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch19" checked>

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch20" checked>

                                  <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="myonoffswitch22" checked>

Dropdown Menu with headers

Dropdown header

Action

Another action

Something else here

Dropdown header

Separated link

                        <form role="form">

                            Datetimepicker
                            <input type="text" class="form-control" id="datepicker">

                        </form>

Range Slider

One Handle Slider

Vertical Sliders

                        <form role="form">

                            Chosen Multiple-Select
                            <select data-placeholder="Select recipients..." multiple="" tabindex="3" class="chosen-select form-control" id="chosen">
                              <option value="http://tattek.com/minimal/ici@gmail.com">ici@gmail.com</option>
                              <option value="http://tattek.com/minimal/johny@gmail.com">johny@gmail.com</option>
                              <option value="http://tattek.com/minimal/arnie@gmail.com">arnie@gmail.com</option>
                              <option value="http://tattek.com/minimal/pete@gmail.com">pete@gmail.com</option>
                              <option value="http://tattek.com/minimal/gorge@gmail.com">gorge@gmail.com</option>
                            </select>

                        </form>

Row Select

Options:

                              <input type="checkbox" value="1" id="opt01">
                              Option 1

                              <input type="checkbox" checked="checked" value="1" id="opt02">
                              Option 2

                              <input type="checkbox" value="1" id="opt03">
                              Option 3

                              <input type="checkbox" value="1" id="opt04">
                              Option 4

Inline Select

Options:

                              <input type="checkbox" value="1" id="opt05">
                              Option 1

                              <input type="checkbox" checked="checked" value="1" id="opt06">
                              Option 2

                              <input type="checkbox" value="1" id="opt07">
                              Option 3

Wells

                          Look, I'm in a well!

                          Look, I'm in a large well with slategray background!

                          Look, I'm in a small well with cyan background!

Online Users

Ing. Imrich Kamarel

                       Ulaanbaatar, Mongolia

                    3

Arnold Karlsberg

                       Bratislava, Slovakia

Peter Kay

                       Kosice, Slovakia

George McCain

                       Prague, Czech Republic

Lucius Cashmere

                       Wien, Austria

Jesse Phoenix

                       Berlin, Germany

Offline Users

Dell MacApple

                       Paris, France

Roger Flopple

                       Rome, Italia

Nico Vulture

                       Kyjev, Ukraine

Bobby Socks

                       Moscow, Russia

Anna Opichia

                       Budapest, Hungary

Chat History

Ing. Imrich Kamarel

                      Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor

                    3

Arnold Karlsberg

                      Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur

Peter Kay

                      Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit

Friends List

                    3

Arnold Karlsberg

                       Bratislava, Slovakia

Anna Opichia

                       Budapest, Hungary

Lucius Cashmere

                       Wien, Austria

Ing. Imrich Kamarel

                       Ulaanbaatar, Mongolia

Chat Settings

                    Show Offline Users

                        <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show-offline" checked="">

                    Show Fullname

                        <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show-fullname">

                    History Enable

                        <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show-history" checked="">

                    Show Locations

                        <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show-location" checked="">

                    Notifications

                        <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show-notifications">

                    Show Undread Count

                        <input type="checkbox" name="onoffswitch" class="onoffswitch-checkbox" id="show-unread" checked="">


text:
package class

import (
	"github.com/golang/glog"
	extensions "k8s.io/client-go/pkg/apis/extensions/v1beta1"

	"k8s.io/ingress/core/pkg/ingress/annotations/parser"
	"k8s.io/ingress/core/pkg/ingress/errors"
)

const (
	// IngressKey picks a specific "class" for the Ingress.
	// The controller only processes Ingresses with this annotation either
	// unset, or set to either the configured value or the empty string.
	IngressKey = "kubernetes.io/ingress.class"
)

// IsValid returns true if the given Ingress either doesn't specify
// the ingress.class annotation, or it's set to the configured in the
// ingress controller.
func IsValid(ing *extensions.Ingress, controller, defClass string) bool {
	ingress, err := parser.GetStringAnnotation(IngressKey, ing)
	if err != nil && !errors.IsMissingAnnotations(err) {
		glog.Warningf("unexpected error reading ingress annotation: %v", err)
	}

	// we have 2 valid combinations
	// 1 - ingress with default class | blank annotation on ingress
	// 2 - ingress with specific class | same annotation on ingress
	//
	// and 2 invalid combinations
	// 3 - ingress with default class | fixed annotation on ingress
	// 4 - ingress with specific class | different annotation on ingress
	if ingress == "" && controller == defClass {
		return true
	}

	return ingress == controller
}

redpajama_set_name: RedPajamaGithub


text:
import re
import sys
import json
import html.parser
import urllib.parse
import http.client

def getresults(query):
    domain = "www.trainchinese.com"
    urlTemmplate = "/v1/a_user/searchForWords.php?searchWord={}"
    url = urlTemmplate.format(urllib.parse.quote(query))

    client = http.client.HTTPConnection(domain)
    client.request("GET", url)
    response = client.getresponse()
    responseText = response.read().decode();

    regex = re.compile(r'sr_oneWord\((.+?)\)\+')
    matches = re.findall(regex, responseText)

    spanRegex = re.compile(r'<\/?span[^>]*>')

    results = []
    for match in matches:
        match = match.replace("'", "\"")
        match = "[" + match + "]"
        result = json.loads(match)
        name = result[2]
        name = re.sub(spanRegex, "", name)
        name = html.parser.HTMLParser().unescape(name)
        audio = "/v1/" +result[6][3:]
        results.append([name, audio])

    return results

def downloadfile(url, path):
    domain = "www.trainchinese.com"
    client = http.client.HTTPConnection(domain)
    client.request("GET", url)
    response = client.getresponse()

    with open(path, "wb") as outputfile:
        outputfile.write(response.read())

if __name__ == "__main__":

    if len(sys.argv) != 2:
        print("Usage: {} <word>".format(sys.argv[0]))
        sys.exit(1)

    word = sys.argv[1]

    for (name, audio) in getresults(word):
        if name == word:
            downloadfile(audio, name + ".mp3")
            print("Done")
            sys.exit(0)

    print("Not found")
    sys.exit(1)


text:
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.psi.codeStyle;

import com.intellij.application.options.CodeStyle;
import com.intellij.configurationStore.Property;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.InvalidDataException;
import com.intellij.openapi.util.WriteExternalException;
import com.intellij.psi.PsiFile;
import com.intellij.psi.PsiModifier;
import com.intellij.psi.codeStyle.CommonCodeStyleSettings.WrapConstant;
import org.jdom.Element;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.TestOnly;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;

public class JavaCodeStyleSettings extends CustomCodeStyleSettings implements ImportsLayoutSettings {
  private static final String REPEAT_ANNOTATIONS = "REPEAT_ANNOTATIONS";
  private static final String REPEAT_ANNOTATIONS_ITEM = "ANNO";
  private static final String DO_NOT_IMPORT_INNER = "DO_NOT_IMPORT_INNER";
  private static final String DO_NOT_IMPORT_INNER_ITEM = "CLASS";
  private static final String COLLECTION_ITEM_ATTRIBUTE = "name";

  public JavaCodeStyleSettings(@NotNull CodeStyleSettings container) {
    super("JavaCodeStyleSettings", container);
    initImportsByDefault();
  }
  public String FIELD_NAME_PREFIX = "";
  public String STATIC_FIELD_NAME_PREFIX = "";
  public String PARAMETER_NAME_PREFIX = "";
  public String LOCAL_VARIABLE_NAME_PREFIX = "";
  public String TEST_NAME_PREFIX = "";
  public String SUBCLASS_NAME_PREFIX = "";

  public String FIELD_NAME_SUFFIX = "";
  public String STATIC_FIELD_NAME_SUFFIX = "";
  public String PARAMETER_NAME_SUFFIX = "";
  public String LOCAL_VARIABLE_NAME_SUFFIX = "";
  public String TEST_NAME_SUFFIX = "Test";
  public String SUBCLASS_NAME_SUFFIX = "Impl";

  public boolean PREFER_LONGER_NAMES = true;

  public boolean GENERATE_FINAL_LOCALS;
  public boolean GENERATE_FINAL_PARAMETERS;

  @PsiModifier.ModifierConstant
  public String VISIBILITY = "public";

  public boolean USE_EXTERNAL_ANNOTATIONS;
  public boolean INSERT_OVERRIDE_ANNOTATION = true;

  public boolean REPEAT_SYNCHRONIZED = true;

  private List<String> myRepeatAnnotations = new ArrayList<>();

  public List<String> getRepeatAnnotations() {
    return myRepeatAnnotations;
  }

  public void setRepeatAnnotations(List<String> repeatAnnotations) {
    myRepeatAnnotations.clear();
    myRepeatAnnotations.addAll(repeatAnnotations);
  }

  private List<String> myDoNotImportInner = new ArrayList<>();

  public List<String> getDoNotImportInner() {
    return myDoNotImportInner;
  }

  public void setDoNotImportInner(List<String> doNotImportInner) {
    myDoNotImportInner = doNotImportInner;
  }

  /** @deprecated Use {@link #REPLACE_INSTANCEOF_AND_CAST} */
  @SuppressWarnings("DeprecatedIsStillUsed")
  @Deprecated(forRemoval = true)
  public boolean REPLACE_INSTANCEOF = false;
  /** @deprecated Use {@link #REPLACE_INSTANCEOF_AND_CAST} */
  @SuppressWarnings("DeprecatedIsStillUsed")
  @Deprecated(forRemoval = true)
  public boolean REPLACE_CAST = false;
  public boolean REPLACE_INSTANCEOF_AND_CAST = false;
  public boolean REPLACE_NULL_CHECK = true;

  @Property(externalName = "replace_sum_lambda_with_method_ref")
  public boolean REPLACE_SUM = true;

  public boolean SPACES_WITHIN_ANGLE_BRACKETS;

  //Type arguments
  public boolean SPACE_AFTER_CLOSING_ANGLE_BRACKET_IN_TYPE_ARGUMENT;

  //Type parameters
  public boolean SPACE_BEFORE_OPENING_ANGLE_BRACKET_IN_TYPE_PARAMETER;
  public boolean SPACE_AROUND_TYPE_BOUNDS_IN_TYPE_PARAMETERS = true;

  // Only related to fields!
  // @Foo int field;
  public boolean DO_NOT_WRAP_AFTER_SINGLE_ANNOTATION;

  // @Foo int param
  public boolean DO_NOT_WRAP_AFTER_SINGLE_ANNOTATION_IN_PARAMETER = false;

  @WrapConstant
  public int ANNOTATION_PARAMETER_WRAP = CommonCodeStyleSettings.DO_NOT_WRAP;
  public boolean ALIGN_MULTILINE_ANNOTATION_PARAMETERS;
  public boolean NEW_LINE_AFTER_LPAREN_IN_ANNOTATION = false;
  public boolean RPAREN_ON_NEW_LINE_IN_ANNOTATION = false;

  public boolean SPACE_AROUND_ANNOTATION_EQ = true;

  public boolean ALIGN_MULTILINE_TEXT_BLOCKS = false;

  public int BLANK_LINES_AROUND_INITIALIZER = 1;

  public static final int FULLY_QUALIFY_NAMES_IF_NOT_IMPORTED = 1;
  public static final int FULLY_QUALIFY_NAMES_ALWAYS = 2;
  public static final int SHORTEN_NAMES_ALWAYS_AND_ADD_IMPORT = 3;

  public int CLASS_NAMES_IN_JAVADOC = FULLY_QUALIFY_NAMES_IF_NOT_IMPORTED;
  public boolean SPACE_BEFORE_COLON_IN_FOREACH = true;
  public boolean SPACE_INSIDE_ONE_LINE_ENUM_BRACES = false;

  public boolean useFqNamesInJavadocAlways() {
    return CLASS_NAMES_IN_JAVADOC == FULLY_QUALIFY_NAMES_ALWAYS;
  }

  // Imports
  public boolean LAYOUT_STATIC_IMPORTS_SEPARATELY = true;
  public boolean USE_FQ_CLASS_NAMES;
  public boolean USE_SINGLE_CLASS_IMPORTS = true;
  public boolean INSERT_INNER_CLASS_IMPORTS;
  public int CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND = 5;
  public int NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND = 3;
  public PackageEntryTable PACKAGES_TO_USE_IMPORT_ON_DEMAND = new PackageEntryTable();
  @Property(externalName = "imports_layout")
  public PackageEntryTable IMPORT_LAYOUT_TABLE = new PackageEntryTable();

  @WrapConstant
  public int RECORD_COMPONENTS_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED;
  public boolean ALIGN_MULTILINE_RECORDS = true;
  public boolean NEW_LINE_AFTER_LPAREN_IN_RECORD_HEADER = false;
  public boolean RPAREN_ON_NEW_LINE_IN_RECORD_HEADER = false;
  /**
   * "record R( String s )"
   * or
   * "record R(String s)"
   */
  public boolean SPACE_WITHIN_RECORD_HEADER = false;

  @WrapConstant
  public int MULTI_CATCH_TYPES_WRAP = CommonCodeStyleSettings.WRAP_AS_NEEDED;
  public boolean ALIGN_TYPES_IN_MULTI_CATCH = true;

  // region JavaDoc
  @Property(externalName = "doc_enable_formatting")
  public boolean ENABLE_JAVADOC_FORMATTING = true;
  @Property(externalName = "doc_align_param_comments")
  public boolean JD_ALIGN_PARAM_COMMENTS = true;
  @Property(externalName = "doc_align_exception_comments")
  public boolean JD_ALIGN_EXCEPTION_COMMENTS = true;
  @Property(externalName = "doc_add_blank_line_after_param_comments")
  public boolean JD_ADD_BLANK_AFTER_PARM_COMMENTS;
  @Property(externalName = "doc_add_blank_line_after_return")
  public boolean JD_ADD_BLANK_AFTER_RETURN;
  @Property(externalName = "doc_add_blank_line_after_description")
  public boolean JD_ADD_BLANK_AFTER_DESCRIPTION = true;
  @Property(externalName = "doc_add_p_tag_on_empty_lines")
  public boolean JD_P_AT_EMPTY_LINES = true;

  @Property(externalName = "doc_keep_invalid_tags")
  public boolean JD_KEEP_INVALID_TAGS = true;
  @Property(externalName = "doc_keep_empty_lines")
  public boolean JD_KEEP_EMPTY_LINES = true;
  @Property(externalName = "doc_do_not_wrap_if_one_line")
  public boolean JD_DO_NOT_WRAP_ONE_LINE_COMMENTS;

  @Property(externalName = "doc_use_throws_not_exception_tag")
  public boolean JD_USE_THROWS_NOT_EXCEPTION = true;
  @Property(externalName = "doc_keep_empty_parameter_tag")
  public boolean JD_KEEP_EMPTY_PARAMETER = true;
  @Property(externalName = "doc_keep_empty_throws_tag")
  public boolean JD_KEEP_EMPTY_EXCEPTION = true;
  @Property(externalName = "doc_keep_empty_return_tag")
  public boolean JD_KEEP_EMPTY_RETURN = true;

  @Property(externalName = "doc_enable_leading_asterisks")
  public boolean JD_LEADING_ASTERISKS_ARE_ENABLED = true;
  @Property(externalName = "doc_preserve_line_breaks")
  public boolean JD_PRESERVE_LINE_FEEDS;
  @Property(externalName = "doc_param_description_on_new_line")
  public boolean JD_PARAM_DESCRIPTION_ON_NEW_LINE;

  @Property(externalName = "doc_indent_on_continuation")
  public boolean JD_INDENT_ON_CONTINUATION = false;

  // endregion

  @Override
  public boolean isLayoutStaticImportsSeparately() {
    return LAYOUT_STATIC_IMPORTS_SEPARATELY;
  }

  @Override
  public void setLayoutStaticImportsSeparately(boolean value) {
    LAYOUT_STATIC_IMPORTS_SEPARATELY = value;

  }

  @Override
  public int getNamesCountToUseImportOnDemand() {
    return NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND;
  }

  @Override
  public void setNamesCountToUseImportOnDemand(int value) {
    NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND = value;
  }

  @Override
  public int getClassCountToUseImportOnDemand() {
    return CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND;
  }

  @Override
  public void setClassCountToUseImportOnDemand(int value) {
    CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND = value;
  }

  @Override
  public boolean isInsertInnerClassImports() {
    return INSERT_INNER_CLASS_IMPORTS;
  }

  @Override
  public void setInsertInnerClassImports(boolean value) {
    INSERT_INNER_CLASS_IMPORTS = value;
  }

  public boolean isInsertInnerClassImportsFor(String className) {
    return INSERT_INNER_CLASS_IMPORTS && !myDoNotImportInner.contains(className);
  }

  @Override
  public boolean isUseSingleClassImports() {
    return USE_SINGLE_CLASS_IMPORTS;
  }

  @Override
  public void setUseSingleClassImports(boolean value) {
    USE_SINGLE_CLASS_IMPORTS = value;
  }

  @Override
  public boolean isUseFqClassNames() {
    return USE_FQ_CLASS_NAMES;
  }

  @Override
  public void setUseFqClassNames(boolean value) {
    USE_FQ_CLASS_NAMES = value;
  }

  @Override
  public PackageEntryTable getImportLayoutTable() {
    return IMPORT_LAYOUT_TABLE;
  }

  @Override
  public PackageEntryTable getPackagesToUseImportOnDemand() {
    return PACKAGES_TO_USE_IMPORT_ON_DEMAND;
  }

  private void initImportsByDefault() {
    PACKAGES_TO_USE_IMPORT_ON_DEMAND.addEntry(new PackageEntry(false, "java.awt", false));
    PACKAGES_TO_USE_IMPORT_ON_DEMAND.addEntry(new PackageEntry(false,"javax.swing", false));
    IMPORT_LAYOUT_TABLE.addEntry(PackageEntry.ALL_OTHER_IMPORTS_ENTRY);
    IMPORT_LAYOUT_TABLE.addEntry(PackageEntry.BLANK_LINE_ENTRY);
    IMPORT_LAYOUT_TABLE.addEntry(new PackageEntry(false, "javax", true));
    IMPORT_LAYOUT_TABLE.addEntry(new PackageEntry(false, "java", true));
    IMPORT_LAYOUT_TABLE.addEntry(PackageEntry.BLANK_LINE_ENTRY);
    IMPORT_LAYOUT_TABLE.addEntry(PackageEntry.ALL_OTHER_STATIC_IMPORTS_ENTRY);
  }

  @SuppressWarnings("unused") // Used in objectEquals.vm
  public boolean isGenerateFinalLocals() {
    return GENERATE_FINAL_LOCALS;
  }

  @SuppressWarnings("unused") // Used in objectEquals.vm
  public boolean isGenerateFinalParameters() {
    return GENERATE_FINAL_PARAMETERS;
  }

  @SuppressWarnings("deprecation")
  @Override
  protected void importLegacySettings(@NotNull CodeStyleSettings rootSettings) {
    USE_EXTERNAL_ANNOTATIONS = rootSettings.USE_EXTERNAL_ANNOTATIONS;
    INSERT_OVERRIDE_ANNOTATION = rootSettings.INSERT_OVERRIDE_ANNOTATION;
    REPEAT_SYNCHRONIZED = rootSettings.REPEAT_SYNCHRONIZED;
    setRepeatAnnotations(rootSettings.getRepeatAnnotations());
    LAYOUT_STATIC_IMPORTS_SEPARATELY = rootSettings.LAYOUT_STATIC_IMPORTS_SEPARATELY;
    USE_FQ_CLASS_NAMES = rootSettings.USE_FQ_CLASS_NAMES;
    USE_SINGLE_CLASS_IMPORTS = rootSettings.USE_SINGLE_CLASS_IMPORTS;
    INSERT_INNER_CLASS_IMPORTS = rootSettings.INSERT_INNER_CLASS_IMPORTS;
    CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND = rootSettings.CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND;
    NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND = rootSettings.NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND;
    PACKAGES_TO_USE_IMPORT_ON_DEMAND.copyFrom(rootSettings.PACKAGES_TO_USE_IMPORT_ON_DEMAND);
    IMPORT_LAYOUT_TABLE.copyFrom(rootSettings.IMPORT_LAYOUT_TABLE);
    FIELD_NAME_PREFIX = rootSettings.FIELD_NAME_PREFIX;
    STATIC_FIELD_NAME_PREFIX = rootSettings.STATIC_FIELD_NAME_PREFIX;
    PARAMETER_NAME_PREFIX = rootSettings.PARAMETER_NAME_PREFIX;
    LOCAL_VARIABLE_NAME_PREFIX = rootSettings.LOCAL_VARIABLE_NAME_PREFIX;

    FIELD_NAME_SUFFIX = rootSettings.FIELD_NAME_SUFFIX;
    STATIC_FIELD_NAME_SUFFIX = rootSettings.STATIC_FIELD_NAME_SUFFIX;
    PARAMETER_NAME_SUFFIX = rootSettings.PARAMETER_NAME_SUFFIX;
    LOCAL_VARIABLE_NAME_SUFFIX = rootSettings.LOCAL_VARIABLE_NAME_SUFFIX;

    PREFER_LONGER_NAMES = rootSettings.PREFER_LONGER_NAMES;
    GENERATE_FINAL_LOCALS = rootSettings.GENERATE_FINAL_LOCALS;
    GENERATE_FINAL_PARAMETERS = rootSettings.GENERATE_FINAL_PARAMETERS;
    VISIBILITY = rootSettings.VISIBILITY;

    ENABLE_JAVADOC_FORMATTING = rootSettings.ENABLE_JAVADOC_FORMATTING;

    JD_LEADING_ASTERISKS_ARE_ENABLED = rootSettings.JD_LEADING_ASTERISKS_ARE_ENABLED;
  }

  @Override
  public Object clone() {
    JavaCodeStyleSettings cloned = (JavaCodeStyleSettings)super.clone();
    cloned.myRepeatAnnotations = new ArrayList<>();
    cloned.setRepeatAnnotations(getRepeatAnnotations());
    cloned.PACKAGES_TO_USE_IMPORT_ON_DEMAND = new PackageEntryTable();
    cloned.PACKAGES_TO_USE_IMPORT_ON_DEMAND.copyFrom(PACKAGES_TO_USE_IMPORT_ON_DEMAND);
    cloned.IMPORT_LAYOUT_TABLE = new PackageEntryTable();
    cloned.IMPORT_LAYOUT_TABLE.copyFrom(IMPORT_LAYOUT_TABLE);
    return cloned;
  }

  @Override
  public void readExternal(Element parentElement) throws InvalidDataException {
    super.readExternal(parentElement);
    readExternalCollection(parentElement, myRepeatAnnotations, REPEAT_ANNOTATIONS, REPEAT_ANNOTATIONS_ITEM);
    readExternalCollection(parentElement, myDoNotImportInner, DO_NOT_IMPORT_INNER, DO_NOT_IMPORT_INNER_ITEM);
  }

  @Override
  public void writeExternal(Element parentElement, @NotNull CustomCodeStyleSettings parentSettings) throws WriteExternalException {
    super.writeExternal(parentElement, parentSettings);
    writeExternalCollection(parentElement, myRepeatAnnotations, REPEAT_ANNOTATIONS, REPEAT_ANNOTATIONS_ITEM);
    writeExternalCollection(parentElement, myDoNotImportInner, DO_NOT_IMPORT_INNER, DO_NOT_IMPORT_INNER_ITEM);
  }

  public static JavaCodeStyleSettings getInstance(@NotNull PsiFile file) {
    return CodeStyle.getCustomSettings(file, JavaCodeStyleSettings.class);
  }

  /**
   * For production code use {@link #getInstance(PsiFile)}
   */
  @TestOnly
  public static JavaCodeStyleSettings getInstance(@NotNull Project project) {
    return CodeStyle.getSettings(project).getCustomSettings(JavaCodeStyleSettings.class);
  }

  private void readExternalCollection(Element parentElement, Collection<? super String> collection, String collectionName, String itemName) {
    Element child = parentElement.getChild(getTagName());
    if (child != null) {
      collection.clear();
      Element item = child.getChild(collectionName);
      if (item != null) {
        for (Element element : item.getChildren(itemName)) {
          collection.add(element.getAttributeValue(COLLECTION_ITEM_ATTRIBUTE));
        }
      }
    }
  }

  private void writeExternalCollection(Element parentElement,
                                       Collection<String> collection,
                                       String collectionName,
                                       String itemName) {
    if (!collection.isEmpty()) {
      Element child = parentElement.getChild(getTagName());
      if (child == null) {
        child = new Element(getTagName());
        parentElement.addContent(child);
      }
      Element element = new Element(collectionName);
      for (String item : collection) {
        element.addContent(new Element(itemName).setAttribute(COLLECTION_ITEM_ATTRIBUTE, item));
      }
      child.addContent(element);
    }
  }

  @Override
  protected void afterLoaded() {
    REPLACE_INSTANCEOF_AND_CAST |= REPLACE_CAST || REPLACE_INSTANCEOF;
    REPLACE_CAST = REPLACE_INSTANCEOF = false;
  }

  @NotNull
  @Override
  public List<String> getKnownTagNames() {
    return Arrays.asList(getTagName(), REPEAT_ANNOTATIONS, DO_NOT_IMPORT_INNER);
  }

  @Override
  public boolean equals(Object obj) {
    if (!super.equals(obj)) return false;
    JavaCodeStyleSettings otherSettings = (JavaCodeStyleSettings)obj;
    if (!myRepeatAnnotations.equals(otherSettings.getRepeatAnnotations())) return false;
    return myDoNotImportInner.equals(otherSettings.getDoNotImportInner());
  }
}


text:
/**
 * @externs
 * @suppress {duplicate,checkTypes}
 */
// NOTE: generated by tsickle, do not edit.
// externs from test_files/export/export_helper_2.ts:
/** @const */
var test_files$export$export_helper_2 = {};

/** @typedef {{a: number}} */
test_files$export$export_helper_2.DeclaredType;
/**
 * @record
 * @struct
 */
test_files$export$export_helper_2.DeclaredInterface = function() {};
/** @type {number} */
test_files$export$export_helper_2.DeclaredInterface.prototype.a;


text:
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 * vim: set ts=8 sw=4 et tw=80:
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef mozilla_jsipc_ContextWrapperChild_h__
#define mozilla_jsipc_ContextWrapperChild_h__

#include "mozilla/jsipc/PContextWrapperChild.h"
#include "mozilla/jsipc/ObjectWrapperChild.h"

#include "jsapi.h"
#include "nsClassHashtable.h"
#include "nsHashKeys.h"

namespace mozilla {
namespace jsipc {

class ContextWrapperChild
    : public PContextWrapperChild
{
public:

    ContextWrapperChild(JSContext* cx)
        : mContext(cx)
    {
        mResidentObjectTable.Init();
    }

    JSContext* GetContext() { return mContext; }

    PObjectWrapperChild* GetOrCreateWrapper(JSObject* obj,
                                            bool makeGlobal = false)
    {
        if (!obj) // Don't wrap nothin'!
            return NULL;
        PObjectWrapperChild* wrapper;
        while (!mResidentObjectTable.Get(obj, &wrapper)) {
            wrapper = SendPObjectWrapperConstructor(AllocPObjectWrapper(obj),
                                                    makeGlobal);
            if (wrapper)
                mResidentObjectTable.Put(obj, wrapper);
            else
                return NULL;
        }
        return wrapper;
    }

protected:

    PObjectWrapperChild* AllocPObjectWrapper(JSObject* obj) {
        return new ObjectWrapperChild(mContext, obj);
    }

    PObjectWrapperChild* AllocPObjectWrapper(const bool&) {
        return AllocPObjectWrapper(JS_GetGlobalObject(mContext));
    }

    bool DeallocPObjectWrapper(PObjectWrapperChild* actor) {
        ObjectWrapperChild* owc = static_cast<ObjectWrapperChild*>(actor);
        mResidentObjectTable.Remove(owc->GetJSObject());
        return true;
    }

private:

    JSContext* const mContext;

    nsClassHashtable<nsPtrHashKey<JSObject>,
                     PObjectWrapperChild> mResidentObjectTable;

};

}}

#endif


text:
salt.modules.mac_shadow
=======================

.. automodule:: salt.modules.mac_shadow
    :members:


text:
import React from 'react';
var ReactPropTypes = React.PropTypes;
var TodoActions = require('../actions/TodoActions');
var TodoItem = require('./TodoItem.react.js');

export default React.createClass({

    propTypes: {
        allTodos:       ReactPropTypes.object.isRequired,
        areAllComplete: ReactPropTypes.bool.isRequired
    },

    render() {
        // This section should be hidden by default
        // and shown when there are todos.
        if (Object.keys(this.props.allTodos).length < 1) {
            return null;
        }

        var allTodos = this.props.allTodos;
        var todos = [];

        for (var key in allTodos) {
            todos.push(<TodoItem key={key} todo={allTodos[key]} />);
        }

        return (

                <input
                    id="toggle-all"
                    type="checkbox"
                    onChange={this._onToggleCompleteAll}
                    checked={this.props.areAllComplete ? 'checked' : ''}
                />
                Mark all as complete

{todos}

        );
    },

    /**
     * Event handler to mark all TODOs as complete
     */
    _onToggleCompleteAll() {
        TodoActions.toggleCompleteAll();
    }
});


text:
rm -rf target/
mvn clean install


text:
<?xml version="1.0" encoding="utf-8"?>
<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolBarMenu"
            style="@style/Toolbar"
            android:layout_alignParentTop="true"
            android:animateLayoutChanges="true"
            app:contentInsetStart="0dp"
            app:layout_scrollFlags="scroll|enterAlways"
            >

            <com.ghn.android.views.FontTextView
                android:id="@+id/tittle_fragment"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:text="Upload News"
                android:textColor="@color/icons_text"
                android:textSize="20sp"/>
        </android.support.v7.widget.Toolbar>

        <android.support.design.widget.TextInputLayout
            android:id="@+id/tittle_news_wrapper"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <EditText
                android:id="@+id/input_email"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:textColor="@color/colorPrimary"
                android:hint="Tittle"
                android:inputType="text"/>

        </android.support.design.widget.TextInputLayout>

        <android.support.design.widget.TextInputLayout
            android:id="@+id/desc_news_wrapper"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <EditText
                android:id="@+id/input_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="Description"
                android:textColor="@color/colorPrimary"
                android:inputType="text"
                android:maxLines="8"
                android:singleLine="true"/>
        </android.support.design.widget.TextInputLayout>

        <android.support.design.widget.TextInputLayout
            android:id="@+id/phone_number_wrapper"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <EditText
                android:id="@+id/input_phone_number"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:hint="Phone Number"
                android:textColor="@color/colorPrimary"
                android:inputType="number"/>

        </android.support.design.widget.TextInputLayout>

        <android.support.v7.widget.CardView
            android:layout_width="300dp"
            android:layout_height="300dp"
            android:layout_gravity="center_horizontal"
            android:layout_marginTop="8dp"
            >

            <ImageView
                android:id="@+id/upload_image"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:src="@drawable/placeholder_normal"
                />
        </android.support.v7.widget.CardView>

        <Button
            android:id="@+id/btn_upload"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="4dp"
            android:background="@color/primary"
            android:backgroundTint="@color/primary"
            android:text="Upload"
            android:textColor="@android:color/white"/>
    </LinearLayout>
</ScrollView>


text: Moved to https://github.com/scalameta/scalameta/releases/tag/v2.0.0


text:
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.debugger.ui.impl.watch;

import com.intellij.debugger.JavaDebuggerBundle;
import com.intellij.debugger.DebuggerContext;
import com.intellij.debugger.DebuggerManagerEx;
import com.intellij.debugger.SourcePosition;
import com.intellij.debugger.engine.ContextUtil;
import com.intellij.debugger.engine.JavaValue;
import com.intellij.debugger.engine.JavaValueModifier;
import com.intellij.debugger.engine.StackFrameContext;
import com.intellij.debugger.engine.evaluation.EvaluateException;
import com.intellij.debugger.engine.evaluation.EvaluateExceptionUtil;
import com.intellij.debugger.engine.evaluation.EvaluationContextImpl;
import com.intellij.debugger.engine.evaluation.TextWithImports;
import com.intellij.debugger.engine.evaluation.expression.ExpressionEvaluator;
import com.intellij.debugger.engine.evaluation.expression.Modifier;
import com.intellij.debugger.engine.evaluation.expression.UnsupportedExpressionException;
import com.intellij.debugger.impl.DebuggerContextImpl;
import com.intellij.debugger.impl.DebuggerUtilsEx;
import com.intellij.debugger.jdi.StackFrameProxyImpl;
import com.intellij.openapi.application.ReadAction;
import com.intellij.openapi.project.IndexNotReadyException;
import com.intellij.openapi.project.Project;
import com.intellij.psi.*;
import com.intellij.xdebugger.XExpression;
import com.intellij.xdebugger.frame.XValueModifier;
import com.sun.jdi.*;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
 * @author lex
 */
public abstract class EvaluationDescriptor extends ValueDescriptorImpl {
  private Modifier myModifier;
  protected TextWithImports myText;

  protected EvaluationDescriptor(TextWithImports text, Project project, Value value) {
    super(project, value);
    myText = text;
  }

  protected EvaluationDescriptor(TextWithImports text, Project project) {
    super(project);
    setLvalue(false);
    myText = text;
  }

  protected abstract EvaluationContextImpl getEvaluationContext(EvaluationContextImpl evaluationContext);

  protected abstract PsiCodeFragment getEvaluationCode(StackFrameContext context) throws EvaluateException;

  public PsiCodeFragment createCodeFragment(PsiElement context) {
    TextWithImports text = getEvaluationText();
    return DebuggerUtilsEx.findAppropriateCodeFragmentFactory(text, context).createCodeFragment(text, context, myProject);
  }

  @ApiStatus.Experimental
  protected @NotNull ExpressionEvaluator getEvaluator(EvaluationContextImpl evaluationContext) throws EvaluateException {
    SourcePosition position = ContextUtil.getSourcePosition(evaluationContext);
    return ReadAction.compute(() -> {
      PsiCodeFragment code = getEvaluationCode(evaluationContext);
      PsiElement psiContext = ContextUtil.getContextElement(evaluationContext, position);
      try {
        return DebuggerUtilsEx.findAppropriateCodeFragmentFactory(getEvaluationText(), psiContext).getEvaluatorBuilder().build(code, position);
      }
      catch (UnsupportedExpressionException ex) {
        ExpressionEvaluator eval = CompilingEvaluatorImpl.create(myProject, code.getContext(), element -> code);
        if (eval != null) {
          return eval;
        }
        throw ex;
      }
    });
  }

  @Override
  public final Value calcValue(EvaluationContextImpl evaluationContext) throws EvaluateException {
    try {
      PsiDocumentManager.getInstance(myProject).commitAndRunReadAction(() -> {});

      EvaluationContextImpl thisEvaluationContext = getEvaluationContext(evaluationContext);

      ExpressionEvaluator evaluator = getEvaluator(thisEvaluationContext);

      if (!thisEvaluationContext.getDebugProcess().isAttached()) {
        throw EvaluateExceptionUtil.PROCESS_EXITED;
      }
      StackFrameProxyImpl frameProxy = thisEvaluationContext.getFrameProxy();
      if (frameProxy == null) {
        throw EvaluateExceptionUtil.NULL_STACK_FRAME;
      }

      Value value = evaluator.evaluate(thisEvaluationContext);
      thisEvaluationContext.keep(value);

      myModifier = evaluator.getModifier();
      setLvalue(myModifier != null);

      return value;
    }
    catch (IndexNotReadyException ex) {
      throw new EvaluateException(JavaDebuggerBundle.message("evaluation.error.during.indexing"), ex);
    }
    catch (final EvaluateException ex) {
      throw new EvaluateException(ex.getLocalizedMessage(), ex);
    }
    catch (ObjectCollectedException ex) {
      throw EvaluateExceptionUtil.OBJECT_WAS_COLLECTED;
    }
  }

  @Override
  public PsiExpression getDescriptorEvaluation(DebuggerContext context) throws EvaluateException {
    PsiElement evaluationCode = getEvaluationCode(context);
    if (evaluationCode instanceof PsiExpressionCodeFragment) {
      return ((PsiExpressionCodeFragment)evaluationCode).getExpression();
    }
    else {
      throw new EvaluateException(JavaDebuggerBundle.message("error.cannot.create.expression.from.code.fragment"), null);
    }
  }

  @Override
  protected boolean isPrintExceptionToConsole() {
    return false;
  }

  @Nullable
  public Modifier getModifier() {
    return myModifier;
  }

  @Override
  public boolean canSetValue() {
    return super.canSetValue() && myModifier != null && myModifier.canSetValue();
  }

  public TextWithImports getEvaluationText() {
    return myText;
  }

  @Override
  public XValueModifier getModifier(JavaValue value) {
    return new JavaValueModifier(value) {
      @Override
      protected void setValueImpl(@NotNull XExpression expression, @NotNull XModificationCallback callback) {
        final EvaluationDescriptor evaluationDescriptor = EvaluationDescriptor.this;
        if (evaluationDescriptor.canSetValue()) {
          final DebuggerContextImpl debuggerContext = DebuggerManagerEx.getInstanceEx(getProject()).getContext();
          set(expression, callback, debuggerContext, new SetValueRunnable() {
            @Override
            public void setValue(EvaluationContextImpl evaluationContext, Value newValue)
              throws ClassNotLoadedException, InvalidTypeException, EvaluateException {
              //noinspection ConstantConditions
              evaluationDescriptor.getModifier().setValue(preprocessValue(evaluationContext, newValue, getLType()));
              update(debuggerContext);
            }

            @NotNull
            @Override
            public Type getLType() throws EvaluateException, ClassNotLoadedException {
              //noinspection ConstantConditions
              return evaluationDescriptor.getModifier().getExpectedType();
            }
          });
        }
      }
    };
  }
}


text:
$(function() {

    $( "#predict" ).button({
	disabled: true
    });

    $( "#input" ).accordion({
	collapsible: true,
	active: false
    });
    $( "#model" ).accordion({
	collapsible: true,
	active: false
    });
    $( "#workflow li" ).draggable({
	appendTo: "body",
	helper: "clone",
	cursor: "move"
    });

    var request = {};

    $( "#inputBox" ).droppable({
	accept: "#input li",
	activeClass: "ui-state-highlight",
	drop: function( event, ui ) {
	    $( this ).find( ".placeholder" ).remove();
	    $( this ).find( "span" ).remove();
	    var tableName = ui.draggable.attr("tableName");
	    request["inputTableName"] = tableName;
	    $( "" ).text( ui.draggable.text() ).appendTo( this );
	}
    });

    $( "#modelBox" ).droppable({
	accept: "#model li",
	activeClass: "ui-state-highlight",
	drop: function( event, ui ) {
	    $( this ).find( ".placeholder" ).remove();
	    $( this ).find( "span" ).remove();
	    var category = ui.draggable.attr("category");
	    var model = ui.draggable.attr("model");
	    request["category"] = category;
	    request["model"] = model;
	    $( "" ).text( ui.draggable.text() ).appendTo( this );
	}
    });

    var modelId;
    $( "#train" ).button().click(function( event ) {
	$('').text("running...").appendTo($("#modelBox"));
	$.ajax({
	    url: "http://localhost:8888/train/",
	    method: "POST",
	    data: JSON.stringify(request),
	    dataType: "json",
	    success: function(data){
		var jobId = data.jobId;
		$.ajax({
		    url: "http://localhost:8888/check/"+jobId+"/",
		    method: "GET",
		    dataType: "json",
		    success: function(data){
			$("#modelBox").find( ".loading" ).remove();
			$("#modelBox").addClass("ui-state-highlight");
			for (var name in data) {
			    if (name == "modelId") {
				modelId = data[name];
				$( "#predict" ).button({
				    disabled: false
				});
			    } else {
				var output = name + ": " + data[name];
				$("").text(output).appendTo($("#modelBox"));
			    }
			}
		    }
		});
	    }});
    });

    $( "#predict" ).button().click(function( event ) {
	var predictRequest = {};
	predictRequest["modelId"] = modelId;
	predictRequest["inputTableName"] = request["inputTableName"];
	$('').text("running...").appendTo($("#outputBox"));
	$.ajax({
	    url: "http://localhost:8888/predict/",
	    method: "POST",
	    data: JSON.stringify(predictRequest),
	    dataType: "json",
	    success: function(data){
		var jobId = data.jobId;
		$.ajax({
		    url: "http://localhost:8888/check/"+jobId+"/",
		    method: "GET",
		    dataType: "json",
		    success: function(data){
			$("#outputBox").find( ".loading" ).remove();
			$("#outputBox").addClass("ui-state-highlight");
			var output = data["outputTableName"];
			$("#outputBox").find( ".placeholder" ).remove();
			$("#outputBox").find( "span" ).remove();
			$("").text(output).appendTo($("#outputBox"));
		    }
		});
	    }});
    });
});


text:
<?php

namespace AppBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class IndexController extends Controller
{
    /**
     * @Route("/", name="front_index", methods={"GET"})
     */
    public function indexAction()
    {
        return $this->render(':default:index.html.twig');
    }

    /**
     * @Route("login", name="front_login", methods={"GET"})
     */
    public function loginAction()
    {
        return $this->render(':default:login.html.twig');
    }

    /**
     * @Route("profile", name="front_user", methods={"GET"})
     */
    public function profileAction()
    {
        return $this->render(':default:user.html.twig');
    }
}


text:
package com.devmarvel.creditcardentrydemo;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.Toast;

import com.devmarvel.creditcardentry.library.CardValidCallback;
import com.devmarvel.creditcardentry.library.CreditCard;
import com.devmarvel.creditcardentry.library.CreditCardForm;

public class SimpleActivity extends Activity {
	private static final String TAG = "SimpleActivity";

	CardValidCallback cardValidCallback = new CardValidCallback() {
		@Override
		public void cardValid(CreditCard card) {
			Log.d(TAG, "valid card: " + card);
			Toast.makeText(SimpleActivity.this, "Card valid and complete", Toast.LENGTH_SHORT).show();
		}
	};

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.simple);

		final CreditCardForm zipForm = (CreditCardForm) findViewById(R.id.form_with_zip);
		zipForm.setOnCardValidCallback(cardValidCallback);
	}

}


text:
Minimal API to arbitrate URLs on GOV.UK.  This maintains a list of all the URL
paths in use on GOV.UK, and for each one records which publishing app owns that
path.

## API Endpoints

### Getting details about a path

To get details of a path:

``` sh
curl http://url-arbiter-api.example.com/paths/foo/bar
```

This will return details of the reserved path as JSON - eg:

``` json
{
  "path": "/foo/bar",
  "publishing_app": "foo_publisher",
  "created_at": "2014-08-13T13:25:17.184Z",
  "updated_at": "2014-08-13T13:25:17.184Z"
}
```

### Reserving a path

To reserve a path:

``` sh
curl http://url-arbiter-api.example.com/paths/foo/bar -X PUT \
    -H 'Content-type: application/json' \
    -d '{"publishing_app": "foo_publisher"}'
```

This will return a [200](http://tools.ietf.org/html/rfc7231#section-6.3.1)
or [201](http://tools.ietf.org/html/rfc7231#section-6.3.2)
status on success along with JSON details as above.

A [409](http://tools.ietf.org/html/rfc7231#section-6.5.8)
status will be returned if the path has already been reserved by a different
publishing application.

A [422](https://tools.ietf.org/html/rfc4918#section-11.2) status will be
returned for any validation errors.

These errors will also include a JSON response including an "errors" field with
any error messages.


text:
namespace tesseract {

// This class that contains the data structures and functions necessary
// to represent and use the knowledge about the language.
class LanguageModel {
 public:
  // Masks for keeping track of top choices that should not be pruned out.
  static const LanguageModelFlagsType kSmallestRatingFlag = 0x1;
  static const LanguageModelFlagsType kLowerCaseFlag = 0x2;
  static const LanguageModelFlagsType kUpperCaseFlag = 0x4;
  static const LanguageModelFlagsType kDigitFlag = 0x8;
  static const LanguageModelFlagsType kXhtConsistentFlag = 0x10;

  // Denominator for normalizing per-letter ngram cost when deriving
  // penalty adjustments.
  static const float kMaxAvgNgramCost;

  LanguageModel(const UnicityTable<FontInfo> *fontinfo_table, Dict *dict);
  ~LanguageModel();

  // Fills the given floats array with features extracted from path represented
  // by the given ViterbiStateEntry. See ccstruct/params_training_featdef.h
  // for feature information.
  // Note: the function assumes that features points to an array of size
  // PTRAIN_NUM_FEATURE_TYPES.
  static void ExtractFeaturesFromPath(const ViterbiStateEntry &vse,
                                      float features[]);

  // Updates data structures that are used for the duration of the segmentation
  // search on the current word;
  void InitForWord(const WERD_CHOICE *prev_word,
                   bool fixed_pitch, float max_char_wh_ratio,
                   float rating_cert_scale);

  // Updates language model state of the given BLOB_CHOICE_LIST (from
  // the ratings matrix) a its parent. Updates pain_points if new
  // problematic points are found in the segmentation graph.
  //
  // At most language_model_viterbi_list_size are kept in each
  // LanguageModelState.viterbi_state_entries list.
  // At most language_model_viterbi_list_max_num_prunable of those are prunable
  // (non-dictionary) paths.
  // The entries that represent dictionary word paths are kept at the front
  // of the list.
  // The list ordered by cost that is computed collectively by several
  // language model components (currently dawg and ngram components).
  bool UpdateState(
      bool just_classified,
      int curr_col, int curr_row,
      BLOB_CHOICE_LIST *curr_list,
      LanguageModelState *parent_node,
      LMPainPoints *pain_points,
      WERD_RES *word_res,
      BestChoiceBundle *best_choice_bundle,
      BlamerBundle *blamer_bundle);

  // Returns true if an acceptable best choice was discovered.
  inline bool AcceptableChoiceFound() { return acceptable_choice_found_; }
  inline void SetAcceptableChoiceFound(bool val) {
    acceptable_choice_found_ = val;
  }
  // Returns the reference to ParamsModel.
  inline ParamsModel &getParamsModel() { return params_model_; }

 protected:

  inline float CertaintyScore(float cert) {
    if (language_model_use_sigmoidal_certainty) {
      // cert is assumed to be between 0 and -dict_->certainty_scale.
      // If you enable language_model_use_sigmoidal_certainty, you
      // need to adjust language_model_ngram_nonmatch_score as well.
      cert = -cert / dict_->certainty_scale;
      return 1.0f / (1.0f + exp(10.0f * cert));
    } else {
      return (-1.0f / cert);
    }
  }

  inline float ComputeAdjustment(int num_problems, float penalty) {
    if (num_problems == 0) return 0.0f;
    if (num_problems == 1) return penalty;
    return (penalty + (language_model_penalty_increment *
                       static_cast<float>(num_problems-1)));
  }

  // Computes the adjustment to the ratings sum based on the given
  // consistency_info. The paths with invalid punctuation, inconsistent
  // case and character type are penalized proportionally to the number
  // of inconsistencies on the path.
  inline float ComputeConsistencyAdjustment(
      const LanguageModelDawgInfo *dawg_info,
      const LMConsistencyInfo &consistency_info) {
    if (dawg_info != NULL) {
      return ComputeAdjustment(consistency_info.NumInconsistentCase(),
                               language_model_penalty_case) +
          (consistency_info.inconsistent_script ?
             language_model_penalty_script : 0.0f);
    }
    return (ComputeAdjustment(consistency_info.NumInconsistentPunc(),
                              language_model_penalty_punc) +
            ComputeAdjustment(consistency_info.NumInconsistentCase(),
                              language_model_penalty_case) +
            ComputeAdjustment(consistency_info.NumInconsistentChartype(),
                              language_model_penalty_chartype) +
            ComputeAdjustment(consistency_info.NumInconsistentSpaces(),
                              language_model_penalty_spacing) +
            (consistency_info.inconsistent_script ?
             language_model_penalty_script : 0.0f) +
            (consistency_info.inconsistent_font ?
             language_model_penalty_font : 0.0f));
  }

  // Returns an adjusted ratings sum that includes inconsistency penalties,
  // penalties for non-dictionary paths and paths with dips in ngram
  // probability.
  float ComputeAdjustedPathCost(ViterbiStateEntry *vse);

  // Finds the first lower and upper case letter and first digit in curr_list.
  // Uses the first character in the list in place of empty results.
  // Returns true if both alpha and digits are found.
  bool GetTopLowerUpperDigit(BLOB_CHOICE_LIST *curr_list,
                             BLOB_CHOICE **first_lower,
                             BLOB_CHOICE **first_upper,
                             BLOB_CHOICE **first_digit) const;
  // Forces there to be at least one entry in the overall set of the
  // viterbi_state_entries of each element of parent_node that has the
  // top_choice_flag set for lower, upper and digit using the same rules as
  // GetTopLowerUpperDigit, setting the flag on the first found suitable
  // candidate, whether or not the flag is set on some other parent.
  // Returns 1 if both alpha and digits are found among the parents, -1 if no
  // parents are found at all (a legitimate case), and 0 otherwise.
  int SetTopParentLowerUpperDigit(LanguageModelState *parent_node) const;

  // Finds the next ViterbiStateEntry with which the given unichar_id can
  // combine sensibly, taking into account any mixed alnum/mixed case
  // situation, and whether this combination has been inspected before.
  ViterbiStateEntry* GetNextParentVSE(
      bool just_classified, bool mixed_alnum,
      const BLOB_CHOICE* bc, LanguageModelFlagsType blob_choice_flags,
      const UNICHARSET& unicharset, WERD_RES* word_res,
      ViterbiStateEntry_IT* vse_it,
      LanguageModelFlagsType* top_choice_flags) const;
  // Helper function that computes the cost of the path composed of the
  // path in the given parent ViterbiStateEntry and the given BLOB_CHOICE.
  // If the new path looks good enough, adds a new ViterbiStateEntry to the
  // list of viterbi entries in the given BLOB_CHOICE and returns true.
  bool AddViterbiStateEntry(
      LanguageModelFlagsType top_choice_flags, float denom, bool word_end,
      int curr_col, int curr_row, BLOB_CHOICE *b,
      LanguageModelState *curr_state, ViterbiStateEntry *parent_vse,
      LMPainPoints *pain_points, WERD_RES *word_res,
      BestChoiceBundle *best_choice_bundle, BlamerBundle *blamer_bundle);

  // Determines whether a potential entry is a true top choice and
  // updates changed accordingly.
  //
  // Note: The function assumes that b, top_choice_flags and changed
  // are not NULL.
  void GenerateTopChoiceInfo(ViterbiStateEntry *new_vse,
                             const ViterbiStateEntry *parent_vse,
                             LanguageModelState *lms);

  // Calls dict_->LetterIsOk() with DawgArgs initialized from parent_vse and
  // unichar from b.unichar_id(). Constructs and returns LanguageModelDawgInfo
  // with updated active dawgs, constraints and permuter.
  //
  // Note: the caller is responsible for deleting the returned pointer.
  LanguageModelDawgInfo *GenerateDawgInfo(bool word_end,
                                          int curr_col, int curr_row,
                                          const BLOB_CHOICE &b,
                                          const ViterbiStateEntry *parent_vse);

  // Computes p(unichar | parent context) and records it in ngram_cost.
  // If b.unichar_id() is an unlikely continuation of the parent context
  // sets found_small_prob to true and returns NULL.
  // Otherwise creates a new LanguageModelNgramInfo entry containing the
  // updated context (that includes b.unichar_id() at the end) and returns it.
  //
  // Note: the caller is responsible for deleting the returned pointer.
  LanguageModelNgramInfo *GenerateNgramInfo(
      const char *unichar, float certainty, float denom,
      int curr_col, int curr_row, float outline_length,
      const ViterbiStateEntry *parent_vse);

  // Computes -(log(prob(classifier)) + log(prob(ngram model)))
  // for the given unichar in the given context. If there are multiple
  // unichars at one position - takes the average of their probabilities.
  // UNICHAR::utf8_step() is used to separate out individual UTF8 characters,
  // since probability_in_context() can only handle one at a time (while
  // unicharset might contain ngrams and glyphs composed from multiple UTF8
  // characters).
  float ComputeNgramCost(const char *unichar, float certainty, float denom,
                         const char *context, int *unichar_step_len,
                         bool *found_small_prob, float *ngram_prob);

  // Computes the normalization factors for the classifier confidences
  // (used by ComputeNgramCost()).
  float ComputeDenom(BLOB_CHOICE_LIST *curr_list);

  // Fills the given consistenty_info based on parent_vse.consistency_info
  // and on the consistency of the given unichar_id with parent_vse.
  void FillConsistencyInfo(
      int curr_col, bool word_end, BLOB_CHOICE *b,
      ViterbiStateEntry *parent_vse,
      WERD_RES *word_res,
      LMConsistencyInfo *consistency_info);

  // Constructs WERD_CHOICE by recording unichar_ids of the BLOB_CHOICEs
  // on the path represented by the given BLOB_CHOICE and language model
  // state entries (lmse, dse). The path is re-constructed by following
  // the parent pointers in the the lang model state entries). If the
  // constructed WERD_CHOICE is better than the best/raw choice recorded
  // in the best_choice_bundle, this function updates the corresponding
  // fields and sets best_choice_bunldle->updated to true.
  void UpdateBestChoice(ViterbiStateEntry *vse,
                        LMPainPoints *pain_points,
                        WERD_RES *word_res,
                        BestChoiceBundle *best_choice_bundle,
                        BlamerBundle *blamer_bundle);

  // Constructs a WERD_CHOICE by tracing parent pointers starting with
  // the given LanguageModelStateEntry. Returns the constructed word.
  // Updates best_char_choices, certainties and state if they are not
  // NULL (best_char_choices and certainties are assumed to have the
  // length equal to lmse->length).
  // The caller is responsible for freeing memory associated with the
  // returned WERD_CHOICE.
  WERD_CHOICE *ConstructWord(ViterbiStateEntry *vse,
                             WERD_RES *word_res,
                             DANGERR *fixpt,
                             BlamerBundle *blamer_bundle,
                             bool *truth_path);

  // Wrapper around AssociateUtils::ComputeStats().
  inline void ComputeAssociateStats(int col, int row,
                                    float max_char_wh_ratio,
                                    ViterbiStateEntry *parent_vse,
                                    WERD_RES *word_res,
                                    AssociateStats *associate_stats) {
    AssociateUtils::ComputeStats(
        col, row,
        (parent_vse != NULL) ? &(parent_vse->associate_stats) : NULL,
        (parent_vse != NULL) ? parent_vse->length : 0,
        fixed_pitch_, max_char_wh_ratio,
        word_res, language_model_debug_level > 2, associate_stats);
  }

  // Returns true if the path with such top_choice_flags and dawg_info
  // could be pruned out (i.e. is neither a system/user/frequent dictionary
  // nor a top choice path).
  // In non-space delimited languages all paths can be "somewhat" dictionary
  // words. In such languages we can not do dictionary-driven path pruning,
  // so paths with non-empty dawg_info are considered prunable.
  inline bool PrunablePath(const ViterbiStateEntry &vse) {
    if (vse.top_choice_flags) return false;
    if (vse.dawg_info != NULL &&
        (vse.dawg_info->permuter == SYSTEM_DAWG_PERM ||
         vse.dawg_info->permuter == USER_DAWG_PERM ||
         vse.dawg_info->permuter == FREQ_DAWG_PERM)) return false;
    return true;
  }

  // Returns true if the given ViterbiStateEntry represents an acceptable path.
  inline bool AcceptablePath(const ViterbiStateEntry &vse) {
    return (vse.dawg_info != NULL || vse.Consistent() ||
            (vse.ngram_info != NULL && !vse.ngram_info->pruned));
  }

 public:
  // Parameters.
  INT_VAR_H(language_model_debug_level, 0, "Language model debug level");
  BOOL_VAR_H(language_model_ngram_on, false,
             "Turn on/off the use of character ngram model");
  INT_VAR_H(language_model_ngram_order, 8,
            "Maximum order of the character ngram model");
  INT_VAR_H(language_model_viterbi_list_max_num_prunable, 10,
            "Maximum number of prunable (those for which PrunablePath() is"
            " true) entries in each viterbi list recorded in BLOB_CHOICEs");
  INT_VAR_H(language_model_viterbi_list_max_size, 500,
            "Maximum size of viterbi lists recorded in BLOB_CHOICEs");
  double_VAR_H(language_model_ngram_small_prob, 0.000001,
               "To avoid overly small denominators use this as the floor"
               " of the probability returned by the ngram model");
  double_VAR_H(language_model_ngram_nonmatch_score, -40.0,
               "Average classifier score of a non-matching unichar");
  BOOL_VAR_H(language_model_ngram_use_only_first_uft8_step, false,
             "Use only the first UTF8 step of the given string"
             " when computing log probabilities");
  double_VAR_H(language_model_ngram_scale_factor, 0.03,
               "Strength of the character ngram model relative to the"
               " character classifier ");
  double_VAR_H(language_model_ngram_rating_factor, 16.0,
               "Factor to bring log-probs into the same range as ratings"
               " when multiplied by outline length ");
  BOOL_VAR_H(language_model_ngram_space_delimited_language, true,
             "Words are delimited by space");
  INT_VAR_H(language_model_min_compound_length, 3,
            "Minimum length of compound words");
  // Penalties used for adjusting path costs and final word rating.
  double_VAR_H(language_model_penalty_non_freq_dict_word, 0.1,
               "Penalty for words not in the frequent word dictionary");
  double_VAR_H(language_model_penalty_non_dict_word, 0.15,
               "Penalty for non-dictionary words");
  double_VAR_H(language_model_penalty_punc, 0.2,
               "Penalty for inconsistent punctuation");
  double_VAR_H(language_model_penalty_case, 0.1,
               "Penalty for inconsistent case");
  double_VAR_H(language_model_penalty_script, 0.5,
               "Penalty for inconsistent script");
  double_VAR_H(language_model_penalty_chartype, 0.3,
               "Penalty for inconsistent character type");
  double_VAR_H(language_model_penalty_font, 0.00,
               "Penalty for inconsistent font");
  double_VAR_H(language_model_penalty_spacing, 0.05,
               "Penalty for inconsistent spacing");
  double_VAR_H(language_model_penalty_increment, 0.01, "Penalty increment");
  INT_VAR_H(wordrec_display_segmentations, 0, "Display Segmentations");
  BOOL_VAR_H(language_model_use_sigmoidal_certainty, false,
             "Use sigmoidal score for certainty");

 protected:
  // Member Variables.

  // Temporary DawgArgs struct that is re-used across different words to
  // avoid dynamic memory re-allocation (should be cleared before each use).
  DawgArgs *dawg_args_;
  // Scaling for recovering blob outline length from rating and certainty.
  float rating_cert_scale_;

  // The following variables are set at construction time.

  // Pointer to fontinfo table (not owned by LanguageModel).
  const UnicityTable<FontInfo> *fontinfo_table_;

  // Pointer to Dict class, that is used for querying the dictionaries
  // (the pointer is not owned by LanguageModel).
  Dict *dict_;

  // TODO(daria): the following variables should become LanguageModel params
  // when the old code in bestfirst.cpp and heuristic.cpp is deprecated.
  //
  // Set to true if we are dealing with fixed pitch text
  // (set to assume_fixed_pitch_char_segment).
  bool fixed_pitch_;
  // Max char width-to-height ratio allowed
  // (set to segsearch_max_char_wh_ratio).
  float max_char_wh_ratio_;

  // The following variables are initialized with InitForWord().

  // String representation of the classification of the previous word
  // (since this is only used by the character ngram model component,
  // only the last language_model_ngram_order of the word are stored).
  STRING prev_word_str_;
  int prev_word_unichar_step_len_;
  // Active dawg vector.
  DawgPositionVector *very_beginning_active_dawgs_;  // includes continuation
  DawgPositionVector *beginning_active_dawgs_;
  // Set to true if acceptable choice was discovered.
  // Note: it would be nice to use this to terminate the search once an
  // acceptable choices is found. However we do not do that and once an
  // acceptable choice is found we finish looking for alternative choices
  // in the current segmentation graph and then exit the search (no more
  // classifications are done after an acceptable choice is found).
  // This is needed in order to let the search find the words very close to
  // the best choice in rating (e.g. what/What, Cat/cat, etc) and log these
  // choices. This way the stopper will know that the best choice is not
  // ambiguous (i.e. there are best choices in the best choice list that have
  // ratings close to the very best one) and will be less likely to mis-adapt.
  bool acceptable_choice_found_;
  // Set to true if a choice representing correct segmentation was explored.
  bool correct_segmentation_explored_;

  // Params models containing weights for for computing ViterbiStateEntry costs.
  ParamsModel params_model_;
};

}  // namespace tesseract

#endif  // TESSERACT_WORDREC_LANGUAGE_MODEL_H_


text:
package dbcl

import (
	"sync"

	"github.com/OneOfOne/dbcl/backend"
)

func newBucket(name string, mFn MarshalFn, uFn UnmarshalFn) *Bucket {
	return &Bucket{
		name: name,
		data: make(map[string][]byte),
		tmp:  make(map[string][]byte),

		mFn: mFn,
		uFn: uFn,
	}
}

type Bucket struct {
	name string
	data map[string][]byte
	tmp  map[string][]byte

	mFn MarshalFn
	uFn UnmarshalFn

	m  sync.RWMutex
	tx *Tx
}

func (b *Bucket) Get(key string, out interface{}) error {
	if b.tx != nil {
		if v, ok := b.tmp[key]; ok {
			if v == nil {
				return ErrNotFound
			}
			return b.uFn(v, out)
		}
	}
	if v, ok := b.data[key]; ok {
		return b.uFn(v, out)
	}
	return ErrNotFound
}

func (b *Bucket) Set(key string, value interface{}) error {
	if b.tx == nil {
		return ErrReadOnly
	}

	var (
		val []byte
		err error
	)

	if val, err = b.mFn(value); err != nil {
		return err
	}

	b.tmp[key] = val
	b.tx.action(backend.ActionSet, b.name, key, val)

	return nil
}

func (b *Bucket) GetRaw(key string) []byte {
	if b.tx != nil {
		if v, ok := b.tmp[key]; ok {
			return copyBytes(v)
		}
	}

	return copyBytes(b.data[key])
}

func (b *Bucket) SetRaw(key string, val []byte) error {
	if b.tx == nil {
		return ErrReadOnly
	}

	val = copyBytes(val)
	b.tmp[key] = val
	b.tx.action(backend.ActionSet, b.name, key, val)

	return nil
}

func (b *Bucket) Delete(key string) error {
	if b.tx == nil {
		return ErrReadOnly
	}

	b.tmp[key] = nil
	b.tx.action(backend.ActionDelete, b.name, key, nil)

	return nil
}

func (b *Bucket) commit() {
	for k, v := range b.tmp {
		if v == nil {
			delete(b.data, k)
		} else {
			b.data[k] = v
		}
		delete(b.tmp, k)
	}
}

func (b *Bucket) rollback() {
	for k := range b.tmp {
		delete(b.tmp, k)
	}
}

// CreateBucket creates or returns a sub bucket by the specified name.
// TODO: implement sub buckets
func (b *Bucket) CreateBucket(name string) (*Bucket, error) { panic("n/i") }

// Bucket returns a sub bucket by the specified name, nil if it doesn't exist.
// TODO: implement sub buckets
func (b *Bucket) Bucket(name string) *Bucket { panic("n/i") }


text:
/* TEMPLATE GENERATED TESTCASE FILE
Filename: CWE121_Stack_Based_Buffer_Overflow__CWE805_wchar_t_alloca_snprintf_68b.c
Label Definition File: CWE121_Stack_Based_Buffer_Overflow__CWE805.string.label.xml
Template File: sources-sink-68b.tmpl.c
*/
/*
 * @description
 * CWE: 121 Stack Based Buffer Overflow
 * BadSource:  Set data pointer to the bad buffer
 * GoodSource: Set data pointer to the good buffer
 * Sink: snprintf
 *    BadSink : Copy string to data using snprintf
 * Flow Variant: 68 Data flow: data passed as a global variable from one function to another in different source files
 *
 * */

#include "std_testcase.h"

#include <wchar.h>

#ifdef _WIN32
#define SNPRINTF _snwprintf
#else
#define SNPRINTF snprintf
#endif

extern wchar_t * CWE121_Stack_Based_Buffer_Overflow__CWE805_wchar_t_alloca_snprintf_68_badData;
extern wchar_t * CWE121_Stack_Based_Buffer_Overflow__CWE805_wchar_t_alloca_snprintf_68_goodG2BData;

/* all the sinks are the same, we just want to know where the hit originated if a tool flags one */

#ifndef OMITBAD

void CWE121_Stack_Based_Buffer_Overflow__CWE805_wchar_t_alloca_snprintf_68b_badSink()
{
    wchar_t * data = CWE121_Stack_Based_Buffer_Overflow__CWE805_wchar_t_alloca_snprintf_68_badData;
    {
        wchar_t source[100];
        wmemset(source, L'C', 100-1); /* fill with L'C's */
        source[100-1] = L'\0'; /* null terminate */
        /* POTENTIAL FLAW: Possible buffer overflow if the size of data is less than the length of source */
        SNPRINTF(data, 100, L"%s", source);
        printWLine(data);
    }
}

#endif /* OMITBAD */

#ifndef OMITGOOD

/* goodG2B uses the GoodSource with the BadSink */
void CWE121_Stack_Based_Buffer_Overflow__CWE805_wchar_t_alloca_snprintf_68b_goodG2BSink()
{
    wchar_t * data = CWE121_Stack_Based_Buffer_Overflow__CWE805_wchar_t_alloca_snprintf_68_goodG2BData;
    {
        wchar_t source[100];
        wmemset(source, L'C', 100-1); /* fill with L'C's */
        source[100-1] = L'\0'; /* null terminate */
        /* POTENTIAL FLAW: Possible buffer overflow if the size of data is less than the length of source */
        SNPRINTF(data, 100, L"%s", source);
        printWLine(data);
    }
}

#endif /* OMITGOOD */