hexsha
stringlengths
40
40
size
int64
5
1.05M
ext
stringclasses
98 values
lang
stringclasses
21 values
max_stars_repo_path
stringlengths
3
945
max_stars_repo_name
stringlengths
4
118
max_stars_repo_head_hexsha
stringlengths
40
78
max_stars_repo_licenses
listlengths
1
10
max_stars_count
int64
1
368k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
3
945
max_issues_repo_name
stringlengths
4
118
max_issues_repo_head_hexsha
stringlengths
40
78
max_issues_repo_licenses
listlengths
1
10
max_issues_count
int64
1
134k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
945
max_forks_repo_name
stringlengths
4
135
max_forks_repo_head_hexsha
stringlengths
40
78
max_forks_repo_licenses
listlengths
1
10
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
5
1.05M
avg_line_length
float64
1
1.03M
max_line_length
int64
2
1.03M
alphanum_fraction
float64
0
1
72e71fb9774dab3ce9fa85715a39374511aace4e
212
cs
C#
MetX/MetX.Standard/Data/Join.cs
wrawlsqw/xlg
f839e0da9eb33ace2db021327c2ff0e064795243
[ "ISC" ]
2
2016-06-18T02:33:02.000Z
2016-07-04T05:40:26.000Z
MetX/MetX.Standard/Data/Join.cs
wrawlsqw/xlg
f839e0da9eb33ace2db021327c2ff0e064795243
[ "ISC" ]
4
2020-04-30T16:54:26.000Z
2021-06-11T16:56:26.000Z
MetX/MetX.Standard/Data/Join.cs
wrawlsqw/xlg
f839e0da9eb33ace2db021327c2ff0e064795243
[ "ISC" ]
2
2021-06-29T21:25:33.000Z
2022-01-10T16:25:38.000Z
namespace MetX.Standard.Data { public class Join { public string FromColumn; public string ToColumn; public string JoinTable; public string JoinType = "INNER JOIN"; } }
21.2
46
0.622642
2d70ebeda5cd74059dd3dfd370652908a6a33abc
2,184
css
CSS
src/app/app.component.css
vectordiman/SpaceY
184ff3461237e122db72f6cc3d93d76b45f123fd
[ "MIT" ]
3
2021-02-13T19:32:55.000Z
2021-04-14T21:51:02.000Z
src/app/app.component.css
SpaceYstudentProject/Testtt
b6c0ea84ac370304c3803622318943cabab3f482
[ "MIT" ]
null
null
null
src/app/app.component.css
SpaceYstudentProject/Testtt
b6c0ea84ac370304c3803622318943cabab3f482
[ "MIT" ]
2
2021-02-16T11:24:03.000Z
2021-04-14T21:47:32.000Z
.navigation, nav, .navbar, .list-group-item, footer { background: rgb(29,29,29); } .navigation { height: 59px; } .list-group-item:hover { background-color: black; } .wrapper { background: #252626; position: relative; overflow: hidden; min-height: calc(100vh - 115.3px); } .menu { position: fixed; right: 0; top: 3.7em; width: 20%; height: 100%; transition: 0.5s; transform: translateX(100%); z-index: 15; } .menu-active { transform: translateX(0%); } .blackout { margin-top: -3em; position: absolute; background-color: black; width: 100%; z-index: -1; transition: 0.5s; opacity: 0.0; -ms-overflow-x: hidden; } .blackout-active { opacity: 0.5; z-index: 10; height: 150%; overflow: hidden; } .menu-btn { position: relative; display: flex; justify-content: center; align-items: center; width: 28px; height: 28px; cursor: pointer; transition: all 0.5s ease-in-out; margin-right: 1vh; } .menu-btn_burger { width: 28px; height: 3px; background: #fff; /*border-radius: 5px;*/ box-shadow: 0 2px 5px rgba(255, 101, 47, 0.2); transition: all 0.5s ease-in-out; } .menu-btn_burger::before { content: ""; position: absolute; width: 28px; height: 3px; background: #fff; border-radius: 5px; box-shadow: 0 2px 5px rgba(255, 101, 47, 0.2); transition: all 0.5s ease-in-out; } .menu-btn_burger::after { content: ""; position: absolute; width: 28px; height: 3px; background: #fff; border-radius: 5px; box-shadow: 0 2px 5px rgba(255, 101, 47, 0.2); transition: all 0.5s ease-in-out; } .menu-btn_burger::before { transform: translateY(-10px); } .menu-btn_burger::after { transform: translateY(10px); } .menu-btn.open .menu-btn_burger { transform: translateX(-50px); background: transparent; box-shadow: none; } .menu-btn.open .menu-btn_burger::before { transform: rotate(45deg) translate(35px, -35px); } .menu-btn.open .menu-btn_burger::after { transform: rotate(-45deg) translate(35px, 35px); } #image-git { background: #eff0f0; width: 20px; height: 20px; border-radius: 50%; border: 10px none; } #footer-main { margin: auto auto 0; width: 100%; }
17.901639
53
0.652015
cd35142cddfa798f33b45eb2bab622bdce6f36ce
2,115
sh
Shell
formatting_scripts/fix_formatting.sh
EvanMorcom/Software
586fb3cf8dc2d93de194d9815af5de63caa7e318
[ "MIT" ]
null
null
null
formatting_scripts/fix_formatting.sh
EvanMorcom/Software
586fb3cf8dc2d93de194d9815af5de63caa7e318
[ "MIT" ]
null
null
null
formatting_scripts/fix_formatting.sh
EvanMorcom/Software
586fb3cf8dc2d93de194d9815af5de63caa7e318
[ "MIT" ]
null
null
null
#!/bin/bash # # This script is used for running formatting checks in CI # # The version of the clang executable to use export CLANG_VERSION=10.0 # The version of black to use export BLACK_VERSION=19-10b0 # The directory this script is in CURR_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # The root bazel directory BAZEL_ROOT_DIR="$CURR_DIR/../src" # Extensions to check formatting for clang-format CLANG_FORMAT_EXTENSIONS=(h cpp c hpp tpp proto) # Function to run clang format function run_clang_format () { echo "Running clang format over all files..." cd $BAZEL_ROOT_DIR # Generate extension string # Formatted as -iname *.EXTENSION -o EXTENSION_STRING="" for value in "${CLANG_FORMAT_EXTENSIONS[@]}" do EXTENSION_STRING="$EXTENSION_STRING -name *.$value -o" done # Find all the files that we want to format, and pass them to # clang-format as arguments # We remove the last -o flag from the extension string find $CURR_DIR/../src/ ${EXTENSION_STRING::-2} \ | xargs -I{} -n1000 $CURR_DIR/clang-format-$CLANG_VERSION -i -style=file if [[ "$?" != 0 ]]; then # There was a problem in at least one execution of clang-format exit 1 fi } # Function to run bazel formatting function run_bazel_formatting () { echo "Running bazel buildifier to format all bazel files..." cd $BAZEL_ROOT_DIR bazel run @com_github_bazelbuild_buildtools//:buildifier if [[ "$?" != 0 ]]; then exit 1 fi } # Function to run black python formatting function run_black_formatting () { echo "Running black to format Python files..." $CURR_DIR/black_$BLACK_VERSION $BAZEL_ROOT_DIR if [[ "$?" != 0 ]]; then exit 1 fi } function run_code_spell(){ echo "Fixing spellings..." cd $CURR_DIR/../src/software && codespell -w cd $CURR_DIR/../src/firmware_new && codespell -w cd $CURR_DIR/../src/firmware/app && codespell -w cd $CURR_DIR/../src/shared && codespell -w } # Run formatting run_code_spell run_clang_format run_bazel_formatting run_black_formatting exit 0
25.792683
80
0.679433
588c6eb7c0269f1dcb90373e2a9a3024a46da202
432
css
CSS
css/SweetAlert.css
rajvaibhavjain/ETLib
c3ede0a6175c6df52372742c9af71d08110fa756
[ "MIT" ]
null
null
null
css/SweetAlert.css
rajvaibhavjain/ETLib
c3ede0a6175c6df52372742c9af71d08110fa756
[ "MIT" ]
null
null
null
css/SweetAlert.css
rajvaibhavjain/ETLib
c3ede0a6175c6df52372742c9af71d08110fa756
[ "MIT" ]
null
null
null
/*Sweet Alert*/ .swal-button { background-color: #ff5e14 !important; } .swal-icon--success { border-color: #ff5e14 !important; border: 4px solid #ff5e14!important; } .swal-icon--success__ring { border-color: #ff5e14 !important; } .swal-icon--success__line { background-color: #ff5e14 !important; } .swal-overlay { background-color: #ff5e1442 !important; } .swal-modal { border: 3px solid #ff5100; }
16.615385
43
0.671296
d63ce1a69838d5c718fe37b539efd71131eb968b
10,049
cs
C#
Client/Bar.cs
cafehaine/windmenu
0b6cbe282926d5f0b3a81b8d36a0e8ba6232756c
[ "MIT" ]
10
2017-06-23T00:58:06.000Z
2020-12-02T08:04:20.000Z
Client/Bar.cs
psgarsenal/windmenu
0b6cbe282926d5f0b3a81b8d36a0e8ba6232756c
[ "MIT" ]
1
2017-03-01T10:33:48.000Z
2017-03-01T10:33:48.000Z
Client/Bar.cs
psgarsenal/windmenu
0b6cbe282926d5f0b3a81b8d36a0e8ba6232756c
[ "MIT" ]
7
2018-04-24T10:07:08.000Z
2021-12-20T09:24:15.000Z
using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.IO.MemoryMappedFiles; using System.Net.Sockets; using System.Text; using System.Windows.Forms; namespace Client { class Bar : Form { public enum Position : byte { top = 1, bottom = 0 } #region Variables private Color barBack; private SolidBrush barFore; private SolidBrush selBack; private SolidBrush selFore; private Screen output; private Position pos; private int barHeight; private string text = string.Empty; private string[] programList; private List<string> suggestions; private int suggIndex = 0; private string lastSuggested = string.Empty; private Point oldMousePos; #endregion public Bar(Position Pos, Color NormalBack, Color NormalFore, Color FocusedBack, Color FocusedFore, Font Font) { Text = "BTWM-EXCLUDED windwenu"; BackColor = NormalBack; ForeColor = NormalFore; this.Font = Font; // Make windmenu appear on focused screen output = Screen.PrimaryScreen; foreach (Screen scr in Screen.AllScreens) if (scr.Bounds.Contains(Cursor.Position)) output = scr; pos = Pos; DoubleBuffered = true; // Reduce flickering on redraw TopMost = true; // Draw on top of everything barBack = NormalBack; barFore = new SolidBrush(NormalFore); selBack = new SolidBrush(FocusedBack); selFore = new SolidBrush(FocusedFore); FormBorderStyle = FormBorderStyle.None; ShowInTaskbar = false; // Retreive program list: try { MemoryMappedFile mmf = MemoryMappedFile.OpenExisting("windmenu", MemoryMappedFileRights.Read); MemoryMappedViewAccessor va = mmf.CreateViewAccessor(0, 8, MemoryMappedFileAccess.Read); long sizeData; va.Read(0, out sizeData); va.Dispose(); va = mmf.CreateViewAccessor(8, sizeData, MemoryMappedFileAccess.Read); byte[] data = new byte[sizeData]; va.ReadArray(0, data, 0, (int)sizeData); va.Dispose(); mmf.Dispose(); programList = Encoding.Unicode.GetString(data).Split('|'); } catch (Exception) { throw new Exception("Communication error with the server.\nTry killing the server and starting it again."); } suggestions = new List<string>(); } protected override CreateParams CreateParams { get { CreateParams cp = base.CreateParams; cp.ExStyle |= 0x80; return cp; } } protected override void OnLoad(EventArgs e) { base.OnLoad(e); int x, y, width, height; width = output.Bounds.Width; height = Font.Height + 2; barHeight = height; x = output.Bounds.X; switch (pos) { case Position.top: y = 0; break; default: y = output.Bounds.Y + output.Bounds.Height - height; break; } SetBoundsCore(x, y, width, height, BoundsSpecified.All); updateSuggestions(); oldMousePos = Cursor.Position; Cursor = new Cursor(Cursor.Current.Handle); Cursor.Position = new Point(ClientRectangle.Width / 10, ClientRectangle.Height); Cursor.Clip = new Rectangle(Location, Size); Cursor.Hide(); BringToFront(); Activate(); } protected override void OnClosing(CancelEventArgs e) { Cursor.Clip = new Rectangle(); Cursor.Position = oldMousePos; Cursor.Show(); base.OnClosing(e); } protected override void OnKeyDown(KeyEventArgs e) { if (e.KeyCode == Keys.Escape) Close(); else if (e.KeyCode == Keys.Enter) { if (suggestions.Count > 0 || text.StartsWith(lastSuggested, StringComparison.OrdinalIgnoreCase)) { TcpClient clientSocket; string data; if (suggestions.Count > 0) data = "run" + suggestions[suggIndex]; else data = "run" + lastSuggested + "|" + text.Substring(lastSuggested.Length + 1); clientSocket = new TcpClient(); try { clientSocket.Connect(System.Net.IPAddress.Loopback, 12321); } catch { MessageBox.Show("Server unreachable."); return; } NetworkStream serverStream = clientSocket.GetStream(); byte[] outStream = Encoding.Unicode.GetBytes(data); byte[] messageSize = new byte[] { (byte)(outStream.Length / 256), (byte)(outStream.Length % 256) }; serverStream.Write(messageSize, 0, 2); serverStream.Write(outStream, 0, outStream.Length); clientSocket.Close(); } Close(); } else if (e.KeyCode == Keys.Back) { if (text.Length == 0) return; text = text.Substring(0, text.Length - 1); updateSuggestions(); } else if (e.KeyCode == Keys.Left) { if (suggIndex > 0) { suggIndex--; Invalidate(); } } else if (e.KeyCode == Keys.Right) { if (suggIndex < suggestions.Count - 1) { suggIndex++; Invalidate(); } } else if (e.KeyCode == Keys.Tab) { text = suggestions[suggIndex]; updateSuggestions(); } else { string input = KeyboardConverter.KeyCodeToUnicode(e.KeyCode); if (input != "") { text += input; updateSuggestions(); } } } protected override void OnLostFocus(EventArgs e) { #if !DEBUG Close(); #endif } protected override void OnPaint(PaintEventArgs e) { Graphics g = e.Graphics; g.Clear(barBack); float RightMost = ClientRectangle.Width; SizeF textSize = g.MeasureString(text, Font); if (textSize.Width < ClientRectangle.Width / 10) g.DrawString(text, Font, barFore, new RectangleF(1, 1, ClientRectangle.Width / 10, ClientRectangle.Height - 2)); else g.DrawString(text, Font, barFore, new RectangleF(ClientRectangle.Width / 10 - textSize.Width, 1, textSize.Width, ClientRectangle.Height - 2)); float leftPos = ClientRectangle.Width / 10 + 2; for (int i = 0; i < suggestions.Count; i++) { string sugg = suggestions[i]; SizeF size = g.MeasureString(sugg, Font); if (i == suggIndex) { g.FillRectangle(selBack, new Rectangle((int)leftPos, 0, (int)size.Width, barHeight)); g.DrawString(sugg, Font, selFore, new PointF(leftPos, 1)); } else g.DrawString(sugg, Font, barFore, new PointF(leftPos, 1)); leftPos += size.Width + 2; } } private class comparer : IComparer { string input; public comparer(string Input) { input = Input; } int IComparer.Compare(object a, object b) { string x = (string)a; string y = (string)b; if (x == y) return 0; bool xStarts = x.StartsWith(input, StringComparison.OrdinalIgnoreCase); bool yStarts = y.StartsWith(input, StringComparison.OrdinalIgnoreCase); if (xStarts ^ yStarts) { if (xStarts) return -1; return 1; } else return string.Compare(x, y, true); } } private void updateSuggestions() { if (suggestions.Count != 0) lastSuggested = suggestions[suggIndex]; suggIndex = 0; suggestions.Clear(); int i = 0; Graphics temp = Graphics.FromHwndInternal(Handle); float xPosition = 0; Array.Sort(programList, new comparer(text)); while (xPosition < ClientRectangle.Width * 0.9F && i < programList.Length) { string element = programList[i]; if (element.ToLower().Contains(text.ToLower())) { suggestions.Add(element); xPosition += temp.MeasureString(element, Font).Width + 2; } i++; } temp.Dispose(); Invalidate(); } } }
31.600629
158
0.479252
baa4b8d601eac87e91958ec009afd140f03aa424
1,142
css
CSS
client/src/css/ResearchThemes.css
divyanshu-kushwaha/Astro_Website
8612dfc0a6affdee9083c7d888e93db4897b55fa
[ "MIT" ]
null
null
null
client/src/css/ResearchThemes.css
divyanshu-kushwaha/Astro_Website
8612dfc0a6affdee9083c7d888e93db4897b55fa
[ "MIT" ]
3
2022-01-31T09:13:15.000Z
2022-02-07T15:02:53.000Z
client/src/css/ResearchThemes.css
divyanshu-kushwaha/Astro_Website
8612dfc0a6affdee9083c7d888e93db4897b55fa
[ "MIT" ]
1
2021-10-31T18:08:46.000Z
2021-10-31T18:08:46.000Z
/* .i-am-centered { margin: auto; max-width: 300px;} */ @media (max-width: 640px){ .card-title{ font-size: x-large; font-family: monospace; } .card-text { font-size: medium; font-family: "Roboto"; /* text-align: center; */ } .cardhgt { height: auto; background-color : transparent; /* margin: 0 1rem 0 1rem; */ } } .card-text { font-family: "Roboto"; } .cardhgt { height: 18rem; background-color : transparent; /* margin: 0 1rem 0 1rem; */ } .cardbd { background: linear-gradient(90deg, rgba(45,78,128,1) 0%, rgba(1,19,32,1) 100%); background-color: #007bff; font-family: monospace; } .cardbd:hover { background-color: rgb(45, 78, 128); } .lststyle { list-style-type:circle !important; padding-inline-start: 10px; } .blockcol{ /* background: red; */ padding:20px; background-image: linear-gradient(to left,transparent, transparent 50%,rgb(45, 78, 128) 50%, #011320); background-position: 100% 0; background-size: 200% 100%; transition: all .5s ease-in; } .blockcol:hover{ background-position: 0 0; }
20.392857
106
0.604203
ef55f9e28006969e4426232086b2d28f26424923
509
php
PHP
app/Policies/LocalePolicy.php
viktorcsimma/mars
840315df597a3118390b03bbe36e24606fc16e81
[ "MIT" ]
6
2019-10-23T13:17:42.000Z
2021-07-24T22:37:16.000Z
app/Policies/LocalePolicy.php
viktorcsimma/mars
840315df597a3118390b03bbe36e24606fc16e81
[ "MIT" ]
470
2019-09-29T21:26:54.000Z
2022-03-25T21:41:53.000Z
app/Policies/LocalePolicy.php
viktorcsimma/mars
840315df597a3118390b03bbe36e24606fc16e81
[ "MIT" ]
25
2019-10-02T19:16:42.000Z
2022-01-22T14:33:36.000Z
<?php namespace App\Policies; use App\Models\LocalizationContribution; use App\Models\Role; use App\Models\User; use Illuminate\Auth\Access\HandlesAuthorization; class LocalePolicy { use HandlesAuthorization; public function viewAny(User $user) { return $user->hasRoleBase(Role::LOCALE_ADMIN); } public function approve(User $user, LocalizationContribution $contribution) { return $user->hasRoleWithObjectName(Role::LOCALE_ADMIN, $contribution->language); } }
21.208333
89
0.730845
4d2aa88c768f2555796a19c9d3b88b1a51947f3e
10,639
cs
C#
ModelDesigner.MeshDiagram3D/Elements3D/BasicModel3DModel.cs
BiancoRoyal/ASMD
e10f7846047dc70b4f68a7123631bb193e5721fc
[ "MIT" ]
48
2019-11-04T15:11:21.000Z
2022-02-22T07:14:01.000Z
ModelDesigner.MeshDiagram3D/Elements3D/BasicModel3DModel.cs
BiancoRoyal/ASMD
e10f7846047dc70b4f68a7123631bb193e5721fc
[ "MIT" ]
172
2019-10-26T08:16:10.000Z
2022-01-24T11:41:26.000Z
ModelDesigner.MeshDiagram3D/Elements3D/BasicModel3DModel.cs
BiancoRoyal/ASMD
e10f7846047dc70b4f68a7123631bb193e5721fc
[ "MIT" ]
4
2019-11-15T16:36:14.000Z
2020-06-09T22:36:02.000Z
//--------------------------------------------------------------------------- // This file is part of the following project: // Mesh Diagram 3D // Author: Maciej Zbrzezny // // This source is subject to the Microsoft Public License (Ms-PL) // See http://meshdiagram3d.codeplex.com/license // // For more information, see: // http://meshdiagram3d.codeplex.com/ // //--------------------------------------------------------------------------- using System.Windows; using System.Windows.Media; using System.Windows.Media.Media3D; using MeshDiagram3D.Presentation; using MeshDiagram3D.Utils; namespace MeshDiagram3D.Elements3D { public enum ModelType { Tetraeder, Cube } public class BasicModel3DModel: IModelVisual3D { #region private protected MeshDiagramViewport3D meshDiagramViewport3D; private ModelVisual3D lastModelVisual3D = null; private ModelVisual3DFilter lastFilterSettings = ModelVisual3DFilter.AllOff; private Material materialNormal; private Material materialSelected; private ModelType mModelType; private string mText; private bool isSelected = false; private double mX; private double mY; private double mZ; private double mSizeX; private double mSizeY; private double mSizeZ; private bool mCentric; private ModelVisual3D PrepareModelVisual3D( ModelVisual3DFilter FilterSettings, bool Selected ) { if ( FilterSettings.Triangles ) { if ( Centric ) { return CreateModel3DModel( Selected ? materialSelected : materialNormal, X, Y, Z, SizeX, SizeY, SizeZ, ModelType ); } else { return CreateModel3DModel( Selected ? materialSelected : materialNormal, X + SizeX / 2, Y + SizeY / 2, Z + SizeZ / 2, SizeX, SizeY, SizeZ, ModelType ); } } else return new ModelVisual3D(); } private void UpdateLastModelVisual3D() { lastModelVisual3D.Children.Clear(); lastModelVisual3D.Children.Add( PrepareModelVisual3D( this.lastFilterSettings, this.isSelected ) ); } #endregion #region static static private ModelVisual3D CreateModel3DModel( Material material, double X, double Y, double Z, double sizeX, double sizeY, double sizeZ, ModelType mt ) { Model3DGroup cube = CreateCubeModel3DGroup( material, X, Y, Z, sizeX, sizeY, sizeZ ); switch ( mt ) { case ModelType.Cube: cube = CreateCubeModel3DGroup( material, X, Y, Z, sizeX, sizeY, sizeZ ); break; case ModelType.Tetraeder: cube = CreateTetraederModel3DGroup( material, X, Y, Z, sizeX, sizeY, sizeZ ); break; } ModelVisual3D model = new ModelVisual3D(); model.Content = cube; return model; } static private Model3DGroup CreateCubeModel3DGroup ( Material material, double X, double Y, double Z, double sizeX, double sizeY, double sizeZ ) { Model3DGroup cube = new Model3DGroup(); Point3D p0 = new Point3D( X - sizeX / 2, Y - sizeY / 2, Z - sizeZ / 2 ); Point3D p1 = new Point3D( X + sizeX / 2, Y - sizeY / 2, Z - sizeZ / 2 ); Point3D p2 = new Point3D( X + sizeX / 2, Y - sizeY / 2, Z + sizeZ / 2 ); Point3D p3 = new Point3D( X - sizeX / 2, Y - sizeY / 2, Z + sizeZ / 2 ); Point3D p4 = new Point3D( X - sizeX / 2, Y + sizeY / 2, Z - sizeZ / 2 ); Point3D p5 = new Point3D( X + sizeX / 2, Y + sizeY / 2, Z - sizeZ / 2 ); Point3D p6 = new Point3D( X + sizeX / 2, Y + sizeY / 2, Z + sizeZ / 2 ); Point3D p7 = new Point3D( X - sizeX / 2, Y + sizeY / 2, Z + sizeZ / 2 ); //front side triangles cube.Children.Add( CreateSquareModel( material, p3, p2, p1, p0 ) ); //right side triangles cube.Children.Add( CreateSquareModel( material, p4, p5, p6, p7 ) ); //back side triangles cube.Children.Add( CreateSquareModel( material, p2, p3, p7, p6 ) ); //left side triangles cube.Children.Add( CreateSquareModel( material, p0, p1, p5, p4 ) ); //top side triangles cube.Children.Add( CreateSquareModel( material, p1, p2, p6, p5 ) ); //bottom side triangles cube.Children.Add( CreateSquareModel( material, p7, p3, p0, p4 ) ); return cube; } static private Model3DGroup CreateTetraederModel3DGroup ( Material material, double X, double Y, double Z, double sizeX, double sizeY, double sizeZ ) { Model3DGroup tetraeder = new Model3DGroup(); Point3D p0 = new Point3D( X - sizeX / 2, Y - sizeY / 2, Z - sizeZ / 2 ); Point3D p2 = new Point3D( X + sizeX / 2, Y - sizeY / 2, Z + sizeZ / 2 ); Point3D p5 = new Point3D( X + sizeX / 2, Y + sizeY / 2, Z - sizeZ / 2 ); Point3D p7 = new Point3D( X - sizeX / 2, Y + sizeY / 2, Z + sizeZ / 2 ); tetraeder.Children.Add( CreateTriangleModel( material, p0, p5, p7 ) ); tetraeder.Children.Add( CreateTriangleModel( material, p0, p2, p5 ) ); tetraeder.Children.Add( CreateTriangleModel( material, p0, p7, p2 ) ); tetraeder.Children.Add( CreateTriangleModel( material, p5, p2, p7 ) ); return tetraeder; } static private Model3DGroup CreateTriangleModel( Material material, Point3D p0, Point3D p1, Point3D p2 ) { MeshGeometry3D mesh = new MeshGeometry3D(); mesh.Positions.Add( p0 ); mesh.Positions.Add( p1 ); mesh.Positions.Add( p2 ); mesh.TriangleIndices.Add( 0 ); mesh.TriangleIndices.Add( 1 ); mesh.TriangleIndices.Add( 2 ); Vector3D normal = CalculateNormal( p0, p1, p2 ); mesh.Normals.Add( normal ); mesh.Normals.Add( normal ); mesh.Normals.Add( normal ); GeometryModel3D model = new GeometryModel3D( mesh, material ); Model3DGroup group = new Model3DGroup(); group.Children.Add( model ); return group; } static private Model3DGroup CreateSquareModel( Material material, Point3D p0, Point3D p1, Point3D p2, Point3D p3 ) { MeshGeometry3D mesh = new MeshGeometry3D(); mesh.Positions.Add( p0 ); mesh.Positions.Add( p1 ); mesh.Positions.Add( p2 ); mesh.Positions.Add( p3 ); // 0,1,2,0,2,3 mesh.TriangleIndices.Add( 2 ); mesh.TriangleIndices.Add( 1 ); mesh.TriangleIndices.Add( 0 ); mesh.TriangleIndices.Add( 3 ); mesh.TriangleIndices.Add( 2 ); mesh.TriangleIndices.Add( 0 ); mesh.TextureCoordinates = ( (PointCollection)new PointCollectionConverter().ConvertFromString( "0,1 0,0 1,0 1,1 " ) ); //TODO: tamto texture coordinates powinny zostac przeniesione GeometryModel3D model = new GeometryModel3D( mesh, material ); Model3DGroup group = new Model3DGroup(); group.Children.Add( model ); return group; } static private Vector3D CalculateNormal( Point3D p0, Point3D p1, Point3D p2 ) { Vector3D v0 = new Vector3D( p1.X - p0.X, p1.Y - p0.Y, p1.Z - p0.Z ); Vector3D v1 = new Vector3D( p2.X - p1.X, p2.Y - p1.Y, p2.Z - p1.Z ); return Vector3D.CrossProduct( v0, v1 ); } #endregion #region pubic public double X { get { return mX; } set { mX = value; UpdateLastModelVisual3D(); } } public double Y { get { return mY; } set { mY = value; UpdateLastModelVisual3D(); } } public double Z { get { return mZ; } set { mZ = value; UpdateLastModelVisual3D(); } } public double SizeX { get { return mSizeX; } set { mSizeX = value; UpdateLastModelVisual3D(); } } public double SizeY { get { return mSizeY; } set { mSizeY = value; UpdateLastModelVisual3D(); } } public double SizeZ { get { return mSizeZ; } set { mSizeZ = value; UpdateLastModelVisual3D(); } } public bool Centric { get { return mCentric; } set { mCentric = value; UpdateLastModelVisual3D(); } } public virtual string Text { get { return mText; } set { mText = value; UpdateLastModelVisual3D(); } } public ModelType ModelType { get { return mModelType; } set { mModelType = value; UpdateLastModelVisual3D(); } } public virtual bool CanBeSelected { get { return true; } } #endregion public #region constructor public BasicModel3DModel() : this( new DiffuseMaterial( new SolidColorBrush( Colors.DarkKhaki ) ), new DiffuseMaterial( new SolidColorBrush( Colors.Red ) ), 0, 0, 0, 1, 1, 1, true, ModelType.Tetraeder ) { } public BasicModel3DModel( Material MaterialInNormalState, Material MaterialInSelectedState, double X, double Y, double Z, double sizeX, double sizeY, double sizeZ, bool centric, ModelType modelType ) { this.mX = X; this.mY = Y; this.mZ = Z; this.mSizeX = sizeX; this.mSizeY = sizeY; this.mSizeZ = sizeZ; this.mCentric = centric; this.materialNormal = MaterialInNormalState; this.materialSelected = MaterialInSelectedState; this.mModelType = modelType; } #endregion constructor #region IModelVisual3D Members object IModelVisual3D.Tag { get; set; } void IModelVisual3D.Register( MeshDiagramViewport3D mdv3d ) { meshDiagramViewport3D = mdv3d; } bool IModelVisual3D.IsSelected { get { return isSelected; } set { if ( this.lastModelVisual3D != null && isSelected != value ) { this.isSelected = value; UpdateLastModelVisual3D(); } } } void IModelVisual3D.Unregister() { meshDiagramViewport3D = null; } ModelVisual3D IModelVisual3D.GetModelVisual3D( ModelVisual3DFilter FilterSettings, bool Selected ) { lastFilterSettings = FilterSettings; return lastModelVisual3D = PrepareModelVisual3D( FilterSettings, Selected ); } bool IModelVisual3D.Match( Point point2D ) { bool success = false; Rect my2DRect = MeshDiagram3DMath.Get2DBoundingBox( lastModelVisual3D, out success ); if ( !success ) return false; return my2DRect.Contains( point2D ); } UIElement IModelVisual3D.GetUIElement( ModelVisual3DFilter FilterSettings, Viewport3DVisual DestinationViewport3D ) { return new UIElement(); } #endregion //IModelVisual3D Members } }
40.14717
127
0.610208
a00e1bcca21306c68ec004ee6799cbb1b8e8930f
802
ts
TypeScript
trms-back-end/src/services/generic/service.ts
210524training/ddl-trms
da0a6138301e216caa7c6134153db53a5967e109
[ "MIT" ]
null
null
null
trms-back-end/src/services/generic/service.ts
210524training/ddl-trms
da0a6138301e216caa7c6134153db53a5967e109
[ "MIT" ]
null
null
null
trms-back-end/src/services/generic/service.ts
210524training/ddl-trms
da0a6138301e216caa7c6134153db53a5967e109
[ "MIT" ]
null
null
null
import { IEntity } from '../../@types/trms/index.d'; import Repository from '../../repositories/generic/repository'; /** * Generic service that implements all the default repository operations (CRUD, get all items, * or get item by id). * * @author Dustin Diaz */ export default class Service<T extends IEntity, R extends Repository<T>> { constructor( protected repository: R, ) {} getAll(): Promise<T[]> { return this.repository.getAll(); } getById(id: string): Promise<T | null> { return this.repository.getById(id); } add(item: T): Promise<boolean> { return this.repository.add(item); } update(item: T): Promise<boolean> { return this.repository.update(item); } delete(id: string): Promise<boolean> { return this.repository.delete(id); } }
22.914286
94
0.663342
06c94a3bbbe03fa86e5b09f84c04d605d0000e3c
3,216
py
Python
src/tasks.py
acs6610987/CredibleWeb
addc3dce55d49b21d0baede4dddad7a0aa0532b6
[ "MIT" ]
null
null
null
src/tasks.py
acs6610987/CredibleWeb
addc3dce55d49b21d0baede4dddad7a0aa0532b6
[ "MIT" ]
null
null
null
src/tasks.py
acs6610987/CredibleWeb
addc3dce55d49b21d0baede4dddad7a0aa0532b6
[ "MIT" ]
null
null
null
import webapp2 from google.appengine.ext import db from data_models import URLStorage, SnapshotStorage import conf import urllib from google.appengine.api import urlfetch, taskqueue import json import urllib2 import re import logging class URLInfoDownloadHandler(webapp2.RequestHandler): def post(self): key = self.request.get('key') def txn(): rec = URLStorage.get(key) if rec: rec.topic = self.get_topic(rec.url) img = self.get_snapshot(rec.url) ss = SnapshotStorage(url = rec.url) ss.snapshot = db.Blob(img) ss.put() rec.snapshot = '/img/blob_snapshot?key=%s' % ss.key() rec.title = self.get_title(rec.url) rec.put() db.run_in_transaction_options(db.create_transaction_options(xg=True), txn) def get_topic(self, url): params = {'url':url, 'apikey':conf.ALCHEMY_KEY, 'outputMode':'json'} alchemy_call = conf.ALCHEMY_ENDPOINT+'?'+urllib.urlencode(params) response = urlfetch.fetch(alchemy_call, deadline=60).content jresponse = json.loads(response) if jresponse.has_key('category'): topic = jresponse['category'] else: topic = 'unknown_category' return topic def get_snapshot(self, url): if url.endswith('/'): url = url[:len(url)-1] url = url.replace('=', '%3d') url = url.replace('-', '%2d') if url.startswith('https'): url = url[:4] + url[5:] snapshot = 'http://immediatenet.com/t/l3?Size=1024x768&URL='+url img = urlfetch.fetch(snapshot, deadline = 120).content return img def get_title(self, url): title = url content = '' try: request = urllib2.Request(url) request.add_header('User-Agent', 'Mozilla/5.0 (X11; U; Linux i686) Gecko/20071127 Firefox/2.0.0.11') opener = urllib2.build_opener() conn = opener.open(request) content_type = conn.info().get('Content-type') charset_i = -1 if content_type: content_type = content_type.lower() charset_i = content_type.rfind('charset=') code = 'utf-8' #default to utf-8 if charset_i > 0: code = content_type[charset_i+8:].strip(' "\'') content = conn.read() except Exception, e: pass m = re.search(r'<title.*?>(.*?)</title>', content, re.IGNORECASE | re.DOTALL) if m: title = m.group(1) title = title.strip() title = title.replace('\n', ' ') try: title = unicode(title, code, 'ignore') except UnicodeDecodeError, e: title = unicode(url) return title def addUrlDownloadTask(url_rec): taskqueue.add(url='/urlInfoDownloadTask', params={'key': url_rec.key()}) app = webapp2.WSGIApplication([('/urlInfoDownloadTask', URLInfoDownloadHandler)], debug=True)
36.134831
112
0.548197
8d87c45d0514a813b9da602d3d41a12b6c163e55
1,064
js
JavaScript
frontend/redux/nodes/components/Decorators/reducer.js
angrylogic/fleet
ca84b41ffdb28c7b93645fefebd1413fcf20355a
[ "MIT" ]
1
2017-11-22T18:05:07.000Z
2017-11-22T18:05:07.000Z
frontend/redux/nodes/components/Decorators/reducer.js
angrylogic/fleet
ca84b41ffdb28c7b93645fefebd1413fcf20355a
[ "MIT" ]
1
2022-02-11T00:11:11.000Z
2022-02-11T00:11:11.000Z
frontend/redux/nodes/components/Decorators/reducer.js
angrylogic/fleet
ca84b41ffdb28c7b93645fefebd1413fcf20355a
[ "MIT" ]
1
2020-09-02T06:01:31.000Z
2020-09-02T06:01:31.000Z
import { defaultSelectedOsqueryTable, SELECT_DECORATOR_TABLE, SET_DECORATOR_QUERY_TEXT, SET_SELECTED_DECORATOR_TARGETS, SET_SELECTED_DECORATOR_TARGETS_QUERY, } from './actions'; export const initialState = { queryText: 'SELECT total_seconds AS uptime FROM uptime', selectedOsqueryTable: defaultSelectedOsqueryTable, selectedTargets: [], selectedTargetsQuery: '', }; const reducer = (state = initialState, { type, payload }) => { switch (type) { case SELECT_DECORATOR_TABLE: return { ...state, selectedOsqueryTable: payload.selectedOsqueryTable, }; case SET_DECORATOR_QUERY_TEXT: return { ...state, queryText: payload.queryText, }; case SET_SELECTED_DECORATOR_TARGETS: return { ...state, selectedTargets: payload.selectedTargets, }; case SET_SELECTED_DECORATOR_TARGETS_QUERY: return { ...state, selectedTargetsQuery: payload.selectedTargetsQuery, }; default: return state; } }; export default reducer;
24.181818
62
0.679511
6533af729359a6f4ec3e0655171b7f5ded036ac3
496
sql
SQL
openGaussBase/testcase/KEYWORDS/row_count/Opengauss_Function_Keyword_Row_count_Case0027.sql
opengauss-mirror/Yat
aef107a8304b94e5d99b4f1f36eb46755eb8919e
[ "MulanPSL-1.0" ]
null
null
null
openGaussBase/testcase/KEYWORDS/row_count/Opengauss_Function_Keyword_Row_count_Case0027.sql
opengauss-mirror/Yat
aef107a8304b94e5d99b4f1f36eb46755eb8919e
[ "MulanPSL-1.0" ]
null
null
null
openGaussBase/testcase/KEYWORDS/row_count/Opengauss_Function_Keyword_Row_count_Case0027.sql
opengauss-mirror/Yat
aef107a8304b94e5d99b4f1f36eb46755eb8919e
[ "MulanPSL-1.0" ]
null
null
null
-- @testpoint:opengauss关键字row_count非保留),作为序列名 --关键字不带引号-成功 drop sequence if exists row_count; create sequence row_count start 100 cache 50; drop sequence row_count; --关键字带双引号-成功 drop sequence if exists "row_count"; create sequence "row_count" start 100 cache 50; drop sequence "row_count"; --关键字带单引号-合理报错 drop sequence if exists 'row_count'; create sequence 'row_count' start 100 cache 50; --关键字带反引号-合理报错 drop sequence if exists `row_count`; create sequence `row_count` start 100 cache 50;
23.619048
47
0.782258
a47376fa1b3bc0308aa766efbb0723c79c6f47b0
4,059
php
PHP
application/views/template/template.php
julisah/SI-Mudharabah
486a9960e85d8f5a33a090369d8b3fdc79c66adf
[ "MIT" ]
null
null
null
application/views/template/template.php
julisah/SI-Mudharabah
486a9960e85d8f5a33a090369d8b3fdc79c66adf
[ "MIT" ]
null
null
null
application/views/template/template.php
julisah/SI-Mudharabah
486a9960e85d8f5a33a090369d8b3fdc79c66adf
[ "MIT" ]
null
null
null
<body class="skin-blue layout-top-nav"> <div class="wrapper"> <header class="main-header"> <nav class="navbar navbar-static-top"> <div class="container"> <div class="navbar-header"> <a href="#" class="navbar-brand"><b><?php echo $this->session->userdata('level');?></b></a> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse"> <i class="fa fa-bars"></i> </button> </div> <?php if($this->session->userdata('level')=='Admin' && $this->session->->userdata('status')=='Aktif') }?> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse pull-left" id="navbar-collapse"> <ul class="nav navbar-nav"> <!--Menu for Admin--> <li><a href="<?php echo base_url()?>c_admin/index">Home</a></li> <li><a href="<?php echo base_url()?>c_admin/tampil_pegawai">Pegawai</a></li> <li><a href="<?php echo base_url()?>c_admin/tampil_log_pegawai">Log Pegawai</a></li> <!--End of menu Admin--> </ul> <form class="navbar-form navbar-left" role="search"> <div class="form-group"> <input type="text" class="form-control" id="navbar-search-input" placeholder="Search"> </div> </form> </div><!-- /.navbar-collapse --> <!-- Navbar Right Menu --> <div class="navbar-custom-menu"> <ul class="nav navbar-nav"> <!-- User Account Menu --> <li class="dropdown user user-menu"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <img src=""/><!--foto pegawai--> <span class="hidden-xs"><?php echo $this->session->userdata('nama');?></span> </a> <ul class="dropdown-menu"> <!-- User image --> <li class="user-header"> <img src="" alt="User Image" /><!--foto pegawai--> <p> <?php echo $this->session->userdata('nama');?> - Admin </p> </li> <?php } elseif ($this->session->userdata('level')=='CS' && $this->session->->userdata('status')=='Aktif') {?> <div class="navbar-custom-menu"> <ul class="nav navbar-nav"> <!-- User Account Menu --> <li class="dropdown user user-menu"> <a href="#" class="dropdown-toggle" data-toggle="dropdown"> <img src=""/><!--foto pegawai--> <span class="hidden-xs"><?php echo $this->session->userdata('nama');?></span> </a> <ul class="dropdown-menu"> <!-- User image --> <li class="user-header"> <img src="" alt="User Image" /><!--foto pegawai--> <p> <?php echo $this->session->userdata('nama');?> - CS </p> </li> <?php } ?> <!-- Menu Footer--> <li class="user-footer"> <div class="pull-left"> <a href="#" class="btn btn-default btn-flat">Profile</a> </div> </li> </ul> </li> <li><a href="<?php echo base_url()?>c_admin/logout">Logout</a></li><!--end of user profile> </ul> </div><!-- /.navbar-custom-menu --> </div><!-- /.container-fluid --> </nav> </header> <div class="content-wrapper"> <!--this is form--> <div class="content"> <div class="container"> <div class="row"> <div class="box box-primary">
46.125
120
0.442966
30cb74aa6a47ef5abf7c6a17abbc5a3fc206187e
938
php
PHP
resources/views/luckys/index.blade.php
myohanhtet/htb
d36aaa4a3871313f870e6d89560e0004007e2d4b
[ "MIT" ]
null
null
null
resources/views/luckys/index.blade.php
myohanhtet/htb
d36aaa4a3871313f870e6d89560e0004007e2d4b
[ "MIT" ]
null
null
null
resources/views/luckys/index.blade.php
myohanhtet/htb
d36aaa4a3871313f870e6d89560e0004007e2d4b
[ "MIT" ]
null
null
null
@extends('layouts.app') @section('content') <section class="content-header"> <h1 class="pull-left">{!! ($ui_config['title'] == null ? "Title" : $ui_config['title']) !!}</h1><br> {{-- <h1 class="pull-right"> <a class="btn btn-primary pull-right" style="margin-top: -10px;margin-bottom: 5px" href="{{ route('htbs.create') }}">Add New</a> </h1> --}} </section> <div class="content"> <div class="clearfix"></div> @include('flash::message') <div class="clearfix"></div> <div class="box box-warning"> <div class="box-body"> @include('luckys.search') </div> </div> @if(isset($filename)) <div class="text-center"> <embed src="{{ url('luckyinvoice/') .'/' . $filename }}" alt="pdf" width="1120" height="500" /> </div> @endif </div> @endsection
30.258065
139
0.496802
464e3fdf796d72090e202b42c5ce78773ccc484e
393
php
PHP
packages/point/point-sales/src/Http/Routes/sales-report.php
bgd-point/point-app-test
be4da13a3334ce721415d9f294841959f504e192
[ "Apache-2.0" ]
4
2017-08-18T09:35:46.000Z
2018-07-24T01:52:33.000Z
packages/point/point-sales/src/Http/Routes/sales-report.php
bgd-point/point-app-test
be4da13a3334ce721415d9f294841959f504e192
[ "Apache-2.0" ]
33
2017-07-25T04:10:30.000Z
2018-08-16T08:57:01.000Z
packages/point/point-sales/src/Http/Routes/sales-report.php
bgd-point/point-app-test
be4da13a3334ce721415d9f294841959f504e192
[ "Apache-2.0" ]
7
2017-07-24T03:55:44.000Z
2020-03-18T08:28:39.000Z
<?php Route::group(['prefix' => 'sales/point/indirect', 'namespace' => 'Point\PointSales\Http\Controllers\Sales'], function () { Route::get('/report/pdf', 'SalesReportController@indexPDF'); Route::get('/report/export', 'SalesReportController@export'); Route::get('/report', 'SalesReportController@index'); Route::get('/retur-report', 'SalesReturReportController@index'); });
39.3
122
0.692112
93bb49d738e93531af5ce24e0c40ffcd37336f87
6,514
cs
C#
MusicPlayer/Spatializer/SpatializerControl.xaml.cs
tstavropoulos/Musegician
a8bd54102a74e7afc624657a0dc2c158e2988664
[ "MIT" ]
7
2018-01-18T18:14:51.000Z
2020-10-02T01:57:43.000Z
MusicPlayer/Spatializer/SpatializerControl.xaml.cs
tstavropoulos/Musegician
a8bd54102a74e7afc624657a0dc2c158e2988664
[ "MIT" ]
12
2018-02-02T16:34:18.000Z
2019-08-06T18:16:44.000Z
MusicPlayer/Spatializer/SpatializerControl.xaml.cs
tstavropoulos/Musegician
a8bd54102a74e7afc624657a0dc2c158e2988664
[ "MIT" ]
1
2021-04-27T18:11:31.000Z
2021-04-27T18:11:31.000Z
using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace Musegician.Spatializer { /// <summary> /// Interaction logic for SpatializerControl.xaml /// </summary> public partial class SpatializerControl : UserControl { #region Constructor public SpatializerControl() { InitializeComponent(); Presets = new ReadOnlyCollection<SpatializerSettingViewModel>( (from data in SpatializationManager.Instance.Presets select new SpatializerSettingViewModel(data)) .ToArray()); SpatializerLocationsViewModel[] locationViewModels = new SpatializerLocationsViewModel[(int)IR_Position.MAX]; for (IR_Position pos = 0; pos < IR_Position.MAX; pos++) { (float left, float top) = GetOffsets(pos); locationViewModels[(int)pos] = new SpatializerLocationsViewModel(left, top); } InterfacePositions = new ReadOnlyCollection<SpatializerLocationsViewModel>(locationViewModels); DataContext = this; Loaded += SpatializerControl_Loaded; Unloaded += SpatializerControl_Unloaded; } private void SpatializerControl_Loaded(object sender, RoutedEventArgs e) { SpatializationManager.Instance.SpatializerChanged += SpatializerChanged; RebuildPositions(); } private void SpatializerControl_Unloaded(object sender, RoutedEventArgs e) { SpatializationManager.Instance.SpatializerChanged -= SpatializerChanged; } #endregion Constructor #region Properties public ReadOnlyCollection<SpatializerSettingViewModel> Presets { get; } public ReadOnlyCollection<SpatializerLocationsViewModel> InterfacePositions { get; } #endregion Properties #region Callbacks private void SpatializationPresets_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (!(e.AddedItems is null)) { if (e.AddedItems.Count == 0) { //Callback from updating just name //Do nothing } else if (e.AddedItems.Count == 1 && e.AddedItems[0] is SpatializerSettingViewModel viewModel) { //Callback from new selection if (viewModel.Name != "Custom") { SpatializationManager.Instance.SetPositions(viewModel.Position); } } else { throw new ArgumentException($"Unexpected callback argument: {e.AddedItems}"); } } else { throw new ArgumentException($"Unexpected callback argument: {e.AddedItems}"); } } private void SpatializerChanged(object sender, SpatializerChangedArgs e) { RebuildPositions(); } private void RebuildPositions() { for (IR_Position position = 0; position < IR_Position.MAX; position++) { InterfacePositions[(int)position].ShowLL = (SpatializationManager.Instance.Positions[0, 0] == position); InterfacePositions[(int)position].ShowLR = (!SpatializationManager.Instance.IsolateChannels && SpatializationManager.Instance.Positions[1, 0] == position); InterfacePositions[(int)position].ShowRL = (!SpatializationManager.Instance.IsolateChannels && SpatializationManager.Instance.Positions[0, 1] == position); InterfacePositions[(int)position].ShowRR = (SpatializationManager.Instance.Positions[1, 1] == position); } } #endregion Callbacks #region Helper Methods private (float, float) GetOffsets(IR_Position position) { float offset = 8f; float radius = 120f; (float x, float y) center = (150f, 140f); float angle = GetAngle(position); float x_coord = center.x + radius * (float)Math.Sin(angle * Math.PI / 180f) - offset; float y_coord = center.y - radius * (float)Math.Cos(angle * Math.PI / 180f) - offset; return (x_coord, y_coord); } private float GetAngle(IR_Position position) { switch (position) { case IR_Position.IR_0: return 0f; case IR_Position.IR_p5: return 5f; case IR_Position.IR_n5: return -5f; case IR_Position.IR_p10: return 10f; case IR_Position.IR_n10: return -10f; case IR_Position.IR_p15: return 15f; case IR_Position.IR_n15: return -15f; case IR_Position.IR_p20: return 20f; case IR_Position.IR_n20: return -20f; case IR_Position.IR_p25: return 25f; case IR_Position.IR_n25: return -25f; case IR_Position.IR_p30: return 30f; case IR_Position.IR_n30: return -30f; case IR_Position.IR_p35: return 35f; case IR_Position.IR_n35: return -35f; case IR_Position.IR_p40: return 40f; case IR_Position.IR_n40: return -40f; case IR_Position.IR_p45: return 45f; case IR_Position.IR_n45: return -45f; case IR_Position.IR_p55: return 55f; case IR_Position.IR_n55: return -55f; case IR_Position.IR_p65: return 65f; case IR_Position.IR_n65: return -65f; case IR_Position.IR_p80: return 80f; case IR_Position.IR_n80: return -80f; default: throw new Exception($"Unexpected IR_Position: {position}"); } } #endregion Helper Methods } }
35.791209
109
0.580903
af1482275ee6a41ed1132d77e57ed7788533276a
456
py
Python
cpdb/activity_grid/migrations/0002_activitycard_important.py
invinst/CPDBv2_backend
b4e96d620ff7a437500f525f7e911651e4a18ef9
[ "Apache-2.0" ]
25
2018-07-20T22:31:40.000Z
2021-07-15T16:58:41.000Z
cpdb/activity_grid/migrations/0002_activitycard_important.py
invinst/CPDBv2_backend
b4e96d620ff7a437500f525f7e911651e4a18ef9
[ "Apache-2.0" ]
13
2018-06-18T23:08:47.000Z
2022-02-10T07:38:25.000Z
cpdb/activity_grid/migrations/0002_activitycard_important.py
invinst/CPDBv2_backend
b4e96d620ff7a437500f525f7e911651e4a18ef9
[ "Apache-2.0" ]
6
2018-05-17T21:59:43.000Z
2020-11-17T00:30:26.000Z
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-09-20 04:34 from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('activity_grid', '0001_initial'), ] operations = [ migrations.AddField( model_name='activitycard', name='important', field=models.BooleanField(default=False), ), ]
21.714286
53
0.620614
79d4c190808f7a42bf03b317d8024a8b295245b4
622
lua
Lua
schema/items/sh_ration.lua
RiggsMackay/ixhl2rp
860970d63d5adef490ae33516ce6010d1f6a7b3f
[ "MIT" ]
null
null
null
schema/items/sh_ration.lua
RiggsMackay/ixhl2rp
860970d63d5adef490ae33516ce6010d1f6a7b3f
[ "MIT" ]
null
null
null
schema/items/sh_ration.lua
RiggsMackay/ixhl2rp
860970d63d5adef490ae33516ce6010d1f6a7b3f
[ "MIT" ]
null
null
null
ITEM.name = "Ration" ITEM.model = Model("models/weapons/w_packatc.mdl") ITEM.description = "A shrink-wrapped packet containing some food and money." ITEM.items = {"supplements", "water"} ITEM.bDropOnDeath = true ITEM.functions.Open = { OnRun = function(itemTable) local client = itemTable.player local character = client:GetCharacter() for k, v in ipairs(itemTable.items) do if (!character:GetInventory():Add(v)) then ix.item.Spawn(v, client) end end character:GiveMoney(ix.config.Get("rationTokens", 20)) client:EmitSound("ambient/fire/mtov_flame2.wav", 75, math.random(160, 180), 0.35) end }
27.043478
83
0.71865
d883060189719ddf00dd75eed364e4915dfce476
924
rb
Ruby
lib/statistrano/deployment/log_file.rb
fakeNetflix/mailchimp-repo-statistrano
91ea21c5469b1c6371e4dbd0cbf87388598aecd6
[ "BSD-3-Clause" ]
43
2015-01-02T03:06:37.000Z
2019-04-28T11:28:36.000Z
lib/statistrano/deployment/log_file.rb
fakeNetflix/mailchimp-repo-statistrano
91ea21c5469b1c6371e4dbd0cbf87388598aecd6
[ "BSD-3-Clause" ]
2
2015-05-22T19:47:47.000Z
2017-03-03T21:09:16.000Z
lib/statistrano/deployment/log_file.rb
fakeNetflix/mailchimp-repo-statistrano
91ea21c5469b1c6371e4dbd0cbf87388598aecd6
[ "BSD-3-Clause" ]
1
2021-02-02T10:11:03.000Z
2021-02-02T10:11:03.000Z
module Statistrano module Deployment class LogFile attr_reader :resolved_path, :remote, :file def initialize path, remote @remote = remote @resolved_path = resolve_path path @file = Remote::File.new @resolved_path, remote end def append! log_entry file.append_content! log_entry.to_json end def last_entry entries(1).last || {} end def tail length=10 entries(length) end private def entries length=10 entries = file.content.split("\n") || [] entries.reverse[0...length].map do |e| Util.symbolize_hash_keys( JSON.parse(e) ) end end def resolve_path path if path.start_with? '/' path else File.join( remote.config.remote_dir, path ) end end end end end
20.533333
64
0.544372
8e72c64395c88608dc0c220094a667fff35a8409
502
js
JavaScript
app/assets/js/scripts/settings/launcher-distribution.js
0lixiz/assettomc
7fa2bc72b30d263a5379d2198358160c65f4c942
[ "FSFAP" ]
1
2021-05-22T18:18:21.000Z
2021-05-22T18:18:21.000Z
app/assets/js/scripts/settings/launcher-distribution.js
0lixiz/assettomc
7fa2bc72b30d263a5379d2198358160c65f4c942
[ "FSFAP" ]
null
null
null
app/assets/js/scripts/settings/launcher-distribution.js
0lixiz/assettomc
7fa2bc72b30d263a5379d2198358160c65f4c942
[ "FSFAP" ]
null
null
null
/** * Paladium Launcher - https://github.com/Chaika9/paladiumlauncher * Copyright (C) 2019 Paladium */ const initSettingsLauncherDistroTextField = document.getElementById('settings-launcher-distro-textfield'); function initSettingsLauncherDistroTab() { if(ConfigManager.getDistroCustom() == "true") { initSettingsLauncherDistroTextField.setAttribute("value", ConfigManager.getDistroURL()); } else { initSettingsLauncherDistroTextField.setAttribute("value", ""); } }
33.466667
106
0.741036
e773fb561b0d8a6c2f44d8fb87fdeca6e74efed9
572
php
PHP
module/Application/src/Application/View/Helper/User/Image/ProfileUrl.php
falodunos/eqa
0258e2d483be22725b09418de58b45545c46c681
[ "BSD-3-Clause" ]
null
null
null
module/Application/src/Application/View/Helper/User/Image/ProfileUrl.php
falodunos/eqa
0258e2d483be22725b09418de58b45545c46c681
[ "BSD-3-Clause" ]
null
null
null
module/Application/src/Application/View/Helper/User/Image/ProfileUrl.php
falodunos/eqa
0258e2d483be22725b09418de58b45545c46c681
[ "BSD-3-Clause" ]
null
null
null
<?php namespace Application\View\Helper\User\Image; use Zend\View\Helper\AbstractHelper; class ProfileUrl extends AbstractHelper { public function __invoke($basePath, $zfcUserIdentity) { $defaultProfileImageUrl = $basePath . '/img/user/profile/default.png'; $userProfileImageUrl = $basePath . '/img/user/profile/'.$zfcUserIdentity->getId().'.png'; if (file_exists($userProfileImageUrl) && is_file($userProfileImageUrl)){ return $userProfileImageUrl; } return $defaultProfileImageUrl; } }
28.6
97
0.66958
b03dab621e15669ced2924bc726c7d5c98dc8039
334
py
Python
model-optimizer/mo/front/common/extractors/utils.py
monroid/openvino
8272b3857ef5be0aaa8abbf7bd0d5d5615dc40b6
[ "Apache-2.0" ]
2,406
2020-04-22T15:47:54.000Z
2022-03-31T10:27:37.000Z
model-optimizer/mo/front/common/extractors/utils.py
thomas-yanxin/openvino
031e998a15ec738c64cc2379d7f30fb73087c272
[ "Apache-2.0" ]
4,948
2020-04-22T15:12:39.000Z
2022-03-31T18:45:42.000Z
model-optimizer/mo/front/common/extractors/utils.py
thomas-yanxin/openvino
031e998a15ec738c64cc2379d7f30fb73087c272
[ "Apache-2.0" ]
991
2020-04-23T18:21:09.000Z
2022-03-31T18:40:57.000Z
# Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import numpy as np def layout_attrs(): return { 'spatial_dims': np.array([2, 3], dtype=np.int64), 'channel_dims': np.array([1], dtype=np.int64), 'batch_dims': np.array([0], dtype=np.int64), 'layout': 'NCHW' }
23.857143
57
0.610778
3a8e2eb1f2aba99038bfed59583f98003e62e811
478
kt
Kotlin
app/src/main/java/eu/kanade/tachiyomi/ui/browse/animesource/latest/LatestUpdatesPager.kt
25-Khairin/aniyomi
98b7e1dbebb9460a7a036f3c738772be9121b6fa
[ "Apache-2.0" ]
942
2021-06-12T04:07:37.000Z
2022-03-31T23:54:57.000Z
app/src/main/java/eu/kanade/tachiyomi/ui/browse/animesource/latest/LatestUpdatesPager.kt
au267/aniyomi
e793c6cd156ba4185d3ce23be976b61e12924ed3
[ "Apache-2.0" ]
335
2021-06-11T14:22:57.000Z
2022-03-31T16:15:49.000Z
app/src/main/java/eu/kanade/tachiyomi/ui/browse/animesource/latest/LatestUpdatesPager.kt
au267/aniyomi
e793c6cd156ba4185d3ce23be976b61e12924ed3
[ "Apache-2.0" ]
100
2021-06-15T13:21:07.000Z
2022-03-29T23:19:03.000Z
package eu.kanade.tachiyomi.ui.browse.animesource.latest import eu.kanade.tachiyomi.animesource.AnimeCatalogueSource import eu.kanade.tachiyomi.ui.browse.animesource.browse.AnimePager import eu.kanade.tachiyomi.util.lang.awaitSingle class LatestUpdatesPager(val source: AnimeCatalogueSource) : AnimePager() { override suspend fun requestNextPage() { val animesPage = source.fetchLatestUpdates(currentPage).awaitSingle() onPageReceived(animesPage) } }
34.142857
77
0.797071
dbccd934af8142abcb6310879150a12a15f5f783
1,508
php
PHP
page-planes.php
juanpablogdl/Intranet_GDL
a50535c8a12a31116e29e6cd67dd7dceb3cf371b
[ "MIT" ]
null
null
null
page-planes.php
juanpablogdl/Intranet_GDL
a50535c8a12a31116e29e6cd67dd7dceb3cf371b
[ "MIT" ]
null
null
null
page-planes.php
juanpablogdl/Intranet_GDL
a50535c8a12a31116e29e6cd67dd7dceb3cf371b
[ "MIT" ]
null
null
null
<?php /* Template Name: Planes Parciales*/ get_header(); the_post(); ?> <main role="main"> <!-- section --> <section class="container"> <div class="tituloWrapper"> <h1 class="descuentos"><?php the_title(); ?></h1> </div> <div id="planes"> </div> <?php the_content(); ?> <br/> <?php edit_post_link(); ?> <script> $(function() { $.getJSON('<?php echo get_stylesheet_directory_uri(); ?>/externas/planes.php', function(data) { var template = $('#planTPL').html(); var info = Mustache.to_html(template, data); $('#planes').html(info); }); }); </script> <script id="planTPL" type="text/template"> {{#zona<?php echo $_GET['zona'] ?>}} <h2>{{name}}</h2> <a href="{{file}}" target="_blank">Ver Documento</a><br><br> {{/zona<?php echo $_GET['zona'] ?>}} </script> </section> <!-- /section --> </main> <?php get_footer(); ?>
35.069767
129
0.333554
33bba67dc9d5b5c65f26fdb8d65661974a76f609
454
h
C
GC_Teleport_Out_classes.h
NotDiscordOfficial/Fortnite_SDK
58f8da148256f99cb35518003306fffee33c4a21
[ "MIT" ]
null
null
null
GC_Teleport_Out_classes.h
NotDiscordOfficial/Fortnite_SDK
58f8da148256f99cb35518003306fffee33c4a21
[ "MIT" ]
null
null
null
GC_Teleport_Out_classes.h
NotDiscordOfficial/Fortnite_SDK
58f8da148256f99cb35518003306fffee33c4a21
[ "MIT" ]
1
2021-07-22T00:31:44.000Z
2021-07-22T00:31:44.000Z
// BlueprintGeneratedClass GC_Teleport_Out.GC_Teleport_Out_C // Size: 0x74 (Inherited: 0x70) struct UGC_Teleport_Out_C : UFortGameplayCueNotify_Simple { float Default Play Length; // 0x70(0x04) bool OnExecute(struct AActor* MyTarget, struct FGameplayCueParameters Parameters); // Function GC_Teleport_Out.GC_Teleport_Out_C.OnExecute // (Event|Public|HasOutParms|HasDefaults|BlueprintCallable|BlueprintEvent|BlueprintPure|Const) // @ game+0xda7c34 };
50.444444
253
0.821586
9e1ddfb5b49a1cbb5d00be3fd6d78fd6d7d7a09e
1,763
cs
C#
01. Exam Solutions/Exam6March2016/Histogram/histogram.cs
spzvtbg/01-Programming-basics
d9b4df9197e7d467292b734dc7fed19f59ce8787
[ "MIT" ]
null
null
null
01. Exam Solutions/Exam6March2016/Histogram/histogram.cs
spzvtbg/01-Programming-basics
d9b4df9197e7d467292b734dc7fed19f59ce8787
[ "MIT" ]
null
null
null
01. Exam Solutions/Exam6March2016/Histogram/histogram.cs
spzvtbg/01-Programming-basics
d9b4df9197e7d467292b734dc7fed19f59ce8787
[ "MIT" ]
null
null
null
using System; namespace Histogram { class histogram { static void Main() { double n = 0.00; n = double.Parse(Console.ReadLine()); double sum200 = 0; double sum400 = 0; double sum600 = 0; double sum800 = 0; double sum1000 = 0; double Procent1 = 0; double Procent2 = 0; double Procent3 = 0; double Procent4 = 0; double Procent5 = 0; for (double i = 0; i < n; i++) { double Number = double.Parse(Console.ReadLine()); if (Number >= 0 && Number < 200) { sum200 = sum200 + 1; } if (Number >= 200 && Number < 400) { sum400 = sum400 + 1; } if (Number >= 400 && Number < 600) { sum600 = sum600 + 1; } if (Number >= 600 && Number < 800) { sum800 = sum800 + 1; } if (Number >= 800) { ++sum1000; } Procent1 = (100 / n) * sum200; Procent2 = (100 / n) * sum400; Procent3 = (100 / n) * sum600; Procent4 = (100 / n) * sum800; Procent5 = (100 / n) * sum1000; } Console.WriteLine("{0:f2}%", Procent1); Console.WriteLine("{0:f2}%", Procent2); Console.WriteLine("{0:f2}%", Procent3); Console.WriteLine("{0:f2}%", Procent4); Console.WriteLine("{0:f2}%", Procent5); } } }
30.929825
65
0.374929
e284136f520bd7f9eb6d2cb40d7d702f209caa9a
1,290
py
Python
sklego/meta/estimator_transformer.py
kaipoethkow/scikit-lego
b0b9cab19ef170fe47fcf18366dc47a1344b0d0b
[ "MIT" ]
1
2020-06-27T22:28:41.000Z
2020-06-27T22:28:41.000Z
sklego/meta/estimator_transformer.py
kaipoethkow/scikit-lego
b0b9cab19ef170fe47fcf18366dc47a1344b0d0b
[ "MIT" ]
null
null
null
sklego/meta/estimator_transformer.py
kaipoethkow/scikit-lego
b0b9cab19ef170fe47fcf18366dc47a1344b0d0b
[ "MIT" ]
null
null
null
import numpy as np from sklearn import clone from sklearn.base import ( BaseEstimator, TransformerMixin, MetaEstimatorMixin, ) from sklearn.utils.validation import ( check_is_fitted, check_X_y, FLOAT_DTYPES, ) class EstimatorTransformer(TransformerMixin, MetaEstimatorMixin, BaseEstimator): """ Allows using an estimator such as a model as a transformer in an earlier step of a pipeline :param estimator: An instance of the estimator that should be used for the transformation :param predict_func: The function called on the estimator when transforming e.g. (`predict`, `predict_proba`) """ def __init__(self, estimator, predict_func="predict"): self.estimator = estimator self.predict_func = predict_func def fit(self, X, y): """Fits the estimator""" X, y = check_X_y(X, y, estimator=self, dtype=FLOAT_DTYPES) self.estimator_ = clone(self.estimator) self.estimator_.fit(X, y) return self def transform(self, X): """ Applies the `predict_func` on the fitted estimator. Returns an array of shape `(X.shape[0], )`. """ check_is_fitted(self, "estimator_") return getattr(self.estimator_, self.predict_func)(X).reshape(-1, 1)
30
113
0.676744
14eb7212f9223578608573324cb08c0b8a25cf71
1,394
cpp
C++
OOPS/Inheritance.cpp
SusheelThapa/Code-With-C-Plus-Plus
8fdf86bf5a8420f8cd2e5d8afb8e1aebc376f136
[ "MIT" ]
null
null
null
OOPS/Inheritance.cpp
SusheelThapa/Code-With-C-Plus-Plus
8fdf86bf5a8420f8cd2e5d8afb8e1aebc376f136
[ "MIT" ]
null
null
null
OOPS/Inheritance.cpp
SusheelThapa/Code-With-C-Plus-Plus
8fdf86bf5a8420f8cd2e5d8afb8e1aebc376f136
[ "MIT" ]
null
null
null
#include <iostream> using namespace std; //Base Class class Employee { public: int id; float salary; //Default Constructor Employee(void) {} Employee(int i) { id = i; salary = 34; } }; /* Derived Class Syntax: class {{derived-class_name}} : {{visibility_mode}} {{base_class_name}} { //code }; Note: ->Default visiblity_mode is private ->Private member of base class won't be inheritance Private Visibility Mode: Public member of base class becomes private member of derived class Public Visibility Mode: Public member of base class becomes private member of derived class */ class Programmer : Employee { public: int language_code = 9; //Before execution of this constructor, it try to call the default constructor of Base class Programmer(int i) { id = i; } //To print id as it is inaaccessible outside this derived class since it is inherited from base class and will be private. void getData(void) { cout << id << endl; } }; int main() { //Base Class Employee one(1), two(2), three(3); cout << one.salary << endl; cout << two.salary << endl; cout << three.salary << endl; //Derived Class Programmer skillf(10); cout << skillf.language_code << endl; skillf.getData(); return 0; }
18.103896
126
0.618364
6dcee42e56df3e724eb86a7a27bb557d3a8405f6
2,876
tsx
TypeScript
airbyte-webapp/src/components/ArrayOfObjectsEditor/ArrayOfObjectsEditor.tsx
sarvex/airbyte
f5d8203f7b5d21fbe92ce994662d5fbf46f0b583
[ "MIT" ]
2
2021-03-02T09:17:41.000Z
2021-03-02T11:02:23.000Z
airbyte-webapp/src/components/ArrayOfObjectsEditor/ArrayOfObjectsEditor.tsx
sarvex/airbyte
f5d8203f7b5d21fbe92ce994662d5fbf46f0b583
[ "MIT" ]
null
null
null
airbyte-webapp/src/components/ArrayOfObjectsEditor/ArrayOfObjectsEditor.tsx
sarvex/airbyte
f5d8203f7b5d21fbe92ce994662d5fbf46f0b583
[ "MIT" ]
null
null
null
import React from "react"; import styled from "styled-components"; import { FormattedMessage } from "react-intl"; import { Button } from "components"; import { EditorHeader } from "./components/EditorHeader"; import { EditorRow } from "./components/EditorRow"; const ItemsList = styled.div` background: ${({ theme }) => theme.greyColor0}; border-radius: 4px; `; const ButtonContainer = styled.div` display: flex; justify-content: flex-end; `; const SmallButton = styled(Button)` margin-left: 8px; padding: 6px 8px 7px; `; const Content = styled.div` margin-bottom: 20px; `; type ArrayOfObjectsEditorProps<T extends { name: string }> = { items: T[]; editableItemIndex?: number | string | null; children: (item?: T) => React.ReactNode; mainTitle?: React.ReactNode; addButtonText?: React.ReactNode; onStartEdit: (n: number) => void; onCancelEdit?: () => void; onDone?: () => void; onRemove: (index: number) => void; }; function ArrayOfObjectsEditor<T extends { name: string } = { name: string }>( props: ArrayOfObjectsEditorProps<T> ): JSX.Element { const { onStartEdit, onDone, onRemove, onCancelEdit, items, editableItemIndex, children, mainTitle, addButtonText, } = props; const onAddItem = React.useCallback(() => onStartEdit(items.length), [ onStartEdit, items, ]); const isEditMode = editableItemIndex !== null && editableItemIndex !== undefined; if (isEditMode) { const item = typeof editableItemIndex === "number" ? items[editableItemIndex] : undefined; return ( <Content> {children(item)} {onCancelEdit || onDone ? ( <ButtonContainer> {onCancelEdit && ( <SmallButton onClick={onCancelEdit} type="button" secondary> <FormattedMessage id="form.cancel" /> </SmallButton> )} {onDone && ( <SmallButton onClick={onDone} type="button" data-test-id="done-button" > <FormattedMessage id="form.done" /> </SmallButton> )} </ButtonContainer> ) : null} </Content> ); } return ( <Content> <EditorHeader itemsCount={items.length} onAddItem={onAddItem} mainTitle={mainTitle} addButtonText={addButtonText} /> {items.length ? ( <ItemsList> {items.map((item, key) => ( <EditorRow key={`form-item-${key}`} name={item.name} id={key} onEdit={onStartEdit} onRemove={onRemove} /> ))} </ItemsList> ) : null} </Content> ); } export { ArrayOfObjectsEditor }; export type { ArrayOfObjectsEditorProps };
23.768595
77
0.569193
a9a8b6e3b42b3c7831a21d6d4058447b26f89812
15,792
dart
Dart
lib/src/pages/music/travel_map/music_travel_map_controller.dart
SebbasCh/mishowtogo
a143b2e78c73a0aeeff39c20c6314a69afc0f79e
[ "MIT" ]
null
null
null
lib/src/pages/music/travel_map/music_travel_map_controller.dart
SebbasCh/mishowtogo
a143b2e78c73a0aeeff39c20c6314a69afc0f79e
[ "MIT" ]
null
null
null
lib/src/pages/music/travel_map/music_travel_map_controller.dart
SebbasCh/mishowtogo
a143b2e78c73a0aeeff39c20c6314a69afc0f79e
[ "MIT" ]
null
null
null
import 'dart:async'; import 'package:cloud_firestore/cloud_firestore.dart'; import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; import 'package:flutter_polyline_points/flutter_polyline_points.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:location/location.dart' as location; import 'package:progress_dialog/progress_dialog.dart'; import 'package:mishowtogo/src/api/environment.dart'; import 'package:mishowtogo/src/models/travel_history.dart'; import 'package:mishowtogo/src/models/client.dart'; import 'package:mishowtogo/src/models/travel_info.dart'; import 'package:mishowtogo/src/providers/auth_provider.dart'; import 'package:mishowtogo/src/providers/client_provider.dart'; import 'package:mishowtogo/src/providers/geofire_provider.dart'; import 'package:mishowtogo/src/providers/music_provider.dart'; import 'package:mishowtogo/src/providers/push_notifications_provider.dart'; import 'package:mishowtogo/src/providers/travel_history_provider.dart'; import 'package:mishowtogo/src/providers/travel_info_provider.dart'; import 'package:mishowtogo/src/providers/prices_provider.dart'; import 'package:mishowtogo/src/utils/my_progress_dialog.dart'; import 'package:mishowtogo/src/utils/snackbar.dart' as utils; import 'package:mishowtogo/src/models/music.dart'; import 'package:mishowtogo/src/models/prices.dart'; import 'package:modal_bottom_sheet/modal_bottom_sheet.dart'; import 'package:mishowtogo/src/widgets/bottom_sheet_music_info.dart'; class MusicTravelMapController { BuildContext context; Function refresh; GlobalKey<ScaffoldState> key = new GlobalKey<ScaffoldState>(); Completer<GoogleMapController> _mapController = Completer(); CameraPosition initialPosition = CameraPosition( target: LatLng(1.2342774, -77.2645446), zoom: 14.0 ); Map<MarkerId, Marker> markers = <MarkerId, Marker>{}; Position _position; StreamSubscription<Position> _positionStream; BitmapDescriptor markerMusic; BitmapDescriptor fromMarker; BitmapDescriptor toMarker; GeofireProvider _geofireProvider; AuthProvider _authProvider; MusicProvider _musicProvider; PushNotificationsProvider _pushNotificationsProvider; TravelInfoProvider _travelInfoProvider; PricesProvider _pricesProvider; ClientProvider _clientProvider; TravelHistoryProvider _travelHistoryProvider; bool isConnect = false; ProgressDialog _progressDialog; StreamSubscription<DocumentSnapshot> _statusSuscription; StreamSubscription<DocumentSnapshot> _musicInfoSuscription; Set<Polyline> polylines = {}; List<LatLng> points = new List(); Music music; Client _client; String _idTravel; TravelInfo travelInfo; String currentStatus = 'INICIAR VIAJE'; Color colorStatus = Colors.white; double _distanceBetween; Timer _timer; int seconds = 0; double mt = 0; double km = 0; Future init(BuildContext context, Function refresh) async { this.context = context; this.refresh = refresh; _idTravel = ModalRoute.of(context).settings.arguments as String; _geofireProvider = new GeofireProvider(); _authProvider = new AuthProvider(); _musicProvider = new MusicProvider(); _travelInfoProvider = new TravelInfoProvider(); _pushNotificationsProvider = new PushNotificationsProvider(); _pricesProvider = new PricesProvider(); _clientProvider = new ClientProvider(); _travelHistoryProvider = new TravelHistoryProvider(); _progressDialog = MyProgressDialog.createProgressDialog(context, 'Conectandose...'); markerMusic = await createMarkerImageFromAsset('assets/img/trompeta2.png'); fromMarker = await createMarkerImageFromAsset('assets/img/map_pin_red.png'); toMarker = await createMarkerImageFromAsset('assets/img/map_pin_blue.png'); checkGPS(); getMusicInfo(); } void getClientInfo() async { _client = await _clientProvider.getById(_idTravel); } Future<double> calculatePrice() async { Prices prices = await _pricesProvider.getAll(); if (seconds < 60) seconds = 60; if (km == 0) km = 0.1; int min = seconds ~/ 60; print('=========== MIN TOTALES =============='); print(min.toString()); print('=========== KM TOTALES =============='); print(km.toString()); double priceMin = min * prices.min; double priceKm = km * prices.km; double total = priceMin + priceKm; if (total < prices.minValue) { total = prices.minValue; } print('=========== TOTAL =============='); print(total.toString()); return total; } void startTimer() { _timer = Timer.periodic(Duration(seconds: 1), (timer) { seconds = timer.tick; refresh(); }); } void isCloseToPickupPosition(LatLng from, LatLng to) { _distanceBetween = Geolocator.distanceBetween( from.latitude, from.longitude, to.latitude, to.longitude ); print('------ DISTANCE: $_distanceBetween--------'); } void updateStatus () { if (travelInfo.status == 'accepted') { startTravel(); } else if (travelInfo.status == 'started') { finishTravel(); } } void startTravel() async { if (_distanceBetween <= 300) { Map<String, dynamic> data = { 'status': 'started' }; await _travelInfoProvider.update(data, _idTravel); travelInfo.status = 'started'; currentStatus = 'FINALIZAR VIAJE'; colorStatus = Colors.cyan; polylines = {}; points = List(); // markers.remove(markers['from']); markers.removeWhere((key, marker) => marker.markerId.value == 'from'); addSimpleMarker( 'to', travelInfo.toLat, travelInfo.toLng, 'Destino', '', toMarker ); LatLng from = new LatLng(_position.latitude, _position.longitude); LatLng to = new LatLng(travelInfo.toLat, travelInfo.toLng); setPolylines(from, to); startTimer(); refresh(); } else { utils.Snackbar.showSnackbar(context, key, 'Debes estar cerca a la posicion del cliente para iniciar el viaje'); } refresh(); } void finishTravel() async { _timer?.cancel(); double total = await calculatePrice(); saveTravelHistory(total); } void saveTravelHistory(double price) async { TravelHistory travelHistory = new TravelHistory( from: travelInfo.from, to: travelInfo.to, idMusic: _authProvider.getUser().uid, idClient: _idTravel, timestamp: DateTime.now().millisecondsSinceEpoch, price: price ); String id = await _travelHistoryProvider.create(travelHistory); Map<String, dynamic> data = { 'status': 'finished', 'idTravelHistory': id, 'price': price, }; await _travelInfoProvider.update(data, _idTravel); travelInfo.status = 'finished'; Navigator.pushNamedAndRemoveUntil(context, 'music/travel/calification', (route) => false, arguments: id); } void _getTravelInfo() async { travelInfo = await _travelInfoProvider.getById(_idTravel); LatLng from = new LatLng(_position.latitude, _position.longitude); LatLng to = new LatLng(travelInfo.fromLat, travelInfo.fromLng); addSimpleMarker('from', to.latitude, to.longitude, 'Recoger aqui', '', fromMarker); setPolylines(from, to); getClientInfo(); } Future<void> setPolylines(LatLng from, LatLng to) async { PointLatLng pointFromLatLng = PointLatLng(from.latitude, from.longitude); PointLatLng pointToLatLng = PointLatLng(to.latitude, to.longitude); PolylineResult result = await PolylinePoints().getRouteBetweenCoordinates( Environment.API_KEY_MAPS, pointFromLatLng, pointToLatLng ); for (PointLatLng point in result.points) { points.add(LatLng(point.latitude, point.longitude)); } Polyline polyline = Polyline( polylineId: PolylineId('poly'), color: Colors.amber, points: points, width: 6 ); polylines.add(polyline); // addMarker('to', toLatLng.latitude, toLatLng.longitude, 'Destino', '', toMarker); refresh(); } void getMusicInfo() { Stream<DocumentSnapshot> musicStream = _musicProvider.getByIdStream(_authProvider.getUser().uid); _musicInfoSuscription = musicStream.listen((DocumentSnapshot document) { music = Music.fromJson(document.data()); refresh(); }); } void dispose() { _timer?.cancel(); _positionStream?.cancel(); _statusSuscription?.cancel(); _musicInfoSuscription?.cancel(); } void onMapCreated(GoogleMapController controller) { controller.setMapStyle('[{"elementType":"geometry","stylers":[{"color":"#212121"}]},{"elementType":"labels.icon","stylers":[{"visibility":"off"}]},{"elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"elementType":"labels.text.stroke","stylers":[{"color":"#212121"}]},{"featureType":"administrative","elementType":"geometry","stylers":[{"color":"#757575"}]},{"featureType":"administrative.country","elementType":"labels.text.fill","stylers":[{"color":"#9e9e9e"}]},{"featureType":"administrative.land_parcel","stylers":[{"visibility":"off"}]},{"featureType":"administrative.locality","elementType":"labels.text.fill","stylers":[{"color":"#bdbdbd"}]},{"featureType":"poi","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"poi.park","elementType":"geometry","stylers":[{"color":"#181818"}]},{"featureType":"poi.park","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"poi.park","elementType":"labels.text.stroke","stylers":[{"color":"#1b1b1b"}]},{"featureType":"road","elementType":"geometry.fill","stylers":[{"color":"#2c2c2c"}]},{"featureType":"road","elementType":"labels.text.fill","stylers":[{"color":"#8a8a8a"}]},{"featureType":"road.arterial","elementType":"geometry","stylers":[{"color":"#373737"}]},{"featureType":"road.highway","elementType":"geometry","stylers":[{"color":"#3c3c3c"}]},{"featureType":"road.highway.controlled_access","elementType":"geometry","stylers":[{"color":"#4e4e4e"}]},{"featureType":"road.local","elementType":"labels.text.fill","stylers":[{"color":"#616161"}]},{"featureType":"transit","elementType":"labels.text.fill","stylers":[{"color":"#757575"}]},{"featureType":"water","elementType":"geometry","stylers":[{"color":"#000000"}]},{"featureType":"water","elementType":"labels.text.fill","stylers":[{"color":"#3d3d3d"}]}]'); _mapController.complete(controller); } void saveLocation() async { await _geofireProvider.createWorking( _authProvider.getUser().uid, _position.latitude, _position.longitude ); _progressDialog.hide(); } void updateLocation() async { try { await _determinePosition(); _position = await Geolocator.getLastKnownPosition(); _getTravelInfo(); centerPosition(); saveLocation(); addMarker( 'music', _position.latitude, _position.longitude, 'Tu posicion', '', markerMusic ); refresh(); _positionStream = Geolocator.getPositionStream(desiredAccuracy: LocationAccuracy.best, distanceFilter: 1) .listen((Position position) { if (travelInfo?.status == 'started') { mt = mt + Geolocator.distanceBetween( _position.latitude, _position.longitude, position.latitude, position.longitude ); km = mt / 1000; } _position = position; addMarker( 'music', _position.latitude, _position.longitude, 'Tu posicion', '', markerMusic ); animateCameraToPosition(_position.latitude, _position.longitude); if (travelInfo.fromLat != null && travelInfo.fromLng != null) { LatLng from = new LatLng(_position.latitude, _position.longitude); LatLng to = new LatLng(travelInfo.fromLat, travelInfo.fromLng); isCloseToPickupPosition(from, to); } saveLocation(); refresh(); }); } catch(error) { print('Error en la localizacion: $error'); } } void openBottomSheet() { if (_client == null) return; showMaterialModalBottomSheet( context: context, builder: (context) => BottomSheetMusicInfo( imageUrl: _client?.image, username: _client?.username, email: _client?.email, ) ); } void centerPosition() { if (_position != null) { animateCameraToPosition(_position.latitude, _position.longitude); } else { utils.Snackbar.showSnackbar(context, key, 'Activa el GPS para obtener la posicion'); } } void checkGPS() async { bool isLocationEnabled = await Geolocator.isLocationServiceEnabled(); if (isLocationEnabled) { print('GPS ACTIVADO'); updateLocation(); } else { print('GPS DESACTIVADO'); bool locationGPS = await location.Location().requestService(); if (locationGPS) { updateLocation(); print('ACTIVO EL GPS'); } } } Future<Position> _determinePosition() async { bool serviceEnabled; LocationPermission permission; serviceEnabled = await Geolocator.isLocationServiceEnabled(); if (!serviceEnabled) { return Future.error('Location services are disabled.'); } permission = await Geolocator.checkPermission(); if (permission == LocationPermission.deniedForever) { return Future.error( 'Location permissions are permantly denied, we cannot request permissions.'); } if (permission == LocationPermission.denied) { permission = await Geolocator.requestPermission(); if (permission != LocationPermission.whileInUse && permission != LocationPermission.always) { return Future.error( 'Location permissions are denied (actual value: $permission).'); } } return await Geolocator.getCurrentPosition(); } Future animateCameraToPosition(double latitude, double longitude) async { GoogleMapController controller = await _mapController.future; if (controller != null) { controller.animateCamera(CameraUpdate.newCameraPosition( CameraPosition( bearing: 0, target: LatLng(latitude, longitude), zoom: 17 ) )); } } Future<BitmapDescriptor> createMarkerImageFromAsset(String path) async { ImageConfiguration configuration = ImageConfiguration(); BitmapDescriptor bitmapDescriptor = await BitmapDescriptor.fromAssetImage(configuration, path); return bitmapDescriptor; } void addMarker( String markerId, double lat, double lng, String title, String content, BitmapDescriptor iconMarker ) { MarkerId id = MarkerId(markerId); Marker marker = Marker( markerId: id, icon: iconMarker, position: LatLng(lat, lng), infoWindow: InfoWindow(title: title, snippet: content), draggable: false, zIndex: 2, flat: true, anchor: Offset(0.5, 0.5), rotation: _position.heading ); markers[id] = marker; } void addSimpleMarker( String markerId, double lat, double lng, String title, String content, BitmapDescriptor iconMarker ) { MarkerId id = MarkerId(markerId); Marker marker = Marker( markerId: id, icon: iconMarker, position: LatLng(lat, lng), infoWindow: InfoWindow(title: title, snippet: content), ); markers[id] = marker; } }
32.032454
1,839
0.666667
38d27574491c6b4c02f10b168ecd9cc2d4bf269d
3,397
php
PHP
application/api/controller/Login.php
zhifengnetwork/redPacket
32e597d135389d396c98558dde607f6625be4c27
[ "Apache-2.0" ]
null
null
null
application/api/controller/Login.php
zhifengnetwork/redPacket
32e597d135389d396c98558dde607f6625be4c27
[ "Apache-2.0" ]
null
null
null
application/api/controller/Login.php
zhifengnetwork/redPacket
32e597d135389d396c98558dde607f6625be4c27
[ "Apache-2.0" ]
null
null
null
<?php /** * Created by PhpStorm. * User: MyPC * Date: 2019/4/22 * Time: 17:53 */ namespace app\api\controller; use think\Db; use think\Loader; use think\Request; use think\Session; use think\captcha\Captcha; use app\common\util\jwt\JWT; class Login extends \think\Controller { public function index () { redirect('login/login')->send(); exit; } /** * 登录接口 */ public function login() { $mobile = input('mobile'); $password1 = input('password'); $password = md5('TPSHOP'.$password1); $data = Db::name("users")->where('mobile',$mobile) ->field('password,user_id') ->find(); if(!$data){ exit(json_encode(['status' => -1 , 'msg'=>'手机不存在或错误','data'=>null])); } if ($password != $data['password']) { exit(json_encode(['status' => -2 , 'msg'=>'登录密码错误','data'=>null])); } unset($data['password']); //重写 $data['token'] = $this->create_token($data['user_id']); exit(json_encode(['status' => 0 , 'msg'=>'登录成功','data'=>$data])); } /** * 生成token */ private function create_token($user_id){ $time = time(); $payload = array( "iss"=> "DC", "iat"=> $time , "exp"=> $time + 36000 , "user_id"=> $user_id ); $key = 'zhelishimiyao'; $token = JWT::encode($payload, $key, $alg = 'HS256', $keyId = null, $head = null); return $token; } // public function login () { // if (Request::instance()->isPost()) { // $username = input('username'); // $password = input('password'); // // 实例化验证器 // $validate = Loader::validate('Login'); // // 验证数据 // $data = ['username' => $username, 'password' => $password]; // // 验证 // $code = input('captcha'); // $str = session('captcha_id'); // $captcha = new \think\captcha\Captcha(); // if (!$captcha->check($code,$str)){ // return json(['code'=>0,'msg'=>'验证码错误']); // } // if (!$validate->check($data)) { // return $this->error($validate->getError()); // } // $where['username'] = $username; // $where['status'] = 1; // $user_info = Db::table('mg_user')->where($where)->find(); // if ($user_info && $user_info['password'] === minishop_md5($password, $user_info['salt'])) { // $session['uid'] = $user_info['mgid']; // $session['user_name'] = $user_info['username']; // // 记录用户登录信息 // Session::set('admin_user_auth', $session); // return json(['code'=>1,'msg'=>'登录成功']); // } // return json(['code'=>0,'msg'=>'密码错误!']); // } // } // /* // * 获取验证码 // */ // public function loginCaptcha () { // $str = time().uniqid(); // Session::set('captcha_id', $str); // $captcha = new Captcha(); // return $captcha->entry($str); // } // // /* // * 退出登录 // */ // public function login_out() // { // session('admin_user_auth', null); // session('ALL_MENU_LIST', null); // return json(['code'=>1,'msg'=>'请登录','data'=>'']); // } }
26.960317
105
0.459817
12a70ad497b7c9a7ff8e36875e9bc6b5ce91510c
5,668
swift
Swift
PS_Swift_cnodejs/PS_Swift_cnodejs/Util/PageView/PageContentView.swift
PengSiSi/PS_Swift_cnodejs
027c42bb151a6e0d38c3552f42adf2fa615ad924
[ "MIT" ]
2
2018-01-31T02:23:57.000Z
2018-03-11T09:35:33.000Z
PS_Swift_cnodejs/PS_Swift_cnodejs/Util/PageView/PageContentView.swift
PengSiSi/PS_Swift_cnodejs
027c42bb151a6e0d38c3552f42adf2fa615ad924
[ "MIT" ]
null
null
null
PS_Swift_cnodejs/PS_Swift_cnodejs/Util/PageView/PageContentView.swift
PengSiSi/PS_Swift_cnodejs
027c42bb151a6e0d38c3552f42adf2fa615ad924
[ "MIT" ]
1
2019-10-11T01:42:07.000Z
2019-10-11T01:42:07.000Z
// // PageContentView.swift // PS_Swift_cnodejs // // Created by 思 彭 on 2018/1/18. // Copyright © 2018年 思 彭. All rights reserved. // import UIKit class PageContentView: UIView { fileprivate var titles:[String] fileprivate var controllers:[UIViewController] fileprivate var parentVc:UIViewController fileprivate var style:PageStyle fileprivate var startOffsetX:CGFloat = 0 //按下瞬间的offsetX fileprivate var isForbideScroll:Bool = false fileprivate var currentIndex:Int = 0 fileprivate lazy var titleView: PageTitleView = { let titleView:PageTitleView = PageTitleView(frame: CGRect(x: 0, y: 0, width: self.bounds.size.width, height: self.style.labelHeight), titles: self.titles, style: self.style) titleView.delegate = self return titleView }() fileprivate lazy var collectionView: UICollectionView = { let layout:UICollectionViewFlowLayout = UICollectionViewFlowLayout() layout.scrollDirection = .horizontal layout.itemSize = CGSize(width: self.bounds.size.width, height: self.bounds.size.height - self.style.labelHeight) layout.minimumLineSpacing = 0 layout.minimumInteritemSpacing = 0 let collection:UICollectionView = UICollectionView(frame: CGRect(x: 0, y: self.style.labelHeight, width: self.bounds.size.width, height: self.bounds.size.height - self.style.labelHeight), collectionViewLayout: layout) collection.dataSource = self collection.delegate = self collection.register(UICollectionViewCell.self, forCellWithReuseIdentifier: "UICollectionViewCell") collection.scrollsToTop = false collection.isPagingEnabled = true collection.bounces = false collection.showsHorizontalScrollIndicator = false return collection }() init(frame:CGRect,titles:[String],childControllers:[UIViewController],parentController:UIViewController,style:PageStyle = PageStyle()) { //初始化参数 self.titles = titles self.controllers = childControllers self.style = style self.parentVc = parentController super.init(frame: frame) //UI setupUI() } required init?(coder aDecoder: NSCoder) { fatalError("init(coder:) has not been implemented") } } extension PageContentView { fileprivate func setupUI(){ //设置titleView addSubview(titleView) //设置子控制器 for vc in controllers { parentVc.addChildViewController(vc) } //设置contentView addSubview(collectionView) } } extension PageContentView:UICollectionViewDataSource{ func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { return controllers.count } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "UICollectionViewCell", for: indexPath) for subview in cell.contentView.subviews { subview.removeFromSuperview() } let vc = controllers[indexPath.row] vc.view.frame = cell.contentView.bounds cell.contentView .addSubview(vc.view) return cell } } extension PageContentView:UICollectionViewDelegate { func scrollViewWillBeginDragging(_ scrollView: UIScrollView) { startOffsetX = scrollView.contentOffset.x isForbideScroll = false } public func scrollViewDidScroll(_ scrollView: UIScrollView) { if startOffsetX == scrollView.contentOffset.x { return } if isForbideScroll { return} //scroll滚动的情况下,让item大小变化 var progress:CGFloat = 0 var nextIndex = 0 let width = scrollView.bounds.size.width let count = Int(scrollView.contentSize.width/width) //判断是左移还是右移 if startOffsetX > scrollView.contentOffset.x{ //右移动 nextIndex = currentIndex - 1 if nextIndex < 0 { nextIndex = 0 } //计算progress progress = (startOffsetX - scrollView.contentOffset.x)/width } if startOffsetX < scrollView.contentOffset.x{ //左移 nextIndex = currentIndex + 1 if nextIndex > count - 1 { nextIndex = count - 1 } progress = (scrollView.contentOffset.x - startOffsetX)/width } titleView.pageViewScroll(nextIndex: nextIndex, progress: progress) } func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) { //拖动结束 计算index var index = Int(scrollView.contentOffset.x/scrollView.bounds.size.width) let width = scrollView.bounds.size.width let count = Int(scrollView.contentSize.width/width) if index < 0{ index = 0 } if index > count - 1 { index = count - 1 } //设置viewFrame currentIndex = index //让pageView滚动起来 titleView.pageViewScrollEnd(pageIndex: index) } } extension PageContentView : PageTitleViewDelegate { func pageTitleView(pageTitleView: PageTitleView, selectIndex: Int) { isForbideScroll = true //设置view frame currentIndex = selectIndex //让collectionView滚动 let indexPath = IndexPath(row: selectIndex, section: 0) collectionView.scrollToItem(at: indexPath, at: .left, animated: false) } }
33.146199
225
0.643966
a771c49c80350798e769a9342b49b858a4f214b7
4,659
lua
Lua
rot/rot/fov/precise.lua
LJNIC/Collaborogue
9c333e790f043087045d9236ccde0e496ebfc96b
[ "MIT" ]
4
2020-11-09T23:33:48.000Z
2021-04-19T23:14:50.000Z
rot/rot/fov/precise.lua
LJNIC/Collaborogue
9c333e790f043087045d9236ccde0e496ebfc96b
[ "MIT" ]
1
2021-11-13T15:53:53.000Z
2021-11-13T15:53:53.000Z
rot/rot/fov/precise.lua
LJNIC/Collaborogue
9c333e790f043087045d9236ccde0e496ebfc96b
[ "MIT" ]
2
2021-11-11T03:25:30.000Z
2022-02-13T13:05:00.000Z
--- Precise Shadowcasting Field of View calculator. -- The Precise shadow casting algorithm developed by Ondřej Žára for rot.js. -- See http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Shadowcasting_in_JavaScript -- @module ROT.FOV.Precise local ROT = require((...):gsub(('.[^./\\]*'):rep(2) .. '$', '')) local Precise = ROT.FOV:extend("Precise") --- Constructor. -- Called with ROT.FOV.Precise:new() -- @tparam function lightPassesCallback A function with two parameters (x, y) that returns true if a map cell will allow light to pass through -- @tparam table options Options -- @tparam int options.topology Direction for light movement Accepted values: (4 or 8) function Precise:init(lightPassesCallback, options) Precise.super.init(self, lightPassesCallback, options) end --- Compute. -- Get visibility from a given point -- @tparam int x x-position of center of FOV -- @tparam int y y-position of center of FOV -- @tparam int R radius of FOV (i.e.: At most, I can see for R cells) -- @tparam function callback A function that is called for every cell in view. Must accept four parameters. -- @tparam int callback.x x-position of cell that is in view -- @tparam int callback.y y-position of cell that is in view -- @tparam int callback.r The cell's distance from center of FOV -- @tparam number callback.visibility The cell's visibility rating (from 0-1). How well can you see this cell? function Precise:compute(x, y, R, callback) callback(x, y, 0, 1) local SHADOWS = {} local blocks, A1, A2, visibility for r = 1, R do local neighbors = self:_getCircle(x, y, r) local neighborCount = #neighbors for i = 0, neighborCount - 1 do local cx = neighbors[i + 1][1] local cy = neighbors[i + 1][2] A1 = {i > 0 and 2 * i - 1 or 2 * neighborCount - 1, 2 * neighborCount} A2 = {2 * i + 1, 2 * neighborCount} blocks = not self:_lightPasses(cx, cy) visibility = self:_checkVisibility(A1, A2, blocks, SHADOWS) if visibility > 0 then callback(cx, cy, r, visibility) end if #SHADOWS == 2 and SHADOWS[1][1] == 0 and SHADOWS[2][1] == SHADOWS[2][2] then break end end end end local function splice(t, i, rn, it) -- table, index, numberToRemove, insertTable if rn > 0 then for _ = 1, rn do table.remove(t, i) end end if it and #it > 0 then for idx = i, i + #it - 1 do local el = table.remove(it, 1) if el then table.insert(t, idx, el) end end end end function Precise:_checkVisibility(A1, A2, blocks, SHADOWS) if A1[1] > A2[1] then local v1 = self:_checkVisibility(A1, {A1[2], A1[2]}, blocks, SHADOWS) local v2 = self:_checkVisibility({0, 1}, A2, blocks, SHADOWS) return (v1 + v2) / 2 end local index1 = 1 local edge1 = false while index1 <= #SHADOWS do local old = SHADOWS[index1] local diff = old[1] * A1[2] - A1[1] * old[2] if diff >= 0 then if diff == 0 and (index1)%2 == 1 then edge1 = true end break end index1 = index1 + 1 end local index2 = #SHADOWS local edge2 = false while index2 > 0 do local old = SHADOWS[index2] local diff = A2[1] * old[2] - old[1] * A2[2] if diff >= 0 then if diff == 0 and (index2)%2 == 0 then edge2 = true end break end index2 = index2 - 1 end local visible = true if index1 == index2 and (edge1 or edge2) then visible = false elseif edge1 and edge2 and index1 + 1 == index2 and (index2)%2 == 0 then visible = false elseif index1 > index2 and (index1)%2 == 0 then visible = false end if not visible then return 0 end local visibleLength = 0 local remove = index2 - index1 + 1 if remove%2 == 1 then if (index1)%2 == 0 then if #SHADOWS > 0 then local P = SHADOWS[index1] visibleLength = (A2[1] * P[2] - P[1] * A2[2]) / (P[2] * A2[2]) end if blocks then splice(SHADOWS, index1, remove, {A2}) end else if #SHADOWS > 0 then local P = SHADOWS[index2] visibleLength = (P[1] * A1[2] - A1[1] * P[2]) / (A1[2] * P[2]) end if blocks then splice(SHADOWS, index1, remove, {A1}) end end else if (index1)%2 == 0 then if #SHADOWS > 0 then local P1 = SHADOWS[index1] local P2 = SHADOWS[index2] visibleLength = (P2[1] * P1[2] - P1[1] * P2[2]) / (P1[2] * P2[2]) end if blocks then splice(SHADOWS, index1, remove) end else if blocks then splice(SHADOWS, index1, remove, {A1, A2}) end return 1 end end local arcLength = (A2[1] * A1[2] - A1[1] * A2[2]) / (A1[2] * A2[2]) return visibleLength / arcLength end return Precise
33.517986
142
0.631037
7284279aae5279c7d648666be95bc342dff3bf22
1,656
cs
C#
src/AspNetCore.IdentityServer4.WebApi/Services/IIdentityClient.cs
matt2005/AspNetCore.IdentityServer4.Sample
bdf7dced375aaa87ff0453c6e5f59469ff7ed1a6
[ "BSD-3-Clause" ]
1
2020-12-29T23:54:47.000Z
2020-12-29T23:54:47.000Z
src/AspNetCore.IdentityServer4.WebApi/Services/IIdentityClient.cs
matt2005/AspNetCore.IdentityServer4.Sample
bdf7dced375aaa87ff0453c6e5f59469ff7ed1a6
[ "BSD-3-Clause" ]
null
null
null
src/AspNetCore.IdentityServer4.WebApi/Services/IIdentityClient.cs
matt2005/AspNetCore.IdentityServer4.Sample
bdf7dced375aaa87ff0453c6e5f59469ff7ed1a6
[ "BSD-3-Clause" ]
null
null
null
using IdentityModel.Client; using System; using System.Net.Http; using System.Threading.Tasks; namespace AspNetCore.IdentityServer4.WebApi.Services { public interface IIdentityClient : IDisposable { /// <summary> /// Get token by form data (Grant Type: password) /// </summary> /// <param name="userName">User name</param> /// <param name="password">Password</param> /// <returns>HttpResponseMessage</returns> Task<HttpResponseMessage> GetTokenByFormDataAsync(string userName, string password); /// <summary> /// Sign in /// </summary> /// <param name="userName">User name</param> /// <param name="password">Password</param> /// <returns>TokenResponse</returns> Task<TokenResponse> SignInAsync(string userName, string password); /// <summary> /// Get User's information by Access Token /// </summary> /// <param name="accessToken">Access Token</param> /// <returns>UserInfoReponse</returns> Task<UserInfoResponse> GetUserInfoAsync(string accessToken); /// <summary> /// Refresh token /// </summary> /// <param name="refreshToken">Refresh-token</param> /// <returns>TokenResponse</returns> Task<TokenResponse> RefreshTokenAsync(string refreshToken); /// <summary> /// Revoke Reference|Refresh token /// </summary> /// <param name="token">Reference|Refresh Token</param> /// <returns>TokenRevocationResponse</returns> Task<TokenRevocationResponse> RevokeTokenAsync(string token); } }
34.5
92
0.618961
641e55ec8c37dd8e31dcede4ac9789370a659741
1,840
py
Python
student_records/migrations/0001_initial.py
HillaryOkello/CIT-blockchain-DB
0b931e196da43a87bf842cee0e130f57557169bd
[ "MIT" ]
1
2021-12-10T13:54:38.000Z
2021-12-10T13:54:38.000Z
student_records/migrations/0001_initial.py
HillaryOkello/CIT-blockchain-DB
0b931e196da43a87bf842cee0e130f57557169bd
[ "MIT" ]
null
null
null
student_records/migrations/0001_initial.py
HillaryOkello/CIT-blockchain-DB
0b931e196da43a87bf842cee0e130f57557169bd
[ "MIT" ]
null
null
null
# Generated by Django 3.1.1 on 2021-11-29 09:44 from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='StudentRecord', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('first_name', models.CharField(max_length=50)), ('last_name', models.CharField(max_length=50)), ('dob', models.CharField(max_length=50)), ('address', models.CharField(max_length=100)), ('phone', models.CharField(max_length=50)), ('email', models.CharField(max_length=100)), ('date_of_enrollment', models.DateField(auto_now_add=True)), ('quiz_score', models.IntegerField(default=0)), ('python_entry_level', models.CharField(choices=[('pass', 'PASS'), ('fail', 'FAIL')], default='pass', max_length=4)), ('aws_practitioner_exam', models.CharField(choices=[('pass', 'PASS'), ('fail', 'FAIL')], default='pass', max_length=4)), ('python_associate_exam', models.CharField(choices=[('pass', 'PASS'), ('fail', 'FAIL')], default='pass', max_length=4)), ('blockchain_exam', models.CharField(choices=[('pass', 'PASS'), ('fail', 'FAIL')], default='pass', max_length=4)), ('aws_ml_exam', models.CharField(choices=[('pass', 'PASS'), ('fail', 'FAIL')], default='pass', max_length=4)), ('dissertation', models.CharField(default='pass', max_length=50)), ('date_of_graduation', models.DateField(auto_now_add=True)), ('job_placement', models.CharField(max_length=100)), ], ), ]
49.72973
136
0.580435
05240d6a365951e0bec4183cd212c50b64eb5fd0
2,613
css
CSS
assets/css/clase4.css
karly9/ClasesHtml
25d20fefb41ead0176fdb657eddbef652bd6df24
[ "MIT" ]
null
null
null
assets/css/clase4.css
karly9/ClasesHtml
25d20fefb41ead0176fdb657eddbef652bd6df24
[ "MIT" ]
null
null
null
assets/css/clase4.css
karly9/ClasesHtml
25d20fefb41ead0176fdb657eddbef652bd6df24
[ "MIT" ]
null
null
null
/* *{ margin: 0; padding: 0; } */ body{ font-family: Arial, Helvetica, sans-serif; font-size: 1.1em; } /************ textos ***************/ .text-center{ text-align: center; } .text-left{ text-align: left; } .text-right { text-align: right; } .text-justify{ text-align: justify; } .text-bold{ /*texto en negrita*/ font-weight: bold; } .text-tag{ background: #ff0000; } .text-blue{ color: #0000ff; } .text-red{ color: #ff0000; } /************ margenes ***************/ .am-1{ /*todos los margenes con 15px*/ margin: 15px; } .am-2{ /*todos los margenes con 30px*/ margin: 30px; } .mt-1{ /*Solo margen superior con 15px*/ margin-top: 15px; } .mt-2{ /*Solo margen superior con 30px*/ margin-top: 30px; } .ml-1{ /*Solo margen izquierdo con 15px*/ margin-left: 15px; } .ml-2{ /*Solo margen izquierdo con 30px*/ margin-left: 30px; } .mr-1{ /*Solo margen derecho con 15px*/ margin-right: 15px; } .mr-2{ /*Solo margen superior con 30px*/ margin-right: 30px; } .mb-1{ /*Solo margen inferior con 15px*/ margin-bottom: 15px; } .mb-2{ /*Solo margen inferior con 30px*/ margin-bottom: 30px; } /********* end margenes ***************/ .ap-1{ /*Tooos los padding a 15px*/ padding: 15px; } .ap-2{ /*Tooos los padding a 30px*/ padding: 30px; } .pt-1{ /*Solo padding superior a 15px*/ padding-top: 15px; } .pt-2 { /*Solo padding superior a 30x*/ padding-top: 30px; } .pb-1{ /*Solo padding inferior a 15x*/ padding-bottom: 15px; } .pb-2 { /*Solo padding inferior a 30x*/ padding-bottom: 30px; } .pl-1{ /*Solo padding izquierdo a 15x*/ padding-left: 15px; } .pl-2 { /*Solo padding izquierdo a 30x*/ padding-left: 30px; } .pr-1{ /*Solo padding derecho a 15x*/ padding-right: 15px; } .pr-2 { /*Solo padding derecho a 30x*/ padding-right: 30px; } /************ bordes ***************/ .ab{ /* Todos los bordes */ border: 1px #000 solid; } .b-top { border-top: 1px #000 solid; } .b-bottom{ border-bottom: 1px #000 solid; } .b-left{ border-left: 1px #000 solid; } .b-right{ border-right: 1px #000 solid; } /************ bordes redondeados ***************/ .abr{ /* todos los bordes redondeados*/ border-radius: 10px; } .brt-left{ /* borde redondeado de arriba*/ border-top-left-radius: 10px; } .brt-right{ /* borde redondeado de arriba*/ border-top-right-radius: 10px; } .brb-left{ /* borde redondeado de abajo*/ border-bottom-left-radius: 10px; } .brb-right{ /* borde redondeado de abajo*/ border-bottom-right-radius: 10px; }
15.370588
49
0.582855
a62a2ed87dbb9ba1663e1892911b6df27bd471c9
10,816
sql
SQL
database/files/test_results.sql
trinityprog/twix_eba_2022_ge-
0903e74e910418535349afcc0aabcc1282fa2358
[ "MIT" ]
null
null
null
database/files/test_results.sql
trinityprog/twix_eba_2022_ge-
0903e74e910418535349afcc0aabcc1282fa2358
[ "MIT" ]
null
null
null
database/files/test_results.sql
trinityprog/twix_eba_2022_ge-
0903e74e910418535349afcc0aabcc1282fa2358
[ "MIT" ]
null
null
null
INSERT INTO `test_results` (`id`, `general`, `locale`, `image`, `created_at`, `updated_at`) VALUES (1, 'ароматный чай с Twix и новая серия, ради которой точно стоило проснуться пораньше', 'ертеңгілік хош иісті шай және көптен күткен телехикаяның жаңа сериясы', '1.png', '2022-01-27 05:06:17', '2022-01-27 08:11:45'), (2, 'чашка тёплого чая и Twix для момента, когда Добби полностью свободен', 'бір шыныаяқ жылы шай және Добби толық еркіндік алған сәтте жейтін Twix', '2.png', '2022-01-27 05:06:17', '2022-01-27 08:37:52'), (3, 'бодрящий кофе, любимый Twix и вдохновляющее кино, для эффективного дня', 'сергіткіш кофе, сүйікті Twix және күнді тиімді өткізуге шабыт беретін кино', '3.png', '2022-01-27 05:06:17', '2022-01-27 08:38:08'), (4, 'когда понимаешь, что на одной серии не остановишься, и нужны кофе и Twix, чтобы узнать, чем это закончится', 'бір телехикаямен тоқтамайтыныңды білген кезде кофе және соңы немен бітетінін білу үшін Twix керек', '4.png', '2022-01-27 05:06:17', '2022-01-27 08:38:26'), (5, 'начало дня настоящих эстетов, с ароматом любимого чая, вкусом Twix и тихим шелестом страниц', 'нағыз эстеттер күндерін осылай бастайды: сүйікті шайының хош иісі, Twix дәмі және кітаптың беттерін ақырын ғана парақтау', '5.png', '2022-01-27 05:06:17', '2022-01-27 08:39:14'), (6, 'уютный вечер за кружкой травяного чая с погружением в мир слов, смыслов и вкуса Twix', 'кешқұрым бір саптыаяқ шөп шайын іше отырып, сөз, мән-мағына әлемі мен Twix дәміне шому', '6.png', '2022-01-27 05:06:17', '2022-01-27 08:39:31'), (7, 'идеальное утро, чтобы проснуться с кофе, поднять настроение с Twix, и разбудить мозг одним из навыков эффективных людей', 'ұйқыдан тұрғанда кофе ішіп, Twix-пен көңіл-күйді көтеріп, миды жұмысы жемісті адамдарға тән дағдылардың бірімен оятатын керемет таңғы уақыт', '7.png', '2022-01-27 05:06:17', '2022-01-27 08:40:32'), (8, 'когда вечер - это не повод отказываться от любимого вкуса кофе и Twix, и новых страниц новой истории', 'кеш - сүйікті кофе дәмі мен Twix-тен, жаңа оқиғаның жаңа парақтарынан бас тарту деген сөз емес', '8.png', '2022-01-27 05:06:17', '2022-01-27 08:40:43'), (9, 'Twix-пикник на природе, в руках кружка горячего чая и ты готов к новому сезону любимого сериала.', 'табиғаттағы Twix-сейіл, қолыңда бір шыныаяқ ыстық шай, сонымен жаңа телехикаяның жаңа маусымына дайынсың.', '4202fb9d-0fc9-4660-a40b-0f03ce81fcb6.jpg', '2022-01-27 05:06:17', '2022-01-27 11:25:00'), (10, 'начни многосерийную историю твоего путешествия с кружки чая и первой серии нового сериала', 'саяхатыңның хикаясын бір шыныаяқ шай мен жаңа телехикаяның бірінші сериясынан баста', 'c669916b-8476-4afd-9be8-59f4a59e9451.jpg', '2022-01-27 05:06:17', '2022-01-27 11:25:59'), (11, 'время наедине с собой и музыкой, станет еще «вкуснее» с горячим чаем и любимым Twix', 'өз бетіңше өткізген уақыт және тыңдаған музыкаң ыстық шаймен және сүйікті Twix-пен тіпті, «дәмді» болады', '825e6f6a-2d91-4b7e-b278-f8d58f9be760.jpg', '2022-01-27 05:06:17', '2022-01-27 11:26:36'), (12, 'завари чай в термос, собери музыкальный плейлист, закинь в рюкзак Twix и отправляйся в дорогу', 'термосқа шай бұқтырып, музыкалық плейлист жасап, арқақоржыныңа Twix салып алып, жолға шық', '9d130107-7893-47eb-9c39-9aa798bf127e.jpg', '2022-01-27 05:06:17', '2022-01-27 11:27:25'), (13, 'кофе на природе с Twix – особенное удовольствие, которое стоит разделить с любимыми актёрами', 'табиғатта Twix-пен шай ішу – сүйікті актерлеріңмен бөлісуге тұрарлық ерекше рақат', 'b1616b86-2d21-4505-908a-d6f654bebff6.jpg', '2022-01-27 05:06:17', '2022-01-27 11:28:27'), (14, 'дальний перелёт или поездка – идеальный момент для ароматного кофе, Twix и сериала, на который не хватало времени', 'ұзақ жолға ұшу немесе сапарға шығу – хош иісті кофе, Twix және біраз уақыттан бері ойда жүрген телехикая көруге керемет сәт', 'e89e01fb-e291-45de-a727-a0db849898cf.jpg', '2022-01-27 05:06:17', '2022-01-27 11:29:07'), (15, 'двигайся в ритме с природой под любимую музыку с кружкой крепкого кофе и любимым Twix', 'сүйікті музыкаңды қосып, бір саптыаяқ кофемен және сүйікті Twix-пен табиғатпен үйлесе қозғал', 'bff918a2-2762-4782-8b17-1749e2da886e.jpg', '2022-01-27 05:06:17', '2022-01-27 11:30:09'), (16, 'выбирай саундтрек к твоему путешествию со вкусом кофе и настроением Twix', 'кофе дәмі мен Twix көңіл-күйі бар саяхатқа саундтрек таңда', '8fa733bd-6895-4861-8b33-2925979bb205.jpg', '2022-01-27 05:06:17', '2022-01-27 11:30:58'), (17, 'холодный лёд, горячий чай и любимый Twix с самого раннего утра!', 'таңғы уақытта суық мұз, ыстық шай және сүйікті Twix!', 'ff4c2980-d367-4049-b341-38a2bab3d455.jpg', '2022-01-27 05:06:17', '2022-01-27 11:31:54'), (18, 'разрезать утренний вельвет и наградить себя чашкой ароматного чая с Twix', 'таңғы қарға із қалдырып, өзіңді бір шыныаяқ хош иісті шаймен және Twix-пен марапатта!', 'fd561ebb-bced-4a57-92ba-b3e725572378.jpg', '2022-01-27 05:06:17', '2022-01-27 11:32:37'), (19, 'крепкий кофе и динамичное катание, пока каток только твой!', 'қою кофе және қарқынды түрде сырғанау, қазірше мұзайдын сенікі!', '432b1cf2-ff99-44e5-a3c2-f6d0f07ecca1.jpg', '2022-01-27 05:06:17', '2022-01-27 11:33:16'), (20, 'когда на завтрак порция адреналина, ароматный кофе и любимый Twix!', 'таңғы асқа – бір үлесім адреналин, хош иісті кофе және сүйікті Twix!', 'ed42db24-88d7-4f07-a0ef-982b8f557fdc.jpg', '2022-01-27 05:06:17', '2022-01-27 11:34:18'), (21, 'романтическое настроение, когда лед искрится звездами, а чай и Twix сладко согревают!', 'күннің шуағы шашылған мұз жалтырап, шай мен Twix жылытатын романтикалық көңіл-күй!', '2ee88290-5f4b-432c-a606-1f1e68713705.jpg', '2022-01-27 05:06:17', '2022-01-27 11:34:54'), (22, 'проводить закат в стремительной полёте с финишем у кружки горячего чая с Twix!', 'күннің батуын ұшып келе жатып тамашалау, ақтық мәреде Twix-пен бір шыныаяқ ыстық шай ішу!', '081dd77b-48cf-400b-9e95-9e31ca260932.jpg', '2022-01-27 05:06:17', '2022-01-27 11:35:44'), (23, 'бодрящий кофе и парные танцы на льду в стиле Twix!', 'сергітетін кофе және мұз бетінде Twix стилінде жұппен билеу!', '71d200c2-babf-4ab9-a9b7-23eb5fcdfaf0.jpg', '2022-01-27 05:06:17', '2022-01-27 11:36:31'), (24, 'выпить кофе с невероятным видом на вечерний горный пейзаж!', 'таудың керемет әдемі кешкілік табиғатын тамашалай отырып кофе ішу!', 'ccc20b51-7ddf-4e03-a0b7-a7eaf51c97f2.jpg', '2022-01-27 05:06:17', '2022-01-27 11:37:33'), (25, 'пропустить по чашке чая и прикупить по пакету новинок с любимой подругой!', 'сүйікті құрбыңмен бір-бір шыныаяқ шай ішіп, бір-бір пакет жаңа киім сатып алу!', '2391d487-d727-4c27-a622-4b3815214458.jpg', '2022-01-27 05:06:17', '2022-01-27 11:38:20'), (26, 'успокоительный чай с Twix для любимого, пока примеряешь пятое платье!', 'бесінші көйлегіңді киіп көріп жатқанда сүйіктіңе Twix пен тыныштандыратын шай керек!', '573f9ba5-fd5a-45c1-843e-51f7614600bf.jpg', '2022-01-27 05:06:17', '2022-01-27 11:39:18'), (27, 'расслабляющий чай, роскошный спа и Twix на сладкое в компании с той, кто отлично тебя понимает', 'өзіңді түсінетін жанмен денеңді босаңсытатын шай ішу, салтанатты спа және Twix', 'ef5edba2-bb15-4bb9-a591-21101f5ea4a3.jpg', '2022-01-27 05:06:17', '2022-01-27 11:40:17'), (28, 'испытать новые эмоции в спа для двоих и отметить это чашкой чая с Twix', 'екі адамға арналған спада жаңа эмоцияларға бөлену және оны бір шыныаяқ шаймен және Twix-пен атап өту', '6024fc23-5134-4de7-9406-77b2d1da4495.jpg', '2022-01-27 05:06:17', '2022-01-27 11:40:57'), (29, 'устроить дружеский забег по любимым магазинам с остановкой на кофе и Twix!', 'кофе мен Twix-ке аялдап, сүйікті дүкендерді қол ұстасып бірге аралау!', '450cffd9-b3bd-40bb-9fa2-947d2d5d9c3d.jpg', '2022-01-27 05:06:17', '2022-01-27 11:45:37'), (30, 'ему кофе для бодрости, тебе шоппинг для красоты и Twix каждому – для удовольствия', 'оған сергітетін кофе, саған сұлулық беретін шоппинг, әрқайсыңа рақатқа батыратын Twix', '57c90b56-9089-407e-846c-e15432f0706d.jpg', '2022-01-27 05:06:17', '2022-01-27 11:46:22'), (31, 'разнообразить кофейные посиделки с подругой – походом в спа с Twix', 'құрбыңмен кофе ішетін сәттеріңді Twix жеп спаға баратын сәттермен түрлендір', '6c5056c4-d97f-4c45-8ba8-669f8e7d6e8f.jpg', '2022-01-27 05:06:17', '2022-01-27 11:48:27'), (32, 'кофейный скраб и Twix для любимого, как награда за его готовность к совместному спа', 'кофе скрабы және сенімен бірге спаға барғаны үшін берілетін марапат ретінде сүйіктіңе Twix', '895d7f18-d701-4bed-a2b8-71f85b1cb462.jpg', '2022-01-27 05:06:17', '2022-01-27 11:49:05'), (33, 'морской вайб ждет тебя на расстоянии перелёта до отеля в ОАЭ, с чаем и Twix в номере', 'теңізге тән көңіл-күй сені бөлмесінде шайы мен Twix-і бар БАӘ дейін ұшып келеді деп күтуде', 'fa255c6f-2b83-47bc-ab69-06865ea639ac.jpg', '2022-01-27 05:06:17', '2022-01-27 11:54:48'), (34, 'прилетай на Шри-Ланку, и выбирай домик в глубине острова, чтобы наслаждаться природой, попивая кофе с Twix', 'Шри-Ланкаға ұшып бар да, кофе ішіп, Twix жеп, табиғатты тамашалау үшін аралдың ортасынан үй таңдап ал', 'a71e2d60-cb53-422d-9c71-ca3860e1da40.jpg', '2022-01-27 05:06:17', '2022-01-27 11:55:26'), (35, 'смотри африканскую природу из окна автомобиля и отеля, но следи, чтобы обезьяны не украли твой Twix', 'Африканың табиғатын автокөліктің және қонақүйдің терезесінен тамашала, бірақ байқа, маймылдар Twix-іңді ұрлап кетпесін.', '1d974ef8-831d-4907-a376-3de78a02642b.jpg', '2022-01-27 05:06:17', '2022-01-27 11:56:19'), (36, 'автомобильное путешествие по Лазурному побережью и кофе с Twix в уютных деревеньках', 'көк теңіздің жағасында автокөлікпен саяхаттау, жайлы ауылдарда Twix-пен кофе ішу', '5af48263-bb39-403b-b4b8-821bca827bce.jpg', '2022-01-27 05:06:17', '2022-01-27 11:57:22'), (37, 'лети в Турцию – страну экскурсий, отелей и особого чая по-турецки для твоего Twix', 'экскурсия, қонақүйлер және Twix-іңе арналған түрікше дайындалған ерекше шай елі Түркияға ұш', '67a6edc2-cd8b-4411-afac-698b69d27107.jpg', '2022-01-27 05:06:17', '2022-01-27 11:58:43'), (38, 'изучай любую страну, и живи там по системе каучсёрфинг - главное устрой хозяину чаепитие с Twix', 'сүйікті еліңді зертте, онда каучсёрфинг жүйесі бойынша өмір сүр, ең бастысы – қожайыныңа Twix-пен шай бер', '4b2a285d-967d-4e91-927d-b3cc88757e2a.jpg', '2022-01-27 05:06:17', '2022-01-27 11:59:59'), (39, 'экскурсионный тур по Европе начнётся с кофе и Twix на террасе отеля в историческом центре', 'Еуропа ішіндегі экскурсиялық тур тарихи орталықтағы қонақүйдің террасасында кофе мен Twix-тен басталады', '276c2dcd-b6c6-40e4-b067-adc9c03ad23c.jpg', '2022-01-27 05:06:17', '2022-01-27 12:00:35'), (40, 'проедь на автомобиле по маршруту Шёлкового пути, останавливаясь у местных жителей, с Twix и термосом кофе', 'автокөлікпен Жібек жолының бойымен жүр, Twix-пен және термосқа құйылған кофеңмен жергілікті тұрғындардың үйлеріне тоқта', '2bddafa6-fd3d-46fb-9686-999815b20d6e.jpg', '2022-01-27 05:06:17', '2022-01-27 12:01:29');
257.52381
339
0.752219
0523cc2da862fdcf4042e0fa4772906096cad51a
146
swift
Swift
notes/Sources/Service/DTO/NoteDTO.swift
santaarturio/Notes
0921992957e0368c3f342389d8f154ec8da46f1e
[ "MIT" ]
null
null
null
notes/Sources/Service/DTO/NoteDTO.swift
santaarturio/Notes
0921992957e0368c3f342389d8f154ec8da46f1e
[ "MIT" ]
null
null
null
notes/Sources/Service/DTO/NoteDTO.swift
santaarturio/Notes
0921992957e0368c3f342389d8f154ec8da46f1e
[ "MIT" ]
null
null
null
import Foundation enum API { struct Note: Codable { let id: String let title: String let subtitle: String let date: Date } }
13.272727
24
0.636986
38a6f5af4009ca537c1c628a7ed44990967de54e
1,457
php
PHP
resources/views/components/email/picture_two_columns.blade.php
AlejandroFdz/pruebalaravel
76bfff8743c2cd40dd4bb1dea993b167ee92d471
[ "MIT" ]
null
null
null
resources/views/components/email/picture_two_columns.blade.php
AlejandroFdz/pruebalaravel
76bfff8743c2cd40dd4bb1dea993b167ee92d471
[ "MIT" ]
null
null
null
resources/views/components/email/picture_two_columns.blade.php
AlejandroFdz/pruebalaravel
76bfff8743c2cd40dd4bb1dea993b167ee92d471
[ "MIT" ]
null
null
null
<?php $content = json_decode($component->content, true); ?> <div id="{{$component->name}}" class="component" style=" margin:{{$component->margin}}px; padding:{{$component->padding}}px; background-color:{{$content['component']['bg_color']}}; text-align:{{$content['component']['text_align']}}; "> @if( isset($content['featured_picture']) ) <img src="{{url('storage')}}/{{$content['featured_picture']['picture']}}" id="picture_two_columns_featured_picture" style="width:100%;"> @endif @if( isset($content['title']) ) <h3 id="picture_two_columns_title" style=" font-size:{{$content['title']['styles']['font_size']}}px; margin-top:{{$content['title']['styles']['margin_top']}}px; color:{{$content['title']['styles']['color']}} font-style: {{$content['title']['styles']['font-style']}}; "> {{$content['title']['properties']['text']}} </h3> @endif @if( isset($content['columns']) ) <div style="display:inline-block;color:#808080;font-size:16px;"> <div id="column_text_1" style="width:49%;float:left;"> {{$content['columns']['column_1']['text']}} </div> <div id="column_text_2" style="width:49%;float:right;"> {{$content['columns']['column_2']['text']}} </div> </div> @endif </div>
38.342105
144
0.532601
2c72b38d088b6b308fdd667f503d6afdb0c3653c
82,448
py
Python
tkp/db/associations.py
kernsuite-debian/tkp
f1eca5b051aafb6ca20cd134d7850f46b861ff12
[ "BSD-2-Clause" ]
null
null
null
tkp/db/associations.py
kernsuite-debian/tkp
f1eca5b051aafb6ca20cd134d7850f46b861ff12
[ "BSD-2-Clause" ]
null
null
null
tkp/db/associations.py
kernsuite-debian/tkp
f1eca5b051aafb6ca20cd134d7850f46b861ff12
[ "BSD-2-Clause" ]
null
null
null
""" A collection of back end subroutines (mostly SQL queries), In this module we deal with source association. """ import logging import tkp.db from sqlalchemy.exc import IntegrityError logger = logging.getLogger(__name__) def associate_extracted_sources(image_id, deRuiter_r, beamwidths_limit=1, new_source_sigma_margin=3): """ Associate extracted sources with sources detected in the running catalog. See the "developer's reference" section of the docs for a step-by-step breakdown of the logic encapsulated here. The dimensionless distance between two sources is given by the "De Ruiter radius", see Chapters 2 & 3 of Scheers' thesis. """ logger.debug("Using a De Ruiter radius of %s" % (deRuiter_r,)) ##This is used as a check that everything from the sourcefinder is sensible. ##Currently switched off as it's incompatible with sources about the meridian. # _delete_bad_blind_extractions(conn, image_id) _empty_temprunningcatalog() #+------------------------------------------------------+ #| Here we select all extracted sources that have one or| #| more counterparts in the runningcatalog | #| Association pairs are of the sequence runcat-xtrsrc, | #| which may be matching one of the following cases: | #| many-to-many, many-to-one, one-to-many, one-to-many | #+------------------------------------------------------+ mw = _check_meridian_wrap(image_id) _insert_temprunningcatalog(image_id, deRuiter_r, beamwidths_limit, mw) #+------------------------------------------------------+ #| Here we process (flag) the many-to-many associations.| #+------------------------------------------------------+ database = tkp.db.Database() # Since the _flag_many_to_many_tempruncat uses the temprunningcatalog table # as a temporary use space the table will receive many writes and updates. # On postgresql for speed up reasons rows are not directly deleted, but # marked for deletion and eventually deleted by an auto vacuum process. # Because of the nested complexity of this query it may happen the # computational complexity of the query explodes, resulting in massive # slowdowns. To make sure the temprunningcatalog table doesn't contain dead # rows we force a manual vacuum here. database.vacuum('temprunningcatalog') # _process_many_to_many() _flag_many_to_many_tempruncat() #+------------------------------------------------------+ #| After this, the assocs have been reduced to many-to-1| #| which are treated identical as 1-to-1, and 1-to-many.| #+------------------------------------------------------+ # _process_many_to_1() => process_1_to_1() #+------------------------------------------------------+ #| Here we process the one-to-many associations. | #+------------------------------------------------------+ try: _insert_1_to_many_runcat() except IntegrityError as e: logger.error("Error caught around _insert_1_to_many_runcat - " "possible 'IntegrityError'. See Issue #4778. Will now re-raise.") raise e _flag_1_to_many_inactive_runcat() _insert_1_to_many_runcat_flux() _delete_1_to_many_inactive_runcat_flux() _insert_1_to_many_basepoint_assocxtrsource() _insert_1_to_many_replacement_assocxtrsource() _delete_1_to_many_inactive_assocxtrsource() _insert_1_to_many_assocskyrgn() _delete_1_to_many_inactive_assocskyrgn() _insert_1_to_many_newsource() _delete_1_to_many_inactive_newsource() _flag_1_to_many_inactive_tempruncat() #+-----------------------------------------------------+ #| Here we process the one-to-one associations | #+-----------------------------------------------------+ # _process_1_to_1() _insert_1_to_1_assoc() _update_1_to_1_runcat() n_updated_rf = _update_1_to_1_runcat_flux() # update flux in existing band if n_updated_rf: logger.debug("Updated 1-to-1 fluxes for %s sources" % n_updated_rf) n_new_rf = _insert_1_to_1_runcat_flux() # insert flux for new band if n_new_rf: logger.debug("Inserted new fluxes for %s sources" % n_new_rf) #+-------------------------------------------------------+ #| Here we take care of the extracted sources that could | #| not be associated with any runningcatalog source | #+-------------------------------------------------------+ _insert_new_runcat(image_id) _insert_new_runcat_flux(image_id) _insert_new_runcat_skyrgn_assocs(image_id) _insert_new_assocxtrsource(image_id) _determine_newsource_previous_limits(image_id, new_source_sigma_margin) _empty_temprunningcatalog() _update_ff_runcat_extractedsource() _delete_inactive_runcat() ############################################################################## # Subroutines... # Here be SQL dragons. ############################################################################## def _delete_bad_blind_extractions(image_id): """Remove blind extractions centred outside designated extract region. These occur sometimes due to highly elliptical fits on noisy data, creating a best fit centred outside the original pixel region. The source-extraction code has been modified to (probably) prevent this, but we check for them anyway. NB. We currently only delete blind extractions. We expect that occasionally forced fits to sources just inside the extraction radius might converge just outside, but these should be restricted to a very small additional margin. By not deleting these edge cases, the data allows us to construct proper lightcurves, and (I think) does not contribute to their weighted mean positions (so sources cannot 'migrate' across the border). TODO(TS): Check this. Only extractions from the specified image are checked for deletion. Returns: Number of extractedsource rows deleted. """ query = """\ DELETE FROM extractedsource WHERE image = %(imgid)s AND id IN (SELECT badid FROM (SELECT ex0.id as badid ,SQRT( ( (ex0.ra - sky.centre_ra)* COS(RADIANS(sky.centre_decl)) *(ex0.ra - sky.centre_ra)* COS(RADIANS(sky.centre_decl)) + (ex0.decl - sky.centre_decl) * (ex0.decl - sky.centre_decl)) ) as distance ,sky.xtr_radius as xtr_radius FROM extractedsource ex0 ,image im ,skyregion sky WHERE im.id = %(imgid)s AND ex0.image = im.id AND ex0.extract_type = 0 AND im.skyrgn = sky.id ) t1 WHERE t1.distance > t1.xtr_radius ) """ qry_params = {'imgid':image_id} cursor = tkp.db.execute(query, qry_params, commit=True) n_deleted = cursor.rowcount if n_deleted: logger.warn("Removed %s bad blind extractions for image %s" "(centred outside extraction region)", n_deleted, image_id) return n_deleted def _empty_temprunningcatalog(): """Initialize the temporary storage table Initialize the temporary table temprunningcatalog which contains the current observed sources. """ query = "DELETE FROM temprunningcatalog" tkp.db.execute(query, commit=True) def _check_meridian_wrap(image_id): """ Checks whether an image is close to the meridian ra = 0 or ra = 360 When so, the association query needs to be rewritten to take into account sources across the 0/360 meridian. The query returns: q_across: true, if the extraction region of the image crosses the ra=0/360 border ra_min: the min value of the ra-between for the normal case, when the image is outside the ra=0/360 meridian, otherwise NULL ra_max: the max value of the ra-between for the normal case, when the image is outside the ra=0/360 meridian, otherwise NULL ra_min1/max1 and ra_min2/max2 are the values which may be used for the case of a cross-meridian image. F.ex. using a search radius of 5 degrees, and when a source is at 359.99 the ra-betweens 1 and 2 are : ... AND (ra BETWEEN ra_min1 AND ra_max1 OR ra BETWEEN ra_min2 AND ra_max2) ... ... AND (ra BETWEEN 354.99 AND 360 OR ra BETWEEN 0 AND 4.99) ... ra_min1: the min value of the high-end ra-between, if the extraction region of the image crosses the ra=0/360 border, otherwise NULL ra_max1: the min value of the high-end ra-between, if the extraction region of the image crosses the ra=0/360 border, otherwise NULL ra_min2, ra_max2: As ra_min1/max1, but for the low-end ra values. These values are not being used in the cross-meridian association query, but are merely reported to notice the search area. The cross-meridian association query uses the cartesian dot product, to get the search area. """ meridian_wrap_query = """\ SELECT CASE WHEN s.centre_ra - alpha(s.xtr_radius, s.centre_decl) < 0 OR s.centre_ra + alpha(s.xtr_radius, s.centre_decl) > 360 THEN TRUE ELSE FALSE END AS q_across ,CASE WHEN s.centre_ra - alpha(s.xtr_radius, s.centre_decl) > 0 AND s.centre_ra + alpha(s.xtr_radius, s.centre_decl) < 360 THEN s.centre_ra - alpha(s.xtr_radius, s.centre_decl) ELSE NULL END AS ra_min ,CASE WHEN s.centre_ra - alpha(s.xtr_radius, s.centre_decl) > 0 AND s.centre_ra + alpha(s.xtr_radius, s.centre_decl) < 360 THEN s.centre_ra + alpha(s.xtr_radius, s.centre_decl) ELSE NULL END AS ra_max ,CASE WHEN s.centre_ra - alpha(s.xtr_radius, s.centre_decl) < 0 THEN s.centre_ra - alpha(s.xtr_radius, s.centre_decl) + 360.0 ELSE CASE WHEN s.centre_ra + alpha(s.xtr_radius, s.centre_decl) > 360 THEN s.centre_ra - alpha(s.xtr_radius, s.centre_decl) ELSE NULL END END AS ra_min1 ,CASE WHEN s.centre_ra - alpha(s.xtr_radius, s.centre_decl) < 0 OR s.centre_ra + alpha(s.xtr_radius, s.centre_decl) > 360 THEN 360 ELSE NULL END AS ra_max1 ,CASE WHEN s.centre_ra - alpha(s.xtr_radius, s.centre_decl) < 0 OR s.centre_ra + alpha(s.xtr_radius, s.centre_decl) > 360 THEN 0 ELSE NULL END AS ra_min2 ,CASE WHEN s.centre_ra - alpha(s.xtr_radius, s.centre_decl) < 0 THEN s.centre_ra + alpha(s.xtr_radius, s.centre_decl) ELSE CASE WHEN s.centre_ra + alpha(s.xtr_radius, s.centre_decl) > 360 THEN s.centre_ra + alpha(s.xtr_radius, s.centre_decl) - 360 ELSE NULL END END AS ra_max2 FROM image i ,skyregion s WHERE i.skyrgn = s.id AND i.id = %(image_id)s """ args = {'image_id': image_id} cursor = tkp.db.execute(meridian_wrap_query, args, commit=True) results = zip(*cursor.fetchall()) if len(results) != 0: q_across = results[0] ra_min = results[1] ra_max = results[2] ra_min1 = results[3] ra_max1 = results[4] ra_min2 = results[5] ra_max2 = results[6] if len(q_across) != 1: raise ValueError("More than one FoVs for image '%s'" % image_id) else: raise ValueError("No FoV information present for image '%s'" % image_id) return { 'q_across': q_across[0], 'ra_min': ra_min[0], 'ra_max': ra_max[0], 'ra_min1': ra_min1[0], 'ra_max1': ra_max1[0], 'ra_min2': ra_min2[0], 'ra_max2': ra_max2[0] } def _insert_temprunningcatalog(image_id, deRuiter_r, beamwidths_limit, meridian_wrap): """Select matched sources Here we select the extractedsource that have a positional match with the sources in the running catalogue table (runningcatalog). Those sources which *do* have a potential match, will be inserted into the temporary running catalogue table (temprunningcatalog). See also: http://docs.transientskp.org/tkp/database/schema.html#temprunningcatalog Explanation of some column name prefixes/suffixes used in the SQL query: - avg_X := average of X - avg_X_sq := average of X^2 - avg_weight_X := average of weight of X, i.e. mean( 1/error^2 ) - avg_weighted_X := average of weighted X, i.e. mean(X/error^2) - avg_weighted_X_sq := average of weighted X^2, i.e. mean(X^2/error^2) This result set might contain multiple associations (1-n,n-1) for a single known source in runningcatalog. The n-1 assocs will be treated similar as n 1-1 assocs. NOTE: Beware of the extra condition on x0.image in the WHERE clause, preventing the query to grow exponentially in response time """ # The cross-meridian differs slightly from the normal association query. # # We removed the wm_ra between statement, because the dot-product of the # cartesian coordinates will handle the distance checking in case of # meridian wrapping. # # The RA values for sources with 270 < wm_ra < 90 are translated to the # opposite site of the sphere, where we can easily work with the modulo # values to calculate the ra position (but this is of course translated # back) and de Ruiter radius. # # Note that a weighted mean RA in the range [-8e-14, 0) is snapped to # zero. This accounts for dynamic range issues with doubles: if we end up # with a tiny sub-zero RA and add 360 to it, we end up with 360 rather # than 359.999..., but, of course, we don't regard an RA of 360 as # meaningful. q_across_ra0 = """\ INSERT INTO temprunningcatalog (runcat ,xtrsrc ,distance_arcsec ,r ,dataset ,band ,stokes ,datapoints ,zone ,wm_ra ,wm_decl ,wm_uncertainty_ew ,wm_uncertainty_ns ,avg_ra_err ,avg_decl_err ,avg_wra ,avg_wdecl ,avg_weight_ra ,avg_weight_decl ,x ,y ,z ,f_datapoints ,avg_f_peak ,avg_f_peak_sq ,avg_f_peak_weight ,avg_weighted_f_peak ,avg_weighted_f_peak_sq ,avg_f_int ,avg_f_int_sq ,avg_f_int_weight ,avg_weighted_f_int ,avg_weighted_f_int_sq ) SELECT t0.runcat ,t0.xtrsrc ,t0.distance_arcsec ,t0.r ,t0.dataset ,t0.band ,t0.stokes ,t0.datapoints ,CAST(FLOOR(t0.wm_decl) AS INTEGER) AS zone ,CASE WHEN t0.wm_ra < 0 THEN CASE WHEN ABS(t0.wm_ra) > 8e-14 THEN t0.wm_ra + 360 ELSE 0.0 END ELSE t0.wm_ra END AS wm_ra ,t0.wm_decl ,t0.wm_uncertainty_ew ,t0.wm_uncertainty_ns ,t0.avg_ra_err ,t0.avg_decl_err ,t0.avg_wra ,t0.avg_wdecl ,t0.avg_weight_ra ,t0.avg_weight_decl ,COS(RADIANS(t0.wm_decl)) * COS(RADIANS(t0.wm_ra)) AS x ,COS(RADIANS(t0.wm_decl)) * SIN(RADIANS(t0.wm_ra)) AS y ,SIN(RADIANS(t0.wm_decl)) AS z ,CASE WHEN rf0.f_datapoints IS NULL THEN 1 ELSE rf0.f_datapoints + 1 END AS f_datapoints ,CASE WHEN rf0.f_datapoints IS NULL THEN t0.f_peak ELSE (rf0.f_datapoints * rf0.avg_f_peak + t0.f_peak) / (rf0.f_datapoints + 1) END AS avg_f_peak ,CASE WHEN rf0.f_datapoints IS NULL THEN t0.f_peak * t0.f_peak ELSE (rf0.f_datapoints * rf0.avg_f_peak_sq + t0.f_peak * t0.f_peak) / (rf0.f_datapoints + 1) END AS avg_f_peak_sq ,CASE WHEN rf0.f_datapoints IS NULL THEN 1 / (t0.f_peak_err * t0.f_peak_err) ELSE (rf0.f_datapoints * rf0.avg_f_peak_weight + 1 / (t0.f_peak_err * t0.f_peak_err)) / (rf0.f_datapoints + 1) END AS avg_f_peak_weight ,CASE WHEN rf0.f_datapoints IS NULL THEN t0.f_peak / (t0.f_peak_err * t0.f_peak_err) ELSE (rf0.f_datapoints * rf0.avg_weighted_f_peak + t0.f_peak / (t0.f_peak_err * t0.f_peak_err)) / (rf0.f_datapoints + 1) END AS avg_weighted_f_peak ,CASE WHEN rf0.f_datapoints IS NULL THEN t0.f_peak * t0.f_peak / (t0.f_peak_err * t0.f_peak_err) ELSE (rf0.f_datapoints * rf0.avg_weighted_f_peak_sq + (t0.f_peak * t0.f_peak) / (t0.f_peak_err * t0.f_peak_err)) / (rf0.f_datapoints + 1) END AS avg_weighted_f_peak_sq ,CASE WHEN rf0.f_datapoints IS NULL THEN t0.f_int ELSE (rf0.f_datapoints * rf0.avg_f_int + t0.f_int) / (rf0.f_datapoints + 1) END AS avg_f_int ,CASE WHEN rf0.f_datapoints IS NULL THEN t0.f_int * t0.f_int ELSE (rf0.f_datapoints * rf0.avg_f_int_sq + t0.f_int * t0.f_int) / (rf0.f_datapoints + 1) END AS avg_f_int_sq ,CASE WHEN rf0.f_datapoints IS NULL THEN 1 / (t0.f_int_err * t0.f_int_err) ELSE (rf0.f_datapoints * rf0.avg_f_int_weight + 1 / (t0.f_int_err * t0.f_int_err)) / (rf0.f_datapoints + 1) END AS avg_f_int_weight ,CASE WHEN rf0.f_datapoints IS NULL THEN t0.f_int / (t0.f_int_err * t0.f_int_err) ELSE (rf0.f_datapoints * rf0.avg_weighted_f_int + t0.f_int / (t0.f_int_err * t0.f_int_err)) / (rf0.f_datapoints + 1) END AS avg_weighted_f_int ,CASE WHEN rf0.f_datapoints IS NULL THEN t0.f_int * t0.f_int / (t0.f_int_err * t0.f_int_err) ELSE (rf0.f_datapoints * rf0.avg_weighted_f_int_sq + (t0.f_int * t0.f_int) / (t0.f_int_err * t0.f_int_err)) / (rf0.f_datapoints + 1) END AS avg_weighted_f_int_sq FROM (SELECT rc0.id as runcat ,x0.id as xtrsrc ,3600 * DEGREES(2 * ASIN(SQRT( (rc0.x - x0.x) * (rc0.x - x0.x) + (rc0.y - x0.y) * (rc0.y - x0.y) + (rc0.z - x0.z) * (rc0.z - x0.z) ) / 2) ) AS distance_arcsec ,CASE WHEN rc0.wm_ra < 90 OR rc0.wm_ra > 270 THEN SQRT( (MOD(CAST(rc0.wm_ra + 180 AS NUMERIC(11,8)), 360) - MOD(CAST(x0.ra + 180 AS NUMERIC(11,8)), 360)) * COS(RADIANS((rc0.wm_decl + x0.decl)/2)) * (MOD(CAST(rc0.wm_ra + 180 AS NUMERIC(11,8)), 360) - MOD(CAST(x0.ra + 180 AS NUMERIC(11,8)), 360)) * COS(RADIANS((rc0.wm_decl + x0.decl)/2)) / (rc0.wm_uncertainty_ew * rc0.wm_uncertainty_ew + x0.uncertainty_ew * x0.uncertainty_ew) + (rc0.wm_decl - x0.decl) * (rc0.wm_decl - x0.decl) / (rc0.wm_uncertainty_ns * rc0.wm_uncertainty_ns + x0.uncertainty_ns * x0.uncertainty_ns) ) ELSE SQRT( (rc0.wm_ra - x0.ra) * COS(RADIANS((rc0.wm_decl + x0.decl)/2)) * (rc0.wm_ra - x0.ra) * COS(RADIANS((rc0.wm_decl + x0.decl)/2)) / (rc0.wm_uncertainty_ew * rc0.wm_uncertainty_ew + x0.uncertainty_ew * x0.uncertainty_ew) + (rc0.wm_decl - x0.decl) * (rc0.wm_decl - x0.decl) / (rc0.wm_uncertainty_ns * rc0.wm_uncertainty_ns + x0.uncertainty_ns * x0.uncertainty_ns) ) END AS r ,x0.f_peak ,x0.f_peak_err ,x0.f_int ,x0.f_int_err ,i0.dataset ,i0.band ,i0.stokes ,rc0.datapoints + 1 AS datapoints ,CASE WHEN rc0.wm_ra < 90 OR rc0.wm_ra > 270 THEN (datapoints * rc0.avg_weight_ra * MOD(CAST(rc0.wm_ra + 180 AS NUMERIC(11,8)), 360) + MOD(CAST(x0.ra + 180 AS NUMERIC(11,8)), 360) / (x0.uncertainty_ew * x0.uncertainty_ew) ) / (datapoints * rc0.avg_weight_ra + 1 / (x0.uncertainty_ew * x0.uncertainty_ew) ) - 180 ELSE (datapoints * rc0.avg_wra + x0.ra /(x0.uncertainty_ew * x0.uncertainty_ew) ) / (datapoints * rc0.avg_weight_ra + 1 / (x0.uncertainty_ew * x0.uncertainty_ew) ) END AS wm_ra ,(datapoints * rc0.avg_weight_decl * rc0.wm_decl + x0.decl / (x0.uncertainty_ns * x0.uncertainty_ns)) / (datapoints * rc0.avg_weight_decl + 1 / (x0.uncertainty_ns * x0.uncertainty_ns)) AS wm_decl ,SQRT(1 / ((datapoints + 1) * ((datapoints * rc0.avg_weight_ra + 1 / (x0.uncertainty_ew * x0.uncertainty_ew)) / (datapoints + 1)) ) ) AS wm_uncertainty_ew ,SQRT(1 / ((datapoints + 1) * ((datapoints * rc0.avg_weight_decl + 1 / (x0.uncertainty_ns * x0.uncertainty_ns)) / (datapoints + 1)) ) ) AS wm_uncertainty_ns ,(datapoints * rc0.avg_ra_err + x0.ra_err) / (datapoints + 1) AS avg_ra_err ,(datapoints * rc0.avg_decl_err + x0.decl_err) / (datapoints + 1) AS avg_decl_err ,CASE WHEN rc0.wm_ra < 90 OR rc0.wm_ra > 270 THEN ((datapoints * rc0.avg_weight_ra * MOD(CAST(rc0.wm_ra + 180 AS NUMERIC(11,8)), 360) + MOD(CAST(x0.ra + 180 AS NUMERIC(11,8)), 360) / (x0.uncertainty_ew * x0.uncertainty_ew) - datapoints * avg_weight_ra * 180 - 180 / (x0.uncertainty_ew * x0.uncertainty_ew)) / (datapoints + 1)) - 360 * (datapoints * rc0.avg_weight_ra + 1 / (x0.uncertainty_ew * x0.uncertainty_ew)) / (datapoints + 1) * FLOOR( ((datapoints * avg_weight_ra * MOD(CAST(rc0.wm_ra + 180 AS NUMERIC(11,8)), 360) + MOD(CAST(x0.ra + 180 AS NUMERIC(11,8)), 360) / (x0.uncertainty_ew * x0.uncertainty_ew) - datapoints * avg_weight_ra * 180 - 180 / (x0.uncertainty_ew * x0.uncertainty_ew)) / (datapoints + 1)) / (360 * (datapoints * rc0.avg_weight_ra + 1 / (x0.uncertainty_ew * x0.uncertainty_ew)) / (datapoints + 1)) ) ELSE (datapoints * rc0.avg_wra + x0.ra / (x0.uncertainty_ew * x0.uncertainty_ew)) / (datapoints + 1) END AS avg_wra ,(datapoints * rc0.avg_wdecl + x0.decl / (x0.uncertainty_ns * x0.uncertainty_ns)) / (datapoints + 1) AS avg_wdecl ,(datapoints * rc0.avg_weight_ra + 1 / (x0.uncertainty_ew * x0.uncertainty_ew)) / (datapoints + 1) AS avg_weight_ra ,(datapoints * rc0.avg_weight_decl + 1 / (x0.uncertainty_ns * x0.uncertainty_ns)) / (datapoints + 1) AS avg_weight_decl FROM extractedsource x0 ,runningcatalog rc0 ,image i0 WHERE i0.id = %(image_id)s AND x0.image = i0.id AND x0.image = %(image_id)s AND i0.dataset = rc0.dataset AND rc0.mon_src = FALSE AND rc0.zone BETWEEN CAST(FLOOR(x0.decl - %(beamwidths_limit)s * i0.rb_smaj) as INTEGER) AND CAST(FLOOR(x0.decl + %(beamwidths_limit)s * i0.rb_smaj) as INTEGER) AND rc0.wm_decl BETWEEN x0.decl - %(beamwidths_limit)s * i0.rb_smaj AND x0.decl + %(beamwidths_limit)s * i0.rb_smaj AND rc0.x*x0.x + rc0.y*x0.y + rc0.z*x0.z > cos(radians(%(beamwidths_limit)s * i0.rb_smaj)) AND CASE WHEN rc0.wm_ra < 90 OR rc0.wm_ra > 270 THEN SQRT( (MOD(CAST(rc0.wm_ra + 180 AS NUMERIC(11,8)), 360) - MOD(CAST(x0.ra + 180 AS NUMERIC(11,8)), 360)) * COS(RADIANS((rc0.wm_decl + x0.decl)/2)) * (MOD(CAST(rc0.wm_ra + 180 AS NUMERIC(11,8)), 360) - MOD(CAST(x0.ra + 180 AS NUMERIC(11,8)), 360)) * COS(RADIANS((rc0.wm_decl + x0.decl)/2)) / (x0.uncertainty_ew * x0.uncertainty_ew + rc0.wm_uncertainty_ew * rc0.wm_uncertainty_ew) + (x0.decl - rc0.wm_decl) * (x0.decl - rc0.wm_decl) / (x0.uncertainty_ns * x0.uncertainty_ns + rc0.wm_uncertainty_ns * rc0.wm_uncertainty_ns) ) ELSE SQRT( (rc0.wm_ra - x0.ra) * COS(RADIANS((rc0.wm_decl + x0.decl)/2)) * (rc0.wm_ra - x0.ra) * COS(RADIANS((rc0.wm_decl + x0.decl)/2)) / (x0.uncertainty_ew * x0.uncertainty_ew + rc0.wm_uncertainty_ew * rc0.wm_uncertainty_ew) + (x0.decl - rc0.wm_decl) * (x0.decl - rc0.wm_decl) / (x0.uncertainty_ns * x0.uncertainty_ns + rc0.wm_uncertainty_ns * rc0.wm_uncertainty_ns) ) END < %(deRuiter)s ) t0 LEFT OUTER JOIN runningcatalog_flux rf0 ON t0.runcat = rf0.runcat AND t0.band = rf0.band AND t0.stokes = rf0.stokes """ query = """\ INSERT INTO temprunningcatalog (runcat ,xtrsrc ,distance_arcsec ,r ,dataset ,band ,stokes ,datapoints ,zone ,wm_ra ,wm_decl ,wm_uncertainty_ew ,wm_uncertainty_ns ,avg_ra_err ,avg_decl_err ,avg_wra ,avg_wdecl ,avg_weight_ra ,avg_weight_decl ,x ,y ,z ,f_datapoints ,avg_f_peak ,avg_f_peak_sq ,avg_f_peak_weight ,avg_weighted_f_peak ,avg_weighted_f_peak_sq ,avg_f_int ,avg_f_int_sq ,avg_f_int_weight ,avg_weighted_f_int ,avg_weighted_f_int_sq ) SELECT t0.runcat ,t0.xtrsrc ,t0.distance_arcsec ,t0.r ,t0.dataset ,t0.band ,t0.stokes ,t0.datapoints ,CAST(FLOOR(t0.wm_decl) AS INTEGER) AS zone ,t0.wm_ra ,t0.wm_decl ,t0.wm_uncertainty_ew ,t0.wm_uncertainty_ns ,t0.avg_ra_err ,t0.avg_decl_err ,t0.avg_wra ,t0.avg_wdecl ,t0.avg_weight_ra ,t0.avg_weight_decl ,COS(RADIANS(t0.wm_decl)) * COS(RADIANS(t0.wm_ra)) AS x ,COS(RADIANS(t0.wm_decl)) * SIN(RADIANS(t0.wm_ra)) AS y ,SIN(RADIANS(t0.wm_decl)) AS z ,CASE WHEN rf0.f_datapoints IS NULL THEN 1 ELSE rf0.f_datapoints + 1 END AS f_datapoints ,CASE WHEN rf0.f_datapoints IS NULL THEN t0.f_peak ELSE (rf0.f_datapoints * rf0.avg_f_peak + t0.f_peak) / (rf0.f_datapoints + 1) END AS avg_f_peak ,CASE WHEN rf0.f_datapoints IS NULL THEN t0.f_peak * t0.f_peak ELSE (rf0.f_datapoints * rf0.avg_f_peak_sq + t0.f_peak * t0.f_peak) / (rf0.f_datapoints + 1) END AS avg_f_peak_sq ,CASE WHEN rf0.f_datapoints IS NULL THEN 1 / (t0.f_peak_err * t0.f_peak_err) ELSE (rf0.f_datapoints * rf0.avg_f_peak_weight + 1 / (t0.f_peak_err * t0.f_peak_err)) / (rf0.f_datapoints + 1) END AS avg_f_peak_weight ,CASE WHEN rf0.f_datapoints IS NULL THEN t0.f_peak / (t0.f_peak_err * t0.f_peak_err) ELSE (rf0.f_datapoints * rf0.avg_weighted_f_peak + t0.f_peak / (t0.f_peak_err * t0.f_peak_err)) / (rf0.f_datapoints + 1) END AS avg_weighted_f_peak ,CASE WHEN rf0.f_datapoints IS NULL THEN t0.f_peak * t0.f_peak / (t0.f_peak_err * t0.f_peak_err) ELSE (rf0.f_datapoints * rf0.avg_weighted_f_peak_sq + (t0.f_peak * t0.f_peak) / (t0.f_peak_err * t0.f_peak_err)) / (rf0.f_datapoints + 1) END AS avg_weighted_f_peak_sq ,CASE WHEN rf0.f_datapoints IS NULL THEN t0.f_int ELSE (rf0.f_datapoints * rf0.avg_f_int + t0.f_int) / (rf0.f_datapoints + 1) END AS avg_f_int ,CASE WHEN rf0.f_datapoints IS NULL THEN t0.f_int * t0.f_int ELSE (rf0.f_datapoints * rf0.avg_f_int_sq + t0.f_int * t0.f_int) / (rf0.f_datapoints + 1) END AS avg_f_int_sq ,CASE WHEN rf0.f_datapoints IS NULL THEN 1 / (t0.f_int_err * t0.f_int_err) ELSE (rf0.f_datapoints * rf0.avg_f_int_weight + 1 / (t0.f_int_err * t0.f_int_err)) / (rf0.f_datapoints + 1) END AS avg_f_int_weight ,CASE WHEN rf0.f_datapoints IS NULL THEN t0.f_int / (t0.f_int_err * t0.f_int_err) ELSE (rf0.f_datapoints * rf0.avg_weighted_f_int + t0.f_int / (t0.f_int_err * t0.f_int_err)) / (rf0.f_datapoints + 1) END AS avg_weighted_f_int ,CASE WHEN rf0.f_datapoints IS NULL THEN t0.f_int * t0.f_int / (t0.f_int_err * t0.f_int_err) ELSE (rf0.f_datapoints * rf0.avg_weighted_f_int_sq + (t0.f_int * t0.f_int) / (t0.f_int_err * t0.f_int_err)) / (rf0.f_datapoints + 1) END AS avg_weighted_f_int_sq FROM (SELECT rc0.id as runcat ,x0.id as xtrsrc ,3600 * DEGREES(2 * ASIN(SQRT( (rc0.x - x0.x) * (rc0.x - x0.x) + (rc0.y - x0.y) * (rc0.y - x0.y) + (rc0.z - x0.z) * (rc0.z - x0.z) ) / 2) ) AS distance_arcsec ,SQRT( (rc0.wm_ra - x0.ra) * COS(RADIANS((rc0.wm_decl + x0.decl)/2)) * (rc0.wm_ra - x0.ra) * COS(RADIANS((rc0.wm_decl + x0.decl)/2)) / (rc0.wm_uncertainty_ew * rc0.wm_uncertainty_ew + x0.uncertainty_ew * x0.uncertainty_ew) + (rc0.wm_decl - x0.decl) * (rc0.wm_decl - x0.decl) / (rc0.wm_uncertainty_ns * rc0.wm_uncertainty_ns + x0.uncertainty_ns * x0.uncertainty_ns) ) AS r ,x0.f_peak ,x0.f_peak_err ,x0.f_int ,x0.f_int_err ,i0.dataset ,i0.band ,i0.stokes ,rc0.datapoints + 1 AS datapoints ,(datapoints * rc0.avg_wra + x0.ra /(x0.uncertainty_ew * x0.uncertainty_ew) ) / (datapoints * rc0.avg_weight_ra + 1 / (x0.uncertainty_ew * x0.uncertainty_ew) ) AS wm_ra ,(datapoints * rc0.avg_wdecl + x0.decl /(x0.uncertainty_ns * x0.uncertainty_ns)) / (datapoints * rc0.avg_weight_decl + 1 /(x0.uncertainty_ns * x0.uncertainty_ns)) AS wm_decl , SQRT(1 / ((datapoints + 1) * ((datapoints * rc0.avg_weight_ra + 1 / (x0.uncertainty_ew * x0.uncertainty_ew)) / (datapoints + 1) ) ) ) AS wm_uncertainty_ew , SQRT(1 / ((datapoints + 1) * ((datapoints * rc0.avg_weight_decl + 1 / (x0.uncertainty_ns * x0.uncertainty_ns)) / (datapoints + 1) ) ) ) AS wm_uncertainty_ns ,(datapoints * rc0.avg_ra_err + x0.ra_err) / (datapoints + 1) AS avg_ra_err ,(datapoints * rc0.avg_decl_err + x0.decl_err) / (datapoints + 1) AS avg_decl_err ,(datapoints * rc0.avg_wra + x0.ra / (x0.uncertainty_ew * x0.uncertainty_ew)) / (datapoints + 1) AS avg_wra ,(datapoints * rc0.avg_wdecl + x0.decl / (x0.uncertainty_ns * x0.uncertainty_ns)) / (datapoints + 1) AS avg_wdecl ,(datapoints * rc0.avg_weight_ra + 1 / (x0.uncertainty_ew * x0.uncertainty_ew)) / (datapoints + 1) AS avg_weight_ra ,(datapoints * rc0.avg_weight_decl + 1 / (x0.uncertainty_ns * x0.uncertainty_ns)) / (datapoints + 1) AS avg_weight_decl FROM extractedsource x0 ,runningcatalog rc0 ,image i0 WHERE i0.id = %(image_id)s AND x0.image = i0.id AND x0.image = %(image_id)s AND i0.dataset = rc0.dataset AND rc0.mon_src = FALSE AND rc0.zone BETWEEN CAST(FLOOR(x0.decl - %(beamwidths_limit)s * i0.rb_smaj) AS INTEGER) AND CAST(FLOOR(x0.decl + %(beamwidths_limit)s * i0.rb_smaj) AS INTEGER) AND rc0.wm_decl BETWEEN x0.decl - %(beamwidths_limit)s * i0.rb_smaj AND x0.decl + %(beamwidths_limit)s * i0.rb_smaj AND rc0.wm_ra BETWEEN x0.ra - alpha(%(beamwidths_limit)s * i0.rb_smaj, x0.decl) AND x0.ra + alpha(%(beamwidths_limit)s * i0.rb_smaj, x0.decl) AND rc0.x * x0.x + rc0.y * x0.y + rc0.z * x0.z > COS(RADIANS(%(beamwidths_limit)s * i0.rb_smaj)) AND SQRT( (rc0.wm_ra - x0.ra) * COS(RADIANS((rc0.wm_decl + x0.decl)/2)) * (rc0.wm_ra - x0.ra) * COS(RADIANS((rc0.wm_decl + x0.decl)/2)) / (x0.uncertainty_ew * x0.uncertainty_ew + rc0.wm_uncertainty_ew * rc0.wm_uncertainty_ew) + (x0.decl - rc0.wm_decl) * (x0.decl - rc0.wm_decl) / (x0.uncertainty_ns * x0.uncertainty_ns + rc0.wm_uncertainty_ns * rc0.wm_uncertainty_ns) ) < %(deRuiter)s ) t0 LEFT OUTER JOIN runningcatalog_flux rf0 ON t0.runcat = rf0.runcat AND t0.band = rf0.band AND t0.stokes = rf0.stokes """ #mw = _check_meridian_wrap(conn, image_id) if meridian_wrap['q_across'] == True: logger.debug("Search across 0/360 meridian: %s" % meridian_wrap) query = q_across_ra0 args = {'image_id': image_id, 'deRuiter': deRuiter_r, 'beamwidths_limit' : beamwidths_limit} tkp.db.execute(query, args, commit=True) def _flag_many_to_many_tempruncat(): """Select the many-to-many association pairs in temprunningcatalog. By flagging the many-to-many associations, we reduce the processing to one-to-many and many-to-one (identical to one-to-one) relationships """ # This one selects the farthest out of the many-to-many assocs query = """\ UPDATE temprunningcatalog SET inactive = TRUE WHERE EXISTS (SELECT runcat ,xtrsrc FROM (SELECT t1.runcat ,t1.xtrsrc FROM (SELECT xtrsrc ,MIN(r) as min_r FROM temprunningcatalog WHERE runcat IN (SELECT runcat FROM temprunningcatalog WHERE runcat IN (SELECT runcat FROM temprunningcatalog WHERE xtrsrc IN (SELECT xtrsrc FROM temprunningcatalog GROUP BY xtrsrc HAVING COUNT(*) > 1 ) ) GROUP BY runcat HAVING COUNT(*) > 1 ) AND xtrsrc IN (SELECT xtrsrc FROM temprunningcatalog GROUP BY xtrsrc HAVING COUNT(*) > 1 ) GROUP BY xtrsrc ) t0 ,(SELECT runcat ,xtrsrc ,r FROM temprunningcatalog WHERE runcat IN (SELECT runcat FROM temprunningcatalog WHERE runcat IN (SELECT runcat FROM temprunningcatalog WHERE xtrsrc IN (SELECT xtrsrc FROM temprunningcatalog GROUP BY xtrsrc HAVING COUNT(*) > 1 ) ) GROUP BY runcat HAVING COUNT(*) > 1 ) AND xtrsrc IN (SELECT xtrsrc FROM temprunningcatalog GROUP BY xtrsrc HAVING COUNT(*) > 1 ) ) t1 WHERE t0.xtrsrc = t1.xtrsrc AND t0.min_r < t1.r ) t2 WHERE t2.runcat = temprunningcatalog.runcat AND t2.xtrsrc = temprunningcatalog.xtrsrc ) """ tkp.db.execute(query, commit=True) def _insert_1_to_many_runcat(): """Insert the extracted sources that belong to one-to-many associations in the runningcatalog. Since for the one-to-many associations (i.e. one runcat source associated with multiple extracted sources) we cannot a priori decide which counterpart pair is the correct one, or whether all are correct (in the case of a higher-resolution image), all extracted sources are added as a new source to the runningcatalog, and they will replace the (old; lower resolution) runcat source of the association. As a consequence of this, the resolution of the runningcatalog is increasing over time. """ query = """\ INSERT INTO runningcatalog (xtrsrc ,dataset ,datapoints ,zone ,wm_ra ,wm_decl ,wm_uncertainty_ew ,wm_uncertainty_ns ,avg_ra_err ,avg_decl_err ,avg_wra ,avg_wdecl ,avg_weight_ra ,avg_weight_decl ,x ,y ,z ) SELECT xtrsrc ,dataset ,datapoints ,zone ,wm_ra ,wm_decl ,wm_uncertainty_ew ,wm_uncertainty_ns ,avg_ra_err ,avg_decl_err ,avg_wra ,avg_wdecl ,avg_weight_ra ,avg_weight_decl ,x ,y ,z FROM (SELECT runcat FROM temprunningcatalog WHERE inactive = FALSE GROUP BY runcat HAVING COUNT(*) > 1 ) one_to_many ,temprunningcatalog tmprc WHERE tmprc.runcat = one_to_many.runcat AND tmprc.inactive = FALSE """ tkp.db.execute(query, commit=True) def _insert_1_to_many_runcat_flux(): """Insert the fluxes of the extracted sources that belong to a one-to-many association in the runningcatalog. Analogous to the runningcatalog, extracted source properties are added to the runningcatalog_flux table. """ # NB we pull the new runcat id from the runningcatalog by matching with # temprunningcatalog via xtrsrc. (temprunningcatalog.runcat points at old # runcat entries). query = """\ INSERT INTO runningcatalog_flux (runcat ,band ,stokes ,f_datapoints ,avg_f_peak ,avg_f_peak_sq ,avg_f_peak_weight ,avg_weighted_f_peak ,avg_weighted_f_peak_sq ,avg_f_int ,avg_f_int_sq ,avg_f_int_weight ,avg_weighted_f_int ,avg_weighted_f_int_sq ) SELECT r.id ,tmprc.band ,tmprc.stokes ,tmprc.f_datapoints ,avg_f_peak ,avg_f_peak_sq ,avg_f_peak_weight ,avg_weighted_f_peak ,avg_weighted_f_peak_sq ,avg_f_int ,avg_f_int_sq ,avg_f_int_weight ,avg_weighted_f_int ,avg_weighted_f_int_sq FROM (SELECT runcat FROM temprunningcatalog WHERE inactive = FALSE GROUP BY runcat HAVING COUNT(*) > 1 ) one_to_many ,temprunningcatalog tmprc ,runningcatalog r WHERE tmprc.runcat = one_to_many.runcat AND tmprc.inactive = FALSE AND r.xtrsrc = tmprc.xtrsrc """ tkp.db.execute(query, commit=True) def _insert_1_to_many_basepoint_assocxtrsource(): """Insert 'base points' for one-to-many associations Before continuing, we have to insert the 'base points' of the associations, i.e. the links between the new runningcatalog entries and their associated (new) extractedsources. We also calculate the variability indices at the timestamp of the the current image. """ # NB we pull the new runcat id from the runningcatalog by matching with # temprunningcatalog via xtrsrc. (temprunningcatalog.runcat points at old # runcat entries). query = """\ INSERT INTO assocxtrsource (runcat ,xtrsrc ,type ,distance_arcsec ,r ,v_int ,eta_int ,f_datapoints ) SELECT t0.new_runcat_id ,t0.xtrsrc ,2 ,t0.distance_arcsec ,t0.r ,t0.v_int_inter / t0.avg_f_int ,t0.eta_int_inter / t0.avg_f_int_weight ,t0.f_datapoints FROM (SELECT runcat.id AS new_runcat_id ,tmprc.xtrsrc ,tmprc.distance_arcsec ,tmprc.r ,tmprc.f_datapoints ,CASE WHEN tmprc.avg_f_int = 0.0 THEN 0.000001 ELSE avg_f_int END AS avg_f_int ,tmprc.avg_f_int_weight ,CASE WHEN tmprc.f_datapoints = 1 THEN 0 ELSE CASE WHEN ABS(tmprc.avg_f_int_sq - tmprc.avg_f_int * tmprc.avg_f_int) < 8e-14 THEN 0 ELSE SQRT(CAST(tmprc.f_datapoints AS DOUBLE PRECISION) * (tmprc.avg_f_int_sq - tmprc.avg_f_int * tmprc.avg_f_int) / (CAST(tmprc.f_datapoints AS DOUBLE PRECISION) - 1.0) ) END END AS v_int_inter ,CASE WHEN tmprc.f_datapoints = 1 THEN 0 ELSE (CAST(tmprc.f_datapoints AS DOUBLE PRECISION) / (CAST(tmprc.f_datapoints AS DOUBLE PRECISION) - 1.0)) * (tmprc.avg_f_int_weight * tmprc.avg_weighted_f_int_sq - tmprc.avg_weighted_f_int * tmprc.avg_weighted_f_int) END AS eta_int_inter FROM (SELECT runcat as old_runcat_id FROM temprunningcatalog WHERE inactive = FALSE GROUP BY runcat HAVING COUNT(*) > 1 ) one_to_many ,temprunningcatalog tmprc ,runningcatalog runcat WHERE tmprc.runcat = one_to_many.old_runcat_id AND tmprc.inactive = FALSE AND runcat.xtrsrc = tmprc.xtrsrc ) t0 """ tkp.db.execute(query, commit=True) def _insert_1_to_many_replacement_assocxtrsource(): """Insert links into the association table between the new runcat entries and the old extractedsources. (New to New ('basepoint') links have been added earlier). In this case, new entries in the runningcatalog and runningcatalog_flux were already added (for every extractedsource one), which will replace the existing ones in the runningcatalog. Therefore, we have to update the references to these new ids as well. So, we will append to assocxtrsource and delete the entries from runningcatalog_flux. NOTE: 1. We do not update the distance_arcsec and r values of the pairs. TODO: 1. Why not? """ # NB we pull the new runcat id from the runningcatalog by matching with # temprunningcatalog via xtrsrc. (temprunningcatalog.runcat points at old # runcat entries). query = """\ INSERT INTO assocxtrsource (runcat ,xtrsrc ,type ,distance_arcsec ,r ,v_int ,eta_int ,f_datapoints ) SELECT r.id AS new_runcat_id ,a.xtrsrc ,6 ,a.distance_arcsec ,a.r ,a.v_int ,a.eta_int ,a.f_datapoints FROM (SELECT runcat as old_runcat_id FROM temprunningcatalog WHERE inactive = FALSE GROUP BY runcat HAVING COUNT(*) > 1 ) one_to_many ,temprunningcatalog tmprc ,runningcatalog r ,assocxtrsource a WHERE tmprc.runcat = one_to_many.old_runcat_id AND tmprc.inactive = FALSE AND r.xtrsrc = tmprc.xtrsrc AND a.runcat = tmprc.runcat """ tkp.db.execute(query, commit=True) def _insert_1_to_many_assocskyrgn(): """ Copy skyregion associations from old runcat entries for new one-to-many runningcatalog entries. """ # NB we pull the new runcat id from the runningcatalog by matching with # temprunningcatalog via xtrsrc. (temprunningcatalog.runcat points at old # runcat entries). query = """\ INSERT INTO assocskyrgn (runcat ,skyrgn ,distance_deg ) SELECT r.id AS new_runcat_id ,a.skyrgn ,a.distance_deg FROM (SELECT runcat as old_runcat_id FROM temprunningcatalog WHERE inactive = FALSE GROUP BY runcat HAVING COUNT(*) > 1 ) one_to_many ,temprunningcatalog tmprc ,runningcatalog r ,assocskyrgn a WHERE tmprc.runcat = one_to_many.old_runcat_id AND tmprc.inactive = FALSE AND r.xtrsrc = tmprc.xtrsrc AND a.runcat = tmprc.runcat """ tkp.db.execute(query, commit=True) def _insert_1_to_many_newsource(): """Update the runcat id for the one-to-many associations, and delete the newsource entries of the old runcat id (the new ones have been added earlier). In this case, new entries in the runningcatalog and runningcatalog_flux were already added (for every extractedsource one), which will replace the existing ones in the runningcatalog. Therefore, we have to update the references to these new ids as well. """ query = """\ INSERT INTO newsource (runcat ,trigger_xtrsrc ,newsource_type ,previous_limits_image ) SELECT r.id as new_runcat_id ,tr.trigger_xtrsrc ,tr.newsource_type ,tr.previous_limits_image FROM (SELECT runcat as old_runcat_id FROM temprunningcatalog WHERE inactive = FALSE GROUP BY runcat HAVING COUNT(*) > 1 ) one_to_many ,temprunningcatalog tmprc ,runningcatalog r ,newsource tr WHERE tmprc.runcat = one_to_many.old_runcat_id AND tmprc.inactive = FALSE AND tr.runcat = one_to_many.old_runcat_id AND r.xtrsrc = tmprc.xtrsrc """ tkp.db.execute(query, commit=True) def _delete_1_to_many_inactive_assocskyrgn(): """Delete the assocskyrgn links of the old runcat Since we replaced this runcat.id with multiple new ones, we now delete the old links. """ query = """\ DELETE FROM assocskyrgn WHERE runcat IN (SELECT runcat FROM temprunningcatalog WHERE inactive = FALSE GROUP BY runcat HAVING COUNT(*) > 1 ) """ tkp.db.execute(query, commit=True) def _delete_1_to_many_inactive_newsource(): """Delete the newsource sources of the old runcat Since we replaced this runcat.id with multiple new ones, we now delete the old one. """ query = """\ DELETE FROM newsource WHERE runcat IN (SELECT runcat FROM temprunningcatalog WHERE inactive = FALSE GROUP BY runcat HAVING COUNT(*) > 1 ) """ tkp.db.execute(query, commit=True) def _delete_1_to_many_inactive_assocxtrsource(): """Delete the association pairs of the old runcat from assocxtrsource NOTE: It might sound confusing, but those are not qualified as inactive in tempruncat (read below). Since we replaced this runcat.id with multiple new one, we first flag it as inactive, after which we delete it from the runningcatalog The subselect selects those valid "old" runcat ids (i.e., the ones that were not set to inactive for the many-to-many associations). NOTE: We do not have to flag these rows as inactive, no furthr processing depends on these in the assoc run """ #NB temprunningcatalog 'runcat' field still refers to old, #superceded runcat entries. query = """\ DELETE FROM assocxtrsource WHERE runcat IN (SELECT runcat FROM temprunningcatalog WHERE inactive = FALSE GROUP BY runcat HAVING COUNT(*) > 1 ) """ tkp.db.execute(query, commit=True) def _delete_1_to_many_inactive_runcat_flux(): """Flag the old runcat ids in the runningcatalog to inactive Since we replaced this runcat.id with multiple new one, we first flag it as inactive, after which we delete it from the runningcatalog """ query = """\ DELETE FROM runningcatalog_flux WHERE runcat IN (SELECT runcat FROM temprunningcatalog WHERE inactive = FALSE GROUP BY runcat HAVING COUNT(*) > 1 ) """ tkp.db.execute(query, commit=True) def _flag_1_to_many_inactive_runcat(): """Flag the old runcat ids in the runningcatalog to inactive We do not delete them yet, because we still need to clear up all the superseded entries in assocskyrgn, etc. """ query = """\ UPDATE runningcatalog SET inactive = TRUE WHERE id IN (SELECT runcat FROM temprunningcatalog WHERE inactive = FALSE GROUP BY runcat HAVING COUNT(*) > 1 ) """ tkp.db.execute(query, commit=True) def _flag_1_to_many_inactive_tempruncat(): """ Flag the one-to-many associations from temprunningcatalog. (Since we are done processing them, now.) We do not delete them yet- if we did, we would not be able to cross-match extractedsources to determine which sources did not have a match in temprunningcatalog ('new' sources). """ query = """\ UPDATE temprunningcatalog SET inactive = TRUE WHERE runcat IN (SELECT runcat FROM temprunningcatalog WHERE inactive = FALSE GROUP BY runcat HAVING COUNT(*) > 1 ) """ tkp.db.execute(query, commit=True) # This is the "master" 1-to-1 association query. We reuse it for associating # both null detections and monitoring list sources, tweaking the type as # appropriate. ONE_TO_ONE_ASSOC_QUERY = """\ INSERT INTO assocxtrsource (runcat ,xtrsrc ,type ,distance_arcsec ,r ,v_int ,eta_int ,f_datapoints ) SELECT t0.runcat ,t0.xtrsrc ,%(type)s ,t0.distance_arcsec ,t0.r ,t0.v_int_inter / t0.avg_f_int ,t0.eta_int_inter / t0.avg_f_int_weight ,t0.f_datapoints FROM (SELECT tmprc.runcat ,tmprc.xtrsrc ,tmprc.distance_arcsec ,tmprc.r ,tmprc.f_datapoints ,CASE WHEN tmprc.avg_f_int = 0.0 THEN 0.000001 ELSE avg_f_int END AS avg_f_int ,tmprc.avg_f_int_weight ,CASE WHEN tmprc.f_datapoints = 1 THEN 0 ELSE CASE WHEN ABS(tmprc.avg_f_int_sq - tmprc.avg_f_int * tmprc.avg_f_int) < 8e-14 THEN 0 ELSE SQRT(CAST(tmprc.f_datapoints AS DOUBLE PRECISION) * (tmprc.avg_f_int_sq - tmprc.avg_f_int * tmprc.avg_f_int) / (CAST(tmprc.f_datapoints AS DOUBLE PRECISION) - 1.0) ) END END AS v_int_inter ,CASE WHEN tmprc.f_datapoints = 1 THEN 0 ELSE (CAST(tmprc.f_datapoints AS DOUBLE PRECISION) / (CAST(tmprc.f_datapoints AS DOUBLE PRECISION) - 1.0)) * (tmprc.avg_f_int_weight * tmprc.avg_weighted_f_int_sq - tmprc.avg_weighted_f_int * tmprc.avg_weighted_f_int) END AS eta_int_inter FROM temprunningcatalog tmprc WHERE tmprc.inactive = FALSE ) t0 """ def _insert_1_to_1_assoc(): """ Insert remaining associations from temprunningcatalog into assocxtrsource. We also calculate the variability indices at the timestamp of the the current image. """ tkp.db.execute(ONE_TO_ONE_ASSOC_QUERY, {'type': 3}, commit=True) def _update_1_to_1_runcat(): """Update the running catalog with the values in temprunningcatalog""" query = """\ UPDATE runningcatalog SET datapoints = (SELECT datapoints FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog.id AND temprunningcatalog.inactive = FALSE ) ,zone = (SELECT zone FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog.id AND temprunningcatalog.inactive = FALSE ) ,wm_ra = (SELECT wm_ra FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog.id AND temprunningcatalog.inactive = FALSE ) ,wm_decl = (SELECT wm_decl FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog.id AND temprunningcatalog.inactive = FALSE ) ,avg_ra_err = (SELECT avg_ra_err FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog.id AND temprunningcatalog.inactive = FALSE ) ,avg_decl_err = (SELECT avg_decl_err FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog.id AND temprunningcatalog.inactive = FALSE ) ,wm_uncertainty_ew = (SELECT wm_uncertainty_ew FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog.id AND temprunningcatalog.inactive = FALSE ) ,wm_uncertainty_ns = (SELECT wm_uncertainty_ns FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog.id AND temprunningcatalog.inactive = FALSE ) ,avg_wra = (SELECT avg_wra FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog.id AND temprunningcatalog.inactive = FALSE ) ,avg_wdecl = (SELECT avg_wdecl FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog.id AND temprunningcatalog.inactive = FALSE ) ,avg_weight_ra = (SELECT avg_weight_ra FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog.id AND temprunningcatalog.inactive = FALSE ) ,avg_weight_decl = (SELECT avg_weight_decl FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog.id AND temprunningcatalog.inactive = FALSE ) ,x = (SELECT x FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog.id AND temprunningcatalog.inactive = FALSE ) ,y = (SELECT y FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog.id AND temprunningcatalog.inactive = FALSE ) ,z = (SELECT z FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog.id AND temprunningcatalog.inactive = FALSE ) ,forcedfits_count = 0 WHERE EXISTS (SELECT runcat FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog.id AND temprunningcatalog.inactive = FALSE ) """ tkp.db.execute(query, commit=True) def _update_1_to_1_runcat_flux(): """Updates the fluxes in runningcatalog_flux of an existing band for an existing runcat source. If the runcat, band, stokes entry does exist in runcat_flux, it will be updated with the values from tempruncat. """ query = """\ UPDATE runningcatalog_flux SET f_datapoints = (SELECT f_datapoints FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog_flux.runcat AND temprunningcatalog.band = runningcatalog_flux.band AND temprunningcatalog.stokes = runningcatalog_flux.stokes AND temprunningcatalog.inactive = FALSE ) ,avg_f_peak = (SELECT avg_f_peak FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog_flux.runcat AND temprunningcatalog.band = runningcatalog_flux.band AND temprunningcatalog.stokes = runningcatalog_flux.stokes AND temprunningcatalog.inactive = FALSE ) ,avg_f_peak_sq = (SELECT avg_f_peak_sq FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog_flux.runcat AND temprunningcatalog.band = runningcatalog_flux.band AND temprunningcatalog.stokes = runningcatalog_flux.stokes AND temprunningcatalog.inactive = FALSE ) ,avg_f_peak_weight = (SELECT avg_f_peak_weight FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog_flux.runcat AND temprunningcatalog.band = runningcatalog_flux.band AND temprunningcatalog.stokes = runningcatalog_flux.stokes AND temprunningcatalog.inactive = FALSE ) ,avg_weighted_f_peak = (SELECT avg_weighted_f_peak FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog_flux.runcat AND temprunningcatalog.band = runningcatalog_flux.band AND temprunningcatalog.stokes = runningcatalog_flux.stokes AND temprunningcatalog.inactive = FALSE ) ,avg_weighted_f_peak_sq = (SELECT avg_weighted_f_peak_sq FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog_flux.runcat AND temprunningcatalog.band = runningcatalog_flux.band AND temprunningcatalog.stokes = runningcatalog_flux.stokes AND temprunningcatalog.inactive = FALSE ) ,avg_f_int = (SELECT avg_f_int FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog_flux.runcat AND temprunningcatalog.band = runningcatalog_flux.band AND temprunningcatalog.stokes = runningcatalog_flux.stokes AND temprunningcatalog.inactive = FALSE ) ,avg_f_int_sq = (SELECT avg_f_int_sq FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog_flux.runcat AND temprunningcatalog.band = runningcatalog_flux.band AND temprunningcatalog.stokes = runningcatalog_flux.stokes AND temprunningcatalog.inactive = FALSE ) ,avg_f_int_weight = (SELECT avg_f_int_weight FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog_flux.runcat AND temprunningcatalog.band = runningcatalog_flux.band AND temprunningcatalog.stokes = runningcatalog_flux.stokes AND temprunningcatalog.inactive = FALSE ) ,avg_weighted_f_int = (SELECT avg_weighted_f_int FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog_flux.runcat AND temprunningcatalog.band = runningcatalog_flux.band AND temprunningcatalog.stokes = runningcatalog_flux.stokes AND temprunningcatalog.inactive = FALSE ) ,avg_weighted_f_int_sq = (SELECT avg_weighted_f_int_sq FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog_flux.runcat AND temprunningcatalog.band = runningcatalog_flux.band AND temprunningcatalog.stokes = runningcatalog_flux.stokes AND temprunningcatalog.inactive = FALSE ) WHERE EXISTS (SELECT runcat FROM temprunningcatalog WHERE temprunningcatalog.runcat = runningcatalog_flux.runcat AND temprunningcatalog.band = runningcatalog_flux.band AND temprunningcatalog.stokes = runningcatalog_flux.stokes AND temprunningcatalog.inactive = FALSE AND temprunningcatalog.f_datapoints > 1 ) """ cursor = tkp.db.execute(query, commit=True) return cursor.rowcount def _insert_1_to_1_runcat_flux(): """Insert the fluxes in runningcatalog_flux of a new band for an existing runcat source. If the runcat, band, stokes entry does not exist (yet) in runcat_flux, we need to insert the new values from tempruncat. This might be the case if a source has been observed at other frequencies, but not in the current band, so there does not exist an entry for this band. """ query = """\ INSERT INTO runningcatalog_flux (runcat ,band ,stokes ,f_datapoints ,avg_f_peak ,avg_f_peak_sq ,avg_f_peak_weight ,avg_weighted_f_peak ,avg_weighted_f_peak_sq ,avg_f_int ,avg_f_int_sq ,avg_f_int_weight ,avg_weighted_f_int ,avg_weighted_f_int_sq ) SELECT runcat ,band ,stokes ,f_datapoints ,avg_f_peak ,avg_f_peak_sq ,avg_f_peak_weight ,avg_weighted_f_peak ,avg_weighted_f_peak_sq ,avg_f_int ,avg_f_int_sq ,avg_f_int_weight ,avg_weighted_f_int ,avg_weighted_f_int_sq FROM temprunningcatalog WHERE inactive = FALSE AND f_datapoints=1 """ cursor = tkp.db.execute(query, commit=True) return cursor.rowcount def _insert_new_runcat(image_id): """Insert previously unknown sources into the ``runningcatalog`` table. Extractedsources for which no counterpart was found in the runningcatalog (i.e. no pair exists in tempruncat), will be added as a new source to the assocxtrsource, runningcatalog and runningcatalog_flux tables. """ # NOTE: Here we select all (inactive TRUE&FALSE) tempruncat entries # source in order to exclude all extractedsources that have been associated. query = """\ INSERT INTO runningcatalog (xtrsrc ,dataset ,datapoints ,zone ,wm_ra ,wm_decl ,avg_ra_err ,avg_decl_err ,wm_uncertainty_ew ,wm_uncertainty_ns ,avg_wra ,avg_wdecl ,avg_weight_ra ,avg_weight_decl ,x ,y ,z ) SELECT new_src.xtrsrc ,new_src.dataset ,new_src.datapoints ,new_src.zone ,new_src.wm_ra ,new_src.wm_decl ,new_src.avg_ra_err ,new_src.avg_decl_err ,new_src.wm_uncertainty_ew ,new_src.wm_uncertainty_ns ,new_src.avg_wra ,new_src.avg_wdecl ,new_src.avg_weight_ra ,new_src.avg_weight_decl ,new_src.x ,new_src.y ,new_src.z FROM (SELECT x0.id AS xtrsrc ,i0.dataset ,1 AS datapoints ,x0.zone ,x0.ra AS wm_ra ,x0.decl AS wm_decl ,x0.ra_err AS avg_ra_err ,x0.decl_err AS avg_decl_err ,x0.uncertainty_ew AS wm_uncertainty_ew ,x0.uncertainty_ns AS wm_uncertainty_ns ,x0.ra / (x0.uncertainty_ew * x0.uncertainty_ew) AS avg_wra ,x0.decl / (x0.uncertainty_ns * x0.uncertainty_ns) AS avg_wdecl ,1 / (x0.uncertainty_ew * x0.uncertainty_ew) AS avg_weight_ra ,1 / (x0.uncertainty_ns * x0.uncertainty_ns) AS avg_weight_decl ,x0.x ,x0.y ,x0.z FROM extractedsource x0 ,image i0 WHERE x0.image = i0.id AND x0.image = %s AND x0.extract_type = 0 ) new_src LEFT OUTER JOIN temprunningcatalog tmprc ON new_src.xtrsrc = tmprc.xtrsrc WHERE tmprc.xtrsrc IS NULL """ cursor = tkp.db.execute(query, (image_id,), True) ins = cursor.rowcount if ins > 0: logger.debug("Added %s new sources to runningcatalog" % ins) def _insert_new_runcat_flux(image_id): """ Insert previously unknown sources into the ``runningcatalog_flux`` table. (i.e. those without *any* previous runcat-counterpart) """ query = """\ INSERT INTO runningcatalog_flux (runcat ,band ,stokes ,f_datapoints ,avg_f_peak ,avg_f_peak_sq ,avg_f_peak_weight ,avg_weighted_f_peak ,avg_weighted_f_peak_sq ,avg_f_int ,avg_f_int_sq ,avg_f_int_weight ,avg_weighted_f_int ,avg_weighted_f_int_sq ) SELECT r0.id ,i0.band ,i0.stokes ,1 AS f_datapoints ,x0.f_peak ,x0.f_peak * x0.f_peak ,1 / (x0.f_peak_err * x0.f_peak_err) ,x0.f_peak / (x0.f_peak_err * x0.f_peak_err) ,x0.f_peak * x0.f_peak / (x0.f_peak_err * x0.f_peak_err) ,x0.f_int ,x0.f_int * x0.f_int ,1 / (x0.f_int_err * x0.f_int_err) ,x0.f_int / (x0.f_int_err * x0.f_int_err) ,x0.f_int * x0.f_int / (x0.f_int_err * x0.f_int_err) FROM image i0 ,(SELECT x1.id AS xtrsrc FROM extractedsource x1 LEFT OUTER JOIN temprunningcatalog tmprc ON x1.id = tmprc.xtrsrc WHERE x1.image = %(image_id)s AND x1.extract_type = 0 AND tmprc.xtrsrc IS NULL ) new_src ,runningcatalog r0 ,extractedsource x0 WHERE i0.id = %(image_id)s AND r0.xtrsrc = new_src.xtrsrc AND x0.id = r0.xtrsrc """ tkp.db.execute(query, {'image_id': image_id}, True) def _insert_new_runcat_skyrgn_assocs(image_id): """ Process newly created entries from the runningcatalog, determine which skyregions they lie within. Upon creation of a new runningcatalog entry, we need to determine which previous fields of view (skyrgns) we expect to see it in. This knowledge helps us to make accurate guesses as whether a new source is really transient or simply being surveyed for the first time. .. note: This could be made more efficient, at the cost of added complexity, by tracking which skyregions overlap, and then only testing for membership of overlapping regions. """ # First, mark membership in the skyregion of the image of initial detection. # We look for extracted sources from this image # that are not in temprunningcatalog, i.e. have no association candidates. # By dealing with these separately, we save a number of radius comparison # operations proportional to the number of new sources in this field. assocskyrgn_parent_qry = """\ INSERT INTO assocskyrgn (runcat ,skyrgn ) SELECT t0.runcat ,t0.skyrgn FROM (SELECT ex.id AS xtrsrc ,rc.id as runcat ,im.skyrgn FROM extractedsource ex ,runningcatalog rc ,image im WHERE ex.image = %(img_id)s AND rc.xtrsrc = ex.id AND ex.image = im.id ) t0 LEFT OUTER JOIN temprunningcatalog tmprc ON t0.xtrsrc = tmprc.xtrsrc WHERE tmprc.xtrsrc IS NULL """ tkp.db.execute(assocskyrgn_parent_qry, {'img_id':image_id}, True) #Now search all the other skyregions *in same dataset* to determine matches: assocskyrgn_others_qry = """\ INSERT INTO assocskyrgn (runcat ,skyrgn ,distance_deg ) SELECT new_src.runcat as runcatid ,sky.id as skyrgnid ,DEGREES(2 * ASIN(SQRT( (rc1.x - sky.x) * (rc1.x - sky.x) + (rc1.y - sky.y) * (rc1.y - sky.y) + (rc1.z - sky.z) * (rc1.z - sky.z) ) / 2) ) AS idistance_deg FROM skyregion sky ,runningcatalog rc1 ,(SELECT t0.runcat ,t0.self_skyrgn FROM (SELECT ex.id AS xtrsrc ,rc0.id as runcat ,im.skyrgn as self_skyrgn FROM extractedsource ex ,runningcatalog rc0 ,image im WHERE ex.image = %(img_id)s AND rc0.xtrsrc = ex.id AND ex.image = im.id ) t0 LEFT OUTER JOIN temprunningcatalog tmprc ON t0.xtrsrc = tmprc.xtrsrc WHERE tmprc.xtrsrc IS NULL ) new_src WHERE rc1.id = new_src.runcat AND sky.dataset = rc1.dataset AND sky.id <> new_src.self_skyrgn AND DEGREES(2 * ASIN(SQRT( (rc1.x - sky.x) * (rc1.x - sky.x) + (rc1.y - sky.y) * (rc1.y - sky.y) + (rc1.z - sky.z) * (rc1.z - sky.z) ) / 2) ) < sky.xtr_radius """ tkp.db.execute(assocskyrgn_others_qry, {'img_id':image_id}, True) def _insert_new_assocxtrsource(image_id): """ Insert new associations for previously unknown sources. """ query = """\ INSERT INTO assocxtrsource (runcat ,xtrsrc ,type ,distance_arcsec ,r ,v_int ,eta_int ,f_datapoints ) SELECT r0.id AS runcat ,r0.xtrsrc ,4 ,0 ,0 ,0 ,0 ,1 FROM (SELECT x1.id AS xtrsrc FROM extractedsource x1 LEFT OUTER JOIN temprunningcatalog tmprc ON x1.id = tmprc.xtrsrc WHERE x1.image = %(image_id)s AND x1.extract_type = 0 AND tmprc.xtrsrc IS NULL ) new_src ,runningcatalog r0 WHERE r0.xtrsrc = new_src.xtrsrc """ tkp.db.execute(query, {'image_id':image_id}, True) def _determine_newsource_previous_limits(image_id, new_source_sigma_margin): """ Determines which new-runcat sources are also probably transient. Looks up previous images relevant to this source-position, using the following criteria - images must: - overlap the new-source position, according to the skyregion information; - be in the same dataset; - be in the same frequency band; - have an earlier timestamp than the current image; - have not been rejected. For those images we calculate the per-previous-image detection-thresholds, which are defined as follows. A new source is 'possibly transient' (type 0) if it passes the following tests: - Was not detected in a skyregion being surveyed for the first time. - Has a flux-value such that: flux > MIN_OVER_I [ (rms_min_I*(det_I + new_source_sigma_margin) ] (where I indexes the images) i.e. if it was a steady-source, it should have been already detected if it was in the *low-RMS* area of the previous image with best detection threshold, even allowing for noise fluctuations. Furthermore, a new source is 'likely transient' (type 1) if it is additionally bright enough that, if it were a steady source, it should have been detected even if it was in the *high-RMS* area of the aforementioned 'low rms_min' image, i.e. flux > (rms_max_I*(det_I + new_source_sigma_margin)) Note that, once we have located the image with best 'low rms threshold', we then use that image to *also* generate the 'high rms threshold'. Strictly speaking, this is non-optimal - we should run a fresh search against all images to find the best 'high rms threshold'. However, I'm working on the assumption that most of the time the image with best low-threshold will also have best high-threshold, and even when that is not the case we won't lose too much accuracy. The benefits of this assumption are simplicity, and possibly faster performance, but this might need to be re-examined in future, especially if we start ingesting images of wildly differing sizes and noise non-uniformity characteristics (e.g. single pointings vs mosaics) etc. We use peak flux (f_peak) as the flux value here, since that is likely to be the deciding factor in whether a source gets blindly extracted or not. (NB This is a hunch, rigorous investigation welcome.) """ # This is another hairy query, but it breaks down like so: # # The innermost SELECT (unassoc_xtr) is a standard query # that we use to grab extractedsources from the current image that # do not have a candidate runcat counterpart from previous images. # Note that, by the time this query is run, a new runningcatalog entry has # been inserted for them, and the skyregion matching has been done. # # Next, we match those new sources with previous images overlapping # their position according to the criteria in the docstring above, # and calculate detection thresholds for each of those images. # # We then thinly wrap the resulting 'matched_imgs' set in a query # to sort them by low_flux_threshold, with high_flux_threshold as the # secondary criteria in case of a tie ('ordered_matched_imgs'). # # Finally, we pull out the results we want - new source flux above the low # threshold, image ID of the 'best' previous image according to the sorting, # and run a final CASE to determine if the new source also passes the # high flux threshold. # query = """\ INSERT INTO newsource (runcat ,trigger_xtrsrc ,newsource_type ,previous_limits_image ) SELECT new_src_runcat_id AS runcat ,new_src_xtr_id AS trigger_xtrsrc ,CASE WHEN new_src_flux > high_flux_threshold THEN 1 ELSE 0 END as newsource_type ,prev_img_id AS previous_limits_image FROM ( SELECT new_src_runcat_id ,new_src_xtr_id ,new_src_flux ,prev_img_id ,low_flux_threshold ,high_flux_threshold ,ROW_NUMBER() OVER ( PARTITION BY new_src_xtr_id ORDER BY low_flux_threshold ASC, high_flux_threshold ASC ) AS row_num FROM ( SELECT runcat1.id as new_src_runcat_id ,unassoc_xtr.xtrsrc_id as new_src_xtr_id ,unassoc_xtr.f_peak as new_src_flux ,prev_imgs.id as prev_img_id ,(prev_imgs.rms_min * (prev_imgs.detection_thresh + %(sigma_margin)s)) AS low_flux_threshold ,(prev_imgs.rms_max * (prev_imgs.detection_thresh + %(sigma_margin)s)) AS high_flux_threshold FROM (SELECT x1.id AS xtrsrc_id ,x1.f_peak FROM extractedsource x1 WHERE x1.image = %(image_id)s AND x1.id NOT IN (SELECT xtrsrc FROM temprunningcatalog) AND x1.extract_type = 0 ) unassoc_xtr ,runningcatalog runcat1 ,assocskyrgn asky1 ,image this_img ,image prev_imgs WHERE this_img.id = %(image_id)s AND runcat1.xtrsrc = unassoc_xtr.xtrsrc_id AND asky1.runcat = runcat1.id AND prev_imgs.dataset = this_img.dataset AND prev_imgs.skyrgn = asky1.skyrgn AND prev_imgs.band = this_img.band AND this_img.taustart_ts > prev_imgs.taustart_ts AND prev_imgs.id NOT IN (select image from rejection) ) matched_imgs ) ordered_matched_imgs WHERE row_num = 1 AND new_src_flux > low_flux_threshold """ params = {'image_id': image_id, 'sigma_margin': new_source_sigma_margin} cursor = tkp.db.execute(query, params, commit=True) ins = cursor.rowcount if ins > 0: logger.debug("Added %s new sources to newsource table" % (ins,)) def _update_ff_runcat_extractedsource(): """ We are about to delete the runcats that are inactivated, and therefore have to set the ff_runcat reference in extractedsource to NULL. """ query = """\ UPDATE extractedsource SET ff_runcat = NULL WHERE EXISTS (SELECT id FROM runningcatalog WHERE runningcatalog.id = extractedsource.ff_runcat AND runningcatalog.inactive = TRUE ) """ cursor = tkp.db.execute(query, commit=True) cnt = cursor.rowcount if cnt > 0: logger.debug("Unset ff_runcat for %s extractedsources" % cnt) def _delete_inactive_runcat(): """Delete the one-to-many associations from temprunningcatalog, and delete the inactive rows from runningcatalog. After the one-to-many associations have been processed, they can be deleted from the temporary table and the runningcatalog. """ query = """\ DELETE FROM runningcatalog WHERE inactive = TRUE """ tkp.db.execute(query, commit=True)
39.467688
200
0.560208
2c80f9e18b67e3c25bfa89cef79c3bfb5642630d
68
sql
SQL
evo-X-Scriptdev2/sql/Updates/0.0.3/r1023_scriptdev2.sql
Gigelf-evo-X/evo-X
d0e68294d8cacfc7fb3aed5572f51d09a47136b9
[ "OpenSSL" ]
1
2019-01-19T06:35:40.000Z
2019-01-19T06:35:40.000Z
src/bindings/Scriptdev2/sql/Updates/0.0.3/r1023_scriptdev2.sql
mfooo/wow
3e5fad4cfdf0fd1c0a2fd7c9844e6f140a1bb32d
[ "OpenSSL" ]
null
null
null
src/bindings/Scriptdev2/sql/Updates/0.0.3/r1023_scriptdev2.sql
mfooo/wow
3e5fad4cfdf0fd1c0a2fd7c9844e6f140a1bb32d
[ "OpenSSL" ]
null
null
null
UPDATE sd2_db_version SET version='ScriptDev2 (for MaNGOS 7715+) ';
34
67
0.779412
590d9d5751a28539435416c6c35ca50544014fc8
4,766
swift
Swift
Biin/Pods/UberRides/source/UberRides/RequestURLBuilder.swift
estebanpadilla/biinIOS
65956adf9fcaf3508f083db883bb8d4bb35ce319
[ "MIT" ]
null
null
null
Biin/Pods/UberRides/source/UberRides/RequestURLBuilder.swift
estebanpadilla/biinIOS
65956adf9fcaf3508f083db883bb8d4bb35ce319
[ "MIT" ]
null
null
null
Biin/Pods/UberRides/source/UberRides/RequestURLBuilder.swift
estebanpadilla/biinIOS
65956adf9fcaf3508f083db883bb8d4bb35ce319
[ "MIT" ]
null
null
null
// // RequestURLBuilder.swift // UberRides // // Copyright © 2016 Uber Technologies, Inc. All rights reserved. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. import CoreLocation class RequestURLBuilder { private enum LocationType: String { case Pickup = "pickup" case Dropoff = "dropoff" } static let actionKey = "action" static let setPickupValue = "setPickup" static let clientIDKey = "client_id" static let productIDKey = "product_id" static let currentLocationValue = "my_location" static let latitudeKey = "[latitude]" static let longitudeKey = "[longitude]" static let nicknameKey = "[nickname]" static let formattedAddressKey = "[formatted_address]" static let deeplinkScheme = "uber" static let userAgentKey = "user-agent" private let clientID: String private var rideParameters: RideParameters? init() { clientID = Configuration.getClientID() } func setRideParameters(rideParameters: RideParameters) -> RequestURLBuilder { self.rideParameters = rideParameters return self } func build() -> NSURL? { guard let rideParameters = rideParameters else { return nil } let urlComponents = NSURLComponents() urlComponents.scheme = RequestURLBuilder.deeplinkScheme urlComponents.host = "" var queryItems = [NSURLQueryItem]() queryItems.append(NSURLQueryItem(name: RequestURLBuilder.actionKey, value: RequestURLBuilder.setPickupValue)) queryItems.append(NSURLQueryItem(name: RequestURLBuilder.clientIDKey, value: clientID)) if let productID = rideParameters.productID { queryItems.append(NSURLQueryItem(name: RequestURLBuilder.productIDKey, value: productID)) } if let location = rideParameters.pickupLocation { queryItems.appendContentsOf(addLocation(LocationType.Pickup, location: location, nickname: rideParameters.pickupNickname, address: rideParameters.pickupAddress)) } else { queryItems.append(NSURLQueryItem(name: LocationType.Pickup.rawValue, value: RequestURLBuilder.currentLocationValue)) } if let location = rideParameters.dropoffLocation { queryItems.appendContentsOf(addLocation(LocationType.Dropoff, location: location, nickname: rideParameters.dropoffNickname, address: rideParameters.dropoffAddress)) } queryItems.append(NSURLQueryItem(name: RequestURLBuilder.userAgentKey, value: rideParameters.userAgent)) urlComponents.queryItems = queryItems return urlComponents.URL } private func addLocation(locationType: LocationType, location: CLLocation, nickname: String?, address: String?) -> [NSURLQueryItem] { var queryItems = [NSURLQueryItem]() let locationPrefix = locationType.rawValue let latitudeString = "\(location.coordinate.latitude)" let longitudeString = "\(location.coordinate.longitude)" queryItems.append(NSURLQueryItem(name: locationPrefix + RequestURLBuilder.latitudeKey, value: latitudeString)) queryItems.append(NSURLQueryItem(name: locationPrefix + RequestURLBuilder.longitudeKey, value: longitudeString)) if let nickname = nickname { queryItems.append(NSURLQueryItem(name: locationPrefix + RequestURLBuilder.nicknameKey, value: nickname)) } if let address = address { queryItems.append(NSURLQueryItem(name: locationPrefix + RequestURLBuilder.formattedAddressKey, value: address)) } return queryItems } }
42.936937
176
0.701217
5d71588845e6705632b2f59f03eb839de110f012
4,650
lua
Lua
resources/[local]/[ESX]/esx_jailer/config.lua
szymczakovv/AriviRP
e1b9425b242586da551ee4909954a98a7c7aa2de
[ "MIT" ]
10
2021-03-09T23:17:02.000Z
2021-10-03T12:47:03.000Z
resources/[local]/[ESX]/esx_jailer/config.lua
szymczakovv/AriviRP
e1b9425b242586da551ee4909954a98a7c7aa2de
[ "MIT" ]
null
null
null
resources/[local]/[ESX]/esx_jailer/config.lua
szymczakovv/AriviRP
e1b9425b242586da551ee4909954a98a7c7aa2de
[ "MIT" ]
33
2021-03-09T09:49:35.000Z
2022-03-15T01:17:05.000Z
Config = {} Config.JailBlip = {x = 1854.00, y = 2622.00, z = 45.00} Config.JailLocation = {x = 1657.73, y = 2538.08, z = 45.5649} Config.Locale = 'en' Config.Marker = true Config.Notify = false Config.Usuntimeessen = math.random(1,4) -- CHECK SKINCHANGER CLIENT MAIN.LUA for matching elements Config.Uniforms = { prison_wear = { male = { ['tshirt_1'] = 15, ['tshirt_2'] = 0, ['torso_1'] = 146, ['torso_2'] = 0, ['decals_1'] = 0, ['decals_2'] = 0, ['arms'] = 0, ['pants_1'] = 3, ['pants_2'] = 7, ['shoes_1'] = 12, ['shoes_2'] = 12, ['chain_1'] = 50, ['chain_2'] = 0 }, female = { ['tshirt_1'] = 3, ['tshirt_2'] = 0, ['torso_1'] = 38, ['torso_2'] = 3, ['decals_1'] = 0, ['decals_2'] = 0, ['arms'] = 2, ['pants_1'] = 3, ['pants_2'] = 15, ['shoes_1'] = 66, ['shoes_2'] = 5, ['chain_1'] = 0, ['chain_2'] = 2 } } } Config.JailPositions = { ["Cell"] = { ["x"] = 1799.8345947266, ["y"] = 2489.1350097656, ["z"] = -119.02998352051, ["h"] = 179.03021240234 } } Config.Cutscene = { ["PhotoPosition"] = { ["x"] = 402.91567993164, ["y"] = -996.75970458984, ["z"] = -99.000259399414, ["h"] = 186.22499084473 }, ["CameraPos"] = { ["x"] = 402.88830566406, ["y"] = -1003.8851318359, ["z"] = -97.419647216797, ["rotationX"] = -15.433070763946, ["rotationY"] = 0.0, ["rotationZ"] = -0.31496068835258, ["cameraId"] = 0 }, ["PolicePosition"] = { ["x"] = 402.91702270508, ["y"] = -1000.6376953125, ["z"] = -99.004028320313, ["h"] = 356.88052368164 } } Config.Teleports = { ["Prison Work"] = { ["x"] = 992.51770019531, ["y"] = -3097.8413085938, ["z"] = -38.995861053467, ["h"] = 81.15771484375, ["goal"] = { "Jail" } }, ["Boiling Broke"] = { ["x"] = 1845.6022949219, ["y"] = 2585.8029785156, ["z"] = 45.672061920166, ["h"] = 92.469093322754, ["goal"] = { "Security" } }, ["Jail"] = { ["x"] = 1800.6979980469, ["y"] = 2483.0979003906, ["z"] = -122.68814849854, ["h"] = 271.75274658203, ["goal"] = { "Prison Work", "Security", "Visitor" } }, ["Security"] = { ["x"] = 1706.7625732422, ["y"] = 2581.0793457031, ["z"] = -69.407371520996, ["h"] = 267.72802734375, ["goal"] = { "Jail", "Boiling Broke" } }, ["Visitor"] = { ["x"] = 1699.7196044922, ["y"] = 2574.5314941406, ["z"] = -69.403930664063, ["h"] = 169.65020751953, ["goal"] = { "Jail" } } } Config.Jobs = { Marker = { Color = {r = 204, g = 204, b = 0}, Size = {x = 3.0, y = 3.0, z = 1.0}, Type = 1 }, List = { { Pos = {x = 1689.326, y = 2551.525, z = 44.564}, Name = '#1' }, { Pos = {x = 1700.200, y = 2474.780, z = 44.564}, Name = '#2' }, { Pos = {x = 1609.010, y = 2566.986, z = 44.564}, Name = '#3' }, { Pos = {x = 1717.449, y = 2567.409, z = 44.564}, Name = '#4' }, { Pos = {x = 1772.111, y = 2546.052, z = 44.586}, Name = '#5' } } } Config.ArrestedCutScene = { Player = {coord = vector3(1817.81, 2593.97, 45.62), head = 91.55, dest = vector3(1791.79, 2593.74, 45.8)}, NPC = { {coord = vector3(1818.24, 2595.68, 45.72), head = 91.55, dest = vector3(1792.56, 2595.48, 45.8), dhead = 350.66, ped = "s_m_m_prisguard_01"}, {coord = vector3(1818.22, 2592.58, 45.72), head = 91.55, dest = vector3(1792.54, 2592.55, 45.8), dhead = 350.60, ped = "s_m_m_prisguard_01"} }, Cams = { ["Cam0"] = { coord = vector3(1813.53, 2592.08, 44.86), rot = vector3(0, 0, 0) }, ["Cam1"] = { coord = vector3(1803.19, 2594.77, 45.8), rot = vector3(0, 0, -90) }, ["Cam2"] = { coord = vector3(1800.04, 2596.17, 45.8), rot = vector3(0, 0, 140) }, ["Cam3"] = { coord = vector3(1757.1, 2510.36, 45.57), rot = vector3(0, 0, -17) }, }, } Config.PrisonZones = { ["SPos"] = { coord = vector3(1775.54, 2552.04, 45.57), heading = 93.0 }, ["9AB"] = { coord = vector3(1760.02, 2513.09, 45.81), peds = {coord = vector3(1760.02, 2513.09, 45.81-0.95), head = 76.42, ped = "s_m_m_prisguard_01"} } } Config.Uniforms = { prison_wear = { male = { ['tshirt_1'] = 15, ['tshirt_2'] = 0, ['torso_1'] = 56, ['torso_2'] = 0, ['decals_1'] = 0, ['decals_2'] = 0, ['arms'] = 0, ['pants_1'] = 3, ['pants_2'] = 7, ['shoes_1'] = 89, ['shoes_2'] = 0 }, female = { ['tshirt_1'] = 15, ['tshirt_2'] = 0, ['torso_1'] = 23, ['torso_2'] = 0, ['decals_1'] = 0, ['decals_2'] = 0, ['arms'] = 0, ['pants_1'] = 64, ['pants_2'] = 1, ['shoes_1'] = 69, ['shoes_2'] = 1, ['chain_1'] = 0, ['chain_2'] = 0 } } }
23.72449
205
0.497204
e709b7e0f06457cd00c124b531b93b8a90889c20
2,766
php
PHP
app/Http/Controllers/PDFController.php
PatelPratik0812/How-To-Generate-PDF-In-Laravel-Using-TCPDF-PHPLibrary
38c7d9d3474988f3c1b971d6c0d8ab0cc8c1ffba
[ "MIT" ]
null
null
null
app/Http/Controllers/PDFController.php
PatelPratik0812/How-To-Generate-PDF-In-Laravel-Using-TCPDF-PHPLibrary
38c7d9d3474988f3c1b971d6c0d8ab0cc8c1ffba
[ "MIT" ]
null
null
null
app/Http/Controllers/PDFController.php
PatelPratik0812/How-To-Generate-PDF-In-Laravel-Using-TCPDF-PHPLibrary
38c7d9d3474988f3c1b971d6c0d8ab0cc8c1ffba
[ "MIT" ]
null
null
null
<?php namespace App\Http\Controllers; use Illuminate\Http\Response; use Illuminate\Http\Request; use Elibyy\TCPDF\Facades\TCPDF; use App\Http\Requests; use App\Post; use App\Register; use PDF; use DB; class PDFController extends Controller { public function index() { return view('reg'); } //simple generate pdf public function samplePDF() { $html_content='<h1>Hello</h1>'; PDF::SetTitle('Sample PDF'); PDF::AddPage(); PDF::writeHTML($html_content,true,false,true,false,''); PDF::Output('SamplePDF.pdf'); } //Directy generate pdf in .then click on link download pdf file is downloded public function downloadPDF() { $html_content='<h1>Hello</h1>'; PDF::SetTitle('Sample PDF'); PDF::AddPage(); PDF::writeHTML($html_content,true,false,true,false,''); PDF::Output(public_path(uniqid().'_SamplePDF.pdf'),'D'); } ///HTML to generate pdf in laravel .fetch record from mysql databse public function HtmlToPDF() { PDF::SetFont('dejavusans', '', 10); PDF::SetTitle('Sample PDF'); PDF::AddPage(); $registers= DB::select('select * from register'); $view=View('view',['register'=>$registers]); $html_content= $view->render(); PDF::writeHTML($html_content,true,false,true,false,''); PDF::Output('_SamplePDF.pdf'); } public function create(Request $request) { //Mongo DB Insert Code //return view('reg'); /* $username=$request->input('username'); $email=$request->input('email'); $mobile_no=$request->input('mobile_no'); $education=$request->input('education'); $country=$request->input('country'); $data=array('username'=>$username,'email'=>$email,'mobile_no'=>$mobile_no,'education'=>$education,'country'=>$country); DB::insert('register')->insert($data); echo "Record Successfully Inserted...";*/ /*************************************Mysql Insert Code *****************************************/ $post=new Post; $post->username=$request['username']; $post->email=$request['email']; $post->mobile_no=$request['mobile_no']; $post->education=$request['education']; $post->country=$request['country']; $post->save(); /************************************Mysql End*****************************************/ } public function EmployeeData() { //return view('show'); $register= DB::select('select * from register'); return view('show',['register'=>$register]); } }
29.115789
127
0.54013
bd46a7cb1f4110f4eac29e322b450f89e2d847d5
2,132
sh
Shell
infra/create_instance.sh
crumplecup/rustgym
1733977bb05c83cfb9ee363e1edb6ab411b6e15c
[ "MIT" ]
null
null
null
infra/create_instance.sh
crumplecup/rustgym
1733977bb05c83cfb9ee363e1edb6ab411b6e15c
[ "MIT" ]
null
null
null
infra/create_instance.sh
crumplecup/rustgym
1733977bb05c83cfb9ee363e1edb6ab411b6e15c
[ "MIT" ]
null
null
null
#!/bin/bash TAG=v0.2.10 VM_NAME=rustgym-22 SERVER_NAME=rustgym.com WORK_DIR=/root EMAIL=larry.fantasy@gmail.com RUSTGYM_DOWNLOAD=https://github.com/warycat/rustgym/releases/download SONIC_DOWNLOAD=https://github.com/valeriansaliou/sonic/releases/download SONIC_TAG=v1.3.0 HTTP_UPGRADE='$http_upgrade' HOST='$host' IMAGE=debian-10-buster-v20201216 IMAGE_FAMILY=debian-10 MACHINE_TYPE=e2-micro ZONE=us-central1-a gcloud compute instances create $VM_NAME \ --machine-type $MACHINE_TYPE \ --zone $ZONE \ --tags http-server,https-server \ --metadata startup-script="#! /bin/bash apt update apt -y install nginx sqlite3 certbot python-certbot-nginx telnet cd $WORK_DIR cat <<EOF > certbot.sh #!/bin/bash certbot --nginx --redirect --non-interactive --agree-tos -m $EMAIL -d $SERVER_NAME EOF chmod u+x certbot.sh curl -LJO $SONIC_DOWNLOAD/$SONIC_TAG/$SONIC_TAG-x86_64.tar.gz tar -xzf $SONIC_TAG-x86_64.tar.gz mv sonic/sonic sonic-server mv sonic/config.cfg . rm $SONIC_TAG-x86_64.tar.gz rmdir sonic mkdir -p data/store/kv mkdir -p data/store/fst ./sonic-server >> sonic.log &>> sonic.error.log & curl -LJO $RUSTGYM_DOWNLOAD/$TAG/pkg.tar.gz tar -xzf pkg.tar.gz rm pkg.tar.gz curl -LJO $RUSTGYM_DOWNLOAD/$TAG/static.tar.gz tar -xzf static.tar.gz rm static.tar.gz curl -LJO $RUSTGYM_DOWNLOAD/$TAG/rustgym.sqlite curl -LJO $RUSTGYM_DOWNLOAD/$TAG/rustgym-server curl -LJO $RUSTGYM_DOWNLOAD/$TAG/rustgym-ingest chmod u+x rustgym-ingest ./rustgym-ingest >> ingest.log &>> ingest.error.log & chmod u+x rustgym-server TAG=$TAG ./rustgym-server >> server.log &>> server.error.log & cat <<\EOF > /etc/nginx/sites-available/rustgym-nginx.cfg server { listen 80 default_server; listen [::]:80 default_server; server_name $SERVER_NAME; location / { proxy_pass http://127.0.0.1:8080; proxy_http_version 1.1; proxy_set_header Upgrade $HTTP_UPGRADE; proxy_set_header Connection \"upgrade\"; proxy_set_header Host $HOST; } } EOF rm /etc/nginx/sites-enabled/default ln -s /etc/nginx/sites-available/rustgym-nginx.cfg /etc/nginx/sites-enabled/default systemctl restart nginx "
28.426667
83
0.743433
1a6fa0227aafd37bea7d547fabd05eb6daaa7788
4,292
py
Python
RLBotPack/Botimus&Bumblebee/hivemind.py
L0laapk3/RLBotPack
f54038475d2a57428f3784560755f96bfcf8015f
[ "MIT" ]
13
2019-05-25T20:25:51.000Z
2022-03-19T13:36:23.000Z
RLBotPack/Botimus&Bumblebee/hivemind.py
L0laapk3/RLBotPack
f54038475d2a57428f3784560755f96bfcf8015f
[ "MIT" ]
53
2019-06-07T13:31:59.000Z
2022-03-28T22:53:47.000Z
RLBotPack/Botimus&Bumblebee/hivemind.py
L0laapk3/RLBotPack
f54038475d2a57428f3784560755f96bfcf8015f
[ "MIT" ]
78
2019-06-30T08:42:13.000Z
2022-03-23T20:11:42.000Z
import logging from typing import Dict, List from rlbot.agents.hivemind.python_hivemind import PythonHivemind from rlbot.utils.structures.bot_input_struct import PlayerInput from rlbot.utils.structures.game_data_struct import GameTickPacket from maneuvers.kickoffs.kickoff import Kickoff from maneuvers.general_defense import GeneralDefense from maneuvers.refuel import Refuel from rlutilities.linear_algebra import vec3 from strategy import teamplay_strategy from strategy.hivemind_strategy import HivemindStrategy from tools.drawing import DrawingTool from tools.drone import Drone from tools.game_info import GameInfo RELEASE = True class Beehive(PythonHivemind): def __init__(self, *args): super().__init__(*args) self.info: GameInfo = None self.team: int = None self.draw: DrawingTool = None self.drones: List[Drone] = [] self.strategy: HivemindStrategy = None self.last_latest_touch_time = 0.0 def initialize_hive(self, packet: GameTickPacket) -> None: index = next(iter(self.drone_indices)) self.team = packet.game_cars[index].team self.info = GameInfo(self.team) self.info.set_mode("soccar") self.strategy = HivemindStrategy(self.info, self.logger) self.draw = DrawingTool(self.renderer, self.team) self.drones = [Drone(self.info.cars[i], i) for i in self.drone_indices] self.logger.handlers[0].setLevel(logging.NOTSET) # override handler level self.logger.setLevel(logging.INFO if RELEASE else logging.DEBUG) self.logger.info("Beehive initialized") def get_outputs(self, packet: GameTickPacket) -> Dict[int, PlayerInput]: self.info.read_packet(packet, self.get_field_info()) # if a kickoff is happening and none of the drones have a Kickoff maneuver active, reset all drone maneuvers if ( packet.game_info.is_kickoff_pause and self.info.ball.position[0] == 0 and self.info.ball.position[1] == 0 and not any(isinstance(drone.maneuver, Kickoff) for drone in self.drones) ): if len(self.drones) == 1: self.drones[0].maneuver = None else: self.strategy.set_kickoff_maneuvers(self.drones) # reset drone maneuvers when an opponent hits the ball touch = packet.game_ball.latest_touch if touch.time_seconds > self.last_latest_touch_time and touch.team != self.team: self.last_latest_touch_time = touch.time_seconds for drone in self.drones: if drone.maneuver and drone.maneuver.interruptible(): # don't reset a drone while dodging/recovering drone.maneuver = None # reset drone maneuver when it gets demoed for drone in self.drones: if drone.maneuver and drone.car.demolished: drone.maneuver = None # if at least one drone doesn't have an active maneuver, execute strategy code if None in [drone.maneuver for drone in self.drones]: self.logger.debug("Setting maneuvers") if len(self.drones) == 1: self.drones[0].maneuver = teamplay_strategy.choose_maneuver(self.info, self.drones[0].car) else: self.strategy.set_maneuvers(self.drones) for drone in self.drones: if drone.maneuver is None: continue # execute maneuvers drone.maneuver.step(self.info.time_delta) drone.controls = drone.maneuver.controls drone.maneuver.render(self.draw) # draw names of maneuvers above our drones self.draw.color(self.draw.yellow) self.draw.string(drone.car.position + vec3(0, 0, 50), type(drone.maneuver).__name__) # expire finished maneuvers if drone.maneuver.finished: drone.maneuver = None if len(self.drones) > 1: self.strategy.avoid_demos_and_team_bumps(self.drones) self.strategy.render(self.draw) self.draw.execute() return {drone.index: drone.get_player_input() for drone in self.drones}
40.87619
118
0.649814
59502dff2d4deeef2a05f25917421c336f47f0be
442
asm
Assembly
tests/asm/03-headers2.asm
earwig/crater
b57de026e11d77a307606d49edfc0a3e756353d7
[ "MIT" ]
16
2015-09-10T20:13:52.000Z
2022-03-27T02:22:13.000Z
tests/asm/03-headers2.asm
earwig/crater
b57de026e11d77a307606d49edfc0a3e756353d7
[ "MIT" ]
5
2017-07-11T19:06:34.000Z
2017-07-16T11:26:39.000Z
tests/asm/03-headers2.asm
earwig/crater
b57de026e11d77a307606d49edfc0a3e756353d7
[ "MIT" ]
2
2017-11-23T05:55:22.000Z
2021-02-10T23:03:21.000Z
;; Copyright (C) 2016 Ben Kurtovic <ben.kurtovic@gmail.com> ;; Released under the terms of the MIT License. See LICENSE for details. ; ----- CRATER UNIT TESTING SUITE --------------------------------------------- ; 03-headers2.asm ; Header/directive test using non-default values .rom_size "64 KB" .rom_header $7FF0 .rom_product 101893 .rom_version 3 .rom_region "GG International" .rom_checksum on .rom_declsize "32 KB" .cross_blocks off
26
79
0.678733
e04b39730f66b8761018810cbd08e78befa5701a
1,026
h
C
include/cascadb/comparator.h
sagpant/cascadb
cc2a118f2548fd7221e8dba42774edea8af080f7
[ "BSD-3-Clause" ]
166
2015-01-26T15:21:26.000Z
2022-03-25T03:22:27.000Z
include/cascadb/comparator.h
BohuTANG/cascadb
28d61545074b8b064ec123f3e565cc47cbcda2a3
[ "BSD-3-Clause" ]
1
2015-05-01T23:52:46.000Z
2015-05-01T23:52:46.000Z
include/cascadb/comparator.h
BohuTANG/cascadb
28d61545074b8b064ec123f3e565cc47cbcda2a3
[ "BSD-3-Clause" ]
44
2015-01-26T15:21:28.000Z
2021-05-29T14:18:35.000Z
// Copyright (c) 2013 The CascaDB Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. See the AUTHORS file for names of contributors. #ifndef CASCADB_COMPARATOR_H_ #define CASCADB_COMPARATOR_H_ #include <assert.h> #include "slice.h" namespace cascadb { class Comparator { public: virtual int compare(const Slice & s1, const Slice & s2) const = 0; virtual ~Comparator(){} }; class LexicalComparator : public Comparator { public: int compare(const Slice & s1, const Slice & s2) const { return s1.compare(s2); } }; template<typename NumericType> class NumericComparator : public Comparator { public: int compare(const Slice & s1, const Slice & s2) const { assert(s1.size() == sizeof(NumericType) && s2.size() == sizeof(NumericType)); NumericType *n1 = (NumericType*)s1.data(); NumericType *n2 = (NumericType*)s2.data(); return *n1 - *n2; } }; } #endif
23.860465
77
0.665692
54d22bbf3bfba520b1780e8a1ad78f0792052db4
23,196
css
CSS
.nuxt/dist/client/app/24120820.5acc87e.css
GACHAIN/gachain.org
449b6d4f8b28783e52cc1500b4dfbe0c9fd76088
[ "MIT" ]
1
2021-05-28T09:53:08.000Z
2021-05-28T09:53:08.000Z
.nuxt/dist/client/app/24120820.5acc87e.css
GACHAIN/gachain.org
449b6d4f8b28783e52cc1500b4dfbe0c9fd76088
[ "MIT" ]
null
null
null
.nuxt/dist/client/app/24120820.5acc87e.css
GACHAIN/gachain.org
449b6d4f8b28783e52cc1500b4dfbe0c9fd76088
[ "MIT" ]
1
2022-03-05T09:14:27.000Z
2022-03-05T09:14:27.000Z
.nuxt-progress{position:fixed;top:0;left:0;right:0;height:2px;width:0;opacity:1;transition:width .1s,opacity .4s;background-color:#c4171d;z-index:999999}.nuxt-progress.nuxt-progress-notransition{transition:none}.nuxt-progress-failed{background-color:red}a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,embed,fieldset,figcaption,figure,footer,form,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,summary,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{border:0;vertical-align:baseline;outline:none}*,p{margin:0;padding:0}li,ol,ul{list-style:none}table{border-collapse:collapse;border-spacing:0}caption,td,th{text-align:left;font-weight:400;vertical-align:middle}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:"";content:none}a img{border:none}a{text-decoration:none}*,:after,:before{box-sizing:border-box;margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}#__layout,#__nuxt,body,html{width:100%;overflow:hidden;overflow-y:auto;height:100%}.layout-enter-active,.layout-leave-active{transition:opacity .5s}.layout-enter,.layout-leave-active{opacity:0}.page-enter-active,.page-leave-active{transition:opacity .5s}.page-enter,.page-leave-active{opacity:0}.global .ant-layout{min-height:100vh;font-family:Noto Sans SC,Microsoft YaHei,sans-serif,serif;line-height:1.5em;background:#f3f5f7;color:#666;font-size:14px;font-weight:400}.global a{color:#666}.global .ant-btn:active,.global .ant-btn:focus,.global .ant-btn:hover{background-color:#c4171d;color:#fff}.global .ant-layout-content{width:100%;background:#f3f5f7;overflow:hidden}.global .ant-layout-header{height:90px;padding:0;background:#fff}.global .ant-layout-footer{line-height:1.5;padding:0;color:#fff;background:#1e1e1e}.global-fixed{position:fixed;top:0;left:0;z-index:999;box-shadow:0 0 10px rgba(196,23,29,.2);width:100%}.global .hao-back-box{position:fixed;width:40px;height:40px;z-index:1000;right:30px;bottom:100px;cursor:pointer;background:#c4171d;border-radius:25px;text-align:center}.global .hao-back-box .hao-back-icon{position:absolute;top:0;left:8px;font-size:25px;color:#fff;margin-top:7px;display:inline-block}.global .ant-pagination-item-active,.global .ant-pagination-item:hover{font-weight:500;background:#c4171d;border-color:#c4171d;color:#fff}.global .ant-pagination-item-active a,.global .ant-pagination-item-active a:hover{color:#fff}.header-logo{width:50px;height:50px}.header-logo a{display:block;width:100%;height:100%;background-size:100% 100%}.nav-active-link{color:#c4171d}.slideInUp{z-index:1300}.header{display:flex;position:relative;justify-content:space-between;align-items:center;height:90px}.header-logo{width:120px}.header-logo img{width:100%}.header-nav{display:flex}.header-nav a{margin-left:30px;font-size:16px}.header-nav .nav-active-link,.header-nav a:hover{font-weight:bolder;color:#c4171d}.header-slide{width:30px;margin-left:auto;margin-right:20px}.header-slide img{width:100%}.header-aside{height:100vh;position:absolute;background-color:rgba(0,0,0,.5);right:0;top:0;z-index:1000;width:0;transition:width 1s;display:flex}.header-aside-content{width:50%;background-color:#fff;height:100vh;margin-left:auto}.header-aside-top{height:80px;display:flex;align-items:center;padding:20px}.header-aside-top i{font-size:25px;margin-left:auto}.header-aside-link a{color:#333;display:block;height:1.5rem;text-align:center;line-height:1.5rem;font-size:18px;margin-bottom:20px}.header-aside-link .nav-active-link{color:#c4171d;font-weight:550}.header-width,.home{width:100%}.home,.home-back{overflow:hidden}.home-back{background:url(/_nuxt/img/80cf17a.png) no-repeat top;background-size:100% 550px;color:#fff;height:auto;padding:50px 0}.home-back-btn{padding:20px 0}.home-back-btn .ant-btn{height:40px}.home-back-btn-center{text-align:center;color:#c4171d;padding-top:10px}.home-back-text{line-height:2em}.home-back-second{display:flex;justify-content:flex-start;padding-top:30px;padding-bottom:50px;flex-wrap:wrap;color:#666}.home-back-second-item{background-color:#fff;margin-top:40px;color:#666;box-shadow:0 2px 10px #dfdfdf}.home-back-second-item:nth-child(4),.home-back-second-item:nth-child(8){margin-right:0}.home-back-second-item.ant-col{padding:20px}.home-back-second-img img{width:50px}.home-three{color:#666}.home-three-title{font-size:2.6vh;margin:0;padding-bottom:15px}.home-three-title,.home-three-title-text{font-weight:700;color:#333;text-align:center;line-height:1.5em}.home-three-title-text{font-size:25px;margin-bottom:30px}.home-three-title-samll{border-left:5px solid #c4171d;font-size:16px;font-weight:700}.home-three-appear{text-align:center;color:#333;margin-bottom:40px}.home-three-img,.home-three-img img{width:100%}.home-three-box{display:flex;justify-content:flex-start;flex-wrap:wrap;margin-top:50px;padding:20px;box-shadow:0 10px 10px #dfdfdf;background-color:#fff}.home-three-box>*{width:50%;display:flex;align-items:center}.home-three-box>* img{width:25px}.home-three-box-1{border-right:2px solid #dfdfdf}.home-three-box-1,.home-three-box-2{border-bottom:2px solid #dfdfdf;padding-bottom:20px}.home-three-box-2{padding-left:20px}.home-three-box-3{border-right:2px solid #dfdfdf;padding-top:20px}.home-three-box-4{padding-left:20px;padding-top:20px}.home-three-box span{margin-left:10px;display:inline-block}.home-three-last{display:flex;align-items:center;padding:20px;box-shadow:0 2px 10px #dfdfdf;margin-bottom:30px;background-color:#fff;height:120px}.home-three-last img{width:80px}.home-three-last-content{margin-left:35px}.home-three-last-content .home-three-title-samll{border:none}.home-second{background-repeat:no-repeat;background-position:50%;background-size:cover;padding:50px 0}.home-second .home-back-second-content,.home-second .home-three-title{color:#fff;line-height:1.5em}.home-third{background-color:#fff;padding-top:40px;margin-bottom:40px}.home-third-img{width:100%;margin-bottom:50px;text-align:center}.home-third-img img{width:80%}.home-third .home-three-title-samll{border:none;text-align:center;display:flex;justify-content:center}.home-third .home-three-title-samll img{width:30px}.home-third .home-three-title-samll span{padding:0 10px}.home-third-back{width:100%;height:450px;background:url(/_nuxt/img/a77422b.png) no-repeat 0 100%;background-size:80% 400px}.home-third-back-back{width:100%;height:450px;background:url(/_nuxt/img/4e36ec9.png) no-repeat 70% top;background-size:60% 450px}.home-third-back-back-back{width:100%;height:450px;background:url(/_nuxt/img/1b4bd22.png) no-repeat 100% 100%;background-size:30% 80%}.home-carousel{display:flex;justify-content:center;margin-bottom:30px}.home-carousel-box .swiper-img{height:300px}.home-fourth{margin-bottom:20px}.home-fourth .home-three-title{position:relative;margin-bottom:30px}.home-fourth .home-three-title:before{content:"";position:absolute;display:block;width:40px;height:5px;bottom:0;left:calc(50% - 22px);background-color:#c4171d}.home-fourth-box{background-color:#fff;display:block;height:100%}.home-fourth-box img{height:150px}.home-fourth-box-img,.home-fourth-box img{display:block;width:100%}.home-fourth-box-date{color:#999;font-size:14px}.home-fourth .home-three-title-samll{font-size:16px;border:none}.home-fifth{background:url(/_nuxt/img/99bc0b6.png) no-repeat 50%;background-size:cover;padding:30px 0}.home-fifth,.home-sixth{margin-bottom:50px}.home-sixth-box{display:flex;justify-content:space-around;position:relative;align-items:center;height:70px}.home-sixth-box-item{width:150px;margin-left:23px;margin-right:23px;opacity:1;text-align:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.home-sixth-box-item img{width:100%}.home-sixth-box i{color:#aeaeae;font-size:20px;cursor:pointer}.home-sixth-box-left{left:-20px;top:25px;position:absolute}.home-sixth-box-right{right:-20px;top:25px;position:absolute}.home-sixth .anticon.disabled{cursor:not-allowed}.home video{width:100%!important;height:100%!important;-o-object-position:center;object-position:center;-o-object-fit:fill;object-fit:fill}.home .video-js.vjs-4-3,.home .video-js.vjs-16-9,.home .video-js.vjs-fluid{border:none}.home .vjs-poster{background-size:100% 100%}.home .vjs-custom-skin>.video-js .vjs-big-play-button{height:80px!important;line-height:80px!important;margin-top:-40px!important;width:80px;border-radius:50%;left:calc(50% + 20px);color:#c4171d;background-color:#fff}.home .link-a{background-color:#c4171d;color:#fff}.home .link-a,.home .link-a-none{padding:10px 20px;display:inline-block}.home .link-a-none{background-color:#fff}.threeBefore{content:"";position:absolute;display:block;width:40px;height:5px;bottom:0;left:calc(50% - 22px);background-color:#c4171d}.video{position:relative;width:100%;height:250px}.video-content{z-index:1}.video-content,.video-poster{position:absolute;left:0;top:0}.video-poster{width:100%;z-index:10;height:100%;background:url(/_nuxt/img/ad8100a.png) no-repeat 50%;background-size:100% 100%}.video-poster img{width:80px;height:80px;position:absolute;margin:auto;left:0;right:0;top:0;bottom:0;cursor:pointer}.footer{background:url(/_nuxt/img/c9e1922.png) no-repeat 50%;background-size:cover;padding:50px 0;color:#ccc;font-size:14px}.footer-box{width:100%}.footer-box-logo{padding-bottom:10px}.footer-box-logo img{width:150px}.footer-box-text{padding-bottom:10px;display:flex;align-items:center}.footer-box-text img{width:20px}.footer-box-text span{margin-left:10px}.footer .ant-col-lg-16{padding-bottom:20px;border-bottom:1px solid hsla(0,0%,100%,.2);margin-bottom:20px}.footer-bottom{text-align:center}.footer-wei{display:inline-flex;align-items:center;justify-content:center;flex-wrap:wrap;width:48%;height:100%}.footer-wei img{width:80%}.footer-wei span{padding-top:10px}.footer-message{display:flex;justify-content:space-between;align-items:center;margin-top:20px}.footer-message a{color:#ccc}.footer-message-img{width:30px}.footer-message-item{text-align:center}.footer-message-item>*{display:block}.footer-message-item img{width:20px;margin:auto;padding-bottom:10px}.product{width:100%;line-height:2em}.product-text{line-height:2em;text-indent:2em;font-size:13px}.product-video{padding-top:20px;padding-bottom:90px;width:100%}.product-video .video{width:100%}.product-video .video video{width:100%;height:100%}.product-video .video-poster{background:url(/_nuxt/img/c38bf46.png) no-repeat 50%;background-size:100% 100%}.product-img{margin-top:20px;margin-bottom:20px;width:100%}.product-img img{width:100%}.product-img .third-4{width:30px}.product .product-img.computer{margin-bottom:50px}.product-first{color:#fff;background:url(/_nuxt/img/686532c.png) no-repeat 50%;background-size:cover;padding:100px 0;text-align:center}.product-second{padding-top:50px}.product-second .home-three-last-content{margin-left:0}.product-second .ant-col{margin-bottom:40px}.product-second .home-three-last{height:100%;align-items:flex-start;padding-bottom:0}.product-second .home-three-last img{width:120px;margin-left:20px;height:100px}.product .home-three-title-samll{padding-left:0;padding-bottom:10px;border:none;padding-top:20px;text-align:center}.product .home-three-title{position:relative;margin-bottom:60px;margin-top:20px}.product .home-three-title:before{content:"";position:absolute;display:block;width:40px;height:5px;bottom:0;left:calc(50% - 22px);background-color:#c4171d}.product-third-img{width:60px;margin:auto;display:block}.product-third-text{color:#666}.product-fourth{padding:30px 0;margin-bottom:70px}.product-fourth-white{background-color:#fff}.product-fourth-img{width:100%}.product-sixth{margin:50px 0}.product-sixth img{width:100%}.product-seventh{background:#fff;padding-top:60px;padding-bottom:70px}.service-first{background:url(/_nuxt/img/2fd43e6.png) no-repeat 50%;background-size:cover;padding:50px 0;color:#fff}.service-title{font-size:20px;margin-bottom:30px}.service-title,.service-title-samll{font-weight:700;text-align:center;color:#333}.service-title-samll{font-size:18px;margin:10px 0}.service-second{background-color:#fff;padding:50px 0;margin-bottom:50px}.service-second-left{padding-bottom:30px}.service-second-left:first-child{padding-bottom:70px}.service-second-right{padding-top:54px;padding-left:20%;border-left:1px solid #dfdfdf}.service-second-right:last-child{padding-top:55px}.service-btn{display:flex;align-items:center;margin:20px 0}.service-btn a{padding:10px 20px;color:#fff}.service-btn a:last-child{border:1px solid #fff;margin-left:20px;padding:8px 20px}.service-btn a:first-child{background-color:#c4171d}.service-btn a:first-child:hover{color:#fff;background-color:rgba(196,23,29,.8)}.service-fourth-box .product-text{text-align:left;text-indent:2em;margin-bottom:10px}.service-fifth{background:url(/_nuxt/img/9a5f2c9.png) no-repeat 50%;padding:50px 0}.service-fifth .product-text{color:#fff;text-align:center}.service-fifth-btn{text-align:center}.service-fifth-btn a{color:#fff}.service-fifth-github{border:1px solid #fff;padding:10px 20px;color:#fff;display:inline-flex;align-items:center}.service-fifth-github img{margin-right:10px}.font{font-weight:700;text-align:center;color:#333}.solution{width:100%}.solution-first{background:url(/_nuxt/img/b8b815c.png) no-repeat 50%;background-size:cover;padding:100px 0;color:#fff;margin-bottom:50px}.solution-first-text{width:80%;line-height:2em;text-align:center;margin:auto auto 50px}.solution-first-btn{text-align:center}.solution-first-btn a{padding:10px 20px;color:#c4171d;border-radius:5px}.solution-second{width:100%}.solution-second .ant-col-lg-11{margin-bottom:30px}.solution-second-box{background-color:#fff;box-shadow:0 2px 10px #dfdfdf;height:100%;width:100%}.solution-second-box-img{margin-bottom:20px}.solution-second-box-img img{width:100%}.solution-second-box-samll{font-weight:700;font-size:18px;margin-bottom:10px;color:#333}.solution-second-box-text{text-align:left;text-indent:2em;margin-bottom:5px}.solution-second-content{padding:0 30px 30px;text-align:left}.about-first{background:url(/_nuxt/img/282635b.png) no-repeat top;background-size:100% 350px;padding:30px 0;text-align:center;color:#fff}.about-first-text{text-align:left;text-indent:2em;margin-bottom:10px;font-size:13px}.about-first-one{color:#666;padding:30px 0}.about-first-one .service-title{position:relative;display:inline-block}.about-first-one .service-title:before{left:-130px}.about-first-one .service-title:after,.about-first-one .service-title:before{content:"";position:absolute;display:block;width:100px;height:1px;background-color:#bcc6c9;bottom:10px}.about-first-one .service-title:after{right:-130px}.about-first-one img{width:100%}.about-first-one-title{font-size:16px;font-weight:700;margin:.5em 0;-webkit-line-clamp:2;text-align:left}.about-first-one-content,.about-first-one-title{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}.about-first-one-content{-webkit-line-clamp:3}.about-first-one-date{display:flex;align-items:center;color:#999;font-size:14px;padding:10px 20px 20px}.about-first-one-date i{margin-left:auto;font-weight:700}.about-first-one-shadow{box-shadow:0 2px 10px #dfdfdf}.about-first-one-clamp1{-webkit-line-clamp:1}.about-first-one-clamp2{-webkit-line-clamp:2}.about-first-one-pagination{text-align:right}.about-first-one-right{display:flex;align-items:center;height:100px;margin-bottom:15px}.about-first-one-right p{width:120px;height:100px;margin:0}.about-first-one-right img{width:120px;height:100px}.about .home-three-title{position:relative;margin-bottom:30px}.about .home-three-title:before{content:"";position:absolute;display:block;width:40px;height:5px;bottom:0;left:calc(50% - 22px);background-color:#c4171d}.about-second{background:url(/_nuxt/img/8968d99.png) no-repeat 50%;background-size:cover;padding:50px 0}.about-second-box{display:flex;justify-content:space-between;text-align:center;align-items:center}.about-second-box-item{width:30%;font-size:25px}.about-second-box-item-border{width:1px;height:40%;background:#fff}.about-second-box-item img{width:80px}.about-second-box-item-text{color:#fff;padding:10px 0}.about-fourth{padding:50px 0}.about-three-appear{margin-bottom:30px;text-align:center}.about .about-first-one-right-box{padding:0 20px}.about-buttom{margin-bottom:15px;display:flex;align-items:center}.about-buttom-right{margin-left:auto}.about-buttom img{margin-right:10px}.about-buttom-first{width:30px}.about-buttom-second{width:25px;margin-right:10px}.about-buttom-box{margin-bottom:10px;margin-left:40px;display:flex;align-items:center}.about-buttom-box img{width:20px}.about-buttom-box span{width:calc(100% - 60px)}.about-sixth{margin-bottom:50px}.clamp{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}.news{margin:50px 0}.news-box{padding:20px;background-color:#fff;line-height:2em;margin-bottom:30px}.news-box-info{display:flex;align-items:center;justify-content:center;padding-bottom:20px}.news-box-info>*{margin:0 10px;font-size:14px;color:#999}.news-box img{max-width:100%}.news-other{width:100%;background-color:#fff;overflow:hidden;margin-bottom:30px}.news-other-title{width:80%;margin:20px auto}.news-other a{display:block;width:80%;margin:auto;color:#333;font-weight:700}.news-other a:hover{color:#c4171d}.news-other a p{height:100px}.news-other a img{width:100%;height:100px}.news-next{background-color:#fff;padding:20px}.news-next a{display:block;margin:auto;color:#333;font-weight:700}.news-next a:hover{color:#c4171d}.mobile-box{padding:20px;background-color:#fff;margin-top:30px}.mobile-box .home-back-title{color:#333}.mobile .home-back-second-item:last-child{margin-bottom:50px}.mobile .home-second{padding:20px 0}.mobile .footer-message{margin:0;flex-wrap:wrap}.mobile-footer-message{display:flex;margin-top:25px;margin-bottom:25px;margin-left:10px}.mobile-footer-message a{margin-right:20px}.mobile .service-btn{text-align:center;justify-content:center;margin-top:0}.mobile .service-btn a:last-child{color:#c4171d;border:1px solid #dfdfdf}.mobile-about-first{background:url(/_nuxt/img/ccb2bed.png) no-repeat 50%;background-size:100% 100%;text-align:center;padding:60px 0}.mobile-about-first img{width:100%}.mobile-about-first-box{padding:30px 20px;background-color:#fff}.mobile-about-first-box img{width:100%}.mobile-about-first .home-back-text{color:#fff}.mobile .home-sixth-box{flex-wrap:wrap;margin-top:20px}.mobile .home-sixth-box-btn{position:absolute;bottom:-30px;margin:auto;text-align:center}.mobile .home-sixth-box-btn-item{width:30px;height:10px;display:inline-block;background:#dfdfdf;opacity:1;border-radius:7px;cursor:pointer;margin:10px}.mobile .home-sixth-box-btn .active{background-color:#c4171d}.mobile .home-sixth-box-item{width:40%;margin-bottom:10px;margin-left:0;margin-right:0}.mobile .footer-message-mobile{margin-left:10px}.mobile .footer-message-mobile a{display:flex;align-items:center;width:100%;text-align:left;margin-top:25px;color:#fff}.mobile .footer-message-mobile img{width:30px;height:30px}.mobile .footer-message-mobile span{margin-left:10px}.mobile .time-item{width:60px;margin-left:30px}.mobile .time-item:first-child{margin-left:0}.mobile .time-item-axis{width:65px;background-color:rgba(196,23,29,.5);background-image:none}.mobile .time-item-odd-line{margin-left:75px;height:60px;margin-top:8px}.mobile .time-item-even-line{margin-left:75px;height:60px;margin-top:0}.mobile .time-item-even,.mobile .time-item-odd{height:70px}.mobile .time-item-even-text{top:-60px;right:-105px}.mobile .time-item-odd-text{top:60px;right:-105px}.mobile .product-back{width:80%}.mobile-first{background-color:#fff;padding-top:25px}.mobile .service-btn1{margin:0}.home-back-second-content{line-height:2em;font-size:13px;text-indent:2em}.mobile{display:none}.fontWeight{font-weight:700;line-height:1.5em}.title-h1__white{color:#fff;padding-bottom:30px}.title-h1__black,.title-h1__white{font-size:32px;font-weight:700;line-height:1.5em}.title-h1__black{color:#333}.title-h2__black{color:#333;padding-bottom:28px}.title-h2__black,.title-h2__white{font-size:25px;text-align:center;font-weight:700;line-height:1.5em}.title-h2__white{padding-bottom:15px;color:#fff}.title-h3__black{color:#333;padding-top:15px;padding-bottom:15px;text-align:center}.title-h3__black,.title-h3__white{font-size:16px;font-weight:700;line-height:1.5em}.title-h3__white{color:#fff}.title-h__center{display:flex;justify-content:center;align-items:center}.title-h__center img{width:30px}.mobile-line{position:relative;padding-left:10px}.mobile-line:after{content:"";position:absolute;display:block;width:5px;height:20px;left:0;top:18px;background:#c4171d}@media screen and (max-width:992px){.global .title-h1__white{color:#fff}.global .title-h1__black,.global .title-h1__white{font-size:16px;text-align:center;padding-top:10px;padding-bottom:20px;font-weight:700;line-height:1.5em}.global .title-h1__black{color:#333}.global .title-h2__black{color:#333;padding-bottom:25px}.global .title-h2__black,.global .title-h2__white{font-size:16px;text-align:center;font-weight:700;line-height:1.5em}.global .title-h2__white{color:#fff;padding-bottom:15px}.global .title-h3__black{color:#333;font-size:14px;padding-top:15px;padding-bottom:15px;text-align:center;font-weight:700;line-height:1.5em}.global .title-h3__white{color:#fff;font-size:14px;font-weight:700;line-height:1.5em}.global .about-second-box-item img{width:28px}.global .about-second-box-item{font-size:12px}.global .home-three-box{margin-top:20px;margin-bottom:25px}.global .home-three-last{margin-bottom:15px}.computer{display:none}.mobile{display:block}.header-logo{margin-left:20px}.product-first{padding:50px 0}.product-second .home-three-last img{width:60px;height:auto}.product-second .ant-col{margin-bottom:20px}.product .home-three-title{margin-top:0;margin-bottom:30px}.product-third-img{width:30px}.product-fourth{margin-bottom:20px;padding:15px 0}.product-fourth .mobile-title-h3__black{padding-top:0}.mobile-back{padding-bottom:30px}.home-carousel{margin-bottom:10px}.product .home-three-title-samll{padding-bottom:0}.home-third{margin-bottom:30px}.product-sixth{margin:25px 0}.product-seventh{padding-top:30px;padding-bottom:20px}.solution-second-content{padding:0 20px 20px}.solution-second-content .title-h3__black{padding-top:0}.service-first{padding:25px 0;margin-bottom:0}.service-second-left:first-child{padding-bottom:20px}.service-second{padding:30px 0;margin-bottom:25px}.mobile-product-text{border-bottom:1px solid #dfdfdf;padding-bottom:20px}.product-video{padding-bottom:30px}.about-first-one-pagination{text-align:center}.about .home-three-title{margin-bottom:20px}.about-three-appear{margin-bottom:10px}.about-second{padding:20px 0}.about-second-box-item-content{color:#fff}.about-buttom{margin-bottom:0}.home-fifth,.solution-first{margin-bottom:30px}.home-sixth .swiper-pagination .swiper-pagination-bullet,.swiper-pagination .swiper-pagination-bullet{width:10px;border-radius:2px;height:4px}.home-sixth{margin-bottom:30px}.home-third-img{margin-bottom:25px}.home-sixth .mobile .swiper-container .swiper-slide{padding-bottom:0}.mobile-line:after{top:2px}.product-third .home-three-title-samll{padding-top:15px}}
23,196
23,196
0.798327
53900ed2fe0641ace3b4e49b1a4b61853b5a53c6
904
swift
Swift
CustomAlert-Example/Alerts/ViewControllers/Alerts/InformationalAlertViewController.swift
wibosco/CustomAlert-Example
804d926b8b7d2b57e9b9c875faff0ab48b46b46c
[ "MIT" ]
5
2019-09-29T16:06:04.000Z
2022-03-31T07:03:08.000Z
CustomAlert-Example/Alerts/ViewControllers/Alerts/InformationalAlertViewController.swift
wibosco/CustomAlert-Example
804d926b8b7d2b57e9b9c875faff0ab48b46b46c
[ "MIT" ]
null
null
null
CustomAlert-Example/Alerts/ViewControllers/Alerts/InformationalAlertViewController.swift
wibosco/CustomAlert-Example
804d926b8b7d2b57e9b9c875faff0ab48b46b46c
[ "MIT" ]
1
2022-03-31T07:03:46.000Z
2022-03-31T07:03:46.000Z
// // InformationalAlertViewController.swift // CustomAlert-Example // // Created by William Boles on 26/10/2019. // Copyright © 2019 William Boles. All rights reserved. // import UIKit class InformationalAlertViewController: UIViewController { @IBOutlet weak var titleLabel: UILabel! @IBOutlet weak var button: UIButton! private var viewModel: InformationalAlertViewModel? // MARK: - Configure func configure(withViewModel viewModel: InformationalAlertViewModel) { self.viewModel = viewModel titleLabel.text = viewModel.title button.setTitle(viewModel.button.title, for: .normal) } // MARK: - Actions @IBAction func buttonPressed(_ sender: Any) { guard let viewModel = viewModel else { fatalError("Alert needs a view model") } viewModel.button.action?() } }
25.111111
74
0.65708
b3bcce79149944ac0b6446016ab3e9f965874537
544
sh
Shell
LIMS_RNA_Pipeline/wrapper.sh
NCI-CGR/RNA_CGR_Pipeline
307107eb0753087f7abd0b9d8fc3906ddfdac33a
[ "MIT" ]
null
null
null
LIMS_RNA_Pipeline/wrapper.sh
NCI-CGR/RNA_CGR_Pipeline
307107eb0753087f7abd0b9d8fc3906ddfdac33a
[ "MIT" ]
null
null
null
LIMS_RNA_Pipeline/wrapper.sh
NCI-CGR/RNA_CGR_Pipeline
307107eb0753087f7abd0b9d8fc3906ddfdac33a
[ "MIT" ]
1
2021-12-14T17:16:17.000Z
2021-12-14T17:16:17.000Z
#/bin/bash # subshells do not inherit bash functions, so conda must be initialized again source /DCEG/Resources/Tools/miniconda/miniconda3/etc/profile.d/conda.sh source activate /DCEG/Resources/Tools/miniconda/miniconda3/envs/rnaseq_qc dir=$(pwd) mkdir -p $dir/logs # create running flag here touch RNA.QC.Running snakemake \ --cluster "qsub -pe by_node {threads} \ -V -j y \ -S /bin/bash \ -cwd \ -o ${dir}/logs" \ --jobs 500 --latency-wait 120 \ --keep-going \ --rerun-incomplete \ --restart-times 5 \
23.652174
77
0.676471
f40ebecdaf613efd2c360d9105931b53a8392897
1,619
cs
C#
perseus-plugin/Source Code/PluginEBprot/MatrixProcessing.cs
cssblab/EBprot
da0b0917653efe4c661e43615327b5f483e84f11
[ "Apache-2.0" ]
null
null
null
perseus-plugin/Source Code/PluginEBprot/MatrixProcessing.cs
cssblab/EBprot
da0b0917653efe4c661e43615327b5f483e84f11
[ "Apache-2.0" ]
null
null
null
perseus-plugin/Source Code/PluginEBprot/MatrixProcessing.cs
cssblab/EBprot
da0b0917653efe4c661e43615327b5f483e84f11
[ "Apache-2.0" ]
null
null
null
using BaseLibS.Graph; using BaseLibS.Num; using BaseLibS.Param; using BaseLibS.Parse; using PerseusApi.Document; using PerseusApi.Generic; using PerseusApi.Matrix; using PerseusApi.Utils; using System; using System.Collections.Generic; using System.IO; using System.Linq; namespace PluginEBprot { public abstract class MatrixProcessing : IMatrixProcessing { public abstract string Name { get; } public abstract string Description { get; } public virtual float DisplayRank => 1; public virtual bool IsActive => true; public virtual int GetMaxThreads(global::BaseLibS.Param.Parameters parameters) => 1; public virtual bool HasButton => false; public virtual Bitmap2 DisplayImage => null; //insert github plugin in the future public virtual string Url => "https://www.ncbi.nlm.nih.gov/pubmed/25913743"; public virtual string Heading => "EBprot"; public virtual string HelpOutput { get; } public virtual string[] HelpSupplTables { get; } public virtual int NumSupplTables { get; } public virtual string[] HelpDocuments { get; } public virtual int NumDocuments { get; } public virtual Parameters GetParameters(IMatrixData mdata, ref string errString) { Parameters parameters = new Parameters(); return parameters; } public virtual void ProcessData(IMatrixData mdata, global::BaseLibS.Param.Parameters param, ref IMatrixData[] supplTables, ref IDocumentData[] documents, ProcessInfo processInfo) { } } }
27.913793
186
0.684373
c9aa001b5219d31aab786422ff5625a2b1fb1168
289
ts
TypeScript
src/modules/rental/rental.module.ts
aadelgrossi/rentx-api
f143c8f2fdd7a7b37cd53cb65a5d4a483b475c88
[ "MIT" ]
1
2021-06-28T17:42:27.000Z
2021-06-28T17:42:27.000Z
src/modules/rental/rental.module.ts
aadelgrossi/rentx-api
f143c8f2fdd7a7b37cd53cb65a5d4a483b475c88
[ "MIT" ]
3
2021-01-20T19:28:20.000Z
2021-01-26T17:05:12.000Z
src/modules/rental/rental.module.ts
aadelgrossi/rentx-api
f143c8f2fdd7a7b37cd53cb65a5d4a483b475c88
[ "MIT" ]
null
null
null
import { Module } from '@nestjs/common' import { PrismaService } from 'src/services' import { RentalResolver } from './rental.resolver' import { RentalService } from './rental.service' @Module({ providers: [RentalResolver, RentalService, PrismaService] }) export class RentalModule {}
26.272727
59
0.740484
27832e3f4d93c14a9fbb35d211e9e65e1bc0c990
387
sql
SQL
ORACLE_SQL/SHARED_FUNCTIONS/14_ORG/14F001_ORG.GET_DIV_TYPE.sql
rhomicom-systems-tech-gh/Rhomicom-DB-Scripts
ac36d96a5883097a1f0c86909cb516e456f154f9
[ "MIT" ]
1
2022-01-12T06:39:23.000Z
2022-01-12T06:39:23.000Z
ORACLE_SQL/SHARED_FUNCTIONS/14_ORG/14F001_ORG.GET_DIV_TYPE.sql
rhomicom-systems-tech-gh/Rhomicom-DB-Scripts
ac36d96a5883097a1f0c86909cb516e456f154f9
[ "MIT" ]
null
null
null
ORACLE_SQL/SHARED_FUNCTIONS/14_ORG/14F001_ORG.GET_DIV_TYPE.sql
rhomicom-systems-tech-gh/Rhomicom-DB-Scripts
ac36d96a5883097a1f0c86909cb516e456f154f9
[ "MIT" ]
1
2020-12-19T15:27:29.000Z
2020-12-19T15:27:29.000Z
/* Formatted on 12-20-2018 9:36:40 AM (QP5 v5.126.903.23003) */ CREATE OR REPLACE FUNCTION ORG.GET_DIV_TYPE (P_DIVID NUMBER) RETURN VARCHAR2 AS L_RESULT VARCHAR2 (200 BYTE); BEGIN L_RESULT := ''; SELECT GST.GET_PSSBL_VAL1 (ORG.GET_DIV_TYPE_ID (P_DIVID)) INTO L_RESULT FROM DUAL; RETURN L_RESULT; EXCEPTION WHEN OTHERS THEN RETURN ''; END; /
20.368421
63
0.669251
4337f96fe551f532a290559efbd80a745106167e
358
ts
TypeScript
FE/app/src/app/entities/pais/pais.module.ts
francoo27/JavaTPI
9bfba5895f250fa28c721a72d95e7254e7be47f3
[ "MIT" ]
1
2021-04-27T21:22:30.000Z
2021-04-27T21:22:30.000Z
Sistema/FE/app/src/app/entities/pais/pais.module.ts
francoo27/TPI
53b7a88a491ef785046c208625c745de80200945
[ "MIT" ]
2
2022-01-10T18:34:29.000Z
2022-02-18T20:24:02.000Z
Sistema/FE/app/src/app/entities/pais/pais.module.ts
francoo27/TPI
53b7a88a491ef785046c208625c745de80200945
[ "MIT" ]
null
null
null
import { NgModule } from "@angular/core"; import { RouterModule } from "@angular/router"; import { CineArPaisCommonsModule } from "./pais.commons.module"; import { paisRoute } from "./pais.route"; const ENTITY_STATES = [...paisRoute] @NgModule({ imports: [CineArPaisCommonsModule, RouterModule.forChild(ENTITY_STATES)] }) export class CineArPaisModule{}
35.8
76
0.74581
7eb29605b26b1a41c9faf3434a5f76e48265b73f
2,799
rb
Ruby
features/step_definitions/pathology/request_form_steps.rb
airslie/renalware-core
395fd25b7ef78cf959d8ebe1d3d44a65dd7c02c9
[ "MIT" ]
3
2018-08-17T15:18:08.000Z
2019-09-01T10:41:09.000Z
features/step_definitions/pathology/request_form_steps.rb
airslie/renalware-core
395fd25b7ef78cf959d8ebe1d3d44a65dd7c02c9
[ "MIT" ]
4
2019-12-31T11:57:22.000Z
2020-03-22T18:35:17.000Z
features/step_definitions/pathology/request_form_steps.rb
airslie/renalware-core
395fd25b7ef78cf959d8ebe1d3d44a65dd7c02c9
[ "MIT" ]
2
2018-06-20T14:57:19.000Z
2021-02-15T22:34:37.000Z
# frozen_string_literal: true Given("Patty has a request form generated with parameters:") do |table| params = table.rows_hash pathology_patient = Renalware::Pathology.cast_patient(@patty) @request_forms = generate_request_forms_for_single_patient( @clyde, clinic: params[:clinic], consultant: params[:consultant], telephone: params[:telephone], template: params[:template], patients: [pathology_patient] ) end When(/^Clyde chooses the consultant (\w+\s\w+)$/) do |user_name| @request_forms = update_request_form_user(user_name) end When("Clyde chooses the clinic {word}") do |clinic_name| @request_forms = update_request_form_clinic(clinic_name) end When("Clyde chooses the telephone number {int}") do |telephone| @request_forms = update_request_form_telephone(telephone) end When("Clyde generates the request forms for the appointments with the following parameters:") do |table| params = Hash[table.rows].with_indifferent_access @appointments = view_appointments(@clyde) @request_forms = generate_request_forms_for_appointments(@clyde, @appointments, params) end When("Clyde generates the request forms for the appointments sorted by user with the following parameters:") do |table| params = Hash[table.rows].with_indifferent_access @appointments = view_appointments(@clyde, q: { s: "user_family_name asc" }) @request_forms = generate_request_forms_for_appointments(@clyde, @appointments, params) end When("Clyde generates the request form for {word} with the following parameters:") do |patient_name, table| params = Hash[table.rows] .merge(patients: [patient_name]) .with_indifferent_access @request_forms = generate_request_forms_for_single_patient(@clyde, params) end When("Clyde prints Patty's request form") do print_request_forms(@request_forms) end Then("Clyde sees these details at the top of {word}'s form") do |patient_name, table| patient = get_patient(patient_name) expect_patient_summary_to_match_table(@request_forms, patient, table.rows_hash) end Then("Clyde sees the following pathology requirements for {word}:") do |patient_name, table| patient = get_patient(patient_name) expect_pathology_form(@request_forms, patient, table.rows_hash) end Then("Clyde sees the requests forms for these patients:") do |table| patients = table.rows.map do |patient_full_name, _user_full_name| given_name, family_name = patient_full_name.split(" ") Renalware::Pathology::Patient.find_by(given_name: given_name, family_name: family_name) end expect_pathology_forms_for_patients(@request_forms, patients) end Then("Patty has the request recorded and printed:") do |table| params = table.rows_hash.with_indifferent_access expect_request_form_recorded_and_printed(@patty, params) end
35.43038
119
0.775634
e140edcbe2b8240aa0509667073f67ffc7c6b72e
1,769
go
Go
hull_test.go
ctessum/tilegram
e65fb671f3c3e0b93ad16aca73375d48c2c94b08
[ "MIT" ]
null
null
null
hull_test.go
ctessum/tilegram
e65fb671f3c3e0b93ad16aca73375d48c2c94b08
[ "MIT" ]
null
null
null
hull_test.go
ctessum/tilegram
e65fb671f3c3e0b93ad16aca73375d48c2c94b08
[ "MIT" ]
null
null
null
// Copyright ©2016 The tilegram Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package tilegram import ( "fmt" "reflect" "sort" "testing" "github.com/ctessum/geom" ) func TestHull(t *testing.T) { d := []geom.Polygonal{ geom.Polygon{{{0, 0}, {1, 0}, {1, 1}, {0, 1}}}, geom.Polygon{{{1, 0}, {2, 0}, {2, 1}, {1, 1.01}}}, geom.Polygon{{{1, 1}, {2, 1}, {2, 2}, {1, 2}}}, geom.Polygon{{{0, 1}, {1, 1}, {1, 2}, {0, 2}}}, } want := normalize(geom.Polygon{{{0, 0}, {2, 0}, {2, 2}, {0, 2}, {0, 1}}}) have := normalize(newHull(0.1, d...)) have = have.Simplify(0.0001).(geom.Polygon) if !reflect.DeepEqual(normalize(want), normalize(have)) { t.Errorf("want: %v, have %v", dump(want), dump(have)) } } type sorter geom.Polygon func (s sorter) Len() int { return len(s) } func (s sorter) Swap(i, j int) { s[i], s[j] = s[j], s[i] } func (s sorter) Less(i, j int) bool { if len(s[i]) != len(s[j]) { return len(s[i]) < len(s[j]) } for k := range s[i] { pi, pj := s[i][k], s[j][k] if pi.X != pj.X { return pi.X < pj.X } if pi.Y != pj.Y { return pi.Y < pj.Y } } return false } // basic normalization just for tests; to be improved if needed func normalize(poly geom.Polygon) geom.Polygon { for i, c := range poly { if len(c) == 0 { continue } // find bottom-most of leftmost points, to have fixed anchor min := 0 for j, p := range c { if p.X < c[min].X || p.X == c[min].X && p.Y < c[min].Y { min = j } } // rotate points to make sure min is first poly[i] = append(c[min:], c[:min]...) } sort.Sort(sorter(poly)) return poly } func dump(poly geom.Polygon) string { return fmt.Sprintf("%v", normalize(poly)) }
22.974026
74
0.571509
71879bdd04844c22a483018b2049ae17611ffba6
727
dart
Dart
lib/src/libcec_enum/CEC_display_control.dart
julemand101/cec_dart
5f9741778479664381b573d1c1b1dbac13bc17ef
[ "BSD-3-Clause" ]
1
2020-10-08T06:40:06.000Z
2020-10-08T06:40:06.000Z
lib/src/libcec_enum/CEC_display_control.dart
julemand101/cec_dart
5f9741778479664381b573d1c1b1dbac13bc17ef
[ "BSD-3-Clause" ]
null
null
null
lib/src/libcec_enum/CEC_display_control.dart
julemand101/cec_dart
5f9741778479664381b573d1c1b1dbac13bc17ef
[ "BSD-3-Clause" ]
null
null
null
part of cec_dart; enum CEC_display_control { CEC_DISPLAY_CONTROL_DISPLAY_FOR_DEFAULT_TIME, CEC_DISPLAY_CONTROL_DISPLAY_UNTIL_CLEARED, CEC_DISPLAY_CONTROL_CLEAR_PREVIOUS_MESSAGE, CEC_DISPLAY_CONTROL_RESERVED_FOR_FUTURE_USE, } class _CEC_display_control { static Map<CEC_display_control, int> toValue = { CEC_display_control.CEC_DISPLAY_CONTROL_DISPLAY_FOR_DEFAULT_TIME: 0x00, CEC_display_control.CEC_DISPLAY_CONTROL_DISPLAY_UNTIL_CLEARED: 0x40, CEC_display_control.CEC_DISPLAY_CONTROL_CLEAR_PREVIOUS_MESSAGE: 0x80, CEC_display_control.CEC_DISPLAY_CONTROL_RESERVED_FOR_FUTURE_USE: 0xC0, }; static Map<int, CEC_display_control> toEnum = new Map.fromIterables(toValue.values, toValue.keys); }
36.35
75
0.841816
24b76404fc2a62880fd595e25175ce0973a9d4d6
783
php
PHP
app/Http/Resources/DirectionResource.php
bedr123/gimnazija-laravel
74d77158b63b3663d94b12c25f317691b65e4e01
[ "MIT" ]
null
null
null
app/Http/Resources/DirectionResource.php
bedr123/gimnazija-laravel
74d77158b63b3663d94b12c25f317691b65e4e01
[ "MIT" ]
null
null
null
app/Http/Resources/DirectionResource.php
bedr123/gimnazija-laravel
74d77158b63b3663d94b12c25f317691b65e4e01
[ "MIT" ]
null
null
null
<?php namespace App\Http\Resources; use Illuminate\Http\Resources\Json\JsonResource; class DirectionResource extends JsonResource { /** * Transform the resource into an array. * * @param \Illuminate\Http\Request $request * @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable */ public function toArray($request) { return [ 'id' => $this->id, 'naziv' => $this->naziv, 'opis' => $this->opis, 'ikonica' => $this->ikonica, 'kontent' => $this->kontent, 'slug' => $this->slug, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, 'slike' => $this->images()->get()->toArray() ]; } }
26.1
78
0.544061
0219c96f737ddaa5ce37a1822f6b86220f93de84
3,595
h
C
src/ECS/SpriteC.h
GastaGaming/Gasta2D
77ae264449f0f1db84546a7c72d9fc63dc1085a6
[ "MIT" ]
null
null
null
src/ECS/SpriteC.h
GastaGaming/Gasta2D
77ae264449f0f1db84546a7c72d9fc63dc1085a6
[ "MIT" ]
null
null
null
src/ECS/SpriteC.h
GastaGaming/Gasta2D
77ae264449f0f1db84546a7c72d9fc63dc1085a6
[ "MIT" ]
1
2020-12-03T13:51:26.000Z
2020-12-03T13:51:26.000Z
#pragma once #include "Components.h" #include "SDL.h" #include "../Client/TextureLoader.h" #include <map> #include <string> #include <sstream> struct Animation { int index; int frames; int speed; Animation() {} Animation(int i, int f, int s) { index = i; frames = f; speed = s; } }; class SpriteC : public Component { private: TransformC* transform; CameraC* camera; SDL_Texture* texture; SDL_Rect srcRect, destRect; float angle = 0; bool animated = false; int frames = 0; int speed = 100; // This value is dealy between frames !!!!! in ms public: int animIndex = 0; // Needs to 0 if we dont have animations std::map<std::string, Animation> animations; SDL_RendererFlip spriteFlip = SDL_FLIP_NONE; SpriteC() = default; SpriteC(const char* path) { SetTexture(path); } SpriteC(const char* path, bool isAnimated) { animated = true; Animation idle = Animation(0, 4, 200); Animation walk = Animation(1, 4, 100); animations.emplace("Idle", idle); animations.emplace("Walk", walk); Play("Idle"); SetTexture(path); } SpriteC(const char* path, bool isAnimated, int frames) { animated = isAnimated; Animation idle = Animation(0, frames, 500); animations.emplace("Idle", idle); Play("Idle"); SetTexture(path); } SpriteC(const char* path, bool isAnimated, int numOfAnimations, std::vector<int> framesInAnimation, std::vector<int> delayPerAnimation) { animated = isAnimated; for (int i = 0; i < numOfAnimations; i++) { Animation anim = Animation(i, framesInAnimation[i], delayPerAnimation[i]); char c = (char)i; std::string animName = "Anim" + std::to_string(i); std::cout << animName << "\n"; animations.emplace(animName, anim); } Play("Anim0"); SetTexture(path); } ~SpriteC() { SDL_DestroyTexture(texture); } void SetTexture(const char* path) { texture = TextureLoader::LoadTexture(path); } void Init() override { transform = &entity->getComponent<TransformC>(); srcRect.x = srcRect.y = 0; srcRect.w = transform->width; srcRect.h = transform->height; } void Update() override { if (animated) { srcRect.x = srcRect.w * static_cast<int>((SDL_GetTicks() / speed) % frames); } //Maybe I should check if user want's a camera srcRect.y = animIndex * transform->height; destRect.x = static_cast<int>(transform->position.x - Game::camera->camPosX + (1280/2)); destRect.y = static_cast<int>(transform->position.y - Game::camera->camPosY + (720/2)); destRect.w = transform->width * transform->scale; destRect.h = transform->height * transform->scale; angle = transform->angle; //if(Game::activeCamera == true) //{ // /*destRect.x = static_cast<int>(transform->position.x - cc.cameraRect.x); // destRect.y = static_cast<int>(transform->position.y - cc.cameraRect.y); // destRect.w = transform->width * transform->scale; // destRect.h = transform->height * transform->scale;*/ //} //else //{ // destRect.x = static_cast<int>(transform->position.x); // destRect.y = static_cast<int>(transform->position.y); // destRect.w = transform->width * transform->scale; // destRect.h = transform->height * transform->scale; //} } void Draw() override { TextureLoader::Draw(texture, srcRect, destRect, angle, spriteFlip); } /*void Play(const char* animName) { frames = animations[animName].frames; animIndex = animations[animName].index; speed = animations[animName].speed; }*/ void Play(std::string animName) { frames = animations[animName].frames; animIndex = animations[animName].index; speed = animations[animName].speed; } };
25.678571
90
0.675661
c26dfd5fdc2a87c208f64f42e171aedf6d22beb1
9,835
h
C
src/models/LinearModel.h
litlpoet/beliefbox
6b303e49017f8054f43c6c840686fcc632205e4e
[ "OLDAP-2.3" ]
null
null
null
src/models/LinearModel.h
litlpoet/beliefbox
6b303e49017f8054f43c6c840686fcc632205e4e
[ "OLDAP-2.3" ]
null
null
null
src/models/LinearModel.h
litlpoet/beliefbox
6b303e49017f8054f43c6c840686fcc632205e4e
[ "OLDAP-2.3" ]
null
null
null
/// -*- Mode: c++ -*- // copyright (c) 2012 by Nikolaos Tziortziotis <ntziorzi@gmail.com> /*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef LINEAR_MODEL_H #define LINEAR_MODEL_H #include "BasisSet.h" #include "BayesianMultivariateRegression.h" #include "Environment.h" #include "Matrix.h" #include "MultivariateNormal.h" template <typename S, typename A> class LinearModel { protected: int m; ///< Input dimensions int d; ///< Output dimensions of the transition model std::vector<Matrix> M; ///< Mean Matrix of the transition model std::vector<Matrix> V; ///< Covariance Matrix of the transition model std::vector<Matrix> SP; std::vector<Vector> MR; ///< Mean of the reward model std::vector<Matrix> VR; ///< Covariance Matrix of the reward model std::vector<Matrix> SR; RBFBasisSet* RBFs; Environment<S, A>* environment; std::vector<BayesianMultivariateRegression*> regression_t; public: LinearModel(const int& m_, const int& d_, RBFBasisSet* RBFs_, Environment<S, A>* environment_, std::vector<BayesianMultivariateRegression*> regression_t_) : RBFs(RBFs_), environment(environment_), regression_t(regression_t_) { m = m_; d = d_; int n_actions = environment->getNActions(); M.resize(n_actions); V.resize(n_actions); SP.resize(n_actions); MR.resize(n_actions); VR.resize(n_actions); SR.resize(n_actions); for (int i = 0; i < n_actions; ++i) { M[i] = Matrix::Null(d, m); V[i] = Matrix::Unity(d, d); SP[i] = Matrix::Unity(m, m); MR[i] = Vector::Null(m); VR[i] = Matrix::Unity(1, 1); SR[i] = Matrix::Unity(1, 1); } } LinearModel(const int& m_, const int& d_, Environment<S, A>* environment_) : environment(environment_) { m = m_; d = d_; int n_actions = environment->getNActions(); M.resize(n_actions); V.resize(n_actions); SP.resize(n_actions); MR.resize(n_actions); VR.resize(n_actions); SR.resize(n_actions); for (int i = 0; i < n_actions; ++i) { M[i] = Matrix::Null(d, m); V[i] = Matrix::Unity(d, d); SP[i] = Matrix::Unity(m, m); MR[i] = Vector::Null(m); VR[i] = Matrix::Unity(1, 1); SR[i] = Matrix::Unity(1, 1); } RBFs = NULL; } LinearModel(const std::vector<Matrix>& M_, const std::vector<Matrix>& V_, const std::vector<Matrix>& SP_, const std::vector<Vector>& MR_, const std::vector<Matrix>& VR_, const std::vector<Matrix>& SR_, RBFBasisSet* RBFs_, Environment<S, A>* environment_) : M(M_), V(V_), SP(SP_), MR(MR_), VR(VR_), SR(SR_), RBFs(RBFs_), environment(environment_) { d = M[0].Rows(); m = M[0].Columns(); //*TODO*/ } LinearModel(const std::vector<Matrix>& M_, const std::vector<Matrix>& V_, const std::vector<Matrix>& SP_, const std::vector<Vector>& MR_, const std::vector<Matrix>& VR_, const std::vector<Matrix>& SR_, Environment<S, A>* environment_) : M(M_), V(V_), SP(SP_), MR(MR_), VR(VR_), SR(SR_), environment(environment_) { d = M[0].Rows(); m = M[0].Columns(); RBFs = NULL; //*TODO*/ } virtual ~LinearModel() {} void Reset() { int n_actions = environment->getNActions(); for (int i = 0; i < n_actions; ++i) { M[i] = Matrix::Null(d, m); V[i] = Matrix::Unity(d, d); SP[i] = Matrix::Unity(m, m); MR[i] = Vector::Null(m); VR[i] = Matrix::Unity(1, 1); SR[i] = Matrix::Unity(1, 1); } } const void SetStatePredictionMean(const Matrix& M_, const int& a) { assert(M_.Rows() == d && M_.Columns() == m); M[a] = M_; } const void SetStatePredictionMean(const std::vector<Matrix>& M_) { int n_actions = environment->getNActions(); for (int i = 0; i < n_actions; ++i) { assert(M_[i].Rows() == d && M_[i].Columns() == m); } M = M_; } Matrix GetStatePredictionVar(const int& a) { return V[a]; } const void SetStatePredictionVar(const Matrix& V_, const int& a) { assert(V_.Rows() == d && V_.Columns() == d); V[a] = V_; } const void SetStatePredictionVar(const std::vector<Matrix>& V_) { int n_actions = environment->getNActions(); for (int i = 0; i < n_actions; ++i) { assert(V_[i].Rows() == d && V_[i].Columns() == d); } V = V_; } const void SetStatePredictionS(const Matrix& SP_, const int& a) { assert(SP_.Rows() == m && SP_.Columns() == m); SP[a] = SP_; } const void SetStatePredictionS(const std::vector<Matrix>& SP_) { int n_actions = environment->getNActions(); for (int i = 0; i < n_actions; ++i) { assert(SP_[i].Rows() == m && SP_[i].Columns() == m); } SP = SP_; } const void SetRewardPredictionMean(const Vector& MR_, const int& a) { assert(MR_.Size() == m); MR[a] = MR_; } const void SetRewardPredictionMean(const std::vector<Vector>& MR_) { int n_actions = environment->getNActions(); for (int i = 0; i < n_actions; ++i) { assert(MR_[i].Size() == m); } MR = MR_; } const void SetRewardPredictionVar(const Matrix& VR_, const int& a) { assert(VR_.Rows() == 1 && VR_.Columns() == 1); VR[a] = VR_; } const void SetRewardPredictionVar(const std::vector<Matrix>& VR_) { int n_actions = environment->getNActions(); for (int i = 0; i < n_actions; ++i) { assert(VR_[i].Rows() == 1 && VR_[i].Columns() == 1); } VR = VR_; } const void SetRewardPredictionS(const Matrix& SR_, const int& a) { assert(SR_.Rows() == 1 && SR_.Columns() == 1); SR[a] = SR_; } const void SetRewardPredictionS(const std::vector<Matrix>& SR_) { int n_actions = environment->getNActions(); for (int i = 0; i < n_actions; ++i) { assert(SR_[i].Rows() == 1 && SR_[i].Columns() == 1); } SR = SR_; } const void SetModelParameters(const Matrix& M_, const Matrix& V_, const Matrix& SP_, const Vector& MR_, const Matrix& VR_, const Matrix& SR_, int a) { assert(M_.Rows() == d && M_.Columns() == m); assert(V_.Rows() == d && V_.Columns() == d); assert(SP_.Rows() == m && SP_.Columns() == m); assert(MR_.Size() == m); assert(VR_.Rows() == 1 && VR_.Columns() == 1); assert(SR_.Rows() == 1 && SR_.Columns() == 1); M[a] = M_; V[a] = V_; SP[a] = SP_; MR[a] = MR_; VR[a] = VR_; SR[a] = SR_; } const void SetModelParameters(const std::vector<Matrix>& M_, const std::vector<Matrix>& V_, const std::vector<Matrix>& SP_, const std::vector<Vector>& MR_, const std::vector<Matrix>& VR_, const std::vector<Matrix>& SR_) { int n_actions = environment->getNActions(); for (int i = 0; i < n_actions; ++i) { assert(M_[i].Rows() == d && M_[i].Columns() == m); assert(V_[i].Rows() == d && V_[i].Columns() == d); assert(SP_[i].Rows() == m && SP_[i].Columns() == m); assert(MR_[i].Size() == m); assert(VR_[i].Rows() == 1 && VR_[i].Columns() == 1); assert(SR_[i].Rows() == 1 && SR_[i].Columns() == 1); } M = M_; V = V_; SP = SP_; MR = MR_; VR = VR_; SR = SR_; } const void SetEnvrironment(const Environment<Vector, int>& environment_) { environment = environment_; } const Vector& StateUpperBound() const { return environment->StateUpperBound(); } const Vector& StateLowerBound() const { return environment->StateLowerBound(); } const Vector getNextState(const Vector& state, const int& action) { return regression_t[action]->generate(state); } virtual real getTransitionProbability(const S& state, const A& action, const S& next_state) const { // Basis function creation Vector phi; if (RBFs != NULL) { RBFs->Evaluate(state); phi = RBFs->F(); } else { phi = state; } phi.Resize(m); phi[m - 1] = 1.0; Vector mean = M[action] * phi; real c = 1.0; // Matrix xx = OuterProduct(phi,phi); // xx = (xx + SP[action]).Inverse(); // Vector xx1 = xx*phi; // c = 1.0 / (c - Product(phi,xx1)); MultivariateNormal m_normal(mean, (c * V[action]).Inverse()); // MultivariateNormal m_normal(mean,(c*VV).Inverse()); return m_normal.pdf(next_state); } virtual real getExpectedReward(const Vector& state, const int& action) const { // Vector phi; // // if(RBFs != NULL) { // RBFs->Evaluate(state); // phi = RBFs->F(); // } // else { // phi = state; // } // phi.Resize(m); // phi[m-1] = 1.0; // // return Product(MR[action],phi); Vector previous_state = environment->getState(); environment->Reset(); environment->setState(state); environment->Act(action); real reward = environment->getReward(); environment->Reset(); environment->setState(previous_state); return reward; } }; #endif
33.566553
80
0.541739
7366bce44e191327260e233bc1053eae5577f850
2,512
swift
Swift
Sources/RediStack/Extensions/SwiftNIO.swift
tschulze/RediStack
e9574b6b6526dae0a6c2847c725a60dfc3af900d
[ "Apache-2.0" ]
null
null
null
Sources/RediStack/Extensions/SwiftNIO.swift
tschulze/RediStack
e9574b6b6526dae0a6c2847c725a60dfc3af900d
[ "Apache-2.0" ]
null
null
null
Sources/RediStack/Extensions/SwiftNIO.swift
tschulze/RediStack
e9574b6b6526dae0a6c2847c725a60dfc3af900d
[ "Apache-2.0" ]
null
null
null
//===----------------------------------------------------------------------===// // // This source file is part of the RediStack open source project // // Copyright (c) 2019 RediStack project authors // Licensed under Apache License v2.0 // // See LICENSE.txt for license information // See CONTRIBUTORS.txt for the list of RediStack project authors // // SPDX-License-Identifier: Apache-2.0 // //===----------------------------------------------------------------------===// import NIO extension TimeAmount { /// The seconds representation of the TimeAmount. @usableFromInline internal var seconds: Int64 { return self.nanoseconds / 1_000_000_000 } } // MARK: Setting up a Redis connection extension Channel { /// Adds the baseline `ChannelHandlers` needed to support sending and receiving messages in Redis Serialization Protocol (RESP) format to the pipeline. /// /// For implementation details, see `RedisMessageEncoder`, `RedisByteDecoder`, and `RedisCommandHandler`. /// - Returns: An `EventLoopFuture` that resolves after all handlers have been added to the pipeline. public func addBaseRedisHandlers() -> EventLoopFuture<Void> { let handlers: [(ChannelHandler, name: String)] = [ (MessageToByteHandler(RedisMessageEncoder()), "RediStack.OutgoingHandler"), (ByteToMessageHandler(RedisByteDecoder()), "RediStack.IncomingHandler"), (RedisCommandHandler(), "RediStack.CommandHandler") ] return .andAllSucceed( handlers.map { self.pipeline.addHandler($0, name: $1) }, on: self.eventLoop ) } } extension ClientBootstrap { /// Makes a new `ClientBootstrap` instance with a baseline Redis `Channel` pipeline /// for sending and receiving messages in Redis Serialization Protocol (RESP) format. /// /// For implementation details, see `RedisMessageEncoder`, `RedisByteDecoder`, and `RedisCommandHandler`. /// - Parameter group: The `EventLoopGroup` to create the `ClientBootstrap` with. /// - Returns: A `ClientBootstrap` with the base configuration of a `Channel` pipeline for RESP messages. public static func makeRedisTCPClient(group: EventLoopGroup) -> ClientBootstrap { return ClientBootstrap(group: group) .channelOption( ChannelOptions.socket(SocketOptionLevel(SOL_SOCKET), SO_REUSEADDR), value: 1 ) .channelInitializer { $0.addBaseRedisHandlers() } } }
41.866667
155
0.646099
7cf3df1932d6889a39e75e531a2441eba66c24c4
1,762
kt
Kotlin
flowbinding-core/src/main/java/reactivecircus/flowbinding/core/NestedScrollViewScrollChangeEventFlow.kt
ReactiveCircus/FlowBinding
620d7ddc32e54ca08d1315dc46cc6b5b50473575
[ "Apache-2.0" ]
826
2019-08-17T08:09:59.000Z
2022-03-22T02:23:25.000Z
flowbinding-core/src/main/java/reactivecircus/flowbinding/core/NestedScrollViewScrollChangeEventFlow.kt
leobert-lan/FlowBinding
621ff1f0a3396a791c7472f7fce448685dda08a5
[ "Apache-2.0" ]
37
2019-08-26T08:21:43.000Z
2021-09-25T02:57:22.000Z
flowbinding-core/src/main/java/reactivecircus/flowbinding/core/NestedScrollViewScrollChangeEventFlow.kt
leobert-lan/FlowBinding
621ff1f0a3396a791c7472f7fce448685dda08a5
[ "Apache-2.0" ]
42
2019-08-17T07:48:32.000Z
2022-03-19T14:13:57.000Z
@file:Suppress("MatchingDeclarationName") package reactivecircus.flowbinding.core import android.view.View import androidx.annotation.CheckResult import androidx.core.widget.NestedScrollView import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.channels.awaitClose import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.callbackFlow import kotlinx.coroutines.flow.conflate import reactivecircus.flowbinding.common.checkMainThread /** * Create a [Flow] of scroll change events on the [NestedScrollView] instance. * * Note: Created flow keeps a strong reference to the [NestedScrollView] instance * until the coroutine that launched the flow collector is cancelled. * * Example of usage: * * ``` * nestedScrollView.scrollChangeEvents() * .onEach { event -> * // handle scroll change event * } * .launchIn(uiScope) * ``` */ @CheckResult @OptIn(ExperimentalCoroutinesApi::class) public fun NestedScrollView.scrollChangeEvents(): Flow<ScrollChangeEvent> = callbackFlow { checkMainThread() val listener = NestedScrollView.OnScrollChangeListener { v, scrollX, scrollY, oldScrollX, oldScrollY -> trySend( ScrollChangeEvent( view = v, scrollX = scrollX, scrollY = scrollY, oldScrollX = oldScrollX, oldScrollY = oldScrollY ) ) } setOnScrollChangeListener(listener) awaitClose { setOnScrollChangeListener(null as NestedScrollView.OnScrollChangeListener?) } }.conflate() public data class ScrollChangeEvent( public val view: View, public val scrollX: Int, public val scrollY: Int, public val oldScrollX: Int, public val oldScrollY: Int )
30.912281
107
0.715096
14391db4910e44b344dec826840ca29084780343
3,758
ts
TypeScript
tests/integration/application.test.ts
ElMijo/builder-box-rest-api
48a32b21dc5ff809faa8b84844cc1777681ea37b
[ "MIT" ]
null
null
null
tests/integration/application.test.ts
ElMijo/builder-box-rest-api
48a32b21dc5ff809faa8b84844cc1777681ea37b
[ "MIT" ]
6
2020-08-28T18:46:26.000Z
2020-09-08T14:17:14.000Z
tests/integration/application.test.ts
ElMijo/builder-box-rest-api
48a32b21dc5ff809faa8b84844cc1777681ea37b
[ "MIT" ]
null
null
null
import cors from 'cors' import { json, urlencoded } from 'body-parser' import Express, { Router, Request, Response, NextFunction } from 'express' import request from 'supertest' import { Application, ResourceType, MiddlewareType } from '../../src/index' describe("Testing Applicantion class...", () => { test("Checking that the Application class is instantiable", () => { expect(new Application).toBeInstanceOf(Object) expect(new Application(Express())).toBeInstanceOf(Object) }) test("Test registerResource when given valid", () => { const app = new Application; const resource : ResourceType = ["/path", Router()] expect(app.registerResource(resource)).toBeInstanceOf(Application) expect(app.registerResource(["/path", Router()])).toBeInstanceOf(Application) }) test("Test registerMiddleware when given valid", () => { const app = new Application; const middleware : MiddlewareType = () => {} expect(app.registerMiddleware(middleware)).toBeInstanceOf(Application) expect(app.registerMiddleware(() => {})).toBeInstanceOf(Application) }) test("Test getEngine when not add any resource or middleware", () => { const app = new Application; const EXpressApp = app.getEngine() expect(EXpressApp.name).toBe("app") expect(EXpressApp._router === undefined).toBeTruthy() expect(app.getEngine()).toEqual(EXpressApp) }) test("Test getEngine when add any resource or middleware before booted", () => { const resource : ResourceType = ["/path", Router()] const middleware : MiddlewareType = () => {} const EXpressApp = (new Application) .registerMiddleware(middleware) .registerResource(resource) .getEngine() expect(EXpressApp.name).toBe("app") expect(EXpressApp._router).toBeInstanceOf(Function) }) test("Test getEngine when add any resource or middleware after booted", () => { const resource : ResourceType = ["/path", Router()] const middleware : MiddlewareType = () => {} const app = new Application const EXpressApp = app.getEngine() app.registerMiddleware(middleware).registerResource(resource) expect(app.getEngine()).toEqual(EXpressApp) }) test("Test app booted runing", (done) => { const resource : ResourceType = ["/path", Router()] const middleware : MiddlewareType = () => {} const app = new Application const EXpressApp = app.getEngine() app.registerMiddleware(middleware).registerResource(resource) request(app.getEngine()) .get("/") .expect(404, done) }) test("Test app booted runing full features", (done) => { const router : Router = Router() router.use('/', (req: Request, res: Response) => res.json({message: "Testing api..."})) const resource : ResourceType = ["/api", router] const middleware : MiddlewareType = (req: Request, res: Response, next: NextFunction) => { res.set('X-VALUE', 'Builder Box Test'); next() } const app = new Application app .registerMiddleware(cors()) .registerMiddleware(json()) .registerMiddleware(urlencoded({ extended: true })) .registerMiddleware(middleware) .registerResource(resource) request(app.getEngine()) .get("/api") .expect('X-VALUE', 'Builder Box Test') .expect('content-type', 'application/json; charset=utf-8') .expect('Access-Control-Allow-Origin', '*') .expect(200, {message: "Testing api..."}, done) }) })
41.755556
98
0.616285
f5af7cc32493ca6b6c3d6fb036d9f4805be4ce71
5,821
css
CSS
src/styles.css
brooklynrauckman/wonder
17a29619a8506132593d0df9592fd5bd4138e94f
[ "MIT" ]
null
null
null
src/styles.css
brooklynrauckman/wonder
17a29619a8506132593d0df9592fd5bd4138e94f
[ "MIT" ]
null
null
null
src/styles.css
brooklynrauckman/wonder
17a29619a8506132593d0df9592fd5bd4138e94f
[ "MIT" ]
null
null
null
* { box-sizing: border-box; } /* main page containers */ html { scroll-behavior: smooth; } body { margin: 0 auto; background-color: #000; font-family: 'Cairo', sans-serif; color: #fff; } a { text-decoration: none; } .app { width: calc(100vw - 4rem); max-width: 940px; margin: 2rem; padding-bottom: 5rem; display: flex; flex-direction: column; justify-content: center; align-items: center; } .app-wrapper { display: flex; justify-content: center; width: 100%; } .hero-wrapper { background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), #000), url("./space.jpg") no-repeat center; background-size: cover; width: 100%; } .hero { position: relative; width: 100%; display: flex; flex-direction: column; } /* App title */ .title { font-size: 3rem; text-align: center; margin: 4rem 0 2rem 0; } /* Menu */ .circle-menu { position: absolute; top: 0; left: 0; z-index: 2; border: 3px solid #fff; border-radius: 50%; width: 25px; height: 25px; margin: 2rem; transform: scale(1); transition: 0.4s; } .circle-menu:hover { transform: scale(1.2); cursor: pointer; } .hero-options { position: absolute; top: 0; padding: 3rem 0; margin-left: -2rem; width: calc(100vw + 2rem); background: #00BFB3; display: flex; flex-direction: column; align-items: center; justify-content: center; } .post, .guest-list { margin-left: 2rem; } .guest-list, .guest-add { font-size: 1.25rem; line-height: 3rem; border: none; border-radius: 10px; font-family: inherit; font-weight: bold; color: #fff; display: inline; outline: none; } .guest-list:hover, .post:hover { cursor: pointer; } .guest-input { color: #fff; background: #000; font-weight: normal; padding: .5rem 1rem; margin-right: .5rem; font-size: 1.25rem; border-radius: 10px; font-family: inherit; outline: none; border: none; } input::placeholder { color: #fff; } input:hover { cursor: text; } /* guest galaxy */ .dot { height: 15px; width: 15px; background-color: #bbb; border-radius: 50%; display: inline-block; transform: scale(1); transition: 0.2s; } .guest-name { font-size: 1rem; transform: scale(1); transition: 0.2s; } .guest { transform: scale(1); transition: 0.2s; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 1.5rem; margin: 1rem; } .guest:hover { transform: scale(1.2); } .guest-wrapper { display: flex; flex-direction: row; justify-content: flex-start; align-items: flex-start; } .side-scroll { overflow: auto; overflow-y: hidden; } /* view toggle */ .toggle { background-color: inherit; border: 1px solid #fff; border-radius: 10px; padding: .5rem 1rem; font-family: inherit; color: #fff; font-weight: bold; font-size: 1.25rem; margin: 1rem 0; display: inline; outline: none; width: 100%; } .toggle:hover { background-color: #fff; color: #000; cursor: pointer; } .view { width: 100%; } /* question component */ .question { display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%; } .dropdowns { width: 100%; } .dropdown:hover { cursor: pointer; } .dropdown { display: inline; font-size: 1.25rem; font-family: inherit; color: #fff; padding: .5rem 1rem; margin: 2rem 0; border: 1px solid #fff; border-radius: 10px; -moz-appearance: none; -webkit-appearance: none; appearance: none; outline: none; background-color: #000; background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" viewBox="0 0 24 24" fill="none" stroke="%2300BFB3" stroke-width="4" stroke-linecap="round" stroke-linejoin="round" class="feather feather-chevron-down"><polyline points="6 9 12 15 18 9"/></svg>'); background-repeat: no-repeat, repeat; background-position: right .5rem top 50%, 0 0; background-size: 1.25rem auto, 100%; width: 100%; } .dropdown::-ms-expand { display: none; } .vs { font-size: 2rem; font-weight: bold; text-align: center; color: #00BFB3; } .options { display: flex; flex-direction: column; justify-content: center; margin: 2rem 0; width: 100%; } .option-select { background-color: inherit; font-size: 1.25rem; font-family: inherit; color: #fff; border-radius: 10px; padding: .5rem 1rem; border: 1px solid #fff; outline: none; margin-bottom: 2rem; width: 100%; } .option-select:hover { background-color: #fff; color: #000; cursor: pointer; } .space-to-earth, .space-to-space { padding: 1rem; font-size: 1.5rem; text-align: center; color: #000; background: #00BFB3; border-radius: 10px; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; } .compare { width: 100%; display: flex; flex-direction: column; padding: 1rem; } .compare-right, .compare-left { padding-top: 1rem; } .factor { display: block; text-align: center; font-weight: bold; } .factor-number { font-size: 2.5rem; overflow-wrap: break-word; } .on { background-color: #fff; color: #000; border: none; } /* media queries */ @media (min-width: 700px) { .view, .dropdowns { display: flex; flex-direction: row; } #earth-button { margin-right: 2rem; } .dropdowns { align-items: center; } .dropdowns .vs { margin: 0 2rem; } .options { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 2rem; } .option-select { margin-bottom: 0; } .compare { flex-direction: row; justify-content: space-around; align-items: center; } } @media (min-width: 900px) { .options { grid-template-columns: 1fr 1fr 1fr; } }
15.564171
308
0.638035
b077a34aeba451b6269f79c282e04246b2ed20dd
1,870
py
Python
notifications/migrations/0004_add_comment_event.py
mitodl/open-discussions
ab6e9fac70b8a1222a84e78ba778a7a065c20541
[ "BSD-3-Clause" ]
12
2017-09-27T21:23:27.000Z
2020-12-25T04:31:30.000Z
notifications/migrations/0004_add_comment_event.py
mitodl/open-discussions
ab6e9fac70b8a1222a84e78ba778a7a065c20541
[ "BSD-3-Clause" ]
3,293
2017-06-30T18:16:01.000Z
2022-03-31T18:01:34.000Z
notifications/migrations/0004_add_comment_event.py
mitodl/open-discussions
ab6e9fac70b8a1222a84e78ba778a7a065c20541
[ "BSD-3-Clause" ]
1
2020-04-13T12:19:57.000Z
2020-04-13T12:19:57.000Z
# -*- coding: utf-8 -*- # Generated by Django 1.11.10 on 2018-03-29 14:45 from __future__ import unicode_literals import channels.models from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("notifications", "0003_add_notification_skipped"), ] operations = [ migrations.CreateModel( name="CommentEvent", fields=[ ( "id", models.AutoField( auto_created=True, primary_key=True, serialize=False, verbose_name="ID", ), ), ("created_on", models.DateTimeField(auto_now_add=True)), ("updated_on", models.DateTimeField(auto_now=True)), ("post_id", channels.models.Base36IntegerField()), ("comment_id", channels.models.Base36IntegerField(null=True)), ( "email_notification", models.ForeignKey( null=True, on_delete=django.db.models.deletion.CASCADE, to="notifications.EmailNotification", ), ), ( "user", models.ForeignKey( on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, ), ), ], ), migrations.AlterUniqueTogether( name="commentevent", unique_together=set([("user", "post_id", "comment_id")]), ), ]
32.807018
78
0.489305
c71343afe7cc2cc4cafe82bb9b1f2b5f29b43dda
13,506
swift
Swift
NA Meeting Search/BMLTNAMeetingSearchMarker.swift
bmlt-enabled/Quick-NA-Meeting-Finder
5e9dd7610c08c01ccd2a071535d72d7f26aabcad
[ "MIT" ]
1
2021-08-15T16:50:29.000Z
2021-08-15T16:50:29.000Z
NA Meeting Search/BMLTNAMeetingSearchMarker.swift
bmlt-enabled/Quick-NA-Meeting-Finder
5e9dd7610c08c01ccd2a071535d72d7f26aabcad
[ "MIT" ]
1
2021-08-15T16:50:05.000Z
2021-08-15T16:50:05.000Z
NA Meeting Search/BMLTNAMeetingSearchMarker.swift
bmlt-enabled/Quick-NA-Meeting-Finder
5e9dd7610c08c01ccd2a071535d72d7f26aabcad
[ "MIT" ]
1
2019-05-13T20:31:53.000Z
2019-05-13T20:31:53.000Z
// // BMLTNAMeetingSearchMarker.swift // BMLTiOSLib // // Created by BMLT-Enabled // // https://bmlt.app/ // // This software is licensed under the MIT License. // Copyright (c) 2017 BMLT-Enabled // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // /** This file contains a couple of classes that allow us to establish and manipulate markers in our map. */ import MapKit import BMLTiOSLib /** Points to an array of meetings. */ typealias BMLTNAMeetingSearchMeetingList = [BMLTiOSLibMeetingNode] // MARK: - Classes - /* ###################################################################################################################################### */ /** This handles the marker annotation. */ class BMLTNAMeetingSearchAnnotation: NSObject, MKAnnotation, NSCoding { /// The Dictionary key for the coordinate object. let sCoordinateObjectKey: String = "BMLTNAMeetingSearchAnnotation_Coordinate" /// The Dictionary key for the list of meetings. let sMeetingsObjectKey: String = "BMLTNAMeetingSearchAnnotation_Meetings" /// The Dictionary key for the annotation title value. let sTitleObjectKey: String = "BMLTNAMeetingSearchAnnotation_Title" /// The coordinate for this annotation. @objc var coordinate: CLLocationCoordinate2D = kCLLocationCoordinate2DInvalid /// The meetings attached to this annotation. @objc var meetings: BMLTNAMeetingSearchMeetingList = [] /// The title of this annotation's marker. @objc var title: String? /* ################################################################## */ /** Convenience initializer. :param: coordinate the coordinate for this annotation display. */ convenience init(coordinate: CLLocationCoordinate2D) { self.init(coordinate: coordinate, meetings: []) } /* ################################################################## */ /** Default initializer. :param: coordinate the coordinate for this annotation display. :param: meetings a list of meetings to be assigned to this annotation. */ init(coordinate: CLLocationCoordinate2D, meetings: BMLTNAMeetingSearchMeetingList) { self.coordinate = coordinate self.meetings = meetings } // MARK: - NSCoding Protocol Methods - /* ################################################################## */ /** This method will restore the meetings and coordinate objects from the coder passed in. :param: aDecoder The coder that will contain the coordinates. */ @objc required init?(coder aDecoder: NSCoder) { if let temp = aDecoder.decodeObject(forKey: self.sTitleObjectKey) as? String { self.title = temp } else { self.title = nil } self.meetings = (aDecoder.decodeObject(forKey: self.sMeetingsObjectKey) as? BMLTNAMeetingSearchMeetingList)! if let tempCoordinate = aDecoder.decodeObject(forKey: self.sCoordinateObjectKey) as? [NSNumber] { self.coordinate.longitude = tempCoordinate[0].doubleValue self.coordinate.latitude = tempCoordinate[1].doubleValue } } /* ################################################################## */ /** This method saves the meetings and coordinates as part of the serialization. :param: aCoder The coder that contains the coordinates. */ @objc func encode(with aCoder: NSCoder) { let long: NSNumber = NSNumber(value: self.coordinate.longitude as Double) let lat: NSNumber = NSNumber(value: self.coordinate.latitude as Double) let values: [NSNumber] = [long, lat] aCoder.encode(values, forKey: self.sCoordinateObjectKey) aCoder.encode(self.meetings, forKey: self.sMeetingsObjectKey) if nil != self.title { aCoder.encode(self.title, forKey: self.sTitleObjectKey) } } } /* ###################################################################################################################################### */ /** This handles our map marker. */ class BMLTNAMeetingSearchMarker: MKAnnotationView { /* ################################################################## */ // MARK: Internal Static Properties /* ################################################################## */ /** The coder key */ let sAnnotationObjectKey: String = "BMLTNAMeetingSearchMarker_Annotation" /** This is how many display units to shift the annotation view up. */ let sRegularAnnotationOffsetUp: CGFloat = 24 /** This is how many display units to shift the annotation view right. */ let sRegularAnnotationOffsetRight: CGFloat = 5 /* ################################################################## */ // MARK: Internal Instance Properties /* ################################################################## */ /** In an animation (dragging the current frame. */ var currentFrame: Int = 0 /** The timer used for animation. */ var animationTimer: Timer! = nil /** The frames to be drawn during an animation. */ var animationFrames: [UIImage] = [] /* ################################################################## */ // MARK: Internal Computed Properties /* ################################################################## */ /** We override this, so we can be sure to refresh the need for a draw state when draggable is set (Meaning it's a black marker). */ override var isDraggable: Bool { get { return super.isDraggable } set { // You can only drag if there are no meetings, or just one meeting. if 2 > self.meetings.count { super.isDraggable = newValue } else { super.isDraggable = false } if !super.isDraggable { self.animationFrames = [] } self.setNeedsDisplay() } } /* ################################################################## */ /** This gives us a shortcut to the annotation prpoerty. */ var coordinate: CLLocationCoordinate2D { return (self.annotation?.coordinate)! } /* ################################################################## */ /** This gives us a shortcut to the annotation prpoerty. */ var meetings: BMLTNAMeetingSearchMeetingList { return ((self.annotation as? BMLTNAMeetingSearchAnnotation)!.meetings) } /* ################################################################## */ // MARK: Internal Instance Methods /* ################################################################## */ /** The default initializer. - parameter annotation: The annotation that represents this instance. - parameter draggable: If true, then this will be draggable (ignored if the annotation has more than one meeting). - parameter reuseID: The reuse ID of the annotation. */ init(annotation: MKAnnotation?, draggable: Bool, reuseID: String?) { super.init(annotation: annotation, reuseIdentifier: reuseID) if nil != annotation?.title { self.canShowCallout = true } self.isDraggable = draggable self.backgroundColor = UIColor.clear self.image = self.selectImage(false) self.centerOffset = CGPoint(x: self.sRegularAnnotationOffsetRight, y: -self.sRegularAnnotationOffsetUp) } /* ################################################################## */ /** This selects the appropriate image for our display. - parameter inAnimated: If true, then the drag will be animated. */ func selectImage(_ inAnimated: Bool) -> UIImage! { var image: UIImage! = nil if self.isDraggable && (2 > self.meetings.count) { if self.dragState == MKAnnotationView.DragState.dragging { if inAnimated { image = self.animationFrames[self.currentFrame] } else { image = UIImage(named: "MapMarkerGreen", in: nil, compatibleWith: nil) } } else { image = UIImage(named: "MapMarkerBlack", in: nil, compatibleWith: nil) } } else { if 0 < self.meetings.count { if self.isSelected { image = UIImage(named: "MapMarkerGreen", in: nil, compatibleWith: nil) } else { if 1 < self.meetings.count { image = UIImage(named: "MapMarkerRed", in: nil, compatibleWith: nil) } else { image = UIImage(named: "MapMarkerBlue", in: nil, compatibleWith: nil) } } } else { image = UIImage(named: "MapMarkerBlack", in: nil, compatibleWith: nil) } } return image } /* ################################################################## */ // MARK: Base Class Override Methods /* ################################################################## */ /** Draws the image for the marker. - parameter rect: The rectangle in which this is to be drawn. */ override func draw(_ rect: CGRect) { let image = self.selectImage(0 < self.animationFrames.count) if nil != image { image!.draw(in: rect) } } /* ################################################################## */ /** Sets the drag state for this marker. - parameter newDragState: The new state that should be set after this call. - parameter animated: True, if the state change is to be animated (ignored). */ override func setDragState(_ newDragState: MKAnnotationView.DragState, animated: Bool) { var subsequentDragState = MKAnnotationView.DragState.none switch newDragState { case MKAnnotationView.DragState.starting: subsequentDragState = MKAnnotationView.DragState.dragging self.currentFrame = 0 self.animationFrames = [] case MKAnnotationView.DragState.dragging: if animated && (0 == self.animationFrames.count) { // Set up the drag animation. // We have 10 frames in the drag animation. for c in 1 ..< 11 { // Construct an image name for each frame. var imageName = "Frame" if 10 > c { imageName += "0" } imageName += String(c) if let image = UIImage(named: imageName, in: nil, compatibleWith: nil) { self.animationFrames.append(image) } } } _ = self.selectImage(true) self.currentFrame += 1 subsequentDragState = MKAnnotationView.DragState.dragging if self.currentFrame == self.animationFrames.count { self.currentFrame = 0 } default: subsequentDragState = MKAnnotationView.DragState.none } super.dragState = subsequentDragState self.setNeedsDisplay() } /* ################################################################## */ // MARK: NSCoding Protocol Methods /* ################################################################## */ /** This class will restore its meeting object from the coder passed in. - parameter coder: The coder that will contain the meeting. */ required init?(coder aDecoder: NSCoder) { super.init(coder: aDecoder) self.annotation = aDecoder.decodeObject(forKey: self.sAnnotationObjectKey) as? BMLTNAMeetingSearchAnnotation } /* ################################################################## */ /** This method saves the meetings and coordinates as part of the serialization. - parameter with: The coder that contains the coordinates. */ override func encode(with aCoder: NSCoder) { aCoder.encode(self.annotation, forKey: self.sAnnotationObjectKey) super.encode(with: aCoder) } }
40.316418
140
0.536873
8366810b74454a85b14e25669d695e1ba2550a3f
663
ts
TypeScript
example/dubbo-dj/dubbo/ts/service/org/apache/dubbo/service/base/UserService.ts
hufeng/dubbo-dj
69eb85685ade0a13390f94ab0a7c0f09fd87b687
[ "Apache-2.0" ]
1
2021-07-07T07:51:00.000Z
2021-07-07T07:51:00.000Z
example/dubbo-dj/dubbo/ts/service/org/apache/dubbo/service/base/UserService.ts
hufeng/dubbo-dj
69eb85685ade0a13390f94ab0a7c0f09fd87b687
[ "Apache-2.0" ]
null
null
null
example/dubbo-dj/dubbo/ts/service/org/apache/dubbo/service/base/UserService.ts
hufeng/dubbo-dj
69eb85685ade0a13390f94ab0a7c0f09fd87b687
[ "Apache-2.0" ]
null
null
null
/** * auto generated by dubbo dj * ~~~ 💗 machine coding 💗 ~~~ */ import java from 'js-to-java' import { User, IUser } from '../../entity/User' export default abstract class UserService { dubboInterface = 'org.apache.dubbo.service.UserService' methods = { sayHello: async (user: IUser) => { const val = await this.sayHello(user) return ((v: IUser) => new User(v).__fields2java())(val) }, sayWorld: async (names: Array<string>) => { const val = await this.sayWorld(names) return java.String(val) }, } abstract sayHello(user: IUser): Promise<IUser> abstract sayWorld(names: Array<string>): Promise<string> }
24.555556
61
0.638009
a460ec107b7c5f354c26405dff39a07f3c28998d
1,268
h
C
impl/browser/geolocation/location_provider_efl.h
Jabawack/chromium-efl
6d3a3accc8afba0aa0eff6461eb5c83138172e6e
[ "BSD-3-Clause" ]
9
2015-04-09T20:22:08.000Z
2021-03-17T08:34:56.000Z
impl/browser/geolocation/location_provider_efl.h
Jabawack/chromium-efl
6d3a3accc8afba0aa0eff6461eb5c83138172e6e
[ "BSD-3-Clause" ]
2
2015-02-04T13:41:12.000Z
2015-05-25T14:00:40.000Z
impl/browser/geolocation/location_provider_efl.h
isabella232/chromium-efl
db2d09aba6498fb09bbea1f8440d071c4b0fde78
[ "BSD-3-Clause" ]
14
2015-02-12T16:20:47.000Z
2022-01-20T10:36:26.000Z
// Copyright 2013 Samsung Electronics. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef LOCATION_PROVIDER_EFL_H_ #define LOCATION_PROVIDER_EFL_H_ #include "base/compiler_specific.h" #include "content/browser/geolocation/location_provider_base.h" #include "content/public/common/geoposition.h" #include <location/locations.h> namespace base { class MessageLoop; } namespace content { class LocationProviderEfl : public LocationProviderBase { public: virtual ~LocationProviderEfl(); static LocationProvider* Create(); virtual bool StartProvider(bool high_accuracy) override; virtual void StopProvider() override; virtual void GetPosition(Geoposition* position) override; virtual void RequestRefresh() override; virtual void OnPermissionGranted() override; private: LocationProviderEfl(); static void GeoPositionChangedCb(double, double, double, time_t, void*); void NotifyPositionChanged(double, double, double, time_t); Geoposition last_position_; location_manager_h location_manager_; base::MessageLoop* geolocation_message_loop_; DISALLOW_COPY_AND_ASSIGN(LocationProviderEfl); }; } // namespace content #endif // LOCATION_PROVIDER_EFL_H_
26.978723
74
0.794953
9bdc6b10103694ad5fbbe78bb3c694b5a258081f
1,464
sql
SQL
db/routines.sql
DreamLab/vmshepherd-postgres-driver
2dc0f6aa3b4359e339301a4e05da57d0ff90d819
[ "Apache-2.0" ]
null
null
null
db/routines.sql
DreamLab/vmshepherd-postgres-driver
2dc0f6aa3b4359e339301a4e05da57d0ff90d819
[ "Apache-2.0" ]
null
null
null
db/routines.sql
DreamLab/vmshepherd-postgres-driver
2dc0f6aa3b4359e339301a4e05da57d0ff90d819
[ "Apache-2.0" ]
1
2018-08-28T11:57:18.000Z
2018-08-28T11:57:18.000Z
CREATE OR REPLACE FUNCTION lock_preset( IN preset_name VARCHAR(128)) RETURNS BOOLEAN AS $BODY$ DECLARE is_locked BOOLEAN; BEGIN SELECT pst_is_locked into is_locked FROM preset_states WHERE pst_name = $1 FOR UPDATE; IF NOT FOUND THEN INSERT INTO preset_states (pst_name, pst_is_locked) VALUES (preset_name, true); ELSE IF is_locked THEN RETURN FALSE; ELSE UPDATE preset_states SET pst_is_locked = true where pst_name = preset_name; END IF; END IF; RETURN TRUE; END;$BODY$ LANGUAGE plpgsql VOLATILE COST 100; CREATE OR REPLACE FUNCTION upsert_preset( IN preset_name VARCHAR(128), IN last_managed TIMESTAMP WITH TIME ZONE, IN last_managed_by VARCHAR(64), IN vms_states JSON) RETURNS VOID AS $BODY$ DECLARE BEGIN PERFORM * FROM preset_states WHERE pst_name = preset_name; IF NOT FOUND THEN INSERT INTO preset_states (pst_name, pst_last_managed, pst_last_managed_by, pst_vms_states) VALUES (preset_name, last_managed, last_managed_by, vms_states); ELSE UPDATE preset_states SET pst_last_managed = last_managed, pst_last_managed_by = last_managed_by, pst_vms_states = vms_states WHERE pst_name = preset_name; END IF; END;$BODY$ LANGUAGE plpgsql VOLATILE COST 100; GRANT ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA public TO vmshepherd;
26.142857
92
0.687842
cc4fe749fd9675ee25ce2f552ca3a3846bd61d33
1,867
rb
Ruby
config/application.rb
ProgrammingSam/programmingam-resume
7b2440401c8472ef55a93a0970855dbfffad5d89
[ "MIT" ]
null
null
null
config/application.rb
ProgrammingSam/programmingam-resume
7b2440401c8472ef55a93a0970855dbfffad5d89
[ "MIT" ]
7
2020-01-07T11:08:08.000Z
2022-03-30T23:06:15.000Z
config/application.rb
ProgrammingSam/programmingam-resume
7b2440401c8472ef55a93a0970855dbfffad5d89
[ "MIT" ]
null
null
null
# frozen_string_literal: true require_relative 'boot' # We don't need active_record # require 'rails/all' # active_record is what we're not going to use it, so comment it "just in case" # require "active_record/railtie" # This is not loaded in rails/all but inside active_record so add it if # you want your models work as expected require 'active_model/railtie' # And now the rest require 'action_controller/railtie' # require 'action_mailer/railtie' require 'action_view/railtie' # require 'active_job/railtie' require 'action_cable/engine' # require 'active_storage/engine' require 'sprockets/railtie' # require 'rails/test_unit/railtie' # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. Bundler.require(*Rails.groups) module ProgrammingsamResume class Application < Rails::Application # Initialize configuration defaults for originally generated Rails version. config.load_defaults 6.0 # Initialize configuration for translation config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}')] config.i18n.default_locale = :fr config.i18n.available_locales = %i[fr en] config.i18n.fallbacks = [I18n.default_locale] # Allow custom error pages config.exceptions_app = routes # Add environments for Skylight Errors Handler config.skylight.environments += ['development'] # Settings in config/environments/* take precedence over # those specified here. # Application configuration can go into files in config/initializers # -- all .rb files in that directory are automatically loaded after loading # the framework and any gems in your application. end end
33.945455
79
0.693091
a2553c0af550de6cffa7a8fd13c06f54ed8437f2
141
sh
Shell
resources/testData/bin/run_test_01_01.sh
OkieOth/jeeselte
32930c4de1287e193182d454925f4f29a8f888b3
[ "Apache-2.0" ]
null
null
null
resources/testData/bin/run_test_01_01.sh
OkieOth/jeeselte
32930c4de1287e193182d454925f4f29a8f888b3
[ "Apache-2.0" ]
null
null
null
resources/testData/bin/run_test_01_01.sh
OkieOth/jeeselte
32930c4de1287e193182d454925f4f29a8f888b3
[ "Apache-2.0" ]
null
null
null
#!/bin/bash scriptPos=${0%/*} stylesheet=$scriptPos/../xslt/test_01_01.xslt file=$scriptPos/../xml/test_01.xml xsltproc $stylesheet $file
15.666667
45
0.723404
ec8f0dd97631df64fea544002c45be49082b380f
142
rb
Ruby
config/initializers/session_store.rb
tgfi/harvest_overlord
7f53af8f20f62599dc6bf99c7731c705f8a8ddd9
[ "MIT" ]
null
null
null
config/initializers/session_store.rb
tgfi/harvest_overlord
7f53af8f20f62599dc6bf99c7731c705f8a8ddd9
[ "MIT" ]
null
null
null
config/initializers/session_store.rb
tgfi/harvest_overlord
7f53af8f20f62599dc6bf99c7731c705f8a8ddd9
[ "MIT" ]
null
null
null
# Be sure to restart your server when you modify this file. Harvest::Application.config.session_store :cookie_store, key: '_harvest_session'
35.5
80
0.802817
40eea681b9e773a523f00dbdce1cb8214d6c4ec2
1,104
rb
Ruby
h2o/robots.rb
chabu/config
e5676909ecd899d54bdd82187fa3ced3b2640c1c
[ "CC0-1.0" ]
null
null
null
h2o/robots.rb
chabu/config
e5676909ecd899d54bdd82187fa3ced3b2640c1c
[ "CC0-1.0" ]
null
null
null
h2o/robots.rb
chabu/config
e5676909ecd899d54bdd82187fa3ced3b2640c1c
[ "CC0-1.0" ]
null
null
null
lambda do |env| headers = [ 'HTTP_FORWARDED', 'HTTP_X_FORWARDED_FOR', ] agents = [ 'Slack', 'Hatena', 'MetaURI', 'redback', 'Applebot', '360Spider', 'AppEngine', 'LivelapBot', 'PaperLiBot', 'goo_search', 'line-poker', 'Yahoo!Japan', 'MegaIndex.ru', 'SkypeUriPreview', 'ShortLinkTranslate', 'Gluten Free Crawler', 'facebookexternalhit', ] html = [403, {'content-type' => 'text/html; charset=utf-8'}, [<<'HTML']] <!DOCTYPE html> <html lang="en"> <head> <meta name="viewport" content="initial-scale=1"> <meta name="Hatena::Bookmark" content="noindex,nocomment"> <title>Bad Request</title> </head> <body> <p>Malformed HTTP header was detected.</p> </body> </html> HTML if env['PATH_INFO'] === '/robots.txt' return [399, {}, []] end headers.each do |name| if env.has_key?(name) return html end end agent = env['HTTP_USER_AGENT'] if agent.nil? return [399, {}, []] end agents.each do |name| if agent.include?(name) return html end end return [399, {}, []] end
16.984615
74
0.586957
38bd78d6d3ea5a1623c7e05a18b02458c4cec444
697,124
php
PHP
admin/system/user/edita.php
adrmoenster/MaisDizer
61f5f15bea5ed2b62382f5d38d2a64c5dabfcbb4
[ "MIT" ]
1
2020-04-16T17:11:15.000Z
2020-04-16T17:11:15.000Z
admin/system/user/edita.php
adrmoenster/MaisDizer
61f5f15bea5ed2b62382f5d38d2a64c5dabfcbb4
[ "MIT" ]
null
null
null
admin/system/user/edita.php
adrmoenster/MaisDizer
61f5f15bea5ed2b62382f5d38d2a64c5dabfcbb4
[ "MIT" ]
null
null
null
<!-- Main content --> <div class="content-wrapper"> <!-- Page header --> <div class="page-header page-header-light"> <div class="page-header-content header-elements-md-inline"> <div class="page-title d-flex"> <h4><i class="icon-arrow-left52 mr-2"></i> <span class="font-weight-semibold">Edita</span> - Usuario</h4> <a href="#" class="header-elements-toggle text-default d-md-none"><i class="icon-more"></i></a> </div> <div class="header-elements d-none"> <div class="d-flex justify-content-center"> <a href="#" class="btn btn-link btn-float text-default"><i class="icon-bars-alt text-primary"></i><span>Statistics</span></a> <a href="#" class="btn btn-link btn-float text-default"><i class="icon-calculator text-primary"></i> <span>Invoices</span></a> <a href="#" class="btn btn-link btn-float text-default"><i class="icon-calendar5 text-primary"></i> <span>Schedule</span></a> </div> </div> </div> <div class="breadcrumb-line breadcrumb-line-light header-elements-md-inline"> <div class="d-flex"> <div class="breadcrumb"> <a href="painel.php" class="breadcrumb-item"><i class="icon-home2 mr-2"></i> Inicio</a> <a href="#" class="breadcrumb-item">Usuario</a> <span class="breadcrumb-item active">Edita</span> </div> <a href="#" class="header-elements-toggle text-default d-md-none"><i class="icon-more"></i></a> </div> <div class="header-elements d-none"> <div class="breadcrumb justify-content-center"> <a href="#" class="breadcrumb-elements-item"> <i class="icon-comment-discussion mr-2"></i> Support </a> <div class="breadcrumb-elements-item dropdown p-0"> <a href="#" class="breadcrumb-elements-item dropdown-toggle" data-toggle="dropdown"> <i class="icon-gear mr-2"></i> Settings </a> <div class="dropdown-menu dropdown-menu-right"> <a href="#" class="dropdown-item"><i class="icon-user-lock"></i> Account security</a> <a href="#" class="dropdown-item"><i class="icon-statistics"></i> Analytics</a> <a href="#" class="dropdown-item"><i class="icon-accessibility"></i> Accessibility</a> <div class="dropdown-divider"></div> <a href="#" class="dropdown-item"><i class="icon-gear"></i> All settings</a> </div> </div> </div> </div> </div> </div> <!-- /page header --> <!-- INICIO form_inputs --> <!-- Content area --> <div class="content"> <!-- Form inputs --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Basic form inputs</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <p class="mb-4">Examples of standard form controls supported in an example form layout. Individual form controls automatically receive some global styling. All textual <code>&lt;input></code>, <code>&lt;textarea></code>, and <code>&lt;select></code> elements with <code>.form-control</code> are set to <code>width: 100%;</code> by default. Wrap labels and controls in <code>.form-group</code> for optimum spacing. Labels in horizontal form require <code>.col-form-label</code> class.</p> <form action="#"> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Basic inputs</legend> <div class="form-group row"> <label class="col-form-label col-lg-2">Default text input</label> <div class="col-lg-10"> <input type="text" class="form-control"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Password</label> <div class="col-lg-10"> <input type="password" class="form-control"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Input with placeholder</label> <div class="col-lg-10"> <input type="text" class="form-control" placeholder="Enter your username..."> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Read only field</label> <div class="col-lg-10"> <input type="text" class="form-control" readonly value="read only"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Disabled field</label> <div class="col-lg-10"> <input type="text" class="form-control" disabled value="disabled"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Predefined value</label> <div class="col-lg-10"> <input type="text" class="form-control" value="http://"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Disabled autocomplete</label> <div class="col-lg-10"> <input type="text" class="form-control" placeholder="Autocomplete is off" autocomplete="off"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Maximum value</label> <div class="col-lg-10"> <input type="text" class="form-control" maxlength="4" placeholder="Maximum 4 characters"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2 cursor-pointer" for="clickable-label">Focus on label click</label> <div class="col-lg-10"> <input type="text" class="form-control" id="clickable-label" placeholder="Field focus on label click"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Static text</label> <div class="col-lg-10"> <div class="form-control-plaintext">This is a static text</div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Textarea</label> <div class="col-lg-10"> <textarea rows="3" cols="3" class="form-control" placeholder="Default textarea"></textarea> </div> </div> </fieldset> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Basic selects</legend> <div class="form-group row"> <label class="col-form-label col-lg-2">Single select</label> <div class="col-lg-10"> <select class="form-control"> <option value="opt1">Default select box</option> <option value="opt2">Option 2</option> <option value="opt3">Option 3</option> <option value="opt4">Option 4</option> <option value="opt5">Option 5</option> <option value="opt6">Option 6</option> <option value="opt7">Option 7</option> <option value="opt8">Option 8</option> </select> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Styled select</label> <div class="col-lg-10"> <select class="form-control form-control-uniform" data-fouc> <option value="opt1">Styled select box</option> <option value="opt2">Option 2</option> <option value="opt3">Option 3</option> <option value="opt4">Option 4</option> <option value="opt5">Option 5</option> <option value="opt6">Option 6</option> <option value="opt7">Option 7</option> <option value="opt8">Option 8</option> </select> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Custom BS select</label> <div class="col-lg-10"> <select class="custom-select"> <option value="opt1">Styled select box</option> <option value="opt2">Option 2</option> <option value="opt3">Option 3</option> <option value="opt4">Option 4</option> <option value="opt5">Option 5</option> <option value="opt6">Option 6</option> <option value="opt7">Option 7</option> <option value="opt8">Option 8</option> </select> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Multiple select</label> <div class="col-lg-10"> <select multiple="multiple" class="form-control"> <option selected>Amsterdam</option> <option selected>Atlanta</option> <option>Baltimore</option> <option>Boston</option> <option>Buenos Aires</option> <option>Calgary</option> <option selected>Chicago</option> <option>Denver</option> <option>Dubai</option> <option>Frankfurt</option> <option>Hong Kong</option> <option>Honolulu</option> <option>Houston</option> <option>Kuala Lumpur</option> <option>London</option> <option>Los Angeles</option> <option>Melbourne</option> <option>Mexico City</option> <option>Miami</option> <option>Minneapolis</option> </select> </div> </div> </fieldset> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Basic file inputs</legend> <div class="form-group row"> <label class="col-form-label col-lg-2">Default file input</label> <div class="col-lg-10"> <input type="file" class="form-control"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Styled file input</label> <div class="col-lg-10"> <input type="file" class="form-control-uniform" data-fouc> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Custom BS file input</label> <div class="col-lg-10"> <div class="custom-file"> <input type="file" class="custom-file-input" id="customFile"> <label class="custom-file-label" for="customFile">Choose file</label> </div> </div> </div> </fieldset> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Form helpers</legend> <div class="form-group row"> <label class="col-form-label col-lg-2">Text form helpers</label> <div class="col-lg-10"> <div class="row"> <div class="col-md-4"> <input type="text" class="form-control"> <span class="form-text text-muted">Left aligned helper</span> </div> <div class="col-md-4"> <input type="text" class="form-control"> <span class="form-text text-muted text-center">Centered helper</span> </div> <div class="col-md-4"> <input type="text" class="form-control"> <span class="form-text text-muted text-right">Right aligned helper</span> </div> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Full width badge helpers</label> <div class="col-lg-10"> <div class="row"> <div class="col-md-4"> <input type="text" class="form-control"> <span class="badge d-block badge-primary form-text text-left">Left aligned badge</span> </div> <div class="col-md-4"> <input type="text" class="form-control"> <span class="badge d-block badge-danger form-text">Centered badge</span> </div> <div class="col-md-4"> <input type="text" class="form-control"> <span class="badge d-block badge-info form-text text-right">Right aligned badge</span> </div> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Block badge helpers</label> <div class="col-lg-10"> <div class="row"> <div class="col-md-4"> <input type="text" class="form-control"> <div class="d-block form-text"> <span class="badge badge-primary">Left aligned badge</span> </div> </div> <div class="col-md-4"> <input type="text" class="form-control"> <div class="d-block form-text text-center"> <span class="badge badge-danger">Centered badge</span> </div> </div> <div class="col-md-4"> <input type="text" class="form-control"> <div class="d-block form-text text-right"> <span class="badge badge-info text-right">Right aligned badge</span> </div> </div> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Inline text helper</label> <div class="col-lg-10"> <div class="row"> <div class="col-lg-6"> <input type="text" class="form-control"> </div> <div class="col-lg-6 mt-1 mt-lg-0 align-self-center"> <span class="text-muted">Inline text helper</span> </div> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Inline badge helper</label> <div class="col-lg-10"> <div class="row"> <div class="col-lg-6"> <input type="text" class="form-control"> </div> <div class="col-lg-6 mt-1 mt-lg-0 align-self-center"> <span class="badge bg-teal">Inline badge helper</span> </div> </div> </div> </div> </fieldset> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Input icons</legend> <div class="form-group row"> <label class="col-form-label col-lg-2">Input with icons</label> <div class="col-lg-10"> <div class="row"> <div class="col-md-6"> <div class="form-group form-group-feedback form-group-feedback-left"> <input type="text" class="form-control form-control-lg" placeholder="Left icon, input large"> <div class="form-control-feedback form-control-feedback-lg"> <i class="icon-make-group"></i> </div> </div> <div class="form-group form-group-feedback form-group-feedback-left"> <input type="text" class="form-control" placeholder="Left icon, input default"> <div class="form-control-feedback"> <i class="icon-droplets"></i> </div> </div> <div class="form-group form-group-feedback form-group-feedback-left"> <input type="text" class="form-control form-control-sm" placeholder="Left icon, input small"> <div class="form-control-feedback form-control-feedback-sm"> <i class="icon-pin-alt"></i> </div> </div> </div> <div class="col-md-6"> <div class="form-group form-group-feedback form-group-feedback-right"> <input type="text" class="form-control form-control-lg" placeholder="Right icon, input large"> <div class="form-control-feedback form-control-feedback-lg"> <i class="icon-make-group"></i> </div> </div> <div class="form-group form-group-feedback form-group-feedback-right"> <input type="text" class="form-control" placeholder="Right icon, input default"> <div class="form-control-feedback"> <i class="icon-droplets"></i> </div> </div> <div class="form-group form-group-feedback form-group-feedback-right"> <input type="text" class="form-control form-control-sm" placeholder="Right icon, input small"> <div class="form-control-feedback form-control-feedback-sm"> <i class="icon-pin-alt"></i> </div> </div> </div> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Input with spinners</label> <div class="col-lg-10"> <div class="row"> <div class="col-md-6"> <div class="form-group form-group-feedback form-group-feedback-left"> <input type="text" class="form-control" placeholder="Left spinner"> <div class="form-control-feedback"> <i class="icon-spinner2 spinner"></i> </div> </div> </div> <div class="col-md-6"> <div class="form-group form-group-feedback form-group-feedback-right"> <input type="text" class="form-control" placeholder="Right spinner"> <div class="form-control-feedback"> <i class="icon-spinner2 spinner"></i> </div> </div> </div> </div> </div> </div> </fieldset> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Validation states</legend> <div class="form-group row"> <label class="col-form-label col-lg-2 font-weight-semibold text-success">Valid state</label> <div class="col-lg-10"> <input type="text" class="form-control border-success" placeholder="Valid state"> <span class="form-text text-success">Valid state helper</span> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2 font-weight-semibold text-success">Valid state with icon</label> <div class="col-lg-10"> <div class="form-group-feedback form-group-feedback-right"> <input type="text" class="form-control border-success" placeholder="Valid state"> <div class="form-control-feedback text-success"> <i class="icon-checkmark-circle"></i> </div> </div> <span class="form-text text-success">Valid state helper</span> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2 font-weight-semibold text-danger">Invalid state</label> <div class="col-lg-10"> <input type="text" class="form-control border-danger" placeholder="Invalid state"> <span class="form-text text-danger">Invalid state helper</span> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2 font-weight-semibold text-danger">Invalid state with icon</label> <div class="col-lg-10"> <div class="form-group-feedback form-group-feedback-right"> <input type="text" class="form-control border-danger" placeholder="Invalid state"> <div class="form-control-feedback text-danger"> <i class="icon-cancel-circle2"></i> </div> </div> <span class="form-text text-danger">Invalid state helper</span> </div> </div> </fieldset> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Text options</legend> <div class="form-group row"> <label class="col-form-label col-md-2">Light text</label> <div class="col-md-10"> <input type="text" class="form-control font-weight-light" placeholder="Input with light text"> </div> </div> <div class="form-group row"> <label class="col-form-label col-md-2">Semibold text</label> <div class="col-md-10"> <input type="text" class="form-control font-weight-semibold" placeholder="Input with semibold text"> </div> </div> <div class="form-group row"> <label class="col-form-label col-md-2">Bold text</label> <div class="col-md-10"> <input type="text" class="form-control font-weight-bold" placeholder="Input with bold text"> </div> </div> <div class="form-group row"> <label class="col-form-label col-md-2">Capitalized text</label> <div class="col-md-10"> <input type="text" class="form-control text-capitalize" placeholder="Input with capitalized text"> </div> </div> <div class="form-group row"> <label class="col-form-label col-md-2">Centered text</label> <div class="col-md-10"> <input type="text" class="form-control text-center" placeholder="Input with centered text"> </div> </div> <div class="form-group row"> <label class="col-form-label col-md-2">Right aligned text</label> <div class="col-md-10"> <input type="text" class="form-control text-right" placeholder="Input with right aligned text"> </div> </div> <div class="form-group row"> <label class="col-form-label col-md-2">Uppercase text</label> <div class="col-md-10"> <input type="text" class="form-control text-uppercase" placeholder="Input with uppercase text"> <span class="form-text text-muted">Other text options work as well</span> </div> </div> </fieldset> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Field options</legend> <div class="form-group row"> <label class="col-form-label col-lg-2">Tooltip on focus</label> <div class="col-lg-10"> <input type="text" class="form-control" data-popup="tooltip" data-trigger="focus" title="Tooltip on focus" placeholder="Click on input"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Tooltip on hover</label> <div class="col-lg-10"> <input type="text" class="form-control" data-popup="tooltip" title="Tooltip on hover" placeholder="Hover on input"> </div> </div> <div class="form-group row"> <label class="col-form-label col-md-2">Rounded input</label> <div class="col-md-10"> <input type="text" class="form-control rounded-round" placeholder="Rounded input"> </div> </div> <div class="form-group row"> <label class="col-form-label col-md-2">Roundless input</label> <div class="col-md-10"> <input type="text" class="form-control rounded-0" placeholder="Roundless input"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Fixed input sizing</label> <div class="col-lg-10"> <div class="row"> <div class="col-3"> <input type="text" class="form-control" placeholder=".col-3"> </div> <div class="col-4"> <input type="text" class="form-control" placeholder=".col-4"> </div> <div class="col-5"> <input type="text" class="form-control" placeholder=".col-5"> </div> </div> <span class="form-text text-muted">Available in 12 columns sizes since it's based on 12 columns grid</span> </div> </div> </fieldset> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Sizing options</legend> <div class="form-group row"> <label class="col-form-label col-form-label-lg col-lg-2">Large size</label> <div class="col-lg-10"> <input type="text" class="form-control form-control-lg" placeholder=".col-form-label-lg .form-control-lg"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Default size</label> <div class="col-lg-10"> <input type="text" class="form-control" placeholder=".col-form-label .form-control"> </div> </div> <div class="form-group row"> <label class="col-form-label col-form-label-sm col-lg-2">Small size</label> <div class="col-lg-10"> <input type="text" class="form-control form-control-sm" placeholder=".col-form-label-sm .form-control-sm"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Inputs only</label> <div class="col-lg-10"> <div class="row"> <div class="col-md-6"> <div class="form-group"> <input class="form-control form-control-lg" type="text" placeholder="Large input height"> </div> <div class="form-group"> <input class="form-control" type="text" placeholder="Default input height"> </div> <div class="form-group"> <input class="form-control form-control-sm" type="text" placeholder="Small input height"> </div> </div> <div class="col-md-6"> <div class="form-group"> <select class="form-control form-control-lg"> <option value="opt1">Large select height</option> <option value="opt2">Option 2</option> <option value="opt3">Option 3</option> <option value="opt4">Option 4</option> <option value="opt5">Option 5</option> <option value="opt6">Option 6</option> <option value="opt7">Option 7</option> <option value="opt8">Option 8</option> </select> </div> <div class="form-group"> <select class="form-control"> <option value="opt1">Default select height</option> <option value="opt2">Option 2</option> <option value="opt3">Option 3</option> <option value="opt4">Option 4</option> <option value="opt5">Option 5</option> <option value="opt6">Option 6</option> <option value="opt7">Option 7</option> <option value="opt8">Option 8</option> </select> </div> <div class="form-group"> <select class="form-control form-control-sm"> <option value="opt1">Small select height</option> <option value="opt2">Option 2</option> <option value="opt3">Option 3</option> <option value="opt4">Option 4</option> <option value="opt5">Option 5</option> <option value="opt6">Option 6</option> <option value="opt7">Option 7</option> <option value="opt8">Option 8</option> </select> </div> </div> </div> </div> </div> </fieldset> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Color options</legend> <div class="form-group row"> <label class="col-form-label col-lg-2">Text color</label> <div class="col-lg-10"> <input type="text" class="form-control text-violet" value="Custom text color"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Border color</label> <div class="col-lg-10"> <input type="text" class="form-control border-teal border-1" placeholder="Custom border color"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Background color</label> <div class="col-lg-10"> <input type="text" class="form-control bg-slate-600 border-slate-600 border-1" placeholder="Custom background color"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Select color</label> <div class="col-lg-10"> <select class="form-control bg-indigo-400 border-indigo-400"> <option value="opt1">Custom select color</option> <option value="opt2">Option 2</option> <option value="opt3">Option 3</option> <option value="opt4">Option 4</option> <option value="opt5">Option 5</option> <option value="opt6">Option 6</option> <option value="opt7">Option 7</option> <option value="opt8">Option 8</option> </select> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Styled select</label> <div class="col-lg-10"> <select class="form-control form-control-uniform-custom"> <option value="opt1">Custom styled select color</option> <option value="opt2">Option 2</option> <option value="opt3">Option 3</option> <option value="opt4">Option 4</option> <option value="opt5">Option 5</option> <option value="opt6">Option 6</option> <option value="opt7">Option 7</option> <option value="opt8">Option 8</option> </select> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">File input color</label> <div class="col-lg-10"> <input type="file" class="form-control-uniform-custom"> </div> </div> </fieldset> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Type options</legend> <div class="form-group row"> <label class="col-form-label col-md-2">Datetime</label> <div class="col-md-10"> <input class="form-control" type="datetime" name="datetime"> <span class="form-text text-muted">Using <code>input type="datetime"</code></span> </div> </div> <div class="form-group row"> <label class="col-form-label col-md-2">Date</label> <div class="col-md-10"> <input class="form-control" type="date" name="date"> <span class="form-text text-muted">Using <code>input type="date"</code></span> </div> </div> <div class="form-group row"> <label class="col-form-label col-md-2">Month</label> <div class="col-md-10"> <input class="form-control" type="month" name="month"> <span class="form-text text-muted">Using <code>input type="month"</code></span> </div> </div> <div class="form-group row"> <label class="col-form-label col-md-2">Time</label> <div class="col-md-10"> <input class="form-control" type="time" name="time"> <span class="form-text text-muted">Using <code>input type="time"</code></span> </div> </div> <div class="form-group row"> <label class="col-form-label col-md-2">Week</label> <div class="col-md-10"> <input class="form-control" type="week" name="week"> <span class="form-text text-muted">Using <code>input type="week"</code></span> </div> </div> <div class="form-group row"> <label class="col-form-label col-md-2">Number</label> <div class="col-md-10"> <input class="form-control" type="number" name="number"> <span class="form-text text-muted">Using <code>input type="number"</code></span> </div> </div> <div class="form-group row"> <label class="col-form-label col-md-2">Email</label> <div class="col-md-10"> <input class="form-control" type="email" name="email"> <span class="form-text text-muted">Using <code>input type="email"</code></span> </div> </div> <div class="form-group row"> <label class="col-form-label col-md-2">URL</label> <div class="col-md-10"> <input class="form-control" type="url" name="url"> <span class="form-text text-muted">Using <code>input type="url"</code></span> </div> </div> <div class="form-group row"> <label class="col-form-label col-md-2">Search</label> <div class="col-md-10"> <input class="form-control" type="search" name="search"> <span class="form-text text-muted">Using <code>input type="search"</code></span> </div> </div> <div class="form-group row"> <label class="col-form-label col-md-2">Tel</label> <div class="col-md-10"> <input class="form-control" type="tel" name="tel"> <span class="form-text text-muted">Using <code>input type="tel"</code></span> </div> </div> <div class="form-group row"> <label class="col-form-label col-md-2">Color</label> <div class="col-md-10"> <input class="form-control" type="color" name="color"> <span class="form-text text-muted">Using <code>input type="color"</code></span> </div> </div> <div class="form-group row"> <label class="col-form-label col-md-2">Range</label> <div class="col-md-10"> <input class="form-control" type="range" name="range" min="0" max="10"> <span class="form-text text-muted">Using <code>input type="range"</code></span> </div> </div> </fieldset> <div class="text-right"> <button type="submit" class="btn btn-primary">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> <!-- /form inputs --> </div> <!-- /content area --> <!-- FIM form_inputs --> <!-- INICIO form_checkboxes_radios --> <div class="content"> <!-- Checkboxes --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Checkboxes</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <p class="mb-3">The HTML input element <code>&lt;input type=checkbox></code> is an input element to enter an array of different values. The <code>value</code> attribute is used to define the value submitted by the checkbox. The <code>checked</code> attribute is used to indicate whether this item is selected. The <code>indeterminate</code> attribute is used to indicate that the checkbox is in an indeterminate state (on most platforms, this draws a horizontal line across the checkbox).</p> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label class="font-weight-semibold">Left stacked default</label> <div class="form-check"> <label class="form-check-label"> <input type="checkbox" class="form-check-input" checked> Checked default </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="checkbox" class="form-check-input"> Unchecked default </label> </div> <div class="form-check disabled"> <label class="form-check-label"> <input type="checkbox" class="form-check-input" checked disabled> Disabled default </label> </div> </div> <div class="form-group"> <label class="d-block font-weight-semibold">Left inline default</label> <div class="form-check form-check-inline"> <label class="form-check-label"> <input type="checkbox" class="form-check-input" checked> Checked default </label> </div> <div class="form-check form-check-inline"> <label class="form-check-label"> <input type="checkbox" class="form-check-input"> Unchecked default </label> </div> </div> <div class="form-group pt-2"> <label class="font-weight-semibold">Left stacked styled</label> <div class="form-check"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-styled" checked data-fouc> Checked styled </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-styled" data-fouc> Unchecked styled </label> </div> <div class="form-check disabled"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-styled" disabled data-fouc> Disabled styled </label> </div> </div> <div class="form-group mb-3 mb-md-2"> <label class="d-block font-weight-semibold">Left inline styled</label> <div class="form-check form-check-inline"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-styled" checked data-fouc> Checked styled </label> </div> <div class="form-check form-check-inline"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-styled" data-fouc> Unchecked styled </label> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <label class="font-weight-semibold">Right stacked default</label> <div class="form-check form-check-right"> <label class="form-check-label"> Checked default <input type="checkbox" class="form-check-input" checked> </label> </div> <div class="form-check form-check-right"> <label class="form-check-label"> Unchecked default <input type="checkbox" class="form-check-input"> </label> </div> <div class="form-check form-check-right disabled"> <label class="form-check-label"> Disabled default <input type="checkbox" class="form-check-input" checked disabled> </label> </div> </div> <div class="form-group"> <label class="d-block font-weight-semibold">Right inline default</label> <div class="form-check form-check-inline form-check-right"> <label class="form-check-label"> Checked default <input type="checkbox" class="form-check-input" checked> </label> </div> <div class="form-check form-check-inline form-check-right"> <label class="form-check-label"> Unchecked default <input type="checkbox" class="form-check-input"> </label> </div> </div> <div class="form-group pt-2"> <label class="d-block font-weight-semibold">Right stacked styled</label> <div class="form-check form-check-right"> <label class="form-check-label"> Checked styled <input type="checkbox" class="form-check-input-styled" checked data-fouc> </label> </div> <div class="form-check form-check-right"> <label class="form-check-label"> Unchecked styled <input type="checkbox" class="form-check-input-styled" data-fouc> </label> </div> <div class="form-check form-check-right disabled"> <label class="form-check-label"> Disabled styled <input type="checkbox" class="form-check-input-styled" checked disabled data-fouc> </label> </div> </div> <div class="form-group mb-3 mb-md-2"> <label class="d-block font-weight-semibold">Right inline styled</label> <div class="form-check form-check-inline form-check-right"> <label class="form-check-label"> Checked styled <input type="checkbox" class="form-check-input-styled" checked data-fouc> </label> </div> <div class="form-check form-check-inline form-check-right"> <label class="form-check-label"> Unchecked styled <input type="checkbox" class="form-check-input-styled" data-fouc> </label> </div> </div> </div> </div> </div> </div> <!-- /checkboxes --> <!-- Radio buttons --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Radio buttons</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <p class="mb-3">Radio button is an element that can be turned on and off. Radio buttons are almost always grouped together in groups. Only one radio button within the same <code>radiogroup</code> may be selected at a time. The user can switch which radio button is turned on by selecting it with the mouse or keyboard. Other radio buttons in the same group are turned off. A label, specified with the <code>label</code> attribute may be added beside the radio button.</p> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label class="font-weight-semibold">Left stacked default</label> <div class="form-check"> <label class="form-check-label"> <input type="radio" class="form-check-input" name="unstyled-radio-left" checked> Selected default </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" class="form-check-input" name="unstyled-radio-left"> Unselected default </label> </div> <div class="form-check disabled"> <label class="form-check-label"> <input type="radio" class="form-check-input" checked disabled> Disabled default </label> </div> </div> <div class="form-group"> <label class="d-block font-weight-semibold">Left inline default</label> <div class="form-check form-check-inline"> <label class="form-check-label"> <input type="radio" class="form-check-input" name="radio-unstyled-inline-left" checked> Selected default </label> </div> <div class="form-check form-check-inline"> <label class="form-check-label"> <input type="radio" class="form-check-input" name="radio-unstyled-inline-left"> Unselected default </label> </div> </div> <div class="form-group pt-2"> <label class="font-weight-semibold">Left stacked styled</label> <div class="form-check"> <label class="form-check-label"> <input type="radio" class="form-check-input-styled" name="stacked-radio-left" checked data-fouc> Selected styled </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" class="form-check-input-styled" name="stacked-radio-left" data-fouc> Unselected styled </label> </div> <div class="form-check disabled"> <label class="form-check-label"> <input type="radio" class="form-check-input-styled" disabled data-fouc> Disabled styled </label> </div> </div> <div class="form-group mb-3 mb-md-2"> <label class="d-block font-weight-semibold">Left inline styled</label> <div class="form-check form-check-inline"> <label class="form-check-label"> <input type="radio" class="form-check-input-styled" name="radio-inline-left" checked data-fouc> Selected styled </label> </div> <div class="form-check form-check-inline"> <label class="form-check-label"> <input type="radio" class="form-check-input-styled" name="radio-inline-left" data-fouc> Unselected styled </label> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <label class="font-weight-semibold">Right stacked default</label> <div class="form-check form-check-right"> <label class="form-check-label"> Selected default <input type="radio" class="form-check-input" name="unstyled-radio-right" checked> </label> </div> <div class="form-check form-check-right"> <label class="form-check-label"> Unselected default <input type="radio" class="form-check-input" name="unstyled-radio-right"> </label> </div> <div class="form-check form-check-right disabled"> <label class="form-check-label"> Disabled default <input type="radio" class="form-check-input" checked disabled> </label> </div> </div> <div class="form-group"> <label class="d-block font-weight-semibold">Right inline default</label> <div class="form-check form-check-inline form-check-right"> <label class="form-check-label"> Selected default <input type="radio" class="form-check-input" name="radio-unstyled-inline-right" checked> </label> </div> <div class="form-check form-check-inline form-check-right"> <label class="form-check-label"> Unselected default <input type="radio" class="form-check-input" name="radio-unstyled-inline-right"> </label> </div> </div> <div class="form-group pt-2"> <label class="font-weight-semibold">Right stacked styled</label> <div class="form-check form-check-right"> <label class="form-check-label"> Selected styled <input type="radio" class="form-check-input-styled" name="stacked-radio-right" checked data-fouc> </label> </div> <div class="form-check form-check-right"> <label class="form-check-label"> Unselected styled <input type="radio" class="form-check-input-styled" name="stacked-radio-right" data-fouc> </label> </div> <div class="form-check form-check-right disabled"> <label class="form-check-label"> Disabled styled <input type="radio" class="form-check-input-styled" checked disabled data-fouc> </label> </div> </div> <div class="form-group mb-3 mb-md-2"> <label class="d-block font-weight-semibold">Right inline styled</label> <div class="form-check form-check-inline form-check-right"> <label class="form-check-label"> Selected styled <input type="radio" class="form-check-input-styled" name="radio-inline-right" checked data-fouc> </label> </div> <div class="form-check form-check-inline form-check-right"> <label class="form-check-label"> Unselected styled <input type="radio" class="form-check-input-styled" name="radio-inline-right" data-fouc> </label> </div> </div> </div> </div> </div> </div> <!-- /radio buttons --> <!-- Custom Bootstrap inputs --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Custom Bootstrap inputs</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <p class="mb-3">For even more customization and cross browser consistency, use our completely custom form elements to replace the browser defaults. They’re built on top of semantic and accessible markup, so they’re solid replacements for any default form control. Custom checkboxes can also utilize the <code>:indeterminate</code> pseudo class when manually set via JavaScript (there is no available HTML attribute for specifying it).</p> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label class="d-block font-weight-semibold">Left stacked checkboxes</label> <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input" id="custom_checkbox_stacked_unchecked" checked> <label class="custom-control-label" for="custom_checkbox_stacked_unchecked">Custom checked</label> </div> <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input" id="custom_checkbox_stacked_checked"> <label class="custom-control-label" for="custom_checkbox_stacked_checked">Custom unchecked</label> </div> <div class="custom-control custom-checkbox"> <input type="checkbox" class="custom-control-input" id="custom_checkbox_stacked_checked_disabled" checked disabled> <label class="custom-control-label" for="custom_checkbox_stacked_checked_disabled">Custom checked disabled</label> </div> </div> <div class="form-group"> <label class="d-block font-weight-semibold">Left inline checkboxes</label> <div class="custom-control custom-checkbox custom-control-inline"> <input type="checkbox" class="custom-control-input" id="custom_checkbox_inline_unchecked" checked> <label class="custom-control-label" for="custom_checkbox_inline_unchecked">Custom checked</label> </div> <div class="custom-control custom-checkbox custom-control-inline"> <input type="checkbox" class="custom-control-input" id="custom_checkbox_inline_checked"> <label class="custom-control-label" for="custom_checkbox_inline_checked">Custom unchecked</label> </div> </div> <div class="form-group pt-2"> <label class="d-block font-weight-semibold">Left stacked radios</label> <div class="custom-control custom-radio"> <input type="radio" class="custom-control-input" name="custom-stacked-radio" id="custom_radio_stacked_unchecked" checked> <label class="custom-control-label" for="custom_radio_stacked_unchecked">Custom selected</label> </div> <div class="custom-control custom-radio"> <input type="radio" class="custom-control-input" name="custom-stacked-radio" id="custom_radio_stacked_checked"> <label class="custom-control-label" for="custom_radio_stacked_checked">Custom unselected</label> </div> <div class="custom-control custom-radio"> <input type="radio" class="custom-control-input" id="custom_radio_stacked_checked_disabled" checked disabled> <label class="custom-control-label" for="custom_radio_stacked_checked_disabled">Custom selected disabled</label> </div> </div> <div class="form-group mb-3 mb-md-2"> <label class="d-block font-weight-semibold">Left inline radios</label> <div class="custom-control custom-radio custom-control-inline"> <input type="radio" class="custom-control-input" name="custom-inline-radio" id="custom_radio_inline_unchecked" checked> <label class="custom-control-label" for="custom_radio_inline_unchecked">Custom selected</label> </div> <div class="custom-control custom-radio custom-control-inline"> <input type="radio" class="custom-control-input" name="custom-inline-radio" id="custom_radio_inline_checked"> <label class="custom-control-label" for="custom_radio_inline_checked">Custom unselected</label> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <label class="d-block font-weight-semibold">Right stacked checkboxes</label> <div class="custom-control custom-control-right custom-checkbox"> <input type="checkbox" class="custom-control-input" id="custom_checkbox_stacked_right_checked" checked> <label class="custom-control-label position-static" for="custom_checkbox_stacked_right_checked">Custom checked</label> </div> <div class="custom-control custom-control-right custom-checkbox"> <input type="checkbox" class="custom-control-input" id="custom_checkbox_stacked_right_unchecked"> <label class="custom-control-label position-static" for="custom_checkbox_stacked_right_unchecked">Custom unchecked</label> </div> <div class="custom-control custom-control-right custom-checkbox"> <input type="checkbox" class="custom-control-input" id="custom_checkbox_stacked_right_checked_disabled" checked disabled> <label class="custom-control-label position-static" for="custom_checkbox_stacked_right_checked_disabled">Custom checked disabled</label> </div> </div> <div class="form-group"> <label class="d-block font-weight-semibold">Right inline checkboxes</label> <div class="custom-control custom-control-right custom-checkbox custom-control-inline"> <input type="checkbox" class="custom-control-input" id="custom_checkbox_inline_right_checked" checked> <label class="custom-control-label position-static" for="custom_checkbox_inline_right_checked">Custom checked</label> </div> <div class="custom-control custom-control-right custom-checkbox custom-control-inline"> <input type="checkbox" class="custom-control-input" id="custom_checkbox_inline_right_unchecked"> <label class="custom-control-label position-static" for="custom_checkbox_inline_right_unchecked">Custom unchecked</label> </div> </div> <div class="form-group pt-2"> <label class="d-block font-weight-semibold">Right stacked radios</label> <div class="custom-control custom-control-right custom-radio"> <input type="radio" class="custom-control-input" name="custom-stacked-radio-right" id="custom_radio_stacked_right_checked" checked> <label class="custom-control-label position-static" for="custom_radio_stacked_right_checked">Custom selected</label> </div> <div class="custom-control custom-control-right custom-radio"> <input type="radio" class="custom-control-input" name="custom-stacked-radio-right" id="custom_radio_stacked_right_unchecked"> <label class="custom-control-label position-static" for="custom_radio_stacked_right_unchecked">Custom unselected</label> </div> <div class="custom-control custom-control-right custom-radio"> <input type="radio" class="custom-control-input" id="custom_radio_stacked_right_checked_disabled" checked disabled> <label class="custom-control-label position-static" for="custom_radio_stacked_right_checked_disabled">Custom selected disabled</label> </div> </div> <div class="form-group mb-3 mb-md-2"> <label class="d-block font-weight-semibold">Right stacked radios</label> <div class="custom-control custom-control-right custom-radio custom-control-inline"> <input type="radio" class="custom-control-input" name="custom-inline-radio-right" id="custom_radio_inline_right_checked" checked> <label class="custom-control-label position-static" for="custom_radio_inline_right_checked">Custom selected</label> </div> <div class="custom-control custom-control-right custom-radio custom-control-inline"> <input type="radio" class="custom-control-input" name="custom-inline-radio-right" id="custom_radio_inline_right_unchecked"> <label class="custom-control-label position-static" for="custom_radio_inline_right_unchecked">Custom unselected</label> </div> </div> </div> </div> </div> </div> <!-- /custom Bootstrap inputs --> <!-- Colors --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Color options</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <p class="mb-3">Besides default color, both checkboxes and radio buttons support 5 additional contextual color classes and other custom colors from color system. Colors are adapted to use in different background colors of parent elements - dropdown menus, active list states, input group addons - all checkboxes and radios are white on dark backgrounds. To use, simply add <code>background</code> and <code>text</code> color classes to Uniform's <code>wrapperClass</code> options.</p> <div class="row"> <div class="col-md-6"> <div class="form-group mb-3 mb-md-2"> <label class="font-weight-semibold">Checkboxes</label> <div class="row"> <div class="col-md-6"> <div class="form-check"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-styled-primary" checked data-fouc> Primary checkbox </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-styled-danger" checked data-fouc> Danger checkbox </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-styled-success" checked data-fouc> Success checkbox </label> </div> </div> <div class="col-md-6"> <div class="form-check"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-styled-warning" checked data-fouc> Warning checkbox </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-styled-info" checked data-fouc> Info checkbox </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-styled-custom" checked data-fouc> Custom color </label> </div> </div> </div> </div> </div> <div class="col-md-6"> <div class="form-group mb-3 mb-md-2"> <label class="font-weight-semibold">Radio buttons</label> <div class="row"> <div class="col-md-6"> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="radio-styled-color" class="form-check-input-styled-primary" checked data-fouc> Primary radio </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="radio-styled-color" class="form-check-input-styled-danger" data-fouc> Danger radio </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="radio-styled-color" class="form-check-input-styled-success" data-fouc> Success radio </label> </div> </div> <div class="col-md-6"> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="radio-styled-color" class="form-check-input-styled-warning" data-fouc> Warning radio </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="radio-styled-color" class="form-check-input-styled-info" data-fouc> Info radio </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="radio-styled-color" class="form-check-input-styled-custom" data-fouc> Custom color </label> </div> </div> </div> </div> </div> </div> </div> </div> <!-- /colors --> <!-- Switchery toggles --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Switchery toggles</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="row"> <div class="col-md-6"> <h6 class="font-weight-semibold">Default switchers</h6> <p class="mb-3">You can add as many switches as you like, as long as their corresponding checkboxes have the same class. Select them and make new instance of the Switchery class for every of them.</p> <div class="form-check form-check-switchery"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-switchery" checked data-fouc> Checked switch </label> </div> <div class="form-check form-check-switchery"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-switchery" data-fouc> Unchecked switch </label> </div> <div class="form-check form-check-switchery disabled"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-switchery" checked disabled data-fouc> Checked disabled </label> </div> <div class="form-check form-check-switchery disabled"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-switchery" disabled data-fouc> Unchecked disabled </label> </div> <h6 class="font-weight-semibold pt-3">Switcher colors</h6> <p class="mb-3">You can change the default color of the switch to fit your design perfectly. According to the color system, any of its color can be applied to the switchery. Custom colors are also supported.</p> <div class="form-check form-check-switchery"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-switchery-primary" checked data-fouc> Switch in <span class="font-weight-semibold">primary</span> context </label> </div> <div class="form-check form-check-switchery"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-switchery-danger" checked data-fouc> Switch in <span class="font-weight-semibold">danger</span> context </label> </div> <div class="form-check form-check-switchery"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-switchery-info" checked data-fouc> Switch in <span class="font-weight-semibold">info</span> context </label> </div> <div class="form-check form-check-switchery"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-switchery-warning" checked data-fouc> Switch in <span class="font-weight-semibold">warning</span> context </label> </div> <h6 class="font-weight-semibold pt-3">Left inline</h6> <p class="mb-3">Switchery component also supports default option for <strong>left</strong> and <strong>right</strong> inline alignment. Just add <code>.form-check-inline</code> class to <code>.form-check-switchery</code> container. Default alignment is <strong>left</strong>.</p> <div class="form-check form-check-switchery form-check-inline"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-switchery" checked data-fouc> First input </label> </div> <div class="form-check form-check-switchery form-check-inline"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-switchery" checked data-fouc> Second input </label> </div> </div> <div class="col-md-6"> <h6 class="font-weight-semibold pt-3 pt-md-0">Sticked to the right</h6> <p class="mb-3">Sometimes it's very useful to have switches on the right side of the container. Just add <code>.form-check-right</code> class to the <code>&lt;.form-check></code> container for the very right side switcher alignment.</p> <div class="form-check form-check-right form-check-switchery"> <label class="form-check-label"> Checked switch <input type="checkbox" class="form-check-input-switchery" checked data-fouc> </label> </div> <div class="form-check form-check-right form-check-switchery"> <label class="form-check-label"> Unchecked switch <input type="checkbox" class="form-check-input-switchery" data-fouc> </label> </div> <div class="form-check form-check-right form-check-switchery disabled"> <label class="form-check-label"> Checked disabled <input type="checkbox" class="form-check-input-switchery" checked disabled data-fouc> </label> </div> <div class="form-check form-check-right form-check-switchery disabled"> <label class="form-check-label"> Unchecked disabled <input type="checkbox" class="form-check-input-switchery" disabled data-fouc> </label> </div> <h6 class="font-weight-semibold pt-3">Multiple labels</h6> <p class="mb-3">Switchery can be used with single label or with multiple labels. To use, add <code>.switchery-double</code> class to the container. All sizing options are available for this switchery type as well.</p> <div class="form-check form-check-switchery form-check-switchery-double"> <label class="form-check-label"> Enable <input type="checkbox" class="form-check-input-switchery" checked data-fouc> Disable </label> </div> <div class="form-check form-check-switchery form-check-switchery-double"> <label class="form-check-label"> Enable <input type="checkbox" class="form-check-input-switchery" data-fouc> Disable </label> </div> <div class="form-check form-check-switchery form-check-switchery-double disabled"> <label class="form-check-label"> Enable <input type="checkbox" class="form-check-input-switchery" checked disabled data-fouc> Disable </label> </div> <div class="form-check form-check-switchery form-check-switchery-double disabled"> <label class="form-check-label"> Enable <input type="checkbox" class="form-check-input-switchery" disabled data-fouc> Disable </label> </div> <h6 class="font-weight-semibold pt-3">Right inline</h6> <p class="mb-3">You can also reverse inline alignment to <code>right</code> - just add default <code>.form-check-right</code> to any <code>.form-check</code> container and all inputs will be adjusted automatically.</p> <div class="form-check form-check-switchery form-check-inline form-check-right"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-switchery" checked data-fouc> First input </label> </div> <div class="form-check form-check-switchery form-check-inline form-check-right"> <label class="form-check-label"> <input type="checkbox" class="form-check-input-switchery" checked data-fouc> Second input </label> </div> </div> </div> </div> </div> <!-- /switchery toggles --> <!-- Bootstrap switch --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Bootstrap switch</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="row"> <div class="col-md-6"> <div class="mb-4"> <h6 class="font-weight-semibold">Switch states</h6> <p>By default Bootstrap Switch supports standard attributes for checkboxes such as <code>disabled</code>, <code>checked</code> and <code>readonly</code> or use <code>true</code> or <code>false</code> in plugin options.</p> <div class="row"> <div class="col-md-6"> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label"> <input type="checkbox" class="form-check-input form-check-input-switch" data-on-text="On" data-off-text="Off" checked> Checked switch </label> </div> <div class="form-check form-check-switch form-check-switch-left disabled"> <label class="form-check-label"> <input type="checkbox" data-on-text="On" data-off-text="Off" class="form-check-input form-check-input-switch" checked disabled> Checked disabled </label> </div> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label"> <input type="checkbox" data-on-text="On" data-off-text="Off" class="form-check-input form-check-input-switch" readonly checked> Checked readonly </label> </div> </div> <div class="col-md-6"> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label"> <input type="checkbox" data-on-text="On" data-off-text="Off" class="form-check-input form-check-input-switch"> Unchecked switch </label> </div> <div class="form-check form-check-switch form-check-switch-left disabled"> <label class="form-check-label"> <input type="checkbox" data-on-text="On" data-off-text="Off" class="form-check-input form-check-input-switch" disabled> Unchecked disabled </label> </div> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label"> <input type="checkbox" data-on-text="On" data-off-text="Off" class="form-check-input form-check-input-switch" readonly> Unchecked readonly </label> </div> </div> </div> </div> </div> <div class="col-md-6"> <div class="mb-4"> <h6 class="font-weight-semibold">Switch colors</h6> <p>You can change the default color of the switch by choosing one of 6 predefined classes and use them in <code>data-on-color</code> and <code>data-off-color</code> attributes.</p> <div class="row"> <div class="col-sm-6"> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label d-flex align-items-center"> <input type="checkbox" class="form-check-input form-check-input-switch" data-on-text="On" data-off-text="Off" data-on-color="default" data-off-color="danger" checked> Default color </label> </div> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label d-flex align-items-center"> <input type="checkbox" class="form-check-input form-check-input-switch" data-on-text="On" data-off-text="Off" data-on-color="primary" data-off-color="default" checked> Primary color </label> </div> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label d-flex align-items-center"> <input type="checkbox" class="form-check-input form-check-input-switch" data-on-text="On" data-off-text="Off" data-on-color="danger" data-off-color="default" checked> Danger color </label> </div> </div> <div class="col-sm-6"> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label d-flex align-items-center"> <input type="checkbox" class="form-check-input form-check-input-switch" data-on-text="On" data-off-text="Off" data-on-color="success" data-off-color="default" checked> Success color </label> </div> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label d-flex align-items-center"> <input type="checkbox" class="form-check-input form-check-input-switch" data-on-text="On" data-off-text="Off" data-on-color="warning" data-off-color="default" checked> Warning color </label> </div> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label d-flex align-items-center"> <input type="checkbox" class="form-check-input form-check-input-switch" data-on-text="On" data-off-text="Off" data-on-color="info" data-off-color="default" checked> Info color </label> </div> </div> </div> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="mb-3"> <h6 class="font-weight-semibold">Switch sizes</h6> <p>Default height is equal to input field height, but you can also choose one of 4 available sizes (large, small and mini) by changing <code>data-size</code> attribute.</p> <div class="row"> <div class="col-md-6"> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label d-flex align-items-center"> <input type="checkbox" class="form-check-input-switch" data-on-text="On" data-off-text="Off" data-size="large" checked> Large switch </label> </div> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label d-flex align-items-center"> <input type="checkbox" data-on-text="On" data-off-text="Off" class="form-check-input-switch" data-size="small" checked> Small switch </label> </div> </div> <div class="col-md-6"> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label d-flex align-items-center"> <input type="checkbox" data-on-text="On" data-off-text="Off" class="form-check-input-switch" checked> Default switch </label> </div> </div> </div> </div> </div> <div class="col-md-6"> <div class="mb-3"> <h6 class="font-weight-semibold">Label options</h6> <p>Labels support any text or icon via <code>data-on-text</code> and <code>data-off-text</code> attributes. If no custom text specified, switch will display default on/off text.</p> <div class="row"> <div class="col-md-6"> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label d-flex align-items-center"> <input type="checkbox" data-off-color="danger" data-on-text="Yes" data-off-text="No" class="form-check-input-switch" checked> Default text </label> </div> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label d-flex align-items-center"> <input type="checkbox" data-on-color="warning" data-off-color="info" data-on-text="<i class='icon-link'></i>" data-off-text="<i class='icon-unlink'></i>" class="form-check-input-switch" checked> Icons only </label> </div> </div> <div class="col-md-6"> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label d-flex align-items-center"> <input type="checkbox" data-on-color="danger" data-off-color="primary" data-on-text="Enable" data-off-text="Disable" class="form-check-input-switch" checked> Enable/Disable </label> </div> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label d-flex align-items-center"> <input type="checkbox" data-on-color="success" data-off-color="danger" data-on-text="Online" data-off-text="Offline" class="form-check-input-switch" checked> Online/Offline </label> </div> </div> </div> </div> </div> </div> </div> </div> <!-- /bootstrap switch --> </div> <!-- FIM form_checkboxes_radios --> <!-- INICIO form_select2 --> <div class="content"> <!-- Select2 selects --> <div class="mb-3"> <h6 class="mb-0 font-weight-semibold"> Basic setup </h6> <span class="text-muted d-block">Examples with basic options</span> </div> <div class="row"> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Single select</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="form-group"> <label>Basic select</label> <select class="form-control select" data-fouc> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="AR">Arkansas</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> <div class="form-group"> <label class="d-block">Fixed select width</label> <select class="form-control select-fixed-single" data-fouc> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="AR">Arkansas</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> <div class="form-group"> <label>Select with search</label> <select class="form-control select-search" data-fouc> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> <div class="form-group"> <label>Select with placeholder</label> <select data-placeholder="Select a State..." class="form-control select" data-fouc> <option></option> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> <div class="form-group"> <label>Select with icons</label> <select data-placeholder="Select a state..." class="form-control select-icons" data-fouc> <optgroup label="Services"> <option value="wordpress2" data-icon="wordpress2">Wordpress</option> <option value="tumblr2" data-icon="tumblr2">Tumblr</option> <option value="stumbleupon" data-icon="stumbleupon">Stumble upon</option> <option value="pinterest2" data-icon="pinterest2">Pinterest</option> <option value="lastfm2" data-icon="lastfm2">Lastfm</option> </optgroup> <optgroup label="File types"> <option value="pdf" data-icon="file-pdf">PDF</option> <option value="word" data-icon="file-word">Word</option> <option value="excel" data-icon="file-excel">Excel</option> <option value="openoffice" data-icon="file-openoffice">Open office</option> </optgroup> <optgroup label="Browsers"> <option value="chrome" data-icon="chrome" selected>Chrome</option> <option value="firefox" data-icon="firefox">Firefox</option> <option value="safari" data-icon="safari">Safari</option> <option value="opera" data-icon="opera">Opera</option> <option value="IE" data-icon="IE">IE</option> </optgroup> </select> </div> <div class="form-group"> <label>Disable items</label> <select class="form-control select" data-fouc> <optgroup label="Mountain Time Zone"> <option value="AZ" disabled>Arizona</option> <option value="CO">Colorado</option> <option value="ID" disabled>Idaho</option> <option value="WY" disabled>Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="AR" disabled>Arkansas</option> <option value="KS">Kansas</option> <option value="KY" disabled>Kentucky</option> </optgroup> </select> </div> <div class="form-group"> <label>Disabled select</label> <select class="form-control select" disabled data-fouc> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </select> </div> <div class="form-group"> <label>Select background color</label> <select class="form-control select" data-container-css-class="bg-teal-400" data-fouc> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> <div class="form-group"> <label>Menu background color</label> <select class="form-control select" data-dropdown-css-class="bg-teal-400" data-fouc> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> <div class="form-group"> <label>Custom color</label> <select class="form-control select" data-container-css-class="bg-indigo-400" data-dropdown-css-class="bg-indigo-400" data-fouc> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> <div class="form-group"> <label>Custom border and text color</label> <select class="form-control select" data-container-css-class="border-primary text-primary-700" data-dropdown-css-class="border-primary" data-fouc> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> </div> </div> </div> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Multiple select</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="form-group"> <label>Multiple select</label> <select multiple="multiple" class="form-control select" data-fouc> <optgroup label="Mountain Time Zone"> <option value="AZ" selected>Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="IA" selected>Iowa</option> <option value="KS" selected>Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> <div class="form-group"> <label class="d-block">Fixed width select</label> <select multiple="multiple" class="form-control select-fixed-multiple" data-fouc> <optgroup label="Mountain Time Zone"> <option value="AZ" selected>Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="IA">Iowa</option> <option value="KS" selected>Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> <div class="form-group"> <label>With placeholder</label> <select data-placeholder="Select a State..." multiple="multiple" class="form-control select" data-fouc> <option></option> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> <div class="form-group"> <label>With icons</label> <select multiple="multiple" data-placeholder="Select a state..." class="form-control select-icons" data-fouc> <optgroup label="Services"> <option value="wordpress2" data-icon="wordpress2">Wordpress</option> <option value="tumblr2" data-icon="tumblr2">Tumblr</option> <option value="stumbleupon" data-icon="stumbleupon">Stumble upon</option> <option value="pinterest2" data-icon="pinterest2">Pinterest</option> <option value="lastfm2" data-icon="lastfm2">Lastfm</option> </optgroup> <optgroup label="File types"> <option value="pdf" data-icon="file-pdf">PDF</option> <option value="word" data-icon="file-word">Word</option> <option value="excel" data-icon="file-excel">Excel</option> <option value="openoffice" data-icon="file-openoffice">Open office</option> </optgroup> <optgroup label="Browsers"> <option value="chrome" data-icon="chrome" selected>Chrome</option> <option value="firefox" data-icon="firefox" selected>Firefox</option> <option value="safari" data-icon="safari" selected>Safari</option> <option value="opera" data-icon="opera">Opera</option> <option value="IE" data-icon="IE">IE</option> </optgroup> </select> </div> <div class="form-group"> <label>Drag and drop sorting</label> <select class="form-control select-multiple-drag" multiple="multiple" data-fouc> <option value="AZ" selected>Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> <option value="IL" selected>Illinois</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </select> </div> <div class="form-group"> <label>Disable menu items</label> <select multiple="multiple" class="form-control select" data-fouc> <optgroup label="Mountain Time Zone"> <option value="AZ" disabled>Arizona</option> <option value="CO">Colorado</option> <option value="ID" disabled>Idaho</option> <option value="WY" selected>Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="AR" selected>Arkansas</option> <option value="KS">Kansas</option> <option value="KY" disabled>Kentucky</option> </optgroup> </select> </div> <div class="form-group"> <label>Disabled select</label> <select multiple="multiple" class="form-control select" disabled data-fouc> <option value="AZ" selected>Arizona</option> <option value="CO">Colorado</option> <option value="ID" selected>Idaho</option> <option value="WY" selected>Wyoming</option> </select> </div> <div class="form-group"> <label>Results background color</label> <select multiple="multiple" class="form-control select" data-container-css-class="bg-teal-400" data-fouc> <optgroup label="Mountain Time Zone"> <option value="AZ" selected>Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="IL" selected>Illinois</option> <option value="IA">Iowa</option> <option value="KS" selected>Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> <div class="form-group"> <label>Menu background color</label> <select multiple="multiple" class="form-control select" data-dropdown-css-class="bg-slate-700" data-fouc> <optgroup label="Mountain Time Zone"> <option value="AZ" selected>Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="IL" selected>Illinois</option> <option value="IA">Iowa</option> <option value="KS" selected>Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> <div class="form-group"> <label>Custom colors</label> <select multiple="multiple" class="form-control select" data-container-css-class="bg-indigo-400" data-dropdown-css-class="bg-indigo-400" data-fouc> <optgroup label="Mountain Time Zone"> <option value="AZ" selected>Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="IL" selected>Illinois</option> <option value="IA">Iowa</option> <option value="KS" selected>Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> <div class="form-group"> <label>Custom border color</label> <select multiple="multiple" class="form-control select" data-container-css-class="border-primary text-primary-700" data-dropdown-css-class="border-primary" data-fouc> <optgroup label="Mountain Time Zone"> <option value="AZ" selected>Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="IL" selected>Illinois</option> <option value="IA">Iowa</option> <option value="KS" selected>Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> </div> </div> </div> </div> <!-- /select2 selects --> <!-- Select2 sizing --> <div class="mb-3 pt-2"> <h6 class="mb-0 font-weight-semibold"> Select sizing </h6> <span class="text-muted d-block">Single and multiple selects sizing</span> </div> <div class="row"> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Single select sizing</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="form-group"> <label>Large select</label> <select data-placeholder="Select a State..." class="form-control form-control-lg select" data-container-css-class="select-lg" data-fouc> <option></option> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> <div class="form-group"> <label>Default select</label> <select data-placeholder="Select a State..." class="form-control select" data-fouc> <option></option> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> <div class="form-group"> <label>Small select</label> <select data-placeholder="Select a State..." class="form-control form-control-sm select" data-container-css-class="select-sm" data-fouc> <option></option> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> </div> </div> </div> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Multiple select sizing</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="form-group"> <label>Large select</label> <select multiple="multiple" data-placeholder="Select a State..." class="form-control form-control-lg select" data-container-css-class="select-lg" data-fouc> <option></option> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID" selected>Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="IA" selected>Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> <div class="form-group"> <label>Default select</label> <select multiple="multiple" data-placeholder="Select a State..." class="form-control select" data-fouc> <option></option> <optgroup label="Mountain Time Zone"> <option value="AZ" selected>Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL" selected>Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> <div class="form-group"> <label>Small select</label> <select multiple="multiple" data-placeholder="Select a State..." class="form-control form-control-sm select" data-container-css-class="select-sm" data-fouc> <option></option> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY" selected>Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY" selected>Kentucky</option> </optgroup> </select> </div> </div> </div> </div> </div> <!-- /select2 sizing --> <!-- Select2 advanced --> <div class="mb-3 pt-2"> <h6 class="mb-0 font-weight-semibold"> Advanced usage </h6> <span class="text-muted d-block">More complex configurations</span> </div> <div class="row"> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Advanced single selects</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="mb-4"> <h6 class="font-weight-semibold">Minimum input</h6> <p class="mb-2">Select2 supports a minimum input setting which is useful for large remote datasets where short search terms are not very useful. Simply specify a number of input characters using <code>minimumInputLength</code> option:</p> <select data-placeholder="Enter 'as'" class="form-control select-minimum" data-fouc> <option></option> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> <div class="mb-4"> <h6 class="font-weight-semibold">Customizing how results are matched</h6> <p class="mb-2">Example of how matched results can be customized. Unlike other dropdowns on this page, this one matches options only if the term appears in the beginning of the string as opposed to anywhere.</p> <select class="form-control select-matched-customize" data-fouc> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> <div class="mb-4"> <h6 class="font-weight-semibold">Loading array data</h6> <p class="mb-2">Select2 provides a way to load the data from a local array. You can provide initial selections with array data by providing the option tag for the selected values, similar to how it would be done for a standard select.</p> <div class="mb-3"> <p>1. Example below loads array:</p> <select class="form-control select-data-array" data-fouc></select> </div> <div class="mb-3"> <p>2. Example below loads array with selected option:</p> <select class="form-control select-data-array" data-fouc> <option value="2" selected>duplicate</option> </select> </div> </div> <div class="mb-4"> <h6 class="font-weight-semibold">Loading remote data</h6> <p class="mb-2">Select2 comes with AJAX support built in, using jQuery's AJAX methods. In this example, we can search for repositories using GitHub's API. Example also includes infinite scrolling feature:</p> <select class="form-control select-remote-data" data-fouc> <option value="3620194" selected>select2/select2</option> </select> </div> <div class="mb-4"> <h6 class="font-weight-semibold">Diacritics support in single select</h6> <p class="mb-2">Select2's default matcher will ignore diacritics, making it easier for users to filter results in international selects. Type <strong>"aero"</strong> into the select below:</p> <select data-placeholder="Type 'aero'" class="form-control select-search" data-fouc> <option>Aeróbics</option> <option>Aeróbics en Agua</option> <option>Aerografía</option> <option>Aeromodelaje</option> <option>Águilas</option> <option>Ajedrez</option> <option>Ala Delta</option> <option>Álbumes de Música</option> <option>Alusivos</option> <option>Análisis de Escritura a Mano</option> </select> </div> <div class="mb-4"> <h6 class="font-weight-semibold">Clearing results</h6> <p class="mb-2">Whether or not a clear button is displayed when the select box has a selection. The button, when clicked, resets the value of the select box back to the placeholder.</p> <select data-placeholder="Select a state" class="form-control select-clear" data-fouc> <option></option> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL" selected>Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> <div class="mb-3"> <h6 class="font-weight-semibold">Programmatic access</h6> <p class="mb-2">Select2 supports methods that allow programmatic control of the component: you can set and get single or multiple values, control menu visibility by opening and closing it, make the menu enabled or disabled.</p> <div class="mb-3"> <p>1. Set and get value:</p> <p class="mb-2"> <select data-placeholder="Select something" class="form-control select-access-value" data-fouc> <option></option> <option value="CA">California</option> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> <option value="CT">Connecticut</option> </select> </p> <button type="button" class="btn bg-blue access-set">Set to California</button> <button type="button" class="btn bg-blue access-get">Alert selected value</button> </div> <div class="mb-3"> <p>2. Enable and disable menu:</p> <p class="mb-2"> <select data-placeholder="Select something" class="form-control select-access-enable" data-fouc> <option></option> <option value="CA">California</option> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> <option value="CT">Connecticut</option> </select> </p> <button type="button" class="btn bg-danger-400 access-disable">Disable</button> <button type="button" class="btn bg-danger-400 access-enable">Enable</button> </div> <div class="mb-3"> <p>3. Destroy and create menu:</p> <p class="mb-2"> <select data-placeholder="Select something" class="form-control select-access-create" data-fouc> <option></option> <option value="CA">California</option> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> <option value="CT">Connecticut</option> </select> </p> <button type="button" class="btn bg-indigo-300 access-destroy">Destroy</button> <button type="button" class="btn bg-indigo-300 access-create">Create</button> </div> <div> <p>4. Open and close menu:</p> <p class="mb-2"> <select data-placeholder="Select something" class="form-control select-access-open" data-fouc> <option></option> <option value="CA">California</option> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> <option value="CT">Connecticut</option> </select> </p> <button type="button" class="btn bg-teal-400 access-open">Open</button> <button type="button" class="btn bg-teal-400 access-close">Close</button> </div> </div> </div> </div> </div> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Advanced multiple selects</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="mb-4"> <h6 class="font-weight-semibold">Tagging support</h6> <p class="mb-2">Select2 can be used to quickly set up fields used for tagging. When tagging is enabled the user can select from pre-existing tags or create a new tag by picking the first choice.</p> <select class="form-control select-multiple-tags" multiple="multiple" data-fouc> <option value="AZ">Arizona</option> <option value="CO" selected>Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> <option value="AL" selected>Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </select> </div> <div class="mb-4"> <h6 class="font-weight-semibold">Maximum input length</h6> <p class="mb-2">Select2 can be set a limit on the number of characters that can be entered per tag. You would not be able to enter any input of more than 5 characters long.</p> <select class="form-control select-multiple-maximum-length" multiple="multiple" data-fouc> <option value="AZ">Arizona</option> <option value="CO" selected>Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> <option value="AL" selected>Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </select> </div> <div class="mb-4"> <h6 class="font-weight-semibold">Auto tokenization</h6> <p class="mb-2">Select2 supports ability to add choices automatically as the user is typing into the search field. Try typing in the search field below and entering a space or a comma.</p> <select class="form-control select-multiple-tokenization" multiple="multiple" data-fouc> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> <option value="AL" selected>Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </select> </div> <div class="mb-4"> <h6 class="font-weight-semibold">Limiting the number of selections</h6> <p class="mb-2">Select2 multi-value select boxes can set restrictions regarding the maximum number of options selected. The select below is declared with <code>maximumSelectionLength</code> option.</p> <select class="form-control select-multiple-limited" multiple="multiple" data-fouc> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> <option value="AL">Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY" selected>Kentucky</option> </select> </div> <div class="mb-4"> <h6 class="font-weight-semibold">Diacritics support in multiple select</h6> <p class="mb-2">Select2's default matcher will ignore diacritics, making it easier for users to filter results in international selects. Type <strong>"aero"</strong> into the select below:</p> <select data-placeholder="Type 'aero'" multiple="multiple" class="form-control select" data-fouc> <option>Aeróbics</option> <option>Aeróbics en Agua</option> <option>Aerografía</option> <option>Aeromodelaje</option> <option>Águilas</option> <option>Ajedrez</option> <option>Ala Delta</option> <option>Álbumes de Música</option> <option>Alusivos</option> <option>Análisis de Escritura a Mano</option> </select> </div> <div class="mb-3"> <h6 class="font-weight-semibold">Programmatic access</h6> <p class="mb-2">Select2 supports methods that allow programmatic control of the component: you can set and get single or multiple values, control menu visibility by opening and closing it, make the menu enabled or disabled.</p> <div class="mb-3"> <p>1. Reacting to external value changes:</p> <p class="mb-2"> <select data-placeholder="Select something" multiple="multiple" class="form-control select-access-multiple-value" data-fouc> <option value="AK">Alaska</option> <option value="CA">California</option> <option value="AZ" selected>Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY" selected>Wyoming</option> <option value="CT">Connecticut</option> </select> </p> <button type="button" class="btn bg-blue change-to-ca">Select California</button> <button type="button" class="btn bg-blue change-to-ak-co">Select Alaska and Colorado</button> </div> <div class="mb-3"> <p>2. Enable and disable menu:</p> <p class="mb-2"> <select data-placeholder="Select something" multiple="multiple" class="form-control select-access-multiple-enable" data-fouc> <option value="AK">Alaska</option> <option value="CA">California</option> <option value="AZ" selected>Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY" selected>Wyoming</option> <option value="CT">Connecticut</option> </select> </p> <button type="button" class="btn bg-danger-400 access-multiple-disable">Disable</button> <button type="button" class="btn bg-danger-400 access-multiple-enable">Enable</button> </div> <div class="mb-3"> <p>3. Destroy and create menu:</p> <p class="mb-2"> <select data-placeholder="Select something" multiple="multiple" class="form-control select-access-multiple-create" data-fouc> <option value="AK">Alaska</option> <option value="CA">California</option> <option value="AZ" selected>Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY" selected>Wyoming</option> <option value="CT">Connecticut</option> </select> </p> <button type="button" class="btn bg-indigo-300 access-multiple-destroy">Destroy</button> <button type="button" class="btn bg-indigo-300 access-multiple-create">Create</button> </div> <div class="mb-3"> <p>4. Clear selection:</p> <p class="mb-2"> <select data-placeholder="Select states" multiple="multiple" class="form-control select-access-multiple-clear" data-fouc> <option value="AK">Alaska</option> <option value="CA">California</option> <option value="AZ" selected>Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY" selected>Wyoming</option> <option value="CT">Connecticut</option> </select> </p> <button type="button" class="btn bg-brown-400 access-multiple-clear">Clear selection</button> </div> <div> <p>5. Open and close menu:</p> <p class="mb-2"> <select data-placeholder="Select something" multiple="multiple" class="form-control select-access-multiple-open" data-fouc> <option value="AK">Alaska</option> <option value="CA">California</option> <option value="AZ" selected>Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY" selected>Wyoming</option> <option value="CT">Connecticut</option> </select> </p> <button type="button" class="btn bg-teal-400 access-multiple-open">Open</button> <button type="button" class="btn bg-teal-400 access-multiple-close">Close</button> </div> </div> </div> </div> </div> </div> <!-- /select2 advanced --> </div> <!-- FIM form_select2 --> <!-- INICIO form_multiselect --> <div class="content"> <!-- Multiselect examples --> <div class="mb-3"> <h6 class="mb-0 font-weight-semibold"> Basic examples </h6> <span class="text-muted d-block">Different multiselect options</span> </div> <div class="row"> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Basic examples</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <!-- Default multiselect --> <div class="form-group"> <label>Default select</label> <select class="form-control multiselect" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> <!-- /default multiselect --> <!-- Default multiselect with selected options --> <div class="form-group"> <label>Default selected options</label> <select class="form-control multiselect" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes" selected>Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms" selected>Mushrooms</option> </select> </div> <!-- /default multiselect with selected options --> <!-- Options with divider --> <div class="form-group"> <label>Options with divider</label> <select class="form-control multiselect" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option data-role="divider"></option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> <!-- /options with divider --> <!-- Option groups support --> <div class="form-group"> <label>Option groups support</label> <select class="form-control multiselect" multiple="multiple" data-fouc> <optgroup label="Mathematics"> <option value="analysis">Analysis</option> <option value="algebra">Linear Algebra</option> <option value="discrete">Discrete Mathematics</option> </optgroup> <optgroup label="Computer Science"> <option value="programming">Introduction to Programming</option> <option value="complexity">Complexity Theory</option> <option value="software">Software Engineering</option> </optgroup> </select> </div> <!-- /option groups support --> <!-- Options with and without groups --> <div class="form-group"> <label>Options with and without groups</label> <select class="form-control multiselect" multiple="multiple" data-fouc> <option value="lab">Lab Course</option> <option value="proseminar">Proseminar</option> <optgroup label="Mathematics"> <option value="analysis">Analysis</option> <option value="algebra">Linear Algebra</option> <option value="probability">Probability Theory</option> </optgroup> <optgroup label="Computer Science"> <option value="programming">Introduction to Programming</option> <option value="automata">Automata Theory</option> <option value="software">Software Engineering</option> </optgroup> </select> </div> <!-- /options with and without groups --> <!-- Dropdown with max height --> <div class="form-group"> <label>Dropdown with max height</label> <select class="form-control multiselect-max-height" multiple="multiple" data-fouc> <optgroup label="Mathematics"> <option value="analysis">Analysis</option> <option value="algebra">Linear Algebra</option> <option value="discrete">Discrete Mathematics</option> </optgroup> <optgroup label="Computer Science"> <option value="programming">Introduction to Programming</option> <option value="complexity">Complexity Theory</option> <option value="software">Software Engineering</option> </optgroup> </select> </div> <!-- /dropdown with max height --> <!-- Select All option --> <div class="form-group"> <label>With <span class="font-weight-semibold">Select all</span> option</label> <select class="form-control multiselect-select-all" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> <!-- /select All option --> <!-- Select All option selected --> <div class="form-group"> <label>Select all option response</label> <select class="form-control multiselect-select-all" multiple="multiple" data-fouc> <option value="cheese" selected>Cheese</option> <option value="tomatoes" selected>Tomatoes</option> <option value="mozarella" selected>Mozzarella</option> <option value="mushrooms" selected>Mushrooms</option> </select> </div> <!-- /select All option selected --> <!-- Filtering options --> <div class="form-group"> <label><span class="font-weight-semibold">Filtering</span> option</label> <select class="form-control multiselect-filtering" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> <!-- /filtering options --> <!-- Select All and filtering options --> <div class="form-group"> <label><span class="font-weight-semibold">Select All</span> and <span class="font-weight-semibold">Filtering</span> options</label> <select class="form-control multiselect-select-all-filtering" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> <!-- /select All and filtering options --> <!-- Optgroups, filtering and select all --> <div class="form-group"> <label>Full featured example</label> <select class="form-control multiselect-full-featured" multiple="multiple" data-fouc> <option value="lab">Lab Course</option> <option value="proseminar">Proseminar</option> <optgroup label="Mathematics"> <option value="analysis">Analysis</option> <option value="algebra">Linear Algebra</option> <option value="probability">Probability Theory</option> </optgroup> <optgroup label="Computer Science"> <option value="programming">Introduction to Programming</option> <option value="complexity">Complexity Theory</option> <option value="software">Software Engineering</option> </optgroup> </select> </div> <!-- /optgroups, filtering and select all --> <!-- Disabled select --> <div class="form-group"> <label>Disabled select</label> <select class="form-control multiselect" multiple="multiple" disabled data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> <!-- /disabled select --> <!-- Disabled options --> <div class="form-group"> <label>Disabled options</label> <select class="form-control multiselect" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes" disabled selected>Tomatoes</option> <option value="mozarella" disabled>Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> <!-- /disabled options --> <!-- Disabled optgroups --> <div class="form-group"> <label>Disabled optgroups</label> <select class="form-control multiselect" multiple="multiple" data-fouc> <optgroup label="Mathematics" disabled> <option value="analysis">Analysis</option> <option value="algebra">Linear Algebra</option> <option value="probability">Probability Theory</option> </optgroup> <optgroup label="Computer Science"> <option value="programming">Introduction to Programming</option> <option value="complexity">Complexity Theory</option> <option value="software">Software Engineering</option> </optgroup> </select> </div> <!-- /disabled optgroups --> <!-- Prevent deselect --> <div class="form-group"> <label>Prevent deselect</label> <select class="form-control multiselect-prevent-deselect" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> <!-- /prevent deselect --> </div> </div> </div> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Advanced usage</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <!-- Within a group with addon --> <div class="form-group"> <label>Within a group with addon</label> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text"> <i class="icon-android"></i> </span> </span> <select class="form-control multiselect" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> </div> <!-- /within a group with addon --> <!-- Within a group with button --> <div class="form-group"> <label>Within a group with button</label> <div class="input-group"> <span class="input-group-prepend"> <button class="btn btn-light" type="button">Action</button> </span> <select class="form-control multiselect" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> </div> <!-- /within a group with button --> <!-- Within a group with button dropdown --> <div class="form-group"> <label>Within a group with button dropdown</label> <div class="input-group"> <div class="input-group-prepend"> <button type="button" class="btn btn-light dropdown-toggle" data-toggle="dropdown">Action</button> <div class="dropdown-menu"> <a href="#" class="dropdown-item">Action</a> <a href="#" class="dropdown-item">Another action</a> <a href="#" class="dropdown-item">Something else here</a> <div class="dropdown-divider"></div> <a href="#" class="dropdown-item">One more separated line</a> </div> </div> <select class="form-control multiselect" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> </div> <!-- /within a group with button dropdown --> <!-- Within a group with segmented button dropdown --> <div class="form-group"> <label>Within a group with segmented button dropdown</label> <div class="input-group"> <div class="input-group-prepend"> <button type="button" class="btn btn-light">Action</button> <button type="button" class="btn btn-light btn-icon dropdown-toggle" data-toggle="dropdown"></button> <div class="dropdown-menu"> <a href="#" class="dropdown-item">Action</a> <a href="#" class="dropdown-item">Another action</a> <a href="#" class="dropdown-item">Something else here</a> <div class="dropdown-divider"></div> <a href="#" class="dropdown-item">One more separated line</a> </div> </div> <select class="form-control multiselect" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> </div> <!-- /within a group with segmented button dropdown --> <!-- Within a group with checkbox --> <div class="form-group"> <label>Within a group with checkbox</label> <div class="input-group"> <span class="input-group-prepend"> <div class="input-group-text"> <input type="checkbox" class="form-control-styled" name="input-addon-checkbox" checked data-fouc> </div> </span> <select class="form-control multiselect" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> </div> <!-- /within a group with checkbox --> <!-- Within a group with radio --> <div class="form-group"> <label>Within a group with radio</label> <div class="input-group"> <span class="input-group-prepend"> <div class="input-group-text"> <input type="radio" class="form-control-styled" name="input-addon-radio" checked data-fouc> </div> </span> <select class="form-control multiselect" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> </div> <!-- /within a group with radio --> <!-- Remove active option class --> <div class="form-group"> <label>Remove active option class</label> <select class="form-control multiselect-no-active-class" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes" selected>Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> <!-- /remove active option class --> <!-- Alternative labels for options --> <div class="form-group"> <label>Alternative labels for options</label> <select class="form-control multiselect" multiple="multiple" data-fouc> <option value="analysis" label="An (Analysis)">Analysis</option> <option value="algebra" label="LA (Linear Algebra)">Linear Algebra</option> <option value="discrete" label="Discrete (Mathematics)">Discrete Mathematics</option> </select> </div> <!-- /alternative labels for options --> <!-- Limit options number --> <div class="form-group"> <label>Limit options number</label> <select class="form-control multiselect-number" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> <!-- /limit options number --> <!-- Custom empty text --> <div class="form-group"> <label>Custom empty text</label> <select class="form-control multiselect-nonselected-text" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> <!-- /custom empty --> <!-- As a link --> <div class="form-group"> <label>As a link</label> <select class="form-control multiselect-link" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> <!-- /as a link --> <!-- onChange notice --> <div class="form-group"> <label>onChange notice</label> <select class="form-control multiselect-onchange-notice" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> <!-- /onChange notice --> <!-- onChange desktop notification --> <div class="form-group"> <label>onChange desktop notification</label> <select class="form-control multiselect-onchange-desktop" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> <!-- /onChange desktop notification --> <!-- onDropdownShow event --> <div class="form-group"> <label>onDropdownShow event</label> <select class="form-control multiselect-show-event" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> <!-- /onDropdownShow event --> <!-- onDropdownHide event --> <div class="form-group"> <label>onDropdownHide event</label> <select class="form-control multiselect-hide-event" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> <!-- /onDropdownHide event --> </div> </div> </div> </div> <!-- /multiselect examples --> <!-- Sizing options --> <div class="mb-3 mt-2"> <h6 class="mb-0 font-weight-semibold"> Sizing options </h6> <span class="text-muted d-block">Width and height sizing</span> </div> <div class="row"> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Width sizing</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <!-- Full width --> <div class="form-group"> <label>Full width button (default)</label> <select class="form-control multiselect" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> </select> </div> <!-- /full width --> <!-- Fixed width --> <div class="form-group"> <label>Fixed width</label> <select class="form-control multiselect" multiple="multiple" data-button-width="250" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> </select> </div> <!-- /fixed width --> <!-- Auto width --> <div class="form-group"> <label>Auto width button (default)</label> <select class="form-control multiselect" multiple="multiple" data-button-width="auto" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> </select> </div> <!-- /auto width --> </div> </div> </div> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Height sizing</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <!-- Large button --> <div class="form-group"> <label>Large select</label> <select class="form-control form-control-lg multiselect" multiple="multiple" data-button-class="btn btn-light btn-lg" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> </select> </div> <!-- /large button --> <!-- Default button --> <div class="form-group"> <label>Default select</label> <select class="form-control multiselect" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> </select> </div> <!-- /default button --> <!-- Small button --> <div class="form-group"> <label>Small select</label> <select class="form-control form-control-sm multiselect" multiple="multiple" data-button-class="btn btn-light btn-sm" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> </select> </div> <!-- /small button --> </div> </div> </div> </div> <!-- /sizing options --> <!-- Color options --> <div class="mb-3 mt-2"> <h6 class="mb-0 font-weight-semibold"> Other options </h6> <span class="text-muted d-block">Contextual alternatives and other options</span> </div> <div class="row"> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Contextual alternatives</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <!-- Default --> <div class="form-group"> <label>Default class</label> <select class="form-control multiselect" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> </select> </div> <!-- /default --> <!-- Primary --> <div class="form-group"> <label>Primary class</label> <select class="form-control multiselect" multiple="multiple" data-button-class="btn bg-primary" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> </select> </div> <!-- /primary --> <!-- Danger --> <div class="form-group"> <label>Danger class</label> <select class="form-control multiselect" multiple="multiple" data-button-class="btn bg-danger" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> </select> </div> <!-- /danger --> <!-- Success --> <div class="form-group"> <label>Success class</label> <select class="form-control multiselect" multiple="multiple" data-button-class="btn bg-success" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> </select> </div> <!-- /success --> <!-- Warning --> <div class="form-group"> <label>Warning class</label> <select class="form-control multiselect" multiple="multiple" data-button-class="btn bg-warning" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> </select> </div> <!-- /warning --> <!-- Info --> <div class="form-group"> <label>Info class</label> <select class="form-control multiselect" multiple="multiple" data-button-class="btn bg-info" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> </select> </div> <!-- /info --> </div> </div> </div> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Other options</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <!-- Single select --> <div class="form-group"> <label>Single select</label> <select class="form-control multiselect" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> <!-- /single select --> <!-- Clickable optgroups --> <div class="form-group"> <label>Clickable optgroups</label> <select class="form-control multiselect-clickable-groups" multiple="multiple" data-fouc> <optgroup label="Mathematics"> <option value="analysis">Analysis</option> <option value="algebra">Linear Algebra</option> <option value="discrete">Discrete Mathematics</option> </optgroup> <optgroup label="Computer Science"> <option value="programming">Introduction to Programming</option> <option value="complexity">Complexity Theory</option> <option value="software">Software Engineering</option> </optgroup> <optgroup label="Physics"> <option value="mechanics">Classical Mechanics</option> <option value="magnetism">Electromagnetism</option> <option value="quantum">Quantum Mechanics</option> </optgroup> </select> </div> <!-- /clickable optgroups --> <!-- Disable if empty --> <div class="form-group"> <label>Disable if no options are given</label> <select class="form-control multiselect-disable-empty" multiple="multiple" data-fouc></select> </div> <!-- /disable if empty --> <!-- Custom button color --> <div class="form-group"> <label>Custom button color</label> <select class="form-control multiselect" multiple="multiple" data-button-class="btn bg-teal-400" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> <!-- /custom button color --> <!-- Custom menu color --> <div class="form-group"> <label>Custom menu color</label> <select class="form-control multiselect-menu-bg-color" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> <!-- /custom menu color --> <!-- Custom colors --> <div class="form-group"> <label>Custom colors combination</label> <select class="form-control multiselect-combine-all" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> <!-- /custom colors --> </div> </div> </div> </div> <!-- /color options --> <!-- More complex examples --> <div class="mb-3 mt-2"> <h6 class="mb-0 font-weight-semibold"> Advanced examples </h6> <span class="text-muted d-block">More complex multiselect examples</span> </div> <div class="row"> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Further examples</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <!-- Showing values --> <div class="mb-4"> <h6 class="font-weight-semibold">Showing values</h6> <p class="mb-3">Use "Select" and "Deselect" buttons to select or deselect cheese and tomatoes. Display selected or deselected options by using <code>$('.multiselect').val()</code> method.</p> <div class="input-group"> <select class="form-control multiselect-display-values" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> <option value="pepperoni">Pepperoni</option> <option value="onions">Onions</option> </select> <div class="input-group-append"> <button type="button" class="btn btn-light multiselect-display-values-select">Select</button> <button type="button" class="btn btn-light multiselect-display-values-deselect">Deselect</button> </div> </div> <div class="values-area mt-2"></div> </div> <!-- /showing values --> <!-- Toggle selection --> <div class="mb-4"> <h6 class="font-weight-semibold">Toggle selection</h6> <p class="mb-3">Use the button to toggle the selection. Don't forget to include <code>$.uniform.update();</code> to update checkboxes or radios state dynamically.</p> <div class="input-group"> <select class="form-control multiselect-toggle-selection" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> <option value="pepperoni">Pepperoni</option> <option value="onions">Onions</option> </select> <div class="input-group-append"> <button type="button" class="btn btn-light multiselect-toggle-selection-button">Select All</button> </div> </div> </div> <!-- /toggle selection --> <!-- Order options --> <div class="mb-4"> <h6 class="font-weight-semibold">Order options</h6> <p class="mb-3">Record the order the options are selected. When selecting an item an ordering number will be incremented and saved within the option.</p> <div class="input-group"> <select class="form-control multiselect-order-options" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> <option value="pepperoni">Pepperoni</option> <option value="onions">Onions</option> </select> <div class="input-group-append"> <button type="button" class="btn bg-blue multiselect-order-options-button">Order</button> </div> </div> </div> <!-- /order options --> <!-- Simulate selections --> <div class="mb-4"> <h6 class="font-weight-semibold">Simulate selections</h6> <p class="mb-3">Simulate single selections using checkboxes. The behavior will be similar to a multiselect with radio buttons.</p> <select class="form-control multiselect-simulate-selections" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> <option value="pepperoni">Pepperoni</option> <option value="onions">Onions</option> </select> </div> <!-- /simulate selections --> <!-- Close dropdown automatically --> <div class="mb-4"> <h6 class="font-weight-semibold">Close dropdown automatically</h6> <p class="mb-3">Close dropdown after 3 selections automatically.</p> <select class="form-control multiselect-close-dropdown" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> <option value="pepperoni">Pepperoni</option> <option value="onions">Onions</option> </select> </div> <!-- /close dropdown automatically --> <!-- Reset button --> <div class="mb-4"> <h6 class="font-weight-semibold">Reset button</h6> <p class="mb-3">Using a reset button together with a multiselect. Select options then click Reset button to reset selections.</p> <form class="input-group" id="multiselect-reset-form"> <select class="form-control multiselect-reset" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> <option value="pepperoni">Pepperoni</option> <option value="onions">Onions</option> </select> <div class="input-group-append"> <button type="reset" class="btn bg-blue">Reset</button> </div> </form> </div> <!-- /reset button --> <!-- Templates --> <div class="mb-3"> <h6 class="font-weight-semibold">Multiselect templates</h6> <p class="mb-3">The templates can be overriden using the <code>templates</code> configuration option. The example below uses a <code>red</code> border color for dividers.</p> <select class="form-control multiselect-templates" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option data-role="divider"></option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> <option data-role="divider"></option> <option value="pepperoni">Pepperoni</option> <option value="onions">Onions</option> </select> </div> <!-- /templates --> </div> </div> </div> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Multiselect methods</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <!-- Destroy method --> <div class="mb-4"> <h6 class="font-weight-semibold">Destroy method</h6> <p class="mb-3">This method is used to destroy the plugin on the given element - meaning unbinding the plugin.</p> <div class="input-group"> <select class="form-control multiselect-method-destroy" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> <option value="pepperoni">Pepperoni</option> <option value="onions">Onions</option> </select> <div class="input-group-append"> <button type="button" class="btn btn-light multiselect-create-button">Create</button> <button type="button" class="btn bg-danger multiselect-destroy-button">Destroy</button> </div> </div> </div> <!-- /destroy method --> <!-- Refresh method --> <div class="mb-4"> <h6 class="font-weight-semibold">Refresh method</h6> <p class="mb-3">This method is used to refresh the checked checkboxes based on the currently selected options within the select. Click <strong>'Select'</strong>, then click <strong>refresh</strong>. The plugin will update the checkboxes.</p> <div class="input-group"> <select class="form-control multiselect-method-refresh" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> <option value="pepperoni">Pepperoni</option> <option value="onions">Onions</option> </select> <div class="input-group-append"> <button type="button" class="btn btn-light multiselect-select-button">Select</button> <button type="button" class="btn btn-light multiselect-deselect-button">Deselect</button> <button type="button" class="btn bg-blue btn-icon multiselect-refresh-button"><i class="icon-reload-alt"></i></button> </div> </div> </div> <!-- /refresh method --> <!-- Rebuild method --> <div class="mb-4"> <h6 class="font-weight-semibold">Rebuild method</h6> <p class="mb-3">Rebuilds the whole dropdown menu. All selected options will remain selected (if still existent!). Click <strong>Add</strong> button and then click <strong>Rebuild</strong> button, open dropdown and you'll notice new options added to the bottom of the list.</p> <div class="input-group"> <select class="form-control multiselect-method-rebuild" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> <option value="pepperoni">Pepperoni</option> <option value="onions">Onions</option> </select> <div class="input-group-append"> <button type="button" class="btn btn-light multiselect-add-button">Add</button> <button type="button" class="btn btn-light multiselect-delete-button">Delete</button> <button type="button" class="btn bg-blue btn-icon multiselect-rebuild-button"><i class="icon-reload-alt"></i></button> </div> </div> </div> <!-- /rebuild method --> <!-- Select method --> <div class="mb-4"> <h6 class="font-weight-semibold">Select method</h6> <p class="mb-3">Selects an option by its value (which has to be given as string). Works also using an array of values.</p> <div class="input-group"> <select class="form-control multiselect-method-select" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> <option value="pepperoni">Pepperoni</option> <option value="onions">Onions</option> </select> <div class="input-group-append"> <button type="button" class="btn btn-light multiselect-select-cheese-button">Cheese</button> <button type="button" class="btn btn-light multiselect-select-onions-button">Onions</button> </div> </div> </div> <!-- /select method --> <!-- Deselect method --> <div class="mb-4"> <h6 class="font-weight-semibold">Deselect method</h6> <p class="mb-3">Deselect an option by its value (which has to be given as string). Works also using an array of values.</p> <div class="input-group"> <select class="form-control multiselect-method-deselect" multiple="multiple" data-fouc> <option value="cheese" selected>Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> <option value="pepperoni">Pepperoni</option> <option value="onions" selected>Onions</option> </select> <div class="input-group-append"> <button type="button" class="btn btn-light multiselect-deselect-cheese-button">Deselect Cheese</button> <button type="button" class="btn btn-light multiselect-deselect-onions-button">Deselect Onions</button> </div> </div> </div> <!-- /deselect method --> <!-- Disable method --> <div class="mb-4"> <h6 class="font-weight-semibold">Disable method</h6> <p class="mb-3">Disable both the underlying select and the dropdown button.</p> <div class="input-group"> <select class="form-control multiselect-method-disable" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> <option value="pepperoni">Pepperoni</option> <option value="onions">Onions</option> </select> <div class="input-group-append"> <button type="button" class="btn bg-danger multiselect-disable1-button">Disable</button> <button type="button" class="btn btn-light multiselect-enable1-button">Enable</button> </div> </div> </div> <!-- /disable method --> <!-- Enable method --> <div class="mb-3"> <h6 class="font-weight-semibold">Enable method</h6> <p class="mb-3">Enable both the underlying select and the dropdown button.</p> <div class="input-group"> <select class="form-control multiselect-method-enable" multiple="multiple" disabled data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> <option value="pepperoni">Pepperoni</option> <option value="onions">Onions</option> </select> <div class="input-group-append"> <button type="button" class="btn bg-blue multiselect-enable2-button">Enable</button> <button type="button" class="btn btn-light multiselect-disable2-button">Disable</button> </div> </div> </div> <!-- /enable method --> </div> </div> </div> </div> <!-- /more complex examples --> </div> <!-- FIM form_multiselect --> <!-- INICIO form_input_groups --> <div class="content"> <!-- Input group addons --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Input group addons</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <p class="mb-4">Extend form controls by adding text or buttons before, after, or on both sides of any text-based <code>&lt;input></code>. Use <code>.input-group</code> with an <code>.input-group-prepend</code> to prepend or <code>.input-group-append</code> to append elements to a single <code>.form-control</code>. Place one add-on or button on either side of an input. You may also place one on both sides of an input. While multiple <code>&lt;input></code>s are supported visually, validation styles are only available for input groups with a single <code>&lt;input></code>.</p> <form action="#"> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Text addon</legend> <div class="form-group row"> <label class="col-form-label col-lg-2">Left text addon</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text">@</span> </span> <input type="text" class="form-control" placeholder="Left addon"> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Multiple left addons</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text">$</span> <span class="input-group-text">0.00</span> </span> <input type="text" class="form-control" placeholder="Multiple left addons"> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Right text addon</label> <div class="col-lg-10"> <div class="input-group"> <input type="text" class="form-control" placeholder="Right addon"> <span class="input-group-append"> <span class="input-group-text">%</span> </span> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Multiple right addons</label> <div class="col-lg-10"> <div class="input-group"> <input type="text" class="form-control" placeholder="Multiple right addons"> <span class="input-group-append"> <span class="input-group-text">$</span> <span class="input-group-text">0.00</span> </span> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Left and right text addons</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text">$</span> </span> <input type="text" class="form-control" placeholder="Left and right addons"> <span class="input-group-append"> <span class="input-group-text">.00</span> </span> </div> </div> </div> </fieldset> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Icon addon</legend> <div class="form-group row"> <label class="col-form-label col-lg-2">Left icon addon</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text"><i class="icon-user"></i></span> </span> <input type="text" class="form-control" placeholder="Left icon"> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Right icon addon</label> <div class="col-lg-10"> <div class="input-group"> <input type="text" class="form-control" placeholder="Right icon"> <span class="input-group-append"> <span class="input-group-text"><i class="icon-user"></i></span> </span> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Left and right icon addons</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text"><i class="icon-menu6"></i></span> </span> <input type="text" class="form-control" placeholder="Left and right icons"> <span class="input-group-append"> <span class="input-group-text"><i class="icon-inbox"></i></span> </span> </div> </div> </div> </fieldset> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Spinner addon</legend> <div class="form-group row"> <label class="col-form-label col-lg-2">Left spinner addon</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text"><i class="icon-spinner2 spinner"></i></span> </span> <input type="text" class="form-control" placeholder="Left spinner"> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Right spinner addon</label> <div class="col-lg-10"> <div class="input-group"> <input type="text" class="form-control" placeholder="Right spinner"> <span class="input-group-append"> <span class="input-group-text"><i class="icon-spinner2 spinner"></i></span> </span> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Left and right spinner addons</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text"><i class="icon-spinner2 spinner"></i></span> </span> <input type="text" class="form-control" placeholder="Left and right spinners"> <span class="input-group-append"> <span class="input-group-text"><i class="icon-spinner9 spinner"></i></span> </span> </div> </div> </div> </fieldset> <fieldset> <legend class="text-uppercase font-size-sm font-weight-bold">Color options</legend> <div class="form-group row"> <label class="col-form-label col-lg-2">Contextual class</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text bg-primary border-primary text-white"> <i class="icon-pin-alt"></i> </span> </span> <input type="text" class="form-control border-left-0" placeholder="Primary addon"> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Custom color class</label> <div class="col-lg-10"> <div class="input-group"> <input type="text" class="form-control border-right-0" placeholder="Pink addon"> <span class="input-group-append"> <span class="input-group-text bg-pink border-pink text-white"> <i class="icon-help"></i> </span> </span> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Color everything</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text bg-slate-700 border-slate-700 text-white"> <i class="icon-lock2"></i> </span> </span> <input type="text" class="form-control bg-slate text-white border-transparent" placeholder="Solid background color"> <span class="input-group-append"> <span class="input-group-text bg-slate-700 border-slate-700 text-white"> <i class="icon-help"></i> </span> </span> </div> </div> </div> </fieldset> </form> </div> </div> <!-- /input group addons --> <!-- Input group buttons --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Input group buttons</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <p class="mb-4">Optional buttons as addons. Buttons in input groups are a bit different and require one extra level of nesting. Instead of <code>.input-group-addon</code>, you'll need to use <code>.input-group-prepend (append)</code> to wrap the buttons. Input group buttons support all available button options except sizing - all buttons height will be adjusted automatically according to the input group size.</p> <form action="#"> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Button addons</legend> <div class="form-group row"> <label class="col-form-label col-lg-2">Left button</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-prepend"> <button class="btn btn-light" type="button">Button</button> </span> <input type="text" class="form-control" placeholder="Left button"> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Right button</label> <div class="col-lg-10"> <div class="input-group"> <input type="text" class="form-control" placeholder="Right button"> <span class="input-group-append"> <button class="btn btn-light" type="button">Button</button> </span> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Left and right buttons</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-prepend"> <button class="btn btn-light btn-icon" type="button"><i class="icon-user"></i></button> </span> <input type="text" class="form-control" placeholder="Left and right buttons"> <span class="input-group-append"> <button class="btn btn-light" type="button">Button</button> </span> </div> </div> </div> </fieldset> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Button dropdown addons</legend> <div class="form-group row"> <label class="col-form-label col-lg-2">Left button dropdown</label> <div class="col-lg-10"> <div class="input-group"> <div class="input-group-prepend"> <button type="button" class="btn btn-light dropdown-toggle" data-toggle="dropdown">Action</button> <div class="dropdown-menu"> <a href="#" class="dropdown-item">Action</a> <a href="#" class="dropdown-item">Another action</a> <a href="#" class="dropdown-item">Something else here</a> <a href="#" class="dropdown-item">One more line</a> </div> </div> <input type="text" class="form-control" placeholder="Left dropdown"> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Right button dropdown</label> <div class="col-lg-10"> <div class="input-group"> <input type="text" class="form-control" placeholder="Right dropdown"> <div class="input-group-append"> <button type="button" class="btn btn-light dropdown-toggle" data-toggle="dropdown">Action</button> <div class="dropdown-menu dropdown-menu-right"> <a href="#" class="dropdown-item">Action</a> <a href="#" class="dropdown-item">Another action</a> <a href="#" class="dropdown-item">Something else here</a> <a href="#" class="dropdown-item">One more line</a> </div> </div> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Left and right button dropdowns</label> <div class="col-lg-10"> <div class="input-group"> <div class="input-group-prepend"> <button type="button" class="btn btn-light dropdown-toggle" data-toggle="dropdown">Action</button> <div class="dropdown-menu"> <a href="#" class="dropdown-item">Action</a> <a href="#" class="dropdown-item">Another action</a> <a href="#" class="dropdown-item">Something else here</a> <a href="#" class="dropdown-item">One more line</a> </div> </div> <input type="text" class="form-control" placeholder="Left and right dropdowns"> <div class="input-group-append"> <button type="button" class="btn btn-light dropdown-toggle" data-toggle="dropdown">Action</button> <div class="dropdown-menu dropdown-menu-right"> <a href="#" class="dropdown-item">Action</a> <a href="#" class="dropdown-item">Another action</a> <a href="#" class="dropdown-item">Something else here</a> <a href="#" class="dropdown-item">One more line</a> </div> </div> </div> </div> </div> </fieldset> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Segmented button addons</legend> <div class="form-group row"> <label class="col-form-label col-lg-2">Left button</label> <div class="col-lg-10"> <div class="input-group"> <div class="input-group-prepend"> <button type="button" class="btn btn-light">Action</button> <button type="button" class="btn btn-light dropdown-toggle btn-icon" data-toggle="dropdown"></button> <div class="dropdown-menu"> <a href="#" class="dropdown-item">Action</a> <a href="#" class="dropdown-item">Another action</a> <a href="#" class="dropdown-item">Something else here</a> <a href="#" class="dropdown-item">One more line</a> </div> </div> <input type="text" class="form-control" placeholder="Left buttons"> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Right button</label> <div class="col-lg-10"> <div class="input-group"> <input type="text" class="form-control" placeholder="Right buttons"> <div class="input-group-append"> <button type="button" class="btn btn-light">Action</button> <button type="button" class="btn btn-light dropdown-toggle btn-icon" data-toggle="dropdown"></button> <div class="dropdown-menu dropdown-menu-right"> <a href="#" class="dropdown-item">Action</a> <a href="#" class="dropdown-item">Another action</a> <a href="#" class="dropdown-item">Something else here</a> <a href="#" class="dropdown-item">One more line</a> </div> </div> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Left and right buttons</label> <div class="col-lg-10"> <div class="input-group"> <div class="input-group-prepend"> <button type="button" class="btn btn-light">Button</button> <button type="button" class="btn btn-light dropdown-toggle btn-icon" data-toggle="dropdown"></button> <div class="dropdown-menu"> <a href="#" class="dropdown-item">Action</a> <a href="#" class="dropdown-item">Another action</a> <a href="#" class="dropdown-item">Something else here</a> <a href="#" class="dropdown-item">One more line</a> </div> </div> <input type="text" class="form-control" placeholder="Left and right buttons"> <div class="input-group-append"> <button type="button" class="btn btn-light btn-icon"><i class="icon-user"></i></button> <button type="button" class="btn btn-light dropdown-toggle btn-icon" data-toggle="dropdown"></button> <div class="dropdown-menu dropdown-menu-right"> <a href="#" class="dropdown-item">Action</a> <a href="#" class="dropdown-item">Another action</a> <a href="#" class="dropdown-item">Something else here</a> <a href="#" class="dropdown-item">One more line</a> </div> </div> </div> </div> </div> </fieldset> <fieldset> <legend class="text-uppercase font-size-sm font-weight-bold">Color options</legend> <div class="form-group row"> <label class="col-form-label col-lg-2">Contextual button</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-prepend"> <button class="btn bg-danger" type="button">Button</button> </span> <input type="text" class="form-control border-left-0" placeholder="Danger button"> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Custom color button</label> <div class="col-lg-10"> <div class="input-group"> <input type="text" class="form-control border-right-0" placeholder="Teal button"> <span class="input-group-append"> <button class="btn bg-teal" type="button">Button</button> </span> </div> </div> </div> </fieldset> </form> </div> </div> <!-- /input group buttons --> <!-- Input group options --> <div class="card mb-4"> <div class="card-header header-elements-inline"> <h5 class="card-title">Input group options</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <p class="mb-4">Besides default addon options, input groups support different variations of checkboxes, radio buttons, switches, contextual validation state options, icons in different positions. All colors can be easily changed in LESS variables, options and positions also can be mixed. However avoid using <code>&lt;select></code> elements here as they cannot be fully styled in WebKit browsers and <code>&lt;textarea></code> elements here as their rows attribute will not be respected in some cases.</p> <form action="#"> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Sizing options</legend> <div class="form-group row"> <label class="col-form-label col-lg-2">Large input group</label> <div class="col-lg-10"> <div class="input-group input-group-lg"> <span class="input-group-prepend"> <span class="input-group-text"><i class="icon-mention"></i></span> </span> <input type="text" class="form-control" placeholder=".input-group-lg"> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Default input group</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text"><i class="icon-git-pull-request"></i></span> </span> <input type="text" class="form-control" placeholder=".input-group"> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Small input group</label> <div class="col-lg-10"> <div class="input-group input-group-sm"> <span class="input-group-prepend"> <span class="input-group-text"><i class="icon-statistics"></i></span> </span> <input type="text" class="form-control" placeholder=".input-group-sm"> </div> </div> </div> </fieldset> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Validation states</legend> <div class="form-group row"> <label class="col-form-label col-lg-2 font-weight-semibold text-success">Valid state</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text alpha-success text-success border-success"><i class="icon-comment"></i></span> </span> <input type="text" class="form-control border-success" placeholder="Success color classes"> </div> <span class="form-text text-success">Success state helper</span> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2 font-weight-semibold text-danger">Invalid state</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text alpha-danger text-danger border-danger"><i class="icon-graph"></i></span> </span> <input type="text" class="form-control border-danger" placeholder="Danger color classes"> </div> <span class="form-text text-danger">Invalid state helper</span> </div> </div> <div class="form-group form-group-feedback form-group-feedback-right row"> <label class="col-form-label col-lg-2 font-weight-semibold text-success">Valid with icon</label> <div class="col-lg-10"> <div class="position-relative"> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text alpha-success text-success border-success"><i class="icon-graduation"></i></span> </span> <input type="text" class="form-control border-success" placeholder="Success color classes"> </div> <div class="form-control-feedback text-success"> <i class="icon-checkmark-circle"></i> </div> </div> <span class="form-text text-success">Valid state helper</span> </div> </div> <div class="form-group form-group-feedback form-group-feedback-right row"> <label class="col-form-label col-lg-2 font-weight-semibold text-danger">Invalid with icon</label> <div class="col-lg-10"> <div class="position-relative"> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text alpha-danger text-danger border-danger"><i class="icon-droplets"></i></span> </span> <input type="text" class="form-control border-danger" placeholder="Danger color classes"> </div> <div class="form-control-feedback text-danger"> <i class="icon-cancel-circle2"></i> </div> </div> <span class="form-text text-danger">Error input group helper</span> </div> </div> </fieldset> <fieldset> <legend class="text-uppercase font-size-sm font-weight-bold">Addon options</legend> <div class="form-group row"> <label class="col-form-label col-lg-2">Default checkbox</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text"> <input type="checkbox" checked> </span> </span> <input type="text" class="form-control" placeholder="Default checkbox addon"> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Styled checkbox</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-prepend"> <div class="input-group-text"> <input type="checkbox" class="form-control-styled" name="input-addon-checkbox" checked data-fouc> </div> </span> <input type="text" class="form-control" placeholder="Styled checkbox addon"> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Default radio button</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text"> <input type="radio" name="addon-radio"> </span> </span> <input type="text" class="form-control" placeholder="Unstyled radio addon"> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Styled radio button</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-prepend"> <div class="input-group-text"> <input type="radio" name="addon-radio" class="form-control-styled" checked data-fouc> </div> </span> <input type="text" class="form-control" placeholder="Styled radio addon"> </div> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Switchery toggle</label> <div class="col-lg-10"> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text"> <input type="checkbox" class="form-control-switchery" checked data-fouc> </span> </span> <input type="text" class="form-control" placeholder="Switchery toggle addon"> </div> </div> </div> </fieldset> </form> </div> </div> <!-- /input group options --> <!-- Touchspin spinners --> <div class="mb-3"> <h6 class="mb-0 font-weight-semibold"> Touchspin spinners </h6> <span class="text-muted d-block">Touch friendly input spinner component</span> </div> <div class="row"> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Bootstrap touchspin</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <p class="mb-3">Basically Touchspin uses default Bootstrap <code>input-group</code> component styling with ability to add extra classes to the buttons and addons to match your design perfectly.</p> <div class="form-group"> <label>Example with postfix: </label> <input type="text" value="55" class="form-control touchspin-postfix"> </div> <div class="form-group"> <label>Example with prefix: </label> <input type="text" value="0" class="form-control touchspin-prefix"> </div> <div class="form-group"> <label>Init with empty value: </label> <input type="text" value="" class="form-control touchspin-empty"> </div> <div class="form-group"> <label>Incremental/decremental step on up/down change: </label> <input type="text" value="10" class="form-control touchspin-step"> </div> </div> </div> </div> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Advanced spinners</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <p class="mb-3">Depending on your needs, you can easily swith off mousewheel support, change steps and increments, use more complex examples with button groups and dropdowns.</p> <div class="form-group"> <label>Button group example</label> <div class="input-group"> <input type="text" class="form-control touchspin-button-group" value="50"> <div class="input-group-append"> <button type="button" class="btn bg-primary">Action</button> <button type="button" class="btn btn-light dropdown-toggle" data-toggle="dropdown"></button> <div class="dropdown-menu dropdown-menu-right"> <a href="#" class="dropdown-item">Action</a> <a href="#" class="dropdown-item">Another action</a> <a href="#" class="dropdown-item">Something else here</a> <div class="dropdown-divider"></div> <a href="#" class="dropdown-item">Separated link</a> </div> </div> </div> </div> <div class="form-group"> <label>Value attribute is not set: <span class="text-muted">applying settings.initval</span></label> <input type="text" value="" class="form-control touchspin-set-value"> </div> <div class="form-group"> <label>Value is set explicitly to 33: <span class="text-muted">skipping settings.initval</span></label> <input type="text" value="33" class="form-control touchspin-set-value"> </div> <div class="form-group"> <label>No mousewheel support: </label> <input type="text" value="10" class="form-control touchspin-no-mousewheel"> </div> </div> </div> </div> </div> <!-- /touchspin spinners --> <!-- Touchspin layouts --> <div class="row"> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Horizontal spinners</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <p class="mb-3">Touchspin supports default Bootstrap <code>input-group</code> component sizing classes, applied to the input or wrapped in <code>div</code> with these classes.</p> <div class="form-group"> <label>Large spinner</label> <input type="text" value="55" class="form-control form-control-lg touchspin-basic"> </div> <div class="form-group"> <label>Default spinner</label> <input type="text" value="55" class="form-control touchspin-basic"> </div> <div class="form-group"> <label>Small spinner</label> <input type="text" value="55" class="form-control form-control-sm touchspin-basic"> </div> </div> </div> </div> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Vertical spinners</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <p class="mb-3">Also Touchspin library supports <code>vertical</code> spinner controls orientation, that appear on the right side. Buttons and icons are fully customizable.</p> <div class="form-group"> <label>Large spinner</label> <input type="text" value="55" class="form-control form-control-lg touchspin-vertical"> </div> <div class="form-group"> <label>Default spinner</label> <input type="text" value="55" class="form-control touchspin-vertical"> </div> <div class="form-group"> <label>Small spinner</label> <input type="text" value="55" class="form-control form-control-sm touchspin-vertical"> </div> </div> </div> </div> </div> <!-- /touchspin layouts --> </div> <!-- FIM form_input_groups --> <!-- INICIO form_controls_extended --> <div class="content"> <!-- Typeahead --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Twitter typeahead</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="row"> <div class="col-md-6"> <div class="mb-4"> <h6 class="font-weight-semibold">Basic usage</h6> <p class="mb-2">When initializing a typeahead, you pass the plugin method one or more datasets. The source of a dataset is responsible for computing a set of suggestions for a given query.</p> <input type="text" class="form-control typeahead-basic" placeholder="States of USA"> </div> <div class="mb-4"> <h6 class="font-weight-semibold">Bloodhound engine</h6> <p class="mb-2">For more advanced use cases, rather than implementing the source for your dataset yourself, you can take advantage of <code>Bloodhound</code>, the <code>typeahead.js</code> suggestion engine.</p> <input type="text" class="form-control typeahead-bloodhound" placeholder="States of USA"> </div> <div class="mb-4"> <h6 class="font-weight-semibold">Prefetched data</h6> <p class="mb-2">Prefetched data is fetched and processed on initialization. If the browser supports local storage, the processed data will be cached there to prevent additional network requests on subsequent page loads.</p> <input type="text" class="form-control typeahead-prefetched" placeholder="Countries"> </div> <div class="mb-3"> <h6 class="font-weight-semibold">Remote data</h6> <p class="mb-2">Remote data is only used when the data provided by local and prefetch is insufficient. In order to prevent an obscene number of requests being made to the remote endpoint, requests are rate-limited.</p> <input type="text" class="form-control typeahead-remote" placeholder="Oscar winners for Best Picture"> </div> </div> <div class="col-md-6"> <div class="mb-4"> <h6 class="font-weight-semibold">Custom templates</h6> <p class="mb-2">Custom templates give you full control over how suggestions get rendered making it easy to customize the look and feel of your typeahead. Requires <code>Handlebars.js</code> extension for compilation.</p> <input type="text" class="form-control typeahead-custom-templates" placeholder="Oscar winners for Best Picture"> </div> <div class="mb-4"> <h6 class="font-weight-semibold">Multiple datasets</h6> <p class="mb-2">Multiple datasets give you visually separated sets of data inside Dropdown menu with custom titles, managed in <code>templates</code> option. This looks like a <code>&lt;optgroup></code> titles in selects.</p> <input type="text" class="form-control typeahead-multiple-datasets" placeholder="NBA and NHL teams"> </div> <div class="mb-4"> <h6 class="font-weight-semibold">Dropdown height</h6> <p class="mb-2">To change the height of your dropdown menu, just wrap your input in some div with custom css styles and change necessary css properties or change it in css directly.</p> <div class="typeahead-scrollable"> <input type="text" class="form-control typeahead-scrollable-menu" placeholder="Countries"> </div> </div> <div class="mb-3"> <h6 class="font-weight-semibold">RTL support</h6> <p class="mb-2">Twitter Typeahead supports <code>RTL</code> direction. Wrap your input in any div with <code>text-align: right;</code> property and add <code>dir="rtl"</code> to your input, now your dropdown menu is right aligned.</p> <input type="text" class="form-control typeahead-rtl-support" dir="rtl" placeholder="نعم"> </div> </div> </div> </div> </div> <!-- /typeahead --> <!-- Elastic textarea --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Elastic textarea</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="row"> <div class="col-md-4"> <div class="mb-3"> <h6 class="font-weight-semibold">Basic example</h6> <p class="mb-3">Drop Autosize into any existing website and it should Just Work™. The source is short and well commented if you are curious to how it works.</p> <div class="form-group"> <textarea rows="4" cols="4" class="form-control elastic" placeholder="Textarea"></textarea> </div> <button type="button" class="btn btn-primary">Submit form</button> </div> </div> <div class="col-md-4"> <div class="mb-3"> <h6 class="font-weight-semibold">Manual triggering</h6> <p class="mb-3">When the value of a textarea has been changed through JavaScript, trigger the <code>autosize.resize</code> event immediately after to update the height.</p> <div class="form-group"> <textarea rows="4" cols="4" class="form-control elastic elastic-manual" placeholder="Press 'Trigger Manually' button"></textarea> </div> <button type="button" class="btn btn-primary elastic-manual-trigger">Trigger manually</button> </div> </div> <div class="col-md-4"> <div class="mb-3"> <h6 class="font-weight-semibold">Removing autosize</h6> <p class="mb-3">Trigger the <code>autosize.destroy</code> event to remove autosize from a textarea element. Once <code>destroy</code> button clicked, autosize will be removed.</p> <div class="form-group"> <textarea rows="4" cols="4" class="form-control elastic elastic-destroy" placeholder="Press 'Destroy' button to remove autosize"></textarea> </div> <button type="button" class="btn btn-primary elastic-destroy-trigger">Destroy Autosize</button> </div> </div> </div> </div> </div> <!-- /elastic textarea --> <!-- Masked inputs --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Masked inputs</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="row"> <div class="col-md-4"> <div class="form-group"> <label>Date: </label> <input type="text" class="form-control" data-mask="99/99/9999" placeholder="Enter starting date"> <span class="form-text text-muted">99/99/9999</span> </div> <div class="form-group"> <label>Phone: </label> <input type="text" class="form-control" data-mask="(999) 999-9999" placeholder="Enter your phone #"> <span class="form-text text-muted">(999) 999-9999</span> </div> <div class="form-group"> <label>Phone + Ext: </label> <input type="text" class="form-control" data-mask="(999) 999-9999 / x99999" placeholder="Enter your phone #"> <span class="form-text text-muted">(999) 999-9999 / x99999</span> </div> <div class="form-group"> <label>Currency: </label> <input type="text" class="form-control" data-mask="$999" placeholder="Enter amount in USD"> <span class="form-text text-muted">$999</span> </div> </div> <div class="col-md-4"> <div class="form-group"> <label>International format: </label> <input type="text" class="form-control" data-mask="+39 999 999 999" placeholder="Enter your phone in international format"> <span class="form-text text-muted">+39 999 999 999</span> </div> <div class="form-group"> <label>Tax ID: </label> <input type="text" class="form-control" data-mask="99-9999999" placeholder="Enter your tax id"> <span class="form-text text-muted">99-9999999</span> </div> <div class="form-group"> <label>SSN: </label> <input type="text" class="form-control" data-mask="999-99-9999" placeholder="Enter your social security number"> <span class="form-text text-muted">999-99-9999</span> </div> <div class="form-group"> <label>Credit card: </label> <input type="text" class="form-control" data-mask="9999-9999-9999-9999" placeholder="Enter your credit card number"> <span class="form-text text-muted">9999-9999-9999-9999</span> </div> </div> <div class="col-md-4"> <div class="form-group"> <label>Product key: </label> <input type="text" class="form-control" data-mask="a*-999-a999" placeholder="Enter your product key"> <span class="form-text text-muted">a*-999-a999</span> </div> <div class="form-group"> <label>Purchase order: </label> <input type="text" class="form-control" data-mask="aaa-999-***" placeholder="Enter your order #"> <span class="form-text text-muted">aaa-999-***</span> </div> <div class="form-group"> <label>Percentage: </label> <input type="text" class="form-control" data-mask="99%" placeholder="Enter value in %"> <span class="form-text text-muted">99%</span> </div> <div class="form-group"> <label>ISBN: </label> <input type="text" class="form-control" data-mask="999-99-999-9999-9" placeholder="Enter your ISBN"> <span class="form-text text-muted">999-99-999-9999-9</span> </div> </div> </div> </div> </div> <!-- /masked inputs --> <!-- Input formatter --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Input formatter</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="row"> <div class="col-md-4"> <div class="form-group"> <label>Date: </label> <input type="text" class="form-control" name="format-date" placeholder="Enter starting date"> <span class="form-text text-muted">99/99/9999</span> </div> <div class="form-group"> <label>Phone number: </label> <input type="text" class="form-control format-phone-number" placeholder="Enter your phone number"> <span class="form-text text-muted">(999) 999 - 9999</span> </div> <div class="form-group"> <label>Phone + Ext: </label> <input type="text" class="form-control" name="format-phone-ext" placeholder="Enter your phone number"> <span class="form-text text-muted">(999) 999-9999 / a999</span> </div> <div class="form-group"> <label>Currency: </label> <input type="text" class="form-control" name="format-currency" placeholder="Enter amount in USD"> <span class="form-text text-muted">$999.99</span> </div> </div> <div class="col-md-4"> <div class="form-group"> <label>International format: </label> <input type="text" class="form-control" name="format-international-phone" placeholder="Enter your phone in international format"> <span class="form-text text-muted">+39 999 999 999</span> </div> <div class="form-group"> <label>Tax ID: </label> <input type="text" class="form-control" name="format-tax-id" placeholder="Enter your tax id"> <span class="form-text text-muted">99 - 9999999</span> </div> <div class="form-group"> <label>SSN: </label> <input type="text" class="form-control" name="format-ssn" placeholder="Enter your social security number"> <span class="form-text text-muted">999 - 99 - 9999</span> </div> <div class="form-group"> <label>Credit card: </label> <input type="text" class="form-control" name="format-credit-card" placeholder="Enter your credit card number"> <span class="form-text text-muted">9999 - 9999 - 9999 - 9999</span> </div> </div> <div class="col-md-4"> <div class="form-group"> <label>Product key: </label> <input type="text" class="form-control" name="format-product-key" placeholder="Enter your product key"> <span class="form-text text-muted">a* - 999 - a999</span> </div> <div class="form-group"> <label>Order number: </label> <input type="text" class="form-control" name="format-order-number" placeholder="Enter your order #"> <span class="form-text text-muted">aaa - 999 - ***</span> </div> <div class="form-group"> <label>ISBN: </label> <input type="text" class="form-control" name="format-isbn" placeholder="Enter your ISBN"> <span class="form-text text-muted">999 - 99 - 999 - 9999 - 9</span> </div> <div class="form-group"> <label>Visible formatted characters: </label> <input type="text" class="form-control" name="format-persistent" placeholder="Enter your phone #"> <span class="form-text text-muted">+3 (999) 999-99-99</span> </div> </div> </div> </div> </div> <!-- /input formatter --> <!-- Password generator --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Password generator</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="row"> <div class="col-md-4"> <div class="mb-3"> <h6 class="font-weight-semibold">Checker inside badge</h6> <p class="mb-3">Password checker is attached to the badge, which appears below the input field. Empty badge is hidden, if you add any text inside badge, it'll stay visible.</p> <div class="form-group"> <div class="badge-indicator"> <input type="text" class="form-control" placeholder="Enter your password"> <span class="badge form-text password-indicator-badge"></span> </div> </div> <button type="button" class="btn btn-info generate-badge">Generate 12 characters password</button> </div> </div> <div class="col-md-4"> <div class="mb-3"> <h6 class="font-weight-semibold">Label inside input</h6> <p class="mb-3">Rules are the same as for password checker inside badge, but this one has absolute position and placed inside <code>form-group</code>. Empty badge is also hidden.</p> <div class="form-group"> <div class="badge-indicator-absolute"> <input type="text" class="form-control" placeholder="Enter your password"> <span class="badge password-indicator-badge-absolute"></span> </div> </div> <button type="button" class="btn btn-info generate-badge-absolute">Generate 10 characters password</button> </div> </div> <div class="col-md-4"> <div class="mb-3"> <h6 class="font-weight-semibold">Label inside addon</h6> <p class="mb-3">In this example password checker appears as input group <code>text addon</code>. Can be left and/or right aligned, supports all input group styles. Styles can be adjusted in JS config.</p> <div class="form-group"> <div class="input-group group-indicator"> <input type="text" class="form-control" placeholder="Enter your password"> <span class="input-group-append"> <span class="input-group-text">No password</span> </span> </div> </div> <button type="button" class="btn btn-info generate-group">Generate 8 characters password</button> </div> </div> </div> </div> </div> <!-- /password generator --> <!-- Bootstrap maxlength --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Bootstrap maxlength</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="row"> <div class="col-md-6"> <div class="mb-4"> <h6 class="font-weight-semibold">Basic example</h6> <p class="mb-2">Basic example of maxlength plugin. The badge will show up right below the input by default when the remaining chars are 10 or less. This is a default value and position.</p> <input type="text" class="form-control maxlength" maxlength="20" placeholder="Type 10 characters..."> </div> <div class="mb-4"> <h6 class="font-weight-semibold">Label position</h6> <p class="mb-2">The field counter can be positioned at the top, bottom, left or right via <code>placement</code> option. You can also place the maxlength indicator on the corners: bottom-right, top-right, top-left, bottom-left and centered-right.</p> <input type="text" class="form-control maxlength-badge-position" maxlength="20" placeholder="Centered right position"> </div> <div class="mb-3"> <h6 class="font-weight-semibold">Full featured</h6> <p class="mb-2">This is a complete example where all the options configured for the bootstrap-maxlength counter are setted. <strong>Please note:</strong> if the <code>alwaysShow</code> option is enabled, the <code>threshold</code> option is ignored.</p> <input type="text" class="form-control maxlength-options" maxlength="20" placeholder="Always visible with custom text"> </div> </div> <div class="col-md-6"> <div class="mb-4"> <h6 class="font-weight-semibold">Change the threshold value</h6> <p class="mb-2">Do you want the badge to show up when there are 20 chars or less? Use the <code>threshold</code> option. In this example badge appears when the remaining chars are <code>15</code> or less.</p> <input type="text" class="form-control maxlength-threshold" maxlength="20" placeholder="Type 5 characters..."> </div> <div class="mb-4"> <h6 class="font-weight-semibold">Custom options</h6> <p class="mb-2">Example with custom options. All options can be mixed: here badge will show up after entering 10 characters, badge has different color and shows up after the limit is reached.</p> <input type="text" class="form-control maxlength-custom" maxlength="20" placeholder="With Primary and Danger badges"> </div> <div class="mb-3"> <h6 class="font-weight-semibold">Textarea example</h6> <p class="mb-2">Bootstrap maxlength supports textarea as well as inputs. Even on old IE. Maxlength, attached to the textarea supports all available options and settings by default.</p> <textarea rows="3" cols="3" maxlength="225" class="form-control maxlength-textarea" placeholder="This textarea has a limit of 225 chars."></textarea> </div> </div> </div> </div> </div> <!-- /bootstrap maxlength --> </div> <!-- FIM form_controls_extended --> <!-- INICIO form_floating_labels --> <div class="content"> <!-- Floating labels --> <div class="row"> <div class="col-md-6"> <!-- Title --> <div class="mb-3"> <h6 class="mb-0 font-weight-semibold"> Hidden labels </h6> <span class="text-muted d-block">Inputs with empty values</span> </div> <!-- /title --> <!-- Text inputs --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Text inputs</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="form-group form-group-float"> <label class="form-group-float-label">Text input</label> <input type="text" class="form-control" placeholder="Text input"> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Password input</label> <input type="password" class="form-control" placeholder="Password input"> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Input with helper</label> <input type="text" class="form-control" placeholder="Input with helper"> <span class="form-text text-muted">Input helper text block</span> </div> <div class="form-group form-group-float"> <label class="form-group-float-label text-success font-weight-semibold">Contextual input</label> <div class="form-group-feedback form-group-feedback-right"> <input type="text" class="form-control border-success" placeholder="Success with icon"> <div class="form-control-feedback text-success"> <i class="icon-checkmark3"></i> </div> </div> <span class="form-text text-success">Contextual input helper</span> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Readonly input field</label> <input type="text" class="form-control" readonly placeholder="Readonly input field"> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Disabled input field</label> <input type="text" class="form-control" disabled placeholder="Disabled input field"> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Textarea</label> <textarea rows="5" cols="5" class="form-control" placeholder="Textarea"></textarea> </div> </div> </div> <!-- /text inputs --> <!-- Input groups --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Input groups</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="form-group form-group-float"> <label class="form-group-float-label">Left group addon</label> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text"><i class="icon-paperplane"></i></span> </span> <input type="text" class="form-control" placeholder="Left group addon"> </div> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Right group addon</label> <div class="input-group"> <input type="text" class="form-control" placeholder="Right group addon"> <span class="input-group-append"> <span class="input-group-text"><i class="icon-truck"></i></span> </span> </div> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Left group button</label> <div class="input-group"> <div class="input-group-prepend"> <button type="button" class="btn bg-blue dropdown-toggle" data-toggle="dropdown">Action</button> <div class="dropdown-menu"> <a href="#" class="dropdown-item">Action</a> <a href="#" class="dropdown-item">Another action</a> <a href="#" class="dropdown-item">Something else here</a> <a href="#" class="dropdown-item">One more line</a> </div> </div> <input type="text" class="form-control" placeholder="Left group button"> </div> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Right group button</label> <div class="input-group"> <input type="text" class="form-control" placeholder="Right group button"> <div class="input-group-append"> <button type="button" class="btn bg-blue dropdown-toggle" data-toggle="dropdown">Action</button> <div class="dropdown-menu dropdown-menu-right"> <a href="#" class="dropdown-item">Action</a> <a href="#" class="dropdown-item">Another action</a> <a href="#" class="dropdown-item">Something else here</a> <a href="#" class="dropdown-item">One more line</a> </div> </div> </div> </div> <div class="form-group form-group-float form-group-feedback form-group-feedback-right"> <label class="form-group-float-label text-danger font-weight-semibold">Contextual input group</label> <div class="position-relative"> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text alpha-danger text-danger border-danger"> <i class="icon-blocked"></i> </span> </span> <input type="text" class="form-control border-danger" placeholder="Contextual input group"> </div> <div class="form-control-feedback text-danger"> <i class="icon-spam"></i> </div> </div> <span class="form-text text-danger">Contextual input group helper</span> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Touchspin spinners</label> <input type="text" value="" class="form-control touchspin-basic" placeholder="Touchspin spinners"> </div> </div> </div> <!-- /input groups --> <!-- Selects --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Selects</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="form-group form-group-float"> <label class="form-group-float-label">Basic select</label> <select class="form-control"> <option value="" selected>Basic select</option> <optgroup label="Alaskan/Hawaiian Time Zone"> <option value="AK">Alaska</option> <option value="HI">Hawaii</option> </optgroup> <optgroup label="Pacific Time Zone"> <option value="CA">California</option> <option value="NV">Nevada</option> <option value="WA">Washington</option> </optgroup> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="WY">Wyoming</option> </optgroup> </select> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Styled select</label> <select class="form-control form-control-uniform" data-fouc> <option value="" selected>Basic select</option> <optgroup label="Alaskan/Hawaiian Time Zone"> <option value="AK">Alaska</option> <option value="HI">Hawaii</option> </optgroup> <optgroup label="Pacific Time Zone"> <option value="CA">California</option> <option value="NV">Nevada</option> <option value="WA">Washington</option> </optgroup> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="WY">Wyoming</option> </optgroup> </select> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Single Select2 select</label> <select data-placeholder="Single Select2 select" class="form-control form-control-select2" data-fouc> <option></option> <optgroup label="Alaskan/Hawaiian Time Zone"> <option value="AK">Alaska</option> <option value="HI">Hawaii</option> </optgroup> <optgroup label="Pacific Time Zone"> <option value="CA">California</option> <option value="NV">Nevada</option> <option value="WA">Washington</option> </optgroup> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="WY">Wyoming</option> </optgroup> </select> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Multiple Select2 select</label> <select data-placeholder="Multiple Select2 select" multiple="multiple" class="form-control form-control-select2" data-fouc> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </optgroup> <optgroup label="Eastern Time Zone"> <option value="CT">Connecticut</option> <option value="FL">Florida</option> <option value="MA">Massachusetts</option> <option value="WV">West Virginia</option> </optgroup> </select> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Bootstrap multiselect</label> <select class="form-control form-control-multiselect" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes">Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> </div> </div> <!-- /selects --> <!-- Other inputs --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Other inputs</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="form-group form-group-float"> <label class="form-group-float-label">Typeahead</label> <input type="text" class="form-control typeahead-basic" placeholder="Typeahead"> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Masked input</label> <input type="text" class="form-control" data-mask="99/99/9999" placeholder="Masked input"> <span class="form-text text-muted">99/99/9999</span> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Input formatter</label> <input type="text" class="form-control" name="format-date" placeholder="Input formatter"> <span class="form-text text-muted">99/99/9999</span> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Bootstrap Maxlength</label> <input type="text" class="form-control form-control-maxlength" maxlength="10" placeholder="Bootstrap Maxlength"> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Bootstrap Tokenfield</label> <input type="text" class="form-control token-field" placeholder="- Bootstrap Tokenfield" data-fouc> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Bootstrap tags input</label> <input type="text" class="form-control tags-input" placeholder="- Bootstrap tags input" data-fouc> </div> <div class="form-group form-group-float"> <label class="d-block form-group-float-label">Default file input</label> <input type="file" class="form-control"> </div> <div class="form-group form-group-float"> <label class="d-block form-group-float-label">Styled file input</label> <input type="file" class="form-control-uniform" data-fouc> </div> </div> </div> <!-- /other inputs --> </div> <div class="col-md-6"> <!-- Title --> <div class="mb-3"> <h6 class="mb-0 font-weight-semibold"> Visible labels </h6> <span class="text-muted d-block">Inputs with predefined values</span> </div> <!-- /title --> <!-- Text inputs --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Text inputs</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="form-group form-group-float"> <label class="form-group-float-label">Text input</label> <input type="text" class="form-control" value="Value" placeholder="Text input"> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Password input</label> <input type="password" class="form-control" value="Value" placeholder="Password input"> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Input with helper</label> <input type="text" class="form-control" value="Value" placeholder="Input with helper"> <span class="form-text text-muted">Input helper text block</span> </div> <div class="form-group form-group-float"> <label class="form-group-float-label text-success font-weight-semibold">Contextual input</label> <div class="form-group-feedback form-group-feedback-right"> <input type="text" class="form-control border-success" value="Value" placeholder="Success with icon"> <div class="form-control-feedback text-success"> <i class="icon-checkmark3"></i> </div> </div> <span class="form-text text-success">Contextual input helper</span> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Readonly input field</label> <input type="text" class="form-control" readonly value="Value" placeholder="Readonly input field"> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Disabled input field</label> <input type="text" class="form-control" disabled value="Value" placeholder="Disabled input field"> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Textarea</label> <textarea rows="5" cols="5" class="form-control" placeholder="Textarea">Text</textarea> </div> </div> </div> <!-- /text inputs --> <!-- Input groups --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Input groups</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="form-group form-group-float"> <label class="form-group-float-label">Left group addon</label> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text"><i class="icon-paperplane"></i></span> </span> <input type="text" class="form-control" value="Value" placeholder="Left group addon"> </div> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Right group addon</label> <div class="input-group"> <input type="text" class="form-control" value="Value" placeholder="Right group addon"> <span class="input-group-append"> <span class="input-group-text"><i class="icon-truck"></i></span> </span> </div> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Left group button</label> <div class="input-group"> <div class="input-group-prepend"> <button type="button" class="btn bg-blue dropdown-toggle" data-toggle="dropdown">Action</button> <div class="dropdown-menu"> <a href="#" class="dropdown-item">Action</a> <a href="#" class="dropdown-item">Another action</a> <a href="#" class="dropdown-item">Something else here</a> <a href="#" class="dropdown-item">One more line</a> </div> </div> <input type="text" class="form-control" value="Value" placeholder="Left group button"> </div> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Right group button</label> <div class="input-group"> <input type="text" class="form-control" value="Value" placeholder="Right group button"> <div class="input-group-append"> <button type="button" class="btn bg-blue dropdown-toggle" data-toggle="dropdown">Action</button> <div class="dropdown-menu dropdown-menu-right"> <a href="#" class="dropdown-item">Action</a> <a href="#" class="dropdown-item">Another action</a> <a href="#" class="dropdown-item">Something else here</a> <a href="#" class="dropdown-item">One more line</a> </div> </div> </div> </div> <div class="form-group form-group-float form-group-feedback form-group-feedback-right"> <label class="form-group-float-label text-danger font-weight-semibold">Contextual input group</label> <div class="position-relative"> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text alpha-danger text-danger border-danger"><i class="icon-blocked"></i></span> </span> <input type="text" class="form-control border-danger" value="Value" placeholder="Contextual input group"> </div> <div class="form-control-feedback text-danger"> <i class="icon-spam"></i> </div> </div> <span class="form-text text-danger">Contextual input group helper</span> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Touchspin spinners</label> <input type="text" value="10" class="form-control touchspin-basic" placeholder="Touchspin spinners"> </div> </div> </div> <!-- /input groups --> <!-- Selects --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Selects</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="form-group form-group-float"> <label class="form-group-float-label">Basic select</label> <select class="form-control"> <option value="">Select state...</option> <optgroup label="Alaskan/Hawaiian Time Zone"> <option value="AK" selected>Alaska</option> <option value="HI">Hawaii</option> </optgroup> <optgroup label="Pacific Time Zone"> <option value="CA">California</option> <option value="NV">Nevada</option> <option value="WA">Washington</option> </optgroup> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="WY">Wyoming</option> </optgroup> </select> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Styled select</label> <select class="form-control form-control-uniform" data-fouc> <option value="" selected>Styled select</option> <optgroup label="Alaskan/Hawaiian Time Zone"> <option value="AK" selected>Alaska</option> <option value="HI">Hawaii</option> </optgroup> <optgroup label="Pacific Time Zone"> <option value="CA">California</option> <option value="NV">Nevada</option> <option value="WA">Washington</option> </optgroup> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="WY">Wyoming</option> </optgroup> </select> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Single Select2 select</label> <select data-placeholder="Single Select2 select" class="form-control form-control-select2" data-fouc> <option></option> <optgroup label="Alaskan/Hawaiian Time Zone"> <option value="AK" selected>Alaska</option> <option value="HI">Hawaii</option> </optgroup> <optgroup label="Pacific Time Zone"> <option value="CA">California</option> <option value="NV">Nevada</option> <option value="WA">Washington</option> </optgroup> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="WY">Wyoming</option> </optgroup> </select> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Multiple Select2 select</label> <select data-placeholder="Multiple Select2 select" multiple="multiple" class="form-control form-control-select2" data-fouc> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO" selected>Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="IA">Iowa</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </optgroup> <optgroup label="Eastern Time Zone"> <option value="CT">Connecticut</option> <option value="FL">Florida</option> <option value="MA" selected>Massachusetts</option> <option value="WV">West Virginia</option> </optgroup> </select> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Bootstrap multiselect</label> <div class="multi-select-full"> <select class="form-control form-control-multiselect" multiple="multiple" data-fouc> <option value="cheese">Cheese</option> <option value="tomatoes" selected>Tomatoes</option> <option value="mozarella">Mozzarella</option> <option value="mushrooms">Mushrooms</option> </select> </div> </div> </div> </div> <!-- /selects --> <!-- Other inputs --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Other inputs</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="form-group form-group-float"> <label class="form-group-float-label">Typeahead</label> <input type="text" class="form-control typeahead-basic" value="Arkansas" placeholder="Typeahead"> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Masked input</label> <input type="text" class="form-control" data-mask="99/99/9999" value="22/22/2222" placeholder="Masked input"> <span class="form-text text-muted">99/99/9999</span> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Input formatter</label> <input type="text" class="form-control" name="format-date" value="33/33/3333" placeholder="Input formatter"> <span class="form-text text-muted">99/99/9999</span> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Bootstrap Maxlength</label> <input type="text" class="form-control form-control-maxlength" maxlength="10" value="Value" placeholder="Bootstrap Maxlength"> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Bootstrap Tokenfield</label> <input type="text" class="form-control token-field" value="California,Washington" placeholder="- Bootstrap Tokenfield" data-fouc> </div> <div class="form-group form-group-float"> <label class="form-group-float-label">Bootstrap tags input</label> <input type="text" class="form-control tags-input" value="Miami,Texas" placeholder="- Bootstrap tags input" data-fouc> </div> <div class="form-group form-group-float"> <label class="d-block">Default file input (forced)</label> <input type="file" class="form-control" src="/file.txt" value="10" name="uploadform" size="30" id="fileupload2"> </div> <div class="form-group form-group-float"> <label class="d-block">Styled file input (forced)</label> <input type="file" class="form-control-uniform" data-fouc> </div> </div> </div> <!-- /other inputs --> </div> </div> <!-- /floating labels --> </div> <!-- FIM form_floating_labels --> <!-- INICIO form_tag_inputs --> <div class="content"> <!-- Tokenfield title --> <div class="mb-3"> <h6 class="mb-0 font-weight-semibold"> Tokenfield for Bootstrap </h6> <span class="text-muted d-block">Advanced tagging/tokenizing plugin</span> </div> <!-- /tokenfield title --> <!-- Tokenfield basic --> <div class="row"> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Basic usage</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <!-- Basic example --> <div class="form-group"> <label>Basic example</label> <input type="text" class="form-control tokenfield" value="These,are,tokens" data-fouc> </div> <!-- /basic example --> <!-- Limit tokens number --> <div class="form-group"> <label>Limit tokens number</label> <input type="text" class="form-control tokenfield" data-limit="5" value="Maximum,five,tokens" data-fouc> </div> <!-- /limit tokens number --> <!-- Disabled field --> <div class="form-group"> <label>Disabled field</label> <input type="text" class="form-control tokenfield" disabled value="This,is,disabled,field" data-fouc> </div> <!-- disabled field --> <!-- Readonly field --> <div class="form-group"> <label>Readonly field</label> <input type="text" class="form-control tokenfield" readonly value="This,is,readonly,field" data-fouc> </div> <!-- readonly field --> <!-- Using typeahead --> <div class="form-group"> <label>Using Twitter Typeahead</label> <input type="text" class="form-control tokenfield-typeahead" value="Enter,color,names" data-fouc> </div> <!-- /using typeahead --> <!-- Keyboard support --> <div class="form-group"> <label>Keyboard support</label> <input type="text" class="form-control tokenfield" value="Try,pressing,backspace" data-fouc> </div> <!-- /keyboard support --> <!-- Copy paste support --> <div class="form-group"> <label>Copy and paste support</label> <input type="text" class="form-control tokenfield" value="Copy,and,paste" data-fouc> </div> <!-- /copy paste support --> <!-- Create token on blur --> <div class="form-group"> <label>Create token on blur</label> <input type="text" class="form-control tokenfield-blur" value="Type,and,focus,out" data-fouc> </div> <!-- /create token on blur --> <!-- Custom delimiter --> <div class="form-group"> <label>Custom delimiter</label> <input type="text" class="form-control tokenfield-delimiter" value="Semicolon;as;delimiter" data-fouc> </div> <!-- /custom delimiter --> </div> </div> </div> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Advanced examples</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <!-- Show placeholder --> <div class="form-group"> <label>Show placeholder</label> <input type="text" class="form-control tokenfield" placeholder="Add tag" value="Copy,and,paste" data-fouc> </div> <!-- /show placeholder --> <!-- Inside form group with addon --> <div class="form-group"> <label>Input group with addon</label> <div class="input-group"> <span class="input-group-prepend"> <span class="input-group-text"><i class="icon-price-tags"></i></span> </span> <input type="text" class="form-control tokenfield" value="cool,nice,great" data-fouc> </div> </div> <!-- /inside form group with addon --> <!-- Inside form group with button --> <div class="form-group"> <label>Input group with button</label> <div class="input-group"> <input type="text" class="form-control tokenfield" value="Cool,nice,great" data-fouc> <div class="input-group-append"> <button type="button" class="btn btn-light btn-icon dropdown-toggle" data-toggle="dropdown"><i class="icon-cog5"></i></button> <div class="dropdown-menu dropdown-menu-right"> <a href="#" class="dropdown-item">Action</a> <a href="#" class="dropdown-item">Another action</a> <a href="#" class="dropdown-item">Something else here</a> <a href="#" class="dropdown-item">One more line</a> </div> </div> </div> </div> <!-- /inside form group with button --> <!-- Set tokens method --> <div class="form-group"> <label>Set tokens method</label> <div class="input-group"> <input type="text" class="form-control tokenfield" id="set-tokens-field" value="Click,Set,button" data-fouc> <div class="input-group-append"> <button type="button" class="btn btn-light" id="set-tokens">Set tokens</button> </div> </div> </div> <!-- /set tokens method --> <!-- Get tokens method --> <div class="form-group"> <label>Get tokens method</label> <div class="input-group"> <input type="text" class="form-control tokenfield" id="get-tokens-field" value="Click,Get,button" data-fouc> <div class="input-group-append"> <button type="button" class="btn btn-light" id="get-tokens">Get tokens</button> </div> </div> </div> <!-- /get tokens method --> <!-- Create token method --> <div class="form-group"> <label>Create token method</label> <div class="input-group"> <input type="text" class="form-control tokenfield" id="create-token-field" value="Create,token" data-fouc> <div class="input-group-append"> <button type="button" class="btn btn-light" id="create-token">Create token</button> </div> </div> </div> <!-- /create token method --> <!-- Disable/enable methods --> <div class="form-group"> <label>Disable / enable methods</label> <div class="input-group"> <input type="text" class="form-control tokenfield-disable" value="Disable,and,enable" data-fouc> <div class="input-group-append"> <button type="button" class="btn btn-light" id="disable">Disable</button> <button type="button" class="btn bg-info" id="enable">Enable</button> </div> </div> </div> <!-- /disable/enable methods --> <!-- Readonly/writeable methods --> <div class="form-group"> <label>Readonly / writable methods</label> <div class="input-group"> <input type="text" class="form-control tokenfield-readonly" value="Readonly,and,writeable" data-fouc> <div class="input-group-append"> <button type="button" class="btn btn-light" id="readonly">Readonly</button> <button type="button" class="btn bg-info" id="writeable">Writeable</button> </div> </div> </div> <!-- /readonly/writeable methods --> <!-- Destroy method --> <div class="form-group"> <label>Destroy</label> <div class="input-group"> <input type="text" class="form-control tokenfield-destroy" value="Destroy,and,create" data-fouc> <div class="input-group-append"> <button type="button" class="btn btn-light" id="destroy">Destroy</button> <button type="button" class="btn bg-info" id="create">Create</button> </div> </div> </div> <!-- /destroy method --> </div> </div> </div> </div> <!-- /tokenfield basic --> <!-- Tokenfield inputs sizing --> <div class="row"> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Input sizing</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <!-- Large input size --> <div class="form-group"> <label>Large input size</label> <input type="text" class="form-control tokenfield form-control-lg" value="Red,blue,green" data-fouc> </div> <!-- /large input size --> <!-- Default input size --> <div class="form-group"> <label>Default input size</label> <input type="text" class="form-control tokenfield" value="Red,blue,green" data-fouc> </div> <!-- /default input size --> <!-- Small input size --> <div class="form-group"> <label>Small input size</label> <input type="text" class="form-control tokenfield form-control-sm" value="Red,blue,green" data-fouc> </div> <!-- /small input size --> </div> </div> </div> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Input group sizing</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <!-- Large input group size --> <div class="form-group"> <label>Large input group size</label> <div class="input-group input-group-lg"> <div class="input-group-prepend"> <span class="input-group-text"><i class="icon-menu7"></i></span> </div> <input type="text" class="form-control tokenfield" value="Red,blue,green" data-fouc> </div> </div> <!-- /large input group size --> <!-- Default input group size --> <div class="form-group"> <label>Default input group size</label> <div class="input-group"> <div class="input-group-prepend"> <span class="input-group-text"><i class="icon-cash3"></i></span> </div> <input type="text" class="form-control tokenfield" value="Red,blue,green" data-fouc> </div> </div> <!-- /default input group size --> <!-- Small input group size --> <div class="form-group"> <label>Small input group size</label> <div class="input-group input-group-sm"> <div class="input-group-prepend"> <span class="input-group-text"><i class="icon-lifebuoy"></i></span> </div> <input type="text" class="form-control tokenfield" value="Red,blue,green" data-fouc> </div> </div> <!-- /small input group size --> </div> </div> </div> </div> <!-- /tokenfield inputs sizing --> <!-- Tokenfield styling --> <div class="row"> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Validation states</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <!-- Error validation state --> <div class="form-group"> <label class="font-weight-semibold text-danger">Invalid state</label> <div class="form-group-feedback form-group-feedback-right"> <input type="text" class="form-control tokenfield-danger" value="Red,blue,green" data-fouc> <div class="form-control-feedback text-danger"> <i class="icon-cancel-circle2"></i> </div> </div> </div> <!-- /error validation state --> <!-- Success validation state --> <div class="form-group"> <label class="font-weight-semibold text-success">Valid state</label> <div class="form-group-feedback form-group-feedback-right"> <input type="text" class="form-control tokenfield-success" value="Red,blue,green" data-fouc> <div class="form-control-feedback text-success"> <i class="icon-checkmark-circle"></i> </div> </div> </div> <!-- /success validation state --> </div> </div> </div> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Custom colors</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <!-- Custom blue color --> <div class="form-group"> <label>Custom blue color</label> <input type="text" class="form-control tokenfield-primary" value="Red,blue,green" data-fouc> </div> <!-- /custom blue color --> <!-- Custom green color --> <div class="form-group"> <label>Custom green color</label> <input type="text" class="form-control tokenfield-teal" value="Red,blue,green" data-fouc> </div> <!-- /custom green color --> </div> </div> </div> </div> <!-- /tokenfield basic --> <!-- Bootstrap tags input --> <div class="mb-3 pt-2"> <h6 class="mb-0 font-weight-semibold"> Bootstrap Tags Input </h6> <span class="text-muted d-block">User interface for managing tags</span> </div> <div class="row"> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Initialization</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <!-- Default usage --> <div class="mb-3"> <h6 class="font-weight-semibold">Default usage</h6> <p class="mb-3">Tags input is a simple and flexible extension with plenty of useful features and support of Twitter Typeahead library. To initialize tags input, you can use both javascript and data attributes.</p> <div class="mb-3"> <input type="text" value="Amsterdam,Washington,Sydney,Beijing" class="form-control tags-input" data-fouc> </div> <div class="mb-3"> <div class="mb-1">Returned values</div> <pre class="val"><code class="language-javascript">"Amsterdam,Washington,Sydney,Beijing"</code></pre> </div> <div class="mb-4"> <div class="mb-1">Returned items</div> <pre class="items"><code class="language-javascript">["Amsterdam","Washington","Sydney","Beijing"]</code></pre> </div> </div> <!-- /default usage --> <!-- Using data attributes --> <div class="mb-3"> <h6 class="font-weight-semibold">Using data attributes</h6> <p class="mb-3">Just add <code>data-role="tagsinput"</code> to your input field to automatically change it to a tags input field. <span class="font-weight-semibold">Note:</span> currently tags input supports only default options if intinalized via data attributes.</p> <div class="mb-3"> <input type="text" value="Amsterdam,Washington,Sydney" class="form-control" data-role="tagsinput" data-fouc> </div> <div class="mb-3"> <div class="mb-1">Returned values</div> <pre class="val"><code class="language-javascript">&nbsp;</code></pre> </div> <div class="mb-3"> <div class="mb-1">Returned items</div> <pre class="items"><code class="language-javascript">&nbsp;</code></pre> </div> </div> <!-- /using data attributes --> </div> </div> </div> <div class="col-md-6"> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Basic options</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <!-- Maximum tags --> <div class="mb-3"> <h6 class="font-weight-semibold">Maximum tags allowed</h6> <p class="mb-3">When set, no more than the given number of tags are allowed to add (default: undefined). When maxTags is reached, a class 'bootstrap-tagsinput-max' is placed on the tagsinput element.</p> <div class="mb-3"> <input type="text" value="Amsterdam,Washington,Sydney" class="form-control tagsinput-max-tags" data-fouc> </div> <div class="mb-3"> <div class="mb-1">Returned values</div> <pre class="val"><code class="language-javascript">"Amsterdam,Washington,Sydney"</code></pre> </div> <div class="mb-4"> <div class="mb-1">Returned items</div> <pre class="items"><code class="language-javascript">["Amsterdam","Washington","Sydney"]</code></pre> </div> </div> <!-- /maximum tags --> <!-- Custom tag class --> <div class="mb-3"> <h6 class="font-weight-semibold">Custom tags class</h6> <p class="mb-3">Tag element uses basic <code>.badge</code> element markup and supports all color options available for it. Default color alternative is <code>info</code>, to use another color add proper class to <code>tagClass</code> option.</p> <div class="mb-3"> <input type="text" value="Amsterdam,Washington,Sydney" class="form-control tagsinput-custom-tag-class" data-fouc> </div> <div class="mb-3"> <div class="mb-1">Returned values</div> <pre class="val"><code class="language-javascript">"Amsterdam,Washington,Sydney"</code></pre> </div> <div class="mb-3"> <div class="mb-1">Returned items</div> <pre class="items"><code class="language-javascript">["Amsterdam","Washington","Sydney"]</code></pre> </div> </div> <!-- /maximum tags --> </div> </div> </div> </div> <!-- /bootstrap tags input --> <!-- Tags input options --> <div class="row"> <div class="col-md-6"> <!-- Advanced examples --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Advanced examples</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <!-- Typeahead support --> <div class="form-group"> <label>Typeahead support</label> <input type="text" value="Washington,Alaska" data-role="tagsinput" class="form-control tagsinput-typeahead" data-fouc> </div> <!-- /typeahead support --> <!-- Categorizing tags --> <div class="form-group"> <label>Categorizing tags</label> <input type="text" class="form-control tagsinput-tag-categorizing" data-fouc> </div> <!-- /categorizing tags --> <!-- Objects as tags --> <div class="form-group"> <label>Objects as tags</label> <input type="text" class="form-control tagsinput-tag-objects" data-fouc> </div> <!-- /objects as tags --> <!-- Allow dublicates --> <div class="form-group"> <label>Allow dublicates</label> <select multiple="multiple" class="form-control tags-input-dublicates" data-fouc> <option value="Amsterdam" selected>Amsterdam</option> <option value="Washington" selected>Washington</option> <option value="Washington" selected>Washington</option> </select> </div> <!-- /allow dublicates --> </div> </div> <!-- /advanced examples --> </div> <div class="col-md-6"> <!-- Tags input methods --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Tags input methods</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <!-- Add tag --> <div class="form-group"> <label>Add one tag</label> <div class="input-group"> <input type="text" value="Washington,Alaska" class="form-control tagsinput-add-tag" data-fouc> <div class="input-group-append"> <button type="button" class="btn btn-light add-tag-button">Add Beijing</button> </div> </div> </div> <!-- /add tag --> <!-- Remove tag --> <div class="form-group"> <label>Remove one tag</label> <div class="input-group"> <input type="text" value="Washington,Alaska" class="form-control tagsinput-remove-tag" data-fouc> <div class="input-group-append"> <button type="button" class="btn btn-light remove-tag-button">Remove Sydney</button> </div> </div> </div> <!-- /remove tag --> <!-- Remove all tags --> <div class="form-group"> <label>Remove all tags</label> <div class="input-group"> <input type="text" value="Washington,Alaska" class="form-control tagsinput-remove-tags" data-fouc> <div class="input-group-append"> <button type="button" class="btn btn-light remove-all-tags-button">Remove all</button> </div> </div> </div> <!-- /remove all tags --> <!-- Destroy tags input --> <div class="form-group"> <label>Destroy Tagsinput</label> <div class="input-group"> <input type="text" value="Washington,Alaska" class="form-control tagsinput-destroy" data-fouc> <div class="input-group-append"> <button type="button" class="btn btn-light destroy-tagsinput-button">Destroy</button> </div> </div> </div> <!-- /destroy tags input --> </div> </div> <!-- /tags input methods --> </div> </div> <!-- /tags input options --> </div> <!-- FIM form_tag_inputs --> <!-- INICIO form_dual_listboxes --> <div class="content"> <!-- Basic example --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Basic example</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <p class="mb-3">The dual listbox is created from a select multiple by calling <code>.bootstrapDualListbox(settings);</code> on a selector. The selector can be any element, not just selects. When the method is called on a selector other than a select, then all select childrens are converted into dual list boxes. This example demonstrates <code>single</code> option selection.</p> <select multiple="multiple" class="form-control listbox" data-fouc> <option value="option1" selected>Classical mechanics</option> <option value="option2">Electromagnetism</option> <option value="option4">Relativity</option> <option value="option5" selected>Quantum mechanics</option> <option value="option7">Astrophysics</option> <option value="option8" selected>Biophysics</option> <option value="option9">Chemical physics</option> <option value="option10">Econophysics</option> <option value="option11">Geophysics</option> <option value="option12">Medical physics</option> <option value="option13">Physical chemistry</option> <option value="option14" selected>Continuum mechanics</option> <option value="option15">Electrodynamics</option> <option value="option16" selected>Quantum field theory</option> <option value="option17">Scattering theory</option> <option value="option18" selected>Chaos theory</option> <option value="option19" selected>Newton's laws of motion</option> <option value="option20">Thermodynamics</option> </select> </div> </div> <!-- /basic example --> <!-- Multiple selection --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Multiple selection</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <p class="mb-3">Multiple selection example. By default, only single selection is allowed: once you click on the option, it automatically moves to another box. To disable single selection and turn on multiple, set <code>moveOnSelect</code> option to <code>false</code> in plugin configuration. Defaults to <code>true</code> and this option is forced to <code>true</code> on the Android browser.</p> <select multiple="multiple" class="form-control listbox-no-selection" data-fouc> <option value="option1" selected>Classical mechanics</option> <option value="option2">Electromagnetism</option> <option value="option4">Relativity</option> <option value="option5" selected>Quantum mechanics</option> <option value="option7">Astrophysics</option> <option value="option8" selected>Biophysics</option> <option value="option9">Chemical physics</option> <option value="option10">Econophysics</option> <option value="option11">Geophysics</option> <option value="option12">Medical physics</option> <option value="option13">Physical chemistry</option> <option value="option14" selected>Continuum mechanics</option> <option value="option15">Electrodynamics</option> <option value="option16" selected>Quantum field theory</option> <option value="option17">Scattering theory</option> <option value="option18" selected>Chaos theory</option> <option value="option19" selected>Newton's laws of motion</option> <option value="option20">Thermodynamics</option> </select> </div> </div> <!-- /multiple selection --> <!-- Filtered results --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Filtered results</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <p class="mb-3">The following example demonstrates initialization of the dual listbox with a filter for the non selected elements, currently from 7 to 12. This can be applied only if <code>showFilterInputs</code> is set to <code>true</code>. Using <code>selectedFilter</code> option, listbox will filter selected elements only. You can use "Display all" button as a filter reset.</p> <select multiple="multiple" class="form-control listbox-filtered-results" data-fouc> <option value="option1">Classical mechanics</option> <option value="option2" selected>Electromagnetism</option> <option value="option3">Relativity</option> <option value="option4">Quantum mechanics</option> <option value="option5">Astrophysics</option> <option value="option6">Biophysics</option> <option value="option7">Chemical physics</option> <option value="option8">Econophysics</option> <option value="option9">Geophysics</option> <option value="option10">Medical physics</option> <option value="option11">Physical chemistry</option> <option value="option12" selected>Continuum mechanics</option> <option value="option13">Electrodynamics</option> <option value="option14">Quantum field theory</option> <option value="option15">Scattering theory</option> <option value="option16">Chaos theory</option> <option value="option17">Newton's laws of motion</option> <option value="option18">Thermodynamics</option> </select> </div> </div> <!-- /filtered results --> <!-- Disable filter --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Disable filter</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <p class="mb-3">The following example demonstrates listbox with disabled filter input. By default, filter input field is always visible, unless <code>showFilterInputs</code> option is set to <code>false</code>. Please note: if false, all additional filter options such as filtered results will be disabled, but all plugin options related to selects will remain available.</p> <select multiple="multiple" class="form-control listbox-filter-disabled" data-fouc> <option value="option1" selected>Classical mechanics</option> <option value="option2">Electromagnetism</option> <option value="option4">Relativity</option> <option value="option5" selected>Quantum mechanics</option> <option value="option7">Astrophysics</option> <option value="option8" selected>Biophysics</option> <option value="option9">Chemical physics</option> <option value="option10">Econophysics</option> <option value="option11">Geophysics</option> <option value="option12">Medical physics</option> <option value="option13">Physical chemistry</option> <option value="option14" selected>Continuum mechanics</option> <option value="option15">Electrodynamics</option> <option value="option16" selected>Quantum field theory</option> <option value="option17">Scattering theory</option> <option value="option18" selected>Chaos theory</option> <option value="option19" selected>Newton's laws of motion</option> <option value="option20">Thermodynamics</option> </select> </div> </div> <!-- /disable filter --> <!-- Control boxes height --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Control boxes height</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <p class="mb-3">This example demonstrates ability to change the minimal height of the generated dual listbox. Default listbox height is <code>200px</code>, in this example the height is increased up to <code>300px</code> using <code>selectorMinimalHeight</code> option. This value is applied to the list itself, but not to the whole container with other elements.</p> <select multiple="multiple" class="form-control listbox-tall" data-fouc> <option value="option1" selected>Classical mechanics</option> <option value="option2">Electromagnetism</option> <option value="option4">Relativity</option> <option value="option5" selected>Quantum mechanics</option> <option value="option7">Astrophysics</option> <option value="option8" selected>Biophysics</option> <option value="option9">Chemical physics</option> <option value="option10">Econophysics</option> <option value="option11">Geophysics</option> <option value="option12">Medical physics</option> <option value="option13">Physical chemistry</option> <option value="option14" selected>Continuum mechanics</option> <option value="option15">Electrodynamics</option> <option value="option16" selected>Quantum field theory</option> <option value="option17">Scattering theory</option> <option value="option18" selected>Chaos theory</option> <option value="option19" selected>Newton's laws of motion</option> <option value="option20">Thermodynamics</option> </select> </div> </div> <!-- /control boxes height --> <!-- Custom text support --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Custom text support</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <p class="mb-3">This example demonstrates how custom text or language can be used in dual listbox controls. All these text labels and placeholders are fully editable through specified options, such as: <code>infoText</code>, <code>infoTextFiltered</code>, <code>infoTextEmpty</code>, <code>filterPlaceHolder</code> etc.</p> <select multiple="multiple" class="form-control listbox-custom-text" data-fouc> <option value="option1" selected>Classical mechanics</option> <option value="option2">Electromagnetism</option> <option value="option4">Relativity</option> <option value="option5" selected>Quantum mechanics</option> <option value="option7">Astrophysics</option> <option value="option8" selected>Biophysics</option> <option value="option9">Chemical physics</option> <option value="option10">Econophysics</option> <option value="option11">Geophysics</option> <option value="option12">Medical physics</option> <option value="option13">Physical chemistry</option> <option value="option14" selected>Continuum mechanics</option> <option value="option15">Electrodynamics</option> <option value="option16" selected>Quantum field theory</option> <option value="option17">Scattering theory</option> <option value="option18" selected>Chaos theory</option> <option value="option19" selected>Newton's laws of motion</option> <option value="option20">Thermodynamics</option> </select> </div> </div> <!-- /custom text support --> <!-- Add options dynamically --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Adding options dynamically</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <p class="mb-3">The options must be added to/removed from the original select. Note that the <code>bootstrapDualListbox.refresh</code> event must be triggered on it after manipulating the options. If there are some highlighted options in the lists, then triggering the <code>bootstrapDualListbox.refresh</code> event with the optional <code>true</code> parameter results the highlights to be removed.</p> <div class="mb-3"> <select multiple="multiple" class="form-control listbox-dynamic-options" data-fouc> <option value="option1" selected>Classical mechanics</option> <option value="option2">Electromagnetism</option> <option value="option4">Relativity</option> <option value="option5" selected>Quantum mechanics</option> <option value="option7">Astrophysics</option> <option value="option8" selected>Biophysics</option> <option value="option9">Chemical physics</option> <option value="option10">Econophysics</option> <option value="option11">Geophysics</option> <option value="option12">Medical physics</option> <option value="option13">Physical chemistry</option> <option value="option14" selected>Continuum mechanics</option> <option value="option15">Electrodynamics</option> <option value="option16" selected>Quantum field theory</option> <option value="option17">Scattering theory</option> <option value="option18" selected>Chaos theory</option> <option value="option19" selected>Newton's laws of motion</option> <option value="option20">Thermodynamics</option> </select> </div> <button type="button" class="btn btn-primary listbox-add">Add options</button> <button type="button" class="btn btn-primary listbox-add-clear">Add with clearing highlights</button> </div> </div> <!-- /add options dynamically --> </div> <!-- FIM form_dual_listboxes --> <!-- INICIO form_validation --> <div class="content"> <!-- Form validation --> <div class="card"> <div class="card-header header-elements-inline"> <h5 class="card-title">Form validation</h5> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <p class="mb-4">Validate.js makes simple clientside form validation easy, whilst still offering plenty of customization options. The plugin comes bundled with a useful set of validation methods, including URL and email validation, while providing an API to write your own methods. All bundled methods come with default error messages in english and translations into 37 other languages. <strong>Note:</strong> <code>success</code> callback is configured for demo purposes only and can be removed in validation setup.</p> <form class="form-validate-jquery" action="#"> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Basic inputs</legend> <!-- Basic text input --> <div class="form-group row"> <label class="col-form-label col-lg-3">Basic text input <span class="text-danger">*</span></label> <div class="col-lg-9"> <input type="text" name="basic" class="form-control" required placeholder="Text input validation"> </div> </div> <!-- /basic text input --> <!-- Input with icons --> <div class="form-group row"> <label class="col-form-label col-lg-3">Input with icon <span class="text-danger">*</span></label> <div class="col-lg-9"> <div class="form-group-feedback form-group-feedback-right"> <input type="text" name="with_icon" class="form-control" required placeholder="Text input with icon validation"> <div class="form-control-feedback"> <i class="icon-droplets"></i> </div> </div> </div> </div> <!-- /input with icons --> <!-- Input group --> <div class="form-group row"> <label class="col-form-label col-lg-3">Input group <span class="text-danger">*</span></label> <div class="col-lg-9"> <div class="input-group"> <div class="input-group-prepend"> <span class="input-group-text"><i class="icon-mention"></i></span> </div> <input type="text" name="input_group" class="form-control" required placeholder="Input group validation"> </div> </div> </div> <!-- /input group --> <!-- Password field --> <div class="form-group row"> <label class="col-form-label col-lg-3">Password field <span class="text-danger">*</span></label> <div class="col-lg-9"> <input type="password" name="password" id="password" class="form-control" required placeholder="Minimum 5 characters allowed"> </div> </div> <!-- /password field --> <!-- Repeat password --> <div class="form-group row"> <label class="col-form-label col-lg-3">Repeat password <span class="text-danger">*</span></label> <div class="col-lg-9"> <input type="password" name="repeat_password" class="form-control" required placeholder="Try different password"> </div> </div> <!-- /repeat password --> <!-- Email field --> <div class="form-group row"> <label class="col-form-label col-lg-3">Email field <span class="text-danger">*</span></label> <div class="col-lg-9"> <input type="email" name="email" class="form-control" id="email" required placeholder="Enter a valid email address"> </div> </div> <!-- /email field --> <!-- Repeat email --> <div class="form-group row"> <label class="col-form-label col-lg-3">Repeat email <span class="text-danger">*</span></label> <div class="col-lg-9"> <input type="email" name="repeat_email" class="form-control" required placeholder="Enter a valid email address"> </div> </div> <!-- /repeat email --> <!-- Minimum characters --> <div class="form-group row"> <label class="col-form-label col-lg-3">Minimum characters <span class="text-danger">*</span></label> <div class="col-lg-9"> <input type="text" name="minimum_characters" class="form-control" required placeholder="Enter at least 10 characters"> </div> </div> <!-- /minimum characters --> <!-- Maximum characters --> <div class="form-group row"> <label class="col-form-label col-lg-3">Maximum characters <span class="text-danger">*</span></label> <div class="col-lg-9"> <input type="text" name="maximum_characters" class="form-control" required placeholder="Enter 10 characters maximum"> </div> </div> <!-- /maximum characters --> <!-- Minimum number --> <div class="form-group row"> <label class="col-form-label col-lg-3">Minimum number <span class="text-danger">*</span></label> <div class="col-lg-9"> <input type="text" name="minimum_number" class="form-control" required placeholder="Enter a value greater than or equal to 10"> </div> </div> <!-- /minimum number --> <!-- Maximum number --> <div class="form-group row"> <label class="col-form-label col-lg-3">Maximum number <span class="text-danger">*</span></label> <div class="col-lg-9"> <input type="text" name="maximum_number" class="form-control" required placeholder="Please enter a value less than or equal to 10"> </div> </div> <!-- /maximum number --> <!-- Basic textarea --> <div class="form-group row"> <label class="col-form-label col-lg-3">Basic textarea <span class="text-danger">*</span></label> <div class="col-lg-9"> <textarea rows="5" cols="5" name="textarea" class="form-control" required placeholder="Default textarea"></textarea> </div> </div> <!-- /basic textarea --> </fieldset> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Advanced inputs</legend> <!-- Number range --> <div class="form-group row"> <label class="col-form-label col-lg-3">Number range <span class="text-danger">*</span></label> <div class="col-lg-9"> <input type="text" name="number_range" class="form-control" required placeholder="Enter a value between 10 and 20"> </div> </div> <!-- /number range --> <!-- Touchspin spinners --> <div class="form-group row"> <label class="col-form-label col-lg-3">Touchspin spinner <span class="text-danger">*</span></label> <div class="col-lg-9"> <input type="text" name="touchspin" value="" required class="form-control touchspin-postfix" placeholder="Not valid if empty"> </div> </div> <!-- /touchspin spinners --> <!-- Custom message --> <div class="form-group row"> <label class="col-form-label col-lg-3">Custom message <span class="text-danger">*</span></label> <div class="col-lg-9"> <input type="text" name="custom" class="form-control" required placeholder="Custom error message"> </div> </div> <!-- /custom message --> <!-- URL validation --> <div class="form-group row"> <label class="col-form-label col-lg-3">URL validation <span class="text-danger">*</span></label> <div class="col-lg-9"> <input type="text" name="url" class="form-control" required placeholder="Enter a valid URL address"> </div> </div> <!-- /url validation --> <!-- Date validation --> <div class="form-group row"> <label class="col-form-label col-lg-3">Date validation <span class="text-danger">*</span></label> <div class="col-lg-9"> <input type="text" name="date" class="form-control" required placeholder="April, 2014 or any other date format"> </div> </div> <!-- /date validation --> <!-- ISO date validation --> <div class="form-group row"> <label class="col-form-label col-lg-3">ISO date validation <span class="text-danger">*</span></label> <div class="col-lg-9"> <input type="text" name="date_iso" class="form-control" required placeholder="YYYY/MM/DD or any other ISO date format"> </div> </div> <!-- /iso date validation --> <!-- Numbers only --> <div class="form-group row"> <label class="col-form-label col-lg-3">Numbers only <span class="text-danger">*</span></label> <div class="col-lg-9"> <input type="text" name="numbers" class="form-control" required placeholder="Enter decimal number only"> </div> </div> <!-- /numbers only --> <!-- Digits only --> <div class="form-group row"> <label class="col-form-label col-lg-3">Digits only <span class="text-danger">*</span></label> <div class="col-lg-9"> <input type="text" name="digits" class="form-control" required placeholder="Enter digits only"> </div> </div> <!-- /digits only --> <!-- Credit card validation --> <div class="form-group row"> <label class="col-form-label col-lg-3">Credit card validation <span class="text-danger">*</span></label> <div class="col-lg-9"> <input type="text" name="card" class="form-control" required placeholder="Enter credit card number. Try 446-667-651"> </div> </div> <!-- /credit card validation --> <!-- Basic file uploader --> <div class="form-group row"> <label class="col-form-label col-lg-3">Basic file uploader <span class="text-danger">*</span></label> <div class="col-lg-9"> <input type="file" name="unstyled_file" class="form-control" required> </div> </div> <!-- /basic file uploader --> <!-- Styled file uploader --> <div class="form-group row"> <label class="col-form-label col-lg-3">Styled file uploader <span class="text-danger">*</span></label> <div class="col-lg-9"> <input type="file" name="styled_file" class="form-input-styled" required data-fouc> </div> </div> <!-- /styled file uploader --> <!-- Basic select --> <div class="form-group row"> <label class="col-form-label col-lg-3">Basic select <span class="text-danger">*</span></label> <div class="col-lg-9"> <select name="default_select" class="form-control" required> <option value="">Choose an option</option> <optgroup label="Alaskan/Hawaiian Time Zone"> <option value="AK">Alaska</option> <option value="HI">Hawaii</option> <option value="CA">California</option> </optgroup> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="AR">Arkansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> </div> <!-- /basic select --> <!-- Styled select --> <div class="form-group row"> <label class="col-form-label col-lg-3">Styled select <span class="text-danger">*</span></label> <div class="col-lg-9"> <select name="styled_select" class="form-control form-input-styled" required data-fouc> <option value="">Choose an option</option> <optgroup label="Alaskan/Hawaiian Time Zone"> <option value="AK">Alaska</option> <option value="HI">Hawaii</option> <option value="CA">California</option> </optgroup> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="AR">Arkansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> </div> <!-- /styled asic select --> <!-- Select2 select --> <div class="form-group row"> <label class="col-form-label col-lg-3">Select2 select <span class="text-danger">*</span></label> <div class="col-lg-9"> <select name="select2" data-placeholder="Select a State..." class="form-control form-control-select2" required data-fouc> <option></option> <optgroup label="Alaskan/Hawaiian Time Zone"> <option value="AK">Alaska</option> <option value="HI">Hawaii</option> </optgroup> <optgroup label="Pacific Time Zone"> <option value="CA">California</option> <option value="NV">Nevada</option> <option value="OR">Oregon</option> <option value="WA">Washington</option> </optgroup> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> </select> </div> </div> <!-- /select2 select --> <!-- Multiple select --> <div class="form-group row"> <label class="col-form-label col-lg-3">Multiple select <span class="text-danger">*</span></label> <div class="col-lg-9"> <select name="default_multiple_select" class="form-control" multiple required> <optgroup label="Alaskan/Hawaiian Time Zone"> <option value="AK">Alaska</option> <option value="HI">Hawaii</option> <option value="CA">California</option> <option value="NV">Nevada</option> <option value="WA">Washington</option> </optgroup> <optgroup label="Mountain Time Zone"> <option value="AZ">Arizona</option> <option value="CO">Colorado</option> <option value="ID">Idaho</option> <option value="WY">Wyoming</option> </optgroup> <optgroup label="Central Time Zone"> <option value="AL">Alabama</option> <option value="AR">Arkansas</option> <option value="IL">Illinois</option> <option value="KS">Kansas</option> <option value="KY">Kentucky</option> </optgroup> </select> </div> </div> <!-- /multiple select --> </fieldset> <fieldset class="mb-3"> <legend class="text-uppercase font-size-sm font-weight-bold">Checkboxes and radios</legend> <!-- Basic single checkbox --> <div class="form-group row"> <label class="col-lg-3 col-form-label">Basic single checkbox <span class="text-danger">*</span></label> <div class="col-lg-9"> <div class="form-check"> <label class="form-check-label"> <input type="checkbox" class="form-check-input" name="single_basic_checkbox" required> Accept our terms </label> </div> </div> </div> <!-- /basic singlecheckbox --> <!-- Basic checkbox group --> <div class="form-group row"> <label class="col-lg-3 col-form-label">Basic checkbox group <span class="text-danger">*</span></label> <div class="col-lg-9"> <div class="form-check"> <label class="form-check-label"> <input type="checkbox" class="form-check-input" name="basic_checkbox" required> Duis eget nibh purus </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="checkbox" class="form-check-input" name="basic_checkbox"> Maecenas non nulla ac nunc </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="checkbox" class="form-check-input" name="basic_checkbox"> Maecenas egestas tristique </label> </div> </div> </div> <!-- /basic checkbox group --> <!-- Inline checkbox group --> <div class="form-group row"> <label class="col-lg-3 col-form-label">Basic inline checkbox group <span class="text-danger">*</span></label> <div class="col-lg-9"> <div class="form-check form-check-inline"> <label class="form-check-label"> <input type="checkbox" class="form-check-input" name="basic_inline_checkbox" required> Duis eget nibh purus </label> </div> <div class="form-check form-check-inline"> <label class="form-check-label"> <input type="checkbox" class="form-check-input" name="basic_inline_checkbox"> Maecenas non nulla ac nunc </label> </div> </div> </div> <!-- /inline checkbox group --> <!-- Basic radio group --> <div class="form-group row"> <label class="col-lg-3 col-form-label">Basic radio group <span class="text-danger">*</span></label> <div class="col-lg-9"> <div class="form-check"> <label class="form-check-label"> <input type="radio" class="form-check-input" name="basic_radio" required> Cras leo turpis malesuada eget </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" class="form-check-input" name="basic_radio"> Maecenas congue justo vel ipsum </label> </div> </div> </div> <!-- /basic radio group --> <!-- Basic inline radio group --> <div class="form-group row"> <label class="col-lg-3 col-form-label">Basic inline radio group <span class="text-danger">*</span></label> <div class="col-lg-9"> <div class="form-check form-check-inline"> <label class="form-check-label"> <input type="radio" class="form-check-input" name="basic_radio_group" required> Cras leo turpis malesuada eget </label> </div> <div class="form-check form-check-inline"> <label class="form-check-label"> <input type="radio" class="form-check-input" name="basic_radio_group"> Maecenas congue justo vel ipsum </label> </div> </div> </div> <!-- /basic inline radio group --> <hr class="mb-4"> <!-- Single styled checkbox --> <div class="form-group row"> <label class="col-lg-3 col-form-label">Single styled checkbox <span class="text-danger">*</span></label> <div class="col-lg-9"> <div class="form-check"> <label class="form-check-label"> <input type="checkbox" name="single_styled_checkbox" class="form-input-styled" required data-fouc> Accept our terms </label> </div> </div> </div> <!-- /single styled checkbox --> <!-- Styled checkbox group --> <div class="form-group row"> <label class="col-lg-3 col-form-label">Styled checkbox group <span class="text-danger">*</span></label> <div class="col-lg-9"> <div class="form-check"> <label class="form-check-label"> <input type="checkbox" name="styled_checkbox" class="form-input-styled" required data-fouc> Duis eget nibh purus </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="checkbox" name="styled_checkbox" class="form-input-styled" data-fouc> Maecenas non nulla ac nunc </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="checkbox" name="styled_checkbox" class="form-input-styled" data-fouc> Maecenas egestas tristique </label> </div> </div> </div> <!-- /styled checkbox group --> <!-- Inline checkbox group --> <div class="form-group row"> <label class="col-lg-3 col-form-label">Inline checkbox group <span class="text-danger">*</span></label> <div class="col-lg-9"> <div class="form-check form-check-inline"> <label class="form-check-label"> <input type="checkbox" name="styled_inline_checkbox" class="form-input-styled" required data-fouc> Duis eget nibh purus </label> </div> <div class="form-check form-check-inline"> <label class="form-check-label"> <input type="checkbox" name="styled_inline_checkbox" class="form-input-styled" data-fouc> Maecenas non nulla ac nunc </label> </div> </div> </div> <!-- /inline checkbox group --> <!-- Styled radio group --> <div class="form-group row"> <label class="col-lg-3 col-form-label">Styled radio group <span class="text-danger">*</span></label> <div class="col-lg-9"> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="styled_radio" class="form-input-styled" required data-fouc> Cras leo turpis malesuada eget </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="styled_radio" class="form-input-styled" data-fouc> Maecenas congue justo vel ipsum </label> </div> </div> </div> <!-- /styled radio group --> <!-- Styled inline radio group --> <div class="form-group row"> <label class="col-lg-3 col-form-label">Styled inline radio group <span class="text-danger">*</span></label> <div class="col-lg-9"> <div class="form-check form-check-inline"> <label class="form-check-label"> <input type="radio" name="styled_inline_radio" class="form-input-styled" required data-fouc> Cras leo turpis malesuada eget </label> </div> <div class="form-check form-check-inline"> <label class="form-check-label"> <input type="radio" name="styled_inline_radio" class="form-input-styled" data-fouc> Maecenas congue justo vel ipsum </label> </div> </div> </div> <!-- /styled inline radio group --> </fieldset> <fieldset> <legend class="text-uppercase font-size-sm font-weight-bold">Switcher components</legend> <!-- Switchery single --> <div class="form-group row"> <label class="col-lg-3 col-form-label">Swichery single <span class="text-danger">*</span></label> <div class="col-lg-9"> <div class="form-check form-check-switchery switchery-sm"> <label class="form-check-label"> <input type="checkbox" name="switchery_single" class="form-input-switchery" required data-fouc> Accept our terms </label> </div> </div> </div> <!-- /switchery single --> <!-- Switchery group --> <div class="form-group row"> <label class="col-lg-3 col-form-label">Swichery group <span class="text-danger">*</span></label> <div class="col-lg-9"> <div class="form-check form-check-switchery switchery-sm"> <label class="form-check-label"> <input type="checkbox" name="switchery_group" class="form-input-switchery" required data-fouc> Duis eget nibh purus </label> </div> <div class="form-check form-check-switchery switchery-sm"> <label class="form-check-label"> <input type="checkbox" name="switchery_group" class="form-input-switchery" data-fouc> Maecenas non nulla ac nunc </label> </div> <div class="form-check form-check-switchery switchery-sm"> <label class="form-check-label"> <input type="checkbox" name="switchery_group" class="form-input-switchery" data-fouc> Maecenas egestas tristique </label> </div> </div> </div> <!-- /switchery group --> <!-- Inline switchery group --> <div class="form-group row"> <label class="col-lg-3 col-form-label">Inline swichery group <span class="text-danger">*</span></label> <div class="col-lg-9"> <div class="form-check form-check-inline form-check-switchery switchery-sm"> <label class="form-check-label"> <input type="checkbox" name="inline_switchery_group" class="form-input-switchery" required data-fouc> Duis eget nibh purus </label> </div> <div class="form-check form-check-inline form-check-switchery switchery-sm"> <label class="form-check-label"> <input type="checkbox" name="inline_switchery_group" class="form-input-switchery" data-fouc> Maecenas egestas tristique </label> </div> </div> </div> <!-- /inline switchery group --> <hr> <!-- Switch single --> <div class="form-group row"> <label class="col-lg-3 col-form-label">Switch single <span class="text-danger">*</span></label> <div class="col-lg-9"> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label d-flex align-items-center"> <input type="checkbox" name="switch_single" data-on-text="Yes" data-off-text="No" class="form-input-switch" required> Accept our terms </label> </div> </div> </div> <!-- /switch single --> <!-- Switch group --> <div class="form-group row"> <label class="col-form-label col-lg-3">Switch group <span class="text-danger">*</span></label> <div class="col-lg-9"> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label d-flex align-items-center"> <input type="checkbox" name="switch_group" class="form-input-switch" required> Duis eget nibh purus </label> </div> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label d-flex align-items-center"> <input type="checkbox" name="switch_group" class="form-input-switch"> Maecenas non nulla ac nunc </label> </div> <div class="form-check form-check-switch form-check-switch-left"> <label class="form-check-label d-flex align-items-center"> <input type="checkbox" name="switch_group" class="form-input-switch"> Maecenas egestas tristique </label> </div> </div> </div> <!-- /switch group --> <!-- Inline switch group --> <div class="form-group row"> <label class="col-form-label col-lg-3">Inline switch group <span class="text-danger">*</span></label> <div class="col-lg-9"> <div class="form-check form-check-inline form-check-switch form-check-switch-left"> <label class="form-check-label align-items-center"> <input type="checkbox" name="inline_switch_group" class="form-input-switch" required> Duis eget nibh purus </label> </div> <div class="form-check form-check-inline form-check-switch form-check-switch-left"> <label class="form-check-label align-items-center"> <input type="checkbox" name="inline_switch_group" class="form-input-switch"> Maecenas non nulla ac nunc </label> </div> </div> </div> <!-- /inline switch group --> </fieldset> <div class="d-flex justify-content-end align-items-center"> <button type="reset" class="btn btn-light" id="reset">Reset <i class="icon-reload-alt ml-2"></i></button> <button type="submit" class="btn btn-primary ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> <!-- /form validation --> </div> <!-- FIM form_validation --> <!-- INICIO form_wizard --> <div class="content"> <!-- Basic setup --> <div class="card"> <div class="card-header bg-white header-elements-inline"> <h6 class="card-title">Basic example</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <form class="wizard-form steps-basic" action="#" data-fouc> <h6>Personal data</h6> <fieldset> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Select location:</label> <select name="location" data-placeholder="Select position" class="form-control form-control-select2" data-fouc> <option></option> <optgroup label="North America"> <option value="1">United States</option> <option value="2">Canada</option> </optgroup> <optgroup label="Latin America"> <option value="3">Chile</option> <option value="4">Argentina</option> <option value="5">Colombia</option> <option value="6">Peru</option> </optgroup> <optgroup label="Europe"> <option value="8">Croatia</option> <option value="9">Hungary</option> <option value="10">Ukraine</option> <option value="11">Greece</option> </optgroup> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Select position:</label> <select name="position" data-placeholder="Select position" class="form-control form-control-select2" data-fouc> <option></option> <optgroup label="Developer Relations"> <option value="1">Sales Engineer</option> <option value="2">Ads Solutions Consultant</option> <option value="3">Technical Solutions Consultant</option> <option value="4">Business Intern</option> </optgroup> <optgroup label="Engineering &amp; Design"> <option value="5">Interaction Designer</option> <option value="6">Technical Program Manager</option> <option value="7">Software Engineer</option> <option value="8">Information Security Engineer</option> </optgroup> <optgroup label="Marketing &amp; Communications"> <option value="13">Media Outreach Manager</option> <option value="14">Research Manager</option> <option value="15">Marketing Intern</option> <option value="16">Business Intern</option> </optgroup> </select> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Applicant name:</label> <input type="text" name="name" class="form-control" placeholder="John Doe"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Email address:</label> <input type="email" name="email" class="form-control" placeholder="your@email.com"> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Phone #:</label> <input type="text" name="tel" class="form-control" placeholder="+99-99-9999-9999" data-mask="+99-99-9999-9999"> </div> </div> <div class="col-md-6"> <label>Date of birth:</label> <div class="row"> <div class="col-md-4"> <div class="form-group"> <select name="birth-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="1">January</option> <option value="2">February</option> <option value="3">March</option> <option value="4">April</option> <option value="5">May</option> <option value="6">June</option> <option value="7">July</option> <option value="8">August</option> <option value="9">September</option> <option value="10">October</option> <option value="11">November</option> <option value="12">December</option> </select> </div> </div> <div class="col-md-4"> <div class="form-group"> <select name="birth-day" data-placeholder="Day" class="form-control form-control-select2" data-fouc> <option></option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="...">...</option> <option value="31">31</option> </select> </div> </div> <div class="col-md-4"> <div class="form-group"> <select name="birth-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1">1980</option> <option value="2">1981</option> <option value="3">1982</option> <option value="4">1983</option> <option value="5">1984</option> <option value="6">1985</option> <option value="7">1986</option> <option value="8">1987</option> <option value="9">1988</option> <option value="10">1989</option> <option value="11">1990</option> </select> </div> </div> </div> </div> </div> </fieldset> <h6>Your education</h6> <fieldset> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>University:</label> <input type="text" name="university" placeholder="University name" class="form-control"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Country:</label> <select name="university-country" data-placeholder="Choose a Country..." class="form-control form-control-select2" data-fouc> <option></option> <option value="1">United States</option> <option value="2">France</option> <option value="3">Germany</option> <option value="4">Spain</option> </select> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Degree level:</label> <input type="text" name="degree-level" placeholder="Bachelor, Master etc." class="form-control"> </div> <div class="form-group"> <label>Specialization:</label> <input type="text" name="specialization" placeholder="Design, Development etc." class="form-control"> </div> </div> <div class="col-md-6"> <div class="row"> <div class="col-md-6"> <label>From:</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <select name="education-from-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="January">January</option> <option value="...">...</option> <option value="December">December</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <select name="education-from-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1995">1995</option> <option value="...">...</option> <option value="1980">1980</option> </select> </div> </div> </div> </div> <div class="col-md-6"> <label>To:</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <select name="education-to-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="January">January</option> <option value="...">...</option> <option value="December">December</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <select name="education-to-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1995">1995</option> <option value="...">...</option> <option value="1980">1980</option> </select> </div> </div> </div> </div> </div> <div class="form-group"> <label>Language of education:</label> <input type="text" name="education-language" placeholder="English, German etc." class="form-control"> </div> </div> </div> </fieldset> <h6>Your experience</h6> <fieldset> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Company:</label> <input type="text" name="experience-company" placeholder="Company name" class="form-control"> </div> <div class="form-group"> <label>Position:</label> <input type="text" name="experience-position" placeholder="Company name" class="form-control"> </div> <div class="row"> <div class="col-md-6"> <label>From:</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <select name="education-from-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="January">January</option> <option value="...">...</option> <option value="December">December</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <select name="education-from-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1995">1995</option> <option value="...">...</option> <option value="1980">1980</option> </select> </div> </div> </div> </div> <div class="col-md-6"> <label>To:</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <select name="education-to-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="January">January</option> <option value="...">...</option> <option value="December">December</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <select name="education-to-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1995">1995</option> <option value="...">...</option> <option value="1980">1980</option> </select> </div> </div> </div> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Brief description:</label> <textarea name="experience-description" rows="4" cols="4" placeholder="Tasks and responsibilities" class="form-control"></textarea> </div> <div class="form-group"> <label class="d-block">Recommendations:</label> <input name="recommendations" type="file" class="form-input-styled" data-fouc> <span class="form-text text-muted">Accepted formats: pdf, doc. Max file size 2Mb</span> </div> </div> </div> </fieldset> <h6>Additional info</h6> <fieldset> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label class="d-block">Applicant resume:</label> <input type="file" name="resume" class="form-input-styled" data-fouc> <span class="form-text text-muted">Accepted formats: pdf, doc. Max file size 2Mb</span> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Where did you find us?</label> <select name="source" data-placeholder="Choose an option..." class="form-control form-control-select2" data-fouc> <option></option> <option value="monster">Monster.com</option> <option value="linkedin">LinkedIn</option> <option value="google">Google</option> <option value="adwords">Google AdWords</option> <option value="other">Other source</option> </select> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Availability:</label> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="availability" class="form-input-styled" data-fouc> Immediately </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="availability" class="form-input-styled" data-fouc> 1 - 2 weeks </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="availability" class="form-input-styled" data-fouc> 3 - 4 weeks </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="availability" class="form-input-styled" data-fouc> More than 1 month </label> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Additional information:</label> <textarea name="additional-info" rows="5" cols="5" placeholder="If you want to add any info, do it here." class="form-control"></textarea> </div> </div> </div> </fieldset> </form> </div> <!-- /basic setup --> <!-- Wizard with validation --> <div class="card"> <div class="card-header bg-white header-elements-inline"> <h6 class="card-title">Wizard with validation</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <form class="wizard-form steps-validation" action="#" data-fouc> <h6>Personal data</h6> <fieldset> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Select location: <span class="text-danger">*</span></label> <select name="location" data-placeholder="Select position" class="form-control form-control-select2 required" data-fouc> <option></option> <optgroup label="North America"> <option value="1">United States</option> <option value="2">Canada</option> </optgroup> <optgroup label="Latin America"> <option value="3">Chile</option> <option value="4">Argentina</option> <option value="5">Colombia</option> <option value="6">Peru</option> </optgroup> <optgroup label="Europe"> <option value="8">Croatia</option> <option value="9">Hungary</option> <option value="10">Ukraine</option> <option value="11">Greece</option> </optgroup> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Select position: <span class="text-danger">*</span></label> <select name="position" data-placeholder="Select position" class="form-control form-control-select2 required" data-fouc> <option></option> <optgroup label="Developer Relations"> <option value="1">Sales Engineer</option> <option value="2">Ads Solutions Consultant</option> <option value="3">Technical Solutions Consultant</option> <option value="4">Business Intern</option> </optgroup> <optgroup label="Engineering &amp; Design"> <option value="5">Interaction Designer</option> <option value="6">Technical Program Manager</option> <option value="7">Software Engineer</option> <option value="8">Information Security Engineer</option> </optgroup> <optgroup label="Marketing &amp; Communications"> <option value="13">Media Outreach Manager</option> <option value="14">Research Manager</option> <option value="15">Marketing Intern</option> <option value="16">Business Intern</option> </optgroup> </select> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Applicant name: <span class="text-danger">*</span></label> <input type="text" name="name" class="form-control required" placeholder="John Doe"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Email address: <span class="text-danger">*</span></label> <input type="email" name="email" class="form-control required" placeholder="your@email.com"> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Phone #:</label> <input type="text" name="tel" class="form-control" placeholder="+99-99-9999-9999" data-mask="+99-99-9999-9999"> </div> </div> <div class="col-md-6"> <label>Date of birth:</label> <div class="row"> <div class="col-md-4"> <div class="form-group"> <select name="birth-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="1">January</option> <option value="2">February</option> <option value="3">March</option> <option value="4">April</option> <option value="5">May</option> <option value="6">June</option> <option value="7">July</option> <option value="8">August</option> <option value="9">September</option> <option value="10">October</option> <option value="11">November</option> <option value="12">December</option> </select> </div> </div> <div class="col-md-4"> <div class="form-group"> <select name="birth-day" data-placeholder="Day" class="form-control form-control-select2" data-fouc> <option></option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="...">...</option> <option value="31">31</option> </select> </div> </div> <div class="col-md-4"> <div class="form-group"> <select name="birth-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1">1980</option> <option value="2">1981</option> <option value="3">1982</option> <option value="4">1983</option> <option value="5">1984</option> <option value="6">1985</option> <option value="7">1986</option> <option value="8">1987</option> <option value="9">1988</option> <option value="10">1989</option> <option value="11">1990</option> </select> </div> </div> </div> </div> </div> </fieldset> <h6>Your education</h6> <fieldset> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>University: <span class="text-danger">*</span></label> <input type="text" name="university" placeholder="University name" class="form-control required"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Country:</label> <select name="university-country" data-placeholder="Choose a Country..." class="form-control form-control-select2" data-fouc> <option></option> <option value="1">United States</option> <option value="2">France</option> <option value="3">Germany</option> <option value="4">Spain</option> </select> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Degree level: <span class="text-danger">*</span></label> <input type="text" name="degree-level" placeholder="Bachelor, Master etc." class="form-control required"> </div> <div class="form-group"> <label>Specialization:</label> <input type="text" name="specialization" placeholder="Design, Development etc." class="form-control"> </div> </div> <div class="col-md-6"> <div class="row"> <div class="col-md-6"> <label>From:</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <select name="education-from-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="January">January</option> <option value="...">...</option> <option value="December">December</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <select name="education-from-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1995">1995</option> <option value="...">...</option> <option value="1980">1980</option> </select> </div> </div> </div> </div> <div class="col-md-6"> <label>To:</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <select name="education-to-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="January">January</option> <option value="...">...</option> <option value="December">December</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <select name="education-to-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1995">1995</option> <option value="...">...</option> <option value="1980">1980</option> </select> </div> </div> </div> </div> </div> <div class="form-group"> <label>Language of education:</label> <input type="text" name="education-language" placeholder="English, German etc." class="form-control"> </div> </div> </div> </fieldset> <h6>Your experience</h6> <fieldset> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Company: <span class="text-danger">*</span></label> <input type="text" name="experience-company" placeholder="Company name" class="form-control required"> </div> <div class="form-group"> <label>Position: <span class="text-danger">*</span></label> <input type="text" name="experience-position" placeholder="Company name" class="form-control required"> </div> <div class="row"> <div class="col-md-6"> <label>From:</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <select name="education-from-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="January">January</option> <option value="...">...</option> <option value="December">December</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <select name="education-from-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1995">1995</option> <option value="...">...</option> <option value="1980">1980</option> </select> </div> </div> </div> </div> <div class="col-md-6"> <label>To:</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <select name="education-to-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="January">January</option> <option value="...">...</option> <option value="December">December</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <select name="education-to-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1995">1995</option> <option value="...">...</option> <option value="1980">1980</option> </select> </div> </div> </div> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Brief description:</label> <textarea name="experience-description" rows="4" cols="4" placeholder="Tasks and responsibilities" class="form-control"></textarea> </div> <div class="form-group"> <label class="d-block">Recommendations:</label> <input name="recommendations" type="file" class="form-input-styled" data-fouc> <span class="form-text text-muted">Accepted formats: pdf, doc. Max file size 2Mb</span> </div> </div> </div> </fieldset> <h6>Additional info</h6> <fieldset> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label class="d-block">Applicant resume:</label> <input type="file" name="resume" class="form-input-styled" data-fouc> <span class="form-text text-muted">Accepted formats: pdf, doc. Max file size 2Mb</span> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Where did you find us? <span class="text-danger">*</span></label> <select name="source" data-placeholder="Choose an option..." class="form-control form-control-select2 required" data-fouc> <option></option> <option value="monster">Monster.com</option> <option value="linkedin">LinkedIn</option> <option value="google">Google</option> <option value="adwords">Google AdWords</option> <option value="other">Other source</option> </select> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Availability: <span class="text-danger">*</span></label> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="availability" class="form-input-styled required" data-fouc> Immediately </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="availability" class="form-input-styled" data-fouc> 1 - 2 weeks </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="availability" class="form-input-styled" data-fouc> 3 - 4 weeks </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="availability" class="form-input-styled" data-fouc> More than 1 month </label> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Additional information:</label> <textarea name="additional-info" rows="5" cols="5" placeholder="If you want to add any info, do it here." class="form-control"></textarea> </div> </div> </div> </fieldset> </form> </div> <!-- /wizard with validation --> <!-- Saving state --> <div class="card"> <div class="card-header bg-white header-elements-inline"> <h6 class="card-title">Saving wizard state</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <form class="wizard-form steps-state-saving" action="#" data-fouc> <h6>Personal data</h6> <fieldset> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Select location:</label> <select name="location" data-placeholder="Select position" class="form-control form-control-select2" data-fouc> <option></option> <optgroup label="North America"> <option value="1">United States</option> <option value="2">Canada</option> </optgroup> <optgroup label="Latin America"> <option value="3">Chile</option> <option value="4">Argentina</option> <option value="5">Colombia</option> <option value="6">Peru</option> </optgroup> <optgroup label="Europe"> <option value="8">Croatia</option> <option value="9">Hungary</option> <option value="10">Ukraine</option> <option value="11">Greece</option> </optgroup> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Select position:</label> <select name="position" data-placeholder="Select position" class="form-control form-control-select2" data-fouc> <option></option> <optgroup label="Developer Relations"> <option value="1">Sales Engineer</option> <option value="2">Ads Solutions Consultant</option> <option value="3">Technical Solutions Consultant</option> <option value="4">Business Intern</option> </optgroup> <optgroup label="Engineering &amp; Design"> <option value="5">Interaction Designer</option> <option value="6">Technical Program Manager</option> <option value="7">Software Engineer</option> <option value="8">Information Security Engineer</option> </optgroup> </select> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Applicant name:</label> <input type="text" name="name" class="form-control" placeholder="John Doe"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Email address:</label> <input type="email" name="email" class="form-control" placeholder="your@email.com"> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Phone #:</label> <input type="text" name="tel" class="form-control" placeholder="+99-99-9999-9999" data-mask="+99-99-9999-9999"> </div> </div> <div class="col-md-6"> <label>Date of birth:</label> <div class="row"> <div class="col-md-4"> <div class="form-group"> <select name="birth-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="1">January</option> <option value="2">February</option> <option value="3">March</option> <option value="4">April</option> <option value="5">May</option> <option value="6">June</option> <option value="7">July</option> <option value="8">August</option> <option value="9">September</option> <option value="10">October</option> <option value="11">November</option> <option value="12">December</option> </select> </div> </div> <div class="col-md-4"> <div class="form-group"> <select name="birth-day" data-placeholder="Day" class="form-control form-control-select2" data-fouc> <option></option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="...">...</option> <option value="31">31</option> </select> </div> </div> <div class="col-md-4"> <div class="form-group"> <select name="birth-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1">1980</option> <option value="2">1981</option> <option value="3">1982</option> <option value="4">1983</option> <option value="5">1984</option> <option value="6">1985</option> <option value="7">1986</option> <option value="8">1987</option> <option value="9">1988</option> <option value="10">1989</option> <option value="11">1990</option> </select> </div> </div> </div> </div> </div> </fieldset> <h6>Your education</h6> <fieldset> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>University:</label> <input type="text" name="university" placeholder="University name" class="form-control"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Country:</label> <select name="university-country" data-placeholder="Choose a Country..." class="form-control form-control-select2" data-fouc> <option></option> <option value="1">United States</option> <option value="2">France</option> <option value="3">Germany</option> <option value="4">Spain</option> </select> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Degree level:</label> <input type="text" name="degree-level" placeholder="Bachelor, Master etc." class="form-control"> </div> <div class="form-group"> <label>Specialization:</label> <input type="text" name="specialization" placeholder="Design, Development etc." class="form-control"> </div> </div> <div class="col-md-6"> <div class="row"> <div class="col-md-6"> <label>From:</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <select name="education-from-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="January">January</option> <option value="...">...</option> <option value="December">December</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <select name="education-from-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1995">1995</option> <option value="...">...</option> <option value="1980">1980</option> </select> </div> </div> </div> </div> <div class="col-md-6"> <label>To:</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <select name="education-to-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="January">January</option> <option value="...">...</option> <option value="December">December</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <select name="education-to-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1995">1995</option> <option value="...">...</option> <option value="1980">1980</option> </select> </div> </div> </div> </div> </div> <div class="form-group"> <label>Language of education:</label> <input type="text" name="education-language" placeholder="English, German etc." class="form-control"> </div> </div> </div> </fieldset> <h6>Your experience</h6> <fieldset> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Company:</label> <input type="text" name="experience-company" placeholder="Company name" class="form-control"> </div> <div class="form-group"> <label>Position:</label> <input type="text" name="experience-position" placeholder="Company name" class="form-control"> </div> <div class="row"> <div class="col-md-6"> <label>From:</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <select name="education-from-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="January">January</option> <option value="...">...</option> <option value="December">December</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <select name="education-from-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1995">1995</option> <option value="...">...</option> <option value="1980">1980</option> </select> </div> </div> </div> </div> <div class="col-md-6"> <label>To:</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <select name="education-to-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="January">January</option> <option value="...">...</option> <option value="December">December</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <select name="education-to-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1995">1995</option> <option value="...">...</option> <option value="1980">1980</option> </select> </div> </div> </div> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Brief description:</label> <textarea name="experience-description" rows="4" cols="4" placeholder="Tasks and responsibilities" class="form-control"></textarea> </div> <div class="form-group"> <label class="d-block">Recommendations:</label> <input name="recommendations" type="file" class="form-input-styled" data-fouc> <span class="form-text text-muted">Accepted formats: pdf, doc. Max file size 2Mb</span> </div> </div> </div> </fieldset> <h6>Additional info</h6> <fieldset> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label class="d-block">Applicant resume:</label> <input type="file" name="resume" class="form-input-styled" data-fouc> <span class="form-text text-muted">Accepted formats: pdf, doc. Max file size 2Mb</span> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Where did you find us?</label> <select name="source" data-placeholder="Choose an option..." class="form-control form-control-select2" data-fouc> <option></option> <option value="monster">Monster.com</option> <option value="linkedin">LinkedIn</option> <option value="google">Google</option> <option value="adwords">Google AdWords</option> <option value="other">Other source</option> </select> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Availability:</label> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="availability" class="form-input-styled" data-fouc> Immediately </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="availability" class="form-input-styled" data-fouc> 1 - 2 weeks </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="availability" class="form-input-styled" data-fouc> 3 - 4 weeks </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="availability" class="form-input-styled" data-fouc> More than 1 month </label> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Additional information:</label> <textarea name="additional-info" rows="5" cols="5" placeholder="If you want to add any info, do it here." class="form-control"></textarea> </div> </div> </div> </fieldset> </form> </div> <!-- /saving state --> <!-- Starting step --> <div class="card"> <div class="card-header bg-white header-elements-inline"> <h6 class="card-title">Change starting step</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <form class="wizard-form steps-starting-step" action="#" data-fouc> <h6>Personal data</h6> <fieldset> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Select location:</label> <select name="location" data-placeholder="Select position" class="form-control form-control-select2" data-fouc> <option></option> <optgroup label="North America"> <option value="1">United States</option> <option value="2">Canada</option> </optgroup> <optgroup label="Latin America"> <option value="3">Chile</option> <option value="4">Argentina</option> <option value="5">Colombia</option> <option value="6">Peru</option> </optgroup> <optgroup label="Europe"> <option value="8">Croatia</option> <option value="9">Hungary</option> <option value="10">Ukraine</option> <option value="11">Greece</option> </optgroup> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Select position:</label> <select name="position" data-placeholder="Select position" class="form-control form-control-select2" data-fouc> <option></option> <optgroup label="Developer Relations"> <option value="1">Sales Engineer</option> <option value="2">Ads Solutions Consultant</option> <option value="3">Technical Solutions Consultant</option> <option value="4">Business Intern</option> </optgroup> <optgroup label="Engineering &amp; Design"> <option value="5">Interaction Designer</option> <option value="6">Technical Program Manager</option> <option value="7">Software Engineer</option> <option value="8">Information Security Engineer</option> </optgroup> <optgroup label="Marketing &amp; Communications"> <option value="13">Media Outreach Manager</option> <option value="14">Research Manager</option> <option value="15">Marketing Intern</option> <option value="16">Business Intern</option> </optgroup> </select> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Applicant name:</label> <input type="text" name="name" class="form-control" placeholder="John Doe"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Email address:</label> <input type="email" name="email" class="form-control" placeholder="your@email.com"> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Phone #:</label> <input type="text" name="tel" class="form-control" placeholder="+99-99-9999-9999" data-mask="+99-99-9999-9999"> </div> </div> <div class="col-md-6"> <label>Date of birth:</label> <div class="row"> <div class="col-md-4"> <div class="form-group"> <select name="birth-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="1">January</option> <option value="2">February</option> <option value="3">March</option> <option value="4">April</option> <option value="5">May</option> <option value="6">June</option> <option value="7">July</option> <option value="8">August</option> <option value="9">September</option> <option value="10">October</option> <option value="11">November</option> <option value="12">December</option> </select> </div> </div> <div class="col-md-4"> <div class="form-group"> <select name="birth-day" data-placeholder="Day" class="form-control form-control-select2" data-fouc> <option></option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="...">...</option> <option value="31">31</option> </select> </div> </div> <div class="col-md-4"> <div class="form-group"> <select name="birth-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1">1980</option> <option value="2">1981</option> <option value="3">1982</option> <option value="4">1983</option> <option value="5">1984</option> <option value="6">1985</option> <option value="7">1986</option> <option value="8">1987</option> <option value="9">1988</option> <option value="10">1989</option> <option value="11">1990</option> </select> </div> </div> </div> </div> </div> </fieldset> <h6>Your education</h6> <fieldset> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>University:</label> <input type="text" name="university" placeholder="University name" class="form-control"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Country:</label> <select name="university-country" data-placeholder="Choose a Country..." class="form-control form-control-select2" data-fouc> <option></option> <option value="1">United States</option> <option value="2">France</option> <option value="3">Germany</option> <option value="4">Spain</option> </select> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Degree level:</label> <input type="text" name="degree-level" placeholder="Bachelor, Master etc." class="form-control"> </div> <div class="form-group"> <label>Specialization:</label> <input type="text" name="specialization" placeholder="Design, Development etc." class="form-control"> </div> </div> <div class="col-md-6"> <div class="row"> <div class="col-md-6"> <label>From:</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <select name="education-from-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="January">January</option> <option value="...">...</option> <option value="December">December</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <select name="education-from-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1995">1995</option> <option value="...">...</option> <option value="1980">1980</option> </select> </div> </div> </div> </div> <div class="col-md-6"> <label>To:</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <select name="education-to-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="January">January</option> <option value="...">...</option> <option value="December">December</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <select name="education-to-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1995">1995</option> <option value="...">...</option> <option value="1980">1980</option> </select> </div> </div> </div> </div> </div> <div class="form-group"> <label>Language of education:</label> <input type="text" name="education-language" placeholder="English, German etc." class="form-control"> </div> </div> </div> </fieldset> <h6>Your experience</h6> <fieldset data-step-start> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Company:</label> <input type="text" name="experience-company" placeholder="Company name" class="form-control"> </div> <div class="form-group"> <label>Position:</label> <input type="text" name="experience-position" placeholder="Company name" class="form-control"> </div> <div class="row"> <div class="col-md-6"> <label>From:</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <select name="education-from-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="January">January</option> <option value="...">...</option> <option value="December">December</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <select name="education-from-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1995">1995</option> <option value="...">...</option> <option value="1980">1980</option> </select> </div> </div> </div> </div> <div class="col-md-6"> <label>To:</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <select name="education-to-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="January">January</option> <option value="...">...</option> <option value="December">December</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <select name="education-to-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1995">1995</option> <option value="...">...</option> <option value="1980">1980</option> </select> </div> </div> </div> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Brief description:</label> <textarea name="experience-description" rows="4" cols="4" placeholder="Tasks and responsibilities" class="form-control"></textarea> </div> <div class="form-group"> <label class="d-block">Recommendations:</label> <input name="recommendations" type="file" class="form-input-styled" data-fouc> <span class="form-text text-muted">Accepted formats: pdf, doc. Max file size 2Mb</span> </div> </div> </div> </fieldset> <h6>Additional info</h6> <fieldset> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label class="d-block">Applicant resume:</label> <input type="file" name="resume" class="form-input-styled" data-fouc> <span class="form-text text-muted">Accepted formats: pdf, doc. Max file size 2Mb</span> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Where did you find us?</label> <select name="source" data-placeholder="Choose an option..." class="form-control form-control-select2" data-fouc> <option></option> <option value="monster">Monster.com</option> <option value="linkedin">LinkedIn</option> <option value="google">Google</option> <option value="adwords">Google AdWords</option> <option value="other">Other source</option> </select> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Availability:</label> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="availability" class="form-input-styled" data-fouc> Immediately </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="availability" class="form-input-styled" data-fouc> 1 - 2 weeks </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="availability" class="form-input-styled" data-fouc> 3 - 4 weeks </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="availability" class="form-input-styled" data-fouc> More than 1 month </label> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Additional information:</label> <textarea name="additional-info" rows="5" cols="5" placeholder="If you want to add any info, do it here." class="form-control"></textarea> </div> </div> </div> </fieldset> </form> </div> <!-- /starting step --> <!-- Starting step --> <div class="card"> <div class="card-header bg-white header-elements-inline"> <h6 class="card-title">Enable all steps <span class="text-muted font-size-base ml-2">and make them clickable</span></h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <form class="wizard-form steps-enable-all" action="#" data-fouc> <h6>Personal data</h6> <fieldset> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Select location:</label> <select name="location" data-placeholder="Select position" class="form-control form-control-select2" data-fouc> <option></option> <optgroup label="North America"> <option value="1">United States</option> <option value="2">Canada</option> </optgroup> <optgroup label="Latin America"> <option value="3">Chile</option> <option value="4">Argentina</option> <option value="5">Colombia</option> <option value="6">Peru</option> </optgroup> <optgroup label="Europe"> <option value="8">Croatia</option> <option value="9">Hungary</option> <option value="10">Ukraine</option> <option value="11">Greece</option> </optgroup> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Select position:</label> <select name="position" data-placeholder="Select position" class="form-control form-control-select2" data-fouc> <option></option> <optgroup label="Developer Relations"> <option value="1">Sales Engineer</option> <option value="2">Ads Solutions Consultant</option> <option value="3">Technical Solutions Consultant</option> <option value="4">Business Intern</option> </optgroup> <optgroup label="Engineering &amp; Design"> <option value="5">Interaction Designer</option> <option value="6">Technical Program Manager</option> <option value="7">Software Engineer</option> <option value="8">Information Security Engineer</option> </optgroup> <optgroup label="Marketing &amp; Communications"> <option value="13">Media Outreach Manager</option> <option value="14">Research Manager</option> <option value="15">Marketing Intern</option> <option value="16">Business Intern</option> </optgroup> </select> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Applicant name:</label> <input type="text" name="name" class="form-control" placeholder="John Doe"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Email address:</label> <input type="email" name="email" class="form-control" placeholder="your@email.com"> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Phone #:</label> <input type="text" name="tel" class="form-control" placeholder="+99-99-9999-9999" data-mask="+99-99-9999-9999"> </div> </div> <div class="col-md-6"> <label>Date of birth:</label> <div class="row"> <div class="col-md-4"> <div class="form-group"> <select name="birth-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="1">January</option> <option value="2">February</option> <option value="3">March</option> <option value="4">April</option> <option value="5">May</option> <option value="6">June</option> <option value="7">July</option> <option value="8">August</option> <option value="9">September</option> <option value="10">October</option> <option value="11">November</option> <option value="12">December</option> </select> </div> </div> <div class="col-md-4"> <div class="form-group"> <select name="birth-day" data-placeholder="Day" class="form-control form-control-select2" data-fouc> <option></option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="...">...</option> <option value="31">31</option> </select> </div> </div> <div class="col-md-4"> <div class="form-group"> <select name="birth-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1">1980</option> <option value="2">1981</option> <option value="3">1982</option> <option value="4">1983</option> <option value="5">1984</option> <option value="6">1985</option> <option value="7">1986</option> <option value="8">1987</option> <option value="9">1988</option> <option value="10">1989</option> <option value="11">1990</option> </select> </div> </div> </div> </div> </div> </fieldset> <h6>Your education</h6> <fieldset> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>University:</label> <input type="text" name="university" placeholder="University name" class="form-control"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Country:</label> <select name="university-country" data-placeholder="Choose a Country..." class="form-control form-control-select2" data-fouc> <option></option> <option value="1">United States</option> <option value="2">France</option> <option value="3">Germany</option> <option value="4">Spain</option> </select> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Degree level:</label> <input type="text" name="degree-level" placeholder="Bachelor, Master etc." class="form-control"> </div> <div class="form-group"> <label>Specialization:</label> <input type="text" name="specialization" placeholder="Design, Development etc." class="form-control"> </div> </div> <div class="col-md-6"> <div class="row"> <div class="col-md-6"> <label>From:</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <select name="education-from-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="January">January</option> <option value="...">...</option> <option value="December">December</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <select name="education-from-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1995">1995</option> <option value="...">...</option> <option value="1980">1980</option> </select> </div> </div> </div> </div> <div class="col-md-6"> <label>To:</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <select name="education-to-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="January">January</option> <option value="...">...</option> <option value="December">December</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <select name="education-to-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1995">1995</option> <option value="...">...</option> <option value="1980">1980</option> </select> </div> </div> </div> </div> </div> <div class="form-group"> <label>Language of education:</label> <input type="text" name="education-language" placeholder="English, German etc." class="form-control"> </div> </div> </div> </fieldset> <h6>Your experience</h6> <fieldset> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Company:</label> <input type="text" name="experience-company" placeholder="Company name" class="form-control"> </div> <div class="form-group"> <label>Position:</label> <input type="text" name="experience-position" placeholder="Company name" class="form-control"> </div> <div class="row"> <div class="col-md-6"> <label>From:</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <select name="education-from-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="January">January</option> <option value="...">...</option> <option value="December">December</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <select name="education-from-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1995">1995</option> <option value="...">...</option> <option value="1980">1980</option> </select> </div> </div> </div> </div> <div class="col-md-6"> <label>To:</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <select name="education-to-month" data-placeholder="Month" class="form-control form-control-select2" data-fouc> <option></option> <option value="January">January</option> <option value="...">...</option> <option value="December">December</option> </select> </div> </div> <div class="col-md-6"> <div class="form-group"> <select name="education-to-year" data-placeholder="Year" class="form-control form-control-select2" data-fouc> <option></option> <option value="1995">1995</option> <option value="...">...</option> <option value="1980">1980</option> </select> </div> </div> </div> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Brief description:</label> <textarea name="experience-description" rows="4" cols="4" placeholder="Tasks and responsibilities" class="form-control"></textarea> </div> <div class="form-group"> <label class="d-block">Recommendations:</label> <input name="recommendations" type="file" class="form-input-styled" data-fouc> <span class="form-text text-muted">Accepted formats: pdf, doc. Max file size 2Mb</span> </div> </div> </div> </fieldset> <h6>Additional info</h6> <fieldset> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label class="d-block">Applicant resume:</label> <input type="file" name="resume" class="form-input-styled" data-fouc> <span class="form-text text-muted">Accepted formats: pdf, doc. Max file size 2Mb</span> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Where did you find us?</label> <select name="source" data-placeholder="Choose an option..." class="form-control form-control-select2" data-fouc> <option></option> <option value="monster">Monster.com</option> <option value="linkedin">LinkedIn</option> <option value="google">Google</option> <option value="adwords">Google AdWords</option> <option value="other">Other source</option> </select> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Availability:</label> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="availability" class="form-input-styled" data-fouc> Immediately </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="availability" class="form-input-styled" data-fouc> 1 - 2 weeks </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="availability" class="form-input-styled" data-fouc> 3 - 4 weeks </label> </div> <div class="form-check"> <label class="form-check-label"> <input type="radio" name="availability" class="form-input-styled" data-fouc> More than 1 month </label> </div> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Additional information:</label> <textarea name="additional-info" rows="5" cols="5" placeholder="If you want to add any info, do it here." class="form-control"></textarea> </div> </div> </div> </fieldset> </form> </div> <!-- /starting step --> <!-- Remote content source --> <div class="card"> <div class="card-header bg-white header-elements-inline"> <h6 class="card-title">Remote content source</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <form class="wizard-form steps-async" action="#" data-fouc> <h6>Personal data</h6> <fieldset data-mode="async" data-url="../../../../global_assets/demo_data/wizard/personal_data.html"></fieldset> <h6>Your education</h6> <fieldset data-mode="async" data-url="../../../../global_assets/demo_data/wizard/education.html"></fieldset> <h6>Your experience</h6> <fieldset data-mode="async" data-url="../../../../global_assets/demo_data/wizard/experience.html"></fieldset> <h6>Additional info</h6> <fieldset data-mode="async" data-url="../../../../global_assets/demo_data/wizard/additional.html"></fieldset> </form> </div> <!-- /remote content source --> </div> <!-- FIM form_wizard --> <!-- INICIO form_actions --> <div class="content"> <!-- Form action components --> <div class="mb-3"> <h6 class="mb-0 font-weight-semibold"> Form action components </h6> <span class="text-muted d-block">Form actions with mixed elements</span> </div> <div class="row"> <div class="col-md-4"> <!-- Left aligned buttons --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Left aligned buttons</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group"> <label>Your name:</label> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> <div class="form-group"> <label>Your password:</label> <input type="password" class="form-control" placeholder="Your strong password"> </div> <div class="form-group"> <label>Your message:</label> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> <div class="d-flex justify-content-start align-items-center"> <button type="submit" class="btn btn-light">Cancel</button> <button type="submit" class="btn bg-blue ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> <!-- /left aligned buttons --> <!-- Text + button --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Text + button</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group"> <label>Your name:</label> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> <div class="form-group"> <label>Your password:</label> <input type="password" class="form-control" placeholder="Your strong password"> </div> <div class="form-group"> <label>Your message:</label> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> <div class="d-flex justify-content-between align-items-center"> <span class="text-muted"><i class="icon-code"></i> &nbsp; Some HTML is supported</span> <button type="submit" class="btn bg-blue ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> <!-- /text + button --> <!-- Inline list + button --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Inline list + button</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group"> <label>Your name:</label> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> <div class="form-group"> <label>Your password:</label> <input type="password" class="form-control" placeholder="Your strong password"> </div> <div class="form-group"> <label>Your message:</label> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> <div class="d-flex justify-content-between align-items-center"> <div class="list-inline mb-0"> <a href="#" class="list-inline-item text-default">Support</a> <a href="#" class="list-inline-item text-default">Terms</a> <a href="#" class="list-inline-item text-default">Policy</a> </div> <button type="submit" class="btn bg-blue ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> <!-- /inline list + button --> <!-- Checkbox + button --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Checkbox + button</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group"> <label>Your name:</label> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> <div class="form-group"> <label>Your password:</label> <input type="password" class="form-control" placeholder="Your strong password"> </div> <div class="form-group"> <label>Your message:</label> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> <div class="d-flex justify-content-between align-items-center"> <div class="form-check form-check-inline"> <label class="form-check-label"> <input type="checkbox" class="form-control-styled" checked data-fouc> Save as template </label> </div> <button type="submit" class="btn bg-blue ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> <!-- /checkbox + button --> </div> <div class="col-md-4"> <!-- Right aligned buttons --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Right aligned buttons</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group"> <label>Your name:</label> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> <div class="form-group"> <label>Your password:</label> <input type="password" class="form-control" placeholder="Your strong password"> </div> <div class="form-group"> <label>Your message:</label> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> <div class="d-flex justify-content-end align-items-center"> <button type="submit" class="btn btn-light">Preview</button> <button type="submit" class="btn bg-blue ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> <!-- /right aligned buttons --> <!-- Text link + button --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Text link + button</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group"> <label>Your name:</label> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> <div class="form-group"> <label>Your password:</label> <input type="password" class="form-control" placeholder="Your strong password"> </div> <div class="form-group"> <label>Your message:</label> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> <div class="d-flex justify-content-between align-items-center"> <a href="#">Can't send message?</a> <button type="submit" class="btn bg-blue ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> <!-- /text link + button --> <!-- Icon list + button --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Icon list + button</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group"> <label>Your name:</label> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> <div class="form-group"> <label>Your password:</label> <input type="password" class="form-control" placeholder="Your strong password"> </div> <div class="form-group"> <label>Your message:</label> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> <div class="d-flex justify-content-between align-items-center"> <div class="list-icons"> <a href="#" class="list-icons-item mr-2"><i class="icon-github"></i></a> <a href="#" class="list-icons-item mr-2"><i class="icon-stackoverflow"></i></a> <a href="#" class="list-icons-item mr-2"><i class="icon-google-drive"></i></a> </div> <button type="submit" class="btn bg-blue ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> <!-- /icon list + button --> <!-- Switch + button --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Switch + button</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group"> <label>Your name:</label> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> <div class="form-group"> <label>Your password:</label> <input type="password" class="form-control" placeholder="Your strong password"> </div> <div class="form-group"> <label>Your message:</label> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> <div class="d-flex justify-content-between align-items-center"> <div class="form-check form-check-switchery mb-0"> <label class="form-check-label"> <input type="checkbox" class="form-control-switchery" checked data-fouc> Start discussion </label> </div> <button type="submit" class="btn bg-blue ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> <!-- /switch + button --> </div> <div class="col-md-4"> <!-- Left and right buttons --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Left/right buttons</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group"> <label>Your name:</label> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> <div class="form-group"> <label>Your password:</label> <input type="password" class="form-control" placeholder="Your strong password"> </div> <div class="form-group"> <label>Your message:</label> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> <div class="d-flex justify-content-between align-items-center"> <button type="submit" class="btn btn-light">Cancel</button> <button type="submit" class="btn bg-blue">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> <!-- /left and right buttons --> <!-- Status text + button --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Status text + button</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group"> <label>Your name:</label> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> <div class="form-group"> <label>Your password:</label> <input type="password" class="form-control" placeholder="Your strong password"> </div> <div class="form-group"> <label>Your message:</label> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> <div class="d-flex justify-content-between align-items-center"> <span><i class="icon-spinner2 spinner mr-2"></i> Processing...</span> <button type="submit" class="btn bg-blue ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> <!-- /status text + button --> <!-- Left alternate button --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Left alternate button</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group"> <label>Your name:</label> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> <div class="form-group"> <label>Your password:</label> <input type="password" class="form-control" placeholder="Your strong password"> </div> <div class="form-group"> <label>Your message:</label> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> <div class="d-flex justify-content-between align-items-center"> <a href="#" class="btn btn-light btn-icon"><i class="icon-help"></i></a> <div class="d-inline-flex"> <button type="reset" class="btn btn-light">Cancel</button> <button type="submit" class="btn bg-blue ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </div> </form> </div> </div> <!-- /left alternate button --> <!-- Select + button --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Select + button</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group"> <label>Your name:</label> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> <div class="form-group"> <label>Your password:</label> <input type="password" class="form-control" placeholder="Your strong password"> </div> <div class="form-group"> <label>Your message:</label> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> <div class="d-lg-flex justify-content-between align-items-center flex-wrap"> <div class="wmin-lg-200 mb-3 mb-lg-0"> <select class="form-control form-control-select2" data-placeholder="Actions" data-fouc> <option></option> <option value="1">Send to all contacts</option> <option value="2">Send to my contacts</option> <option value="3">Save as draft</option> <option value="4">Don't have in Sent</option> </select> </div> <button type="submit" class="btn bg-blue ml-lg-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> <!-- /select + button --> </div> </div> <!-- /form action components --> <!-- Form actions positioning --> <div class="mb-3 pt-2"> <h6 class="mb-0 font-weight-semibold"> Form actions alignment </h6> <span class="text-muted d-block">Using text or flexbox utility classes</span> </div> <div class="row"> <div class="col-md-4"> <!-- Left alignment --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Left aligned</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group"> <label>Your name:</label> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> <div class="form-group"> <label>Your password:</label> <input type="password" class="form-control" placeholder="Your strong password"> </div> <div class="form-group"> <label>Your message:</label> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> <button type="submit" class="btn bg-teal-400">Submit form <i class="icon-paperplane ml-2"></i></button> </form> </div> </div> <!-- /left alignment --> </div> <div class="col-md-4"> <!-- Centered buttons --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Centered actions</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group"> <label>Your name:</label> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> <div class="form-group"> <label>Your password:</label> <input type="password" class="form-control" placeholder="Your strong password"> </div> <div class="form-group"> <label>Your message:</label> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> <div class="text-center"> <button type="submit" class="btn bg-teal-400">Submit form <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> <!-- /centered buttons --> </div> <div class="col-md-4"> <!-- Right alignment --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Right aligned</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group"> <label>Your name: </label> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> <div class="form-group"> <label>Your password: </label> <input type="password" class="form-control" placeholder="Your strong password"> </div> <div class="form-group"> <label>Your message: </label> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> <div class="text-right"> <button type="submit" class="btn bg-teal-400">Submit form <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> <!-- /right alignment --> </div> </div> <!-- /form actions positioning --> <!-- Optional styles --> <div class="mb-3 pt-2"> <h6 class="mb-0 font-weight-semibold"> Optional styles </h6> <span class="text-muted d-block">White, grey and custom backgrounds</span> </div> <div class="row"> <div class="col-md-4"> <!-- Grey background --> <form action="#"> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Grey background</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="form-group"> <label>Your name:</label> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> <div class="form-group"> <label>Your password:</label> <input type="password" class="form-control" placeholder="Your strong password"> </div> <div class="form-group mb-0"> <label>Your message:</label> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> </div> <div class="card-footer d-flex justify-content-between align-items-center"> <button type="submit" class="btn btn-light">Cancel</button> <button type="submit" class="btn bg-blue">Submit form <i class="icon-paperplane ml-2"></i></button> </div> </div> </form> <!-- /grey background --> </div> <div class="col-md-4"> <!-- White background --> <form action="#"> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">White background</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="form-group"> <label>Your name:</label> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> <div class="form-group"> <label>Your password:</label> <input type="password" class="form-control" placeholder="Your strong password"> </div> <div class="form-group mb-0"> <label>Your message:</label> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> </div> <div class="card-footer d-flex justify-content-between align-items-center bg-white"> <button type="submit" class="btn btn-light">Cancel</button> <button type="submit" class="btn bg-blue">Submit form <i class="icon-paperplane ml-2"></i></button> </div> </div> </form> <!-- /white background --> </div> <div class="col-md-4"> <!-- Custom background --> <form action="#"> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Custom background</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <div class="form-group"> <label>Your name:</label> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> <div class="form-group"> <label>Your password:</label> <input type="password" class="form-control" placeholder="Your strong password"> </div> <div class="form-group mb-0"> <label>Your message:</label> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> </div> <div class="card-footer d-flex justify-content-between align-items-center bg-teal-400 border-top-0"> <button type="submit" class="btn bg-transparent text-white border-white border-2">Cancel</button> <button type="submit" class="btn btn-outline bg-white text-white border-white border-2">Submit form <i class="icon-paperplane ml-2"></i></button> </div> </div> </form> <!-- /custom background --> </div> </div> <!-- /optional styles --> <!-- In horizontal forms --> <div class="mb-3 pt-2"> <h6 class="mb-0 font-weight-semibold"> In horizontal forms </h6> <span class="text-muted d-block">Styling and alignment options</span> </div> <div class="row"> <div class="col-md-6"> <!-- Left buttons --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Left buttons</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group row"> <label class="col-form-label col-lg-2">Your name:</label> <div class="col-lg-10"> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Your password:</label> <div class="col-lg-10"> <input type="password" class="form-control" placeholder="Your strong password"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Your message:</label> <div class="col-lg-10"> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> </div> <div class="form-group row mb-0"> <div class="col-lg-10 ml-lg-auto"> <button type="submit" class="btn btn-light">Cancel</button> <button type="submit" class="btn bg-blue ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </div> </form> </div> </div> <!-- /left buttons --> <!-- Left and right buttons --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Left and right buttons</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group row"> <label class="col-form-label col-lg-2">Your name:</label> <div class="col-lg-10"> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Your password:</label> <div class="col-lg-10"> <input type="password" class="form-control" placeholder="Your strong password"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Your message:</label> <div class="col-lg-10"> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> </div> <div class="form-group row mb-0"> <div class="col-lg-10 ml-lg-auto"> <div class="d-flex justify-content-between align-items-center"> <button type="submit" class="btn btn-light">Cancel</button> <button type="submit" class="btn bg-blue">Submit <i class="icon-paperplane ml-2"></i></button> </div> </div> </div> </form> </div> </div> <!-- /left and right buttons --> </div> <div class="col-md-6"> <!-- Right buttons --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Right buttons</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group row"> <label class="col-form-label col-lg-2">Your name:</label> <div class="col-lg-10"> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Your password:</label> <div class="col-lg-10"> <input type="password" class="form-control" placeholder="Your strong password"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Your message:</label> <div class="col-lg-10"> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> </div> <div class="form-group row mb-0"> <div class="col-lg-10 ml-lg-auto text-right"> <button type="submit" class="btn btn-light">Cancel</button> <button type="submit" class="btn bg-blue ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </div> </form> </div> </div> <!-- /right buttons --> <!-- Left and right buttons (reversed) --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Left and right buttons (reversed)</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group row"> <label class="col-form-label col-lg-2">Your name:</label> <div class="col-lg-10"> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Your password:</label> <div class="col-lg-10"> <input type="password" class="form-control" placeholder="Your strong password"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Your message:</label> <div class="col-lg-10"> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> </div> <div class="form-group row mb-0"> <div class="col-lg-10 ml-lg-auto"> <div class="d-flex justify-content-between align-items-center"> <button type="submit" class="btn bg-blue">Submit <i class="icon-paperplane ml-2"></i></button> <button type="submit" class="btn btn-light">Cancel</button> </div> </div> </div> </form> </div> </div> <!-- /left and right buttons (reversed) --> </div> </div> <!-- /in horizontal forms --> <!-- Optional button styles --> <div class="mb-3 pt-2"> <h6 class="mb-0 font-weight-semibold"> Optional button styles </h6> <span class="text-muted d-block">Action buttons placement and spacing</span> </div> <div class="row"> <div class="col-md-6"> <!-- Grey background, left button spacing --> <form action="#"> <div class="card"> <div class="card-header bg-white header-elements-inline"> <h6 class="card-title">Grey bg and left spacing</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-footer"> <div class="row"> <div class="col-lg-10 ml-lg-auto"> <div class="d-flex justify-content-between align-items-center"> <button type="submit" class="btn btn-light">Cancel</button> <button type="submit" class="btn bg-blue ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </div> </div> </div> <div class="card-body"> <div class="form-group row"> <label class="col-form-label col-lg-2">Your name:</label> <div class="col-lg-10"> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Your password:</label> <div class="col-lg-10"> <input type="password" class="form-control" placeholder="Your strong password"> </div> </div> <div class="form-group row mb-0"> <label class="col-form-label col-lg-2">Your message:</label> <div class="col-lg-10"> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> </div> </div> <div class="card-footer"> <div class="row"> <div class="col-lg-10 ml-lg-auto"> <div class="d-flex justify-content-between align-items-center"> <button type="submit" class="btn btn-light">Cancel</button> <button type="submit" class="btn bg-blue ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </div> </div> </div> </div> </form> <!-- /grey background, left button spacing --> <!-- Grey background, no left button spacing --> <form action="#"> <div class="card"> <div class="card-header bg-white header-elements-inline"> <h6 class="card-title">Grey background</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-footer"> <div class="d-flex justify-content-between align-items-center"> <button type="submit" class="btn btn-light">Cancel</button> <button type="submit" class="btn bg-blue ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </div> <div class="card-body"> <div class="form-group row"> <label class="col-form-label col-lg-2">Your name:</label> <div class="col-lg-10"> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Your password:</label> <div class="col-lg-10"> <input type="password" class="form-control" placeholder="Your strong password"> </div> </div> <div class="form-group row mb-0"> <label class="col-form-label col-lg-2">Your message:</label> <div class="col-lg-10"> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> </div> </div> <div class="card-footer"> <div class="d-flex justify-content-between align-items-center"> <button type="submit" class="btn btn-light">Cancel</button> <button type="submit" class="btn bg-blue ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </div> </div> </form> <!-- /grey background, no left button spacing --> </div> <div class="col-md-6"> <!-- White background, left button spacing --> <form action="#"> <div class="card"> <div class="card-header bg-white header-elements-inline"> <h6 class="card-title">White bg and left spacing</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-footer bg-white"> <div class="row"> <div class="col-lg-10 ml-lg-auto"> <div class="d-flex justify-content-between align-items-center"> <button type="submit" class="btn btn-light">Cancel</button> <button type="submit" class="btn bg-blue ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </div> </div> </div> <div class="card-body"> <div class="form-group row"> <label class="col-form-label col-lg-2">Your name:</label> <div class="col-lg-10"> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Your password:</label> <div class="col-lg-10"> <input type="password" class="form-control" placeholder="Your strong password"> </div> </div> <div class="form-group row mb-0"> <label class="col-form-label col-lg-2">Your message:</label> <div class="col-lg-10"> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> </div> </div> <div class="card-footer bg-white"> <div class="row"> <div class="col-lg-10 ml-lg-auto"> <div class="d-flex justify-content-between align-items-center"> <button type="submit" class="btn btn-light">Cancel</button> <button type="submit" class="btn bg-blue ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </div> </div> </div> </div> </form> <!-- /white background, left button spacing --> <!-- White background, no left button spacing --> <form action="#"> <div class="card"> <div class="card-header bg-white header-elements-inline"> <h6 class="card-title">White background</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-footer bg-white"> <div class="d-flex justify-content-between align-items-center"> <button type="submit" class="btn btn-light">Cancel</button> <button type="submit" class="btn bg-blue ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </div> <div class="card-body"> <div class="form-group row"> <label class="col-form-label col-lg-2">Your name:</label> <div class="col-lg-10"> <input type="text" class="form-control" placeholder="Eugene Kopyov"> </div> </div> <div class="form-group row"> <label class="col-form-label col-lg-2">Your password:</label> <div class="col-lg-10"> <input type="password" class="form-control" placeholder="Your strong password"> </div> </div> <div class="form-group row mb-0"> <label class="col-form-label col-lg-2">Your message:</label> <div class="col-lg-10"> <textarea rows="3" cols="3" class="form-control" placeholder="Enter your message here"></textarea> </div> </div> </div> <div class="card-footer bg-white"> <div class="d-flex justify-content-between align-items-center"> <button type="submit" class="btn btn-light">Cancel</button> <button type="submit" class="btn bg-blue ml-3">Submit <i class="icon-paperplane ml-2"></i></button> </div> </div> </div> </form> <!-- /white background, no left button spacing --> </div> </div> <!-- /optional button styles --> </div> <!-- FIM form_actions --> <!-- INICIO form_inputs_grid --> <div class="content"> <!-- Default grid --> <div class="row"> <div class="col-lg-6"> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Default form</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="row"> <div class="col-md-2"> <div class="form-group"> <input type="text" class="form-control" placeholder="col-md-2"> </div> </div> <div class="col-md-10"> <div class="form-group"> <input type="text" class="form-control" placeholder="col-md-10"> </div> </div> </div> <div class="row"> <div class="col-md-3"> <div class="form-group"> <input type="text" class="form-control" placeholder="col-md-3"> </div> </div> <div class="col-md-9"> <div class="form-group"> <input type="text" class="form-control" placeholder="col-md-9"> </div> </div> </div> <div class="row"> <div class="col-md-4"> <div class="form-group"> <input type="text" class="form-control" placeholder="col-md-4"> </div> </div> <div class="col-md-8"> <div class="form-group"> <input type="text" class="form-control" placeholder="col-md-8"> </div> </div> </div> <div class="row"> <div class="col-md-5"> <div class="form-group"> <input type="text" class="form-control" placeholder="col-md-5"> </div> </div> <div class="col-md-7"> <div class="form-group"> <input type="text" class="form-control" placeholder="col-md-7"> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <input type="text" class="form-control" placeholder="col-md-6"> </div> </div> <div class="col-md-6"> <div class="form-group"> <input type="text" class="form-control" placeholder="col-md-6"> </div> </div> </div> <div class="text-right"> <button type="submit" class="btn btn-primary">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> </div> <div class="col-lg-6"> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Horizontal form</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group row"> <div class="col-md-2"> <input type="text" class="form-control" placeholder="col-md-2"> </div> <div class="col-md-10"> <input type="text" class="form-control" placeholder="col-md-10"> </div> </div> <div class="form-group row"> <div class="col-md-3"> <input type="text" class="form-control" placeholder="col-md-3"> </div> <div class="col-md-9"> <input type="text" class="form-control" placeholder="col-md-9"> </div> </div> <div class="form-group row"> <div class="col-md-4"> <input type="text" class="form-control" placeholder="col-md-4"> </div> <div class="col-md-8"> <input type="text" class="form-control" placeholder="col-md-8"> </div> </div> <div class="form-group row"> <div class="col-md-5"> <input type="text" class="form-control" placeholder="col-md-5"> </div> <div class="col-md-7"> <input type="text" class="form-control" placeholder="col-md-7"> </div> </div> <div class="form-group row"> <div class="col-md-6"> <input type="text" class="form-control" placeholder="col-md-6"> </div> <div class="col-md-6"> <input type="text" class="form-control" placeholder="col-md-6"> </div> </div> <div class="text-right"> <button type="submit" class="btn btn-primary">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> </div> </div> <!-- /default grid --> <!-- Alignment --> <div class="row"> <div class="col-lg-6"> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Right inputs</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group row"> <div class="col-md-12"> <input type="text" class="form-control" placeholder=".col-md-12".> </div> </div> <div class="form-group row"> <div class="col-md-11 ml-md-auto"> <input type="text" class="form-control" placeholder=".col-md-11 .ml-md-auto"> </div> </div> <div class="form-group row"> <div class="col-md-10 ml-md-auto"> <input type="text" class="form-control" placeholder=".col-md-10 .ml-md-auto"> </div> </div> <div class="form-group row"> <div class="col-md-9 ml-md-auto"> <input type="text" class="form-control" placeholder=".col-md-9 .ml-md-auto"> </div> </div> <div class="form-group row"> <div class="col-md-8 ml-md-auto"> <input type="text" class="form-control" placeholder=".col-md-8 .ml-md-auto"> </div> </div> <div class="form-group row"> <div class="col-md-7 ml-md-auto"> <input type="text" class="form-control" placeholder=".col-md-7 .ml-md-auto"> </div> </div> <div class="form-group row"> <div class="col-md-6 ml-md-auto"> <input type="text" class="form-control" placeholder=".col-md-6 .ml-md-auto"> </div> </div> <div class="form-group row"> <div class="col-md-5 ml-md-auto"> <input type="text" class="form-control" placeholder=".col-md-5 .ml-md-auto"> </div> </div> <div class="form-group row"> <div class="col-md-4 ml-md-auto"> <input type="text" class="form-control" placeholder=".col-md-4 .ml-md-auto"> </div> </div> <div class="text-right"> <button type="submit" class="btn btn-primary">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> </div> <div class="col-lg-6"> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Left inputs</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group row"> <div class="col-md-12"> <input type="text" class="form-control" placeholder="col-md-12"> </div> </div> <div class="form-group row"> <div class="col-md-11"> <input type="text" class="form-control" placeholder="col-md-11"> </div> </div> <div class="form-group row"> <div class="col-md-10"> <input type="text" class="form-control" placeholder="col-md-10"> </div> </div> <div class="form-group row"> <div class="col-md-9"> <input type="text" class="form-control" placeholder="col-md-9"> </div> </div> <div class="form-group row"> <div class="col-md-8"> <input type="text" class="form-control" placeholder="col-md-8"> </div> </div> <div class="form-group row"> <div class="col-md-7"> <input type="text" class="form-control" placeholder="col-md-7"> </div> </div> <div class="form-group row"> <div class="col-md-6"> <input type="text" class="form-control" placeholder="col-md-6"> </div> </div> <div class="form-group row"> <div class="col-md-5"> <input type="text" class="form-control" placeholder="col-md-5"> </div> </div> <div class="form-group row"> <div class="col-md-4"> <input type="text" class="form-control" placeholder="col-md-4"> </div> </div> <button type="submit" class="btn btn-primary">Submit <i class="icon-paperplane ml-2"></i></button> </form> </div> </div> </div> </div> <!-- /alignment --> <!-- Centered inputs --> <div class="row"> <div class="col-lg-6"> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Centered horizontal inputs</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group row"> <label class="col-form-label col-lg-3 text-lg-right">Label</label> <div class="col-lg-9"> <input type="text" class="form-control" placeholder="Full width"> </div> </div> <div class="form-group row"> <div class="col-lg-10 mx-lg-auto"> <div class="row"> <label class="col-form-label col-lg-3 text-lg-right">Label</label> <div class="col-lg-9"> <input type="text" class="form-control" placeholder="col-lg-10 mx-lg-auto"> </div> </div> </div> </div> <div class="form-group row"> <div class="col-lg-8 mx-lg-auto"> <div class="row"> <label class="col-form-label col-lg-3 text-lg-right">Label</label> <div class="col-lg-9"> <input type="text" class="form-control" placeholder="col-lg-8 mx-lg-auto"> </div> </div> </div> </div> <div class="form-group row"> <div class="col-lg-6 mx-lg-auto"> <div class="row"> <label class="col-form-label col-lg-3 text-lg-right">Label</label> <div class="col-lg-9"> <input type="text" class="form-control" placeholder="col-lg-6 mx-lg-auto"> </div> </div> </div> </div> <div class="form-group row"> <div class="col-lg-4 mx-lg-auto"> <div class="row"> <label class="col-form-label col-lg-4 text-lg-right">Label</label> <div class="col-lg-8"> <input type="text" class="form-control" placeholder="col-lg-4 mx-lg-auto"> </div> </div> </div> </div> <div class="text-center"> <button type="submit" class="btn btn-primary">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> </div> <div class="col-lg-6"> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Centered vertical inputs</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="row"> <div class="col-lg-10 mx-lg-auto"> <div class="form-group"> <label>Row label</label> <input type="text" class="form-control" placeholder="col-lg-10 mx-lg-auto"> </div> </div> </div> <div class="row"> <div class="col-lg-8 mx-lg-auto"> <div class="form-group"> <label>Row label</label> <input type="text" class="form-control" placeholder="col-lg-8 mx-lg-auto"> </div> </div> </div> <div class="row"> <div class="col-lg-6 mx-lg-auto"> <div class="form-group"> <label>Row label</label> <input type="text" class="form-control" placeholder="col-lg-6 mx-lg-auto"> </div> </div> </div> <div class="row"> <div class="col-lg-4 mx-lg-auto"> <div class="form-group"> <label>Row label</label> <input type="text" class="form-control" placeholder="col-lg-4 mx-lg-auto"> </div> </div> </div> <div class="text-center"> <button type="submit" class="btn btn-primary">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> </div> </div> <!-- /centered inputs --> <!-- Row and input labels (default form) --> <div class="row"> <div class="col-lg-6"> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Vertical row label</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <label>Label</label> <div class="row"> <div class="col-md-2"> <div class="form-group"> <input type="text" class="form-control" placeholder="col-md-2"> </div> </div> <div class="col-md-10"> <div class="form-group"> <input type="text" class="form-control" placeholder="col-md-10"> </div> </div> </div> <label>Label</label> <div class="row"> <div class="col-md-3"> <div class="form-group"> <input type="text" class="form-control" placeholder="col-md-3"> </div> </div> <div class="col-md-9"> <div class="form-group"> <input type="text" class="form-control" placeholder="col-md-9"> </div> </div> </div> <label>Label</label> <div class="row"> <div class="col-md-4"> <div class="form-group"> <input type="text" class="form-control" placeholder="col-md-4"> </div> </div> <div class="col-md-8"> <div class="form-group"> <input type="text" class="form-control" placeholder="col-md-8"> </div> </div> </div> <label>Label</label> <div class="row"> <div class="col-md-5"> <div class="form-group"> <input type="text" class="form-control" placeholder="col-md-5"> </div> </div> <div class="col-md-7"> <div class="form-group"> <input type="text" class="form-control" placeholder="col-md-7"> </div> </div> </div> <label>Label</label> <div class="row"> <div class="col-md-6"> <div class="form-group"> <input type="text" class="form-control" placeholder="col-md-6"> </div> </div> <div class="col-md-6"> <div class="form-group"> <input type="text" class="form-control" placeholder="col-md-6"> </div> </div> </div> <div class="text-right"> <button type="submit" class="btn btn-primary">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> </div> <div class="col-lg-6"> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Vertical input label</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="row"> <div class="col-md-2"> <div class="form-group"> <label>Label</label> <input type="text" class="form-control" placeholder="col-md-2"> </div> </div> <div class="col-md-10"> <div class="form-group"> <label>Label</label> <input type="text" class="form-control" placeholder="col-md-10"> </div> </div> </div> <div class="row"> <div class="col-md-3"> <div class="form-group"> <label>Label</label> <input type="text" class="form-control" placeholder="col-md-3"> </div> </div> <div class="col-md-9"> <div class="form-group"> <label>Label</label> <input type="text" class="form-control" placeholder="col-md-9"> </div> </div> </div> <div class="row"> <div class="col-md-4"> <div class="form-group"> <label>Label</label> <input type="text" class="form-control" placeholder="col-md-4"> </div> </div> <div class="col-md-8"> <div class="form-group"> <label>Label</label> <input type="text" class="form-control" placeholder="col-md-8"> </div> </div> </div> <div class="row"> <div class="col-md-5"> <div class="form-group"> <label>Label</label> <input type="text" class="form-control" placeholder="col-md-5"> </div> </div> <div class="col-md-7"> <div class="form-group"> <label>Label</label> <input type="text" class="form-control" placeholder="col-md-7"> </div> </div> </div> <div class="row"> <div class="col-md-6"> <div class="form-group"> <label>Label</label> <input type="text" class="form-control" placeholder="col-md-6"> </div> </div> <div class="col-md-6"> <div class="form-group"> <label>Label</label> <input type="text" class="form-control" placeholder="col-md-6"> </div> </div> </div> <div class="text-right"> <button type="submit" class="btn btn-primary">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> </div> </div> <!-- /row and input labels (default form) --> <!-- Row label (horizontal form) --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Horizontal row labels</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group row"> <label class="col-lg-2 col-form-label">Label</label> <div class="col-lg-10"> <div class="row"> <div class="col-md-1"> <input type="text" class="form-control" placeholder="col-md-1"> </div> <div class="col-md-11"> <input type="text" class="form-control" placeholder="col-md-11"> </div> </div> </div> </div> <div class="form-group row"> <label class="col-lg-2 col-form-label">Label</label> <div class="col-lg-10"> <div class="row"> <div class="col-md-2"> <input type="text" class="form-control" placeholder="col-md-2"> </div> <div class="col-md-10"> <input type="text" class="form-control" placeholder="col-md-10"> </div> </div> </div> </div> <div class="form-group row"> <label class="col-lg-2 col-form-label">Label</label> <div class="col-lg-10"> <div class="row"> <div class="col-md-3"> <input type="text" class="form-control" placeholder="col-md-3"> </div> <div class="col-md-9"> <input type="text" class="form-control" placeholder="col-md-9"> </div> </div> </div> </div> <div class="form-group row"> <label class="col-lg-2 col-form-label">Label</label> <div class="col-lg-10"> <div class="row"> <div class="col-md-4"> <input type="text" class="form-control" placeholder="col-md-4"> </div> <div class="col-md-8"> <input type="text" class="form-control" placeholder="col-md-8"> </div> </div> </div> </div> <div class="form-group row"> <label class="col-lg-2 col-form-label">Label</label> <div class="col-lg-10"> <div class="row"> <div class="col-md-5"> <input type="text" class="form-control" placeholder="col-md-5"> </div> <div class="col-md-7"> <input type="text" class="form-control" placeholder="col-md-7"> </div> </div> </div> </div> <div class="form-group row"> <label class="col-lg-2 col-form-label">Label</label> <div class="col-lg-10"> <div class="row"> <div class="col-md-6"> <input type="text" class="form-control" placeholder="col-md-6"> </div> <div class="col-md-6"> <input type="text" class="form-control" placeholder="col-md-6"> </div> </div> </div> </div> <div class="text-right"> <button type="submit" class="btn btn-primary">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> <!-- /row label (horizontal form) --> <!-- Input label (horizontal form) --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Horizontal input labels</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group row"> <div class="col-lg-2"> <div class="row"> <label class="col-md-4 col-form-label text-lg-right">Label: </label> <div class="col-md-8"> <input type="text" class="form-control" placeholder="col-md-2"> </div> </div> </div> <div class="col-lg-10"> <div class="row"> <label class="col-md-4 col-form-label text-lg-right">Label: </label> <div class="col-md-8"> <input type="text" class="form-control" placeholder="col-md-10"> </div> </div> </div> </div> <div class="form-group row"> <div class="col-lg-3"> <div class="row"> <label class="col-md-4 col-form-label text-lg-right">Label: </label> <div class="col-md-8"> <input type="text" class="form-control" placeholder="col-md-3"> </div> </div> </div> <div class="col-lg-9"> <div class="row"> <label class="col-md-4 col-form-label text-lg-right">Label: </label> <div class="col-md-8"> <input type="text" class="form-control" placeholder="col-md-9"> </div> </div> </div> </div> <div class="form-group row"> <div class="col-lg-4"> <div class="row"> <label class="col-md-4 col-form-label text-lg-right">Label: </label> <div class="col-md-8"> <input type="text" class="form-control" placeholder="col-md-4"> </div> </div> </div> <div class="col-lg-8"> <div class="row"> <label class="col-md-4 col-form-label text-lg-right">Label: </label> <div class="col-md-8"> <input type="text" class="form-control" placeholder="col-md-8"> </div> </div> </div> </div> <div class="form-group row"> <div class="col-lg-5"> <div class="row"> <label class="col-md-4 col-form-label text-lg-right">Label: </label> <div class="col-md-8"> <input type="text" class="form-control" placeholder="col-md-5"> </div> </div> </div> <div class="col-lg-7"> <div class="row"> <label class="col-md-4 col-form-label text-lg-right">Label: </label> <div class="col-md-8"> <input type="text" class="form-control" placeholder="col-md-7"> </div> </div> </div> </div> <div class="form-group row"> <div class="col-lg-6"> <div class="row"> <label class="col-md-4 col-form-label text-lg-right">Label: </label> <div class="col-md-8"> <input type="text" class="form-control" placeholder="col-md-6"> </div> </div> </div> <div class="col-lg-6"> <div class="row"> <label class="col-md-4 col-form-label text-lg-right">Label: </label> <div class="col-md-8"> <input type="text" class="form-control" placeholder="col-md-6"> </div> </div> </div> </div> <div class="text-right"> <button type="submit" class="btn btn-primary">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> <!-- /input label (horizontal form) --> <!-- Multiple row inputs (vertical) --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Multiple vertical inputs</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <label>First form group</label> <div class="row"> <div class="col-md-4"> <div class="form-group"> <input type="text" class="form-control" placeholder="First row, first input"> </div> <div class="form-group"> <input type="text" class="form-control" placeholder="Second row, first input"> </div> </div> <div class="col-md-8"> <div class="form-group"> <input type="text" class="form-control" placeholder="First row, second input"> </div> <div class="form-group"> <input type="text" class="form-control" placeholder="Second row, second input"> </div> </div> </div> <label>Second form group</label> <div class="row"> <div class="col-md-8"> <div class="form-group"> <input type="text" class="form-control" placeholder="First row, first input"> </div> <div class="form-group"> <input type="text" class="form-control" placeholder="Second row, first input"> </div> </div> <div class="col-md-4"> <div class="form-group"> <input type="text" class="form-control" placeholder="First row, second input"> </div> <div class="form-group"> <input type="text" class="form-control" placeholder="Second row, second input"> </div> </div> </div> <div class="text-right"> <button type="submit" class="btn btn-primary">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> <!-- /multiple row inputs (vertical) --> <!-- Multiple row inputs (horizontal) --> <div class="card"> <div class="card-header header-elements-inline"> <h6 class="card-title">Multiple horizontal inputs</h6> <div class="header-elements"> <div class="list-icons"> <a class="list-icons-item" data-action="collapse"></a> <a class="list-icons-item" data-action="reload"></a> <a class="list-icons-item" data-action="remove"></a> </div> </div> </div> <div class="card-body"> <form action="#"> <div class="form-group row"> <label class="col-lg-2 col-form-label">First form group</label> <div class="col-lg-10"> <div class="row"> <div class="col-md-4"> <div class="form-group"> <input type="text" class="form-control" placeholder="First row, first input"> </div> <div class="form-group"> <input type="text" class="form-control" placeholder="Second row, first input"> </div> </div> <div class="col-md-8"> <div class="form-group"> <input type="text" class="form-control" placeholder="First row, second input"> </div> <div class="form-group"> <input type="text" class="form-control" placeholder="Second row, second input"> </div> </div> </div> </div> </div> <div class="form-group row"> <label class="col-lg-2 col-form-label">First form group</label> <div class="col-lg-10"> <div class="row"> <div class="col-md-8"> <div class="form-group"> <input type="text" class="form-control" placeholder="First row, first input"> </div> <div class="form-group"> <input type="text" class="form-control" placeholder="Second row, first input"> </div> </div> <div class="col-md-4"> <div class="form-group"> <input type="text" class="form-control" placeholder="First row, second input"> </div> <div class="form-group"> <input type="text" class="form-control" placeholder="Second row, second input"> </div> </div> </div> </div> </div> <div class="text-right"> <button type="submit" class="btn btn-primary">Submit <i class="icon-paperplane ml-2"></i></button> </div> </form> </div> </div> <!-- /multiple row inputs (horizontal) --> </div> <!-- FIM form_inputs_grid --> </div> <!-- /main content -->
55.507923
597
0.38567
e9058015529870e0cf2e5a1b17cf8761fac33c90
2,200
dart
Dart
lib/src/android/com/baidu/mapapi/search/poi/PoiFilter/SortName/HotelSortName.g.dart
yohom/bmap_map_fluttify
5cf8728b1eccd948d3487aace85d5f2349828285
[ "Apache-2.0" ]
null
null
null
lib/src/android/com/baidu/mapapi/search/poi/PoiFilter/SortName/HotelSortName.g.dart
yohom/bmap_map_fluttify
5cf8728b1eccd948d3487aace85d5f2349828285
[ "Apache-2.0" ]
null
null
null
lib/src/android/com/baidu/mapapi/search/poi/PoiFilter/SortName/HotelSortName.g.dart
yohom/bmap_map_fluttify
5cf8728b1eccd948d3487aace85d5f2349828285
[ "Apache-2.0" ]
null
null
null
// ignore_for_file: non_constant_identifier_names, camel_case_types, missing_return, unused_import, unused_local_variable, dead_code, unnecessary_cast ////////////////////////////////////////////////////////// // GENERATED BY FLUTTIFY. DO NOT EDIT IT. ////////////////////////////////////////////////////////// enum com_baidu_mapapi_search_poi_PoiFilter_SortName_HotelSortName { DEFAULT /* null */, HOTEL_PRICE /* null */, HOTEL_DISTANCE /* null */, HOTEL_TOTAL_SCORE /* null */, HOTEL_LEVEL /* null */, HOTEL_HEALTH_SCORE /* null */ } extension com_baidu_mapapi_search_poi_PoiFilter_SortName_HotelSortNameToX on com_baidu_mapapi_search_poi_PoiFilter_SortName_HotelSortName { int toValue() { switch (this) { case com_baidu_mapapi_search_poi_PoiFilter_SortName_HotelSortName.DEFAULT: return com_baidu_mapapi_search_poi_PoiFilter_SortName_HotelSortName.DEFAULT.index + 0; case com_baidu_mapapi_search_poi_PoiFilter_SortName_HotelSortName.HOTEL_PRICE: return com_baidu_mapapi_search_poi_PoiFilter_SortName_HotelSortName.HOTEL_PRICE.index + 0; case com_baidu_mapapi_search_poi_PoiFilter_SortName_HotelSortName.HOTEL_DISTANCE: return com_baidu_mapapi_search_poi_PoiFilter_SortName_HotelSortName.HOTEL_DISTANCE.index + 0; case com_baidu_mapapi_search_poi_PoiFilter_SortName_HotelSortName.HOTEL_TOTAL_SCORE: return com_baidu_mapapi_search_poi_PoiFilter_SortName_HotelSortName.HOTEL_TOTAL_SCORE.index + 0; case com_baidu_mapapi_search_poi_PoiFilter_SortName_HotelSortName.HOTEL_LEVEL: return com_baidu_mapapi_search_poi_PoiFilter_SortName_HotelSortName.HOTEL_LEVEL.index + 0; case com_baidu_mapapi_search_poi_PoiFilter_SortName_HotelSortName.HOTEL_HEALTH_SCORE: return com_baidu_mapapi_search_poi_PoiFilter_SortName_HotelSortName.HOTEL_HEALTH_SCORE.index + 0; default: return 0; } } } extension com_baidu_mapapi_search_poi_PoiFilter_SortName_HotelSortNameFromX on int { com_baidu_mapapi_search_poi_PoiFilter_SortName_HotelSortName tocom_baidu_mapapi_search_poi_PoiFilter_SortName_HotelSortName() { switch (this) { default: return com_baidu_mapapi_search_poi_PoiFilter_SortName_HotelSortName.values[this + 0]; } } }
61.111111
189
0.801818
181ae55cf31647f207087fc957603844b57762ec
3,245
rs
Rust
src/main.rs
agentjsmith/aoc21day8
34490bc82c88d4dd826fa3db2908430908fb3979
[ "Unlicense" ]
null
null
null
src/main.rs
agentjsmith/aoc21day8
34490bc82c88d4dd826fa3db2908430908fb3979
[ "Unlicense" ]
null
null
null
src/main.rs
agentjsmith/aoc21day8
34490bc82c88d4dd826fa3db2908430908fb3979
[ "Unlicense" ]
null
null
null
#![feature(let_else)] pub mod digit; pub mod segment; pub mod sevensegdecoder; use itertools::Itertools; use regex::Regex; use std::{env, fs::File, io::Read}; #[derive(Debug)] struct Puzzle<'a> { inputs: Vec<&'a str>, outputs: Vec<&'a str>, } impl<'a> Puzzle<'a> { fn new(line: &'a str) -> Option<Puzzle<'a>> { if let Some((ins, outs)) = line.split('|').collect_tuple() { let inputs = ins.split_whitespace().collect_vec(); let outputs = outs.split_whitespace().collect_vec(); // validate input and output strings contain only characters a-g let valid_chars = Regex::new(r"^[a-g]+$").unwrap(); // static, valid regex. won't panic. for input in &inputs { if !valid_chars.is_match(input) { println!( "Input Error: Invalid character found in input string {}", input ); return None; } } for output in &outputs { if !valid_chars.is_match(output) { println!( "Input Error: Invalid character found in output string {}", output ); return None; } } Some(Puzzle { inputs, outputs }) } else { println!( "Input Error: Puzzle string lacks a pipe separator:\n{}", line ); None } } fn solve(&self) -> Option<usize> { let ssd = sevensegdecoder::SevenSegDecoder::new(&self.inputs); // attempt to translate all given output codes... let digits: Vec<Option<u8>> = self.outputs.iter().map(|d| ssd.decode(d)).collect(); // if any failed to decode, fail the entire puzzle if digits.iter().any(|d| d.is_none()) { println!("Input Error: At least one given output failed to decode"); println!(" Decoder was {:?}", ssd); println!(" Output codes were {:?}", self.outputs); None } else { // unwrap will not panic because we already checked for None Some( digits .iter() .fold(0, |acc, &dig| acc * 10 + dig.unwrap() as usize), ) } } } fn main() { let args: Vec<String> = env::args().collect(); // This program takes one required parameter: the name of a file containing input let Some(input_file) = &args.get(1) else { println!("Hey! An argument is required."); println!("Usage: {} input.txt",&args[0]); std::process::exit(1); }; let mut fh = File::open(input_file).expect("Could not open the input file"); let mut contents = String::new(); fh.read_to_string(&mut contents) .expect("Could not read the input file"); // The filter_map's cause these loops to ignore any invalid puzzles. Diagnostics are produced elsewhere. let puzzles = contents.lines().filter_map(Puzzle::new); let total: usize = puzzles.filter_map(|puz| puz.solve()).sum(); println!("{} total", total); }
32.45
109
0.521418
afe06c5256ce9107ec28e681e6b23f6a57519410
10,689
py
Python
db_toolkit/tests/test_mongoDb.py
ib-da-ncirl/db_toolkit
a93069889a0e6834775b22291cd528111c05ad2c
[ "MIT" ]
null
null
null
db_toolkit/tests/test_mongoDb.py
ib-da-ncirl/db_toolkit
a93069889a0e6834775b22291cd528111c05ad2c
[ "MIT" ]
null
null
null
db_toolkit/tests/test_mongoDb.py
ib-da-ncirl/db_toolkit
a93069889a0e6834775b22291cd528111c05ad2c
[ "MIT" ]
1
2019-12-05T19:12:05.000Z
2019-12-05T19:12:05.000Z
# The MIT License (MIT) # Copyright (c) 2019 Ian Buttimer # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. import unittest from unittest import TestCase from mongo.MongoDb import MongoDb from io import ( StringIO, SEEK_SET ) from testfixtures import ( LogCapture, StringComparison ) import os # indices of argument keys in MongoDb.KEYS server_idx = 0 user_idx = 1 password_idx = 2 port_idx = 3 dbname_idx = 4 collection_idx = 5 auth_src_idx = 6 ssl_idx = 7 replica_set_idx = 8 max_idle_time_ms_idx = 9 app_name_idx = 10 retry_writes_idx = 11 # argument which may be used for testing config file syntax, but are not real # need to be same order as MongoDb.KEYS values = ( 'myserver', 'username', 'verysecret', '28000', 'mydatabase', 'mycollection', 'myauthsrc', 'true', 'myreplicaset', '1000', 'myappname', 'false' ) class TestMongoDb(TestCase): """ MongoDb tests Note: a valid configuration file is required for some of the tests Specify the path to the file in the environment variable MONGO_CFG. """ def test_load_cfg_file(self): # check less than min constructor arguments self.assertRaises(ValueError, MongoDb) for svr in [None, values[server_idx]]: for usr in [None, values[user_idx]]: for passwd in [None, values[password_idx]]: for port in [None, values[port_idx]]: for db in [None, values[dbname_idx]]: for auth in [None, values[auth_src_idx]]: for coll in [None, values[collection_idx]]: if svr is None: self.assertRaises(ValueError, MongoDb, server=svr, username=usr, password=passwd, port=port, dbname=db, auth_source=auth, collection=coll, test=True) else: obj = MongoDb(server=svr, username=usr, password=passwd, port=port, dbname=db, auth_source=auth, collection=coll, test=True) self.assertIsNotNone(obj) # valid config file str_io = StringIO() str_io.write(' # this is a comment\n') for idx in list(range(len(MongoDb.KEYS))): str_io.write(f'{MongoDb.KEYS[idx]}= {values[idx]}\n') str_io.seek(0, SEEK_SET) db = MongoDb(server='fake server', test=True) # test missing config file handle self.assertRaises(ValueError, db._load_cfg_file, None) # test valid config file handle db._load_cfg_file(str_io) for idx in list(range(len(MongoDb.KEYS))): self.assertEqual(db[MongoDb.KEYS[idx]], values[idx]) # valid invalid port & timeout for test_key in ['port', 'max_idle_time_ms']: str_io.truncate(0) str_io.seek(0, SEEK_SET) for idx in list(range(len(MongoDb.KEYS))): if MongoDb.KEYS[idx] == test_key: str_io.write(f'{MongoDb.KEYS[idx]}= notaninteger\n') else: str_io.write(f'{MongoDb.KEYS[idx]}= {values[idx]}\n') db._load_cfg_file(str_io) self.assertRaises(ValueError, db.make_db_link) str_io.truncate(0) str_io.seek(0, SEEK_SET) for idx in list(range(len(MongoDb.KEYS))): if MongoDb.KEYS[idx] == test_key: str_io.write(f'{MongoDb.KEYS[idx]}= {values[idx]}\n') else: str_io.write(f'{MongoDb.KEYS[idx]}= 10.2\n') db._load_cfg_file(str_io) self.assertRaises(ValueError, db.make_db_link) # valid invalid ssl for test_key in ['ssl', 'retry_writes']: str_io.truncate(0) str_io.seek(0, SEEK_SET) for idx in list(range(len(MongoDb.KEYS))): if MongoDb.KEYS[idx] == test_key: str_io.write(f'{MongoDb.KEYS[idx]}= notaboolean\n') else: str_io.write(f'{MongoDb.KEYS[idx]}= {values[idx]}\n') db._load_cfg_file(str_io) self.assertRaises(ValueError, db.make_db_link) # test missing value str_io.truncate(0) str_io.seek(0, SEEK_SET) str_io.write(f'username= \n') self.assertRaises(ValueError, db._load_cfg_file, str_io) # test missing key str_io.truncate(0) str_io.seek(0, SEEK_SET) str_io.write(f'= value\n') self.assertRaises(ValueError, db._load_cfg_file, str_io) # invalid separator str_io.truncate(0) str_io.seek(0, SEEK_SET) str_io.write(f'user: value\n') self.assertRaises(ValueError, db._load_cfg_file, str_io) # unknown key/value str_io.truncate(0) str_io.seek(0, SEEK_SET) str_io.write(f'unknown_key= value\n') with LogCapture() as log_cap: db._load_cfg_file(str_io) log_cap.check( ('root', 'INFO', 'Ignoring unknown entry on line 1'), ) str_io.close() # test invalid config file path self.assertRaises(ValueError, MongoDb, cfg_filename='doesnotexist') # test invalid config file argument type self.assertRaises(ValueError, MongoDb, cfg_filename=['i am a list']) def get_test_database(self): """ Get the test database Note: a valid configuration file is required. Specify the path to the file in the environment variable MONGO_CFG. """ cfg_filename = os.environ.get('MONGO_CFG') if cfg_filename is None: self.fail('Configuration file not set. ' 'Please specify path to configuration file as environment variable MONGO_CFG') return MongoDb(cfg_filename=cfg_filename) def test_make_db_link(self): """ Run a unit test on the db connection string """ # test server only server = values[server_idx] db = MongoDb(server=server, test=True) link = db.make_db_link() self.assertEqual(f'mongodb://{server}', link) # test username, password & server username = values[user_idx] password = values[password_idx] db.username = username db.password = password link = db.make_db_link() self.assertEqual(f'mongodb://{username}:{password}@{server}', link) # test username, password, server & port port = values[port_idx] db.port = port link = db.make_db_link() self.assertEqual(f'mongodb://{username}:{password}@{server}:{port}', link) # test username, password, server, port & database dbname = values[dbname_idx] db.dbname = dbname link = db.make_db_link() self.assertEqual(f'mongodb://{username}:{password}@{server}:{port}', link) # test query arguments expected = f'mongodb://{username}:{password}@{server}:{port}/?' for idx in range(auth_src_idx, app_name_idx + 1): db[MongoDb.KEYS[idx]] = values[idx] if idx > auth_src_idx: expected += f'&' q_idx = MongoDb.QUERY_KEYS.index(MongoDb.KEYS[idx]) expected += f'{MongoDb.QUERY_KEY_NAMES[q_idx]}={values[idx]}' link = db.make_db_link() self.assertEqual(expected, link) # clear query args for idx in range(auth_src_idx, app_name_idx + 1): db[MongoDb.KEYS[idx]] = None # test percent encoded username db.username = 'fun@ny:user/name%' encoded_username = 'fun%40ny%3Auser%2Fname%25' link = db.make_db_link() self.assertEqual(f'mongodb://{encoded_username}:{password}@{server}:{port}', link) # test percent encoded password db.password = '@:/%' encoded_password = '%40%3A%2F%25' link = db.make_db_link() self.assertEqual(f'mongodb://{encoded_username}:{encoded_password}@{server}:{port}', link) def test_connection(self): """ Run a unit test on the connection method Note: a valid configuration file is required. Specify the path to the file in the environment variable MONGO_CFG. """ client = self.get_test_database() valid_cfg = client.get_configuration() # test valid config self.assertTrue(client.is_connected()) connection = client.get_connection() self.assertIsNotNone(connection) self.assertTrue(client.is_connected()) client.close_connection() self.assertFalse(client.is_connected()) real_password = client.password client.password = 'incorrect' connection = client.get_connection() self.assertFalse(client.is_authenticated()) client.close_connection() client.password = real_password connection = client.get_connection() self.assertIsNotNone(connection) self.assertTrue(client.is_connected()) db = client.get_database() self.assertIsNotNone(db) collection = client.get_collection() self.assertIsNotNone(collection) result = collection.insert_one({'hi': 'this is a test'}) self.assertIsNotNone(result) self.assertIsNotNone(result.inserted_id) client.close_connection() if __name__ == '__main__': unittest.main()
36.986159
118
0.605389
52426591bec6f18ac8169caf660e20a1efcf12c6
19,598
sql
SQL
BDatos/celulares.sql
Guilegar/celulares
9b61efe7c45de9d3c25540bcf5c25df46518b925
[ "MIT" ]
null
null
null
BDatos/celulares.sql
Guilegar/celulares
9b61efe7c45de9d3c25540bcf5c25df46518b925
[ "MIT" ]
5
2021-03-10T02:40:16.000Z
2022-02-26T21:36:58.000Z
BDatos/celulares.sql
Guilegar/celulares
9b61efe7c45de9d3c25540bcf5c25df46518b925
[ "MIT" ]
null
null
null
-- phpMyAdmin SQL Dump -- version 4.9.2 -- https://www.phpmyadmin.net/ -- -- Servidor: 127.0.0.1 -- Tiempo de generación: 21-12-2019 a las 20:29:47 -- Versión del servidor: 10.4.10-MariaDB -- Versión de PHP: 7.3.12 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8mb4 */; -- -- Base de datos: `celulares` -- CREATE DATABASE IF NOT EXISTS `celulares` DEFAULT CHARACTER SET utf8 COLLATE utf8_spanish2_ci; USE `celulares`; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `accion` -- DROP TABLE IF EXISTS `accion`; CREATE TABLE `accion` ( `acc_cod` int(1) NOT NULL, `acc_nom` varchar(10) COLLATE utf8_spanish2_ci NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish2_ci; -- -- Volcado de datos para la tabla `accion` -- INSERT INTO `accion` (`acc_cod`, `acc_nom`, `created_at`, `updated_at`) VALUES (1, 'Entrada', '2019-12-18 13:27:45', '2019-12-18 13:27:45'), (2, 'Salida', '2019-12-18 13:27:45', '2019-12-18 13:27:45'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `asesores` -- DROP TABLE IF EXISTS `asesores`; CREATE TABLE `asesores` ( `ase_cod` int(10) NOT NULL, `ase_id` varchar(20) COLLATE utf8_spanish2_ci NOT NULL, `ase_nom` varchar(50) COLLATE utf8_spanish2_ci NOT NULL, `ase_dir` varchar(50) COLLATE utf8_spanish2_ci NOT NULL, `ase_tel` varchar(15) COLLATE utf8_spanish2_ci NOT NULL, `est_cod` int(2) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish2_ci; -- -- Volcado de datos para la tabla `asesores` -- INSERT INTO `asesores` (`ase_cod`, `ase_id`, `ase_nom`, `ase_dir`, `ase_tel`, `est_cod`, `created_at`, `updated_at`) VALUES (1, '16987654', 'Juan Tamaris', 'Carrera 5 # 45-87', '310568972', 1, '2019-12-16 21:54:42', '2019-12-16 21:54:42'), (2, '31658977', 'Andrea Serna', 'Avenida 4 n # 32-34', '3138974569', 1, '2019-12-16 21:54:42', '2019-12-16 21:54:42'), (3, '16985302', 'Mauricio Vasquez', 'Calle 103 # 21-34', '55555', 2, '2019-12-16 21:54:42', '2019-12-21 02:02:02'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `dispositivos` -- DROP TABLE IF EXISTS `dispositivos`; CREATE TABLE `dispositivos` ( `dis_cod` int(10) NOT NULL, `imei` varchar(20) COLLATE utf8_spanish2_ci NOT NULL, `imei2` varchar(20) COLLATE utf8_spanish2_ci DEFAULT NULL, `color` varchar(30) COLLATE utf8_spanish2_ci NOT NULL, `prod_cod` int(10) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish2_ci; -- -- Volcado de datos para la tabla `dispositivos` -- INSERT INTO `dispositivos` (`dis_cod`, `imei`, `imei2`, `color`, `prod_cod`, `created_at`, `updated_at`) VALUES (1, '123698574589635', '159874563258635', 'Blanco', 1, '2019-12-17 22:53:26', '2019-12-17 22:53:26'), (2, '65123695689955', '965877456935695', 'Negro', 1, '2019-12-17 22:53:26', '2019-12-17 22:53:26'), (3, '9685236578541256', '698574853695563', 'Rosa', 2, '2019-12-17 22:53:26', '2019-12-17 22:53:26'), (4, '986587459985334', '4569874589635452', 'Blanco', 3, '2019-12-17 22:53:26', '2019-12-17 22:53:26'), (5, '985886689635', '15987456688635', 'Blanco', 4, '2019-12-17 22:53:26', '2019-12-17 22:53:26'), (6, '222222222222222', '111111111111111', 'Dorado', 1, '2019-12-17 22:53:26', '2019-12-17 22:53:26'), (7, '888888888888888', NULL, 'Plata', 3, '2019-12-17 22:53:26', '2019-12-17 22:53:26'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `estados` -- DROP TABLE IF EXISTS `estados`; CREATE TABLE `estados` ( `est_cod` int(2) NOT NULL, `est_desc` varchar(20) COLLATE utf8_spanish2_ci NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish2_ci; -- -- Volcado de datos para la tabla `estados` -- INSERT INTO `estados` (`est_cod`, `est_desc`, `created_at`, `updated_at`) VALUES (1, 'Activo', '2019-12-13 18:30:17', '2019-12-13 18:30:17'), (2, 'Inactivo', '2019-12-13 18:30:18', '2019-12-13 18:30:18'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `failed_jobs` -- DROP TABLE IF EXISTS `failed_jobs`; CREATE TABLE `failed_jobs` ( `id` bigint(20) UNSIGNED NOT NULL, `connection` text COLLATE utf8mb4_unicode_ci NOT NULL, `queue` text COLLATE utf8mb4_unicode_ci NOT NULL, `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL, `failed_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `locales` -- DROP TABLE IF EXISTS `locales`; CREATE TABLE `locales` ( `local_cod` int(10) NOT NULL, `local_nom` varchar(50) COLLATE utf8_spanish2_ci NOT NULL, `local_dir` varchar(50) COLLATE utf8_spanish2_ci NOT NULL, `local_tel` varchar(15) COLLATE utf8_spanish2_ci NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish2_ci; -- -- Volcado de datos para la tabla `locales` -- INSERT INTO `locales` (`local_cod`, `local_nom`, `local_dir`, `local_tel`, `created_at`, `updated_at`) VALUES (1, 'Centro', 'carrera 6 # 3-25', '311598855', '2019-12-13 18:34:02', '2019-12-16 09:43:48'), (2, 'sur', 'calle 5 # 44-25', '314987632', '2019-12-13 18:34:02', '2019-12-13 18:34:02'), (3, 'norte', 'Avenida 6 # 23-88', '306898462', '2019-12-13 18:34:02', '2019-12-13 18:34:02'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `migrations` -- DROP TABLE IF EXISTS `migrations`; CREATE TABLE `migrations` ( `id` int(10) UNSIGNED NOT NULL, `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `batch` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Volcado de datos para la tabla `migrations` -- INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (1, '2014_10_12_000000_create_users_table', 1), (2, '2014_10_12_100000_create_password_resets_table', 1), (3, '2019_08_19_000000_create_failed_jobs_table', 1); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `movimientos` -- DROP TABLE IF EXISTS `movimientos`; CREATE TABLE `movimientos` ( `movi_cod` int(10) NOT NULL, `dis_cod` int(10) NOT NULL, `fecha` date NOT NULL, `acc_cod` int(1) NOT NULL, `local_cod` int(10) NOT NULL, `ase_cod` int(10) NOT NULL, `obs_mov` varchar(50) COLLATE utf8_spanish2_ci NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish2_ci; -- -- Volcado de datos para la tabla `movimientos` -- INSERT INTO `movimientos` (`movi_cod`, `dis_cod`, `fecha`, `acc_cod`, `local_cod`, `ase_cod`, `obs_mov`, `created_at`, `updated_at`) VALUES (1, 1, '2019-12-21', 1, 3, 3, 'ee', '2019-12-21 18:11:01', '2019-12-21 18:11:01'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `password_resets` -- DROP TABLE IF EXISTS `password_resets`; CREATE TABLE `password_resets` ( `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `token` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `created_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `productos` -- DROP TABLE IF EXISTS `productos`; CREATE TABLE `productos` ( `prod_cod` int(10) NOT NULL, `prod_nom` varchar(20) COLLATE utf8_spanish2_ci NOT NULL, `prod_desc` varchar(50) COLLATE utf8_spanish2_ci NOT NULL, `prod_valor` int(10) NOT NULL, `stock` int(10) NOT NULL, `prov_cod` int(10) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish2_ci; -- -- Volcado de datos para la tabla `productos` -- INSERT INTO `productos` (`prod_cod`, `prod_nom`, `prod_desc`, `prod_valor`, `stock`, `prov_cod`, `created_at`, `updated_at`) VALUES (1, 'Samsung A20', 'Samsung A20 4GbRam', 750000, 10, 1, '2019-12-16 16:04:31', '2019-12-16 16:04:31'), (2, 'Samsung A20', 'Samsung A20 16GbRam', 1250000, 5, 2, '2019-12-16 16:04:31', '2019-12-16 16:04:31'), (3, 'Mototola M2', 'Moto GH10 4GbRam', 700000, 20, 5, '2019-12-16 16:04:32', '2019-12-16 16:04:32'), (4, 'Xiaomi X20', 'X20 32GbRam', 1500000, 3, 2, '2019-12-16 16:04:32', '2019-12-16 16:04:32'), (6, 'Asus AT10', 'Asus At 32GB', 9500000, 10, 1, '2019-12-21 09:58:48', '2019-12-21 09:58:48'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `proveedores` -- DROP TABLE IF EXISTS `proveedores`; CREATE TABLE `proveedores` ( `prov_cod` int(10) NOT NULL, `prov_id` varchar(20) COLLATE utf8_spanish2_ci NOT NULL, `prov_nom` varchar(50) COLLATE utf8_spanish2_ci NOT NULL, `prov_dir` varchar(50) COLLATE utf8_spanish2_ci NOT NULL, `prov_tel` varchar(15) COLLATE utf8_spanish2_ci NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish2_ci; -- -- Volcado de datos para la tabla `proveedores` -- INSERT INTO `proveedores` (`prov_cod`, `prov_id`, `prov_nom`, `prov_dir`, `prov_tel`, `created_at`, `updated_at`) VALUES (1, '890635489', 'Tecnicelular', 'Cll 5 # 13-15', '032698745', '2019-12-16 04:01:40', '2019-12-17 01:37:17'), (2, '890632452', 'Worldcelular', 'Cll 78 # 15-15', '315986741', '2019-12-16 04:01:41', '2019-12-17 01:37:36'), (5, '16583541', 'Andres Lopez Gomez', 'Calle 8 # 65-89', '311896325', '2019-12-16 10:05:56', '2019-12-17 01:36:52'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `roles` -- DROP TABLE IF EXISTS `roles`; CREATE TABLE `roles` ( `rol_cod` int(2) NOT NULL, `rol_desc` varchar(20) COLLATE utf8_spanish2_ci NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish2_ci; -- -- Volcado de datos para la tabla `roles` -- INSERT INTO `roles` (`rol_cod`, `rol_desc`, `created_at`, `updated_at`) VALUES (1, 'administrador', '2019-12-13 18:28:21', '2019-12-13 18:28:21'), (2, 'agente', '2019-12-13 18:29:07', '2019-12-13 18:29:07'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `rol_x_usu` -- DROP TABLE IF EXISTS `rol_x_usu`; CREATE TABLE `rol_x_usu` ( `rxu_id` int(10) NOT NULL, `usu_cod` int(10) NOT NULL, `rol_cod` int(2) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish2_ci; -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `users` -- DROP TABLE IF EXISTS `users`; CREATE TABLE `users` ( `id` bigint(20) UNSIGNED NOT NULL, `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `email_verified_at` timestamp NULL DEFAULT NULL, `api_token` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `password` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `remember_token` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `created_at` timestamp NULL DEFAULT NULL, `updated_at` timestamp NULL DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- Volcado de datos para la tabla `users` -- INSERT INTO `users` (`id`, `name`, `email`, `email_verified_at`, `api_token`, `password`, `remember_token`, `created_at`, `updated_at`) VALUES (1, 'Guilegar Mambuscay', 'mambuscay_og@hotmail.com', NULL, NULL, '$2y$10$MyKMrZNx2jQpX95UEZsnjOoybdZQV2AG2M04tTp99hAIuncojpGia', NULL, '2019-12-21 20:30:53', '2019-12-21 20:30:53'); -- -------------------------------------------------------- -- -- Estructura de tabla para la tabla `usuarios` -- DROP TABLE IF EXISTS `usuarios`; CREATE TABLE `usuarios` ( `usu_cod` int(10) NOT NULL, `usu_id` varchar(20) COLLATE utf8_spanish2_ci NOT NULL, `usu_nom` varchar(50) COLLATE utf8_spanish2_ci NOT NULL, `usu_alias` varchar(10) COLLATE utf8_spanish2_ci NOT NULL, `usu_dir` varchar(50) COLLATE utf8_spanish2_ci NOT NULL, `usu_tel` varchar(15) COLLATE utf8_spanish2_ci NOT NULL, `est_cod` int(2) NOT NULL, `created_at` timestamp NOT NULL DEFAULT current_timestamp(), `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_spanish2_ci; -- -- Volcado de datos para la tabla `usuarios` -- INSERT INTO `usuarios` (`usu_cod`, `usu_id`, `usu_nom`, `usu_alias`, `usu_dir`, `usu_tel`, `est_cod`, `created_at`, `updated_at`) VALUES (1, '6136933', 'Guille', 'Guille', 'dvsd', '43434', 1, '2019-12-18 19:15:09', '2019-12-18 19:15:09'); -- -- Índices para tablas volcadas -- -- -- Indices de la tabla `accion` -- ALTER TABLE `accion` ADD PRIMARY KEY (`acc_cod`); -- -- Indices de la tabla `asesores` -- ALTER TABLE `asesores` ADD PRIMARY KEY (`ase_cod`), ADD KEY `fk_estase` (`est_cod`); -- -- Indices de la tabla `dispositivos` -- ALTER TABLE `dispositivos` ADD PRIMARY KEY (`dis_cod`), ADD KEY `fk_deprod` (`prod_cod`); -- -- Indices de la tabla `estados` -- ALTER TABLE `estados` ADD PRIMARY KEY (`est_cod`); -- -- Indices de la tabla `failed_jobs` -- ALTER TABLE `failed_jobs` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `locales` -- ALTER TABLE `locales` ADD PRIMARY KEY (`local_cod`); -- -- Indices de la tabla `migrations` -- ALTER TABLE `migrations` ADD PRIMARY KEY (`id`); -- -- Indices de la tabla `movimientos` -- ALTER TABLE `movimientos` ADD PRIMARY KEY (`movi_cod`), ADD KEY `fk_acc` (`acc_cod`), ADD KEY `fk_mov_dis` (`dis_cod`), ADD KEY `fk_mov_ase` (`ase_cod`), ADD KEY `fk_mov_loc` (`local_cod`); -- -- Indices de la tabla `password_resets` -- ALTER TABLE `password_resets` ADD KEY `password_resets_email_index` (`email`); -- -- Indices de la tabla `productos` -- ALTER TABLE `productos` ADD PRIMARY KEY (`prod_cod`), ADD KEY `fk_prov_cod` (`prov_cod`); -- -- Indices de la tabla `proveedores` -- ALTER TABLE `proveedores` ADD PRIMARY KEY (`prov_cod`); -- -- Indices de la tabla `roles` -- ALTER TABLE `roles` ADD PRIMARY KEY (`rol_cod`); -- -- Indices de la tabla `rol_x_usu` -- ALTER TABLE `rol_x_usu` ADD PRIMARY KEY (`rxu_id`), ADD KEY `fk_rxu_usu` (`usu_cod`), ADD KEY `fk_rxu_rol` (`rol_cod`); -- -- Indices de la tabla `users` -- ALTER TABLE `users` ADD PRIMARY KEY (`id`), ADD UNIQUE KEY `users_email_unique` (`email`), ADD UNIQUE KEY `users_api_token_unique` (`api_token`); -- -- Indices de la tabla `usuarios` -- ALTER TABLE `usuarios` ADD PRIMARY KEY (`usu_cod`), ADD KEY `fk_estusu` (`est_cod`); -- -- AUTO_INCREMENT de las tablas volcadas -- -- -- AUTO_INCREMENT de la tabla `accion` -- ALTER TABLE `accion` MODIFY `acc_cod` int(1) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT de la tabla `asesores` -- ALTER TABLE `asesores` MODIFY `ase_cod` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5; -- -- AUTO_INCREMENT de la tabla `dispositivos` -- ALTER TABLE `dispositivos` MODIFY `dis_cod` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9; -- -- AUTO_INCREMENT de la tabla `estados` -- ALTER TABLE `estados` MODIFY `est_cod` int(2) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT de la tabla `failed_jobs` -- ALTER TABLE `failed_jobs` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `locales` -- ALTER TABLE `locales` MODIFY `local_cod` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT de la tabla `migrations` -- ALTER TABLE `migrations` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4; -- -- AUTO_INCREMENT de la tabla `movimientos` -- ALTER TABLE `movimientos` MODIFY `movi_cod` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT de la tabla `productos` -- ALTER TABLE `productos` MODIFY `prod_cod` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7; -- -- AUTO_INCREMENT de la tabla `proveedores` -- ALTER TABLE `proveedores` MODIFY `prov_cod` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6; -- -- AUTO_INCREMENT de la tabla `roles` -- ALTER TABLE `roles` MODIFY `rol_cod` int(2) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3; -- -- AUTO_INCREMENT de la tabla `rol_x_usu` -- ALTER TABLE `rol_x_usu` MODIFY `rxu_id` int(10) NOT NULL AUTO_INCREMENT; -- -- AUTO_INCREMENT de la tabla `users` -- ALTER TABLE `users` MODIFY `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- AUTO_INCREMENT de la tabla `usuarios` -- ALTER TABLE `usuarios` MODIFY `usu_cod` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2; -- -- Restricciones para tablas volcadas -- -- -- Filtros para la tabla `asesores` -- ALTER TABLE `asesores` ADD CONSTRAINT `fk_estase` FOREIGN KEY (`est_cod`) REFERENCES `estados` (`est_cod`); -- -- Filtros para la tabla `dispositivos` -- ALTER TABLE `dispositivos` ADD CONSTRAINT `fk_deprod` FOREIGN KEY (`prod_cod`) REFERENCES `productos` (`prod_cod`); -- -- Filtros para la tabla `movimientos` -- ALTER TABLE `movimientos` ADD CONSTRAINT `fk_acc` FOREIGN KEY (`acc_cod`) REFERENCES `accion` (`acc_cod`), ADD CONSTRAINT `fk_mov_ase` FOREIGN KEY (`ase_cod`) REFERENCES `asesores` (`ase_cod`), ADD CONSTRAINT `fk_mov_dis` FOREIGN KEY (`dis_cod`) REFERENCES `dispositivos` (`dis_cod`), ADD CONSTRAINT `fk_mov_loc` FOREIGN KEY (`local_cod`) REFERENCES `locales` (`local_cod`); -- -- Filtros para la tabla `productos` -- ALTER TABLE `productos` ADD CONSTRAINT `fk_prov_cod` FOREIGN KEY (`prov_cod`) REFERENCES `proveedores` (`prov_cod`); -- -- Filtros para la tabla `rol_x_usu` -- ALTER TABLE `rol_x_usu` ADD CONSTRAINT `fk_rxu_rol` FOREIGN KEY (`rol_cod`) REFERENCES `roles` (`rol_cod`), ADD CONSTRAINT `fk_rxu_usu` FOREIGN KEY (`usu_cod`) REFERENCES `usuarios` (`usu_cod`); -- -- Filtros para la tabla `usuarios` -- ALTER TABLE `usuarios` ADD CONSTRAINT `fk_estusu` FOREIGN KEY (`est_cod`) REFERENCES `estados` (`est_cod`); COMMIT; /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
31.814935
182
0.67813
f1b8f08248701437f6b5801097623e6deb843bcd
1,834
rb
Ruby
test/unit/test_skein_client_worker.rb
postageapp/skein
d43078105351e8f5af8abfc3ea1024a02c5d688e
[ "MIT" ]
1
2018-10-23T16:29:36.000Z
2018-10-23T16:29:36.000Z
test/unit/test_skein_client_worker.rb
postageapp/skein
d43078105351e8f5af8abfc3ea1024a02c5d688e
[ "MIT" ]
9
2016-12-07T22:11:20.000Z
2021-09-14T10:49:00.000Z
test/unit/test_skein_client_worker.rb
postageapp/skein
d43078105351e8f5af8abfc3ea1024a02c5d688e
[ "MIT" ]
null
null
null
require_relative '../helper' class TestSkeinClientWorker < Test::Unit::TestCase class ErrorGenerator < Skein::Client::Worker class CustomError < RuntimeError end def raises_error raise CustomError, 'Example error!' end end def test_example worker = ErrorGenerator.new('test_rpc') handler = worker.send(:handler) message = { method: 'ident', params: [ ], id: '43d8352c-4907-4c32-9c81-fc34e91a3884' } metrics = worker.send(:metrics_tracker) state = worker.send(:state_tracker) handler.handle(JSON.dump(message), metrics, state) do |response_json, error| response = JSON.load(response_json) expected = { 'jsonrpc' => '2.0', 'result' => worker.ident, 'id' => message[:id] } assert_equal(expected, response) end ensure worker and worker.close(delete_queue: true) end def test_throws_exception worker = ErrorGenerator.new('test_error') handler = Skein::Handler.for(worker) message = { method: 'raises_error', id: '29fe8a40-fccf-43c6-ba48-818598c66e6f' } metrics = worker.send(:metrics_tracker) state = worker.send(:state_tracker) handler.handle(JSON.dump(message), metrics, state) do |response_json, error| expected = { 'jsonrpc' => '2.0', 'error' => { 'code' => -32063, 'message' => '[TestSkeinClientWorker::ErrorGenerator::CustomError] Example error!' }, 'id' => message[:id] } assert_equal(expected.to_json, response_json) assert_equal(1, metrics[:failed]) assert_equal(1, metrics[:errors][:exception]) assert(metrics[:time] >= 0, 'Time (%.3f) should be positive' % metrics[:time]) end ensure worker and worker.close(delete_queue: true) end end
24.453333
92
0.628135
e74b0805854e44e9de4e66c56be7d8127bb89a64
703
php
PHP
application/controllers/Testimoni.php
kamiltopan20/olshop
5e658a9b83ba0a86dadbd47201ad1fc806215690
[ "MIT" ]
null
null
null
application/controllers/Testimoni.php
kamiltopan20/olshop
5e658a9b83ba0a86dadbd47201ad1fc806215690
[ "MIT" ]
null
null
null
application/controllers/Testimoni.php
kamiltopan20/olshop
5e658a9b83ba0a86dadbd47201ad1fc806215690
[ "MIT" ]
null
null
null
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Testimoni extends CI_Controller { public function __construct(){ parent::__construct(); $this->load->model("Categories_model"); $this->load->model("Testi_model"); } public function index(){ $data['title'] = 'Testimoni - ' . $this->Settings_model->general()["app_name"]; $data['css'] = 'products'; $data['responsive'] = 'product-responsive'; $data['testi'] = $this->Testi_model->getTesti(); $this->load->view('templates/header', $data); $this->load->view('templates/navbar'); $this->load->view('page/testi', $data); $this->load->view('templates/footerv2'); } }
29.291667
83
0.625889
af2c2b68c6a8904eed1a6cead6f73d51ca72a15f
501
py
Python
examples/api/profile/update_profile.py
javad94/instauto
8d4d068863176b0a1df13e5be3d5e32388036921
[ "MIT" ]
79
2020-08-24T23:32:57.000Z
2022-02-20T19:03:17.000Z
examples/api/profile/update_profile.py
klaytonpaiva/instauto
7f8c26b22f84d3d966625c7fa656e91cc623bb2e
[ "MIT" ]
146
2020-07-25T16:27:48.000Z
2021-10-02T09:03:50.000Z
examples/api/profile/update_profile.py
klaytonpaiva/instauto
7f8c26b22f84d3d966625c7fa656e91cc623bb2e
[ "MIT" ]
41
2020-09-07T14:19:04.000Z
2022-02-07T23:08:10.000Z
from instauto.api.client import ApiClient import instauto.api.actions.structs.profile as pr from instauto.api.structs import WhichGender client = ApiClient.initiate_from_file('.instauto.save') # With the update object, you can update multiple attributes at the same time, but you # can also just set one property. obj = pr.Update( "https://github.com/stanvanrooy/instauto", "your phone number", "your new username", "your new first name", "your new email" ) client.profile_update(obj)
29.470588
86
0.758483
0d8462d2681f5f6a872e120a6f08deec4baa2a77
5,842
ru
Ruby
systems/2013/english-russian/newstest2013.en-ru.MES-QCRI:.2848/abces_2012_12_01_239729.newstest2013.en-ru.MES-QCRI:.2848.ru
fredblain/docQE-corp
6c03de96252f128e257cbbac633756e5280da0e6
[ "BSD-3-Clause" ]
null
null
null
systems/2013/english-russian/newstest2013.en-ru.MES-QCRI:.2848/abces_2012_12_01_239729.newstest2013.en-ru.MES-QCRI:.2848.ru
fredblain/docQE-corp
6c03de96252f128e257cbbac633756e5280da0e6
[ "BSD-3-Clause" ]
null
null
null
systems/2013/english-russian/newstest2013.en-ru.MES-QCRI:.2848/abces_2012_12_01_239729.newstest2013.en-ru.MES-QCRI:.2848.ru
fredblain/docQE-corp
6c03de96252f128e257cbbac633756e5280da0e6
[ "BSD-3-Clause" ]
null
null
null
"Валентино предпочитает элегантность известность" По случаю "Валентино: Master of couture", выставка, что на этой неделе был открыт в Лондоне, ABC беседует с нать абаскал, Фиона Тиссен-Валенсии и других итальянского дизайнера знаменитых клиентов. Отель Somerset House, бывший дом королевы Елизаветы I в Англии, - это единственное место в британской столице достоин Valentino Гаравани выставки. Во время инаугурации "Валентино: Master of couture", дизайнер признал ретроспективный апофеоз, который объединяет более 130 Couture платья, созданные его дома моды за последние 50 лет. "я люблю этот дворец", - говорит он, - в его безошибочное итальянским акцентом. Эта выставка является кульминацией которого только главный герой "имени" Гаравани, хотя она не могла не были написаны без его клиентов. Валентино всегда был очарован и далеком мире знати. В первый зал выставки, открытой до 3 марта, существует большое количество частных писем и фотографий подписанного сливки аристократии, от принцессы Салима Ага Хана, лорд Сноудон, принцесса Мари-Chantal Греции Маргарет Англии. Валентино экспонаты эти личные воспоминания, как если бы они были трофеи своего социального восхождения от скромной кутюрье в voghera, Северной Италии, идол международного Jet-set. Нет ничего плохого в том, что любящие роялти. - по крайней мере, они не заканчивается сигарет на ковер, как некоторые красивые звезды поп-музыки, - говорит баронесса Тиссен-Валенсии. В 60-х и 70-х, мы оба жили в Альпах и были хорошими друзьями. Валентино, чья щедрость и элегантность. "мы все любили его шале в", - говорит "Хайни" Тиссен экс-жена, близкий друг забытых красавицы, такие как марелла Аньелли и Евгения Ниархос. Валентино всегда предпочитал элегантность известность. И, тем не менее, он - звезда. Валерия Мацца, Валентино. Аргентинская модель Валерия Мацца также напоминает о кутюрье харизмы. Много лет назад, после Fashion Show в Пьяцца ди Спанья в Риме, мы пошли на ужин в его квартире. Там было двадцать из нас, в том числе Шэрон Стоун и Джон Кеннеди мл. Вы могли видеть и чувствовать его "дух" в каждую деталь в квартире и его декор, продукты питания и музыку. "все гости были сделаны чувствовать себя нужным и любил" вспоминает топ-модель, которая начала работать с ним в течение недели haute couture Парижа, в 1995 году. "его произведений искусства, и поэтому никогда не выходят из моды", заключает она. Дворянство парад Гаравани 's life is not a Story of одержимость, но также взбунтовались любви. Он любит образованных людей, которые приходят из хорошие фоны, и они любят его. Один из Сомерсет дом превратился в гламурной, шестьдесят ноги длинные подиум, который предлагает определенную роль: посетители занять место моделей и придется маршировать по сцене, в то время как looking at a Dream "аудитория" Валентино шедевров, например, платье Жаклин Кеннеди выбрали для своей свадьбы с Аристотеля Онассиса, костюм Моника vitti носил в "la notte" и шерсти и кожаные пальто, принадлежавшие императрице Фарах Диба. В этой толпе манекены, имена выделиться, таких как Сибилла Люксембурга, Глория von thurn und такси, Норвегии Метте-Марит Норвегии, Rosario Болгарии и Софии Габсбургов. Нать абаскал и дизайнер, в 2006 г. Многие из этих клиентов говорят, что ваш первый Валентино похожа ваша первая любовь ", невозможно забыть". Я помню, как это прекрасно. Это была пара брюки, рубашку, "gilet" спасательный жилет, куртку с 1971-1972 осенне-зимняя коллекция. "это был подарок, он дал мне", - говорит нать абаскал, один из дизайнера музы. "я предпочитаю его на другие дизайнеры из-за своей женственности, его великую любовь женщин, а потому, что он улучшает нашу красоты" добавили бывший герцогини FERIA. Я люблю цвета он использует, они действительно выделяются и "дай взаймы себя" на вашем лице. Их пропорции идеальны. Принцесса и моды советник Патриция della джовампаола d 'arenberg также вспоминает первый раз она носила Валентино. Будучи подростком, живущих в Италии, я мечтал о достижении возраста, когда я бы возможность носить одну из своих вечерних платьев... Мое время наконец-то пришла в конце 90-х. Я купил свой первый Валентино платье носить на вечеринке в замке, принадлежащие к мой двоюродный брат, принц Edouard de ligne. Это было красное платье, с фрилли юбку, сотканный "корсажем" и без бретелек декольте. "это была мечта сбылась", говорит, что принцесса d 'arenberg, вдова Родриго d 'arenberg. "Валентино безразличен к моде, его одержимость - вечные", - говорит этот итальянский аристократ, который живет в Париже, Нью-Йорке и Буэнос-Айреса. Принцесса d 'arenberg выглядит после ее кутюрье платья с "тщательностью... потому что платье не только платье, это также много воспоминаний, которые идут с ней". "король" моды "Grand Finale" Сомерсет дом выставочный Мари-Chantal Миллера свадебное платье от ее брак с Павлом Греции в 1995 году. Потребовалось четыре месяца работы и 25 "девочек" (как дизайнер называет его жатой), чтобы создать Перл-накипи, Кот-д 'шелковое платье с двенадцати различных типов кружевами и четырех с половиной метров. По словам журналиста Сьюзи menkes, ведущий специалист по прессе, что платье представляет собой высокой моды вехой конца XX века, "the return of high society клиентов". Но на протяжении многих лет с "savoir-кtre" элиты, Валентино сейчас своих лучших защитника. Cavaliere di Gran Кроче (самый высокий рейтинг различия в Италии), Cavaliere del Lavoro, командер de l 'ordre des Arts et des lettres, и присудил легион чести, Гаравани накапливается столько же, как и любой из его клиентов мужьям. "я всегда был поражен его изысканным и спокойной манере, и его аккуратно и внешний вид" признает d 'arenberg. Последний раз, когда я видел его был месяц назад на гала-ужин в музее Орсе. Он был на столе графини Жаклин de what a friend of mine. "он был опрятный, Time stands still для него". Если принцесса говорит о том, что...
104.321429
432
0.805033
2cd0a5a2921bf137a93200689ec6ee945b6a5417
5,573
cpp
C++
tools/test/systemtest/aa/aa_command_start_system_test.cpp
openharmony-gitee-mirror/aafwk_standard
59761a67f4ebc5ea4c3282cd1262bd4a2b66faa7
[ "Apache-2.0" ]
null
null
null
tools/test/systemtest/aa/aa_command_start_system_test.cpp
openharmony-gitee-mirror/aafwk_standard
59761a67f4ebc5ea4c3282cd1262bd4a2b66faa7
[ "Apache-2.0" ]
null
null
null
tools/test/systemtest/aa/aa_command_start_system_test.cpp
openharmony-gitee-mirror/aafwk_standard
59761a67f4ebc5ea4c3282cd1262bd4a2b66faa7
[ "Apache-2.0" ]
1
2021-09-13T11:17:48.000Z
2021-09-13T11:17:48.000Z
/* * Copyright (c) 2021 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <gtest/gtest.h> #include <thread> #include "ability_command.h" #include "ability_manager_client.h" #include "ability_manager_interface.h" #include "bundle_command.h" #include "tool_system_test.h" using namespace testing::ext; using namespace OHOS; using namespace OHOS::AAFwk; using namespace OHOS::AppExecFwk; namespace { const std::string STRING_DEVICE_NAME = "device"; const std::string STRING_PAGE_ABILITY_BUNDLE_PATH = "/data/test/resource/aa/pageAbilityBundleForStart.hap"; const std::string STRING_PAGE_ABILITY_BUNDLE_NAME = "com.ohos.tools.pageAbilityBundleForStart"; const std::string STRING_PAGE_ABILITY_BUNDLE_NAME_INVALID = STRING_PAGE_ABILITY_BUNDLE_NAME + ".invalid"; const std::string STRING_PAGE_ABILITY_NAME = "com.ohos.tools.pageAbilityForStart.MainAbility"; const std::string STRING_PAGE_ABILITY_NAME_INVALID = STRING_PAGE_ABILITY_NAME + ".Invalid"; const std::string STRING_SERVICE_ABILITY_BUNDLE_PATH = "/data/test/resource/aa/serviceAbilityBundleForStart.hap"; const std::string STRING_SERVICE_ABILITY_BUNDLE_NAME = "com.ohos.tools.serviceAbilityBundleForStart"; const std::string STRING_SERVICE_ABILITY_BUNDLE_NAME_INVALID = STRING_SERVICE_ABILITY_BUNDLE_NAME + ".invalid"; const std::string STRING_SERVICE_ABILITY_NAME = "MainAbility"; const std::string STRING_SERVICE_ABILITY_NAME_INVALID = STRING_SERVICE_ABILITY_NAME + ".Invalid"; } // namespace class AaCommandStartSystemTest : public ::testing::Test { public: static void SetUpTestCase(); static void TearDownTestCase(); void SetUp() override; void TearDown() override; }; void AaCommandStartSystemTest::SetUpTestCase() {} void AaCommandStartSystemTest::TearDownTestCase() {} void AaCommandStartSystemTest::SetUp() { // reset optind to 0 optind = 0; } void AaCommandStartSystemTest::TearDown() {} /** * @tc.number: Aa_Command_Start_SystemTest_0100 * @tc.name: ExecCommand * @tc.desc: Verify the "aa start -d <device-id> -a <ability-name> -b <bundle-name> -D" command. */ HWTEST_F(AaCommandStartSystemTest, Aa_Command_Start_SystemTest_0100, Function | MediumTest | Level1) { // uninstall the bundle ToolSystemTest::UninstallBundle(STRING_PAGE_ABILITY_BUNDLE_NAME); // install the bundle ToolSystemTest::InstallBundle(STRING_PAGE_ABILITY_BUNDLE_PATH, true); // start the page ability std::string command = "aa start -d " + STRING_DEVICE_NAME + " -a " + STRING_PAGE_ABILITY_NAME + " -b " + STRING_PAGE_ABILITY_BUNDLE_NAME + " -D"; std::string commandResult = ToolSystemTest::ExecuteCommand(command); EXPECT_EQ(commandResult, STRING_START_ABILITY_OK + "\n"); // uninstall the bundle ToolSystemTest::UninstallBundle(STRING_PAGE_ABILITY_BUNDLE_NAME); } /** * @tc.number: Aa_Command_Start_SystemTest_0200 * @tc.name: ExecCommand * @tc.desc: Verify the "aa start -d <device-id> -a <ability-name> -b <bundle-name>" command. */ HWTEST_F(AaCommandStartSystemTest, Aa_Command_Start_SystemTest_0200, Function | MediumTest | Level1) { // uninstall the bundle ToolSystemTest::UninstallBundle(STRING_SERVICE_ABILITY_BUNDLE_NAME); // install the bundle ToolSystemTest::InstallBundle(STRING_SERVICE_ABILITY_BUNDLE_PATH, true); // start the service ability std::string command = "aa start -d " + STRING_DEVICE_NAME + " -a " + STRING_SERVICE_ABILITY_NAME + " -b " + STRING_SERVICE_ABILITY_BUNDLE_NAME; std::string commandResult = ToolSystemTest::ExecuteCommand(command); EXPECT_EQ(commandResult, STRING_START_ABILITY_OK + "\n"); // uninstall the bundle ToolSystemTest::UninstallBundle(STRING_SERVICE_ABILITY_BUNDLE_NAME); } /** * @tc.number: Aa_Command_Start_SystemTest_0300 * @tc.name: ExecCommand * @tc.desc: Verify the "aa start -d <device-id> -a <ability-name> -b <bundle-name>" command. */ HWTEST_F(AaCommandStartSystemTest, Aa_Command_Start_SystemTest_0300, Function | MediumTest | Level1) { // start the invalid page ability std::string command = "aa start -d " + STRING_DEVICE_NAME + " -a " + STRING_PAGE_ABILITY_NAME_INVALID + " -b " + STRING_PAGE_ABILITY_BUNDLE_NAME_INVALID; std::string commandResult = ToolSystemTest::ExecuteCommand(command); EXPECT_EQ(commandResult, STRING_START_ABILITY_NG + "\n"); } /** * @tc.number: Aa_Command_Start_SystemTest_0400 * @tc.name: ExecCommand * @tc.desc: Verify the "aa start -d <device-id> -a <ability-name> -b <bundle-name>" command. */ HWTEST_F(AaCommandStartSystemTest, Aa_Command_Start_SystemTest_0400, Function | MediumTest | Level1) { // start the invalid service ability std::string command = "aa start -d " + STRING_DEVICE_NAME + " -a " + STRING_SERVICE_ABILITY_NAME_INVALID + " -b " + STRING_SERVICE_ABILITY_BUNDLE_NAME_INVALID; std::string commandResult = ToolSystemTest::ExecuteCommand(command); EXPECT_EQ(commandResult, STRING_START_ABILITY_NG + "\n"); }
38.171233
119
0.746636
0a78df1f354b3a7535129722a92ee6910c5ecc62
9,024
cs
C#
src/DotNetOpenAuth/OpenId/Extensions/ExtensionArgumentsManager.cs
slluis/dotnetopenid
7e959b5c555e81c875b43cdf0d82c13437c437f3
[ "MS-PL" ]
null
null
null
src/DotNetOpenAuth/OpenId/Extensions/ExtensionArgumentsManager.cs
slluis/dotnetopenid
7e959b5c555e81c875b43cdf0d82c13437c437f3
[ "MS-PL" ]
null
null
null
src/DotNetOpenAuth/OpenId/Extensions/ExtensionArgumentsManager.cs
slluis/dotnetopenid
7e959b5c555e81c875b43cdf0d82c13437c437f3
[ "MS-PL" ]
2
2019-01-08T07:15:44.000Z
2019-07-12T17:31:15.000Z
//----------------------------------------------------------------------- // <copyright file="ExtensionArgumentsManager.cs" company="Andrew Arnott"> // Copyright (c) Andrew Arnott. All rights reserved. // </copyright> //----------------------------------------------------------------------- namespace DotNetOpenAuth.OpenId.Extensions { using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Globalization; using System.Text; using DotNetOpenAuth.Messaging; /// <summary> /// Manages the processing and construction of OpenID extensions parts. /// </summary> internal class ExtensionArgumentsManager { /// <summary> /// This contains a set of aliases that we must be willing to implicitly /// match to namespaces for backward compatibility with other OpenID libraries. /// </summary> private static readonly Dictionary<string, string> typeUriToAliasAffinity = new Dictionary<string, string> { { Extensions.SimpleRegistration.Constants.sreg_ns, Extensions.SimpleRegistration.Constants.sreg_compatibility_alias }, { Extensions.ProviderAuthenticationPolicy.Constants.TypeUri, Extensions.ProviderAuthenticationPolicy.Constants.CompatibilityAlias }, }; /// <summary> /// The version of OpenID that the message is using. /// </summary> private Protocol protocol; /// <summary> /// Whether extensions are being read or written. /// </summary> private bool isReadMode; /// <summary> /// The alias manager that will track Type URI to alias mappings. /// </summary> private AliasManager aliasManager = new AliasManager(); /// <summary> /// A complex dictionary where the key is the Type URI of the extension, /// and the value is another dictionary of the name/value args of the extension. /// </summary> private Dictionary<string, IDictionary<string, string>> extensions = new Dictionary<string, IDictionary<string, string>>(); /// <summary> /// Prevents a default instance of the <see cref="ExtensionArgumentsManager"/> class from being created. /// </summary> private ExtensionArgumentsManager() { } /// <summary> /// Gets a value indicating whether the extensions are being read (as opposed to written). /// </summary> internal bool ReadMode { get { return this.isReadMode; } } /// <summary> /// Creates a <see cref="ExtensionArgumentsManager"/> instance to process incoming extensions. /// </summary> /// <param name="query">The parameters in the OpenID message.</param> /// <returns>The newly created instance of <see cref="ExtensionArgumentsManager"/>.</returns> public static ExtensionArgumentsManager CreateIncomingExtensions(IDictionary<string, string> query) { Contract.Requires<ArgumentNullException>(query != null); var mgr = new ExtensionArgumentsManager(); mgr.protocol = Protocol.Detect(query); mgr.isReadMode = true; string aliasPrefix = mgr.protocol.openid.ns + "."; // First pass looks for namespace aliases foreach (var pair in query) { if (pair.Key.StartsWith(aliasPrefix, StringComparison.Ordinal)) { mgr.aliasManager.SetAlias(pair.Key.Substring(aliasPrefix.Length), pair.Value); } } // For backwards compatibility, add certain aliases if they aren't defined. if (mgr.protocol.Version.Major < 2) { foreach (var pair in typeUriToAliasAffinity) { if (!mgr.aliasManager.IsAliasAssignedTo(pair.Key) && !mgr.aliasManager.IsAliasUsed(pair.Value)) { mgr.aliasManager.SetAlias(pair.Value, pair.Key); } } } // Second pass looks for extensions using those aliases foreach (var pair in query) { if (!pair.Key.StartsWith(mgr.protocol.openid.Prefix, StringComparison.Ordinal)) { continue; } string possibleAlias = pair.Key.Substring(mgr.protocol.openid.Prefix.Length); int periodIndex = possibleAlias.IndexOf(".", StringComparison.Ordinal); if (periodIndex >= 0) { possibleAlias = possibleAlias.Substring(0, periodIndex); } string typeUri; if ((typeUri = mgr.aliasManager.TryResolveAlias(possibleAlias)) != null) { if (!mgr.extensions.ContainsKey(typeUri)) { mgr.extensions[typeUri] = new Dictionary<string, string>(); } string key = periodIndex >= 0 ? pair.Key.Substring(mgr.protocol.openid.Prefix.Length + possibleAlias.Length + 1) : string.Empty; mgr.extensions[typeUri].Add(key, pair.Value); } } return mgr; } /// <summary> /// Creates a <see cref="ExtensionArgumentsManager"/> instance to prepare outgoing extensions. /// </summary> /// <param name="protocol">The protocol version used for the outgoing message.</param> /// <returns> /// The newly created instance of <see cref="ExtensionArgumentsManager"/>. /// </returns> public static ExtensionArgumentsManager CreateOutgoingExtensions(Protocol protocol) { var mgr = new ExtensionArgumentsManager(); mgr.protocol = protocol; // Affinity for certain alias for backwards compatibility foreach (var pair in typeUriToAliasAffinity) { mgr.aliasManager.SetAlias(pair.Value, pair.Key); } return mgr; } /// <summary> /// Adds query parameters for OpenID extensions to the request directed /// at the OpenID provider. /// </summary> /// <param name="extensionTypeUri">The extension type URI.</param> /// <param name="arguments">The arguments for this extension to add to the message.</param> public void AddExtensionArguments(string extensionTypeUri, IDictionary<string, string> arguments) { Contract.Requires<InvalidOperationException>(!this.ReadMode); Contract.Requires<ArgumentException>(!String.IsNullOrEmpty(extensionTypeUri)); Contract.Requires<ArgumentNullException>(arguments != null); if (arguments.Count == 0) { return; } IDictionary<string, string> extensionArgs; if (!this.extensions.TryGetValue(extensionTypeUri, out extensionArgs)) { this.extensions.Add(extensionTypeUri, extensionArgs = new Dictionary<string, string>(arguments.Count)); } ErrorUtilities.VerifyProtocol(extensionArgs.Count == 0, OpenIdStrings.ExtensionAlreadyAddedWithSameTypeURI, extensionTypeUri); foreach (var pair in arguments) { extensionArgs.Add(pair.Key, pair.Value); } } /// <summary> /// Gets the actual arguments to add to a querystring or other response, /// where type URI, alias, and actual key/values are all defined. /// </summary> /// <param name="includeOpenIdPrefix"> /// <c>true</c> if the generated parameter names should include the 'openid.' prefix. /// This should be <c>true</c> for all but direct response messages. /// </param> /// <returns>A dictionary of key=value pairs to add to the message to carry the extension.</returns> internal IDictionary<string, string> GetArgumentsToSend(bool includeOpenIdPrefix) { Contract.Requires<InvalidOperationException>(!this.ReadMode); Dictionary<string, string> args = new Dictionary<string, string>(); foreach (var typeUriAndExtension in this.extensions) { string typeUri = typeUriAndExtension.Key; var extensionArgs = typeUriAndExtension.Value; if (extensionArgs.Count == 0) { continue; } string alias = this.aliasManager.GetAlias(typeUri); // send out the alias declaration string openidPrefix = includeOpenIdPrefix ? this.protocol.openid.Prefix : string.Empty; args.Add(openidPrefix + this.protocol.openidnp.ns + "." + alias, typeUri); string prefix = openidPrefix + alias; foreach (var pair in extensionArgs) { string key = prefix; if (pair.Key.Length > 0) { key += "." + pair.Key; } args.Add(key, pair.Value); } } return args; } /// <summary> /// Gets the fields carried by a given OpenId extension. /// </summary> /// <param name="extensionTypeUri">The type URI of the extension whose fields are being queried for.</param> /// <returns> /// The fields included in the given extension, or null if the extension is not present. /// </returns> internal IDictionary<string, string> GetExtensionArguments(string extensionTypeUri) { Contract.Requires<ArgumentException>(!String.IsNullOrEmpty(extensionTypeUri)); Contract.Requires<InvalidOperationException>(this.ReadMode); IDictionary<string, string> extensionArgs; this.extensions.TryGetValue(extensionTypeUri, out extensionArgs); return extensionArgs; } /// <summary> /// Gets whether any arguments for a given extension are present. /// </summary> /// <param name="extensionTypeUri">The extension Type URI in question.</param> /// <returns><c>true</c> if this extension is present; <c>false</c> otherwise.</returns> internal bool ContainsExtension(string extensionTypeUri) { return this.extensions.ContainsKey(extensionTypeUri); } /// <summary> /// Gets the type URIs of all discovered extensions in the message. /// </summary> /// <returns>A sequence of the type URIs.</returns> internal IEnumerable<string> GetExtensionTypeUris() { return this.extensions.Keys; } } }
40.285714
135
0.704676
a97beb8b26bf17d429fa243d0e2e062264a1ffed
4,013
html
HTML
lists.whatwg.org/pipermail/implementors-whatwg.org/2008-April/000873.html
zcorpan/whatwg.org
3374e69f013e5939abc5f3fffaae50bb6eaf0bd3
[ "CC-BY-4.0" ]
1
2022-02-14T23:44:51.000Z
2022-02-14T23:44:51.000Z
lists.whatwg.org/pipermail/implementors-whatwg.org/2008-April/000873.html
Seanpm2001-Google/whatwg.org
33ad837c0dc53b68865f4a35ccdc1c68dc07fce6
[ "BSD-3-Clause" ]
1
2021-01-31T11:51:12.000Z
2021-01-31T11:51:12.000Z
lists.whatwg.org/pipermail/implementors-whatwg.org/2008-April/000873.html
Seanpm2001-Google/whatwg.org
33ad837c0dc53b68865f4a35ccdc1c68dc07fce6
[ "BSD-3-Clause" ]
null
null
null
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <TITLE> [imps] HTML5 and libxml2 </TITLE> <LINK REL="Index" HREF="index.html" > <LINK REL="made" HREF="mailto:implementors%40lists.whatwg.org?Subject=Re%3A%20%5Bimps%5D%20HTML5%20and%20libxml2&In-Reply-To=%3CAD30D796-F9D6-4774-AAC2-08CD333A192D%40iki.fi%3E"> <META NAME="robots" CONTENT="index,nofollow"> <style type="text/css"> pre { white-space: pre-wrap; /* css-2.1, curent FF, Opera, Safari */ } </style> <META http-equiv="Content-Type" content="text/html; charset=us-ascii"> <LINK REL="Previous" HREF="000887.html"> <LINK REL="Next" HREF="000528.html"> </HEAD> <BODY BGCOLOR="#ffffff"> <H1>[imps] HTML5 and libxml2</H1> <!--htdig_noindex--> <B>Henri Sivonen</B> <A HREF="mailto:implementors%40lists.whatwg.org?Subject=Re%3A%20%5Bimps%5D%20HTML5%20and%20libxml2&In-Reply-To=%3CAD30D796-F9D6-4774-AAC2-08CD333A192D%40iki.fi%3E" TITLE="[imps] HTML5 and libxml2">hsivonen at iki.fi </A><BR> <I>Sat Apr 5 01:10:40 PDT 2008</I> <P><UL> <LI>Previous message: <A HREF="000887.html">[imps] HTML5 and libxml2 </A></li> <LI>Next message: <A HREF="000528.html">[imps] HTML5 parser test location </A></li> <LI> <B>Messages sorted by:</B> <a href="date.html#873">[ date ]</a> <a href="thread.html#873">[ thread ]</a> <a href="subject.html#873">[ subject ]</a> <a href="author.html#873">[ author ]</a> </LI> </UL> <HR> <!--/htdig_noindex--> <!--beginarticle--> <PRE>On Apr 5, 2008, at 07:06, Edward Z. Yang wrote: &gt;<i> Unfortunately, certain tag names causes libxml2 to choke, and HTML5 </I>&gt;<i> doesn't specify any way to: </I>&gt;<i> </I>&gt;<i> 1. Munge the name into something libxml2 finds acceptable </I>&gt;<i> 2. Ignore the tag as invalid </I>&gt;<i> </I>&gt;<i> Without modifying the algorithms, (2) is not tenable, so I've been </I>&gt;<i> looking at (1). </I>[...] &gt;<i> So, in short, due to underlying library limitations I can't put </I>&gt;<i> arbitrary characters in a tag (which is what Firefox actually seems to </I>&gt;<i> do), and I don't know exactly what characters I need to get rid of. </I>&gt;<i> Advice? </I> In the Validator.nu HTML parser, I've solved this by having three available policies: public enum XmlViolationPolicy { /** * Conform to HTML 5, allow XML 1.0 to be violated. */ ALLOW, /** * Halt when something cannot be mapped to XML 1.0. */ FATAL, /** * Be non-conforming and alter the infoset to fit * XML 1.0 when something would otherwise not be * mappable to XML 1.0. */ ALTER_INFOSET } It seems like ALLOW isn't a possibility for libxml2. With ALTER_INFOSET, tag tokens that do not match Namespaces in XML 1.0 NCName are ignored in the tokenizer. This is non-conforming but works most of the time. (There are many more similar situations you can find by searching for ALTER_INFOSET in the source.) -- Henri Sivonen <A HREF="http://lists.whatwg.org/listinfo.cgi/implementors-whatwg.org">hsivonen at iki.fi</A> <A HREF="http://hsivonen.iki.fi/">http://hsivonen.iki.fi/</A> </PRE> <!--endarticle--> <!--htdig_noindex--> <HR> <P><UL> <!--threads--> <LI>Previous message: <A HREF="000887.html">[imps] HTML5 and libxml2 </A></li> <LI>Next message: <A HREF="000528.html">[imps] HTML5 parser test location </A></li> <LI> <B>Messages sorted by:</B> <a href="date.html#873">[ date ]</a> <a href="thread.html#873">[ thread ]</a> <a href="subject.html#873">[ subject ]</a> <a href="author.html#873">[ author ]</a> </LI> </UL> <hr> <a href="http://lists.whatwg.org/listinfo.cgi/implementors-whatwg.org">More information about the Implementors mailing list</a><br> <!--/htdig_noindex--> </body></html>
34.594828
181
0.622477
8054cc0f1d022510b1cca656de0d1d60d59c1ed9
634
sh
Shell
database/hbase/hbase-config.sh
FizzCorp/fizz-devops
f5c78622e155bf1254754c72bc6209aec4fa2144
[ "MIT" ]
null
null
null
database/hbase/hbase-config.sh
FizzCorp/fizz-devops
f5c78622e155bf1254754c72bc6209aec4fa2144
[ "MIT" ]
null
null
null
database/hbase/hbase-config.sh
FizzCorp/fizz-devops
f5c78622e155bf1254754c72bc6209aec4fa2144
[ "MIT" ]
null
null
null
#!/bin/bash crontab -l | { cat; echo "0 11 * * * sh /opt/hbase/automation-helper-scripts/hbase-log-deletion.sh"; }| crontab - sh /opt/hbase/init-fizz.sh echo "ran init" sh /opt/hbase/open_tsdb_setup.sh echo "ran open" mkdir /hbase_backup_scripts chmod 777 /hbase_backup_scripts mkdir /hbase_backup_scripts/logs/ chmod 777 /hbase_backup_scripts/logs/ crontab -l | { cat; echo "0 5 * * * sh /opt/hbase/backup_scripts/snapshot/hbase_snapshot.sh >> /hbase_backup_scripts/logs/hbase_backup.txt 2>&1"; echo "0 11 * * * sh /opt/hbase/automation-helper-scripts/hbase-log-deletion.sh"; }| crontab -
39.625
247
0.689274
b5025b462effb2c77e19284e174a0a432667f5e2
97
rb
Ruby
app/models/picdump.rb
b1nary/MayMay
353371b9e740b6ee055057b376fbf03353283ff4
[ "MIT" ]
1
2017-07-27T05:47:38.000Z
2017-07-27T05:47:38.000Z
app/models/picdump.rb
b1nary/MayMay
353371b9e740b6ee055057b376fbf03353283ff4
[ "MIT" ]
null
null
null
app/models/picdump.rb
b1nary/MayMay
353371b9e740b6ee055057b376fbf03353283ff4
[ "MIT" ]
null
null
null
class Picdump < ActiveRecord::Base belongs_to :picdump_category has_many :picdump_images end
19.4
34
0.814433
ed45de0ab880c6c53ac91ca4b935db0402ea610f
3,138
h
C
System/Library/Frameworks/AddressBookUI.framework/ABCountryPickerViewController.h
lechium/tvOS10Headers
f0c99993da6cc502d36fdc5cb4ff90d94b12bf67
[ "MIT" ]
4
2017-03-23T00:01:54.000Z
2018-08-04T20:16:32.000Z
System/Library/Frameworks/AddressBookUI.framework/ABCountryPickerViewController.h
lechium/tvOS10Headers
f0c99993da6cc502d36fdc5cb4ff90d94b12bf67
[ "MIT" ]
null
null
null
System/Library/Frameworks/AddressBookUI.framework/ABCountryPickerViewController.h
lechium/tvOS10Headers
f0c99993da6cc502d36fdc5cb4ff90d94b12bf67
[ "MIT" ]
4
2017-05-14T16:23:26.000Z
2019-12-21T15:07:59.000Z
/* * This header is generated by classdump-dyld 1.0 * on Wednesday, March 22, 2017 at 9:04:43 AM Mountain Standard Time * Operating System: Version 10.1 (Build 14U593) * Image Source: /System/Library/Frameworks/AddressBookUI.framework/AddressBookUI * classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. */ #import <AddressBookUI/AddressBookUI-Structs.h> #import <AddressBookUI/ABPickerViewController.h> #import <UIKit/UITableViewDelegate.h> #import <UIKit/UITableViewDataSource.h> #import <UIKit/UISearchDisplayDelegate.h> #import <UIKit/UISearchBarDelegate.h> @class UITableView, UILocalizedIndexedCollation, NSArray, NSDictionary, UISearchBar, UISearchDisplayController, NSString, NSIndexPath; @interface ABCountryPickerViewController : ABPickerViewController <UITableViewDelegate, UITableViewDataSource, UISearchDisplayDelegate, UISearchBarDelegate> { UITableView* _tableView; UILocalizedIndexedCollation* _collation; NSArray* _sections; NSArray* _sectionIndexTitles; NSDictionary* _indexToSections; UISearchBar* _searchBar; UISearchDisplayController* _searchController; NSArray* _filteredCountries; NSString* _selectedCountryCode; NSIndexPath* _selectedIndexPath; NSArray* _allCountries; } @property (nonatomic,retain) NSString * selectedCountryCode; @property (readonly) unsigned long long hash; @property (readonly) Class superclass; @property (copy,readonly) NSString * description; @property (copy,readonly) NSString * debugDescription; -(void)dealloc; -(id)init; -(void)tableView:(id)arg1 willDisplayCell:(id)arg2 forRowAtIndexPath:(id)arg3 ; -(double)tableView:(id)arg1 heightForHeaderInSection:(long long)arg2 ; -(id)tableView:(id)arg1 viewForHeaderInSection:(long long)arg2 ; -(id)tableView:(id)arg1 willSelectRowAtIndexPath:(id)arg2 ; -(void)tableView:(id)arg1 didSelectRowAtIndexPath:(id)arg2 ; -(long long)tableView:(id)arg1 numberOfRowsInSection:(long long)arg2 ; -(id)tableView:(id)arg1 cellForRowAtIndexPath:(id)arg2 ; -(long long)numberOfSectionsInTableView:(id)arg1 ; -(id)tableView:(id)arg1 titleForHeaderInSection:(long long)arg2 ; -(id)sectionIndexTitlesForTableView:(id)arg1 ; -(long long)tableView:(id)arg1 sectionForSectionIndexTitle:(id)arg2 atIndex:(long long)arg3 ; -(void)loadView; -(void)viewWillAppear:(BOOL)arg1 ; -(void)_getRotationContentSettings:(SCD_Struct_AB0*)arg1 ; -(void)searchBarTextDidBeginEditing:(id)arg1 ; -(void)searchBarSearchButtonClicked:(id)arg1 ; -(void)searchDisplayController:(id)arg1 willShowSearchResultsTableView:(id)arg2 ; -(void)searchDisplayController:(id)arg1 willHideSearchResultsTableView:(id)arg2 ; -(void)searchDisplayControllerWillBeginSearch:(id)arg1 ; -(void)searchDisplayControllerWillEndSearch:(id)arg1 ; -(BOOL)searchDisplayController:(id)arg1 shouldReloadTableForSearchString:(id)arg2 ; -(NSString *)selectedCountryCode; -(void)setSelectedCountryCode:(NSString *)arg1 ; -(void)setStyleProvider:(id)arg1 ; -(void)reloadCountryCodes; -(void)_setSelectedCountryCode:(id)arg1 atPath:(id)arg2 ; -(void)configureSections; -(void)scrollToSearchFieldAnimated:(BOOL)arg1 ; -(double)ab_heightToFitForViewInPopoverView; @end
43.583333
158
0.808795
6d55557776f284efb367047cc969484bb727ab7e
390
sql
SQL
backend/de.metas.adempiere.adempiere/migration/src/main/sql/postgresql/system/10-de.metas.adempiere/5571761_cli_gh10184_AD_WF_Process_WF_Initial_User_ID_migrate.sql
dram/metasfresh
a1b881a5b7df8b108d4c4ac03082b72c323873eb
[ "RSA-MD" ]
1,144
2016-02-14T10:29:35.000Z
2022-03-30T09:50:41.000Z
backend/de.metas.adempiere.adempiere/migration/src/main/sql/postgresql/system/10-de.metas.adempiere/5571761_cli_gh10184_AD_WF_Process_WF_Initial_User_ID_migrate.sql
vestigegroup/metasfresh
4b2d48c091fb2a73e6f186260a06c715f5e2fe96
[ "RSA-MD" ]
8,283
2016-04-28T17:41:34.000Z
2022-03-30T13:30:12.000Z
backend/de.metas.adempiere.adempiere/migration/src/main/sql/postgresql/system/10-de.metas.adempiere/5571761_cli_gh10184_AD_WF_Process_WF_Initial_User_ID_migrate.sql
vestigegroup/metasfresh
4b2d48c091fb2a73e6f186260a06c715f5e2fe96
[ "RSA-MD" ]
441
2016-04-29T08:06:07.000Z
2022-03-28T06:09:56.000Z
/* Note: on at least one legacy-DB there are ancient ad_wf_process records with not-more existing createdBy-AD_Users */ UPDATE ad_wf_process p SET wf_initial_user_id=u.ad_user_id FROM AD_User u WHERE TRUE and u.ad_user_ID=p.createdby and p.wf_initial_user_id IS NULL and u.ad_user_id is not null ; UPDATE ad_wf_process p SET wf_initial_user_id=99 WHERE p.wf_initial_user_id IS NULL ;
22.941176
113
0.810256
2cc654fb6957d8db35b50eecc06c707595640168
3,089
py
Python
_scripts/s2id.py
Son-Guhun/Titan-Land-Lands-of-Plenty
edeca1d5437a7397195799ebf4b9585ee4609fed
[ "MIT" ]
12
2019-05-27T16:02:28.000Z
2021-01-08T09:32:08.000Z
_scripts/s2id.py
Son-Guhun/Titan-Land-Lands-of-Plenty
edeca1d5437a7397195799ebf4b9585ee4609fed
[ "MIT" ]
209
2019-04-06T15:16:52.000Z
2021-07-03T02:11:53.000Z
_scripts/s2id.py
Son-Guhun/Titan-Land-Lands-of-Plenty
edeca1d5437a7397195799ebf4b9585ee4609fed
[ "MIT" ]
1
2021-05-26T12:13:35.000Z
2021-05-26T12:13:35.000Z
""" Used to work with FourCC's (four character codes) used by Warcraft III to identify objects. Provides a Rawcode class which inherits from str and can be added with integers. Examples: - Rawcode('H009') + 2 => Rawcode('H00B') # Considers only alphanumeric rawcodes. - Rawcode('hfoo').to_int() => 130701168 # Returns in-game value of rawcode. - Rawcode('Hart').match('abAB') => Rawcode('haRT') # Matches capitalization of another rawcode. - Rawcode('Hart').match('0000') => Rawcode('HART') # Numbers are considered uppercase. """ import string alphabet = '0123456789' + string.ascii_lowercase def base36encode(number, alphabet='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'): """Converts an integer to a base36 string.""" if not isinstance(number, (int)): raise TypeError('number must be an integer') base36 = '' sign = '' number %= RAWCODE_MAX if 0 <= number < len(alphabet): return sign + '000' + alphabet[number] while number != 0: number, i = divmod(number, len(alphabet)) base36 = alphabet[i] + base36 return sign + '0'*(4-len(base36)) + base36 def base36decode(number): return int(number, 36) RAWCODE_MAX = int('ZZZZ', 36) + 1 from weakref import WeakValueDictionary class Rawcode(str): _objects = WeakValueDictionary() _chars = set(alphabet + alphabet.upper()) def __new__(cls, object): r = super().__new__(cls, object) chars = cls._chars if r in cls._objects: return cls._objects[r] if len(r) != 4: raise ValueError("Rawcode string must be 4 characters long.") if not(r[0] in chars and r[1] in chars and r[2] in chars and r[3] in chars): raise ValueError("Rawcode string must be alphanumeric.") cls._objects[r] = r return r def __add__(self, n): return Rawcode(base36encode(base36decode(self)+n)) def __repr__(self): return "Rawcode('{}')".format(self) def to_int(self): return ord(self[0])*16777216 + ord(self[1])*65536 + ord(self[2])*256 + ord(self[3]) def match(self, other): r = ''.join([ self[0].lower() if other[0].islower() else self[0].upper(), self[1].lower() if other[1].islower() else self[1].upper(), self[2].lower() if other[2].islower() else self[2].upper(), self[3].lower() if other[3].islower() else self[3].upper() ]) return self if self == r else type(self)(r) def match_first(self, other): r = ''.join([ self[0].lower() if other[0].islower() else self[0].upper(), self[1],self[2],self[3] ]) return self if self == r else type(self)(r) # Declare RawcodeSafe class for compatability RawcodeSafe = Rawcode def rawcode_range(init, size): """Example: rawcode_range('H000',3) => yields 'H000','H001','H002' as Rawcodes""" if type('init') == str: init = Rawcode(init) for i in range(size): yield init init += 1
29.990291
102
0.600842
0d86ddb0a428c9bdf71f5c347016928fe65c463b
801
c
C
lib/liblfds7.2.0/src/liblfds720/src/lfds720_list_nodelete_singlylinked_unordered/lfds720_list_nsu_cleanup.c
sletz/fas
91d0bd9dcf0b90a6c07d18c571b9a0f2d0f70539
[ "BSD-2-Clause" ]
128
2017-01-14T23:57:56.000Z
2022-03-26T02:00:01.000Z
lib/liblfds7.2.0/src/liblfds720/src/lfds720_list_nodelete_singlylinked_unordered/lfds720_list_nsu_cleanup.c
sletz/fas
91d0bd9dcf0b90a6c07d18c571b9a0f2d0f70539
[ "BSD-2-Clause" ]
6
2017-01-17T00:46:22.000Z
2021-05-25T12:09:37.000Z
lib/liblfds7.2.0/src/liblfds720/src/lfds720_list_nodelete_singlylinked_unordered/lfds720_list_nsu_cleanup.c
sletz/fas
91d0bd9dcf0b90a6c07d18c571b9a0f2d0f70539
[ "BSD-2-Clause" ]
8
2017-04-10T21:12:08.000Z
2022-01-06T18:56:29.000Z
/***** includes *****/ #include "lfds720_list_nsu_internal.h" /****************************************************************************/ void lfds720_list_nsu_cleanup( struct lfds720_list_nsu_state *lasus, void (*element_cleanup_callback)(struct lfds720_list_nsu_state *lasus, struct lfds720_list_nsu_element *lasue) ) { struct lfds720_list_nsu_element *lasue, *temp; LFDS720_PAL_ASSERT( lasus != NULL ); // TRD : element_cleanup_callback can be NULL LFDS720_MISC_BARRIER_LOAD; if( element_cleanup_callback == NULL ) return; lasue = LFDS720_LIST_NSU_GET_START( *lasus ); while( lasue != NULL ) { temp = lasue; lasue = LFDS720_LIST_NSU_GET_NEXT( *lasue ); element_cleanup_callback( lasus, temp ); } return; }
21.078947
143
0.616729
c3ce745e072c06786eceeff27a8d43da8862b6ef
1,872
cs
C#
Translation/MessageFormatter.cs
JStalnac/DirtBot
25e3ae9a8322ac7749422a49462090202c67c902
[ "Apache-2.0" ]
1
2021-03-25T14:58:49.000Z
2021-03-25T14:58:49.000Z
Translation/MessageFormatter.cs
JStalnac/DirtBot
25e3ae9a8322ac7749422a49462090202c67c902
[ "Apache-2.0" ]
null
null
null
Translation/MessageFormatter.cs
JStalnac/DirtBot
25e3ae9a8322ac7749422a49462090202c67c902
[ "Apache-2.0" ]
1
2021-03-25T05:32:20.000Z
2021-03-25T05:32:20.000Z
using DirtBot.Logging; using Discord; using SmartFormat; using System; using System.Threading.Tasks; namespace DirtBot.Translation { /// <summary> /// Provides static methods for formatting messages. /// </summary> public static class MessageFormatter { private static Logger Log { get; } = Logger.GetLogger("Formatting"); /// <summary> /// Formats a message with provided arguments. Logs errors in the console. /// </summary> /// <param name="format"></param> /// <param name="args"></param> /// <returns></returns> public static string Format(string format, params object[] args) { if (String.IsNullOrEmpty(format?.Trim())) throw new ArgumentNullException(nameof(format)); try { return Smart.Format(format, args); } catch (Exception e) { Log.Warning("Failed to format message", e); return format; } } /// <summary> /// Sends a formatted message to the text channel. Logs errors in the console. /// </summary> /// <param name="channel">Text channel</param> /// <param name="format">Format</param> /// <param name="isTTS">Is the message Text To Speech</param> /// <param name="embed">Embed</param> /// <param name="args">Format arguments</param> /// <returns></returns> public static Task<IUserMessage> SendMessageFormatted(this IMessageChannel channel, string format, bool isTTS = false, Embed embed = null, params object[] args) { if (channel is null) throw new ArgumentNullException(nameof(channel)); return channel.SendMessageAsync(Format(format, args), isTTS, embed); } } }
34.036364
168
0.573718
1a32a1449b30ea76ad2929ea1e1aefc91037c77e
1,090
py
Python
hw4_RNN/utils.py
nikusaikou/lhy_ML2020
1f86e5850d910571e0a0fd6a342590059f54a84f
[ "WTFPL" ]
null
null
null
hw4_RNN/utils.py
nikusaikou/lhy_ML2020
1f86e5850d910571e0a0fd6a342590059f54a84f
[ "WTFPL" ]
null
null
null
hw4_RNN/utils.py
nikusaikou/lhy_ML2020
1f86e5850d910571e0a0fd6a342590059f54a84f
[ "WTFPL" ]
null
null
null
import torch import numpy as np import pandas as pd import torch.optim as optim import torch.nn.functional as F def load_training_data(path='./data/training_label.txt'): if 'training_label' in path: with open(path, 'r', encoding='UTF-8') as f: lines = f.readlines() lines = [line.strip('\n').split(' ') for line in lines] x = [line[2:] for line in lines] y = [line[0] for line in lines] return x, y else: with open(path, 'r', encoding='UTF-8') as f: lines = f.readlines() x = [line.strip('\n').split(' ') for line in lines] return x def load_testing_data(path='./data/testing_data.txt'): with open(path, 'r', encoding='UTF-8') as f: lines = f.readlines() X = ["".join(line.strip('\n').split(",")[1:]).strip() for line in lines[1:]] X = [sen.split(' ') for sen in X] return X def evaluation(outputs, labels): outputs[outputs >= 0.5] = 1 outputs[outputs < 0.5] = 0 correct = torch.sum(torch.eq(outputs, labels)).item() return correct
30.277778
84
0.579817
c8ff6f00b9dd3355dd1af5f4ce829e069a583c12
1,460
css
CSS
src/datetime.css
swjjxyxty/DateTimePicker
9622720a0cae787da0402ed9b4411bd32b1da164
[ "Apache-2.0" ]
28
2016-08-07T05:39:11.000Z
2020-09-30T08:58:59.000Z
src/datetime.css
swjjxyxty/DateTiemPicker
9622720a0cae787da0402ed9b4411bd32b1da164
[ "Apache-2.0" ]
2
2017-05-08T09:34:12.000Z
2017-10-01T10:28:45.000Z
src/datetime.css
swjjxyxty/DateTiemPicker
9622720a0cae787da0402ed9b4411bd32b1da164
[ "Apache-2.0" ]
11
2016-08-17T06:15:51.000Z
2020-12-23T09:43:54.000Z
* { padding: 0; margin: 0 } body { font-family: Helvetica Neue, Helvetica, Arial, sans-serif; color: #000; font-size: 14px; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; overflow-y: auto } .ui-datetime { width: 100%; background: #fff; } .ui-datetime .ui-datetime-item ul { list-style: none; margin: 0; padding: 0; text-align: center; min-height: 120px; width: 80px; overflow: hidden; } .ui-datetime .ui-datetime-item ul li { height: 40px; line-height: 40px; color: #898c90; font-size: 15px } .ui-datetime .ui-datetime-item ul li.selected { color: #292a2b; font-size: 17px } .ui-datetime .ui-datetime-line { top: 40% } .ui-datetime, .ui-load { width: 100% } .ui-datetime .ui-datetime-wrap { width: 100%; height: 120px; background: #fff; position: relative; text-align: center } .ui-datetime .ui-datetime-line, .ui-datetime-wrap .ui-datetime-line { height: 40px; border-top: 1px solid #D6DDE7; border-bottom: 1px solid #D6DDE7; width: 100%; position: absolute } .ui-datetime .ui-datetime-item { margin: 0; padding: 0 3%; display: inline-block; vertical-align: top; text-align: center; height: 120px; overflow: hidden }
18.024691
69
0.616438
70a0b19c79c670584410b9b73217d8cf9d179192
3,488
rs
Rust
src/y2020d07.rs
LLBlumire/advent-of-code
03597b3d3a55cc8aea774596ec2d02865b7d603c
[ "Unlicense" ]
2
2021-12-06T21:23:27.000Z
2021-12-15T09:17:30.000Z
src/y2020d07.rs
LLBlumire/advent-of-code
03597b3d3a55cc8aea774596ec2d02865b7d603c
[ "Unlicense" ]
null
null
null
src/y2020d07.rs
LLBlumire/advent-of-code
03597b3d3a55cc8aea774596ec2d02865b7d603c
[ "Unlicense" ]
null
null
null
use aoc::*; use std::collections::{HashMap, HashSet}; struct ParsedInput<'a> { policy: Policy<'a>, } struct Policy<'a> { rules: HashMap<Bag<'a>, Vec<(u32, Bag<'a>)>>, } #[derive(Copy, Clone, Eq, PartialEq, Hash)] struct Bag<'a> { property: &'a str, color: &'a str, } fn parse(input: &str) -> ParseResult<ParsedInput> { use nom::{ branch::alt, bytes::complete::tag, character::complete::{alpha1, char, line_ending, u32}, combinator::{map, value}, multi::separated_list1, sequence::{separated_pair, tuple}, }; let bag = |i| { map( separated_pair(alpha1, char(' '), alpha1), |(property, color)| Bag { property, color }, )(i) }; let numbag = separated_pair(u32, char(' '), bag); let baglist_sep = alt((tag(" bags, "), tag(" bag, "))); let nobag = value(vec![], tag("no other")); let baglist = alt((separated_list1(baglist_sep, numbag), nobag)); let rule_sep = tag(" bags contain "); let rule = separated_pair(bag, rule_sep, baglist); let rule_end = tuple((alt((tag(" bag."), tag(" bags."))), line_ending)); let policy = map(separated_list1(rule_end, rule), |rules| Policy { rules: rules.into_iter().collect(), }); let mut parsed = map(policy, |policy| ParsedInput { policy }); parsed(input) } fn bags_containing<'a>(policy: &Policy<'a>, contained_bag: Bag) -> HashSet<Bag<'a>> { policy .rules .iter() .fold(HashSet::new(), |mut bags, (&bag, contained_bags)| { if contained_bags .iter() .any(|&(_, search)| search == contained_bag) { bags.insert(bag); bags.extend(bags_containing(policy, bag).iter()); } bags }) } const SHINY_GOLD_BAG: Bag<'static> = Bag { property: "shiny", color: "gold", }; fn task1(input: &ParsedInput) -> Result<usize> { Ok(bags_containing(&input.policy, SHINY_GOLD_BAG).len()) } fn count_bags_contained(policy: &Policy, container_bag: Bag) -> u32 { policy .rules .get(&container_bag) .iter() .flat_map(|n| n.iter()) .map(|&(numof, bag)| (count_bags_contained(policy, bag) + 1) * numof) .sum() } fn task2(input: &ParsedInput) -> Result<u32> { Ok(count_bags_contained(&input.policy, SHINY_GOLD_BAG)) } #[test] fn test() { let input1 = " light red bags contain 1 bright white bag, 2 muted yellow bags. dark orange bags contain 3 bright white bags, 4 muted yellow bags. bright white bags contain 1 shiny gold bag. muted yellow bags contain 2 shiny gold bags, 9 faded blue bags. shiny gold bags contain 1 dark olive bag, 2 vibrant plum bags. dark olive bags contain 3 faded blue bags, 4 dotted black bags. vibrant plum bags contain 5 faded blue bags, 6 dotted black bags. faded blue bags contain no other bags. dotted black bags contain no other bags. " .trim(); assert_task!(parse, task1, input1, 4); assert_task!(parse, task2, input1, 32); let input2 = " shiny gold bags contain 2 dark red bags. dark red bags contain 2 dark orange bags. dark orange bags contain 2 dark yellow bags. dark yellow bags contain 2 dark green bags. dark green bags contain 2 dark blue bags. dark blue bags contain 2 dark violet bags. dark violet bags contain no other bags. " .trim(); assert_task!(parse, task2, input2, 126); } aoc_main!(parse, task1, task2);
30.068966
85
0.615252
4b6c557bfac6858f633efb7419bd279a58bc67f6
2,425
cpp
C++
Assignment2/report/src/main.cpp
Gripnook/numerical-methods
14cb60050e5f2ba413f59690beb24cacb1153563
[ "MIT" ]
1
2019-02-21T01:35:02.000Z
2019-02-21T01:35:02.000Z
Assignment2/src/main.cpp
Gripnook/numerical-methods
14cb60050e5f2ba413f59690beb24cacb1153563
[ "MIT" ]
null
null
null
Assignment2/src/main.cpp
Gripnook/numerical-methods
14cb60050e5f2ba413f59690beb24cacb1153563
[ "MIT" ]
null
null
null
#include <iostream> #include <iomanip> #include <algorithm> #include <numeric> #include <cmath> #include "matrix.h" #include "matrix-util.h" #include "solver.h" #include "finite-differences.h" #include "conjugate-gradient.h" using namespace Numeric; void question3(); void print(const Matrix<double>& nodes, const Matrix<double>& index); int main() { question3(); return 0; } void question3() { std::cout << "========== Question 3 ==========" << std::endl; double h = 0.02; Matrix<double> A, b, index; std::tie(A, b, index) = createGrid(h); std::cout << "Testing for Positive Definite" << std::endl; auto isPositiveDefinite = bcholesky(A); std::cout << " A is positive definite: " << std::boolalpha << isPositiveDefinite.second << std::endl; isPositiveDefinite = bcholesky(transpose(A) * A); std::cout << " A' A is positive definite: " << std::boolalpha << isPositiveDefinite.second << std::endl; std::cout << "Banded Cholesky Solver" << std::endl; auto bresult = bsolve(transpose(A) * A, transpose(A) * b); print(bresult, index); std::cout << "Conjugate Gradient Solver" << std::endl; std::cout << "iteration,2-norm,inf-norm" << std::endl; int iteration = 0; std::function<void(const Matrix<double>&)> callback = [&](const Matrix<double>& x) { auto r = b - A * x; auto twoNorm = std::sqrt( std::inner_product(r.begin(), r.end(), r.begin(), 0.0)); auto infNorm = std::abs( *std::max_element(r.begin(), r.end(), [](auto lhs, auto rhs) { return std::abs(lhs) < std::abs(rhs); })); std::cout << iteration++ << "," << twoNorm << "," << infNorm << std::endl; }; auto cgresult = cgsolve(transpose(A) * A, transpose(A) * b, callback); print(cgresult.first, index); } void print(const Matrix<double>& nodes, const Matrix<double>& index) { for (int j = index.rows() - 1; j >= 0; --j) { for (int i = 0; i < index.cols(); ++i) { if (index(i, j) > 0) { std::cout << std::setw(10) << nodes(index(i, j) - 1) << " "; } else { std::cout << std::setw(10) << std::abs(index(i, j)) << " "; } } std::cout << std::endl; } }
29.938272
78
0.525361
b14e74c091cf8c511c896cdcff881027be72d477
553
sql
SQL
benchmark/YaleLanguages/queries-vectorwise-disabled/26.sql
bogdanghita/public_bi_benchmark-master_project
86f4a67805fd3451fe8cf9fb8e2ed3bc9f83f06a
[ "MIT" ]
null
null
null
benchmark/YaleLanguages/queries-vectorwise-disabled/26.sql
bogdanghita/public_bi_benchmark-master_project
86f4a67805fd3451fe8cf9fb8e2ed3bc9f83f06a
[ "MIT" ]
null
null
null
benchmark/YaleLanguages/queries-vectorwise-disabled/26.sql
bogdanghita/public_bi_benchmark-master_project
86f4a67805fd3451fe8cf9fb8e2ed3bc9f83f06a
[ "MIT" ]
null
null
null
--SELECT "YaleLanguages_5"."Calculation_6550106154858816" AS "Calculation_6550106154858816", SUM(CAST("YaleLanguages_5"."Number of Records" AS BIGINT)) AS "sum:Number of Records:ok", TABLEAU.TO_DATETIME(DATE_TRUNC('YEAR', TABLEAU.NORMALIZE_DATETIME("YaleLanguages_5"."CHARGE_DATE")), "YaleLanguages_5"."CHARGE_DATE") AS "tyr:CHARGE_DATE:ok" FROM "YaleLanguages_5" WHERE ((TABLEAU.NORMALIZE_DATETIME("YaleLanguages_5"."CHARGE_DATE") >= cast('2001-01-01' as DATE)) AND ("YaleLanguages_5"."PATRON_TYPE (Pseudo vs Patron)" = 'Patron')) GROUP BY 1, 3;
276.5
552
0.766727
cda0acb47bd5f8da18b1ef5083a7313ebc07e6b8
137
cs
C#
SeudoBuild.Net.Tests/UdpDiscoveryServerTest.cs
mstevenson/UnityBuildServer
d64015a4e32c1c4e8c2baac3ac03627fde790df4
[ "MIT" ]
3
2016-11-03T03:36:32.000Z
2016-11-05T00:25:28.000Z
SeudoBuild.Net.Tests/UdpDiscoveryServerTest.cs
mstevenson/UnityBuildServer
d64015a4e32c1c4e8c2baac3ac03627fde790df4
[ "MIT" ]
null
null
null
SeudoBuild.Net.Tests/UdpDiscoveryServerTest.cs
mstevenson/UnityBuildServer
d64015a4e32c1c4e8c2baac3ac03627fde790df4
[ "MIT" ]
null
null
null
using NUnit.Framework; namespace SeudoBuild.Net.Tests { [TestFixture] public class UdpDiscoveryServerTest { } }
13.7
39
0.656934
749fbf53f100639fb3f7631d71d4dfdd34ed46fe
191
css
CSS
src/quill_modules/quill.table.css
jinkebj/HandyNote-Web
0e972b2c6a4b145e0d940b54ebe68aba07eb32b6
[ "MIT" ]
null
null
null
src/quill_modules/quill.table.css
jinkebj/HandyNote-Web
0e972b2c6a4b145e0d940b54ebe68aba07eb32b6
[ "MIT" ]
null
null
null
src/quill_modules/quill.table.css
jinkebj/HandyNote-Web
0e972b2c6a4b145e0d940b54ebe68aba07eb32b6
[ "MIT" ]
null
null
null
.ql-editor table { border-collapse: collapse; } .ql-editor table td { border: 1px solid black; padding: 5px; height: 25px; vertical-align: top; } .tdbr, .trbr { display: none }
12.733333
28
0.649215